@apliteni/apliteni-ui 0.133.0 → 0.137.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apliteni/apliteni-ui",
3
- "version": "0.133.0",
3
+ "version": "0.137.0",
4
4
 
5
5
  "workspaces": [
6
6
  "react"
package/react/README.md CHANGED
@@ -32,7 +32,10 @@ import { DataTable, Modal, Button } from '@apliteni/apliteni-ui/react';
32
32
  Both stylesheets. The React one adds what React's own components need — it carries no tokens, no
33
33
  reset and none of the kit's control CSS, so it cannot stand in for the first import.
34
34
 
35
- Components: `Success`, `SuccessPanel`, `SuccessCheck`, `Checkbox`, `Switch`, `SearchField`, `EmptyState`, `DataTable`, `Pagination`, `StatBand`, `Chart`, `Modal`, `Confirm`, `Drawer`, `CommandPalette`, `Dropdown`, `BackLink`, `Tooltip`, `Snippet`, `Segmented`, `Tabs`, `Button`, `Badge`, `Pill`, `StatusDot`, `Card`, `Callout`, `Icon`.
35
+ Components: `Success`, `SuccessPanel`, `SuccessCheck`, `Checkbox`, `Switch`, `SearchField`, `EmptyState`, `DataTable`, `Pagination`, `StatBand`, `Chart`, `Modal`, `Confirm`, `Feedback`, `Drawer`, `CommandPalette`, `Dropdown`, `BackLink`, `Tooltip`, `Snippet`, `Segmented`, `Tabs`, `Button`, `Badge`, `Pill`, `StatusDot`, `Card`, `Callout`, `Icon`.
36
+
37
+ `Card` accepts `title`, `sub`, children, `level`, `variant`, `pad`, `icon`, `href`, and `className`. `variant` is `accent` or `live`; omit it for the default surface. `pad` is `sm` or `lg`. A title is a heading unless `href` makes the whole card a link. Compose setting rows with `ui-card__row` and kit controls.
38
+ Three-option setting rows use `ui-card__row--tight-choice` to narrow pills below 360 px and stay on one line, while other rows keep full tap width.
36
39
 
37
40
  `Segmented` is a controlled choice toolbar: pass `options`, `value`, `onChange`,
38
41
  and a `label` for its accessible name. `size="sm"` compacts it, `block` makes it
@@ -304,6 +307,19 @@ once installed. In the repo there is no copy to resolve to, so `kit-alias.ts` po
304
307
  vitest and Storybook straight at `../src/` — which is why the class-name parity tests
305
308
  now compare against the working tree rather than the last published release.
306
309
 
310
+ ### Table appearance
311
+
312
+ `DataTable` takes the vanilla table hooks as props. `zebra`, `hover` (on unless `false`), `stack`,
313
+ `density`, `stickyHeader` and `pinnedIdentity` set the table modifiers. `rowState={(row) => 'target' | 'dead' | undefined}`
314
+ marks a row, `footer` takes totals rows, and `caption` names the table for assistive technology. A column takes
315
+ `rowHeader` and `cell` (`'title' | 'code' | 'long' | 'strong' | 'act'`). A `dead` row is muted, so put the word
316
+ that names its state in one of its cells.
317
+
318
+ ```tsx
319
+ <DataTable columns={columns} rows={rows} selectable={false} pager={false}
320
+ density="dense" zebra stack rowState={(r) => (r.id === landedOn ? 'target' : undefined)} />
321
+ ```
322
+
307
323
  ### Tables with another presentation of the same rows
308
324
 
309
325
  Pass `selectable={false}` to omit selection controls and their callbacks. Existing callers
@@ -447,6 +463,30 @@ and described by its body. Modal also accepts
447
463
  `initialFocusRef` for a mounted, focusable element inside its panel. Without it, Modal
448
464
  uses its normal opening focus.
449
465
 
466
+ ## Feedback
467
+
468
+ `Feedback` lets a reader select a passage and send a note about it. Pass `container`, a ref to
469
+ the element whose text can be selected, and `onSend`. A "Give feedback" pill appears above a
470
+ selection of `minChars` (3) or more. The pill opens a form with a chip for the nearest heading,
471
+ the quoted passage, a note field, Cancel and Send. The quoted passage stays highlighted until the
472
+ form closes. The container may mount after `Feedback`. On close, focus returns to the visible
473
+ control that had it before opening. If that control is gone, hidden, or disabled, focus returns to the pill.
474
+
475
+ ```tsx
476
+ <Feedback container={articleRef}
477
+ onSend={async ({ note, excerpt, anchor }) => ({ ok: await file(note, excerpt, anchor) })} />
478
+ ```
479
+
480
+ `onSend` receives `note`, `excerpt`, `anchor`, `sectionLabel` and `sectionTitle`. Resolve
481
+ `{ ok: true }` when the note is filed. Resolve `{ ok: false, error }`, or throw, to keep the form
482
+ open with the note intact and the error shown in place. `section` reshapes the chip and the
483
+ payload from the heading. Send stays off until the note has text and shows progress while the
484
+ request runs.
485
+
486
+ A sent note shows one line, `sentMessage`, and a Close button. Cancel, Escape, the close button
487
+ and the scrim dismiss the form without sending. `Feedback` uses the shared dialog stack and the
488
+ kit's buttons.
489
+
450
490
  ## Timeline
451
491
 
452
492
  `Timeline` displays a record’s events in the order provided. Pass events from oldest
@@ -817,6 +857,24 @@ the trigger's trailing edge. Without `ariaLabel` the trigger's own text is its a
817
857
  name, so a control reading "17 September 2026" is heard as that rather than as its
818
858
  placeholder. The popover stays mounted while closed, and is `inert` while it is.
819
859
 
860
+ ## Footer
861
+
862
+ `Footer` draws the kit's `full`, `slim` and `app` versions. The full version takes
863
+ brand text, a tagline, social links and link columns. The columns sit side by side
864
+ on an iPad or desktop and stack on a phone. Supply legal text and links for every
865
+ version. Pass `AccentPicker` and `ThemeToggle` through `switcher` when needed.
866
+
867
+ ```tsx
868
+ <Footer variant="full" tagline="A short product line"
869
+ columns={[{ title: 'Product', links: [{ label: 'Overview', href: '/overview' }] }]}
870
+ legal="© 2026 Example" switcher={<ThemeToggle />} />
871
+ ```
872
+
873
+ Use `brand` to replace the lockup with React content. Set `brand={false}` to hide
874
+ the brand block. Use `links` for React link columns in place of `columns`.
875
+ Use `legal` for text or React content. The component uses the kit's footer classes
876
+ and stylesheet.
877
+
820
878
  ## AccentPicker
821
879
 
822
880
  `AccentPicker` is a controlled group of the kit’s four accent swatches. Pass `value`
@@ -96,13 +96,22 @@ declare const StatusDot: react.ForwardRefExoticComponent<Omit<HTMLAttributes<HTM
96
96
  } & react.RefAttributes<HTMLSpanElement>>;
97
97
 
98
98
  type Level = 2 | 3 | 4 | 5 | 6;
99
- declare function Card({ title, sub, level, className, children }: {
99
+ type CardProps = {
100
100
  title?: ReactNode;
101
101
  sub?: ReactNode;
102
102
  level?: Level;
103
+ /** `accent` tints the card with the accent and `live` with green. */
104
+ variant?: 'accent' | 'live';
105
+ /** `sm` trims the vertical padding. `lg` is the centred landing card. */
106
+ pad?: 'sm' | 'lg';
107
+ /** Glyph name for the chip before the title. Needs a `title`. */
108
+ icon?: string;
109
+ /** Makes the whole card a link. Its title is then a plain block, because a link holds no heading. */
110
+ href?: string;
103
111
  className?: string;
104
112
  children?: ReactNode;
105
- }): react.JSX.Element;
113
+ };
114
+ declare function Card({ title, sub, level, variant, pad, icon, href, className, children }: CardProps): react.JSX.Element;
106
115
 
107
116
  type CalloutVariant = 'neutral' | 'info' | 'success' | 'warn' | 'danger';
108
117
  interface CalloutProps {
@@ -156,6 +165,38 @@ type ConfirmProps = {
156
165
  };
157
166
  declare function Confirm({ open, title, body, confirmLabel, cancelLabel, danger, busy, onConfirm, onCancel, }: ConfirmProps): react.JSX.Element;
158
167
 
168
+ type FeedbackPayload = {
169
+ note: string;
170
+ excerpt: string;
171
+ anchor: string;
172
+ sectionLabel: string;
173
+ sectionTitle: string;
174
+ };
175
+ type FeedbackResult = {
176
+ ok: boolean;
177
+ error?: string;
178
+ };
179
+ type FeedbackSection = {
180
+ label?: string;
181
+ title?: string;
182
+ anchor?: string;
183
+ };
184
+ type FeedbackProps = {
185
+ /** The element whose text a reader may select. Pass a ref to it. */
186
+ container: RefObject<HTMLElement | null>;
187
+ /** Files the note. Resolve `{ ok: true }` when it is sent, or `{ ok: false, error }` to keep the form open with the error in place. */
188
+ onSend: (payload: FeedbackPayload) => Promise<FeedbackResult>;
189
+ /** Shortest selection that offers the pill. */
190
+ minChars?: number;
191
+ /** Shapes the chip and the payload from the heading above the selection. */
192
+ section?: (heading: Element | null) => FeedbackSection;
193
+ label?: string;
194
+ placeholder?: string;
195
+ /** The one line shown once the note is sent. */
196
+ sentMessage?: string;
197
+ };
198
+ declare function Feedback({ container, onSend, minChars, section, label, placeholder, sentMessage, }: FeedbackProps): react.ReactPortal;
199
+
159
200
  type ModalProps = {
160
201
  open: boolean;
161
202
  title: string;
@@ -240,6 +281,10 @@ type Column<T> = {
240
281
  * why: docs/components.md#dense-financial-tables
241
282
  */
242
283
  linked?: boolean;
284
+ /** Renders this column's body cells as row headers (`th scope="row"`), as the kit's compact table does. */
285
+ rowHeader?: boolean;
286
+ /** `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. */
287
+ cell?: 'title' | 'code' | 'long' | 'strong' | 'act';
243
288
  };
244
289
  type TableSort<T> = {
245
290
  key: (keyof T & string) | undefined;
@@ -275,6 +320,16 @@ type PagerProps = {
275
320
  type DataTableProps<T> = {
276
321
  columns: Column<T>[];
277
322
  rows: T[];
323
+ /** 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. */
324
+ zebra?: boolean;
325
+ hover?: boolean;
326
+ stack?: boolean;
327
+ /** 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. */
328
+ rowState?: (row: T) => 'target' | 'dead' | undefined;
329
+ /** Table footer rows, such as totals: `<tr>` elements with a `th scope="row"` label. */
330
+ footer?: ReactNode;
331
+ /** A caption read by assistive technology only. */
332
+ caption?: string;
278
333
  dense?: boolean;
279
334
  density?: 'default' | 'dense' | 'compact';
280
335
  stickyHeader?: boolean;
@@ -304,7 +359,7 @@ type DataTableProps<T> = {
304
359
  declare function sortTableRows<T>(rows: T[], sort: TableSort<T>): T[];
305
360
  declare function DataTable<T extends {
306
361
  name: string;
307
- }>({ columns, rows, 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;
362
+ }>({ 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;
308
363
 
309
364
  type PaginationProps = {
310
365
  page?: number;
@@ -870,6 +925,42 @@ type AppShellProps = {
870
925
  };
871
926
  declare function AppShell({ sections, pathname, title, children, word, brand, brandHref, width, back, lede, actions, bandControl, account, onSignOut, searchLabel, searchShortLabel, defaultCollapsed, palette, renderLink }: AppShellProps): react.JSX.Element;
872
927
 
928
+ type FooterLink = {
929
+ label: string;
930
+ href?: string;
931
+ target?: string;
932
+ };
933
+ type FooterColumn = {
934
+ title?: string;
935
+ links: FooterLink[];
936
+ };
937
+ type FooterSocial = {
938
+ label: string;
939
+ href?: string;
940
+ icon?: 'github' | 'x' | 'linkedin' | 'mail';
941
+ };
942
+ type FooterProps = Omit<HTMLAttributes<HTMLElement>, 'children'> & {
943
+ /** `full` is the marketing footer, `slim` a single legal row, `app` the in-product row. */
944
+ variant?: 'full' | 'slim' | 'app';
945
+ /** Product word beside the mark. Default `Strategy`. */
946
+ word?: string;
947
+ brandHref?: string;
948
+ /** Replaces the lockup. `false` hides the whole brand block: lockup, tagline and social links. Full variant only. */
949
+ brand?: ReactNode | false;
950
+ /** Short line under the brand. Full variant only. */
951
+ tagline?: string;
952
+ /** Link columns. Side by side above the phone step, stacked on a phone. Full variant only. */
953
+ columns?: FooterColumn[];
954
+ /** Contents of the link navigation. Takes the place of `columns`. Full variant only. */
955
+ links?: ReactNode;
956
+ social?: FooterSocial[];
957
+ legal?: ReactNode;
958
+ legalLinks?: FooterLink[];
959
+ /** Slot for `<AccentPicker>` and `<ThemeToggle>`. */
960
+ switcher?: ReactNode;
961
+ };
962
+ declare function Footer({ variant, word, brandHref, brand, tagline, columns, links, social, legal, legalLinks, switcher, className, ...rest }: FooterProps): react.JSX.Element;
963
+
873
964
  type EmptyStateVariant = 'first-run' | 'no-matches' | 'not-found' | 'not-yet-built';
874
965
  type EmptyStateProps = {
875
966
  variant?: EmptyStateVariant;
@@ -1157,4 +1248,4 @@ declare const Breadcrumbs: react.ForwardRefExoticComponent<Omit<Omit<react.Detai
1157
1248
  declare const PAGE_SIZES: readonly number[];
1158
1249
  declare const DEFAULT_PAGE_SIZE: number;
1159
1250
 
1160
- export { type Accent, AccentPicker, type AccentPickerProps, type AddFilter, AppShell, type AppShellProps, type AppShellSection, 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 ChartBridgeStep, type ChartBridgeTones, type ChartPeriod, type ChartProps, type ChartSeries, 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, Field, type FieldControlProps, type FieldProps, FileDrop, type FileDropFile, type FileDropProps, type FileDropStatus, FileField, type FileFieldProps, type Filter, FilterBar, type FilterBarProps, 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, sortTableRows, useToast };
1251
+ export { type Accent, AccentPicker, type AccentPickerProps, type AddFilter, AppShell, type AppShellProps, type AppShellSection, 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 ChartBridgeStep, type ChartBridgeTones, type ChartPeriod, type ChartProps, type ChartSeries, 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, sortTableRows, useToast };