pebble-web 2.2.9 → 2.4.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.
Files changed (40) hide show
  1. package/dist/components/Option.d.ts +2 -10
  2. package/dist/components/Rating.d.ts +9 -0
  3. package/dist/components/index.d.ts +2 -1
  4. package/dist/components/styles/Button.styles.d.ts +3 -3
  5. package/dist/components/styles/Rating.styles.d.ts +4 -0
  6. package/dist/components/typings/Option.d.ts +1 -0
  7. package/dist/components/typings/OptionGroupCheckBox.d.ts +1 -0
  8. package/dist/components/typings/Rating.d.ts +13 -0
  9. package/dist/components/typings/Search.d.ts +1 -0
  10. package/dist/pebble-web.dev.js +208 -93
  11. package/dist/pebble-web.dev.js.map +1 -1
  12. package/dist/pebble-web.es.dev.js +143 -45
  13. package/dist/pebble-web.es.dev.js.map +1 -1
  14. package/dist/pebble-web.es.js +108 -13
  15. package/dist/pebble-web.es.js.map +1 -1
  16. package/dist/pebble-web.js +173 -61
  17. package/dist/pebble-web.js.map +1 -1
  18. package/dist/pebble-web.module.dev.js +208 -94
  19. package/dist/pebble-web.module.dev.js.map +1 -1
  20. package/dist/pebble-web.module.js +173 -62
  21. package/dist/pebble-web.module.js.map +1 -1
  22. package/dist/pebble-web.umd.dev.js +208 -93
  23. package/dist/pebble-web.umd.dev.js.map +1 -1
  24. package/dist/pebble-web.umd.js +173 -61
  25. package/dist/pebble-web.umd.js.map +1 -1
  26. package/package.json +3 -4
  27. package/src/components/Option.tsx +7 -8
  28. package/src/components/OptionGroupCheckBox.tsx +10 -2
  29. package/src/components/Rating.tsx +82 -0
  30. package/src/components/Search.tsx +5 -1
  31. package/src/components/__tests__/__snapshots__/option.test.tsx.snap +24 -42
  32. package/src/components/__tests__/__snapshots__/optionGroup.test.tsx.snap +24 -42
  33. package/src/components/__tests__/rating.test.tsx +35 -0
  34. package/src/components/index.ts +2 -0
  35. package/src/components/styles/Options.styles.ts +1 -1
  36. package/src/components/styles/Rating.styles.ts +22 -0
  37. package/src/components/typings/Option.ts +1 -0
  38. package/src/components/typings/OptionGroupCheckBox.ts +1 -0
  39. package/src/components/typings/Rating.ts +12 -0
  40. package/src/components/typings/Search.ts +1 -0
@@ -1,19 +1,11 @@
1
1
  import * as React from "react";
2
2
  import { OptionProps } from "./typings/Option";
3
3
  declare const defaultProps: {
4
- rightElement: ({ isSelected, multiSelect, indeterminate }: {
5
- isSelected: boolean;
6
- multiSelect: boolean;
7
- indeterminate?: boolean | undefined;
8
- }) => JSX.Element | null;
4
+ rightElement: <T extends unknown>({ isSelected, multiSelect, indeterminate, iconClassName }: OptionProps<T>) => JSX.Element | null;
9
5
  };
10
6
  declare class Option<OptionType> extends React.Component<OptionProps<OptionType> & Required<typeof defaultProps>> {
11
7
  static defaultProps: {
12
- rightElement: ({ isSelected, multiSelect, indeterminate }: {
13
- isSelected: boolean;
14
- multiSelect: boolean;
15
- indeterminate?: boolean | undefined;
16
- }) => JSX.Element | null;
8
+ rightElement: <T extends unknown>({ isSelected, multiSelect, indeterminate, iconClassName }: OptionProps<T>) => JSX.Element | null;
17
9
  };
18
10
  render(): JSX.Element;
19
11
  }
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ import { RatingProps, RatingState } from "./typings/Rating";
3
+ declare class Rating extends React.PureComponent<RatingProps, RatingState> {
4
+ constructor(props: RatingProps);
5
+ componentDidUpdate(prevProps: RatingProps): void;
6
+ setRating: (rating: number) => void;
7
+ render(): JSX.Element;
8
+ }
9
+ export default Rating;
@@ -21,6 +21,7 @@ import PopUp from "./PopUp";
21
21
  import PresetCalendar from "./PresetCalendar";
22
22
  import Radio from "./Radio";
23
23
  import RadioGroup from "./RadioGroup";
24
+ import Rating from "./Rating";
24
25
  import Search from "./Search";
25
26
  import SecondaryInput from "./SecondaryInput";
26
27
  import Select from "./Select";
@@ -35,4 +36,4 @@ import TimePicker from "./TimePicker";
35
36
  import Toast from "./Toast";
36
37
  import Tooltip from "./Tooltip";
37
38
  import TypeAhead from "./TypeAhead";
38
- export { BrowserBasedDateInput, Button, Calendar, Checkbox, CheckboxGroup, DateInput, DropDown, DropDownButton, Input, Loader, Logo, Message, Modal, NativeDateInput, Option, OptionGroup, OptionGroupCheckBox, OptionGroupRadio, OutsideClick, PhoneNumberInput, Popper, PopUp, PresetCalendar, Radio, RadioGroup, Search, SecondaryInput, Select, SideBar, Slider, Stepper, Switch, Tabs, TabSection, Tag, Text, TimePicker, Toast, Tooltip, TypeAhead };
39
+ export { BrowserBasedDateInput, Button, Calendar, Checkbox, CheckboxGroup, DateInput, DropDown, DropDownButton, Input, Loader, Logo, Message, Modal, NativeDateInput, Option, OptionGroup, OptionGroupCheckBox, OptionGroupRadio, OutsideClick, PhoneNumberInput, Popper, PopUp, PresetCalendar, Radio, RadioGroup, Rating, Search, SecondaryInput, Select, SideBar, Slider, Stepper, Switch, Tabs, TabSection, Tag, Text, TimePicker, Toast, Tooltip, TypeAhead };
@@ -5,7 +5,7 @@ declare const styleBasedOnSize: {
5
5
  height: number;
6
6
  minWidth: number;
7
7
  } | {
8
- fontSize: string | number;
8
+ fontSize: import("csstype").FontSizeProperty<number>;
9
9
  fontWeight: import("csstype").FontWeightProperty;
10
10
  color: string;
11
11
  height: number;
@@ -15,7 +15,7 @@ declare const styleBasedOnSize: {
15
15
  height: number;
16
16
  minWidth: number;
17
17
  } | {
18
- fontSize: string | number;
18
+ fontSize: import("csstype").FontSizeProperty<number>;
19
19
  fontWeight: import("csstype").FontWeightProperty;
20
20
  color: string;
21
21
  height: number;
@@ -25,7 +25,7 @@ declare const styleBasedOnSize: {
25
25
  height: number;
26
26
  minWidth: number;
27
27
  } | {
28
- fontSize: string | number;
28
+ fontSize: import("csstype").FontSizeProperty<number>;
29
29
  fontWeight: import("csstype").FontWeightProperty;
30
30
  color: string;
31
31
  height: number;
@@ -0,0 +1,4 @@
1
+ export declare const wrapStyle: string;
2
+ export declare const disabledStyle: string;
3
+ export declare const unSelectedStar: string;
4
+ export declare const selectedStar: string;
@@ -6,5 +6,6 @@ export interface OptionProps<OptionType> extends Omit<ControlProps<OptionType>,
6
6
  isSelected?: boolean;
7
7
  multiSelect?: boolean;
8
8
  labelClassName?: string;
9
+ leftElement?: (props: OptionProps<OptionType>) => React.ReactNode;
9
10
  rightElement?: (props: OptionProps<OptionType>) => React.ReactNode;
10
11
  }
@@ -1,5 +1,6 @@
1
1
  import { CommonProps, Extras } from "./OptionGroup";
2
2
  export interface OptionGroupCheckBoxProps<OptionType> extends CommonProps {
3
+ wrapClassName?: string;
3
4
  onChange: (value: OptionType[], extras: Extras) => void;
4
5
  /**
5
6
  * @deprecated use isSelected
@@ -0,0 +1,13 @@
1
+ export interface RatingProps {
2
+ name: string;
3
+ maxRating: number;
4
+ value: number;
5
+ onChange: (value: number) => void;
6
+ disabled?: boolean;
7
+ className?: string;
8
+ }
9
+ export interface RatingState {
10
+ stars: Array<{
11
+ active: boolean;
12
+ }>;
13
+ }
@@ -8,4 +8,5 @@ export interface SearchProps {
8
8
  className?: string;
9
9
  clearable?: boolean;
10
10
  inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
11
+ loading?: boolean;
11
12
  }