@instructure/ui-rating 11.7.2-snapshot-19 → 11.7.2-snapshot-21
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 +12 -2
- package/es/Rating/v2/index.js +114 -0
- package/es/Rating/v2/props.js +26 -0
- package/es/Rating/v2/styles.js +43 -0
- package/es/RatingIcon/v2/index.js +124 -0
- package/es/RatingIcon/v2/props.js +26 -0
- package/es/RatingIcon/v2/styles.js +59 -0
- package/es/exports/b.js +25 -0
- package/lib/Rating/v2/index.js +119 -0
- package/lib/Rating/v2/props.js +31 -0
- package/lib/Rating/v2/styles.js +49 -0
- package/lib/RatingIcon/v2/index.js +129 -0
- package/lib/RatingIcon/v2/props.js +31 -0
- package/lib/RatingIcon/v2/styles.js +65 -0
- package/lib/exports/b.js +19 -0
- package/package.json +23 -23
- package/src/Rating/v2/README.md +104 -0
- package/src/Rating/v2/index.tsx +131 -0
- package/src/Rating/v2/props.ts +90 -0
- package/src/Rating/v2/styles.ts +46 -0
- package/src/RatingIcon/v2/index.tsx +140 -0
- package/src/RatingIcon/v2/props.ts +55 -0
- package/src/RatingIcon/v2/styles.ts +71 -0
- package/src/exports/b.ts +28 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Rating/v2/index.d.ts +39 -0
- package/types/Rating/v2/index.d.ts.map +1 -0
- package/types/Rating/v2/props.d.ts +46 -0
- package/types/Rating/v2/props.d.ts.map +1 -0
- package/types/Rating/v2/styles.d.ts +14 -0
- package/types/Rating/v2/styles.d.ts.map +1 -0
- package/types/RatingIcon/v2/index.d.ts +39 -0
- package/types/RatingIcon/v2/index.d.ts.map +1 -0
- package/types/RatingIcon/v2/props.d.ts +19 -0
- package/types/RatingIcon/v2/props.d.ts.map +1 -0
- package/types/RatingIcon/v2/styles.d.ts +15 -0
- package/types/RatingIcon/v2/styles.d.ts.map +1 -0
- package/types/exports/b.d.ts +5 -0
- package/types/exports/b.d.ts.map +1 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
import { RatingIcon } from '../../RatingIcon/v2';
|
|
3
|
+
import type { RatingProps } from './props';
|
|
4
|
+
/**
|
|
5
|
+
---
|
|
6
|
+
category: components
|
|
7
|
+
---
|
|
8
|
+
**/
|
|
9
|
+
declare class Rating extends Component<RatingProps> {
|
|
10
|
+
static readonly componentId = "Rating";
|
|
11
|
+
static allowedProps: readonly (keyof {
|
|
12
|
+
label: string;
|
|
13
|
+
formatValueText?: (filled: number, iconCount: number) => string;
|
|
14
|
+
iconCount?: 3 | 5;
|
|
15
|
+
size?: "small" | "medium" | "large";
|
|
16
|
+
valueMax?: number;
|
|
17
|
+
valueNow?: number;
|
|
18
|
+
animateFill?: boolean;
|
|
19
|
+
margin?: import("@instructure/emotion").Spacing;
|
|
20
|
+
})[];
|
|
21
|
+
static defaultProps: {
|
|
22
|
+
animateFill: boolean;
|
|
23
|
+
formatValueText: (filled: number, iconCount: number) => string;
|
|
24
|
+
iconCount: number;
|
|
25
|
+
size: string;
|
|
26
|
+
valueNow: number;
|
|
27
|
+
};
|
|
28
|
+
static Icon: typeof RatingIcon;
|
|
29
|
+
ref: Element | null;
|
|
30
|
+
handleRef: (el: Element | null) => void;
|
|
31
|
+
componentDidMount(): void;
|
|
32
|
+
componentDidUpdate(): void;
|
|
33
|
+
get filled(): number;
|
|
34
|
+
get empty(): number;
|
|
35
|
+
render(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
36
|
+
}
|
|
37
|
+
export default Rating;
|
|
38
|
+
export { Rating };
|
|
39
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Rating/v2/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKjC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAGhD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAG1C;;;;GAIG;AACH,cACM,MAAO,SAAQ,SAAS,CAAC,WAAW,CAAC;IACzC,MAAM,CAAC,QAAQ,CAAC,WAAW,YAAW;IAEtC,MAAM,CAAC,YAAY;;;;;;;;;SAAe;IAElC,MAAM,CAAC,YAAY;;kCAES,MAAM,aAAa,MAAM;;;;MAKpD;IAED,MAAM,CAAC,IAAI,oBAAa;IAExB,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,GAAI,IAAI,OAAO,GAAG,IAAI,UAE9B;IAED,iBAAiB;IAIjB,kBAAkB;IAIlB,IAAI,MAAM,WAcT;IAED,IAAI,KAAK,WAER;IAED,MAAM;CAoCP;AAED,eAAe,MAAM,CAAA;AACrB,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Spacing, WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
2
|
+
import type { OtherHTMLAttributes } from '@instructure/shared-types';
|
|
3
|
+
type RatingOwnProps = {
|
|
4
|
+
/**
|
|
5
|
+
* A label is required for accessibility
|
|
6
|
+
*/
|
|
7
|
+
label: string;
|
|
8
|
+
/**
|
|
9
|
+
* A function that returns the current value formatted for screen readers
|
|
10
|
+
*/
|
|
11
|
+
formatValueText?: (filled: number, iconCount: number) => string;
|
|
12
|
+
/**
|
|
13
|
+
* Choose from a 0-3 or 0-5 rating system
|
|
14
|
+
*/
|
|
15
|
+
iconCount?: 3 | 5;
|
|
16
|
+
/**
|
|
17
|
+
* Choose from different rating icon sizes
|
|
18
|
+
*/
|
|
19
|
+
size?: 'small' | 'medium' | 'large';
|
|
20
|
+
/**
|
|
21
|
+
* The maximum rating (defaults to iconCount)
|
|
22
|
+
*/
|
|
23
|
+
valueMax?: number;
|
|
24
|
+
/**
|
|
25
|
+
* The current rating
|
|
26
|
+
*/
|
|
27
|
+
valueNow?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Set to make the icons animate when they become filled
|
|
30
|
+
*/
|
|
31
|
+
animateFill?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
|
|
34
|
+
* `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
|
|
35
|
+
* familiar CSS-like shorthand. For example: `margin="small auto large"`.
|
|
36
|
+
*/
|
|
37
|
+
margin?: Spacing;
|
|
38
|
+
};
|
|
39
|
+
type PropKeys = keyof RatingOwnProps;
|
|
40
|
+
type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
41
|
+
type RatingProps = RatingOwnProps & WithStyleProps<null, RatingStyle> & OtherHTMLAttributes<RatingOwnProps>;
|
|
42
|
+
type RatingStyle = ComponentStyle<'rating'>;
|
|
43
|
+
declare const allowedProps: AllowedPropKeys;
|
|
44
|
+
export type { RatingProps, RatingStyle };
|
|
45
|
+
export { allowedProps };
|
|
46
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Rating/v2/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAEpE,KAAK,cAAc,GAAG;IACpB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,CAAA;IAC/D;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,GAAG,CAAC,CAAA;IACjB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,KAAK,QAAQ,GAAG,MAAM,cAAc,CAAA;AAEpC,KAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,KAAK,WAAW,GAAG,cAAc,GAC/B,cAAc,CAAC,IAAI,EAAE,WAAW,CAAC,GACjC,mBAAmB,CAAC,cAAc,CAAC,CAAA;AAErC,KAAK,WAAW,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAA;AAC3C,QAAA,MAAM,YAAY,EAAE,eASnB,CAAA;AAED,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { RatingStyle } from './props';
|
|
2
|
+
/**
|
|
3
|
+
* ---
|
|
4
|
+
* private: true
|
|
5
|
+
* ---
|
|
6
|
+
* Generates the style object from the theme and provided additional information
|
|
7
|
+
* @param {Object} componentTheme The theme variable object.
|
|
8
|
+
* @param {Object} props the props of the component, the style is applied to
|
|
9
|
+
* @param {Object} state the state 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: () => RatingStyle;
|
|
13
|
+
export default generateStyle;
|
|
14
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/Rating/v2/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,QAAO,WAOzB,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
import type { RequestAnimationFrameType } from '@instructure/ui-dom-utils';
|
|
3
|
+
import type { RatingIconProps, RatingIconState } from './props';
|
|
4
|
+
/**
|
|
5
|
+
---
|
|
6
|
+
parent: Rating
|
|
7
|
+
id: Rating.Icon
|
|
8
|
+
---
|
|
9
|
+
**/
|
|
10
|
+
declare class RatingIcon extends Component<RatingIconProps, RatingIconState> {
|
|
11
|
+
static readonly componentId = "Rating.Icon";
|
|
12
|
+
static allowedProps: readonly (keyof {
|
|
13
|
+
animationDelay?: number;
|
|
14
|
+
animateFill?: boolean;
|
|
15
|
+
filled?: boolean;
|
|
16
|
+
size?: "small" | "medium" | "large";
|
|
17
|
+
})[];
|
|
18
|
+
static defaultProps: {
|
|
19
|
+
animationDelay: number;
|
|
20
|
+
animateFill: boolean;
|
|
21
|
+
filled: boolean;
|
|
22
|
+
size: string;
|
|
23
|
+
};
|
|
24
|
+
ref: HTMLSpanElement | null;
|
|
25
|
+
constructor(props: RatingIconProps);
|
|
26
|
+
_timeouts: ReturnType<typeof setTimeout>[];
|
|
27
|
+
_animation: RequestAnimationFrameType | undefined;
|
|
28
|
+
componentDidMount(): void;
|
|
29
|
+
componentDidUpdate(prevProps: RatingIconProps): void;
|
|
30
|
+
componentWillUnmount(): void;
|
|
31
|
+
makeStyleProps: () => {
|
|
32
|
+
filled: boolean;
|
|
33
|
+
};
|
|
34
|
+
fill: () => void;
|
|
35
|
+
render(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
36
|
+
}
|
|
37
|
+
export default RatingIcon;
|
|
38
|
+
export { RatingIcon };
|
|
39
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/RatingIcon/v2/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAIjC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAA;AAK1E,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAS/D;;;;;GAKG;AACH,cACM,UAAW,SAAQ,SAAS,CAAC,eAAe,EAAE,eAAe,CAAC;IAClE,MAAM,CAAC,QAAQ,CAAC,WAAW,iBAAgB;IAE3C,MAAM,CAAC,YAAY;;;;;SAAe;IAElC,MAAM,CAAC,YAAY;;;;;MAKlB;IAED,GAAG,EAAE,eAAe,GAAG,IAAI,CAAO;gBAEtB,KAAK,EAAE,eAAe;IAQlC,SAAS,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,EAAE,CAAK;IAC/C,UAAU,EAAE,yBAAyB,GAAG,SAAS,CAAA;IAEjD,iBAAiB;IAOjB,kBAAkB,CAAC,SAAS,EAAE,eAAe;IAW7C,oBAAoB;IAKpB,cAAc;;MAEb;IAED,IAAI,aAMH;IAED,MAAM;CA2BP;AAED,eAAe,UAAU,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { RatingIconTheme } from '@instructure/shared-types';
|
|
2
|
+
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
3
|
+
type RatingIconOwnProps = {
|
|
4
|
+
animationDelay?: number;
|
|
5
|
+
animateFill?: boolean;
|
|
6
|
+
filled?: boolean;
|
|
7
|
+
size?: 'small' | 'medium' | 'large';
|
|
8
|
+
};
|
|
9
|
+
export type RatingIconState = {
|
|
10
|
+
filled: boolean;
|
|
11
|
+
};
|
|
12
|
+
type PropKeys = keyof RatingIconOwnProps;
|
|
13
|
+
type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
14
|
+
type RatingIconProps = RatingIconOwnProps & WithStyleProps<RatingIconTheme, RatingIconStyle>;
|
|
15
|
+
type RatingIconStyle = ComponentStyle<'ratingIcon' | 'icon'>;
|
|
16
|
+
declare const allowedProps: AllowedPropKeys;
|
|
17
|
+
export type { RatingIconProps, RatingIconStyle };
|
|
18
|
+
export { allowedProps };
|
|
19
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/RatingIcon/v2/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1E,KAAK,kBAAkB,GAAG;IACxB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;CACpC,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,OAAO,CAAA;CAChB,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,MAAM,CAAC,CAAA;AAC5D,QAAA,MAAM,YAAY,EAAE,eAKnB,CAAA;AAED,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,CAAA;AAChD,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { NewComponentTypes, SharedTokens } from '@instructure/ui-themes';
|
|
2
|
+
import type { RatingIconProps, RatingIconState, RatingIconStyle } 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: NewComponentTypes["RatingIcon"], _props: RatingIconProps, state: RatingIconState, _sharedTokens: SharedTokens) => RatingIconStyle;
|
|
14
|
+
export default generateStyle;
|
|
15
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/RatingIcon/v2/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC7E,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAEhF;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,GACjB,gBAAgB,iBAAiB,CAAC,YAAY,CAAC,EAC/C,QAAQ,eAAe,EACvB,OAAO,eAAe,EACtB,eAAe,YAAY,KAC1B,eA0BF,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"b.d.ts","sourceRoot":"","sources":["../../src/exports/b.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,YAAY,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA"}
|