@apliteni/apliteni-ui 0.56.1 → 0.58.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.56.1",
3
+ "version": "0.58.0",
4
4
  "workspaces": [
5
5
  "react"
6
6
  ],
package/react/README.md CHANGED
@@ -28,7 +28,7 @@ import '@apliteni/apliteni-ui/react/css'; // React components' shell styles (mo
28
28
  import { DataTable, Modal, Button } from '@apliteni/apliteni-ui/react';
29
29
  ```
30
30
 
31
- Components: `EmptyState`, `DataTable`, `Pagination`, `StatBand`, `Modal`, `Confirm`, `Drawer`, `CommandPalette`, `Dropdown`, `BackLink`, `Snippet`, `Tabs`, `Button`, `Badge`, `Card`, `Callout`, `Icon`.
31
+ Components: `EmptyState`, `DataTable`, `Pagination`, `StatBand`, `Modal`, `Confirm`, `Drawer`, `CommandPalette`, `Dropdown`, `BackLink`, `Tooltip`, `Snippet`, `Tabs`, `Button`, `Badge`, `Card`, `Callout`, `Icon`.
32
32
 
33
33
  `Snippet` accepts `label`, `code`, `reveal`, and `copyLabel` props. It treats `code`
34
34
  as plain text and copies it exactly as provided. After a successful clipboard write,
@@ -501,3 +501,11 @@ AppShell includes the kit’s rail and top band. Pass the current router pathnam
501
501
  <Reports />
502
502
  </AppShell>
503
503
  ```
504
+
505
+ ## Tooltip
506
+
507
+ Tooltip accepts text and inline children, without nested controls. Hovering or focusing opens it; pressing Escape, moving focus away, or moving the mouse away closes it. On touch devices, tapping toggles it. It uses the kit’s tooltip styles and moves below the trigger when there is not enough space above. Keep the same information elsewhere on the page.
508
+
509
+ ```tsx
510
+ <Tooltip text="Updated daily">Balance</Tooltip>
511
+ ```
@@ -26,6 +26,57 @@
26
26
  }
27
27
  }
28
28
 
29
+ /* ../src/styles/tooltip.css */
30
+ .ui-tip-host {
31
+ position: relative;
32
+ }
33
+ .ui-tip {
34
+ --ui-tip-gap: 8px;
35
+ --ui-tip-bg: var(--bg-elevated);
36
+ position: absolute;
37
+ top: var(--ui-tip-y, 0px);
38
+ left: var(--ui-tip-x, 50%);
39
+ z-index: var(--z-dropdown);
40
+ translate: calc(-50% + var(--ui-tip-shift, 0px)) calc(-100% - var(--ui-tip-gap));
41
+ display: flex;
42
+ flex-direction: column;
43
+ width: max-content;
44
+ max-width: var(--prose-caption);
45
+ padding: var(--space-2) var(--space-3);
46
+ background: var(--ui-tip-bg);
47
+ border: 1px solid var(--border-strong);
48
+ box-shadow: inset 0 0 0 1px var(--elev-edge, var(--border)), var(--elev-drop);
49
+ border-radius: var(--radius-sm);
50
+ font-family: var(--font-sans);
51
+ font-size: var(--text-xs);
52
+ line-height: 1.45;
53
+ color: var(--text);
54
+ pointer-events: none;
55
+ opacity: 0;
56
+ visibility: hidden;
57
+ transition: opacity var(--dur-fast) var(--ease), visibility var(--dur-fast) linear;
58
+ }
59
+ .ui-tip.is-below {
60
+ translate: calc(-50% + var(--ui-tip-shift, 0px)) var(--ui-tip-gap);
61
+ }
62
+ .ui-tip.is-open {
63
+ opacity: 1;
64
+ visibility: visible;
65
+ }
66
+ .ui-tip__label {
67
+ color: var(--text);
68
+ }
69
+ .ui-tip__value {
70
+ font-size: var(--text-sm);
71
+ font-weight: var(--weight-semibold);
72
+ color: var(--strong);
73
+ font-variant-numeric: tabular-nums;
74
+ }
75
+ .ui-tip__detail {
76
+ color: var(--text);
77
+ font-variant-numeric: tabular-nums;
78
+ }
79
+
29
80
  /* src/Modal.css */
30
81
  .rx-scrim {
31
82
  position: fixed;
@@ -60,6 +60,7 @@ interface StatDelta {
60
60
  value: string | null;
61
61
  tone?: StatTone;
62
62
  basis?: string;
63
+ tooltip?: string;
63
64
  direction?: 'up' | 'down' | 'flat';
64
65
  none?: string;
65
66
  }
@@ -73,10 +74,12 @@ interface StatBandProps {
73
74
  stats: StatFigure[];
74
75
  variant?: StatVariant;
75
76
  basis?: string;
77
+ /** Existing caption before the figures; used when basis is omitted. */
78
+ basisId?: string;
76
79
  label?: string;
77
80
  id?: string;
78
81
  }
79
- declare function StatBand({ stats, variant, basis, label, id }: StatBandProps): react.JSX.Element;
82
+ declare function StatBand({ stats, variant, basis, basisId: sharedBasisId, label, id }: StatBandProps): react.JSX.Element;
80
83
 
81
84
  type ConfirmProps = {
82
85
  open: boolean;
@@ -161,7 +164,7 @@ declare function CommandPalette({ open, onClose, groups, onSelect, label, placeh
161
164
 
162
165
  type Column<T> = {
163
166
  key: keyof T & string;
164
- label: string;
167
+ label: ReactNode;
165
168
  num?: boolean;
166
169
  sortable?: boolean;
167
170
  render?: (row: T) => ReactNode;
@@ -431,6 +434,7 @@ declare function RowIdentity({ symbol, name, logo, href }: RowIdentityProps): re
431
434
  type SegmentOption = {
432
435
  label: string;
433
436
  value: string;
437
+ ariaLabel?: string;
434
438
  disabled?: boolean;
435
439
  };
436
440
  type SegmentedProps = {
@@ -612,7 +616,14 @@ type ThemeToggleProps = {
612
616
  };
613
617
  declare function ThemeToggle({ labelled }: ThemeToggleProps): react.JSX.Element;
614
618
 
619
+ type TooltipProps = {
620
+ text: string;
621
+ /** Inline content without nested controls. */
622
+ children: ReactNode;
623
+ };
624
+ declare function Tooltip({ text, children }: TooltipProps): react.JSX.Element;
625
+
615
626
  declare const PAGE_SIZES: readonly number[];
616
627
  declare const DEFAULT_PAGE_SIZE: number;
617
628
 
618
- export { AppShell, type AppShellProps, type AppShellSection, BackLink, type BackLinkOwnProps, type BackLinkProps, Badge, BusyRegion, type BusyRegionProps, Button, type ButtonProps, Callout, type CalloutProps, type CalloutVariant, Card, type Column, type CommandGroup, type CommandItem, CommandPalette, type CommandPaletteProps, Confirm, type ConfirmProps, DEFAULT_PAGE_SIZE, DataTable, type DataTableProps, DeltaValue, type DeltaValueProps, Denied, type DeniedProps, Drawer, type DrawerProps, DrawerSection, type DrawerSectionProps, Dropdown, type DropdownBadge, type DropdownEntry, type DropdownItem, type DropdownProps, type DropdownRowProps, type DropdownSearch, type DropdownSection, type DropdownSeparator, EmptyState, type EmptyStateProps, type EmptyStateVariant, FileField, type FileFieldProps, type Filter, FilterBar, type FilterBarProps, Icon, KeyValueList, type KeyValueListProps, type KeyValueRow, Modal, type ModalProps, NumericValue, type NumericValueProps, PAGE_SIZES, Pagination, type PaginationProps, RowIdentity, type RowIdentityProps, type SegmentOption, Segmented, type SegmentedProps, SelectField, type SelectFieldProps, Skeleton, type SkeletonProps, SkeletonTable, type SkeletonTableProps, Snippet, type SnippetProps, StatBand, type StatBandProps, type StatDelta, type StatFigure, type StatTone, type StatVariant, 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, sortTableRows, useToast };
629
+ export { AppShell, type AppShellProps, type AppShellSection, BackLink, type BackLinkOwnProps, type BackLinkProps, Badge, BusyRegion, type BusyRegionProps, Button, type ButtonProps, Callout, type CalloutProps, type CalloutVariant, Card, type Column, type CommandGroup, type CommandItem, CommandPalette, type CommandPaletteProps, Confirm, type ConfirmProps, DEFAULT_PAGE_SIZE, DataTable, type DataTableProps, DeltaValue, type DeltaValueProps, Denied, type DeniedProps, Drawer, type DrawerProps, DrawerSection, type DrawerSectionProps, Dropdown, type DropdownBadge, type DropdownEntry, type DropdownItem, type DropdownProps, type DropdownRowProps, type DropdownSearch, type DropdownSection, type DropdownSeparator, EmptyState, type EmptyStateProps, type EmptyStateVariant, FileField, type FileFieldProps, type Filter, FilterBar, type FilterBarProps, Icon, KeyValueList, type KeyValueListProps, type KeyValueRow, Modal, type ModalProps, NumericValue, type NumericValueProps, PAGE_SIZES, Pagination, type PaginationProps, RowIdentity, type RowIdentityProps, type SegmentOption, Segmented, type SegmentedProps, SelectField, type SelectFieldProps, Skeleton, type SkeletonProps, SkeletonTable, type SkeletonTableProps, Snippet, type SnippetProps, StatBand, type StatBandProps, type StatDelta, type StatFigure, type StatTone, type StatVariant, 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 };