neatkit 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/LICENSE.md +373 -674
  2. package/README.md +9 -32
  3. package/dist/components/Alert/Alert.d.ts +29 -0
  4. package/dist/components/Alert/index.d.ts +2 -0
  5. package/dist/components/Avatar/Avatar.d.ts +28 -0
  6. package/dist/components/Avatar/index.d.ts +2 -0
  7. package/dist/components/Badge/Badge.d.ts +32 -0
  8. package/dist/components/Badge/index.d.ts +2 -0
  9. package/dist/components/Button/Button.d.ts +58 -8
  10. package/dist/components/Button/index.d.ts +2 -3
  11. package/dist/components/Card/Card.d.ts +40 -0
  12. package/dist/components/Card/index.d.ts +2 -0
  13. package/dist/components/Checkbox/Checkbox.d.ts +35 -0
  14. package/dist/components/Checkbox/index.d.ts +2 -0
  15. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +62 -0
  16. package/dist/components/CheckboxGroup/contexts/CheckboxGroupContext.d.ts +22 -0
  17. package/dist/components/CheckboxGroup/hooks/useCheckboxGroup.d.ts +7 -0
  18. package/dist/components/CheckboxGroup/index.d.ts +2 -0
  19. package/dist/components/Content/Content.d.ts +58 -0
  20. package/dist/components/Content/hooks/useContentLayout.d.ts +18 -0
  21. package/dist/components/Content/index.d.ts +2 -0
  22. package/dist/components/Content/utils/layout.d.ts +11 -0
  23. package/dist/components/Divider/Divider.d.ts +30 -0
  24. package/dist/components/Divider/index.d.ts +2 -0
  25. package/dist/components/Field/Field.d.ts +61 -0
  26. package/dist/components/Field/index.d.ts +2 -0
  27. package/dist/components/Field/utils/field-control.d.ts +23 -0
  28. package/dist/components/Icon/Icon.d.ts +21 -0
  29. package/dist/components/Icon/icons/ArrowLeftIcon.d.ts +11 -0
  30. package/dist/components/Icon/icons/ArrowRightIcon.d.ts +11 -0
  31. package/dist/components/Icon/icons/ArticlesIcon.d.ts +11 -0
  32. package/dist/components/Icon/icons/AudioIcon.d.ts +11 -0
  33. package/dist/components/Icon/icons/BranchIcon.d.ts +11 -0
  34. package/dist/components/Icon/icons/BurgerIcon.d.ts +11 -0
  35. package/dist/components/Icon/icons/CameraIcon.d.ts +11 -0
  36. package/dist/components/Icon/icons/ChatIcon.d.ts +11 -0
  37. package/dist/components/Icon/icons/CheckmarkIcon.d.ts +11 -0
  38. package/dist/components/Icon/icons/ChevronDownIcon.d.ts +11 -0
  39. package/dist/components/Icon/icons/ChevronLeftIcon.d.ts +11 -0
  40. package/dist/components/Icon/icons/ChevronRightIcon.d.ts +11 -0
  41. package/dist/components/Icon/icons/ChevronUpIcon.d.ts +11 -0
  42. package/dist/components/Icon/icons/CommitIcon.d.ts +11 -0
  43. package/dist/components/Icon/icons/CrossIcon.d.ts +11 -0
  44. package/dist/components/Icon/icons/DownloadIcon.d.ts +11 -0
  45. package/dist/components/Icon/icons/DuplicateIcon.d.ts +11 -0
  46. package/dist/components/Icon/icons/ExitIcon.d.ts +11 -0
  47. package/dist/components/Icon/icons/EyeIcon.d.ts +11 -0
  48. package/dist/components/Icon/icons/EyeOffIcon.d.ts +11 -0
  49. package/dist/components/Icon/icons/FileIcon.d.ts +11 -0
  50. package/dist/components/Icon/icons/FolderIcon.d.ts +11 -0
  51. package/dist/components/Icon/icons/GitIcon.d.ts +11 -0
  52. package/dist/components/Icon/icons/GithubIcon.d.ts +11 -0
  53. package/dist/components/Icon/icons/GlobeIcon.d.ts +11 -0
  54. package/dist/components/Icon/icons/HardwareIcon.d.ts +11 -0
  55. package/dist/components/Icon/icons/HomeIcon.d.ts +11 -0
  56. package/dist/components/Icon/icons/InfoIcon.d.ts +11 -0
  57. package/dist/components/Icon/icons/KeyIcon.d.ts +11 -0
  58. package/dist/components/Icon/icons/LinkedInIcon.d.ts +11 -0
  59. package/dist/components/Icon/icons/MailIcon.d.ts +11 -0
  60. package/dist/components/Icon/icons/MinusIcon.d.ts +11 -0
  61. package/dist/components/Icon/icons/PencilIcon.d.ts +11 -0
  62. package/dist/components/Icon/icons/PlusIcon.d.ts +11 -0
  63. package/dist/components/Icon/icons/ProjectsIcon.d.ts +11 -0
  64. package/dist/components/Icon/icons/QRCodeIcon.d.ts +11 -0
  65. package/dist/components/Icon/icons/RedditIcon.d.ts +11 -0
  66. package/dist/components/Icon/icons/RepositoryIcon.d.ts +11 -0
  67. package/dist/components/Icon/icons/SaveIcon.d.ts +11 -0
  68. package/dist/components/Icon/icons/SignalIcon.d.ts +11 -0
  69. package/dist/components/Icon/icons/TagIcon.d.ts +11 -0
  70. package/dist/components/Icon/icons/UserIcon.d.ts +11 -0
  71. package/dist/components/Icon/icons/WarningIcon.d.ts +11 -0
  72. package/dist/components/Icon/icons/WindowIcon.d.ts +11 -0
  73. package/dist/components/Icon/icons/types.d.ts +3 -0
  74. package/dist/components/Icon/index.d.ts +36 -0
  75. package/dist/components/Icon/utils/registry.d.ts +49 -0
  76. package/dist/components/Input/Input.d.ts +50 -0
  77. package/dist/components/Input/index.d.ts +2 -0
  78. package/dist/components/Modal/Modal.d.ts +62 -0
  79. package/dist/components/Modal/index.d.ts +2 -0
  80. package/dist/components/PinInput/PinInput.d.ts +76 -0
  81. package/dist/components/PinInput/hooks/usePinInput.d.ts +65 -0
  82. package/dist/components/PinInput/index.d.ts +2 -0
  83. package/dist/components/Popover/Popover.d.ts +93 -0
  84. package/dist/components/Popover/index.d.ts +2 -0
  85. package/dist/components/Portal/Portal.d.ts +19 -0
  86. package/dist/components/Portal/contexts/FocusScopeContext.d.ts +7 -0
  87. package/dist/components/Portal/hooks/useDismissableLayer.d.ts +31 -0
  88. package/dist/components/Portal/hooks/useFloatingPosition.d.ts +12 -0
  89. package/dist/components/Portal/hooks/useFocusTrap.d.ts +24 -0
  90. package/dist/components/Portal/hooks/usePresence.d.ts +19 -0
  91. package/dist/components/Portal/hooks/useScrollLock.d.ts +7 -0
  92. package/dist/components/Portal/utils/floating-position.d.ts +26 -0
  93. package/dist/components/Portal/utils/overlay-stack.d.ts +45 -0
  94. package/dist/components/Radio/Radio.d.ts +32 -0
  95. package/dist/components/Radio/index.d.ts +2 -0
  96. package/dist/components/RadioGroup/RadioGroup.d.ts +54 -0
  97. package/dist/components/RadioGroup/contexts/RadioGroupContext.d.ts +18 -0
  98. package/dist/components/RadioGroup/hooks/useRadioGroup.d.ts +7 -0
  99. package/dist/components/RadioGroup/index.d.ts +2 -0
  100. package/dist/components/Select/Select.d.ts +97 -0
  101. package/dist/components/Select/index.d.ts +2 -0
  102. package/dist/components/Skeleton/Skeleton.d.ts +30 -0
  103. package/dist/components/Skeleton/index.d.ts +2 -0
  104. package/dist/components/Spinner/Spinner.d.ts +24 -0
  105. package/dist/components/Spinner/index.d.ts +2 -0
  106. package/dist/components/Surface/Surface.d.ts +15 -0
  107. package/dist/components/Switch/Switch.d.ts +27 -0
  108. package/dist/components/Switch/index.d.ts +2 -0
  109. package/dist/components/Text/Text.d.ts +41 -0
  110. package/dist/components/Text/index.d.ts +2 -0
  111. package/dist/components/TextArea/TextArea.d.ts +40 -0
  112. package/dist/components/TextArea/index.d.ts +2 -0
  113. package/dist/components/Tooltip/Tooltip.d.ts +54 -0
  114. package/dist/components/Tooltip/TooltipProvider.d.ts +24 -0
  115. package/dist/components/Tooltip/index.d.ts +4 -0
  116. package/dist/index.cjs +1 -1
  117. package/dist/index.d.ts +27 -3
  118. package/dist/index.js +3920 -12
  119. package/dist/style.css +1 -1
  120. package/dist/tokens.d.ts +84 -0
  121. package/dist/utils/aria.d.ts +18 -0
  122. package/dist/utils/reference.d.ts +16 -0
  123. package/dist/utils/units.d.ts +33 -0
  124. package/package.json +20 -4
  125. package/dist/components/Button/Button.d.ts.map +0 -1
  126. package/dist/components/Button/index.d.ts.map +0 -1
  127. package/dist/index.d.ts.map +0 -1
package/README.md CHANGED
@@ -2,8 +2,9 @@
2
2
  <!-- The media queries determine the image based on website theme -->
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
- <!-- Fallback to light mode variant if no match -->
6
- <img alt="Neatkit Banner" src=".assets/banner/light-mode.png">
5
+ <!-- Fallback to light mode variant if no match. The `alt` attribute is
6
+ intentionally set to a space to prevent rendering if the image is missing -->
7
+ <img alt=" " src=".assets/banner/light-mode.png">
7
8
  </picture>
8
9
 
9
10
  ######
@@ -11,32 +12,8 @@
11
12
  An opinionated React UI library for modern web applications, combining
12
13
  accessible components, a cohesive design system, light and dark themes, accent
13
14
  customization, design tokens, SSR support, strong TypeScript support, and
14
- comprehensive documentation. To browse the component library, click
15
- [here](https://neatkit.org).
16
-
17
- ### Getting Started
18
-
19
- Install Neatkit with your package manager:
20
-
21
- ```sh
22
- npm install neatkit
23
- ```
24
-
25
- Import the stylesheet once in your app, then use components wherever you need
26
- them:
27
-
28
- ```tsx
29
- import "neatkit/style.css";
30
- import { Button } from "neatkit";
31
-
32
- export function App() {
33
- return (
34
- <Button variant="primary" size="md">
35
- Get started
36
- </Button>
37
- );
38
- }
39
- ```
15
+ comprehensive documentation. To browse the component library and its
16
+ documentation, click [here](https://neatkit.org).
40
17
 
41
18
  ### Contributing
42
19
 
@@ -49,9 +26,9 @@ To get started, see `CONTRIBUTING.md`.
49
26
 
50
27
  ### License
51
28
 
52
- This project is licensed under the GPL-3.0 License, reflecting a commitment to
53
- keeping this software free and open-source. The GPL-3.0 promotes freedom,
54
- transparency, and collaboration, allowing users to freely use, modify, and
55
- distribute the software while ensuring it remains community-driven.
29
+ This project is licensed under the Mozilla Public License 2.0 (MPL-2.0),
30
+ supporting open-source collaboration while allowing use in both open-source
31
+ and proprietary projects. Modifications to MPL-covered files must remain
32
+ available under the same license when distributed.
56
33
 
57
34
  For more details, see `LICENSE.md`.
@@ -0,0 +1,29 @@
1
+ import { type HTMLAttributes, type ReactNode } from "react";
2
+ import "./styles/alert.css";
3
+ /** A type representing the semantic color treatment applied to an Alert. */
4
+ export type AlertTone = "info" | "success" | "warning" | "danger";
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,2 @@
1
+ export { default as Alert } from "./Alert";
2
+ export type { AlertProps, AlertTone } from "./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,2 @@
1
+ export { default as Avatar } from "./Avatar";
2
+ export type { AvatarProps } from "./Avatar";
@@ -0,0 +1,32 @@
1
+ import { type HTMLAttributes, type 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" | "info" | "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;
@@ -0,0 +1,2 @@
1
+ export { default as Badge } from "./Badge";
2
+ export type { BadgeProps, BadgeTone, BadgeVariant } from "./Badge";
@@ -1,11 +1,61 @@
1
- import type { ButtonHTMLAttributes, ReactNode } from "react";
2
- import "./Button.css";
1
+ import { type ComponentPropsWithRef, type ComponentPropsWithoutRef, type ElementType, type ReactElement, type 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
- export type ButtonSize = "sm" | "md" | "lg";
5
- export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
6
- children: ReactNode;
6
+ /** A type representing the semantic intent applied to a Button. */
7
+ export type ButtonTone = "info" | "success" | "warning" | "danger";
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
- size?: ButtonSize;
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
- export declare function Button({ children, className, size, type, variant, ...props }: ButtonProps): import("react").JSX.Element;
11
- //# sourceMappingURL=Button.d.ts.map
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, type 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,2 @@
1
+ export { default as Card } from "./Card";
2
+ export type { CardHeader, CardProps, CardSpacing, } from "./Card";
@@ -0,0 +1,35 @@
1
+ import { type CSSProperties, type InputHTMLAttributes, type 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,2 @@
1
+ export { default as Checkbox } from "./Checkbox";
2
+ export type { CheckboxProps } from "./Checkbox";
@@ -0,0 +1,62 @@
1
+ import { type ChangeEventHandler, type HTMLAttributes, type 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,2 @@
1
+ export { default as CheckboxGroup } from "./CheckboxGroup";
2
+ export type { CheckboxGroupOrientation, CheckboxGroupProps, } from "./CheckboxGroup";
@@ -0,0 +1,58 @@
1
+ import { type ComponentPropsWithRef, type ComponentPropsWithoutRef, type CSSProperties, type ElementType, type 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, type 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,2 @@
1
+ export { default as Content } from "./Content";
2
+ export type { ContentFill, ContentMode, ContentProps, ContentSpacing, ContentTheme, } from "./Content";
@@ -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,2 @@
1
+ export { default as Divider } from "./Divider";
2
+ export type { DividerOrientation, DividerProps } from "./Divider";
@@ -0,0 +1,61 @@
1
+ import { type AriaAttributes, type HTMLAttributes, type ReactElement, type 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,2 @@
1
+ export { default as Field } from "./Field";
2
+ export type { FieldOrientation, FieldProps } from "./Field";