@apliteni/apliteni-ui 0.146.1 → 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.
@@ -4,17 +4,15 @@
4
4
 
5
5
  <!-- rule: modal -->
6
6
 
7
- **Rule:** Open account and settings in one modal over the product, with its navigation beside the pane.
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:** Open a panel over the work, navigation beside the pane.
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 navigation stands above the pane, where a column beside it would leave the pane narrower than its rows.
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
 
@@ -4,23 +4,23 @@
4
4
 
5
5
  <!-- rule: words-first -->
6
6
 
7
- **Rule:** Give every button words, and add a glyph only to help those words.
7
+ **Rule:** Give every button words, and add a glyph only to help them.
8
8
 
9
9
  **Do:** Export, Rename and Share, named at rest.
10
10
 
11
- **Don't:** The same three, each name waiting on a hover a finger never performs.
11
+ **Don't:** The same three, named only on a hover a finger never performs.
12
12
 
13
13
  ## Let the glyph repeat the verb
14
14
 
15
15
  <!-- rule: glyph-repeats-the-verb -->
16
16
 
17
- **Rule:** Add a glyph beside a label only when it depicts that label’s action, and treat a row’s buttons alike.
17
+ **Rule:** Add a glyph only when it depicts its label’s action, and treat a row’s buttons alike.
18
18
 
19
19
  **Except:** A dismissing action beside a committing one is not a peer, and stays plain.
20
20
 
21
21
  **Do:** The arrow downloads, the sheets copy.
22
22
 
23
- **Don't:** A table is what is exported, not the export; the plain neighbour reads as lesser.
23
+ **Don't:** A table is what is exported, not the export; the plain neighbour looks weaker.
24
24
 
25
25
  ## Earn a wordless button
26
26
 
@@ -28,8 +28,20 @@
28
28
 
29
29
  **Rule:** Drop a button’s words only when its glyph is learned everywhere, its action is on the closed list, and its name reaches assistive technology and a hover title.
30
30
 
31
- **Except:** Icon-only controls on the Iconography page is the list. The folded rail shows its names beside the glyphs, so they carry no title.
31
+ **Except:** Icon-only controls on the Iconography page is the list, plus the download glyph, named and titled Download PDF. The folded rail shows names beside its glyphs, so they carry no title.
32
32
 
33
33
  **Do:** Overflow is on that list; the funnel is not.
34
34
 
35
- **Don't:** A funnel could filter, sort or export; the cog gave up the word that said which.
35
+ **Don't:** A funnel could filter, sort or export; the cog lost the word that said which.
36
+
37
+ ## Put no action on a text selection
38
+
39
+ <!-- rule: no-action-on-selection -->
40
+
41
+ **Rule:** Give a text action its own button, which opens a popover or a modal, and never wait for a selection.
42
+
43
+ **Why:** A reader selects text to copy it, and a phone or a screen reader seldom makes one.
44
+
45
+ **Do:** An Add note button under the clause opens the note form.
46
+
47
+ **Don't:** A toolbar that appears over the selected words.
@@ -64,14 +64,50 @@
64
64
 
65
65
  **Don't:** A table alone, its period fixed when it was built.
66
66
 
67
- ## Put the table under every chart
67
+ ## Download a report with one icon button
68
68
 
69
- <!-- rule: table-behind-the-chart -->
69
+ <!-- rule: export-icon -->
70
70
 
71
- **Rule:** Show the table a chart was drawn from under it, on every report.
71
+ **Rule:** Offer a report's download as one icon button, named for the file it makes.
72
72
 
73
- **Why:** A chart shows the shape of a change, not the amount it is read for.
73
+ **Why:** The glyph is learned everywhere, and its name reaches assistive technology and a hover title.
74
74
 
75
- **Do:** The months as bars, then the same months as rows.
75
+ **Do:** The download glyph named Download PDF, at the end of the filter row.
76
76
 
77
- **Don't:** The bars alone, every month estimated by eye.
77
+ **Don't:** The same button with its words, wider than every filter.
78
+
79
+ ## Switch a chart to its table
80
+
81
+ <!-- rule: chart-table-switch -->
82
+
83
+ **Rule:** Give a chart's block a Chart and Table switch that opens on Chart.
84
+
85
+ **Why:** The chart shows the shape of a change, and the table the amounts it is read for.
86
+
87
+ **Do:** Net settled by month as bars, then switched to its rows.
88
+
89
+ **Don't:** The rows stacked under the bars, in one block or the next.
90
+
91
+ ## Name the lines by their values or a key
92
+
93
+ <!-- rule: value-not-legend -->
94
+
95
+ **Rule:** Write the last values on a chart of one or two lines when the latest value matters, and draw a key for more lines or when no one value matters.
96
+
97
+ **Why:** A key sends the eye from a line to the key and back and gives no amount, but a tap shows the readout with the values at that point.
98
+
99
+ **Do:** Spend with a key and last values, and seasonal spend with a key.
100
+
101
+ **Don't:** The same two lines without values.
102
+
103
+ ## Draw at most two lines on a chart
104
+
105
+ <!-- rule: two-lines-at-most -->
106
+
107
+ **Rule:** Draw one line on a chart, or two when the reader compares them.
108
+
109
+ **Why:** Past two lines, the colours are hard to tell apart and the crossings hide the shape of each line.
110
+
111
+ **Do:** Spend against Estimated, then revenue against expenses on a second chart.
112
+
113
+ **Don't:** All four lines on one chart.
@@ -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. A short value in a stacked row carries its own unit or count word, because the header that named it is no longer on screen.
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 row whose long column is a paragraph stacks instead of scrolling: the short values on one line, the paragraph under them, and the header kept for screen readers. No column is dropped.
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
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "@apliteni/apliteni-ui",
3
- "version": "0.146.1",
4
-
3
+ "version": "0.149.0",
5
4
  "workspaces": [
6
5
  "react"
7
6
  ],
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`), `stack`,
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 stack rowState={(r) => (r.id === landedOn ? 'target' : undefined)} />
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
@@ -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;
@@ -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 gets its own line in a stacked row, `strong` bolds a figure, `act` right-aligns a row action. */
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`, `--hover` (on unless `false`) and `--stack` hooks. A stacked table lays each row out as a block below the phone step, so no column scrolls out of reach. */
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, stack, 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;
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 };