@apliteni/apliteni-ui 0.108.0 → 0.114.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.
@@ -6,9 +6,9 @@
6
6
 
7
7
  **Rule:** Use body ink for all words; use size, weight and spacing for hierarchy.
8
8
 
9
- **Why:** Muted text can look decorative, especially at small sizes, even when contrast passes.
9
+ **Why:** Muted text can look decorative at small sizes, even when contrast passes.
10
10
 
11
- **Do:** Use body ink at xs, sm and base; let size show hierarchy.
11
+ **Do:** Use body ink at every size; let size show hierarchy.
12
12
 
13
13
  **Don't:** Use muted ink at different sizes to show rank.
14
14
 
@@ -16,15 +16,15 @@
16
16
 
17
17
  <!-- rule: text-ink-exceptions -->
18
18
 
19
- **Rule:** Use muted or dim ink only for the three named exception classes.
19
+ **Rule:** Use muted or dim ink only for the four named exception classes.
20
20
 
21
- **Why:** A closed list prevents fading from becoming a hierarchy cue.
21
+ **Why:** A closed list keeps fading from becoming hierarchy.
22
22
 
23
- **Do:** Use muted ink for a disabled control or empty field placeholder.
23
+ **Do:** Use muted ink for a placeholder or an axis.
24
24
 
25
25
  **Don't:** Fade timestamps, counts or enabled actions.
26
26
 
27
- **Except:** Only: (1) non-word glyphs, such as arrows, chevrons or dismiss marks; (2) colour reporting off, unset, disabled or archived state; (3) a valueless slot, such as an empty field or cell placeholder. Unselected options, “No earlier figure” sentences, counts, timestamps, keyboard shortcuts, enabled actions and empty-state instructions are information, not exceptions.
27
+ **Except:** Only: (1) non-word glyphs — arrows, chevrons, dismiss marks; (2) colour reporting off, unset, disabled or archived; (3) a valueless slot, such as an empty field or cell; (4) a drawing’s furniture — a chart’s axis, period row and legend — whose values remain reachable in full. Unselected options, counts, timestamps, shortcuts, enabled actions and empty-state text are information, not exceptions.
28
28
 
29
29
  ## Use sentence case
30
30
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apliteni/apliteni-ui",
3
- "version": "0.108.0",
3
+ "version": "0.114.0",
4
4
  "workspaces": [
5
5
  "react"
6
6
  ],
package/react/README.md CHANGED
@@ -32,7 +32,7 @@ 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`, `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`, `Drawer`, `CommandPalette`, `Dropdown`, `BackLink`, `Tooltip`, `Snippet`, `Segmented`, `Tabs`, `Button`, `Badge`, `Pill`, `StatusDot`, `Card`, `Callout`, `Icon`.
36
36
 
37
37
  `Segmented` is a controlled choice toolbar: pass `options`, `value`, `onChange`,
38
38
  and a `label` for its accessible name. `size="sm"` compacts it, `block` makes it
@@ -831,3 +831,71 @@ control ever draws: selection and focus are one signal each, and only focus is a
831
831
  accent. Accent names and swatch paints come from the kit's `ACCENTS` and
832
832
  `accentSwatchStyle`, which the vanilla factory also reads, so the two pickers cannot
833
833
  drift.
834
+
835
+ ## Chart
836
+
837
+ `Chart` draws three shapes from the kit's tokens: `months`, a column per period with bars and
838
+ a line across them; `bridge`, one period walked from a starting total to a result; and `spark`,
839
+ one series at text size with no axis, for a stat band's `trend` slot.
840
+
841
+ The numbers are yours and so is the wording. `format` prints exact values in the readout, the
842
+ live region and the table; `formatAxis` prints the ticks, which are whole units, and defaults
843
+ to `format`. A `bars-below` series takes positive magnitudes and is drawn under the zero line.
844
+ A period marked `estimated` keeps its series fill with a dashed edge. The legend names the state.
845
+ The readout and the optional table show the state and its `note`.
846
+
847
+ A bar series names a tone. `accent` and `accent-soft` are one hue at two weights, which is how
848
+ two series read apart without spending a second colour on them; `good` and `bad` say which way
849
+ the news runs, and belong to a series where some direction is better. Every tone is opaque and
850
+ clears 3:1 against the card and against the page, in both themes and under every accent.
851
+
852
+ The plot draws a hairline at every tick and the zero rule over them, and the axis keeps a label
853
+ at every tick. A bar is flat, rounded only at the end away from zero, and **never wider than a
854
+ mark**: a chart that grows with the card gains ground between its columns rather than twelve
855
+ wider blocks. Two bar series on the same side of the zero line stand side by side with ground
856
+ between them. A bridge carries each step's running total across to the step beside it. The
857
+ value axis, the period row and the legend are drawn quietly, and every value they name is also
858
+ in the readout and in the table at full strength.
859
+
860
+ Picking a column paints the column's own ground behind it and sets its label in the strong ink
861
+ at a heavier weight. No mark changes colour, so the accent stays with the series it names, and
862
+ the only outline the chart draws is the focus ring on the plot.
863
+
864
+ The plot is one tab stop. Left, Right, Home and End step columns and announce each one
865
+ politely, Enter picks one when `selectable` is set, and `title` names the `role="img"` plot and
866
+ the table under it without being drawn — the card around the chart already carries its title.
867
+ The table the reader opens adds the two stops it needs of its own: its summary, and the named
868
+ scroller that carries its columns sideways so your card and your page keep their width.
869
+ At phone widths the plot scrolls with the value axis held in place, and the side that still
870
+ hides columns is faded. Nothing animates.
871
+
872
+ On a touch screen a tap opens the readout and a second tap on the same mark closes it. **The
873
+ tap that opens a readout does not call `onSelect`** — it is the reader asking what a mark is
874
+ worth — while the tap that closes one, and an ordinary mouse click, do. The click itself is
875
+ never swallowed, so your own listener around the chart still hears every tap. Below 560px, to
876
+ a coarse pointer, a line's point grows an invisible target that stops at its own column so
877
+ no two periods answer for each other. A narrow sparkline can own less than 44px across, but it
878
+ still owns at least 24px across and the full 44px down. The drawn line does not change. A
879
+ sparkline's box grows with it — 32px of drawing cannot hold the vertical target, and the part
880
+ outside the box would be clipped by the chart's own edge — so a `trend` slot is 44px tall there
881
+ instead of 32, with the same line drawn in the middle of it.
882
+
883
+ ```tsx
884
+ <Chart title="Income and spend by month, last 12 months, with net"
885
+ periods={months.map(label => ({ label }))}
886
+ series={[
887
+ { id: 'income', name: 'Income', values: income, tone: 'accent' },
888
+ { id: 'spend', name: 'Spend', values: spend, shape: 'bars-below', tone: 'accent-soft' },
889
+ /* or `shape: 'bars'` for the two standing side by side on the zero line */
890
+ { id: 'net', name: 'Net', values: net, shape: 'line', tone: 'info' },
891
+ ]}
892
+ format={eur} formatAxis={eurShort} />
893
+
894
+ <Chart variant="bridge" title="Cash from opening to closing" format={eur}
895
+ steps={[
896
+ { label: 'Opening', value: 120000 },
897
+ { label: 'Subscriptions', value: 42600 },
898
+ { label: 'Payroll', value: -58200 },
899
+ { label: 'Closing', kind: 'total' },
900
+ ]} />
901
+ ```
@@ -900,6 +900,87 @@ declare const Success: react.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLD
900
900
  onCountdownEnd?: () => void;
901
901
  } & react.RefAttributes<HTMLDivElement>>;
902
902
 
903
+ type ChartTone = 'accent' | 'accent-soft' | 'good' | 'bad' | 'warn' | 'info' | 'neutral';
904
+ type ChartPeriod = {
905
+ /** The period as the readout and the table name it: `Jan 2026`. */
906
+ label: string;
907
+ /** The period as the axis names it. Defaults to `label`'s first word. */
908
+ short?: string;
909
+ /** The period is not final — estimated, forecast, or still running. */
910
+ estimated?: boolean;
911
+ /** Why it is not final. Printed in the readout and in the legend. */
912
+ note?: string;
913
+ };
914
+ type ChartSeries = {
915
+ id: string;
916
+ name: string;
917
+ values: readonly number[];
918
+ /**
919
+ * `bars` stand on the zero line, `bars-below` hang under it from positive
920
+ * magnitudes (spend given as 31870, not −31870), and `line` crosses both.
921
+ */
922
+ shape?: 'bars' | 'bars-below' | 'line';
923
+ /**
924
+ * Bars take a tone. A line is `neutral` unless the caller says otherwise.
925
+ * `accent` and `accent-soft` are one hue at two weights, which is how two
926
+ * series read apart without spending a second colour on them.
927
+ */
928
+ tone?: ChartTone;
929
+ };
930
+ type ChartBridgeStep = {
931
+ label: string;
932
+ short?: string;
933
+ /**
934
+ * A `total` is an absolute column; a `change` is added to the running total.
935
+ * The first step is a total and every later one a change, unless it says so.
936
+ */
937
+ kind?: 'total' | 'change';
938
+ /** A change's amount. A `total` without one takes the running total. */
939
+ value?: number;
940
+ estimated?: boolean;
941
+ note?: string;
942
+ };
943
+ type ChartBridgeTones = {
944
+ rise?: ChartTone;
945
+ fall?: ChartTone;
946
+ total?: ChartTone;
947
+ };
948
+ type ChartCommon = {
949
+ /**
950
+ * Names the chart for a reader who cannot see it, and the table under it.
951
+ * Never drawn: the card around a chart already carries its title.
952
+ */
953
+ title: string;
954
+ /** Exact values, for the readout, the live region and the table. */
955
+ format: (value: number) => string;
956
+ /** Axis ticks, which are whole units. Defaults to `format`. */
957
+ formatAxis?: (value: number) => string;
958
+ /** The plot's height in CSS px. */
959
+ height?: number;
960
+ /** Offer the same numbers as a table. On by default, off for a sparkline. */
961
+ table?: boolean;
962
+ /** Let Enter and a click pick a column. */
963
+ selectable?: boolean;
964
+ /** The picked column, when the caller keeps that state. */
965
+ selected?: number | null;
966
+ onSelect?: (index: number) => void;
967
+ className?: string;
968
+ };
969
+ type ChartProps = ChartCommon & ({
970
+ variant?: 'months';
971
+ periods: readonly ChartPeriod[];
972
+ series: readonly ChartSeries[];
973
+ } | {
974
+ variant: 'spark';
975
+ periods: readonly ChartPeriod[];
976
+ series: readonly ChartSeries[];
977
+ } | {
978
+ variant: 'bridge';
979
+ steps: readonly ChartBridgeStep[];
980
+ tones?: ChartBridgeTones;
981
+ });
982
+ declare function Chart(props: ChartProps): react.JSX.Element;
983
+
903
984
  type SidebarNavBadge = string | number | {
904
985
  text: string | number;
905
986
  tone?: 'neutral' | 'accent' | 'live' | 'danger';
@@ -965,4 +1046,4 @@ declare const AccentPicker: react.ForwardRefExoticComponent<Omit<HTMLAttributes<
965
1046
  declare const PAGE_SIZES: readonly number[];
966
1047
  declare const DEFAULT_PAGE_SIZE: number;
967
1048
 
968
- export { type Accent, AccentPicker, type AccentPickerProps, AppShell, type AppShellProps, type AppShellSection, BackLink, type BackLinkOwnProps, type BackLinkProps, Badge, BusyRegion, type BusyRegionProps, Button, type ButtonLinkProps, type ButtonProps, Callout, type CalloutProps, type CalloutVariant, Card, 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 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, 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 };
1049
+ export { type Accent, AccentPicker, type AccentPickerProps, AppShell, type AppShellProps, type AppShellSection, BackLink, type BackLinkOwnProps, type BackLinkProps, Badge, 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, 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 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, 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 };