baseline-kit 5.0.0 → 5.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.
Files changed (94) hide show
  1. package/CHANGELOG.md +243 -0
  2. package/README.md +227 -353
  3. package/dist/baseline-kit.css +5 -2
  4. package/dist/core.cjs +1 -1
  5. package/dist/core.d.ts +25 -9
  6. package/dist/core.mjs +1 -1
  7. package/dist/guide.cjs +1 -1
  8. package/dist/guide.cjs.map +1 -1
  9. package/dist/guide.css +1 -1
  10. package/dist/guide.d.ts +16 -16
  11. package/dist/guide.mjs +147 -150
  12. package/dist/guide.mjs.map +1 -1
  13. package/dist/index.cjs +1 -1
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.ts +22 -12
  16. package/dist/index.mjs +169 -158
  17. package/dist/index.mjs.map +1 -1
  18. package/dist/remix-server.d.ts +8 -0
  19. package/dist/remix-server.mjs +15 -0
  20. package/dist/remix-server.mjs.map +1 -0
  21. package/dist/remix.css +2 -0
  22. package/dist/remix.d.ts +191 -0
  23. package/dist/remix.mjs +984 -0
  24. package/dist/remix.mjs.map +1 -0
  25. package/dist/{src-QHaSfgVe.js → src-D0nL1BwZ.js} +96 -165
  26. package/dist/src-D0nL1BwZ.js.map +1 -0
  27. package/dist/src-R5usYJol.cjs +2 -0
  28. package/dist/src-R5usYJol.cjs.map +1 -0
  29. package/dist/styles.css +1 -1
  30. package/dist/theme/default.css +0 -1
  31. package/dist/theme/tokens.css +0 -1
  32. package/dist/theme.css +4 -1
  33. package/package.json +86 -37
  34. package/dist/README.md +0 -468
  35. package/dist/core/src/config/defaults.d.ts +0 -2
  36. package/dist/core/src/config/index.d.ts +0 -3
  37. package/dist/core/src/config/merge.d.ts +0 -21
  38. package/dist/core/src/config/schema.d.ts +0 -33
  39. package/dist/core/src/descriptors/baseline.d.ts +0 -26
  40. package/dist/core/src/descriptors/box.d.ts +0 -20
  41. package/dist/core/src/descriptors/guide.d.ts +0 -44
  42. package/dist/core/src/descriptors/index.d.ts +0 -5
  43. package/dist/core/src/descriptors/padder.d.ts +0 -19
  44. package/dist/core/src/descriptors/spacer.d.ts +0 -24
  45. package/dist/core/src/index.d.ts +0 -10
  46. package/dist/core/src/types.d.ts +0 -62
  47. package/dist/core/src/utils/convert.d.ts +0 -10
  48. package/dist/core/src/utils/grid.d.ts +0 -18
  49. package/dist/core/src/utils/index.d.ts +0 -8
  50. package/dist/core/src/utils/math.d.ts +0 -9
  51. package/dist/core/src/utils/merge.d.ts +0 -28
  52. package/dist/core/src/utils/normalize.d.ts +0 -13
  53. package/dist/core/src/utils/padding.d.ts +0 -2
  54. package/dist/core/src/utils/parse.d.ts +0 -5
  55. package/dist/core/src/utils/snapping.d.ts +0 -2
  56. package/dist/core/src/validation/guide.d.ts +0 -3
  57. package/dist/core/src/validation/index.d.ts +0 -1
  58. package/dist/dom/src/index.d.ts +0 -11
  59. package/dist/dom/src/measure.d.ts +0 -18
  60. package/dist/dom/src/observers.d.ts +0 -5
  61. package/dist/dom/src/ssr.d.ts +0 -20
  62. package/dist/dom/src/timing.d.ts +0 -2
  63. package/dist/dom/src/viewport.d.ts +0 -7
  64. package/dist/dom/src/virtual.d.ts +0 -23
  65. package/dist/react/src/components/Baseline/Baseline.d.ts +0 -13
  66. package/dist/react/src/components/Baseline/index.d.ts +0 -1
  67. package/dist/react/src/components/Box/Box.d.ts +0 -26
  68. package/dist/react/src/components/Box/index.d.ts +0 -1
  69. package/dist/react/src/components/Config/Config.d.ts +0 -20
  70. package/dist/react/src/components/Config/index.d.ts +0 -2
  71. package/dist/react/src/components/Guide/Guide.d.ts +0 -16
  72. package/dist/react/src/components/Guide/index.d.ts +0 -1
  73. package/dist/react/src/components/Padder/Padder.d.ts +0 -20
  74. package/dist/react/src/components/Padder/index.d.ts +0 -1
  75. package/dist/react/src/components/Spacer/Spacer.d.ts +0 -14
  76. package/dist/react/src/components/Spacer/index.d.ts +0 -1
  77. package/dist/react/src/components/index.d.ts +0 -12
  78. package/dist/react/src/components/types.d.ts +0 -29
  79. package/dist/react/src/guide.d.ts +0 -10
  80. package/dist/react/src/hooks/index.d.ts +0 -10
  81. package/dist/react/src/hooks/useBaseline.d.ts +0 -26
  82. package/dist/react/src/hooks/useConfig.d.ts +0 -9
  83. package/dist/react/src/hooks/useDebug.d.ts +0 -6
  84. package/dist/react/src/hooks/useGuide.d.ts +0 -7
  85. package/dist/react/src/hooks/useIsClient.d.ts +0 -4
  86. package/dist/react/src/hooks/useMeasure.d.ts +0 -10
  87. package/dist/react/src/hooks/useVirtual.d.ts +0 -14
  88. package/dist/react/src/index.d.ts +0 -21
  89. package/dist/react/src/utils/index.d.ts +0 -9
  90. package/dist/react/src/utils/merge.d.ts +0 -10
  91. package/dist/react/src/utils/ssr.d.ts +0 -1
  92. package/dist/src-CMjyHjX5.cjs +0 -2
  93. package/dist/src-CMjyHjX5.cjs.map +0 -1
  94. package/dist/src-QHaSfgVe.js.map +0 -1
@@ -1,62 +0,0 @@
1
- /**
2
- * @baseline-kit/core - Pure type definitions
3
- * Framework-agnostic types for the baseline-kit system
4
- */
5
- export type Spacing = number | [number, number] | {
6
- start?: number;
7
- end?: number;
8
- };
9
- export type PaddingValue = number | [number, number] | [number, number, number] | [number, number, number, number] | {
10
- top?: number;
11
- bottom?: number;
12
- left?: number;
13
- right?: number;
14
- };
15
- export type Padding = {
16
- top: number;
17
- right: number;
18
- bottom: number;
19
- left: number;
20
- };
21
- export type SpacingProps = {
22
- padding?: PaddingValue;
23
- block?: Spacing;
24
- inline?: Spacing;
25
- };
26
- export type GuideVariant = 'line' | 'pattern' | 'fixed' | 'auto';
27
- export type GuideColumnValue = string | number | undefined | 'auto';
28
- export type GuideColumnsPattern = readonly GuideColumnValue[];
29
- export declare const GRID_ALIGNMENTS: readonly ["start", "center", "end"];
30
- export type GridAlignment = (typeof GRID_ALIGNMENTS)[number];
31
- export declare const PADD_VARIANTS: readonly ["line", "flat"];
32
- export type PaddedVariant = (typeof PADD_VARIANTS)[number];
33
- export type Variant = 'line' | 'flat' | 'pattern';
34
- export type BaselineVariant = Exclude<Variant, 'pattern'>;
35
- export type SnappingMode = 'none' | 'height' | 'clamp';
36
- export type DebuggingMode = 'none' | 'hidden' | 'visible';
37
- type BaseGuideConfig = {
38
- gap?: number | string;
39
- base?: number;
40
- };
41
- export type PatternConfig = BaseGuideConfig & {
42
- variant: 'pattern';
43
- columns: GuideColumnsPattern;
44
- columnWidth?: never;
45
- };
46
- export type FixedConfig = BaseGuideConfig & {
47
- variant: 'fixed';
48
- columns: number;
49
- columnWidth?: number | string;
50
- };
51
- export type AutoConfig = BaseGuideConfig & {
52
- variant: 'auto';
53
- columnWidth: number | string;
54
- columns?: never;
55
- };
56
- export type LineConfig = BaseGuideConfig & {
57
- variant?: 'line';
58
- columns?: never;
59
- columnWidth?: never;
60
- };
61
- export type GuideConfig = PatternConfig | AutoConfig | FixedConfig | LineConfig;
62
- export {};
@@ -1,10 +0,0 @@
1
- export interface ConversionContext {
2
- parentSize?: number;
3
- viewportWidth?: number;
4
- viewportHeight?: number;
5
- rootFontSize?: number;
6
- parentFontSize?: number;
7
- }
8
- export declare const ABSOLUTE_UNIT_CONVERSIONS: Record<string, number>;
9
- export declare const RELATIVE_UNITS: string[];
10
- export declare function convertValue(value: number | string | undefined, context?: ConversionContext): number | null;
@@ -1,18 +0,0 @@
1
- import type { GuideConfig } from '../types';
2
- import { type ConversionContext } from './convert';
3
- export interface GuideResult {
4
- template: string;
5
- columnsCount: number;
6
- calculatedGap: number;
7
- isValid: boolean;
8
- }
9
- /**
10
- * Pure calculation of grid template from container width and guide config.
11
- * Framework-agnostic — can be used outside React.
12
- *
13
- * Sizing note: the `line` variant still reports the number of pixel tracks as
14
- * metadata, but React renders line guides with a CSS gradient so dense grids do
15
- * not allocate one DOM node per line.
16
- */
17
- export declare function calculateGuideTemplate(width: number, config: GuideConfig, context?: ConversionContext): GuideResult;
18
- export declare const createGridSpanStyles: (span?: number, colSpan?: number, rowSpan?: number) => Record<string, string>;
@@ -1,8 +0,0 @@
1
- export * from './parse';
2
- export * from './convert';
3
- export * from './math';
4
- export * from './normalize';
5
- export * from './padding';
6
- export * from './snapping';
7
- export * from './merge';
8
- export * from './grid';
@@ -1,9 +0,0 @@
1
- export declare function clamp(value: number, min: number, max: number): number;
2
- type RowCountParams = {
3
- height?: number;
4
- top: number;
5
- bottom: number;
6
- base: number;
7
- };
8
- export declare function calculateRowCount(params: RowCountParams): number;
9
- export {};
@@ -1,28 +0,0 @@
1
- import type { DebuggingMode } from '../types';
2
- /**
3
- * Combines class names, filtering out falsy values.
4
- * Lightweight alternative to clsx/classnames.
5
- */
6
- export declare const cx: (...classes: Array<string | boolean | undefined | null>) => string;
7
- /**
8
- * Resolves component debug/visibility state from prop and config.
9
- * Pure function — framework-agnostic.
10
- */
11
- export interface DebugState {
12
- isShown: boolean;
13
- isHidden: boolean;
14
- isNone: boolean;
15
- debugging: DebuggingMode | undefined;
16
- }
17
- export declare function resolveDebugState(debuggingProp?: DebuggingMode, debuggingConfig?: DebuggingMode): DebugState;
18
- export type StyleOverrideParams = {
19
- key: string;
20
- value: string;
21
- defaultStyles: Record<string, string>;
22
- skipDimensions?: {
23
- fitContent?: string[];
24
- auto?: string[];
25
- fullSize?: string[];
26
- };
27
- };
28
- export declare function createStyleOverride(params: StyleOverrideParams | string, value?: string, defaultStyles?: Record<string, string>): Record<string, string>;
@@ -1,13 +0,0 @@
1
- import { type ConversionContext } from './convert';
2
- export interface NormalizationOptions {
3
- base?: number;
4
- round?: boolean;
5
- clamp?: {
6
- min?: number;
7
- max?: number;
8
- };
9
- suppressWarnings?: boolean;
10
- context?: ConversionContext;
11
- }
12
- export declare function normalizeValue(value: string | number | undefined, options?: NormalizationOptions): number;
13
- export declare function normalizeValuePair(values: [string | number | undefined, string | number | undefined] | undefined, defaults: [number, number], options?: NormalizationOptions): [number, number];
@@ -1,2 +0,0 @@
1
- import type { Padding, SpacingProps } from '../types';
2
- export declare function parsePadding(spacing: SpacingProps): Padding;
@@ -1,5 +0,0 @@
1
- export declare function parseUnit(value: string): {
2
- value: number;
3
- unit: string;
4
- } | null;
5
- export declare function formatValue(value: string | number | undefined, defaultValue?: number): string;
@@ -1,2 +0,0 @@
1
- import type { SnappingMode, Padding, PaddingValue } from '../types';
2
- export declare function calculateSnappedSpacing(height: number, base: number, initial: PaddingValue, snapping: SnappingMode): Padding;
@@ -1,3 +0,0 @@
1
- import type { GuideColumnsPattern, GuideColumnValue } from '../types';
2
- export declare const isValidGuideColumnValue: (value: unknown) => value is GuideColumnValue;
3
- export declare const isValidGuidePattern: (pattern: unknown) => pattern is GuideColumnsPattern;
@@ -1 +0,0 @@
1
- export * from './guide';
@@ -1,11 +0,0 @@
1
- /**
2
- * @baseline-kit/dom
3
- * DOM utilities: timing, SSR detection, observers, and browser APIs
4
- * Depends on @baseline-kit/core
5
- */
6
- export * from './timing';
7
- export * from './ssr';
8
- export * from './measure';
9
- export * from './virtual';
10
- export * from './observers';
11
- export * from './viewport';
@@ -1,18 +0,0 @@
1
- /**
2
- * Element measurement observer.
3
- */
4
- export interface MeasureRect {
5
- width: number;
6
- height: number;
7
- }
8
- export interface MeasureObserverHandle {
9
- /** Force an immediate re-measure */
10
- refresh(): void;
11
- /** Stop observing */
12
- disconnect(): void;
13
- }
14
- /**
15
- * Observes an element's dimensions via ResizeObserver.
16
- * Calls `onChange` with rounded width/height whenever the size changes.
17
- */
18
- export declare function createMeasureObserver(el: Element, onChange: (rect: MeasureRect) => void): MeasureObserverHandle;
@@ -1,5 +0,0 @@
1
- /**
2
- * Imperative DOM observers — framework-agnostic compatibility barrel.
3
- */
4
- export * from './measure';
5
- export * from './virtual';
@@ -1,20 +0,0 @@
1
- /**
2
- * Detects if code is running in a server-side environment
3
- */
4
- export declare const isSSR: boolean;
5
- /**
6
- * Default dimensions to use during server-side rendering
7
- */
8
- export declare const SSR_DIMENSIONS: {
9
- width: number;
10
- height: number;
11
- };
12
- /**
13
- * Safe window-using function that works in both server and client
14
- */
15
- export declare function safeClientValue<T>(clientFn: () => T, fallback: T): T;
16
- /**
17
- * Returns a stable value during SSR and initial render, then switches to
18
- * the dynamic value after hydration
19
- */
20
- export declare function hydratedValue<T>(isHydrated: boolean, ssrValue: T, dynamicValue: T): T;
@@ -1,2 +0,0 @@
1
- export declare const debounce: <T extends (...args: unknown[]) => void>(fn: T, delay: number) => [T, () => void];
2
- export declare const rafThrottle: <T extends (...args: never[]) => void>(fn: T) => [T, () => void];
@@ -1,7 +0,0 @@
1
- import type { ConversionContext } from '@baseline-kit/core';
2
- /**
3
- * Returns the current browser viewport for vw/vh/vmin/vmax conversion.
4
- * Returns an empty object on the server so callers fall back to the
5
- * core defaults without crashing.
6
- */
7
- export declare function getViewportContext(): Partial<ConversionContext>;
@@ -1,23 +0,0 @@
1
- /**
2
- * Virtual scroll range tracker.
3
- */
4
- export interface VirtualRange {
5
- start: number;
6
- end: number;
7
- }
8
- export interface VirtualTrackerOptions {
9
- totalItems: number;
10
- itemHeight: number;
11
- buffer?: number;
12
- }
13
- export interface VirtualTrackerHandle {
14
- /** Force recalculation */
15
- refresh(): void;
16
- /** Stop tracking */
17
- disconnect(): void;
18
- }
19
- /**
20
- * Tracks which slice of a virtual list is visible in the viewport.
21
- * Uses IntersectionObserver + window scroll/resize events.
22
- */
23
- export declare function createVirtualTracker(el: Element, options: VirtualTrackerOptions, onChange: (range: VirtualRange) => void): VirtualTrackerHandle;
@@ -1,13 +0,0 @@
1
- import * as React from 'react';
2
- import { ComponentsProps } from '../types';
3
- import type { BaselineVariant } from '@baseline-kit/core';
4
- export type { BaselineVariant };
5
- export type BaselineProps = {
6
- variant?: BaselineVariant;
7
- width?: number | string;
8
- height?: number | string;
9
- base?: number;
10
- color?: string;
11
- ssrMode?: boolean;
12
- } & ComponentsProps;
13
- export declare const Baseline: React.NamedExoticComponent<BaselineProps>;
@@ -1 +0,0 @@
1
- export * from './Baseline';
@@ -1,26 +0,0 @@
1
- import * as React from 'react';
2
- import type { SnappingMode } from '@baseline-kit/core';
3
- import { ComponentsProps } from '../types';
4
- export type { SnappingMode };
5
- export type BoxProps = {
6
- colSpan?: number;
7
- rowSpan?: number;
8
- span?: number;
9
- snapping?: SnappingMode;
10
- ssrMode?: boolean;
11
- children?: React.ReactNode;
12
- } & ComponentsProps;
13
- export declare const Box: React.NamedExoticComponent<{
14
- colSpan?: number;
15
- rowSpan?: number;
16
- span?: number;
17
- snapping?: SnappingMode;
18
- ssrMode?: boolean;
19
- children?: React.ReactNode;
20
- } & {
21
- debugging?: import("@baseline-kit/core").DebuggingMode;
22
- className?: string;
23
- style?: React.CSSProperties;
24
- height?: React.CSSProperties["height"];
25
- width?: React.CSSProperties["width"];
26
- } & import("@baseline-kit/core").SpacingProps & React.RefAttributes<HTMLDivElement>>;
@@ -1 +0,0 @@
1
- export * from './Box';
@@ -1,20 +0,0 @@
1
- import * as React from 'react';
2
- import type { ConfigSchema } from '@baseline-kit/core/config/schema';
3
- import { mergeConfig, createCSSVariables } from '@baseline-kit/core/config/merge';
4
- export type { DebuggingMode } from '@baseline-kit/core/types';
5
- export type { ConfigSchema } from '@baseline-kit/core/config/schema';
6
- export declare const useDefaultConfig: () => ConfigSchema;
7
- type ConfigProps = {
8
- children: React.ReactNode;
9
- base?: number;
10
- baseline?: Partial<ConfigSchema['baseline']>;
11
- guide?: Partial<ConfigSchema['guide']>;
12
- spacer?: Partial<ConfigSchema['spacer']>;
13
- box?: Partial<ConfigSchema['box']>;
14
- padder?: Partial<ConfigSchema['padder']>;
15
- };
16
- /**
17
- * Configuration provider for baseline-kit components.
18
- */
19
- export declare function Config({ children, base, baseline, guide, spacer, box, padder, }: ConfigProps): import("react/jsx-runtime").JSX.Element;
20
- export { createCSSVariables, mergeConfig };
@@ -1,2 +0,0 @@
1
- export * from './Config';
2
- export { DEFAULT_CONFIG } from '@baseline-kit/core';
@@ -1,16 +0,0 @@
1
- import * as React from 'react';
2
- import type { ComponentsProps } from '../types';
3
- import type { GuideVariant, GuideConfig } from '@baseline-kit/core/types';
4
- export type { GuideConfig };
5
- export type GuideProps = {
6
- align?: React.CSSProperties['justifyContent'];
7
- variant?: GuideVariant;
8
- columns?: number | readonly (string | number | undefined | 'auto')[];
9
- columnWidth?: React.CSSProperties['width'];
10
- maxWidth?: React.CSSProperties['maxWidth'];
11
- color?: React.CSSProperties['color'];
12
- children?: React.ReactNode;
13
- gap?: number;
14
- ssrMode?: boolean;
15
- } & ComponentsProps & Omit<GuideConfig, 'columns' | 'columnWidth' | 'gap'>;
16
- export declare const Guide: React.NamedExoticComponent<GuideProps>;
@@ -1 +0,0 @@
1
- export * from './Guide';
@@ -1,20 +0,0 @@
1
- import * as React from 'react';
2
- import { ComponentsProps } from '../types';
3
- import { IndicatorNode } from '../Spacer';
4
- import type { DebuggingMode } from '../types';
5
- export type PadderProps = {
6
- indicatorNode?: IndicatorNode;
7
- ssrMode?: boolean;
8
- children?: React.ReactNode;
9
- } & ComponentsProps;
10
- export declare const Padder: React.NamedExoticComponent<{
11
- indicatorNode?: IndicatorNode;
12
- ssrMode?: boolean;
13
- children?: React.ReactNode;
14
- } & {
15
- debugging?: DebuggingMode;
16
- className?: string;
17
- style?: React.CSSProperties;
18
- height?: React.CSSProperties["height"];
19
- width?: React.CSSProperties["width"];
20
- } & import("@baseline-kit/core").SpacingProps & React.RefAttributes<HTMLDivElement>>;
@@ -1 +0,0 @@
1
- export * from './Padder';
@@ -1,14 +0,0 @@
1
- import * as React from 'react';
2
- import { ComponentsProps, Variant } from '../types';
3
- export type IndicatorNode = (value: number, type: 'width' | 'height') => React.ReactNode;
4
- export type SpacerProps = {
5
- width?: React.CSSProperties['width'];
6
- height?: React.CSSProperties['height'];
7
- variant?: Variant;
8
- color?: string;
9
- base?: number;
10
- children?: React.ReactNode;
11
- indicatorNode?: IndicatorNode;
12
- ssrMode?: boolean;
13
- } & ComponentsProps;
14
- export declare const Spacer: React.NamedExoticComponent<SpacerProps>;
@@ -1 +0,0 @@
1
- export * from './Spacer';
@@ -1,12 +0,0 @@
1
- /**
2
- * @baseline-kit/react components
3
- */
4
- import './styles/core.css';
5
- import './styles/theme.css';
6
- export * from './Box';
7
- export * from './Spacer';
8
- export * from './Padder';
9
- export * from './Guide';
10
- export * from './Baseline';
11
- export * from './Config';
12
- export * from './types';
@@ -1,29 +0,0 @@
1
- import * as React from 'react';
2
- import type { DebuggingMode, SpacingProps } from '@baseline-kit/core';
3
- export type { Spacing, PaddingValue, Padding, SpacingProps, GuideVariant, GuideColumnValue, GuideColumnsPattern, GridAlignment, PaddedVariant, Variant, DebuggingMode, ConfigSchema, } from '@baseline-kit/core';
4
- export { GRID_ALIGNMENTS, PADD_VARIANTS } from '@baseline-kit/core';
5
- /**
6
- * Common props shared across library components.
7
- */
8
- export type ComponentsProps = {
9
- debugging?: DebuggingMode;
10
- className?: string;
11
- style?: React.CSSProperties;
12
- height?: React.CSSProperties['height'];
13
- width?: React.CSSProperties['width'];
14
- } & SpacingProps;
15
- /** Base configuration for components that support padding. */
16
- export type PaddedBaseConfig = {
17
- base?: number;
18
- color?: React.CSSProperties['color'] | React.CSSProperties['backgroundColor'];
19
- zIndex?: React.CSSProperties['zIndex'];
20
- };
21
- export type Gaps = {
22
- gap?: React.CSSProperties['gap'];
23
- rowGap?: never;
24
- columnGap?: never;
25
- } | {
26
- gap?: never;
27
- rowGap?: React.CSSProperties['rowGap'];
28
- columnGap?: React.CSSProperties['columnGap'];
29
- };
@@ -1,10 +0,0 @@
1
- /**
2
- * Guide-only entry point for consumers that only need the grid overlay.
3
- */
4
- import './components/styles/core.css';
5
- export { Config } from './components/Config';
6
- export { Guide } from './components/Guide';
7
- export type { DebuggingMode, ConfigSchema } from './components/Config/Config';
8
- export type { GuideProps, GuideConfig } from './components/Guide';
9
- export type { GuideVariant } from '@baseline-kit/core/types';
10
- export { createCSSVariables, mergeConfig } from './components/Config/Config';
@@ -1,10 +0,0 @@
1
- /**
2
- * @baseline-kit/react hooks
3
- */
4
- export * from './useMeasure';
5
- export * from './useVirtual';
6
- export * from './useBaseline';
7
- export * from './useGuide';
8
- export * from './useConfig';
9
- export * from './useDebug';
10
- export * from './useIsClient';
@@ -1,26 +0,0 @@
1
- import * as React from 'react';
2
- import type { SnappingMode, Padding } from '@baseline-kit/core';
3
- export interface BaselineOptions {
4
- base?: number;
5
- snapping?: SnappingMode;
6
- spacing?: Partial<Padding> | number;
7
- }
8
- export interface BaselineResult {
9
- padding: Padding;
10
- isAligned: boolean;
11
- height: number;
12
- }
13
- /**
14
- * Hook for managing baseline grid alignment in components.
15
- *
16
- * Snapping notes
17
- * --------------
18
- * `clamp` mode would oscillate without a latch: each snap tweaks the
19
- * element's padding which changes its measured height, which would
20
- * trigger another snap, and so on. We snap exactly once per mount on
21
- * the *first non-zero* measurement, then keep returning the snapped
22
- * padding for the rest of the element's life. Resizes after the first
23
- * snap intentionally do not re-snap (avoids visual jitter and the
24
- * `clamp` oscillation).
25
- */
26
- export declare function useBaseline(ref: React.RefObject<HTMLElement | null>, { base, snapping, spacing }?: BaselineOptions): BaselineResult;
@@ -1,9 +0,0 @@
1
- import type { ConfigSchema } from '@baseline-kit/core/config/schema';
2
- /** Type helper that merges base configuration with component-specific settings. */
3
- export type ComponentConfig<K extends keyof ConfigSchema> = ConfigSchema[K] & {
4
- base: number;
5
- };
6
- /**
7
- * Hook for accessing component-specific theme configuration.
8
- */
9
- export declare function useConfig<K extends keyof ConfigSchema>(component: K): ComponentConfig<K>;
@@ -1,6 +0,0 @@
1
- import type { DebuggingMode } from '@baseline-kit/core/types';
2
- /**
3
- * Hook for managing component debug state and visibility.
4
- * Delegates to pure resolveDebugState in core.
5
- */
6
- export declare function useDebug(debuggingProp?: DebuggingMode, debuggingConfig?: DebuggingMode): import("@baseline-kit/core").DebugState;
@@ -1,7 +0,0 @@
1
- import * as React from 'react';
2
- import type { GuideConfig } from '@baseline-kit/core/types';
3
- export type { GuideResult } from '@baseline-kit/core/utils/grid';
4
- /**
5
- * Hook for calculating grid layout parameters based on container dimensions.
6
- */
7
- export declare function useGuide(ref: React.RefObject<HTMLElement | null>, config: GuideConfig): import("@baseline-kit/core").GuideResult;
@@ -1,4 +0,0 @@
1
- /**
2
- * Hook to determine if the code is running on the client side.
3
- */
4
- export declare function useIsClient(): boolean;
@@ -1,10 +0,0 @@
1
- import * as React from 'react';
2
- import type { MeasureRect } from '@baseline-kit/dom/measure';
3
- export interface MeasureResult extends MeasureRect {
4
- refresh: () => void;
5
- }
6
- /**
7
- * Hook for measuring and tracking DOM element dimensions.
8
- * Thin wrapper around the imperative createMeasureObserver from @baseline-kit/dom.
9
- */
10
- export declare function useMeasure(ref: React.RefObject<HTMLElement | null>): MeasureResult;
@@ -1,14 +0,0 @@
1
- import { RefObject } from 'react';
2
- import type { VirtualRange } from '@baseline-kit/dom/virtual';
3
- type VirtualOptions = {
4
- totalLines: number;
5
- lineHeight: number;
6
- containerRef: RefObject<HTMLDivElement | null>;
7
- buffer?: number | string;
8
- };
9
- /**
10
- * Hook for optimizing large lists through virtual scrolling.
11
- * Thin wrapper around the imperative createVirtualTracker from @baseline-kit/dom.
12
- */
13
- export declare function useVirtual({ totalLines, lineHeight, containerRef, buffer, }: VirtualOptions): VirtualRange;
14
- export {};
@@ -1,21 +0,0 @@
1
- /**
2
- * @baseline-kit/react
3
- * React adapter for baseline-kit: components, hooks, and React-specific utilities
4
- *
5
- * Re-exports from @baseline-kit/core and @baseline-kit/dom for convenience.
6
- */
7
- import './components/styles/core.css';
8
- export { Config } from './components/Config';
9
- export { Baseline } from './components/Baseline';
10
- export { Guide } from './components/Guide';
11
- export { Box } from './components/Box';
12
- export { Spacer } from './components/Spacer';
13
- export { Padder } from './components/Padder';
14
- export type { DebuggingMode, ConfigSchema } from './components/Config/Config';
15
- export type { GuideVariant, Spacing, SpacingProps, PaddingValue, Variant, } from '@baseline-kit/core';
16
- export type { BaselineProps, BaselineVariant } from './components/Baseline';
17
- export type { BoxProps, SnappingMode } from './components/Box';
18
- export type { GuideProps } from './components/Guide';
19
- export type { IndicatorNode, SpacerProps } from './components/Spacer';
20
- export type { PadderProps } from './components/Padder';
21
- export { isSSR, safeClientValue } from '@baseline-kit/dom';
@@ -1,9 +0,0 @@
1
- /**
2
- * @baseline-kit/react utilities
3
- * Re-exports from core and dom for backwards compatibility,
4
- * plus React-specific merge and SSR utilities.
5
- */
6
- export * from '@baseline-kit/core';
7
- export * from '@baseline-kit/dom';
8
- export * from './merge';
9
- export * from './ssr';
@@ -1,10 +0,0 @@
1
- import * as React from 'react';
2
- /**
3
- * Combines descriptor style records and React style objects.
4
- * Accepts Record<string, string> from descriptors and React.CSSProperties.
5
- */
6
- export declare function mergeStyles(...styles: Array<Record<string, string> | React.CSSProperties | undefined>): React.CSSProperties;
7
- /**
8
- * Merges multiple React refs into a single callback ref.
9
- */
10
- export declare function mergeRefs<T>(...refs: Array<React.Ref<T> | null | undefined>): React.RefCallback<T>;
@@ -1 +0,0 @@
1
- export {};