@7shifts/sous-chef 3.36.0 → 3.36.1-beta0

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 (57) hide show
  1. package/dist/core/DataTable/DataTable.d.ts +29 -0
  2. package/dist/core/DataTable/DataTableCell/DataTableCell.d.ts +7 -0
  3. package/dist/core/DataTable/DataTableCell/index.d.ts +1 -0
  4. package/dist/core/DataTable/DataTableContext.d.ts +11 -0
  5. package/dist/core/DataTable/DataTableHeader.d.ts +9 -0
  6. package/dist/core/DataTable/index.d.ts +1 -0
  7. package/dist/core/DataTable/types.d.ts +38 -0
  8. package/dist/core/DataTableEditableCell/DataTableEditableCell.d.ts +21 -0
  9. package/dist/core/DataTableEditableCell/index.d.ts +1 -0
  10. package/dist/core/DataTableRow/DataTableRow.d.ts +11 -0
  11. package/dist/core/DataTableRow/DataTableRowActions/DataTableRowActions.d.ts +6 -0
  12. package/dist/core/DataTableRow/DataTableRowActions/index.d.ts +1 -0
  13. package/dist/core/DataTableRow/index.d.ts +1 -0
  14. package/dist/core/Flex/Flex.d.ts +19 -0
  15. package/dist/core/Flex/index.d.ts +1 -0
  16. package/dist/core/Flex/types.d.ts +4 -0
  17. package/dist/core/Inline/Inline.d.ts +20 -0
  18. package/dist/core/Inline/index.d.ts +1 -0
  19. package/dist/core/ResourceTable/ResourceTable.d.ts +28 -0
  20. package/dist/core/ResourceTable/ResourceTableContext.d.ts +8 -0
  21. package/dist/core/ResourceTable/ResourceTableHeader.d.ts +12 -0
  22. package/dist/core/ResourceTable/index.d.ts +1 -0
  23. package/dist/core/ResourceTable/types.d.ts +26 -0
  24. package/dist/core/ResourceTableRow/ResourceTableRow.d.ts +13 -0
  25. package/dist/core/ResourceTableRow/index.d.ts +1 -0
  26. package/dist/core/Stack/Stack.d.ts +19 -0
  27. package/dist/core/Stack/index.d.ts +1 -0
  28. package/dist/forms/DatePickerCalendar/DatePickerCalendar.d.ts +15 -0
  29. package/dist/forms/DatePickerCalendar/index.d.ts +1 -0
  30. package/dist/forms/MultiSelectField/CustomOption/CustomOption.d.ts +7 -0
  31. package/dist/forms/MultiSelectField/CustomOption/index.d.ts +1 -0
  32. package/dist/forms/TimeField/TimeFieldDropdown/TimeFieldDropdown.d.ts +2 -1
  33. package/dist/foundation/colors.d.ts +53 -0
  34. package/dist/icons/components/IconCoffeeCup.d.ts +12 -0
  35. package/dist/index.js +9 -16
  36. package/dist/index.js.map +1 -1
  37. package/dist/index.modern.js +9 -16
  38. package/dist/index.modern.js.map +1 -1
  39. package/dist/lists/DataTable/DataTableCell/DataTableCell.d.ts +7 -0
  40. package/dist/lists/DataTable/DataTableCell/index.d.ts +1 -0
  41. package/dist/lists/DataTable/DataTableHeader.d.ts +9 -0
  42. package/dist/lists/ResourceTable/ResourceTable.d.ts +28 -0
  43. package/dist/lists/ResourceTable/ResourceTableContext.d.ts +8 -0
  44. package/dist/lists/ResourceTable/ResourceTableHeader.d.ts +12 -0
  45. package/dist/lists/ResourceTable/index.d.ts +1 -0
  46. package/dist/lists/ResourceTable/types.d.ts +26 -0
  47. package/dist/lists/ResourceTableRow/ResourceTableRow.d.ts +13 -0
  48. package/dist/lists/ResourceTableRow/index.d.ts +1 -0
  49. package/dist/overlay/Menu/Menu.d.ts +9 -0
  50. package/dist/overlay/Menu/MenuButton.d.ts +8 -0
  51. package/dist/overlay/Menu/MenuContext.d.ts +9 -0
  52. package/dist/overlay/Menu/MenuItem.d.ts +7 -0
  53. package/dist/overlay/Menu/MenuList.d.ts +6 -0
  54. package/dist/overlay/Menu/index.d.ts +1 -0
  55. package/dist/overlay/Menu/types.d.ts +6 -0
  56. package/dist/utils/i18n.d.ts +1 -0
  57. package/package.json +1 -1
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import type { Column, CustomComponent, Item, Sort } from './types';
3
+ declare type Props<T> = {
4
+ /** Each element represents a row and each key of the object represents a column */
5
+ items: Item<T>[];
6
+ /** For each column element, the `name` property should match the key on `items` */
7
+ columns?: Column[];
8
+ /** A custom component for customizing how the each item is rendered. It pass as props: `item`, `index`, `columnSizes` and `columns` */
9
+ itemComponent?: React.ComponentType<CustomComponent<T>>;
10
+ maxHeight?: number;
11
+ /** Used for pagination */
12
+ hasPrevious?: boolean;
13
+ /** Used for pagination */
14
+ hasNext?: boolean;
15
+ /** Used for pagination */
16
+ onPreviousClick?: () => void;
17
+ /** Used for pagination */
18
+ onNextClick?: () => void;
19
+ isLoading?: boolean;
20
+ /** It is fired when a sorted column is clicked to be sorted */
21
+ onSort?: (sort: Sort) => void;
22
+ showActionMenu?: boolean;
23
+ /** Will render footer component if not null - expects a custom RowItem component */
24
+ footerComponent?: React.ReactNode;
25
+ /** Will render vertical borders between columns if true */
26
+ hasVerticalBorders?: boolean;
27
+ };
28
+ declare const DataTable: <T extends unknown>({ items, columns, itemComponent, maxHeight, hasPrevious, hasNext, onPreviousClick, onNextClick, onSort, isLoading, showActionMenu, footerComponent, hasVerticalBorders }: Props<T>) => JSX.Element;
29
+ export default DataTable;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ declare type Props = {
3
+ children: React.ReactNode;
4
+ columnIndex: number;
5
+ };
6
+ declare const DataTableCell: ({ children, columnIndex }: Props) => JSX.Element;
7
+ export default DataTableCell;
@@ -0,0 +1 @@
1
+ export * from './DataTableCell';
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import type { Column } from './types';
3
+ export declare type DataTableContextType = {
4
+ columns?: Column[];
5
+ showActionMenu?: boolean;
6
+ numberOfRows: number;
7
+ hasVerticalBorders?: boolean;
8
+ };
9
+ declare const Context: import("react").Context<DataTableContextType>;
10
+ export declare const useDataTableContext: () => DataTableContextType;
11
+ export default Context;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { Column, Sort } from './types';
3
+ declare type Props = {
4
+ columns: Column[];
5
+ onSort?: (sort: Sort) => void;
6
+ showActionMenu?: boolean;
7
+ };
8
+ declare const DataTableHeader: React.FC<Props>;
9
+ export default DataTableHeader;
@@ -0,0 +1 @@
1
+ export { default } from './DataTable';
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import Button from '../../actions/Button/Button';
3
+ export declare type Column = {
4
+ name: string;
5
+ label?: React.ReactNode;
6
+ size?: number;
7
+ isSortable?: boolean;
8
+ currentSort?: SortDirection;
9
+ isRightAligned?: boolean;
10
+ };
11
+ export declare type SortDirection = 'asc' | 'desc' | null;
12
+ export declare type Sort = {
13
+ columnName: string;
14
+ direction: SortDirection;
15
+ };
16
+ export declare type Item<T> = T | (T & {
17
+ actions?: Action[];
18
+ });
19
+ export declare type CustomComponent<T> = {
20
+ item: Item<T>;
21
+ index: number;
22
+ columnSizes?: number[];
23
+ columns?: Column[];
24
+ };
25
+ declare type BaseAction = {
26
+ action?: string;
27
+ label: React.ReactNode;
28
+ onAction: (e: React.MouseEvent | React.KeyboardEvent) => void;
29
+ };
30
+ declare type KebabAction = {
31
+ showInKebab?: true;
32
+ } & BaseAction;
33
+ declare type ButtonAction = {
34
+ buttonProps?: Pick<React.ComponentPropsWithoutRef<typeof Button>, 'theme' | 'disabled' | 'loading' | 'title'>;
35
+ showInKebab: false;
36
+ } & BaseAction;
37
+ export declare type Action = KebabAction | ButtonAction;
38
+ export {};
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ declare type Props = {
3
+ name: string;
4
+ columnIndex: number;
5
+ rowIndex: number;
6
+ id?: string;
7
+ value?: string;
8
+ onChange?: (e: string) => void;
9
+ onBlur?: (e: string) => void;
10
+ placeholder?: string;
11
+ disabled?: boolean;
12
+ error?: string;
13
+ /** Use a prefix for things like currency symbols (“$”, “¥”, “£”) or icons. */
14
+ prefix?: React.ReactNode;
15
+ /** Use suffix for things like units of measure (“in”, “cm”, ”hours”) or icons. */
16
+ suffix?: React.ReactNode;
17
+ defaultValue?: string;
18
+ type?: 'text' | 'currency';
19
+ };
20
+ declare const DataTableEditableCell: ({ name, columnIndex, rowIndex, id: inputId, value, onChange, onBlur, placeholder, disabled, error, prefix, suffix, defaultValue, type }: Props) => JSX.Element;
21
+ export default DataTableEditableCell;
@@ -0,0 +1 @@
1
+ export { default } from './DataTableEditableCell';
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { Action } from '../DataTable/types';
3
+ declare type Props = {
4
+ children: React.ReactNode;
5
+ onClick?: () => void;
6
+ isSelected?: boolean;
7
+ actions?: Action[];
8
+ hasDefaultPadding?: boolean;
9
+ } & Omit<React.HTMLProps<HTMLDivElement>, 'css'>;
10
+ declare const DataTableRow: React.ForwardRefExoticComponent<Pick<Props, "children" | "type" | "default" | "disabled" | "onClick" | "id" | "title" | "href" | "target" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "pattern" | "key" | "contextMenu" | "list" | "className" | "start" | "wrap" | "dir" | "checked" | "onChange" | "name" | "value" | "onBlur" | "placeholder" | "prefix" | "color" | "content" | "height" | "translate" | "width" | "hidden" | "size" | "open" | "multiple" | "aria-label" | "aria-labelledby" | "autoFocus" | "onFocus" | "onKeyDown" | "tabIndex" | "defaultValue" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "high" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "step" | "useMap" | "wmode" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "draggable" | "lang" | "spellCheck" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "isSelected" | "actions" | "hasDefaultPadding"> & React.RefAttributes<HTMLDivElement>>;
11
+ export default DataTableRow;
@@ -0,0 +1,6 @@
1
+ import type { Action } from '../../DataTable/types';
2
+ declare type Props = {
3
+ actions: Action[];
4
+ };
5
+ declare const ActionsCell: ({ actions }: Props) => JSX.Element;
6
+ export default ActionsCell;
@@ -0,0 +1 @@
1
+ export { default } from './DataTableRowActions';
@@ -0,0 +1 @@
1
+ export { default } from './DataTableRow';
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import type { AlignItems, FlexWrap, JustifyContent, Space } from './types';
3
+ declare type Props = {
4
+ children: React.ReactNode;
5
+ space?: Space;
6
+ /** It sets how each item will grow or shrink to fit the space available in its flex container. The default value is `0 1 auto` but it can be overriden. Check it out this [official doc](https://developer.mozilla.org/en-US/docs/Web/CSS/flex) to see all the possible values. */
7
+ flex?: (string | number)[];
8
+ alignItems?: AlignItems;
9
+ justifyContent?: JustifyContent;
10
+ inlineFlex?: boolean;
11
+ direction?: 'row' | 'column';
12
+ flexItems?: boolean;
13
+ flexWrap?: FlexWrap;
14
+ };
15
+ /**
16
+ * Flex is a internal component used by Stack and Inline. DON'T use this component outside of Sous Chef
17
+ */
18
+ declare const Flex: React.FC<Props>;
19
+ export default Flex;
@@ -0,0 +1 @@
1
+ export { default } from './Flex';
@@ -0,0 +1,4 @@
1
+ export declare type AlignItems = 'flex-start' | 'flex-end' | 'center' | 'stretch';
2
+ export declare type FlexWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
3
+ export declare type JustifyContent = 'start' | 'end' | 'center' | 'space-between';
4
+ export declare type Space = 0 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import type { AlignItems, FlexWrap, JustifyContent, Space } from '../Flex/types';
3
+ declare type Props = {
4
+ children: React.ReactNode;
5
+ /** From `0` to `60` with multiples of `4`, eg. `8`, `12`, `16` and so on. */
6
+ space?: Space;
7
+ /** It sets how each item will grow or shrink to fit the space available in its flex container. The default value is `0 1 auto` but it can be overriden. Check it out this [official doc](https://developer.mozilla.org/en-US/docs/Web/CSS/flex) to see all the possible values. */
8
+ flex?: (string | number)[];
9
+ /** One of: `flex-start`, `flex-end`, `center`, `stretch` */
10
+ alignItems?: AlignItems;
11
+ /** One of: `start`, `end`, `center`, `space-between` */
12
+ justifyContent?: JustifyContent;
13
+ inlineFlex?: boolean;
14
+ flexWrap?: FlexWrap;
15
+ };
16
+ /**
17
+ * Layout component to easily line elements up in a row.
18
+ */
19
+ declare const Inline: React.FC<Props>;
20
+ export default Inline;
@@ -0,0 +1 @@
1
+ export { default } from './Inline';
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import type { Column, CustomComponent, Item, Sort } from './types';
3
+ declare type Props<T> = {
4
+ /** Each element represents a row and each key of the object represents a column */
5
+ items: Item<T>[];
6
+ /** For each column element, the `name` property should match the key on `items` */
7
+ columns?: Column[];
8
+ /** A custom component for customizing how the each item is rendered. It pass as props: `item`, `index`, `columnSizes` and `columns` */
9
+ itemComponent?: React.ComponentType<CustomComponent<T>>;
10
+ maxHeight?: number;
11
+ /** Used for pagination */
12
+ hasPrevious?: boolean;
13
+ /** Used for pagination */
14
+ hasNext?: boolean;
15
+ /** Used for pagination */
16
+ onPreviousClick?: () => void;
17
+ /** Used for pagination */
18
+ onNextClick?: () => void;
19
+ isLoading?: boolean;
20
+ /** It is fired when a sorted column is clicked to be sorted */
21
+ onSort?: (sort: Sort) => void;
22
+ showActionMenu?: boolean;
23
+ };
24
+ /**
25
+ * @deprecated On v2.0 we introduced the `DataTable` that should be used for tabular data. This component will be removed on v3.0.
26
+ */
27
+ declare const ResourceTable: <T extends unknown>({ items, columns, itemComponent, maxHeight, hasPrevious, hasNext, onPreviousClick, onNextClick, onSort, isLoading, showActionMenu }: Props<T>) => JSX.Element;
28
+ export default ResourceTable;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ export declare type ResourceTableContextType = {
3
+ columnSizes?: number[];
4
+ showActionMenu?: boolean;
5
+ };
6
+ declare const Context: import("react").Context<ResourceTableContextType>;
7
+ export declare const useResourceTableContext: () => ResourceTableContextType;
8
+ export default Context;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import type { Column, Sort } from './types';
3
+ declare type Props = {
4
+ columns: Column[];
5
+ onSort?: (sort: Sort) => void;
6
+ showActionMenu?: boolean;
7
+ };
8
+ /**
9
+ * @deprecated On v2.0 we introduced the `DataTable` that should be used for tabular data. This component will be removed on v3.0.
10
+ */
11
+ declare const ResourceTableHeader: React.FC<Props>;
12
+ export default ResourceTableHeader;
@@ -0,0 +1 @@
1
+ export { default } from './ResourceTable';
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ export declare type Column = {
3
+ name: string;
4
+ label?: React.ReactNode;
5
+ size?: number;
6
+ isSortable?: boolean;
7
+ currentSort?: SortDirection;
8
+ };
9
+ export declare type SortDirection = 'asc' | 'desc' | null;
10
+ export declare type Sort = {
11
+ columnName: string;
12
+ direction: SortDirection;
13
+ };
14
+ export declare type Item<T> = T | (T & {
15
+ actions?: Action[];
16
+ });
17
+ export declare type CustomComponent<T> = {
18
+ item: Item<T>;
19
+ index: number;
20
+ columnSizes?: number[];
21
+ columns?: Column[];
22
+ };
23
+ export declare type Action = {
24
+ label: React.ReactNode;
25
+ onAction: () => void;
26
+ };
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import type { Action } from '../ResourceTable/types';
3
+ declare type Props = {
4
+ children: React.ReactNode;
5
+ onClick?: () => void;
6
+ isSelected?: boolean;
7
+ actions?: Action[];
8
+ };
9
+ /**
10
+ * @deprecated On v2.0 we introduced the `DataTable` that should be used for tabular data. This component will be removed on v3.0.
11
+ */
12
+ declare const ResourceTableRow: React.FC<Props>;
13
+ export default ResourceTableRow;
@@ -0,0 +1 @@
1
+ export { default } from './ResourceTableRow';
@@ -0,0 +1,19 @@
1
+ import * as React from 'react';
2
+ import type { JustifyContent, Space, AlignItems } from '../Flex/types';
3
+ declare type Props = {
4
+ children: React.ReactNode;
5
+ /** From `0` to `60` with multiples of `4`, eg. `8`, `12`, `16` and so on. */
6
+ space?: Space;
7
+ /** It sets how each item will grow or shrink to fit the space available in its flex container. The default value is `0 1 auto` but it can be overriden. Check it out this [official doc](https://developer.mozilla.org/en-US/docs/Web/CSS/flex) to see all the possible values. */
8
+ flex?: (string | number)[];
9
+ /** One of: `flex-start`, `flex-end`, `center`, `stretch` */
10
+ alignItems?: AlignItems;
11
+ /** One of: `start`, `end`, `center`, `space-between` */
12
+ justifyContent?: JustifyContent;
13
+ flexItems?: boolean;
14
+ };
15
+ /**
16
+ * Layout component to easily stack elements up in a column.
17
+ */
18
+ declare const Stack: React.FC<Props>;
19
+ export default Stack;
@@ -0,0 +1 @@
1
+ export { default } from './Stack';
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import styles from './date-picker-calendar.scss';
3
+ declare type Props = {
4
+ classNames: typeof styles;
5
+ inputNode: HTMLElement;
6
+ onBlur: () => void;
7
+ onFocus: () => void;
8
+ tabIndex: number;
9
+ children: React.ReactNode;
10
+ showCalendar: boolean;
11
+ onClickOutside: () => void;
12
+ testId?: string;
13
+ };
14
+ declare const DatePickerCalendar: React.FC<Props>;
15
+ export default DatePickerCalendar;
@@ -0,0 +1 @@
1
+ export { default } from './DatePickerCalendar';
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { OptionProps } from 'react-select';
3
+ interface Props<T> extends OptionProps<T, true> {
4
+ CustomComponent: React.ElementType;
5
+ }
6
+ declare function CustomOption<T>({ children, CustomComponent, ...props }: Props<T>): JSX.Element;
7
+ export default CustomOption;
@@ -0,0 +1 @@
1
+ export { default } from './CustomOption';
@@ -8,6 +8,7 @@ type TimeFieldDropdownProps = {
8
8
  inputValue?: string;
9
9
  width?: number;
10
10
  endField: boolean;
11
+ value?: string;
11
12
  };
12
- declare const TimeFieldDropdown: ({ trigger, interval, startTime, onOptionClick, inputValue, width, endField }: TimeFieldDropdownProps) => React.JSX.Element;
13
+ declare const TimeFieldDropdown: ({ trigger, interval, startTime, onOptionClick, inputValue, width, endField, value }: TimeFieldDropdownProps) => React.JSX.Element;
13
14
  export default TimeFieldDropdown;
@@ -0,0 +1,53 @@
1
+ export declare const WHITE: '#ffffff';
2
+ export declare const BLACK: '#000000';
3
+ export declare const TANGERINE100: '#fef1ed';
4
+ export declare const TANGERINE200: '#fdd5c8';
5
+ export declare const TANGERINE300: '#fcab91';
6
+ export declare const TANGERINE400: '#fb7448';
7
+ export declare const TANGERINE500: '#e16840';
8
+ export declare const TANGERINE600: '#96452b';
9
+ export declare const EGGPLANT100: '#f0f3fb';
10
+ export declare const EGGPLANT200: '#d3dbf4';
11
+ export declare const EGGPLANT300: '#a7b7ea';
12
+ export declare const EGGPLANT400: '#6d87dd';
13
+ export declare const EGGPLANT500: '#6179c6';
14
+ export declare const EGGPLANT600: '#415184';
15
+ export declare const MINT100: '#ecfaf8';
16
+ export declare const MINT200: '#c6f1eb';
17
+ export declare const MINT300: '#8de4d7';
18
+ export declare const MINT400: '#3abda9';
19
+ export declare const MINT500: '#35ac9a';
20
+ export declare const MINT600: '#277e71';
21
+ export declare const RADISH100: '#fcf0f0';
22
+ export declare const RADISH200: '#f7d1d1';
23
+ export declare const RADISH300: '#f0a3a3';
24
+ export declare const RADISH400: '#e76767';
25
+ export declare const RADISH500: '#cf5c5c';
26
+ export declare const RADISH600: '#8a3d3d';
27
+ export declare const BLUEBERRY100: '#f6fdff';
28
+ export declare const BLUEBERRY200: '#ceecf5';
29
+ export declare const BLUEBERRY300: '#9cd9eb';
30
+ export declare const BLUEBERRY400: '#5bc0de';
31
+ export declare const BLUEBERRY500: '#51acc7';
32
+ export declare const BLUEBERRY600: '#367385';
33
+ export declare const BANANA100: '#fff9ed';
34
+ export declare const BANANA200: '#ffeec9';
35
+ export declare const BANANA300: '#ffdd92';
36
+ export declare const BANANA400: '#ffc74a';
37
+ export declare const BANANA500: '#e5b242';
38
+ export declare const BANANA600: '#99772c';
39
+ export declare const GREY100: '#F3F3F3';
40
+ export declare const GREY200: '#D5D5D5';
41
+ export declare const GREY300: '#949494';
42
+ export declare const GREY400: '#767676';
43
+ export declare const GREY500: '#464646';
44
+ export declare const GREY600: '#323232';
45
+ export declare const COLORS: {
46
+ TANGERINE: string;
47
+ EGGPLANT: string;
48
+ MINT: string;
49
+ RADISH: string;
50
+ BLUEBERRY: string;
51
+ BANANA: string;
52
+ };
53
+ export declare type Color = typeof WHITE | typeof BLACK | typeof TANGERINE100 | typeof TANGERINE200 | typeof TANGERINE300 | typeof TANGERINE400 | typeof TANGERINE500 | typeof TANGERINE600 | typeof EGGPLANT100 | typeof EGGPLANT200 | typeof EGGPLANT300 | typeof EGGPLANT400 | typeof EGGPLANT500 | typeof EGGPLANT600 | typeof MINT100 | typeof MINT200 | typeof MINT300 | typeof MINT400 | typeof MINT500 | typeof MINT600 | typeof RADISH100 | typeof RADISH200 | typeof RADISH300 | typeof RADISH400 | typeof RADISH500 | typeof RADISH600 | typeof BLUEBERRY100 | typeof BLUEBERRY200 | typeof BLUEBERRY300 | typeof BLUEBERRY400 | typeof BLUEBERRY500 | typeof BLUEBERRY600 | typeof BANANA100 | typeof BANANA200 | typeof BANANA300 | typeof BANANA400 | typeof BANANA500 | typeof BANANA600 | typeof GREY100 | typeof GREY200 | typeof GREY300 | typeof GREY400 | typeof GREY500 | typeof GREY600;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { IconSize } from '../types';
3
+ declare type Props = {
4
+ size?: IconSize;
5
+ color?: string;
6
+ testId?: string;
7
+ } & React.SVGProps<SVGSVGElement>;
8
+ declare const IconCoffeeCup: {
9
+ ({ testId, ...props }: Props): JSX.Element;
10
+ displayName: string;
11
+ };
12
+ export default IconCoffeeCup;
package/dist/index.js CHANGED
@@ -5759,13 +5759,6 @@ var getItemType = function getItemType(child) {
5759
5759
  throw new Error('DropdownList - dropdown items should be using DropdownListDivider or DropdownListItem components');
5760
5760
  }
5761
5761
  };
5762
- var calculateScrollYPosition = function calculateScrollYPosition(newFocusItem, lastFocusItem, paneScrollTop, maxPaneHeight, elementYPosition) {
5763
- var directionCoeff = !lastFocusItem || newFocusItem > lastFocusItem ? -1 * maxPaneHeight : 0;
5764
- if (elementYPosition > paneScrollTop + maxPaneHeight || elementYPosition < paneScrollTop) {
5765
- return elementYPosition + directionCoeff;
5766
- }
5767
- return null;
5768
- };
5769
5762
 
5770
5763
  var DropdownList = function DropdownList(_ref) {
5771
5764
  var testId = _ref.testId,
@@ -5788,10 +5781,7 @@ var DropdownList = function DropdownList(_ref) {
5788
5781
  if (listRef.current && newFocusItem !== null && listRef.current.parentNode) {
5789
5782
  var element = listRef.current.querySelector(":nth-child(" + (newFocusItem + 1) + ")");
5790
5783
  var parentList = listRef.current.parentNode;
5791
- var scrollYPosition = calculateScrollYPosition(newFocusItem, focusedItem || 0, parentList.scrollTop, 354, element.offsetTop);
5792
- if (scrollYPosition !== null) {
5793
- parentList.scrollTo(0, scrollYPosition);
5794
- }
5784
+ parentList.scrollTo(0, element.offsetTop);
5795
5785
  }
5796
5786
  };
5797
5787
  var _useListKeyboardNavig = useListKeyboardNavigation(items, listRef, {
@@ -9717,7 +9707,8 @@ var TimeFieldDropdown = function TimeFieldDropdown(_ref) {
9717
9707
  inputValue = _ref.inputValue,
9718
9708
  width = _ref.width,
9719
9709
  _ref$endField = _ref.endField,
9720
- endField = _ref$endField === void 0 ? false : _ref$endField;
9710
+ endField = _ref$endField === void 0 ? false : _ref$endField,
9711
+ value = _ref.value;
9721
9712
  var startTimeParsed = startTime ? getDateWithStartTime(startTime) : setToMidnight(new Date());
9722
9713
  var timeOptions = React.useMemo(function () {
9723
9714
  return getTimeOptions(interval, startTimeParsed, endField && !!startTime);
@@ -9726,12 +9717,13 @@ var TimeFieldDropdown = function TimeFieldDropdown(_ref) {
9726
9717
  index = _useState[0],
9727
9718
  setIndex = _useState[1];
9728
9719
  React.useEffect(function () {
9729
- if (inputValue) {
9720
+ var selectedValue = value || inputValue;
9721
+ if (selectedValue) {
9730
9722
  setIndex(timeOptions.findIndex(function (option) {
9731
- return option.toLowerCase().startsWith(inputValue.toLowerCase());
9723
+ return option.toLowerCase().startsWith(selectedValue.toLowerCase());
9732
9724
  }));
9733
9725
  }
9734
- }, [inputValue]);
9726
+ }, [inputValue, value]);
9735
9727
  return React__default.createElement(Dropdown, {
9736
9728
  triggerWidth: "full",
9737
9729
  trigger: trigger,
@@ -9805,7 +9797,8 @@ var TimeFieldElement = function TimeFieldElement(_ref, forwardedRef) {
9805
9797
  onOptionClick: onOptionClick,
9806
9798
  inputValue: selectedDropdownValue,
9807
9799
  width: width,
9808
- endField: endField
9800
+ endField: endField,
9801
+ value: allOtherProps.value
9809
9802
  });
9810
9803
  };
9811
9804
  var TimeRangeSelector = React.forwardRef(TimeFieldElement);