@nice2dev/ui-core 1.3.13 → 1.3.15

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 CHANGED
@@ -1,5 +1,48 @@
1
1
  # @nice2dev/ui-core — Changelog
2
2
 
3
+ ## 1.3.15
4
+
5
+ ### Patch Changes
6
+
7
+ - 7fde5a6: From OmniVerk's list (1.3.15, §19–20):
8
+
9
+ - **NiceCard `icon`** — an icon before the title in the header, sized to the title's font and coloured like it. A header icon no longer needs a node cast to `string` as the `title`.
10
+ - **NiceProgress fills its row.** Its field used to fit its content, which left the bar at its 200 px minimum. `controlWidth` still sets a width.
11
+ - **`--nice-field-control-width` from CSS widens the inputs too.** Until now, only a `style` attribute holding the variable (the `controlWidth` prop) made text, number, masked and password inputs fill the field. A value inherited from an ancestor widened the field but left the input content-sized. Without the variable, inputs stay content-sized as before.
12
+ - **NicePasswordInput** stretches like the other inputs. Its input sat in a `display: contents` wrapper that the stretch rule missed.
13
+ - The `controlWidth` docs say what it does. They used to claim "defaults to 100% in column layout".
14
+
15
+ ## 1.3.14
16
+
17
+ ### Patch Changes
18
+
19
+ - ff59527: Package builds (1.3.14, OmniVerk's list):
20
+
21
+ - **@nice2dev/ui ESM: a module per source file.**
22
+ - Until now `dist/index.mjs` was a single 2.6 MB module, so an app's bundler could not keep controls used only on a lazily loaded page out of the chunk every page loads. Now an app splits the library like its own code.
23
+ - Entry paths, the `exports` map, the CommonJS build and `style.css` (byte-identical) do not change.
24
+ - `country-flag-icons`, already a dependency, is no longer bundled.
25
+ - Note: an app rule that sends every `@nice2dev/ui/` module to one manual chunk undoes the split.
26
+ - **Only `style.css` ships:** the chunk CSS files it inlines are no longer published next to it, which halves the CSS in the package.
27
+ - **ui-audio workers:** their URLs are relative. They were addressed from the site root (`/assets/pitchWorker-….js`), where an app that installs the package has no such file. Test and benchmark declarations are no longer published.
28
+ - **ui-buildings:** no longer ships an import worker that nothing refers to.
29
+ - **Clean builds:** ui-core, ui-display and ui-tools empty `dist` before building, so stale hashed chunks cannot be packed.
30
+ - **Release pipeline:**
31
+ - The publish job takes the builds from a folder emptied after every job. Old builds' files had piled up in its previous folder and were published (e.g. @nice2dev/ui 1.3.10: 793 files instead of 337).
32
+ - It checks each package against the file list the build recorded before anything goes to npm.
33
+ - The contents audit also lists published files that no entry reaches.
34
+
35
+ - f840d64: Smaller items from OmniVerk's list (1.3.14):
36
+
37
+ - **NiceScheduler** names days and months through `Intl` in the provider's language. Before, it looked up keys that no dictionary had, so a Polish calendar showed "January" and "Mon". Its titles, agenda and tooltip dates also follow the provider's `lang` now, no longer the browser's language.
38
+ - **NiceTopNav**:
39
+ - The collapsed tools cluster shows a small swatch of the current theme and the language code next to its chevron, and its accessible name says both (`collapsedSummary`, default `true`, a node of your own or `false`).
40
+ - Once open, the cluster lets the language and theme pickers' lists hang below the bar instead of cutting them off.
41
+ - **NiceTopNav `hideOnScroll` and NiceAnchor** take a `scrollContainer`: the window (default), an element, `'nearest'` or a function. They then work where the content scrolls inside a shell. The helpers are new in @nice2dev/ui-core: `getScrollParent`, `resolveScrollContainer`, `scrollTopOf`, `scrollTopFor`.
42
+ - **First frame on narrow screens:** NiceNavShell and NiceTopNav read the screen width on their first render, so a phone no longer flashes the desktop sidebar on every mount. `useMediaQuery` also guards against a missing `matchMedia`.
43
+ - **Exported types:** `NiceTreeGridRowAction` and `NiceTreeGridCheckedSummaryInfo` are now exported.
44
+ - **Docs:** the admin and auth READMEs say to import their `style.css`. The ui README no longer links to the compatibility sheet removed in 1.2.0.
45
+
3
46
  ## 1.3.13
4
47
 
5
48
  No changes in this release.
@@ -27,6 +27,10 @@ export interface UseBreakpointResult {
27
27
  isDesktop: boolean;
28
28
  }
29
29
  export declare function useBreakpoint(breakpoints?: NiceBreakpoints): UseBreakpointResult;
30
+ /**
31
+ * Whether `query` matches — already on the first render (the first frame of a phone layout is not
32
+ * a desktop one), then on every change. `false` on the server and where `matchMedia` is missing.
33
+ */
30
34
  export declare function useMediaQuery(query: string): boolean;
31
35
  /**
32
36
  * Define a value per breakpoint. Missing breakpoints inherit from the
@@ -0,0 +1,16 @@
1
+ /** The `scrollContainer` of a control: a window or element, `'nearest'`, or a function giving one. */
2
+ export type NiceScrollContainer = Window | HTMLElement | 'nearest' | (() => Window | HTMLElement | null | undefined);
3
+ /**
4
+ * The nearest ancestor of `el` that scrolls vertically (`overflow-y: auto | scroll | overlay`),
5
+ * else the window.
6
+ */
7
+ export declare function getScrollParent(el: Element | null | undefined): HTMLElement | Window;
8
+ /** The element or window a `scrollContainer` prop names for the element `self`; default the window. */
9
+ export declare function resolveScrollContainer(container: NiceScrollContainer | undefined, self: Element | null | undefined): HTMLElement | Window;
10
+ /** How far a container is scrolled down, in px. */
11
+ export declare function scrollTopOf(container: HTMLElement | Window): number;
12
+ /**
13
+ * The scroll position that brings `target` to the top of `container`, less `offset` px — for
14
+ * `container.scrollTo({ top })`.
15
+ */
16
+ export declare function scrollTopFor(container: HTMLElement | Window, target: Element, offset?: number): number;
@@ -100,7 +100,11 @@ export interface NiceFormFieldProps extends NiceBaseProps {
100
100
  loading?: boolean;
101
101
  /** Explicit width for the label (e.g. '120px', '30%'). Only applies when labelPlacement is 'left'. */
102
102
  labelWidth?: string | number;
103
- /** Explicit width for the control (e.g. '200px', '50%'). Defaults to 100% in column layout. */
103
+ /**
104
+ * Width of the field (e.g. '200px', '50%', '100%'); text inputs then fill it. It sets
105
+ * `--nice-field-control-width`, which an ancestor can also set in CSS for every field below it.
106
+ * Without either the field fits its control; progress bars fill their row.
107
+ */
104
108
  controlWidth?: string | number;
105
109
  /** When `true`, the control renders as a clickable label-style display of the current value
106
110
  * (no input border/chrome). Click switches it into the regular editable control. Useful for