@optimum-intelligence/opti-ui 0.9.1 → 1.0.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/CHANGELOG.md +99 -0
- package/README.md +5 -1
- package/dist/components/app-shell/AppShell.d.ts +30 -1
- package/dist/components/app-shell/AppShell.js +387 -236
- package/dist/components/app-shell/AppShell.js.map +1 -1
- package/dist/components/avatar/Avatar.d.ts +1 -1
- package/dist/components/avatar/Avatar.js +64 -52
- package/dist/components/avatar/Avatar.js.map +1 -1
- package/dist/components/calendar/Calendar.js +6 -4
- package/dist/components/calendar/Calendar.js.map +1 -1
- package/dist/components/calendar/date-utils.js +1 -1
- package/dist/components/calendar/date-utils.js.map +1 -1
- package/dist/components/card/Card.d.ts +24 -5
- package/dist/components/card/Card.js +36 -23
- package/dist/components/card/Card.js.map +1 -1
- package/dist/components/collapsible/Collapsible.d.ts +8 -1
- package/dist/components/collapsible/Collapsible.js +32 -25
- package/dist/components/collapsible/Collapsible.js.map +1 -1
- package/dist/components/data-table/DataTable.d.ts +21 -4
- package/dist/components/data-table/DataTable.js +310 -100
- package/dist/components/data-table/DataTable.js.map +1 -1
- package/dist/components/data-table/DataTableContent.d.ts +1 -7
- package/dist/components/data-table/DataTableContent.js +209 -243
- package/dist/components/data-table/DataTableContent.js.map +1 -1
- package/dist/components/data-table/DataTableFilters.js +47 -57
- package/dist/components/data-table/DataTableFilters.js.map +1 -1
- package/dist/components/data-table/DataTableRow.js +105 -90
- package/dist/components/data-table/DataTableRow.js.map +1 -1
- package/dist/components/data-table/layout.d.ts +0 -5
- package/dist/components/data-table/layout.js +1 -23
- package/dist/components/data-table/layout.js.map +1 -1
- package/dist/components/data-table/types.d.ts +5 -2
- package/dist/components/data-table/useDataTable.js +249 -221
- package/dist/components/data-table/useDataTable.js.map +1 -1
- package/dist/components/date-picker/DateRangePicker.js +1 -0
- package/dist/components/date-picker/DateRangePicker.js.map +1 -1
- package/dist/components/date-picker/PickerField.js +98 -101
- package/dist/components/date-picker/PickerField.js.map +1 -1
- package/dist/components/description-list/DescriptionList.d.ts +3 -1
- package/dist/components/description-list/DescriptionList.js +3 -1
- package/dist/components/description-list/DescriptionList.js.map +1 -1
- package/dist/components/drawer/Drawer.d.ts +1 -1
- package/dist/components/drawer/Drawer.js +173 -87
- package/dist/components/drawer/Drawer.js.map +1 -1
- package/dist/components/file-upload/FileUpload.js +7 -0
- package/dist/components/file-upload/FileUpload.js.map +1 -1
- package/dist/components/link/Link.d.ts +1 -1
- package/dist/components/link/Link.js +57 -74
- package/dist/components/link/Link.js.map +1 -1
- package/dist/components/map/Map.d.ts +14 -2
- package/dist/components/map/Map.js +194 -153
- package/dist/components/map/Map.js.map +1 -1
- package/dist/components/pagination/Pagination.js +2 -0
- package/dist/components/pagination/Pagination.js.map +1 -1
- package/dist/components/scroll-area/ScrollArea.d.ts +18 -2
- package/dist/components/scroll-area/ScrollArea.js +89 -61
- package/dist/components/scroll-area/ScrollArea.js.map +1 -1
- package/dist/components/spinner/Spinner.js +34 -26
- package/dist/components/spinner/Spinner.js.map +1 -1
- package/dist/components/stat-card/StatCard.js +36 -22
- package/dist/components/stat-card/StatCard.js.map +1 -1
- package/dist/components/table/Table.d.ts +9 -2
- package/dist/components/table/Table.js +87 -63
- package/dist/components/table/Table.js.map +1 -1
- package/dist/components/tag/Tag.js +79 -103
- package/dist/components/tag/Tag.js.map +1 -1
- package/dist/components/toolbar/Toolbar.d.ts +2 -1
- package/dist/components/toolbar/Toolbar.js +23 -15
- package/dist/components/toolbar/Toolbar.js.map +1 -1
- package/dist/components/typography/Typography.d.ts +7 -1
- package/dist/components/typography/Typography.js +21 -18
- package/dist/components/typography/Typography.js.map +1 -1
- package/dist/components.json +134 -26
- package/dist/fonts/Montserrat-OFL.txt +93 -0
- package/dist/fonts/Poppins-OFL.txt +93 -0
- package/dist/fonts/montserrat-latin-ext.woff2 +0 -0
- package/dist/fonts/montserrat-latin.woff2 +0 -0
- package/dist/fonts/poppins-latin-400.woff2 +0 -0
- package/dist/fonts/poppins-latin-500.woff2 +0 -0
- package/dist/fonts/poppins-latin-600.woff2 +0 -0
- package/dist/fonts/poppins-latin-700.woff2 +0 -0
- package/dist/fonts/poppins-latin-ext-400.woff2 +0 -0
- package/dist/fonts/poppins-latin-ext-500.woff2 +0 -0
- package/dist/fonts/poppins-latin-ext-600.woff2 +0 -0
- package/dist/fonts/poppins-latin-ext-700.woff2 +0 -0
- package/dist/fonts.css +104 -4
- package/dist/index.js +2 -2
- package/dist/labels/Labels.d.ts +12 -0
- package/dist/labels/Labels.js +6 -0
- package/dist/labels/Labels.js.map +1 -1
- package/dist/labels/hu.js +9 -3
- package/dist/labels/hu.js.map +1 -1
- package/dist/llms-full.txt +103 -20
- package/dist/llms.txt +15 -10
- package/dist/opti-ui.css +567 -197
- package/dist/reset.css +33 -0
- package/dist/utils/focus.d.ts +8 -0
- package/dist/utils/focus.js +39 -0
- package/dist/utils/focus.js.map +1 -0
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,105 @@
|
|
|
3
3
|
All notable changes to `@optimum-intelligence/opti-ui`. Versions follow [semver](https://semver.org/); while
|
|
4
4
|
the version is `0.x`, minor releases may contain breaking changes, which are marked **Breaking**.
|
|
5
5
|
|
|
6
|
+
## 1.0.0
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
|
|
10
|
+
- `Page`: the content column inside `AppShell`, with gutters, a maximum width and a gap between sections that
|
|
11
|
+
shrink on phones (`--oui-page-max-width`, `--oui-page-padding`, `--oui-page-gap`). `fill` makes it as tall as
|
|
12
|
+
the main area so a filling card or table takes the height left; below 900px and in windows under 640px tall the
|
|
13
|
+
page scrolls and those parts get `--oui-page-fill-height` (32rem).
|
|
14
|
+
- `Card` `fill`: grows to the height left in a flex column (at least `--oui-card-fill-min-height`, 24rem), and its
|
|
15
|
+
content passes the height on to a `DataTable fill` or `[data-fill]` child.
|
|
16
|
+
- `Text` `truncate`: one line, ending in an ellipsis.
|
|
17
|
+
- `ScrollArea` `fade`: fades the left and right edges while content is cut off there, for rows that scroll sideways.
|
|
18
|
+
- `DataTable.SelectionBar`: the selected rows' count, a clear button and actions, for composed tables.
|
|
19
|
+
- `AppShell`: a "Skip to content" link, the first tab stop, shown when it gets keyboard focus. The `Navbar` is a
|
|
20
|
+
named landmark ("Main").
|
|
21
|
+
- Labels `mainNavigation`, `skipToContent`, `opensInNewTab`, `moreAvatars`, `trendUp` and `trendDown`, in English and
|
|
22
|
+
in `huLabels`.
|
|
23
|
+
- `--oui-scrollbar-thumb`: the scrollbar thumb colour, darker when the system asks for more contrast.
|
|
24
|
+
- `Collapsible.Panel` `plain`: no padding, and the content keeps the surrounding text style.
|
|
25
|
+
- `reset.css`: an optional element reset (box-sizing, no default margins or padding, full-height `html`/`body`,
|
|
26
|
+
inherited fonts in form controls) in an `oui-reset` layer below the library's.
|
|
27
|
+
- `Map.Legend` `collapsible`: a "Legend" button folds the entries away; collapsed at first on phones unless
|
|
28
|
+
`defaultCollapsed` says otherwise. New map label `legend`.
|
|
29
|
+
- `TableCell` `mono` and `nowrap`, like the `DataTable` column options.
|
|
30
|
+
- A bottom `Drawer` (also the date picker's phone sheet and the DataTable filter sheet) closes when its header is
|
|
31
|
+
dragged down, and shows a grab handle.
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
|
|
35
|
+
- **Breaking** `DataTable`: the selection bar (count, clear button, `bulkActions`) moved from the header row to the
|
|
36
|
+
toolbar, where it covers the search and filters while rows are selected, so the column headers, sorting and
|
|
37
|
+
`aria-sort` stay and nothing moves. With `showToolbar={false}` it shows under the rows, next to the pagination.
|
|
38
|
+
`DataTable.Content` loses `selectionActions`: compose `DataTable.SelectionBar` after `DataTable.Controls` in
|
|
39
|
+
`DataTable.Toolbar` instead, with `inert` on the controls while rows are selected.
|
|
40
|
+
- `fonts.css` ships Poppins and Montserrat with the package instead of loading them from Google Fonts, so no request
|
|
41
|
+
goes to Google (about 180 KB more in the package).
|
|
42
|
+
- **Breaking** `DescriptionList` follows its own width instead of the viewport (a container query): `rows` puts the
|
|
43
|
+
label above the value below 27.5rem, in a drawer as on a phone. Its width no longer comes from its content, so in a
|
|
44
|
+
flex row give it `flex: 1` or a width.
|
|
45
|
+
- Headings, the page title and the stat card value scale with `rem + vw` between 800px and 1600px, so they follow the
|
|
46
|
+
user's font size; sizes in between differ slightly from before.
|
|
47
|
+
- Badges, tabs, toggles and pagination buttons have a minimum height instead of a fixed one, so larger text spacing
|
|
48
|
+
no longer clips them.
|
|
49
|
+
- Hover styles only apply on devices that can hover, so they no longer stick after a tap.
|
|
50
|
+
- `Map.Marker` with `onClick` is a button (`aria-pressed` from `selected`), reachable and pressed by keyboard.
|
|
51
|
+
- On a collapsed navbar rail, pressing a `NavbarGroup` expands the navbar with the group open, instead of opening a
|
|
52
|
+
panel the rail hides.
|
|
53
|
+
- `Avatar` is one image named after the person (`role="img"`), so a screen reader no longer reads the initials;
|
|
54
|
+
`alt` names the whole avatar. The `AvatarGroup` counter reads "3 more".
|
|
55
|
+
- `Spinner` puts its label in hidden text, so its status region is announced.
|
|
56
|
+
- Clickable `DataTable` rows also open with Space.
|
|
57
|
+
- `AppShell`'s main area reserves room for its scrollbar (`scrollbar-gutter: stable`), so content no longer shifts
|
|
58
|
+
sideways when a page starts scrolling.
|
|
59
|
+
- The `AppShell` mobile top bar ends a long `mobileBrand` text in an ellipsis.
|
|
60
|
+
- `Toolbar` stays on one line and scrolls sideways with a faded edge instead of wrapping its groups.
|
|
61
|
+
- In a `Table` under 40rem wide, cells stay on one line and the table scrolls sideways. `mono` cells (and
|
|
62
|
+
`DataTable` `mono` columns) never wrap.
|
|
63
|
+
- `DataTable` counts are locale-formatted ("10,000 records"; `huLabels`: "10 000 tétel"). Without search, filters
|
|
64
|
+
or toolbar content the toolbar is left out and the loading spinner moves to the footer. Clear filters takes no
|
|
65
|
+
space until a filter is set.
|
|
66
|
+
- `CardHeader`: only the first child (the title block) grows; a Badge or `CardActions` after it keeps its width and
|
|
67
|
+
wraps only when the title would get narrower than 8rem.
|
|
68
|
+
- `PageHeader` on phones puts the actions under the description.
|
|
69
|
+
- `DateTimePicker` with `granularity="hour"` shows `2026-10-12 08:00` (was `08`).
|
|
70
|
+
- Text inputs, the combobox and the number field use 16px text on touch screens, so iOS Safari doesn't zoom in on
|
|
71
|
+
focus. Disabled fields get a muted fill.
|
|
72
|
+
- `Switch`, breadcrumb links and the map legend's show/hide button have finger-sized hit areas on touch screens.
|
|
73
|
+
- `AvatarGroup` overlaps less, so the initials stay readable. The phone tab bar fits five labels at 320px.
|
|
74
|
+
- The horizontal `Stepper` gives every connector the same length. `EmptyState` balances its title and avoids an
|
|
75
|
+
orphan in the description. `DescriptionList` labels use the same colour in both layouts.
|
|
76
|
+
|
|
77
|
+
### Fixed
|
|
78
|
+
|
|
79
|
+
- The focus no longer falls back to the page when the focused button goes away: DataTable edit, save, cancel and
|
|
80
|
+
delete move it to the row's editor, edit button or the next row; clearing the selection (or a bulk action that does)
|
|
81
|
+
moves it to the select-all checkbox; removing a filter tag or a file moves it to the next one.
|
|
82
|
+
- `Pagination` and `Calendar` previous/next buttons, and the date range picker's Clear, keep the focus when they
|
|
83
|
+
become disabled.
|
|
84
|
+
- Dialogs, drawers, toasts and the command palette no longer reach under a classic scrollbar (`100%`, not `100vw`).
|
|
85
|
+
- External `Link`s say they open in a new tab; `Tag`'s remove button uses the translated `removeItem` label; the
|
|
86
|
+
date picker trigger no longer sets `aria-required` on a button; `StatCard` says its trend direction and that it is
|
|
87
|
+
loading; a `Table` with `aria-label` names its scroll area.
|
|
88
|
+
- `CardActions` no longer makes the card header taller than the title: small controls sit centred on the title
|
|
89
|
+
and overhang into the padding, also at the touch size (2.5rem).
|
|
90
|
+
- `IconButton` `sm` and `lg` are square (the size padding no longer applies).
|
|
91
|
+
- Vertical `Tabs` no longer shrink and clip their labels beside the panel.
|
|
92
|
+
- `Combobox`: the chip's remove button no longer shrinks, and in a multiple combobox the input no longer wraps onto
|
|
93
|
+
an empty line beside the chips.
|
|
94
|
+
- `Text` and `Heading` inside a `nowrap` parent (a table cell, a truncated row) no longer wrap: they set
|
|
95
|
+
`text-wrap-style`, which leaves the inherited wrap mode alone.
|
|
96
|
+
- The open map attribution wraps within 60% of the map instead of running under a bottom-left overlay.
|
|
97
|
+
|
|
98
|
+
## 0.9.2
|
|
99
|
+
|
|
100
|
+
### Fixed
|
|
101
|
+
|
|
102
|
+
- `PageHeader`: the title row is at least as tall as a button, so headers with and without actions are the same
|
|
103
|
+
height and their descriptions line up across pages.
|
|
104
|
+
|
|
6
105
|
## 0.9.1
|
|
7
106
|
|
|
8
107
|
### Fixed
|
package/README.md
CHANGED
|
@@ -47,7 +47,8 @@ React 19 is a peer dependency; the build is precompiled with React Compiler. `@b
|
|
|
47
47
|
|
|
48
48
|
```tsx
|
|
49
49
|
import '@optimum-intelligence/opti-ui/styles.css';
|
|
50
|
-
import '@optimum-intelligence/opti-ui/fonts.css'; // optional:
|
|
50
|
+
import '@optimum-intelligence/opti-ui/fonts.css'; // optional: Poppins, Montserrat and JetBrains Mono, bundled
|
|
51
|
+
import '@optimum-intelligence/opti-ui/reset.css'; // optional: box-sizing, no default margins, full-height html/body
|
|
51
52
|
import { Button, Card, CardTitle, ToastProvider, Tooltip } from '@optimum-intelligence/opti-ui';
|
|
52
53
|
|
|
53
54
|
export function App() {
|
|
@@ -64,6 +65,9 @@ export function App() {
|
|
|
64
65
|
}
|
|
65
66
|
```
|
|
66
67
|
|
|
68
|
+
The reset sits in its own `oui-reset` layer below the library's. If your app declares a layer order before
|
|
69
|
+
importing opti-ui (Tailwind does), put `oui-reset` first in it, or the reset would win over the components.
|
|
70
|
+
|
|
67
71
|
Add `class="oui-root"` to `<body>` for the library font, text color and background. Add `oui-isolate`
|
|
68
72
|
to your app root so portalled popups stack above app content. Every module has a `'use client'` banner,
|
|
69
73
|
so the components work in Next.js App Router.
|
|
@@ -111,7 +111,8 @@ export interface NavbarGroupProps extends Omit<React.HTMLAttributes<HTMLDivEleme
|
|
|
111
111
|
/**
|
|
112
112
|
* Expandable parent row in a `Navbar` with nested `NavbarItem` sub-links. Place it in a `NavbarSection`
|
|
113
113
|
* next to other items. On a collapsed rail the sub-links are hidden and the parent shows as active when
|
|
114
|
-
* one of them is; the hover peek shows the full tree
|
|
114
|
+
* one of them is; the hover peek shows the full tree, and pressing the parent expands the navbar with the
|
|
115
|
+
* group open, so keyboard users reach the sub-links too.
|
|
115
116
|
*
|
|
116
117
|
* @example
|
|
117
118
|
* <NavbarSection>
|
|
@@ -177,6 +178,34 @@ export interface AppShellProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
177
178
|
* </AppShell>
|
|
178
179
|
*/
|
|
179
180
|
export declare function AppShell({ navbar, mobileBrand, mobileActions, mobileNavPosition, menuLabel: menuLabelProp, moreLabel: moreLabelProp, moreTabPosition, mainProps, className, children, ref, ...props }: AppShellProps): React.JSX.Element;
|
|
181
|
+
export type PageState = {
|
|
182
|
+
fill: boolean;
|
|
183
|
+
};
|
|
184
|
+
export interface PageProps extends useRender.ComponentProps<'div', PageState> {
|
|
185
|
+
/**
|
|
186
|
+
* Take the main area's height instead of growing with the content, so a `Card fill` or `DataTable fill`
|
|
187
|
+
* inside takes the height left and only its rows scroll. Below 900px and in windows under 640px tall the
|
|
188
|
+
* page scrolls as usual, and those children get a fixed height (`--oui-page-fill-height`, 32rem).
|
|
189
|
+
*/
|
|
190
|
+
fill?: boolean;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Content column of a page inside `AppShell`: gutters, a maximum width and the gap between sections, all
|
|
194
|
+
* smaller on phones. Customize with `--oui-page-max-width` (80rem), `--oui-page-padding` and `--oui-page-gap`.
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* <AppShell navbar={<Navbar>…</Navbar>}>
|
|
198
|
+
* <Page fill>
|
|
199
|
+
* <PageHeader title="Sessions" />
|
|
200
|
+
* <Card fill>
|
|
201
|
+
* <CardContent>
|
|
202
|
+
* <DataTable fill columns={columns} data={sessions} getRowId={(row) => row.id} />
|
|
203
|
+
* </CardContent>
|
|
204
|
+
* </Card>
|
|
205
|
+
* </Page>
|
|
206
|
+
* </AppShell>
|
|
207
|
+
*/
|
|
208
|
+
export declare function Page({ fill, render, ref, ...props }: PageProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
180
209
|
export interface PageHeaderProps extends Omit<React.HTMLAttributes<HTMLElement>, 'title'> {
|
|
181
210
|
/** Ref to the `<header>` element. */
|
|
182
211
|
ref?: React.Ref<HTMLElement>;
|