@cyclone-ui/state 0.0.17 → 0.0.19
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 +16 -0
- package/dist/form/hooks/use-field-actions.cjs +1 -1
- package/dist/form/hooks/use-field-actions.mjs +1 -1
- package/dist/form/molecules/field-molecule.cjs +5 -2
- package/dist/form/molecules/field-molecule.mjs +5 -2
- package/dist/form/types.d.cts +6 -0
- package/dist/form/types.d.cts.map +1 -1
- package/dist/form/types.d.mts +6 -0
- package/dist/message/hooks/use-message-actions.cjs +2 -1
- package/dist/message/hooks/use-message-actions.mjs +2 -1
- package/dist/message/providers/MessageProvider.d.cts.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog for Cyclone UI - State
|
|
4
4
|
|
|
5
|
+
## [0.0.18](https://github.com/storm-software/cyclone-ui/releases/tag/state%400.0.18) (10/14/2026)
|
|
6
|
+
|
|
7
|
+
### Updated Dependencies
|
|
8
|
+
|
|
9
|
+
- Updated **helpers** to **v0.3.17**
|
|
10
|
+
|
|
11
|
+
## [0.0.17](https://github.com/storm-software/cyclone-ui/releases/tag/state%400.0.17) (10/13/2026)
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
- **monorepo:** Clean up of various components and tokens ([08a494ad](https://github.com/storm-software/cyclone-ui/commit/08a494ad))
|
|
16
|
+
|
|
17
|
+
### Updated Dependencies
|
|
18
|
+
|
|
19
|
+
- Updated **helpers** to **v0.3.16**
|
|
20
|
+
|
|
5
21
|
## [0.0.16](https://github.com/storm-software/cyclone-ui/releases/tag/state%400.0.16) (10/12/2026)
|
|
6
22
|
|
|
7
23
|
### Features
|
|
@@ -70,7 +70,7 @@ const useFieldActions = () => {
|
|
|
70
70
|
const toggleFocused = (0, jotai_utils.useAtomCallback)((0, react.useCallback)(async (get) => setFocused(!get(field.focused)), [setFocused]));
|
|
71
71
|
return {
|
|
72
72
|
mount: (0, jotai_utils.useAtomCallback)((0, react.useCallback)(async (get, set, ref, tabIndex) => {
|
|
73
|
-
set(field.ref, ref);
|
|
73
|
+
set(field.ref, () => ref);
|
|
74
74
|
set(field.tabIndex, tabIndex ?? 0);
|
|
75
75
|
if (!get(field.initialValue)) {
|
|
76
76
|
const options = get(field.options);
|
|
@@ -70,7 +70,7 @@ const useFieldActions = () => {
|
|
|
70
70
|
const toggleFocused = useAtomCallback(useCallback(async (get) => setFocused(!get(field.focused)), [setFocused]));
|
|
71
71
|
return {
|
|
72
72
|
mount: useAtomCallback(useCallback(async (get, set, ref, tabIndex) => {
|
|
73
|
-
set(field.ref, ref);
|
|
73
|
+
set(field.ref, () => ref);
|
|
74
74
|
set(field.tabIndex, tabIndex ?? 0);
|
|
75
75
|
if (!get(field.initialValue)) {
|
|
76
76
|
const options = get(field.options);
|
|
@@ -68,14 +68,17 @@ const FieldApi = require_create_molecule.createMoleculeApi((scope) => {
|
|
|
68
68
|
const dirtyAtom = (0, jotai.atom)((get) => {
|
|
69
69
|
return get(optionsAtom).isEqual(get(valueAtom), get(initialValueAtom));
|
|
70
70
|
});
|
|
71
|
-
const
|
|
71
|
+
const showErrorsAtom = (0, jotai.atom)((get) => Boolean(get(optionsAtom).showErrorsBeforeBlur) || Boolean(get(blurredAtom)) || get(form.submitAttempts) > 0);
|
|
72
|
+
const allErrorsAtom = require_atom_with_messages.atomWithFieldsMessageTypes(validationResultsAtom, "danger");
|
|
73
|
+
const errorsAtom = (0, jotai.atom)((get) => get(showErrorsAtom) ? get(allErrorsAtom) : []);
|
|
72
74
|
const warningsAtom = require_atom_with_messages.atomWithFieldsMessageTypes(validationResultsAtom, "warning");
|
|
73
75
|
const infoAtom = require_atom_with_messages.atomWithFieldsMessageTypes(validationResultsAtom, "info");
|
|
74
76
|
const discoveryAtom = require_atom_with_messages.atomWithFieldsMessageTypes(validationResultsAtom, "discovery");
|
|
75
77
|
const successesAtom = require_atom_with_messages.atomWithFieldsMessageTypes(validationResultsAtom, "success");
|
|
76
78
|
const positivesAtom = require_atom_with_messages.atomWithFieldsMessageTypes(validationResultsAtom, "positive");
|
|
77
79
|
const negativesAtom = require_atom_with_messages.atomWithFieldsMessageTypes(validationResultsAtom, "negative");
|
|
78
|
-
const
|
|
80
|
+
const allErrorMessagesAtom = require_atom_with_messages.atomWithFieldsMessageList(validationResultsAtom, "danger");
|
|
81
|
+
const errorMessagesAtom = (0, jotai.atom)((get) => get(showErrorsAtom) ? get(allErrorMessagesAtom) : []);
|
|
79
82
|
const warningMessagesAtom = require_atom_with_messages.atomWithFieldsMessageList(validationResultsAtom, "warning");
|
|
80
83
|
const infoMessagesAtom = require_atom_with_messages.atomWithFieldsMessageList(validationResultsAtom, "info");
|
|
81
84
|
const discoveryMessagesAtom = require_atom_with_messages.atomWithFieldsMessageList(validationResultsAtom, "discovery");
|
|
@@ -68,14 +68,17 @@ const FieldApi = createMoleculeApi((scope) => {
|
|
|
68
68
|
const dirtyAtom = atom((get) => {
|
|
69
69
|
return get(optionsAtom).isEqual(get(valueAtom), get(initialValueAtom));
|
|
70
70
|
});
|
|
71
|
-
const
|
|
71
|
+
const showErrorsAtom = atom((get) => Boolean(get(optionsAtom).showErrorsBeforeBlur) || Boolean(get(blurredAtom)) || get(form.submitAttempts) > 0);
|
|
72
|
+
const allErrorsAtom = atomWithFieldsMessageTypes(validationResultsAtom, "danger");
|
|
73
|
+
const errorsAtom = atom((get) => get(showErrorsAtom) ? get(allErrorsAtom) : []);
|
|
72
74
|
const warningsAtom = atomWithFieldsMessageTypes(validationResultsAtom, "warning");
|
|
73
75
|
const infoAtom = atomWithFieldsMessageTypes(validationResultsAtom, "info");
|
|
74
76
|
const discoveryAtom = atomWithFieldsMessageTypes(validationResultsAtom, "discovery");
|
|
75
77
|
const successesAtom = atomWithFieldsMessageTypes(validationResultsAtom, "success");
|
|
76
78
|
const positivesAtom = atomWithFieldsMessageTypes(validationResultsAtom, "positive");
|
|
77
79
|
const negativesAtom = atomWithFieldsMessageTypes(validationResultsAtom, "negative");
|
|
78
|
-
const
|
|
80
|
+
const allErrorMessagesAtom = atomWithFieldsMessageList(validationResultsAtom, "danger");
|
|
81
|
+
const errorMessagesAtom = atom((get) => get(showErrorsAtom) ? get(allErrorMessagesAtom) : []);
|
|
79
82
|
const warningMessagesAtom = atomWithFieldsMessageList(validationResultsAtom, "warning");
|
|
80
83
|
const infoMessagesAtom = atomWithFieldsMessageList(validationResultsAtom, "info");
|
|
81
84
|
const discoveryMessagesAtom = atomWithFieldsMessageList(validationResultsAtom, "discovery");
|
package/dist/form/types.d.cts
CHANGED
|
@@ -186,6 +186,12 @@ interface FieldOptions<TFieldValue> {
|
|
|
186
186
|
* The validations to run on the field when certain events occur.
|
|
187
187
|
*/
|
|
188
188
|
validate?: Partial<Record<`on${Capitalize<ValidationCause>}`, Validator<TFieldValue>[] | undefined>>;
|
|
189
|
+
/**
|
|
190
|
+
* Show error messages while the user is still editing the field. By default they stay hidden until the field is blurred or the form is submitted.
|
|
191
|
+
*
|
|
192
|
+
* @defaultValue false
|
|
193
|
+
*/
|
|
194
|
+
showErrorsBeforeBlur?: boolean;
|
|
189
195
|
/**
|
|
190
196
|
* How long to debounce the `onChange` event and validation calls in milliseconds.
|
|
191
197
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","names":["ValidationDetails"],"sources":["../../src/form/types.ts"],"mappings":";;;;;;;;;;;;;;;KA4CY;cAGC;EACiB,YAAA;EACR,QAAA;EACJ,MAAA;EACI,QAAA;EACA,QAAA;;KAGV,UAAU,iBACpB,OAAO,QACP,eAAe,QACf,OAAO,iBACP,KAAK,QACL,KAAK,WACF,aAAaA;KAEN,oBAAoB,QAC9B,OAAO,iBAAiBA;;;;KAMd;KA6BA,gBAAgB,SAAS,UACnC,cAAc,2BAEP,cAAc,UAAU,gBAAgB,QAAQ,OAAO,aAE1D;KAEM,eAAe,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;EACX,SAAS,aACP,gBAAgB,wBACf,eAAe,gBAAgB;EAGlC,SAAS,aACP,gBAAgB,wBACf,eAAe,gBAAgB;EAGlC,YAAY,aACV,gBAAgB,wBACf,eAAe,gBAAgB;EAGlC,mBAAmB,aACjB,gBAAgB,aAAa,qBAC5B,eAAe,gBAAgB,aAAa;EAG/C,UAAU,aACR,gBAAgB,uBACf,eAAe,gBAAgB;EAGlC,KAAK,aACH,gBAAgB,aAAa,IAAI,qBAChC,eAAe,gBAAgB,aAAa,IAAI;EAInD,UAAU;EACV,OAAO;EAEP,eAAe,KAAK;EACpB,cAAc,aAAa,cAAc,eAAe;EACxD,OAAO,aAAa,cAAc,eAAe;EACjD,gBAAgB;EAEhB,OAAO,aACL,aAAa,+BACZ,eAAe,aAAa;EAG/B,YAAY,aACV,cAAc,aAAa,gCAC1B,gBAAgB,aAAa;EAIhC,MAAM,aAAa,kBAAkB,eAAe;EAEpD,QAAQ,KAAKA;EACb,UAAU,KAAKA;EACf,MAAM,KAAKA;EACX,WAAW,KAAKA;EAChB,SAAS,KAAKA;EACd,UAAU,KAAKA;EACf,UAAU,KAAKA;EAEf,gBAAgB,KAAKA;EACrB,iBAAiB,KAAKA;EACtB,cAAc,KAAKA;EACnB,mBAAmB,KAAKA;EACxB,iBAAiB,KAAKA;EACtB,kBAAkB,KAAKA;EACvB,kBAAkB,KAAKA;EAEvB,OAAO;EACP,UAAU,KAAKA;EAEf,SAAS;EACT,OAAO"}
|
package/dist/form/types.d.mts
CHANGED
|
@@ -186,6 +186,12 @@ interface FieldOptions<TFieldValue> {
|
|
|
186
186
|
* The validations to run on the field when certain events occur.
|
|
187
187
|
*/
|
|
188
188
|
validate?: Partial<Record<`on${Capitalize<ValidationCause>}`, Validator<TFieldValue>[] | undefined>>;
|
|
189
|
+
/**
|
|
190
|
+
* Show error messages while the user is still editing the field. By default they stay hidden until the field is blurred or the form is submitted.
|
|
191
|
+
*
|
|
192
|
+
* @defaultValue false
|
|
193
|
+
*/
|
|
194
|
+
showErrorsBeforeBlur?: boolean;
|
|
189
195
|
/**
|
|
190
196
|
* How long to debounce the `onChange` event and validation calls in milliseconds.
|
|
191
197
|
*
|
|
@@ -11,12 +11,13 @@ const useMessageActions = () => {
|
|
|
11
11
|
description: heading ? message : void 0
|
|
12
12
|
};
|
|
13
13
|
switch (type) {
|
|
14
|
-
case "
|
|
14
|
+
case "danger":
|
|
15
15
|
_tamagui_toast.toast.error(title, data);
|
|
16
16
|
break;
|
|
17
17
|
case "warning":
|
|
18
18
|
_tamagui_toast.toast.warning(title, data);
|
|
19
19
|
break;
|
|
20
|
+
case "discovery":
|
|
20
21
|
case "info":
|
|
21
22
|
_tamagui_toast.toast.info(title, data);
|
|
22
23
|
break;
|
|
@@ -11,12 +11,13 @@ const useMessageActions = () => {
|
|
|
11
11
|
description: heading ? message : void 0
|
|
12
12
|
};
|
|
13
13
|
switch (type) {
|
|
14
|
-
case "
|
|
14
|
+
case "danger":
|
|
15
15
|
toast.error(title, data);
|
|
16
16
|
break;
|
|
17
17
|
case "warning":
|
|
18
18
|
toast.warning(title, data);
|
|
19
19
|
break;
|
|
20
|
+
case "discovery":
|
|
20
21
|
case "info":
|
|
21
22
|
toast.info(title, data);
|
|
22
23
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageProvider.d.cts","names":[],"sources":["../../../src/message/providers/MessageProvider.tsx"],"mappings":";;;;;KAuBY,uBAAuB;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"MessageProvider.d.cts","names":[],"sources":["../../../src/message/providers/MessageProvider.tsx"],"mappings":";;;;;KAuBY,uBAAuB;;;;;;;;;;;;cAgBtB,oBAAmB,YAAc,yCAAoB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyclone-ui/state",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A state management package used to handle state in Storm Software applications.",
|
|
6
6
|
"repository": {
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
"optics-ts": "^2.4.1",
|
|
133
133
|
"react-native-safe-area-context": "^4.14.1",
|
|
134
134
|
"valibot": "^0.42.1",
|
|
135
|
-
"@cyclone-ui/helpers": "0.3.
|
|
135
|
+
"@cyclone-ui/helpers": "0.3.18"
|
|
136
136
|
},
|
|
137
137
|
"devDependencies": {
|
|
138
138
|
"@powerlines/plugin-tsdown": "^0.1.615",
|
|
@@ -143,5 +143,5 @@
|
|
|
143
143
|
},
|
|
144
144
|
"publishConfig": { "access": "public" },
|
|
145
145
|
"module": "./dist/index.mjs",
|
|
146
|
-
"gitHead": "
|
|
146
|
+
"gitHead": "afcbef21608f66480e2ac1289df054668696ac78"
|
|
147
147
|
}
|