@soul-refiner/design-system 2.14.152 → 2.14.153

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.
@@ -1 +1 @@
1
- "use strict";exports.fluidFontSize={100:"clamp(3rem, 3.906vw, 6.25rem)",80:"clamp(2.5rem, 3.125vw, 5rem)",64:"clamp(2rem, 2.5vw, 4rem)",56:"clamp(1.75rem, 2.1875vw, 3.5rem)",48:"clamp(1.5rem, 1.875vw, 3rem)",40:"clamp(1.25rem, 1.5625vw, 2.5rem)",36:"clamp(1.375rem, 1.406vw, 2.25rem)",32:"clamp(1.25rem, 1.25vw, 2rem)",28:"clamp(1.125rem, 1.094vw, 1.75rem)",24:"clamp(1rem, 0.9375vw, 1.5rem)",20:"clamp(0.875rem, 0.781vw, 1.25rem)",18:"clamp(0.75rem, 0.703vw, 1.125rem)",16:"clamp(0.875rem, 0.625vw, 1rem)",14:"clamp(0.8125rem, 0.547vw, 0.875rem)",12:"clamp(0.75rem, 0.469vw, 0.8125rem)",11:"clamp(0.625rem, 0.43vw, 0.6875rem)",10:"clamp(0.5625rem, 0.391vw, 0.625rem)"};
1
+ "use strict";const m={100:"clamp(3rem, 3.906vw, 6.25rem)",80:"clamp(2.5rem, 3.125vw, 5rem)",64:"clamp(2rem, 2.5vw, 4rem)",56:"clamp(1.75rem, 2.1875vw, 3.5rem)",48:"clamp(1.5rem, 1.875vw, 3rem)",40:"clamp(1.25rem, 1.5625vw, 2.5rem)",36:"clamp(1.375rem, 1.406vw, 2.25rem)",32:"clamp(1.25rem, 1.25vw, 2rem)",28:"clamp(1.125rem, 1.094vw, 1.75rem)",24:"clamp(1rem, 0.9375vw, 1.5rem)",20:"clamp(0.875rem, 0.781vw, 1.25rem)",18:"clamp(0.75rem, 0.703vw, 1.125rem)",16:"clamp(0.875rem, 0.625vw, 1rem)",14:"clamp(0.8125rem, 0.547vw, 0.875rem)",12:"clamp(0.75rem, 0.469vw, 0.8125rem)",11:"clamp(0.625rem, 0.43vw, 0.6875rem)",10:"clamp(0.5625rem, 0.391vw, 0.625rem)"},e=(m,e=2560,r)=>{const l=+(m/16).toFixed(4);return`clamp(${void 0!==r?+(r/16).toFixed(4):+(m/2/16).toFixed(4)}rem, ${+(m/e*100).toFixed(3)}vw, ${l}rem)`};exports.computeFluidClamp=e,exports.fluidFontSize=m,exports.resolveFluidFontSize=r=>m[r]??e(r);
@@ -18,7 +18,7 @@
18
18
  `,t.padding=e.css`
19
19
  padding: ${({$padding:e})=>e&&"number"==typeof e?`${e}px;`:e&&"string"==typeof e&&e.includes("px")?e:e&&"string"==typeof e?`var(--${e});`:"0px"};
20
20
  `,t.styleable=e.css`
21
- ${({sx:e})=>r.processSx(e)}
21
+ ${({sx:e,$fluid:o})=>r.processSx(e,{fluid:o})}
22
22
  `,t.textClamp=e.css`
23
23
  overflow: hidden;
24
24
  text-overflow: ellipsis;
package/dist/common/sx.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e=require("./media.js");const o=new Set(["opacity","zIndex","fontWeight","lineHeight","flex","flexGrow","flexShrink","order","orphans","widows","zoom","fillOpacity","strokeOpacity","strokeWidth","tabSize","columnCount","aspectRatio"]),t=e=>e.replace(/[A-Z]+/g,(e,o)=>(o>0?"-":"")+e.toLowerCase()),n=(e,t)=>"number"!=typeof t||o.has(e)?`${t}`:`${t}px`;exports.processSx=o=>{if(!o)return"";if("string"==typeof o)return o;const r=[],i={};for(const[s,a]of Object.entries(o)){const o=t(s);if("object"==typeof a&&null!==a){const t=a;for(const r of e.breakpointAliasOrder)void 0!==t[r]&&(i[r]||(i[r]=[]),i[r].push(`${o}: ${n(s,t[r])};`))}else r.push(`${o}: ${n(s,a)};`)}const s=[...e.breakpointAliasOrder].reverse().filter(e=>i[e]?.length).map(o=>`@media (max-width: ${e.breakpointAliases[o]}px) {\n ${i[o].join("\n ")}\n}`).join("\n");return[r.join("\n"),s].filter(Boolean).join("\n")};
1
+ "use strict";var e=require("./media.js"),o=require("./fluid-typography.js");const t=new Set(["opacity","zIndex","fontWeight","flex","flexGrow","flexShrink","order","orphans","widows","zoom","fillOpacity","strokeOpacity","strokeWidth","tabSize","columnCount","aspectRatio"]),r=e=>e.replace(/[A-Z]+/g,(e,o)=>(o>0?"-":"")+e.toLowerCase()),i=(e,r,i,n,s)=>i&&"fontSize"===e&&"number"==typeof r?void 0!==n?o.computeFluidClamp(r,n,s):o.resolveFluidFontSize(r):"number"!=typeof r||t.has(e)?`${r}`:`${r}px`;exports.processSx=(o,t={})=>{if(!o)return"";if("string"==typeof o)return o;const n=t.fluid??!1,s=[],a={};for(const[t,l]of Object.entries(o)){const o=r(t);if("object"==typeof l&&null!==l){const r=l,s={};if(n&&"fontSize"===t)for(let o=0;o<e.breakpointAliasOrder.length;o++){const t=e.breakpointAliasOrder[o];if("number"==typeof r[t])for(let i=o-1;i>=0;i--){const o=e.breakpointAliasOrder[i];if(void 0===r[o])continue;const n=parseFloat(`${r[o]}`);isNaN(n)||(s[t]=n);break}}for(const l of e.breakpointAliasOrder)void 0!==r[l]&&(a[l]||(a[l]=[]),a[l].push(`${o}: ${i(t,r[l],n,e.breakpointAliases[l],s[l])};`))}else s.push(`${o}: ${i(t,l,n)};`)}const l=[...e.breakpointAliasOrder].reverse().filter(e=>a[e]?.length).map(o=>`@media (max-width: ${e.breakpointAliases[o]}px) {\n ${a[o].join("\n ")}\n}`).join("\n");return[s.join("\n"),l].filter(Boolean).join("\n")};
@@ -6,6 +6,21 @@
6
6
  * clamp(min-rem, preferred-vw, max-rem)
7
7
  *
8
8
  * Components opt in via the `$fluid` prop.
9
+ *
10
+ * Calibrated to a 2560px max viewport: preferred-vw = maxPx / 2560 * 100.
11
+ * The font hits its maximum size at 2560px and scales down smoothly from there.
9
12
  */
10
13
  export declare const fluidFontSize: Partial<Record<number, string>>;
14
+ /**
15
+ * Computes a fluid clamp() expression for arbitrary px font sizes.
16
+ * Fallback for sizes not in the fluidFontSize lookup table.
17
+ * maxViewport defaults to 2560px; pass a breakpoint px value to recalibrate
18
+ * so the font hits its maximum at that viewport width instead.
19
+ */
20
+ export declare const computeFluidClamp: (maxPx: number, maxViewport?: number, minPx?: number) => string;
21
+ /**
22
+ * Returns the fluid clamp() for a given px font size.
23
+ * Prefers the calibrated lookup table; falls back to computeFluidClamp.
24
+ */
25
+ export declare const resolveFluidFontSize: (px: number) => string;
11
26
  //# sourceMappingURL=fluid-typography.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fluid-typography.d.ts","sourceRoot":"","sources":["../../../src/common/fluid-typography.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAqBzD,CAAC"}
1
+ {"version":3,"file":"fluid-typography.d.ts","sourceRoot":"","sources":["../../../src/common/fluid-typography.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAqBzD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,UACrB,MAAM,gCAEL,MAAM,KACb,MAQF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,OAAQ,MAAM,KAAG,MACN,CAAC"}
@@ -17,7 +17,9 @@ export declare namespace Styles {
17
17
  const flex: import("styled-components").RuleSet<Flex>;
18
18
  const margin: import("styled-components").RuleSet<Margin>;
19
19
  const padding: import("styled-components").RuleSet<Padding>;
20
- const styleable: import("styled-components").RuleSet<Styleable>;
20
+ const styleable: import("styled-components").RuleSet<Styleable & {
21
+ $fluid?: boolean;
22
+ }>;
21
23
  const textClamp: import("styled-components").RuleSet<TextClamp>;
22
24
  const typography: import("styled-components").RuleSet<TypographyStyle>;
23
25
  const weight: import("styled-components").RuleSet<TypographyWeight>;
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/common/styles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qBAAqB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAyBvD,yBAAiB,MAAM,CAAC;IACf,MAAM,eAAe,sDAG3B,CAAC;IAEK,MAAM,YAAY,mDAGxB,CAAC;IAEK,MAAM,KAAK,4CAGjB,CAAC;IAEK,MAAM,SAAS,gDAGrB,CAAC;IAEK,MAAM,IAAI,2CAYhB,CAAC;IAEK,MAAM,MAAM,6CAOlB,CAAC;IAEK,MAAM,OAAO,8CASnB,CAAC;IAEK,MAAM,SAAS;iBAA8B,OAAO;MAE1D,CAAC;IAEK,MAAM,SAAS,gDAOrB,CAAC;IAEK,MAAM,UAAU,sDAItB,CAAC;IAEK,MAAM,MAAM,uDAGlB,CAAC;CACH"}
@@ -29,6 +29,9 @@ export type SxObject = {
29
29
  * Media queries are emitted largest-to-smallest so each smaller breakpoint
30
30
  * correctly overrides the larger one in the cascade.
31
31
  */
32
- export declare const processSx: (sx: SxObject | string | undefined) => string;
32
+ export interface ProcessSxOptions {
33
+ fluid?: boolean;
34
+ }
35
+ export declare const processSx: (sx: SxObject | string | undefined, options?: ProcessSxOptions) => string;
33
36
  export {};
34
37
  //# sourceMappingURL=sx.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sx.d.ts","sourceRoot":"","sources":["../../../src/common/sx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEL,eAAe,EAEhB,MAAM,SAAS,CAAC;AAEjB,KAAK,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAChC,KAAK,eAAe,GAAG,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC;AAE7E,MAAM,MAAM,QAAQ,GAAG;KACpB,CAAC,IAAI,MAAM,KAAK,CAAC,aAAa,CAAC,CAAC,EAAE,eAAe;CACnD,CAAC;AAkCF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,SAAS,OAAQ,QAAQ,GAAG,MAAM,GAAG,SAAS,KAAG,MAuC7D,CAAC"}
1
+ {"version":3,"file":"sx.d.ts","sourceRoot":"","sources":["../../../src/common/sx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEL,eAAe,EAEhB,MAAM,SAAS,CAAC;AAGjB,KAAK,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAChC,KAAK,eAAe,GAAG,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC;AAE7E,MAAM,MAAM,QAAQ,GAAG;KACpB,CAAC,IAAI,MAAM,KAAK,CAAC,aAAa,CAAC,CAAC,EAAE,eAAe;CACnD,CAAC;AA6CF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,SAAS,OAChB,QAAQ,GAAG,MAAM,GAAG,SAAS,YACxB,gBAAgB,KACxB,MAiEF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soul-refiner/design-system",
3
- "version": "2.14.152",
3
+ "version": "2.14.153",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "license": "MIT",