neatkit 0.2.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 (46) hide show
  1. package/LICENSE.md +373 -674
  2. package/README.md +9 -34
  3. package/dist/components/Alert/Alert.d.ts +2 -2
  4. package/dist/components/Avatar/Avatar.d.ts +1 -1
  5. package/dist/components/Badge/Badge.d.ts +2 -2
  6. package/dist/components/Button/Button.d.ts +3 -3
  7. package/dist/components/Card/Card.d.ts +1 -1
  8. package/dist/components/Checkbox/Checkbox.d.ts +1 -1
  9. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +1 -1
  10. package/dist/components/CheckboxGroup/contexts/CheckboxGroupContext.d.ts +1 -1
  11. package/dist/components/CheckboxGroup/hooks/useCheckboxGroup.d.ts +1 -1
  12. package/dist/components/Content/Content.d.ts +2 -2
  13. package/dist/components/Content/hooks/useContentLayout.d.ts +1 -1
  14. package/dist/components/Divider/Divider.d.ts +1 -1
  15. package/dist/components/Field/Field.d.ts +1 -1
  16. package/dist/components/Icon/Icon.d.ts +2 -2
  17. package/dist/components/Input/Input.d.ts +1 -1
  18. package/dist/components/Modal/Modal.d.ts +1 -1
  19. package/dist/components/PinInput/PinInput.d.ts +1 -1
  20. package/dist/components/PinInput/hooks/usePinInput.d.ts +1 -1
  21. package/dist/components/Popover/Popover.d.ts +1 -1
  22. package/dist/components/Portal/Portal.d.ts +2 -2
  23. package/dist/components/Portal/hooks/useDismissableLayer.d.ts +1 -1
  24. package/dist/components/Portal/hooks/useFloatingPosition.d.ts +1 -1
  25. package/dist/components/Portal/hooks/useFocusTrap.d.ts +1 -1
  26. package/dist/components/Radio/Radio.d.ts +1 -1
  27. package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
  28. package/dist/components/RadioGroup/contexts/RadioGroupContext.d.ts +1 -1
  29. package/dist/components/RadioGroup/hooks/useRadioGroup.d.ts +1 -1
  30. package/dist/components/Select/Select.d.ts +2 -2
  31. package/dist/components/Skeleton/Skeleton.d.ts +1 -1
  32. package/dist/components/Spinner/Spinner.d.ts +1 -1
  33. package/dist/components/Surface/Surface.d.ts +1 -1
  34. package/dist/components/Switch/Switch.d.ts +1 -1
  35. package/dist/components/Text/Text.d.ts +2 -2
  36. package/dist/components/TextArea/TextArea.d.ts +1 -1
  37. package/dist/components/Tooltip/Tooltip.d.ts +1 -1
  38. package/dist/components/Tooltip/TooltipProvider.d.ts +1 -1
  39. package/dist/index.cjs +1 -1
  40. package/dist/index.d.ts +2 -0
  41. package/dist/index.js +937 -887
  42. package/dist/style.css +1 -1
  43. package/dist/tokens.d.ts +84 -0
  44. package/dist/utils/{react-reference.d.ts → reference.d.ts} +1 -1
  45. package/dist/utils/units.d.ts +33 -0
  46. package/package.json +3 -2
@@ -0,0 +1,84 @@
1
+ /** The canonical Neatkit grid cell size in CSS pixels. */
2
+ export declare const CELL_SIZE = 36;
3
+ /** The canonical Neatkit spacing scale in CSS pixels. */
4
+ export declare const SPACE_SIZES: readonly [2, 4, 8, 12, 16, 24, 32, 48];
5
+ /** A supported value from the Neatkit spacing scale. */
6
+ export type SpaceSize = (typeof SPACE_SIZES)[number];
7
+ /** The canonical Neatkit responsive breakpoints in CSS pixels. */
8
+ export declare const BREAKPOINTS: {
9
+ readonly sm: 768;
10
+ readonly md: 960;
11
+ readonly lg: 1440;
12
+ readonly xl: 1920;
13
+ };
14
+ /** A supported Neatkit responsive breakpoint name. */
15
+ export type BreakpointName = keyof typeof BREAKPOINTS;
16
+ /** Theme-independent design tokens used by every Neatkit theme. */
17
+ export declare const BASE_TOKENS: {
18
+ readonly "--nk-duration-fast": "200ms";
19
+ readonly "--nk-duration-normal": "300ms";
20
+ readonly "--nk-easing-standard": "ease";
21
+ readonly "--nk-focus-ring-width": "2px";
22
+ readonly "--nk-focus-ring-offset": "2px";
23
+ readonly "--nk-shadow-subtle": string;
24
+ readonly "--nk-shadow-medium": string;
25
+ readonly "--nk-shadow-strong": "0 var(--nk-space-16) var(--nk-space-48) rgb(0 0 0 / 20%)";
26
+ readonly "--nk-font-family-sans": "\"Albert Sans\", system-ui, sans-serif";
27
+ readonly "--nk-font-size-caption": "12px";
28
+ readonly "--nk-font-size-root": "14px";
29
+ readonly "--nk-font-size-body": "var(--nk-font-size-root)";
30
+ readonly "--nk-font-size-subtitle": "16px";
31
+ readonly "--nk-font-size-title": "21px";
32
+ readonly "--nk-font-size-heading": "24px";
33
+ readonly "--nk-font-weight-medium": "500";
34
+ readonly "--nk-font-weight-semibold": "650";
35
+ readonly "--nk-radius-small": "4px";
36
+ readonly "--nk-radius-medium": "8px";
37
+ readonly "--nk-radius-large": "12px";
38
+ readonly "--nk-control-height": "calc(var(--nk-cell) * 0.9)";
39
+ readonly "--nk-choice-size": "calc(var(--nk-cell) * 0.5)";
40
+ readonly "--nk-space-control-gap": "var(--nk-space-8)";
41
+ readonly "--nk-space-control-inline": "var(--nk-space-12)";
42
+ readonly "--nk-space-group-gap": "var(--nk-space-8)";
43
+ readonly "--nk-cell": "36px";
44
+ };
45
+ /** Default theme tokens inherited unless a theme overrides them. */
46
+ export declare const BASE_THEME_TOKENS: {
47
+ readonly "--nk-accent": "#2563eb";
48
+ readonly "--nk-accent-soft": "color-mix(in srgb, var(--nk-accent) 12%, transparent)";
49
+ readonly "--nk-accent-subtle": "color-mix(in srgb, var(--nk-accent) 6%, transparent)";
50
+ readonly "--nk-color-background": "#fff";
51
+ readonly "--nk-color-surface": "#fff";
52
+ readonly "--nk-color-text": "#000";
53
+ readonly "--nk-color-text-muted": "rgb(0 0 0 / 65%)";
54
+ readonly "--nk-color-border": "rgb(0 0 0 / 12.5%)";
55
+ readonly "--nk-color-emphasis-fill": "#000";
56
+ readonly "--nk-color-emphasis-fill-foreground": "#fff";
57
+ readonly "--nk-color-info-foreground": "#2563eb";
58
+ readonly "--nk-color-info-fill": "#2563eb";
59
+ readonly "--nk-color-info-fill-foreground": "#fff";
60
+ readonly "--nk-color-success-foreground": "#15803d";
61
+ readonly "--nk-color-success-fill": "#15803d";
62
+ readonly "--nk-color-success-fill-foreground": "#fff";
63
+ readonly "--nk-color-warning-foreground": "#b84800";
64
+ readonly "--nk-color-warning-fill": "#f97316";
65
+ readonly "--nk-color-warning-fill-foreground": "#000";
66
+ readonly "--nk-color-danger-foreground": "#d32f2f";
67
+ readonly "--nk-color-danger-fill": "#d32f2f";
68
+ readonly "--nk-color-danger-fill-foreground": "#fff";
69
+ readonly "--nk-focus-ring-color": "var(--nk-accent)";
70
+ };
71
+ /** Dark-theme overrides applied on top of the base theme. */
72
+ export declare const DARK_THEME_TOKENS: {
73
+ readonly "--nk-color-background": "#000";
74
+ readonly "--nk-color-surface": "#111";
75
+ readonly "--nk-color-text": "#fff";
76
+ readonly "--nk-color-text-muted": "rgb(255 255 255 / 65%)";
77
+ readonly "--nk-color-border": "rgb(255 255 255 / 15%)";
78
+ readonly "--nk-color-emphasis-fill": "#fff";
79
+ readonly "--nk-color-emphasis-fill-foreground": "#000";
80
+ readonly "--nk-color-info-foreground": "#60a5fa";
81
+ readonly "--nk-color-success-foreground": "#4ade80";
82
+ readonly "--nk-color-warning-foreground": "#fb923c";
83
+ readonly "--nk-color-danger-foreground": "#ff6b6b";
84
+ };
@@ -1,4 +1,4 @@
1
- import type { ReactElement, Ref } from "react";
1
+ import { type ReactElement, type Ref } from "react";
2
2
  /**
3
3
  * Returns the reference assigned to a React element across React versions.
4
4
  *
@@ -0,0 +1,33 @@
1
+ import { type BreakpointName, type SpaceSize } from "../tokens";
2
+ /**
3
+ * Resolves a number of canonical grid cells in CSS pixels.
4
+ *
5
+ * @param amount - The finite number of cells to resolve.
6
+ *
7
+ * @returns The corresponding number of CSS pixels.
8
+ */
9
+ export declare function cell(amount: number): number;
10
+ /**
11
+ * Resolves a canonical spacing size in CSS pixels.
12
+ *
13
+ * @param size - A supported value from the Neatkit spacing scale.
14
+ *
15
+ * @returns The spacing size as a unitless number.
16
+ */
17
+ export declare function space(size: SpaceSize): number;
18
+ /**
19
+ * Resolves a named canonical breakpoint in CSS pixels.
20
+ *
21
+ * @param name - A supported Neatkit breakpoint name.
22
+ *
23
+ * @returns The breakpoint as a unitless number.
24
+ */
25
+ export declare function breakpoint(name: BreakpointName): number;
26
+ /**
27
+ * Serializes a finite numeric value as a CSS pixel length.
28
+ *
29
+ * @param value - The numeric value to serialize.
30
+ *
31
+ * @returns The value followed by the CSS pixel unit.
32
+ */
33
+ export declare function px(value: number): `${number}px`;
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "neatkit",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "A modern, composable UI library for the web.",
5
+ "keywords": ["library", "react", "typescript", "ui"],
5
6
  "type": "module",
6
- "license": "GPL-3.0-only",
7
+ "license": "MPL-2.0",
7
8
  "engines": {
8
9
  "node": "^22.22.2 || ^24.15.0 || >=26.0.0",
9
10
  "npm": ">=10.0.0"