@nice2dev/ui 1.2.2 → 1.3.1

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 (97) hide show
  1. package/CHANGELOG.md +474 -0
  2. package/dist/NiceButton-CnAIqCbd.js +101 -0
  3. package/dist/NiceButton-DzCqkG5a.cjs +1 -0
  4. package/dist/NiceCodeEditor-CK6B54mu.js +1215 -0
  5. package/dist/NiceCodeEditor-bJReZPDO.cjs +268 -0
  6. package/dist/NiceColorPicker-BV3olE3M.cjs +1 -0
  7. package/dist/NiceColorPicker-CyY-4q89.js +552 -0
  8. package/dist/NiceDataGrid-BQIqitMM.cjs +10 -0
  9. package/dist/NiceDataGrid-C1eI6Pso.js +2267 -0
  10. package/dist/NiceDataGrid-Cs4vOOTE.js +2267 -0
  11. package/dist/NiceDataGrid-jZvzaCv3.cjs +10 -0
  12. package/dist/NiceForm-CfAPcXdX.cjs +1 -0
  13. package/dist/NiceForm-DYcrWaN1.js +5017 -0
  14. package/dist/NiceForm-DfKYNQti.js +5017 -0
  15. package/dist/NiceForm-ZzfYumoR.cjs +1 -0
  16. package/dist/NiceGantt-TEXbAELi.js +333 -0
  17. package/dist/NiceGantt-s2cgt5zD.cjs +1 -0
  18. package/dist/NiceHtmlEditor-CDZeF_zG.cjs +10 -0
  19. package/dist/NiceHtmlEditor-CdWgddg3.js +901 -0
  20. package/dist/NiceLoginForm-DRPldHXa.js +808 -0
  21. package/dist/NiceLoginForm-IGLUCQUE.cjs +1 -0
  22. package/dist/NiceMention-CgDp0sl9.cjs +430 -0
  23. package/dist/NiceMention-DBvFvx71.js +11653 -0
  24. package/dist/NiceMention-VhH0Dllr.cjs +430 -0
  25. package/dist/NiceMention-cOqXnI0M.js +11653 -0
  26. package/dist/NiceMention.css +1 -1
  27. package/dist/NiceModal-BlYhFDhP.js +80 -0
  28. package/dist/NiceModal-DmWz2PDM.cjs +1 -0
  29. package/dist/NiceModuleLifecyclePanel-BWUYyWfY.cjs +1 -0
  30. package/dist/NiceModuleLifecyclePanel-BdcJATGF.js +7190 -0
  31. package/dist/NiceModuleLifecyclePanel-D8EoXqBy.cjs +1 -0
  32. package/dist/NiceModuleLifecyclePanel-SN6G7t64.js +7189 -0
  33. package/dist/NiceModuleLifecyclePanel.css +1 -1
  34. package/dist/NicePagination-BJS65foT.js +200 -0
  35. package/dist/NicePagination-D_3GfWp5.cjs +1 -0
  36. package/dist/NicePivotGrid-D_kRF1Dt.js +1180 -0
  37. package/dist/NicePivotGrid-DqluEkCI.cjs +152 -0
  38. package/dist/NiceSavedQueryPanel-C2Tn1cMW.js +5311 -0
  39. package/dist/NiceSavedQueryPanel-Cs_dypgU.js +5311 -0
  40. package/dist/NiceSavedQueryPanel-DDKtL1AA.cjs +586 -0
  41. package/dist/NiceSavedQueryPanel-DTSOHW2v.cjs +586 -0
  42. package/dist/NiceScheduler-BmHcJLBe.cjs +5 -0
  43. package/dist/NiceScheduler-DI2sg3Rr.js +1710 -0
  44. package/dist/NiceScheduler-GJLvkXJ3.cjs +5 -0
  45. package/dist/NiceScheduler-UT49u2Vq.js +1710 -0
  46. package/dist/NiceSelect-CdUHd8rj.cjs +1 -0
  47. package/dist/NiceSelect-fOelG_QB.js +495 -0
  48. package/dist/NiceWindow-CqSsTjrS.cjs +1 -0
  49. package/dist/NiceWindow-DZLPhXbR.js +2223 -0
  50. package/dist/charts-BYQwl_GS.js +4789 -0
  51. package/dist/charts-C6iOu0H6.cjs +768 -0
  52. package/dist/charts.cjs +1 -1
  53. package/dist/charts.d.ts +1 -1
  54. package/dist/charts.mjs +1 -1
  55. package/dist/core-lazy-B_laOXNf.cjs +1 -0
  56. package/dist/core-lazy-BpbIO1EN.cjs +1 -0
  57. package/dist/core-lazy-L7MVTPp1.js +351 -0
  58. package/dist/core-lazy-VQEjdz0L.js +351 -0
  59. package/dist/data-branching-7rpktFJ-.cjs +1 -0
  60. package/dist/data-branching-BS0aFUMu.js +6428 -0
  61. package/dist/data-branching.cjs +1 -1
  62. package/dist/data-branching.mjs +1 -1
  63. package/dist/data.cjs +1 -1
  64. package/dist/data.mjs +3 -3
  65. package/dist/devops-CFytAJQr.cjs +18 -0
  66. package/dist/devops-CW8YY_zA.js +9122 -0
  67. package/dist/devops.cjs +1 -1
  68. package/dist/devops.css +1 -0
  69. package/dist/devops.mjs +5 -5
  70. package/dist/editors.cjs +1 -1
  71. package/dist/editors.mjs +8 -8
  72. package/dist/feedback.cjs +1 -1
  73. package/dist/feedback.d.ts +21 -16
  74. package/dist/feedback.mjs +3 -3
  75. package/dist/index.cjs +262 -257
  76. package/dist/index.css +1 -1
  77. package/dist/index.d.ts +402 -27
  78. package/dist/index.mjs +21437 -20148
  79. package/dist/lazy.cjs +1 -1
  80. package/dist/lazy.mjs +24 -24
  81. package/dist/navigation.cjs +1 -1
  82. package/dist/navigation.d.ts +50 -7
  83. package/dist/navigation.mjs +404 -354
  84. package/dist/no-code-BaAI_sJR.js +8318 -0
  85. package/dist/no-code-oQTeAtnW.cjs +331 -0
  86. package/dist/no-code.cjs +1 -1
  87. package/dist/no-code.mjs +1 -1
  88. package/dist/overlays.cjs +1 -1
  89. package/dist/overlays.d.ts +5 -0
  90. package/dist/overlays.mjs +1 -1
  91. package/dist/pickerCommons-BQi6IEAt.js +661 -0
  92. package/dist/pickerCommons-CUGHOWyc.cjs +1 -0
  93. package/dist/pickerCommons-D-dwdCBZ.js +659 -0
  94. package/dist/pickerCommons-DvQptSPX.cjs +1 -0
  95. package/dist/pickerCommons.css +1 -1
  96. package/dist/style.css +8 -5
  97. package/package.json +4 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,479 @@
1
1
  # [1.0.27] — 2026-06-07
2
2
 
3
+ ## 1.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 27af285: Fill-height layouts: the sidebar's collapse button and the wizard's button bar stay at the bottom edge.
8
+
9
+ - `NiceNavShell` gets `height` (px or any CSS length). The shell's default `height: 100%` fills a
10
+ parent with a definite height; under a parent that only has `min-height` (a page wrapper with
11
+ `min-height: 100vh`) it is the content's height, so the shell grew with the page, nothing scrolled
12
+ inside it, and the `showStickyFooter` row and the sidebar's collapse button moved down with the
13
+ content. Give the shell a definite height (`height="100dvh"` when it is the whole page) or give its
14
+ parent one.
15
+ - `NiceNavShell`: a `NiceSidebarNav` plugged into the `sidebar` slot with its default `sticky` was
16
+ `100vh` tall whatever the shell's height — its rule loads later in `style.css` with the same
17
+ specificity and won over the slot's `height: 100%`. In a shell shorter than the screen (a top bar
18
+ above it) the column clipped the sidebar and its collapse button. It is now never taller than
19
+ the column; a shell without a definite height behaves as before.
20
+ - `NiceSetupWizard` gets `height` (px or any CSS length). By default the wizard is as tall as the
21
+ step, up to `100vh`, so on a short step the button bar sat right under it. With a height the wizard
22
+ fills exactly that (no 400px minimum, no `100vh` cap, border included): the step body scrolls and
23
+ the Back / Next bar stays at the bottom edge on every step — `height="100%"` in a parent with a
24
+ definite height, `"100dvh"` for the whole screen.
25
+
26
+ - 3d31f25: The setup wizard's header stays in its step column, and theme thumbnails look like a page.
27
+
28
+ - `NiceSetupWizard` (`layout="vertical"`): the header — branding, language, theme, restart — heads
29
+ the step column in the flow instead of lying over it with room for one row. What did not fit the
30
+ 260px column (on omniverk.com the theme picker and restart) ran over the step body; now the
31
+ controls wrap to a second row under the logo. The step list is 260px with its padding (it was
32
+ 292px, over the body, and wider than a phone in the narrow layout), it lost the 60px gap the
33
+ overlaid header needed, and the progress bar runs along the top edge of the step body.
34
+ - Compact pickers (`NiceThemePicker`, `NiceLanguagePicker`, `NiceCountryPicker` with `compact`) no
35
+ longer keep the field's 200px minimum width: a 42px trigger took 200px of a toolbar.
36
+ - `NiceThemePicker`'s `'page'` preview (`ThemePreviewSwatch`) is a page in miniature: a low accent
37
+ bar across the top, under it the page background (`backgroundSecondary`) as thin margins left and
38
+ right, and a card (`background`, bordered) with two lines of text (`textColor`). The header,
39
+ sidebar and lines before it read as a flag at 24px. Theme descriptors stay as they are.
40
+
41
+ - @nice2dev/i18n@1.3.1
42
+ - @nice2dev/ui-core@1.3.1
43
+
44
+ ## 1.3.0
45
+
46
+ ### Minor Changes
47
+
48
+ - ada5a2d: Keyboard, gamepad and remote input for every Nice control (TODO_1.3.0, ADR-005).
49
+
50
+ - `@nice2dev/ui-core` gets the input layer, also as its own entry `@nice2dev/ui-core/input`:
51
+ one engine per page that turns keys, pad buttons and remote keys into intents (`navigate`,
52
+ `activate`, `back`, `secondary`, `tertiary`, `menu`, `view`, `sectionPrev` / `sectionNext`,
53
+ `pagePrev` / `pageNext`, `first` / `last`, `scroll`, `toggleHints`). No animation frame without a
54
+ pad; changes only, no re-render per frame; repeat with acceleration, stick hysteresis, several
55
+ pads, Xbox / PlayStation / Nintendo / Steam / generic families (Nintendo confirms with the right
56
+ button). Pads also emulate the matching key on the focused element, so controls with a keyboard
57
+ pattern work with a pad as they are.
58
+ - Focus without registration: spatial moves between tabbable elements, focus scopes
59
+ (`useFocusScope`, `<NiceFocusScope>`) with memory, wrapping, traps and escalation at an edge,
60
+ regions for F6 / Select, focus recovery when the focused element disappears. Value controls are
61
+ engaged first on a pad (`useEngage`): the d-pad passes them by until A.
62
+ - `useRovingFocus` (APG keys, 1-D and 2-D, typeahead, RTL), `useOverlayFocus` (initial focus,
63
+ trap, Escape / B, overlay stack, return to the opener), `useIntent`, `useInputMethod`,
64
+ `useGamepadFamily`, `useInputPreferences`, `NiceInputProvider` (preferences persisted in
65
+ `NiceUserPreferences` as `global.input`; `useUserPreferencesOptional` added).
66
+ - `@nice2dev/testing`: `mockGamepad()` with a controlled frame clock, `pressKey()`,
67
+ `pressIntent()`, `describeInputContract()` / `runInputContract()`, `stubLayout()` /
68
+ `stubGridLayout()` for jsdom.
69
+ - Focus visibility: in pad and remote modes the ring shows on plain `:focus` (the browsers'
70
+ `:focus-visible` heuristics miss focus moved by a pad); an engaged control wears
71
+ `--nice-focus-ring-engaged`; `scroll-padding` on the root from `--nice-scroll-padding-top` /
72
+ `-bottom`. `NiceDisplayValue` drew no ring: its outline used the box-shadow token as a colour.
73
+ - The old APIs are layers over the engine and `@deprecated` (removal only in a breaking release):
74
+ `useGamepad` reads the engine's frames — no animation loop of its own and no render per frame;
75
+ `NiceSpatialNavProvider` takes intents instead of a `window` keydown listener, so it no longer
76
+ steals the arrow keys of text fields; `useRovingTabIndex` runs on `useRovingFocus` (2-D in
77
+ `grid`); `createNavigationActions` fires once per stick push instead of every frame.
78
+ - Button prompts (B1–B4, B6, B7): 41 glyphs of pad buttons (Xbox, PlayStation, Nintendo, generic
79
+ positions), bumpers, triggers, d-pad, sticks, remote keys and the macOS key symbols — outline
80
+ built-ins of `NiceIcon` and filled, coloured `Ntd*` icons of `@nice2dev/icons` under the same
81
+ names (`pad-xbox-a` → `NtdPadXboxA`); `NiceKeyCap` (words translated, arrows and ⌘ ⌥ ⇧ as
82
+ glyphs); `NiceButtonPrompt` (the button or key of an intent for the device in use, the pad
83
+ family and the user's bindings); `NiceInputHintBar` + `useInputHints` (the actions of the focus
84
+ path); `useNiceAction` (application actions with a key, a pad intent, a scope, `when`,
85
+ `aria-keyshortcuts`, conflict warnings) and `useNiceActions` / `triggerNiceAction` for command
86
+ palettes. `NiceKeyboardHint` is reachable with Tab, draws an icon instead of "?", keycaps, and
87
+ the pad button of shortcuts that carry an `intent` (`COMMON_SHORTCUTS` do); `NiceSkipLink`
88
+ translates its default text. 64 dictionary keys in six languages.
89
+ - `NiceDeviceManager`, the karaoke pad player, the note particles (ui-audio) and the model viewer
90
+ (ui-3d) read pads through the engine (`getInputEngine().gamepadSnapshot`,
91
+ `useConnectedGamepads`). `@nice2dev/ui` re-exports the app-facing part of the input layer.
92
+ - `NiceInputSettings` (new): the input preferences and the rebinding of every intent to keys or a
93
+ pad button, captured from the next press. `NiceCommandPalette` opens on the `menu` intent
94
+ (Ctrl+K, Start, the remote's menu key), keeps focus inside, moves with the d-pad, runs with A
95
+ and lists the `useNiceAction` actions (`includeActions`, default on).
96
+ - Shells are focus scopes (D1, D2): `NiceNavShell`, `NiceAppShell` and the shells of
97
+ `NiceShells` move with the arrows and the d-pad, have F6 / Select regions, switch sections with
98
+ LB / RB and show the hint bar in pad mode (`hintBar`: `bottom` by default, `top`, `none`).
99
+ `NiceNavShell` gets an APG tab strip with a tab menu and moving tabs without dragging
100
+ (Ctrl+Shift+← →), moves focus into the new page after navigating (`focusContentOnNavigate`),
101
+ remembers focus per route and announces the page; `contentArrows: 'native'` gives the arrows
102
+ back to the page.
103
+ - Tabs (C6): every tab list moves with ← → Home End and the d-pad (`useRovingFocus`, also new
104
+ `activateOnMove`). `NiceTabs` links each tab to its panel (`aria-controls` /
105
+ `aria-labelledby`), sets `aria-orientation`, switches with LB / RB in its scope and shows those
106
+ prompts with `showHints`. `NiceCarousel` moves between its dots; ← → on the carousel go on to
107
+ the page at an end without wrapping. The sheet buttons of `NiceSpreadsheet` and the tabs of
108
+ `NiceMobileTabs` are now `role="tab"` with `aria-selected` (they were buttons with
109
+ `aria-pressed` — tests that look them up as buttons must look up tabs); stepping onto "More"
110
+ does not open its sheet.
111
+ - Overlays (C12): every modal, drawer, sheet, popover, lightbox, picker popup and confirmation
112
+ runs on `useOverlayFocus`. Escape / B close only the top overlay — they listened on the
113
+ document before, so one Escape closed every open overlay at once — and focus returns to the
114
+ element that opened it. `useFocusTrap` runs on `useOverlayFocus` (it took its element list
115
+ once, so elements added later broke the trap); a modal no longer pulls focus back from a popup
116
+ opened above it (a select's list portalled after it). An overlay that can be closed shows
117
+ "B Close" in the hint bar (`closeHint`); `useInputHints` takes several publishers per element
118
+ (`fallback` hints give way). Consent dialogs (`NiceCookieConsent`, `NiceGDPRConsent`) keep focus
119
+ until answered. `NiceLightbox`, the mobile `NiceImageGallery`, both print previews and
120
+ `NiceTutorial` take LB / RB (and LT / RT for zoom) on a pad; their keys listen on the overlay
121
+ instead of the window. The context menus (`NiceOverlayContextMenu`, `NiceTouchMenuPopover`)
122
+ open from the menu key, Shift+F10 and X, move with the arrows and letters, and a submenu
123
+ closes on ← / Escape alone. `NiceWindowManager` / `NiceWindow`: windows are F6 / View regions,
124
+ raised when focus enters them, and the taskbar moves with the arrows. `NiceCommandBar` gets
125
+ `aria-activedescendant` and unique ids. The raw glyphs used as icons in `NiceTutorial`, the
126
+ print preview of `@nice2dev/ui-printing` and `NiceGlobalSearch` are `NiceIcon` / `NiceKeyCap`.
127
+ - Menus (C7): `useMenuButton` (new) — ↓ / ↑ on the trigger open the menu on its first / last
128
+ item, the arrows, Home End and letters move, Enter / Space activate items that are not buttons,
129
+ Escape / B, focus leaving and a press outside close it, and a pad's d-pad moves past the trigger
130
+ (A opens). It runs `NiceDropDownButton`, `NiceSpeedDialAction`, `NiceUserMenu`, the extra-action
131
+ menus of `NiceTopNav`, `NiceHamburgerMenu`, the desktop Start menu and the "Open" menu of
132
+ `NiceThemeBuilder`. `NiceUserMenu` and the `NiceTopNav` action menus closed 200 / 180 ms after
133
+ their button lost focus, so focus could never move into them. `NiceTopMenu` is an APG menubar;
134
+ `NiceNavMenu` moves focus into an opened panel (it never did), adds Home / End, moves in two
135
+ dimensions in a mega panel and opens / closes its flyouts from the keyboard; panels opened by
136
+ hovering leave focus where it is. The closed panel of `NiceHamburgerMenu` is inert (Tab reached
137
+ its hidden items). The quick settings of `NiceDeviceTile` are a `dialog`, not a `menu`.
138
+ - Select lists (C3): with the default `searchable`, `NiceSelect` moved focus into a search
139
+ field that had no keys — the list could not be used from the keyboard at all. The field and the
140
+ trigger now share the keys (↑ ↓ PageUp PageDown, Home / End on the trigger, Enter, Escape), the
141
+ list opens on the selected option, names the highlighted one (`aria-activedescendant`), keeps
142
+ it in view and gives focus back to the trigger after a pick; a pad moves and picks in the field.
143
+ The same for `NiceLookup`, `NiceCountryPicker`, `NiceLanguagePicker` and `NiceThemePicker`
144
+ (after a pick from their search field focus was lost to the page), `NiceAutocomplete`,
145
+ `NiceMention` and `NiceSearchInput`. A select open inside a modal now closes alone on Escape.
146
+ `useOverlayFocus` takes `initialFocus: 'none'` and returns focus to the element focused before
147
+ an `autoFocus` child took it.
148
+ - Lists (C8): every list of items is an APG listbox with one tab stop — the arrows, Home End,
149
+ PageUp PageDown and letters move, Enter / Space (A on a pad) pick: `NiceList` (one listbox with
150
+ groups too), both columns of `NicePickList`, `NiceRevisionHistory`, `NiceTaskInbox` and both
151
+ panels of `NiceReconciliationView` (Space picks a row, Enter opens its details as a double
152
+ click does; its rows were `role="row"`, each a tab stop, and `focusStatements()` /
153
+ `focusEntries()` focused nothing). The fields with a list of suggestions drive it from the field
154
+ (`aria-activedescendant`) and with a pad: `NiceTagBox` (a list opened by focus alone has no
155
+ highlight, so Enter still submits a form), `NiceTagInput` (a combobox only with `suggestions`),
156
+ `NiceAccountPicker`, `NiceContactPicker`, `NiceCommandBar` and `NiceGlobalSearch` (Enter and the
157
+ pad took the result from before the filter). The dropdowns of `NiceModeSelector` and
158
+ `NiceDisplayStylePicker` are select-only comboboxes that open on the current item. These fields
159
+ and triggers are `role="combobox"` now — tests that look them up as textboxes or buttons must
160
+ look up comboboxes. Each column of `NiceCascadeSelect` is a listbox: → / Enter go into an
161
+ option's children, ← back; it opens on the selected path and Escape returns focus to the
162
+ trigger. The panel of `NiceIconPicker` is a dialog on the overlay stack (it listened for Escape
163
+ on the document) with a two-dimensional icon grid. The time columns of the `NiceDateTimePicker`
164
+ popup are spinbuttons (Home / End, PageUp / PageDown); the wheel beside them is for the pointer.
165
+ The palette of `NiceWorkflowDesigner` inserts an element on Enter / Space.
166
+ - Trees (C9): `useTreeFocus` (new, also exported from `@nice2dev/ui`) — the APG tree view on
167
+ nested or flat (`aria-level`) trees: one tab stop, ↑ ↓ Home End and letters move, → opens an
168
+ item or enters it, ← closes it or goes to its parent, `*` opens the siblings; Enter / Space and
169
+ a pad's A click the item's row and a pad's X / Shift+F10 open its context menu, so the
170
+ components keep their click handlers. `NiceTreeView` (the items had only the pointer; F2 edits
171
+ and focus comes back after the edit; its context menu is a real menu with focus in it and
172
+ Escape back to the item), `NiceTreeSelect` (↓ / ↑ / Enter on the field open the tree with
173
+ focus in it, ↓ from the search box goes to the tree, a pick returns focus to the field),
174
+ the page tree of `NiceWiki`, the resource tree of `NiceAccessManager` and the mobile tree of
175
+ `NiceTopNav` (each node was two tab stops — its toggle and its link — and the mobile tree had
176
+ `role="tree"` with no items in it).
177
+ - Data grids (C10): `useGridFocus` (new, also exported from `@nice2dev/ui`) — the APG data grid:
178
+ one tab stop, the arrows move by row and column, Home / End along a row, Ctrl+Home / Ctrl+End
179
+ to the corners, PageUp / PageDown by rows; Enter / Space / a pad's A click the cell, and a cell
180
+ holding one control (a header's "toggle all", a row checkbox, a link) is reached on that
181
+ control. `NicePermissionMatrix` (the grants had only the pointer), `NiceModuleGrid` (its cells
182
+ are `gridcell`s now and `role="grid"` sits on the table, no longer on the whole control with
183
+ its toolbar and pagination — tests that look the grid up still find it, by its label too; a
184
+ cell's Enter selects its row, a header's sorts; the mobile cards are a listbox of options, not
185
+ rows), `NiceWarehouseView` (ui-erp; every bin was a tab stop, and a focused bin shows its
186
+ details as a hovered one does). `NiceSpreadsheet` adds Home / End, Ctrl+Home / Ctrl+End and
187
+ PageUp / PageDown.
188
+ - One of several (C4): `NiceSegmentedControl` is a radio group — one tab stop, the arrows (a
189
+ pad's d-pad) move and select; its options were toggle buttons with `aria-pressed`, one tab stop
190
+ each (tests that look them up as pressed buttons must look up checked radios). So are the
191
+ true / false, NPS and star scales of the assessment widgets (`NiceSurvey`, `NiceQuiz`,
192
+ `NicePollLive`). `NiceRadioGroup` and the payment method selector were native radio groups
193
+ already.
194
+ - Sliders (C5): `NiceRangeSlider`'s thumbs had no keys at all — the arrows step, PageUp /
195
+ PageDown take a tenth of the range, Home / End go as far as the thumb may, and they are named
196
+ "Minimum" / "Maximum" with the formatted value as `aria-valuetext`. `NiceKnob`, `NiceTempDial`
197
+ and `NiceRating` add PageUp / PageDown and Home / End; `NiceTempDial` consumes its keys (the
198
+ arrows also scrolled the page, and an engaged pad's d-pad moved focus away instead of stepping).
199
+ - Toolbars (C13): the toolbars of `NiceDocumentEditor`, `NiceImageEditor`, `NicePDFViewer`, the
200
+ file manager, the component playground's canvas and `NiceDock` are one tab stop with the arrows
201
+ along the bar and Home / End between their buttons (their fields and selects keep their own
202
+ keys); they are named, a side dock is a vertical toolbar and a focused dock item magnifies as a
203
+ hovered one does. The file manager's panels name the item under their cursor
204
+ (`aria-activedescendant`) — its rows were no options, so ↑ ↓ moved a cursor no screen reader
205
+ could follow.
206
+ - Dates (C11): `NiceCalendar` is an APG date grid — its days had no keys at all though the hint
207
+ listed them: focus sits on a day (one tab stop), ← → a day, ↑ ↓ a week, Home / End the week,
208
+ PageUp / PageDown a month, Shift+PageUp / PageDown a year, crossing into the next month as
209
+ needed; Enter / Space pick; a pad's LB / RB change the month and LT / RT the year; the month
210
+ and year pickers move in two dimensions and a pick keeps focus in the calendar. The
211
+ `NiceDateTimePicker` field opens its picker with Alt+↓, the context-menu key, Shift+F10 or a
212
+ pad's X (its button is no tab stop), focus on the day; the clock's hour and minute are
213
+ spinbuttons. The single-field `NiceDateRangeBox` opens with Enter / Space / ↓, its popup is on
214
+ the overlay stack (it closed on any Escape on the page) and a picked range returns focus to
215
+ the field. In the engine a read-only text field is not engaged: a pad's A acts as its Enter.
216
+ - Number fields (C2): WAI-ARIA spinbutton keys — ↑ ↓ a step, PageUp / PageDown ten, Home / End
217
+ the minimum / maximum (without a bound they stay the caret's). `NiceNumericInput` had no keys
218
+ at all; `NiceNumberInput` adds the big step and the bounds, a stepped value replaces the typed
219
+ text (it stayed on screen) and a read-only field no longer steps. With `showSteppers`
220
+ `NiceMoneyInput`'s amount is a `spinbutton` with the same keys — its stepper buttons are out of
221
+ the tab order, so the steps were pointer-only (the buttons show `NiceIcon`s instead of "−" /
222
+ "+"); without steppers it stays a text field. On a pad B on an engaged number field cancels:
223
+ the engine puts a native `<input type="number">`'s value from before back, and the new
224
+ `useEngage` option `restoreOnCancel` does it for a custom control (put the value back in
225
+ `onRelease(true)`). LT / RT on an engaged native field (minimum / maximum) went past React's
226
+ value tracker unseen — a controlled input never heard of it. The hint bar names what the
227
+ buttons do on an engaged control — "Adjust", "A Done, B Cancel" on number fields, "Start
228
+ Confirm, B Done" on a text field, "A Select, B Close" with a list open — and follows engaging
229
+ and opening a list (it only changed when focus moved).
230
+ - Composites (C14, part 1): `NiceAccordion` headers move with ↑ ↓ Home / End (each stays a Tab
231
+ stop; `type="button"` — in a form a header submitted it; `aria-controls` only while the panel
232
+ exists). `NiceCollapse`'s panel is named by its trigger; a header-toggled
233
+ `NiceCollapsibleCard` no longer takes Enter / Space from the controls in it. `NiceFAQ`'s
234
+ folded answers are `inert` (their buttons stayed in the Tab order while hidden) and a
235
+ foldable group has a button. `NiceStepper` steps are buttons with `allowStepClick` (pointer
236
+ only before) and the active one is `aria-current="step"`. `NiceWizard` and
237
+ `NiceSetupWizard` step back and on with LB / RB (Ctrl+PageUp / Ctrl+PageDown) — validated as
238
+ the buttons are, with hints; the wizard's progress is a `progressbar`, its step content a
239
+ named `group` (a `tabpanel` without tabs) and its validation error an `alert`; the setup
240
+ wizard's vertical layout moves through the steps with ↑ ↓. `NiceCarousel` waits while the
241
+ pointer is over it or focus is in it, has a button that stops / starts the rotation
242
+ (WCAG 2.2.2 — it never stopped), takes slides out of view out of the Tab order (`inert`),
243
+ announces a slide the user changed and changes slides on LB / RB. `NiceGallery`'s
244
+ thumbnails are one Tab stop (← → Home End move and show), `aria-pressed` on the shown one;
245
+ its autoplay waits the same way; LB / RB change the image. `NicePagination` buttons are
246
+ `type="button"` (in a form, Enter in a field "clicked" First / Previous), pages are named
247
+ ("Page 3"), the ellipsis is hidden, the jump field is labelled, the page change is announced
248
+ and LT / RT (PageUp / PageDown) turn the page, the prev / next buttons showing the triggers
249
+ next to them (B5). In a paged `NiceDataGrid` a pad's LT / RT turn the page from anywhere in
250
+ the grid — the keyboard's PageUp / PageDown stay the cell's. A breadcrumb with only `onClick`
251
+ is a button (an `<a>` without `href` had no Tab stop), separators are hidden. A clickable
252
+ `NiceTag` takes Enter / Space and, when removable, Delete / Backspace; `aria-pressed` with
253
+ `selected`; its remove button names the tag ("Remove: React").
254
+ - Composites (C14, part 2): `NiceColorPicker`'s saturation / brightness box is a slider — it
255
+ took only the pointer (← → saturation, ↑ ↓ brightness, Shift by ten, PageUp / PageDown,
256
+ Home / End); its presets are one Tab stop moved in two dimensions (as its shortcut hint
257
+ already promised), `aria-pressed` on the current one; every channel field is named and a
258
+ disabled picker is no Tab stop. `NiceGradientPicker`'s stops are sliders (← → move,
259
+ Delete removes; focus selects as a click does), its toggle groups show `aria-pressed`, every
260
+ field is named. `NiceColorPalette`'s hue wheel is a slider of the base hue (pointer only
261
+ before); its tints and shades took focus but no keys — one Tab stop now, Enter / Space
262
+ apply; focus into a colour row selects it. `NiceUpload`: an icon-only drop zone is named,
263
+ progress is a `progressbar`, a file's actions name the file and status changes are
264
+ announced. `NiceTutorial` is named by its step and described by its text, says the title of
265
+ a new step (focus stays on the Next button) and goes to the first / last step with Home /
266
+ End. In `useRovingFocus` the pressed button of a toggle group is the initial stop.
267
+ - TV / 10-foot mode (D4): `data-nice-tv` on any element applies the 10-foot variant of the
268
+ theme below it — type of 24–28 px on a 1080p picture, targets of 48–64 px, spacing × 1.5, a
269
+ stronger focus ring (`styles/tv.css`, part of the `@nice2dev/ui` stylesheet); the input engine
270
+ sets it on `<html>` in a TV browser (webOS, Tizen, Android TV …; `engine.isTv`), and
271
+ `NiceKioskShell` / `NiceNavShell` take `tv`, which also keeps a 5 % safe area for overscan.
272
+ Remote keys were already the engine's (A1).
273
+ - `NiceMdiWorkspace` (D1): the tab menu (right click, X on a pad, Shift+F10) is a menu that
274
+ takes focus, moves with ↑ ↓ and closes on Escape / B with focus back on its tab — it was a
275
+ plain box the keyboard never reached; it moves a tab left or right (the way without
276
+ dragging); Delete closes the focused tab; the unsaved-changes question is a modal dialog with
277
+ focus on Cancel; LB / RB (Ctrl+PageUp / Ctrl+PageDown) switch tabs from anywhere in the
278
+ workspace.
279
+ - Hover has a focus counterpart (C15): `NiceRate` previews the focused star; an auto-hidden
280
+ `NiceDockMenu` shows while focus is in it (a Tab reached its buttons while they stayed
281
+ hidden) and its icon or letter items are named by their text; a hover `NicePopover` opens on
282
+ focus of its trigger too and Escape there hides it first; `NiceTimeline` events took only the
283
+ pointer — they are one Tab stop moved by the arrows, Enter / Space open one and focus shows
284
+ its details; `NiceScheduler` events are Tab stops with Enter / Space and their details on
285
+ focus; the comment button of `NiceGitDiffViewer` shows on focus as on hover.
286
+ - Typing with a pad (H1, H2): `NiceOnScreenKeyboard` (new, `@nice2dev/ui`) — the d-pad moves
287
+ over the keys and A types; X deletes, Y types a space, LT / RT move the cursor, LB / RB change
288
+ the layout (letters with the accents of the interface language, symbols, more languages),
289
+ Start confirms and B closes; the buttons show next to their keys in pad mode; a physical
290
+ keyboard and touch type too; `modal={false}` makes it a standing keyboard of a page.
291
+ `NiceOnScreenKeyboardHost` (new) opens it for the text field a pad or remote engages (A on the
292
+ field) — every key goes into the field as typing would (a controlled field hears it in
293
+ `onChange`), Start submits as Enter (a form submits), B leaves the text as it is; number
294
+ fields get digits, a text area new lines; the `onScreenKeyboard` preference turns it off or
295
+ also opens it on touch (kiosks). The application shells render the host. Its layouts are the
296
+ keyboard core now in `@nice2dev/ui-core` (`NICE_KEYBOARD_LAYOUTS`, `buildKeyboardRows`,
297
+ `insertAtCaret` …), which `NiceTouchKeyboard` (ui-mobile) uses too — its exported type names
298
+ are unchanged. New built-in glyphs `key-backspace`, `key-space`, `key-caps` (and
299
+ `NtdKeyBackspace`, `NtdKeySpace`, `NtdKeyCaps` in `@nice2dev/icons`); `setFieldText` writes a
300
+ field's text past React's value tracker.
301
+ - Toasts (D3): `NiceToastContainer` is a region named "Notifications", so F6 or a pad's View
302
+ reaches the toasts while they never take focus; Escape / B dismisses the toast with focus,
303
+ which goes on to the next toast or back where it came from (it was lost with the toast). The
304
+ countdown waits while the pointer is over a toast or focus is in it (WCAG 2.2.1). A toast can
305
+ carry an `action` (`{ label, onClick }`, also in `useNiceToast`'s options, `NiceToastOptions`)
306
+ — it runs and dismisses the toast.
307
+ - `NiceScientificChart` (ui-science): the export buttons had no handler — CSV and JSON of the
308
+ visible data and SVG / PNG of the plot download now, and the new `onExport` takes every format
309
+ over (PDF is offered only with it); the tooltip sits beside the hovered point instead of the
310
+ plot's corner. The VLAN panel of `@nice2dev/ui-buildings` labels its connections with a key of
311
+ their own (in Polish it read "połączeń", the counted form).
312
+ - `NiceCodeEditor`: an inline `lsp={{ … }}` object re-created the Monaco editor on every render,
313
+ dropping its undo history and cursor — it is re-created only when the LSP config's content
314
+ changes. The audio editor's project hooks (`useProjectCRUD`, `useAutoSave`) word their status
315
+ messages and questions through the translator (some were Polish without diacritics).
316
+ - Prompts next to controls (B5): `NiceControlHint`, and `hint` / `showHint` on `NiceButton` — the
317
+ button or keys of its action, shown while hints are visible; keys also become
318
+ `aria-keyshortcuts`. `NiceButton` also passes `role`, `aria-selected`, `aria-pressed`,
319
+ `aria-expanded`, `aria-controls`, `aria-haspopup`, `tabIndex` and `onKeyDown`.
320
+ - Found by the showcase crawler (I4, `scripts/audit-input-crawl.mjs`): **no `NiceButton` showed a
321
+ focus ring** — the display styles write `box-shadow` inline (`none` for the default `flat`) and
322
+ that beat the `:focus-visible` rule; the ring is `!important` now, also for the `underlined` and
323
+ `neumorphic` fields. `NiceCodeEditor`, `NiceCodeDiffEditor`, `NiceSimpleCodeEditor` and
324
+ `NiceMarkdownEditor` were keyboard traps (Tab indents and Shift+Tab outdents, nothing left the
325
+ field): Escape, then Tab moves focus on (WCAG 2.1.2), said in the field's description, and a
326
+ read-only editor lets Tab through (it indented its text); `createTabEscape()` (new, ui-core
327
+ and ui) gives a control of your own the same. These editors, `NiceHtmlEditor`,
328
+ `NiceTerminalUI` and the search of `NicePickList` drew no focus at all — their frame shows the
329
+ ring now. The diagram buttons of `NiceGamepad` were pointer-only, so arming a button for an
330
+ assignment took a mouse: with a handler or an action tree they are buttons (one Tab stop, the
331
+ arrows move by geometry, Enter / Space / A press, `aria-pressed` while armed); an SVG element
332
+ has no `click()`, so a pad's A dispatches a click to one (`clickElement`, new). A sortable
333
+ `NiceDataGrid` header sorted only on a click: it is a Tab stop and sorts on
334
+ Enter / Space / A. `NicePasswordInput`'s show / hide button is a Tab stop (showing the password
335
+ took a pointer). The `NiceDateTimePicker` field says how its picker opens (`aria-haspopup`,
336
+ `aria-keyshortcuts="Alt+ArrowDown"`).
337
+ - More from the crawler (I4). `NiceDataGrid` took keys from anything inside it: with a focused
338
+ cell Tab never left the grid (a trap, also from a header) and the search field's arrows did
339
+ not move its caret — the cell cursor follows only the grid's own focus, and Tab at the edge of
340
+ a row leaves. `NiceSpreadsheet`'s formula bar kept Tab without an edit. `NiceModelEditor`
341
+ (ui-3d) listened on the whole page: Tab cycled its mode anywhere (focus moved nowhere on a page
342
+ with the editor), Space pressed no button and Ctrl+Z took the undo of every text field — its
343
+ shortcuts work inside the editor only, Tab and Space on its controls are theirs, Escape then
344
+ Tab leaves the viewport. `NiceDocumentEditor` indents a block on Tab and lets the keyboard out
345
+ as the code editors do (Escape, then Tab; its shortcut list says so). `NicePlaylistDualPane` (ui-audio)
346
+ switches panes on Tab, and Escape then Tab moves on. `NiceSeatingChart` / `NiceSeatPicker`
347
+ (events) take focus to the cursor seat — it stayed on the chart, out of a screen reader's
348
+ reach. Rings where there were none: the cursor row of `NiceKaraokeSongBrowser` (it looked the
349
+ same focused as not), `NiceFileManager`'s panels, `NiceTagInput`, the name field of
350
+ `NiceWorkflowDesigner`, `NiceDocumentEditor`, the chat and search fields of ui-communication
351
+ (`outline: none` inline), the search of `NiceGlobalSearch` and `NiceAccessLog`
352
+ (ui-enterprise), the fields of `NiceTaskManager` and `NiceTorrentUI` (templates) and of the
353
+ automation and scene editors (ui-buildings), the viewport of `NiceModelViewer` (ui-3d).
354
+ - `useOverlayFocus` gave focus back to the opener whenever an overlay closed with focus on the
355
+ page body — also for the moment of a Tab, when the opener's blur closed a popup it showed on
356
+ focus: a `NiceDataGrid` header with column stats took focus back on every Tab, a trap. Focus
357
+ goes back now only when it was in the overlay. The keyboard shortcuts of `GenericPlayer`
358
+ (ui-audio) and `NicePresentationPlayer` (ui-presentations) listened on the whole page — the
359
+ arrows of every list and a pad's d-pad (they move focus with them) did nothing on a page with a
360
+ player, Space pressed no button, and with a presentation Backspace deleted nothing and Enter
361
+ submitted nothing in any field; they work in the player or with focus on the page body, and
362
+ Space / Enter on the player's own buttons press them. A pad has no Tab: on a control of a
363
+ player its d-pad moves focus (as seek, volume or the next slide it kept focus in the player for
364
+ good); on the player itself or the page body a remote's arrows still turn the slides.
365
+ - Lint (I2): the whole jsx-a11y recommended set is on, with the input program's own rules against
366
+ page-wide key listeners and inline `outline: 'none'`. Found on the way: the reply box of
367
+ `NiceHelpdesk` and the search of `NiceCommandBar` took the outline away and showed nothing
368
+ instead — they show focus now.
369
+ - `NicePopover` (the one anchored to a `targetRef`) had no keyboard at all — it closed only on a
370
+ click outside it. It is a `dialog` named by its `title`, takes focus when it opens, closes on
371
+ Escape / B and gives focus back to its target (tests that count the page's dialogs see it now).
372
+ A pick in a `NiceSelect` inside it closed it and was lost (the select's list is portalled out
373
+ of the popover): such a click keeps it open.
374
+ - Rows, cards, tiles and list entries that answered a pointer only (C1) are buttons for the
375
+ keyboard and the pad: `role="button"`, a Tab stop, Enter / Space / A press them — a selection
376
+ toggle says `aria-pressed`, a folder or summary row `aria-expanded`, a check box drawn with a
377
+ `div` is a `checkbox` with its item's name. `clickOnActivationKey` (new, ui-core and ui) is the
378
+ `onKeyDown` for such an element: Enter and Space click it, once per press and with the
379
+ modifiers, so Ctrl+Enter selects as Ctrl+click does; keys of a control inside it stay that
380
+ control's. Dialog backdrops and click stoppers are `role="presentation"` (Escape / B close the
381
+ dialogs). Done so far in events (attraction picker and voting, round list), game-engine (the
382
+ Godot, Unity and Unreal project browsers, the asset store, the editor's hierarchy), licensing
383
+ (portal, transfer, the license table), templates (health, life dashboard, personal finance,
384
+ task manager, torrent UI) and `OmniWerkLogo`, whose `role="button"` took no key; ui-3d (model
385
+ editor outliner with expand / show-hide buttons, Add menu, context menu, timeline, particle
386
+ editor), ui-ai (dataset, experiment, model and labeling cards), ui-api (endpoints, schemas,
387
+ history), ui-audio (sample browser, bar-fill swatches, DMX cues and tracks, the "activate
388
+ audio" overlay, playlist grid / overview / sidebar / search / tags / track list),
389
+ ui-bi (ETL palette and nodes), ui-buildings (automations, zone card, scenes, network paths,
390
+ object library), ui-diagrams, ui-enterprise (access log, contract sections), ui-erp (capacity
391
+ planner — its time cells are named buttons, the only way to add an allocation — and inventory
392
+ cards), ui-forms, and in ui-core `NiceIcon` and `NiceTouchTarget` with an `onClick` and the
393
+ profiler's header — `NiceTouchTarget` also draws a focus ring now; ui-graphics (font glyphs, 2D game asset lists and state nodes, photo
394
+ overlays and colour swatches, pixel layers with show / lock buttons, palette and frames,
395
+ texture and UI designer layers, vector gradients and layers), ui-iot cards, ui-math templates,
396
+ ui-monitoring (saved queries, expandable log rows), ui-presentations (slide thumbnails and the
397
+ overview), ui-printing (template cards, schema fields, layers), ui-science (citations,
398
+ notebooks) and ui-video (live sources, timeline tracks and clips). A clickable `NiceIcon` is a
399
+ button now. `ImportPreviewDialog` (ui-buildings) carried `role="dialog"` on its backdrop — it
400
+ is on the dialog box now. The wheel of `NiceMobilePicker` still has no keys (it gets a
401
+ spinbutton column with E). Tests that count the buttons of these components find more.
402
+ - C1 in `@nice2dev/ui`: the rows, cards and items of the devops, data-branching, media, no-code,
403
+ tools, backup and chart components are buttons (selection toggles `aria-pressed`, folding rows
404
+ `aria-expanded`); a `NiceKanbanBoard` card that opens on a click and a `NiceTileView` tile with
405
+ `onTileClick` are buttons; `NiceTreeList` rows fold from the keyboard (the toggle is a named
406
+ button with `aria-expanded`); `NiceDataGrid`'s virtual group rows and detail toggles take
407
+ Enter / Space. A built-in `NiceIcon` with `onClick` is a button — it was `aria-hidden` and took
408
+ no key. `NiceSelect`, `NiceCountryPicker`, `NiceLanguagePicker` and `NiceThemePicker` clear with
409
+ Delete / Backspace on the trigger (`aria-keyshortcuts="Delete"`): the × in the trigger was
410
+ pointer-only (in `NiceSelect` a `role="button"` inside the trigger button) and is
411
+ `role="presentation"` now. `NiceModal`, `NiceConfirmDialog`, `NiceCommandPalette` and
412
+ `NiceGlobalSearch` stop clicks at the backdrop instead of the dialog — a click on the backdrop
413
+ itself closes, and no click inside or on it reaches a component around the overlay.
414
+ `NiceHtmlEditor`'s template list is a menu with keys, its emoji are buttons; `NiceGitManager`
415
+ opens a file's diff from its path, a button (a click elsewhere on the row did it before);
416
+ `NiceResourceAllocation`'s days are named buttons with `onSlotClick`. Options of comboboxes and
417
+ items of menus, trees and grids keep their click with a line disable naming the keys that
418
+ drive them. The empty cells of `NiceScheduler`'s grids get their keys with E.
419
+
420
+ ### Patch Changes
421
+
422
+ - 2972a9a: Showcase feedback: charts, the theme and workflow designers, the vector editor and the spatial
423
+ editor.
424
+
425
+ - `NiceChart`: bars are centred on their category label. The slots counted line series too, so in
426
+ a bar + line chart every bar sat left of its label.
427
+ - `NicePieChart`: the slice labels get a white fill with a dark halo (`.nice-piechart__label`,
428
+ tokens `--nice-piechart-label-color` / `--nice-piechart-label-halo`) and read on light slices.
429
+ In a donut the label sits in the middle of the ring, not at 0.7 of the radius, where it fell
430
+ into a wide hole. `innerRadius` stays 0 by default: a full pie.
431
+ - `NiceBarGauge`: the title gets a band of its own and the drawn arc, not the whole circle, is
432
+ fitted into the box. The outer ring no longer runs into the title, and the rings of the default
433
+ 270° gauge are larger. Visual change only; the props are the same.
434
+ - `NiceThemeDesigner` / `NiceThemeBuilder`:
435
+ - Apply Theme and `livePreview` apply the theme through the enclosing `NiceThemeProvider`
436
+ (`setTheme`), and to the document root only outside one. The provider's scope shadows
437
+ `:root`, so inside a provider neither had a visible effect.
438
+ - Export JSON downloads `<theme name>.json` when no `onExport` is given; it did nothing before.
439
+ - A click on the next preview element clears the previous field's dashed highlight.
440
+ - `NiceWorkflowDesigner` (state machine):
441
+ - A drag on the empty canvas pans the view; the canvas now fills the height and scrolls. A
442
+ press on the canvas without a drag clears the selection, and the properties panel has a close
443
+ button (new key `workflowDesigner.closeProps` × 6 languages).
444
+ - No properties panel opens while simulating: a simulation step no longer selects the state it
445
+ leaves. The current state of a simulation scrolls into view.
446
+ - `NiceVectorEditor`:
447
+ - A dragged rectangle, ellipse, line or arrow stays on the canvas; it was deleted on release as
448
+ "tiny".
449
+ - The pointer maps through the viewBox fit of the artboard, so shapes land where they are
450
+ drawn, also when the artboard is shown smaller than its size.
451
+ - `NiceSpatialEditor`:
452
+ - A plan given as `initialDocument` gets its active floor; objects added to it were dropped.
453
+ - The canvas draws walls, devices, furniture, network and infrastructure gear, besides the
454
+ zones and cables it drew before.
455
+ - Finishing a drawing (double-click or Enter) creates a zone or wall segments in
456
+ spatial-core's shapes. Before, the drawing vanished.
457
+ - A pick in the object library is placed by a click on the plan, or dragged onto it; the
458
+ toolbar's place tools put their kind of object down.
459
+ - The select tool moves objects by dragging. `MOVE_OBJECTS` moves all of an object's geometry
460
+ (box, outline, wall ends), and attached cable ends follow. The X / Y fields of the properties
461
+ panel move the object.
462
+ - `onDocumentChange` and `onSelectionChange` are called on every change; they never were.
463
+ - An added object goes into the first layer of its name, else of its type, else a new layer.
464
+ - `NiceSpatialViewer`:
465
+ - Reads zones in any of the shapes in use: `boundary`, `metadata.points` or `polygon`.
466
+ - Draws walls and cables as lines, and objects without `position` at their box instead of
467
+ (0, 0).
468
+ - Shows a real minimap; the minimap was an empty box.
469
+ - `Minimap`: reads zones in any of those shapes; it read `polygon` only.
470
+
471
+ - Updated dependencies [e4cd134]
472
+ - Updated dependencies [ada5a2d]
473
+ - Updated dependencies [2972a9a]
474
+ - @nice2dev/ui-core@1.3.0
475
+ - @nice2dev/i18n@1.3.0
476
+
3
477
  ## 1.2.2
4
478
 
5
479
  ### Patch Changes
@@ -0,0 +1,101 @@
1
+ import { jsxs as y, jsx as t } from "react/jsx-runtime";
2
+ import { normalizeVariant as M, normalizeSize as R, useNiceAccessMode as V, useComponentDisplayStyle as q, useComponentDisplayClass as F, NiceControlHint as G } from "@nice2dev/ui-core";
3
+ import { forwardRef as J } from "react";
4
+ const U = /* @__PURE__ */ Object.assign(
5
+ /* @__PURE__ */ J(
6
+ ({
7
+ children: i,
8
+ variant: x = "primary",
9
+ size: S = "md",
10
+ type: w = "button",
11
+ disabled: c,
12
+ loading: e,
13
+ fullWidth: z,
14
+ onClick: D,
15
+ leftIcon: r,
16
+ rightIcon: a,
17
+ error: l,
18
+ errorPlacement: f = "bottom",
19
+ ariaLabel: j,
20
+ hint: d,
21
+ showHint: B = !1,
22
+ className: E,
23
+ style: O,
24
+ id: h,
25
+ accessMode: H,
26
+ displayStyle: N,
27
+ ...L
28
+ }, W) => {
29
+ const s = typeof d == "string" ? { intent: d } : d, o = M(x), b = R(S), u = V(H, h), _ = u === "hidden";
30
+ (u === "disabled" || u === "readOnly") && (c = !0);
31
+ const k = q("button", N), A = F("button", N);
32
+ let v = k;
33
+ if (o !== "primary") {
34
+ const n = { ...k };
35
+ delete n.background, delete n.color, (o === "outline" || o === "ghost") && (delete n.border, delete n.borderColor, delete n.borderWidth, delete n.borderStyle, delete n.boxShadow), v = n;
36
+ }
37
+ const p = i != null && i !== !1 && !(typeof i == "string" && i.trim() === ""), $ = !p && !!(r || a), m = /* @__PURE__ */ y(
38
+ "button",
39
+ {
40
+ ref: W,
41
+ type: w,
42
+ id: h,
43
+ className: `nice-btn nice-btn--${o} nice-btn--${b} nice-btn--ds-${A} ${$ ? "nice-btn--icon-only" : ""} ${z ? "nice-btn--full-width" : ""} ${e ? "nice-btn--loading" : ""} ${l && !f ? "nice-btn--has-error" : ""} ${E || ""}`,
44
+ style: { ...v, ...O },
45
+ disabled: c || e,
46
+ "aria-busy": e || void 0,
47
+ "aria-disabled": c || e || void 0,
48
+ "aria-label": j,
49
+ "aria-keyshortcuts": s?.keys ? s.keys.replace(/\bCtrl\b/g, "Control").replace(/\bEsc\b/g, "Escape") : void 0,
50
+ onClick: D,
51
+ ...L,
52
+ children: [
53
+ e && /* @__PURE__ */ t(
54
+ "svg",
55
+ {
56
+ className: "nice-btn__spinner",
57
+ viewBox: "0 0 24 24",
58
+ fill: "none",
59
+ stroke: "currentColor",
60
+ strokeWidth: "3",
61
+ "aria-hidden": "true",
62
+ children: /* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "10", strokeDasharray: "31.4 31.4", strokeLinecap: "round" })
63
+ }
64
+ ),
65
+ !e && r && /* @__PURE__ */ t("span", { className: "nice-btn__icon", "aria-hidden": "true", children: r }),
66
+ !e && p && /* @__PURE__ */ t("span", { children: i }),
67
+ e && p && /* @__PURE__ */ t("span", { style: { visibility: "hidden" }, "aria-hidden": "true", children: i }),
68
+ e && $ && /* @__PURE__ */ t("span", { className: "nice-btn__icon", style: { visibility: "hidden" }, "aria-hidden": "true", children: r || a }),
69
+ !e && a && /* @__PURE__ */ t("span", { className: "nice-btn__icon", "aria-hidden": "true", children: a }),
70
+ s && /* @__PURE__ */ t(
71
+ G,
72
+ {
73
+ className: "nice-btn__hint",
74
+ intent: s.intent,
75
+ keys: s.keys,
76
+ button: s.button,
77
+ always: B
78
+ }
79
+ )
80
+ ]
81
+ }
82
+ );
83
+ if (_)
84
+ return null;
85
+ if (!l)
86
+ return m;
87
+ const C = /* @__PURE__ */ t("div", { className: "nice-field__error", role: "alert", children: l });
88
+ return f === "right" ? /* @__PURE__ */ y("span", { className: `nice-btn-field nice-btn-field--right nice-field--${b}`, children: [
89
+ m,
90
+ C
91
+ ] }) : _ ? null : /* @__PURE__ */ y("span", { className: `nice-btn-field nice-btn-field--bottom nice-field--${b}`, children: [
92
+ m,
93
+ C
94
+ ] });
95
+ }
96
+ ),
97
+ { displayName: "NiceButton" }
98
+ );
99
+ export {
100
+ U as N
101
+ };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("react/jsx-runtime"),r=require("@nice2dev/ui-core"),W=require("react"),A=Object.assign(W.forwardRef(({children:s,variant:C="primary",size:$="md",type:S="button",disabled:l,loading:t,fullWidth:w,onClick:z,leftIcon:c,rightIcon:a,error:d,errorPlacement:f="bottom",ariaLabel:B,hint:b,showHint:D=!1,className:q,style:E,id:h,accessMode:O,displayStyle:x,...R},H)=>{const i=typeof b=="string"?{intent:b}:b,o=r.normalizeVariant(C),u=r.normalizeSize($),y=r.useNiceAccessMode(O,h),N=y==="hidden";(y==="disabled"||y==="readOnly")&&(l=!0);const j=r.useComponentDisplayStyle("button",x),L=r.useComponentDisplayClass("button",x);let _=j;if(o!=="primary"){const n={...j};delete n.background,delete n.color,(o==="outline"||o==="ghost")&&(delete n.border,delete n.borderColor,delete n.borderWidth,delete n.borderStyle,delete n.boxShadow),_=n}const p=s!=null&&s!==!1&&!(typeof s=="string"&&s.trim()===""),k=!p&&!!(c||a),m=e.jsxs("button",{ref:H,type:S,id:h,className:`nice-btn nice-btn--${o} nice-btn--${u} nice-btn--ds-${L} ${k?"nice-btn--icon-only":""} ${w?"nice-btn--full-width":""} ${t?"nice-btn--loading":""} ${d&&!f?"nice-btn--has-error":""} ${q||""}`,style:{..._,...E},disabled:l||t,"aria-busy":t||void 0,"aria-disabled":l||t||void 0,"aria-label":B,"aria-keyshortcuts":i?.keys?i.keys.replace(/\bCtrl\b/g,"Control").replace(/\bEsc\b/g,"Escape"):void 0,onClick:z,...R,children:[t&&e.jsx("svg",{className:"nice-btn__spinner",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3","aria-hidden":"true",children:e.jsx("circle",{cx:"12",cy:"12",r:"10",strokeDasharray:"31.4 31.4",strokeLinecap:"round"})}),!t&&c&&e.jsx("span",{className:"nice-btn__icon","aria-hidden":"true",children:c}),!t&&p&&e.jsx("span",{children:s}),t&&p&&e.jsx("span",{style:{visibility:"hidden"},"aria-hidden":"true",children:s}),t&&k&&e.jsx("span",{className:"nice-btn__icon",style:{visibility:"hidden"},"aria-hidden":"true",children:c||a}),!t&&a&&e.jsx("span",{className:"nice-btn__icon","aria-hidden":"true",children:a}),i&&e.jsx(r.NiceControlHint,{className:"nice-btn__hint",intent:i.intent,keys:i.keys,button:i.button,always:D})]});if(N)return null;if(!d)return m;const v=e.jsx("div",{className:"nice-field__error",role:"alert",children:d});return f==="right"?e.jsxs("span",{className:`nice-btn-field nice-btn-field--right nice-field--${u}`,children:[m,v]}):N?null:e.jsxs("span",{className:`nice-btn-field nice-btn-field--bottom nice-field--${u}`,children:[m,v]})}),{displayName:"NiceButton"});exports.NiceButton=A;