@apliteni/apliteni-ui 0.147.0 → 0.149.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/guidelines/account-and-settings.md +3 -5
- package/guidelines/dense-tables.md +2 -2
- package/package.json +1 -2
- package/react/README.md +2 -2
- package/react/dist/index.css +121 -0
- package/react/dist/index.d.ts +31 -4
- package/react/dist/index.js +1064 -930
- package/src/styles/table.css +33 -110
|
@@ -4,17 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
<!-- rule: modal -->
|
|
6
6
|
|
|
7
|
-
**Rule:** Open account and settings in
|
|
7
|
+
**Rule:** Open account and settings in the kit's account window, over the product, with its sections beside the pane.
|
|
8
8
|
|
|
9
9
|
**Why:** The reader has not left the work behind it, and one overlay holds every setting.
|
|
10
10
|
|
|
11
|
-
**Do:**
|
|
11
|
+
**Do:** Give the window the reader and the sections, and let it draw the rail, the title, the close and the dimmed page.
|
|
12
12
|
|
|
13
13
|
**Don't:** Slide a full-width sheet in with columns inside it.
|
|
14
14
|
|
|
15
|
-
**Except:** On a phone the
|
|
16
|
-
|
|
17
|
-
**Gap #553:** The kit has no modal that takes a navigation pane or a width, so this shape is built by hand.
|
|
15
|
+
**Except:** On a phone the sections become tabs under the reader, where a column beside the pane would leave it narrower than its rows.
|
|
18
16
|
|
|
19
17
|
## Give the modal its own navigation
|
|
20
18
|
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
|
|
57
57
|
**Rule:** Keep units smaller and in body ink.
|
|
58
58
|
|
|
59
|
-
**Do:** Keep units smaller and in body ink, and explain abbreviations in reachable text.
|
|
59
|
+
**Do:** Keep units smaller and in body ink, and explain abbreviations in reachable text.
|
|
60
60
|
|
|
61
61
|
**Don't:** Hide units in muted text or make readers guess what an abbreviation means.
|
|
62
62
|
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
|
|
87
87
|
**Don't:** Squeeze columns until values are unreadable or silently remove data.
|
|
88
88
|
|
|
89
|
-
**Except:** On a phone, a
|
|
89
|
+
**Except:** On a phone, a table stays a table and scrolls sideways. Never turn its rows into cards.
|
|
90
90
|
|
|
91
91
|
## Keep identity sub-lines as text
|
|
92
92
|
|
package/package.json
CHANGED
package/react/README.md
CHANGED
|
@@ -311,7 +311,7 @@ now compare against the working tree rather than the last published release.
|
|
|
311
311
|
|
|
312
312
|
### Table appearance
|
|
313
313
|
|
|
314
|
-
`DataTable` takes the vanilla table hooks as props. `zebra`, `hover` (on unless `false`),
|
|
314
|
+
`DataTable` takes the vanilla table hooks as props. `zebra`, `hover` (on unless `false`),
|
|
315
315
|
`density`, `stickyHeader` and `pinnedIdentity` set the table modifiers. `rowState={(row) => 'target' | 'dead' | undefined}`
|
|
316
316
|
marks a row, `footer` takes totals rows, and `caption` names the table for assistive technology. A column takes
|
|
317
317
|
`rowHeader` and `cell` (`'title' | 'code' | 'long' | 'strong' | 'act'`). A `dead` row is muted, so put the word
|
|
@@ -319,7 +319,7 @@ that names its state in one of its cells.
|
|
|
319
319
|
|
|
320
320
|
```tsx
|
|
321
321
|
<DataTable columns={columns} rows={rows} selectable={false} pager={false}
|
|
322
|
-
density="dense" zebra
|
|
322
|
+
density="dense" zebra rowState={(r) => (r.id === landedOn ? 'target' : undefined)} />
|
|
323
323
|
```
|
|
324
324
|
|
|
325
325
|
### Tables with another presentation of the same rows
|
package/react/dist/index.css
CHANGED
|
@@ -282,6 +282,127 @@
|
|
|
282
282
|
flex: none;
|
|
283
283
|
}
|
|
284
284
|
|
|
285
|
+
/* src/AccountWindow.css */
|
|
286
|
+
.rx-modal.rx-account {
|
|
287
|
+
width: min(calc(var(--container) - var(--space-12) * 2), 96vw);
|
|
288
|
+
height: min(76vh, calc(100vh - var(--space-16)));
|
|
289
|
+
height: min(76dvh, calc(100dvh - var(--space-16)));
|
|
290
|
+
max-height: none;
|
|
291
|
+
flex-direction: row;
|
|
292
|
+
}
|
|
293
|
+
.rx-account__rail {
|
|
294
|
+
flex: none;
|
|
295
|
+
display: flex;
|
|
296
|
+
flex-direction: column;
|
|
297
|
+
gap: var(--space-4);
|
|
298
|
+
margin: var(--space-2);
|
|
299
|
+
padding: var(--space-5) var(--space-3);
|
|
300
|
+
border-radius: var(--radius-lg);
|
|
301
|
+
overflow-y: auto;
|
|
302
|
+
background: var(--bg);
|
|
303
|
+
}
|
|
304
|
+
.rx-account__rail:focus-visible {
|
|
305
|
+
outline: var(--ring-scroll);
|
|
306
|
+
outline-offset: var(--ring-scroll-offset);
|
|
307
|
+
}
|
|
308
|
+
.rx-account__who {
|
|
309
|
+
display: flex;
|
|
310
|
+
align-items: center;
|
|
311
|
+
gap: var(--space-3);
|
|
312
|
+
min-width: 0;
|
|
313
|
+
padding: 0 var(--space-3);
|
|
314
|
+
}
|
|
315
|
+
.rx-account__who > .ui-app__who {
|
|
316
|
+
flex: 1 1 auto;
|
|
317
|
+
}
|
|
318
|
+
.rx-account__av {
|
|
319
|
+
display: grid;
|
|
320
|
+
flex: none;
|
|
321
|
+
}
|
|
322
|
+
.rx-account__av > .ui-avatar {
|
|
323
|
+
--ui-avatar-size: var(--space-10);
|
|
324
|
+
}
|
|
325
|
+
.rx-account .ui-nav__item.is-active {
|
|
326
|
+
color: var(--accent);
|
|
327
|
+
}
|
|
328
|
+
.rx-account__pane {
|
|
329
|
+
flex: 1 1 auto;
|
|
330
|
+
min-width: 0;
|
|
331
|
+
display: flex;
|
|
332
|
+
flex-direction: column;
|
|
333
|
+
}
|
|
334
|
+
.rx-account__head {
|
|
335
|
+
border-bottom: 0;
|
|
336
|
+
padding: var(--space-5) var(--space-5) var(--space-2) var(--space-8);
|
|
337
|
+
}
|
|
338
|
+
.rx-account__title {
|
|
339
|
+
margin: 0;
|
|
340
|
+
font-size: var(--text-lg);
|
|
341
|
+
font-weight: var(--weight-semibold);
|
|
342
|
+
line-height: var(--leading-snug);
|
|
343
|
+
font-family: var(--font-sans);
|
|
344
|
+
color: var(--strong);
|
|
345
|
+
}
|
|
346
|
+
.rx-account__body {
|
|
347
|
+
flex: 1 1 auto;
|
|
348
|
+
padding: var(--space-4) var(--space-8) var(--space-8);
|
|
349
|
+
}
|
|
350
|
+
.rx-account__tabs,
|
|
351
|
+
.rx-account__who > .ui-btn {
|
|
352
|
+
display: none;
|
|
353
|
+
}
|
|
354
|
+
.rx-account__tabs {
|
|
355
|
+
--ui-tabs-ground: var(--bg);
|
|
356
|
+
}
|
|
357
|
+
.rx-account__tabs .ui-nav__tab {
|
|
358
|
+
border: 0;
|
|
359
|
+
background: none;
|
|
360
|
+
font-family: inherit;
|
|
361
|
+
cursor: pointer;
|
|
362
|
+
}
|
|
363
|
+
.rx-account__who > .ui-btn {
|
|
364
|
+
width: calc(var(--space-10) + var(--space-1));
|
|
365
|
+
height: calc(var(--space-10) + var(--space-1));
|
|
366
|
+
flex: none;
|
|
367
|
+
}
|
|
368
|
+
@media (max-width: 560px) {
|
|
369
|
+
.rx-modal.rx-account {
|
|
370
|
+
width: 100vw;
|
|
371
|
+
height: 100vh;
|
|
372
|
+
height: 100dvh;
|
|
373
|
+
border-radius: 0;
|
|
374
|
+
flex-direction: column;
|
|
375
|
+
}
|
|
376
|
+
.rx-account__rail {
|
|
377
|
+
overflow: visible;
|
|
378
|
+
padding: var(--space-4) var(--space-3);
|
|
379
|
+
gap: var(--space-2);
|
|
380
|
+
}
|
|
381
|
+
.rx-account__av > .ui-avatar {
|
|
382
|
+
--ui-avatar-size: var(--space-8);
|
|
383
|
+
}
|
|
384
|
+
.rx-account__who {
|
|
385
|
+
padding: 0 0 0 var(--space-3);
|
|
386
|
+
}
|
|
387
|
+
.rx-account__side,
|
|
388
|
+
.rx-account__head > .ui-btn {
|
|
389
|
+
display: none;
|
|
390
|
+
}
|
|
391
|
+
.rx-account__tabs,
|
|
392
|
+
.rx-account__who > .ui-btn {
|
|
393
|
+
display: flex;
|
|
394
|
+
}
|
|
395
|
+
.rx-account__pane {
|
|
396
|
+
min-height: 0;
|
|
397
|
+
}
|
|
398
|
+
.rx-account__head {
|
|
399
|
+
padding: var(--space-4) var(--space-4) 0;
|
|
400
|
+
}
|
|
401
|
+
.rx-account__body {
|
|
402
|
+
padding: var(--space-4);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
|
|
285
406
|
/* src/DataTable.css */
|
|
286
407
|
.rx-sortable {
|
|
287
408
|
user-select: none;
|
package/react/dist/index.d.ts
CHANGED
|
@@ -208,6 +208,32 @@ type ModalProps = {
|
|
|
208
208
|
};
|
|
209
209
|
declare function Modal({ open, title, onClose, footer, children, initialFocusRef, role }: ModalProps): react.ReactPortal | null;
|
|
210
210
|
|
|
211
|
+
type AccountSection = {
|
|
212
|
+
id: string;
|
|
213
|
+
label: string;
|
|
214
|
+
icon?: string;
|
|
215
|
+
content: ReactNode;
|
|
216
|
+
};
|
|
217
|
+
type AccountReader = {
|
|
218
|
+
name: string;
|
|
219
|
+
email: string;
|
|
220
|
+
personKey?: string | number;
|
|
221
|
+
avatarSrc?: string;
|
|
222
|
+
};
|
|
223
|
+
type AccountWindowProps = {
|
|
224
|
+
open: boolean;
|
|
225
|
+
onClose: () => void;
|
|
226
|
+
reader: AccountReader;
|
|
227
|
+
sections: AccountSection[];
|
|
228
|
+
/** The open section. Leave it out and the window keeps its own, from `defaultSection`. */
|
|
229
|
+
section?: string;
|
|
230
|
+
defaultSection?: string;
|
|
231
|
+
onSectionChange?: (id: string) => void;
|
|
232
|
+
/** The dialog's name. The section title is its heading. */
|
|
233
|
+
label?: string;
|
|
234
|
+
};
|
|
235
|
+
declare function AccountWindow({ open, onClose, reader, sections, section, defaultSection, onSectionChange, label, }: AccountWindowProps): react.ReactPortal | null;
|
|
236
|
+
|
|
211
237
|
type DrawerProps = {
|
|
212
238
|
open: boolean;
|
|
213
239
|
title: string;
|
|
@@ -286,7 +312,7 @@ type Column<T> = {
|
|
|
286
312
|
linked?: boolean;
|
|
287
313
|
/** Renders this column's body cells as row headers (`th scope="row"`), as the kit's compact table does. */
|
|
288
314
|
rowHeader?: boolean;
|
|
289
|
-
/** `title` gives the column the remaining width, `code` sets a handle or id in the table's small text, `long` is running text that
|
|
315
|
+
/** `title` gives the column the remaining width, `code` sets a handle or id in the table's small text, `long` is running text that wraps in a column wide enough to read, `strong` bolds a figure, `act` right-aligns a row action. */
|
|
290
316
|
cell?: 'title' | 'code' | 'long' | 'strong' | 'act';
|
|
291
317
|
};
|
|
292
318
|
type TableSort<T> = {
|
|
@@ -323,9 +349,10 @@ type PagerProps = {
|
|
|
323
349
|
type DataTableProps<T> = {
|
|
324
350
|
columns: Column<T>[];
|
|
325
351
|
rows: T[];
|
|
326
|
-
/** The kit's `--zebra
|
|
352
|
+
/** The kit's `--zebra` and `--hover` (on unless `false`) hooks. */
|
|
327
353
|
zebra?: boolean;
|
|
328
354
|
hover?: boolean;
|
|
355
|
+
/** @deprecated Ignored. A table no longer stacks its rows on a phone. It scrolls sideways in its frame. The prop stays only so existing calls compile. */
|
|
329
356
|
stack?: boolean;
|
|
330
357
|
/** Marks a row the reader landed on (`target`) or a revoked one (`dead`). A dead row is muted, so put the word that names its state in one of its cells. */
|
|
331
358
|
rowState?: (row: T) => 'target' | 'dead' | undefined;
|
|
@@ -362,7 +389,7 @@ type DataTableProps<T> = {
|
|
|
362
389
|
declare function sortTableRows<T>(rows: T[], sort: TableSort<T>): T[];
|
|
363
390
|
declare function DataTable<T extends {
|
|
364
391
|
name: string;
|
|
365
|
-
}>({ columns, rows, zebra, hover,
|
|
392
|
+
}>({ columns, rows, zebra, hover, rowState, footer, caption, dense, density, stickyHeader, pinnedIdentity, scrollLabel, empty, pageSize, pageSizes, onPageSizeChange, pager, pagerLabel, loading, selectable, selected, onToggle, onTogglePage, sort: controlledSort, onSortChange, page: controlledPage, onPageChange, total, hasMore, }: DataTableProps<T>): react.JSX.Element;
|
|
366
393
|
|
|
367
394
|
type PaginationProps = {
|
|
368
395
|
page?: number;
|
|
@@ -1380,4 +1407,4 @@ declare const NavTabs: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedH
|
|
|
1380
1407
|
declare const PAGE_SIZES: readonly number[];
|
|
1381
1408
|
declare const DEFAULT_PAGE_SIZE: number;
|
|
1382
1409
|
|
|
1383
|
-
export { type Accent, AccentPicker, type AccentPickerProps, AccountMenu, type AccountMenuProps, type AddFilter, AppShell, type AppShellProps, type AppShellSection, AuthShell, type AuthShellProps, Avatar, type AvatarProps, BackLink, type BackLinkOwnProps, type BackLinkProps, Badge, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, BusyRegion, type BusyRegionProps, Button, type ButtonLinkProps, type ButtonProps, Callout, type CalloutProps, type CalloutVariant, Card, Chart, type ChartAreaLook, type ChartBridgeStep, type ChartBridgeTones, type ChartDonutLook, type ChartLineLook, type ChartLookSeries, type ChartPeriod, type ChartProps, type ChartSeries, type ChartSlice, type ChartStackedLook, type ChartTone, CheckList, type CheckListProps, Checkbox, type CheckboxProps, type Column, type CommandGroup, type CommandItem, CommandPalette, type CommandPaletteProps, Confirm, type ConfirmProps, DEFAULT_PAGE_SIZE, DataTable, type DataTableProps, DatePicker, type DatePickerMode, type DatePickerPreset, type DatePickerProps, type DatePickerRange, DeltaValue, type DeltaValueProps, Denied, type DeniedProps, Drawer, type DrawerProps, DrawerSection, type DrawerSectionProps, Dropdown, type DropdownAvatar, type DropdownBadge, type DropdownEntry, type DropdownItem, type DropdownProps, type DropdownRowProps, type DropdownSearch, type DropdownSection, type DropdownSeparator, EmptyState, type EmptyStateProps, type EmptyStateVariant, Feedback, type FeedbackPayload, type FeedbackProps, type FeedbackResult, type FeedbackSection, Field, type FieldControlProps, type FieldProps, FileDrop, type FileDropFile, type FileDropProps, type FileDropStatus, FileField, type FileFieldProps, type Filter, FilterBar, type FilterBarProps, Footer, type FooterColumn, type FooterLink, type FooterProps, type FooterSocial, Icon, KeyValueList, type KeyValueListProps, type KeyValueRow, Modal, type ModalProps, type NativeButtonProps, type NavTabBadge, type NavTabItem, NavTabs, type NavTabsProps, NumericValue, type NumericValueProps, PAGE_SIZES, Pagination, type PaginationProps, Pill, type PillProps, RowIdentity, type RowIdentityProps, SearchField, type SearchFieldProps, type SegmentOption, Segmented, type SegmentedProps, SelectField, type SelectFieldProps, SidebarNav, type SidebarNavBadge, type SidebarNavItem, type SidebarNavLeaf, type SidebarNavProps, type SidebarNavSection, Skeleton, type SkeletonProps, SkeletonTable, type SkeletonTableProps, Snippet, type SnippetProps, StatBand, type StatBandProps, type StatDelta, type StatFigure, type StatTone, type StatVariant, StatusDot, type StatusDotProps, Success, SuccessCheck, type SuccessCheckProps, type SuccessCountdown, SuccessPanel, type SuccessPanelProps, type SuccessProps, Switch, type SwitchProps, THEME_INIT_SCRIPT, type TabItem, type TableSort, Tabs, type TabsProps, TextArea, type TextAreaProps, TextField, type TextFieldProps, ThemeToggle, type ThemeToggleProps, Timeline, type TimelineEvent, type TimelineEventKind, type TimelineProps, Toast, type ToastNotice, type ToastProps, Tooltip, type TooltipProps, TopBar, type TopBarProps, type Version, VersionSwitcher, type VersionSwitcherProps, ViewSwitch, type ViewSwitchItem, type ViewSwitchProps, sortTableRows, useToast };
|
|
1410
|
+
export { type Accent, AccentPicker, type AccentPickerProps, AccountMenu, type AccountMenuProps, type AccountReader, type AccountSection, AccountWindow, type AccountWindowProps, type AddFilter, AppShell, type AppShellProps, type AppShellSection, AuthShell, type AuthShellProps, Avatar, type AvatarProps, BackLink, type BackLinkOwnProps, type BackLinkProps, Badge, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, BusyRegion, type BusyRegionProps, Button, type ButtonLinkProps, type ButtonProps, Callout, type CalloutProps, type CalloutVariant, Card, Chart, type ChartAreaLook, type ChartBridgeStep, type ChartBridgeTones, type ChartDonutLook, type ChartLineLook, type ChartLookSeries, type ChartPeriod, type ChartProps, type ChartSeries, type ChartSlice, type ChartStackedLook, type ChartTone, CheckList, type CheckListProps, Checkbox, type CheckboxProps, type Column, type CommandGroup, type CommandItem, CommandPalette, type CommandPaletteProps, Confirm, type ConfirmProps, DEFAULT_PAGE_SIZE, DataTable, type DataTableProps, DatePicker, type DatePickerMode, type DatePickerPreset, type DatePickerProps, type DatePickerRange, DeltaValue, type DeltaValueProps, Denied, type DeniedProps, Drawer, type DrawerProps, DrawerSection, type DrawerSectionProps, Dropdown, type DropdownAvatar, type DropdownBadge, type DropdownEntry, type DropdownItem, type DropdownProps, type DropdownRowProps, type DropdownSearch, type DropdownSection, type DropdownSeparator, EmptyState, type EmptyStateProps, type EmptyStateVariant, Feedback, type FeedbackPayload, type FeedbackProps, type FeedbackResult, type FeedbackSection, Field, type FieldControlProps, type FieldProps, FileDrop, type FileDropFile, type FileDropProps, type FileDropStatus, FileField, type FileFieldProps, type Filter, FilterBar, type FilterBarProps, Footer, type FooterColumn, type FooterLink, type FooterProps, type FooterSocial, Icon, KeyValueList, type KeyValueListProps, type KeyValueRow, Modal, type ModalProps, type NativeButtonProps, type NavTabBadge, type NavTabItem, NavTabs, type NavTabsProps, NumericValue, type NumericValueProps, PAGE_SIZES, Pagination, type PaginationProps, Pill, type PillProps, RowIdentity, type RowIdentityProps, SearchField, type SearchFieldProps, type SegmentOption, Segmented, type SegmentedProps, SelectField, type SelectFieldProps, SidebarNav, type SidebarNavBadge, type SidebarNavItem, type SidebarNavLeaf, type SidebarNavProps, type SidebarNavSection, Skeleton, type SkeletonProps, SkeletonTable, type SkeletonTableProps, Snippet, type SnippetProps, StatBand, type StatBandProps, type StatDelta, type StatFigure, type StatTone, type StatVariant, StatusDot, type StatusDotProps, Success, SuccessCheck, type SuccessCheckProps, type SuccessCountdown, SuccessPanel, type SuccessPanelProps, type SuccessProps, Switch, type SwitchProps, THEME_INIT_SCRIPT, type TabItem, type TableSort, Tabs, type TabsProps, TextArea, type TextAreaProps, TextField, type TextFieldProps, ThemeToggle, type ThemeToggleProps, Timeline, type TimelineEvent, type TimelineEventKind, type TimelineProps, Toast, type ToastNotice, type ToastProps, Tooltip, type TooltipProps, TopBar, type TopBarProps, type Version, VersionSwitcher, type VersionSwitcherProps, ViewSwitch, type ViewSwitchItem, type ViewSwitchProps, sortTableRows, useToast };
|