@superdispatch/ui-lab 0.15.0 → 0.18.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.
@@ -1,11 +1,12 @@
1
1
  /// <reference types="react" />
2
- import { ReactNode, ForwardRefExoticComponent, RefAttributes, Ref, AriaAttributes, MouseEventHandler, FocusEventHandler, ReactChild, MouseEvent, ReactElement } from 'react';
2
+ import { ReactNode, ForwardRefExoticComponent, RefAttributes, Ref, AriaAttributes, MouseEventHandler, FocusEventHandler, HTMLAttributes, ComponentType, ReactElement, MouseEvent, Key, CSSProperties, ReactChild } from 'react';
3
3
  import { CSSTransition } from 'react-transition-group';
4
4
  import { CSSTransitionProps } from 'react-transition-group/CSSTransition';
5
5
  import { SpaceProp, NegativeSpaceProp, ResponsiveProp, ColorProp } from '@superdispatch/ui';
6
6
  import { Property } from 'csstype';
7
- import { ButtonBaseProps, TooltipProps } from '@material-ui/core';
7
+ import { ButtonBaseProps, AvatarProps, TooltipProps } from '@material-ui/core';
8
8
  import { FileRejection } from 'react-dropzone';
9
+ import { StyledComponent, DefaultTheme } from 'styled-components';
9
10
 
10
11
  declare type AlertSeverityProp = 'positive' | 'info' | 'caution' | 'critical';
11
12
  interface AlertProps {
@@ -117,6 +118,13 @@ interface AnchorButtonProps extends BaseButtonProps<HTMLAnchorElement> {
117
118
  }
118
119
  declare const AnchorButton: ForwardRefExoticComponent<AnchorButtonProps & RefAttributes<HTMLAnchorElement>>;
119
120
 
121
+ declare type ContainerProps = HTMLAttributes<HTMLDivElement> & {
122
+ fullViewportHeight?: boolean;
123
+ };
124
+ declare const Container: ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
125
+ fullViewportHeight?: boolean | undefined;
126
+ } & RefAttributes<HTMLDivElement>>;
127
+
120
128
  interface DescriptionItemProps {
121
129
  id?: string;
122
130
  'aria-label'?: string;
@@ -155,6 +163,94 @@ interface FileListItemProps {
155
163
  }
156
164
  declare const FileListItem: ForwardRefExoticComponent<FileListItemProps & RefAttributes<HTMLDivElement>>;
157
165
 
166
+ interface NavbarBottomBarItem {
167
+ active?: boolean;
168
+ value: string;
169
+ hasBadge?: boolean;
170
+ label: ReactNode;
171
+ icon: ReactNode;
172
+ onClick?: () => void;
173
+ component?: ComponentType<HTMLAttributes<HTMLElement>>;
174
+ }
175
+ interface NavbarBottomBarProps {
176
+ items: NavbarBottomBarItem[];
177
+ hasMenuBadge?: boolean;
178
+ }
179
+ declare function NavbarBottomBar({ items, hasMenuBadge, }: NavbarBottomBarProps): ReactElement;
180
+
181
+ declare const NavbarBadge: StyledComponent<"span", DefaultTheme, {}, never>;
182
+ declare const NavbarLabel: StyledComponent<"span", DefaultTheme, {}, never>;
183
+ interface NavbarItemProps {
184
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
185
+ component?: ComponentType<HTMLAttributes<HTMLElement>>;
186
+ label: ReactNode;
187
+ icon?: ReactNode;
188
+ badge?: ReactNode;
189
+ ident?: number;
190
+ gutter?: boolean;
191
+ variant?: 'danger' | 'primary';
192
+ }
193
+ declare function NavbarItem({ label, gutter, badge, icon, component, onClick, variant, ident, }: NavbarItemProps): ReactElement;
194
+
195
+ interface NavbarMenuItemProps {
196
+ icon?: ReactNode;
197
+ label: ReactNode;
198
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
199
+ component?: ComponentType<HTMLAttributes<HTMLElement>>;
200
+ }
201
+ declare function NavbarMenuItem({ label, icon, onClick, component, }: NavbarMenuItemProps): ReactElement;
202
+ interface NavbarItemOptions extends NavbarItemProps {
203
+ key: Key;
204
+ groupKey?: Key;
205
+ hide?: boolean;
206
+ }
207
+ interface NavbarListProps {
208
+ header: ReactNode;
209
+ items: NavbarItemOptions[];
210
+ footer?: ReactNode;
211
+ }
212
+ declare function NavbarList({ header, items, footer, }: NavbarListProps): ReactElement;
213
+
214
+ interface NavbarProps {
215
+ containerStyle?: CSSProperties;
216
+ children: ReactNode;
217
+ header?: ReactNode;
218
+ items: NavbarItemOptions[];
219
+ bottomItems: NavbarBottomBarItem[];
220
+ footer?: ReactNode;
221
+ hasExtraBadge?: boolean;
222
+ }
223
+ declare function Navbar({ footer, items, header, bottomItems, children, containerStyle, hasExtraBadge, }: NavbarProps): ReactElement;
224
+
225
+ interface NavbarAvatarProps extends Omit<AvatarProps, 'title'> {
226
+ title: ReactNode;
227
+ subtitle: ReactNode;
228
+ children: ReactNode;
229
+ }
230
+ declare function NavbarAvatar({ title, subtitle, children, ...props }: NavbarAvatarProps): ReactElement;
231
+
232
+
233
+ interface NavbarContextType {
234
+ isDrawerOpen: boolean;
235
+ isExpanded: boolean;
236
+ setIsExpanded: (value: boolean) => void;
237
+ setDrawerOpen: (value: boolean) => void;
238
+ }
239
+ declare function useNavbarContext(): NavbarContextType;
240
+
241
+ interface NavbarMenuItemOption {
242
+ key: Key;
243
+ icon: ReactNode;
244
+ label: ReactNode;
245
+ visible?: boolean;
246
+ onClick: () => void;
247
+ }
248
+ interface NavbarMenuProps {
249
+ children: ReactNode;
250
+ items: NavbarMenuItemOption[];
251
+ }
252
+ declare function NavbarMenu({ items, children }: NavbarMenuProps): ReactElement;
253
+
158
254
  interface SidebarProps {
159
255
  id?: string;
160
256
  title?: ReactNode;
@@ -226,4 +322,4 @@ interface TextBoxProps {
226
322
  }
227
323
  declare const TextBox: ForwardRefExoticComponent<TextBoxProps & RefAttributes<HTMLElement>>;
228
324
 
229
- export { Alert, AlertProps, AlertSeverityProp, AnchorButton, AnchorButtonProps, Banner, BorderRadiusProp, BorderWidthProp, Box, BoxProps, Button, ButtonArea, ButtonAreaProps, ButtonProps, ButtonSizeProp, ButtonVariantProp, DescriptionItem, DescriptionItemProps, FileDropZone, FileDropZoneProps, FileListItem, FileListItemProps, MarginProp, Sidebar, SidebarContainer, SidebarContainerProps, SidebarDivider, SidebarMenuItem, SidebarMenuItemAction, SidebarMenuItemActionProps, SidebarMenuItemAvatar, SidebarMenuItemAvatarProps, SidebarMenuItemProps, SidebarProps, SidebarSubheader, SidebarSubheaderProps, TextAlignProp, TextBox, TextBoxProps, TextColorProp, TextDisplayProp, TextVariantProp, formatBytes, toBytes };
325
+ export { Alert, AlertProps, AlertSeverityProp, AnchorButton, AnchorButtonProps, Banner, BorderRadiusProp, BorderWidthProp, Box, BoxProps, Button, ButtonArea, ButtonAreaProps, ButtonProps, ButtonSizeProp, ButtonVariantProp, Container, ContainerProps, DescriptionItem, DescriptionItemProps, FileDropZone, FileDropZoneProps, FileListItem, FileListItemProps, MarginProp, Navbar, NavbarAvatar, NavbarBadge, NavbarBottomBar, NavbarBottomBarItem, NavbarItem, NavbarItemOptions, NavbarItemProps, NavbarLabel, NavbarList, NavbarMenu, NavbarMenuItem, NavbarMenuItemOption, Sidebar, SidebarContainer, SidebarContainerProps, SidebarDivider, SidebarMenuItem, SidebarMenuItemAction, SidebarMenuItemActionProps, SidebarMenuItemAvatar, SidebarMenuItemAvatarProps, SidebarMenuItemProps, SidebarProps, SidebarSubheader, SidebarSubheaderProps, TextAlignProp, TextBox, TextBoxProps, TextColorProp, TextDisplayProp, TextVariantProp, formatBytes, toBytes, useNavbarContext };