@spscommerce/ds-shared 5.0.0-rc1 → 5.0.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/lib/bar-chart.d.ts +12 -12
- package/lib/button.d.ts +34 -34
- package/lib/clickable-tag.d.ts +4 -4
- package/lib/datetime.d.ts +36 -34
- package/lib/examples.d.ts +41 -47
- package/lib/feedback.d.ts +15 -15
- package/lib/filter-tile.d.ts +7 -0
- package/lib/grid.d.ts +2 -2
- package/lib/growler.d.ts +12 -12
- package/lib/i18n.d.ts +4 -4
- package/lib/icon.d.ts +186 -185
- package/lib/index.cjs.js +1 -560
- package/lib/index.d.ts +29 -25
- package/lib/index.es.js +507 -0
- package/lib/insight-card.d.ts +15 -15
- package/lib/insight-tile.d.ts +15 -0
- package/lib/key-value-list-item.d.ts +4 -0
- package/lib/modal.d.ts +12 -12
- package/lib/option-list.d.ts +32 -31
- package/lib/pagination.d.ts +2 -2
- package/lib/positioning.d.ts +14 -14
- package/lib/ring-size.d.ts +5 -5
- package/lib/spinner.d.ts +5 -5
- package/lib/sps-action.d.ts +25 -23
- package/lib/stacked-horizontal-bar-chart.d.ts +7 -0
- package/lib/table.d.ts +10 -10
- package/lib/tabs.d.ts +13 -12
- package/lib/tag.d.ts +9 -9
- package/lib/task-queue.d.ts +24 -24
- package/lib/tooltip.d.ts +13 -13
- package/lib/translations.d.ts +130 -125
- package/lib/wizard-substep-condition.d.ts +6 -6
- package/lib/z-strata.d.ts +7 -7
- package/package.json +15 -13
- package/tsconfig.json +1 -1
- package/vite.config.js +20 -0
- package/lib/index.esm.js +0 -540
- package/rollup.config.js +0 -24
package/lib/bar-chart.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export interface ChartDataObject {
|
|
2
|
-
label: string;
|
|
3
|
-
value: number;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Used for the Y and X axis for bar charts.
|
|
7
|
-
* The Y axis uses tickCount but the X axis does not
|
|
8
|
-
*/
|
|
9
|
-
export interface ChartAxis {
|
|
10
|
-
tickValues: any;
|
|
11
|
-
tickCount?: number;
|
|
12
|
-
}
|
|
1
|
+
export interface ChartDataObject {
|
|
2
|
+
label: string;
|
|
3
|
+
value: number;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Used for the Y and X axis for bar charts.
|
|
7
|
+
* The Y axis uses tickCount but the X axis does not
|
|
8
|
+
*/
|
|
9
|
+
export interface ChartAxis {
|
|
10
|
+
tickValues: any;
|
|
11
|
+
tickCount?: number;
|
|
12
|
+
}
|
package/lib/button.d.ts
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
export declare enum StdButtonKind {
|
|
2
|
-
DEFAULT = "default",
|
|
3
|
-
CONFIRM = "confirm",
|
|
4
|
-
DELETE = "delete",
|
|
5
|
-
KEY = "key"
|
|
6
|
-
}
|
|
7
|
-
declare enum ButtonKindIcon {
|
|
8
|
-
ICON = "icon"
|
|
9
|
-
}
|
|
10
|
-
declare enum ButtonKindLink {
|
|
11
|
-
LINK = "link"
|
|
12
|
-
}
|
|
13
|
-
export declare type DropdownKind = StdButtonKind | ButtonKindIcon;
|
|
14
|
-
export declare const DropdownKind: Readonly<{
|
|
15
|
-
ICON: ButtonKindIcon.ICON;
|
|
16
|
-
DEFAULT: StdButtonKind.DEFAULT;
|
|
17
|
-
CONFIRM: StdButtonKind.CONFIRM;
|
|
18
|
-
DELETE: StdButtonKind.DELETE;
|
|
19
|
-
KEY: StdButtonKind.KEY;
|
|
20
|
-
}>;
|
|
21
|
-
export declare type ButtonKind = StdButtonKind | ButtonKindIcon | ButtonKindLink;
|
|
22
|
-
export declare const ButtonKind: Readonly<{
|
|
23
|
-
LINK: ButtonKindLink.LINK;
|
|
24
|
-
ICON: ButtonKindIcon.ICON;
|
|
25
|
-
DEFAULT: StdButtonKind.DEFAULT;
|
|
26
|
-
CONFIRM: StdButtonKind.CONFIRM;
|
|
27
|
-
DELETE: StdButtonKind.DELETE;
|
|
28
|
-
KEY: StdButtonKind.KEY;
|
|
29
|
-
}>;
|
|
30
|
-
export declare enum ButtonType {
|
|
31
|
-
BUTTON = "button",
|
|
32
|
-
SUBMIT = "submit"
|
|
33
|
-
}
|
|
34
|
-
export {};
|
|
1
|
+
export declare enum StdButtonKind {
|
|
2
|
+
DEFAULT = "default",
|
|
3
|
+
CONFIRM = "confirm",
|
|
4
|
+
DELETE = "delete",
|
|
5
|
+
KEY = "key"
|
|
6
|
+
}
|
|
7
|
+
declare enum ButtonKindIcon {
|
|
8
|
+
ICON = "icon"
|
|
9
|
+
}
|
|
10
|
+
declare enum ButtonKindLink {
|
|
11
|
+
LINK = "link"
|
|
12
|
+
}
|
|
13
|
+
export declare type DropdownKind = StdButtonKind | ButtonKindIcon;
|
|
14
|
+
export declare const DropdownKind: Readonly<{
|
|
15
|
+
ICON: ButtonKindIcon.ICON;
|
|
16
|
+
DEFAULT: StdButtonKind.DEFAULT;
|
|
17
|
+
CONFIRM: StdButtonKind.CONFIRM;
|
|
18
|
+
DELETE: StdButtonKind.DELETE;
|
|
19
|
+
KEY: StdButtonKind.KEY;
|
|
20
|
+
}>;
|
|
21
|
+
export declare type ButtonKind = StdButtonKind | ButtonKindIcon | ButtonKindLink;
|
|
22
|
+
export declare const ButtonKind: Readonly<{
|
|
23
|
+
LINK: ButtonKindLink.LINK;
|
|
24
|
+
ICON: ButtonKindIcon.ICON;
|
|
25
|
+
DEFAULT: StdButtonKind.DEFAULT;
|
|
26
|
+
CONFIRM: StdButtonKind.CONFIRM;
|
|
27
|
+
DELETE: StdButtonKind.DELETE;
|
|
28
|
+
KEY: StdButtonKind.KEY;
|
|
29
|
+
}>;
|
|
30
|
+
export declare enum ButtonType {
|
|
31
|
+
BUTTON = "button",
|
|
32
|
+
SUBMIT = "submit"
|
|
33
|
+
}
|
|
34
|
+
export {};
|
package/lib/clickable-tag.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare enum ClickableTagKind {
|
|
2
|
-
BLUE = "blue",
|
|
3
|
-
GRAY = "gray"
|
|
4
|
-
}
|
|
1
|
+
export declare enum ClickableTagKind {
|
|
2
|
+
BLUE = "blue",
|
|
3
|
+
GRAY = "gray"
|
|
4
|
+
}
|
package/lib/datetime.d.ts
CHANGED
|
@@ -1,34 +1,36 @@
|
|
|
1
|
-
import { Duration, Moment } from
|
|
2
|
-
export interface MomentRange {
|
|
3
|
-
start: Moment;
|
|
4
|
-
end: Moment;
|
|
5
|
-
preset?: Duration;
|
|
6
|
-
}
|
|
7
|
-
export interface SimpleDate {
|
|
8
|
-
year: number;
|
|
9
|
-
month: number;
|
|
10
|
-
date: number;
|
|
11
|
-
}
|
|
12
|
-
export declare type SimpleDateRange = [SimpleDate, SimpleDate];
|
|
13
|
-
export declare enum SelectMode {
|
|
14
|
-
START = 0,
|
|
15
|
-
END = 1
|
|
16
|
-
}
|
|
17
|
-
export interface DateSelectionEvent<T = Moment | MomentRange> {
|
|
18
|
-
value: T;
|
|
19
|
-
mode: SelectMode;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* [
|
|
26
|
-
* [
|
|
27
|
-
* [
|
|
28
|
-
*
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
export
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
import type { Duration, Moment } from "moment-timezone";
|
|
2
|
+
export interface MomentRange {
|
|
3
|
+
start: Moment;
|
|
4
|
+
end: Moment;
|
|
5
|
+
preset?: Duration;
|
|
6
|
+
}
|
|
7
|
+
export interface SimpleDate {
|
|
8
|
+
year: number;
|
|
9
|
+
month: number;
|
|
10
|
+
date: number;
|
|
11
|
+
}
|
|
12
|
+
export declare type SimpleDateRange = [SimpleDate, SimpleDate];
|
|
13
|
+
export declare enum SelectMode {
|
|
14
|
+
START = 0,
|
|
15
|
+
END = 1
|
|
16
|
+
}
|
|
17
|
+
export interface DateSelectionEvent<T = Moment | MomentRange> {
|
|
18
|
+
value: T;
|
|
19
|
+
mode: SelectMode;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A list of lists representing the weeks and
|
|
23
|
+
* days of a month, e.g.
|
|
24
|
+
* [ [ , , 1, 2, 3, 4, 5 ],
|
|
25
|
+
* [ 6, 7, 8, 9, 10, 11, 12 ],
|
|
26
|
+
* [ 13, 14, 15, 16, 17, 18, 19 ],
|
|
27
|
+
* [ 20, 21, 22, 23, 24, 25, 26 ],
|
|
28
|
+
* [ 27, 28, 29, 30, , , ] ]
|
|
29
|
+
* but where each number is a SimpleDate object
|
|
30
|
+
*/
|
|
31
|
+
export declare type CalendarArray = ReadonlyArray<readonly SimpleDate[]>;
|
|
32
|
+
export declare type ISO8601String = string;
|
|
33
|
+
export interface DatePreset {
|
|
34
|
+
label: string;
|
|
35
|
+
definition: ISO8601String | (() => SimpleDateRange);
|
|
36
|
+
}
|
package/lib/examples.d.ts
CHANGED
|
@@ -1,47 +1,41 @@
|
|
|
1
|
-
import { ReactElement } from
|
|
2
|
-
export
|
|
3
|
-
naviagateTo: (selection: string) => void;
|
|
4
|
-
NavigateTo: (props: {
|
|
5
|
-
to: string;
|
|
6
|
-
children: ReactElement | string;
|
|
7
|
-
slugPrefix?: string;
|
|
8
|
-
}) => ReactElement;
|
|
9
|
-
Link: (props: {
|
|
10
|
-
to: string;
|
|
11
|
-
children: ReactElement | string;
|
|
12
|
-
}) => ReactElement;
|
|
13
|
-
}
|
|
14
|
-
declare type ReactChildOrRenderer = ReactElement | string | ((args: ExtraExampleRendererArgs) => ReactElement | string);
|
|
15
|
-
export interface DSExampleBase {
|
|
16
|
-
description?: ReactChildOrRenderer;
|
|
17
|
-
}
|
|
18
|
-
export interface DSReactExampleJSX {
|
|
19
|
-
jsx: string;
|
|
20
|
-
}
|
|
21
|
-
export interface DSReactExampleComponent {
|
|
22
|
-
react: string;
|
|
23
|
-
}
|
|
24
|
-
export declare type DSReactExample = DSExampleBase & (DSReactExampleComponent | DSReactExampleJSX);
|
|
25
|
-
export declare type DSExample = DSReactExample;
|
|
26
|
-
export declare function exampleIsReactComponentExample(example: DSExample): example is DSReactExampleComponent;
|
|
27
|
-
export declare function exampleIsReactJSXExample(example: DSExample): example is DSReactExampleJSX;
|
|
28
|
-
export interface DSExamplesTab<T extends DSExample = DSExample> {
|
|
29
|
-
label?: ReactChildOrRenderer;
|
|
30
|
-
description?: ReactChildOrRenderer;
|
|
31
|
-
customSection?: ReactChildOrRenderer;
|
|
32
|
-
examples?:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
export
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
description?: ReactChildOrRenderer;
|
|
43
|
-
components: Array<any>;
|
|
44
|
-
examples: DSReactExamples;
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
export {};
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
export interface ExtraExampleRendererArgs {
|
|
3
|
+
naviagateTo: (selection: string) => void;
|
|
4
|
+
NavigateTo: (props: {
|
|
5
|
+
to: string;
|
|
6
|
+
children: ReactElement | string;
|
|
7
|
+
slugPrefix?: string;
|
|
8
|
+
}) => ReactElement;
|
|
9
|
+
Link: (props: {
|
|
10
|
+
to: string;
|
|
11
|
+
children: ReactElement | string;
|
|
12
|
+
}) => ReactElement;
|
|
13
|
+
}
|
|
14
|
+
declare type ReactChildOrRenderer = ReactElement | string | ((args: ExtraExampleRendererArgs) => ReactElement | string);
|
|
15
|
+
export interface DSExampleBase {
|
|
16
|
+
description?: ReactChildOrRenderer;
|
|
17
|
+
}
|
|
18
|
+
export interface DSReactExampleJSX {
|
|
19
|
+
jsx: string;
|
|
20
|
+
}
|
|
21
|
+
export interface DSReactExampleComponent {
|
|
22
|
+
react: string;
|
|
23
|
+
}
|
|
24
|
+
export declare type DSReactExample = DSExampleBase & (DSReactExampleComponent | DSReactExampleJSX);
|
|
25
|
+
export declare type DSExample = DSReactExample;
|
|
26
|
+
export declare function exampleIsReactComponentExample(example: DSExample): example is DSReactExampleComponent;
|
|
27
|
+
export declare function exampleIsReactJSXExample(example: DSExample): example is DSReactExampleJSX;
|
|
28
|
+
export interface DSExamplesTab<T extends DSExample = DSExample> {
|
|
29
|
+
label?: ReactChildOrRenderer;
|
|
30
|
+
description?: ReactChildOrRenderer;
|
|
31
|
+
customSection?: ReactChildOrRenderer;
|
|
32
|
+
examples?: Record<string, T>;
|
|
33
|
+
}
|
|
34
|
+
export declare type DSExamples<T extends DSExample = DSExample> = Record<string, DSExamplesTab<T>>;
|
|
35
|
+
export declare type DSReactExamples = DSExamples<DSReactExample>;
|
|
36
|
+
export declare type ComponentManifest = Record<string, {
|
|
37
|
+
description?: ReactChildOrRenderer;
|
|
38
|
+
components: unknown[];
|
|
39
|
+
examples: DSReactExamples;
|
|
40
|
+
}>;
|
|
41
|
+
export {};
|
package/lib/feedback.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { SpsIcon } from
|
|
2
|
-
export declare enum FeedbackBlockKind {
|
|
3
|
-
TIP = "tip",
|
|
4
|
-
SUCCESS = "success",
|
|
5
|
-
WARNING = "warning",
|
|
6
|
-
ERROR = "error",
|
|
7
|
-
INFO = "info"
|
|
8
|
-
}
|
|
9
|
-
export declare const FeedbackBlockIcons: Readonly<{
|
|
10
|
-
tip: SpsIcon;
|
|
11
|
-
error: SpsIcon;
|
|
12
|
-
info: SpsIcon;
|
|
13
|
-
success: SpsIcon;
|
|
14
|
-
warning: SpsIcon;
|
|
15
|
-
}>;
|
|
1
|
+
import { SpsIcon } from "./icon";
|
|
2
|
+
export declare enum FeedbackBlockKind {
|
|
3
|
+
TIP = "tip",
|
|
4
|
+
SUCCESS = "success",
|
|
5
|
+
WARNING = "warning",
|
|
6
|
+
ERROR = "error",
|
|
7
|
+
INFO = "info"
|
|
8
|
+
}
|
|
9
|
+
export declare const FeedbackBlockIcons: Readonly<{
|
|
10
|
+
tip: SpsIcon;
|
|
11
|
+
error: SpsIcon;
|
|
12
|
+
info: SpsIcon;
|
|
13
|
+
success: SpsIcon;
|
|
14
|
+
warning: SpsIcon;
|
|
15
|
+
}>;
|
package/lib/grid.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/** Allowable values for the width of an element in our 12-column layout grid. */
|
|
2
|
-
export declare type GridWidth = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
1
|
+
/** Allowable values for the width of an element in our 12-column layout grid. */
|
|
2
|
+
export declare type GridWidth = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
package/lib/growler.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { SpsIcon } from
|
|
2
|
-
export declare const GROWLER_VISIBLE_DURATION_MS = 7000;
|
|
3
|
-
export declare const GROWLER_FADEOUT_DURATION_MS = 2000;
|
|
4
|
-
export declare enum GrowlerKind {
|
|
5
|
-
ACTIVITY = "activity",
|
|
6
|
-
ERROR = "error",
|
|
7
|
-
INFO = "info",
|
|
8
|
-
PROGRESS = "progress",
|
|
9
|
-
SUCCESS = "success",
|
|
10
|
-
WARNING = "warning"
|
|
11
|
-
}
|
|
12
|
-
export declare const GrowlerIcon: Map<GrowlerKind, SpsIcon>;
|
|
1
|
+
import { SpsIcon } from "./icon";
|
|
2
|
+
export declare const GROWLER_VISIBLE_DURATION_MS = 7000;
|
|
3
|
+
export declare const GROWLER_FADEOUT_DURATION_MS = 2000;
|
|
4
|
+
export declare enum GrowlerKind {
|
|
5
|
+
ACTIVITY = "activity",
|
|
6
|
+
ERROR = "error",
|
|
7
|
+
INFO = "info",
|
|
8
|
+
PROGRESS = "progress",
|
|
9
|
+
SUCCESS = "success",
|
|
10
|
+
WARNING = "warning"
|
|
11
|
+
}
|
|
12
|
+
export declare const GrowlerIcon: Map<GrowlerKind, SpsIcon>;
|
package/lib/i18n.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface I18nObject {
|
|
2
|
-
t(key: string, interpolations?: any)
|
|
3
|
-
}
|
|
4
|
-
export declare const noI18nI18n: I18nObject;
|
|
1
|
+
export interface I18nObject {
|
|
2
|
+
t: (key: string, interpolations?: any) => string;
|
|
3
|
+
}
|
|
4
|
+
export declare const noI18nI18n: I18nObject;
|