@ohos-ports/instructure-ui-breadcrumb 11.7.5-beta.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/CHANGELOG.md +1330 -0
- package/LICENSE.md +28 -0
- package/README.md +46 -0
- package/es/Breadcrumb/v1/BreadcrumbLink/index.js +119 -0
- package/es/Breadcrumb/v1/BreadcrumbLink/props.js +26 -0
- package/es/Breadcrumb/v1/index.js +113 -0
- package/es/Breadcrumb/v1/props.js +26 -0
- package/es/Breadcrumb/v1/styles.js +106 -0
- package/es/Breadcrumb/v1/theme.js +49 -0
- package/es/Breadcrumb/v2/BreadcrumbLink/index.js +121 -0
- package/es/Breadcrumb/v2/BreadcrumbLink/props.js +26 -0
- package/es/Breadcrumb/v2/index.js +133 -0
- package/es/Breadcrumb/v2/props.js +26 -0
- package/es/Breadcrumb/v2/styles.js +77 -0
- package/es/exports/a.js +24 -0
- package/es/exports/b.js +24 -0
- package/lib/Breadcrumb/v1/BreadcrumbLink/index.js +125 -0
- package/lib/Breadcrumb/v1/BreadcrumbLink/props.js +31 -0
- package/lib/Breadcrumb/v1/index.js +125 -0
- package/lib/Breadcrumb/v1/props.js +31 -0
- package/lib/Breadcrumb/v1/styles.js +112 -0
- package/lib/Breadcrumb/v1/theme.js +55 -0
- package/lib/Breadcrumb/v2/BreadcrumbLink/index.js +127 -0
- package/lib/Breadcrumb/v2/BreadcrumbLink/props.js +31 -0
- package/lib/Breadcrumb/v2/index.js +145 -0
- package/lib/Breadcrumb/v2/props.js +31 -0
- package/lib/Breadcrumb/v2/styles.js +83 -0
- package/lib/exports/a.js +18 -0
- package/lib/exports/b.js +18 -0
- package/lib/package.json +1 -0
- package/package.json +90 -0
- package/scripts/fix-instructure-exports.js +137 -0
- package/src/Breadcrumb/v1/BreadcrumbLink/index.tsx +122 -0
- package/src/Breadcrumb/v1/BreadcrumbLink/props.ts +102 -0
- package/src/Breadcrumb/v1/README.md +141 -0
- package/src/Breadcrumb/v1/index.tsx +143 -0
- package/src/Breadcrumb/v1/props.ts +63 -0
- package/src/Breadcrumb/v1/styles.ts +116 -0
- package/src/Breadcrumb/v1/theme.ts +55 -0
- package/src/Breadcrumb/v2/BreadcrumbLink/index.tsx +123 -0
- package/src/Breadcrumb/v2/BreadcrumbLink/props.ts +101 -0
- package/src/Breadcrumb/v2/README.md +141 -0
- package/src/Breadcrumb/v2/index.tsx +157 -0
- package/src/Breadcrumb/v2/props.ts +64 -0
- package/src/Breadcrumb/v2/styles.ts +86 -0
- package/src/exports/a.ts +27 -0
- package/src/exports/b.ts +27 -0
- package/tsconfig.build.json +24 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +4 -0
- package/types/Breadcrumb/v1/BreadcrumbLink/index.d.ts +31 -0
- package/types/Breadcrumb/v1/BreadcrumbLink/index.d.ts.map +1 -0
- package/types/Breadcrumb/v1/BreadcrumbLink/props.d.ts +49 -0
- package/types/Breadcrumb/v1/BreadcrumbLink/props.d.ts.map +1 -0
- package/types/Breadcrumb/v1/index.d.ts +35 -0
- package/types/Breadcrumb/v1/index.d.ts.map +1 -0
- package/types/Breadcrumb/v1/props.d.ts +30 -0
- package/types/Breadcrumb/v1/props.d.ts.map +1 -0
- package/types/Breadcrumb/v1/styles.d.ts +15 -0
- package/types/Breadcrumb/v1/styles.d.ts.map +1 -0
- package/types/Breadcrumb/v1/theme.d.ts +10 -0
- package/types/Breadcrumb/v1/theme.d.ts.map +1 -0
- package/types/Breadcrumb/v2/BreadcrumbLink/index.d.ts +31 -0
- package/types/Breadcrumb/v2/BreadcrumbLink/index.d.ts.map +1 -0
- package/types/Breadcrumb/v2/BreadcrumbLink/props.d.ts +49 -0
- package/types/Breadcrumb/v2/BreadcrumbLink/props.d.ts.map +1 -0
- package/types/Breadcrumb/v2/index.d.ts +35 -0
- package/types/Breadcrumb/v2/index.d.ts.map +1 -0
- package/types/Breadcrumb/v2/props.d.ts +30 -0
- package/types/Breadcrumb/v2/props.d.ts.map +1 -0
- package/types/Breadcrumb/v2/styles.d.ts +14 -0
- package/types/Breadcrumb/v2/styles.d.ts.map +1 -0
- package/types/exports/a.d.ts +4 -0
- package/types/exports/a.d.ts.map +1 -0
- package/types/exports/b.d.ts +4 -0
- package/types/exports/b.d.ts.map +1 -0
package/tsconfig.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
import type { BreadcrumbLinkProps, BreadcrumbLinkState } from './props';
|
|
3
|
+
/**
|
|
4
|
+
---
|
|
5
|
+
parent: Breadcrumb
|
|
6
|
+
id: Breadcrumb.Link
|
|
7
|
+
---
|
|
8
|
+
**/
|
|
9
|
+
declare class BreadcrumbLink extends Component<BreadcrumbLinkProps, BreadcrumbLinkState> {
|
|
10
|
+
static displayName: string;
|
|
11
|
+
static readonly componentId = "Breadcrumb.Link";
|
|
12
|
+
static allowedProps: readonly (keyof {
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
href?: string;
|
|
15
|
+
onClick?: (event: React.MouseEvent<import("@instructure/ui-view/types/exports/a.js").ViewOwnProps, MouseEvent>) => void;
|
|
16
|
+
onMouseEnter?: (event: React.MouseEvent<import("@instructure/ui-view/types/exports/a.js").ViewOwnProps, MouseEvent>) => void;
|
|
17
|
+
size?: "small" | "medium" | "large";
|
|
18
|
+
renderIcon?: import("@instructure/shared-types").Renderable;
|
|
19
|
+
iconPlacement?: "start" | "end";
|
|
20
|
+
isCurrentPage?: boolean;
|
|
21
|
+
})[];
|
|
22
|
+
static defaultProps: {};
|
|
23
|
+
ref: Element | null;
|
|
24
|
+
handleRef: (el: Element | null) => void;
|
|
25
|
+
constructor(props: BreadcrumbLinkProps);
|
|
26
|
+
handleTruncation(isTruncated: boolean): void;
|
|
27
|
+
render(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
28
|
+
}
|
|
29
|
+
export default BreadcrumbLink;
|
|
30
|
+
export { BreadcrumbLink };
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Breadcrumb/v1/BreadcrumbLink/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAQjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAEvE;;;;;GAKG;AAEH,cAAM,cAAe,SAAQ,SAAS,CACpC,mBAAmB,EACnB,mBAAmB,CACpB;IACC,MAAM,CAAC,WAAW,SAAmB;IACrC,MAAM,CAAC,QAAQ,CAAC,WAAW,qBAAoB;IAE/C,MAAM,CAAC,YAAY;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY,KAAK;IAExB,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,GAAI,IAAI,OAAO,GAAG,IAAI,UAE9B;gBACW,KAAK,EAAE,mBAAmB;IAOtC,gBAAgB,CAAC,WAAW,EAAE,OAAO;IAMrC,MAAM;CAiDP;AAED,eAAe,cAAc,CAAA;AAC7B,OAAO,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PickPropsWithExceptions, OtherHTMLAttributes, Renderable } from '@instructure/shared-types';
|
|
3
|
+
import type { ViewOwnProps } from '@instructure/ui-view/v11_6';
|
|
4
|
+
import type { LinkProps } from '@instructure/ui-link/v11_6';
|
|
5
|
+
type BreadcrumbLinkOwnProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Content to render as the crumb, generally should be text.
|
|
8
|
+
*/
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* Link the crumb should direct to; if an href is provided, the crumb will render as a link
|
|
12
|
+
*/
|
|
13
|
+
href?: string;
|
|
14
|
+
/**
|
|
15
|
+
* If the Breadcrumb.Link has an onClick prop (and no href), it will render as a button
|
|
16
|
+
*/
|
|
17
|
+
onClick?: (event: React.MouseEvent<ViewOwnProps, MouseEvent>) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Fires when the Link is hovered
|
|
20
|
+
*/
|
|
21
|
+
onMouseEnter?: (event: React.MouseEvent<ViewOwnProps, MouseEvent>) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Sets the font-size of the breadcrumb text
|
|
24
|
+
*/
|
|
25
|
+
size?: 'small' | 'medium' | 'large';
|
|
26
|
+
/**
|
|
27
|
+
* Add an icon to the Breadcrumb.Link
|
|
28
|
+
*/
|
|
29
|
+
renderIcon?: Renderable;
|
|
30
|
+
/**
|
|
31
|
+
* Place the icon before or after the text in the Breadcrumb.Link
|
|
32
|
+
*/
|
|
33
|
+
iconPlacement?: 'start' | 'end';
|
|
34
|
+
/**
|
|
35
|
+
* Whether the page this breadcrumb points to is the current one. If true, it sets aria-current="page".
|
|
36
|
+
* If this prop is not set to true on any breadcrumb element, the one recieving the aria-current="page" will always be the last element, unless the last element's isCurrentPage prop is explicity set to false.
|
|
37
|
+
*/
|
|
38
|
+
isCurrentPage?: boolean;
|
|
39
|
+
};
|
|
40
|
+
type PropKeys = keyof BreadcrumbLinkOwnProps;
|
|
41
|
+
type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
42
|
+
type BreadcrumbLinkProps = PickPropsWithExceptions<LinkProps, 'children' | 'href' | 'onClick' | 'renderIcon' | 'iconPlacement' | 'isWithinText' | 'elementRef'> & BreadcrumbLinkOwnProps & OtherHTMLAttributes<BreadcrumbLinkOwnProps & LinkProps>;
|
|
43
|
+
declare const allowedProps: AllowedPropKeys;
|
|
44
|
+
type BreadcrumbLinkState = {
|
|
45
|
+
isTruncated: boolean;
|
|
46
|
+
};
|
|
47
|
+
export type { BreadcrumbLinkProps, BreadcrumbLinkState };
|
|
48
|
+
export { allowedProps };
|
|
49
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../../src/Breadcrumb/v1/BreadcrumbLink/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACnB,UAAU,EACX,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAE3D,KAAK,sBAAsB,GAAG;IAC5B;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,YAAY,EAAE,UAAU,CAAC,KAAK,IAAI,CAAA;IACrE;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,YAAY,EAAE,UAAU,CAAC,KAAK,IAAI,CAAA;IAC1E;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;IAC/B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,CAAA;AAED,KAAK,QAAQ,GAAG,MAAM,sBAAsB,CAAA;AAE5C,KAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,KAAK,mBAAmB,GAAG,uBAAuB,CAChD,SAAS,EACP,UAAU,GACV,MAAM,GACN,SAAS,GACT,YAAY,GACZ,eAAe,GACf,cAAc,GACd,YAAY,CACf,GACC,sBAAsB,GACtB,mBAAmB,CAAC,sBAAsB,GAAG,SAAS,CAAC,CAAA;AACzD,QAAA,MAAM,YAAY,EAAE,eASnB,CAAA;AAED,KAAK,mBAAmB,GAAG;IACzB,WAAW,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Component, ReactElement } from 'react';
|
|
2
|
+
import { BreadcrumbLink } from './BreadcrumbLink/index.js';
|
|
3
|
+
import type { BreadcrumbProps } from './props';
|
|
4
|
+
/**
|
|
5
|
+
---
|
|
6
|
+
category: components
|
|
7
|
+
---
|
|
8
|
+
**/
|
|
9
|
+
declare class Breadcrumb extends Component<BreadcrumbProps> {
|
|
10
|
+
static displayName: string;
|
|
11
|
+
static readonly componentId = "Breadcrumb";
|
|
12
|
+
static allowedProps: readonly (keyof {
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
label: string;
|
|
15
|
+
size?: "small" | "medium" | "large";
|
|
16
|
+
margin?: import("@instructure/emotion").Spacing;
|
|
17
|
+
})[];
|
|
18
|
+
static defaultProps: {
|
|
19
|
+
size: string;
|
|
20
|
+
children: null;
|
|
21
|
+
};
|
|
22
|
+
ref: Element | null;
|
|
23
|
+
handleRef: (el: Element | null) => void;
|
|
24
|
+
addAriaCurrent: (child: React.ReactNode) => ReactElement<{
|
|
25
|
+
'aria-current'?: string;
|
|
26
|
+
}, string | import("react").JSXElementConstructor<any>>;
|
|
27
|
+
componentDidMount(): void;
|
|
28
|
+
componentDidUpdate(): void;
|
|
29
|
+
static Link: typeof BreadcrumbLink;
|
|
30
|
+
renderChildren(): import("@emotion/react/jsx-runtime").JSX.Element[] | null | undefined;
|
|
31
|
+
render(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
32
|
+
}
|
|
33
|
+
export default Breadcrumb;
|
|
34
|
+
export { Breadcrumb, BreadcrumbLink };
|
|
35
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Breadcrumb/v1/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAIL,SAAS,EACT,YAAY,EACb,MAAM,OAAO,CAAA;AAMd,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAM1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C;;;;GAIG;AAEH,cACM,UAAW,SAAQ,SAAS,CAAC,eAAe,CAAC;IACjD,MAAM,CAAC,WAAW,SAAe;IACjC,MAAM,CAAC,QAAQ,CAAC,WAAW,gBAAe;IAE1C,MAAM,CAAC,YAAY;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;MAGlB;IAED,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,GAAI,IAAI,OAAO,GAAG,IAAI,UAE9B;IAED,cAAc,GAAI,OAAO,KAAK,CAAC,SAAS;yBAEW,MAAM;4DAMxD;IAED,iBAAiB;IAGjB,kBAAkB;IAIlB,MAAM,CAAC,IAAI,wBAAiB;IAE5B,cAAc;IAqCd,MAAM;CAgBP;AAED,eAAe,UAAU,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Spacing, WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
2
|
+
import type { BreadcrumbTheme } from '@instructure/shared-types';
|
|
3
|
+
type BreadcrumbOwnProps = {
|
|
4
|
+
/**
|
|
5
|
+
* children of type Breadcrumb.Link
|
|
6
|
+
*/
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* An accessible label for the navigation
|
|
10
|
+
*/
|
|
11
|
+
label: string;
|
|
12
|
+
/**
|
|
13
|
+
* Sets the font-size of the breadcrumb text
|
|
14
|
+
*/
|
|
15
|
+
size?: 'small' | 'medium' | 'large';
|
|
16
|
+
/**
|
|
17
|
+
* Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
|
|
18
|
+
* `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
|
|
19
|
+
* familiar CSS-like shorthand. For example: `margin="small auto large"`.
|
|
20
|
+
*/
|
|
21
|
+
margin?: Spacing;
|
|
22
|
+
};
|
|
23
|
+
type PropKeys = keyof BreadcrumbOwnProps;
|
|
24
|
+
type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
25
|
+
type BreadcrumbProps = BreadcrumbOwnProps & WithStyleProps<BreadcrumbTheme, BreadcrumbStyle>;
|
|
26
|
+
type BreadcrumbStyle = ComponentStyle<'breadcrumb' | 'crumb' | 'separator'>;
|
|
27
|
+
declare const allowedProps: AllowedPropKeys;
|
|
28
|
+
export type { BreadcrumbProps, BreadcrumbStyle };
|
|
29
|
+
export { allowedProps };
|
|
30
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Breadcrumb/v1/props.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAEhE,KAAK,kBAAkB,GAAG;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,KAAK,QAAQ,GAAG,MAAM,kBAAkB,CAAA;AAExC,KAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,KAAK,eAAe,GAAG,kBAAkB,GACvC,cAAc,CAAC,eAAe,EAAE,eAAe,CAAC,CAAA;AAElD,KAAK,eAAe,GAAG,cAAc,CAAC,YAAY,GAAG,OAAO,GAAG,WAAW,CAAC,CAAA;AAC3E,QAAA,MAAM,YAAY,EAAE,eAAyD,CAAA;AAE7E,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,CAAA;AAChD,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { BreadcrumbTheme } from '@instructure/shared-types';
|
|
2
|
+
import type { BreadcrumbProps, BreadcrumbStyle } from './props';
|
|
3
|
+
/**
|
|
4
|
+
* ---
|
|
5
|
+
* private: true
|
|
6
|
+
* ---
|
|
7
|
+
* Generates the style object from the theme and provided additional information
|
|
8
|
+
* @param {Object} componentTheme The theme variable object.
|
|
9
|
+
* @param {Object} props the props of the component, the style is applied to
|
|
10
|
+
* @param {Object} state the state of the component, the style is applied to
|
|
11
|
+
* @return {Object} The final style object, which will be used in the component
|
|
12
|
+
*/
|
|
13
|
+
declare const generateStyle: (componentTheme: BreadcrumbTheme, props: BreadcrumbProps) => BreadcrumbStyle;
|
|
14
|
+
export default generateStyle;
|
|
15
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/Breadcrumb/v1/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE/D;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,GACjB,gBAAgB,eAAe,EAC/B,OAAO,eAAe,KACrB,eAyEF,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Theme } from '@instructure/ui-themes';
|
|
2
|
+
import { BreadcrumbTheme } from '@instructure/shared-types';
|
|
3
|
+
/**
|
|
4
|
+
* Generates the theme object for the component from the theme and provided additional information
|
|
5
|
+
* @param {Object} theme The actual theme object.
|
|
6
|
+
* @return {Object} The final theme object with the overrides and component variables
|
|
7
|
+
*/
|
|
8
|
+
declare const generateComponentTheme: (theme: Theme) => BreadcrumbTheme;
|
|
9
|
+
export default generateComponentTheme;
|
|
10
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/Breadcrumb/v1/theme.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D;;;;GAIG;AACH,QAAA,MAAM,sBAAsB,GAAI,OAAO,KAAK,KAAG,eAoB9C,CAAA;AAED,eAAe,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
import type { BreadcrumbLinkProps, BreadcrumbLinkState } from './props';
|
|
3
|
+
/**
|
|
4
|
+
---
|
|
5
|
+
parent: Breadcrumb
|
|
6
|
+
id: Breadcrumb.Link
|
|
7
|
+
---
|
|
8
|
+
**/
|
|
9
|
+
declare class BreadcrumbLink extends Component<BreadcrumbLinkProps, BreadcrumbLinkState> {
|
|
10
|
+
static displayName: string;
|
|
11
|
+
static readonly componentId = "Breadcrumb.Link";
|
|
12
|
+
static allowedProps: readonly (keyof {
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
href?: string;
|
|
15
|
+
onClick?: (event: React.MouseEvent<import("@instructure/ui-view/types/exports/b.js").ViewOwnProps, MouseEvent>) => void;
|
|
16
|
+
onMouseEnter?: (event: React.MouseEvent<import("@instructure/ui-view/types/exports/b.js").ViewOwnProps, MouseEvent>) => void;
|
|
17
|
+
size?: "small" | "medium" | "large";
|
|
18
|
+
renderIcon?: import("@instructure/shared-types").Renderable;
|
|
19
|
+
iconPlacement?: "start" | "end";
|
|
20
|
+
isCurrentPage?: boolean;
|
|
21
|
+
})[];
|
|
22
|
+
static defaultProps: {};
|
|
23
|
+
ref: Element | null;
|
|
24
|
+
handleRef: (el: Element | null) => void;
|
|
25
|
+
constructor(props: BreadcrumbLinkProps);
|
|
26
|
+
handleTruncation(isTruncated: boolean): void;
|
|
27
|
+
render(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
28
|
+
}
|
|
29
|
+
export default BreadcrumbLink;
|
|
30
|
+
export { BreadcrumbLink };
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Breadcrumb/v2/BreadcrumbLink/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAQjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAEvE;;;;;GAKG;AAEH,cAAM,cAAe,SAAQ,SAAS,CACpC,mBAAmB,EACnB,mBAAmB,CACpB;IACC,MAAM,CAAC,WAAW,SAAmB;IACrC,MAAM,CAAC,QAAQ,CAAC,WAAW,qBAAoB;IAE/C,MAAM,CAAC,YAAY;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY,KAAK;IAExB,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,GAAI,IAAI,OAAO,GAAG,IAAI,UAE9B;gBACW,KAAK,EAAE,mBAAmB;IAOtC,gBAAgB,CAAC,WAAW,EAAE,OAAO;IAMrC,MAAM;CAkDP;AAED,eAAe,cAAc,CAAA;AAC7B,OAAO,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PickPropsWithExceptions, OtherHTMLAttributes, Renderable } from '@instructure/shared-types';
|
|
3
|
+
import type { ViewOwnProps } from '@instructure/ui-view/latest';
|
|
4
|
+
import type { LinkProps } from '@instructure/ui-link/latest';
|
|
5
|
+
type BreadcrumbLinkOwnProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Content to render as the crumb, generally should be text.
|
|
8
|
+
*/
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* Link the crumb should direct to; if an href is provided, the crumb will render as a link
|
|
12
|
+
*/
|
|
13
|
+
href?: string;
|
|
14
|
+
/**
|
|
15
|
+
* If the Breadcrumb.Link has an onClick prop (and no href), it will render as a button
|
|
16
|
+
*/
|
|
17
|
+
onClick?: (event: React.MouseEvent<ViewOwnProps, MouseEvent>) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Fires when the Link is hovered
|
|
20
|
+
*/
|
|
21
|
+
onMouseEnter?: (event: React.MouseEvent<ViewOwnProps, MouseEvent>) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Sets the font-size of the breadcrumb text
|
|
24
|
+
*/
|
|
25
|
+
size?: 'small' | 'medium' | 'large';
|
|
26
|
+
/**
|
|
27
|
+
* Add an icon to the Breadcrumb.Link
|
|
28
|
+
*/
|
|
29
|
+
renderIcon?: Renderable;
|
|
30
|
+
/**
|
|
31
|
+
* Place the icon before or after the text in the Breadcrumb.Link
|
|
32
|
+
*/
|
|
33
|
+
iconPlacement?: 'start' | 'end';
|
|
34
|
+
/**
|
|
35
|
+
* Whether the page this breadcrumb points to is the current one. If true, it sets aria-current="page".
|
|
36
|
+
* If this prop is not set to true on any breadcrumb element, the one recieving the aria-current="page" will always be the last element, unless the last element's isCurrentPage prop is explicity set to false.
|
|
37
|
+
*/
|
|
38
|
+
isCurrentPage?: boolean;
|
|
39
|
+
};
|
|
40
|
+
type PropKeys = keyof BreadcrumbLinkOwnProps;
|
|
41
|
+
type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
42
|
+
type BreadcrumbLinkProps = PickPropsWithExceptions<LinkProps, 'children' | 'href' | 'onClick' | 'renderIcon' | 'iconPlacement' | 'elementRef'> & BreadcrumbLinkOwnProps & OtherHTMLAttributes<BreadcrumbLinkOwnProps & LinkProps>;
|
|
43
|
+
declare const allowedProps: AllowedPropKeys;
|
|
44
|
+
type BreadcrumbLinkState = {
|
|
45
|
+
isTruncated: boolean;
|
|
46
|
+
};
|
|
47
|
+
export type { BreadcrumbLinkProps, BreadcrumbLinkState };
|
|
48
|
+
export { allowedProps };
|
|
49
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../../src/Breadcrumb/v2/BreadcrumbLink/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACnB,UAAU,EACX,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAE5D,KAAK,sBAAsB,GAAG;IAC5B;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,YAAY,EAAE,UAAU,CAAC,KAAK,IAAI,CAAA;IACrE;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,YAAY,EAAE,UAAU,CAAC,KAAK,IAAI,CAAA;IAC1E;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;IAC/B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,CAAA;AAED,KAAK,QAAQ,GAAG,MAAM,sBAAsB,CAAA;AAE5C,KAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,KAAK,mBAAmB,GAAG,uBAAuB,CAChD,SAAS,EACP,UAAU,GACV,MAAM,GACN,SAAS,GACT,YAAY,GACZ,eAAe,GACf,YAAY,CACf,GACC,sBAAsB,GACtB,mBAAmB,CAAC,sBAAsB,GAAG,SAAS,CAAC,CAAA;AACzD,QAAA,MAAM,YAAY,EAAE,eASnB,CAAA;AAED,KAAK,mBAAmB,GAAG;IACzB,WAAW,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Component, ReactElement } from 'react';
|
|
2
|
+
import { BreadcrumbLink } from './BreadcrumbLink/index.js';
|
|
3
|
+
import type { BreadcrumbProps } from './props';
|
|
4
|
+
/**
|
|
5
|
+
---
|
|
6
|
+
category: components
|
|
7
|
+
---
|
|
8
|
+
**/
|
|
9
|
+
declare class Breadcrumb extends Component<BreadcrumbProps> {
|
|
10
|
+
static displayName: string;
|
|
11
|
+
static readonly componentId = "Breadcrumb";
|
|
12
|
+
static allowedProps: readonly (keyof {
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
label: string;
|
|
15
|
+
size?: "small" | "medium" | "large";
|
|
16
|
+
margin?: import("@instructure/emotion").Spacing;
|
|
17
|
+
})[];
|
|
18
|
+
static defaultProps: {
|
|
19
|
+
size: string;
|
|
20
|
+
children: null;
|
|
21
|
+
};
|
|
22
|
+
ref: Element | null;
|
|
23
|
+
handleRef: (el: Element | null) => void;
|
|
24
|
+
addAriaCurrent: (child: React.ReactNode) => ReactElement<{
|
|
25
|
+
'aria-current'?: string;
|
|
26
|
+
}, string | import("react").JSXElementConstructor<any>>;
|
|
27
|
+
componentDidMount(): void;
|
|
28
|
+
componentDidUpdate(): void;
|
|
29
|
+
static Link: typeof BreadcrumbLink;
|
|
30
|
+
renderChildren(): import("@emotion/react/jsx-runtime").JSX.Element[] | null | undefined;
|
|
31
|
+
render(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
32
|
+
}
|
|
33
|
+
export default Breadcrumb;
|
|
34
|
+
export { Breadcrumb, BreadcrumbLink };
|
|
35
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Breadcrumb/v2/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAA4B,SAAS,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAOzE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAK1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C;;;;GAIG;AAEH,cACM,UAAW,SAAQ,SAAS,CAAC,eAAe,CAAC;IACjD,MAAM,CAAC,WAAW,SAAe;IACjC,MAAM,CAAC,QAAQ,CAAC,WAAW,gBAAe;IAE1C,MAAM,CAAC,YAAY;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;MAGlB;IAED,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,GAAI,IAAI,OAAO,GAAG,IAAI,UAE9B;IAED,cAAc,GAAI,OAAO,KAAK,CAAC,SAAS;yBAEW,MAAM;4DAMxD;IAED,iBAAiB;IAIjB,kBAAkB;IAIlB,MAAM,CAAC,IAAI,wBAAiB;IAE5B,cAAc;IAwDd,MAAM;CAgBP;AAED,eAAe,UAAU,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Spacing, WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
2
|
+
import type { NewComponentTypes } from '@instructure/ui-themes';
|
|
3
|
+
type BreadcrumbOwnProps = {
|
|
4
|
+
/**
|
|
5
|
+
* children of type Breadcrumb.Link
|
|
6
|
+
*/
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* An accessible label for the navigation
|
|
10
|
+
*/
|
|
11
|
+
label: string;
|
|
12
|
+
/**
|
|
13
|
+
* Sets the font-size of the breadcrumb text
|
|
14
|
+
*/
|
|
15
|
+
size?: 'small' | 'medium' | 'large';
|
|
16
|
+
/**
|
|
17
|
+
* Valid values are `0`, `none`, `auto`, and Spacing token values,
|
|
18
|
+
* see https://instructure.design/layout-spacing. Apply these values via
|
|
19
|
+
* familiar CSS-like shorthand. For example, `margin="general.spaceMd auto"`.
|
|
20
|
+
*/
|
|
21
|
+
margin?: Spacing;
|
|
22
|
+
};
|
|
23
|
+
type PropKeys = keyof BreadcrumbOwnProps;
|
|
24
|
+
type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
25
|
+
type BreadcrumbProps = BreadcrumbOwnProps & WithStyleProps<ReturnType<NewComponentTypes['Breadcrumb']>, BreadcrumbStyle>;
|
|
26
|
+
type BreadcrumbStyle = ComponentStyle<'breadcrumb' | 'crumb' | 'separator'>;
|
|
27
|
+
declare const allowedProps: AllowedPropKeys;
|
|
28
|
+
export type { BreadcrumbProps, BreadcrumbStyle };
|
|
29
|
+
export { allowedProps };
|
|
30
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Breadcrumb/v2/props.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE/D,KAAK,kBAAkB,GAAG;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,KAAK,QAAQ,GAAG,MAAM,kBAAkB,CAAA;AAExC,KAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,KAAK,eAAe,GAAG,kBAAkB,GACvC,cAAc,CAAC,UAAU,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,EAAE,eAAe,CAAC,CAAA;AAE9E,KAAK,eAAe,GAAG,cAAc,CAAC,YAAY,GAAG,OAAO,GAAG,WAAW,CAAC,CAAA;AAE3E,QAAA,MAAM,YAAY,EAAE,eAAyD,CAAA;AAE7E,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,CAAA;AAChD,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { NewComponentTypes } from '@instructure/ui-themes';
|
|
2
|
+
import type { BreadcrumbProps, BreadcrumbStyle } from './props';
|
|
3
|
+
/**
|
|
4
|
+
* ---
|
|
5
|
+
* private: true
|
|
6
|
+
* ---
|
|
7
|
+
* Generates the style object from the theme and provided additional information
|
|
8
|
+
* @param {Object} componentTheme The theme variable object.
|
|
9
|
+
* @param {Object} props the props of the component, the style is applied to
|
|
10
|
+
* @return {Object} The final style object, which will be used in the component
|
|
11
|
+
*/
|
|
12
|
+
declare const generateStyle: (componentTheme: ReturnType<NewComponentTypes["Breadcrumb"]>, props: BreadcrumbProps) => BreadcrumbStyle;
|
|
13
|
+
export default generateStyle;
|
|
14
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/Breadcrumb/v2/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE/D;;;;;;;;GAQG;AACH,QAAA,MAAM,aAAa,GACjB,gBAAgB,UAAU,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,EAC3D,OAAO,eAAe,KACrB,eA4CF,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["../../src/exports/a.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAEtE,YAAY,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAC7D,YAAY,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"b.d.ts","sourceRoot":"","sources":["../../src/exports/b.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAEtE,YAAY,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAC7D,YAAY,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAA"}
|