@cyclone-ui/helpers 0.3.23 → 0.3.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/form-control.cjs +1 -1
- package/dist/form-control.d.cts +3 -5
- package/dist/form-control.d.cts.map +1 -1
- package/dist/form-control.d.mts +3 -5
- package/dist/form-control.mjs +1 -1
- package/dist/form-control.mjs.map +1 -1
- package/dist/form-size.cjs +1 -1
- package/dist/form-size.d.cts +4 -6
- package/dist/form-size.d.cts.map +1 -1
- package/dist/form-size.d.mts +4 -6
- package/dist/form-size.mjs +1 -1
- package/dist/get-button-sized.d.cts +2 -4
- package/dist/get-button-sized.d.cts.map +1 -1
- package/dist/get-button-sized.d.mts +2 -4
- package/dist/get-colors.d.cts +1 -3
- package/dist/get-colors.d.cts.map +1 -1
- package/dist/get-colors.d.mts +1 -3
- package/dist/get-font-sized-DAeZVq9b.d.cts +36 -0
- package/dist/get-font-sized-DAeZVq9b.d.cts.map +1 -0
- package/dist/get-font-sized-gVvWHF-f.d.mts +36 -0
- package/dist/get-font-sized-gVvWHF-f.d.mts.map +1 -0
- package/dist/get-font-sized.cjs +1 -1
- package/dist/get-font-sized.d.cts +2 -2
- package/dist/get-font-sized.d.mts +2 -2
- package/dist/get-font-sized.mjs +1 -1
- package/dist/get-font-sized.mjs.map +1 -1
- package/dist/get-nearest-token.d.cts +0 -2
- package/dist/get-nearest-token.d.cts.map +1 -1
- package/dist/get-nearest-token.d.mts +0 -2
- package/dist/get-sized.d.cts +1 -3
- package/dist/get-sized.d.cts.map +1 -1
- package/dist/get-sized.d.mts +1 -3
- package/dist/get-token-relative.d.cts +0 -2
- package/dist/get-token-relative.d.cts.map +1 -1
- package/dist/get-token-relative.d.mts +0 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +1 -1
- package/dist/{token-value-sAa1meMz.d.cts → token-value-DiDl_5h7.d.cts} +1 -3
- package/dist/token-value-DiDl_5h7.d.cts.map +1 -0
- package/dist/{token-value-sAa1meMz.d.mts → token-value-DiDl_5h7.d.mts} +1 -3
- package/dist/token-value-DiDl_5h7.d.mts.map +1 -0
- package/dist/token-value.d.cts +1 -1
- package/dist/token-value.d.mts +1 -1
- package/dist/{types-VwCaLyLv.d.cts → types-jnp_CvAO.d.cts} +3 -4
- package/dist/types-jnp_CvAO.d.cts.map +1 -0
- package/dist/{types-VwCaLyLv.d.mts → types-jnp_CvAO.d.mts} +3 -4
- package/dist/types-jnp_CvAO.d.mts.map +1 -0
- package/dist/types.d.cts +2 -2
- package/dist/types.d.mts +2 -2
- package/package.json +6 -6
- package/dist/get-font-sized-BOOkb_Zr.d.cts +0 -28
- package/dist/get-font-sized-BOOkb_Zr.d.cts.map +0 -1
- package/dist/get-font-sized-Bouwk_EY.d.mts +0 -28
- package/dist/get-font-sized-Bouwk_EY.d.mts.map +0 -1
- package/dist/token-value-sAa1meMz.d.cts.map +0 -1
- package/dist/token-value-sAa1meMz.d.mts.map +0 -1
- package/dist/types-VwCaLyLv.d.cts.map +0 -1
- package/dist/types-VwCaLyLv.d.mts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog for Cyclone UI - Helpers
|
|
4
4
|
|
|
5
|
+
## [0.3.25](https://github.com/storm-software/cyclone-ui/releases/tag/helpers%400.3.25) (10/22/2026)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- **tokens:** Update token structure to better allow customizations ([7f23eb61](https://github.com/storm-software/cyclone-ui/commit/7f23eb61))
|
|
10
|
+
|
|
5
11
|
## [0.3.17](https://github.com/storm-software/cyclone-ui/releases/tag/helpers%400.3.17) (10/14/2026)
|
|
6
12
|
|
|
7
13
|
### Features
|
package/dist/form-control.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./form-size.cjs"),t=require("./get-sized.cjs");let n=require("@tamagui/core"),r=require("react"),i=require("react/jsx-runtime");const a=(0,r.createContext)(void 0),o=()=>(0,r.use)(a),s=e=>{let t=o()?.setLabelDefaults;(0,r.useLayoutEffect)(()=>{if(t)return t(e),()=>t(void 0)},[e,t])},c=e=>{let t=o()?.setControlOptions;(0,r.useLayoutEffect)(()=>{if(t)return t(e),()=>t(void 0)},[e,t])},l=Symbol(`field-placeholder-unset`),u=(e=l)=>{let t=o(),n=t?.setHasPlaceholder,i=e===l?l:!!e;return(0,r.useLayoutEffect)(()=>{if(i!==l&&n)return n(i),()=>n(!1)},[i,n]),t?.variant??`outlined`},d=()=>o()?.hasStartIcon??!1,f=()=>o()?.hasValidationMessage??!1,p=()=>{let e=o();return e?.labelVariant===`floating`?e.variant===`outlined`?`border`:`inset`:void 0},m=(t,n)=>t?t===`border`?3:13*e.getFormSizeScale(n):0,h=e=>e!=null&&e!==``,g=e=>{let t=o();return t?.labelVariant!==`floating`||!h(e)&&!!t.focused},_=e=>{let t=o();return(e??t?.labelVariant)===`floating`&&(h(t?.formattedValue)||!!t?.focused)},v=()=>{let e=o(),t=e?.disabled,n=e?.focused,r=e?.theme,i=(!r||r===`base`)&&!e?.hasValidationMessage,a=e?.hasValidationMessage,s=a?`primary`:`outline`,c=a?`
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./form-size.cjs"),t=require("./get-sized.cjs");let n=require("@tamagui/core"),r=require("react"),i=require("react/jsx-runtime");const a=(0,r.createContext)(void 0),o=()=>(0,r.use)(a),s=e=>{let t=o()?.setLabelDefaults;(0,r.useLayoutEffect)(()=>{if(t)return t(e),()=>t(void 0)},[e,t])},c=e=>{let t=o()?.setControlOptions;(0,r.useLayoutEffect)(()=>{if(t)return t(e),()=>t(void 0)},[e,t])},l=Symbol(`field-placeholder-unset`),u=(e=l)=>{let t=o(),n=t?.setHasPlaceholder,i=e===l?l:!!e;return(0,r.useLayoutEffect)(()=>{if(i!==l&&n)return n(i),()=>n(!1)},[i,n]),t?.variant??`outlined`},d=()=>o()?.hasStartIcon??!1,f=()=>o()?.hasValidationMessage??!1,p=()=>{let e=o();return e?.labelVariant===`floating`?e.variant===`outlined`?`border`:`inset`:void 0},m=(t,n)=>t?t===`border`?3:13*e.getFormSizeScale(n):0,h=e=>e!=null&&e!==``,g=e=>{let t=o();return t?.labelVariant!==`floating`||!h(e)&&!!t.focused},_=e=>{let t=o();return(e??t?.labelVariant)===`floating`&&(h(t?.formattedValue)||!!t?.focused)},v=()=>{let e=o(),t=e?.disabled,n=e?.focused,r=e?.theme,i=(!r||r===`base`)&&!e?.hasValidationMessage,a=e?.hasValidationMessage,s=a?`primary`:`outline`,c=a?`primary-active`:`outline-active`,l=a?`primary-hovered`:`outline-hovered`,u=a?`primary-disabled`:`outline-disabled`;return{iconColor:t?u:n?c:s,hoverIconColor:t?u:n?c:l,isNeutral:i}},y=(0,n.styled)(n.View,{displayName:`FieldNotchedOutline`,render:`fieldset`,transition:`200ms`,position:`absolute`,top:0,right:0,bottom:0,left:0,margin:0,padding:0,minWidth:0,borderWidth:1,borderStyle:`solid`,borderRadius:`control`,pointerEvents:`none`}),b=(0,n.styled)(n.View,{displayName:`FieldNotchedOutline`,render:`legend`,width:0,height:0,padding:0,overflow:`hidden`}),x=(0,n.createStyledHOC)(y,(a,s)=>{let c=o(),l=c?.labelContentRef,u=c?.labelVariant,d=c?.size,f=(0,r.useRef)(null),p=(0,r.useRef)(null),m=(0,n.useComposedRefs)(s,f),h=t.getSpaced(`sm`)*e.getFormSizeScale(d);return(0,r.useLayoutEffect)(()=>{let e=f.current,t=p.current,n=l?.current;if(!e||!t||!n||u!==`floating`)return;let r=()=>{let r=e.getBoundingClientRect(),i=n.getBoundingClientRect(),a=i.height>0?Math.min(1,Math.max(0,(r.top-i.top)/(i.height*.2))):0;t.style.marginLeft=`${Math.max(0,i.left-r.left-h)}px`,t.style.width=`${(i.width+h*2)*a}px`};if(r(),typeof ResizeObserver>`u`)return;let i=new ResizeObserver(r);return i.observe(e),i.observe(n),()=>i.disconnect()},[h,l,u]),/* @__PURE__ */ (0,i.jsx)(y,{ref:m,"aria-hidden":!0,...a,children:/* @__PURE__ */ (0,i.jsx)(b,{ref:p})})},{displayName:`FieldNotchedOutline`});exports.FieldNotchedOutline=x,exports.FormControlContext=a,exports.getFieldLabelInset=m,exports.useFieldHasStartIcon=d,exports.useFieldHasValidationMessage=f,exports.useFieldIconColor=v,exports.useFieldLabelDefaults=s,exports.useFieldLabelFloated=_,exports.useFieldLabelPlacement=p,exports.useFieldOptions=c,exports.useFieldShouldShowPlaceholder=g,exports.useFieldVariant=u,exports.useFormControl=o;
|
package/dist/form-control.d.cts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { FormControlSize } from "./form-size.cjs";
|
|
2
2
|
import { SelectOption } from "@stryke/types/form";
|
|
3
3
|
import { ValidationDetail } from "@stryke/types/validations";
|
|
4
|
-
import {
|
|
4
|
+
import { FontSizeTokens, TamaguiWebElement } from "@tamagui/core";
|
|
5
5
|
import { ReactNode, Ref, RefObject } from "react";
|
|
6
|
-
//#region src/form-control.d.ts
|
|
7
6
|
/**
|
|
8
7
|
* The field's control style (see Material UI's `TextField` variants).
|
|
9
8
|
*/
|
|
@@ -101,8 +100,8 @@ interface FieldLabelDefaults {
|
|
|
101
100
|
} | {
|
|
102
101
|
alignContent?: "center";
|
|
103
102
|
};
|
|
104
|
-
/** The font of an `inline` label, such as a smaller one for a small control. */
|
|
105
|
-
|
|
103
|
+
/** The font size of an `inline` label, such as a smaller one for a small control. */
|
|
104
|
+
inlineFontSize?: FontSizeTokens;
|
|
106
105
|
/**
|
|
107
106
|
* Where a floating label rests, for a control with leading content other
|
|
108
107
|
* than a `Field.Icon` (such as a country code trigger).
|
|
@@ -194,6 +193,5 @@ declare const useFieldIconColor: () => {
|
|
|
194
193
|
* border box, and drop the frame's own border.
|
|
195
194
|
*/
|
|
196
195
|
declare const FieldNotchedOutline: import("@tamagui/core").TamaguiComponent<import("@tamagui/core").TamaDefer, import("@tamagui/core").TamaguiElement, Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, keyof import("@tamagui/core").StackStyleBase | keyof import("@tamagui/core").RNTamaguiViewNonStyleProps> & Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, never> & Omit<import("@tamagui/core").WithThemeValues<Omit<import("@tamagui/core").StackStyleBase, never>> & import("@tamagui/core").WithFlatVariantValues<{}> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>>, keyof import("@tamagui/core").RNTamaguiViewNonStyleProps>, import("@tamagui/core").StackStyleBase, Omit<{}, keyof import("@tamagui/core").StackStyleBase | keyof import("@tamagui/core").RNTamaguiViewNonStyleProps>, import("@tamagui/core").StaticConfigPublic>;
|
|
197
|
-
//#endregion
|
|
198
196
|
export { FieldControlOptions, FieldLabelDefaults, FieldLabelPlacement, FieldLabelVariant, FieldNotchedOutline, FieldVariant, FormControlContext, FormControlState, getFieldLabelInset, useFieldHasStartIcon, useFieldHasValidationMessage, useFieldIconColor, useFieldLabelDefaults, useFieldLabelFloated, useFieldLabelPlacement, useFieldOptions, useFieldShouldShowPlaceholder, useFieldVariant, useFormControl };
|
|
199
197
|
//# sourceMappingURL=form-control.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-control.d.cts","names":[],"sources":["../src/form-control.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"form-control.d.cts","names":[],"sources":["../src/form-control.tsx"],"mappings":";;;;;;;;KAmCY;;;;;KAMA;;;;;;KAOA;;;;;;;;;;;;UAaK;;EAEf;;EAGA;;EAGA;;EAGA;;EAGA,QAAQ;EAER,OAAO;EACP;EACA;EACA;EACA;EACA;EACA;;EAGA,WAAW;;EAGX,YAAY;EACZ;EACA;;;;;EAMA,cAAc,cAAc,UAAU;;;;;EAMtC,eAAe;EAEf,SAAS;EACT,cAAc;;EAGd,eAAe;EACf,mBAAmB,eAAe;;EAGlC,oBAAoB,SAAS;EAC7B;EACA;EACA;EACA,iBAAiB,UAAU;EAC3B,kBAAkB,cAAc;EAChC,oBAAoB;EACpB;EACA;;cAGW,oCAAkB,QAAA;;;;cAOlB,sBAAc;;;;UAKV;;EAEf,UAAU;;;;;;EAOV;IAAW;;IAA4B;;;EAGvC,iBAAiB;;;;;EAMjB;;;;;;;cAQW,wBAAyB,eAAe;;;;;UAkBpC;;EAEf,YAAY;;EAGZ,WAAW;;;;;;;;;cAUA,kBAAmB,SAAS;;;;;cAoB5B,kBACX,0BACC;;;;;cAyBU;cAGA;;;;;cAOA,8BAA6B;;;;;;;;;;cAmB7B,qBACX,WAAW,iCACX,OAAO;;;;;cAWI,gCAAiC;;;;;;;cAejC,uBACX,eAAe;;;;;;;;cAkBJ;;;;;;;;;;;;;;;cA4DA,6CAAmB,yCAAA,mCAAA,gBAAA,6BAAA,0DAAA,+CAAA,8BAAA,6BAAA,qCAAA,6BAAA,gBAAA,6BAAA,kDAAA,oDAAA,uCAAA,wCAAA,gDAAA,qDAAA,gBAAA,uCAAA,+CAAA,qDAAA"}
|
package/dist/form-control.d.mts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { FormControlSize } from "./form-size.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { FontSizeTokens, TamaguiWebElement } from "@tamagui/core";
|
|
3
3
|
import { ReactNode, Ref, RefObject } from "react";
|
|
4
4
|
import { SelectOption } from "@stryke/types/form";
|
|
5
5
|
import { ValidationDetail } from "@stryke/types/validations";
|
|
6
|
-
//#region src/form-control.d.ts
|
|
7
6
|
/**
|
|
8
7
|
* The field's control style (see Material UI's `TextField` variants).
|
|
9
8
|
*/
|
|
@@ -101,8 +100,8 @@ interface FieldLabelDefaults {
|
|
|
101
100
|
} | {
|
|
102
101
|
alignContent?: "center";
|
|
103
102
|
};
|
|
104
|
-
/** The font of an `inline` label, such as a smaller one for a small control. */
|
|
105
|
-
|
|
103
|
+
/** The font size of an `inline` label, such as a smaller one for a small control. */
|
|
104
|
+
inlineFontSize?: FontSizeTokens;
|
|
106
105
|
/**
|
|
107
106
|
* Where a floating label rests, for a control with leading content other
|
|
108
107
|
* than a `Field.Icon` (such as a country code trigger).
|
|
@@ -194,6 +193,5 @@ declare const useFieldIconColor: () => {
|
|
|
194
193
|
* border box, and drop the frame's own border.
|
|
195
194
|
*/
|
|
196
195
|
declare const FieldNotchedOutline: import("@tamagui/core").TamaguiComponent<import("@tamagui/core").TamaDefer, import("@tamagui/core").TamaguiElement, Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, keyof import("@tamagui/core").StackStyleBase | keyof import("@tamagui/core").RNTamaguiViewNonStyleProps> & Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, never> & Omit<import("@tamagui/core").WithThemeValues<Omit<import("@tamagui/core").StackStyleBase, never>> & import("@tamagui/core").WithFlatVariantValues<{}> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>>, keyof import("@tamagui/core").RNTamaguiViewNonStyleProps>, import("@tamagui/core").StackStyleBase, Omit<{}, keyof import("@tamagui/core").StackStyleBase | keyof import("@tamagui/core").RNTamaguiViewNonStyleProps>, import("@tamagui/core").StaticConfigPublic>;
|
|
197
|
-
//#endregion
|
|
198
196
|
export { FieldControlOptions, FieldLabelDefaults, FieldLabelPlacement, FieldLabelVariant, FieldNotchedOutline, FieldVariant, FormControlContext, FormControlState, getFieldLabelInset, useFieldHasStartIcon, useFieldHasValidationMessage, useFieldIconColor, useFieldLabelDefaults, useFieldLabelFloated, useFieldLabelPlacement, useFieldOptions, useFieldShouldShowPlaceholder, useFieldVariant, useFormControl };
|
|
199
197
|
//# sourceMappingURL=form-control.d.mts.map
|
package/dist/form-control.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{getFormSizeScale as e}from"./form-size.mjs";import{getSpaced as t}from"./get-sized.mjs";import{View as n,createStyledHOC as r,styled as i,useComposedRefs as a}from"@tamagui/core";import{createContext as o,use as s,useLayoutEffect as c,useRef as l
|
|
1
|
+
import{getFormSizeScale as e}from"./form-size.mjs";import{getSpaced as t}from"./get-sized.mjs";import{View as n,createStyledHOC as r,styled as i,useComposedRefs as a}from"@tamagui/core";import{createContext as o,use as s,useLayoutEffect as c,useRef as l}from"react";import{jsx as u}from"react/jsx-runtime";const d=o(void 0),f=()=>s(d),p=e=>{let t=f()?.setLabelDefaults;c(()=>{if(t)return t(e),()=>t(void 0)},[e,t])},m=e=>{let t=f()?.setControlOptions;c(()=>{if(t)return t(e),()=>t(void 0)},[e,t])},h=Symbol(`field-placeholder-unset`),g=(e=h)=>{let t=f(),n=t?.setHasPlaceholder,r=e===h?h:!!e;return c(()=>{if(r!==h&&n)return n(r),()=>n(!1)},[r,n]),t?.variant??`outlined`},_=()=>f()?.hasStartIcon??!1,v=()=>f()?.hasValidationMessage??!1,y=()=>{let e=f();return e?.labelVariant===`floating`?e.variant===`outlined`?`border`:`inset`:void 0},b=(t,n)=>t?t===`border`?3:13*e(n):0,x=e=>e!=null&&e!==``,S=e=>{let t=f();return t?.labelVariant!==`floating`||!x(e)&&!!t.focused},C=e=>{let t=f();return(e??t?.labelVariant)===`floating`&&(x(t?.formattedValue)||!!t?.focused)},w=()=>{let e=f(),t=e?.disabled,n=e?.focused,r=e?.theme,i=(!r||r===`base`)&&!e?.hasValidationMessage,a=e?.hasValidationMessage,o=a?`primary`:`outline`,s=a?`primary-active`:`outline-active`,c=a?`primary-hovered`:`outline-hovered`,l=a?`primary-disabled`:`outline-disabled`;return{iconColor:t?l:n?s:o,hoverIconColor:t?l:n?s:c,isNeutral:i}},T=i(n,{displayName:`FieldNotchedOutline`,render:`fieldset`,transition:`200ms`,position:`absolute`,top:0,right:0,bottom:0,left:0,margin:0,padding:0,minWidth:0,borderWidth:1,borderStyle:`solid`,borderRadius:`control`,pointerEvents:`none`}),E=i(n,{displayName:`FieldNotchedOutline`,render:`legend`,width:0,height:0,padding:0,overflow:`hidden`}),D=r(T,(n,r)=>{let i=f(),o=i?.labelContentRef,s=i?.labelVariant,d=i?.size,p=l(null),m=l(null),h=a(r,p),g=t(`sm`)*e(d);return c(()=>{let e=p.current,t=m.current,n=o?.current;if(!e||!t||!n||s!==`floating`)return;let r=()=>{let r=e.getBoundingClientRect(),i=n.getBoundingClientRect(),a=i.height>0?Math.min(1,Math.max(0,(r.top-i.top)/(i.height*.2))):0;t.style.marginLeft=`${Math.max(0,i.left-r.left-g)}px`,t.style.width=`${(i.width+g*2)*a}px`};if(r(),typeof ResizeObserver>`u`)return;let i=new ResizeObserver(r);return i.observe(e),i.observe(n),()=>i.disconnect()},[g,o,s]),/* @__PURE__ */ u(T,{ref:h,"aria-hidden":!0,...n,children:/* @__PURE__ */ u(E,{ref:m})})},{displayName:`FieldNotchedOutline`});export{D as FieldNotchedOutline,d as FormControlContext,b as getFieldLabelInset,_ as useFieldHasStartIcon,v as useFieldHasValidationMessage,w as useFieldIconColor,p as useFieldLabelDefaults,C as useFieldLabelFloated,y as useFieldLabelPlacement,m as useFieldOptions,S as useFieldShouldShowPlaceholder,g as useFieldVariant,f as useFormControl};
|
|
2
2
|
//# sourceMappingURL=form-control.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-control.mjs","names":["FormControlContext","createContext","useFormControl","use","useFieldLabelDefaults","setLabelDefaults","useLayoutEffect","labelDefaults","useFieldOptions","setControlOptions","options","FIELD_PLACEHOLDER_UNSET","useFieldVariant","formControl","setHasPlaceholder","hasPlaceholder","placeholder","useFieldHasStartIcon","useFieldHasValidationMessage","useFieldLabelPlacement","getFieldLabelInset","placement","getFormSizeScale","size","hasFieldValue","value","useFieldShouldShowPlaceholder","useFieldLabelFloated","labelVariant","useFieldIconColor","disabled","focused","theme","isNeutral","validated","restColor","focusColor","hoverColor","disabledColor","FieldNotchedOutlineFrame","styled","View","FieldNotchedOutlineLegend","FieldNotchedOutline","createStyledHOC","labelContentRef","
|
|
1
|
+
{"version":3,"file":"form-control.mjs","names":["FormControlContext","createContext","useFormControl","use","useFieldLabelDefaults","setLabelDefaults","useLayoutEffect","labelDefaults","useFieldOptions","setControlOptions","options","FIELD_PLACEHOLDER_UNSET","useFieldVariant","formControl","setHasPlaceholder","hasPlaceholder","placeholder","useFieldHasStartIcon","useFieldHasValidationMessage","useFieldLabelPlacement","getFieldLabelInset","placement","getFormSizeScale","size","hasFieldValue","value","useFieldShouldShowPlaceholder","useFieldLabelFloated","labelVariant","useFieldIconColor","disabled","focused","theme","isNeutral","validated","restColor","focusColor","hoverColor","disabledColor","FieldNotchedOutlineFrame","styled","View","FieldNotchedOutlineLegend","FieldNotchedOutline","createStyledHOC","labelContentRef","outlineRef","useRef","legendRef","composedRef","useComposedRefs","forwardedRef","gap","getSpaced","outline","legend","label","update","outlineRect","labelRect","open","resizeObserver","props"],"sources":[],"mappings":""}
|
package/dist/form-size.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./get-font-sized.cjs");let t=require("@tamagui/core");const n={sm:`8xl`,md:`10xl`,lg:`12xl`},r={sm:`4xl`,md:`6xl`,lg:`7xl`},i=(e=`md`,t=`control`)=>(t===`compact`?r:n)[e],a=(e=`md`)=>({sm:32/42,md:1,lg:52/42})[e],o=(e=`md`)=>({sm:.875,md:1,lg:1.125})[e],s=(n,r,i=`
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./get-font-sized.cjs");let t=require("@tamagui/core");const n={sm:`8xl`,md:`10xl`,lg:`12xl`},r={sm:`4xl`,md:`6xl`,lg:`7xl`},i=(e=`md`,t=`control`)=>(t===`compact`?r:n)[e],a=(e=`md`)=>({sm:32/42,md:1,lg:52/42})[e],o=(e=`md`)=>({sm:.875,md:1,lg:1.125})[e],s=(n,r,i=`md`)=>{let a=e.getFontSized(i,r)??{};if(n===`md`)return a;let s=o(n);return{...a,...a.fontSize===void 0?{}:{fontSize:Number((0,t.getVariableValue)(a.fontSize))*s},...a.lineHeight===void 0?{}:{lineHeight:`${Number((0,t.getVariableValue)(a.lineHeight))*s}px`}}},c=e=>t.styled.dynamic((t,n)=>t===`sm`||t===`md`||t===`lg`?e(t,n):void 0);exports.formSizeVariants=c,exports.getFormFontScale=o,exports.getFormFontSize=s,exports.getFormSizeScale=a,exports.getFormSizeToken=i;
|
package/dist/form-size.d.cts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { o as StyleEnv } from "./types-jnp_CvAO.cjs";
|
|
2
|
+
import { r as getFontSized } from "./get-font-sized-DAeZVq9b.cjs";
|
|
3
3
|
import { styled } from "@tamagui/core";
|
|
4
|
-
//#region src/form-size.d.ts
|
|
5
4
|
/** The public size contract shared by form controls and field state. */
|
|
6
5
|
type FormControlSize = "sm" | "md" | "lg";
|
|
7
6
|
declare const getFormSizeToken: (size?: FormControlSize, kind?: "control" | "compact") => "8xl" | "10xl" | "12xl" | "4xl" | "6xl" | "7xl";
|
|
@@ -10,11 +9,11 @@ declare const getFormSizeScale: (size?: FormControlSize) => number;
|
|
|
10
9
|
/** Text scales more gently than control height to keep labels readable. */
|
|
11
10
|
declare const getFormFontScale: (size?: FormControlSize) => number;
|
|
12
11
|
/**
|
|
13
|
-
*
|
|
12
|
+
* Scale a font size step of the current typography role to the control size.
|
|
14
13
|
*
|
|
15
14
|
* @param size - The form control size.
|
|
16
15
|
* @param env - The `styled.dynamic` environment.
|
|
17
|
-
* @param token - The font size token
|
|
16
|
+
* @param token - The font size token used at the `md` control size.
|
|
18
17
|
* @returns The computed font size style object.
|
|
19
18
|
*/
|
|
20
19
|
declare const getFormFontSize: (size: FormControlSize, env: StyleEnv, token?: string) => ReturnType<typeof getFontSized>;
|
|
@@ -22,6 +21,5 @@ declare const getFormFontSize: (size: FormControlSize, env: StyleEnv, token?: st
|
|
|
22
21
|
type FormSizeVariant = ReturnType<typeof styled.dynamic<FormControlSize>>;
|
|
23
22
|
/** A typed dynamic variant keeps arbitrary Tamagui tokens out of the public API. */
|
|
24
23
|
declare const formSizeVariants: <T extends object>(style: (size: FormControlSize, env: StyleEnv) => T | null | undefined) => FormSizeVariant;
|
|
25
|
-
//#endregion
|
|
26
24
|
export { FormControlSize, FormSizeVariant, formSizeVariants, getFormFontScale, getFormFontSize, getFormSizeScale, getFormSizeToken };
|
|
27
25
|
//# sourceMappingURL=form-size.d.cts.map
|
package/dist/form-size.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-size.d.cts","names":[],"sources":["../src/form-size.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"form-size.d.cts","names":[],"sources":["../src/form-size.ts"],"mappings":";;;;KAuBY;cAKC,mBACX,OAAM,iBACN;;cAIW,mBAAoB,OAAM;;cAI1B,mBAAoB,OAAM;;;;;;;;;cAW1B,kBACX,MAAM,iBACN,KAAK,UACL,mBACC,kBAAkB;;KAoBT,kBAAkB,kBACrB,OAAO,QAAQ;;cAIX,mBAAoB,kBAC/B,QAAQ,MAAM,iBAAiB,KAAK,aAAa,yBAChD"}
|
package/dist/form-size.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { o as StyleEnv } from "./types-jnp_CvAO.mjs";
|
|
2
|
+
import { r as getFontSized } from "./get-font-sized-gVvWHF-f.mjs";
|
|
3
3
|
import { styled } from "@tamagui/core";
|
|
4
|
-
//#region src/form-size.d.ts
|
|
5
4
|
/** The public size contract shared by form controls and field state. */
|
|
6
5
|
type FormControlSize = "sm" | "md" | "lg";
|
|
7
6
|
declare const getFormSizeToken: (size?: FormControlSize, kind?: "control" | "compact") => "8xl" | "10xl" | "12xl" | "4xl" | "6xl" | "7xl";
|
|
@@ -10,11 +9,11 @@ declare const getFormSizeScale: (size?: FormControlSize) => number;
|
|
|
10
9
|
/** Text scales more gently than control height to keep labels readable. */
|
|
11
10
|
declare const getFormFontScale: (size?: FormControlSize) => number;
|
|
12
11
|
/**
|
|
13
|
-
*
|
|
12
|
+
* Scale a font size step of the current typography role to the control size.
|
|
14
13
|
*
|
|
15
14
|
* @param size - The form control size.
|
|
16
15
|
* @param env - The `styled.dynamic` environment.
|
|
17
|
-
* @param token - The font size token
|
|
16
|
+
* @param token - The font size token used at the `md` control size.
|
|
18
17
|
* @returns The computed font size style object.
|
|
19
18
|
*/
|
|
20
19
|
declare const getFormFontSize: (size: FormControlSize, env: StyleEnv, token?: string) => ReturnType<typeof getFontSized>;
|
|
@@ -22,6 +21,5 @@ declare const getFormFontSize: (size: FormControlSize, env: StyleEnv, token?: st
|
|
|
22
21
|
type FormSizeVariant = ReturnType<typeof styled.dynamic<FormControlSize>>;
|
|
23
22
|
/** A typed dynamic variant keeps arbitrary Tamagui tokens out of the public API. */
|
|
24
23
|
declare const formSizeVariants: <T extends object>(style: (size: FormControlSize, env: StyleEnv) => T | null | undefined) => FormSizeVariant;
|
|
25
|
-
//#endregion
|
|
26
24
|
export { FormControlSize, FormSizeVariant, formSizeVariants, getFormFontScale, getFormFontSize, getFormSizeScale, getFormSizeToken };
|
|
27
25
|
//# sourceMappingURL=form-size.d.mts.map
|
package/dist/form-size.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{getFontSized as e}from"./get-font-sized.mjs";import{getVariableValue as t,styled as n}from"@tamagui/core";const r={sm:`8xl`,md:`10xl`,lg:`12xl`},i={sm:`4xl`,md:`6xl`,lg:`7xl`},a=(e=`md`,t=`control`)=>(t===`compact`?i:r)[e],o=(e=`md`)=>({sm:32/42,md:1,lg:52/42})[e],s=(e=`md`)=>({sm:.875,md:1,lg:1.125})[e],c=(n,r,i=`
|
|
1
|
+
import{getFontSized as e}from"./get-font-sized.mjs";import{getVariableValue as t,styled as n}from"@tamagui/core";const r={sm:`8xl`,md:`10xl`,lg:`12xl`},i={sm:`4xl`,md:`6xl`,lg:`7xl`},a=(e=`md`,t=`control`)=>(t===`compact`?i:r)[e],o=(e=`md`)=>({sm:32/42,md:1,lg:52/42})[e],s=(e=`md`)=>({sm:.875,md:1,lg:1.125})[e],c=(n,r,i=`md`)=>{let a=e(i,r)??{};if(n===`md`)return a;let o=s(n);return{...a,...a.fontSize===void 0?{}:{fontSize:Number(t(a.fontSize))*o},...a.lineHeight===void 0?{}:{lineHeight:`${Number(t(a.lineHeight))*o}px`}}},l=e=>n.dynamic((t,n)=>t===`sm`||t===`md`||t===`lg`?e(t,n):void 0);export{l as formSizeVariants,s as getFormFontScale,c as getFormFontSize,o as getFormSizeScale,a as getFormSizeToken};
|
|
2
2
|
//# sourceMappingURL=form-size.mjs.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { t as TokenInput } from "./token-value-
|
|
2
|
-
import {
|
|
3
|
-
//#region src/get-button-sized.d.ts
|
|
1
|
+
import { t as TokenInput } from "./token-value-DiDl_5h7.cjs";
|
|
2
|
+
import { o as StyleEnv } from "./types-jnp_CvAO.cjs";
|
|
4
3
|
/**
|
|
5
4
|
* Get the sizing related style values for a button component based on the size token or number
|
|
6
5
|
*
|
|
@@ -25,6 +24,5 @@ declare const getButtonSized: (val: TokenInput, { tokens }?: StyleEnv, circular?
|
|
|
25
24
|
height: number;
|
|
26
25
|
minHeight: number;
|
|
27
26
|
} | undefined;
|
|
28
|
-
//#endregion
|
|
29
27
|
export { getButtonSized };
|
|
30
28
|
//# sourceMappingURL=get-button-sized.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-button-sized.d.cts","names":[],"sources":["../src/get-button-sized.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-button-sized.d.cts","names":[],"sources":["../src/get-button-sized.ts"],"mappings":";;;;;;;;;;cAiEa,iBACX,KAAK,cACL,WAAY,UACZ"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { t as TokenInput } from "./token-value-
|
|
2
|
-
import {
|
|
3
|
-
//#region src/get-button-sized.d.ts
|
|
1
|
+
import { t as TokenInput } from "./token-value-DiDl_5h7.mjs";
|
|
2
|
+
import { o as StyleEnv } from "./types-jnp_CvAO.mjs";
|
|
4
3
|
/**
|
|
5
4
|
* Get the sizing related style values for a button component based on the size token or number
|
|
6
5
|
*
|
|
@@ -25,6 +24,5 @@ declare const getButtonSized: (val: TokenInput, { tokens }?: StyleEnv, circular?
|
|
|
25
24
|
height: number;
|
|
26
25
|
minHeight: number;
|
|
27
26
|
} | undefined;
|
|
28
|
-
//#endregion
|
|
29
27
|
export { getButtonSized };
|
|
30
28
|
//# sourceMappingURL=get-button-sized.d.mts.map
|
package/dist/get-colors.d.cts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { n as ColorScientificPaletteRecord, r as ColorStylePaletteRecord } from "./types-
|
|
2
|
-
//#region src/get-colors.d.ts
|
|
1
|
+
import { n as ColorScientificPaletteRecord, r as ColorStylePaletteRecord } from "./types-jnp_CvAO.cjs";
|
|
3
2
|
declare const createScientificPalettes: (color: string) => ColorScientificPaletteRecord;
|
|
4
3
|
declare const createStylePalettes: (color: string, scale?: number) => ColorStylePaletteRecord;
|
|
5
|
-
//#endregion
|
|
6
4
|
export { createScientificPalettes, createStylePalettes };
|
|
7
5
|
//# sourceMappingURL=get-colors.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-colors.d.cts","names":[],"sources":["../src/get-colors.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-colors.d.cts","names":[],"sources":["../src/get-colors.ts"],"mappings":";cAoCa,2BACX,kBACC;cA4BU,sBACX,eACA,mBACC"}
|
package/dist/get-colors.d.mts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { n as ColorScientificPaletteRecord, r as ColorStylePaletteRecord } from "./types-
|
|
2
|
-
//#region src/get-colors.d.ts
|
|
1
|
+
import { n as ColorScientificPaletteRecord, r as ColorStylePaletteRecord } from "./types-jnp_CvAO.mjs";
|
|
3
2
|
declare const createScientificPalettes: (color: string) => ColorScientificPaletteRecord;
|
|
4
3
|
declare const createStylePalettes: (color: string, scale?: number) => ColorStylePaletteRecord;
|
|
5
|
-
//#endregion
|
|
6
4
|
export { createScientificPalettes, createStylePalettes };
|
|
7
5
|
//# sourceMappingURL=get-colors.d.mts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { t as TokenInput } from "./token-value-DiDl_5h7.cjs";
|
|
2
|
+
import { o as StyleEnv } from "./types-jnp_CvAO.cjs";
|
|
3
|
+
import { FlatStyleValue, FontSizeTokens, GetThemeValueForKey, TextStyle } from "@tamagui/core";
|
|
4
|
+
import { Mutable } from "@stryke/types/base";
|
|
5
|
+
interface GetFontWeightFromSizeOptions extends StyleEnv {
|
|
6
|
+
/**
|
|
7
|
+
* The scale factor to apply when calculating the font weight from the pixel size.
|
|
8
|
+
*
|
|
9
|
+
* @defaultValue 1
|
|
10
|
+
*/
|
|
11
|
+
scale?: number;
|
|
12
|
+
}
|
|
13
|
+
type GetFontWeightFromSizeReturn = FlatStyleValue<"unset" | GetThemeValueForKey<"fontWeight"> | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | undefined>;
|
|
14
|
+
declare const getFontWeightFromSize: (sizeTokenIn?: FontSizeTokens | TokenInput, { font, scale }?: GetFontWeightFromSizeOptions) => GetFontWeightFromSizeReturn;
|
|
15
|
+
/**
|
|
16
|
+
* Get the font size related styles
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* Call-site `color` and `fontStyle` props take precedence over the values
|
|
20
|
+
* returned here because Tamagui v3 applies call-site props above variants.
|
|
21
|
+
*
|
|
22
|
+
* @param sizeTokenIn - The size token to use
|
|
23
|
+
* @param env - The `styled.dynamic` environment
|
|
24
|
+
* @returns The font size related styles
|
|
25
|
+
*/
|
|
26
|
+
declare const getFontSized: (sizeTokenIn?: FontSizeTokens | TokenInput, env?: GetFontWeightFromSizeOptions) => Mutable<TextStyle>;
|
|
27
|
+
/**
|
|
28
|
+
* Get the font size related styles from a size token
|
|
29
|
+
*
|
|
30
|
+
* @param sizeTokenIn - The size token to use
|
|
31
|
+
* @param env - The `styled.dynamic` environment
|
|
32
|
+
* @returns The font size related styles
|
|
33
|
+
*/
|
|
34
|
+
declare const getFontSizedFromSize: (sizeTokenIn?: TokenInput, env?: StyleEnv) => Mutable<TextStyle>;
|
|
35
|
+
export { getFontWeightFromSize as a, getFontSizedFromSize as i, GetFontWeightFromSizeReturn as n, getFontSized as r, GetFontWeightFromSizeOptions as t };
|
|
36
|
+
//# sourceMappingURL=get-font-sized-DAeZVq9b.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-font-sized-DAeZVq9b.d.cts","names":[],"sources":["../src/get-font-sized.ts"],"mappings":";;;;UAkCiB,qCAAqC;;;;;;EAMpD;;KAGU,8BAA8B,yBAEtC;cAaS,wBACX,cAAa,iBAAiB,cAC9B,MAAA,UAAiB,iCAChB;;;;;;;;;;;;cAiDU,eACX,cAAa,iBAAiB,YAC9B,MAAK,iCACJ,QAAQ;;;;;;;;cAqEE,uBACX,cAAa,YACb,MAAK,aACJ,QAAQ"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { t as TokenInput } from "./token-value-DiDl_5h7.mjs";
|
|
2
|
+
import { o as StyleEnv } from "./types-jnp_CvAO.mjs";
|
|
3
|
+
import { FlatStyleValue, FontSizeTokens, GetThemeValueForKey, TextStyle } from "@tamagui/core";
|
|
4
|
+
import { Mutable } from "@stryke/types/base";
|
|
5
|
+
interface GetFontWeightFromSizeOptions extends StyleEnv {
|
|
6
|
+
/**
|
|
7
|
+
* The scale factor to apply when calculating the font weight from the pixel size.
|
|
8
|
+
*
|
|
9
|
+
* @defaultValue 1
|
|
10
|
+
*/
|
|
11
|
+
scale?: number;
|
|
12
|
+
}
|
|
13
|
+
type GetFontWeightFromSizeReturn = FlatStyleValue<"unset" | GetThemeValueForKey<"fontWeight"> | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | undefined>;
|
|
14
|
+
declare const getFontWeightFromSize: (sizeTokenIn?: FontSizeTokens | TokenInput, { font, scale }?: GetFontWeightFromSizeOptions) => GetFontWeightFromSizeReturn;
|
|
15
|
+
/**
|
|
16
|
+
* Get the font size related styles
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* Call-site `color` and `fontStyle` props take precedence over the values
|
|
20
|
+
* returned here because Tamagui v3 applies call-site props above variants.
|
|
21
|
+
*
|
|
22
|
+
* @param sizeTokenIn - The size token to use
|
|
23
|
+
* @param env - The `styled.dynamic` environment
|
|
24
|
+
* @returns The font size related styles
|
|
25
|
+
*/
|
|
26
|
+
declare const getFontSized: (sizeTokenIn?: FontSizeTokens | TokenInput, env?: GetFontWeightFromSizeOptions) => Mutable<TextStyle>;
|
|
27
|
+
/**
|
|
28
|
+
* Get the font size related styles from a size token
|
|
29
|
+
*
|
|
30
|
+
* @param sizeTokenIn - The size token to use
|
|
31
|
+
* @param env - The `styled.dynamic` environment
|
|
32
|
+
* @returns The font size related styles
|
|
33
|
+
*/
|
|
34
|
+
declare const getFontSizedFromSize: (sizeTokenIn?: TokenInput, env?: StyleEnv) => Mutable<TextStyle>;
|
|
35
|
+
export { getFontWeightFromSize as a, getFontSizedFromSize as i, GetFontWeightFromSizeReturn as n, getFontSized as r, GetFontWeightFromSizeOptions as t };
|
|
36
|
+
//# sourceMappingURL=get-font-sized-gVvWHF-f.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-font-sized-gVvWHF-f.d.mts","names":[],"sources":["../src/get-font-sized.ts"],"mappings":""}
|
package/dist/get-font-sized.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./token-value.cjs"),t=require("./get-nearest-token.cjs");let n=require("@tamagui/core"),r=require("@stryke/type-checks/is-number");const
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./token-value.cjs"),t=require("./get-nearest-token.cjs");let n=require("@tamagui/core"),r=require("@stryke/type-checks"),i=require("@stryke/type-checks/is-number");const a=(t=`true`,{font:a,scale:s}={})=>{let c=(0,r.isSetString)(t)?e.normalizeTokenValue(t):t;if((0,i.isNumber)(c))return o(c);if(!a)return;let l=String((c===`true`?u(a):c)??`true`),d=a.weight?.[l];if(d!==void 0&&Number.isFinite(Number.parseInt(d)))return Number(d);let f=Number((0,n.getVariableValue)(a.size?.[l]));return Number.isFinite(f)?o(f,s):void 0},o=(e,t=1)=>Math.min(700,Math.max(300,Math.round((400+(e-16)*12.5*t)/100)*100)),s=(t=`true`,n={})=>{let{font:r,fontFamily:o}=n,s=e.normalizeTokenValue(t);if(!r)return{fontSize:s};if((0,i.isNumber)(s))return{fontFamily:o,fontSize:s};let c=String((s===`true`?u(r):s)??`true`),l={},d=e=>e?.[c],f=d(r.size),p=d(r.lineHeight),m=d(r.letterSpacing),h=d(r.transform),g=d(r.style),_=d(r.color);return g&&(l.fontStyle=g),h&&(l.textTransform=h),o&&(l.fontFamily=o),m&&(l.letterSpacing=m),f&&(l.fontWeight=a(f,n),l.fontSize=f),p&&(l.lineHeight=p),_&&(l.color=_),l.fontWeight??=500,l},c=(n=`true`,r={})=>{let a=r.font,o=e.normalizeTokenValue(n);if(!a)return{fontSize:o};let c=(0,i.isNumber)(o)?t.getNearestToken(o,`size`):o;return s(c,r)},l=/* @__PURE__ */ new WeakMap;function u(e){if(typeof e==`object`&&l.has(e))return l.get(e);let t=`true`in e.size?e.size:(0,n.getTokens)().size,r=t.true,i=r?Object.keys(t).find(e=>e!==`true`&&t[e].val===r.val):null;return!r||!i?`sm`in e.size?`sm`:Object.keys(e.size)[3]:(l.set(e,i),i)}exports.getFontSized=s,exports.getFontSizedFromSize=c,exports.getFontWeightFromSize=a;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { getFontSized, getFontSizedFromSize };
|
|
1
|
+
import { a as getFontWeightFromSize, i as getFontSizedFromSize, n as GetFontWeightFromSizeReturn, r as getFontSized, t as GetFontWeightFromSizeOptions } from "./get-font-sized-DAeZVq9b.cjs";
|
|
2
|
+
export { GetFontWeightFromSizeOptions, GetFontWeightFromSizeReturn, getFontSized, getFontSizedFromSize, getFontWeightFromSize };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { getFontSized, getFontSizedFromSize };
|
|
1
|
+
import { a as getFontWeightFromSize, i as getFontSizedFromSize, n as GetFontWeightFromSizeReturn, r as getFontSized, t as GetFontWeightFromSizeOptions } from "./get-font-sized-gVvWHF-f.mjs";
|
|
2
|
+
export { GetFontWeightFromSizeOptions, GetFontWeightFromSizeReturn, getFontSized, getFontSizedFromSize, getFontWeightFromSize };
|
package/dist/get-font-sized.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{normalizeTokenValue as e}from"./token-value.mjs";import{getNearestToken as t}from"./get-nearest-token.mjs";import{getTokens as n}from"@tamagui/core";import{isNumber as
|
|
1
|
+
import{normalizeTokenValue as e}from"./token-value.mjs";import{getNearestToken as t}from"./get-nearest-token.mjs";import{getTokens as n,getVariableValue as r}from"@tamagui/core";import{isSetString as i}from"@stryke/type-checks";import{isNumber as a}from"@stryke/type-checks/is-number";const o=(t=`true`,{font:n,scale:o}={})=>{let c=i(t)?e(t):t;if(a(c))return s(c);if(!n)return;let l=String((c===`true`?d(n):c)??`true`),u=n.weight?.[l];if(u!==void 0&&Number.isFinite(Number.parseInt(u)))return Number(u);let f=Number(r(n.size?.[l]));return Number.isFinite(f)?s(f,o):void 0},s=(e,t=1)=>Math.min(700,Math.max(300,Math.round((400+(e-16)*12.5*t)/100)*100)),c=(t=`true`,n={})=>{let{font:r,fontFamily:i}=n,s=e(t);if(!r)return{fontSize:s};if(a(s))return{fontFamily:i,fontSize:s};let c=String((s===`true`?d(r):s)??`true`),l={},u=e=>e?.[c],f=u(r.size),p=u(r.lineHeight),m=u(r.letterSpacing),h=u(r.transform),g=u(r.style),_=u(r.color);return g&&(l.fontStyle=g),h&&(l.textTransform=h),i&&(l.fontFamily=i),m&&(l.letterSpacing=m),f&&(l.fontWeight=o(f,n),l.fontSize=f),p&&(l.lineHeight=p),_&&(l.color=_),l.fontWeight??=500,l},l=(n=`true`,r={})=>{let i=r.font,o=e(n);if(!i)return{fontSize:o};let s=a(o)?t(o,`size`):o;return c(s,r)},u=/* @__PURE__ */ new WeakMap;function d(e){if(typeof e==`object`&&u.has(e))return u.get(e);let t=`true`in e.size?e.size:n().size,r=t.true,i=r?Object.keys(t).find(e=>e!==`true`&&t[e].val===r.val):null;return!r||!i?`sm`in e.size?`sm`:Object.keys(e.size)[3]:(u.set(e,i),i)}export{c as getFontSized,l as getFontSizedFromSize,o as getFontWeightFromSize};
|
|
2
2
|
//# sourceMappingURL=get-font-sized.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-font-sized.mjs","names":["
|
|
1
|
+
{"version":3,"file":"get-font-sized.mjs","names":["getFontWeightFromSize","tokenValue","isSetString","sizeTokenIn","normalizeTokenValue","isNumber","getFontWeightFromPixels","font","sizeToken","getDefaultSizeToken","weight","pixels","getVariableValue","scale","getFontSized","env","style","fontValue","group","fontSize","lineHeight","letterSpacing","textTransform","fontStyle","color","fontFamily","getFontSizedFromSize","getNearestToken","cache","sizeTokens","getTokens","sizeDefault","sizeDefaultSpecific","x"],"sources":[],"mappings":""}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { UnionableString, Variable } from "@tamagui/core";
|
|
2
|
-
//#region src/get-nearest-token.d.ts
|
|
3
2
|
declare const getNearestToken: <TToken extends number | UnionableString = number | UnionableString>(value: number, type?: "size" | "space" | "zIndex" | "radius" | string, tokensMap?: Record<string, Variable<number>>) => TToken;
|
|
4
|
-
//#endregion
|
|
5
3
|
export { getNearestToken };
|
|
6
4
|
//# sourceMappingURL=get-nearest-token.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-nearest-token.d.cts","names":[],"sources":["../src/get-nearest-token.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-nearest-token.d.cts","names":[],"sources":["../src/get-nearest-token.ts"],"mappings":";cAuEa,kBACX,wBAAwB,2BAA2B,iBAEnD,eACA,wDACA,YAAY,eAAe,sBAC1B"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { UnionableString, Variable } from "@tamagui/core";
|
|
2
|
-
//#region src/get-nearest-token.d.ts
|
|
3
2
|
declare const getNearestToken: <TToken extends number | UnionableString = number | UnionableString>(value: number, type?: "size" | "space" | "zIndex" | "radius" | string, tokensMap?: Record<string, Variable<number>>) => TToken;
|
|
4
|
-
//#endregion
|
|
5
3
|
export { getNearestToken };
|
|
6
4
|
//# sourceMappingURL=get-nearest-token.d.mts.map
|
package/dist/get-sized.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { t as TokenInput } from "./token-value-
|
|
2
|
-
//#region src/get-sized.d.ts
|
|
1
|
+
import { t as TokenInput } from "./token-value-DiDl_5h7.cjs";
|
|
3
2
|
interface GetSizedOptions {
|
|
4
3
|
scale?: number;
|
|
5
4
|
shift?: number;
|
|
@@ -56,6 +55,5 @@ type GetRadiusOptions = GetSizedOptions & {
|
|
|
56
55
|
* @returns The radius number
|
|
57
56
|
*/
|
|
58
57
|
declare const getRadius: (val: TokenInput, options?: GetRadiusOptions) => number;
|
|
59
|
-
//#endregion
|
|
60
58
|
export { GetRadiusOptions, GetSizedOptions, fontSizeToSize, getRadius, getSizeFromFontSized, getSized, getSpaced, sizeToSpace };
|
|
61
59
|
//# sourceMappingURL=get-sized.d.cts.map
|
package/dist/get-sized.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-sized.d.cts","names":[],"sources":["../src/get-sized.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-sized.d.cts","names":[],"sources":["../src/get-sized.ts"],"mappings":";UAyBiB;EACf;EACA;EACA;EACA;EACA;;;;;;;;;cAUW,WACX,KAAK,YACL,UAAS;;;;;;;;cAyBE,uBACX,KAAK,YACL,UAAS;;;;;;;cAqBE,iBAAkB,sDAAgB;;;;;;;;cAUlC,YACX,KAAK,YACL,UAAS;;;;;;;cAwBE,cAAe,KAAK;KAErB,mBAAmB;EAC7B;;;;;;;;;cAUW,YAAa,KAAK,YAAY,UAAS"}
|
package/dist/get-sized.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { t as TokenInput } from "./token-value-
|
|
2
|
-
//#region src/get-sized.d.ts
|
|
1
|
+
import { t as TokenInput } from "./token-value-DiDl_5h7.mjs";
|
|
3
2
|
interface GetSizedOptions {
|
|
4
3
|
scale?: number;
|
|
5
4
|
shift?: number;
|
|
@@ -56,6 +55,5 @@ type GetRadiusOptions = GetSizedOptions & {
|
|
|
56
55
|
* @returns The radius number
|
|
57
56
|
*/
|
|
58
57
|
declare const getRadius: (val: TokenInput, options?: GetRadiusOptions) => number;
|
|
59
|
-
//#endregion
|
|
60
58
|
export { GetRadiusOptions, GetSizedOptions, fontSizeToSize, getRadius, getSizeFromFontSized, getSized, getSpaced, sizeToSpace };
|
|
61
59
|
//# sourceMappingURL=get-sized.d.mts.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Variable } from "@tamagui/core";
|
|
2
|
-
//#region src/get-token-relative.d.ts
|
|
3
2
|
type TokenRelativeType = "size" | "space" | "radius" | "zIndex";
|
|
4
3
|
interface GetTokenRelativeOptions {
|
|
5
4
|
shift?: number;
|
|
@@ -20,6 +19,5 @@ interface GetTokenRelativeOptions {
|
|
|
20
19
|
* @returns The resolved token variable, or `undefined` when none matches
|
|
21
20
|
*/
|
|
22
21
|
declare const getTokenRelative: (type: TokenRelativeType, current: string | Variable, options?: GetTokenRelativeOptions) => Variable<number> | undefined;
|
|
23
|
-
//#endregion
|
|
24
22
|
export { GetTokenRelativeOptions, TokenRelativeType, getTokenRelative };
|
|
25
23
|
//# sourceMappingURL=get-token-relative.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-token-relative.d.cts","names":[],"sources":["../src/get-token-relative.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-token-relative.d.cts","names":[],"sources":["../src/get-token-relative.ts"],"mappings":";KAoBY;UAEK;EACf;EACA;EACA;;;;;;;;;;;;;;;cAoCW,mBACX,MAAM,mBACN,kBAAkB,UAClB,UAAS,4BACR"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Variable } from "@tamagui/core";
|
|
2
|
-
//#region src/get-token-relative.d.ts
|
|
3
2
|
type TokenRelativeType = "size" | "space" | "radius" | "zIndex";
|
|
4
3
|
interface GetTokenRelativeOptions {
|
|
5
4
|
shift?: number;
|
|
@@ -20,6 +19,5 @@ interface GetTokenRelativeOptions {
|
|
|
20
19
|
* @returns The resolved token variable, or `undefined` when none matches
|
|
21
20
|
*/
|
|
22
21
|
declare const getTokenRelative: (type: TokenRelativeType, current: string | Variable, options?: GetTokenRelativeOptions) => Variable<number> | undefined;
|
|
23
|
-
//#endregion
|
|
24
22
|
export { GetTokenRelativeOptions, TokenRelativeType, getTokenRelative };
|
|
25
23
|
//# sourceMappingURL=get-token-relative.d.mts.map
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./types.cjs"),t=require("./token-value.cjs"),n=require("./get-nearest-token.cjs"),r=require("./get-font-sized.cjs"),i=require("./form-size.cjs"),a=require("./get-token-relative.cjs"),o=require("./get-sized.cjs"),s=require("./form-control.cjs"),c=require("./get-button-sized.cjs"),l=require("./get-colors.cjs");exports.ColorScientificPalette=e.ColorScientificPalette,exports.FieldNotchedOutline=s.FieldNotchedOutline,exports.FormControlContext=s.FormControlContext,exports.createScientificPalettes=l.createScientificPalettes,exports.createStylePalettes=l.createStylePalettes,exports.fontSizeToSize=o.fontSizeToSize,exports.formSizeVariants=i.formSizeVariants,exports.getButtonSized=c.getButtonSized,exports.getFieldLabelInset=s.getFieldLabelInset,exports.getFontSized=r.getFontSized,exports.getFontSizedFromSize=r.getFontSizedFromSize,exports.getFormFontScale=i.getFormFontScale,exports.getFormFontSize=i.getFormFontSize,exports.getFormSizeScale=i.getFormSizeScale,exports.getFormSizeToken=i.getFormSizeToken,exports.getNearestToken=n.getNearestToken,exports.getRadius=o.getRadius,exports.getSizeFromFontSized=o.getSizeFromFontSized,exports.getSized=o.getSized,exports.getSpaced=o.getSpaced,exports.getTokenRelative=a.getTokenRelative,exports.normalizeTokenValue=t.normalizeTokenValue,exports.sizeToSpace=o.sizeToSpace,exports.useFieldHasStartIcon=s.useFieldHasStartIcon,exports.useFieldHasValidationMessage=s.useFieldHasValidationMessage,exports.useFieldIconColor=s.useFieldIconColor,exports.useFieldLabelDefaults=s.useFieldLabelDefaults,exports.useFieldLabelFloated=s.useFieldLabelFloated,exports.useFieldLabelPlacement=s.useFieldLabelPlacement,exports.useFieldOptions=s.useFieldOptions,exports.useFieldShouldShowPlaceholder=s.useFieldShouldShowPlaceholder,exports.useFieldVariant=s.useFieldVariant,exports.useFormControl=s.useFormControl;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./types.cjs"),t=require("./token-value.cjs"),n=require("./get-nearest-token.cjs"),r=require("./get-font-sized.cjs"),i=require("./form-size.cjs"),a=require("./get-token-relative.cjs"),o=require("./get-sized.cjs"),s=require("./form-control.cjs"),c=require("./get-button-sized.cjs"),l=require("./get-colors.cjs");exports.ColorScientificPalette=e.ColorScientificPalette,exports.FieldNotchedOutline=s.FieldNotchedOutline,exports.FormControlContext=s.FormControlContext,exports.createScientificPalettes=l.createScientificPalettes,exports.createStylePalettes=l.createStylePalettes,exports.fontSizeToSize=o.fontSizeToSize,exports.formSizeVariants=i.formSizeVariants,exports.getButtonSized=c.getButtonSized,exports.getFieldLabelInset=s.getFieldLabelInset,exports.getFontSized=r.getFontSized,exports.getFontSizedFromSize=r.getFontSizedFromSize,exports.getFontWeightFromSize=r.getFontWeightFromSize,exports.getFormFontScale=i.getFormFontScale,exports.getFormFontSize=i.getFormFontSize,exports.getFormSizeScale=i.getFormSizeScale,exports.getFormSizeToken=i.getFormSizeToken,exports.getNearestToken=n.getNearestToken,exports.getRadius=o.getRadius,exports.getSizeFromFontSized=o.getSizeFromFontSized,exports.getSized=o.getSized,exports.getSpaced=o.getSpaced,exports.getTokenRelative=a.getTokenRelative,exports.normalizeTokenValue=t.normalizeTokenValue,exports.sizeToSpace=o.sizeToSpace,exports.useFieldHasStartIcon=s.useFieldHasStartIcon,exports.useFieldHasValidationMessage=s.useFieldHasValidationMessage,exports.useFieldIconColor=s.useFieldIconColor,exports.useFieldLabelDefaults=s.useFieldLabelDefaults,exports.useFieldLabelFloated=s.useFieldLabelFloated,exports.useFieldLabelPlacement=s.useFieldLabelPlacement,exports.useFieldOptions=s.useFieldOptions,exports.useFieldShouldShowPlaceholder=s.useFieldShouldShowPlaceholder,exports.useFieldVariant=s.useFieldVariant,exports.useFormControl=s.useFormControl;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as TokenValue, r as normalizeTokenValue, t as TokenInput } from "./token-value-
|
|
2
|
-
import { a as
|
|
3
|
-
import {
|
|
1
|
+
import { n as TokenValue, r as normalizeTokenValue, t as TokenInput } from "./token-value-DiDl_5h7.cjs";
|
|
2
|
+
import { a as LCHColor, i as DefaultStatusColorTheme, n as ColorScientificPaletteRecord, o as StyleEnv, r as ColorStylePaletteRecord, t as ColorScientificPalette } from "./types-jnp_CvAO.cjs";
|
|
3
|
+
import { a as getFontWeightFromSize, i as getFontSizedFromSize, n as GetFontWeightFromSizeReturn, r as getFontSized, t as GetFontWeightFromSizeOptions } from "./get-font-sized-DAeZVq9b.cjs";
|
|
4
4
|
import { FormControlSize, FormSizeVariant, formSizeVariants, getFormFontScale, getFormFontSize, getFormSizeScale, getFormSizeToken } from "./form-size.cjs";
|
|
5
5
|
import { FieldControlOptions, FieldLabelDefaults, FieldLabelPlacement, FieldLabelVariant, FieldNotchedOutline, FieldVariant, FormControlContext, FormControlState, getFieldLabelInset, useFieldHasStartIcon, useFieldHasValidationMessage, useFieldIconColor, useFieldLabelDefaults, useFieldLabelFloated, useFieldLabelPlacement, useFieldOptions, useFieldShouldShowPlaceholder, useFieldVariant, useFormControl } from "./form-control.cjs";
|
|
6
6
|
import { getButtonSized } from "./get-button-sized.cjs";
|
|
@@ -8,4 +8,4 @@ import { createScientificPalettes, createStylePalettes } from "./get-colors.cjs"
|
|
|
8
8
|
import { getNearestToken } from "./get-nearest-token.cjs";
|
|
9
9
|
import { GetRadiusOptions, GetSizedOptions, fontSizeToSize, getRadius, getSizeFromFontSized, getSized, getSpaced, sizeToSpace } from "./get-sized.cjs";
|
|
10
10
|
import { GetTokenRelativeOptions, TokenRelativeType, getTokenRelative } from "./get-token-relative.cjs";
|
|
11
|
-
export { ColorScientificPalette, ColorScientificPaletteRecord, ColorStylePaletteRecord, FieldControlOptions, FieldLabelDefaults, FieldLabelPlacement, FieldLabelVariant, FieldNotchedOutline, FieldVariant, FormControlContext, FormControlSize, FormControlState, FormSizeVariant, GetRadiusOptions, GetSizedOptions, GetTokenRelativeOptions, LCHColor, StyleEnv, TokenInput, TokenRelativeType, TokenValue, createScientificPalettes, createStylePalettes, fontSizeToSize, formSizeVariants, getButtonSized, getFieldLabelInset, getFontSized, getFontSizedFromSize, getFormFontScale, getFormFontSize, getFormSizeScale, getFormSizeToken, getNearestToken, getRadius, getSizeFromFontSized, getSized, getSpaced, getTokenRelative, normalizeTokenValue, sizeToSpace, useFieldHasStartIcon, useFieldHasValidationMessage, useFieldIconColor, useFieldLabelDefaults, useFieldLabelFloated, useFieldLabelPlacement, useFieldOptions, useFieldShouldShowPlaceholder, useFieldVariant, useFormControl };
|
|
11
|
+
export { ColorScientificPalette, ColorScientificPaletteRecord, ColorStylePaletteRecord, DefaultStatusColorTheme, FieldControlOptions, FieldLabelDefaults, FieldLabelPlacement, FieldLabelVariant, FieldNotchedOutline, FieldVariant, FormControlContext, FormControlSize, FormControlState, FormSizeVariant, GetFontWeightFromSizeOptions, GetFontWeightFromSizeReturn, GetRadiusOptions, GetSizedOptions, GetTokenRelativeOptions, LCHColor, StyleEnv, TokenInput, TokenRelativeType, TokenValue, createScientificPalettes, createStylePalettes, fontSizeToSize, formSizeVariants, getButtonSized, getFieldLabelInset, getFontSized, getFontSizedFromSize, getFontWeightFromSize, getFormFontScale, getFormFontSize, getFormSizeScale, getFormSizeToken, getNearestToken, getRadius, getSizeFromFontSized, getSized, getSpaced, getTokenRelative, normalizeTokenValue, sizeToSpace, useFieldHasStartIcon, useFieldHasValidationMessage, useFieldIconColor, useFieldLabelDefaults, useFieldLabelFloated, useFieldLabelPlacement, useFieldOptions, useFieldShouldShowPlaceholder, useFieldVariant, useFormControl };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as TokenValue, r as normalizeTokenValue, t as TokenInput } from "./token-value-
|
|
2
|
-
import { a as
|
|
3
|
-
import {
|
|
1
|
+
import { n as TokenValue, r as normalizeTokenValue, t as TokenInput } from "./token-value-DiDl_5h7.mjs";
|
|
2
|
+
import { a as LCHColor, i as DefaultStatusColorTheme, n as ColorScientificPaletteRecord, o as StyleEnv, r as ColorStylePaletteRecord, t as ColorScientificPalette } from "./types-jnp_CvAO.mjs";
|
|
3
|
+
import { a as getFontWeightFromSize, i as getFontSizedFromSize, n as GetFontWeightFromSizeReturn, r as getFontSized, t as GetFontWeightFromSizeOptions } from "./get-font-sized-gVvWHF-f.mjs";
|
|
4
4
|
import { FormControlSize, FormSizeVariant, formSizeVariants, getFormFontScale, getFormFontSize, getFormSizeScale, getFormSizeToken } from "./form-size.mjs";
|
|
5
5
|
import { FieldControlOptions, FieldLabelDefaults, FieldLabelPlacement, FieldLabelVariant, FieldNotchedOutline, FieldVariant, FormControlContext, FormControlState, getFieldLabelInset, useFieldHasStartIcon, useFieldHasValidationMessage, useFieldIconColor, useFieldLabelDefaults, useFieldLabelFloated, useFieldLabelPlacement, useFieldOptions, useFieldShouldShowPlaceholder, useFieldVariant, useFormControl } from "./form-control.mjs";
|
|
6
6
|
import { getButtonSized } from "./get-button-sized.mjs";
|
|
@@ -8,4 +8,4 @@ import { createScientificPalettes, createStylePalettes } from "./get-colors.mjs"
|
|
|
8
8
|
import { getNearestToken } from "./get-nearest-token.mjs";
|
|
9
9
|
import { GetRadiusOptions, GetSizedOptions, fontSizeToSize, getRadius, getSizeFromFontSized, getSized, getSpaced, sizeToSpace } from "./get-sized.mjs";
|
|
10
10
|
import { GetTokenRelativeOptions, TokenRelativeType, getTokenRelative } from "./get-token-relative.mjs";
|
|
11
|
-
export { ColorScientificPalette, ColorScientificPaletteRecord, ColorStylePaletteRecord, FieldControlOptions, FieldLabelDefaults, FieldLabelPlacement, FieldLabelVariant, FieldNotchedOutline, FieldVariant, FormControlContext, FormControlSize, FormControlState, FormSizeVariant, GetRadiusOptions, GetSizedOptions, GetTokenRelativeOptions, LCHColor, StyleEnv, TokenInput, TokenRelativeType, TokenValue, createScientificPalettes, createStylePalettes, fontSizeToSize, formSizeVariants, getButtonSized, getFieldLabelInset, getFontSized, getFontSizedFromSize, getFormFontScale, getFormFontSize, getFormSizeScale, getFormSizeToken, getNearestToken, getRadius, getSizeFromFontSized, getSized, getSpaced, getTokenRelative, normalizeTokenValue, sizeToSpace, useFieldHasStartIcon, useFieldHasValidationMessage, useFieldIconColor, useFieldLabelDefaults, useFieldLabelFloated, useFieldLabelPlacement, useFieldOptions, useFieldShouldShowPlaceholder, useFieldVariant, useFormControl };
|
|
11
|
+
export { ColorScientificPalette, ColorScientificPaletteRecord, ColorStylePaletteRecord, DefaultStatusColorTheme, FieldControlOptions, FieldLabelDefaults, FieldLabelPlacement, FieldLabelVariant, FieldNotchedOutline, FieldVariant, FormControlContext, FormControlSize, FormControlState, FormSizeVariant, GetFontWeightFromSizeOptions, GetFontWeightFromSizeReturn, GetRadiusOptions, GetSizedOptions, GetTokenRelativeOptions, LCHColor, StyleEnv, TokenInput, TokenRelativeType, TokenValue, createScientificPalettes, createStylePalettes, fontSizeToSize, formSizeVariants, getButtonSized, getFieldLabelInset, getFontSized, getFontSizedFromSize, getFontWeightFromSize, getFormFontScale, getFormFontSize, getFormSizeScale, getFormSizeToken, getNearestToken, getRadius, getSizeFromFontSized, getSized, getSpaced, getTokenRelative, normalizeTokenValue, sizeToSpace, useFieldHasStartIcon, useFieldHasValidationMessage, useFieldIconColor, useFieldLabelDefaults, useFieldLabelFloated, useFieldLabelPlacement, useFieldOptions, useFieldShouldShowPlaceholder, useFieldVariant, useFormControl };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ColorScientificPalette as e}from"./types.mjs";import{normalizeTokenValue as t}from"./token-value.mjs";import{getNearestToken as n}from"./get-nearest-token.mjs";import{getFontSized as r,getFontSizedFromSize as i}from"./get-font-sized.mjs";import{formSizeVariants as
|
|
1
|
+
import{ColorScientificPalette as e}from"./types.mjs";import{normalizeTokenValue as t}from"./token-value.mjs";import{getNearestToken as n}from"./get-nearest-token.mjs";import{getFontSized as r,getFontSizedFromSize as i,getFontWeightFromSize as a}from"./get-font-sized.mjs";import{formSizeVariants as o,getFormFontScale as s,getFormFontSize as c,getFormSizeScale as l,getFormSizeToken as u}from"./form-size.mjs";import{getTokenRelative as d}from"./get-token-relative.mjs";import{fontSizeToSize as f,getRadius as p,getSizeFromFontSized as m,getSized as h,getSpaced as g,sizeToSpace as _}from"./get-sized.mjs";import{FieldNotchedOutline as v,FormControlContext as y,getFieldLabelInset as b,useFieldHasStartIcon as x,useFieldHasValidationMessage as S,useFieldIconColor as C,useFieldLabelDefaults as w,useFieldLabelFloated as T,useFieldLabelPlacement as E,useFieldOptions as D,useFieldShouldShowPlaceholder as O,useFieldVariant as k,useFormControl as A}from"./form-control.mjs";import{getButtonSized as j}from"./get-button-sized.mjs";import{createScientificPalettes as M,createStylePalettes as N}from"./get-colors.mjs";export{e as ColorScientificPalette,v as FieldNotchedOutline,y as FormControlContext,M as createScientificPalettes,N as createStylePalettes,f as fontSizeToSize,o as formSizeVariants,j as getButtonSized,b as getFieldLabelInset,r as getFontSized,i as getFontSizedFromSize,a as getFontWeightFromSize,s as getFormFontScale,c as getFormFontSize,l as getFormSizeScale,u as getFormSizeToken,n as getNearestToken,p as getRadius,m as getSizeFromFontSized,h as getSized,g as getSpaced,d as getTokenRelative,t as normalizeTokenValue,_ as sizeToSpace,x as useFieldHasStartIcon,S as useFieldHasValidationMessage,C as useFieldIconColor,w as useFieldLabelDefaults,T as useFieldLabelFloated,E as useFieldLabelPlacement,D as useFieldOptions,O as useFieldShouldShowPlaceholder,k as useFieldVariant,A as useFormControl};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/token-value.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* A token key or an arbitrary Tailwind-style dimension.
|
|
4
3
|
*
|
|
@@ -21,6 +20,5 @@ type TokenInput = TokenValue | boolean;
|
|
|
21
20
|
* is returned bare.
|
|
22
21
|
*/
|
|
23
22
|
declare function normalizeTokenValue(value: TokenInput): TokenValue;
|
|
24
|
-
//#endregion
|
|
25
23
|
export { TokenValue as n, normalizeTokenValue as r, TokenInput as t };
|
|
26
|
-
//# sourceMappingURL=token-value-
|
|
24
|
+
//# sourceMappingURL=token-value-DiDl_5h7.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-value-DiDl_5h7.d.cts","names":[],"sources":["../src/token-value.ts"],"mappings":";;;;;;;KAyBY;;;;;KAMA,aAAa;;;;;;;;;iBAaT,oBAAoB,OAAO,aAAa"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/token-value.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* A token key or an arbitrary Tailwind-style dimension.
|
|
4
3
|
*
|
|
@@ -21,6 +20,5 @@ type TokenInput = TokenValue | boolean;
|
|
|
21
20
|
* is returned bare.
|
|
22
21
|
*/
|
|
23
22
|
declare function normalizeTokenValue(value: TokenInput): TokenValue;
|
|
24
|
-
//#endregion
|
|
25
23
|
export { TokenValue as n, normalizeTokenValue as r, TokenInput as t };
|
|
26
|
-
//# sourceMappingURL=token-value-
|
|
24
|
+
//# sourceMappingURL=token-value-DiDl_5h7.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-value-DiDl_5h7.d.mts","names":[],"sources":["../src/token-value.ts"],"mappings":""}
|
package/dist/token-value.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as TokenValue, r as normalizeTokenValue, t as TokenInput } from "./token-value-
|
|
1
|
+
import { n as TokenValue, r as normalizeTokenValue, t as TokenInput } from "./token-value-DiDl_5h7.cjs";
|
|
2
2
|
export { TokenInput, TokenValue, normalizeTokenValue };
|
package/dist/token-value.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as TokenValue, r as normalizeTokenValue, t as TokenInput } from "./token-value-
|
|
1
|
+
import { n as TokenValue, r as normalizeTokenValue, t as TokenInput } from "./token-value-DiDl_5h7.mjs";
|
|
2
2
|
export { TokenInput, TokenValue, normalizeTokenValue };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Font, FontFamilyTokens, TokensParsed } from "@tamagui/core";
|
|
2
2
|
import { Color } from "chroma-js";
|
|
3
|
-
//#region src/types.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* The subset of Tamagui v3's `styled.dynamic` environment these helpers read.
|
|
6
5
|
*
|
|
@@ -31,6 +30,6 @@ interface LCHColor {
|
|
|
31
30
|
}
|
|
32
31
|
type ColorScientificPaletteRecord = Record<ColorScientificPalette, Color[]>;
|
|
33
32
|
type ColorStylePaletteRecord = Record<ColorScientificPalette, string[]>;
|
|
34
|
-
|
|
35
|
-
export {
|
|
36
|
-
//# sourceMappingURL=types-
|
|
33
|
+
type DefaultStatusColorTheme = "danger" | "warning" | "info" | "help" | "success" | "discovery";
|
|
34
|
+
export { LCHColor as a, DefaultStatusColorTheme as i, ColorScientificPaletteRecord as n, StyleEnv as o, ColorStylePaletteRecord as r, ColorScientificPalette as t };
|
|
35
|
+
//# sourceMappingURL=types-jnp_CvAO.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-jnp_CvAO.d.cts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;;;;;;UA6BiB;EACf,SAAS;EACT,OAAO;EACP,aAAa;;KAGH;cAQC;EACmB,aAAA;EACJ,WAAA;EACJ,SAAA;EACE,UAAA;EACU,eAAA;EACW,qBAAA;;UAG9B;EACf;EACA;EACA;EACA;;KAGU,+BAA+B,OACzC,wBACA;KAGU,0BAA0B,OAAO;KAEjC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Font, FontFamilyTokens, TokensParsed } from "@tamagui/core";
|
|
2
2
|
import { Color } from "chroma-js";
|
|
3
|
-
//#region src/types.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* The subset of Tamagui v3's `styled.dynamic` environment these helpers read.
|
|
6
5
|
*
|
|
@@ -31,6 +30,6 @@ interface LCHColor {
|
|
|
31
30
|
}
|
|
32
31
|
type ColorScientificPaletteRecord = Record<ColorScientificPalette, Color[]>;
|
|
33
32
|
type ColorStylePaletteRecord = Record<ColorScientificPalette, string[]>;
|
|
34
|
-
|
|
35
|
-
export {
|
|
36
|
-
//# sourceMappingURL=types-
|
|
33
|
+
type DefaultStatusColorTheme = "danger" | "warning" | "info" | "help" | "success" | "discovery";
|
|
34
|
+
export { LCHColor as a, DefaultStatusColorTheme as i, ColorScientificPaletteRecord as n, StyleEnv as o, ColorStylePaletteRecord as r, ColorScientificPalette as t };
|
|
35
|
+
//# sourceMappingURL=types-jnp_CvAO.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-jnp_CvAO.d.mts","names":[],"sources":["../src/types.ts"],"mappings":""}
|
package/dist/types.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { ColorScientificPalette, ColorScientificPaletteRecord, ColorStylePaletteRecord, LCHColor, StyleEnv };
|
|
1
|
+
import { a as LCHColor, i as DefaultStatusColorTheme, n as ColorScientificPaletteRecord, o as StyleEnv, r as ColorStylePaletteRecord, t as ColorScientificPalette } from "./types-jnp_CvAO.cjs";
|
|
2
|
+
export { ColorScientificPalette, ColorScientificPaletteRecord, ColorStylePaletteRecord, DefaultStatusColorTheme, LCHColor, StyleEnv };
|
package/dist/types.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { ColorScientificPalette, ColorScientificPaletteRecord, ColorStylePaletteRecord, LCHColor, StyleEnv };
|
|
1
|
+
import { a as LCHColor, i as DefaultStatusColorTheme, n as ColorScientificPaletteRecord, o as StyleEnv, r as ColorStylePaletteRecord, t as ColorScientificPalette } from "./types-jnp_CvAO.mjs";
|
|
2
|
+
export { ColorScientificPalette, ColorScientificPaletteRecord, ColorStylePaletteRecord, DefaultStatusColorTheme, LCHColor, StyleEnv };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyclone-ui/helpers",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.25",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A repository containing the core front-end components used by Storm Software across many platforms",
|
|
6
6
|
"repository": {
|
|
@@ -171,8 +171,8 @@
|
|
|
171
171
|
"dependencies": {
|
|
172
172
|
"@stryke/type-checks": "^0.6.49",
|
|
173
173
|
"@stryke/types": "^0.12.44",
|
|
174
|
-
"@tamagui/constants": "
|
|
175
|
-
"@tamagui/core": "
|
|
174
|
+
"@tamagui/constants": "3.0.13",
|
|
175
|
+
"@tamagui/core": "3.0.13",
|
|
176
176
|
"chroma-js": "^2.6.0"
|
|
177
177
|
},
|
|
178
178
|
"devDependencies": {
|
|
@@ -180,10 +180,10 @@
|
|
|
180
180
|
"@powerlines/plugin-tsdown": "^0.1.615",
|
|
181
181
|
"@types/chroma-js": "^2.4.5",
|
|
182
182
|
"powerlines": "^0.47.214",
|
|
183
|
-
"react": "^19.3.
|
|
183
|
+
"react": "^19.3.1"
|
|
184
184
|
},
|
|
185
185
|
"publishConfig": { "access": "public" },
|
|
186
186
|
"module": "./dist/index.mjs",
|
|
187
|
-
"peerDependencies": { "react": "^19.3.
|
|
188
|
-
"gitHead": "
|
|
187
|
+
"peerDependencies": { "react": "^19.3.1" },
|
|
188
|
+
"gitHead": "13806869dab99bab5aca14eb5d6d138c42ae7475"
|
|
189
189
|
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { t as TokenInput } from "./token-value-sAa1meMz.cjs";
|
|
2
|
-
import { a as StyleEnv } from "./types-VwCaLyLv.cjs";
|
|
3
|
-
import { FontSizeTokens, TextStyle } from "@tamagui/core";
|
|
4
|
-
import { Mutable } from "@stryke/types/base";
|
|
5
|
-
//#region src/get-font-sized.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* Get the font size related styles
|
|
8
|
-
*
|
|
9
|
-
* @remarks
|
|
10
|
-
* Call-site `color` and `fontStyle` props take precedence over the values
|
|
11
|
-
* returned here because Tamagui v3 applies call-site props above variants.
|
|
12
|
-
*
|
|
13
|
-
* @param sizeTokenIn - The size token to use
|
|
14
|
-
* @param env - The `styled.dynamic` environment
|
|
15
|
-
* @returns The font size related styles
|
|
16
|
-
*/
|
|
17
|
-
declare const getFontSized: (sizeTokenIn?: FontSizeTokens | TokenInput, { font, fontFamily }?: StyleEnv) => Mutable<TextStyle>;
|
|
18
|
-
/**
|
|
19
|
-
* Get the font size related styles from a size token
|
|
20
|
-
*
|
|
21
|
-
* @param sizeTokenIn - The size token to use
|
|
22
|
-
* @param env - The `styled.dynamic` environment
|
|
23
|
-
* @returns The font size related styles
|
|
24
|
-
*/
|
|
25
|
-
declare const getFontSizedFromSize: (sizeTokenIn?: TokenInput, env?: StyleEnv) => Mutable<TextStyle>;
|
|
26
|
-
//#endregion
|
|
27
|
-
export { getFontSizedFromSize as n, getFontSized as t };
|
|
28
|
-
//# sourceMappingURL=get-font-sized-BOOkb_Zr.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-font-sized-BOOkb_Zr.d.cts","names":[],"sources":["../src/get-font-sized.ts"],"mappings":";;;;;;;;;;;;;;;;cAsCa,eACX,cAAa,iBAAiB,cAC9B,MAAA,eAAsB,aACrB,QAAQ;;;;;;;;cAqEE,uBACX,cAAa,YACb,MAAK,aACJ,QAAQ"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { t as TokenInput } from "./token-value-sAa1meMz.mjs";
|
|
2
|
-
import { a as StyleEnv } from "./types-VwCaLyLv.mjs";
|
|
3
|
-
import { FontSizeTokens, TextStyle } from "@tamagui/core";
|
|
4
|
-
import { Mutable } from "@stryke/types/base";
|
|
5
|
-
//#region src/get-font-sized.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* Get the font size related styles
|
|
8
|
-
*
|
|
9
|
-
* @remarks
|
|
10
|
-
* Call-site `color` and `fontStyle` props take precedence over the values
|
|
11
|
-
* returned here because Tamagui v3 applies call-site props above variants.
|
|
12
|
-
*
|
|
13
|
-
* @param sizeTokenIn - The size token to use
|
|
14
|
-
* @param env - The `styled.dynamic` environment
|
|
15
|
-
* @returns The font size related styles
|
|
16
|
-
*/
|
|
17
|
-
declare const getFontSized: (sizeTokenIn?: FontSizeTokens | TokenInput, { font, fontFamily }?: StyleEnv) => Mutable<TextStyle>;
|
|
18
|
-
/**
|
|
19
|
-
* Get the font size related styles from a size token
|
|
20
|
-
*
|
|
21
|
-
* @param sizeTokenIn - The size token to use
|
|
22
|
-
* @param env - The `styled.dynamic` environment
|
|
23
|
-
* @returns The font size related styles
|
|
24
|
-
*/
|
|
25
|
-
declare const getFontSizedFromSize: (sizeTokenIn?: TokenInput, env?: StyleEnv) => Mutable<TextStyle>;
|
|
26
|
-
//#endregion
|
|
27
|
-
export { getFontSizedFromSize as n, getFontSized as t };
|
|
28
|
-
//# sourceMappingURL=get-font-sized-Bouwk_EY.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-font-sized-Bouwk_EY.d.mts","names":[],"sources":["../src/get-font-sized.ts"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"token-value-sAa1meMz.d.cts","names":[],"sources":["../src/token-value.ts"],"mappings":";;;;;;;;KAyBY;;;;;KAMA,aAAa;;;;;;;;;iBAaT,oBAAoB,OAAO,aAAa"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"token-value-sAa1meMz.d.mts","names":[],"sources":["../src/token-value.ts"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types-VwCaLyLv.d.cts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;;;;;;;UA6BiB;EACf,SAAS;EACT,OAAO;EACP,aAAa;;KAGH;cAQC;EACmB,aAAA;EACJ,WAAA;EACJ,SAAA;EACE,UAAA;EACU,eAAA;EACW,qBAAA;;UAG9B;EACf;EACA;EACA;EACA;;KAGU,+BAA+B,OACzC,wBACA;KAGU,0BAA0B,OAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types-VwCaLyLv.d.mts","names":[],"sources":["../src/types.ts"],"mappings":""}
|