@zendeskgarden/react-draggable 9.0.0-next.19

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 (50) hide show
  1. package/LICENSE.md +176 -0
  2. package/README.md +41 -0
  3. package/dist/esm/elements/draggable/Draggable.js +39 -0
  4. package/dist/esm/elements/draggable/components/Content.js +23 -0
  5. package/dist/esm/elements/draggable/components/Grip.js +24 -0
  6. package/dist/esm/elements/draggable-list/DraggableList.js +36 -0
  7. package/dist/esm/elements/draggable-list/components/DropIndicator.js +33 -0
  8. package/dist/esm/elements/draggable-list/components/Item.js +30 -0
  9. package/dist/esm/elements/dropzone/Dropzone.js +63 -0
  10. package/dist/esm/elements/dropzone/components/Icon.js +46 -0
  11. package/dist/esm/elements/dropzone/components/Message.js +40 -0
  12. package/dist/esm/index.js +9 -0
  13. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/grip.svg.js +66 -0
  14. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/trash-stroke.svg.js +27 -0
  15. package/dist/esm/styled/draggable/StyledContent.js +22 -0
  16. package/dist/esm/styled/draggable/StyledDraggable.js +115 -0
  17. package/dist/esm/styled/draggable/StyledGrip.js +32 -0
  18. package/dist/esm/styled/draggable-list/StyledDraggableList.js +38 -0
  19. package/dist/esm/styled/draggable-list/StyledDropIndicator.js +42 -0
  20. package/dist/esm/styled/draggable-list/StyledItem.js +31 -0
  21. package/dist/esm/styled/dropzone/StyledDropzone.js +96 -0
  22. package/dist/esm/styled/dropzone/StyledIcon.js +38 -0
  23. package/dist/esm/styled/dropzone/StyledMessage.js +22 -0
  24. package/dist/esm/utils/useDraggableListContext.js +18 -0
  25. package/dist/esm/utils/useDropzoneContext.js +18 -0
  26. package/dist/index.cjs.js +632 -0
  27. package/dist/typings/elements/draggable/Draggable.d.ts +17 -0
  28. package/dist/typings/elements/draggable/components/Content.d.ts +11 -0
  29. package/dist/typings/elements/draggable/components/Grip.d.ts +11 -0
  30. package/dist/typings/elements/draggable-list/DraggableList.d.ts +17 -0
  31. package/dist/typings/elements/draggable-list/components/DropIndicator.d.ts +11 -0
  32. package/dist/typings/elements/draggable-list/components/Item.d.ts +11 -0
  33. package/dist/typings/elements/dropzone/Dropzone.d.ts +17 -0
  34. package/dist/typings/elements/dropzone/components/Icon.d.ts +11 -0
  35. package/dist/typings/elements/dropzone/components/Message.d.ts +11 -0
  36. package/dist/typings/index.d.ts +10 -0
  37. package/dist/typings/styled/draggable/StyledContent.d.ts +10 -0
  38. package/dist/typings/styled/draggable/StyledDraggable.d.ts +21 -0
  39. package/dist/typings/styled/draggable/StyledGrip.d.ts +11 -0
  40. package/dist/typings/styled/draggable-list/StyledDraggableList.d.ts +17 -0
  41. package/dist/typings/styled/draggable-list/StyledDropIndicator.d.ts +14 -0
  42. package/dist/typings/styled/draggable-list/StyledItem.d.ts +14 -0
  43. package/dist/typings/styled/dropzone/StyledDropzone.d.ts +23 -0
  44. package/dist/typings/styled/dropzone/StyledIcon.d.ts +19 -0
  45. package/dist/typings/styled/dropzone/StyledMessage.d.ts +10 -0
  46. package/dist/typings/styled/index.d.ts +15 -0
  47. package/dist/typings/types/index.d.ts +41 -0
  48. package/dist/typings/utils/useDraggableListContext.d.ts +12 -0
  49. package/dist/typings/utils/useDropzoneContext.d.ts +17 -0
  50. package/package.json +56 -0
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import React from 'react';
8
+ /**
9
+ * @extends LiHTMLAttributes<HTMLLIElement>
10
+ */
11
+ export declare const DropIndicator: React.ForwardRefExoticComponent<React.LiHTMLAttributes<HTMLLIElement> & React.RefAttributes<HTMLLIElement>>;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import React from 'react';
8
+ /**
9
+ * @extends LiHTMLAttributes<HTMLLIElement>
10
+ */
11
+ export declare const Item: React.ForwardRefExoticComponent<React.LiHTMLAttributes<HTMLLIElement> & React.RefAttributes<HTMLLIElement>>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import React from 'react';
8
+ import { Message } from './components/Message';
9
+ import { Icon } from './components/Icon';
10
+ import { IDropzoneProps } from '../../types';
11
+ /**
12
+ * @extends HTMLAttributes<HTMLDivElement>
13
+ */
14
+ export declare const Dropzone: React.ForwardRefExoticComponent<IDropzoneProps & React.RefAttributes<HTMLDivElement>> & {
15
+ Icon: typeof Icon;
16
+ Message: typeof Message;
17
+ };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import React from 'react';
8
+ /**
9
+ * @extends HTMLAttributes<HTMLDivElement>
10
+ */
11
+ export declare const Icon: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import React from 'react';
8
+ /**
9
+ * @extends HTMLAttributes<HTMLParagraphElement>
10
+ */
11
+ export declare const Message: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ export { Draggable } from './elements/draggable/Draggable';
8
+ export { DraggableList } from './elements/draggable-list/DraggableList';
9
+ export { Dropzone } from './elements/dropzone/Dropzone';
10
+ export type { IDraggableProps, IDraggableListProps, IDropzoneProps } from './types';
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ export declare const StyledContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
8
+ 'data-garden-id': string;
9
+ 'data-garden-version': string;
10
+ }, "data-garden-id" | "data-garden-version">;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import { ThemeProps, DefaultTheme } from 'styled-components';
8
+ import { IGardenTheme } from '@zendeskgarden/react-theming';
9
+ export interface IStyledDraggableProps extends ThemeProps<DefaultTheme> {
10
+ focusInset?: boolean;
11
+ isBare?: boolean;
12
+ isCompact?: boolean;
13
+ isDisabled?: boolean;
14
+ isGrabbed?: boolean;
15
+ isPlaceholder?: boolean;
16
+ }
17
+ export declare function getDragShadow(theme: IGardenTheme): string;
18
+ export declare const StyledDraggable: import("styled-components").StyledComponent<"div", DefaultTheme, {
19
+ 'data-garden-id': string;
20
+ 'data-garden-version': string;
21
+ } & IStyledDraggableProps, "data-garden-id" | "data-garden-version">;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import { DefaultTheme } from 'styled-components';
8
+ export declare const StyledGrip: import("styled-components").StyledComponent<"div", DefaultTheme, {
9
+ 'data-garden-id': string;
10
+ 'data-garden-version': string;
11
+ }, "data-garden-id" | "data-garden-version">;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import { ThemeProps, DefaultTheme } from 'styled-components';
8
+ export interface IStyledDraggableListProps extends ThemeProps<DefaultTheme> {
9
+ isHorizontal?: boolean;
10
+ }
11
+ /**
12
+ * 1. <ul> reset.
13
+ */
14
+ export declare const StyledDraggableList: import("styled-components").StyledComponent<"ul", DefaultTheme, {
15
+ 'data-garden-id': string;
16
+ 'data-garden-version': string;
17
+ } & IStyledDraggableListProps & ThemeProps<DefaultTheme>, "data-garden-id" | "data-garden-version">;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import { ThemeProps, DefaultTheme } from 'styled-components';
8
+ export interface IStyledDropIndicatorProps extends ThemeProps<DefaultTheme> {
9
+ isHorizontal?: boolean;
10
+ }
11
+ export declare const StyledDropIndicator: import("styled-components").StyledComponent<"li", DefaultTheme, {
12
+ 'data-garden-id': string;
13
+ 'data-garden-version': string;
14
+ } & IStyledDropIndicatorProps, "data-garden-id" | "data-garden-version">;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import { DefaultTheme, ThemeProps } from 'styled-components';
8
+ export interface IStyledItemProps extends ThemeProps<DefaultTheme> {
9
+ isHorizontal?: boolean;
10
+ }
11
+ export declare const StyledItem: import("styled-components").StyledComponent<"li", DefaultTheme, {
12
+ 'data-garden-id': string;
13
+ 'data-garden-version': string;
14
+ } & IStyledItemProps, "data-garden-id" | "data-garden-version">;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import { DefaultTheme, ThemeProps } from 'styled-components';
8
+ export interface IStyledDropzoneProps extends ThemeProps<DefaultTheme> {
9
+ isActive?: boolean;
10
+ isVertical?: boolean;
11
+ isDanger?: boolean;
12
+ isDisabled?: boolean;
13
+ isHighlighted?: boolean;
14
+ hasMessage?: boolean;
15
+ hasIcon?: boolean;
16
+ }
17
+ /**
18
+ * 1. Reset margin, e.g. when alternative tag includes native margin
19
+ */
20
+ export declare const StyledDropzone: import("styled-components").StyledComponent<"div", DefaultTheme, {
21
+ 'data-garden-id': string;
22
+ 'data-garden-version': string;
23
+ } & IStyledDropzoneProps, "data-garden-id" | "data-garden-version">;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import { DefaultTheme, ThemeProps } from 'styled-components';
8
+ interface IStyledIconProps extends ThemeProps<DefaultTheme> {
9
+ isVertical?: boolean;
10
+ hasMessage?: boolean;
11
+ }
12
+ /**
13
+ * 1. Corrects the vertical text alignment of the icon within a dropzone message.
14
+ */
15
+ export declare const StyledIcon: import("styled-components").StyledComponent<"div", DefaultTheme, {
16
+ 'data-garden-id': string;
17
+ 'data-garden-version': string;
18
+ } & IStyledIconProps, "data-garden-id" | "data-garden-version">;
19
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ export declare const StyledMessage: import("styled-components").StyledComponent<"p", import("styled-components").DefaultTheme, {
8
+ 'data-garden-id': string;
9
+ 'data-garden-version': string;
10
+ }, "data-garden-id" | "data-garden-version">;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ export { StyledDraggable } from './draggable/StyledDraggable';
8
+ export { StyledContent } from './draggable/StyledContent';
9
+ export { StyledGrip } from './draggable/StyledGrip';
10
+ export { StyledDraggableList } from './draggable-list/StyledDraggableList';
11
+ export { StyledDropIndicator } from './draggable-list/StyledDropIndicator';
12
+ export { StyledItem } from './draggable-list/StyledItem';
13
+ export { StyledDropzone } from './dropzone/StyledDropzone';
14
+ export { StyledMessage } from './dropzone/StyledMessage';
15
+ export { StyledIcon } from './dropzone/StyledIcon';
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import { HTMLAttributes } from 'react';
8
+ export interface IDraggableProps extends HTMLAttributes<HTMLDivElement> {
9
+ /** Applies inset `box-shadow` styling on focus */
10
+ focusInset?: boolean;
11
+ /** Removes borders */
12
+ isBare?: boolean;
13
+ /** Applies compact spacing */
14
+ isCompact?: boolean;
15
+ /** Disables the draggable */
16
+ isDisabled?: boolean;
17
+ /** Applies grab styling */
18
+ isGrabbed?: boolean;
19
+ /** Hides content and applies placeholder background styling */
20
+ isPlaceholder?: boolean;
21
+ /** Updates the element's HTML tag */
22
+ tag?: any;
23
+ }
24
+ export interface IDraggableListProps extends HTMLAttributes<HTMLUListElement> {
25
+ /** Flows list items inline */
26
+ isHorizontal?: boolean;
27
+ }
28
+ export interface IDropzoneProps extends HTMLAttributes<HTMLDivElement> {
29
+ /** Indicates a drop is possible during a drag */
30
+ isActive?: boolean;
31
+ /** Aligns dropzone message content vertically */
32
+ isVertical?: boolean;
33
+ /** Applies danger styling */
34
+ isDanger?: boolean;
35
+ /** Disables the dropzone */
36
+ isDisabled?: boolean;
37
+ /** Indicates a draggable is on a droppable area */
38
+ isHighlighted?: boolean;
39
+ /** Updates the element's HTML tag */
40
+ tag?: any;
41
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ /// <reference types="react" />
8
+ export interface IDraggableListContext {
9
+ isHorizontal?: boolean;
10
+ }
11
+ export declare const DraggableListContext: import("react").Context<IDraggableListContext | undefined>;
12
+ export declare const useDraggableListContext: () => IDraggableListContext;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ /// <reference types="react" />
8
+ export interface IDropzoneContext {
9
+ isVertical?: boolean;
10
+ isDanger?: boolean;
11
+ hasIcon?: boolean;
12
+ setHasIcon?: (hasIcon: boolean) => void;
13
+ hasMessage?: boolean;
14
+ setHasMessage?: (hasMessage: boolean) => void;
15
+ }
16
+ export declare const DropzoneContext: import("react").Context<IDropzoneContext | undefined>;
17
+ export declare const useDropzoneContext: () => IDropzoneContext;
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@zendeskgarden/react-draggable",
3
+ "version": "9.0.0-next.19",
4
+ "description": "Components related to drag and drop in the Garden Design System",
5
+ "license": "Apache-2.0",
6
+ "author": "Zendesk Garden <garden@zendesk.com>",
7
+ "homepage": "https://garden.zendesk.com/",
8
+ "repository": "https://github.com/zendeskgarden/react-components",
9
+ "bugs": {
10
+ "url": "https://github.com/zendeskgarden/react-components/issues"
11
+ },
12
+ "main": "dist/index.cjs.js",
13
+ "module": "dist/esm/index.js",
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "scripts": {
18
+ "build": "../../utils/scripts/build.sh",
19
+ "start": "../../utils/scripts/start.sh"
20
+ },
21
+ "sideEffects": false,
22
+ "types": "dist/typings/index.d.ts",
23
+ "dependencies": {
24
+ "polished": "^4.3.1",
25
+ "prop-types": "^15.7.2"
26
+ },
27
+ "peerDependencies": {
28
+ "@zendeskgarden/react-theming": ">=9.0.0-next",
29
+ "react": ">=16.8.0",
30
+ "react-dom": ">=16.8.0",
31
+ "styled-components": "^5.3.1"
32
+ },
33
+ "devDependencies": {
34
+ "@dnd-kit/core": "6.1.0",
35
+ "@dnd-kit/sortable": "8.0.0",
36
+ "@dnd-kit/utilities": "3.2.2",
37
+ "@zendeskgarden/react-theming": "^9.0.0-next.19",
38
+ "@zendeskgarden/react-typography": "^9.0.0-next.19",
39
+ "@zendeskgarden/svg-icons": "7.1.1"
40
+ },
41
+ "keywords": [
42
+ "components",
43
+ "drag",
44
+ "draggable",
45
+ "drop",
46
+ "dropzone",
47
+ "garden",
48
+ "react",
49
+ "zendesk"
50
+ ],
51
+ "publishConfig": {
52
+ "access": "public"
53
+ },
54
+ "zendeskgarden:src": "src/index.ts",
55
+ "gitHead": "3f18fec721a25bebc274de6af38cd88ab4e63a79"
56
+ }