baseline-kit 3.0.2 → 5.0.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 (123) hide show
  1. package/README.md +70 -48
  2. package/dist/README.md +70 -48
  3. package/dist/baseline-kit.css +3 -21
  4. package/dist/core/src/config/defaults.d.ts +2 -0
  5. package/dist/core/src/config/index.d.ts +3 -0
  6. package/dist/core/src/config/merge.d.ts +21 -0
  7. package/dist/core/src/config/schema.d.ts +33 -0
  8. package/dist/core/src/descriptors/baseline.d.ts +26 -0
  9. package/dist/core/src/descriptors/box.d.ts +20 -0
  10. package/dist/core/src/descriptors/guide.d.ts +44 -0
  11. package/dist/core/src/descriptors/index.d.ts +5 -0
  12. package/dist/core/src/descriptors/padder.d.ts +19 -0
  13. package/dist/core/src/descriptors/spacer.d.ts +24 -0
  14. package/dist/core/src/index.d.ts +10 -0
  15. package/dist/core/src/types.d.ts +62 -0
  16. package/dist/core/src/utils/convert.d.ts +10 -0
  17. package/dist/core/src/utils/grid.d.ts +18 -0
  18. package/dist/{utils → core/src/utils}/index.d.ts +2 -9
  19. package/dist/core/src/utils/math.d.ts +9 -0
  20. package/dist/core/src/utils/merge.d.ts +28 -0
  21. package/dist/core/src/utils/normalize.d.ts +13 -0
  22. package/dist/core/src/utils/padding.d.ts +2 -0
  23. package/dist/core/src/utils/parse.d.ts +5 -0
  24. package/dist/core/src/utils/snapping.d.ts +2 -0
  25. package/dist/core/src/validation/guide.d.ts +3 -0
  26. package/dist/core/src/validation/index.d.ts +1 -0
  27. package/dist/core.cjs +1 -0
  28. package/dist/core.d.ts +344 -0
  29. package/dist/core.mjs +2 -0
  30. package/dist/dom/src/index.d.ts +11 -0
  31. package/dist/dom/src/measure.d.ts +18 -0
  32. package/dist/dom/src/observers.d.ts +5 -0
  33. package/dist/{utils → dom/src}/ssr.d.ts +0 -6
  34. package/dist/dom/src/timing.d.ts +2 -0
  35. package/dist/dom/src/viewport.d.ts +7 -0
  36. package/dist/dom/src/virtual.d.ts +23 -0
  37. package/dist/guide.cjs +2 -0
  38. package/dist/guide.cjs.map +1 -0
  39. package/dist/guide.css +2 -0
  40. package/dist/guide.d.ts +146 -0
  41. package/dist/guide.mjs +589 -0
  42. package/dist/guide.mjs.map +1 -0
  43. package/dist/index.cjs +2 -2
  44. package/dist/index.cjs.map +1 -1
  45. package/dist/index.d.ts +197 -30
  46. package/dist/index.mjs +614 -1747
  47. package/dist/index.mjs.map +1 -1
  48. package/dist/react/src/components/Baseline/Baseline.d.ts +13 -0
  49. package/dist/react/src/components/Baseline/index.d.ts +1 -0
  50. package/dist/react/src/components/Box/Box.d.ts +26 -0
  51. package/dist/react/src/components/Box/index.d.ts +1 -0
  52. package/dist/react/src/components/Config/Config.d.ts +20 -0
  53. package/dist/react/src/components/Config/index.d.ts +2 -0
  54. package/dist/react/src/components/Guide/Guide.d.ts +16 -0
  55. package/dist/react/src/components/Guide/index.d.ts +1 -0
  56. package/dist/react/src/components/Padder/Padder.d.ts +20 -0
  57. package/dist/react/src/components/Padder/index.d.ts +1 -0
  58. package/dist/react/src/components/Spacer/Spacer.d.ts +14 -0
  59. package/dist/react/src/components/Spacer/index.d.ts +1 -0
  60. package/dist/{components → react/src/components}/index.d.ts +1 -5
  61. package/dist/react/src/components/types.d.ts +29 -0
  62. package/dist/react/src/guide.d.ts +10 -0
  63. package/dist/{hooks → react/src/hooks}/index.d.ts +2 -3
  64. package/dist/react/src/hooks/useBaseline.d.ts +26 -0
  65. package/dist/react/src/hooks/useConfig.d.ts +9 -0
  66. package/dist/react/src/hooks/useDebug.d.ts +6 -0
  67. package/dist/react/src/hooks/useGuide.d.ts +7 -0
  68. package/dist/{hooks → react/src/hooks}/useIsClient.d.ts +0 -2
  69. package/dist/react/src/hooks/useMeasure.d.ts +10 -0
  70. package/dist/react/src/hooks/useVirtual.d.ts +14 -0
  71. package/dist/react/src/index.d.ts +21 -0
  72. package/dist/react/src/utils/index.d.ts +9 -0
  73. package/dist/react/src/utils/merge.d.ts +10 -0
  74. package/dist/react/src/utils/ssr.d.ts +1 -0
  75. package/dist/reset.css +43 -0
  76. package/dist/src-CMjyHjX5.cjs +2 -0
  77. package/dist/src-CMjyHjX5.cjs.map +1 -0
  78. package/dist/src-QHaSfgVe.js +619 -0
  79. package/dist/src-QHaSfgVe.js.map +1 -0
  80. package/dist/styles.css +1 -1
  81. package/dist/theme/dark.css +0 -8
  82. package/dist/theme/default.css +0 -9
  83. package/dist/theme/tokens.css +1 -10
  84. package/dist/theme.css +0 -18
  85. package/package.json +82 -42
  86. package/dist/components/Baseline/Baseline.d.ts +0 -48
  87. package/dist/components/Baseline/index.d.ts +0 -6
  88. package/dist/components/Box/Box.d.ts +0 -73
  89. package/dist/components/Box/index.d.ts +0 -6
  90. package/dist/components/Config/Config.d.ts +0 -179
  91. package/dist/components/Config/defaults.d.ts +0 -25
  92. package/dist/components/Config/index.d.ts +0 -11
  93. package/dist/components/Guide/Guide.d.ts +0 -70
  94. package/dist/components/Guide/index.d.ts +0 -6
  95. package/dist/components/Guide/types.d.ts +0 -144
  96. package/dist/components/Guide/validation.d.ts +0 -82
  97. package/dist/components/Layout/Layout.d.ts +0 -73
  98. package/dist/components/Layout/index.d.ts +0 -10
  99. package/dist/components/Padder/Padder.d.ts +0 -67
  100. package/dist/components/Padder/index.d.ts +0 -10
  101. package/dist/components/Spacer/Spacer.d.ts +0 -48
  102. package/dist/components/Spacer/index.d.ts +0 -10
  103. package/dist/components/Stack/Stack.d.ts +0 -84
  104. package/dist/components/Stack/index.d.ts +0 -10
  105. package/dist/components/styles/index.d.ts +0 -11
  106. package/dist/components/types.d.ts +0 -102
  107. package/dist/hooks/useBaseline.d.ts +0 -55
  108. package/dist/hooks/useConfig.d.ts +0 -41
  109. package/dist/hooks/useDebug.d.ts +0 -49
  110. package/dist/hooks/useGuide.d.ts +0 -61
  111. package/dist/hooks/useMeasure.d.ts +0 -35
  112. package/dist/hooks/useVirtual.d.ts +0 -60
  113. package/dist/styles.d.ts +0 -6
  114. package/dist/theme.d.ts +0 -6
  115. package/dist/utils/convert.d.ts +0 -24
  116. package/dist/utils/grid.d.ts +0 -22
  117. package/dist/utils/math.d.ts +0 -48
  118. package/dist/utils/merge.d.ts +0 -117
  119. package/dist/utils/normalize.d.ts +0 -30
  120. package/dist/utils/padding.d.ts +0 -11
  121. package/dist/utils/parse.d.ts +0 -18
  122. package/dist/utils/snapping.d.ts +0 -28
  123. package/dist/utils/timing.d.ts +0 -45
@@ -0,0 +1,26 @@
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>>;
@@ -0,0 +1 @@
1
+ export * from './Box';
@@ -0,0 +1,20 @@
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 };
@@ -0,0 +1,2 @@
1
+ export * from './Config';
2
+ export { DEFAULT_CONFIG } from '@baseline-kit/core';
@@ -0,0 +1,16 @@
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>;
@@ -0,0 +1 @@
1
+ export * from './Guide';
@@ -0,0 +1,20 @@
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>>;
@@ -0,0 +1 @@
1
+ export * from './Padder';
@@ -0,0 +1,14 @@
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>;
@@ -0,0 +1 @@
1
+ export * from './Spacer';
@@ -1,13 +1,9 @@
1
1
  /**
2
- * @file Component Exports (components/index.ts)
3
- * @description Main entry point for baseline-kit components
4
- * @module baseline-kit/components
2
+ * @baseline-kit/react components
5
3
  */
6
4
  import './styles/core.css';
7
5
  import './styles/theme.css';
8
- export * from './Layout';
9
6
  export * from './Box';
10
- export * from './Stack';
11
7
  export * from './Spacer';
12
8
  export * from './Padder';
13
9
  export * from './Guide';
@@ -0,0 +1,29 @@
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
+ };
@@ -0,0 +1,10 @@
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,7 +1,5 @@
1
1
  /**
2
- * @file Hook Exports (hooks/index.ts)
3
- * @description React hooks for baseline-kit functionality
4
- * @module baseline-kit/hooks
2
+ * @baseline-kit/react hooks
5
3
  */
6
4
  export * from './useMeasure';
7
5
  export * from './useVirtual';
@@ -9,3 +7,4 @@ export * from './useBaseline';
9
7
  export * from './useGuide';
10
8
  export * from './useConfig';
11
9
  export * from './useDebug';
10
+ export * from './useIsClient';
@@ -0,0 +1,26 @@
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;
@@ -0,0 +1,9 @@
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>;
@@ -0,0 +1,6 @@
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;
@@ -0,0 +1,7 @@
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,6 +1,4 @@
1
1
  /**
2
2
  * Hook to determine if the code is running on the client side.
3
- *
4
- * @returns Boolean indicating if the code is running in a browser environment
5
3
  */
6
4
  export declare function useIsClient(): boolean;
@@ -0,0 +1,10 @@
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;
@@ -0,0 +1,14 @@
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 {};
@@ -0,0 +1,21 @@
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';
@@ -0,0 +1,9 @@
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';
@@ -0,0 +1,10 @@
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>;
@@ -0,0 +1 @@
1
+ export {};
package/dist/reset.css ADDED
@@ -0,0 +1,43 @@
1
+ *,
2
+ *::before,
3
+ *::after {
4
+ box-sizing: border-box;
5
+ margin: 0;
6
+ padding: 0;
7
+ }
8
+
9
+ /* Remove list styles on ul, ol elements */
10
+ ul[role='list'],
11
+ ol[role='list'] {
12
+ list-style: none;
13
+ }
14
+
15
+ /* Set core body defaults */
16
+ body {
17
+ min-height: 100vh;
18
+ text-rendering: optimizeSpeed;
19
+ line-height: 1.5;
20
+ }
21
+
22
+ /* Make images easier to work with */
23
+ img,
24
+ picture {
25
+ max-width: 100%;
26
+ display: block;
27
+ }
28
+
29
+ /* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
30
+ @media (prefers-reduced-motion: reduce) {
31
+ html:focus-within {
32
+ scroll-behavior: auto;
33
+ }
34
+
35
+ *,
36
+ *::before,
37
+ *::after {
38
+ animation-duration: 0.01ms !important;
39
+ animation-iteration-count: 1 !important;
40
+ transition-duration: 0.01ms !important;
41
+ scroll-behavior: auto !important;
42
+ }
43
+ }
@@ -0,0 +1,2 @@
1
+ var e={base:8,baseline:{variant:`line`,debugging:`hidden`,colors:{line:`var(--bk-baseline-color-line-theme)`,flat:`var(--bk-baseline-color-flat-theme)`}},guide:{variant:`line`,debugging:`hidden`,colors:{line:`var(--bk-guide-color-line-theme)`,pattern:`var(--bk-guide-color-pattern-theme)`,auto:`var(--bk-guide-color-auto-theme)`,fixed:`var(--bk-guide-color-fixed-theme)`}},spacer:{variant:`line`,debugging:`hidden`,colors:{line:`var(--bk-spacer-color-line-theme)`,flat:`var(--bk-spacer-color-flat-theme)`,text:`var(--bk-spacer-color-text-theme)`}},box:{debugging:`hidden`,colors:{line:`var(--bk-box-color-line-theme)`,flat:`var(--bk-box-color-flat-theme)`,text:`var(--bk-box-color-text-theme)`}},padder:{debugging:`hidden`,color:`var(--bk-padder-color-theme)`}},t=[`baseline`,`guide`,`spacer`,`box`,`padder`],n=e=>{let{parentConfig:n,base:r}=e,i={};for(let r of t)i[r]={...n[r],...e[r]};return{base:r??n.base,...i}},r=e=>{let{base:t,baseline:n,guide:r,spacer:i,box:a,padder:o}=e;return{"--bk-base":`${t}px`,"--bkbl-cl":n.colors.line,"--bkbl-cf":n.colors.flat,"--bkgd-cl":r.colors.line,"--bkgd-cp":r.colors.pattern,"--bkgd-ca":r.colors.auto,"--bkgd-cf":r.colors.fixed,"--bksp-cl":i.colors.line,"--bksp-cf":i.colors.flat,"--bksp-ct":i.colors.text,"--bkbx-cl":a.colors.line,"--bkbx-cf":a.colors.flat,"--bkbx-ct":a.colors.text,"--bkpd-c":o.color}},i=[`start`,`center`,`end`],a=[`line`,`flat`];function o(e){let t=e.trim().match(/^([+-]?[\d.]+)([a-zA-Z%]+)$/);return t?{value:parseFloat(t[1]),unit:t[2]}:null}function s(e,t){return e===void 0&&t!==void 0?`${t}px`:e===`auto`||typeof e==`string`&&/^(auto|100%|0|.*(fr|vh|vw|vmin|vmax|rem))$/.test(e)?String(e):typeof e==`number`?`${e}px`:e??``}var c={parentSize:0,viewportWidth:1920,viewportHeight:1080,rootFontSize:16,parentFontSize:16},l={px:1,in:96,cm:37.8,mm:3.78,pt:1.33,pc:16},u=[`em`,`rem`,`vh`,`vw`,`vmin`,`vmax`,`%`],d={em:e=>e.parentFontSize,rem:e=>e.rootFontSize,vh:e=>e.viewportHeight/100,vw:e=>e.viewportWidth/100,vmin:e=>Math.min(e.viewportWidth,e.viewportHeight)/100,vmax:e=>Math.max(e.viewportWidth,e.viewportHeight)/100,"%":e=>e.parentSize/100};function f(e,t){if(typeof e==`number`)return e;if(typeof e!=`string`)return null;let n=o(e);if(!n)return null;let{value:r,unit:i}=n;if(i in l)return r*l[i];if(i===`auto`)return null;let a=d[i];return a?r*a({...c,...t}):null}function p(e,t,n){return Math.min(Math.max(e,t),n)}function m(e){let{height:t,top:n,bottom:r,base:i}=e,a=(t??0)-(n+r);return Math.max(1,Math.floor(a/i))}function h(e,t={}){let{base:n=8,round:r=!0,clamp:i,context:a}=t;if(e===`auto`)return n;let o=null;if(typeof e==`number`?o=e:typeof e==`string`&&(o=f(e,a)??n),o===null&&(o=n),n<=0)return o;let s=r?Math.round(o/n)*n:o;return i===void 0?s:p(s,i.min??-1/0,i.max??1/0)}function g(e,t,n){return!e||e[0]===void 0&&e[1]===void 0?t:[e[0]===void 0?t[0]:h(e[0],n),e[1]===void 0?t[1]:h(e[1],n)]}function _(e){if(`padding`in e&&e.padding!=null)return v(e.padding);let t=`block`in e&&e.block!=null?y(e.block):{top:0,bottom:0},n=`inline`in e&&e.inline!=null?b(e.inline):{left:0,right:0};return{top:t.top,right:n.right,bottom:t.bottom,left:n.left}}function v(e){if(typeof e==`number`)return{top:e,right:e,bottom:e,left:e};if(Array.isArray(e)){let[t=0,n=0,r,i]=e;return{top:t,right:n,bottom:r??t,left:i??n}}return typeof e==`object`?{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}:{top:0,right:0,bottom:0,left:0}}function y(e){if(typeof e==`number`)return{top:e,bottom:e};if(Array.isArray(e)){let[t,n]=e;return{top:t??0,bottom:n??0}}return typeof e==`object`?{top:e.start??0,bottom:e.end??0}:{top:0,bottom:0}}function b(e){if(typeof e==`number`)return{left:e,right:e};if(Array.isArray(e)){let[t,n]=e;return{left:t??0,right:n??0}}return typeof e==`object`?{left:e.start??0,right:e.end??0}:{left:0,right:0}}function x(e,t,n,r){let i=_({padding:n});if(r===`none`)return i;if(r===`height`){let n=e%t;n!==0&&(i.bottom+=t-n)}if(r===`clamp`){i.top%=t;let n=e%t;n!==0&&(i.bottom+=t-n),i.bottom%=t}return i}var S=(...e)=>e.filter(Boolean).join(` `).trim();function C(e,t){let n=e??t;return{isShown:n===`visible`,isHidden:n===`hidden`,isNone:n===`none`,debugging:n}}function w(e,t,n){let r=typeof e==`string`?e:e.key,i=typeof e==`string`?t:e.value,a=typeof e==`string`?n:e.defaultStyles,o=typeof e==`object`?e.skipDimensions:void 0;return o&&(o.fitContent?.includes(r)&&i===`fit-content`||o.auto?.includes(r)&&i===`auto`||o.fullSize?.includes(r)&&(i===`100%`||i===`100vh`||i===`100vw`))||i===a[r]?{}:{[r]:i}}var T=/^\d*\.?\d+(?:fr|px|%|em|rem|vh|vw|vmin|vmax|pt|pc|in|cm|mm)$/,E=e=>typeof e==`number`?Number.isFinite(e)&&e>=0:typeof e==`string`?e===`auto`||e===`100%`||T.test(e):!1,D=e=>Array.isArray(e)&&e.length>0&&e.every(E),O={template:`none`,columnsCount:0,calculatedGap:0,isValid:!1};function k(e,t,n){let r=t.variant??`line`,i=t.base??8,a=h(t.gap??0,{base:i,context:n});if(!e)return O;switch(r){case`line`:{let t=a===0?0:a-1,n=t+1,r=t===0?Math.max(1,Math.floor(e)+1):Math.max(1,Math.floor((e+1)/n)+1);return{template:`repeat(${r}, 1px)`,columnsCount:r,calculatedGap:a>0?a-1:a,isValid:!0}}case`pattern`:{if(!t.columns||!Array.isArray(t.columns)||!D(t.columns))return O;let e=t.columns.map(e=>typeof e==`number`?`${e}px`:e);return e.some(e=>e===`0`||e===`0px`)?O:{template:e.join(` `),columnsCount:e.length,calculatedGap:a,isValid:!0}}case`fixed`:{let e=typeof t.columns==`number`?t.columns:0;return e<1?O:{template:`repeat(${e}, ${t.columnWidth?s(t.columnWidth):`1fr`})`,columnsCount:e,calculatedGap:a,isValid:!0}}case`auto`:{let r=t.columnWidth??`auto`;if(r===`auto`)return{template:`repeat(auto-fill, minmax(0, 1fr))`,columnsCount:1,calculatedGap:a,isValid:!0};let i=typeof r==`number`?`${r}px`:r.toString(),o=f(i,n)??0,s=o>0?Math.max(1,Math.floor((e+a)/(o+a))):1;return{template:`repeat(auto-fill, ${i})`,columnsCount:s,calculatedGap:a,isValid:!0}}default:{let t=Math.max(1,Math.floor(e/(a+1))+1);return{template:`repeat(${t}, 1px)`,columnsCount:t,calculatedGap:a,isValid:!0}}}}var A=(e,t,n)=>{let r={};return e===void 0?(t!==void 0&&(r.gridColumn=`span ${t}`),n!==void 0&&(r.gridRow=`span ${n}`)):(r.gridColumn=`span ${e}`,r.gridRow=`span ${e}`),r};function j({variant:e,base:t,gap:n,columns:r,columnWidth:i}){switch(e){case`line`:return{variant:`line`,gap:n,base:t};case`pattern`:if(r&&Array.isArray(r))return{variant:`pattern`,columns:r,gap:n,base:t};break;case`fixed`:if(r!==void 0){let e=typeof r==`number`?r:parseInt(String(r),10);return{variant:`fixed`,columns:isNaN(e)?12:e,columnWidth:i||`60px`,gap:n,base:t}}break}return{variant:`auto`,columnWidth:i||`1fr`,gap:n,base:t}}var M=(e,t)=>({"--bkgd-w":`100%`,"--bkgd-h":`100%`,"--bkgd-mw":`none`,"--bkgd-cw":`60px`,"--bkgd-gw":`24px`,"--bkgd-n":`12`,"--bkgd-b":`${e}px`,"--bkgd-cl":t,"--bkgd-g":`0`});function N(e){let{base:t,colors:n,variant:r,align:i,width:a,height:o,columnWidth:c,maxWidth:l,color:u,template:d,columnsCount:f,calculatedGap:p,isVisible:m}=e,h=M(t,n.line),g=[`--bkgd-w`,`--bkgd-h`],_=s(a??`100%`),v=s(o??`100%`),y={...w({key:`--bkgd-w`,value:_,defaultStyles:h,skipDimensions:{fullSize:g}}),...w({key:`--bkgd-h`,value:v,defaultStyles:h,skipDimensions:{fullSize:g}}),...w({key:`--bkgd-mw`,value:s(l||`none`),defaultStyles:h}),...w({key:`--bkgd-cw`,value:s(c||`60px`),defaultStyles:h}),...w({key:`--bkgd-n`,value:`${f}`,defaultStyles:h}),...w({key:`--bkgd-b`,value:`0`,defaultStyles:h}),...w({key:`--bkgd-cl`,value:u??n.line,defaultStyles:h}),...w({key:`--bkgd-g`,value:`${p}px`,defaultStyles:h}),...w({key:`--bkgd-j`,value:i||`center`,defaultStyles:h}),...d&&d!==`none`?{"--bkgd-t":d}:{}},b=(r&&r in n?n[r]:void 0)??n.line,x=r===`line`,S=[`gde`,m?`v`:`h`];return x&&S.push(`line`),x&&(y[`--bkgd-line-color`]=u??n.line,y[`--bkgd-line-period`]=`${p+1}px`),{containerStyle:y,columnColor:b,columnsCount:f,calculatedGap:p,template:d,isVisible:m,isLineVariant:x,classTokens:S}}var P=(e,t,n)=>({"--bkbl-w":`100%`,"--bkbl-h":`100%`,"--bkbl-b":`${e}px`,"--bkbl-cl":t,"--bkbl-cf":n});function F(e){let{base:t,colors:n,variant:r,width:i,height:a,color:o,containerWidth:c,containerHeight:l,spacing:u,isVisible:d}=e,[,f]=g([i,a],[c,l]),{top:p,right:h,bottom:v,left:y}=_(u),b=[p,h,v,y].map(e=>e?`${e}px`:`0`).join(` `),x=b===`0 0 0 0`?void 0:b,S=m({height:f,top:p,bottom:v,base:t}),C=o||(r===`line`?n.line:n.flat),T=P(t,n.line,n.flat),E=[`--bkbl-w`,`--bkbl-h`];return{containerStyle:{...w({key:`--bkbl-w`,value:s(i||`100%`),defaultStyles:T,skipDimensions:{fullSize:E}}),...w({key:`--bkbl-h`,value:s(a||`100%`),defaultStyles:T,skipDimensions:{fullSize:E}}),...w({key:`--bkbl-cl`,value:o||n.line,defaultStyles:T}),...w({key:`--bkbl-cf`,value:o||n.flat,defaultStyles:T}),...x?{padding:x}:{}},rowCount:S,getRowStyle:e=>({"--bkbl-rt":e===0?`0px`:`${e*t}px`,"--bkbl-rh":r===`line`?`1px`:`${t}px`,"--bkbl-c":C}),padding:x,isVisible:d,classTokens:[`bas`,d?`v`:`h`]}}var I=(e,t)=>({"--bkbx-w":`auto`,"--bkbx-h":`auto`,"--bkbx-cl":t,"--bkbx-b":`${e}px`});function L(e){let{base:t,lineColor:n,width:r,height:i,span:a,colSpan:o,rowSpan:c,isVisible:l}=e,u=I(t,n),d=[`--bkbx-w`,`--bkbx-h`],f={...w({key:`--bkbx-w`,value:s(r||`fit-content`),defaultStyles:u,skipDimensions:{fitContent:d}}),...w({key:`--bkbx-h`,value:s(i||`fit-content`),defaultStyles:u,skipDimensions:{fitContent:d}})},p=A(a,o,c),m=[`box`];return l&&m.push(`v`),{boxStyle:f,gridSpanStyle:p,classTokens:m}}var R=(e,t,n,r)=>({"--bksp-w":`100%`,"--bksp-h":`100%`,"--bksp-b":`${e}px`,"--bksp-ct":t,"--bksp-cf":n,"--bksp-cl":r});function z(e){let{base:t,colors:n,width:r,height:i,color:a,variant:o,isVisible:c}=e,[l,u]=g([r,i],[0,0],{base:t,suppressWarnings:!0}),d=R(t,n.text,n.flat,n.line),f=[`--bksp-w`,`--bksp-h`],p={...w({key:`--bksp-h`,value:s(u||`100%`),defaultStyles:d,skipDimensions:{fullSize:f}}),...w({key:`--bksp-w`,value:s(l||`100%`),defaultStyles:d,skipDimensions:{fullSize:f}}),"--bksp-b":`${t}px`,...w({key:`--bksp-ct`,value:a??n.text,defaultStyles:d}),...w({key:`--bksp-cl`,value:a??n.line,defaultStyles:d}),...w({key:`--bksp-cf`,value:a??n.flat,defaultStyles:d})},m=[`spr`];return c&&m.push(o),{style:p,normWidth:l,normHeight:u,classTokens:m}}function B(e){let{base:t,color:n,width:r,height:i,padding:a,enableSpacers:o,isVisible:c}=e,l={};if(r!==void 0&&r!==`fit-content`&&(l[`--bkpd-w`]=s(r)),i!==void 0&&i!==`fit-content`&&(l[`--bkpd-h`]=s(i)),l[`--bkpd-b`]=`${t}px`,l[`--bkpd-c`]=n,!o){let{top:e,right:t,bottom:n,left:r}=a;(e>0||n>0)&&(l.paddingBlock=`${e}px ${n}px`),(r>0||t>0)&&(l.paddingInline=`${r}px ${t}px`)}let u=[`pad`];return c&&o&&u.push(`v`),{containerStyle:l,classTokens:u}}Object.defineProperty(exports,`C`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`D`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`E`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`O`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`S`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`T`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,`k`,{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`w`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`x`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return p}});
2
+ //# sourceMappingURL=src-CMjyHjX5.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"src-CMjyHjX5.cjs","names":[],"sources":["../packages/core/src/config/defaults.ts","../packages/core/src/config/merge.ts","../packages/core/src/types.ts","../packages/core/src/utils/parse.ts","../packages/core/src/utils/convert.ts","../packages/core/src/utils/math.ts","../packages/core/src/utils/normalize.ts","../packages/core/src/utils/padding.ts","../packages/core/src/utils/snapping.ts","../packages/core/src/utils/merge.ts","../packages/core/src/validation/guide.ts","../packages/core/src/utils/grid.ts","../packages/core/src/descriptors/guide.ts","../packages/core/src/descriptors/baseline.ts","../packages/core/src/descriptors/box.ts","../packages/core/src/descriptors/spacer.ts","../packages/core/src/descriptors/padder.ts"],"sourcesContent":["import type { ConfigSchema } from './schema'\n\nexport const DEFAULT_CONFIG: ConfigSchema = {\n base: 8,\n baseline: {\n variant: 'line',\n debugging: 'hidden',\n colors: {\n line: 'var(--bk-baseline-color-line-theme)',\n flat: 'var(--bk-baseline-color-flat-theme)',\n },\n },\n guide: {\n variant: 'line',\n debugging: 'hidden',\n colors: {\n line: 'var(--bk-guide-color-line-theme)',\n pattern: 'var(--bk-guide-color-pattern-theme)',\n auto: 'var(--bk-guide-color-auto-theme)',\n fixed: 'var(--bk-guide-color-fixed-theme)',\n },\n },\n spacer: {\n variant: 'line',\n debugging: 'hidden',\n colors: {\n line: 'var(--bk-spacer-color-line-theme)',\n flat: 'var(--bk-spacer-color-flat-theme)',\n text: 'var(--bk-spacer-color-text-theme)',\n },\n },\n box: {\n debugging: 'hidden',\n colors: {\n line: 'var(--bk-box-color-line-theme)',\n flat: 'var(--bk-box-color-flat-theme)',\n text: 'var(--bk-box-color-text-theme)',\n },\n },\n padder: {\n debugging: 'hidden',\n color: 'var(--bk-padder-color-theme)',\n },\n} as const\n","import type { ConfigSchema } from './schema'\n\ntype MergeConfigParams = {\n parentConfig: ConfigSchema\n base?: number\n baseline?: Partial<ConfigSchema['baseline']>\n guide?: Partial<ConfigSchema['guide']>\n spacer?: Partial<ConfigSchema['spacer']>\n box?: Partial<ConfigSchema['box']>\n padder?: Partial<ConfigSchema['padder']>\n}\n\nconst COMPONENT_KEYS = ['baseline', 'guide', 'spacer', 'box', 'padder'] as const\n\nexport const mergeConfig = (params: MergeConfigParams): ConfigSchema => {\n const { parentConfig, base } = params\n const merged = {} as Record<string, unknown>\n\n for (const key of COMPONENT_KEYS) {\n merged[key] = { ...parentConfig[key], ...params[key] }\n }\n\n return { base: base ?? parentConfig.base, ...merged } as ConfigSchema\n}\n\ntype CSSVariablesParams = {\n base: number\n baseline: ConfigSchema['baseline']\n guide: ConfigSchema['guide']\n spacer: ConfigSchema['spacer']\n box: ConfigSchema['box']\n padder: ConfigSchema['padder']\n}\n\nexport const createCSSVariables = (\n params: CSSVariablesParams\n): Record<string, string> => {\n const { base, baseline, guide, spacer, box, padder } = params\n return {\n '--bk-base': `${base}px`,\n '--bkbl-cl': baseline.colors.line,\n '--bkbl-cf': baseline.colors.flat,\n '--bkgd-cl': guide.colors.line,\n '--bkgd-cp': guide.colors.pattern,\n '--bkgd-ca': guide.colors.auto,\n '--bkgd-cf': guide.colors.fixed,\n '--bksp-cl': spacer.colors.line,\n '--bksp-cf': spacer.colors.flat,\n '--bksp-ct': spacer.colors.text,\n '--bkbx-cl': box.colors.line,\n '--bkbx-cf': box.colors.flat,\n '--bkbx-ct': box.colors.text,\n '--bkpd-c': padder.color,\n }\n}\n","/**\n * @baseline-kit/core - Pure type definitions\n * Framework-agnostic types for the baseline-kit system\n */\n\n// Spacing Types\nexport type Spacing =\n | number\n | [number, number]\n | { start?: number; end?: number }\n\nexport type PaddingValue =\n | number\n | [number, number]\n | [number, number, number]\n | [number, number, number, number]\n | { top?: number; bottom?: number; left?: number; right?: number }\n\nexport type Padding = {\n top: number\n right: number\n bottom: number\n left: number\n}\n\nexport type SpacingProps = {\n padding?: PaddingValue\n block?: Spacing\n inline?: Spacing\n}\n\n// Grid Types\nexport type GuideVariant = 'line' | 'pattern' | 'fixed' | 'auto'\nexport type GuideColumnValue = string | number | undefined | 'auto'\nexport type GuideColumnsPattern = readonly GuideColumnValue[]\n\nexport const GRID_ALIGNMENTS = ['start', 'center', 'end'] as const\nexport type GridAlignment = (typeof GRID_ALIGNMENTS)[number]\n\nexport const PADD_VARIANTS = ['line', 'flat'] as const\nexport type PaddedVariant = (typeof PADD_VARIANTS)[number]\n\n// Component Types\nexport type Variant = 'line' | 'flat' | 'pattern'\nexport type BaselineVariant = Exclude<Variant, 'pattern'>\nexport type SnappingMode = 'none' | 'height' | 'clamp'\nexport type DebuggingMode = 'none' | 'hidden' | 'visible'\n\n// Guide Config Types (framework-agnostic)\ntype BaseGuideConfig = {\n gap?: number | string\n base?: number\n}\n\nexport type PatternConfig = BaseGuideConfig & {\n variant: 'pattern'\n columns: GuideColumnsPattern\n columnWidth?: never\n}\n\nexport type FixedConfig = BaseGuideConfig & {\n variant: 'fixed'\n columns: number\n columnWidth?: number | string\n}\n\nexport type AutoConfig = BaseGuideConfig & {\n variant: 'auto'\n columnWidth: number | string\n columns?: never\n}\n\nexport type LineConfig = BaseGuideConfig & {\n variant?: 'line'\n columns?: never\n columnWidth?: never\n}\n\nexport type GuideConfig = PatternConfig | AutoConfig | FixedConfig | LineConfig\n","export function parseUnit(\n value: string\n): { value: number; unit: string } | null {\n const match = value.trim().match(/^([+-]?[\\d.]+)([a-zA-Z%]+)$/)\n if (!match) return null\n const num = parseFloat(match[1])\n const unit = match[2]\n return { value: num, unit }\n}\n\nexport function formatValue(\n value: string | number | undefined,\n defaultValue?: number\n): string {\n if (value === undefined && defaultValue !== undefined)\n return `${defaultValue}px`\n if (\n value === 'auto' ||\n (typeof value === 'string' &&\n /^(auto|100%|0|.*(fr|vh|vw|vmin|vmax|rem))$/.test(value))\n ) {\n return String(value)\n }\n if (typeof value === 'number') return `${value}px`\n return value ?? ''\n}\n","import { parseUnit } from './parse'\n\nexport interface ConversionContext {\n parentSize?: number\n viewportWidth?: number\n viewportHeight?: number\n rootFontSize?: number\n parentFontSize?: number\n}\n\nconst DEFAULT_CONTEXT: Required<ConversionContext> = {\n parentSize: 0,\n viewportWidth: 1920,\n viewportHeight: 1080,\n rootFontSize: 16,\n parentFontSize: 16,\n}\n\nexport const ABSOLUTE_UNIT_CONVERSIONS: Record<string, number> = {\n px: 1,\n in: 96,\n cm: 37.8,\n mm: 3.78,\n pt: 1.33,\n pc: 16,\n}\n\nexport const RELATIVE_UNITS: string[] = [\n 'em',\n 'rem',\n 'vh',\n 'vw',\n 'vmin',\n 'vmax',\n '%',\n]\n\nconst RELATIVE_UNIT_RESOLVERS: Record<\n string,\n (ctx: Required<ConversionContext>) => number\n> = {\n em: (ctx) => ctx.parentFontSize,\n rem: (ctx) => ctx.rootFontSize,\n vh: (ctx) => ctx.viewportHeight / 100,\n vw: (ctx) => ctx.viewportWidth / 100,\n vmin: (ctx) => Math.min(ctx.viewportWidth, ctx.viewportHeight) / 100,\n vmax: (ctx) => Math.max(ctx.viewportWidth, ctx.viewportHeight) / 100,\n '%': (ctx) => ctx.parentSize / 100,\n}\n\nexport function convertValue(\n value: number | string | undefined,\n context?: ConversionContext\n): number | null {\n if (typeof value === 'number') return value\n if (typeof value !== 'string') return null\n\n const parsed = parseUnit(value)\n if (!parsed) return null\n\n const { value: num, unit } = parsed\n\n if (unit in ABSOLUTE_UNIT_CONVERSIONS) {\n return num * ABSOLUTE_UNIT_CONVERSIONS[unit]\n }\n\n if (unit === 'auto') return null\n\n const resolver = RELATIVE_UNIT_RESOLVERS[unit]\n if (resolver) {\n const ctx = { ...DEFAULT_CONTEXT, ...context }\n return num * resolver(ctx)\n }\n\n return null\n}\n","export function clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max)\n}\n\ntype RowCountParams = {\n height?: number\n top: number\n bottom: number\n base: number\n}\n\nexport function calculateRowCount(params: RowCountParams): number {\n const { height, top, bottom, base } = params\n const totalHeight = (height ?? 0) - (top + bottom)\n return Math.max(1, Math.floor(totalHeight / base))\n}\n","import { convertValue, type ConversionContext } from './convert'\nimport { clamp } from './math'\n\nexport interface NormalizationOptions {\n base?: number\n round?: boolean\n clamp?: { min?: number; max?: number }\n suppressWarnings?: boolean\n context?: ConversionContext\n}\n\nexport function normalizeValue(\n value: string | number | undefined,\n options: NormalizationOptions = {}\n): number {\n const {\n base = 8,\n round: doRound = true,\n clamp: clampOptions,\n context,\n } = options\n\n if (value === 'auto') return base\n\n let num: number | null = null\n if (typeof value === 'number') {\n num = value\n } else if (typeof value === 'string') {\n num = convertValue(value, context) ?? base\n }\n if (num === null) num = base\n\n if (base <= 0) return num\n\n const normalized = doRound ? Math.round(num / base) * base : num\n\n return clampOptions !== undefined\n ? clamp(\n normalized,\n clampOptions.min ?? -Infinity,\n clampOptions.max ?? Infinity\n )\n : normalized\n}\n\nexport function normalizeValuePair(\n values:\n | [string | number | undefined, string | number | undefined]\n | undefined,\n defaults: [number, number],\n options?: NormalizationOptions\n): [number, number] {\n if (!values) return defaults\n\n if (values[0] === undefined && values[1] === undefined) {\n return defaults\n }\n\n const first =\n values[0] !== undefined ? normalizeValue(values[0], options) : defaults[0]\n const second =\n values[1] !== undefined ? normalizeValue(values[1], options) : defaults[1]\n return [first, second]\n}\n","import type { Padding, PaddingValue, Spacing, SpacingProps } from '../types'\n\nexport function parsePadding(spacing: SpacingProps): Padding {\n if ('padding' in spacing && spacing.padding != null) {\n return parsePaddingValue(spacing.padding)\n }\n\n const blockEdges =\n 'block' in spacing && spacing.block != null\n ? parseBlock(spacing.block)\n : { top: 0, bottom: 0 }\n const inlineEdges =\n 'inline' in spacing && spacing.inline != null\n ? parseInline(spacing.inline)\n : { left: 0, right: 0 }\n\n return {\n top: blockEdges.top,\n right: inlineEdges.right,\n bottom: blockEdges.bottom,\n left: inlineEdges.left,\n }\n}\n\nfunction parsePaddingValue(padding: PaddingValue): Padding {\n if (typeof padding === 'number') {\n return { top: padding, right: padding, bottom: padding, left: padding }\n }\n\n if (Array.isArray(padding)) {\n const [a = 0, b = 0, c, d] = padding\n return { top: a, right: b, bottom: c ?? a, left: d ?? b }\n }\n\n if (typeof padding === 'object') {\n return {\n top: padding.top ?? 0,\n right: padding.right ?? 0,\n bottom: padding.bottom ?? 0,\n left: padding.left ?? 0,\n }\n }\n\n return { top: 0, right: 0, bottom: 0, left: 0 }\n}\n\nfunction parseBlock(block: Spacing): Pick<Padding, 'top' | 'bottom'> {\n if (typeof block === 'number') {\n return { top: block, bottom: block }\n }\n if (Array.isArray(block)) {\n const [top, bottom] = block\n return { top: top ?? 0, bottom: bottom ?? 0 }\n }\n if (typeof block === 'object') {\n return { top: block.start ?? 0, bottom: block.end ?? 0 }\n }\n return { top: 0, bottom: 0 }\n}\n\nfunction parseInline(inline: Spacing): Pick<Padding, 'left' | 'right'> {\n if (typeof inline === 'number') {\n return { left: inline, right: inline }\n }\n if (Array.isArray(inline)) {\n const [left, right] = inline\n return { left: left ?? 0, right: right ?? 0 }\n }\n if (typeof inline === 'object') {\n return { left: inline.start ?? 0, right: inline.end ?? 0 }\n }\n return { left: 0, right: 0 }\n}\n","import type { SnappingMode, Padding, PaddingValue } from '../types'\nimport { parsePadding } from './padding'\n\nexport function calculateSnappedSpacing(\n height: number,\n base: number,\n initial: PaddingValue,\n snapping: SnappingMode\n): Padding {\n const pad: Padding = parsePadding({ padding: initial })\n\n if (snapping === 'none') {\n return pad\n }\n\n if (snapping === 'height') {\n const remainder = height % base\n if (remainder !== 0) {\n pad.bottom += base - remainder\n }\n }\n\n if (snapping === 'clamp') {\n pad.top = pad.top % base\n const remainder = height % base\n if (remainder !== 0) {\n pad.bottom += base - remainder\n }\n pad.bottom = pad.bottom % base\n }\n\n return pad\n}\n","import type { DebuggingMode } from '../types'\n\n/**\n * Combines class names, filtering out falsy values.\n * Lightweight alternative to clsx/classnames.\n */\nexport const cx = (\n ...classes: Array<string | boolean | undefined | null>\n): string => classes.filter(Boolean).join(' ').trim()\n\n/**\n * Resolves component debug/visibility state from prop and config.\n * Pure function — framework-agnostic.\n */\nexport interface DebugState {\n isShown: boolean\n isHidden: boolean\n isNone: boolean\n debugging: DebuggingMode | undefined\n}\n\nexport function resolveDebugState(\n debuggingProp?: DebuggingMode,\n debuggingConfig?: DebuggingMode\n): DebugState {\n const effective = debuggingProp ?? debuggingConfig\n return {\n isShown: effective === 'visible',\n isHidden: effective === 'hidden',\n isNone: effective === 'none',\n debugging: effective,\n }\n}\n\nexport type StyleOverrideParams = {\n key: string\n value: string\n defaultStyles: Record<string, string>\n skipDimensions?: {\n fitContent?: string[]\n auto?: string[]\n fullSize?: string[]\n }\n}\n\nexport function createStyleOverride(\n params: StyleOverrideParams | string,\n value?: string,\n defaultStyles?: Record<string, string>\n): Record<string, string> {\n const key = typeof params === 'string' ? params : params.key\n const val = typeof params === 'string' ? value! : params.value\n const defaults =\n typeof params === 'string' ? defaultStyles! : params.defaultStyles\n const skipDimensions =\n typeof params === 'object' ? params.skipDimensions : undefined\n\n if (skipDimensions) {\n if (skipDimensions.fitContent?.includes(key) && val === 'fit-content') {\n return {}\n }\n if (skipDimensions.auto?.includes(key) && val === 'auto') {\n return {}\n }\n if (\n skipDimensions.fullSize?.includes(key) &&\n (val === '100%' || val === '100vh' || val === '100vw')\n ) {\n return {}\n }\n }\n\n return val !== defaults[key] ? { [key]: val } : {}\n}\n","import type { GuideColumnsPattern, GuideColumnValue } from '../types'\n\nconst UNIT_PATTERN =\n /^\\d*\\.?\\d+(?:fr|px|%|em|rem|vh|vw|vmin|vmax|pt|pc|in|cm|mm)$/\n\nexport const isValidGuideColumnValue = (\n value: unknown\n): value is GuideColumnValue => {\n if (typeof value === 'number') return Number.isFinite(value) && value >= 0\n if (typeof value !== 'string') return false\n return value === 'auto' || value === '100%' || UNIT_PATTERN.test(value)\n}\n\nexport const isValidGuidePattern = (\n pattern: unknown\n): pattern is GuideColumnsPattern =>\n Array.isArray(pattern) &&\n pattern.length > 0 &&\n pattern.every(isValidGuideColumnValue)\n","import type { GuideConfig, GuideColumnsPattern } from '../types'\nimport { isValidGuidePattern } from '../validation/guide'\nimport { normalizeValue } from './normalize'\nimport { formatValue } from './parse'\nimport { convertValue, type ConversionContext } from './convert'\n\nexport interface GuideResult {\n template: string\n columnsCount: number\n calculatedGap: number\n isValid: boolean\n}\n\nconst INVALID_RESULT: GuideResult = {\n template: 'none',\n columnsCount: 0,\n calculatedGap: 0,\n isValid: false,\n}\n\n/**\n * Pure calculation of grid template from container width and guide config.\n * Framework-agnostic — can be used outside React.\n *\n * Sizing note: the `line` variant still reports the number of pixel tracks as\n * metadata, but React renders line guides with a CSS gradient so dense grids do\n * not allocate one DOM node per line.\n */\nexport function calculateGuideTemplate(\n width: number,\n config: GuideConfig,\n context?: ConversionContext\n): GuideResult {\n const variant = config.variant ?? 'line'\n const base = config.base ?? 8\n const gap = normalizeValue(config.gap ?? 0, { base, context })\n\n if (!width) return INVALID_RESULT\n\n switch (variant) {\n case 'line': {\n const finalGap = gap === 0 ? 0 : gap - 1\n const actualGapWithLine = finalGap + 1\n\n const columns =\n finalGap === 0\n ? Math.max(1, Math.floor(width) + 1)\n : Math.max(1, Math.floor((width + 1) / actualGapWithLine) + 1)\n\n return {\n template: `repeat(${columns}, 1px)`,\n columnsCount: columns,\n calculatedGap: gap > 0 ? gap - 1 : gap,\n isValid: true,\n }\n }\n\n case 'pattern': {\n if (!config.columns || !Array.isArray(config.columns)) {\n return INVALID_RESULT\n }\n\n if (!isValidGuidePattern(config.columns)) {\n return INVALID_RESULT\n }\n\n const columnsArr = (config.columns as GuideColumnsPattern).map((col) =>\n typeof col === 'number' ? `${col}px` : col\n )\n\n if (columnsArr.some((c) => c === '0' || c === '0px')) {\n return INVALID_RESULT\n }\n\n return {\n template: columnsArr.join(' '),\n columnsCount: columnsArr.length,\n calculatedGap: gap,\n isValid: true,\n }\n }\n\n case 'fixed': {\n const colCount = typeof config.columns === 'number' ? config.columns : 0\n if (colCount < 1) return INVALID_RESULT\n\n const colWidth = config.columnWidth\n ? formatValue(config.columnWidth)\n : '1fr'\n\n return {\n template: `repeat(${colCount}, ${colWidth})`,\n columnsCount: colCount,\n calculatedGap: gap,\n isValid: true,\n }\n }\n\n case 'auto': {\n const colWidth = config.columnWidth ?? 'auto'\n if (colWidth === 'auto') {\n return {\n template: 'repeat(auto-fill, minmax(0, 1fr))',\n columnsCount: 1,\n calculatedGap: gap,\n isValid: true,\n }\n }\n\n const colWidthStr =\n typeof colWidth === 'number' ? `${colWidth}px` : colWidth.toString()\n const pxVal = convertValue(colWidthStr, context) ?? 0\n const columns =\n pxVal > 0 ? Math.max(1, Math.floor((width + gap) / (pxVal + gap))) : 1\n\n return {\n template: `repeat(auto-fill, ${colWidthStr})`,\n columnsCount: columns,\n calculatedGap: gap,\n isValid: true,\n }\n }\n\n default: {\n const columns = Math.max(1, Math.floor(width / (gap + 1)) + 1)\n return {\n template: `repeat(${columns}, 1px)`,\n columnsCount: columns,\n calculatedGap: gap,\n isValid: true,\n }\n }\n }\n}\n\nexport const createGridSpanStyles = (\n span?: number,\n colSpan?: number,\n rowSpan?: number\n): Record<string, string> => {\n const gridStyles: Record<string, string> = {}\n\n if (span !== undefined) {\n gridStyles.gridColumn = `span ${span}`\n gridStyles.gridRow = `span ${span}`\n } else {\n if (colSpan !== undefined) {\n gridStyles.gridColumn = `span ${colSpan}`\n }\n if (rowSpan !== undefined) {\n gridStyles.gridRow = `span ${rowSpan}`\n }\n }\n\n return gridStyles\n}\n","import type { GuideVariant, GuideConfig } from '../types'\nimport { formatValue, createStyleOverride } from '../utils'\n\nexport interface GuideDescriptorParams {\n base: number\n colors: Record<GuideVariant, string>\n variant: GuideVariant\n align: string\n width?: number | string\n height?: number | string\n columnWidth?: number | string\n maxWidth?: number | string\n color?: string\n /** Pre-computed guide template result (from useGuide or calculateGuideTemplate) */\n template: string\n columnsCount: number\n calculatedGap: number\n isVisible: boolean\n}\n\nexport interface GuideDescriptor {\n containerStyle: Record<string, string>\n columnColor: string\n columnsCount: number\n calculatedGap: number\n template: string\n isVisible: boolean\n isLineVariant: boolean\n classTokens: string[]\n}\n\nexport interface GuideConfigParams {\n variant: GuideVariant\n base: number\n gap: number\n columns?: number | readonly (string | number | undefined | 'auto')[]\n columnWidth?: number | string\n}\n\n/**\n * Creates a GuideConfig from component props.\n * Pure function — no React or DOM dependency.\n */\nexport function createGuideConfig({\n variant,\n base,\n gap,\n columns,\n columnWidth,\n}: GuideConfigParams): GuideConfig {\n switch (variant) {\n case 'line':\n return { variant: 'line', gap, base }\n case 'pattern':\n if (columns && Array.isArray(columns)) {\n return {\n variant: 'pattern',\n columns: columns as readonly (string | number)[],\n gap,\n base,\n }\n }\n break\n case 'fixed':\n if (columns !== undefined) {\n const parsed =\n typeof columns === 'number' ? columns : parseInt(String(columns), 10)\n return {\n variant: 'fixed',\n columns: !isNaN(parsed) ? parsed : 12,\n columnWidth: columnWidth || '60px',\n gap,\n base,\n }\n }\n break\n }\n return { variant: 'auto', columnWidth: columnWidth || '1fr', gap, base }\n}\n\nconst GUIDE_DEFAULTS = (\n base: number,\n lineColor: string\n): Record<string, string> => ({\n '--bkgd-w': '100%',\n '--bkgd-h': '100%',\n '--bkgd-mw': 'none',\n '--bkgd-cw': '60px',\n '--bkgd-gw': '24px',\n '--bkgd-n': '12',\n '--bkgd-b': `${base}px`,\n '--bkgd-cl': lineColor,\n '--bkgd-g': '0',\n})\n\n/**\n * Computes all styles and data needed to render a Guide component.\n * Pure function — framework-agnostic.\n */\nexport function createGuideDescriptor(\n params: GuideDescriptorParams\n): GuideDescriptor {\n const {\n base,\n colors,\n variant,\n align,\n width,\n height,\n columnWidth,\n maxWidth,\n color,\n template,\n columnsCount,\n calculatedGap,\n isVisible,\n } = params\n\n const defaultStyles = GUIDE_DEFAULTS(base, colors.line)\n const fullDimensions = ['--bkgd-w', '--bkgd-h']\n\n const widthValue = formatValue(width ?? '100%')\n const heightValue = formatValue(height ?? '100%')\n\n const containerStyle: Record<string, string> = {\n ...createStyleOverride({\n key: '--bkgd-w',\n value: widthValue,\n defaultStyles,\n skipDimensions: { fullSize: fullDimensions },\n }),\n ...createStyleOverride({\n key: '--bkgd-h',\n value: heightValue,\n defaultStyles,\n skipDimensions: { fullSize: fullDimensions },\n }),\n ...createStyleOverride({\n key: '--bkgd-mw',\n value: formatValue(maxWidth || 'none'),\n defaultStyles,\n }),\n ...createStyleOverride({\n key: '--bkgd-cw',\n value: formatValue(columnWidth || '60px'),\n defaultStyles,\n }),\n ...createStyleOverride({\n key: '--bkgd-n',\n value: `${columnsCount}`,\n defaultStyles,\n }),\n ...createStyleOverride({ key: '--bkgd-b', value: '0', defaultStyles }),\n ...createStyleOverride({\n key: '--bkgd-cl',\n value: color ?? colors.line,\n defaultStyles,\n }),\n ...createStyleOverride({\n key: '--bkgd-g',\n value: `${calculatedGap}px`,\n defaultStyles,\n }),\n ...createStyleOverride({\n key: '--bkgd-j',\n value: align || 'center',\n defaultStyles,\n }),\n // CSS module resolves grid-template-columns from --bkgd-t, so the inline\n // gridTemplateColumns property would be redundant.\n ...(template && template !== 'none' ? { '--bkgd-t': template } : {}),\n }\n\n const columnColor =\n (variant && variant in colors\n ? colors[variant as keyof typeof colors]\n : undefined) ?? colors.line\n\n const isLineVariant = variant === 'line'\n const classTokens = ['gde', isVisible ? 'v' : 'h']\n if (isLineVariant) classTokens.push('line')\n\n if (isLineVariant) {\n containerStyle['--bkgd-line-color'] = color ?? colors.line\n containerStyle['--bkgd-line-period'] = `${calculatedGap + 1}px`\n }\n\n return {\n containerStyle,\n columnColor,\n columnsCount,\n calculatedGap,\n template,\n isVisible,\n isLineVariant,\n classTokens,\n }\n}\n","import type { BaselineVariant } from '../types'\nimport {\n formatValue,\n createStyleOverride,\n normalizeValuePair,\n parsePadding,\n calculateRowCount,\n} from '../utils'\n\nexport interface BaselineDescriptorParams {\n base: number\n colors: Record<BaselineVariant, string>\n variant: BaselineVariant\n width?: number | string\n height?: number | string\n color?: string\n containerWidth: number\n containerHeight: number\n spacing: Record<string, unknown>\n isVisible: boolean\n}\n\nexport interface BaselineDescriptor {\n containerStyle: Record<string, string>\n rowCount: number\n getRowStyle: (index: number) => Record<string, string>\n padding: string | undefined\n isVisible: boolean\n classTokens: string[]\n}\n\nconst BASELINE_DEFAULTS = (\n base: number,\n lineColor: string,\n flatColor: string\n): Record<string, string> => ({\n '--bkbl-w': '100%',\n '--bkbl-h': '100%',\n '--bkbl-b': `${base}px`,\n '--bkbl-cl': lineColor,\n '--bkbl-cf': flatColor,\n})\n\n/**\n * Computes all styles and data needed to render a Baseline component.\n * Pure function — framework-agnostic.\n */\nexport function createBaselineDescriptor(\n params: BaselineDescriptorParams\n): BaselineDescriptor {\n const {\n base,\n colors,\n variant,\n width,\n height,\n color,\n containerWidth,\n containerHeight,\n spacing,\n isVisible,\n } = params\n\n const [, normHeight] = normalizeValuePair(\n [width, height],\n [containerWidth, containerHeight]\n )\n const { top, right, bottom, left } = parsePadding(spacing)\n\n const paddingValues = [top, right, bottom, left]\n .map((v) => (v ? `${v}px` : '0'))\n .join(' ')\n const padding = paddingValues !== '0 0 0 0' ? paddingValues : undefined\n\n const rowCount = calculateRowCount({ height: normHeight, top, bottom, base })\n\n const chosenColor = color || (variant === 'line' ? colors.line : colors.flat)\n\n const defaultStyles = BASELINE_DEFAULTS(base, colors.line, colors.flat)\n const dimensionVars = ['--bkbl-w', '--bkbl-h']\n\n const containerStyle: Record<string, string> = {\n ...createStyleOverride({\n key: '--bkbl-w',\n value: formatValue(width || '100%'),\n defaultStyles,\n skipDimensions: { fullSize: dimensionVars },\n }),\n ...createStyleOverride({\n key: '--bkbl-h',\n value: formatValue(height || '100%'),\n defaultStyles,\n skipDimensions: { fullSize: dimensionVars },\n }),\n // --bkbl-b omitted: value `${base}px` always equals the BASELINE_DEFAULTS\n // entry, so the override would never emit. CSS layer carries the default.\n ...createStyleOverride({\n key: '--bkbl-cl',\n value: color || colors.line,\n defaultStyles,\n }),\n ...createStyleOverride({\n key: '--bkbl-cf',\n value: color || colors.flat,\n defaultStyles,\n }),\n ...(padding ? { padding } : {}),\n }\n\n const getRowStyle = (index: number): Record<string, string> => ({\n '--bkbl-rt': index === 0 ? '0px' : `${index * base}px`,\n '--bkbl-rh': variant === 'line' ? '1px' : `${base}px`,\n '--bkbl-c': chosenColor,\n })\n\n const classTokens = ['bas', isVisible ? 'v' : 'h']\n\n return {\n containerStyle,\n rowCount,\n getRowStyle,\n padding,\n isVisible,\n classTokens,\n }\n}\n","import {\n formatValue,\n createStyleOverride,\n createGridSpanStyles,\n} from '../utils'\n\nexport interface BoxDescriptorParams {\n base: number\n lineColor: string\n width?: number | string\n height?: number | string\n span?: number\n colSpan?: number\n rowSpan?: number\n isVisible: boolean\n}\n\nexport interface BoxDescriptor {\n boxStyle: Record<string, string>\n gridSpanStyle: Record<string, string>\n classTokens: string[]\n}\n\nconst BOX_DEFAULTS = (\n base: number,\n lineColor: string\n): Record<string, string> => ({\n '--bkbx-w': 'auto',\n '--bkbx-h': 'auto',\n '--bkbx-cl': lineColor,\n '--bkbx-b': `${base}px`,\n})\n\n/**\n * Computes styles needed to render a Box component.\n * Pure function — framework-agnostic.\n */\nexport function createBoxDescriptor(\n params: BoxDescriptorParams\n): BoxDescriptor {\n const { base, lineColor, width, height, span, colSpan, rowSpan, isVisible } =\n params\n\n const defaultStyles = BOX_DEFAULTS(base, lineColor)\n const dimensionVars = ['--bkbx-w', '--bkbx-h']\n\n // --bkbx-b and --bkbx-cl intentionally omitted: their runtime value\n // always equals the default (both are derived from the same base/lineColor\n // inputs that seed BOX_DEFAULTS), so inline overrides would never emit.\n // Styling happens at the CSS layer via the module's declared defaults.\n const boxStyle: Record<string, string> = {\n ...createStyleOverride({\n key: '--bkbx-w',\n value: formatValue(width || 'fit-content'),\n defaultStyles,\n skipDimensions: { fitContent: dimensionVars },\n }),\n ...createStyleOverride({\n key: '--bkbx-h',\n value: formatValue(height || 'fit-content'),\n defaultStyles,\n skipDimensions: { fitContent: dimensionVars },\n }),\n }\n\n const gridSpanStyle = createGridSpanStyles(span, colSpan, rowSpan)\n\n const classTokens = ['box']\n if (isVisible) classTokens.push('v')\n\n return { boxStyle, gridSpanStyle, classTokens }\n}\n","import { formatValue, createStyleOverride, normalizeValuePair } from '../utils'\n\nexport interface SpacerDescriptorParams {\n base: number\n colors: { line: string; flat: string; text: string }\n width?: number | string\n height?: number | string\n color?: string\n variant: string\n isVisible: boolean\n}\n\nexport interface SpacerDescriptor {\n style: Record<string, string>\n normWidth: number\n normHeight: number\n classTokens: string[]\n}\n\nconst SPACER_DEFAULTS = (\n base: number,\n textColor: string,\n flatColor: string,\n lineColor: string\n): Record<string, string> => ({\n '--bksp-w': '100%',\n '--bksp-h': '100%',\n '--bksp-b': `${base}px`,\n '--bksp-ct': textColor,\n '--bksp-cf': flatColor,\n '--bksp-cl': lineColor,\n})\n\n/**\n * Computes styles needed to render a Spacer component.\n * Pure function — framework-agnostic.\n */\nexport function createSpacerDescriptor(\n params: SpacerDescriptorParams\n): SpacerDescriptor {\n const { base, colors, width, height, color, variant, isVisible } = params\n\n const [normWidth, normHeight] = normalizeValuePair([width, height], [0, 0], {\n base,\n suppressWarnings: true,\n })\n\n const defaultStyles = SPACER_DEFAULTS(\n base,\n colors.text,\n colors.flat,\n colors.line\n )\n const dimensionVars = ['--bksp-w', '--bksp-h']\n\n const style: Record<string, string> = {\n ...createStyleOverride({\n key: '--bksp-h',\n value: formatValue(normHeight || '100%'),\n defaultStyles,\n skipDimensions: { fullSize: dimensionVars },\n }),\n ...createStyleOverride({\n key: '--bksp-w',\n value: formatValue(normWidth || '100%'),\n defaultStyles,\n skipDimensions: { fullSize: dimensionVars },\n }),\n '--bksp-b': `${base}px`,\n ...createStyleOverride({\n key: '--bksp-ct',\n value: color ?? colors.text,\n defaultStyles,\n }),\n ...createStyleOverride({\n key: '--bksp-cl',\n value: color ?? colors.line,\n defaultStyles,\n }),\n ...createStyleOverride({\n key: '--bksp-cf',\n value: color ?? colors.flat,\n defaultStyles,\n }),\n }\n\n const classTokens = ['spr']\n if (isVisible) classTokens.push(variant)\n\n return { style, normWidth, normHeight, classTokens }\n}\n","import { formatValue } from '../utils'\nimport type { Padding } from '../types'\n\nexport interface PadderDescriptorParams {\n base: number\n color: string\n width?: number | string\n height?: number | string\n padding: Padding\n enableSpacers: boolean\n isVisible: boolean\n}\n\nexport interface PadderDescriptor {\n containerStyle: Record<string, string>\n classTokens: string[]\n}\n\n/**\n * Computes styles needed to render a Padder component.\n * Pure function — framework-agnostic.\n */\nexport function createPadderDescriptor(\n params: PadderDescriptorParams\n): PadderDescriptor {\n const { base, color, width, height, padding, enableSpacers, isVisible } =\n params\n\n const containerStyle: Record<string, string> = {}\n\n if (width !== undefined && width !== 'fit-content') {\n containerStyle['--bkpd-w'] = formatValue(width)\n }\n if (height !== undefined && height !== 'fit-content') {\n containerStyle['--bkpd-h'] = formatValue(height)\n }\n\n containerStyle['--bkpd-b'] = `${base}px`\n containerStyle['--bkpd-c'] = color\n\n if (!enableSpacers) {\n const { top, right, bottom, left } = padding\n if (top > 0 || bottom > 0) {\n containerStyle.paddingBlock = `${top}px ${bottom}px`\n }\n if (left > 0 || right > 0) {\n containerStyle.paddingInline = `${left}px ${right}px`\n }\n }\n\n const classTokens = ['pad']\n if (isVisible && enableSpacers) classTokens.push('v')\n\n return { containerStyle, classTokens }\n}\n"],"mappings":"AAEA,IAAa,EAA+B,CAC1C,KAAM,EACN,SAAU,CACR,QAAS,OACT,UAAW,SACX,OAAQ,CACN,KAAM,sCACN,KAAM,sCACP,CACF,CACD,MAAO,CACL,QAAS,OACT,UAAW,SACX,OAAQ,CACN,KAAM,mCACN,QAAS,sCACT,KAAM,mCACN,MAAO,oCACR,CACF,CACD,OAAQ,CACN,QAAS,OACT,UAAW,SACX,OAAQ,CACN,KAAM,oCACN,KAAM,oCACN,KAAM,oCACP,CACF,CACD,IAAK,CACH,UAAW,SACX,OAAQ,CACN,KAAM,iCACN,KAAM,iCACN,KAAM,iCACP,CACF,CACD,OAAQ,CACN,UAAW,SACX,MAAO,+BACR,CACF,CC/BK,EAAiB,CAAC,WAAY,QAAS,SAAU,MAAO,SAAS,CAE1D,EAAe,GAA4C,CACtE,GAAM,CAAE,eAAc,QAAS,EACzB,EAAS,EAAE,CAEjB,IAAK,IAAM,KAA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