@nice2dev/ui-core 1.1.5 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/core/NiceFieldStatus.d.ts +0 -1
  3. package/dist/core/NiceInlineHelp.d.ts +0 -1
  4. package/dist/core/NiceThemeProvider.d.ts +0 -1
  5. package/dist/core/NiceThemeVariants.d.ts +0 -1
  6. package/dist/core/NiceUserPreferences.d.ts +0 -1
  7. package/dist/core/a11y-advanced.d.ts +0 -1
  8. package/dist/core/a11y.d.ts +0 -1
  9. package/dist/core/access-control.d.ts +0 -1
  10. package/dist/core/adapters.d.ts +0 -1
  11. package/dist/core/ai.d.ts +0 -1
  12. package/dist/core/animations.d.ts +0 -1
  13. package/dist/core/colorBlind.d.ts +0 -1
  14. package/dist/core/datasource-advanced.d.ts +0 -1
  15. package/dist/core/datasource-aggregation.d.ts +0 -1
  16. package/dist/core/datasource-hooks.d.ts +0 -1
  17. package/dist/core/datasource-offline.d.ts +0 -1
  18. package/dist/core/datasource.d.ts +0 -1
  19. package/dist/core/deprecation.d.ts +0 -1
  20. package/dist/core/displayMode.d.ts +0 -1
  21. package/dist/core/displayStyle.d.ts +0 -1
  22. package/dist/core/filterToSql.d.ts +0 -1
  23. package/dist/core/helpContext.d.ts +0 -1
  24. package/dist/core/hooks.d.ts +0 -1
  25. package/dist/core/i18n.d.ts +0 -1
  26. package/dist/core/i18nDictionaries.d.ts +0 -1
  27. package/dist/core/icons.d.ts +0 -1
  28. package/dist/core/icuMessageFormat.d.ts +0 -1
  29. package/dist/core/leak-detector.d.ts +0 -1
  30. package/dist/core/omniverkTypes.d.ts +0 -1
  31. package/dist/core/pluginSystem.d.ts +0 -1
  32. package/dist/core/profiling.d.ts +0 -1
  33. package/dist/core/responsive.d.ts +0 -1
  34. package/dist/core/rtl.d.ts +0 -1
  35. package/dist/core/sanitizeHtml.d.ts +0 -1
  36. package/dist/core/spatialNav.d.ts +0 -1
  37. package/dist/core/standardProps.d.ts +0 -1
  38. package/dist/core/testing.d.ts +0 -1
  39. package/dist/core/theme.d.ts +0 -1
  40. package/dist/core/themeGallery.d.ts +0 -1
  41. package/dist/core/themePacks.d.ts +0 -1
  42. package/dist/core/themePacksExtended.d.ts +0 -1
  43. package/dist/core/themePresets.d.ts +0 -1
  44. package/dist/core/themeVariants.d.ts +0 -1
  45. package/dist/core/touch.d.ts +0 -1
  46. package/dist/core/traceless.d.ts +0 -1
  47. package/dist/core/tutorials.d.ts +0 -1
  48. package/dist/core/types.d.ts +0 -1
  49. package/dist/core/useControllableState.d.ts +20 -5
  50. package/dist/core/useGamepad.d.ts +0 -1
  51. package/dist/core/useThemeIsDark.d.ts +0 -1
  52. package/dist/core/validation.d.ts +0 -1
  53. package/dist/index.cjs +22 -23
  54. package/dist/index.d.ts +0 -1
  55. package/dist/index.mjs +1099 -1081
  56. package/dist/performance/concurrent.d.ts +0 -1
  57. package/dist/performance/images.d.ts +0 -1
  58. package/dist/performance/index.d.ts +0 -1
  59. package/dist/performance/memory.d.ts +0 -1
  60. package/dist/performance/virtualization.d.ts +0 -1
  61. package/dist/performance/workers.d.ts +0 -1
  62. package/dist/viewSchema.d.ts +0 -1
  63. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,57 @@
1
1
  # @nice2dev/ui-core — Changelog
2
2
 
3
+ ## 1.1.7
4
+
5
+ ### Patch Changes
6
+
7
+ - Close the three items left open in the 1.1.6 response to OmniVerk.
8
+
9
+ **Every value control works without state in the parent.** The `audit-controllable-state` gate
10
+ counted 87 value props that were required with no `default*`, so the control could not render from a
11
+ manifest without data. It now reports 0 and gates CI at `--max=0`. 48 controls gained `default*` props
12
+ through `useControllableState` (existing `value` + handler call sites behave as before); 33 read-only
13
+ data lists are optional with a stable empty default; 4 props paired with a handler only by name are
14
+ optional; `NiceWhiteboard` and `NiceMetricsDashboard` render an empty state until a session or
15
+ dashboard arrives. Additive API only — nothing renamed or removed.
16
+
17
+ - `NicePivotGrid.fields`, `NiceScheduler.events` and `NiceGitHooks.hooks` are controlled only together
18
+ with their change handler, as `NiceScheduler` already documented for `currentDate`/`view`. A bare
19
+ prop stays an initial value; prop plus handler now always wins (later prop updates used to be
20
+ ignored). `NiceGitHooks.onHookChange` is now called; `onHooksChange` and
21
+ `NiceLocaleManager.onTranslationsChange` are new.
22
+ - `NiceCodeEditor` / `NiceCodeDiffEditor` no longer report a value written from the prop back through
23
+ `onChange`, and call the latest handler rather than the one captured at mount.
24
+ - `NiceHtmlEditor` no longer rewrites its content on every render (React 19 compares the
25
+ `dangerouslySetInnerHTML` object, not its string), which moved the caret; the HTML source and
26
+ Markdown views can be closed again.
27
+ - Selections seeded once from the first item (access manager, automation/scene editors, git diff
28
+ viewer, ribbon, setup wizard) follow data that arrives after mount.
29
+ - `useControllableState`: new `fallbackValue` seed that never triggers the value/default clash warning;
30
+ two functional updates in one tick no longer lose the first; `onChange` is called with one argument
31
+ when there is no meta. `UseControllableStateOptions` is now a union type alias.
32
+
33
+ **`--nice-*` is the source of truth for design tokens.** Controls read only `--nice-*` (9,225 reads in
34
+ 339 files). The unprefixed names (`--color-primary`, `--bg-primary`, `--text-muted`, …) stay declared
35
+ as aliases pointing at the Nice tokens, so reading them works, but setting them no longer repaints Nice
36
+ controls. Apps that relied on that can import `@nice2dev/ui/css/legacy-bg-text-aliases.css` after
37
+ `style.css` (removed in 1.2), or set `--nice-color-primary` and friends directly. 13 tokens that were
38
+ read and never declared (`--color-danger`, `--text-on-primary`, `--color-white`, …) are defined; the
39
+ dark blocks define the canonical names, so `.nice-dark` on `<body>` no longer leaves them on light
40
+ values; `--nice-primary-bg` and `--nice-selected-bg` are a primary tint instead of falling through to
41
+ grey. New gate `audit-token-names`.
42
+
43
+ **Node ESM and `require()`.** `@nice2dev/spatial-core` imports from plain Node ESM (51 relative
44
+ specifiers gained extensions, enforced by `nodenext`), and so does `@nice2dev/ui-buildings`, which
45
+ failed through it. `require()` works for `ui-3d`, `ui-graphics` and `game-engine`. The package-exports
46
+ gate now loads every entry in both module systems.
47
+
48
+ **Hygiene.** Sources are prettier-formatted and CI gates on it; 640 stale `.d.ts` files were removed
49
+ from source trees (never published).
50
+
51
+ ## 1.1.6
52
+
53
+ No changes in this release.
54
+
3
55
  ## 1.1.5
4
56
 
5
57
  No changes in this release.
@@ -13,4 +13,3 @@ export interface NiceFieldStatusProps {
13
13
  testId?: string;
14
14
  }
15
15
  export declare function NiceFieldStatus(props: NiceFieldStatusProps): React.ReactElement | null;
16
- //# sourceMappingURL=NiceFieldStatus.d.ts.map
@@ -66,4 +66,3 @@ export interface NiceHelpIconProps {
66
66
  */
67
67
  export declare const NiceHelpIcon: React.FC<NiceHelpIconProps>;
68
68
  export default NiceInlineHelp;
69
- //# sourceMappingURL=NiceInlineHelp.d.ts.map
@@ -35,4 +35,3 @@ export interface NiceThemeProviderProps {
35
35
  children: React.ReactNode;
36
36
  }
37
37
  export declare const NiceThemeProvider: React.FC<NiceThemeProviderProps>;
38
- //# sourceMappingURL=NiceThemeProvider.d.ts.map
@@ -52,4 +52,3 @@ export interface NiceThemeVariantConfiguratorProps {
52
52
  export declare function NiceThemeVariantConfigurator({ showPresets, showPreview, showCSS, collapsible, className, style, }: NiceThemeVariantConfiguratorProps): React.JSX.Element;
53
53
  export type { ThemeVariantConfig, RadiusVariant, ShadowVariant, FillVariant as _FillVariant, ButtonStyleVariant, InputStyleVariant, CardStyleVariant, AnimationIntensity, DensityVariant, } from './themeVariants';
54
54
  export { DEFAULT_VARIANT_CONFIG, VARIANT_PRESETS, applyVariantConfig, generateVariantCSS, } from './themeVariants';
55
- //# sourceMappingURL=NiceThemeVariants.d.ts.map
@@ -301,4 +301,3 @@ export interface NicePreferencesPanelProps {
301
301
  */
302
302
  export declare function NicePreferencesPanel({ showGlobal, showControls, showExportImport, showSync, className, style, }: NicePreferencesPanelProps): React.JSX.Element;
303
303
  export {};
304
- //# sourceMappingURL=NiceUserPreferences.d.ts.map
@@ -154,4 +154,3 @@ export declare function checkContrastAAA(foreground: string, background: string,
154
154
  * Run a comprehensive WCAG 2.2 AAA audit on the current document.
155
155
  */
156
156
  export declare function auditWCAG22AAA(): WCAGCheckResult[];
157
- //# sourceMappingURL=a11y-advanced.d.ts.map
@@ -309,4 +309,3 @@ export interface AccessibleClickProps {
309
309
  */
310
310
  export declare function useAccessibleClick(options?: UseAccessibleClickOptions): AccessibleClickProps;
311
311
  export {};
312
- //# sourceMappingURL=a11y.d.ts.map
@@ -56,4 +56,3 @@ export declare function accessModeAttrs(mode: NiceAccessMode): {
56
56
  'aria-disabled'?: boolean;
57
57
  tabIndex?: number;
58
58
  };
59
- //# sourceMappingURL=access-control.d.ts.map
@@ -175,4 +175,3 @@ export declare function generateFromOpenAPI(swaggerUrl: string, schemaName: stri
175
175
  export declare function generateColumnsFromSchema(schema: OpenAPISchema): GridColumnDef[];
176
176
  /** Generate form fields from schema object directly (no fetch). */
177
177
  export declare function generateFormFieldsFromSchema(schema: OpenAPISchema): FormFieldDef[];
178
- //# sourceMappingURL=adapters.d.ts.map
package/dist/core/ai.d.ts CHANGED
@@ -188,4 +188,3 @@ export declare function useTextImprovement(): {
188
188
  isLoading: boolean;
189
189
  };
190
190
  export default NiceAIProvider;
191
- //# sourceMappingURL=ai.d.ts.map
@@ -45,4 +45,3 @@ export declare function useNiceCollapse(ref: React.RefObject<HTMLElement | null>
45
45
  */
46
46
  export declare function niceStaggerDelay(index: number, interval?: number): string;
47
47
  export declare function getNiceAnimationClass(preset: NiceAnimationPreset, phase: 'enter' | 'exit'): string;
48
- //# sourceMappingURL=animations.d.ts.map
@@ -38,4 +38,3 @@ export declare function createColorBlindController(target?: HTMLElement | null):
38
38
  set: (mode: NiceColorBlindMode) => void;
39
39
  clear: () => void;
40
40
  };
41
- //# sourceMappingURL=colorBlind.d.ts.map
@@ -258,4 +258,3 @@ export interface NiceSSEDataSource<T> extends NiceDataSource<T> {
258
258
  * Writes (insert/update/remove) are delegated to the base data source.
259
259
  */
260
260
  export declare function createSSEDataSource<T extends Record<string, any>>(config: NiceSSEConfig<T>): NiceSSEDataSource<T>;
261
- //# sourceMappingURL=datasource-advanced.d.ts.map
@@ -218,4 +218,3 @@ export declare const BatchOperations: {
218
218
  addNew?: boolean;
219
219
  }): T[];
220
220
  };
221
- //# sourceMappingURL=datasource-aggregation.d.ts.map
@@ -90,4 +90,3 @@ export interface NiceLookupSourceState {
90
90
  reload: () => void;
91
91
  }
92
92
  export declare function useNiceLookupSource<T = any>(source: NiceDataSource<T> | null | undefined, valueField: string, labelField: string, opts?: UseNiceLookupSourceOptions): NiceLookupSourceState;
93
- //# sourceMappingURL=datasource-hooks.d.ts.map
@@ -198,4 +198,3 @@ export declare function createUserPreferencesStore(storageKey?: string): {
198
198
  */
199
199
  merge(prefs: Partial<NiceUserPreferences>): void;
200
200
  };
201
- //# sourceMappingURL=datasource-offline.d.ts.map
@@ -178,4 +178,3 @@ export interface NiceCustomDataSourceHandlers<T = any> {
178
178
  */
179
179
  export declare function createCustomDataSource<T extends Record<string, any> = any>(handlers: NiceCustomDataSourceHandlers<T>): NiceDataSource<T>;
180
180
  export {};
181
- //# sourceMappingURL=datasource.d.ts.map
@@ -34,4 +34,3 @@ export declare function forwardDeprecated<T>(opts: {
34
34
  newValue: T | undefined;
35
35
  removeIn?: string;
36
36
  }): T | undefined;
37
- //# sourceMappingURL=deprecation.d.ts.map
@@ -43,4 +43,3 @@ export interface DisplayModeViewProps {
43
43
  * (when focused) activates edit mode just like clicking it.
44
44
  */
45
45
  export declare const DisplayModeView: React.FC<DisplayModeViewProps>;
46
- //# sourceMappingURL=displayMode.d.ts.map
@@ -76,4 +76,3 @@ export interface NiceDisplayStyleInfo {
76
76
  }
77
77
  /** Metadata for all built-in display styles. */
78
78
  export declare const NICE_DISPLAY_STYLE_INFO: NiceDisplayStyleInfo[];
79
- //# sourceMappingURL=displayStyle.d.ts.map
@@ -22,4 +22,3 @@ export declare function sortModelToOrderBy(sort: NiceSortExpression[], opts?: Fi
22
22
  export declare function matchesFilterCondition(row: Record<string, unknown>, c: NiceFilterCondition): boolean;
23
23
  /** Evaluate a {@link NiceFilterGroup} tree against a row (empty group ⇒ matches). */
24
24
  export declare function matchesFilterGroup(row: Record<string, unknown>, group: NiceFilterGroup): boolean;
25
- //# sourceMappingURL=filterToSql.d.ts.map
@@ -94,4 +94,3 @@ export declare function useComponentHelp(componentName: string): {
94
94
  showHelpIcon: boolean;
95
95
  };
96
96
  export default NiceHelpProvider;
97
- //# sourceMappingURL=helpContext.d.ts.map
@@ -158,4 +158,3 @@ export declare function generatePaletteFromColor(baseColor: string): {
158
158
  text: string;
159
159
  textInverse: string;
160
160
  };
161
- //# sourceMappingURL=hooks.d.ts.map
@@ -7,4 +7,3 @@
7
7
  export { NiceI18nProvider, useNiceTranslation } from '@nice2dev/i18n';
8
8
  export type { NiceTranslateFn, NiceSupportedLang, NiceI18nProviderProps } from '@nice2dev/i18n';
9
9
  export { NICE_SUPPORTED_LANGS, NICE_I18N_DICTIONARIES } from '@nice2dev/i18n';
10
- //# sourceMappingURL=i18n.d.ts.map
@@ -1,4 +1,3 @@
1
1
  export declare const NICE_SUPPORTED_LANGS: readonly ["en", "pl", "de", "fr", "es", "it", "pt", "nl", "sv", "no", "da", "fi", "cs", "sk", "hu", "ro", "bg", "uk", "ja", "ko", "zh", "ar"];
2
2
  export type NiceSupportedLang = (typeof NICE_SUPPORTED_LANGS)[number];
3
3
  export declare const NICE_I18N_DICTIONARIES: Record<NiceSupportedLang, Record<string, string>>;
4
- //# sourceMappingURL=i18nDictionaries.d.ts.map
@@ -42,4 +42,3 @@ export declare function useNiceIcon(): {
42
42
  };
43
43
  /** Array of all built-in icon names available without a custom resolver. */
44
44
  export declare const NICE_BUILTIN_ICONS: string[];
45
- //# sourceMappingURL=icons.d.ts.map
@@ -7,4 +7,3 @@
7
7
  export { formatICU, createICUTranslator } from '@nice2dev/i18n';
8
8
  export type { ICUFormatOptions } from '@nice2dev/i18n';
9
9
  export type ICUValues = Record<string, string | number | Date>;
10
- //# sourceMappingURL=icuMessageFormat.d.ts.map
@@ -260,4 +260,3 @@ export declare function useMemoryMonitor(intervalMs?: number, warnThresholdMB?:
260
260
  * Display leak detector status in React DevTools (via component props)
261
261
  */
262
262
  export declare const LeakDetectorStatus: React.FC;
263
- //# sourceMappingURL=leak-detector.d.ts.map
@@ -161,4 +161,3 @@ export interface NiceTenantInfo {
161
161
  /** Tenant locale (BCP 47, e.g. 'pl-PL'). */
162
162
  locale?: string;
163
163
  }
164
- //# sourceMappingURL=omniverkTypes.d.ts.map
@@ -124,4 +124,3 @@ export interface NicePluginSystem {
124
124
  * (e.g. one per workspace, one for tests).
125
125
  */
126
126
  export declare function createNicePluginSystem(options?: NicePluginSystemOptions): NicePluginSystem;
127
- //# sourceMappingURL=pluginSystem.d.ts.map
@@ -273,4 +273,3 @@ export declare const ProfilerOverlay: React.FC<ProfilerOverlayProps>;
273
273
  */
274
274
  export declare function setupReactDevToolsIntegration(): void;
275
275
  export {};
276
- //# sourceMappingURL=profiling.d.ts.map
@@ -104,4 +104,3 @@ export interface SafeAreaInsets {
104
104
  * Returns CSS env() values as numbers.
105
105
  */
106
106
  export declare function useSafeAreaInsets(): SafeAreaInsets;
107
- //# sourceMappingURL=responsive.d.ts.map
@@ -44,4 +44,3 @@ export declare const logicalProps: {
44
44
  };
45
45
  };
46
46
  export {};
47
- //# sourceMappingURL=rtl.d.ts.map
@@ -13,4 +13,3 @@ export declare function sanitizeHtml(html: string): string;
13
13
  * Rejects javascript:, vbscript:, data:text/html, and other dangerous schemes.
14
14
  */
15
15
  export declare function isSafeUrl(url: string): boolean;
16
- //# sourceMappingURL=sanitizeHtml.d.ts.map
@@ -72,4 +72,3 @@ export interface NiceFocusableProps extends NiceBaseProps {
72
72
  }
73
73
  /** Thin wrapper that registers its element with the spatial-nav provider. */
74
74
  export declare const NiceFocusable: React.FC<NiceFocusableProps>;
75
- //# sourceMappingURL=spatialNav.d.ts.map
@@ -114,4 +114,3 @@ export declare function warnControlledClash(componentName: string, value: unknow
114
114
  /** Re-export common types this module is built upon. */
115
115
  export type { NiceBaseProps, NiceFormFieldProps, NiceSize, NiceVariant } from './types';
116
116
  export type NiceReactNode = React.ReactNode;
117
- //# sourceMappingURL=standardProps.d.ts.map
@@ -104,4 +104,3 @@ export declare function createMockDataSource<T extends Record<string, unknown>>(
104
104
  * Returns an array of violations (empty = passed).
105
105
  */
106
106
  export declare function checkAriaCompliance(element: HTMLElement): string[];
107
- //# sourceMappingURL=testing.d.ts.map
@@ -251,4 +251,3 @@ export interface NiceThemeContextValue {
251
251
  }
252
252
  export declare const NiceThemeContext: import("react").Context<NiceThemeContextValue | null>;
253
253
  export declare function useNiceTheme(): NiceThemeContextValue;
254
- //# sourceMappingURL=theme.d.ts.map
@@ -101,4 +101,3 @@ export declare const themeCoffee: NiceTheme;
101
101
  export declare const themeWine: NiceTheme;
102
102
  /** All 100 gallery themes in a single array. */
103
103
  export declare const NICE_THEME_GALLERY: NiceTheme[];
104
- //# sourceMappingURL=themeGallery.d.ts.map
@@ -50,4 +50,3 @@ export type NiceThemePackId = keyof typeof NICE_THEME_PACKS;
50
50
  export declare function getNiceThemePack(id: string): NiceThemePack | undefined;
51
51
  /** Filter packs by tag (e.g. 'dark', 'serif', 'retro'). */
52
52
  export declare function filterNiceThemePacksByTag(tag: string): NiceThemePack[];
53
- //# sourceMappingURL=themePacks.d.ts.map
@@ -56,4 +56,3 @@ export type NiceThemePackIdExtended = keyof typeof NICE_THEME_PACKS_EXTENDED;
56
56
  export declare function getNiceThemePackExtended(id: string): NiceThemePack | undefined;
57
57
  /** Filter extended packs by tag. */
58
58
  export declare function filterNiceThemePacksExtendedByTag(tag: string): NiceThemePack[];
59
- //# sourceMappingURL=themePacksExtended.d.ts.map
@@ -7,4 +7,3 @@ export declare const niceThemeMaterial: NiceTheme;
7
7
  export declare const niceThemeBootstrap: NiceTheme;
8
8
  export declare const niceThemeFluent: NiceTheme;
9
9
  export declare const NICE_THEME_PRESETS: NiceTheme[];
10
- //# sourceMappingURL=themePresets.d.ts.map
@@ -201,4 +201,3 @@ export declare function removeVariantConfig(scopeId: string, element?: HTMLEleme
201
201
  export declare function applyVariantsToTheme(theme: NiceTheme, config: Partial<ThemeVariantConfig>): NiceTheme & {
202
202
  variantConfig: ThemeVariantConfig;
203
203
  };
204
- //# sourceMappingURL=themeVariants.d.ts.map
@@ -205,4 +205,3 @@ export interface UseVirtualKeyboardResult {
205
205
  * Uses viewport height changes as the primary detection method.
206
206
  */
207
207
  export declare function useVirtualKeyboard(): UseVirtualKeyboardResult;
208
- //# sourceMappingURL=touch.d.ts.map
@@ -458,4 +458,3 @@ declare const _default: {
458
458
  auditStorageCompliance: typeof auditStorageCompliance;
459
459
  };
460
460
  export default _default;
461
- //# sourceMappingURL=traceless.d.ts.map
@@ -103,4 +103,3 @@ export interface NiceTutorialButtonProps {
103
103
  * unconditionally as `<NiceTutorialButton steps={resolveTutorial(...)} />`.
104
104
  */
105
105
  export declare const NiceTutorialButton: React.FC<NiceTutorialButtonProps>;
106
- //# sourceMappingURL=tutorials.d.ts.map
@@ -124,4 +124,3 @@ export type NiceOption<T = string> = {
124
124
  /** Grouping key for grouped dropdowns. */
125
125
  group?: string;
126
126
  };
127
- //# sourceMappingURL=types.d.ts.map
@@ -1,14 +1,30 @@
1
1
  import type { NiceChangeMeta, NiceOnChange } from './standardProps';
2
- export interface UseControllableStateOptions<T, TEvent = unknown> {
3
- /** Controlled value. When defined, hook is in controlled mode. */
4
- value?: T;
2
+ /**
3
+ * Where uncontrolled state is seeded from. Two roles that used to share one field:
4
+ * `defaultValue` is the consumer's raw `default*` prop (the only thing the
5
+ * value+default clash warning looks at), `fallbackValue` is the control's own
6
+ * empty seed (`''`, `[]`, `0`) and never triggers a warning. One of them must be
7
+ * a `T`, so the returned value is always a `T`.
8
+ */
9
+ export type UseControllableStateSeed<T> = {
5
10
  /** Initial value used in uncontrolled mode. */
6
11
  defaultValue: T;
12
+ /** Seed used when `defaultValue` is undefined. */
13
+ fallbackValue?: T;
14
+ } | {
15
+ /** The consumer's `default*` prop, possibly undefined. */
16
+ defaultValue?: T | undefined;
17
+ /** Seed used when `defaultValue` is undefined. Never triggers the clash warning. */
18
+ fallbackValue: T;
19
+ };
20
+ export type UseControllableStateOptions<T, TEvent = unknown> = {
21
+ /** Controlled value. When defined, hook is in controlled mode. */
22
+ value?: T;
7
23
  /** Change callback invoked in both modes. */
8
24
  onChange?: NiceOnChange<T, TEvent>;
9
25
  /** Component name (used for dev warnings). */
10
26
  componentName?: string;
11
- }
27
+ } & UseControllableStateSeed<T>;
12
28
  export type UseControllableStateReturn<T, TEvent = unknown> = readonly [
13
29
  T,
14
30
  (next: T | ((prev: T) => T), meta?: NiceChangeMeta<TEvent>) => void,
@@ -16,4 +32,3 @@ export type UseControllableStateReturn<T, TEvent = unknown> = readonly [
16
32
  boolean
17
33
  ];
18
34
  export declare function useControllableState<T, TEvent = unknown>(opts: UseControllableStateOptions<T, TEvent>): UseControllableStateReturn<T, TEvent>;
19
- //# sourceMappingURL=useControllableState.d.ts.map
@@ -67,4 +67,3 @@ export interface NavigationActions {
67
67
  }
68
68
  /** Create a standard UI-navigation action map for {@link useGamepad}. */
69
69
  export declare function createNavigationActions(handlers: NavigationActions): Record<string, GamepadAction>;
70
- //# sourceMappingURL=useGamepad.d.ts.map
@@ -19,4 +19,3 @@ import type { RefObject } from 'react';
19
19
  * sync without consumers wiring `useDarkMode`.
20
20
  */
21
21
  export declare function useThemeIsDark(ref?: RefObject<HTMLElement | null>): boolean;
22
- //# sourceMappingURL=useThemeIsDark.d.ts.map
@@ -43,4 +43,3 @@ export declare function evaluateValidationRule(rule: NiceFieldValidationRule, re
43
43
  export declare function evaluateValidation(rules: NiceFieldValidationRule[] | undefined, record: Record<string, unknown>): NiceFieldValidationIssue[];
44
44
  /** Convenience: does the record satisfy every `error`-severity rule? */
45
45
  export declare function isRecordValid(rules: NiceFieldValidationRule[] | undefined, record: Record<string, unknown>): boolean;
46
- //# sourceMappingURL=validation.d.ts.map