@openedx/paragon 22.1.1 → 22.2.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.
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ declare const STYLE_VARIANTS: readonly ["primary", "success", "error", "warning"];
3
+ export type BubbleVariant = typeof STYLE_VARIANTS[number];
4
+ export interface BubbleProps {
5
+ children: React.ReactNode;
6
+ variant?: BubbleVariant;
7
+ disabled?: boolean;
8
+ className?: string;
9
+ expandable?: boolean;
10
+ }
11
+ declare const Bubble: React.ForwardRefExoticComponent<BubbleProps & React.RefAttributes<HTMLDivElement>>;
12
+ export default Bubble;
@@ -0,0 +1,28 @@
1
+ import React, { KeyboardEventHandler, MouseEventHandler } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ export interface ChipIconProps {
4
+ className: string;
5
+ src: React.ReactElement | Function;
6
+ onClick?: KeyboardEventHandler & MouseEventHandler;
7
+ alt?: string;
8
+ variant: string;
9
+ disabled?: boolean;
10
+ }
11
+ declare function ChipIcon({ className, src, onClick, alt, variant, disabled, }: ChipIconProps): JSX.Element;
12
+ declare namespace ChipIcon {
13
+ var propTypes: {
14
+ className: PropTypes.Validator<string>;
15
+ src: PropTypes.Validator<NonNullable<NonNullable<PropTypes.ReactElementLike | ((...args: any[]) => any) | null | undefined>>>;
16
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
17
+ alt: PropTypes.Requireable<string>;
18
+ variant: PropTypes.Requireable<string>;
19
+ disabled: PropTypes.Requireable<boolean>;
20
+ };
21
+ var defaultProps: {
22
+ onClick: undefined;
23
+ alt: undefined;
24
+ variant: any;
25
+ disabled: boolean;
26
+ };
27
+ }
28
+ export default ChipIcon;
@@ -0,0 +1,18 @@
1
+ import React, { KeyboardEventHandler, MouseEventHandler } from 'react';
2
+ export declare const CHIP_PGN_CLASS = "pgn__chip";
3
+ export interface IChip {
4
+ children: React.ReactNode;
5
+ onClick?: KeyboardEventHandler & MouseEventHandler;
6
+ className?: string;
7
+ variant?: string;
8
+ iconBefore?: React.ReactElement | Function;
9
+ iconBeforeAlt?: string;
10
+ iconAfter?: React.ReactElement | Function;
11
+ iconAfterAlt?: string;
12
+ onIconBeforeClick?: KeyboardEventHandler & MouseEventHandler;
13
+ onIconAfterClick?: KeyboardEventHandler & MouseEventHandler;
14
+ disabled?: boolean;
15
+ isSelected?: boolean;
16
+ }
17
+ declare const Chip: React.ForwardRefExoticComponent<IChip & React.RefAttributes<HTMLDivElement>>;
18
+ export default Chip;
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ export interface OverflowScrollContextProps {
3
+ setOverflowRef: () => void;
4
+ isScrolledToStart: boolean;
5
+ isScrolledToEnd: boolean;
6
+ scrollToPrevious: () => void;
7
+ scrollToNext: () => void;
8
+ }
9
+ export interface ChipCarouselProps {
10
+ className?: string;
11
+ items: Array<React.ReactElement>;
12
+ ariaLabel: string;
13
+ disableOpacityMasks?: boolean;
14
+ onScrollPrevious?: () => void;
15
+ onScrollNext?: () => void;
16
+ canScrollHorizontal?: boolean;
17
+ offset?: number | string;
18
+ offsetType?: 'percentage' | 'fixed';
19
+ gap?: number;
20
+ }
21
+ declare const ChipCarousel: React.ForwardRefExoticComponent<ChipCarouselProps & React.RefAttributes<HTMLDivElement>>;
22
+ export default ChipCarousel;
@@ -1,14 +1,14 @@
1
1
  import React from 'react';
2
2
 
3
- export interface IconProps {
3
+ export interface IconProps extends React.ComponentPropsWithoutRef<'span'> {
4
4
  src?: React.ReactElement | Function;
5
5
  svgAttrs?: {
6
6
  'aria-label'?: string;
7
7
  'aria-labelledby'?: string;
8
8
  };
9
- id?: string;
9
+ id?: string | null;
10
10
  size?: 'xs' | 'sm' | 'md' | 'lg';
11
- className?: string;
11
+ className?: string | string[];
12
12
  hidden?: boolean;
13
13
  screenReaderText?: React.ReactNode;
14
14
  }
@@ -0,0 +1,216 @@
1
+ /* eslint-disable max-len, one-var, one-var-declaration-per-line */
2
+ // each line in this file corresponds with the line in index.js
3
+
4
+ // // // // // // // // // // // // // // // // // // // // // // // // // // //
5
+ // Things that have types
6
+ // // // // // // // // // // // // // // // // // // // // // // // // // // //
7
+ export { default as Bubble } from './Bubble';
8
+ export { default as Chip, CHIP_PGN_CLASS } from './Chip';
9
+ export { default as ChipCarousel } from './ChipCarousel';
10
+ export { default as Icon } from './Icon';
11
+
12
+ // // // // // // // // // // // // // // // // // // // // // // // // // // //
13
+ // Things that don't have types
14
+ // // // // // // // // // // // // // // // // // // // // // // // // // // //
15
+ export const asInput: any; // from './asInput';
16
+ export const ActionRow: any; // from './ActionRow';
17
+ export const Alert: any, ALERT_CLOSE_LABEL_TEXT: string; // from './Alert';
18
+ export const Annotation: any; // from './Annotation';
19
+ export const Avatar: any; // from './Avatar';
20
+ export const AvatarButton: any; // from './AvatarButton';
21
+ export const Badge: any; // from './Badge';
22
+ export const Breadcrumb: any; // from './Breadcrumb';
23
+ export const Button: any, ButtonGroup: any, ButtonToolbar: any; // from './Button';
24
+ export const
25
+ Card: any,
26
+ CardColumns: any,
27
+ CardDeck: any,
28
+ CardImg: any,
29
+ CardGroup: any,
30
+ CardGrid: any,
31
+ CardCarousel: any,
32
+ CARD_VARIANTS: any;
33
+ // from './Card';
34
+ export const
35
+ Carousel: any, CarouselItem: any, CAROUSEL_NEXT_LABEL_TEXT: any, CAROUSEL_PREV_LABEL_TEXT: any;
36
+ // from './Carousel';
37
+ export const CheckBox: any; // from './CheckBox';
38
+ export const CheckBoxGroup: any; // from './CheckBoxGroup';
39
+ export const CloseButton: any; // from './CloseButton';
40
+ export const Container: any; // from './Container';
41
+ export const Layout: any, Col: any, Row: any; // from './Layout';
42
+ export const Collapse: any; // from './Collapse';
43
+ export const Collapsible: any; // from './Collapsible';
44
+ export const Scrollable: any; // from './Scrollable';
45
+ export const
46
+ Dropdown: any,
47
+ DropdownToggle: any,
48
+ DropdownButton: any,
49
+ SplitButton: any;
50
+ // from './Dropdown';
51
+ export const Fade: any; // from './Fade';
52
+ export const Fieldset: any; // from './Fieldset';
53
+ export const
54
+ Form: any,
55
+ RadioControl: any,
56
+ CheckboxControl: any,
57
+ SwitchControl: any,
58
+ FormSwitchSet: any,
59
+ FormControl: any,
60
+ FormControlDecoratorGroup: any,
61
+ FormControlFeedback: any,
62
+ FormCheck: any,
63
+ FormFile: any,
64
+ FormRadio: any,
65
+ FormRadioSet: any,
66
+ FormRadioSetContext: any,
67
+ FormGroup: any,
68
+ FormLabel: any,
69
+ useCheckboxSetValues: any,
70
+ FormText: any,
71
+ FormAutosuggest: any,
72
+ FormAutosuggestOption: any,
73
+ InputGroup: any;
74
+ // from './Form';
75
+ export const Hyperlink: any, HYPER_LINK_EXTERNAL_LINK_ALT_TEXT: string, HYPER_LINK_EXTERNAL_LINK_TITLE: string; // from './Hyperlink';
76
+ export const IconButton: any, IconButtonWithTooltip: any; // from './IconButton';
77
+ export const IconButtonToggle: any; // from './IconButtonToggle';
78
+ export const Input: any; // from './Input';
79
+ export const InputSelect: any; // from './InputSelect';
80
+ export const InputText: any; // from './InputText';
81
+ export const Image: any, Figure; // from './Image';
82
+ export const ListBox: any; // from './ListBox';
83
+ export const ListBoxOption: any; // from './ListBoxOption';
84
+ export const MailtoLink: any, MAIL_TO_LINK_EXTERNAL_LINK_ALTERNATIVE_TEXT: string, MAIL_TO_LINK_EXTERNAL_LINK_TITLE: string; // from './MailtoLink';
85
+ export const Media: any; // from './Media';
86
+ export const Menu: any; // from './Menu';
87
+ export const MenuItem: any; // from './Menu/MenuItem';
88
+ export const SelectMenu: any, SELECT_MENU_DEFAULT_MESSAGE: string; // from './Menu/SelectMenu';
89
+ export const Modal: any; // from './Modal';
90
+ export const ModalCloseButton: any; // from './Modal/ModalCloseButton';
91
+ export const FullscreenModal: any, FULLSCREEN_MODAL_CLOSE_LABEL: string; // from './Modal/FullscreenModal';
92
+ export const MarketingModal: any; // from './Modal/MarketingModal';
93
+ export const StandardModal: any, STANDARD_MODAL_CLOSE_LABEL: string; // from './Modal/StandardModal';
94
+ export const AlertModal: any; // from './Modal/AlertModal';
95
+ export const ModalLayer: any; // from './Modal/ModalLayer';
96
+ export const ModalDialog: any, MODAL_DIALOG_CLOSE_LABEL: string; // from './Modal/ModalDialog';
97
+ export const ModalPopup: any; // from './Modal/ModalPopup';
98
+ export const ModalContext: any; // from './Modal/ModalContext';
99
+ export const Portal: any; // from './Modal/Portal';
100
+ export const PopperElement: any; // from './Modal/PopperElement';
101
+
102
+ export const
103
+ Nav: any,
104
+ NavDropdown: any,
105
+ NavItem: any,
106
+ NavLink: any;
107
+ // from './Nav';
108
+ export const Navbar: any, NavbarBrand: any, NAVBAR_LABEL: string; // from './Navbar';
109
+ export const Overlay: any, OverlayTrigger: any; // from './Overlay';
110
+ export const PageBanner: any, PAGE_BANNER_DISMISS_ALT_TEXT: string; // from './PageBanner';
111
+ export const
112
+ Pagination: any,
113
+ PAGINATION_BUTTON_LABEL_PREV: string,
114
+ PAGINATION_BUTTON_ICON_BUTTON_NEXT_ALT: string,
115
+ PAGINATION_BUTTON_ICON_BUTTON_PREV_ALT: string,
116
+ PAGINATION_BUTTON_LABEL_PAGE_OF_COUNT: string,
117
+ PAGINATION_BUTTON_LABEL_CURRENT_PAGE: string,
118
+ PAGINATION_BUTTON_LABEL_NEXT: string,
119
+ PAGINATION_BUTTON_LABEL_PAGE: string;
120
+ // from './Pagination';
121
+ export const Popover: any, PopoverTitle: any, PopoverContent: any; // from './Popover';
122
+ export const ProgressBar: any; // from './ProgressBar';
123
+ export const ProductTour: any; // from './ProductTour';
124
+ export const RadioButtonGroup: any, RadioButton: any; // from './RadioButtonGroup';
125
+ export const ResponsiveEmbed: any; // from './ResponsiveEmbed';
126
+ export const
127
+ SearchField: any,
128
+ SEARCH_FIELD_SCREEN_READER_TEXT_LABEL: string,
129
+ SEARCH_FIELD_SCREEN_READER_TEXT_CLEAR_BUTTON: string,
130
+ SEARCH_FIELD_SCREEN_READER_TEXT_SUBMIT_BUTTON: string,
131
+ SEARCH_FIELD_BUTTON_TEXT: string;
132
+ // from './SearchField';
133
+ export const Sheet: any; // from './Sheet';
134
+ export const Spinner: any; // from './Spinner';
135
+ export const Stepper: any; // from './Stepper';
136
+ export const StatefulButton: any; // from './StatefulButton';
137
+ export const StatusAlert: any; // from './StatusAlert';
138
+ export const Table: any; // from './Table';
139
+ export const
140
+ Tabs: any,
141
+ Tab: any,
142
+ TabContainer: any,
143
+ TabContent: any,
144
+ TabPane: any;
145
+ // from './Tabs';
146
+ export const TextArea: any; // from './TextArea';
147
+ export const Toast: any, TOAST_CLOSE_LABEL_TEXT: string, TOAST_DELAY: number; // from './Toast';
148
+ export const Tooltip: any; // from './Tooltip';
149
+ export const ValidationFormGroup: any; // from './ValidationFormGroup';
150
+ export const TransitionReplace: any; // from './TransitionReplace';
151
+ export const ValidationMessage: any; // from './ValidationMessage';
152
+ export const DataTable: any; // from './DataTable';
153
+ export const TextFilter: any; // from './DataTable/filters/TextFilter';
154
+ export const CheckboxFilter: any; // from './DataTable/filters/CheckboxFilter';
155
+ export const DropdownFilter: any; // from './DataTable/filters/DropdownFilter';
156
+ export const MultiSelectDropdownFilter: any; // from './DataTable/filters/MultiSelectDropdownFilter';
157
+ export const TableHeaderCell: any; // from './DataTable/TableHeaderCell';
158
+ export const TableCell: any; // from './DataTable/TableCell';
159
+ export const TableFilters: any, TABLE_FILTERS_BUTTON_TEXT: string; // from './DataTable/TableFilters';
160
+ export const TableHeader: any; // from './DataTable/TableHeaderRow';
161
+ export const TableRow: any; // from './DataTable/TableRow';
162
+ export const TablePagination: any; // from './DataTable/TablePagination';
163
+ export const TablePaginationMinimal: any; // from './DataTable/TablePaginationMinimal';
164
+ export const DataTableContext: any; // from './DataTable/DataTableContext';
165
+ export const BulkActions: any; // from './DataTable/BulkActions';
166
+ export const TableControlBar: any; // from './DataTable/TableControlBar';
167
+ export const TableFooter: any; // from './DataTable/TableFooter';
168
+ export const CardView: any; // from './DataTable/CardView';
169
+ export const Skeleton: any, SkeletonTheme: any; // from './Skeleton/index';
170
+ export const Stack: any; // from './Stack';
171
+ export const ToggleButton: any, ToggleButtonGroup: any; // from './ToggleButton';
172
+ export const Sticky: any; // from './Sticky';
173
+ export const SelectableBox: any; // from './SelectableBox';
174
+ export const breakpoints: any; // from './utils/breakpoints';
175
+ export const Variant: any; // from './utils/constants';
176
+ export const useWindowSize: any; // from './hooks/useWindowSize';
177
+ export const useToggle: any; // from './hooks/useToggle';
178
+ export const useArrowKeyNavigation: any; // from './hooks/useArrowKeyNavigation';
179
+ export const useIndexOfLastVisibleChild: any; // from './hooks/useIndexOfLastVisibleChild';
180
+ export const useIsVisible: any; // from './hooks/useIsVisible';
181
+ export const
182
+ OverflowScrollContext: any,
183
+ OverflowScroll: any,
184
+ useOverflowScroll: any,
185
+ useOverflowScrollItems: any;
186
+ // from './OverflowScroll';
187
+ export const Dropzone: any; // from './Dropzone';
188
+ export const messages: any; // from './i18n';
189
+ export const Truncate: any; // from './Truncate';
190
+ export const ColorPicker: any; // from './ColorPicker';
191
+
192
+ // Pass through any needed whole third-party library functionality
193
+ // useTable for example is needed to use the DataTable component seamlessly
194
+ // rather than setting a peer dependency in this project, we opt to tightly
195
+ // couple these dependencies by passing through needed functionality.
196
+ export {
197
+ default as MediaQuery,
198
+ useMediaQuery,
199
+ Context as ResponsiveContext,
200
+ } from 'react-responsive';
201
+ export {
202
+ useTable,
203
+ useFilters,
204
+ useGlobalFilter,
205
+ useSortBy,
206
+ useGroupBy,
207
+ useExpanded,
208
+ usePagination,
209
+ useRowSelect,
210
+ useRowState,
211
+ useColumnOrder,
212
+ useResizeColumns,
213
+ useBlockLayout,
214
+ useAbsoluteLayout,
215
+ useFlexLayout,
216
+ } from 'react-table';
package/dist/index.js CHANGED
@@ -1,3 +1,17 @@
1
+ // To keep this file in sync with the .d.ts file, it's in the same order
2
+ // and each line number is the same
3
+
4
+ // // // // // // // // // // // // // // // // // // // // // // // // // // //
5
+ // Things that have types
6
+ // // // // // // // // // // // // // // // // // // // // // // // // // // //
7
+ export { default as Bubble } from './Bubble';
8
+ export { default as Chip, CHIP_PGN_CLASS } from './Chip';
9
+ export { default as ChipCarousel } from './ChipCarousel';
10
+ export { default as Icon } from './Icon';
11
+
12
+ // // // // // // // // // // // // // // // // // // // // // // // // // // //
13
+ // Things that don't have types
14
+ // // // // // // // // // // // // // // // // // // // // // // // // // // //
1
15
  export { default as asInput } from './asInput';
2
16
  export { default as ActionRow } from './ActionRow';
3
17
  export { default as Alert, ALERT_CLOSE_LABEL_TEXT } from './Alert';
@@ -22,8 +36,6 @@ export {
22
36
  } from './Carousel';
23
37
  export { default as CheckBox } from './CheckBox';
24
38
  export { default as CheckBoxGroup } from './CheckBoxGroup';
25
- export { default as Chip, CHIP_PGN_CLASS } from './Chip';
26
- export { default as ChipCarousel } from './ChipCarousel';
27
39
  export { default as CloseButton } from './CloseButton';
28
40
  export { default as Container } from './Container';
29
41
  export { default as Layout, Col, Row } from './Layout';
@@ -61,7 +73,6 @@ export {
61
73
  InputGroup,
62
74
  } from './Form';
63
75
  export { default as Hyperlink, HYPER_LINK_EXTERNAL_LINK_ALT_TEXT, HYPER_LINK_EXTERNAL_LINK_TITLE } from './Hyperlink';
64
- export { default as Icon } from './Icon';
65
76
  export { default as IconButton, IconButtonWithTooltip } from './IconButton';
66
77
  export { default as IconButtonToggle } from './IconButtonToggle';
67
78
  export { default as Input } from './Input';
@@ -155,6 +166,7 @@ export { default as BulkActions } from './DataTable/BulkActions';
155
166
  export { default as TableControlBar } from './DataTable/TableControlBar';
156
167
  export { default as TableFooter } from './DataTable/TableFooter';
157
168
  export { default as CardView } from './DataTable/CardView';
169
+ export { default as Skeleton, SkeletonTheme } from './Skeleton/index';
158
170
  export { default as Stack } from './Stack';
159
171
  export { default as ToggleButton, ToggleButtonGroup } from './ToggleButton';
160
172
  export { default as Sticky } from './Sticky';
@@ -172,6 +184,10 @@ export {
172
184
  useOverflowScroll,
173
185
  useOverflowScrollItems,
174
186
  } from './OverflowScroll';
187
+ export { default as Dropzone } from './Dropzone';
188
+ export { default as messages } from './i18n';
189
+ export { default as Truncate } from './Truncate';
190
+ export { default as ColorPicker } from './ColorPicker';
175
191
 
176
192
  // Pass through any needed whole third-party library functionality
177
193
  // useTable for example is needed to use the DataTable component seamlessly
@@ -198,10 +214,3 @@ export {
198
214
  useAbsoluteLayout,
199
215
  useFlexLayout,
200
216
  } from 'react-table';
201
- export { default as Skeleton, SkeletonTheme } from './Skeleton/index';
202
- export { default as Bubble } from './Bubble';
203
- export { default as Dropzone } from './Dropzone';
204
-
205
- export { default as messages } from './i18n';
206
- export { default as Truncate } from './Truncate';
207
- export { default as ColorPicker } from './ColorPicker';
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ export declare enum DeprTypes {
3
+ MOVED = "MOVED",
4
+ REMOVED = "REMOVED",
5
+ FORMAT = "FORMAT",
6
+ MOVED_AND_FORMAT = "MOVED_AND_FORMAT"
7
+ }
8
+ export interface DeprecatedProps extends Record<string, any> {
9
+ deprType: DeprTypes;
10
+ newName?: string;
11
+ expect?: (propValue: any) => boolean;
12
+ transform?: (propValue: any, allProps: Record<string, any>) => any;
13
+ message?: string;
14
+ }
15
+ declare function withDeprecatedProps<T extends Record<string, any>>(WrappedComponent: React.ComponentType<any>, componentName: string, deprecatedProps: Record<string, DeprecatedProps>): any;
16
+ export default withDeprecatedProps;