@zendeskgarden/react-grid 8.51.0 → 8.53.1
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.
- package/README.md +6 -2
- package/dist/index.cjs.js +235 -97
- package/dist/index.esm.js +235 -97
- package/dist/typings/elements/pane/Pane.d.ts +2 -0
- package/dist/typings/elements/pane/PaneProvider.d.ts +2 -1
- package/dist/typings/elements/pane/components/SplitterButton.d.ts +12 -0
- package/dist/typings/index.d.ts +1 -1
- package/dist/typings/styled/index.d.ts +1 -0
- package/dist/typings/styled/pane/StyledPaneSplitter.d.ts +4 -0
- package/dist/typings/styled/pane/StyledPaneSplitterButton.d.ts +19 -0
- package/dist/typings/types/index.d.ts +16 -3
- package/dist/typings/utils/{useSplitterContext.d.ts → usePaneProviderContext.d.ts} +9 -7
- package/dist/typings/utils/usePaneSplitterContext.d.ts +23 -0
- package/package.json +7 -3
|
@@ -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
|
+
/// <reference types="react" />
|
|
8
|
+
import { DefaultTheme } from 'styled-components';
|
|
9
|
+
import { ISplitterButtonProps, Orientation, PLACEMENT } from '../../types';
|
|
10
|
+
interface IStyledSplitterButtonProps extends ISplitterButtonProps {
|
|
11
|
+
orientation: Orientation;
|
|
12
|
+
placement: typeof PLACEMENT[number];
|
|
13
|
+
isRotated: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 1. Opaque "dish" behind transparent button
|
|
17
|
+
*/
|
|
18
|
+
export declare const StyledPaneSplitterButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@zendeskgarden/react-buttons").IIconButtonProps & import("react").RefAttributes<HTMLButtonElement>>, DefaultTheme, IStyledSplitterButtonProps, never>;
|
|
19
|
+
export {};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
import { ReactNode, HTMLAttributes } from 'react';
|
|
7
|
+
import { ReactNode, HTMLAttributes, ButtonHTMLAttributes } from 'react';
|
|
8
8
|
export declare const ALIGN_ITEMS: readonly ["start", "end", "center", "baseline", "stretch"];
|
|
9
9
|
export declare const ALIGN_SELF: readonly ["auto", "start", "end", "center", "baseline", "stretch"];
|
|
10
10
|
export declare const DIRECTION: readonly ["row", "row-reverse", "column", "column-reverse"];
|
|
@@ -12,6 +12,7 @@ export declare const JUSTIFY_CONTENT: readonly ["start", "end", "center", "betwe
|
|
|
12
12
|
export declare const TEXT_ALIGN: readonly ["start", "end", "center", "justify"];
|
|
13
13
|
export declare const SPACE: readonly [false, "xxs", "xs", "sm", "md", "lg", "xl", "xxl"];
|
|
14
14
|
export declare const WRAP: readonly ["nowrap", "wrap", "wrap-reverse"];
|
|
15
|
+
export declare const PLACEMENT: readonly ["end", "start", "center"];
|
|
15
16
|
export declare type AlignItems = typeof ALIGN_ITEMS[number];
|
|
16
17
|
export declare type AlignSelf = typeof ALIGN_SELF[number];
|
|
17
18
|
export declare type Direction = typeof DIRECTION[number];
|
|
@@ -155,6 +156,8 @@ export interface IRowProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
155
156
|
export declare const ORIENTATION: readonly ["top", "bottom", "start", "end"];
|
|
156
157
|
export declare type Orientation = typeof ORIENTATION[number];
|
|
157
158
|
export interface IPaneProviderProps {
|
|
159
|
+
/** Identifies the pane provider */
|
|
160
|
+
id?: string;
|
|
158
161
|
/** Provides the total width, in `px` units, of all panes in the layout */
|
|
159
162
|
totalPanesWidth: number;
|
|
160
163
|
/** Provides the total height, in `px` units, of all panes in the layout */
|
|
@@ -175,14 +178,16 @@ export interface IPaneProviderProps {
|
|
|
175
178
|
*/
|
|
176
179
|
onChange?: (rowValues: Record<string, number>, columnValues: Record<string, number>) => void;
|
|
177
180
|
/**
|
|
178
|
-
* Surfaces render
|
|
181
|
+
* Surfaces render props for applying splitter state to the supporting layout
|
|
179
182
|
*
|
|
183
|
+
* @param id Provides the `id` prop, if specified; otherwise, a generated ID.
|
|
180
184
|
* @param getColumnValue Gets column value by key
|
|
181
185
|
* @param getRowValue Gets row value by key
|
|
182
186
|
* @param getGridTemplateRows Gets grid template rows track
|
|
183
187
|
* @param getGridTemplateColumns Gets grid template columns track
|
|
184
188
|
*/
|
|
185
|
-
children?: ({ getColumnValue, getRowValue, getGridTemplateRows, getGridTemplateColumns }: {
|
|
189
|
+
children?: ({ id, getColumnValue, getRowValue, getGridTemplateRows, getGridTemplateColumns }: {
|
|
190
|
+
id: string;
|
|
186
191
|
getColumnValue: (splitterKey: string, isPixels?: boolean) => number;
|
|
187
192
|
getRowValue: (splitterKey: string, isPixels?: boolean) => number;
|
|
188
193
|
getGridTemplateRows: (isPixels?: boolean) => string;
|
|
@@ -190,6 +195,8 @@ export interface IPaneProviderProps {
|
|
|
190
195
|
}) => ReactNode;
|
|
191
196
|
}
|
|
192
197
|
export interface ISplitterProps extends HTMLAttributes<HTMLDivElement> {
|
|
198
|
+
/** Identifies the associated `PaneProvider`. Assumes the closest parent provider, by default. */
|
|
199
|
+
providerId?: string;
|
|
193
200
|
/** Specifies the splitter key */
|
|
194
201
|
layoutKey: string;
|
|
195
202
|
/** Sets a minimum, in `fr` units, for splitter position */
|
|
@@ -199,3 +206,9 @@ export interface ISplitterProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
199
206
|
/** Determines splitter orientation within a pane */
|
|
200
207
|
orientation?: Orientation;
|
|
201
208
|
}
|
|
209
|
+
export interface ISplitterButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
210
|
+
/** Adjusts the placement of the splitter button. Assumes start when vertical and center when horizontal, by default. */
|
|
211
|
+
placement?: typeof PLACEMENT[number];
|
|
212
|
+
/** Renders the provided label text inside a tooltip */
|
|
213
|
+
label: string;
|
|
214
|
+
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
/// <reference types="react" />
|
|
8
|
-
interface
|
|
8
|
+
interface IPaneProviderContextData {
|
|
9
9
|
rowState: Record<string, number>;
|
|
10
10
|
columnState: Record<string, number>;
|
|
11
11
|
setRowValue: (isTop: boolean, id: string, value: number) => void;
|
|
@@ -19,9 +19,11 @@ interface ISplitterContext {
|
|
|
19
19
|
columns: number;
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
declare const
|
|
27
|
-
export
|
|
22
|
+
interface IPaneProviderContext {
|
|
23
|
+
providerId?: string;
|
|
24
|
+
contextData?: Record<string, IPaneProviderContextData>;
|
|
25
|
+
}
|
|
26
|
+
export declare const PaneProviderContext: import("react").Context<IPaneProviderContext>;
|
|
27
|
+
export declare const usePaneProviderContextData: (providerId?: string | undefined) => IPaneProviderContextData | undefined;
|
|
28
|
+
declare const usePaneProviderContext: () => IPaneProviderContext;
|
|
29
|
+
export default usePaneProviderContext;
|
|
@@ -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
|
+
/// <reference types="react" />
|
|
8
|
+
import { ISplitterProps, Orientation } from '../types';
|
|
9
|
+
interface IPaneSplitterContext {
|
|
10
|
+
orientation?: Orientation;
|
|
11
|
+
min: ISplitterProps['min'];
|
|
12
|
+
max: ISplitterProps['max'];
|
|
13
|
+
layoutKey: ISplitterProps['layoutKey'];
|
|
14
|
+
valueNow?: number;
|
|
15
|
+
isRow: boolean;
|
|
16
|
+
providerId?: ISplitterProps['providerId'];
|
|
17
|
+
}
|
|
18
|
+
export declare const PaneSplitterContext: import("react").Context<IPaneSplitterContext>;
|
|
19
|
+
/**
|
|
20
|
+
* Retrieve Pane Splitter component context
|
|
21
|
+
*/
|
|
22
|
+
declare const usePaneSplitterContext: () => IPaneSplitterContext;
|
|
23
|
+
export default usePaneSplitterContext;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-grid",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.53.1",
|
|
4
4
|
"description": "Components relating to layout grids in the Garden Design System",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Zendesk Garden <garden@zendesk.com>",
|
|
@@ -22,6 +22,9 @@
|
|
|
22
22
|
"types": "dist/typings/index.d.ts",
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@zendeskgarden/container-splitter": "^0.2.3",
|
|
25
|
+
"@zendeskgarden/container-utilities": "^0.7.1",
|
|
26
|
+
"@zendeskgarden/react-buttons": "^8.53.1",
|
|
27
|
+
"@zendeskgarden/react-tooltips": "^8.53.1",
|
|
25
28
|
"polished": "^4.0.0",
|
|
26
29
|
"prop-types": "^15.5.7",
|
|
27
30
|
"react-merge-refs": "^1.1.0"
|
|
@@ -33,7 +36,8 @@
|
|
|
33
36
|
"styled-components": "^4.2.0 || ^5.0.0"
|
|
34
37
|
},
|
|
35
38
|
"devDependencies": {
|
|
36
|
-
"@zendeskgarden/react-theming": "^8.
|
|
39
|
+
"@zendeskgarden/react-theming": "^8.53.1",
|
|
40
|
+
"use-resize-observer": "9.0.0"
|
|
37
41
|
},
|
|
38
42
|
"keywords": [
|
|
39
43
|
"components",
|
|
@@ -45,5 +49,5 @@
|
|
|
45
49
|
"access": "public"
|
|
46
50
|
},
|
|
47
51
|
"zendeskgarden:src": "src/index.ts",
|
|
48
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "79dee8e82b6f082e8d4a72ba95a5fb3982d63040"
|
|
49
53
|
}
|