baseline-kit 2.0.1 → 3.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 (47) hide show
  1. package/README.md +258 -102
  2. package/dist/README.md +258 -102
  3. package/dist/baseline-kit.css +151 -0
  4. package/dist/components/Baseline/Baseline.d.ts +4 -5
  5. package/dist/components/Box/Box.d.ts +16 -5
  6. package/dist/components/Config/Config.d.ts +60 -17
  7. package/dist/components/Config/defaults.d.ts +2 -2
  8. package/dist/components/Config/index.d.ts +1 -1
  9. package/dist/components/Guide/Guide.d.ts +21 -12
  10. package/dist/components/Guide/index.d.ts +0 -6
  11. package/dist/components/Guide/types.d.ts +1 -1
  12. package/dist/components/Layout/Layout.d.ts +10 -6
  13. package/dist/components/Padder/Padder.d.ts +13 -7
  14. package/dist/components/Spacer/Spacer.d.ts +40 -11
  15. package/dist/components/Stack/Stack.d.ts +15 -8
  16. package/dist/components/index.d.ts +4 -3
  17. package/dist/components/styles/index.d.ts +11 -0
  18. package/dist/components/types.d.ts +3 -3
  19. package/dist/hooks/useBaseline.d.ts +13 -18
  20. package/dist/hooks/useConfig.d.ts +3 -8
  21. package/dist/hooks/useDebug.d.ts +1 -6
  22. package/dist/hooks/useGuide.d.ts +2 -7
  23. package/dist/hooks/useIsClient.d.ts +6 -0
  24. package/dist/hooks/useVirtual.d.ts +0 -5
  25. package/dist/index.cjs +1 -31
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.ts +25 -3
  28. package/dist/index.mjs +1557 -1542
  29. package/dist/index.mjs.map +1 -1
  30. package/dist/styles.css +1 -1
  31. package/dist/styles.d.ts +6 -0
  32. package/dist/theme/dark.css +67 -0
  33. package/dist/theme/default.css +82 -0
  34. package/dist/theme/tokens.css +82 -0
  35. package/dist/theme.css +142 -0
  36. package/dist/theme.d.ts +6 -0
  37. package/dist/utils/convert.d.ts +0 -22
  38. package/dist/utils/grid.d.ts +22 -0
  39. package/dist/utils/index.d.ts +2 -0
  40. package/dist/utils/math.d.ts +20 -36
  41. package/dist/utils/merge.d.ts +54 -5
  42. package/dist/utils/normalize.d.ts +0 -35
  43. package/dist/utils/parse.d.ts +0 -34
  44. package/dist/utils/snapping.d.ts +0 -5
  45. package/dist/utils/ssr.d.ts +26 -0
  46. package/dist/utils/timing.d.ts +0 -5
  47. package/package.json +81 -39
package/dist/styles.css CHANGED
@@ -1 +1 @@
1
- .spr_4aLVm{position:relative;width:var(--bksw);height:var(--bksh);flex-shrink:0}.line_lUa33:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid var(--bkscl);z-index:calc(var(--bkzi))}.flat_zXVQF{background-color:var(--bkscf)}.pad_I0i9S{position:relative;display:grid;grid-template-columns:auto 1fr auto;grid-template-rows:auto 1fr auto;width:var(--bkpw, auto);height:var(--bkph, auto)}.v_E0FRN:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid var(--bkpc, var(--bk-padder-color-theme));pointer-events:none;z-index:var(--bkzi)}.lay_yGGkG{display:grid;position:relative;box-sizing:border-box;width:var(--bklw, auto);height:var(--bklh, auto);grid-template-columns:var(--bklgtc, repeat(auto-fit, minmax(100px, 1fr)));grid-template-rows:var(--bklgtr, auto);gap:var(--bklg);column-gap:var(--bklcg);row-gap:var(--bklrg);justify-items:var(--bklji);align-items:var(--bklai);justify-content:var(--bkljc);align-content:var(--bklac)}.v_uVoBP:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid var(--bklcl);pointer-events:none;z-index:var(--bkzio)}.box_LHy8B{position:relative;width:var(--bkxw);height:var(--bkxh)}.v_q3Ozc:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid var(--bkxcl);pointer-events:none;z-index:var(--bkzi)}.stk_4t2AU{display:flex;position:relative;width:var(--bkkw, auto);height:var(--bkkh, auto)}.v_Uwir6:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid var(--bkkcl);pointer-events:none;z-index:var(--bkzio)}.gde_eT-MH{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;padding:var(--bkgpb) var(--bkgpi)}.line_xcGxq{left:-.5px}.cols_LoPVp{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;gap:var(--bkgg);grid-template-columns:var(--bkgt);justify-content:var(--bkgj);width:var(--bkwf);height:var(--bkhf)}.col_ZgTMC{min-width:0;width:var(--bkwf);height:var(--bkhf)}.col_ZgTMC[data-variant=line]{width:1px;background-color:var(--bkgcl)}.col_ZgTMC[data-variant=pattern]{background-color:var(--bkgcp)}.col_ZgTMC[data-variant=auto]{background-color:var(--bkgca)}.col_ZgTMC[data-variant=fixed]{background-color:var(--bkgcf)}.bas_qAJSK{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;width:var(--bkbw);height:var(--bkbh);overflow:hidden}.row_y6My5{left:0;right:0;position:absolute;top:var(--bkrt);height:var(--bkrh);background-color:var(--bkbcl)}
1
+ *,*:before,*:after{box-sizing:border-box;margin:0;padding:0}ul[role=list],ol[role=list]{list-style:none}body{min-height:100vh;text-rendering:optimizeSpeed;line-height:1.5}img,picture{max-width:100%;display:block}@media (prefers-reduced-motion: reduce){html:focus-within{scroll-behavior:auto}*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}:root{--bkb: 8px;--bkzi: 1;--bkzio: 2;--bk-transition-base: .18s ease;--bk-width-default: fit-content;--bk-height-default: fit-content;--bkwf: 100%;--bkhf: 100%;--bkxb: var(--bkb);--bkxw: var(--bk-width-default);--bkxh: var(--bk-height-default);--bkxcl: var(--bk-box-color-line-theme, hsla(300, 60%, 40%, .6));--bkxcf: var(--bk-box-color-flat-theme, hsla(260, 100%, 70%, .2));--bkxci: var(--bk-box-color-text-theme, hsla(300, 60%, 40%, .9));--bkkw: var(--bkwf);--bkkh: var(--bk-height-default);--bkkcl: var(--bk-stack-color-line-theme, hsla(330, 60%, 40%, .6));--bkkcf: var(--bk-stack-color-flat-theme, hsla(0, 100%, 70%, .2));--bkkci: var(--bk-stack-color-text-theme, hsla(330, 60%, 40%, .9));--bkbw: 100%;--bkbh: 100%;--bkrt: 0;--bkrh: 1px;--bkbcl: var(--bk-baseline-color-line-theme, hsla(240, 60%, 40%, .15));--bkbcf: var(--bk-baseline-color-flat-theme, hsla(230, 100%, 70%, .2));--bkgw: 100vw;--bkgh: 100vh;--bkgg: var(--bkb);--bkgj: center;--bkgt: auto;--bkgpb: 0;--bkgpi: 0;--bkgcl: var(--bk-guide-color-line-theme, hsla(240, 60%, 40%, .15));--bkgcp: var(--bk-guide-color-pattern-theme, hsla(230, 100%, 70%, .2));--bkgca: var(--bk-guide-color-auto-theme, hsla(200, 100%, 70%, .15));--bkgcf: var(--bk-guide-color-fixed-theme, hsla(200, 100%, 70%, .15));--bklw: var(--bk-width-default);--bklh: var(--bk-height-default);--bklcl: var(--bk-layout-color-line-theme, hsla(330, 60%, 40%, .6));--bklcf: var(--bk-layout-color-flat-theme, hsla(0, 100%, 70%, .2));--bklci: var(--bk-layout-color-text-theme, hsla(330, 60%, 40%, .9));--bklgtc: repeat(auto-fill, minmax(100px, 1fr));--bklgtr: auto;--bklg: 0;--bklcg: 0;--bklrg: 0;--bklji: stretch;--bklai: stretch;--bkljc: start;--bklac: start;--bkpw: var(--bk-width-default);--bkph: var(--bk-height-default);--bkpc: var(--bk-padder-color-theme, hsla(270, 60%, 40%, .6));--bksw: var(--bkwf);--bksh: var(--bkhf);--bkscl: var(--bk-spacer-color-line-theme, hsla(270, 60%, 40%, .6));--bkscf: var(--bk-spacer-color-flat-theme, hsla(230, 100%, 70%, .2));--bksct: var(--bk-spacer-color-text-theme, hsla(270, 60%, 40%, 1))}.guide{--bkgcl: var(--bk-guide-color-line-theme, hsla(240, 60%, 40%, .15));--bkgcp: var(--bk-guide-color-pattern-theme, hsla(230, 100%, 70%, .2));--bkgca: var(--bk-guide-color-auto-theme, hsla(200, 100%, 70%, .15));--bkgcf: var(--bk-guide-color-fixed-theme, hsla(200, 100%, 70%, .15))}.baseline{--bkbcl: var(--bk-baseline-color-line-theme, hsla(240, 60%, 40%, .15));--bkbcf: var(--bk-baseline-color-flat-theme, hsla(230, 100%, 70%, .2))}.box{--bkxcl: var(--bk-box-color-line-theme, hsla(300, 60%, 40%, .6));--bkxcf: var(--bk-box-color-flat-theme, hsla(260, 100%, 70%, .2));--bkxci: var(--bk-box-color-text-theme, hsla(300, 60%, 40%, .9))}.stack{--bkkcl: var(--bk-stack-color-line-theme, hsla(330, 60%, 40%, .6));--bkkcf: var(--bk-stack-color-flat-theme, hsla(0, 100%, 70%, .2));--bkkci: var(--bk-stack-color-text-theme, hsla(330, 60%, 40%, .9))}.layout{--bklcl: var(--bk-layout-color-line-theme, hsla(330, 60%, 40%, .6));--bklcf: var(--bk-layout-color-flat-theme, hsla(0, 100%, 70%, .2));--bklci: var(--bk-layout-color-text-theme, hsla(330, 60%, 40%, .9))}.box{position:relative;width:var(--bkxw);height:var(--bkxh)}.v:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid var(--bkxcl);pointer-events:none;z-index:var(--bkzi)}.gde{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;padding:var(--bkgpb) var(--bkgpi)}.line{left:-.5px}.cols{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;column-gap:var(--bkgg);grid-template-rows:1fr;grid-template-columns:var(--bkgt);justify-content:var(--bkgj);width:var(--bkwf);height:var(--bkhf);overflow:hidden}.col{min-width:0;width:var(--bkwf);height:var(--bkhf)}.col[data-variant=line]{width:1px;background-color:var(--bkgcl)}.col[data-variant=pattern]{background-color:var(--bkgcp)}.col[data-variant=auto]{background-color:var(--bkgca);overflow:hidden}.col[data-variant=fixed]{background-color:var(--bkgcf)}.ssr{box-sizing:border-box;display:grid;position:relative;z-index:1;pointer-events:none;min-height:100px}.pad{position:relative;display:grid;grid-template-columns:auto 1fr auto;grid-template-rows:auto 1fr auto;width:var(--bkpw, auto);height:var(--bkph, auto)}.v:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid var(--bkpc, var(--bk-padder-color-theme));pointer-events:none;z-index:var(--bkzi)}.spr{position:relative;box-sizing:border-box;width:var(--bksw, 100%);height:var(--bksh, auto);flex-shrink:0;display:block;margin:0;padding:0}.line:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid var(--bkscl, hsla(270, 60%, 40%, .6));z-index:calc(var(--bkzi, 1))}.flat{background-color:var(--bkscf, hsla(230, 100%, 70%, .2))}.stk{display:flex;position:relative;width:var(--bkkw);height:var(--bkkh)}.stk .line:after{border:none}.v:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid var(--bkkcl, hsla(330, 60%, 40%, .6));pointer-events:none;z-index:var(--bkzio, 2)}.flat{background-color:var(--bkkcf, hsla(0, 100%, 70%, .2))}.lay{display:grid;position:relative;box-sizing:border-box;width:var(--bklw, var(--bk-width-default, auto));height:var(--bklh, var(--bk-height-default, auto));grid-template-columns:var( --bklgtc, repeat(auto-fill, minmax(100px, 1fr)) );grid-template-rows:var(--bklgtr, auto);gap:var(--bklg, 0);column-gap:var(--bklcg, 0);row-gap:var(--bklrg, 0);justify-items:var(--bklji, stretch);align-items:var(--bklai, stretch);justify-content:var(--bkljc, start);align-content:var(--bklac, start)}.lay .line:after,.stk .line:after{border:none}.v:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid var(--bklcl, var(--bk-layout-color-line-theme, hsla(330, 60%, 40%, .6)));pointer-events:none;z-index:var(--bkzio, 2)}.bas{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;width:var(--bkbw);height:var(--bkbh);overflow:hidden}.row{left:0;right:0;position:absolute;top:var(--bkrt);height:var(--bkrh);background-color:var(--bkbc)}.ssr{box-sizing:border-box;display:grid;position:relative;z-index:1;pointer-events:none}.v{opacity:1;visibility:visible;transition:opacity var(--bk-transition-base),visibility 0ms linear}.h{opacity:0;visibility:hidden;transition:opacity var(--bk-transition-base),visibility 0ms linear .18s}:root{--bk-color-black-primary: 0, 0%, 10%;--bk-color-black-secondary: 0, 10%, 30%;--bk-color-white-primary: 0, 100%, 90%;--bk-color-white-secondary: 0, 0%, 90%;--bk-color-pink-primary: 300, 60%, 40%;--bk-color-pink-secondary: 260, 100%, 70%;--bk-color-purple-primary: 270, 60%, 40%;--bk-color-purple-secondary: 230, 100%, 70%;--bk-color-blue-primary: 240, 60%, 40%;--bk-color-blue-secondary: 200, 100%, 70%;--bk-color-cyan-primary: 200, 60%, 40%;--bk-color-cyan-secondary: 160, 100%, 70%;--bk-color-green-primary: 160, 60%, 40%;--bk-color-green-secondary: 110, 100%, 70%;--bk-color-yellow-primary: 30, 60%, 40%;--bk-color-yellow-secondary: 70, 100%, 70%;--bk-color-orange-primary: 10, 60%, 40%;--bk-color-orange-secondary: 30, 100%, 70%;--bk-color-red-primary: 330, 60%, 40%;--bk-color-red-secondary: 0, 100%, 70%;--bk-guide-color-line-theme: hsla(var(--bk-color-blue-primary), .15);--bk-guide-color-pattern-theme: hsla(var(--bk-color-purple-secondary), .2);--bk-guide-color-auto-theme: hsla(var(--bk-color-blue-secondary), .15);--bk-guide-color-fixed-theme: hsla(var(--bk-color-blue-secondary), .15);--bk-baseline-color-line-theme: hsla(var(--bk-color-blue-primary), .15);--bk-baseline-color-flat-theme: hsla(var(--bk-color-purple-secondary), .2);--bk-spacer-color-line-theme: hsla(var(--bk-color-purple-primary), .6);--bk-spacer-color-flat-theme: hsla(var(--bk-color-purple-secondary), .2);--bk-spacer-color-text-theme: hsla(var(--bk-color-purple-primary), 1);--bk-box-color-line-theme: hsla(var(--bk-color-pink-primary), .6);--bk-box-color-flat-theme: hsla(var(--bk-color-pink-secondary), .2);--bk-box-color-text-theme: hsla(var(--bk-color-pink-primary), .9);--bk-stack-color-line-theme: hsla(var(--bk-color-red-primary), .6);--bk-stack-color-flat-theme: hsla(var(--bk-color-red-secondary), .2);--bk-stack-color-text-theme: hsla(var(--bk-color-red-primary), .9);--bk-layout-color-line-theme: hsla(var(--bk-color-red-primary), .6);--bk-layout-color-flat-theme: hsla(var(--bk-color-red-secondary), .2);--bk-layout-color-text-theme: hsla(var(--bk-color-red-primary), .9);--bk-padder-color-theme: hsla(var(--bk-color-purple-primary), .6)}@media (prefers-color-scheme: dark){:root{--bk-color-black-primary: 0, 10%, 30%;--bk-color-black-secondary: 0, 0%, 10%;--bk-color-white-primary: 0, 0%, 90%;--bk-color-white-secondary: 0, 100%, 90%;--bk-color-pink-primary: 260, 100%, 70%;--bk-color-pink-secondary: 300, 60%, 40%;--bk-color-purple-primary: 230, 100%, 70%;--bk-color-purple-secondary: 270, 60%, 40%;--bk-color-blue-primary: 200, 100%, 70%;--bk-color-blue-secondary: 240, 60%, 40%;--bk-color-cyan-primary: 160, 100%, 70%;--bk-color-cyan-secondary: 200, 60%, 40%;--bk-color-green-primary: 110, 100%, 70%;--bk-color-green-secondary: 160, 60%, 40%;--bk-color-yellow-primary: 70, 100%, 70%;--bk-color-yellow-secondary: 30, 60%, 40%;--bk-color-orange-primary: 30, 100%, 70%;--bk-color-orange-secondary: 10, 60%, 40%;--bk-color-red-primary: 0, 100%, 70%;--bk-color-red-secondary: 330, 60%, 40%;--bk-baseline-color-line-theme: hsla(var(--bk-color-white-primary), .1);--bk-baseline-color-flat-theme: hsla(var(--bk-color-white-secondary), .2);--bk-box-color-line-theme: hsla(var(--bk-color-pink-primary), .6);--bk-box-color-flat-theme: hsla(var(--bk-color-pink-secondary), .3);--bk-box-color-text-theme: hsla(var(--bk-color-pink-primary), .9);--bk-guide-color-line-theme: hsla(var(--bk-color-white-primary), .1);--bk-guide-color-pattern-theme: hsla(var(--bk-color-purple-secondary), .25);--bk-guide-color-auto-theme: hsla(var(--bk-color-blue-secondary), .2);--bk-guide-color-fixed-theme: hsla(var(--bk-color-blue-secondary), .2);--bk-stack-color-line-theme: hsla(var(--bk-color-red-primary), .6);--bk-stack-color-flat-theme: hsla(var(--bk-color-red-secondary), .3);--bk-stack-color-text-theme: hsla(var(--bk-color-red-primary), .9);--bk-layout-color-line-theme: hsla(var(--bk-color-red-primary), .6);--bk-layout-color-flat-theme: hsla(var(--bk-color-red-secondary), .3);--bk-layout-color-text-theme: hsla(var(--bk-color-red-primary), .9);--bk-spacer-color-line-theme: hsla(var(--bk-color-purple-primary), .7);--bk-spacer-color-flat-theme: hsla(var(--bk-color-purple-secondary), .3);--bk-spacer-color-text-theme: hsla(var(--bk-color-purple-primary), 1)}}.spr_zbcF6{position:relative;box-sizing:border-box;width:var(--bksw, 100%);height:var(--bksh, auto);flex-shrink:0;display:block;margin:0;padding:0}.line_qHW69:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid var(--bkscl, hsla(270, 60%, 40%, .6));z-index:calc(var(--bkzi, 1))}.flat_gqixr{background-color:var(--bkscf, hsla(230, 100%, 70%, .2))}.pad_w2-sL{position:relative;display:grid;grid-template-columns:auto 1fr auto;grid-template-rows:auto 1fr auto;width:var(--bkpw, auto);height:var(--bkph, auto)}.lay_Ew8za .line_ESlzk:after,.stk_7SJoE .line_ESlzk:after{border:none}.v_lhGBy:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid var(--bkpc, var(--bk-padder-color-theme));pointer-events:none;z-index:var(--bkzi)}.lay_5cMu5{display:grid;position:relative;box-sizing:border-box;width:var(--bklw, var(--bk-width-default, auto));height:var(--bklh, var(--bk-height-default, auto));grid-template-columns:var( --bklgtc, repeat(auto-fill, minmax(100px, 1fr)) );grid-template-rows:var(--bklgtr, auto);gap:var(--bklg, 0);column-gap:var(--bklcg, 0);row-gap:var(--bklrg, 0);justify-items:var(--bklji, stretch);align-items:var(--bklai, stretch);justify-content:var(--bkljc, start);align-content:var(--bklac, start)}.lay_5cMu5 .line_j2f8-:after,.stk_3Spwo .line_j2f8-:after{border:none}.v_dprVE:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid var(--bklcl, var(--bk-layout-color-line-theme, hsla(330, 60%, 40%, .6)));pointer-events:none;z-index:var(--bkzio, 2)}.box_rDCRX{position:relative;width:var(--bkxw);height:var(--bkxh)}.v_0MMHD:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid var(--bkxcl);pointer-events:none;z-index:var(--bkzi)}.stk_l-58l{display:flex;position:relative;width:var(--bkkw);height:var(--bkkh)}.stk_l-58l .line_THMgb:after{border:none}.v_-k3qw:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid var(--bkkcl, hsla(330, 60%, 40%, .6));pointer-events:none;z-index:var(--bkzio, 2)}.flat_j15hF{background-color:var(--bkkcf, hsla(0, 100%, 70%, .2))}.gde_-Naxo{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;padding:var(--bkgpb) var(--bkgpi)}.line_-VS-e{left:-.5px}.cols_8lD6D{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;column-gap:var(--bkgg);grid-template-rows:1fr;grid-template-columns:var(--bkgt);justify-content:var(--bkgj);width:var(--bkwf);height:var(--bkhf);overflow:hidden}.col_rlbsL{min-width:0;width:var(--bkwf);height:var(--bkhf)}.col_rlbsL[data-variant=line]{width:1px;background-color:var(--bkgcl)}.col_rlbsL[data-variant=pattern]{background-color:var(--bkgcp)}.col_rlbsL[data-variant=auto]{background-color:var(--bkgca);overflow:hidden}.col_rlbsL[data-variant=fixed]{background-color:var(--bkgcf)}.ssr_VGvpO{box-sizing:border-box;display:grid;position:relative;z-index:1;pointer-events:none;min-height:100px}.bas_e-SXr{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;width:var(--bkbw);height:var(--bkbh);overflow:hidden}.row_q-FZb{left:0;right:0;position:absolute;top:var(--bkrt);height:var(--bkrh);background-color:var(--bkbc)}.ssr_W1N5g{box-sizing:border-box;display:grid;position:relative;z-index:1;pointer-events:none}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @file Style Entry Point
3
+ * @description Clean import path for core CSS styles
4
+ * @module baseline-kit/styles
5
+ */
6
+ import './components/styles/core.css';
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Baseline Kit Dark Theme
3
+ *
4
+ * Organization:
5
+ * 1. Color Palette (HSL values)
6
+ * 2. Component Theme Colors
7
+ */
8
+
9
+ :root {
10
+ /* ───────────────────────────────────────────────────────
11
+ Color Palette - Dark Theme
12
+ - Inverts Primary/Secondary relationships
13
+ - Adjusts values for better contrast
14
+ ─────────────────────────────────────────────────────── */
15
+
16
+ /* Neutral Colors - Dark */
17
+ --bk-color-black-primary: 0, 10%, 30%; /* #544545 */
18
+ --bk-color-black-secondary: 0, 0%, 10%; /* #1A1A1A */
19
+ --bk-color-white-primary: 0, 0%, 90%; /* #E6E6E6 */
20
+ --bk-color-white-secondary: 0, 100%, 90%; /* #FFCCCC */
21
+
22
+ /* Brand Colors - Dark */
23
+ --bk-color-pink-primary: 260, 100%, 70%; /* #9966FF */
24
+ --bk-color-pink-secondary: 300, 60%, 40%; /* #A329A3 */
25
+ --bk-color-purple-primary: 230, 100%, 70%; /* #6680FF */
26
+ --bk-color-purple-secondary: 270, 60%, 40%; /* #6629A3 */
27
+ --bk-color-blue-primary: 200, 100%, 70%; /* #66CCFF */
28
+ --bk-color-blue-secondary: 240, 60%, 40%; /* #2929A3 */
29
+
30
+ /* Supporting Colors - Dark */
31
+ --bk-color-cyan-primary: 160, 100%, 70%; /* #66FFCC */
32
+ --bk-color-cyan-secondary: 200, 60%, 40%; /* #297AA3 */
33
+ --bk-color-green-primary: 110, 100%, 70%; /* #80FF66 */
34
+ --bk-color-green-secondary: 160, 60%, 40%; /* #29A37A */
35
+ --bk-color-yellow-primary: 70, 100%, 70%; /* #A36629 */
36
+ --bk-color-yellow-secondary: 30, 60%, 40%; /* #A36629 */
37
+ --bk-color-orange-primary: 30, 100%, 70%; /* #FFB266 */
38
+ --bk-color-orange-secondary: 10, 60%, 40%; /* #A33D29 */
39
+ --bk-color-red-primary: 0, 100%, 70%; /* #FF6666 */
40
+ --bk-color-red-secondary: 330, 60%, 40%; /* #A32966 */
41
+
42
+ /* ───────────────────────────────────────────────────────
43
+ Component Theme Colors - Dark
44
+ - Adjusts alpha values for better contrast
45
+ ─────────────────────────────────────────────────────── */
46
+
47
+ /* Component Theme Overrides - Dark */
48
+ --bk-baseline-color-line-theme: hsla(var(--bk-color-white-primary), 0.1);
49
+ --bk-baseline-color-flat-theme: hsla(var(--bk-color-white-secondary), 0.2);
50
+
51
+ --bk-box-color-line-theme: hsla(var(--bk-color-pink-primary), 0.6);
52
+ --bk-box-color-flat-theme: hsla(var(--bk-color-pink-secondary), 0.3);
53
+ --bk-box-color-text-theme: hsla(var(--bk-color-pink-primary), 0.9);
54
+
55
+ --bk-guide-color-line-theme: hsla(var(--bk-color-white-primary), 0.1);
56
+ --bk-guide-color-pattern-theme: hsla(var(--bk-color-purple-secondary), 0.25);
57
+ --bk-guide-color-auto-theme: hsla(var(--bk-color-blue-secondary), 0.2);
58
+ --bk-guide-color-fixed-theme: hsla(var(--bk-color-blue-secondary), 0.2);
59
+
60
+ --bk-stack-color-line-theme: hsla(var(--bk-color-red-primary), 0.6);
61
+ --bk-stack-color-flat-theme: hsla(var(--bk-color-red-secondary), 0.3);
62
+ --bk-stack-color-text-theme: hsla(var(--bk-color-red-primary), 0.9);
63
+
64
+ --bk-layout-color-line-theme: hsla(var(--bk-color-red-primary), 0.6);
65
+ --bk-layout-color-flat-theme: hsla(var(--bk-color-red-secondary), 0.3);
66
+ --bk-layout-color-text-theme: hsla(var(--bk-color-red-primary), 0.9);
67
+ }
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Baseline Kit Default Theme (Light)
3
+ *
4
+ * Organization:
5
+ * 1. Color Palette (HSL values)
6
+ * 2. Component Theme Colors
7
+ */
8
+
9
+ :root {
10
+ /* ───────────────────────────────────────────────────────
11
+ Color Palette - Light Theme
12
+ - Primary: More muted/dimmed colors
13
+ - Secondary: Brighter, more vibrant colors
14
+ ─────────────────────────────────────────────────────── */
15
+
16
+ /* Neutral Colors */
17
+ --bk-color-black-primary: 0, 0%, 10%; /* #1A1A1A */
18
+ --bk-color-black-secondary: 0, 10%, 30%; /* #544545 */
19
+ --bk-color-white-primary: 0, 100%, 90%; /* #FFCCCC */
20
+ --bk-color-white-secondary: 0, 0%, 90%; /* #E6E6E6 */
21
+
22
+ /* Brand Colors */
23
+ --bk-color-pink-primary: 300, 60%, 40%; /* #A329A3 */
24
+ --bk-color-pink-secondary: 260, 100%, 70%; /* #9966FF */
25
+ --bk-color-purple-primary: 270, 60%, 40%; /* #6629A3 */
26
+ --bk-color-purple-secondary: 230, 100%, 70%; /* #6680FF */
27
+ --bk-color-blue-primary: 240, 60%, 40%; /* #2929A3 */
28
+ --bk-color-blue-secondary: 200, 100%, 70%; /* #66CCFF */
29
+
30
+ /* Supporting Colors */
31
+ --bk-color-cyan-primary: 200, 60%, 40%; /* #297AA3 */
32
+ --bk-color-cyan-secondary: 160, 100%, 70%; /* #66FFCC */
33
+ --bk-color-green-primary: 160, 60%, 40%; /* #29A37A */
34
+ --bk-color-green-secondary: 110, 100%, 70%; /* #80FF66 */
35
+ --bk-color-yellow-primary: 30, 60%, 40%; /* #A36629 */
36
+ --bk-color-yellow-secondary: 70, 100%, 70%; /* #A36629 */
37
+ --bk-color-orange-primary: 10, 60%, 40%; /* #A33D29 */
38
+ --bk-color-orange-secondary: 30, 100%, 70%; /* #FFB266 */
39
+ --bk-color-red-primary: 330, 60%, 40%; /* #A32966 */
40
+ --bk-color-red-secondary: 0, 100%, 70%; /* #FF6666 */
41
+
42
+ /* ───────────────────────────────────────────────────────
43
+ Component Theme Colors - Light
44
+ Using consistent alpha values:
45
+ - Line: 0.6 (borders)
46
+ - Flat: 0.2 (backgrounds)
47
+ - text: 0.9-1.0 (indicators)
48
+ ─────────────────────────────────────────────────────── */
49
+
50
+ /* Guide Component Theme */
51
+ --bk-guide-color-line-theme: hsla(var(--bk-color-blue-primary), 0.15);
52
+ --bk-guide-color-pattern-theme: hsla(var(--bk-color-purple-secondary), 0.2);
53
+ --bk-guide-color-auto-theme: hsla(var(--bk-color-blue-secondary), 0.15);
54
+ --bk-guide-color-fixed-theme: hsla(var(--bk-color-blue-secondary), 0.15);
55
+
56
+ /* Baseline Component Theme */
57
+ --bk-baseline-color-line-theme: hsla(var(--bk-color-blue-primary), 0.15);
58
+ --bk-baseline-color-flat-theme: hsla(var(--bk-color-purple-secondary), 0.2);
59
+
60
+ /* Spacer Component Theme */
61
+ --bk-spacer-color-line-theme: hsla(var(--bk-color-purple-primary), 0.6);
62
+ --bk-spacer-color-flat-theme: hsla(var(--bk-color-purple-secondary), 0.2);
63
+ --bk-spacer-color-text-theme: hsla(var(--bk-color-purple-primary), 1);
64
+
65
+ /* Box Component Theme */
66
+ --bk-box-color-line-theme: hsla(var(--bk-color-pink-primary), 0.6);
67
+ --bk-box-color-flat-theme: hsla(var(--bk-color-pink-secondary), 0.2);
68
+ --bk-box-color-text-theme: hsla(var(--bk-color-pink-primary), 0.9);
69
+
70
+ /* Stack Component Theme */
71
+ --bk-stack-color-line-theme: hsla(var(--bk-color-red-primary), 0.6);
72
+ --bk-stack-color-flat-theme: hsla(var(--bk-color-red-secondary), 0.2);
73
+ --bk-stack-color-text-theme: hsla(var(--bk-color-red-primary), 0.9);
74
+
75
+ /* Layout Component Theme */
76
+ --bk-layout-color-line-theme: hsla(var(--bk-color-red-primary), 0.6);
77
+ --bk-layout-color-flat-theme: hsla(var(--bk-color-red-secondary), 0.2);
78
+ --bk-layout-color-text-theme: hsla(var(--bk-color-red-primary), 0.9);
79
+
80
+ /* Padder Component Theme */
81
+ --bk-padder-color-theme: hsla(var(--bk-color-purple-primary), 0.6);
82
+ }
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Baseline Kit Theme Tokens Template
3
+ *
4
+ * Use this file as a starting point for creating your own custom theme.
5
+ * This file contains all theme variables but no values.
6
+ *
7
+ * To create a custom theme:
8
+ * 1. Copy this file
9
+ * 2. Fill in your custom values
10
+ * 3. Import it in your application after the core styles
11
+ */
12
+
13
+ :root {
14
+ /* ───────────────────────────────────────────────────────
15
+ Color Palette
16
+ Provide HSL values in the format: hue, saturation%, lightness%
17
+ ─────────────────────────────────────────────────────── */
18
+
19
+ /* Neutral Colors */
20
+ --bk-color-black-primary: ;
21
+ --bk-color-black-secondary: ;
22
+ --bk-color-white-primary: ;
23
+ --bk-color-white-secondary: ;
24
+
25
+ /* Brand Colors */
26
+ --bk-color-pink-primary: ;
27
+ --bk-color-pink-secondary: ;
28
+ --bk-color-purple-primary: ;
29
+ --bk-color-purple-secondary: ;
30
+ --bk-color-blue-primary: ;
31
+ --bk-color-blue-secondary: ;
32
+
33
+ /* Supporting Colors */
34
+ --bk-color-cyan-primary: ;
35
+ --bk-color-cyan-secondary: ;
36
+ --bk-color-green-primary: ;
37
+ --bk-color-green-secondary: ;
38
+ --bk-color-yellow-primary: ;
39
+ --bk-color-yellow-secondary: ;
40
+ --bk-color-orange-primary: ;
41
+ --bk-color-orange-secondary: ;
42
+ --bk-color-red-primary: ;
43
+ --bk-color-red-secondary: ;
44
+
45
+ /* ───────────────────────────────────────────────────────
46
+ Component Theme Colors
47
+ Use hsla(var(--color-variable), alpha) format for transparency
48
+ ─────────────────────────────────────────────────────── */
49
+
50
+ /* Guide Component Theme */
51
+ --bk-guide-color-line-theme: ;
52
+ --bk-guide-color-pattern-theme: ;
53
+ --bk-guide-color-auto-theme: ;
54
+ --bk-guide-color-fixed-theme: ;
55
+
56
+ /* Baseline Component Theme */
57
+ --bk-baseline-color-line-theme: ;
58
+ --bk-baseline-color-flat-theme: ;
59
+
60
+ /* Spacer Component Theme */
61
+ --bk-spacer-color-line-theme: ;
62
+ --bk-spacer-color-flat-theme: ;
63
+ --bk-spacer-color-text-theme: ;
64
+
65
+ /* Box Component Theme */
66
+ --bk-box-color-line-theme: ;
67
+ --bk-box-color-flat-theme: ;
68
+ --bk-box-color-text-theme: ;
69
+
70
+ /* Stack Component Theme */
71
+ --bk-stack-color-line-theme: ;
72
+ --bk-stack-color-flat-theme: ;
73
+ --bk-stack-color-text-theme: ;
74
+
75
+ /* Layout Component Theme */
76
+ --bk-layout-color-line-theme: ;
77
+ --bk-layout-color-flat-theme: ;
78
+ --bk-layout-color-text-theme: ;
79
+
80
+ /* Padder Component Theme */
81
+ --bk-padder-color-theme: ;
82
+ }
package/dist/theme.css ADDED
@@ -0,0 +1,142 @@
1
+ /**
2
+ * Baseline Kit Theme System
3
+ *
4
+ * This file contains all color variables for theming.
5
+ * For light and dark mode themes separately, see the theme directory.
6
+ */
7
+
8
+ :root {
9
+ /* ───────────────────────────────────────────────────────
10
+ Color Palette - Light Theme
11
+ - Primary: More muted/dimmed colors
12
+ - Secondary: Brighter, more vibrant colors
13
+ ─────────────────────────────────────────────────────── */
14
+
15
+ /* Neutral Colors */
16
+ --bk-color-black-primary: 0, 0%, 10%; /* #1A1A1A */
17
+ --bk-color-black-secondary: 0, 10%, 30%; /* #544545 */
18
+ --bk-color-white-primary: 0, 100%, 90%; /* #FFCCCC */
19
+ --bk-color-white-secondary: 0, 0%, 90%; /* #E6E6E6 */
20
+
21
+ /* Brand Colors */
22
+ --bk-color-pink-primary: 300, 60%, 40%; /* #A329A3 */
23
+ --bk-color-pink-secondary: 260, 100%, 70%; /* #9966FF */
24
+ --bk-color-purple-primary: 270, 60%, 40%; /* #6629A3 */
25
+ --bk-color-purple-secondary: 230, 100%, 70%; /* #6680FF */
26
+ --bk-color-blue-primary: 240, 60%, 40%; /* #2929A3 */
27
+ --bk-color-blue-secondary: 200, 100%, 70%; /* #66CCFF */
28
+
29
+ /* Supporting Colors */
30
+ --bk-color-cyan-primary: 200, 60%, 40%; /* #297AA3 */
31
+ --bk-color-cyan-secondary: 160, 100%, 70%; /* #66FFCC */
32
+ --bk-color-green-primary: 160, 60%, 40%; /* #29A37A */
33
+ --bk-color-green-secondary: 110, 100%, 70%; /* #80FF66 */
34
+ --bk-color-yellow-primary: 30, 60%, 40%; /* #A36629 */
35
+ --bk-color-yellow-secondary: 70, 100%, 70%; /* #A36629 */
36
+ --bk-color-orange-primary: 10, 60%, 40%; /* #A33D29 */
37
+ --bk-color-orange-secondary: 30, 100%, 70%; /* #FFB266 */
38
+ --bk-color-red-primary: 330, 60%, 40%; /* #A32966 */
39
+ --bk-color-red-secondary: 0, 100%, 70%; /* #FF6666 */
40
+
41
+ /* ───────────────────────────────────────────────────────
42
+ Component Theme Colors - Light
43
+ Using consistent alpha values:
44
+ - Line: 0.6 (borders)
45
+ - Flat: 0.2 (backgrounds)
46
+ - text: 0.9-1.0 (indicators)
47
+ ─────────────────────────────────────────────────────── */
48
+
49
+ /* Guide Component Theme */
50
+ --bk-guide-color-line-theme: hsla(var(--bk-color-blue-primary), 0.15);
51
+ --bk-guide-color-pattern-theme: hsla(var(--bk-color-purple-secondary), 0.2);
52
+ --bk-guide-color-auto-theme: hsla(var(--bk-color-blue-secondary), 0.15);
53
+ --bk-guide-color-fixed-theme: hsla(var(--bk-color-blue-secondary), 0.15);
54
+
55
+ /* Baseline Component Theme */
56
+ --bk-baseline-color-line-theme: hsla(var(--bk-color-blue-primary), 0.15);
57
+ --bk-baseline-color-flat-theme: hsla(var(--bk-color-purple-secondary), 0.2);
58
+
59
+ /* Spacer Component Theme */
60
+ --bk-spacer-color-line-theme: hsla(var(--bk-color-purple-primary), 0.6);
61
+ --bk-spacer-color-flat-theme: hsla(var(--bk-color-purple-secondary), 0.2);
62
+ --bk-spacer-color-text-theme: hsla(var(--bk-color-purple-primary), 1);
63
+
64
+ /* Box Component Theme */
65
+ --bk-box-color-line-theme: hsla(var(--bk-color-pink-primary), 0.6);
66
+ --bk-box-color-flat-theme: hsla(var(--bk-color-pink-secondary), 0.2);
67
+ --bk-box-color-text-theme: hsla(var(--bk-color-pink-primary), 0.9);
68
+
69
+ /* Stack Component Theme */
70
+ --bk-stack-color-line-theme: hsla(var(--bk-color-red-primary), 0.6);
71
+ --bk-stack-color-flat-theme: hsla(var(--bk-color-red-secondary), 0.2);
72
+ --bk-stack-color-text-theme: hsla(var(--bk-color-red-primary), 0.9);
73
+
74
+ /* Layout Component Theme */
75
+ --bk-layout-color-line-theme: hsla(var(--bk-color-red-primary), 0.6);
76
+ --bk-layout-color-flat-theme: hsla(var(--bk-color-red-secondary), 0.2);
77
+ --bk-layout-color-text-theme: hsla(var(--bk-color-red-primary), 0.9);
78
+
79
+ /* Padder Component Theme */
80
+ --bk-padder-color-theme: hsla(var(--bk-color-purple-primary), 0.6);
81
+ }
82
+
83
+ /* ───────────────────────────────────────────────────────
84
+ Dark Theme
85
+ - Inverts Primary/Secondary relationships
86
+ - Adjusts alpha values for better contrast
87
+ ─────────────────────────────────────────────────────── */
88
+
89
+ @media (prefers-color-scheme: dark) {
90
+ :root {
91
+ /* Neutral Colors - Dark */
92
+ --bk-color-black-primary: 0, 10%, 30%; /* #544545 */
93
+ --bk-color-black-secondary: 0, 0%, 10%; /* #1A1A1A */
94
+ --bk-color-white-primary: 0, 0%, 90%; /* #E6E6E6 */
95
+ --bk-color-white-secondary: 0, 100%, 90%; /* #FFCCCC */
96
+
97
+ /* Brand Colors - Dark */
98
+ --bk-color-pink-primary: 260, 100%, 70%; /* #9966FF */
99
+ --bk-color-pink-secondary: 300, 60%, 40%; /* #A329A3 */
100
+ --bk-color-purple-primary: 230, 100%, 70%; /* #6680FF */
101
+ --bk-color-purple-secondary: 270, 60%, 40%; /* #6629A3 */
102
+ --bk-color-blue-primary: 200, 100%, 70%; /* #66CCFF */
103
+ --bk-color-blue-secondary: 240, 60%, 40%; /* #2929A3 */
104
+
105
+ /* Supporting Colors - Dark */
106
+ --bk-color-cyan-primary: 160, 100%, 70%; /* #66FFCC */
107
+ --bk-color-cyan-secondary: 200, 60%, 40%; /* #297AA3 */
108
+ --bk-color-green-primary: 110, 100%, 70%; /* #80FF66 */
109
+ --bk-color-green-secondary: 160, 60%, 40%; /* #29A37A */
110
+ --bk-color-yellow-primary: 70, 100%, 70%; /* #A36629 */
111
+ --bk-color-yellow-secondary: 30, 60%, 40%; /* #A36629 */
112
+ --bk-color-orange-primary: 30, 100%, 70%; /* #FFB266 */
113
+ --bk-color-orange-secondary: 10, 60%, 40%; /* #A33D29 */
114
+ --bk-color-red-primary: 0, 100%, 70%; /* #FF6666 */
115
+ --bk-color-red-secondary: 330, 60%, 40%; /* #A32966 */
116
+
117
+ /* Component Theme Overrides - Dark */
118
+ --bk-baseline-color-line-theme: hsla(var(--bk-color-white-primary), 0.1);
119
+ --bk-baseline-color-flat-theme: hsla(var(--bk-color-white-secondary), 0.2);
120
+
121
+ --bk-box-color-line-theme: hsla(var(--bk-color-pink-primary), 0.6);
122
+ --bk-box-color-flat-theme: hsla(var(--bk-color-pink-secondary), 0.3);
123
+ --bk-box-color-text-theme: hsla(var(--bk-color-pink-primary), 0.9);
124
+
125
+ --bk-guide-color-line-theme: hsla(var(--bk-color-white-primary), 0.1);
126
+ --bk-guide-color-pattern-theme: hsla(var(--bk-color-purple-secondary), 0.25);
127
+ --bk-guide-color-auto-theme: hsla(var(--bk-color-blue-secondary), 0.2);
128
+ --bk-guide-color-fixed-theme: hsla(var(--bk-color-blue-secondary), 0.2);
129
+
130
+ --bk-stack-color-line-theme: hsla(var(--bk-color-red-primary), 0.6);
131
+ --bk-stack-color-flat-theme: hsla(var(--bk-color-red-secondary), 0.3);
132
+ --bk-stack-color-text-theme: hsla(var(--bk-color-red-primary), 0.9);
133
+
134
+ --bk-layout-color-line-theme: hsla(var(--bk-color-red-primary), 0.6);
135
+ --bk-layout-color-flat-theme: hsla(var(--bk-color-red-secondary), 0.3);
136
+ --bk-layout-color-text-theme: hsla(var(--bk-color-red-primary), 0.9);
137
+
138
+ --bk-spacer-color-line-theme: hsla(var(--bk-color-purple-primary), 0.7);
139
+ --bk-spacer-color-flat-theme: hsla(var(--bk-color-purple-secondary), 0.3);
140
+ --bk-spacer-color-text-theme: hsla(var(--bk-color-purple-primary), 1);
141
+ }
142
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @file Theme Entry Point
3
+ * @description Clean import path for theme CSS styles
4
+ * @module baseline-kit/theme
5
+ */
6
+ import './components/styles/theme.css';
@@ -1,8 +1,3 @@
1
- /**
2
- * @file convert.ts
3
- * @description Unit conversion and dimension calculation utilities
4
- * @module utils
5
- */
6
1
  export interface ConversionContext {
7
2
  /** Parent element dimension for relative units */
8
3
  parentSize?: number;
@@ -22,25 +17,8 @@ export declare const RELATIVE_UNITS: string[];
22
17
  /**
23
18
  * Converts CSS values to pixels.
24
19
  *
25
- * @remarks
26
- * Handles conversion of:
27
- * - Absolute units (px, in, cm, mm, pt, pc)
28
- * - Relative units (em, rem, vh, vw, vmin, vmax, %)
29
- * - Number values (treated as pixels)
30
- *
31
20
  * @param value - CSS value to convert
32
21
  * @param context - Optional context for relative unit conversion
33
22
  * @returns Value in pixels or null if conversion fails
34
- *
35
- * @example
36
- * ```ts
37
- * // Absolute units
38
- * convertValue('100px') // => 100
39
- * convertValue('1in') // => 96
40
- *
41
- * // Relative units with context
42
- * convertValue('50%', { parentSize: 200 }) // => 100
43
- * convertValue('2em', { parentFontSize: 16 }) // => 32
44
- * ```
45
23
  */
46
24
  export declare function convertValue(value: number | string | undefined, context?: ConversionContext): number | null;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @file grid.ts
3
+ * @description Grid layout utilities
4
+ * @module utils
5
+ */
6
+ import * as React from 'react';
7
+ /**
8
+ * Creates grid span styles based on span props.
9
+ * Handles both combined span and individual col/row span values.
10
+ *
11
+ * @param span - Optional equal span for both rows and columns
12
+ * @param colSpan - Optional column span value
13
+ * @param rowSpan - Optional row span value
14
+ * @returns CSS properties object with grid span values
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * createGridSpanStyles(2) // => { gridColumn: "span 2", gridRow: "span 2" }
19
+ * createGridSpanStyles(undefined, 3, 2) // => { gridColumn: "span 3", gridRow: "span 2" }
20
+ * ```
21
+ */
22
+ export declare const createGridSpanStyles: (span?: number, colSpan?: number, rowSpan?: number) => React.CSSProperties;
@@ -8,6 +8,8 @@ export * from './math';
8
8
  export * from './normalize';
9
9
  export * from './padding';
10
10
  export * from './snapping';
11
+ export * from './grid';
11
12
  export * from './merge';
12
13
  export * from './parse';
13
14
  export * from './timing';
15
+ export * from './ssr';
@@ -1,28 +1,10 @@
1
- /**
2
- * @file math.ts
3
- * @description Mathematical calculation utilities
4
- * @module utils
5
- */
6
1
  /**
7
2
  * Calculates the modulo (remainder) of a CSS value when divided by a base unit.
8
3
  *
9
- * @remarks
10
- * Useful for:
11
- * - Baseline grid alignment
12
- * - Spacing calculations
13
- * - Grid fitting
14
- *
15
4
  * @param value - Input value (number or CSS string)
16
5
  * @param base - Base unit to calculate remainder against
17
6
  * @param options - Optional calculation controls
18
7
  * @returns Remainder in pixel units (e.g., "6px")
19
- *
20
- * @example
21
- * ```ts
22
- * moduloize(14, 8) // => "6px"
23
- * moduloize('14px', 8) // => "6px"
24
- * moduloize(14.3, 8, { round: false }) // => "6.3px"
25
- * ```
26
8
  */
27
9
  export declare function moduloize(value: number | string | undefined, base: number, options?: {
28
10
  round?: boolean;
@@ -34,31 +16,33 @@ export declare function moduloize(value: number | string | undefined, base: numb
34
16
  * @param min - Minimum allowed value
35
17
  * @param max - Maximum allowed value
36
18
  * @returns Clamped value
37
- *
38
- * @example
39
- * ```ts
40
- * clamp(5, 0, 10) // => 5
41
- * clamp(-5, 0, 10) // => 0
42
- * clamp(15, 0, 10) // => 10
43
- * ```
44
19
  */
45
20
  export declare function clamp(value: number, min: number, max: number): number;
46
21
  /**
47
22
  * Rounds a number to specified precision.
48
23
  *
49
- * @remarks
50
- * Supports:
51
- * - Positive precision (decimal places)
52
- * - Negative precision (powers of 10)
53
- *
54
24
  * @param value - Number to round
55
25
  * @param precision - Decimal places (default: 0)
56
26
  * @returns Rounded number
57
- *
58
- * @example
59
- * ```ts
60
- * round(1.234, 2) // => 1.23
61
- * round(123.4, -1) // => 120
62
- * ```
63
27
  */
64
28
  export declare function round(value: number, precision?: number): number;
29
+ /** Parameters for row count calculation */
30
+ type RowCountParams = {
31
+ /** Available height for the container */
32
+ height?: number;
33
+ /** Top padding/offset value */
34
+ top: number;
35
+ /** Bottom padding/offset value */
36
+ bottom: number;
37
+ /** Base unit for calculations */
38
+ base: number;
39
+ };
40
+ /**
41
+ * Calculates the number of rows that fit in the available space.
42
+ * Ensures at least one row is always returned.
43
+ *
44
+ * @param params - Parameters for calculation
45
+ * @returns Number of rows that fit in the space
46
+ */
47
+ export declare function calculateRowCount(params: RowCountParams): number;
48
+ export {};
@@ -1,8 +1,3 @@
1
- /**
2
- * @file merge.ts
3
- * @description Style and class merging utilities
4
- * @module utils
5
- */
6
1
  import * as React from 'react';
7
2
  /**
8
3
  * Combines class names, filtering out falsy values.
@@ -66,3 +61,57 @@ export declare const mergeStyles: <T extends React.CSSProperties>(...styles: Arr
66
61
  * ```
67
62
  */
68
63
  export declare function mergeRefs<T>(...refs: Array<React.Ref<T> | null | undefined>): React.RefCallback<T>;
64
+ /**
65
+ * Parameters for creating a style override
66
+ */
67
+ export type StyleOverrideParams = {
68
+ /** CSS variable key to potentially override */
69
+ key: string;
70
+ /** Value to use if override is needed */
71
+ value: string;
72
+ /** Default styles to compare against */
73
+ defaultStyles: Record<string, string>;
74
+ /** Special case dimensions that should be skipped for specific values */
75
+ skipDimensions?: {
76
+ /** Dimensions that should be skipped when they're set to "fit-content" */
77
+ fitContent?: string[];
78
+ /** Dimensions that should be skipped when they're set to "auto" */
79
+ auto?: string[];
80
+ /** Dimensions that should be skipped when they're set to % values (like "100%") */
81
+ fullSize?: string[];
82
+ };
83
+ };
84
+ /**
85
+ * Creates style overrides for CSS variables, conditionally based on comparison to defaults.
86
+ * Only applies overrides when the value differs from the default, optimizing style objects.
87
+ *
88
+ * @param params - Style override parameters or individual arguments
89
+ * @param value
90
+ * @param defaultStyles
91
+ * @returns Style object with override (if needed)
92
+ *
93
+ * @example
94
+ * ```ts
95
+ * // Object parameter style:
96
+ * createStyleOverride({
97
+ * key: '--color',
98
+ * value: 'red',
99
+ * defaultStyles: { '--color': 'blue' }
100
+ * })
101
+ * // => { '--color': 'red' }
102
+ *
103
+ * // With dimension skipping:
104
+ * createStyleOverride({
105
+ * key: '--width',
106
+ * value: 'fit-content',
107
+ * defaultStyles: { '--width': 'auto' },
108
+ * skipDimensions: { fitContent: ['--width', '--height'] }
109
+ * })
110
+ * // => {}
111
+ *
112
+ * // Legacy style with separate arguments:
113
+ * createStyleOverride('--color', 'red', { '--color': 'blue' })
114
+ * // => { '--color': 'red' }
115
+ * ```
116
+ */
117
+ export declare function createStyleOverride(params: StyleOverrideParams | string, value?: string, defaultStyles?: Record<string, string>): Record<string, string | number>;