neatkit 0.7.0 → 0.8.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 (154) hide show
  1. package/dist/Avatar-Belo7qAY.cjs +1 -0
  2. package/dist/Avatar-DjDCFqNG.js +55 -0
  3. package/dist/Avatar.cjs +1 -1
  4. package/dist/Avatar.js +2 -52
  5. package/dist/Boundary.cjs +1 -0
  6. package/dist/Boundary.js +176 -0
  7. package/dist/{Button-BAsLfA0D.js → Button-Chv4O66e.js} +35 -35
  8. package/dist/Button-DCKtFvSo.cjs +1 -0
  9. package/dist/Button.cjs +1 -1
  10. package/dist/Button.js +1 -1
  11. package/dist/Checkbox.cjs +1 -1
  12. package/dist/Checkbox.js +213 -2
  13. package/dist/Code-ClkozPlv.js +227 -0
  14. package/dist/Code-JDb4VFl7.cjs +4 -0
  15. package/dist/Code.cjs +1 -1
  16. package/dist/Code.js +1 -1
  17. package/dist/{Icon-uQmpr5P2.js → Icon-BoEUoOk7.js} +144 -177
  18. package/dist/Icon-DJ4BigRz.cjs +1 -0
  19. package/dist/Icon.cjs +1 -1
  20. package/dist/Icon.js +2 -35
  21. package/dist/Input.cjs +1 -1
  22. package/dist/Input.js +70 -79
  23. package/dist/Markdown.cjs +1 -31
  24. package/dist/Markdown.js +461 -18062
  25. package/dist/Modal.cjs +1 -1
  26. package/dist/Modal.js +100 -122
  27. package/dist/PinInput.cjs +1 -1
  28. package/dist/PinInput.js +1 -1
  29. package/dist/Popover.cjs +1 -1
  30. package/dist/Popover.js +106 -106
  31. package/dist/Radio.cjs +1 -1
  32. package/dist/Radio.js +86 -41
  33. package/dist/Select.cjs +1 -1
  34. package/dist/Select.js +326 -315
  35. package/dist/Sidebar.cjs +1 -0
  36. package/dist/Sidebar.js +475 -0
  37. package/dist/Skeleton.cjs +1 -1
  38. package/dist/Skeleton.js +20 -16
  39. package/dist/Switch.cjs +1 -1
  40. package/dist/Switch.js +1 -1
  41. package/dist/Table-B30TBckZ.js +402 -0
  42. package/dist/Table-DceR12X9.cjs +1 -0
  43. package/dist/Table.cjs +1 -1
  44. package/dist/Table.js +1 -1
  45. package/dist/TextArea.cjs +1 -1
  46. package/dist/TextArea.js +1 -1
  47. package/dist/Tooltip-B4bajPtk.cjs +1 -0
  48. package/dist/Tooltip-BVqdnKK_.js +231 -0
  49. package/dist/Tooltip.cjs +1 -1
  50. package/dist/Tooltip.js +2 -3
  51. package/dist/aria-Bntn6ad_.cjs +1 -0
  52. package/dist/aria-CeA9QfD1.js +15 -0
  53. package/dist/components/Boundary/Boundary.d.ts +65 -0
  54. package/dist/components/Boundary/contexts/BoundaryContext.d.ts +28 -0
  55. package/dist/components/Boundary/hooks/useBoundary.d.ts +19 -0
  56. package/dist/components/Boundary/hooks/useBoundaryWidth.d.ts +23 -0
  57. package/dist/components/Boundary/index.d.ts +2 -0
  58. package/dist/components/Boundary/utils/width.d.ts +11 -0
  59. package/dist/components/Checkbox/Checkbox.d.ts +9 -1
  60. package/dist/components/{CheckboxGroup → Checkbox/components}/CheckboxGroup.d.ts +2 -2
  61. package/dist/components/Checkbox/index.d.ts +1 -0
  62. package/dist/components/Checkbox/utils/checkbox-option.d.ts +17 -0
  63. package/dist/components/Icon/Icon.d.ts +1 -0
  64. package/dist/components/Icon/index.d.ts +0 -33
  65. package/dist/components/Input/Input.d.ts +1 -9
  66. package/dist/components/Modal/Modal.d.ts +0 -4
  67. package/dist/components/PinInput/PinInput.d.ts +1 -1
  68. package/dist/components/Popover/Popover.d.ts +2 -6
  69. package/dist/components/Portal/Portal.d.ts +11 -8
  70. package/dist/components/Portal/hooks/useDismissableLayer.d.ts +2 -0
  71. package/dist/components/Portal/hooks/useFloatingPosition.d.ts +4 -3
  72. package/dist/components/Portal/hooks/useFocusTrap.d.ts +2 -0
  73. package/dist/components/Portal/hooks/useScrollLock.d.ts +9 -3
  74. package/dist/components/Portal/utils/boundary-focus.d.ts +23 -0
  75. package/dist/components/Portal/utils/floating-position.d.ts +43 -9
  76. package/dist/components/Portal/utils/overlay-stack.d.ts +22 -10
  77. package/dist/components/Portal/utils/scroll-container.d.ts +13 -0
  78. package/dist/components/Radio/Radio.d.ts +9 -1
  79. package/dist/components/{RadioGroup → Radio/components}/RadioGroup.d.ts +9 -2
  80. package/dist/components/Radio/index.d.ts +1 -0
  81. package/dist/components/Select/Select.d.ts +0 -2
  82. package/dist/components/Select/utils/listbox-position.d.ts +28 -0
  83. package/dist/components/Sidebar/Sidebar.d.ts +108 -0
  84. package/dist/components/Sidebar/components/SidebarFooter.d.ts +19 -0
  85. package/dist/components/Sidebar/components/SidebarGroup.d.ts +42 -0
  86. package/dist/components/Sidebar/components/SidebarItem.d.ts +43 -0
  87. package/dist/components/Sidebar/components/SidebarOverlay.d.ts +38 -0
  88. package/dist/components/Sidebar/components/SidebarPanel.d.ts +47 -0
  89. package/dist/components/Sidebar/components/SidebarTrigger.d.ts +47 -0
  90. package/dist/components/Sidebar/components/SidebarUser.d.ts +59 -0
  91. package/dist/components/Sidebar/hooks/usePresentation.d.ts +14 -0
  92. package/dist/components/Sidebar/hooks/useSidebar.d.ts +9 -0
  93. package/dist/components/Sidebar/index.d.ts +2 -0
  94. package/dist/components/Sidebar/utils/state.d.ts +62 -0
  95. package/dist/components/Skeleton/Skeleton.d.ts +21 -5
  96. package/dist/components/Table/Table.d.ts +9 -49
  97. package/dist/components/Table/contexts/TableContext.d.ts +4 -0
  98. package/dist/components/Table/index.d.ts +1 -1
  99. package/dist/components/Tooltip/Tooltip.d.ts +10 -4
  100. package/dist/components/Tooltip/TooltipProvider.d.ts +1 -1
  101. package/dist/components/Tooltip/index.d.ts +0 -1
  102. package/dist/effects-D5CWf-Pl.js +8 -0
  103. package/dist/effects-D85L_7zM.cjs +1 -0
  104. package/dist/floating-position-5wJ5G5IT.js +48 -0
  105. package/dist/floating-position-Cy9xxdH4.cjs +1 -0
  106. package/dist/style.css +1 -1
  107. package/dist/tokens.d.ts +1 -0
  108. package/dist/useFloatingPosition-BBEUHPqy.cjs +1 -0
  109. package/dist/useFloatingPosition-CMirP2-2.js +43 -0
  110. package/dist/useFocusTrap-BrFZdMqQ.cjs +1 -0
  111. package/dist/useFocusTrap-DhVnlboe.js +136 -0
  112. package/dist/usePresence-B5RYv4e1.cjs +1 -0
  113. package/dist/usePresence-CqegYqy4.js +221 -0
  114. package/dist/useScrollLock-Drd7OZRC.js +62 -0
  115. package/dist/useScrollLock-Dy8MZaSn.cjs +1 -0
  116. package/dist/utils/aria.d.ts +9 -0
  117. package/dist/utils/effects.d.ts +12 -0
  118. package/package.json +11 -16
  119. package/dist/Button-D7JUO6Fs.cjs +0 -1
  120. package/dist/Checkbox-BvXM9VyY.js +0 -68
  121. package/dist/Checkbox-VQifZrZZ.cjs +0 -1
  122. package/dist/CheckboxGroup.cjs +0 -1
  123. package/dist/CheckboxGroup.js +0 -144
  124. package/dist/Code-BP2ZCmUf.js +0 -7446
  125. package/dist/Code-eispVOW3.cjs +0 -6
  126. package/dist/Content.cjs +0 -1
  127. package/dist/Content.js +0 -144
  128. package/dist/Icon-D8IZceys.cjs +0 -1
  129. package/dist/RadioGroup.cjs +0 -1
  130. package/dist/RadioGroup.js +0 -51
  131. package/dist/RadioGroupContext-BX9KnDek.cjs +0 -1
  132. package/dist/RadioGroupContext-DbKM4zPZ.js +0 -5
  133. package/dist/Table-83unQQOi.cjs +0 -1
  134. package/dist/Table-Cw8u-pEW.js +0 -403
  135. package/dist/Tooltip-BB82wNOE.cjs +0 -1
  136. package/dist/Tooltip-CqWK_GRD.js +0 -236
  137. package/dist/aria-DHnOMyYp.js +0 -10
  138. package/dist/aria-DKxpE8cA.cjs +0 -1
  139. package/dist/components/CheckboxGroup/index.d.ts +0 -2
  140. package/dist/components/Content/Content.d.ts +0 -60
  141. package/dist/components/Content/hooks/useContentLayout.d.ts +0 -18
  142. package/dist/components/Content/index.d.ts +0 -2
  143. package/dist/components/Content/utils/layout.d.ts +0 -11
  144. package/dist/components/RadioGroup/index.d.ts +0 -2
  145. package/dist/useFloatingPosition-CxzhAvy8.js +0 -73
  146. package/dist/useFloatingPosition-D1FqYy0l.cjs +0 -1
  147. package/dist/useFocusTrap--cgjy78G.cjs +0 -1
  148. package/dist/useFocusTrap-Da4nEash.js +0 -134
  149. package/dist/usePresence-DSPt6aKi.js +0 -210
  150. package/dist/usePresence-qe92UTvK.cjs +0 -1
  151. /package/dist/components/{CheckboxGroup → Checkbox}/contexts/CheckboxGroupContext.d.ts +0 -0
  152. /package/dist/components/{CheckboxGroup → Checkbox}/hooks/useCheckboxGroup.d.ts +0 -0
  153. /package/dist/components/{RadioGroup → Radio}/contexts/RadioGroupContext.d.ts +0 -0
  154. /package/dist/components/{RadioGroup → Radio}/hooks/useRadioGroup.d.ts +0 -0
package/dist/Tooltip.js CHANGED
@@ -1,6 +1,5 @@
1
1
  "use client";
2
- import { T as a, a as r } from "./Tooltip-CqWK_GRD.js";
2
+ import { T as a } from "./Tooltip-BVqdnKK_.js";
3
3
  export {
4
- a as TooltipProvider,
5
- r as default
4
+ a as default
6
5
  };
@@ -0,0 +1 @@
1
+ "use strict";function r(e){return e!==void 0&&e!==!1&&e!=="false"}function s(e,t){return e?!0:t}function l(e,t){const n=(e==null?void 0:e.split(/\s+/).filter(Boolean))??[];return n.includes(t)||n.push(t),n.join(" ")}exports.hasInvalidState=r;exports.mergeIdentifiers=l;exports.resolveAriaInvalid=s;
@@ -0,0 +1,15 @@
1
+ function s(e) {
2
+ return e !== void 0 && e !== !1 && e !== "false";
3
+ }
4
+ function t(e, n) {
5
+ return e ? !0 : n;
6
+ }
7
+ function r(e, n) {
8
+ const o = (e == null ? void 0 : e.split(/\s+/).filter(Boolean)) ?? [];
9
+ return o.includes(n) || o.push(n), o.join(" ");
10
+ }
11
+ export {
12
+ s as h,
13
+ r as m,
14
+ t as r
15
+ };
@@ -0,0 +1,65 @@
1
+ import { type ComponentPropsWithRef, type ComponentPropsWithoutRef, type CSSProperties, type ElementType, type ReactElement } from "react";
2
+ import "./styles/boundary.css";
3
+ /** A type representing the themes supported by Boundary. */
4
+ export type BoundaryTheme = "auto" | "light" | "dark";
5
+ /** A type representing Boundary's visual background decoration. */
6
+ export type BoundaryDecoration = "grid" | "none";
7
+ /** A type representing Boundary's horizontal layout behavior. */
8
+ export type BoundaryWidthMode = "narrow" | "full";
9
+ /** A type representing Boundary's minimum-height behavior. */
10
+ export type BoundaryHeightMode = "content" | "available" | "viewport";
11
+ /** A type representing Boundary's spacing behavior on both axes. */
12
+ export type BoundarySpacing = "standard" | "none";
13
+ /** A type representing CSS custom properties accepted by Boundary styles. */
14
+ type BoundaryCustomProperties = {
15
+ [CustomProperty in `--${string}`]?: string | number;
16
+ };
17
+ /** A type representing native Boundary styles and CSS custom properties. */
18
+ type BoundaryStyle = CSSProperties & BoundaryCustomProperties;
19
+ /** A type representing the reference accepted by a polymorphic element. */
20
+ type BoundaryReference<Component extends ElementType> = ComponentPropsWithRef<Component>["ref"];
21
+ /** A type representing properties owned by the Boundary component. */
22
+ type BoundaryOwnProps = {
23
+ /** The color theme applied within Boundary. */
24
+ theme?: BoundaryTheme;
25
+ /** The accent color exposed to Boundary descendants. */
26
+ accent?: string;
27
+ /** The visual background treatment applied to Boundary. */
28
+ decoration?: BoundaryDecoration;
29
+ /** The horizontal layout applied to Boundary. */
30
+ width?: BoundaryWidthMode;
31
+ /** The minimum height applied to Boundary. */
32
+ height?: BoundaryHeightMode;
33
+ /** The spacing applied around content within Boundary. */
34
+ spacing?: BoundarySpacing;
35
+ };
36
+ /** A type representing properties for a polymorphic Boundary element. */
37
+ export type BoundaryProps<Component extends ElementType = "div"> = BoundaryOwnProps & {
38
+ as?: Component;
39
+ style?: BoundaryStyle;
40
+ } & Omit<ComponentPropsWithoutRef<Component>, keyof BoundaryOwnProps | "as" | "style">;
41
+ /**
42
+ * A type representing the public polymorphic Boundary component.
43
+ *
44
+ * @param props - The properties accepted by the selected element.
45
+ *
46
+ * @returns The rendered Boundary element.
47
+ */
48
+ type BoundaryComponent = <Component extends ElementType = "div">(props: BoundaryProps<Component> & {
49
+ ref?: BoundaryReference<Component>;
50
+ }) => ReactElement | null;
51
+ /**
52
+ * Renders a scoped Neatkit design-system boundary.
53
+ *
54
+ * Every Neatkit interface is wrapped in a Boundary. Portals, overlay
55
+ * stacking, dismissal precedence, and responsive measurement all resolve
56
+ * against the nearest boundary, so several independent boundaries may share
57
+ * one page. Where boundaries nest, descendants use the innermost one.
58
+ *
59
+ * @param props - The properties that configure Boundary and its root element.
60
+ * @param forwardedReference - The reference assigned to the root element.
61
+ *
62
+ * @returns The rendered Boundary element.
63
+ */
64
+ declare const Boundary: BoundaryComponent;
65
+ export default Boundary;
@@ -0,0 +1,28 @@
1
+ /** A type representing observable access to a boundary's measured width. */
2
+ export type BoundaryWidthStore = {
3
+ /**
4
+ * Reads the boundary's measured content-box width.
5
+ *
6
+ * @returns The width in CSS pixels, or undefined while unmeasured.
7
+ */
8
+ read: () => number | undefined;
9
+ /**
10
+ * Subscribes a listener to changes in the measured width.
11
+ *
12
+ * @param listener - The listener notified after every measurement.
13
+ *
14
+ * @returns The teardown removing the registered listener.
15
+ */
16
+ subscribe: (listener: () => void) => () => void;
17
+ };
18
+ /** A type representing the Neatkit boundary shared with its descendants. */
19
+ export type BoundaryContextValue = {
20
+ /** The Boundary root element descendants resolve against. */
21
+ boundaryElement: HTMLElement | null;
22
+ /** The element receiving overlays portalled inside the boundary. */
23
+ portalElement: HTMLElement | null;
24
+ /** Observable access to the boundary's measured content-box width. */
25
+ width: BoundaryWidthStore;
26
+ };
27
+ /** The internal React context published by each boundary. */
28
+ export declare const BoundaryContext: import("react").Context<BoundaryContextValue | undefined>;
@@ -0,0 +1,19 @@
1
+ import { type BoundaryContextValue } from "../contexts/BoundaryContext";
2
+ /**
3
+ * Returns the Neatkit boundary a component resolves against.
4
+ *
5
+ * Portals, overlay stacking, dismissal precedence, and responsive
6
+ * measurement all resolve against the nearest boundary, so a component
7
+ * requiring one cannot function without it. Naming the component requires
8
+ * the boundary, because the name exists only to report its absence; omitting
9
+ * the name returns whatever surrounds the caller, which suits a component
10
+ * that adapts to a boundary rather than depending on one.
11
+ *
12
+ * @param componentName - The component name reported when no boundary exists.
13
+ *
14
+ * @returns The nearest boundary, or undefined when none is required.
15
+ *
16
+ * @warning Throws when a named component is rendered outside a Boundary.
17
+ */
18
+ export declare function useBoundary(componentName: string): BoundaryContextValue;
19
+ export declare function useBoundary(): BoundaryContextValue | undefined;
@@ -0,0 +1,23 @@
1
+ import { type ForwardedRef, type RefCallback } from "react";
2
+ import type { BoundaryWidthStore } from "../contexts/BoundaryContext";
3
+ /** A type representing Boundary's measured layout state. */
4
+ type BoundaryWidthMeasurement = {
5
+ /** The enhanced inner width, or undefined while CSS controls sizing. */
6
+ contentWidth: number | undefined;
7
+ /** Observable access to the boundary's measured content-box width. */
8
+ width: BoundaryWidthStore;
9
+ /** The mounted Boundary root, or null before it mounts. */
10
+ rootElement: HTMLElement | null;
11
+ /** The callback ref assigned to the Boundary root. */
12
+ rootReference: RefCallback<HTMLElement>;
13
+ };
14
+ /**
15
+ * Measures a Boundary root and publishes its layout to descendants.
16
+ *
17
+ * @param forwardedReference - The public reference assigned to the root.
18
+ * @param snap - Whether cell-aligned inner-width sizing is enabled.
19
+ *
20
+ * @returns The merged root reference and the measured boundary layout.
21
+ */
22
+ export declare function useBoundaryWidth(forwardedReference: ForwardedRef<HTMLElement>, snap: boolean): BoundaryWidthMeasurement;
23
+ export {};
@@ -0,0 +1,2 @@
1
+ export { default } from "./Boundary";
2
+ export type { BoundaryHeightMode, BoundaryDecoration, BoundaryProps, BoundarySpacing, BoundaryTheme, BoundaryWidthMode, } from "./Boundary";
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Calculates the enhanced inner width for a Boundary root.
3
+ *
4
+ * Provides a centered cell-aligned width for eligible container sizes.
5
+ *
6
+ * @param availableWidth - The Boundary 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 calculateBoundaryContentWidth(availableWidth: number, cellSize: number): number | undefined;
@@ -1,4 +1,5 @@
1
1
  import { type CSSProperties, type InputHTMLAttributes, type ReactNode } from "react";
2
+ import CheckboxGroup from "./components/CheckboxGroup";
2
3
  import "./styles/checkbox.css";
3
4
  /** A type representing properties for the Checkbox component. */
4
5
  export type CheckboxProps = Omit<InputHTMLAttributes<HTMLInputElement>, "children" | "className" | "style" | "type"> & {
@@ -22,7 +23,7 @@ export type CheckboxProps = Omit<InputHTMLAttributes<HTMLInputElement>, "childre
22
23
  *
23
24
  * @returns The rendered Checkbox control.
24
25
  */
25
- declare const Checkbox: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "className" | "style" | "children" | "type"> & {
26
+ declare const CheckboxRoot: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "className" | "style" | "children" | "type"> & {
26
27
  /** The optional clickable and accessible label for the Checkbox. */
27
28
  children?: ReactNode;
28
29
  /** The additional class name applied to the Checkbox label root. */
@@ -32,4 +33,11 @@ declare const Checkbox: import("react").ForwardRefExoticComponent<Omit<InputHTML
32
33
  /** The inline styles applied to the Checkbox label root. */
33
34
  style?: CSSProperties;
34
35
  } & import("react").RefAttributes<HTMLInputElement>>;
36
+ /** A type representing the complete compound Checkbox component. */
37
+ type CheckboxComponent = typeof CheckboxRoot & {
38
+ /** A labelled set of related Checkbox options sharing one name. */
39
+ Group: typeof CheckboxGroup;
40
+ };
41
+ /** The compound Checkbox component and its grouping form. */
42
+ declare const Checkbox: CheckboxComponent;
35
43
  export default Checkbox;
@@ -1,8 +1,8 @@
1
1
  import { type ChangeEventHandler, type HTMLAttributes, type ReactNode } from "react";
2
- import "./styles/checkbox-group.css";
2
+ import "../styles/checkbox-group.css";
3
3
  /** A type representing the visual direction of Checkbox options. */
4
4
  export type CheckboxGroupOrientation = "horizontal" | "vertical";
5
- /** A type representing properties for the CheckboxGroup component. */
5
+ /** A type representing properties for the Checkbox.Group component. */
6
6
  export type CheckboxGroupProps = Omit<HTMLAttributes<HTMLDivElement>, "children" | "defaultValue" | "onChange"> & {
7
7
  /**
8
8
  * The direct Checkbox options or fragments belonging to the group.
@@ -1,2 +1,3 @@
1
1
  export { default } from "./Checkbox";
2
2
  export type { CheckboxProps } from "./Checkbox";
3
+ export type { CheckboxGroupOrientation, CheckboxGroupProps, } from "./components/CheckboxGroup";
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Marks a component as a valid option inside a Checkbox group.
3
+ *
4
+ * The marker lets the group validate its children without importing the
5
+ * option component, which would otherwise create a circular dependency.
6
+ *
7
+ * @param component - The component receiving the internal option marker.
8
+ */
9
+ export declare function markCheckboxOption<Component extends object>(component: Component): void;
10
+ /**
11
+ * Determines whether a rendered child is a valid Checkbox group option.
12
+ *
13
+ * @param componentType - The rendered child component type to inspect.
14
+ *
15
+ * @returns Whether the component declares the internal option marker.
16
+ */
17
+ export declare function isCheckboxOption(componentType: unknown): boolean;
@@ -1,5 +1,6 @@
1
1
  import { type SVGProps } from "react";
2
2
  import { type IconType } from "./utils/registry";
3
+ import "./styles/icon.css";
3
4
  /** A type representing properties for the Icon component. */
4
5
  export type IconProps = Omit<SVGProps<SVGSVGElement>, "children" | "color" | "height" | "width"> & {
5
6
  /** The icon graphic rendered by the component. */
@@ -1,36 +1,3 @@
1
1
  export { default } from "./Icon";
2
2
  export type { IconProps } from "./Icon";
3
3
  export type { IconType } from "./utils/registry";
4
- export { default as ChatIcon } from "./icons/ChatIcon";
5
- export { default as ProjectsIcon } from "./icons/ProjectsIcon";
6
- export { default as ArticlesIcon } from "./icons/ArticlesIcon";
7
- export { default as MailIcon } from "./icons/MailIcon";
8
- export { default as GithubIcon } from "./icons/GithubIcon";
9
- export { default as GlobeIcon } from "./icons/GlobeIcon";
10
- export { default as LinkedInIcon } from "./icons/LinkedInIcon";
11
- export { default as RedditIcon } from "./icons/RedditIcon";
12
- export { default as ExitIcon } from "./icons/ExitIcon";
13
- export { default as CameraIcon } from "./icons/CameraIcon";
14
- export { default as QRCodeIcon } from "./icons/QRCodeIcon";
15
- export { default as DownloadIcon } from "./icons/DownloadIcon";
16
- export { default as SaveIcon } from "./icons/SaveIcon";
17
- export { default as PencilIcon } from "./icons/PencilIcon";
18
- export { default as ArrowLeftIcon } from "./icons/ArrowLeftIcon";
19
- export { default as ArrowRightIcon } from "./icons/ArrowRightIcon";
20
- export { default as CrossIcon } from "./icons/CrossIcon";
21
- export { default as CheckmarkIcon } from "./icons/CheckmarkIcon";
22
- export { default as PlusIcon } from "./icons/PlusIcon";
23
- export { default as MinusIcon } from "./icons/MinusIcon";
24
- export { default as WindowIcon } from "./icons/WindowIcon";
25
- export { default as UserIcon } from "./icons/UserIcon";
26
- export { default as DuplicateIcon } from "./icons/DuplicateIcon";
27
- export { default as EyeIcon } from "./icons/EyeIcon";
28
- export { default as EyeOffIcon } from "./icons/EyeOffIcon";
29
- export { default as SignalIcon } from "./icons/SignalIcon";
30
- export { default as AudioIcon } from "./icons/AudioIcon";
31
- export { default as HardwareIcon } from "./icons/HardwareIcon";
32
- export { default as BurgerIcon } from "./icons/BurgerIcon";
33
- export { default as RepositoryIcon } from "./icons/RepositoryIcon";
34
- export { default as KeyIcon } from "./icons/KeyIcon";
35
- export { default as InfoIcon } from "./icons/InfoIcon";
36
- export { default as WarningIcon } from "./icons/WarningIcon";
@@ -1,4 +1,4 @@
1
- import { type CSSProperties, type InputHTMLAttributes, type ReactNode } from "react";
1
+ import { type CSSProperties, type InputHTMLAttributes } from "react";
2
2
  import "./styles/input.css";
3
3
  /** A type representing the supported native single-line input types. */
4
4
  export type InputType = "email" | "number" | "password" | "search" | "tel" | "text" | "url";
@@ -10,12 +10,8 @@ export type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "children"
10
10
  clearable?: boolean;
11
11
  /** Whether the Input exposes an invalid semantic and visual state. */
12
12
  invalid?: boolean;
13
- /** The content displayed before the editable value. */
14
- leading?: ReactNode;
15
13
  /** Whether the Input displays a loading indicator and blocks editing. */
16
14
  loading?: boolean;
17
- /** The content displayed after the editable value. */
18
- trailing?: ReactNode;
19
15
  /** The inline styles applied to the composite Input root. */
20
16
  style?: CSSProperties;
21
17
  /** The supported native behavior applied to the single-line control. */
@@ -36,12 +32,8 @@ declare const Input: import("react").ForwardRefExoticComponent<Omit<InputHTMLAtt
36
32
  clearable?: boolean;
37
33
  /** Whether the Input exposes an invalid semantic and visual state. */
38
34
  invalid?: boolean;
39
- /** The content displayed before the editable value. */
40
- leading?: ReactNode;
41
35
  /** Whether the Input displays a loading indicator and blocks editing. */
42
36
  loading?: boolean;
43
- /** The content displayed after the editable value. */
44
- trailing?: ReactNode;
45
37
  /** The inline styles applied to the composite Input root. */
46
38
  style?: CSSProperties;
47
39
  /** The supported native behavior applied to the single-line control. */
@@ -18,8 +18,6 @@ export type ModalProps = Omit<HTMLAttributes<HTMLDivElement>, "children" | "onCl
18
18
  onClose?: (reason: ModalCloseReason) => void;
19
19
  /** Whether the Modal is currently open. */
20
20
  open: boolean;
21
- /** The optional element receiving the Modal portal. */
22
- portalContainer?: Element | null;
23
21
  /** Whether focus returns to its prior owner when the Modal closes. */
24
22
  restoreFocus?: boolean;
25
23
  /** Whether keyboard and programmatic focus remain inside the Modal. */
@@ -50,8 +48,6 @@ declare const Modal: import("react").ForwardRefExoticComponent<Omit<HTMLAttribut
50
48
  onClose?: (reason: ModalCloseReason) => void;
51
49
  /** Whether the Modal is currently open. */
52
50
  open: boolean;
53
- /** The optional element receiving the Modal portal. */
54
- portalContainer?: Element | null;
55
51
  /** Whether focus returns to its prior owner when the Modal closes. */
56
52
  restoreFocus?: boolean;
57
53
  /** Whether keyboard and programmatic focus remain inside the Modal. */
@@ -47,7 +47,7 @@ export type PinInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "childre
47
47
  *
48
48
  * @returns The rendered PinInput control.
49
49
  */
50
- declare const PinInput: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "defaultValue" | "className" | "style" | "inputMode" | "children" | "onPaste" | "onChange" | "size" | "type" | "pattern" | "value" | "maxLength" | "minLength"> & {
50
+ declare const PinInput: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "defaultValue" | "className" | "style" | "inputMode" | "children" | "onPaste" | "onChange" | "size" | "pattern" | "type" | "value" | "maxLength" | "minLength"> & {
51
51
  /** The additional class name applied to the composite PinInput root. */
52
52
  className?: string;
53
53
  /** Whether entered characters are visually replaced with centered dots. */
@@ -32,10 +32,8 @@ export type PopoverProps = Omit<HTMLAttributes<HTMLDivElement>, "children" | "de
32
32
  onPointerDownOutside?: (event: PointerEvent) => void;
33
33
  /** The controlled open state of the Popover. */
34
34
  open?: boolean;
35
- /** The preferred placement before viewport collision handling. */
35
+ /** The preferred placement before collision handling. */
36
36
  placement?: PopoverPlacement;
37
- /** The optional element receiving the Popover portal. */
38
- portalContainer?: Element | null;
39
37
  /** Whether focus returns to the trigger after non-outside closure. */
40
38
  restoreFocus?: boolean;
41
39
  /** Whether keyboard and programmatic focus remain inside the Popover. */
@@ -85,10 +83,8 @@ declare const Popover: import("react").ForwardRefExoticComponent<Omit<HTMLAttrib
85
83
  onPointerDownOutside?: (event: PointerEvent) => void;
86
84
  /** The controlled open state of the Popover. */
87
85
  open?: boolean;
88
- /** The preferred placement before viewport collision handling. */
86
+ /** The preferred placement before collision handling. */
89
87
  placement?: PopoverPlacement;
90
- /** The optional element receiving the Popover portal. */
91
- portalContainer?: Element | null;
92
88
  /** Whether focus returns to the trigger after non-outside closure. */
93
89
  restoreFocus?: boolean;
94
90
  /** Whether keyboard and programmatic focus remain inside the Popover. */
@@ -3,17 +3,20 @@ import { type ReactNode } from "react";
3
3
  type PortalProps = {
4
4
  /** The content rendered outside its React layout parent. */
5
5
  children: ReactNode;
6
- /** The optional element receiving the portal content. */
7
- container?: Element | null;
8
- /** The optional element whose inherited Neatkit variables are preserved. */
9
- inheritFrom?: HTMLElement | null;
10
6
  };
11
7
  /**
12
- * Renders content into a browser-owned container after hydration.
8
+ * Renders content into its boundary after hydration.
13
9
  *
14
- * @param props - The portal destination, design source, and content.
10
+ * Portalling inside the boundary keeps design tokens inheriting through the
11
+ * cascade, so the portalled subtree needs no copied design context. The
12
+ * destination is never configurable, and the boundary is required rather
13
+ * than preferred: overlay coordinates are measured as offsets from it, so a
14
+ * portal that quietly fell back to the document would position its content
15
+ * wrongly instead of reporting the mistake.
15
16
  *
16
- * @returns A server-safe source marker and the mounted browser portal.
17
+ * @param props - The portalled content.
18
+ *
19
+ * @returns The mounted browser portal.
17
20
  */
18
- export default function Portal(props: PortalProps): import("react").JSX.Element;
21
+ export default function Portal(props: PortalProps): import("react").ReactPortal | null;
19
22
  export {};
@@ -9,6 +9,8 @@ type DismissableLayerOptions = {
9
9
  dismissOnPointerDownOutside?: boolean;
10
10
  /** The boundaries considered part of the layer. */
11
11
  boundaries: readonly RefObject<HTMLElement | null>[];
12
+ /** The boundary owning the layer's overlay stack. */
13
+ boundary: Element | null;
12
14
  /** The stable overlay stack identifier for the layer. */
13
15
  layerId: symbol;
14
16
  /** The document owning the layer and its event listeners. */
@@ -1,12 +1,13 @@
1
1
  import { type FloatingPlacement, type FloatingPosition } from "../utils/floating-position";
2
2
  /**
3
- * Keeps anchored floating content aligned and inside its viewport.
3
+ * Keeps anchored floating content aligned and inside its boundary.
4
4
  *
5
5
  * @param active - Whether positioning observers should remain active.
6
6
  * @param placement - The preferred floating placement.
7
7
  * @param trigger - The element anchoring the floating panel.
8
8
  * @param panel - The mounted floating panel.
9
+ * @param boundary - The boundary the panel is positioned within.
9
10
  *
10
- * @returns The current fixed-position coordinates and resolved placement.
11
+ * @returns The boundary-relative coordinates and resolved placement.
11
12
  */
12
- export declare function useFloatingPosition(active: boolean, placement: FloatingPlacement, trigger: HTMLElement | null, panel: HTMLElement | null): FloatingPosition | null;
13
+ export declare function useFloatingPosition(active: boolean, placement: FloatingPlacement, trigger: HTMLElement | null, panel: HTMLElement | null, boundary: HTMLElement | null): FloatingPosition | null;
@@ -6,6 +6,8 @@ type FocusTrapOptions = {
6
6
  active: boolean;
7
7
  /** Whether focus moves inside the trap when it activates. */
8
8
  autoFocus?: boolean;
9
+ /** The boundary owning the trapped layer's overlay stack. */
10
+ boundary: Element | null;
9
11
  /** The element containing focus while the trap is active. */
10
12
  container: HTMLElement | null;
11
13
  /** The optional preferred element focused when the trap opens. */
@@ -1,7 +1,13 @@
1
1
  /**
2
- * Locks document scrolling while compensating for the removed scrollbar.
2
+ * Locks the scroller enclosing a boundary while compensating its scrollbar.
3
+ *
4
+ * The lock follows the boundary like every other overlay concern. A boundary
5
+ * occupying the page locks the page, and a boundary embedded in its own
6
+ * scroller locks only that scroller, so an overlay never freezes a host
7
+ * interface it does not own. `lockScroll` disables it entirely.
3
8
  *
4
9
  * @param active - Whether the lock should currently apply.
5
- * @param ownerDocument - The document whose body scrolling is controlled.
10
+ * @param ownerDocument - The document containing the boundary.
11
+ * @param boundary - The boundary owning the overlay requesting the lock.
6
12
  */
7
- export declare function useScrollLock(active: boolean, ownerDocument: Document | null): void;
13
+ export declare function useScrollLock(active: boolean, ownerDocument: Document | null, boundary: Element | null): void;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Determines whether an overlay outside this layer's boundary owns focus.
3
+ *
4
+ * @param ownerDocument - The document owning the focused element.
5
+ * @param boundary - The boundary owning the inspected layer.
6
+ *
7
+ * @returns Whether a competing overlay currently owns focus.
8
+ */
9
+ export declare function isFocusInsideAnotherOverlay(ownerDocument: Document, boundary: Element): boolean;
10
+ /**
11
+ * Determines whether an overlay outside this layer's boundary owns a press.
12
+ *
13
+ * Pointer ownership cannot be resolved through the focused element, because a
14
+ * capture-phase pointer press runs before focus moves to the pressed target.
15
+ * A layer reading focus here would still see its own content and claim a
16
+ * press that belongs to a competing boundary, so the pressed node decides.
17
+ *
18
+ * @param target - The node receiving the pointer press.
19
+ * @param boundary - The boundary owning the inspected layer.
20
+ *
21
+ * @returns Whether a competing overlay currently owns the press.
22
+ */
23
+ export declare function isPointerInsideAnotherOverlay(target: Node | null, boundary: Element): boolean;
@@ -4,23 +4,57 @@ export type FloatingPlacement = "bottom" | "left" | "right" | "top";
4
4
  export type FloatingPosition = {
5
5
  /** The cross-axis offset at which the arrow points to the trigger. */
6
6
  arrowOffset: number;
7
- /** The resolved placement after viewport collision handling. */
7
+ /** The resolved placement after boundary collision handling. */
8
8
  placement: FloatingPlacement;
9
- /** The viewport-relative horizontal position. */
9
+ /** The boundary-relative horizontal position. */
10
10
  left: number;
11
- /** The viewport-relative vertical position. */
11
+ /** The boundary-relative vertical position. */
12
12
  top: number;
13
13
  };
14
14
  /**
15
- * Calculates collision-aware floating coordinates within a viewport.
15
+ * A type representing the edges a rectangle is fitted against.
16
+ *
17
+ * Only edges are ever read, and describing them structurally keeps the
18
+ * geometry independent of any realm: a `DOMRect` from any document
19
+ * satisfies it, and a fitted result needs no constructor to build.
20
+ */
21
+ export type EdgeBounds = {
22
+ /** The distance from the coordinate space's top to the lower edge. */
23
+ bottom: number;
24
+ /** The distance from the coordinate space's left to the leading edge. */
25
+ left: number;
26
+ /** The distance from the coordinate space's left to the trailing edge. */
27
+ right: number;
28
+ /** The distance from the coordinate space's top to the upper edge. */
29
+ top: number;
30
+ };
31
+ /**
32
+ * Narrows a boundary to the part of it the viewer can actually see.
33
+ *
34
+ * A boundary taller or wider than the viewport still reports its full size,
35
+ * so fitting against it alone can place a panel in boundary space that is
36
+ * scrolled out of view. Collision detection therefore runs against the
37
+ * visible intersection, while coordinates stay relative to the boundary.
38
+ *
39
+ * @param boundaryBounds - The boundary bounds in viewport coordinates.
40
+ * @param viewportWidth - The visible viewport width in CSS pixels.
41
+ * @param viewportHeight - The visible viewport height in CSS pixels.
42
+ *
43
+ * @returns The visible region, or the boundary when nothing intersects.
44
+ */
45
+ export declare function getVisibleBounds(boundaryBounds: EdgeBounds, viewportWidth: number, viewportHeight: number): EdgeBounds;
46
+ /**
47
+ * Calculates collision-aware floating coordinates within a boundary.
48
+ *
49
+ * Every rectangle is expressed in the same coordinate space, so the returned
50
+ * coordinates share that space and callers convert them once.
16
51
  *
17
52
  * @param placement - The preferred floating placement.
18
- * @param spacing - The minimum distance from triggers and viewport edges.
19
- * @param triggerBounds - The viewport bounds of the anchoring trigger.
53
+ * @param spacing - The minimum distance from triggers and boundary edges.
54
+ * @param triggerBounds - The bounds of the anchoring trigger.
20
55
  * @param panelBounds - The measured bounds of the floating panel.
21
- * @param viewportWidth - The available viewport width.
22
- * @param viewportHeight - The available viewport height.
56
+ * @param boundaryBounds - The bounds the panel must remain inside.
23
57
  *
24
58
  * @returns The fitted coordinates and resolved floating placement.
25
59
  */
26
- export declare function calculateFloatingPosition(placement: FloatingPlacement, spacing: number, triggerBounds: DOMRect, panelBounds: DOMRect, viewportWidth: number, viewportHeight: number): FloatingPosition;
60
+ export declare function calculateFloatingPosition(placement: FloatingPlacement, spacing: number, triggerBounds: DOMRect, panelBounds: DOMRect, boundaryBounds: EdgeBounds): FloatingPosition;
@@ -6,23 +6,35 @@ export type OverlayLayer = {
6
6
  zIndex: number;
7
7
  };
8
8
  /**
9
- * Registers an active layer in its owning document's overlay stack.
9
+ * Registers an active layer in its owning boundary's overlay stack.
10
10
  *
11
11
  * @param active - Whether the layer currently participates in the stack.
12
- * @param ownerDocument - The document owning the layer.
12
+ * @param boundaryElement - The boundary owning the layer.
13
13
  *
14
14
  * @returns The stable layer identifier and its current z-index.
15
15
  */
16
- export declare function useOverlayLayer(active: boolean, ownerDocument: Document | null): OverlayLayer;
16
+ export declare function useOverlayLayer(active: boolean, boundaryElement: Element | null): OverlayLayer;
17
17
  /**
18
- * Determines whether a layer is uppermost in its document.
18
+ * Determines whether a layer is uppermost in its boundary.
19
19
  *
20
- * @param ownerDocument - The document owning the overlay layer.
20
+ * @param boundaryElement - The boundary owning the overlay layer.
21
21
  * @param layerIdentifier - The layer identifier being inspected.
22
22
  *
23
23
  * @returns Whether the layer is the last active stack entry.
24
24
  */
25
- export declare function isTopmostOverlayLayer(ownerDocument: Document, layerIdentifier: symbol): boolean;
25
+ export declare function isTopmostOverlayLayer(boundaryElement: Element, layerIdentifier: symbol): boolean;
26
+ /**
27
+ * Determines whether a boundary currently owns any active overlay layer.
28
+ *
29
+ * The lookup deliberately avoids creating an entry, because this answers a
30
+ * question about boundaries the caller does not own, and creating one for
31
+ * every boundary inspected would populate the map with empty stacks.
32
+ *
33
+ * @param boundaryElement - The boundary whose overlay stack is inspected.
34
+ *
35
+ * @returns Whether the boundary holds at least one registered layer.
36
+ */
37
+ export declare function hasActiveOverlayLayer(boundaryElement: Element): boolean;
26
38
  /**
27
39
  * Registers whether an overlay layer currently owns focus containment.
28
40
  *
@@ -30,16 +42,16 @@ export declare function isTopmostOverlayLayer(ownerDocument: Document, layerIden
30
42
  * a non-trapping child layer cannot suspend its enclosing focus trap.
31
43
  *
32
44
  * @param active - Whether the layer currently contains focus.
33
- * @param ownerDocument - The document owning the layer.
45
+ * @param boundaryElement - The boundary owning the layer.
34
46
  * @param layerIdentifier - The layer identifier registered in the stack.
35
47
  */
36
- export declare function useOverlayFocusLayer(active: boolean, ownerDocument: Document | null, layerIdentifier: symbol): void;
48
+ export declare function useOverlayFocusLayer(active: boolean, boundaryElement: Element | null, layerIdentifier: symbol): void;
37
49
  /**
38
50
  * Determines whether a layer is the uppermost focus-containing overlay.
39
51
  *
40
- * @param ownerDocument - The document owning the overlay layer.
52
+ * @param boundaryElement - The boundary owning the overlay layer.
41
53
  * @param layerIdentifier - The layer identifier being inspected.
42
54
  *
43
55
  * @returns Whether no later visual layer also owns focus containment.
44
56
  */
45
- export declare function isTopmostFocusLayer(ownerDocument: Document, layerIdentifier: symbol): boolean;
57
+ export declare function isTopmostFocusLayer(boundaryElement: Element, layerIdentifier: symbol): boolean;