@enonic/ui 1.5.0 → 1.7.0
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/README.md +18 -6
- package/dist/enonic-ui.cjs +1 -1
- package/dist/enonic-ui.es.js +135 -131
- package/dist/style.cjs +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/style.css +2 -2
- package/dist/types/components/avatar/avatar.d.ts +18 -13
- package/dist/types/components/button/button.d.ts +6 -3
- package/dist/types/components/checkbox/checkbox.d.ts +25 -3
- package/dist/types/components/combobox/combobox.d.ts +23 -14
- package/dist/types/components/context-menu/context-menu.d.ts +78 -37
- package/dist/types/components/date-picker/date-picker.d.ts +36 -23
- package/dist/types/components/dialog/dialog-actions.d.ts +16 -1
- package/dist/types/components/dialog/dialog.d.ts +81 -44
- package/dist/types/components/grid-list/grid-list.d.ts +102 -12
- package/dist/types/components/icon-button/icon-button.d.ts +6 -5
- package/dist/types/components/input/input.d.ts +28 -6
- package/dist/types/components/link/link.d.ts +7 -3
- package/dist/types/components/listbox/listbox.d.ts +5 -3
- package/dist/types/components/menu/menu.d.ts +52 -25
- package/dist/types/components/menubar/menubar.d.ts +94 -33
- package/dist/types/components/radio-group/radio-group.d.ts +30 -12
- package/dist/types/components/search-field/search-field.d.ts +5 -5
- package/dist/types/components/selectable-list-item/selectable-list-item.d.ts +1 -1
- package/dist/types/components/selector/selector.d.ts +72 -36
- package/dist/types/components/stepper/index.d.ts +1 -1
- package/dist/types/components/stepper/stepper.d.ts +66 -18
- package/dist/types/components/tab/tab.d.ts +97 -21
- package/dist/types/components/tab/tab.phrases.d.ts +4 -0
- package/dist/types/components/tag/tag.d.ts +29 -24
- package/dist/types/components/textarea/textarea.d.ts +34 -3
- package/dist/types/components/time-picker/time-picker.d.ts +26 -19
- package/dist/types/components/toast/toast.d.ts +29 -25
- package/dist/types/components/toggle/toggle.d.ts +5 -3
- package/dist/types/components/toggle-group/toggle-group.d.ts +6 -9
- package/dist/types/components/toolbar/toolbar-toggle-group.d.ts +10 -12
- package/dist/types/components/toolbar/toolbar.d.ts +29 -21
- package/dist/types/components/tooltip/tooltip.d.ts +13 -1
- package/dist/types/components/tree-list/tree-list.d.ts +255 -62
- package/dist/types/components/virtualized-tree-list/virtualized-tree-list.d.ts +90 -43
- package/dist/types/hooks/use-active-item-focus.d.ts +1 -1
- package/dist/types/hooks/use-active-on-open.d.ts +1 -1
- package/dist/types/hooks/use-click-outside.d.ts +2 -2
- package/dist/types/hooks/use-floating-position.d.ts +2 -2
- package/dist/types/hooks/use-focus-outside.d.ts +9 -0
- package/dist/types/hooks/use-pointer-position.d.ts +1 -1
- package/dist/types/hooks/use-portal-focus-container.d.ts +6 -2
- package/dist/types/hooks/use-radio-navigation.d.ts +1 -1
- package/dist/types/hooks/use-scroll-active-into-view.d.ts +1 -1
- package/dist/types/hooks/use-step-navigation.d.ts +1 -1
- package/dist/types/hooks/use-submenu-safe-area.d.ts +1 -1
- package/dist/types/hooks/use-sync-value.d.ts +1 -1
- package/dist/types/i18n/phrases.d.ts +3 -0
- package/dist/types/primitives/menu-primitive/menu-primitive.d.ts +41 -20
- package/dist/types/providers/combobox-provider.d.ts +5 -5
- package/dist/types/providers/context-menu-content-provider.d.ts +1 -0
- package/dist/types/providers/context-menu-provider.d.ts +4 -5
- package/dist/types/providers/context-menu-sub-provider.d.ts +3 -3
- package/dist/types/providers/date-picker-provider.d.ts +2 -2
- package/dist/types/providers/dialog-provider.d.ts +6 -5
- package/dist/types/providers/focus-container-provider.d.ts +4 -2
- package/dist/types/providers/menu-provider.d.ts +2 -1
- package/dist/types/providers/menubar-menu-provider.d.ts +4 -4
- package/dist/types/providers/menubar-provider.d.ts +1 -1
- package/dist/types/providers/search-field-provider.d.ts +1 -1
- package/dist/types/providers/selector-provider.d.ts +1 -1
- package/dist/types/providers/stepper-provider.d.ts +2 -0
- package/dist/types/providers/time-picker-provider.d.ts +3 -3
- package/dist/types/providers/toolbar-provider.d.ts +1 -1
- package/dist/types/types/lucide.d.ts +9 -5
- package/dist/types/utils/dom.d.ts +23 -1
- package/dist/types/utils/unwrap.d.ts +1 -1
- package/package.json +32 -37
package/README.md
CHANGED
|
@@ -32,6 +32,8 @@ npm install @enonic/ui preact @radix-ui/react-slot # Preact
|
|
|
32
32
|
|
|
33
33
|
</details>
|
|
34
34
|
|
|
35
|
+
The package is built against React. A Preact app aliases `react`, `react-dom`, and `react/jsx-runtime` to `preact/compat` and `preact/jsx-runtime` — `@preact/preset-vite` does this in the bundler by default — and maps the same three in `tsconfig.json` `paths`, or the package's types resolve to `any`. See [Preact projects](https://enonic.github.io/npm-enonic-ui/?path=/docs/getting-started-installation--docs) for both configs.
|
|
36
|
+
|
|
35
37
|
**2. Load the styles.** Components use Tailwind utility classes and render unstyled until a stylesheet is present. The prebuilt one needs no configuration:
|
|
36
38
|
|
|
37
39
|
```css
|
|
@@ -131,16 +133,18 @@ Inside a shadow root the document's theme does not reach in, even though custom
|
|
|
131
133
|
|
|
132
134
|
Icons used inside components are bundled — no icon package is needed for components to render.
|
|
133
135
|
|
|
134
|
-
A Lucide package is needed only when you pass your own icon to a component that takes one, such as
|
|
136
|
+
A Lucide package is needed only when you pass your own icon to a component that takes one, such as `icon` on `IconButton` or `Tab.DefaultTrigger`, or `leftIcon` on `Link`:
|
|
135
137
|
|
|
136
138
|
```tsx
|
|
137
139
|
import { Tab } from '@enonic/ui';
|
|
138
|
-
import { Star } from 'lucide-react'; // lucide-preact
|
|
140
|
+
import { Star } from 'lucide-react'; // or lucide-preact
|
|
139
141
|
|
|
140
|
-
<Tab icon={Star}
|
|
142
|
+
<Tab.DefaultTrigger value='favorites' icon={Star}>
|
|
143
|
+
Favorites
|
|
144
|
+
</Tab.DefaultTrigger>;
|
|
141
145
|
```
|
|
142
146
|
|
|
143
|
-
|
|
147
|
+
Icon props accept icons from either package.
|
|
144
148
|
|
|
145
149
|
## Requirements
|
|
146
150
|
|
|
@@ -149,10 +153,10 @@ The `icon` prop accepts either package.
|
|
|
149
153
|
| Requirement | Notes |
|
|
150
154
|
| ----------------------------------------------- | ----------------------------------- |
|
|
151
155
|
| `@radix-ui/react-slot` | Required — backs the `asChild` prop |
|
|
152
|
-
| `react` + `react-dom` v19, **or** `preact` v10+ |
|
|
156
|
+
| `react` + `react-dom` v19, **or** `preact` v10+ | Preact needs the `react` aliases |
|
|
153
157
|
| Tailwind CSS v4 | Only for the `preset.css` path |
|
|
154
158
|
|
|
155
|
-
Optional
|
|
159
|
+
Optional packages, needed per feature:
|
|
156
160
|
|
|
157
161
|
| Package | Needed for |
|
|
158
162
|
| ---------------- | ------------------------------------------------- |
|
|
@@ -225,6 +229,14 @@ If two actions use the same shortcut, the first registered action wins until it
|
|
|
225
229
|
development builds warn.
|
|
226
230
|
Buttons keep their ordinary focus, Enter, and Space behavior.
|
|
227
231
|
|
|
232
|
+
Built-in widgets yield Cmd/Ctrl+Enter and Cmd/Ctrl+Shift+Enter to the topmost dialog when it owns
|
|
233
|
+
the event. Open selectors, date and time pickers, menus, context menus, menubar menus, and staged comboboxes keep Enter
|
|
234
|
+
local to select or apply values. Their closed controls yield to the dialog. Other widgets yield
|
|
235
|
+
before changing selection, opening popups, or activating items.
|
|
236
|
+
The dialog reserves these chords even when its action is missing, disabled, or pending. Outside
|
|
237
|
+
the dialog's content and registered portals, widget keyboard behavior stays unchanged. Plain
|
|
238
|
+
Enter, Shift+Enter, and modifier combinations the dialog does not own retain their existing behavior.
|
|
239
|
+
|
|
228
240
|
Use `shortcutEnabled={false}` to unregister a mounted action without disabling its button; set
|
|
229
241
|
it on inactive views when they share a shortcut. A disabled `Dialog.Shortcut` can render outside
|
|
230
242
|
`Dialog.Content`; enabled registration requires content. For platform-specific hints,
|