@nice2dev/ui-core 1.0.29 → 1.0.30

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,140 @@
1
1
  # @nice2dev/ui-core — Changelog
2
2
 
3
+ ## 1.0.30
4
+
5
+ ### Patch Changes
6
+
7
+ - 2f9e5d4: Showcase-feedback round 10 (editors state/props + bugs + datetime consolidation):
8
+ - NiceCheckbox: tri-state `indeterminate` now reaches all three states; expose
9
+ readOnly/loading/labelPlacement/errorPlacement in the props panel.
10
+ - NiceToggle/NiceRating: expose readOnly/loading/error/placement props; Rating
11
+ `loading` now replaces the stars with a spinner.
12
+ - NiceRadioGroup / NiceTagBox: implement `readOnly` (was ignored).
13
+ - NiceNumberInput: value stays right-aligned on blur; new `suffixSeparator` prop
14
+ (default false) gating the value↔suffix divider.
15
+ - NiceDatePicker: datetime shows a dot separator instead of the ISO `T` (emitted
16
+ value keeps `T`); datetime mode gains `showSeconds`, `minuteStep`, `showNow`,
17
+ and `hourFormat` (native picker) — ported from the now-removed
18
+ NiceDateTimePicker.
19
+ - NiceTimePicker: honor the `placeholder` prop.
20
+ - NiceSlider: more spacing around a left-placed label.
21
+
22
+ Removed **NiceDateTimePicker** (breaking): its datetime capability is covered by
23
+ NiceDatePicker's datetime mode; NiceForm, ui-forms `formUtils`, and ui-core
24
+ `adapters` now resolve datetime fields to NiceDatePicker.
25
+
26
+ - 7771af3: Round-13 showcase-feedback fixes across ~23 controls.
27
+
28
+ **Behaviour / bug fixes**
29
+ - **NiceUpload** — restored the dropzone look (icon + themed box + hover tint;
30
+ `variant` now defaults to `"dropzone"`).
31
+ - **NiceCard** — `selected` now shows a ring (drawn on a `::after` pseudo-element
32
+ so the display-style inline chrome can't override it).
33
+ - **NiceMenu** — the active-item highlight fills the bar; `separated` (default)
34
+ gained a subtle toolbar surface.
35
+ - **NiceLookup** — implemented `disabled` (gray-out), `readOnly` (inert),
36
+ `loading` (spinner), and `labelPlacement` / `errorPlacement`.
37
+ - **NiceColorPicker** — the palette popup follows the theme instead of always
38
+ rendering light; hex input honours `withAlpha`; `withAlpha`/`compact` are now
39
+ documented. **`showInput` and `showRandom` now default to `false`** (was `true`).
40
+ - **NiceSignature** — theme-aware canvas (empty `penColor`/`backgroundColor`
41
+ resolve to the theme's text/background), plus a `label` prop and an
42
+ `onChangeDataUrl` callback ported from the removed NiceSignaturePad.
43
+ - **NiceSegmentedControl** — the active thumb is hidden while `loading`.
44
+ - **NiceAutocomplete** — multiple-mode selections render as separate bordered
45
+ chips with per-chip remove; the clear button matches the other controls.
46
+ - **NiceCalendar** — `multiple` works (uncontrolled fallback); `min`/`max` only
47
+ apply to complete ISO dates.
48
+ - **NiceDateRangeBox** — horizontal layout stays on one line; `labelPlacement`
49
+ works inline.
50
+ - **NicePickList** — drag-reorder works in both columns with insert-position
51
+ indicators. **When `sortable` is off (the default), both lists now auto-sort
52
+ alphabetically** (display-only; consumer arrays keep their order).
53
+ - **NiceColorPalette** — the hue ring supports press-and-drag.
54
+ - **NiceVirtualScroller** — `itemHeight`/`height` are honoured, and it gained
55
+ `size` + `disabled`/`loading`/`error` states.
56
+ - **NiceBusinessCard** — `variant` (card/inline/compact) and `showLogo` (with a
57
+ fallback avatar) now render.
58
+
59
+ **Breaking (patch, pre-1.2.0 convention)**
60
+ - **NiceSignaturePad is removed** — it duplicated **NiceSignature**. Its `label`
61
+ and data-URL value model were ported (`label`, `onChangeDataUrl`). Migrate to
62
+ `NiceSignature`; for a data-URL value use `onChangeDataUrl` or the imperative
63
+ `ref.toDataURL()`. (The separate touch-optimised `@nice2dev/ui-mobile`
64
+ `NiceSignaturePad` is unaffected.)
65
+
66
+ - da12dfb: Round-17 showcase-feedback fixes (6 select/editor controls).
67
+ - **Select-dropdown standardization** — the menus of NiceSelect / NiceAutocomplete /
68
+ NiceLookup / NiceTreeSelect / NiceDropDownBox now abut the input (new
69
+ `--nice-dropdown-gap`, default `0px`, replacing a hardcoded 4px). NiceAutocomplete /
70
+ NiceLookup / NiceTreeSelect gain an optional `menuGap` prop. NiceDropDownBox's menu
71
+ gains the standard border (its `.nice-dropdown` had no CSS), and its clear `×` moved
72
+ inside the trigger (it was rendering below the control). NiceTreeSelect option rows
73
+ get more left padding.
74
+ - **NiceDateTimePicker** — the time-spinner ▲/▼ buttons now support press-and-hold
75
+ auto-repeat (new shared `useHoldRepeat` hook in `@nice2dev/ui-core`). (The 24-hour
76
+ default was a demo-seed issue, fixed in the showcase.)
77
+ - **NiceLookup** — `readOnly` no longer changes the control height (the chevron slot is
78
+ kept), and `errorPlacement="right"` no longer widens the field when there's no error.
79
+ - **NiceCardGroup** — new `readOnly` (blocks selection without dimming) and `errorText`
80
+ props; `size` now scales the child cards (they inherit the group size via context),
81
+ not just the grid gap.
82
+
83
+ - bea5451: Round-18 showcase-feedback fixes (12 editor controls).
84
+ - **Select family** — NiceTreeSelect now has a stable trigger width (min-width like
85
+ NiceLookup, no longer tracking the value), its dropdown Search reuses the shared
86
+ `.nice-select__search` (left padding + normal vertical padding), and the empty state
87
+ gets padding. NiceAutocomplete inserts the option's DisplayName (label) on select
88
+ instead of the raw lowercase `value`. NiceLookup's `errorPlacement='right'` error is
89
+ absolutely positioned so it no longer widens the control.
90
+ - **NiceRangeSlider** — for `valuePlacement` right/bottom the value moves to a header
91
+ row above the track (mirroring NiceSlider) so it no longer overlaps the slider.
92
+ - **NiceDateRangeBox** — a stable `min-width` keeps disabled/readOnly from narrowing the
93
+ control; the loading spinner and `errorPlacement='right'` error align to the input row.
94
+ - **NiceDateTimePicker** — the time popup is now a slot-machine of vertical scroll-snap
95
+ columns for hours/minutes (animated, fade-masked); the ▲/▼ buttons keep hold-to-repeat
96
+ and typing a digit overwrites (INSERT).
97
+ - **NiceSkeleton** — new `animationSpeed` prop (seconds, default 1.8 ≈ 20% slower);
98
+ numeric-string `width`/`height` are coerced to px so both props apply.
99
+ - **NiceUpload** — new `labelPlacement` prop (`'right'` default | `'bottom'`): the text
100
+ sits beside the icon by default, below it when set.
101
+ - **NiceSignature** — the placeholder is translated (`signature.placeholder`, added to
102
+ the ui-core + i18n dictionaries for en/pl/de/fr/es/uk); the demo drops its synthetic
103
+ label + generic placeholder and the signature line is raised.
104
+ - **NiceColorPalette** — the collapsed field is a compact multi-colour strip at
105
+ NiceColorPicker's 32px height (chevron removed); the studio popup is split into
106
+ NiceTabs (Colors / Presets / Variations / Info / Schemes) and the swatch "kredki" are
107
+ reshaped into compact bars (chip + hex + remove ×) to the right of the wheel.
108
+ - **NiceGradientPicker** — redesigned to mirror NiceColorPicker/Palette: a compact 32×32
109
+ swatch field opens a portaled popup with NiceTabs (Editor / Presets / CSS); the
110
+ `NiceGradientValue`/`onChange` API and exported helpers are preserved.
111
+
112
+ - 783d0db: fix(controls): showcase-feedback round 3 — core controls, deeply honed
113
+ - **NiceButton**: icon-only is a properly padded square (symmetric padding per size), `fullWidth` stretches to 100% width with normal height (no giant square), and the loading spinner no longer collapses the box (the icon is kept in flow, hidden).
114
+ - **NiceDropDownButton**: the portaled menu now carries the trigger's theme (fixes white-on-white rows in scoped themes) and hover/selected set both background and colour; `readOnly` is now visually distinct from `disabled` (own class, not greyed) while still blocking the menu.
115
+ - **NiceSegmentedControl**: the active thumb now fills the selected segment exactly (removed a double-counted container inset that left a gap).
116
+ - **NiceBadge**: `size` now scales width + font too (the display style no longer pins `fontSize`/`padding` inline, so the size class governs).
117
+ - **NiceCarousel**: slide switching / autoPlay / circular work again (no longer frozen by a bare controlled `activeIndex`), `size` has real rules (arrow size + viewport height), and a new `fullWidth` prop (default `true`) toggles fill-vs-content width.
118
+ - **NicePDFViewer**: shows `1 / 1` and `100%` and stays interactive (non-positive controlled `page`/`zoom` are ignored); print converts a `data:` URI to a Blob URL so the tab actually prints.
119
+ - **NiceQRCode / NiceBarcodeGenerator**: the default module/bar colour follows the element's own theme surface (dark → light, light → dark) via a ref-aware `useThemeIsDark`; empty `color`/`background` are guarded.
120
+ - **NiceTooltip**: new `position: 'auto'` (now the default) picks the on-screen side with the most room (collision detection).
121
+ - **NiceFAQ**: items collapse regardless of `animateExpand` (only the transition is gated on it).
122
+ - **NiceTimeline**: horizontal mode draws its connector line and centres the item text; the body line renders at ~70%.
123
+ - **NiceDivider**: the text variant fills its container so the flanking lines are visible.
124
+ - **NiceSkeleton**: grouped rows (`count > 1`) get a definite width so `text`/`rect` variants render and animate (not just `circle`).
125
+
126
+ `useThemeIsDark` now accepts an optional element ref and resolves against that element's nearest theme scope (backwards-compatible: no-arg still observes `<html>`).
127
+
128
+ - 9816474: fix(controls): showcase-feedback round 6 — data + nav controls (8 items)
129
+ - **NiceTabs**: `vertical` now lays out as a sidebar (tab list left, content right) instead of stacking, and the panel keeps a stable size so switching tabs doesn't make the control jump.
130
+ - **NiceTable**: sort icons match NiceDataGrid — a neutral double-chevron when idle, a single up/down chevron for asc/desc, muted (new `sort` NiceIcon).
131
+ - **NiceDataGrid**: the aggregate summary is pinned directly above the pagination (no more jump on page change — it's no longer a sticky `<tfoot>`); the Filter button is now a proper `nice-btn` with a filter icon; toolbar placeholder glyphs (`?`/`??`) replaced with NiceIcons.
132
+ - **NiceList**: `size` now scales row density/font; `disabled`/`readOnly`/`error` states work; the loading spinner is centered and hides the search bar; new optional `header` prop that stays visible during loading.
133
+ - **NiceMenu**: bar-variant (separated/ghost/borderless) item highlight fills the item box edge-to-edge (no gap frame, no rounded-pill shrink; rounding only on the bar's outer corners).
134
+ - **NiceContextMenu**: item highlight fills each row (removed the container top/bottom padding and added `overflow:hidden`, so no top gap, no side overflow, corners clipped to the container).
135
+
136
+ Plus demo polish: NiceCardView cards now have a coloured header, status badge and footer actions; the NiceSpeedDialAction demo drops its bounded container (just the button).
137
+
3
138
  ## 1.0.29
4
139
 
5
140
  ### Patch Changes
@@ -19,6 +19,18 @@ export declare function useLongPress(callback: () => void, holdMs?: number): {
19
19
  onPointerUp: () => void;
20
20
  onPointerCancel: () => void;
21
21
  };
22
+ /**
23
+ * Press-and-hold auto-repeat for stepper buttons. `start(action)` repeats `action`
24
+ * at an accelerating rate while held (first repeat after 400ms, then speeding up to
25
+ * ~30ms); `stop()` ends it. Keep the button's own `onClick` for a single tap and
26
+ * wire `start`/`stop` to `onPointerDown` / `onPointerUp` + `onPointerLeave` (works
27
+ * for mouse, touch and pen). Used by NiceNumberInput and NiceDateTimePicker's time
28
+ * spinners.
29
+ */
30
+ export declare function useHoldRepeat(): {
31
+ start: (action: () => void) => void;
32
+ stop: () => void;
33
+ };
22
34
  /**
23
35
  * Returns a stable unique HTML id. Passes through `externalId` when provided,
24
36
  * otherwise generates one via React's `useId()`.
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/core/hooks.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAY1C;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,OAAO,GAAG,OAAO,CAqBhD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,MAAM,IAAI,EACpB,MAAM,SAAM,GACX;IACD,aAAa,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,YAAY,KAAK,IAAI,CAAC;IAC/C,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,eAAe,EAAE,MAAM,IAAI,CAAC;CAC7B,CAmBA;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAGxD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,CAOjE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,OAAO,EAAE,MAAM,IAAI,QAe5F;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,GA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B,+IAuBvB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAi6KtE,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAuBpF,CAAC"}
1
+ {"version":3,"file":"i18nDictionaries.d.ts","sourceRoot":"","sources":["../../src/core/i18nDictionaries.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB,+IAuBvB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAu6KtE,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAuBpF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../src/core/icons.tsx"],"names":[],"mappings":"AACA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAqNtE,yFAAyF;AACzF,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAU5D,gDAAgD;AAChD,MAAM,WAAW,aAAa;IAC5B,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;CACzC;AAED;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,M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AI,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;AAW3F,8CAA8C;AAC9C,MAAM,WAAW,qBAAqB;IACpC,8DAA8D;IAC9D,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAE5D,CAAC;AAiDF;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA0C5C,CAAC;AAKF;;;GAGG;AACH,wBAAgB,WAAW;uBAKf,KAAK,CAAC,SAAS,GAAG,MAAM,GAAG,SAAS,SACpC,YAAY,GAAG,MAAM,KAC1B,KAAK,CAAC,SAAS;EAarB;AAED,4EAA4E;AAC5E,eAAO,MAAM,kBAAkB,UAA6B,CAAC"}
@@ -1,15 +1,22 @@
1
+ import type { RefObject } from 'react';
1
2
  /**
2
3
  * Live boolean indicating whether the active theme renders as "dark".
3
4
  *
4
- * Resolution order:
5
- * 1. `<html data-theme="dark|light">` attribute (explicit consumer wins)
6
- * 2. `nice-dark` / `nice-light` (and bare `dark`) class on `<html>`
7
- * 3. `--text-primary` CSS variable luminance (light text → dark theme)
5
+ * Resolution order (evaluated against the nearest theme scope of `ref`, or
6
+ * `<html>` when no ref is given):
7
+ * 1. `data-theme="dark|light"` on the nearest scoped ancestor (explicit wins)
8
+ * 2. `nice-dark` / `nice-light` (and bare `dark`) class on that scope
9
+ * 3. the element's own resolved `--text-primary` luminance (light text → dark)
8
10
  * 4. `prefers-color-scheme: dark` media query as last-resort fallback
9
11
  *
10
- * Updates whenever any of the above change (MutationObserver on `<html>`
11
- * attributes/class/style + media-query listener), so canvas-based renderers
12
- * (QR, barcode, charts…) stay in sync without consumers wiring `useDarkMode`.
12
+ * Pass a `ref` to a rendered element (e.g. a canvas) so the result reflects the
13
+ * element's **own** surface — `NiceThemeProvider` themes a scoped container, not
14
+ * `<html>`, so a canvas nested under a scoped provider must read its own scope,
15
+ * not the document root. Without a ref it observes `<html>` as before.
16
+ *
17
+ * Updates whenever the observed scope (or `<html>`) attributes/class/style or the
18
+ * media query change, so canvas-based renderers (QR, barcode, charts…) stay in
19
+ * sync without consumers wiring `useDarkMode`.
13
20
  */
14
- export declare function useThemeIsDark(): boolean;
21
+ export declare function useThemeIsDark(ref?: RefObject<HTMLElement | null>): boolean;
15
22
  //# sourceMappingURL=useThemeIsDark.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useThemeIsDark.d.ts","sourceRoot":"","sources":["../../src/core/useThemeIsDark.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,IAAI,OAAO,CA4BxC"}
1
+ {"version":3,"file":"useThemeIsDark.d.ts","sourceRoot":"","sources":["../../src/core/useThemeIsDark.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,OAAO,CAoC3E"}