@cyclone-ui/helpers 0.3.10 → 0.3.12
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/README.md +1 -1
- package/dist/form-control.cjs +1 -0
- package/dist/form-control.d.cts +198 -0
- package/dist/form-control.d.cts.map +1 -0
- package/dist/form-control.d.mts +198 -0
- package/dist/form-control.d.mts.map +1 -0
- package/dist/form-control.mjs +2 -0
- package/dist/form-control.mjs.map +1 -0
- package/dist/form-size.d.cts +2 -2
- package/dist/form-size.d.mts +2 -2
- package/dist/get-button-sized.d.cts +1 -1
- package/dist/get-button-sized.d.mts +1 -1
- package/dist/get-colors.d.cts +1 -1
- package/dist/get-colors.d.mts +1 -1
- package/dist/get-font-sized-BOOkb_Zr.d.cts +28 -0
- package/dist/get-font-sized-BOOkb_Zr.d.cts.map +1 -0
- package/dist/get-font-sized-Bouwk_EY.d.mts +28 -0
- package/dist/get-font-sized-Bouwk_EY.d.mts.map +1 -0
- package/dist/get-font-sized.d.cts +2 -28
- package/dist/get-font-sized.d.mts +2 -28
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +4 -3
- package/dist/index.d.mts +4 -3
- package/dist/index.mjs +1 -1
- package/dist/types-VwCaLyLv.d.cts +36 -0
- package/dist/types-VwCaLyLv.d.cts.map +1 -0
- package/dist/types-VwCaLyLv.d.mts +36 -0
- package/dist/types-VwCaLyLv.d.mts.map +1 -0
- package/dist/types.d.cts +2 -36
- package/dist/types.d.mts +2 -36
- package/package.json +21 -5
- package/dist/get-font-sized.d.cts.map +0 -1
- package/dist/get-font-sized.d.mts.map +0 -1
- package/dist/types.d.cts.map +0 -1
- package/dist/types.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.11](https://github.com/storm-software/cyclone-ui/releases/tag/helpers%400.3.11) (10/07/2026)
|
|
6
|
+
|
|
7
|
+
### Updated Dependencies
|
|
8
|
+
|
|
9
|
+
- Updated **themes** to **v0.3.11**
|
|
10
|
+
|
|
5
11
|
## [0.3.10](https://github.com/storm-software/cyclone-ui/releases/tag/helpers%400.3.10) (10/06/2026)
|
|
6
12
|
|
|
7
13
|
### Updated Dependencies
|
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ This package is part of the <b>🌀 Cyclone UI</b> monorepo. The repository cont
|
|
|
27
27
|
<!-- markdownlint-disable -->
|
|
28
28
|
|
|
29
29
|
> [!IMPORTANT]
|
|
30
|
-
> This repository, and the apps, libraries, and tools contained within, is still in it's initial development phase. As a result, bugs and issues are expected with it's usage. When the main development phase completes, a proper release will be performed, the packages will be
|
|
30
|
+
> This repository, and the apps, libraries, and tools contained within, is still in it's initial development phase. As a result, bugs and issues are expected with it's usage. When the main development phase completes, a proper release will be performed, the packages will be available through NPM (and other distributions), and this message will be removed. However, in the meantime, please feel free to report any issues you may come across.
|
|
31
31
|
|
|
32
32
|
<!-- markdownlint-restore -->
|
|
33
33
|
<!-- prettier-ignore-end -->
|
|
@@ -0,0 +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=t?i?`borderDisabled`:`disabled`:i?n?`borderActive`:`border`:n?`active`:`accent`,s=t?i?`borderDisabled`:`disabled`:i?`borderActive`:`active`;return{iconColor:e?.hovered?s:a,hoverIconColor:s,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`,transition:`100ms`,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=_(u),p=(0,r.useRef)(null),m=(0,n.useComposedRefs)(s,p),[h,g]=(0,r.useState)();(0,r.useLayoutEffect)(()=>{let e=p.current,t=l?.current;if(!e||!t)return;let n=()=>{let n=t.getBoundingClientRect().left-e.getBoundingClientRect().left,r=t.getBoundingClientRect().width;g(e=>e?.left===n&&e.width===r?e:{left:n,width:r})};if(n(),typeof ResizeObserver>`u`)return;let r=new ResizeObserver(n);return r.observe(e),r.observe(t),()=>r.disconnect()},[l,u]);let v=t.getSpaced(`sm`)*e.getFormSizeScale(d);return/* @__PURE__ */ (0,i.jsx)(y,{ref:m,"aria-hidden":!0,...a,children:/* @__PURE__ */ (0,i.jsx)(b,{marginLeft:Math.max(0,(h?.left??0)-v),width:f&&h?h.width+v*2:0})})},{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;
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { FormControlSize } from "./form-size.cjs";
|
|
2
|
+
import { SelectOption } from "@stryke/types/form";
|
|
3
|
+
import { ValidationDetail } from "@stryke/types/validations";
|
|
4
|
+
import { TamaguiWebElement } from "@tamagui/core";
|
|
5
|
+
import { ReactNode, Ref, RefObject } from "react";
|
|
6
|
+
//#region src/form-control.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* The field's control style (see Material UI's `TextField` variants).
|
|
9
|
+
*/
|
|
10
|
+
type FieldVariant = "outlined" | "underlined" | "inlined";
|
|
11
|
+
/**
|
|
12
|
+
* Where the field's label is displayed: floating over the control (resting
|
|
13
|
+
* inside it until the field is focused or has a value), or above it.
|
|
14
|
+
*/
|
|
15
|
+
type FieldLabelVariant = "floating" | "above";
|
|
16
|
+
/**
|
|
17
|
+
* How a control makes room for its field's floating label: `"border"` when the
|
|
18
|
+
* label floats onto an outlined control's border, `"inset"` when it floats
|
|
19
|
+
* inside an underlined or inlined control.
|
|
20
|
+
*/
|
|
21
|
+
type FieldLabelPlacement = "border" | "inset";
|
|
22
|
+
/**
|
|
23
|
+
* The state a form control (such as `Field`) shares with the input inside it.
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* Modeled on Material UI's `FormControl` context: controls such as `Input`,
|
|
27
|
+
* `Switch` or `Select` read it with {@link useFormControl} and fall back to it
|
|
28
|
+
* for any prop they are not given, so the same uncontrolled control can be
|
|
29
|
+
* used on its own or connected to a form by wrapping it in a `Field`. It holds
|
|
30
|
+
* plain values and callbacks only, so it does not tie a control to any form
|
|
31
|
+
* state library.
|
|
32
|
+
*/
|
|
33
|
+
interface FormControlState {
|
|
34
|
+
/** The field name, also used as the control's `id`. */
|
|
35
|
+
name?: string;
|
|
36
|
+
/** The field's current (parsed) value. */
|
|
37
|
+
value?: any;
|
|
38
|
+
/** The field's value formatted for display. */
|
|
39
|
+
formattedValue?: string;
|
|
40
|
+
/** The field's initial value. */
|
|
41
|
+
defaultValue?: any;
|
|
42
|
+
/** The selectable options of a field, with `selected`/`disabled` resolved. */
|
|
43
|
+
items?: SelectOption[];
|
|
44
|
+
size?: FormControlSize;
|
|
45
|
+
theme?: string;
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
required?: boolean;
|
|
48
|
+
focused?: boolean;
|
|
49
|
+
/** Whether the pointer is over the field (mirrors `group-hover/field`). */
|
|
50
|
+
hovered?: boolean;
|
|
51
|
+
clearable?: boolean;
|
|
52
|
+
hasValidationMessage: boolean;
|
|
53
|
+
/** Ref the control attaches to its native input (applies masking). */
|
|
54
|
+
inputRef?: Ref<any>;
|
|
55
|
+
/** Set the field's value. */
|
|
56
|
+
onChange?: (value: any) => void;
|
|
57
|
+
onFocus?: () => void;
|
|
58
|
+
onBlur?: () => void;
|
|
59
|
+
/**
|
|
60
|
+
* Show (or, without a message, remove) a status message the control raises
|
|
61
|
+
* itself, such as a caps lock warning, keyed by its `code`.
|
|
62
|
+
*/
|
|
63
|
+
setMessage?: (code: string, message?: ValidationDetail) => void;
|
|
64
|
+
/**
|
|
65
|
+
* Status adornments (validation icon, clear button) the field asks a text
|
|
66
|
+
* box style control to render at its end.
|
|
67
|
+
*/
|
|
68
|
+
endAdornment?: ReactNode;
|
|
69
|
+
/**
|
|
70
|
+
* The field's status icon (validation, disabled), as `Field.ThemeIcon`
|
|
71
|
+
* renders it, for controls that show it beside an item.
|
|
72
|
+
*/
|
|
73
|
+
statusIcon?: ReactNode;
|
|
74
|
+
variant: FieldVariant;
|
|
75
|
+
labelVariant: FieldLabelVariant | undefined;
|
|
76
|
+
/** How the field's control prefers its label (see {@link useFieldLabelDefaults}). */
|
|
77
|
+
labelDefaults: FieldLabelDefaults | undefined;
|
|
78
|
+
setLabelDefaults: (labelDefaults: FieldLabelDefaults | undefined) => void;
|
|
79
|
+
/** Field options the control supplies (see {@link useFieldOptions}). */
|
|
80
|
+
setControlOptions: (options: FieldControlOptions | undefined) => void;
|
|
81
|
+
hasPlaceholder: boolean;
|
|
82
|
+
endIconCount: number;
|
|
83
|
+
hasStartIcon: boolean;
|
|
84
|
+
labelContentRef: RefObject<TamaguiWebElement | null>;
|
|
85
|
+
setLabelVariant: (labelVariant: FieldLabelVariant | undefined) => void;
|
|
86
|
+
setHasPlaceholder: (hasPlaceholder: boolean) => void;
|
|
87
|
+
registerEndIcon: () => () => void;
|
|
88
|
+
registerStartIcon: () => () => void;
|
|
89
|
+
}
|
|
90
|
+
declare const FormControlContext: import("react").Context<FormControlState | undefined>;
|
|
91
|
+
/**
|
|
92
|
+
* Get the enclosing form control's state, or `undefined` outside of one.
|
|
93
|
+
*/
|
|
94
|
+
declare const useFormControl: () => FormControlState | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* How a control prefers the enclosing field's label to be displayed.
|
|
97
|
+
*/
|
|
98
|
+
interface FieldLabelDefaults {
|
|
99
|
+
/** Used when `Field.Label` sets no `variant` (text boxes float it). */
|
|
100
|
+
variant?: FieldLabelVariant;
|
|
101
|
+
/**
|
|
102
|
+
* Show a compact label beside the control (checkbox, switch): no required
|
|
103
|
+
* marker, no bottom padding, and a disabled icon next to it. The value sets
|
|
104
|
+
* the alignment of the label's row.
|
|
105
|
+
*/
|
|
106
|
+
inline?: {
|
|
107
|
+
alignItems?: "center";
|
|
108
|
+
} | {
|
|
109
|
+
alignContent?: "center";
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Register how a control prefers its field's label to be displayed.
|
|
114
|
+
*
|
|
115
|
+
* @param labelDefaults - A stable (memoized or module level) value.
|
|
116
|
+
*/
|
|
117
|
+
declare const useFieldLabelDefaults: (labelDefaults: FieldLabelDefaults) => void;
|
|
118
|
+
/**
|
|
119
|
+
* Field options (as `Field` takes them: `format`, `parse`, `mask`,
|
|
120
|
+
* `clearable`, ...) that a control supplies to its field.
|
|
121
|
+
*/
|
|
122
|
+
interface FieldControlOptions {
|
|
123
|
+
/** Options the control sets over the field's own props. */
|
|
124
|
+
overrides?: Record<string, unknown>;
|
|
125
|
+
/** Options used when the field's props leave them unset. */
|
|
126
|
+
defaults?: Record<string, unknown>;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Supply field options from a control, for example a date picker's
|
|
130
|
+
* `format`/`parse`/`mask` for its mode.
|
|
131
|
+
*
|
|
132
|
+
* @param options - A stable (memoized) value; functions inside are compared by
|
|
133
|
+
* reference.
|
|
134
|
+
*/
|
|
135
|
+
declare const useFieldOptions: (options: FieldControlOptions) => void;
|
|
136
|
+
/**
|
|
137
|
+
* Get the enclosing field's control style, registering whether the control
|
|
138
|
+
* shows a placeholder (a floating label stays floated over one).
|
|
139
|
+
*/
|
|
140
|
+
declare const useFieldVariant: (placeholder?: unknown) => FieldVariant;
|
|
141
|
+
/**
|
|
142
|
+
* Whether the enclosing field shows a `position="start"` icon before its
|
|
143
|
+
* control's text.
|
|
144
|
+
*/
|
|
145
|
+
declare const useFieldHasStartIcon: () => boolean;
|
|
146
|
+
declare const useFieldHasValidationMessage: () => boolean;
|
|
147
|
+
/**
|
|
148
|
+
* Get how the enclosing field's floating label needs the control to make room
|
|
149
|
+
* for it, or `undefined` outside a field or without a floating label.
|
|
150
|
+
*/
|
|
151
|
+
declare const useFieldLabelPlacement: () => FieldLabelPlacement | undefined;
|
|
152
|
+
/**
|
|
153
|
+
* Get the extra height (and top text inset) a control adds for a floating
|
|
154
|
+
* label: a label floats onto an outlined control's border, so it only
|
|
155
|
+
* needs a few pixels, but inside an underlined or inlined control it needs a row.
|
|
156
|
+
*
|
|
157
|
+
* @param placement - The field's label placement.
|
|
158
|
+
* @param size - The control size.
|
|
159
|
+
* @returns The extra height, in pixels.
|
|
160
|
+
*/
|
|
161
|
+
declare const getFieldLabelInset: (placement: FieldLabelPlacement | undefined, size?: FormControlSize) => number;
|
|
162
|
+
/**
|
|
163
|
+
* Whether a control should show its placeholder: always, unless a floating
|
|
164
|
+
* label rests over the (unfocused, empty) control.
|
|
165
|
+
*/
|
|
166
|
+
declare const useFieldShouldShowPlaceholder: (value: unknown) => boolean;
|
|
167
|
+
/**
|
|
168
|
+
* Whether a floating label is floated: the field is focused or has a value.
|
|
169
|
+
*
|
|
170
|
+
* @param labelVariant - The label's variant, when the caller already knows it
|
|
171
|
+
* (the field only learns it once the label has mounted).
|
|
172
|
+
*/
|
|
173
|
+
declare const useFieldLabelFloated: (labelVariant?: FieldLabelVariant) => boolean;
|
|
174
|
+
/**
|
|
175
|
+
* Resolves the color tokens used by field icons (and their dividers): `accent`
|
|
176
|
+
* when the field has a non-base theme or a validation message, otherwise
|
|
177
|
+
* `border`. `iconColor` is a single theme key so it can be passed directly
|
|
178
|
+
* to Tamagui v3 icons, which do not resolve flat `group-hover/` values.
|
|
179
|
+
*/
|
|
180
|
+
declare const useFieldIconColor: () => {
|
|
181
|
+
iconColor: string;
|
|
182
|
+
hoverIconColor: string;
|
|
183
|
+
isNeutral: boolean;
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* The border of an outlined control whose field label floats onto it.
|
|
187
|
+
*
|
|
188
|
+
* @remarks
|
|
189
|
+
* Drawn as a native `fieldset` whose `legend` opens a gap in the border under
|
|
190
|
+
* the floated label, like Material UI's `NotchedOutline`. The label then needs
|
|
191
|
+
* no background color behind it, so the form can sit on any surface. Render it
|
|
192
|
+
* as the last child of the control's (positioned) frame, sized to the frame's
|
|
193
|
+
* border box, and drop the frame's own border.
|
|
194
|
+
*/
|
|
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>;
|
|
196
|
+
//#endregion
|
|
197
|
+
export { FieldControlOptions, FieldLabelDefaults, FieldLabelPlacement, FieldLabelVariant, FieldNotchedOutline, FieldVariant, FormControlContext, FormControlState, getFieldLabelInset, useFieldHasStartIcon, useFieldHasValidationMessage, useFieldIconColor, useFieldLabelDefaults, useFieldLabelFloated, useFieldLabelPlacement, useFieldOptions, useFieldShouldShowPlaceholder, useFieldVariant, useFormControl };
|
|
198
|
+
//# sourceMappingURL=form-control.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-control.d.cts","names":[],"sources":["../src/form-control.tsx"],"mappings":";;;;;;;;;KA+BY;;;;;KAMA;;;;;;KAOA;;;;;;;;;;;;UAaK;;EAEf;;EAGA;;EAGA;;EAGA;;EAGA,QAAQ;EAER,OAAO;EACP;EACA;EACA;EACA;;EAEA;EACA;EACA;;EAGA,WAAW;;EAGX,YAAY;EACZ;EACA;;;;;EAMA,cAAc,cAAc,UAAU;;;;;EAMtC,eAAe;;;;;EAMf,aAAa;EAEb,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;;;;;;;;cAQ5B,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;;;;;;;cAiBJ;;;;;;;;;;;;;;;cAyEA,6CAAmB,yCAAA,mCAAA,gBAAA,6BAAA,0DAAA,+CAAA,8BAAA,6BAAA,qCAAA,6BAAA,gBAAA,6BAAA,kDAAA,oDAAA,uCAAA,wCAAA,gDAAA,qDAAA,gBAAA,uCAAA,+CAAA,qDAAA"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { FormControlSize } from "./form-size.mjs";
|
|
2
|
+
import { TamaguiWebElement } from "@tamagui/core";
|
|
3
|
+
import { ReactNode, Ref, RefObject } from "react";
|
|
4
|
+
import { SelectOption } from "@stryke/types/form";
|
|
5
|
+
import { ValidationDetail } from "@stryke/types/validations";
|
|
6
|
+
//#region src/form-control.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* The field's control style (see Material UI's `TextField` variants).
|
|
9
|
+
*/
|
|
10
|
+
type FieldVariant = "outlined" | "underlined" | "inlined";
|
|
11
|
+
/**
|
|
12
|
+
* Where the field's label is displayed: floating over the control (resting
|
|
13
|
+
* inside it until the field is focused or has a value), or above it.
|
|
14
|
+
*/
|
|
15
|
+
type FieldLabelVariant = "floating" | "above";
|
|
16
|
+
/**
|
|
17
|
+
* How a control makes room for its field's floating label: `"border"` when the
|
|
18
|
+
* label floats onto an outlined control's border, `"inset"` when it floats
|
|
19
|
+
* inside an underlined or inlined control.
|
|
20
|
+
*/
|
|
21
|
+
type FieldLabelPlacement = "border" | "inset";
|
|
22
|
+
/**
|
|
23
|
+
* The state a form control (such as `Field`) shares with the input inside it.
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* Modeled on Material UI's `FormControl` context: controls such as `Input`,
|
|
27
|
+
* `Switch` or `Select` read it with {@link useFormControl} and fall back to it
|
|
28
|
+
* for any prop they are not given, so the same uncontrolled control can be
|
|
29
|
+
* used on its own or connected to a form by wrapping it in a `Field`. It holds
|
|
30
|
+
* plain values and callbacks only, so it does not tie a control to any form
|
|
31
|
+
* state library.
|
|
32
|
+
*/
|
|
33
|
+
interface FormControlState {
|
|
34
|
+
/** The field name, also used as the control's `id`. */
|
|
35
|
+
name?: string;
|
|
36
|
+
/** The field's current (parsed) value. */
|
|
37
|
+
value?: any;
|
|
38
|
+
/** The field's value formatted for display. */
|
|
39
|
+
formattedValue?: string;
|
|
40
|
+
/** The field's initial value. */
|
|
41
|
+
defaultValue?: any;
|
|
42
|
+
/** The selectable options of a field, with `selected`/`disabled` resolved. */
|
|
43
|
+
items?: SelectOption[];
|
|
44
|
+
size?: FormControlSize;
|
|
45
|
+
theme?: string;
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
required?: boolean;
|
|
48
|
+
focused?: boolean;
|
|
49
|
+
/** Whether the pointer is over the field (mirrors `group-hover/field`). */
|
|
50
|
+
hovered?: boolean;
|
|
51
|
+
clearable?: boolean;
|
|
52
|
+
hasValidationMessage: boolean;
|
|
53
|
+
/** Ref the control attaches to its native input (applies masking). */
|
|
54
|
+
inputRef?: Ref<any>;
|
|
55
|
+
/** Set the field's value. */
|
|
56
|
+
onChange?: (value: any) => void;
|
|
57
|
+
onFocus?: () => void;
|
|
58
|
+
onBlur?: () => void;
|
|
59
|
+
/**
|
|
60
|
+
* Show (or, without a message, remove) a status message the control raises
|
|
61
|
+
* itself, such as a caps lock warning, keyed by its `code`.
|
|
62
|
+
*/
|
|
63
|
+
setMessage?: (code: string, message?: ValidationDetail) => void;
|
|
64
|
+
/**
|
|
65
|
+
* Status adornments (validation icon, clear button) the field asks a text
|
|
66
|
+
* box style control to render at its end.
|
|
67
|
+
*/
|
|
68
|
+
endAdornment?: ReactNode;
|
|
69
|
+
/**
|
|
70
|
+
* The field's status icon (validation, disabled), as `Field.ThemeIcon`
|
|
71
|
+
* renders it, for controls that show it beside an item.
|
|
72
|
+
*/
|
|
73
|
+
statusIcon?: ReactNode;
|
|
74
|
+
variant: FieldVariant;
|
|
75
|
+
labelVariant: FieldLabelVariant | undefined;
|
|
76
|
+
/** How the field's control prefers its label (see {@link useFieldLabelDefaults}). */
|
|
77
|
+
labelDefaults: FieldLabelDefaults | undefined;
|
|
78
|
+
setLabelDefaults: (labelDefaults: FieldLabelDefaults | undefined) => void;
|
|
79
|
+
/** Field options the control supplies (see {@link useFieldOptions}). */
|
|
80
|
+
setControlOptions: (options: FieldControlOptions | undefined) => void;
|
|
81
|
+
hasPlaceholder: boolean;
|
|
82
|
+
endIconCount: number;
|
|
83
|
+
hasStartIcon: boolean;
|
|
84
|
+
labelContentRef: RefObject<TamaguiWebElement | null>;
|
|
85
|
+
setLabelVariant: (labelVariant: FieldLabelVariant | undefined) => void;
|
|
86
|
+
setHasPlaceholder: (hasPlaceholder: boolean) => void;
|
|
87
|
+
registerEndIcon: () => () => void;
|
|
88
|
+
registerStartIcon: () => () => void;
|
|
89
|
+
}
|
|
90
|
+
declare const FormControlContext: import("react").Context<FormControlState | undefined>;
|
|
91
|
+
/**
|
|
92
|
+
* Get the enclosing form control's state, or `undefined` outside of one.
|
|
93
|
+
*/
|
|
94
|
+
declare const useFormControl: () => FormControlState | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* How a control prefers the enclosing field's label to be displayed.
|
|
97
|
+
*/
|
|
98
|
+
interface FieldLabelDefaults {
|
|
99
|
+
/** Used when `Field.Label` sets no `variant` (text boxes float it). */
|
|
100
|
+
variant?: FieldLabelVariant;
|
|
101
|
+
/**
|
|
102
|
+
* Show a compact label beside the control (checkbox, switch): no required
|
|
103
|
+
* marker, no bottom padding, and a disabled icon next to it. The value sets
|
|
104
|
+
* the alignment of the label's row.
|
|
105
|
+
*/
|
|
106
|
+
inline?: {
|
|
107
|
+
alignItems?: "center";
|
|
108
|
+
} | {
|
|
109
|
+
alignContent?: "center";
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Register how a control prefers its field's label to be displayed.
|
|
114
|
+
*
|
|
115
|
+
* @param labelDefaults - A stable (memoized or module level) value.
|
|
116
|
+
*/
|
|
117
|
+
declare const useFieldLabelDefaults: (labelDefaults: FieldLabelDefaults) => void;
|
|
118
|
+
/**
|
|
119
|
+
* Field options (as `Field` takes them: `format`, `parse`, `mask`,
|
|
120
|
+
* `clearable`, ...) that a control supplies to its field.
|
|
121
|
+
*/
|
|
122
|
+
interface FieldControlOptions {
|
|
123
|
+
/** Options the control sets over the field's own props. */
|
|
124
|
+
overrides?: Record<string, unknown>;
|
|
125
|
+
/** Options used when the field's props leave them unset. */
|
|
126
|
+
defaults?: Record<string, unknown>;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Supply field options from a control, for example a date picker's
|
|
130
|
+
* `format`/`parse`/`mask` for its mode.
|
|
131
|
+
*
|
|
132
|
+
* @param options - A stable (memoized) value; functions inside are compared by
|
|
133
|
+
* reference.
|
|
134
|
+
*/
|
|
135
|
+
declare const useFieldOptions: (options: FieldControlOptions) => void;
|
|
136
|
+
/**
|
|
137
|
+
* Get the enclosing field's control style, registering whether the control
|
|
138
|
+
* shows a placeholder (a floating label stays floated over one).
|
|
139
|
+
*/
|
|
140
|
+
declare const useFieldVariant: (placeholder?: unknown) => FieldVariant;
|
|
141
|
+
/**
|
|
142
|
+
* Whether the enclosing field shows a `position="start"` icon before its
|
|
143
|
+
* control's text.
|
|
144
|
+
*/
|
|
145
|
+
declare const useFieldHasStartIcon: () => boolean;
|
|
146
|
+
declare const useFieldHasValidationMessage: () => boolean;
|
|
147
|
+
/**
|
|
148
|
+
* Get how the enclosing field's floating label needs the control to make room
|
|
149
|
+
* for it, or `undefined` outside a field or without a floating label.
|
|
150
|
+
*/
|
|
151
|
+
declare const useFieldLabelPlacement: () => FieldLabelPlacement | undefined;
|
|
152
|
+
/**
|
|
153
|
+
* Get the extra height (and top text inset) a control adds for a floating
|
|
154
|
+
* label: a label floats onto an outlined control's border, so it only
|
|
155
|
+
* needs a few pixels, but inside an underlined or inlined control it needs a row.
|
|
156
|
+
*
|
|
157
|
+
* @param placement - The field's label placement.
|
|
158
|
+
* @param size - The control size.
|
|
159
|
+
* @returns The extra height, in pixels.
|
|
160
|
+
*/
|
|
161
|
+
declare const getFieldLabelInset: (placement: FieldLabelPlacement | undefined, size?: FormControlSize) => number;
|
|
162
|
+
/**
|
|
163
|
+
* Whether a control should show its placeholder: always, unless a floating
|
|
164
|
+
* label rests over the (unfocused, empty) control.
|
|
165
|
+
*/
|
|
166
|
+
declare const useFieldShouldShowPlaceholder: (value: unknown) => boolean;
|
|
167
|
+
/**
|
|
168
|
+
* Whether a floating label is floated: the field is focused or has a value.
|
|
169
|
+
*
|
|
170
|
+
* @param labelVariant - The label's variant, when the caller already knows it
|
|
171
|
+
* (the field only learns it once the label has mounted).
|
|
172
|
+
*/
|
|
173
|
+
declare const useFieldLabelFloated: (labelVariant?: FieldLabelVariant) => boolean;
|
|
174
|
+
/**
|
|
175
|
+
* Resolves the color tokens used by field icons (and their dividers): `accent`
|
|
176
|
+
* when the field has a non-base theme or a validation message, otherwise
|
|
177
|
+
* `border`. `iconColor` is a single theme key so it can be passed directly
|
|
178
|
+
* to Tamagui v3 icons, which do not resolve flat `group-hover/` values.
|
|
179
|
+
*/
|
|
180
|
+
declare const useFieldIconColor: () => {
|
|
181
|
+
iconColor: string;
|
|
182
|
+
hoverIconColor: string;
|
|
183
|
+
isNeutral: boolean;
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* The border of an outlined control whose field label floats onto it.
|
|
187
|
+
*
|
|
188
|
+
* @remarks
|
|
189
|
+
* Drawn as a native `fieldset` whose `legend` opens a gap in the border under
|
|
190
|
+
* the floated label, like Material UI's `NotchedOutline`. The label then needs
|
|
191
|
+
* no background color behind it, so the form can sit on any surface. Render it
|
|
192
|
+
* as the last child of the control's (positioned) frame, sized to the frame's
|
|
193
|
+
* border box, and drop the frame's own border.
|
|
194
|
+
*/
|
|
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>;
|
|
196
|
+
//#endregion
|
|
197
|
+
export { FieldControlOptions, FieldLabelDefaults, FieldLabelPlacement, FieldLabelVariant, FieldNotchedOutline, FieldVariant, FormControlContext, FormControlState, getFieldLabelInset, useFieldHasStartIcon, useFieldHasValidationMessage, useFieldIconColor, useFieldLabelDefaults, useFieldLabelFloated, useFieldLabelPlacement, useFieldOptions, useFieldShouldShowPlaceholder, useFieldVariant, useFormControl };
|
|
198
|
+
//# sourceMappingURL=form-control.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-control.d.mts","names":[],"sources":["../src/form-control.tsx"],"mappings":""}
|
|
@@ -0,0 +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,useState as u}from"react";import{jsx as d}from"react/jsx-runtime";const f=o(void 0),p=()=>s(f),m=e=>{let t=p()?.setLabelDefaults;c(()=>{if(t)return t(e),()=>t(void 0)},[e,t])},h=e=>{let t=p()?.setControlOptions;c(()=>{if(t)return t(e),()=>t(void 0)},[e,t])},g=Symbol(`field-placeholder-unset`),_=(e=g)=>{let t=p(),n=t?.setHasPlaceholder,r=e===g?g:!!e;return c(()=>{if(r!==g&&n)return n(r),()=>n(!1)},[r,n]),t?.variant??`outlined`},v=()=>p()?.hasStartIcon??!1,y=()=>p()?.hasValidationMessage??!1,b=()=>{let e=p();return e?.labelVariant===`floating`?e.variant===`outlined`?`border`:`inset`:void 0},x=(t,n)=>t?t===`border`?3:13*e(n):0,S=e=>e!=null&&e!==``,C=e=>{let t=p();return t?.labelVariant!==`floating`||!S(e)&&!!t.focused},w=e=>{let t=p();return(e??t?.labelVariant)===`floating`&&(S(t?.formattedValue)||!!t?.focused)},T=()=>{let e=p(),t=e?.disabled,n=e?.focused,r=e?.theme,i=(!r||r===`base`)&&!e?.hasValidationMessage,a=t?i?`borderDisabled`:`disabled`:i?n?`borderActive`:`border`:n?`active`:`accent`,o=t?i?`borderDisabled`:`disabled`:i?`borderActive`:`active`;return{iconColor:e?.hovered?o:a,hoverIconColor:o,isNeutral:i}},E=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`}),D=i(n,{displayName:`FieldNotchedOutline`,render:`legend`,transition:`100ms`,height:0,padding:0,overflow:`hidden`}),O=r(E,(n,r)=>{let i=p(),o=i?.labelContentRef,s=i?.labelVariant,f=i?.size,m=w(s),h=l(null),g=a(r,h),[_,v]=u();c(()=>{let e=h.current,t=o?.current;if(!e||!t)return;let n=()=>{let n=t.getBoundingClientRect().left-e.getBoundingClientRect().left,r=t.getBoundingClientRect().width;v(e=>e?.left===n&&e.width===r?e:{left:n,width:r})};if(n(),typeof ResizeObserver>`u`)return;let r=new ResizeObserver(n);return r.observe(e),r.observe(t),()=>r.disconnect()},[o,s]);let y=t(`sm`)*e(f);return/* @__PURE__ */ d(E,{ref:g,"aria-hidden":!0,...n,children:/* @__PURE__ */ d(D,{marginLeft:Math.max(0,(_?.left??0)-y),width:m&&_?_.width+y*2:0})})},{displayName:`FieldNotchedOutline`});export{O as FieldNotchedOutline,f as FormControlContext,x as getFieldLabelInset,v as useFieldHasStartIcon,y as useFieldHasValidationMessage,T as useFieldIconColor,m as useFieldLabelDefaults,w as useFieldLabelFloated,b as useFieldLabelPlacement,h as useFieldOptions,C as useFieldShouldShowPlaceholder,_ as useFieldVariant,p as useFormControl};
|
|
2
|
+
//# sourceMappingURL=form-control.mjs.map
|
|
@@ -0,0 +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","iconColor","hoverIconColor","FieldNotchedOutlineFrame","styled","View","FieldNotchedOutlineLegend","FieldNotchedOutline","createStyledHOC","labelContentRef","floating","outlineRef","useRef","composedRef","useComposedRefs","forwardedRef","notch","setNotch","useState","outline","label","update","left","width","current","resizeObserver","gap","getSpaced","props"],"sources":[],"mappings":""}
|
package/dist/form-size.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { StyleEnv } from "./types.cjs";
|
|
2
|
-
import { getFontSized } from "./get-font-sized.cjs";
|
|
1
|
+
import { a as StyleEnv } from "./types-VwCaLyLv.cjs";
|
|
2
|
+
import { t as getFontSized } from "./get-font-sized-BOOkb_Zr.cjs";
|
|
3
3
|
import { styled } from "@tamagui/core";
|
|
4
4
|
//#region src/form-size.d.ts
|
|
5
5
|
/** The public size contract shared by form controls and field state. */
|
package/dist/form-size.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { StyleEnv } from "./types.mjs";
|
|
2
|
-
import { getFontSized } from "./get-font-sized.mjs";
|
|
1
|
+
import { a as StyleEnv } from "./types-VwCaLyLv.mjs";
|
|
2
|
+
import { t as getFontSized } from "./get-font-sized-Bouwk_EY.mjs";
|
|
3
3
|
import { styled } from "@tamagui/core";
|
|
4
4
|
//#region src/form-size.d.ts
|
|
5
5
|
/** The public size contract shared by form controls and field state. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as TokenInput } from "./token-value-sAa1meMz.cjs";
|
|
2
|
-
import { StyleEnv } from "./types.cjs";
|
|
2
|
+
import { a as StyleEnv } from "./types-VwCaLyLv.cjs";
|
|
3
3
|
//#region src/get-button-sized.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Get the sizing related style values for a button component based on the size token or number
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as TokenInput } from "./token-value-sAa1meMz.mjs";
|
|
2
|
-
import { StyleEnv } from "./types.mjs";
|
|
2
|
+
import { a as StyleEnv } from "./types-VwCaLyLv.mjs";
|
|
3
3
|
//#region src/get-button-sized.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Get the sizing related style values for a button component based on the size token or number
|
package/dist/get-colors.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColorScientificPaletteRecord, ColorStylePaletteRecord } from "./types.cjs";
|
|
1
|
+
import { n as ColorScientificPaletteRecord, r as ColorStylePaletteRecord } from "./types-VwCaLyLv.cjs";
|
|
2
2
|
//#region src/get-colors.d.ts
|
|
3
3
|
declare const createScientificPalettes: (color: string) => ColorScientificPaletteRecord;
|
|
4
4
|
declare const createStylePalettes: (color: string, scale?: number) => ColorStylePaletteRecord;
|
package/dist/get-colors.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColorScientificPaletteRecord, ColorStylePaletteRecord } from "./types.mjs";
|
|
1
|
+
import { n as ColorScientificPaletteRecord, r as ColorStylePaletteRecord } from "./types-VwCaLyLv.mjs";
|
|
2
2
|
//#region src/get-colors.d.ts
|
|
3
3
|
declare const createScientificPalettes: (color: string) => ColorScientificPaletteRecord;
|
|
4
4
|
declare const createStylePalettes: (color: string, scale?: number) => ColorStylePaletteRecord;
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-font-sized-Bouwk_EY.d.mts","names":[],"sources":["../src/get-font-sized.ts"],"mappings":""}
|
|
@@ -1,28 +1,2 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
|
|
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 { getFontSized, getFontSizedFromSize };
|
|
28
|
-
//# sourceMappingURL=get-font-sized.d.cts.map
|
|
1
|
+
import { n as getFontSizedFromSize, t as getFontSized } from "./get-font-sized-BOOkb_Zr.cjs";
|
|
2
|
+
export { getFontSized, getFontSizedFromSize };
|
|
@@ -1,28 +1,2 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
|
|
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 { getFontSized, getFontSizedFromSize };
|
|
28
|
-
//# sourceMappingURL=get-font-sized.d.mts.map
|
|
1
|
+
import { n as getFontSizedFromSize, t as getFontSized } from "./get-font-sized-Bouwk_EY.mjs";
|
|
2
|
+
export { getFontSized, getFontSizedFromSize };
|
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-
|
|
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;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { n as TokenValue, r as normalizeTokenValue, t as TokenInput } from "./token-value-sAa1meMz.cjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { a as StyleEnv, i as LCHColor, n as ColorScientificPaletteRecord, r as ColorStylePaletteRecord, t as ColorScientificPalette } from "./types-VwCaLyLv.cjs";
|
|
3
|
+
import { n as getFontSizedFromSize, t as getFontSized } from "./get-font-sized-BOOkb_Zr.cjs";
|
|
4
4
|
import { FormControlSize, FormSizeVariant, formSizeVariants, getFormFontScale, getFormFontSize, getFormSizeScale, getFormSizeToken } from "./form-size.cjs";
|
|
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";
|
|
5
6
|
import { getButtonSized } from "./get-button-sized.cjs";
|
|
6
7
|
import { createScientificPalettes, createStylePalettes } from "./get-colors.cjs";
|
|
7
8
|
import { getNearestToken } from "./get-nearest-token.cjs";
|
|
8
9
|
import { GetRadiusOptions, GetSizedOptions, fontSizeToSize, getRadius, getSizeFromFontSized, getSized, getSpaced, sizeToSpace } from "./get-sized.cjs";
|
|
9
10
|
import { GetTokenRelativeOptions, TokenRelativeType, getTokenRelative } from "./get-token-relative.cjs";
|
|
10
|
-
export { ColorScientificPalette, ColorScientificPaletteRecord, ColorStylePaletteRecord, FormControlSize, FormSizeVariant, GetRadiusOptions, GetSizedOptions, GetTokenRelativeOptions, LCHColor, StyleEnv, TokenInput, TokenRelativeType, TokenValue, createScientificPalettes, createStylePalettes, fontSizeToSize, formSizeVariants, getButtonSized, getFontSized, getFontSizedFromSize, getFormFontScale, getFormFontSize, getFormSizeScale, getFormSizeToken, getNearestToken, getRadius, getSizeFromFontSized, getSized, getSpaced, getTokenRelative, normalizeTokenValue, sizeToSpace };
|
|
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 };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { n as TokenValue, r as normalizeTokenValue, t as TokenInput } from "./token-value-sAa1meMz.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { a as StyleEnv, i as LCHColor, n as ColorScientificPaletteRecord, r as ColorStylePaletteRecord, t as ColorScientificPalette } from "./types-VwCaLyLv.mjs";
|
|
3
|
+
import { n as getFontSizedFromSize, t as getFontSized } from "./get-font-sized-Bouwk_EY.mjs";
|
|
4
4
|
import { FormControlSize, FormSizeVariant, formSizeVariants, getFormFontScale, getFormFontSize, getFormSizeScale, getFormSizeToken } from "./form-size.mjs";
|
|
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";
|
|
5
6
|
import { getButtonSized } from "./get-button-sized.mjs";
|
|
6
7
|
import { createScientificPalettes, createStylePalettes } from "./get-colors.mjs";
|
|
7
8
|
import { getNearestToken } from "./get-nearest-token.mjs";
|
|
8
9
|
import { GetRadiusOptions, GetSizedOptions, fontSizeToSize, getRadius, getSizeFromFontSized, getSized, getSpaced, sizeToSpace } from "./get-sized.mjs";
|
|
9
10
|
import { GetTokenRelativeOptions, TokenRelativeType, getTokenRelative } from "./get-token-relative.mjs";
|
|
10
|
-
export { ColorScientificPalette, ColorScientificPaletteRecord, ColorStylePaletteRecord, FormControlSize, FormSizeVariant, GetRadiusOptions, GetSizedOptions, GetTokenRelativeOptions, LCHColor, StyleEnv, TokenInput, TokenRelativeType, TokenValue, createScientificPalettes, createStylePalettes, fontSizeToSize, formSizeVariants, getButtonSized, getFontSized, getFontSizedFromSize, getFormFontScale, getFormFontSize, getFormSizeScale, getFormSizeToken, getNearestToken, getRadius, getSizeFromFontSized, getSized, getSpaced, getTokenRelative, normalizeTokenValue, sizeToSpace };
|
|
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 };
|
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 a,getFormFontScale as o,getFormFontSize as s,getFormSizeScale as c,getFormSizeToken as l}from"./form-size.mjs";import{getTokenRelative as u}from"./get-token-relative.mjs";import{
|
|
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 a,getFormFontScale as o,getFormFontSize as s,getFormSizeScale as c,getFormSizeToken as l}from"./form-size.mjs";import{getTokenRelative as u}from"./get-token-relative.mjs";import{fontSizeToSize as d,getRadius as f,getSizeFromFontSized as p,getSized as m,getSpaced as h,sizeToSpace as g}from"./get-sized.mjs";import{FieldNotchedOutline as _,FormControlContext as v,getFieldLabelInset as y,useFieldHasStartIcon as b,useFieldHasValidationMessage as x,useFieldIconColor as S,useFieldLabelDefaults as C,useFieldLabelFloated as w,useFieldLabelPlacement as T,useFieldOptions as E,useFieldShouldShowPlaceholder as D,useFieldVariant as O,useFormControl as k}from"./form-control.mjs";import{getButtonSized as A}from"./get-button-sized.mjs";import{createScientificPalettes as j,createStylePalettes as M}from"./get-colors.mjs";export{e as ColorScientificPalette,_ as FieldNotchedOutline,v as FormControlContext,j as createScientificPalettes,M as createStylePalettes,d as fontSizeToSize,a as formSizeVariants,A as getButtonSized,y as getFieldLabelInset,r as getFontSized,i as getFontSizedFromSize,o as getFormFontScale,s as getFormFontSize,c as getFormSizeScale,l as getFormSizeToken,n as getNearestToken,f as getRadius,p as getSizeFromFontSized,m as getSized,h as getSpaced,u as getTokenRelative,t as normalizeTokenValue,g as sizeToSpace,b as useFieldHasStartIcon,x as useFieldHasValidationMessage,S as useFieldIconColor,C as useFieldLabelDefaults,w as useFieldLabelFloated,T as useFieldLabelPlacement,E as useFieldOptions,D as useFieldShouldShowPlaceholder,O as useFieldVariant,k as useFormControl};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Font, FontFamilyTokens, TokensParsed } from "@tamagui/core";
|
|
2
|
+
import { Color } from "chroma-js";
|
|
3
|
+
//#region src/types.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* The subset of Tamagui v3's `styled.dynamic` environment these helpers read.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Tamagui does not export its `StyledDynamicEnv` type; the environment it
|
|
9
|
+
* passes to `styled.dynamic` callbacks and `.resolve` resolvers is a superset
|
|
10
|
+
* of this shape. Unlike v2 variant extras, it never carries component props.
|
|
11
|
+
*/
|
|
12
|
+
interface StyleEnv {
|
|
13
|
+
tokens?: TokensParsed;
|
|
14
|
+
font?: Font;
|
|
15
|
+
fontFamily?: FontFamilyTokens;
|
|
16
|
+
}
|
|
17
|
+
type ColorScientificPalette = "surrounding" | "analogous" | "triadic" | "tetradic" | "complementary" | "splitComplementary";
|
|
18
|
+
declare const ColorScientificPalette: {
|
|
19
|
+
SURROUNDING: ColorScientificPalette;
|
|
20
|
+
ANALOGOUS: ColorScientificPalette;
|
|
21
|
+
TRIADIC: ColorScientificPalette;
|
|
22
|
+
TETRADIC: ColorScientificPalette;
|
|
23
|
+
COMPLEMENTARY: ColorScientificPalette;
|
|
24
|
+
SPLIT_COMPLEMENTARY: ColorScientificPalette;
|
|
25
|
+
};
|
|
26
|
+
interface LCHColor {
|
|
27
|
+
l: number;
|
|
28
|
+
c: number;
|
|
29
|
+
h: number;
|
|
30
|
+
mode: "lch";
|
|
31
|
+
}
|
|
32
|
+
type ColorScientificPaletteRecord = Record<ColorScientificPalette, Color[]>;
|
|
33
|
+
type ColorStylePaletteRecord = Record<ColorScientificPalette, string[]>;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { StyleEnv as a, LCHColor as i, ColorScientificPaletteRecord as n, ColorStylePaletteRecord as r, ColorScientificPalette as t };
|
|
36
|
+
//# sourceMappingURL=types-VwCaLyLv.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Font, FontFamilyTokens, TokensParsed } from "@tamagui/core";
|
|
2
|
+
import { Color } from "chroma-js";
|
|
3
|
+
//#region src/types.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* The subset of Tamagui v3's `styled.dynamic` environment these helpers read.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Tamagui does not export its `StyledDynamicEnv` type; the environment it
|
|
9
|
+
* passes to `styled.dynamic` callbacks and `.resolve` resolvers is a superset
|
|
10
|
+
* of this shape. Unlike v2 variant extras, it never carries component props.
|
|
11
|
+
*/
|
|
12
|
+
interface StyleEnv {
|
|
13
|
+
tokens?: TokensParsed;
|
|
14
|
+
font?: Font;
|
|
15
|
+
fontFamily?: FontFamilyTokens;
|
|
16
|
+
}
|
|
17
|
+
type ColorScientificPalette = "surrounding" | "analogous" | "triadic" | "tetradic" | "complementary" | "splitComplementary";
|
|
18
|
+
declare const ColorScientificPalette: {
|
|
19
|
+
SURROUNDING: ColorScientificPalette;
|
|
20
|
+
ANALOGOUS: ColorScientificPalette;
|
|
21
|
+
TRIADIC: ColorScientificPalette;
|
|
22
|
+
TETRADIC: ColorScientificPalette;
|
|
23
|
+
COMPLEMENTARY: ColorScientificPalette;
|
|
24
|
+
SPLIT_COMPLEMENTARY: ColorScientificPalette;
|
|
25
|
+
};
|
|
26
|
+
interface LCHColor {
|
|
27
|
+
l: number;
|
|
28
|
+
c: number;
|
|
29
|
+
h: number;
|
|
30
|
+
mode: "lch";
|
|
31
|
+
}
|
|
32
|
+
type ColorScientificPaletteRecord = Record<ColorScientificPalette, Color[]>;
|
|
33
|
+
type ColorStylePaletteRecord = Record<ColorScientificPalette, string[]>;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { StyleEnv as a, LCHColor as i, ColorScientificPaletteRecord as n, ColorStylePaletteRecord as r, ColorScientificPalette as t };
|
|
36
|
+
//# sourceMappingURL=types-VwCaLyLv.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-VwCaLyLv.d.mts","names":[],"sources":["../src/types.ts"],"mappings":""}
|
package/dist/types.d.cts
CHANGED
|
@@ -1,36 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
//#region src/types.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* The subset of Tamagui v3's `styled.dynamic` environment these helpers read.
|
|
6
|
-
*
|
|
7
|
-
* @remarks
|
|
8
|
-
* Tamagui does not export its `StyledDynamicEnv` type; the environment it
|
|
9
|
-
* passes to `styled.dynamic` callbacks and `.resolve` resolvers is a superset
|
|
10
|
-
* of this shape. Unlike v2 variant extras, it never carries component props.
|
|
11
|
-
*/
|
|
12
|
-
interface StyleEnv {
|
|
13
|
-
tokens?: TokensParsed;
|
|
14
|
-
font?: Font;
|
|
15
|
-
fontFamily?: FontFamilyTokens;
|
|
16
|
-
}
|
|
17
|
-
type ColorScientificPalette = "surrounding" | "analogous" | "triadic" | "tetradic" | "complementary" | "splitComplementary";
|
|
18
|
-
declare const ColorScientificPalette: {
|
|
19
|
-
SURROUNDING: ColorScientificPalette;
|
|
20
|
-
ANALOGOUS: ColorScientificPalette;
|
|
21
|
-
TRIADIC: ColorScientificPalette;
|
|
22
|
-
TETRADIC: ColorScientificPalette;
|
|
23
|
-
COMPLEMENTARY: ColorScientificPalette;
|
|
24
|
-
SPLIT_COMPLEMENTARY: ColorScientificPalette;
|
|
25
|
-
};
|
|
26
|
-
interface LCHColor {
|
|
27
|
-
l: number;
|
|
28
|
-
c: number;
|
|
29
|
-
h: number;
|
|
30
|
-
mode: "lch";
|
|
31
|
-
}
|
|
32
|
-
type ColorScientificPaletteRecord = Record<ColorScientificPalette, Color[]>;
|
|
33
|
-
type ColorStylePaletteRecord = Record<ColorScientificPalette, string[]>;
|
|
34
|
-
//#endregion
|
|
35
|
-
export { ColorScientificPalette, ColorScientificPaletteRecord, ColorStylePaletteRecord, LCHColor, StyleEnv };
|
|
36
|
-
//# sourceMappingURL=types.d.cts.map
|
|
1
|
+
import { a as StyleEnv, i as LCHColor, n as ColorScientificPaletteRecord, r as ColorStylePaletteRecord, t as ColorScientificPalette } from "./types-VwCaLyLv.cjs";
|
|
2
|
+
export { ColorScientificPalette, ColorScientificPaletteRecord, ColorStylePaletteRecord, LCHColor, StyleEnv };
|
package/dist/types.d.mts
CHANGED
|
@@ -1,36 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
//#region src/types.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* The subset of Tamagui v3's `styled.dynamic` environment these helpers read.
|
|
6
|
-
*
|
|
7
|
-
* @remarks
|
|
8
|
-
* Tamagui does not export its `StyledDynamicEnv` type; the environment it
|
|
9
|
-
* passes to `styled.dynamic` callbacks and `.resolve` resolvers is a superset
|
|
10
|
-
* of this shape. Unlike v2 variant extras, it never carries component props.
|
|
11
|
-
*/
|
|
12
|
-
interface StyleEnv {
|
|
13
|
-
tokens?: TokensParsed;
|
|
14
|
-
font?: Font;
|
|
15
|
-
fontFamily?: FontFamilyTokens;
|
|
16
|
-
}
|
|
17
|
-
type ColorScientificPalette = "surrounding" | "analogous" | "triadic" | "tetradic" | "complementary" | "splitComplementary";
|
|
18
|
-
declare const ColorScientificPalette: {
|
|
19
|
-
SURROUNDING: ColorScientificPalette;
|
|
20
|
-
ANALOGOUS: ColorScientificPalette;
|
|
21
|
-
TRIADIC: ColorScientificPalette;
|
|
22
|
-
TETRADIC: ColorScientificPalette;
|
|
23
|
-
COMPLEMENTARY: ColorScientificPalette;
|
|
24
|
-
SPLIT_COMPLEMENTARY: ColorScientificPalette;
|
|
25
|
-
};
|
|
26
|
-
interface LCHColor {
|
|
27
|
-
l: number;
|
|
28
|
-
c: number;
|
|
29
|
-
h: number;
|
|
30
|
-
mode: "lch";
|
|
31
|
-
}
|
|
32
|
-
type ColorScientificPaletteRecord = Record<ColorScientificPalette, Color[]>;
|
|
33
|
-
type ColorStylePaletteRecord = Record<ColorScientificPalette, string[]>;
|
|
34
|
-
//#endregion
|
|
35
|
-
export { ColorScientificPalette, ColorScientificPaletteRecord, ColorStylePaletteRecord, LCHColor, StyleEnv };
|
|
36
|
-
//# sourceMappingURL=types.d.mts.map
|
|
1
|
+
import { a as StyleEnv, i as LCHColor, n as ColorScientificPaletteRecord, r as ColorStylePaletteRecord, t as ColorScientificPalette } from "./types-VwCaLyLv.mjs";
|
|
2
|
+
export { ColorScientificPalette, ColorScientificPaletteRecord, ColorStylePaletteRecord, 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.12",
|
|
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": {
|
|
@@ -24,6 +24,20 @@
|
|
|
24
24
|
"default": "./dist/index.mjs"
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
|
+
"./form-control": {
|
|
28
|
+
"require": {
|
|
29
|
+
"types": "./dist/form-control.d.cts",
|
|
30
|
+
"default": "./dist/form-control.cjs"
|
|
31
|
+
},
|
|
32
|
+
"import": {
|
|
33
|
+
"types": "./dist/form-control.d.mts",
|
|
34
|
+
"default": "./dist/form-control.mjs"
|
|
35
|
+
},
|
|
36
|
+
"default": {
|
|
37
|
+
"types": "./dist/form-control.d.mts",
|
|
38
|
+
"default": "./dist/form-control.mjs"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
27
41
|
"./form-size": {
|
|
28
42
|
"require": {
|
|
29
43
|
"types": "./dist/form-size.d.cts",
|
|
@@ -157,17 +171,19 @@
|
|
|
157
171
|
"dependencies": {
|
|
158
172
|
"@stryke/type-checks": "^0.6.49",
|
|
159
173
|
"@stryke/types": "^0.12.44",
|
|
160
|
-
"@tamagui/constants": "3.0.
|
|
161
|
-
"@tamagui/core": "3.0.
|
|
174
|
+
"@tamagui/constants": "3.0.2",
|
|
175
|
+
"@tamagui/core": "3.0.2",
|
|
162
176
|
"chroma-js": "^2.6.0"
|
|
163
177
|
},
|
|
164
178
|
"devDependencies": {
|
|
165
179
|
"@powerlines/plugin-tamagui": "^0.1.666",
|
|
166
180
|
"@powerlines/plugin-tsdown": "^0.1.615",
|
|
167
181
|
"@types/chroma-js": "^2.4.5",
|
|
168
|
-
"powerlines": "^0.47.214"
|
|
182
|
+
"powerlines": "^0.47.214",
|
|
183
|
+
"react": "^19.3.0"
|
|
169
184
|
},
|
|
170
185
|
"publishConfig": { "access": "public" },
|
|
171
186
|
"module": "./dist/index.mjs",
|
|
172
|
-
"
|
|
187
|
+
"peerDependencies": { "react": "^19.3.0" },
|
|
188
|
+
"gitHead": "12d526b0a408b1e362c9cb449bfc10567d49575d"
|
|
173
189
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-font-sized.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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-font-sized.d.mts","names":[],"sources":["../src/get-font-sized.ts"],"mappings":""}
|
package/dist/types.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.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"}
|
package/dist/types.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","names":[],"sources":["../src/types.ts"],"mappings":""}
|