@enonic/ui 1.6.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 +10 -6
- package/dist/enonic-ui.cjs +1 -1
- package/dist/enonic-ui.es.js +135 -134
- 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 +20 -12
- 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 +1 -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 +2 -4
- 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 +1 -3
- 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/stepper.d.ts +54 -18
- package/dist/types/components/tab/tab.d.ts +93 -21
- package/dist/types/components/tag/tag.d.ts +27 -18
- 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 +28 -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 +253 -60
- package/dist/types/components/virtualized-tree-list/virtualized-tree-list.d.ts +87 -41
- 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-pointer-position.d.ts +1 -1
- 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/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-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/focus-container-provider.d.ts +1 -1
- package/dist/types/providers/menu-provider.d.ts +2 -2
- 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/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 +15 -1
- package/dist/types/utils/unwrap.d.ts +1 -1
- package/package.json +27 -32
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
|
| ---------------- | ------------------------------------------------- |
|