@narmi/design_system 6.16.12 → 6.16.13
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/dist/index.js +25 -25
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/style.css.map +1 -1
- package/dist/tokens/css/rgbColors.css +1 -1
- package/dist/tokens/css/rgbColors.scss +1 -1
- package/dist/tokens/css/tokens.css +1 -1
- package/dist/tokens/css/tokens.scss +1 -1
- package/dist/tokens/js/colors.esm.js +1 -1
- package/dist/tokens/js/colors.js +1 -1
- package/dist/tokens/js/manifest.esm.js +1 -1
- package/dist/tokens/js/manifest.js +1 -1
- package/dist/tokens/js/reactNativeWeb.js +1 -1
- package/dist/types/Tabs/TabsList.d.ts.map +1 -1
- package/dist/types/Tabs/TabsPanel.d.ts.map +1 -1
- package/dist/types/hooks/useDropdownLayer/index.d.ts +1 -1
- package/dist/types/hooks/useDropdownLayer/index.d.ts.map +1 -1
- package/dist/types/hooks/useDropdownLayer/useAnchorPolyfill.d.ts +14 -3
- package/dist/types/hooks/useDropdownLayer/useAnchorPolyfill.d.ts.map +1 -1
- package/dist/types/hooks/useSupportsAnchorPositioning/index.d.ts +2 -12
- package/dist/types/hooks/useSupportsAnchorPositioning/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/types/Error/index.d.ts +0 -20
- package/dist/types/Error/index.d.ts.map +0 -1
- package/dist/types/Field/FauxInput/index.d.ts +0 -20
- package/dist/types/Field/FauxInput/index.d.ts.map +0 -1
- package/dist/types/Field/Select/SelectItem.d.ts +0 -15
- package/dist/types/Field/Select/SelectItem.d.ts.map +0 -1
- package/dist/types/Field/Select/index.d.ts +0 -24
- package/dist/types/Field/Select/index.d.ts.map +0 -1
- package/dist/types/Field/Text/index.d.ts +0 -14
- package/dist/types/Field/Text/index.d.ts.map +0 -1
- package/dist/types/FieldToken/index.d.ts +0 -23
- package/dist/types/FieldToken/index.d.ts.map +0 -1
- package/dist/types/FormSection/index.d.ts +0 -21
- package/dist/types/FormSection/index.d.ts.map +0 -1
- package/dist/types/IconButton/index.d.ts +0 -72
- package/dist/types/IconButton/index.d.ts.map +0 -1
- package/dist/types/LoadingShim/index.d.ts +0 -31
- package/dist/types/LoadingShim/index.d.ts.map +0 -1
- package/dist/types/Pagination/index.d.ts +0 -69
- package/dist/types/Pagination/index.d.ts.map +0 -1
- package/dist/types/Pagination/usePagination.d.ts +0 -39
- package/dist/types/Pagination/usePagination.d.ts.map +0 -1
- package/dist/types/ResponsiveFlex/index.d.ts +0 -52
- package/dist/types/ResponsiveFlex/index.d.ts.map +0 -1
- package/dist/types/Table/util/pinning.d.ts +0 -7
- package/dist/types/Table/util/pinning.d.ts.map +0 -1
- package/dist/types/TimelineEvent/index.d.ts +0 -75
- package/dist/types/TimelineEvent/index.d.ts.map +0 -1
- package/dist/types/Toggle/index.d.ts +0 -40
- package/dist/types/Toggle/index.d.ts.map +0 -1
- package/dist/types/formatters/formatDate.d.ts +0 -17
- package/dist/types/formatters/formatDate.d.ts.map +0 -1
- package/dist/types/formatters/formatNumber.d.ts +0 -22
- package/dist/types/formatters/formatNumber.d.ts.map +0 -1
- package/dist/types/hooks/useDropdownLayer/useDropdownMaxHeight.d.ts +0 -19
- package/dist/types/hooks/useDropdownLayer/useDropdownMaxHeight.d.ts.map +0 -1
- package/dist/types/hooks/useLockBodyScroll/index.d.ts +0 -7
- package/dist/types/hooks/useLockBodyScroll/index.d.ts.map +0 -1
- package/dist/types/util/AsElement.d.ts +0 -44
- package/dist/types/util/AsElement.d.ts.map +0 -1
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { default as PropTypes } from 'prop-types';
|
|
3
|
-
export interface LoadingShimProps {
|
|
4
|
-
/** Loadable content area - will render normally unless `isLoading` is true */
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
/** When `true`, the loading shim appears over child content */
|
|
7
|
-
isLoading?: boolean;
|
|
8
|
-
/** Optional value for `data-testid` attribute */
|
|
9
|
-
testId?: string;
|
|
10
|
-
/** Size of the loading indicator */
|
|
11
|
-
size?: "s" | "l";
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Used to wrap a block of loadable content. When `isLoading` is set to true,
|
|
15
|
-
* the content area will have an overlay and loading animation.
|
|
16
|
-
*/
|
|
17
|
-
declare const LoadingShim: {
|
|
18
|
-
({ isLoading, children, testId, size, }: LoadingShimProps): React.JSX.Element;
|
|
19
|
-
propTypes: {
|
|
20
|
-
/** Loadable content area - will render normally unless `isLoading` is true */
|
|
21
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
22
|
-
/** When `true`, the loading shim appears over child content */
|
|
23
|
-
isLoading: PropTypes.Requireable<boolean>;
|
|
24
|
-
/** Optional value for `data-testid` attribute */
|
|
25
|
-
testId: PropTypes.Requireable<string>;
|
|
26
|
-
/** Size of the loading indicator */
|
|
27
|
-
size: PropTypes.Requireable<string>;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
export default LoadingShim;
|
|
31
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/LoadingShim/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AAGnC,MAAM,WAAW,gBAAgB;IAC/B,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,+DAA+D;IAC/D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC;CAClB;AAED;;;GAGG;AACH,QAAA,MAAM,WAAW;6CAKd,gBAAgB;;QAgCjB,8EAA8E;;QAE9E,+DAA+D;;QAE/D,iDAAiD;;QAEjD,oCAAoC;;;CATrC,CAAC;AAaF,eAAe,WAAW,CAAC"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { default as PropTypes } from 'prop-types';
|
|
3
|
-
export interface PaginationProps {
|
|
4
|
-
/**
|
|
5
|
-
* Total number of pages
|
|
6
|
-
* If the number of pages is 1, pagination will not render
|
|
7
|
-
*/
|
|
8
|
-
totalPages?: number;
|
|
9
|
-
/**
|
|
10
|
-
* Default selected page by page number (uncontrolled)
|
|
11
|
-
*/
|
|
12
|
-
defaultSelectedPage?: number;
|
|
13
|
-
/**
|
|
14
|
-
* Selected page by page number (controlled).
|
|
15
|
-
* In fully controlled mode, you **must** define an `onPageChange`
|
|
16
|
-
* handler to update the value of the `selectedPage` prop.
|
|
17
|
-
*/
|
|
18
|
-
selectedPage?: number;
|
|
19
|
-
/**
|
|
20
|
-
* Callback invoked when user selects a new page via page numbers or
|
|
21
|
-
* previous/next arrows.
|
|
22
|
-
*
|
|
23
|
-
* Invoked with selected page number as the argument.
|
|
24
|
-
*/
|
|
25
|
-
onPageChange?: (page: number) => void;
|
|
26
|
-
/** Optional value for `data-testid` attribute */
|
|
27
|
-
testId?: string;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Component that allows users to navigate between pages of information.
|
|
31
|
-
* Your application is responsible for setting the total number of pages and
|
|
32
|
-
* responding to the `onPageChange` callback.
|
|
33
|
-
*
|
|
34
|
-
* The component will handle which page numbers to render, next and previous arrows,
|
|
35
|
-
* and conditionally rendering first and last pages.
|
|
36
|
-
*
|
|
37
|
-
* If your pagination setup expects a fully controlled component, you may set `defaultSelectedPage` on every `onPageChange` call.
|
|
38
|
-
*/
|
|
39
|
-
declare const Pagination: {
|
|
40
|
-
({ onPageChange, totalPages, defaultSelectedPage, selectedPage: selectedPageControlled, testId, }: PaginationProps): React.JSX.Element;
|
|
41
|
-
propTypes: {
|
|
42
|
-
/**
|
|
43
|
-
* Total number of pages
|
|
44
|
-
* If the number of pages is 1, pagination will not render
|
|
45
|
-
*/
|
|
46
|
-
totalPages: PropTypes.Requireable<number>;
|
|
47
|
-
/**
|
|
48
|
-
* Default selected page by page number (uncontrolled)
|
|
49
|
-
*/
|
|
50
|
-
defaultSelectedPage: PropTypes.Requireable<number>;
|
|
51
|
-
/**
|
|
52
|
-
* Selected page by page number (controlled).
|
|
53
|
-
* In fully controlled mode, you **must** define an `onPageChange`
|
|
54
|
-
* handler to update the value of the `selectedPage` prop.
|
|
55
|
-
*/
|
|
56
|
-
selectedPage: PropTypes.Requireable<number>;
|
|
57
|
-
/**
|
|
58
|
-
* Callback invoked when user selects a new page via page numbers or
|
|
59
|
-
* previous/next arrows.
|
|
60
|
-
*
|
|
61
|
-
* Invoked with selected page number as the argument.
|
|
62
|
-
*/
|
|
63
|
-
onPageChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
64
|
-
/** Optional value for `data-testid` attribute */
|
|
65
|
-
testId: PropTypes.Requireable<string>;
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
export default Pagination;
|
|
69
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Pagination/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,SAAS,MAAM,YAAY,CAAC;AAMnC,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;GASG;AACH,QAAA,MAAM,UAAU;uGAMb,eAAe;;QAmMhB;;;WAGG;;QAEH;;WAEG;;QAEH;;;;WAIG;;QAEH;;;;;WAKG;;QAEH,iDAAiD;;;CAzBlD,CAAC;AA6BF,eAAe,UAAU,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
interface UsePaginationOptions {
|
|
2
|
-
/** The total number of pages */
|
|
3
|
-
totalPages: number;
|
|
4
|
-
/** The selected page by page number */
|
|
5
|
-
selectedPageNumber?: number;
|
|
6
|
-
/** The size of the visible window of pages */
|
|
7
|
-
windowSize?: number;
|
|
8
|
-
}
|
|
9
|
-
type UsePaginationResult = {
|
|
10
|
-
/** List of visible pages by page number */
|
|
11
|
-
visiblePages: number[];
|
|
12
|
-
/** The page number of the currently selected page */
|
|
13
|
-
selectedPage: number;
|
|
14
|
-
/** The index of the currently selected page */
|
|
15
|
-
selectedIndex: number;
|
|
16
|
-
/** Whether to show the first page button */
|
|
17
|
-
showFirstPage: boolean;
|
|
18
|
-
/** Whether to show the last page button */
|
|
19
|
-
showLastPage: boolean;
|
|
20
|
-
/** Whether to show previous arrow */
|
|
21
|
-
showPrev: boolean;
|
|
22
|
-
/** Whether to show next arrow */
|
|
23
|
-
showNext: boolean;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* Create an array of consecutive numbers from start to end (inclusive)
|
|
27
|
-
*/
|
|
28
|
-
export declare const range: (start: number, end: number) => number[];
|
|
29
|
-
/**
|
|
30
|
-
* Calculate the sliding window of visible pages
|
|
31
|
-
*/
|
|
32
|
-
export declare const calculateVisiblePages: (totalPages: number, selectedPage: number, windowSize: number) => number[];
|
|
33
|
-
/**
|
|
34
|
-
* Headless hook for pagination attributes.
|
|
35
|
-
* Creates a sliding window of visible pages with current selection centered.
|
|
36
|
-
*/
|
|
37
|
-
export declare const usePagination: ({ totalPages, selectedPageNumber, windowSize, }: UsePaginationOptions) => UsePaginationResult;
|
|
38
|
-
export {};
|
|
39
|
-
//# sourceMappingURL=usePagination.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usePagination.d.ts","sourceRoot":"","sources":["../../../src/Pagination/usePagination.ts"],"names":[],"mappings":"AAIA,UAAU,oBAAoB;IAC5B,gCAAgC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,8CAA8C;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,KAAK,mBAAmB,GAAG;IACzB,2CAA2C;IAC3C,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,qDAAqD;IACrD,YAAY,EAAE,MAAM,CAAC;IACrB,+CAA+C;IAC/C,aAAa,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,aAAa,EAAE,OAAO,CAAC;IACvB,2CAA2C;IAC3C,YAAY,EAAE,OAAO,CAAC;IACtB,qCAAqC;IACrC,QAAQ,EAAE,OAAO,CAAC;IAClB,iCAAiC;IACjC,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,KAAK,GAAI,OAAO,MAAM,EAAE,KAAK,MAAM,KAAG,MAAM,EACH,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAChC,YAAY,MAAM,EAClB,cAAc,MAAM,EACpB,YAAY,MAAM,KACjB,MAAM,EA4BR,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,iDAI3B,oBAAoB,KAAG,mBA0BzB,CAAC"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { default as PropTypes } from 'prop-types';
|
|
3
|
-
/** Standard Narmi breakpoint names */
|
|
4
|
-
export type ResponsiveFlexSize = "s" | "m" | "l" | "xl";
|
|
5
|
-
export type ResponsiveFlexGap = "xs" | "s" | "m" | "l" | "xl";
|
|
6
|
-
export type ResponsiveFlexDirection = "row" | "column";
|
|
7
|
-
export type FlexDirection = ResponsiveFlexDirection | "row-reverse" | "column-reverse";
|
|
8
|
-
export interface GetFlexDirectionArgs {
|
|
9
|
-
viewportMatches: Record<ResponsiveFlexSize, boolean>;
|
|
10
|
-
direction: ResponsiveFlexDirection;
|
|
11
|
-
toColumnAt?: ResponsiveFlexSize;
|
|
12
|
-
toRowAt?: ResponsiveFlexSize;
|
|
13
|
-
reverseAt?: ResponsiveFlexSize;
|
|
14
|
-
}
|
|
15
|
-
export declare const getFlexDirection: ({ viewportMatches, direction, toColumnAt, toRowAt, reverseAt, }: GetFlexDirectionArgs) => FlexDirection;
|
|
16
|
-
export interface ResponsiveFlexProps {
|
|
17
|
-
/** Implicit flex children */
|
|
18
|
-
children?: React.ReactNode;
|
|
19
|
-
/** Size of flex gap by token size (e.g. "xl") */
|
|
20
|
-
gapSize?: ResponsiveFlexGap;
|
|
21
|
-
/** Initial flex direction */
|
|
22
|
-
direction?: ResponsiveFlexDirection;
|
|
23
|
-
/** Breakpoint at which to reverse order of flex items */
|
|
24
|
-
reverseAt?: ResponsiveFlexSize;
|
|
25
|
-
/** Breakpoint at which to change flex direction to column */
|
|
26
|
-
toColumnAt?: ResponsiveFlexSize;
|
|
27
|
-
/** Breakpoint at which to change flex direction to row */
|
|
28
|
-
toRowAt?: ResponsiveFlexSize;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Responsive layout helper that allows developers to declaratively control
|
|
32
|
-
* how flex items behave at different standard viewport sizes.
|
|
33
|
-
*/
|
|
34
|
-
declare const ResponsiveFlex: {
|
|
35
|
-
({ children, direction, gapSize, reverseAt, toColumnAt, toRowAt, }: ResponsiveFlexProps): React.JSX.Element;
|
|
36
|
-
propTypes: {
|
|
37
|
-
/** Implicit flex children */
|
|
38
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike[]>;
|
|
39
|
-
/** Size of flex gap by token size (e.g. "xl") */
|
|
40
|
-
gapSize: PropTypes.Requireable<string>;
|
|
41
|
-
/** Initial flex direction */
|
|
42
|
-
direction: PropTypes.Requireable<string>;
|
|
43
|
-
/** Breakpoint at which to reverse order of flex items */
|
|
44
|
-
reverseAt: PropTypes.Requireable<string>;
|
|
45
|
-
/** Breakpoint at which to change flex direction to column */
|
|
46
|
-
toColumnAt: PropTypes.Requireable<string>;
|
|
47
|
-
/** Breakpoint at which to change flex direction to row */
|
|
48
|
-
toRowAt: PropTypes.Requireable<string>;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
export default ResponsiveFlex;
|
|
52
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ResponsiveFlex/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AAOnC,sCAAsC;AACtC,MAAM,MAAM,kBAAkB,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AACxD,MAAM,MAAM,iBAAiB,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AAC9D,MAAM,MAAM,uBAAuB,GAAG,KAAK,GAAG,QAAQ,CAAC;AACvD,MAAM,MAAM,aAAa,GACrB,uBAAuB,GACvB,aAAa,GACb,gBAAgB,CAAC;AAErB,MAAM,WAAW,oBAAoB;IACnC,eAAe,EAAE,MAAM,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;IACrD,SAAS,EAAE,uBAAuB,CAAC;IACnC,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,SAAS,CAAC,EAAE,kBAAkB,CAAC;CAChC;AAED,eAAO,MAAM,gBAAgB,GAAI,iEAM9B,oBAAoB,KAAG,aAiBzB,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,iDAAiD;IACjD,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,8BAA8B;IAC9B,SAAS,CAAC,EAAE,uBAAuB,CAAC;IACpC,yDAAyD;IACzD,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,6DAA6D;IAC7D,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,0DAA0D;IAC1D,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B;AAED;;;GAGG;AACH,QAAA,MAAM,cAAc;wEAOjB,mBAAmB;;QAyBpB,6BAA6B;;QAE7B,iDAAiD;;QAEjD,8BAA8B;;QAE9B,yDAAyD;;QAEzD,6DAA6D;;QAE7D,0DAA0D;;;CAb3D,CAAC;AAiBF,eAAe,cAAc,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ColVisibilityContextProps } from './colVisibilityContext';
|
|
2
|
-
export type PinStatus = "start" | "end" | undefined;
|
|
3
|
-
/**
|
|
4
|
-
* Determines if a cell at a given column index is pinned.
|
|
5
|
-
*/
|
|
6
|
-
export declare function getPinStatus(colIndex: number, ctx: ColVisibilityContextProps): PinStatus;
|
|
7
|
-
//# sourceMappingURL=pinning.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pinning.d.ts","sourceRoot":"","sources":["../../../../src/Table/util/pinning.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAExE,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,KAAK,GAAG,SAAS,CAAC;AAEpD;;GAEG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,yBAAyB,GAC7B,SAAS,CAMX"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { default as PropTypes } from 'prop-types';
|
|
3
|
-
import { VALID_ICON_NAMES } from '../icons/iconNames';
|
|
4
|
-
import { IconName } from '../types/Icon.types';
|
|
5
|
-
export { VALID_ICON_NAMES };
|
|
6
|
-
export type TimelineEventKind = "node" | "start" | "pending";
|
|
7
|
-
export interface TimelineEventProps {
|
|
8
|
-
/**
|
|
9
|
-
* Timeline node variant.
|
|
10
|
-
*/
|
|
11
|
-
kind?: TimelineEventKind;
|
|
12
|
-
/**
|
|
13
|
-
* Name of NDS icon to render inside the timeline node
|
|
14
|
-
*/
|
|
15
|
-
icon?: IconName;
|
|
16
|
-
/**
|
|
17
|
-
* Pass an image url to render the timeline node
|
|
18
|
-
* as an avatar
|
|
19
|
-
*/
|
|
20
|
-
imgUrl?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Initial to render in the timeline node
|
|
23
|
-
* Overridden by:
|
|
24
|
-
* - icon
|
|
25
|
-
* - imgUrl
|
|
26
|
-
*/
|
|
27
|
-
initial?: string;
|
|
28
|
-
/**
|
|
29
|
-
* Timeline event content (any JSX)
|
|
30
|
-
*/
|
|
31
|
-
children?: React.ReactNode;
|
|
32
|
-
/**
|
|
33
|
-
* Hover tooltip content for the icon
|
|
34
|
-
*/
|
|
35
|
-
tooltip?: string;
|
|
36
|
-
/** Render a custom circle node on the line */
|
|
37
|
-
renderNode?: () => React.ReactNode;
|
|
38
|
-
}
|
|
39
|
-
declare const TimelineEvent: {
|
|
40
|
-
({ kind, icon, imgUrl, initial, tooltip, children, renderNode, }: TimelineEventProps): React.JSX.Element;
|
|
41
|
-
propTypes: {
|
|
42
|
-
/**
|
|
43
|
-
* Timeline node variant.
|
|
44
|
-
*/
|
|
45
|
-
kind: PropTypes.Requireable<string>;
|
|
46
|
-
/**
|
|
47
|
-
* Name of NDS icon to render inside the timeline node
|
|
48
|
-
*/
|
|
49
|
-
icon: PropTypes.Requireable<string>;
|
|
50
|
-
/**
|
|
51
|
-
* Pass an image url to render the timeline node
|
|
52
|
-
* as an avatar
|
|
53
|
-
*/
|
|
54
|
-
imgUrl: PropTypes.Requireable<string>;
|
|
55
|
-
/**
|
|
56
|
-
* Initial to render in the timeline node
|
|
57
|
-
* Overridden by:
|
|
58
|
-
* - icon
|
|
59
|
-
* - imgUrl
|
|
60
|
-
*/
|
|
61
|
-
initial: PropTypes.Requireable<string>;
|
|
62
|
-
/**
|
|
63
|
-
* Timeline event content (any JSX)
|
|
64
|
-
*/
|
|
65
|
-
children: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
66
|
-
/**
|
|
67
|
-
* Hover tooltip content for the icon
|
|
68
|
-
*/
|
|
69
|
-
tooltip: PropTypes.Requireable<string>;
|
|
70
|
-
/** Render a custom circle node on the line */
|
|
71
|
-
renderNode: PropTypes.Requireable<(...args: any[]) => any>;
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
export default TimelineEvent;
|
|
75
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/TimelineEvent/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAE7D,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;CACpC;AAED,QAAA,MAAM,aAAa;sEAQhB,kBAAkB;;QAmEnB;;WAEG;;QAEH;;WAEG;;QAEH;;;WAGG;;QAEH;;;;;WAKG;;QAEH;;WAEG;;QAKH;;WAEG;;QAEH,8CAA8C;;;CAlC/C,CAAC;AAsCF,eAAe,aAAa,CAAC"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
export interface ToggleProps {
|
|
3
|
-
/**
|
|
4
|
-
* Callback invoked with current active state (bool) as the function argument
|
|
5
|
-
* when user changes the active state of the Toggle
|
|
6
|
-
*/
|
|
7
|
-
onChange?: (isActive: boolean) => void;
|
|
8
|
-
/** When set to `true`, the toggle will initially render as active */
|
|
9
|
-
defaultActive?: boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Sets active state of toggle; makes the component fully controlled.
|
|
12
|
-
* When using `isActive` you **must** use the `onChange` callback
|
|
13
|
-
* to update the active state of the toggle.
|
|
14
|
-
*/
|
|
15
|
-
isActive?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Shows a disabled state for the toggle when set to `true`.
|
|
18
|
-
*/
|
|
19
|
-
disabled?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Shows a loading state for the toggle when set to `true`.
|
|
22
|
-
*/
|
|
23
|
-
isLoading?: boolean;
|
|
24
|
-
/** Label element to render to the right of the toggle */
|
|
25
|
-
label?: string;
|
|
26
|
-
/** ID of element that labels the toggle control (e.g. `my-label-element`)*/
|
|
27
|
-
labelledBy?: string;
|
|
28
|
-
/** Optional value for `data-testid` attribute */
|
|
29
|
-
testId?: string;
|
|
30
|
-
/** Label for enabled state. Not displayed, used for screen readers. */
|
|
31
|
-
enabledLabel?: string;
|
|
32
|
-
/** Label for disabled state. Not displayed, used for screen readers. */
|
|
33
|
-
disabledLabel?: string;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Checkbox behavior with the visual treatment of a physical toggle switch.
|
|
37
|
-
*/
|
|
38
|
-
declare const Toggle: ({ defaultActive, isActive, disabled, isLoading, onChange, labelledBy, label, testId, enabledLabel, disabledLabel, }: ToggleProps) => React.JSX.Element;
|
|
39
|
-
export default Toggle;
|
|
40
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Toggle/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,qEAAqE;IACrE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uEAAuE;IACvE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wEAAwE;IACxE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,QAAA,MAAM,MAAM,GAAI,qHAWb,WAAW,sBA8Db,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wrapper for `Intl.DateTimeFormat` with options configured for Narmi applications.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* import { formatDate } from '@narmi/design_system';
|
|
6
|
-
*
|
|
7
|
-
* formatDate(new Date('July 4, 2022'), 'short'); // '7/4/22'
|
|
8
|
-
* formatDate(new Date('7/4/2022'), 'long'); // 'July 4, 2022'
|
|
9
|
-
*
|
|
10
|
-
* @param date native date object
|
|
11
|
-
* @param style formatting style (`short` or `long`)
|
|
12
|
-
* @returns date string formatted for display
|
|
13
|
-
*/
|
|
14
|
-
export type FormatDateStyle = "short" | "long";
|
|
15
|
-
declare const formatDate: (date: Date, style?: FormatDateStyle) => string;
|
|
16
|
-
export default formatDate;
|
|
17
|
-
//# sourceMappingURL=formatDate.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formatDate.d.ts","sourceRoot":"","sources":["../../../src/formatters/formatDate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,CAAC;AAE/C,QAAA,MAAM,UAAU,GAAI,MAAM,IAAI,EAAE,QAAO,eAAyB,KAAG,MAelE,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wrapper for `Intl.NumberFormat` with options configured for Narmi applications.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* import { formatNumber } from '@narmi/design_system';
|
|
6
|
-
*
|
|
7
|
-
* formatNumber(1234.56, 'currency'); // '$1,234.56'
|
|
8
|
-
* formatNumber(34.4, 'currency'); // '$34.40'
|
|
9
|
-
* formatNumber(-12, 'currency'); // '-$12.00'
|
|
10
|
-
* formatNumber('0.0342', 'percent'); // '3.42%'
|
|
11
|
-
* formatNumber(0.0023, 'percent'); // '0.23%'
|
|
12
|
-
* formatNumber(0.215555, 'percent'); // '21.56%'
|
|
13
|
-
*
|
|
14
|
-
* @param input string or number to format into a number string
|
|
15
|
-
* @param style format style (`currency` or `percent`)
|
|
16
|
-
* @returns number string formatted for display
|
|
17
|
-
*/
|
|
18
|
-
export type FormatNumberStyle = "currency" | "percent";
|
|
19
|
-
export type FormatNumberSignDisplay = "auto" | "never" | "always" | "exceptZero";
|
|
20
|
-
declare const formatNumber: (input: string | number, style?: FormatNumberStyle, signDisplay?: FormatNumberSignDisplay, showCents?: boolean) => string;
|
|
21
|
-
export default formatNumber;
|
|
22
|
-
//# sourceMappingURL=formatNumber.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formatNumber.d.ts","sourceRoot":"","sources":["../../../src/formatters/formatNumber.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,SAAS,CAAC;AACvD,MAAM,MAAM,uBAAuB,GAC/B,MAAM,GACN,OAAO,GACP,QAAQ,GACR,YAAY,CAAC;AAEjB,QAAA,MAAM,YAAY,GAChB,OAAO,MAAM,GAAG,MAAM,EACtB,QAAO,iBAA8B,EACrC,cAAa,uBAAgC,EAC7C,YAAW,OAAc,KACxB,MA+CF,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
interface UseDropdownMaxHeightParams {
|
|
2
|
-
anchorRef: React.RefObject<HTMLElement>;
|
|
3
|
-
layerRef: React.RefObject<HTMLElement>;
|
|
4
|
-
isOpen: boolean;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Resolves a CSS custom property (e.g. `--space-xs`) to a pixel number.
|
|
8
|
-
* Falls back to `fallback` if the property is not set or cannot be parsed.
|
|
9
|
-
*/
|
|
10
|
-
export declare const resolveSpaceToken: (property: string, fallback: number) => number;
|
|
11
|
-
/**
|
|
12
|
-
* Measures available space above and below the anchor element and writes
|
|
13
|
-
* `--js-dropdown-max-height` to the layer element as a pixel value.
|
|
14
|
-
*
|
|
15
|
-
* Re-runs on `visualViewport` resize to handle virtual keyboard changes.
|
|
16
|
-
*/
|
|
17
|
-
declare const useDropdownMaxHeight: ({ anchorRef, layerRef, isOpen, }: UseDropdownMaxHeightParams) => void;
|
|
18
|
-
export default useDropdownMaxHeight;
|
|
19
|
-
//# sourceMappingURL=useDropdownMaxHeight.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDropdownMaxHeight.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useDropdownLayer/useDropdownMaxHeight.ts"],"names":[],"mappings":"AAEA,UAAU,0BAA0B;IAClC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACxC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAC5B,UAAU,MAAM,EAChB,UAAU,MAAM,KACf,MAOF,CAAC;AAEF;;;;;GAKG;AACH,QAAA,MAAM,oBAAoB,GAAI,kCAI3B,0BAA0B,KAAG,IAqC/B,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hook for locking body scrolling while a component is mounted
|
|
3
|
-
* @param isActive - applies scroll locking when `true`
|
|
4
|
-
*/
|
|
5
|
-
declare const useLockBodyScroll: (isActive: boolean) => void;
|
|
6
|
-
export default useLockBodyScroll;
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useLockBodyScroll/index.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,QAAA,MAAM,iBAAiB,GAAI,UAAU,OAAO,KAAG,IAS9C,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { default as PropTypes } from 'prop-types';
|
|
3
|
-
/**
|
|
4
|
-
* Returns the href if it uses a safe protocol, or undefined if it
|
|
5
|
-
* uses a potentially dangerous scheme (javascript:, data:, etc).
|
|
6
|
-
*
|
|
7
|
-
* Accepts `unknown` rather than `string` on purpose: this is a security
|
|
8
|
-
* guard, and it must keep rejecting non-string input that reaches it from
|
|
9
|
-
* untyped call sites at runtime.
|
|
10
|
-
*/
|
|
11
|
-
export declare const getSafeHref: (href?: unknown) => string | null | undefined;
|
|
12
|
-
/**
|
|
13
|
-
* This is not a complete list of HTML elements;
|
|
14
|
-
* only the elements we want to support in `as` props.
|
|
15
|
-
*/
|
|
16
|
-
export declare const VALID_ELEMENTS: string[];
|
|
17
|
-
export interface AsElementProps {
|
|
18
|
-
/** element to render */
|
|
19
|
-
elementType?: React.ElementType;
|
|
20
|
-
children?: React.ReactNode;
|
|
21
|
-
/**
|
|
22
|
-
* Any additional props are spread onto the rendered element.
|
|
23
|
-
* `AsElement` is a passthrough, so this is intentionally open-ended.
|
|
24
|
-
*/
|
|
25
|
-
[key: string]: unknown;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Utility to conditionally render different HTML elements
|
|
29
|
-
* in our components. Useful for exposing `as` props:
|
|
30
|
-
*
|
|
31
|
-
* `<Row as="ul"><Row.Item as="li" /></Row>
|
|
32
|
-
*
|
|
33
|
-
* @usage <AsElement elementName="ul" otherProp="this gets passed through">
|
|
34
|
-
*/
|
|
35
|
-
declare const AsElement: {
|
|
36
|
-
({ elementType, children, ...rest }: AsElementProps): React.JSX.Element;
|
|
37
|
-
propTypes: {
|
|
38
|
-
/** element to render */
|
|
39
|
-
elementType: PropTypes.Validator<NonNullable<NonNullable<string | ((...args: any[]) => any)>>>;
|
|
40
|
-
children: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
export default AsElement;
|
|
44
|
-
//# sourceMappingURL=AsElement.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AsElement.d.ts","sourceRoot":"","sources":["../../../src/util/AsElement.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AAInC;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,OAAO,KAAG,MAAM,GAAG,IAAI,GAAG,SAU5D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,UAkB1B,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,yBAAyB;IACzB,WAAW,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IAChC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;OAGG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,QAAA,MAAM,SAAS;yCAIZ,cAAc;;QA6Bf,yBAAyB;;;;CAH1B,CAAC;AAcF,eAAe,SAAS,CAAC"}
|