@it-holding-ui/atomic 9.21.0 → 9.23.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.
@@ -0,0 +1,25 @@
1
+ import { ITHCardCarouselProps } from './ITHCardCarousel.types';
2
+ /**
3
+ * A horizontal strip of cards: one per screen, swiped through, snapped.
4
+ *
5
+ * <p>Lifted from the Riteo garage, where the cars are the slides, and kept to
6
+ * its numbers on purpose — the thumb already knows this carousel, and a
7
+ * second set would be a second feel for the same gesture: 10px between
8
+ * cards, mandatory snap, the strip's own scroll contained so the page's
9
+ * vertical scroll does not fight it at every diagonal swipe, and room above
10
+ * and below for a card's shadow, which a scroll container would otherwise
11
+ * cut off square.
12
+ *
13
+ * <p>The strip is a native scroll container, not a transform track: momentum,
14
+ * rubber-banding and the snap are the platform's, and a keyboard reaches it
15
+ * as a focusable region — the arrow keys, Home and End move a slide at a
16
+ * time. The dots are buttons, and each says which slide it opens.
17
+ *
18
+ * <p>Which slide is in front is reported once the strip settles on it, not on
19
+ * every frame of the swipe, so a screen that redraws on it does not redraw
20
+ * sixty times a second. Controlled or not: pass `index` to steer it.
21
+ */
22
+ export declare function ITHCardCarousel<T>(props: ITHCardCarouselProps<T>): JSX.Element;
23
+ export declare namespace ITHCardCarousel {
24
+ var displayName: string;
25
+ }
@@ -0,0 +1,64 @@
1
+ import { default as React } from 'react';
2
+ /** The one-time «this scrolls» hint: the cards slide toward the next one and back. */
3
+ export type ITHCardCarouselNudge = {
4
+ /**
5
+ * Remember in localStorage under this key that the hint was shown, so it
6
+ * plays once per device. Without a key it plays once per mount.
7
+ */
8
+ storageKey?: string;
9
+ /** Wait after mount, so the hint is not lost in the page's own entrance. 900 by default. */
10
+ delayMs?: number;
11
+ /** How far the cards travel, px. 40 by default. */
12
+ distancePx?: number;
13
+ };
14
+ type ITHCardCarouselCommonProps = {
15
+ /** The carousel's name for assistive technology: «Проекты», «Your cars». Required — a region needs one. */
16
+ ariaLabel: string;
17
+ /**
18
+ * The slide under the thumb, for a controlled carousel. Changing it
19
+ * scrolls there; the carousel reports every settled change through
20
+ * `onIndexChange`.
21
+ */
22
+ index?: number;
23
+ /** Where an uncontrolled carousel starts. 0 by default. */
24
+ defaultIndex?: number;
25
+ /** Called with the slide's index once the strip settles on a new one, from a swipe, a dot or a key. */
26
+ onIndexChange?: (index: number) => void;
27
+ /**
28
+ * Show a slice of the next card (slides at 90 %, snapped to the start),
29
+ * so the strip says it scrolls. Off: every slide is the full width.
30
+ * Any width can be set through `--ith-card-carousel-slide`.
31
+ */
32
+ peek?: boolean;
33
+ /** Page dots under the strip, on by default. Drawn only when there are two slides or more. */
34
+ dots?: boolean;
35
+ /** The accessible name of a dot and a slide: «2 of 5» by default. */
36
+ slideLabel?: (index: number, count: number) => string;
37
+ /** The «this scrolls» hint. Never for anyone who asked for less motion, never after a touch. */
38
+ nudge?: boolean | ITHCardCarouselNudge;
39
+ /**
40
+ * Let the strip run out to the screen edge through the page's side
41
+ * padding: pass that padding, px (16 on a phone). The first card still
42
+ * lines up with the content above it. Never larger than the padding,
43
+ * or the strip widens the page.
44
+ */
45
+ bleed?: number;
46
+ className?: string;
47
+ slideClassName?: string;
48
+ };
49
+ type ITHCardCarouselChildrenProps = {
50
+ /** Each child is a slide. */
51
+ children: React.ReactNode;
52
+ items?: never;
53
+ renderItem?: never;
54
+ getKey?: never;
55
+ };
56
+ type ITHCardCarouselItemsProps<T> = {
57
+ children?: never;
58
+ items: readonly T[];
59
+ renderItem: (item: T, index: number) => React.ReactNode;
60
+ /** A stable key per item; the index by default. */
61
+ getKey?: (item: T, index: number) => React.Key;
62
+ };
63
+ export type ITHCardCarouselProps<T = unknown> = ITHCardCarouselCommonProps & (ITHCardCarouselChildrenProps | ITHCardCarouselItemsProps<T>);
64
+ export {};
@@ -0,0 +1,2 @@
1
+ export { ITHCardCarousel } from './ITHCardCarousel';
2
+ export type { ITHCardCarouselNudge, ITHCardCarouselProps } from './ITHCardCarousel.types';
@@ -0,0 +1,3 @@
1
+ import { RefObject } from 'react';
2
+ import { ITHCardCarouselNudge } from './ITHCardCarousel.types';
3
+ export declare const useCardCarouselNudge: (stripRef: RefObject<HTMLElement>, nudge: boolean | ITHCardCarouselNudge | undefined) => void;
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+ import { ITHProgressBarProps } from './ITHProgressBar.types';
3
+ /**
4
+ * A straight line that fills from the start: works done, steps passed,
5
+ * anything that is a share of a whole and is read left to right.
6
+ *
7
+ * <p>The ring (`ITHRingGauge`) holds one figure in its middle and wants a
8
+ * square of its own; this one sits under a heading inside a card and keeps
9
+ * the text on one line above it — what is measured on the left, how much on
10
+ * the right. The look is the add-a-car steps: a `--base-20` track and a
11
+ * `-40` fill with round ends.
12
+ *
13
+ * <p>The fill is a percentage width, not a pixel one, so the bar is as wide
14
+ * as whatever holds it and never pushes a phone screen sideways.
15
+ */
16
+ export declare const ITHProgressBar: React.NamedExoticComponent<ITHProgressBarProps>;
@@ -0,0 +1,35 @@
1
+ export declare enum ITHProgressBarTone {
2
+ PRIMARY = "primary",
3
+ SUCCESS = "success",
4
+ WARNING = "warning",
5
+ DANGER = "danger",
6
+ BASE = "base"
7
+ }
8
+ export declare enum ITHProgressBarSize {
9
+ /** 4px — the add-a-car steps, a line under a card. */
10
+ SMALL = "small",
11
+ /** 8px — a figure someone reads: «Работы выполнены · 62 %». */
12
+ MEDIUM = "medium",
13
+ /** 12px — the one number of a screen. */
14
+ LARGE = "large"
15
+ }
16
+ export type ITHProgressBarProps = {
17
+ /** How far along, out of `max`. Clamped to 0…max. */
18
+ value: number;
19
+ /** The whole. 100 by default, so a percentage goes in as is; 9 for «6 of 9 jobs». */
20
+ max?: number;
21
+ tone?: ITHProgressBarTone;
22
+ size?: ITHProgressBarSize;
23
+ /** What is measured, above the bar on the left: «Работы выполнены». Also the bar's accessible name. */
24
+ label?: string;
25
+ /**
26
+ * The figure above the bar on the right: «62 %», «6 из 9». Read out as
27
+ * the value too. Without it the bar draws no figure unless `showValue`.
28
+ */
29
+ valueText?: string;
30
+ /** Draw the rounded percentage on the right when no `valueText` is given. */
31
+ showValue?: boolean;
32
+ /** The accessible name when there is no visible `label`. */
33
+ ariaLabel?: string;
34
+ className?: string;
35
+ };
@@ -0,0 +1,3 @@
1
+ export { ITHProgressBar } from './ITHProgressBar';
2
+ export type { ITHProgressBarProps } from './ITHProgressBar.types';
3
+ export { ITHProgressBarSize, ITHProgressBarTone } from './ITHProgressBar.types';
@@ -0,0 +1,22 @@
1
+ import { default as React } from 'react';
2
+ import { ITHTimelineProps } from './ITHTimeline.types';
3
+ /**
4
+ * Stages on a vertical line, with a marker for where the reader is.
5
+ *
6
+ * <p>The line is schematic. Distances between nodes follow the height of
7
+ * what each node holds, not the kilometres or days between them: a scale
8
+ * drawn to proportion would put the two stages that matter a screen apart
9
+ * and crowd the rest into a row of dots.
10
+ *
11
+ * <p>The marker sits between nodes, never on the line by itself. A car at
12
+ * 148 200 km belongs after the 120 000 stage and before the 150 000 one, and
13
+ * that is where the eye finds it; an exact match — the odometer standing on
14
+ * a stage — is drawn on that stage, because a second dot for the same place
15
+ * would read as two events.
16
+ *
17
+ * <p>Disclosure is a real button with `aria-expanded`, so a keyboard and a
18
+ * screen reader open a stage the same way a thumb does. Which stages are
19
+ * open is the caller's state: the list is drawn from it, not the other way
20
+ * round, so a screen can keep it per car and restore it on return.
21
+ */
22
+ export declare const ITHTimeline: React.NamedExoticComponent<ITHTimelineProps>;
@@ -0,0 +1,55 @@
1
+ import { default as React } from 'react';
2
+ export declare enum ITHTimelineNodeStatus {
3
+ /** Nothing recorded against this stage — a neutral point. */
4
+ NONE = "none",
5
+ /** Some of the stage's work has a record, the rest has none. */
6
+ PARTIAL = "partial",
7
+ /** Every piece of the stage's work has a record. */
8
+ DONE = "done",
9
+ /** The stage coming up — the one the reader is most likely looking for. */
10
+ NEXT = "next"
11
+ }
12
+ /** One stage on the line: a service visit, a milestone, a step. */
13
+ export type ITHTimelineNode = {
14
+ id: string;
15
+ /** «150 000 km», «Step 3», «Dispatched». */
16
+ title: string;
17
+ /** The second line: «in 1 800 km · 6 jobs», «No records». */
18
+ summary?: string;
19
+ status?: ITHTimelineNodeStatus;
20
+ /** A short count beside the title: «4 of 6». */
21
+ badge?: string;
22
+ /**
23
+ * What the stage contains, shown when expanded. A node without children
24
+ * draws no disclosure at all — a chevron that opens nothing is a promise
25
+ * the component cannot keep.
26
+ */
27
+ children?: React.ReactNode;
28
+ expanded?: boolean;
29
+ };
30
+ /** Where the reader is on the line — the odometer today, the current step. */
31
+ export type ITHTimelineMarker = {
32
+ /** «You are here · 148 200 km». */
33
+ label: string;
34
+ /**
35
+ * The node the marker follows, by index. −1 puts it before the first
36
+ * node, `nodes.length − 1` after the last.
37
+ */
38
+ afterIndex: number;
39
+ /**
40
+ * Draw the marker on the node at `afterIndex` instead of after it — the
41
+ * exact-match case, where a second dot for the same place would read as
42
+ * two events.
43
+ */
44
+ onNode?: boolean;
45
+ };
46
+ export type ITHTimelineProps = {
47
+ nodes: ITHTimelineNode[];
48
+ marker?: ITHTimelineMarker | null;
49
+ /** Called with the node's id when its disclosure is pressed. */
50
+ onToggle?: (id: string) => void;
51
+ /** The line after the last node: «Further schedule not available yet». */
52
+ tail?: string;
53
+ ariaLabel?: string;
54
+ className?: string;
55
+ };
@@ -0,0 +1,3 @@
1
+ export { ITHTimeline } from './ITHTimeline';
2
+ export type { ITHTimelineMarker, ITHTimelineNode, ITHTimelineProps } from './ITHTimeline.types';
3
+ export { ITHTimelineNodeStatus } from './ITHTimeline.types';
@@ -19,6 +19,8 @@ export * from './ITHButton';
19
19
  export type { ITHCameraFrameProps } from './ITHCameraFrame';
20
20
  export { ITHCameraFrame, ITHCameraFrameFailure, ITHCameraFrameShape } from './ITHCameraFrame';
21
21
  export { ITHCard } from './ITHCard';
22
+ export type { ITHCardCarouselNudge, ITHCardCarouselProps } from './ITHCardCarousel';
23
+ export { ITHCardCarousel } from './ITHCardCarousel';
22
24
  export type { ITHCheckboxProps } from './ITHCheckbox';
23
25
  export { ITHCheckbox } from './ITHCheckbox';
24
26
  export type { ITHCheckboxItemProps } from './ITHCheckboxItem';
@@ -64,6 +66,8 @@ export { AVAILABLE_PHOTO_MIME_TYPES_ARRAY, DEFAULT_PHOTO_QUALITY, ITHPhotoInput,
64
66
  export type { ITHPopoverProps } from './ITHPopover';
65
67
  export { ITHPopover } from './ITHPopover';
66
68
  export { ITHProfilePhotoInput } from './ITHProfilePhotoInput';
69
+ export type { ITHProgressBarProps } from './ITHProgressBar';
70
+ export { ITHProgressBar, ITHProgressBarSize, ITHProgressBarTone } from './ITHProgressBar';
67
71
  export { ITHProvider } from './ITHProvider';
68
72
  export { ITHRadioItem } from './ITHRadioItem';
69
73
  export type { ITHRangeProps } from './ITHRange';
@@ -86,6 +90,8 @@ export { ITHText, ITHTextType } from './ITHText';
86
90
  export { ITHTextEditor } from './ITHTextEditor';
87
91
  export type { ITHTile, ITHTileSelectProps } from './ITHTileSelect';
88
92
  export { ITHTileSelect, ITHTileSelectSize } from './ITHTileSelect';
93
+ export type { ITHTimelineMarker, ITHTimelineNode, ITHTimelineProps } from './ITHTimeline';
94
+ export { ITHTimeline, ITHTimelineNodeStatus } from './ITHTimeline';
89
95
  export { ITHToggle } from './ITHToggle';
90
96
  export type { ITHTrendChartProps, ITHTrendPoint } from './ITHTrendChart';
91
97
  export { ITHTrendChart, ITHTrendChartTone } from './ITHTrendChart';