@becket-ui/react 0.3.0 → 0.4.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/AspectRatio.d.ts +17 -0
- package/dist/components/AspectRatio.d.ts.map +1 -0
- package/dist/components/AspectRatio.js +12 -0
- package/dist/components/AspectRatio.js.map +1 -0
- package/dist/components/Avatar.d.ts +24 -0
- package/dist/components/Avatar.d.ts.map +1 -0
- package/dist/components/Avatar.js +30 -0
- package/dist/components/Avatar.js.map +1 -0
- package/dist/components/Blockquote.d.ts +18 -0
- package/dist/components/Blockquote.d.ts.map +1 -0
- package/dist/components/Blockquote.js +24 -0
- package/dist/components/Blockquote.js.map +1 -0
- package/dist/components/Center.d.ts +12 -0
- package/dist/components/Center.d.ts.map +1 -0
- package/dist/components/Center.js +14 -0
- package/dist/components/Center.js.map +1 -0
- package/dist/components/Code.d.ts +5 -0
- package/dist/components/Code.d.ts.map +1 -0
- package/dist/components/Code.js +12 -0
- package/dist/components/Code.js.map +1 -0
- package/dist/components/Figure.d.ts +11 -0
- package/dist/components/Figure.d.ts.map +1 -0
- package/dist/components/Figure.js +18 -0
- package/dist/components/Figure.js.map +1 -0
- package/dist/components/Grid.d.ts +29 -0
- package/dist/components/Grid.d.ts.map +1 -0
- package/dist/components/Grid.js +57 -0
- package/dist/components/Grid.js.map +1 -0
- package/dist/components/Image.d.ts +18 -0
- package/dist/components/Image.d.ts.map +1 -0
- package/dist/components/Image.js +23 -0
- package/dist/components/Image.js.map +1 -0
- package/dist/components/Kbd.d.ts +5 -0
- package/dist/components/Kbd.d.ts.map +1 -0
- package/dist/components/Kbd.js +12 -0
- package/dist/components/Kbd.js.map +1 -0
- package/dist/components/List.d.ts +19 -0
- package/dist/components/List.d.ts.map +1 -0
- package/dist/components/List.js +27 -0
- package/dist/components/List.js.map +1 -0
- package/dist/components/Mark.d.ts +5 -0
- package/dist/components/Mark.d.ts.map +1 -0
- package/dist/components/Mark.js +12 -0
- package/dist/components/Mark.js.map +1 -0
- package/dist/components/SkipLink.d.ts +8 -0
- package/dist/components/SkipLink.d.ts.map +1 -0
- package/dist/components/SkipLink.js +14 -0
- package/dist/components/SkipLink.js.map +1 -0
- package/dist/components/VisuallyHidden.d.ts +9 -0
- package/dist/components/VisuallyHidden.d.ts.map +1 -0
- package/dist/components/VisuallyHidden.js +14 -0
- package/dist/components/VisuallyHidden.js.map +1 -0
- package/dist/helpers/storybookImages.d.ts +3 -0
- package/dist/helpers/storybookImages.d.ts.map +1 -0
- package/dist/helpers/storybookImages.js +16 -0
- package/dist/helpers/storybookImages.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -1
- package/guides/building-with-becket.md +19 -4
- package/package.json +3 -3
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
type AspectRatioValue = '1:1' | '3:2' | '5:3' | '8:5' | '13:8' | '2:3' | '3:5' | '5:8' | '8:13' | '16:9' | '9:16';
|
|
3
|
+
export type AspectRatioProps = ComponentPropsWithoutRef<'div'> & {
|
|
4
|
+
/** Width to height. Default `'1:1'`. */
|
|
5
|
+
ratio?: AspectRatioValue;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Keeps one child (image, video, iframe, map) at a fixed ratio; the child fills the box.
|
|
9
|
+
* Ratios are Fibonacci pairs (`'3:2'`, `'8:5'`, `'13:8'` and their portrait flips) plus `'16:9'`
|
|
10
|
+
* and `'9:16'` for video. Default `'1:1'`.
|
|
11
|
+
*/
|
|
12
|
+
export declare const AspectRatio: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
13
|
+
/** Width to height. Default `'1:1'`. */
|
|
14
|
+
ratio?: AspectRatioValue;
|
|
15
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=AspectRatio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AspectRatio.d.ts","sourceRoot":"","sources":["../../src/components/AspectRatio.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAGlE,KAAK,gBAAgB,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAElH,MAAM,MAAM,gBAAgB,GAAG,wBAAwB,CAAC,KAAK,CAAC,GAAG;IAC/D,wCAAwC;IACxC,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAMF;;;;GAIG;AACH,eAAO,MAAM,WAAW;IAbtB,wCAAwC;YAChC,gBAAgB;kDAcxB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { aspectRatio as aspectRatioRecipe } from "@becket-ui/tokens/recipes";
|
|
4
|
+
function mergeClassName(...classes) {
|
|
5
|
+
return classes.filter(Boolean).join(" ");
|
|
6
|
+
}
|
|
7
|
+
const AspectRatio = forwardRef(({ ratio, className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, ...props, className: mergeClassName(aspectRatioRecipe({ ratio }), className) }));
|
|
8
|
+
AspectRatio.displayName = "AspectRatio";
|
|
9
|
+
export {
|
|
10
|
+
AspectRatio
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=AspectRatio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/AspectRatio.tsx"],"sourcesContent":["import { forwardRef, type ComponentPropsWithoutRef } from 'react';\nimport { aspectRatio as aspectRatioRecipe } from '@becket-ui/tokens/recipes';\n\ntype AspectRatioValue = '1:1' | '3:2' | '5:3' | '8:5' | '13:8' | '2:3' | '3:5' | '5:8' | '8:13' | '16:9' | '9:16';\n\nexport type AspectRatioProps = ComponentPropsWithoutRef<'div'> & {\n /** Width to height. Default `'1:1'`. */\n ratio?: AspectRatioValue;\n};\n\nfunction mergeClassName(...classes: (string | undefined)[]): string {\n return classes.filter(Boolean).join(' ');\n}\n\n/**\n * Keeps one child (image, video, iframe, map) at a fixed ratio; the child fills the box.\n * Ratios are Fibonacci pairs (`'3:2'`, `'8:5'`, `'13:8'` and their portrait flips) plus `'16:9'`\n * and `'9:16'` for video. Default `'1:1'`.\n */\nexport const AspectRatio = forwardRef<HTMLDivElement, AspectRatioProps>(({ ratio, className, ...props }, ref) => (\n <div ref={ref} {...props} className={mergeClassName(aspectRatioRecipe({ ratio }), className)} />\n));\n\nAspectRatio.displayName = 'AspectRatio';\n"],"mappings":"AAoBE;AApBF,SAAS,kBAAiD;AAC1D,SAAS,eAAe,yBAAyB;AASjD,SAAS,kBAAkB,SAAyC;AAClE,SAAO,QAAQ,OAAO,OAAO,EAAE,KAAK,GAAG;AACzC;AAOO,MAAM,cAAc,WAA6C,CAAC,EAAE,OAAO,WAAW,GAAG,MAAM,GAAG,QACvG,oBAAC,SAAI,KAAW,GAAG,OAAO,WAAW,eAAe,kBAAkB,EAAE,MAAM,CAAC,GAAG,SAAS,GAAG,CAC/F;AAED,YAAY,cAAc;","names":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
type AvatarSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
3
|
+
export type AvatarProps = Omit<ComponentPropsWithoutRef<'span'>, 'children'> & {
|
|
4
|
+
/** The person's name: the accessible name and the source of the initials. */
|
|
5
|
+
name: string;
|
|
6
|
+
/** Photo URL. Without it, or if it fails to load, the initials show. */
|
|
7
|
+
src?: string;
|
|
8
|
+
/** Fibonacci steps: 20, 32, 52 or 84px. Default `md`. */
|
|
9
|
+
size?: AvatarSize;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Photo or initials in a circle. Renders without JS; client JS only swaps to
|
|
13
|
+
* the initials when the photo fails to load.
|
|
14
|
+
*/
|
|
15
|
+
export declare const Avatar: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref">, "children"> & {
|
|
16
|
+
/** The person's name: the accessible name and the source of the initials. */
|
|
17
|
+
name: string;
|
|
18
|
+
/** Photo URL. Without it, or if it fails to load, the initials show. */
|
|
19
|
+
src?: string;
|
|
20
|
+
/** Fibonacci steps: 20, 32, 52 or 84px. Default `md`. */
|
|
21
|
+
size?: AvatarSize;
|
|
22
|
+
} & import("react").RefAttributes<HTMLSpanElement>>;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=Avatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../src/components/Avatar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAwB,KAAK,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAG5E,KAAK,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5C,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,GAAG;IAC7E,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,CAAC;AAcF;;;GAGG;AACH,eAAO,MAAM,MAAM;IAxBjB,6EAA6E;UACvE,MAAM;IACZ,wEAAwE;UAClE,MAAM;IACZ,yDAAyD;WAClD,UAAU;mDAqClB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef, useState } from "react";
|
|
4
|
+
import { avatar as avatarRecipe } from "@becket-ui/tokens/recipes";
|
|
5
|
+
function mergeClassName(...classes) {
|
|
6
|
+
return classes.filter(Boolean).join(" ");
|
|
7
|
+
}
|
|
8
|
+
function initialsOf(name) {
|
|
9
|
+
const words = name.trim().split(/\s+/).filter(Boolean);
|
|
10
|
+
if (words.length === 0) return "";
|
|
11
|
+
const first = words[0][0] ?? "";
|
|
12
|
+
const last = words.length > 1 ? words[words.length - 1][0] ?? "" : "";
|
|
13
|
+
return `${first}${last}`.toUpperCase();
|
|
14
|
+
}
|
|
15
|
+
const Avatar = forwardRef(
|
|
16
|
+
({ name, src, size = "md", className, ...props }, ref) => {
|
|
17
|
+
const [failedSrc, setFailedSrc] = useState(null);
|
|
18
|
+
const styles = avatarRecipe({ size });
|
|
19
|
+
const showImage = Boolean(src) && failedSrc !== src;
|
|
20
|
+
return /* @__PURE__ */ jsx("span", { ref, role: "img", "aria-label": name, ...props, className: mergeClassName(styles.root, className), children: showImage ? (
|
|
21
|
+
// The wrapper carries the name; the image itself is decorative.
|
|
22
|
+
/* @__PURE__ */ jsx("img", { src, alt: "", className: styles.image, onError: () => setFailedSrc(src ?? null) })
|
|
23
|
+
) : /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: styles.initials, children: initialsOf(name) }) });
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
Avatar.displayName = "Avatar";
|
|
27
|
+
export {
|
|
28
|
+
Avatar
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=Avatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Avatar.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, useState, type ComponentPropsWithoutRef } from 'react';\nimport { avatar as avatarRecipe } from '@becket-ui/tokens/recipes';\n\ntype AvatarSize = 'sm' | 'md' | 'lg' | 'xl';\n\nexport type AvatarProps = Omit<ComponentPropsWithoutRef<'span'>, 'children'> & {\n /** The person's name: the accessible name and the source of the initials. */\n name: string;\n /** Photo URL. Without it, or if it fails to load, the initials show. */\n src?: string;\n /** Fibonacci steps: 20, 32, 52 or 84px. Default `md`. */\n size?: AvatarSize;\n};\n\nfunction mergeClassName(...classes: (string | undefined)[]): string {\n return classes.filter(Boolean).join(' ');\n}\n\nfunction initialsOf(name: string): string {\n const words = name.trim().split(/\\s+/).filter(Boolean);\n if (words.length === 0) return '';\n const first = words[0][0] ?? '';\n const last = words.length > 1 ? (words[words.length - 1][0] ?? '') : '';\n return `${first}${last}`.toUpperCase();\n}\n\n/**\n * Photo or initials in a circle. Renders without JS; client JS only swaps to\n * the initials when the photo fails to load.\n */\nexport const Avatar = forwardRef<HTMLSpanElement, AvatarProps>(\n ({ name, src, size = 'md', className, ...props }, ref) => {\n const [failedSrc, setFailedSrc] = useState<string | null>(null);\n const styles = avatarRecipe({ size });\n const showImage = Boolean(src) && failedSrc !== src;\n return (\n <span ref={ref} role=\"img\" aria-label={name} {...props} className={mergeClassName(styles.root, className)}>\n {showImage ? (\n // The wrapper carries the name; the image itself is decorative.\n <img src={src} alt=\"\" className={styles.image} onError={() => setFailedSrc(src ?? null)} />\n ) : (\n <span aria-hidden=\"true\" className={styles.initials}>\n {initialsOf(name)}\n </span>\n )}\n </span>\n );\n },\n);\n\nAvatar.displayName = 'Avatar';\n"],"mappings":";AAyCU;AAvCV,SAAS,YAAY,gBAA+C;AACpE,SAAS,UAAU,oBAAoB;AAavC,SAAS,kBAAkB,SAAyC;AAClE,SAAO,QAAQ,OAAO,OAAO,EAAE,KAAK,GAAG;AACzC;AAEA,SAAS,WAAW,MAAsB;AACxC,QAAM,QAAQ,KAAK,KAAK,EAAE,MAAM,KAAK,EAAE,OAAO,OAAO;AACrD,MAAI,MAAM,WAAW,EAAG,QAAO;AAC/B,QAAM,QAAQ,MAAM,CAAC,EAAE,CAAC,KAAK;AAC7B,QAAM,OAAO,MAAM,SAAS,IAAK,MAAM,MAAM,SAAS,CAAC,EAAE,CAAC,KAAK,KAAM;AACrE,SAAO,GAAG,KAAK,GAAG,IAAI,GAAG,YAAY;AACvC;AAMO,MAAM,SAAS;AAAA,EACpB,CAAC,EAAE,MAAM,KAAK,OAAO,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ;AACxD,UAAM,CAAC,WAAW,YAAY,IAAI,SAAwB,IAAI;AAC9D,UAAM,SAAS,aAAa,EAAE,KAAK,CAAC;AACpC,UAAM,YAAY,QAAQ,GAAG,KAAK,cAAc;AAChD,WACE,oBAAC,UAAK,KAAU,MAAK,OAAM,cAAY,MAAO,GAAG,OAAO,WAAW,eAAe,OAAO,MAAM,SAAS,GACrG;AAAA;AAAA,MAEC,oBAAC,SAAI,KAAU,KAAI,IAAG,WAAW,OAAO,OAAO,SAAS,MAAM,aAAa,OAAO,IAAI,GAAG;AAAA,QAEzF,oBAAC,UAAK,eAAY,QAAO,WAAW,OAAO,UACxC,qBAAW,IAAI,GAClB,GAEJ;AAAA,EAEJ;AACF;AAEA,OAAO,cAAc;","names":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
2
|
+
export type BlockquoteProps = ComponentPropsWithoutRef<'figure'> & {
|
|
3
|
+
/** URL of the source, set on the <blockquote cite> attribute. */
|
|
4
|
+
cite?: string;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export type BlockquoteCaptionProps = ComponentPropsWithoutRef<'figcaption'>;
|
|
8
|
+
export declare const BlockquoteCaption: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
9
|
+
/**
|
|
10
|
+
* A quotation. Renders <figure><blockquote/><figcaption/></figure> so the caption
|
|
11
|
+
* (who said it) sits outside the quote, as HTML requires.
|
|
12
|
+
*/
|
|
13
|
+
export declare const Blockquote: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
|
|
14
|
+
/** URL of the source, set on the <blockquote cite> attribute. */
|
|
15
|
+
cite?: string;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
} & import("react").RefAttributes<HTMLElement>>;
|
|
18
|
+
//# sourceMappingURL=Blockquote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Blockquote.d.ts","sourceRoot":"","sources":["../../src/components/Blockquote.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwC,KAAK,wBAAwB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5G,MAAM,MAAM,eAAe,GAAG,wBAAwB,CAAC,QAAQ,CAAC,GAAG;IACjE,iEAAiE;IACjE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,wBAAwB,CAAC,YAAY,CAAC,CAAC;AAM5E,eAAO,MAAM,iBAAiB,kMAE5B,CAAC;AAIH;;;GAGG;AACH,eAAO,MAAM,UAAU;IArBrB,iEAAiE;WAC1D,MAAM;eACF,SAAS;+CAgCpB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Children, forwardRef, isValidElement } from "react";
|
|
3
|
+
import { blockquote as blockquoteRecipe } from "@becket-ui/tokens/recipes";
|
|
4
|
+
function mergeClassName(...classes) {
|
|
5
|
+
return classes.filter(Boolean).join(" ");
|
|
6
|
+
}
|
|
7
|
+
const BlockquoteCaption = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("figcaption", { ref, ...props, className: mergeClassName(blockquoteRecipe().caption, className) }));
|
|
8
|
+
BlockquoteCaption.displayName = "BlockquoteCaption";
|
|
9
|
+
const Blockquote = forwardRef(({ cite, className, children, ...props }, ref) => {
|
|
10
|
+
const styles = blockquoteRecipe();
|
|
11
|
+
const items = Children.toArray(children);
|
|
12
|
+
const captions = items.filter((child) => isValidElement(child) && child.type === BlockquoteCaption);
|
|
13
|
+
const quote = items.filter((child) => !(isValidElement(child) && child.type === BlockquoteCaption));
|
|
14
|
+
return /* @__PURE__ */ jsxs("figure", { ref, ...props, className: mergeClassName(styles.root, className), children: [
|
|
15
|
+
/* @__PURE__ */ jsx("blockquote", { cite, className: styles.quote, children: quote }),
|
|
16
|
+
captions
|
|
17
|
+
] });
|
|
18
|
+
});
|
|
19
|
+
Blockquote.displayName = "Blockquote";
|
|
20
|
+
export {
|
|
21
|
+
Blockquote,
|
|
22
|
+
BlockquoteCaption
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=Blockquote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Blockquote.tsx"],"sourcesContent":["import { Children, forwardRef, isValidElement, type ComponentPropsWithoutRef, type ReactNode } from 'react';\nimport { blockquote as blockquoteRecipe } from '@becket-ui/tokens/recipes';\n\nexport type BlockquoteProps = ComponentPropsWithoutRef<'figure'> & {\n /** URL of the source, set on the <blockquote cite> attribute. */\n cite?: string;\n children?: ReactNode;\n};\n\nexport type BlockquoteCaptionProps = ComponentPropsWithoutRef<'figcaption'>;\n\nfunction mergeClassName(...classes: (string | undefined)[]): string {\n return classes.filter(Boolean).join(' ');\n}\n\nexport const BlockquoteCaption = forwardRef<HTMLElement, BlockquoteCaptionProps>(({ className, ...props }, ref) => (\n <figcaption ref={ref} {...props} className={mergeClassName(blockquoteRecipe().caption, className)} />\n));\n\nBlockquoteCaption.displayName = 'BlockquoteCaption';\n\n/**\n * A quotation. Renders <figure><blockquote/><figcaption/></figure> so the caption\n * (who said it) sits outside the quote, as HTML requires.\n */\nexport const Blockquote = forwardRef<HTMLElement, BlockquoteProps>(({ cite, className, children, ...props }, ref) => {\n const styles = blockquoteRecipe();\n const items = Children.toArray(children);\n const captions = items.filter((child) => isValidElement(child) && child.type === BlockquoteCaption);\n const quote = items.filter((child) => !(isValidElement(child) && child.type === BlockquoteCaption));\n return (\n <figure ref={ref} {...props} className={mergeClassName(styles.root, className)}>\n <blockquote cite={cite} className={styles.quote}>\n {quote}\n </blockquote>\n {captions}\n </figure>\n );\n});\n\nBlockquote.displayName = 'Blockquote';\n"],"mappings":"AAgBE,cAeE,YAfF;AAhBF,SAAS,UAAU,YAAY,sBAAqE;AACpG,SAAS,cAAc,wBAAwB;AAU/C,SAAS,kBAAkB,SAAyC;AAClE,SAAO,QAAQ,OAAO,OAAO,EAAE,KAAK,GAAG;AACzC;AAEO,MAAM,oBAAoB,WAAgD,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACzG,oBAAC,gBAAW,KAAW,GAAG,OAAO,WAAW,eAAe,iBAAiB,EAAE,SAAS,SAAS,GAAG,CACpG;AAED,kBAAkB,cAAc;AAMzB,MAAM,aAAa,WAAyC,CAAC,EAAE,MAAM,WAAW,UAAU,GAAG,MAAM,GAAG,QAAQ;AACnH,QAAM,SAAS,iBAAiB;AAChC,QAAM,QAAQ,SAAS,QAAQ,QAAQ;AACvC,QAAM,WAAW,MAAM,OAAO,CAAC,UAAU,eAAe,KAAK,KAAK,MAAM,SAAS,iBAAiB;AAClG,QAAM,QAAQ,MAAM,OAAO,CAAC,UAAU,EAAE,eAAe,KAAK,KAAK,MAAM,SAAS,kBAAkB;AAClG,SACE,qBAAC,YAAO,KAAW,GAAG,OAAO,WAAW,eAAe,OAAO,MAAM,SAAS,GAC3E;AAAA,wBAAC,gBAAW,MAAY,WAAW,OAAO,OACvC,iBACH;AAAA,IACC;AAAA,KACH;AAEJ,CAAC;AAED,WAAW,cAAc;","names":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ElementType } from 'react';
|
|
2
|
+
export type CenterProps = ComponentPropsWithoutRef<'div'> & {
|
|
3
|
+
/** inline-flex instead of flex, e.g. to center an icon inside text. */
|
|
4
|
+
inline?: boolean;
|
|
5
|
+
as?: ElementType;
|
|
6
|
+
};
|
|
7
|
+
export declare const Center: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
8
|
+
/** inline-flex instead of flex, e.g. to center an icon inside text. */
|
|
9
|
+
inline?: boolean;
|
|
10
|
+
as?: ElementType;
|
|
11
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
|
+
//# sourceMappingURL=Center.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Center.d.ts","sourceRoot":"","sources":["../../src/components/Center.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,wBAAwB,EAAE,KAAK,WAAW,EAAE,MAAM,OAAO,CAAC;AAGpF,MAAM,MAAM,WAAW,GAAG,wBAAwB,CAAC,KAAK,CAAC,GAAG;IAC1D,uEAAuE;IACvE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,EAAE,CAAC,EAAE,WAAW,CAAC;CAClB,CAAC;AAMF,eAAO,MAAM,MAAM;IATjB,uEAAuE;aAC9D,OAAO;SACX,WAAW;kDAWjB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { center as centerRecipe } from "@becket-ui/tokens/recipes";
|
|
4
|
+
function mergeClassName(...classes) {
|
|
5
|
+
return classes.filter(Boolean).join(" ");
|
|
6
|
+
}
|
|
7
|
+
const Center = forwardRef(
|
|
8
|
+
({ inline = false, as: Component = "div", className, ...props }, ref) => /* @__PURE__ */ jsx(Component, { ref, ...props, className: mergeClassName(centerRecipe({ inline }), className) })
|
|
9
|
+
);
|
|
10
|
+
Center.displayName = "Center";
|
|
11
|
+
export {
|
|
12
|
+
Center
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=Center.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Center.tsx"],"sourcesContent":["import { forwardRef, type ComponentPropsWithoutRef, type ElementType } from 'react';\nimport { center as centerRecipe } from '@becket-ui/tokens/recipes';\n\nexport type CenterProps = ComponentPropsWithoutRef<'div'> & {\n /** inline-flex instead of flex, e.g. to center an icon inside text. */\n inline?: boolean;\n as?: ElementType;\n};\n\nfunction mergeClassName(...classes: (string | undefined)[]): string {\n return classes.filter(Boolean).join(' ');\n}\n\nexport const Center = forwardRef<HTMLDivElement, CenterProps>(\n ({ inline = false, as: Component = 'div', className, ...props }, ref) => (\n <Component ref={ref} {...props} className={mergeClassName(centerRecipe({ inline }), className)} />\n ),\n);\n\nCenter.displayName = 'Center';\n"],"mappings":"AAeI;AAfJ,SAAS,kBAAmE;AAC5E,SAAS,UAAU,oBAAoB;AAQvC,SAAS,kBAAkB,SAAyC;AAClE,SAAO,QAAQ,OAAO,OAAO,EAAE,KAAK,GAAG;AACzC;AAEO,MAAM,SAAS;AAAA,EACpB,CAAC,EAAE,SAAS,OAAO,IAAI,YAAY,OAAO,WAAW,GAAG,MAAM,GAAG,QAC/D,oBAAC,aAAU,KAAW,GAAG,OAAO,WAAW,eAAe,aAAa,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG;AAEpG;AAEA,OAAO,cAAc;","names":[]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export type CodeProps = ComponentPropsWithoutRef<'code'>;
|
|
3
|
+
/** Inline code. Use CodeBlock (MAV-114) for multi-line code. */
|
|
4
|
+
export declare const Code: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
5
|
+
//# sourceMappingURL=Code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../../src/components/Code.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAGlE,MAAM,MAAM,SAAS,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAC;AAMzD,gEAAgE;AAChE,eAAO,MAAM,IAAI,kMAEf,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { code as codeRecipe } from "@becket-ui/tokens/recipes";
|
|
4
|
+
function mergeClassName(...classes) {
|
|
5
|
+
return classes.filter(Boolean).join(" ");
|
|
6
|
+
}
|
|
7
|
+
const Code = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("code", { ref, ...props, className: mergeClassName(codeRecipe(), className) }));
|
|
8
|
+
Code.displayName = "Code";
|
|
9
|
+
export {
|
|
10
|
+
Code
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=Code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Code.tsx"],"sourcesContent":["import { forwardRef, type ComponentPropsWithoutRef } from 'react';\nimport { code as codeRecipe } from '@becket-ui/tokens/recipes';\n\nexport type CodeProps = ComponentPropsWithoutRef<'code'>;\n\nfunction mergeClassName(...classes: (string | undefined)[]): string {\n return classes.filter(Boolean).join(' ');\n}\n\n/** Inline code. Use CodeBlock (MAV-114) for multi-line code. */\nexport const Code = forwardRef<HTMLElement, CodeProps>(({ className, ...props }, ref) => (\n <code ref={ref} {...props} className={mergeClassName(codeRecipe(), className)} />\n));\n\nCode.displayName = 'Code';\n"],"mappings":"AAWE;AAXF,SAAS,kBAAiD;AAC1D,SAAS,QAAQ,kBAAkB;AAInC,SAAS,kBAAkB,SAAyC;AAClE,SAAO,QAAQ,OAAO,OAAO,EAAE,KAAK,GAAG;AACzC;AAGO,MAAM,OAAO,WAAmC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC/E,oBAAC,UAAK,KAAW,GAAG,OAAO,WAAW,eAAe,WAAW,GAAG,SAAS,GAAG,CAChF;AAED,KAAK,cAAc;","names":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
2
|
+
export type FigureProps = ComponentPropsWithoutRef<'figure'> & {
|
|
3
|
+
/** Rendered as <figcaption> after the content. */
|
|
4
|
+
caption?: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
/** Image, chart or code with a caption. */
|
|
7
|
+
export declare const Figure: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
|
|
8
|
+
/** Rendered as <figcaption> after the content. */
|
|
9
|
+
caption?: ReactNode;
|
|
10
|
+
} & import("react").RefAttributes<HTMLElement>>;
|
|
11
|
+
//# sourceMappingURL=Figure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Figure.d.ts","sourceRoot":"","sources":["../../src/components/Figure.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,wBAAwB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlF,MAAM,MAAM,WAAW,GAAG,wBAAwB,CAAC,QAAQ,CAAC,GAAG;IAC7D,kDAAkD;IAClD,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC;AAMF,2CAA2C;AAC3C,eAAO,MAAM,MAAM;IATjB,kDAAkD;cACxC,SAAS;+CAgBnB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { figure as figureRecipe } from "@becket-ui/tokens/recipes";
|
|
4
|
+
function mergeClassName(...classes) {
|
|
5
|
+
return classes.filter(Boolean).join(" ");
|
|
6
|
+
}
|
|
7
|
+
const Figure = forwardRef(({ caption, className, children, ...props }, ref) => {
|
|
8
|
+
const styles = figureRecipe();
|
|
9
|
+
return /* @__PURE__ */ jsxs("figure", { ref, ...props, className: mergeClassName(styles.root, className), children: [
|
|
10
|
+
children,
|
|
11
|
+
caption != null && /* @__PURE__ */ jsx("figcaption", { className: styles.caption, children: caption })
|
|
12
|
+
] });
|
|
13
|
+
});
|
|
14
|
+
Figure.displayName = "Figure";
|
|
15
|
+
export {
|
|
16
|
+
Figure
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=Figure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Figure.tsx"],"sourcesContent":["import { forwardRef, type ComponentPropsWithoutRef, type ReactNode } from 'react';\nimport { figure as figureRecipe } from '@becket-ui/tokens/recipes';\n\nexport type FigureProps = ComponentPropsWithoutRef<'figure'> & {\n /** Rendered as <figcaption> after the content. */\n caption?: ReactNode;\n};\n\nfunction mergeClassName(...classes: (string | undefined)[]): string {\n return classes.filter(Boolean).join(' ');\n}\n\n/** Image, chart or code with a caption. */\nexport const Figure = forwardRef<HTMLElement, FigureProps>(({ caption, className, children, ...props }, ref) => {\n const styles = figureRecipe();\n return (\n <figure ref={ref} {...props} className={mergeClassName(styles.root, className)}>\n {children}\n {caption != null && <figcaption className={styles.caption}>{caption}</figcaption>}\n </figure>\n );\n});\n\nFigure.displayName = 'Figure';\n"],"mappings":"AAgBI,SAEsB,KAFtB;AAhBJ,SAAS,kBAAiE;AAC1E,SAAS,UAAU,oBAAoB;AAOvC,SAAS,kBAAkB,SAAyC;AAClE,SAAO,QAAQ,OAAO,OAAO,EAAE,KAAK,GAAG;AACzC;AAGO,MAAM,SAAS,WAAqC,CAAC,EAAE,SAAS,WAAW,UAAU,GAAG,MAAM,GAAG,QAAQ;AAC9G,QAAM,SAAS,aAAa;AAC5B,SACE,qBAAC,YAAO,KAAW,GAAG,OAAO,WAAW,eAAe,OAAO,MAAM,SAAS,GAC1E;AAAA;AAAA,IACA,WAAW,QAAQ,oBAAC,gBAAW,WAAW,OAAO,SAAU,mBAAQ;AAAA,KACtE;AAEJ,CAAC;AAED,OAAO,cAAc;","names":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ElementType } from 'react';
|
|
2
|
+
import { type GapValue, type ResponsiveValue } from '../helpers/responsive.js';
|
|
3
|
+
type Columns = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
4
|
+
type Span = Columns | 'full';
|
|
5
|
+
export type GridProps = ComponentPropsWithoutRef<'div'> & {
|
|
6
|
+
/** Column count, 1–12, or per breakpoint: { base: 1, md: 12 }. */
|
|
7
|
+
columns?: ResponsiveValue<Columns>;
|
|
8
|
+
gap?: GapValue;
|
|
9
|
+
as?: ElementType;
|
|
10
|
+
};
|
|
11
|
+
export type GridItemProps = ComponentPropsWithoutRef<'div'> & {
|
|
12
|
+
/** Columns to span, 1–12 or "full", or per breakpoint: { base: 'full', md: 6 }. */
|
|
13
|
+
colSpan?: ResponsiveValue<Span>;
|
|
14
|
+
as?: ElementType;
|
|
15
|
+
};
|
|
16
|
+
/** 12-column layout grid. For equal tiles, SimpleGrid is simpler. */
|
|
17
|
+
export declare const Grid: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
18
|
+
/** Column count, 1–12, or per breakpoint: { base: 1, md: 12 }. */
|
|
19
|
+
columns?: ResponsiveValue<Columns>;
|
|
20
|
+
gap?: GapValue;
|
|
21
|
+
as?: ElementType;
|
|
22
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
23
|
+
export declare const GridItem: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
24
|
+
/** Columns to span, 1–12 or "full", or per breakpoint: { base: 'full', md: 6 }. */
|
|
25
|
+
colSpan?: ResponsiveValue<Span>;
|
|
26
|
+
as?: ElementType;
|
|
27
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=Grid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../src/components/Grid.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,wBAAwB,EAAE,KAAK,WAAW,EAAE,MAAM,OAAO,CAAC;AAGpF,OAAO,EAA+C,KAAK,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAEzH,KAAK,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAChE,KAAK,IAAI,GAAG,OAAO,GAAG,MAAM,CAAC;AAE7B,MAAM,MAAM,SAAS,GAAG,wBAAwB,CAAC,KAAK,CAAC,GAAG;IACxD,kEAAkE;IAClE,OAAO,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;IACnC,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,EAAE,CAAC,EAAE,WAAW,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,wBAAwB,CAAC,KAAK,CAAC,GAAG;IAC5D,mFAAmF;IACnF,OAAO,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;IAChC,EAAE,CAAC,EAAE,WAAW,CAAC;CAClB,CAAC;AAwBF,qEAAqE;AACrE,eAAO,MAAM,IAAI;IAnCf,kEAAkE;cACxD,eAAe,CAAC,OAAO,CAAC;UAC5B,QAAQ;SACT,WAAW;kDA+CjB,CAAC;AAIF,eAAO,MAAM,QAAQ;IA/CnB,mFAAmF;cACzE,eAAe,CAAC,IAAI,CAAC;SAC1B,WAAW;kDAwDjB,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { css } from "@becket-ui/tokens/css";
|
|
4
|
+
import { normalizeGapValue, normalizeResponsiveValue } from "../helpers/responsive.js";
|
|
5
|
+
function mergeClassName(...classes) {
|
|
6
|
+
return classes.filter(Boolean).join(" ");
|
|
7
|
+
}
|
|
8
|
+
function mapResponsive(value, fn) {
|
|
9
|
+
const resolved = normalizeResponsiveValue(value);
|
|
10
|
+
if (resolved == null) return void 0;
|
|
11
|
+
if (Array.isArray(resolved)) return resolved.map((item) => item == null ? void 0 : fn(item));
|
|
12
|
+
if (typeof resolved === "object") {
|
|
13
|
+
return Object.fromEntries(
|
|
14
|
+
Object.entries(resolved).map(([breakpoint, item]) => [breakpoint, fn(item)])
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
return fn(resolved);
|
|
18
|
+
}
|
|
19
|
+
const toTemplate = (count) => `repeat(${count}, minmax(0, 1fr))`;
|
|
20
|
+
const toSpan = (span) => span === "full" ? "1 / -1" : `span ${span} / span ${span}`;
|
|
21
|
+
const Grid = forwardRef(
|
|
22
|
+
({ columns = 12, gap = "md", as: Component = "div", className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
23
|
+
Component,
|
|
24
|
+
{
|
|
25
|
+
ref,
|
|
26
|
+
...props,
|
|
27
|
+
className: mergeClassName(
|
|
28
|
+
css({
|
|
29
|
+
display: "grid",
|
|
30
|
+
gridTemplateColumns: mapResponsive(columns, toTemplate),
|
|
31
|
+
gap: normalizeGapValue(gap)
|
|
32
|
+
}),
|
|
33
|
+
className
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
);
|
|
38
|
+
Grid.displayName = "Grid";
|
|
39
|
+
const GridItem = forwardRef(
|
|
40
|
+
({ colSpan, as: Component = "div", className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
41
|
+
Component,
|
|
42
|
+
{
|
|
43
|
+
ref,
|
|
44
|
+
...props,
|
|
45
|
+
className: mergeClassName(
|
|
46
|
+
css({ minWidth: "0", ...colSpan != null && { gridColumn: mapResponsive(colSpan, toSpan) } }),
|
|
47
|
+
className
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
);
|
|
52
|
+
GridItem.displayName = "GridItem";
|
|
53
|
+
export {
|
|
54
|
+
Grid,
|
|
55
|
+
GridItem
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=Grid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Grid.tsx"],"sourcesContent":["import { forwardRef, type ComponentPropsWithoutRef, type ElementType } from 'react';\nimport { css } from '@becket-ui/tokens/css';\n\nimport { normalizeGapValue, normalizeResponsiveValue, type GapValue, type ResponsiveValue } from '../helpers/responsive';\n\ntype Columns = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\ntype Span = Columns | 'full';\n\nexport type GridProps = ComponentPropsWithoutRef<'div'> & {\n /** Column count, 1–12, or per breakpoint: { base: 1, md: 12 }. */\n columns?: ResponsiveValue<Columns>;\n gap?: GapValue;\n as?: ElementType;\n};\n\nexport type GridItemProps = ComponentPropsWithoutRef<'div'> & {\n /** Columns to span, 1–12 or \"full\", or per breakpoint: { base: 'full', md: 6 }. */\n colSpan?: ResponsiveValue<Span>;\n as?: ElementType;\n};\n\nfunction mergeClassName(...classes: (string | undefined)[]): string {\n return classes.filter(Boolean).join(' ');\n}\n\n// Map a value or a breakpoint object through fn. The prebuilt CSS ships every\n// 1–12 count and span at every breakpoint (panda.config staticCss), so these\n// classes exist in apps that don't run Panda.\nfunction mapResponsive<T, R>(value: ResponsiveValue<T> | undefined, fn: (item: T) => R) {\n const resolved = normalizeResponsiveValue(value as never) as unknown;\n if (resolved == null) return undefined;\n if (Array.isArray(resolved)) return resolved.map((item) => (item == null ? undefined : fn(item as T)));\n if (typeof resolved === 'object') {\n return Object.fromEntries(\n Object.entries(resolved as Record<string, T>).map(([breakpoint, item]) => [breakpoint, fn(item)]),\n );\n }\n return fn(resolved as T);\n}\n\nconst toTemplate = (count: Columns) => `repeat(${count}, minmax(0, 1fr))`;\nconst toSpan = (span: Span) => (span === 'full' ? '1 / -1' : `span ${span} / span ${span}`);\n\n/** 12-column layout grid. For equal tiles, SimpleGrid is simpler. */\nexport const Grid = forwardRef<HTMLDivElement, GridProps>(\n ({ columns = 12, gap = 'md', as: Component = 'div', className, ...props }, ref) => (\n <Component\n ref={ref}\n {...props}\n className={mergeClassName(\n css({\n display: 'grid',\n gridTemplateColumns: mapResponsive(columns, toTemplate) as never,\n gap: normalizeGapValue(gap) as never,\n }),\n className,\n )}\n />\n ),\n);\n\nGrid.displayName = 'Grid';\n\nexport const GridItem = forwardRef<HTMLDivElement, GridItemProps>(\n ({ colSpan, as: Component = 'div', className, ...props }, ref) => (\n <Component\n ref={ref}\n {...props}\n className={mergeClassName(\n css({ minWidth: '0', ...(colSpan != null && { gridColumn: mapResponsive(colSpan, toSpan) as never }) }),\n className,\n )}\n />\n ),\n);\n\nGridItem.displayName = 'GridItem';\n"],"mappings":"AA8CI;AA9CJ,SAAS,kBAAmE;AAC5E,SAAS,WAAW;AAEpB,SAAS,mBAAmB,gCAAqE;AAkBjG,SAAS,kBAAkB,SAAyC;AAClE,SAAO,QAAQ,OAAO,OAAO,EAAE,KAAK,GAAG;AACzC;AAKA,SAAS,cAAoB,OAAuC,IAAoB;AACtF,QAAM,WAAW,yBAAyB,KAAc;AACxD,MAAI,YAAY,KAAM,QAAO;AAC7B,MAAI,MAAM,QAAQ,QAAQ,EAAG,QAAO,SAAS,IAAI,CAAC,SAAU,QAAQ,OAAO,SAAY,GAAG,IAAS,CAAE;AACrG,MAAI,OAAO,aAAa,UAAU;AAChC,WAAO,OAAO;AAAA,MACZ,OAAO,QAAQ,QAA6B,EAAE,IAAI,CAAC,CAAC,YAAY,IAAI,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;AAAA,IAClG;AAAA,EACF;AACA,SAAO,GAAG,QAAa;AACzB;AAEA,MAAM,aAAa,CAAC,UAAmB,UAAU,KAAK;AACtD,MAAM,SAAS,CAAC,SAAgB,SAAS,SAAS,WAAW,QAAQ,IAAI,WAAW,IAAI;AAGjF,MAAM,OAAO;AAAA,EAClB,CAAC,EAAE,UAAU,IAAI,MAAM,MAAM,IAAI,YAAY,OAAO,WAAW,GAAG,MAAM,GAAG,QACzE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACC,GAAG;AAAA,MACJ,WAAW;AAAA,QACT,IAAI;AAAA,UACF,SAAS;AAAA,UACT,qBAAqB,cAAc,SAAS,UAAU;AAAA,UACtD,KAAK,kBAAkB,GAAG;AAAA,QAC5B,CAAC;AAAA,QACD;AAAA,MACF;AAAA;AAAA,EACF;AAEJ;AAEA,KAAK,cAAc;AAEZ,MAAM,WAAW;AAAA,EACtB,CAAC,EAAE,SAAS,IAAI,YAAY,OAAO,WAAW,GAAG,MAAM,GAAG,QACxD;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACC,GAAG;AAAA,MACJ,WAAW;AAAA,QACT,IAAI,EAAE,UAAU,KAAK,GAAI,WAAW,QAAQ,EAAE,YAAY,cAAc,SAAS,MAAM,EAAW,EAAG,CAAC;AAAA,QACtG;AAAA,MACF;AAAA;AAAA,EACF;AAEJ;AAEA,SAAS,cAAc;","names":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
type ImageFit = 'cover' | 'contain';
|
|
3
|
+
type ImageRadius = 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
4
|
+
export type ImageProps = Omit<ComponentPropsWithoutRef<'img'>, 'alt'> & {
|
|
5
|
+
/** Required. Describe the image, or pass "" when it's purely decorative. */
|
|
6
|
+
alt: string;
|
|
7
|
+
fit?: ImageFit;
|
|
8
|
+
radius?: ImageRadius;
|
|
9
|
+
};
|
|
10
|
+
/** Native <img>: lazy-loaded and async-decoded by default, no JS. */
|
|
11
|
+
export declare const Image: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "ref">, "alt"> & {
|
|
12
|
+
/** Required. Describe the image, or pass "" when it's purely decorative. */
|
|
13
|
+
alt: string;
|
|
14
|
+
fit?: ImageFit;
|
|
15
|
+
radius?: ImageRadius;
|
|
16
|
+
} & import("react").RefAttributes<HTMLImageElement>>;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=Image.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../src/components/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAGlE,KAAK,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;AACpC,KAAK,WAAW,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;AAE/D,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,GAAG;IACtE,4EAA4E;IAC5E,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AAMF,qEAAqE;AACrE,eAAO,MAAM,KAAK;IAXhB,4EAA4E;SACvE,MAAM;UACL,QAAQ;aACL,WAAW;oDAkBrB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { image as imageRecipe } from "@becket-ui/tokens/recipes";
|
|
4
|
+
function mergeClassName(...classes) {
|
|
5
|
+
return classes.filter(Boolean).join(" ");
|
|
6
|
+
}
|
|
7
|
+
const Image = forwardRef(
|
|
8
|
+
({ fit = "cover", radius = "none", loading = "lazy", decoding = "async", className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
9
|
+
"img",
|
|
10
|
+
{
|
|
11
|
+
ref,
|
|
12
|
+
loading,
|
|
13
|
+
decoding,
|
|
14
|
+
...props,
|
|
15
|
+
className: mergeClassName(imageRecipe({ fit, radius }), className)
|
|
16
|
+
}
|
|
17
|
+
)
|
|
18
|
+
);
|
|
19
|
+
Image.displayName = "Image";
|
|
20
|
+
export {
|
|
21
|
+
Image
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=Image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Image.tsx"],"sourcesContent":["import { forwardRef, type ComponentPropsWithoutRef } from 'react';\nimport { image as imageRecipe } from '@becket-ui/tokens/recipes';\n\ntype ImageFit = 'cover' | 'contain';\ntype ImageRadius = 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';\n\nexport type ImageProps = Omit<ComponentPropsWithoutRef<'img'>, 'alt'> & {\n /** Required. Describe the image, or pass \"\" when it's purely decorative. */\n alt: string;\n fit?: ImageFit;\n radius?: ImageRadius;\n};\n\nfunction mergeClassName(...classes: (string | undefined)[]): string {\n return classes.filter(Boolean).join(' ');\n}\n\n/** Native <img>: lazy-loaded and async-decoded by default, no JS. */\nexport const Image = forwardRef<HTMLImageElement, ImageProps>(\n ({ fit = 'cover', radius = 'none', loading = 'lazy', decoding = 'async', className, ...props }, ref) => (\n <img\n ref={ref}\n loading={loading}\n decoding={decoding}\n {...props}\n className={mergeClassName(imageRecipe({ fit, radius }), className)}\n />\n ),\n);\n\nImage.displayName = 'Image';\n"],"mappings":"AAoBI;AApBJ,SAAS,kBAAiD;AAC1D,SAAS,SAAS,mBAAmB;AAYrC,SAAS,kBAAkB,SAAyC;AAClE,SAAO,QAAQ,OAAO,OAAO,EAAE,KAAK,GAAG;AACzC;AAGO,MAAM,QAAQ;AAAA,EACnB,CAAC,EAAE,MAAM,SAAS,SAAS,QAAQ,UAAU,QAAQ,WAAW,SAAS,WAAW,GAAG,MAAM,GAAG,QAC9F;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MACJ,WAAW,eAAe,YAAY,EAAE,KAAK,OAAO,CAAC,GAAG,SAAS;AAAA;AAAA,EACnE;AAEJ;AAEA,MAAM,cAAc;","names":[]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export type KbdProps = ComponentPropsWithoutRef<'kbd'>;
|
|
3
|
+
/** A keyboard key or shortcut, e.g. <Kbd>⌘</Kbd> <Kbd>K</Kbd>. */
|
|
4
|
+
export declare const Kbd: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
5
|
+
//# sourceMappingURL=Kbd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Kbd.d.ts","sourceRoot":"","sources":["../../src/components/Kbd.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAGlE,MAAM,MAAM,QAAQ,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAC;AAMvD,kEAAkE;AAClE,eAAO,MAAM,GAAG,kMAEd,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { kbd as kbdRecipe } from "@becket-ui/tokens/recipes";
|
|
4
|
+
function mergeClassName(...classes) {
|
|
5
|
+
return classes.filter(Boolean).join(" ");
|
|
6
|
+
}
|
|
7
|
+
const Kbd = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("kbd", { ref, ...props, className: mergeClassName(kbdRecipe(), className) }));
|
|
8
|
+
Kbd.displayName = "Kbd";
|
|
9
|
+
export {
|
|
10
|
+
Kbd
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=Kbd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Kbd.tsx"],"sourcesContent":["import { forwardRef, type ComponentPropsWithoutRef } from 'react';\nimport { kbd as kbdRecipe } from '@becket-ui/tokens/recipes';\n\nexport type KbdProps = ComponentPropsWithoutRef<'kbd'>;\n\nfunction mergeClassName(...classes: (string | undefined)[]): string {\n return classes.filter(Boolean).join(' ');\n}\n\n/** A keyboard key or shortcut, e.g. <Kbd>⌘</Kbd> <Kbd>K</Kbd>. */\nexport const Kbd = forwardRef<HTMLElement, KbdProps>(({ className, ...props }, ref) => (\n <kbd ref={ref} {...props} className={mergeClassName(kbdRecipe(), className)} />\n));\n\nKbd.displayName = 'Kbd';\n"],"mappings":"AAWE;AAXF,SAAS,kBAAiD;AAC1D,SAAS,OAAO,iBAAiB;AAIjC,SAAS,kBAAkB,SAAyC;AAClE,SAAO,QAAQ,OAAO,OAAO,EAAE,KAAK,GAAG;AACzC;AAGO,MAAM,MAAM,WAAkC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC7E,oBAAC,SAAI,KAAW,GAAG,OAAO,WAAW,eAAe,UAAU,GAAG,SAAS,GAAG,CAC9E;AAED,IAAI,cAAc;","names":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
type ListSpacing = 'xs' | 'sm' | 'md';
|
|
3
|
+
type ListMarker = 'disc' | 'decimal' | 'none';
|
|
4
|
+
export type ListProps = ComponentPropsWithoutRef<'ul'> & {
|
|
5
|
+
/** `ol` for ordered steps; defaults the marker to decimal. */
|
|
6
|
+
as?: 'ul' | 'ol';
|
|
7
|
+
spacing?: ListSpacing;
|
|
8
|
+
marker?: ListMarker;
|
|
9
|
+
};
|
|
10
|
+
export declare const List: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & {
|
|
11
|
+
/** `ol` for ordered steps; defaults the marker to decimal. */
|
|
12
|
+
as?: 'ul' | 'ol';
|
|
13
|
+
spacing?: ListSpacing;
|
|
14
|
+
marker?: ListMarker;
|
|
15
|
+
} & import("react").RefAttributes<HTMLUListElement & HTMLOListElement>>;
|
|
16
|
+
export type ListItemProps = ComponentPropsWithoutRef<'li'>;
|
|
17
|
+
export declare const ListItem: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & import("react").RefAttributes<HTMLLIElement>>;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=List.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../src/components/List.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAGlE,KAAK,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACtC,KAAK,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AAE9C,MAAM,MAAM,SAAS,GAAG,wBAAwB,CAAC,IAAI,CAAC,GAAG;IACvD,8DAA8D;IAC9D,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACjB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB,CAAC;AAMF,eAAO,MAAM,IAAI;IAVf,8DAA8D;SACzD,IAAI,GAAG,IAAI;cACN,WAAW;aACZ,UAAU;uEAkBpB,CAAC;AAIF,MAAM,MAAM,aAAa,GAAG,wBAAwB,CAAC,IAAI,CAAC,CAAC;AAE3D,eAAO,MAAM,QAAQ,0MAAwF,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { list as listRecipe } from "@becket-ui/tokens/recipes";
|
|
4
|
+
function mergeClassName(...classes) {
|
|
5
|
+
return classes.filter(Boolean).join(" ");
|
|
6
|
+
}
|
|
7
|
+
const List = forwardRef(
|
|
8
|
+
({ as: Component = "ul", spacing = "sm", marker, className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
9
|
+
Component,
|
|
10
|
+
{
|
|
11
|
+
ref,
|
|
12
|
+
...props,
|
|
13
|
+
className: mergeClassName(
|
|
14
|
+
listRecipe({ spacing, marker: marker ?? (Component === "ol" ? "decimal" : "disc") }),
|
|
15
|
+
className
|
|
16
|
+
)
|
|
17
|
+
}
|
|
18
|
+
)
|
|
19
|
+
);
|
|
20
|
+
List.displayName = "List";
|
|
21
|
+
const ListItem = forwardRef((props, ref) => /* @__PURE__ */ jsx("li", { ref, ...props }));
|
|
22
|
+
ListItem.displayName = "ListItem";
|
|
23
|
+
export {
|
|
24
|
+
List,
|
|
25
|
+
ListItem
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=List.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/List.tsx"],"sourcesContent":["import { forwardRef, type ComponentPropsWithoutRef } from 'react';\nimport { list as listRecipe } from '@becket-ui/tokens/recipes';\n\ntype ListSpacing = 'xs' | 'sm' | 'md';\ntype ListMarker = 'disc' | 'decimal' | 'none';\n\nexport type ListProps = ComponentPropsWithoutRef<'ul'> & {\n /** `ol` for ordered steps; defaults the marker to decimal. */\n as?: 'ul' | 'ol';\n spacing?: ListSpacing;\n marker?: ListMarker;\n};\n\nfunction mergeClassName(...classes: (string | undefined)[]): string {\n return classes.filter(Boolean).join(' ');\n}\n\nexport const List = forwardRef<HTMLUListElement & HTMLOListElement, ListProps>(\n ({ as: Component = 'ul', spacing = 'sm', marker, className, ...props }, ref) => (\n <Component\n ref={ref}\n {...props}\n className={mergeClassName(\n listRecipe({ spacing, marker: marker ?? (Component === 'ol' ? 'decimal' : 'disc') }),\n className,\n )}\n />\n ),\n);\n\nList.displayName = 'List';\n\nexport type ListItemProps = ComponentPropsWithoutRef<'li'>;\n\nexport const ListItem = forwardRef<HTMLLIElement, ListItemProps>((props, ref) => <li ref={ref} {...props} />);\n\nListItem.displayName = 'ListItem';\n"],"mappings":"AAmBI;AAnBJ,SAAS,kBAAiD;AAC1D,SAAS,QAAQ,kBAAkB;AAYnC,SAAS,kBAAkB,SAAyC;AAClE,SAAO,QAAQ,OAAO,OAAO,EAAE,KAAK,GAAG;AACzC;AAEO,MAAM,OAAO;AAAA,EAClB,CAAC,EAAE,IAAI,YAAY,MAAM,UAAU,MAAM,QAAQ,WAAW,GAAG,MAAM,GAAG,QACtE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACC,GAAG;AAAA,MACJ,WAAW;AAAA,QACT,WAAW,EAAE,SAAS,QAAQ,WAAW,cAAc,OAAO,YAAY,QAAQ,CAAC;AAAA,QACnF;AAAA,MACF;AAAA;AAAA,EACF;AAEJ;AAEA,KAAK,cAAc;AAIZ,MAAM,WAAW,WAAyC,CAAC,OAAO,QAAQ,oBAAC,QAAG,KAAW,GAAG,OAAO,CAAE;AAE5G,SAAS,cAAc;","names":[]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export type MarkProps = ComponentPropsWithoutRef<'mark'>;
|
|
3
|
+
/** Highlighted text. */
|
|
4
|
+
export declare const Mark: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
5
|
+
//# sourceMappingURL=Mark.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Mark.d.ts","sourceRoot":"","sources":["../../src/components/Mark.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAGlE,MAAM,MAAM,SAAS,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAC;AAMzD,wBAAwB;AACxB,eAAO,MAAM,IAAI,kMAEf,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { mark as markRecipe } from "@becket-ui/tokens/recipes";
|
|
4
|
+
function mergeClassName(...classes) {
|
|
5
|
+
return classes.filter(Boolean).join(" ");
|
|
6
|
+
}
|
|
7
|
+
const Mark = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("mark", { ref, ...props, className: mergeClassName(markRecipe(), className) }));
|
|
8
|
+
Mark.displayName = "Mark";
|
|
9
|
+
export {
|
|
10
|
+
Mark
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=Mark.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Mark.tsx"],"sourcesContent":["import { forwardRef, type ComponentPropsWithoutRef } from 'react';\nimport { mark as markRecipe } from '@becket-ui/tokens/recipes';\n\nexport type MarkProps = ComponentPropsWithoutRef<'mark'>;\n\nfunction mergeClassName(...classes: (string | undefined)[]): string {\n return classes.filter(Boolean).join(' ');\n}\n\n/** Highlighted text. */\nexport const Mark = forwardRef<HTMLElement, MarkProps>(({ className, ...props }, ref) => (\n <mark ref={ref} {...props} className={mergeClassName(markRecipe(), className)} />\n));\n\nMark.displayName = 'Mark';\n"],"mappings":"AAWE;AAXF,SAAS,kBAAiD;AAC1D,SAAS,QAAQ,kBAAkB;AAInC,SAAS,kBAAkB,SAAyC;AAClE,SAAO,QAAQ,OAAO,OAAO,EAAE,KAAK,GAAG;AACzC;AAGO,MAAM,OAAO,WAAmC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC/E,oBAAC,UAAK,KAAW,GAAG,OAAO,WAAW,eAAe,WAAW,GAAG,SAAS,GAAG,CAChF;AAED,KAAK,cAAc;","names":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export type SkipLinkProps = ComponentPropsWithoutRef<'a'>;
|
|
3
|
+
/**
|
|
4
|
+
* First focusable element on the page: lets keyboard users jump past the
|
|
5
|
+
* navigation. Hidden until focused. Point `href` at the main landmark's id.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SkipLink: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
8
|
+
//# sourceMappingURL=SkipLink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SkipLink.d.ts","sourceRoot":"","sources":["../../src/components/SkipLink.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAGlE,MAAM,MAAM,aAAa,GAAG,wBAAwB,CAAC,GAAG,CAAC,CAAC;AAM1D;;;GAGG;AACH,eAAO,MAAM,QAAQ,0NAMpB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { skipLink as skipLinkRecipe } from "@becket-ui/tokens/recipes";
|
|
4
|
+
function mergeClassName(...classes) {
|
|
5
|
+
return classes.filter(Boolean).join(" ");
|
|
6
|
+
}
|
|
7
|
+
const SkipLink = forwardRef(
|
|
8
|
+
({ href = "#main", children = "Skip to content", className, ...props }, ref) => /* @__PURE__ */ jsx("a", { ref, href, ...props, className: mergeClassName(skipLinkRecipe(), className), children })
|
|
9
|
+
);
|
|
10
|
+
SkipLink.displayName = "SkipLink";
|
|
11
|
+
export {
|
|
12
|
+
SkipLink
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=SkipLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/SkipLink.tsx"],"sourcesContent":["import { forwardRef, type ComponentPropsWithoutRef } from 'react';\nimport { skipLink as skipLinkRecipe } from '@becket-ui/tokens/recipes';\n\nexport type SkipLinkProps = ComponentPropsWithoutRef<'a'>;\n\nfunction mergeClassName(...classes: (string | undefined)[]): string {\n return classes.filter(Boolean).join(' ');\n}\n\n/**\n * First focusable element on the page: lets keyboard users jump past the\n * navigation. Hidden until focused. Point `href` at the main landmark's id.\n */\nexport const SkipLink = forwardRef<HTMLAnchorElement, SkipLinkProps>(\n ({ href = '#main', children = 'Skip to content', className, ...props }, ref) => (\n <a ref={ref} href={href} {...props} className={mergeClassName(skipLinkRecipe(), className)}>\n {children}\n </a>\n ),\n);\n\nSkipLink.displayName = 'SkipLink';\n"],"mappings":"AAeI;AAfJ,SAAS,kBAAiD;AAC1D,SAAS,YAAY,sBAAsB;AAI3C,SAAS,kBAAkB,SAAyC;AAClE,SAAO,QAAQ,OAAO,OAAO,EAAE,KAAK,GAAG;AACzC;AAMO,MAAM,WAAW;AAAA,EACtB,CAAC,EAAE,OAAO,SAAS,WAAW,mBAAmB,WAAW,GAAG,MAAM,GAAG,QACtE,oBAAC,OAAE,KAAU,MAAa,GAAG,OAAO,WAAW,eAAe,eAAe,GAAG,SAAS,GACtF,UACH;AAEJ;AAEA,SAAS,cAAc;","names":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ElementType } from 'react';
|
|
2
|
+
export type VisuallyHiddenProps = ComponentPropsWithoutRef<'span'> & {
|
|
3
|
+
as?: ElementType;
|
|
4
|
+
};
|
|
5
|
+
/** Text for screen readers only, e.g. a label for an icon-only control. */
|
|
6
|
+
export declare const VisuallyHidden: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
7
|
+
as?: ElementType;
|
|
8
|
+
} & import("react").RefAttributes<HTMLElement>>;
|
|
9
|
+
//# sourceMappingURL=VisuallyHidden.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VisuallyHidden.d.ts","sourceRoot":"","sources":["../../src/components/VisuallyHidden.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,wBAAwB,EAAE,KAAK,WAAW,EAAE,MAAM,OAAO,CAAC;AAGpF,MAAM,MAAM,mBAAmB,GAAG,wBAAwB,CAAC,MAAM,CAAC,GAAG;IACnE,EAAE,CAAC,EAAE,WAAW,CAAC;CAClB,CAAC;AAMF,2EAA2E;AAC3E,eAAO,MAAM,cAAc;SARpB,WAAW;+CAYjB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { visuallyHidden as visuallyHiddenRecipe } from "@becket-ui/tokens/recipes";
|
|
4
|
+
function mergeClassName(...classes) {
|
|
5
|
+
return classes.filter(Boolean).join(" ");
|
|
6
|
+
}
|
|
7
|
+
const VisuallyHidden = forwardRef(
|
|
8
|
+
({ as: Component = "span", className, ...props }, ref) => /* @__PURE__ */ jsx(Component, { ref, ...props, className: mergeClassName(visuallyHiddenRecipe(), className) })
|
|
9
|
+
);
|
|
10
|
+
VisuallyHidden.displayName = "VisuallyHidden";
|
|
11
|
+
export {
|
|
12
|
+
VisuallyHidden
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=VisuallyHidden.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/VisuallyHidden.tsx"],"sourcesContent":["import { forwardRef, type ComponentPropsWithoutRef, type ElementType } from 'react';\nimport { visuallyHidden as visuallyHiddenRecipe } from '@becket-ui/tokens/recipes';\n\nexport type VisuallyHiddenProps = ComponentPropsWithoutRef<'span'> & {\n as?: ElementType;\n};\n\nfunction mergeClassName(...classes: (string | undefined)[]): string {\n return classes.filter(Boolean).join(' ');\n}\n\n/** Text for screen readers only, e.g. a label for an icon-only control. */\nexport const VisuallyHidden = forwardRef<HTMLElement, VisuallyHiddenProps>(\n ({ as: Component = 'span', className, ...props }, ref) => (\n <Component ref={ref} {...props} className={mergeClassName(visuallyHiddenRecipe(), className)} />\n ),\n);\n\nVisuallyHidden.displayName = 'VisuallyHidden';\n"],"mappings":"AAcI;AAdJ,SAAS,kBAAmE;AAC5E,SAAS,kBAAkB,4BAA4B;AAMvD,SAAS,kBAAkB,SAAyC;AAClE,SAAO,QAAQ,OAAO,OAAO,EAAE,KAAK,GAAG;AACzC;AAGO,MAAM,iBAAiB;AAAA,EAC5B,CAAC,EAAE,IAAI,YAAY,QAAQ,WAAW,GAAG,MAAM,GAAG,QAChD,oBAAC,aAAU,KAAW,GAAG,OAAO,WAAW,eAAe,qBAAqB,GAAG,SAAS,GAAG;AAElG;AAEA,eAAe,cAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storybookImages.d.ts","sourceRoot":"","sources":["../../src/helpers/storybookImages.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,gBAAgB,QAE5B,CAAC;AAEF,eAAO,MAAM,eAAe,QAI3B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const svg = (body, width = 640, height = 360) => `data:image/svg+xml;utf8,${encodeURIComponent(
|
|
2
|
+
`<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}" viewBox="0 0 ${width} ${height}">${body}</svg>`
|
|
3
|
+
)}`;
|
|
4
|
+
const SAMPLE_LANDSCAPE = svg(
|
|
5
|
+
'<defs><linearGradient id="g" x1="0" x2="1" y1="0" y2="1"><stop offset="0" stop-color="#e3a21a"/><stop offset="1" stop-color="#c25a1c"/></linearGradient></defs><rect width="640" height="360" fill="url(#g)"/><circle cx="470" cy="120" r="56" fill="#fff4d6" opacity="0.85"/><path d="M0 300 L180 170 L320 280 L440 200 L640 320 L640 360 L0 360 Z" fill="#3a2d1c" opacity="0.8"/>'
|
|
6
|
+
);
|
|
7
|
+
const SAMPLE_PORTRAIT = svg(
|
|
8
|
+
'<rect width="160" height="160" fill="#8aa05a"/><circle cx="80" cy="64" r="30" fill="#f4ecd8"/><path d="M24 160 C30 112 130 112 136 160 Z" fill="#f4ecd8"/>',
|
|
9
|
+
160,
|
|
10
|
+
160
|
|
11
|
+
);
|
|
12
|
+
export {
|
|
13
|
+
SAMPLE_LANDSCAPE,
|
|
14
|
+
SAMPLE_PORTRAIT
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=storybookImages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/helpers/storybookImages.ts"],"sourcesContent":["/**\n * Story-only sample images as data URIs, so stories render in Storybook and in\n * Claude Design previews without hosting files. Not exported from the package.\n */\nconst svg = (body: string, width = 640, height = 360) =>\n `data:image/svg+xml;utf8,${encodeURIComponent(\n `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"${width}\" height=\"${height}\" viewBox=\"0 0 ${width} ${height}\">${body}</svg>`,\n )}`;\n\nexport const SAMPLE_LANDSCAPE = svg(\n '<defs><linearGradient id=\"g\" x1=\"0\" x2=\"1\" y1=\"0\" y2=\"1\"><stop offset=\"0\" stop-color=\"#e3a21a\"/><stop offset=\"1\" stop-color=\"#c25a1c\"/></linearGradient></defs><rect width=\"640\" height=\"360\" fill=\"url(#g)\"/><circle cx=\"470\" cy=\"120\" r=\"56\" fill=\"#fff4d6\" opacity=\"0.85\"/><path d=\"M0 300 L180 170 L320 280 L440 200 L640 320 L640 360 L0 360 Z\" fill=\"#3a2d1c\" opacity=\"0.8\"/>',\n);\n\nexport const SAMPLE_PORTRAIT = svg(\n '<rect width=\"160\" height=\"160\" fill=\"#8aa05a\"/><circle cx=\"80\" cy=\"64\" r=\"30\" fill=\"#f4ecd8\"/><path d=\"M24 160 C30 112 130 112 136 160 Z\" fill=\"#f4ecd8\"/>',\n 160,\n 160,\n);\n"],"mappings":"AAIA,MAAM,MAAM,CAAC,MAAc,QAAQ,KAAK,SAAS,QAC/C,2BAA2B;AAAA,EACzB,kDAAkD,KAAK,aAAa,MAAM,kBAAkB,KAAK,IAAI,MAAM,KAAK,IAAI;AACtH,CAAC;AAEI,MAAM,mBAAmB;AAAA,EAC9B;AACF;AAEO,MAAM,kBAAkB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AACF;","names":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -37,6 +37,27 @@ export { CheckIcon, ChevronDownIcon, ChevronRightIcon, CloseIcon, CopyIcon, Exte
|
|
|
37
37
|
export type { GlyphProps } from './components/Glyphs.js';
|
|
38
38
|
export { Link } from './components/Link.js';
|
|
39
39
|
export { Prose } from './components/Prose.js';
|
|
40
|
+
export { List, ListItem } from './components/List.js';
|
|
41
|
+
export type { ListProps, ListItemProps } from './components/List.js';
|
|
42
|
+
export { Code } from './components/Code.js';
|
|
43
|
+
export { Kbd } from './components/Kbd.js';
|
|
44
|
+
export { Mark } from './components/Mark.js';
|
|
45
|
+
export { Blockquote, BlockquoteCaption } from './components/Blockquote.js';
|
|
46
|
+
export type { BlockquoteProps, BlockquoteCaptionProps } from './components/Blockquote.js';
|
|
47
|
+
export { Image } from './components/Image.js';
|
|
48
|
+
export type { ImageProps } from './components/Image.js';
|
|
49
|
+
export { Figure } from './components/Figure.js';
|
|
50
|
+
export type { FigureProps } from './components/Figure.js';
|
|
51
|
+
export { Avatar } from './components/Avatar.js';
|
|
52
|
+
export type { AvatarProps } from './components/Avatar.js';
|
|
53
|
+
export { SkipLink } from './components/SkipLink.js';
|
|
54
|
+
export { VisuallyHidden } from './components/VisuallyHidden.js';
|
|
55
|
+
export { Center } from './components/Center.js';
|
|
56
|
+
export type { CenterProps } from './components/Center.js';
|
|
57
|
+
export { Grid, GridItem } from './components/Grid.js';
|
|
58
|
+
export type { GridProps, GridItemProps } from './components/Grid.js';
|
|
59
|
+
export { AspectRatio } from './components/AspectRatio.js';
|
|
60
|
+
export type { AspectRatioProps } from './components/AspectRatio.js';
|
|
40
61
|
export type { ProseProps } from './components/Prose.js';
|
|
41
62
|
export { Separator } from './components/Separator.js';
|
|
42
63
|
export type { LabelCustomColors, LabelVisual } from './helpers/labelColors.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EACL,KAAK,EACL,UAAU,EACV,WAAW,EACX,UAAU,EACV,YAAY,EACZ,WAAW,EACX,aAAa,EACb,QAAQ,GACT,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,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,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC5E,YAAY,EACV,UAAU,EACV,eAAe,EACf,aAAa,EACb,eAAe,EACf,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,eAAe,EACf,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,sBAAsB,EACtB,aAAa,EACb,wBAAwB,EACxB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -87,6 +87,19 @@ import {
|
|
|
87
87
|
} from "./components/Glyphs.js";
|
|
88
88
|
import { Link } from "./components/Link.js";
|
|
89
89
|
import { Prose } from "./components/Prose.js";
|
|
90
|
+
import { List, ListItem } from "./components/List.js";
|
|
91
|
+
import { Code } from "./components/Code.js";
|
|
92
|
+
import { Kbd } from "./components/Kbd.js";
|
|
93
|
+
import { Mark } from "./components/Mark.js";
|
|
94
|
+
import { Blockquote, BlockquoteCaption } from "./components/Blockquote.js";
|
|
95
|
+
import { Image } from "./components/Image.js";
|
|
96
|
+
import { Figure } from "./components/Figure.js";
|
|
97
|
+
import { Avatar } from "./components/Avatar.js";
|
|
98
|
+
import { SkipLink } from "./components/SkipLink.js";
|
|
99
|
+
import { VisuallyHidden } from "./components/VisuallyHidden.js";
|
|
100
|
+
import { Center } from "./components/Center.js";
|
|
101
|
+
import { Grid, GridItem } from "./components/Grid.js";
|
|
102
|
+
import { AspectRatio } from "./components/AspectRatio.js";
|
|
90
103
|
import { Separator } from "./components/Separator.js";
|
|
91
104
|
import {
|
|
92
105
|
BREAKPOINTS,
|
|
@@ -98,8 +111,12 @@ import {
|
|
|
98
111
|
resolveBreakpointAlias
|
|
99
112
|
} from "./helpers/responsive.js";
|
|
100
113
|
export {
|
|
114
|
+
AspectRatio,
|
|
115
|
+
Avatar,
|
|
101
116
|
BREAKPOINTS,
|
|
102
117
|
Badge,
|
|
118
|
+
Blockquote,
|
|
119
|
+
BlockquoteCaption,
|
|
103
120
|
Box,
|
|
104
121
|
Button,
|
|
105
122
|
Card,
|
|
@@ -108,11 +125,13 @@ export {
|
|
|
108
125
|
CardFooter,
|
|
109
126
|
CardHeader,
|
|
110
127
|
CardTitle,
|
|
128
|
+
Center,
|
|
111
129
|
CheckIcon,
|
|
112
130
|
Checkbox,
|
|
113
131
|
ChevronDownIcon,
|
|
114
132
|
ChevronRightIcon,
|
|
115
133
|
CloseIcon,
|
|
134
|
+
Code,
|
|
116
135
|
Container,
|
|
117
136
|
CopyIcon,
|
|
118
137
|
Dialog,
|
|
@@ -135,14 +154,22 @@ export {
|
|
|
135
154
|
FieldLabel,
|
|
136
155
|
FieldSelect,
|
|
137
156
|
FieldTextarea,
|
|
157
|
+
Figure,
|
|
138
158
|
Flex,
|
|
159
|
+
Grid,
|
|
160
|
+
GridItem,
|
|
139
161
|
HStack,
|
|
140
162
|
Heading,
|
|
141
163
|
Hide,
|
|
142
164
|
Icon,
|
|
165
|
+
Image,
|
|
143
166
|
InfoIcon,
|
|
167
|
+
Kbd,
|
|
144
168
|
Link,
|
|
145
169
|
LinkIcon,
|
|
170
|
+
List,
|
|
171
|
+
ListItem,
|
|
172
|
+
Mark,
|
|
146
173
|
Menu,
|
|
147
174
|
MenuIcon,
|
|
148
175
|
MenuItem,
|
|
@@ -157,6 +184,7 @@ export {
|
|
|
157
184
|
Select,
|
|
158
185
|
Separator,
|
|
159
186
|
SimpleGrid,
|
|
187
|
+
SkipLink,
|
|
160
188
|
Spinner,
|
|
161
189
|
Stack,
|
|
162
190
|
SunIcon,
|
|
@@ -185,6 +213,7 @@ export {
|
|
|
185
213
|
Tooltip,
|
|
186
214
|
Tr,
|
|
187
215
|
VStack,
|
|
216
|
+
VisuallyHidden,
|
|
188
217
|
WarningIcon,
|
|
189
218
|
normalizeGapValue,
|
|
190
219
|
normalizeResponsiveValue,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { Button } from './components/Button';\nexport { Heading } from './components/Heading';\nexport { Text } from './components/Text';\nexport { Flex } from './components/Flex';\nexport { Stack, HStack, VStack } from './components/Stack';\nexport { Tag } from './components/Tag';\nexport { Badge } from './components/Badge';\nexport { Switch } from './components/Switch';\nexport type { SwitchProps } from './components/Switch';\nexport {\n Field,\n FieldLabel,\n FieldHelper,\n FieldError,\n FieldControl,\n FieldSelect,\n FieldTextarea,\n useField,\n} from './components/Field';\nexport type { FieldSize, FieldContextValue } from './components/Field';\nexport { TextField } from './components/TextField';\nexport { Checkbox } from './components/Checkbox';\nexport { Radio, RadioGroup } from './components/Radio';\nexport type { RadioProps, RadioGroupProps } from './components/Radio';\nexport { Select } from './components/Select';\nexport { Textarea } from './components/Textarea';\nexport {\n Card,\n CardHeader,\n CardBody,\n CardFooter,\n CardTitle,\n CardDescription,\n} from './components/Card';\nexport { SimpleGrid } from './components/SimpleGrid';\nexport { Container } from './components/Container';\nexport type { ContainerProps } from './components/Container';\nexport { Box } from './components/Box';\nexport type { BoxProps } from './components/Box';\nexport { Hide } from './components/Hide';\nexport type { HideProps } from './components/Hide';\nexport { Tooltip } from './components/Tooltip';\nexport type { TooltipPlacement, TooltipProps } from './components/Tooltip';\nexport {\n Dialog,\n DialogHeader,\n DialogBody,\n DialogFooter,\n DialogTitle,\n DialogClose,\n} from './components/Dialog';\nexport {\n Drawer,\n DrawerHeader,\n DrawerBody,\n DrawerFooter,\n DrawerTitle,\n DrawerClose,\n} from './components/Drawer';\nexport { Menu, MenuItem } from './components/Menu';\nexport { Tabs, TabList, Tab, TabPanel } from './components/Tabs';\nexport {\n Table,\n TableCaption,\n TableHeader,\n TableBody,\n TableFooter,\n TableRow,\n TableColumnHeader,\n TableCell,\n Thead,\n Tbody,\n Tfoot,\n Tr,\n Th,\n Td,\n} from './components/Table';\nexport { Spinner } from './components/Spinner';\nexport { Icon } from './components/Icon';\nexport type { IconProps } from './components/Icon';\nexport {\n CheckIcon,\n ChevronDownIcon,\n ChevronRightIcon,\n CloseIcon,\n CopyIcon,\n ExternalLinkIcon,\n InfoIcon,\n LinkIcon,\n MenuIcon,\n MoonIcon,\n SearchIcon,\n SunIcon,\n WarningIcon,\n} from './components/Glyphs';\nexport type { GlyphProps } from './components/Glyphs';\nexport { Link } from './components/Link';\nexport { Prose } from './components/Prose';\nexport type { ProseProps } from './components/Prose';\nexport { Separator } from './components/Separator';\nexport type { LabelCustomColors, LabelVisual } from './helpers/labelColors';\nexport type {\n Breakpoint,\n BreakpointAlias,\n BreakpointMap,\n ResponsiveValue,\n GapValue,\n SpacingScale,\n SpacingStep,\n SpacingSemantic,\n SemanticBreakpoint,\n} from './helpers/responsive';\nexport {\n BREAKPOINTS,\n SEMANTIC_BREAKPOINTS,\n SEMANTIC_TO_BREAKPOINT,\n SPACING_SCALE,\n normalizeResponsiveValue,\n normalizeGapValue,\n resolveBreakpointAlias,\n} from './helpers/responsive';\n"],"mappings":"AAAA,SAAS,cAAc;AACvB,SAAS,eAAe;AACxB,SAAS,YAAY;AACrB,SAAS,YAAY;AACrB,SAAS,OAAO,QAAQ,cAAc;AACtC,SAAS,WAAW;AACpB,SAAS,aAAa;AACtB,SAAS,cAAc;AAEvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB;AACzB,SAAS,OAAO,kBAAkB;AAElC,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAkB;AAC3B,SAAS,iBAAiB;AAE1B,SAAS,WAAW;AAEpB,SAAS,YAAY;AAErB,SAAS,eAAe;AAExB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,MAAM,gBAAgB;AAC/B,SAAS,MAAM,SAAS,KAAK,gBAAgB;AAC7C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,eAAe;AACxB,SAAS,YAAY;AAErB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,YAAY;AACrB,SAAS,aAAa;AAEtB,SAAS,iBAAiB;AAa1B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { Button } from './components/Button';\nexport { Heading } from './components/Heading';\nexport { Text } from './components/Text';\nexport { Flex } from './components/Flex';\nexport { Stack, HStack, VStack } from './components/Stack';\nexport { Tag } from './components/Tag';\nexport { Badge } from './components/Badge';\nexport { Switch } from './components/Switch';\nexport type { SwitchProps } from './components/Switch';\nexport {\n Field,\n FieldLabel,\n FieldHelper,\n FieldError,\n FieldControl,\n FieldSelect,\n FieldTextarea,\n useField,\n} from './components/Field';\nexport type { FieldSize, FieldContextValue } from './components/Field';\nexport { TextField } from './components/TextField';\nexport { Checkbox } from './components/Checkbox';\nexport { Radio, RadioGroup } from './components/Radio';\nexport type { RadioProps, RadioGroupProps } from './components/Radio';\nexport { Select } from './components/Select';\nexport { Textarea } from './components/Textarea';\nexport {\n Card,\n CardHeader,\n CardBody,\n CardFooter,\n CardTitle,\n CardDescription,\n} from './components/Card';\nexport { SimpleGrid } from './components/SimpleGrid';\nexport { Container } from './components/Container';\nexport type { ContainerProps } from './components/Container';\nexport { Box } from './components/Box';\nexport type { BoxProps } from './components/Box';\nexport { Hide } from './components/Hide';\nexport type { HideProps } from './components/Hide';\nexport { Tooltip } from './components/Tooltip';\nexport type { TooltipPlacement, TooltipProps } from './components/Tooltip';\nexport {\n Dialog,\n DialogHeader,\n DialogBody,\n DialogFooter,\n DialogTitle,\n DialogClose,\n} from './components/Dialog';\nexport {\n Drawer,\n DrawerHeader,\n DrawerBody,\n DrawerFooter,\n DrawerTitle,\n DrawerClose,\n} from './components/Drawer';\nexport { Menu, MenuItem } from './components/Menu';\nexport { Tabs, TabList, Tab, TabPanel } from './components/Tabs';\nexport {\n Table,\n TableCaption,\n TableHeader,\n TableBody,\n TableFooter,\n TableRow,\n TableColumnHeader,\n TableCell,\n Thead,\n Tbody,\n Tfoot,\n Tr,\n Th,\n Td,\n} from './components/Table';\nexport { Spinner } from './components/Spinner';\nexport { Icon } from './components/Icon';\nexport type { IconProps } from './components/Icon';\nexport {\n CheckIcon,\n ChevronDownIcon,\n ChevronRightIcon,\n CloseIcon,\n CopyIcon,\n ExternalLinkIcon,\n InfoIcon,\n LinkIcon,\n MenuIcon,\n MoonIcon,\n SearchIcon,\n SunIcon,\n WarningIcon,\n} from './components/Glyphs';\nexport type { GlyphProps } from './components/Glyphs';\nexport { Link } from './components/Link';\nexport { Prose } from './components/Prose';\nexport { List, ListItem } from './components/List';\nexport type { ListProps, ListItemProps } from './components/List';\nexport { Code } from './components/Code';\nexport { Kbd } from './components/Kbd';\nexport { Mark } from './components/Mark';\nexport { Blockquote, BlockquoteCaption } from './components/Blockquote';\nexport type { BlockquoteProps, BlockquoteCaptionProps } from './components/Blockquote';\nexport { Image } from './components/Image';\nexport type { ImageProps } from './components/Image';\nexport { Figure } from './components/Figure';\nexport type { FigureProps } from './components/Figure';\nexport { Avatar } from './components/Avatar';\nexport type { AvatarProps } from './components/Avatar';\nexport { SkipLink } from './components/SkipLink';\nexport { VisuallyHidden } from './components/VisuallyHidden';\nexport { Center } from './components/Center';\nexport type { CenterProps } from './components/Center';\nexport { Grid, GridItem } from './components/Grid';\nexport type { GridProps, GridItemProps } from './components/Grid';\nexport { AspectRatio } from './components/AspectRatio';\nexport type { AspectRatioProps } from './components/AspectRatio';\nexport type { ProseProps } from './components/Prose';\nexport { Separator } from './components/Separator';\nexport type { LabelCustomColors, LabelVisual } from './helpers/labelColors';\nexport type {\n Breakpoint,\n BreakpointAlias,\n BreakpointMap,\n ResponsiveValue,\n GapValue,\n SpacingScale,\n SpacingStep,\n SpacingSemantic,\n SemanticBreakpoint,\n} from './helpers/responsive';\nexport {\n BREAKPOINTS,\n SEMANTIC_BREAKPOINTS,\n SEMANTIC_TO_BREAKPOINT,\n SPACING_SCALE,\n normalizeResponsiveValue,\n normalizeGapValue,\n resolveBreakpointAlias,\n} from './helpers/responsive';\n"],"mappings":"AAAA,SAAS,cAAc;AACvB,SAAS,eAAe;AACxB,SAAS,YAAY;AACrB,SAAS,YAAY;AACrB,SAAS,OAAO,QAAQ,cAAc;AACtC,SAAS,WAAW;AACpB,SAAS,aAAa;AACtB,SAAS,cAAc;AAEvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB;AACzB,SAAS,OAAO,kBAAkB;AAElC,SAAS,cAAc;AACvB,SAAS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,19 @@ Raw elements with inline styles are the most common mistake. Use this table:
|
|
|
43
43
|
| `a` | `Link` |
|
|
44
44
|
| `a` styled as a button (call to action) | `Button as="a" href="…"` (anchor props are typed) |
|
|
45
45
|
| HTML from Markdown or MDX (blog posts, docs) | `<Prose as="article">`; wrap embedded components in `data-not-prose` |
|
|
46
|
+
| `ul` / `ol` with `li` | `List` (`as="ol"` for steps, `marker="none"` for nav) + `ListItem` |
|
|
47
|
+
| inline `code`, `kbd`, `mark` | `Code`, `Kbd`, `Mark` |
|
|
48
|
+
| `blockquote` (+ attribution) | `Blockquote cite` + `BlockquoteCaption` |
|
|
49
|
+
| `img` | `Image alt` (required; lazy by default), inside `Figure caption` when captioned |
|
|
50
|
+
| profile photo or initials circle | `Avatar name src` |
|
|
51
|
+
| centered box | `Center` (`inline` for icons in text) |
|
|
52
|
+
| 12-column page layout | `Grid columns={{ base: 1, md: 12 }}` + `GridItem colSpan` |
|
|
53
|
+
| fixed-ratio media (video, map, cover image) | `AspectRatio ratio="8:5"` (`"16:9"` for video) |
|
|
54
|
+
| screen-reader-only text, skip link | `VisuallyHidden`, `SkipLink href="#main"` |
|
|
46
55
|
| custom modal, side panel, dropdown, tabs or tooltip | `Dialog`, `Drawer`, `Menu`, `Tabs`, `Tooltip` |
|
|
47
56
|
|
|
48
|
-
Raw elements are fine for semantics Becket doesn't cover (`form`, `main`, `nav`, `section
|
|
49
|
-
|
|
57
|
+
Raw elements are fine for semantics Becket doesn't cover (`form`, `main`, `nav`, `section`). Render
|
|
58
|
+
them through a layout component's `as` prop when they also lay things out:
|
|
50
59
|
`<VStack as="form" gap="md">`.
|
|
51
60
|
|
|
52
61
|
**Known gaps** (until these ship, an inline `style` with tokens is allowed, with a `TODO` naming the
|
|
@@ -62,10 +71,16 @@ Style with component props, written inline where the component is used. That's B
|
|
|
62
71
|
language: `gap`, `align`, `justify`, `visual`, `size`, `invalid`, `columns`.
|
|
63
72
|
|
|
64
73
|
- **Spacing:** semantic `gap="xs|sm|md|lg|xl"` (or the Fibonacci steps `1 2 3 5 8 13 21 34`). Never
|
|
65
|
-
pixel numbers
|
|
74
|
+
pixel numbers, and never Panda's in-between keys (`4`, `6`, `10`, `12`): they exist but are off
|
|
75
|
+
the scale.
|
|
76
|
+
- **Sizes and ratios:** use the component's `size` prop rather than a width, since its steps are
|
|
77
|
+
already on the scale. For fixed media, use the Fibonacci ratios (`AspectRatio ratio="3:2|8:5|13:8"`,
|
|
78
|
+
or a portrait flip such as `"5:8"`), and `"16:9"` only for video. Don't bring in sizes or ratios
|
|
79
|
+
from another system (`4:3`, 40px avatars).
|
|
66
80
|
- **When you need your own CSS** (a known gap above, or a one-off like `minWidth: 0`), use token
|
|
67
81
|
variables: `var(--beckui--colors-muted)`, `var(--beckui--spacing-lg)`, `var(--beckui--sizes-4xl)`,
|
|
68
|
-
`var(--beckui--radii-md)
|
|
82
|
+
`var(--beckui--radii-md)`; inside running text, `var(--beckui--spacing-text-2)` (em-based). Never hex,
|
|
83
|
+
`rgb()`, or raw `px`/`rem`/`em` values for spacing and color, since they ignore the app's theme overrides.
|
|
69
84
|
- **Must not** write or copy `.beckui--*` class names. They're generated, not API.
|
|
70
85
|
- **Avoid** named styled wrappers, CSS files per screen, or style objects defined away from the
|
|
71
86
|
element. A reader shouldn't have to look anything up to see how an element looks.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@becket-ui/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Becket React component library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@becket-ui/tokens": "^0.
|
|
41
|
+
"@becket-ui/tokens": "^0.4.0",
|
|
42
42
|
"react": ">=19",
|
|
43
43
|
"react-dom": ">=19"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@becket-ui/a11y": "0.0.0",
|
|
47
|
-
"@becket-ui/tokens": "0.
|
|
47
|
+
"@becket-ui/tokens": "0.4.0",
|
|
48
48
|
"@pandacss/dev": "^1.12.1",
|
|
49
49
|
"@storybook/react": "^10.6.0",
|
|
50
50
|
"@storybook/react-vite": "^10.6.0",
|