neatkit 0.1.0 → 0.2.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/README.md +7 -5
- package/dist/components/Alert/Alert.d.ts +29 -0
- package/dist/components/Alert/index.d.ts +2 -0
- package/dist/components/Avatar/Avatar.d.ts +28 -0
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/Badge/Badge.d.ts +32 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Button/Button.d.ts +58 -8
- package/dist/components/Button/index.d.ts +2 -3
- package/dist/components/Card/Card.d.ts +40 -0
- package/dist/components/Card/index.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.d.ts +35 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +62 -0
- package/dist/components/CheckboxGroup/contexts/CheckboxGroupContext.d.ts +22 -0
- package/dist/components/CheckboxGroup/hooks/useCheckboxGroup.d.ts +7 -0
- package/dist/components/CheckboxGroup/index.d.ts +2 -0
- package/dist/components/Content/Content.d.ts +58 -0
- package/dist/components/Content/hooks/useContentLayout.d.ts +18 -0
- package/dist/components/Content/index.d.ts +2 -0
- package/dist/components/Content/utils/layout.d.ts +11 -0
- package/dist/components/Divider/Divider.d.ts +30 -0
- package/dist/components/Divider/index.d.ts +2 -0
- package/dist/components/Field/Field.d.ts +61 -0
- package/dist/components/Field/index.d.ts +2 -0
- package/dist/components/Field/utils/field-control.d.ts +23 -0
- package/dist/components/Icon/Icon.d.ts +21 -0
- package/dist/components/Icon/icons/ArrowLeftIcon.d.ts +11 -0
- package/dist/components/Icon/icons/ArrowRightIcon.d.ts +11 -0
- package/dist/components/Icon/icons/ArticlesIcon.d.ts +11 -0
- package/dist/components/Icon/icons/AudioIcon.d.ts +11 -0
- package/dist/components/Icon/icons/BranchIcon.d.ts +11 -0
- package/dist/components/Icon/icons/BurgerIcon.d.ts +11 -0
- package/dist/components/Icon/icons/CameraIcon.d.ts +11 -0
- package/dist/components/Icon/icons/ChatIcon.d.ts +11 -0
- package/dist/components/Icon/icons/CheckmarkIcon.d.ts +11 -0
- package/dist/components/Icon/icons/ChevronDownIcon.d.ts +11 -0
- package/dist/components/Icon/icons/ChevronLeftIcon.d.ts +11 -0
- package/dist/components/Icon/icons/ChevronRightIcon.d.ts +11 -0
- package/dist/components/Icon/icons/ChevronUpIcon.d.ts +11 -0
- package/dist/components/Icon/icons/CommitIcon.d.ts +11 -0
- package/dist/components/Icon/icons/CrossIcon.d.ts +11 -0
- package/dist/components/Icon/icons/DownloadIcon.d.ts +11 -0
- package/dist/components/Icon/icons/DuplicateIcon.d.ts +11 -0
- package/dist/components/Icon/icons/ExitIcon.d.ts +11 -0
- package/dist/components/Icon/icons/EyeIcon.d.ts +11 -0
- package/dist/components/Icon/icons/EyeOffIcon.d.ts +11 -0
- package/dist/components/Icon/icons/FileIcon.d.ts +11 -0
- package/dist/components/Icon/icons/FolderIcon.d.ts +11 -0
- package/dist/components/Icon/icons/GitIcon.d.ts +11 -0
- package/dist/components/Icon/icons/GithubIcon.d.ts +11 -0
- package/dist/components/Icon/icons/GlobeIcon.d.ts +11 -0
- package/dist/components/Icon/icons/HardwareIcon.d.ts +11 -0
- package/dist/components/Icon/icons/HomeIcon.d.ts +11 -0
- package/dist/components/Icon/icons/InfoIcon.d.ts +11 -0
- package/dist/components/Icon/icons/KeyIcon.d.ts +11 -0
- package/dist/components/Icon/icons/LinkedInIcon.d.ts +11 -0
- package/dist/components/Icon/icons/MailIcon.d.ts +11 -0
- package/dist/components/Icon/icons/MinusIcon.d.ts +11 -0
- package/dist/components/Icon/icons/PencilIcon.d.ts +11 -0
- package/dist/components/Icon/icons/PlusIcon.d.ts +11 -0
- package/dist/components/Icon/icons/ProjectsIcon.d.ts +11 -0
- package/dist/components/Icon/icons/QRCodeIcon.d.ts +11 -0
- package/dist/components/Icon/icons/RedditIcon.d.ts +11 -0
- package/dist/components/Icon/icons/RepositoryIcon.d.ts +11 -0
- package/dist/components/Icon/icons/SaveIcon.d.ts +11 -0
- package/dist/components/Icon/icons/SignalIcon.d.ts +11 -0
- package/dist/components/Icon/icons/TagIcon.d.ts +11 -0
- package/dist/components/Icon/icons/UserIcon.d.ts +11 -0
- package/dist/components/Icon/icons/WarningIcon.d.ts +11 -0
- package/dist/components/Icon/icons/WindowIcon.d.ts +11 -0
- package/dist/components/Icon/icons/types.d.ts +3 -0
- package/dist/components/Icon/index.d.ts +36 -0
- package/dist/components/Icon/utils/registry.d.ts +49 -0
- package/dist/components/Input/Input.d.ts +50 -0
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Modal/Modal.d.ts +62 -0
- package/dist/components/Modal/index.d.ts +2 -0
- package/dist/components/PinInput/PinInput.d.ts +76 -0
- package/dist/components/PinInput/hooks/usePinInput.d.ts +65 -0
- package/dist/components/PinInput/index.d.ts +2 -0
- package/dist/components/Popover/Popover.d.ts +93 -0
- package/dist/components/Popover/index.d.ts +2 -0
- package/dist/components/Portal/Portal.d.ts +19 -0
- package/dist/components/Portal/contexts/FocusScopeContext.d.ts +7 -0
- package/dist/components/Portal/hooks/useDismissableLayer.d.ts +31 -0
- package/dist/components/Portal/hooks/useFloatingPosition.d.ts +12 -0
- package/dist/components/Portal/hooks/useFocusTrap.d.ts +24 -0
- package/dist/components/Portal/hooks/usePresence.d.ts +19 -0
- package/dist/components/Portal/hooks/useScrollLock.d.ts +7 -0
- package/dist/components/Portal/utils/floating-position.d.ts +26 -0
- package/dist/components/Portal/utils/overlay-stack.d.ts +45 -0
- package/dist/components/Radio/Radio.d.ts +32 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +54 -0
- package/dist/components/RadioGroup/contexts/RadioGroupContext.d.ts +18 -0
- package/dist/components/RadioGroup/hooks/useRadioGroup.d.ts +7 -0
- package/dist/components/RadioGroup/index.d.ts +2 -0
- package/dist/components/Select/Select.d.ts +97 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Skeleton/Skeleton.d.ts +30 -0
- package/dist/components/Skeleton/index.d.ts +2 -0
- package/dist/components/Spinner/Spinner.d.ts +24 -0
- package/dist/components/Spinner/index.d.ts +2 -0
- package/dist/components/Surface/Surface.d.ts +15 -0
- package/dist/components/Switch/Switch.d.ts +27 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Text/Text.d.ts +41 -0
- package/dist/components/Text/index.d.ts +2 -0
- package/dist/components/TextArea/TextArea.d.ts +40 -0
- package/dist/components/TextArea/index.d.ts +2 -0
- package/dist/components/Tooltip/Tooltip.d.ts +54 -0
- package/dist/components/Tooltip/TooltipProvider.d.ts +24 -0
- package/dist/components/Tooltip/index.d.ts +4 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +25 -3
- package/dist/index.js +3870 -12
- package/dist/style.css +1 -1
- package/dist/utils/aria.d.ts +18 -0
- package/dist/utils/react-reference.d.ts +16 -0
- package/package.json +18 -3
- package/dist/components/Button/Button.d.ts.map +0 -1
- package/dist/components/Button/index.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<source media="(prefers-color-scheme: dark)" srcset=".assets/banner/dark-mode.png">
|
|
4
4
|
<source media="(prefers-color-scheme: light)" srcset=".assets/banner/light-mode.png">
|
|
5
5
|
<!-- Fallback to light mode variant if no match -->
|
|
6
|
-
<img
|
|
6
|
+
<img src=".assets/banner/light-mode.png">
|
|
7
7
|
</picture>
|
|
8
8
|
|
|
9
9
|
######
|
|
@@ -27,13 +27,15 @@ them:
|
|
|
27
27
|
|
|
28
28
|
```tsx
|
|
29
29
|
import "neatkit/style.css";
|
|
30
|
-
import { Button } from "neatkit";
|
|
30
|
+
import { Button, Content } from "neatkit";
|
|
31
31
|
|
|
32
32
|
export function App() {
|
|
33
33
|
return (
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
<Content as="main" fill="viewport">
|
|
35
|
+
<Button shape="rectangle" variant="primary">
|
|
36
|
+
Get started
|
|
37
|
+
</Button>
|
|
38
|
+
</Content>
|
|
37
39
|
);
|
|
38
40
|
}
|
|
39
41
|
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
import "./styles/alert.css";
|
|
3
|
+
/** A type representing the semantic color treatment applied to an Alert. */
|
|
4
|
+
export type AlertTone = "danger" | "info" | "success" | "warning";
|
|
5
|
+
/** A type representing properties for the Alert component. */
|
|
6
|
+
export type AlertProps = HTMLAttributes<HTMLDivElement> & {
|
|
7
|
+
/** The contextual feedback displayed inside the Alert. */
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
/** The semantic color treatment applied to the Alert indicator. */
|
|
10
|
+
tone?: AlertTone;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Renders a contextual feedback message with a semantic color indicator.
|
|
14
|
+
*
|
|
15
|
+
* Alert does not create a live region by default. Consumers can provide a
|
|
16
|
+
* native role such as `alert` or `status` when feedback requires announcement.
|
|
17
|
+
*
|
|
18
|
+
* @param props - The properties that configure the Alert.
|
|
19
|
+
* @param forwardedReference - The reference assigned to the Alert element.
|
|
20
|
+
*
|
|
21
|
+
* @returns The rendered Alert message.
|
|
22
|
+
*/
|
|
23
|
+
declare const Alert: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
24
|
+
/** The contextual feedback displayed inside the Alert. */
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
/** The semantic color treatment applied to the Alert indicator. */
|
|
27
|
+
tone?: AlertTone;
|
|
28
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
29
|
+
export default Alert;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "react";
|
|
2
|
+
import "./styles/avatar.css";
|
|
3
|
+
/** A type representing properties for the Avatar component. */
|
|
4
|
+
export type AvatarProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
5
|
+
/** The alternative text, or an empty value for a decorative image. */
|
|
6
|
+
alt?: string;
|
|
7
|
+
/** The image source displayed until loading fails. */
|
|
8
|
+
image?: string;
|
|
9
|
+
/** The CSS-compatible Avatar diameter. */
|
|
10
|
+
size?: number | string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Renders a stable circular image with a deterministic fallback initial.
|
|
14
|
+
*
|
|
15
|
+
* @param props - The properties that configure the Avatar.
|
|
16
|
+
* @param forwardedReference - The reference assigned to the rendered element.
|
|
17
|
+
*
|
|
18
|
+
* @returns The rendered Avatar.
|
|
19
|
+
*/
|
|
20
|
+
declare const Avatar: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
21
|
+
/** The alternative text, or an empty value for a decorative image. */
|
|
22
|
+
alt?: string;
|
|
23
|
+
/** The image source displayed until loading fails. */
|
|
24
|
+
image?: string;
|
|
25
|
+
/** The CSS-compatible Avatar diameter. */
|
|
26
|
+
size?: number | string;
|
|
27
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
28
|
+
export default Avatar;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
import "./styles/badge.css";
|
|
3
|
+
/** A type representing the visual emphasis applied to a Badge. */
|
|
4
|
+
export type BadgeVariant = "outline" | "soft" | "solid";
|
|
5
|
+
/** A type representing the semantic color treatment applied to a Badge. */
|
|
6
|
+
export type BadgeTone = "neutral" | "success" | "warning" | "danger";
|
|
7
|
+
/** A type representing properties for the Badge component. */
|
|
8
|
+
export type BadgeProps = HTMLAttributes<HTMLSpanElement> & {
|
|
9
|
+
/** The label content displayed within the Badge. */
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
/** The visual emphasis applied to the Badge. */
|
|
12
|
+
variant?: BadgeVariant;
|
|
13
|
+
/** The semantic color treatment applied to the Badge. */
|
|
14
|
+
tone?: BadgeTone;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Renders a compact, non-interactive classification or status label.
|
|
18
|
+
*
|
|
19
|
+
* @param props - The properties that configure the Badge.
|
|
20
|
+
* @param forwardedReference - The reference assigned to the rendered element.
|
|
21
|
+
*
|
|
22
|
+
* @returns The rendered Badge.
|
|
23
|
+
*/
|
|
24
|
+
declare const Badge: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLSpanElement> & {
|
|
25
|
+
/** The label content displayed within the Badge. */
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
/** The visual emphasis applied to the Badge. */
|
|
28
|
+
variant?: BadgeVariant;
|
|
29
|
+
/** The semantic color treatment applied to the Badge. */
|
|
30
|
+
tone?: BadgeTone;
|
|
31
|
+
} & import("react").RefAttributes<HTMLSpanElement>>;
|
|
32
|
+
export default Badge;
|
|
@@ -1,11 +1,61 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import "
|
|
1
|
+
import type { ComponentPropsWithRef, ComponentPropsWithoutRef, ElementType, ReactElement, ReactNode } from "react";
|
|
2
|
+
import type { IconType } from "../Icon";
|
|
3
|
+
import "./styles/button.css";
|
|
4
|
+
/** A type representing the visual treatment of a Button. */
|
|
3
5
|
export type ButtonVariant = "primary" | "secondary" | "ghost";
|
|
4
|
-
|
|
5
|
-
export type
|
|
6
|
-
|
|
6
|
+
/** A type representing the semantic intent applied to a Button. */
|
|
7
|
+
export type ButtonTone = "danger" | "success" | "warning";
|
|
8
|
+
/** A type representing the outline shape of a Button. */
|
|
9
|
+
export type ButtonShape = "rectangle" | "capsule";
|
|
10
|
+
/** A type representing the placement of a Button icon. */
|
|
11
|
+
export type ButtonIconAlignment = "left" | "right";
|
|
12
|
+
/** A type representing the horizontal alignment of Button contents. */
|
|
13
|
+
export type ButtonTextAlignment = "left" | "center" | "right";
|
|
14
|
+
/** A type representing Button-specific properties. */
|
|
15
|
+
type ButtonOwnProps = {
|
|
16
|
+
/** The content displayed inside the Button. */
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
/** The visual treatment applied to the Button. */
|
|
7
19
|
variant?: ButtonVariant;
|
|
8
|
-
|
|
20
|
+
/** The semantic intent applied to the Button. */
|
|
21
|
+
tone?: ButtonTone;
|
|
22
|
+
/** The outline shape applied to the Button. */
|
|
23
|
+
shape: ButtonShape;
|
|
24
|
+
/** Whether the Button fills its containing block. */
|
|
25
|
+
fullWidth?: boolean;
|
|
26
|
+
/** Whether the Button displays a loading indicator and blocks interaction. */
|
|
27
|
+
loading?: boolean;
|
|
28
|
+
/** Whether the Button blocks user interaction. */
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The icon displayed alongside the Button content.
|
|
32
|
+
*
|
|
33
|
+
* @warning When no children are provided, set `aria-label` or
|
|
34
|
+
* `aria-labelledby` to describe the action to assistive technology.
|
|
35
|
+
*/
|
|
36
|
+
icon?: IconType;
|
|
37
|
+
/** The side of the content where the icon is displayed. */
|
|
38
|
+
iconAlignment?: ButtonIconAlignment;
|
|
39
|
+
/** The horizontal alignment applied to the Button contents. */
|
|
40
|
+
textAlignment?: ButtonTextAlignment;
|
|
9
41
|
};
|
|
10
|
-
|
|
11
|
-
|
|
42
|
+
/** A type representing the reference accepted by a polymorphic element. */
|
|
43
|
+
type ButtonReference<Component extends ElementType> = ComponentPropsWithRef<Component>["ref"];
|
|
44
|
+
/** A type representing properties for a polymorphic Button element. */
|
|
45
|
+
export type ButtonProps<Component extends ElementType = "button"> = ButtonOwnProps & {
|
|
46
|
+
as?: Component;
|
|
47
|
+
} & Omit<ComponentPropsWithoutRef<Component>, keyof ButtonOwnProps | "as">;
|
|
48
|
+
/** A type representing the public polymorphic Button component. */
|
|
49
|
+
type ButtonComponent = <Component extends ElementType = "button">(props: ButtonProps<Component> & {
|
|
50
|
+
ref?: ButtonReference<Component>;
|
|
51
|
+
}) => ReactElement | null;
|
|
52
|
+
/**
|
|
53
|
+
* Renders an action control with visual, loading, and polymorphic options.
|
|
54
|
+
*
|
|
55
|
+
* @param props - The properties that configure the Button.
|
|
56
|
+
* @param forwardedReference - The reference assigned to the rendered element.
|
|
57
|
+
*
|
|
58
|
+
* @returns The rendered Button element.
|
|
59
|
+
*/
|
|
60
|
+
declare const Button: ButtonComponent;
|
|
61
|
+
export default Button;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export { Button } from "./Button";
|
|
2
|
-
export type { ButtonProps } from "./Button";
|
|
3
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export { default as Button } from "./Button";
|
|
2
|
+
export type { ButtonIconAlignment, ButtonProps, ButtonShape, ButtonTextAlignment, ButtonTone, ButtonVariant, } from "./Button";
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
import "./styles/card.css";
|
|
3
|
+
/** A type representing the optional labels displayed in a Card header. */
|
|
4
|
+
export type CardHeader = {
|
|
5
|
+
/** The primary label displayed in the Card header. */
|
|
6
|
+
title: string;
|
|
7
|
+
/** The secondary label displayed after the primary label. */
|
|
8
|
+
subtitle?: string;
|
|
9
|
+
};
|
|
10
|
+
/** A type representing the internal spacing applied by a Card. */
|
|
11
|
+
export type CardSpacing = "none" | "standard";
|
|
12
|
+
/** A type representing properties for the Card component. */
|
|
13
|
+
export type CardProps = HTMLAttributes<HTMLDivElement> & {
|
|
14
|
+
/** The content displayed inside the Card. */
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
/** The optional fixed-format labels displayed above the Card content. */
|
|
17
|
+
header?: CardHeader;
|
|
18
|
+
/** The internal spacing applied to the Card content region. */
|
|
19
|
+
spacing?: CardSpacing;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Renders a bordered surface for grouping related content.
|
|
23
|
+
*
|
|
24
|
+
* A header moves spacing into a private content region beneath its labels.
|
|
25
|
+
* Spacing can be removed for custom full-bleed layouts.
|
|
26
|
+
*
|
|
27
|
+
* @param props - The properties that configure the Card.
|
|
28
|
+
* @param forwardedReference - The reference assigned to the Card element.
|
|
29
|
+
*
|
|
30
|
+
* @returns The rendered Card surface.
|
|
31
|
+
*/
|
|
32
|
+
declare const Card: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
33
|
+
/** The content displayed inside the Card. */
|
|
34
|
+
children: ReactNode;
|
|
35
|
+
/** The optional fixed-format labels displayed above the Card content. */
|
|
36
|
+
header?: CardHeader;
|
|
37
|
+
/** The internal spacing applied to the Card content region. */
|
|
38
|
+
spacing?: CardSpacing;
|
|
39
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
40
|
+
export default Card;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { CSSProperties, InputHTMLAttributes, ReactNode } from "react";
|
|
2
|
+
import "./styles/checkbox.css";
|
|
3
|
+
/** A type representing properties for the Checkbox component. */
|
|
4
|
+
export type CheckboxProps = Omit<InputHTMLAttributes<HTMLInputElement>, "children" | "className" | "style" | "type"> & {
|
|
5
|
+
/** The optional clickable and accessible label for the Checkbox. */
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
/** The additional class name applied to the Checkbox label root. */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Whether the Checkbox exposes an invalid semantic and visual state. */
|
|
10
|
+
invalid?: boolean;
|
|
11
|
+
/** The inline styles applied to the Checkbox label root. */
|
|
12
|
+
style?: CSSProperties;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Renders a labelled native form choice.
|
|
16
|
+
*
|
|
17
|
+
* Checkbox represents a form choice, while Switch represents an immediate
|
|
18
|
+
* change between two settings.
|
|
19
|
+
*
|
|
20
|
+
* @param props - The properties that configure the Checkbox.
|
|
21
|
+
* @param forwardedReference - The reference assigned to the native input.
|
|
22
|
+
*
|
|
23
|
+
* @returns The rendered Checkbox control.
|
|
24
|
+
*/
|
|
25
|
+
declare const Checkbox: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "className" | "style" | "children" | "type"> & {
|
|
26
|
+
/** The optional clickable and accessible label for the Checkbox. */
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
/** The additional class name applied to the Checkbox label root. */
|
|
29
|
+
className?: string;
|
|
30
|
+
/** Whether the Checkbox exposes an invalid semantic and visual state. */
|
|
31
|
+
invalid?: boolean;
|
|
32
|
+
/** The inline styles applied to the Checkbox label root. */
|
|
33
|
+
style?: CSSProperties;
|
|
34
|
+
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
35
|
+
export default Checkbox;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { ChangeEventHandler, HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
import "./styles/checkbox-group.css";
|
|
3
|
+
/** A type representing the visual direction of Checkbox options. */
|
|
4
|
+
export type CheckboxGroupOrientation = "horizontal" | "vertical";
|
|
5
|
+
/** A type representing properties for the CheckboxGroup component. */
|
|
6
|
+
export type CheckboxGroupProps = Omit<HTMLAttributes<HTMLDivElement>, "children" | "defaultValue" | "onChange"> & {
|
|
7
|
+
/**
|
|
8
|
+
* The direct Checkbox options or fragments belonging to the group.
|
|
9
|
+
*
|
|
10
|
+
* CheckboxGroup owns each option's checked, defaultChecked, and name state.
|
|
11
|
+
*/
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
/** The initially selected values for uncontrolled usage. */
|
|
14
|
+
defaultValue?: readonly string[];
|
|
15
|
+
/** Whether every Checkbox in the group is disabled. */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/** Whether the group exposes an invalid semantic and visual state. */
|
|
18
|
+
invalid?: boolean;
|
|
19
|
+
/** The native form name shared by every Checkbox in the group. */
|
|
20
|
+
name: string;
|
|
21
|
+
/** The native change callback invoked by Checkbox selection. */
|
|
22
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
23
|
+
/** The direction in which Checkbox options are arranged. */
|
|
24
|
+
orientation?: CheckboxGroupOrientation;
|
|
25
|
+
/** Whether the group requires at least one enabled selected option. */
|
|
26
|
+
required?: boolean;
|
|
27
|
+
/** The selected values for controlled usage. */
|
|
28
|
+
value?: readonly string[];
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Renders a native Checkbox group with shared form and validation state.
|
|
32
|
+
*
|
|
33
|
+
* @param props - The properties that configure the CheckboxGroup.
|
|
34
|
+
* @param forwardedReference - The reference assigned to the group root.
|
|
35
|
+
*
|
|
36
|
+
* @returns The rendered CheckboxGroup.
|
|
37
|
+
*/
|
|
38
|
+
declare const CheckboxGroup: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" | "children" | "onChange"> & {
|
|
39
|
+
/**
|
|
40
|
+
* The direct Checkbox options or fragments belonging to the group.
|
|
41
|
+
*
|
|
42
|
+
* CheckboxGroup owns each option's checked, defaultChecked, and name state.
|
|
43
|
+
*/
|
|
44
|
+
children: ReactNode;
|
|
45
|
+
/** The initially selected values for uncontrolled usage. */
|
|
46
|
+
defaultValue?: readonly string[];
|
|
47
|
+
/** Whether every Checkbox in the group is disabled. */
|
|
48
|
+
disabled?: boolean;
|
|
49
|
+
/** Whether the group exposes an invalid semantic and visual state. */
|
|
50
|
+
invalid?: boolean;
|
|
51
|
+
/** The native form name shared by every Checkbox in the group. */
|
|
52
|
+
name: string;
|
|
53
|
+
/** The native change callback invoked by Checkbox selection. */
|
|
54
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
55
|
+
/** The direction in which Checkbox options are arranged. */
|
|
56
|
+
orientation?: CheckboxGroupOrientation;
|
|
57
|
+
/** Whether the group requires at least one enabled selected option. */
|
|
58
|
+
required?: boolean;
|
|
59
|
+
/** The selected values for controlled usage. */
|
|
60
|
+
value?: readonly string[];
|
|
61
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
62
|
+
export default CheckboxGroup;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ChangeEvent } from "react";
|
|
2
|
+
/** A type representing state shared by CheckboxGroup with each Checkbox. */
|
|
3
|
+
export type CheckboxGroupContextValue = {
|
|
4
|
+
/** The initial selected values for an uncontrolled group. */
|
|
5
|
+
defaultValue: readonly string[];
|
|
6
|
+
/** Whether every Checkbox in the group is disabled. */
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
/** Handles a native Checkbox change at group scope. */
|
|
9
|
+
handleChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
10
|
+
/** Whether the group currently contains a selected value. */
|
|
11
|
+
hasSelection: boolean;
|
|
12
|
+
/** The native form name shared by every Checkbox. */
|
|
13
|
+
name: string;
|
|
14
|
+
/** Whether the group requires at least one selected value. */
|
|
15
|
+
required: boolean;
|
|
16
|
+
/** The selected values for a controlled group. */
|
|
17
|
+
value?: readonly string[];
|
|
18
|
+
/** The option acting as the native group-validation anchor. */
|
|
19
|
+
validationValue?: string;
|
|
20
|
+
};
|
|
21
|
+
/** The internal React context connecting CheckboxGroup and Checkbox. */
|
|
22
|
+
export declare const CheckboxGroupContext: import("react").Context<CheckboxGroupContextValue | undefined>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CheckboxGroupContextValue } from "../contexts/CheckboxGroupContext";
|
|
2
|
+
/**
|
|
3
|
+
* Returns the optional CheckboxGroup state surrounding a Checkbox.
|
|
4
|
+
*
|
|
5
|
+
* @returns The nearest CheckboxGroup context value when one exists.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useCheckboxGroup(): CheckboxGroupContextValue | undefined;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef, ComponentPropsWithoutRef, CSSProperties, ElementType, ReactElement } from "react";
|
|
2
|
+
import "./styles/content.css";
|
|
3
|
+
/** A type representing the explicit themes supported by Content. */
|
|
4
|
+
export type ContentTheme = "light" | "dark";
|
|
5
|
+
/** A type representing Content's visual background modes. */
|
|
6
|
+
export type ContentMode = "grid" | "none";
|
|
7
|
+
/** A type representing Content's minimum-height behavior. */
|
|
8
|
+
export type ContentFill = "none" | "available" | "viewport";
|
|
9
|
+
/** A type representing Content's vertical spacing behavior. */
|
|
10
|
+
export type ContentSpacing = "standard" | "none";
|
|
11
|
+
/** A type representing CSS custom properties accepted by Content styles. */
|
|
12
|
+
type ContentCustomProperties = {
|
|
13
|
+
[CustomProperty in `--${string}`]?: string | number;
|
|
14
|
+
};
|
|
15
|
+
/** A type representing native Content styles and CSS custom properties. */
|
|
16
|
+
type ContentStyle = CSSProperties & ContentCustomProperties;
|
|
17
|
+
/** A type representing the reference accepted by a polymorphic element. */
|
|
18
|
+
type ContentReference<Component extends ElementType> = ComponentPropsWithRef<Component>["ref"];
|
|
19
|
+
/** A type representing properties owned by the Content component. */
|
|
20
|
+
type ContentOwnProps = {
|
|
21
|
+
/** The explicit color theme applied within Content. */
|
|
22
|
+
theme?: ContentTheme;
|
|
23
|
+
/** The accent color exposed to Content descendants. */
|
|
24
|
+
accent?: string;
|
|
25
|
+
/** The visual background treatment applied to Content. */
|
|
26
|
+
mode?: ContentMode;
|
|
27
|
+
/** The minimum-height behavior applied to Content. */
|
|
28
|
+
fill?: ContentFill;
|
|
29
|
+
/** The vertical spacing applied within Content. */
|
|
30
|
+
spacing?: ContentSpacing;
|
|
31
|
+
/** Whether Content applies its responsive cell-aligned inner width. */
|
|
32
|
+
constrain?: boolean;
|
|
33
|
+
};
|
|
34
|
+
/** A type representing properties for a polymorphic Content element. */
|
|
35
|
+
export type ContentProps<Component extends ElementType = "div"> = ContentOwnProps & {
|
|
36
|
+
as?: Component;
|
|
37
|
+
style?: ContentStyle;
|
|
38
|
+
} & Omit<ComponentPropsWithoutRef<Component>, keyof ContentOwnProps | "as" | "style">;
|
|
39
|
+
/**
|
|
40
|
+
* A type representing the public polymorphic Content component.
|
|
41
|
+
*
|
|
42
|
+
* @param props - The properties accepted by the selected element.
|
|
43
|
+
*
|
|
44
|
+
* @returns The rendered Content element.
|
|
45
|
+
*/
|
|
46
|
+
type ContentComponent = <Component extends ElementType = "div">(props: ContentProps<Component> & {
|
|
47
|
+
ref?: ContentReference<Component>;
|
|
48
|
+
}) => ReactElement | null;
|
|
49
|
+
/**
|
|
50
|
+
* Renders a scoped NeatKit design-system boundary.
|
|
51
|
+
*
|
|
52
|
+
* @param props - The properties that configure Content and its root element.
|
|
53
|
+
* @param forwardedReference - The reference assigned to the root element.
|
|
54
|
+
*
|
|
55
|
+
* @returns The rendered Content element.
|
|
56
|
+
*/
|
|
57
|
+
declare const Content: ContentComponent;
|
|
58
|
+
export default Content;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ForwardedRef, RefCallback } from "react";
|
|
2
|
+
/** A type representing Content's measured layout state. */
|
|
3
|
+
type ContentLayout = {
|
|
4
|
+
/** The callback ref assigned to the Content root. */
|
|
5
|
+
rootReference: RefCallback<HTMLElement>;
|
|
6
|
+
/** The enhanced inner width, or undefined while CSS controls sizing. */
|
|
7
|
+
innerWidth: number | undefined;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Measures a Content root and progressively enhances its inner width.
|
|
11
|
+
*
|
|
12
|
+
* @param forwardedReference - The public reference assigned to the root.
|
|
13
|
+
* @param constrain - Whether responsive inner-width sizing is enabled.
|
|
14
|
+
*
|
|
15
|
+
* @returns The merged root reference and calculated inner width.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useContentLayout(forwardedReference: ForwardedRef<HTMLElement>, constrain: boolean): ContentLayout;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculates the enhanced inner width for a Content root.
|
|
3
|
+
*
|
|
4
|
+
* Provides a centered cell-aligned width for eligible container sizes.
|
|
5
|
+
*
|
|
6
|
+
* @param availableWidth - The Content root's available content-box width.
|
|
7
|
+
* @param cellSize - The resolved grid cell size in CSS pixels.
|
|
8
|
+
*
|
|
9
|
+
* @returns The cell-aligned width, or undefined when CSS controls sizing.
|
|
10
|
+
*/
|
|
11
|
+
export declare function calculateContentInnerWidth(availableWidth: number, cellSize: number): number | undefined;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "react";
|
|
2
|
+
import "./styles/divider.css";
|
|
3
|
+
/** A type representing the direction of a Divider. */
|
|
4
|
+
export type DividerOrientation = "horizontal" | "vertical";
|
|
5
|
+
/** A type representing properties for the Divider component. */
|
|
6
|
+
export type DividerProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
7
|
+
/** The direction in which the separator is drawn. */
|
|
8
|
+
orientation?: DividerOrientation;
|
|
9
|
+
/** Whether the separator is hidden from assistive technology. */
|
|
10
|
+
decorative?: boolean;
|
|
11
|
+
/** The optional label displayed within a horizontal separator. */
|
|
12
|
+
text?: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Renders a semantic or decorative separator.
|
|
16
|
+
*
|
|
17
|
+
* @param props - The properties that configure the Divider.
|
|
18
|
+
* @param forwardedReference - The reference assigned to the rendered element.
|
|
19
|
+
*
|
|
20
|
+
* @returns The rendered Divider.
|
|
21
|
+
*/
|
|
22
|
+
declare const Divider: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
23
|
+
/** The direction in which the separator is drawn. */
|
|
24
|
+
orientation?: DividerOrientation;
|
|
25
|
+
/** Whether the separator is hidden from assistive technology. */
|
|
26
|
+
decorative?: boolean;
|
|
27
|
+
/** The optional label displayed within a horizontal separator. */
|
|
28
|
+
text?: string;
|
|
29
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
30
|
+
export default Divider;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { AriaAttributes, HTMLAttributes, ReactElement, ReactNode } from "react";
|
|
2
|
+
import "./styles/field.css";
|
|
3
|
+
/** A type representing the label placement used by a Field. */
|
|
4
|
+
export type FieldOrientation = "horizontal" | "vertical";
|
|
5
|
+
/** A type representing properties accepted by a Field control. */
|
|
6
|
+
type FieldControlProps = {
|
|
7
|
+
/** The identifiers describing the control. */
|
|
8
|
+
"aria-describedby"?: string;
|
|
9
|
+
/** The identifiers naming the control. */
|
|
10
|
+
"aria-labelledby"?: string;
|
|
11
|
+
/** The validation state exposed by the control. */
|
|
12
|
+
"aria-invalid"?: AriaAttributes["aria-invalid"];
|
|
13
|
+
/** Whether the control blocks interaction. */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/** The identifier associated with the Field label. */
|
|
16
|
+
id?: string;
|
|
17
|
+
/** Whether the control requires a value. */
|
|
18
|
+
required?: boolean;
|
|
19
|
+
};
|
|
20
|
+
/** A type representing properties for the Field component. */
|
|
21
|
+
export type FieldProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
22
|
+
/** The single control described by the Field. */
|
|
23
|
+
children: ReactElement<FieldControlProps>;
|
|
24
|
+
/** The optional help content describing the control. */
|
|
25
|
+
description?: ReactNode;
|
|
26
|
+
/** Whether the Field disables its control. */
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
/** The optional validation message describing an invalid control. */
|
|
29
|
+
error?: ReactNode;
|
|
30
|
+
/** The optional visible label associated with the control. */
|
|
31
|
+
label?: ReactNode;
|
|
32
|
+
/** The placement of the label relative to the control. */
|
|
33
|
+
orientation?: FieldOrientation;
|
|
34
|
+
/** Whether the Field requires the consumer to provide a value. */
|
|
35
|
+
required?: boolean;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Renders a labelled control with shared description and validation semantics.
|
|
39
|
+
*
|
|
40
|
+
* @param props - The properties that configure the Field and its control.
|
|
41
|
+
* @param forwardedReference - The reference assigned to the Field container.
|
|
42
|
+
*
|
|
43
|
+
* @returns The rendered Field and associated control.
|
|
44
|
+
*/
|
|
45
|
+
declare const Field: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
46
|
+
/** The single control described by the Field. */
|
|
47
|
+
children: ReactElement<FieldControlProps>;
|
|
48
|
+
/** The optional help content describing the control. */
|
|
49
|
+
description?: ReactNode;
|
|
50
|
+
/** Whether the Field disables its control. */
|
|
51
|
+
disabled?: boolean;
|
|
52
|
+
/** The optional validation message describing an invalid control. */
|
|
53
|
+
error?: ReactNode;
|
|
54
|
+
/** The optional visible label associated with the control. */
|
|
55
|
+
label?: ReactNode;
|
|
56
|
+
/** The placement of the label relative to the control. */
|
|
57
|
+
orientation?: FieldOrientation;
|
|
58
|
+
/** Whether the Field requires the consumer to provide a value. */
|
|
59
|
+
required?: boolean;
|
|
60
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
61
|
+
export default Field;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** A type representing how a composite control communicates required state. */
|
|
2
|
+
type FieldRequiredCommunication = "group" | "label";
|
|
3
|
+
/** A type representing Field behavior declared by composite controls. */
|
|
4
|
+
type FieldControlMetadata = {
|
|
5
|
+
/** How the composite communicates its required state accessibly. */
|
|
6
|
+
requiredCommunication: FieldRequiredCommunication;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Returns Field metadata declared by a composite control component.
|
|
10
|
+
*
|
|
11
|
+
* @param componentType - The rendered child component type to inspect.
|
|
12
|
+
*
|
|
13
|
+
* @returns The composite Field behavior when the component declares it.
|
|
14
|
+
*/
|
|
15
|
+
export declare function getFieldControlMetadata(componentType: unknown): FieldControlMetadata | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Marks a component as a composite group control rendered by Field.
|
|
18
|
+
*
|
|
19
|
+
* @param component - The component receiving internal Field behavior.
|
|
20
|
+
* @param requiredCommunication - How the control communicates required state.
|
|
21
|
+
*/
|
|
22
|
+
export declare function markFieldGroupControl<Component extends object>(component: Component, requiredCommunication: FieldRequiredCommunication): void;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { SVGProps } from "react";
|
|
2
|
+
import type { IconType } from "./utils/registry";
|
|
3
|
+
/** A type representing properties for the Icon component. */
|
|
4
|
+
export type IconProps = Omit<SVGProps<SVGSVGElement>, "children" | "color" | "height" | "width"> & {
|
|
5
|
+
/** The icon graphic rendered by the component. */
|
|
6
|
+
type: IconType;
|
|
7
|
+
/** The width and height applied to the icon. */
|
|
8
|
+
size?: number | string;
|
|
9
|
+
/** The color applied to the icon. */
|
|
10
|
+
color?: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Renders an icon graphic selected by type.
|
|
14
|
+
*
|
|
15
|
+
* @param props - The properties that configure the Icon.
|
|
16
|
+
* @param forwardedReference - The reference assigned to the rendered SVG.
|
|
17
|
+
*
|
|
18
|
+
* @returns The selected icon graphic, or null when its type is unavailable.
|
|
19
|
+
*/
|
|
20
|
+
declare const Icon: import("react").ForwardRefExoticComponent<Omit<IconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
21
|
+
export default Icon;
|