@instructure/ui-rating 8.19.1-snapshot.8 → 8.20.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.
@@ -7,40 +7,33 @@ import type { RatingProps } from './props';
7
7
  ---
8
8
  category: components
9
9
  ---
10
+ @tsProps
10
11
  **/
11
12
  declare class Rating extends Component<RatingProps> {
12
13
  static readonly componentId = "Rating";
13
14
  static allowedProps: readonly (keyof {
14
15
  label: string;
15
- formatValueText?: ((...args: any[]) => any) | undefined;
16
+ formatValueText?: ((filled: number, iconCount: number) => string) | undefined;
16
17
  iconCount?: 3 | 5 | undefined;
17
18
  size?: "small" | "medium" | "large" | undefined;
18
19
  valueMax?: number | undefined;
19
20
  valueNow?: number | undefined;
20
21
  animateFill?: boolean | undefined;
21
- margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined; /**
22
- ---
23
- category: components
24
- ---
25
- **/
22
+ margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
26
23
  })[];
27
24
  static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
28
25
  label: string;
29
- formatValueText?: ((...args: any[]) => any) | undefined;
26
+ formatValueText?: ((filled: number, iconCount: number) => string) | undefined;
30
27
  iconCount?: 3 | 5 | undefined;
31
28
  size?: "small" | "medium" | "large" | undefined;
32
29
  valueMax?: number | undefined;
33
30
  valueNow?: number | undefined;
34
31
  animateFill?: boolean | undefined;
35
- margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined; /**
36
- ---
37
- category: components
38
- ---
39
- **/
32
+ margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
40
33
  }>;
41
34
  static defaultProps: {
42
35
  animateFill: boolean;
43
- formatValueText: (filled: any, iconCount: any) => string;
36
+ formatValueText: (filled: number, iconCount: number) => string;
44
37
  iconCount: number;
45
38
  size: string;
46
39
  valueNow: number;
@@ -50,7 +43,7 @@ declare class Rating extends Component<RatingProps> {
50
43
  handleRef: (el: Element | null) => void;
51
44
  componentDidMount(): void;
52
45
  componentDidUpdate(): void;
53
- get filled(): number | undefined;
46
+ get filled(): number;
54
47
  get empty(): number;
55
48
  render(): jsx.JSX.Element;
56
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Rating/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMjC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAG1C;;;;GAIG;AACH,cAEM,MAAO,SAAQ,SAAS,CAAC,WAAW,CAAC;IACzC,MAAM,CAAC,QAAQ,CAAC,WAAW,YAAW;IAEtC,MAAM,CAAC,YAAY;;;;;;;;0GAVrB;;;;WAIG;SAMiC;IAClC,MAAM,CAAC,SAAS;;;;;;;;0GAXlB;;;;WAIG;OAO2B;IAE5B,MAAM,CAAC,YAAY;;;;;;MAOlB;IAED,MAAM,CAAC,IAAI,oBAAa;IAExB,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAE9B;IAED,iBAAiB;IAIjB,kBAAkB;IAIlB,IAAI,MAAM,uBAiBT;IAED,IAAI,KAAK,WAGR;IAED,MAAM;CA6CP;AAED,eAAe,MAAM,CAAA;AACrB,OAAO,EAAE,MAAM,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Rating/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMjC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAG1C;;;;;GAKG;AACH,cAEM,MAAO,SAAQ,SAAS,CAAC,WAAW,CAAC;IACzC,MAAM,CAAC,QAAQ,CAAC,WAAW,YAAW;IAEtC,MAAM,CAAC,YAAY;;;;;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;kCAES,MAAM,aAAa,MAAM;;;;MAKpD;IAED,MAAM,CAAC,IAAI,oBAAa;IAExB,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAE9B;IAED,iBAAiB;IAIjB,kBAAkB;IAIlB,IAAI,MAAM,WAcT;IAED,IAAI,KAAK,WAER;IAED,MAAM;CAmCP;AAED,eAAe,MAAM,CAAA;AACrB,OAAO,EAAE,MAAM,EAAE,CAAA"}
@@ -1,13 +1,39 @@
1
1
  import type { Spacing, WithStyleProps, ComponentStyle } from '@instructure/emotion';
2
2
  import type { OtherHTMLAttributes, PropValidators } from '@instructure/shared-types';
3
3
  declare type RatingOwnProps = {
4
+ /**
5
+ * A label is required for accessibility
6
+ */
4
7
  label: string;
5
- formatValueText?: (...args: any[]) => any;
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
+ */
6
15
  iconCount?: 3 | 5;
16
+ /**
17
+ * Choose from different rating icon sizes
18
+ */
7
19
  size?: 'small' | 'medium' | 'large';
20
+ /**
21
+ * The maximum rating (defaults to iconCount)
22
+ */
8
23
  valueMax?: number;
24
+ /**
25
+ * The current rating
26
+ */
9
27
  valueNow?: number;
28
+ /**
29
+ * Set to make the icons animate when they become filled
30
+ */
10
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
+ */
11
37
  margin?: Spacing;
12
38
  };
13
39
  declare type PropKeys = keyof RatingOwnProps;
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Rating/props.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACf,MAAM,2BAA2B,CAAA;AAElC,aAAK,cAAc,GAAG;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,eAAe,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACzC,SAAS,CAAC,EAAE,CAAC,GAAG,CAAC,CAAA;IACjB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,cAAc,CAAA;AAEpC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,WAAW,GAAG,cAAc,GAC/B,cAAc,CAAC,IAAI,EAAE,WAAW,CAAC,GACjC,mBAAmB,CAAC,cAAc,CAAC,CAAA;AAErC,aAAK,WAAW,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAA;AAE3C,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAmCvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eASnB,CAAA;AAED,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,CAA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AAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
@@ -8,6 +8,7 @@ import type { RatingIconProps, RatingIconState } from './props';
8
8
  parent: Rating
9
9
  id: Rating.Icon
10
10
  ---
11
+ @tsProps
11
12
  **/
12
13
  declare class RatingIcon extends Component<RatingIconProps, RatingIconState> {
13
14
  static readonly componentId = "Rating.Icon";
@@ -29,9 +30,9 @@ declare class RatingIcon extends Component<RatingIconProps, RatingIconState> {
29
30
  filled: boolean;
30
31
  size: string;
31
32
  };
32
- ref: Element | null;
33
- constructor(props: any);
34
- _timeouts: never[];
33
+ ref: HTMLSpanElement | null;
34
+ constructor(props: RatingIconProps);
35
+ _timeouts: ReturnType<typeof setTimeout>[];
35
36
  _animation: RequestAnimationFrameType | undefined;
36
37
  componentDidMount(): void;
37
38
  componentDidUpdate(prevProps: RatingIconProps): void;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/RatingIcon/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAIjC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAA;AAG1E,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAGrD,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAG/D;;;;;GAKG;AACH,cACM,UAAW,SAAQ,SAAS,CAAC,eAAe,EAAE,eAAe,CAAC;IAClE,MAAM,CAAC,QAAQ,CAAC,WAAW,iBAAgB;IAE3C,MAAM,CAAC,YAAY;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;;;MAKlB;IAED,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;gBAGd,KAAK,KAAA;IASjB,SAAS,UAAK;IACd,UAAU,EAAE,yBAAyB,GAAG,SAAS,CAAA;IAEjD,iBAAiB;IAQjB,kBAAkB,CAAC,SAAS,EAAE,eAAe;IAW7C,oBAAoB;IAKpB,cAAc;;MAEb;IAED,IAAI,aAMH;IAED,MAAM;CAuBP;AAED,eAAe,UAAU,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/RatingIcon/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAIjC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAA;AAG1E,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAGrD,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAG/D;;;;;;GAMG;AACH,cACM,UAAW,SAAQ,SAAS,CAAC,eAAe,EAAE,eAAe,CAAC;IAClE,MAAM,CAAC,QAAQ,CAAC,WAAW,iBAAgB;IAE3C,MAAM,CAAC,YAAY;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;OAAY;IAE5B,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;CAuBP;AAED,eAAe,UAAU,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,CAAA"}
package/LICENSE.md DELETED
@@ -1,27 +0,0 @@
1
- ---
2
- title: The MIT License (MIT)
3
- category: Getting Started
4
- order: 9
5
- ---
6
-
7
- # The MIT License (MIT)
8
-
9
- Copyright (c) 2015 Instructure, Inc.
10
-
11
- **Permission is hereby granted, free of charge, to any person obtaining a copy
12
- of this software and associated documentation files (the "Software"), to deal
13
- in the Software without restriction, including without limitation the rights
14
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
- copies of the Software, and to permit persons to whom the Software is
16
- furnished to do so, subject to the following conditions.**
17
-
18
- The above copyright notice and this permission notice shall be included in all
19
- copies or substantial portions of the Software.
20
-
21
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
- SOFTWARE.