baseline-kit 5.0.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +235 -0
- package/README.md +223 -353
- package/dist/baseline-kit.css +5 -2
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +18 -8
- package/dist/core.mjs +1 -1
- package/dist/guide.cjs +1 -1
- package/dist/guide.cjs.map +1 -1
- package/dist/guide.css +1 -1
- package/dist/guide.d.ts +16 -16
- package/dist/guide.mjs +147 -150
- package/dist/guide.mjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +18 -11
- package/dist/index.mjs +126 -120
- package/dist/index.mjs.map +1 -1
- package/dist/remix-server.d.ts +8 -0
- package/dist/remix-server.mjs +15 -0
- package/dist/remix-server.mjs.map +1 -0
- package/dist/remix.css +2 -0
- package/dist/remix.d.ts +177 -0
- package/dist/remix.mjs +989 -0
- package/dist/remix.mjs.map +1 -0
- package/dist/src-C-1u5WNS.cjs +2 -0
- package/dist/src-C-1u5WNS.cjs.map +1 -0
- package/dist/{src-QHaSfgVe.js → src-C3TICsw6.js} +88 -160
- package/dist/src-C3TICsw6.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/theme/default.css +0 -1
- package/dist/theme/tokens.css +0 -1
- package/dist/theme.css +4 -1
- package/package.json +86 -37
- package/dist/README.md +0 -468
- package/dist/core/src/config/defaults.d.ts +0 -2
- package/dist/core/src/config/index.d.ts +0 -3
- package/dist/core/src/config/merge.d.ts +0 -21
- package/dist/core/src/config/schema.d.ts +0 -33
- package/dist/core/src/descriptors/baseline.d.ts +0 -26
- package/dist/core/src/descriptors/box.d.ts +0 -20
- package/dist/core/src/descriptors/guide.d.ts +0 -44
- package/dist/core/src/descriptors/index.d.ts +0 -5
- package/dist/core/src/descriptors/padder.d.ts +0 -19
- package/dist/core/src/descriptors/spacer.d.ts +0 -24
- package/dist/core/src/index.d.ts +0 -10
- package/dist/core/src/types.d.ts +0 -62
- package/dist/core/src/utils/convert.d.ts +0 -10
- package/dist/core/src/utils/grid.d.ts +0 -18
- package/dist/core/src/utils/index.d.ts +0 -8
- package/dist/core/src/utils/math.d.ts +0 -9
- package/dist/core/src/utils/merge.d.ts +0 -28
- package/dist/core/src/utils/normalize.d.ts +0 -13
- package/dist/core/src/utils/padding.d.ts +0 -2
- package/dist/core/src/utils/parse.d.ts +0 -5
- package/dist/core/src/utils/snapping.d.ts +0 -2
- package/dist/core/src/validation/guide.d.ts +0 -3
- package/dist/core/src/validation/index.d.ts +0 -1
- package/dist/dom/src/index.d.ts +0 -11
- package/dist/dom/src/measure.d.ts +0 -18
- package/dist/dom/src/observers.d.ts +0 -5
- package/dist/dom/src/ssr.d.ts +0 -20
- package/dist/dom/src/timing.d.ts +0 -2
- package/dist/dom/src/viewport.d.ts +0 -7
- package/dist/dom/src/virtual.d.ts +0 -23
- package/dist/react/src/components/Baseline/Baseline.d.ts +0 -13
- package/dist/react/src/components/Baseline/index.d.ts +0 -1
- package/dist/react/src/components/Box/Box.d.ts +0 -26
- package/dist/react/src/components/Box/index.d.ts +0 -1
- package/dist/react/src/components/Config/Config.d.ts +0 -20
- package/dist/react/src/components/Config/index.d.ts +0 -2
- package/dist/react/src/components/Guide/Guide.d.ts +0 -16
- package/dist/react/src/components/Guide/index.d.ts +0 -1
- package/dist/react/src/components/Padder/Padder.d.ts +0 -20
- package/dist/react/src/components/Padder/index.d.ts +0 -1
- package/dist/react/src/components/Spacer/Spacer.d.ts +0 -14
- package/dist/react/src/components/Spacer/index.d.ts +0 -1
- package/dist/react/src/components/index.d.ts +0 -12
- package/dist/react/src/components/types.d.ts +0 -29
- package/dist/react/src/guide.d.ts +0 -10
- package/dist/react/src/hooks/index.d.ts +0 -10
- package/dist/react/src/hooks/useBaseline.d.ts +0 -26
- package/dist/react/src/hooks/useConfig.d.ts +0 -9
- package/dist/react/src/hooks/useDebug.d.ts +0 -6
- package/dist/react/src/hooks/useGuide.d.ts +0 -7
- package/dist/react/src/hooks/useIsClient.d.ts +0 -4
- package/dist/react/src/hooks/useMeasure.d.ts +0 -10
- package/dist/react/src/hooks/useVirtual.d.ts +0 -14
- package/dist/react/src/index.d.ts +0 -21
- package/dist/react/src/utils/index.d.ts +0 -9
- package/dist/react/src/utils/merge.d.ts +0 -10
- package/dist/react/src/utils/ssr.d.ts +0 -1
- package/dist/src-CMjyHjX5.cjs +0 -2
- package/dist/src-CMjyHjX5.cjs.map +0 -1
- package/dist/src-QHaSfgVe.js.map +0 -1
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { GuideVariant, BaselineVariant, Variant, DebuggingMode } from '../types';
|
|
2
|
-
type DebugColors = {
|
|
3
|
-
line: string;
|
|
4
|
-
flat: string;
|
|
5
|
-
text: string;
|
|
6
|
-
};
|
|
7
|
-
export type ConfigSchema = {
|
|
8
|
-
base: number;
|
|
9
|
-
baseline: {
|
|
10
|
-
variant: BaselineVariant;
|
|
11
|
-
debugging: DebuggingMode;
|
|
12
|
-
colors: Record<BaselineVariant, string>;
|
|
13
|
-
};
|
|
14
|
-
guide: {
|
|
15
|
-
variant: GuideVariant;
|
|
16
|
-
debugging: DebuggingMode;
|
|
17
|
-
colors: Record<GuideVariant, string>;
|
|
18
|
-
};
|
|
19
|
-
spacer: {
|
|
20
|
-
variant: Variant;
|
|
21
|
-
debugging: DebuggingMode;
|
|
22
|
-
colors: DebugColors;
|
|
23
|
-
};
|
|
24
|
-
box: {
|
|
25
|
-
debugging: DebuggingMode;
|
|
26
|
-
colors: DebugColors;
|
|
27
|
-
};
|
|
28
|
-
padder: {
|
|
29
|
-
debugging: DebuggingMode;
|
|
30
|
-
color: string;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { BaselineVariant } from '../types';
|
|
2
|
-
export interface BaselineDescriptorParams {
|
|
3
|
-
base: number;
|
|
4
|
-
colors: Record<BaselineVariant, string>;
|
|
5
|
-
variant: BaselineVariant;
|
|
6
|
-
width?: number | string;
|
|
7
|
-
height?: number | string;
|
|
8
|
-
color?: string;
|
|
9
|
-
containerWidth: number;
|
|
10
|
-
containerHeight: number;
|
|
11
|
-
spacing: Record<string, unknown>;
|
|
12
|
-
isVisible: boolean;
|
|
13
|
-
}
|
|
14
|
-
export interface BaselineDescriptor {
|
|
15
|
-
containerStyle: Record<string, string>;
|
|
16
|
-
rowCount: number;
|
|
17
|
-
getRowStyle: (index: number) => Record<string, string>;
|
|
18
|
-
padding: string | undefined;
|
|
19
|
-
isVisible: boolean;
|
|
20
|
-
classTokens: string[];
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Computes all styles and data needed to render a Baseline component.
|
|
24
|
-
* Pure function — framework-agnostic.
|
|
25
|
-
*/
|
|
26
|
-
export declare function createBaselineDescriptor(params: BaselineDescriptorParams): BaselineDescriptor;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface BoxDescriptorParams {
|
|
2
|
-
base: number;
|
|
3
|
-
lineColor: string;
|
|
4
|
-
width?: number | string;
|
|
5
|
-
height?: number | string;
|
|
6
|
-
span?: number;
|
|
7
|
-
colSpan?: number;
|
|
8
|
-
rowSpan?: number;
|
|
9
|
-
isVisible: boolean;
|
|
10
|
-
}
|
|
11
|
-
export interface BoxDescriptor {
|
|
12
|
-
boxStyle: Record<string, string>;
|
|
13
|
-
gridSpanStyle: Record<string, string>;
|
|
14
|
-
classTokens: string[];
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Computes styles needed to render a Box component.
|
|
18
|
-
* Pure function — framework-agnostic.
|
|
19
|
-
*/
|
|
20
|
-
export declare function createBoxDescriptor(params: BoxDescriptorParams): BoxDescriptor;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { GuideVariant, GuideConfig } from '../types';
|
|
2
|
-
export interface GuideDescriptorParams {
|
|
3
|
-
base: number;
|
|
4
|
-
colors: Record<GuideVariant, string>;
|
|
5
|
-
variant: GuideVariant;
|
|
6
|
-
align: string;
|
|
7
|
-
width?: number | string;
|
|
8
|
-
height?: number | string;
|
|
9
|
-
columnWidth?: number | string;
|
|
10
|
-
maxWidth?: number | string;
|
|
11
|
-
color?: string;
|
|
12
|
-
/** Pre-computed guide template result (from useGuide or calculateGuideTemplate) */
|
|
13
|
-
template: string;
|
|
14
|
-
columnsCount: number;
|
|
15
|
-
calculatedGap: number;
|
|
16
|
-
isVisible: boolean;
|
|
17
|
-
}
|
|
18
|
-
export interface GuideDescriptor {
|
|
19
|
-
containerStyle: Record<string, string>;
|
|
20
|
-
columnColor: string;
|
|
21
|
-
columnsCount: number;
|
|
22
|
-
calculatedGap: number;
|
|
23
|
-
template: string;
|
|
24
|
-
isVisible: boolean;
|
|
25
|
-
isLineVariant: boolean;
|
|
26
|
-
classTokens: string[];
|
|
27
|
-
}
|
|
28
|
-
export interface GuideConfigParams {
|
|
29
|
-
variant: GuideVariant;
|
|
30
|
-
base: number;
|
|
31
|
-
gap: number;
|
|
32
|
-
columns?: number | readonly (string | number | undefined | 'auto')[];
|
|
33
|
-
columnWidth?: number | string;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Creates a GuideConfig from component props.
|
|
37
|
-
* Pure function — no React or DOM dependency.
|
|
38
|
-
*/
|
|
39
|
-
export declare function createGuideConfig({ variant, base, gap, columns, columnWidth, }: GuideConfigParams): GuideConfig;
|
|
40
|
-
/**
|
|
41
|
-
* Computes all styles and data needed to render a Guide component.
|
|
42
|
-
* Pure function — framework-agnostic.
|
|
43
|
-
*/
|
|
44
|
-
export declare function createGuideDescriptor(params: GuideDescriptorParams): GuideDescriptor;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { Padding } from '../types';
|
|
2
|
-
export interface PadderDescriptorParams {
|
|
3
|
-
base: number;
|
|
4
|
-
color: string;
|
|
5
|
-
width?: number | string;
|
|
6
|
-
height?: number | string;
|
|
7
|
-
padding: Padding;
|
|
8
|
-
enableSpacers: boolean;
|
|
9
|
-
isVisible: boolean;
|
|
10
|
-
}
|
|
11
|
-
export interface PadderDescriptor {
|
|
12
|
-
containerStyle: Record<string, string>;
|
|
13
|
-
classTokens: string[];
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Computes styles needed to render a Padder component.
|
|
17
|
-
* Pure function — framework-agnostic.
|
|
18
|
-
*/
|
|
19
|
-
export declare function createPadderDescriptor(params: PadderDescriptorParams): PadderDescriptor;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export interface SpacerDescriptorParams {
|
|
2
|
-
base: number;
|
|
3
|
-
colors: {
|
|
4
|
-
line: string;
|
|
5
|
-
flat: string;
|
|
6
|
-
text: string;
|
|
7
|
-
};
|
|
8
|
-
width?: number | string;
|
|
9
|
-
height?: number | string;
|
|
10
|
-
color?: string;
|
|
11
|
-
variant: string;
|
|
12
|
-
isVisible: boolean;
|
|
13
|
-
}
|
|
14
|
-
export interface SpacerDescriptor {
|
|
15
|
-
style: Record<string, string>;
|
|
16
|
-
normWidth: number;
|
|
17
|
-
normHeight: number;
|
|
18
|
-
classTokens: string[];
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Computes styles needed to render a Spacer component.
|
|
22
|
-
* Pure function — framework-agnostic.
|
|
23
|
-
*/
|
|
24
|
-
export declare function createSpacerDescriptor(params: SpacerDescriptorParams): SpacerDescriptor;
|
package/dist/core/src/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @baseline-kit/core
|
|
3
|
-
* Pure TypeScript core: types, utilities, config, validation, and descriptors
|
|
4
|
-
* Zero dependencies — works in any JavaScript runtime
|
|
5
|
-
*/
|
|
6
|
-
export * from './types';
|
|
7
|
-
export * from './config';
|
|
8
|
-
export * from './utils';
|
|
9
|
-
export * from './validation';
|
|
10
|
-
export * from './descriptors';
|
package/dist/core/src/types.d.ts
DELETED
|
@@ -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,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 +0,0 @@
|
|
|
1
|
-
export * from './guide';
|
package/dist/dom/src/index.d.ts
DELETED
|
@@ -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;
|
package/dist/dom/src/ssr.d.ts
DELETED
|
@@ -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;
|
package/dist/dom/src/timing.d.ts
DELETED
|
@@ -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,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
|
-
};
|