@workday/canvas-kit-preview-react 6.2.1 → 6.3.0-next.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/dist/commonjs/index.js +1 -0
- package/dist/commonjs/menu/lib/Menu.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/Menu.js +1 -2
- package/dist/commonjs/select/lib/Select.d.ts.map +1 -1
- package/dist/commonjs/select/lib/Select.js +2 -3
- package/dist/commonjs/side-panel/lib/hooks.d.ts +7 -7
- package/dist/es6/index.js +1 -0
- package/dist/es6/menu/lib/Menu.d.ts.map +1 -1
- package/dist/es6/menu/lib/Menu.js +2 -3
- package/dist/es6/select/lib/Select.d.ts.map +1 -1
- package/dist/es6/select/lib/Select.js +3 -4
- package/dist/es6/side-panel/lib/hooks.d.ts +7 -7
- package/index.ts +2 -0
- package/menu/lib/Menu.tsx +3 -3
- package/package.json +5 -7
- package/select/lib/Select.tsx +9 -4
- package/side-panel/lib/hooks.ts +7 -7
- package/ts3.5/dist/commonjs/side-panel/lib/hooks.d.ts +7 -7
- package/ts3.5/dist/es6/side-panel/lib/hooks.d.ts +7 -7
package/dist/commonjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../menu/lib/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAGzC,OAAO,EAAiB,cAAc,
|
|
1
|
+
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../menu/lib/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAGzC,OAAO,EAAiB,cAAc,EAAmB,MAAM,kCAAkC,CAAC;AAElG,MAAM,WAAW,SAAU,SAAQ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= (this && this.__importDefault) || function (mod) {
|
|
|
47
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
48
|
var React = __importStar(require("react"));
|
|
49
49
|
var styled_1 = __importDefault(require("@emotion/styled"));
|
|
50
|
-
var v4_1 = __importDefault(require("uuid/v4"));
|
|
51
50
|
var card_1 = require("@workday/canvas-kit-react/card");
|
|
52
51
|
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
53
52
|
var common_1 = require("@workday/canvas-kit-react/common");
|
|
@@ -58,7 +57,7 @@ var Menu = /** @class */ (function (_super) {
|
|
|
58
57
|
__extends(Menu, _super);
|
|
59
58
|
function Menu(props) {
|
|
60
59
|
var _this = _super.call(this, props) || this;
|
|
61
|
-
_this.id =
|
|
60
|
+
_this.id = common_1.generateUniqueId();
|
|
62
61
|
_this.getNormalizedItemIndex = function (index) {
|
|
63
62
|
var itemCount = React.Children.count(_this.props.children);
|
|
64
63
|
var firstItem = 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../select/lib/Select.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../select/lib/Select.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EAKV,MAAM,kCAAkC,CAAC;AAE1C,OAAmB,EAAC,mBAAmB,EAAE,MAAM,EAAmB,MAAM,cAAc,CAAC;AAIvF,MAAM,WAAW,WAAY,SAAQ,mBAAmB;IACtD;;;;;;;;;;;;;;OAcG;IACH,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;CAC9B;AAmiBD,eAAO,MAAM,MAAM;;CAUjB,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
|
@@ -50,7 +50,6 @@ var common_1 = require("@workday/canvas-kit-react/common");
|
|
|
50
50
|
var SelectMenu_1 = require("./SelectMenu");
|
|
51
51
|
var SelectBase_1 = __importDefault(require("./SelectBase"));
|
|
52
52
|
var utils_1 = require("./utils");
|
|
53
|
-
var v4_1 = __importDefault(require("uuid/v4"));
|
|
54
53
|
var SelectContainer = /** @class */ (function (_super) {
|
|
55
54
|
__extends(SelectContainer, _super);
|
|
56
55
|
function SelectContainer(props) {
|
|
@@ -88,14 +87,14 @@ var SelectContainer = /** @class */ (function (_super) {
|
|
|
88
87
|
var disabled, id, label, value;
|
|
89
88
|
if (typeof option === 'string') {
|
|
90
89
|
disabled = false;
|
|
91
|
-
id =
|
|
90
|
+
id = common_1.generateUniqueId();
|
|
92
91
|
value = option;
|
|
93
92
|
label = option;
|
|
94
93
|
}
|
|
95
94
|
else {
|
|
96
95
|
data = option.data || data;
|
|
97
96
|
disabled = !!option.disabled;
|
|
98
|
-
id = option.id ||
|
|
97
|
+
id = option.id || common_1.generateUniqueId();
|
|
99
98
|
value = option.value;
|
|
100
99
|
label = option.label || option.value;
|
|
101
100
|
}
|
|
@@ -9,12 +9,12 @@ export interface UseSidePanelProps {
|
|
|
9
9
|
initialExpanded?: boolean;
|
|
10
10
|
/**
|
|
11
11
|
* sets the `id` for the panel
|
|
12
|
-
* @default
|
|
12
|
+
* @default unique identifier
|
|
13
13
|
*/
|
|
14
14
|
panelId?: string;
|
|
15
15
|
/**
|
|
16
16
|
* sets the `id` for the label
|
|
17
|
-
* @default
|
|
17
|
+
* @default unique identifier
|
|
18
18
|
*/
|
|
19
19
|
labelId?: string;
|
|
20
20
|
}
|
|
@@ -28,12 +28,12 @@ export interface PanelProps {
|
|
|
28
28
|
expanded: boolean;
|
|
29
29
|
/**
|
|
30
30
|
* the accessible `id`
|
|
31
|
-
* - this will either be a
|
|
31
|
+
* - this will either be a unique identifier value or the `panelId` provided in the config
|
|
32
32
|
*/
|
|
33
33
|
id: string;
|
|
34
34
|
/**
|
|
35
35
|
* the accessible label `id`
|
|
36
|
-
* - this will either be a
|
|
36
|
+
* - this will either be a unique identifier value or the `labelId` provided in the config
|
|
37
37
|
*/
|
|
38
38
|
'aria-labelledby': string;
|
|
39
39
|
/**
|
|
@@ -45,14 +45,14 @@ export interface PanelProps {
|
|
|
45
45
|
export interface LabelProps {
|
|
46
46
|
/**
|
|
47
47
|
* the accessible `id`
|
|
48
|
-
* - this will either be a
|
|
48
|
+
* - this will either be a unique identifier value or the `labelId` provided in the config
|
|
49
49
|
*/
|
|
50
50
|
id: string;
|
|
51
51
|
}
|
|
52
52
|
export interface ControlProps {
|
|
53
53
|
/**
|
|
54
54
|
* the accessible `id` that connects the panel to this control
|
|
55
|
-
* - this will either be a
|
|
55
|
+
* - this will either be a unique identifier value or the `panelId` provided in the config
|
|
56
56
|
*/
|
|
57
57
|
'aria-controls': string;
|
|
58
58
|
/**
|
|
@@ -62,7 +62,7 @@ export interface ControlProps {
|
|
|
62
62
|
'aria-expanded': boolean;
|
|
63
63
|
/**
|
|
64
64
|
* the accessible label `id`
|
|
65
|
-
* - this will either be a
|
|
65
|
+
* - this will either be a unique identifier value or the `labelId` provided in the config
|
|
66
66
|
*/
|
|
67
67
|
'aria-labelledby': string;
|
|
68
68
|
/**
|
package/dist/es6/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../menu/lib/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAGzC,OAAO,EAAiB,cAAc,
|
|
1
|
+
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../menu/lib/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAGzC,OAAO,EAAiB,cAAc,EAAmB,MAAM,kCAAkC,CAAC;AAElG,MAAM,WAAW,SAAU,SAAQ,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAA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import * as React from 'react';
|
|
37
37
|
import styled from '@emotion/styled';
|
|
38
|
-
import uuid from 'uuid/v4';
|
|
39
38
|
import { Card } from '@workday/canvas-kit-react/card';
|
|
40
39
|
import { commonColors, space, borderRadius } from '@workday/canvas-kit-react/tokens';
|
|
41
|
-
import { hideMouseFocus } from '@workday/canvas-kit-react/common';
|
|
40
|
+
import { hideMouseFocus, generateUniqueId } from '@workday/canvas-kit-react/common';
|
|
42
41
|
var List = styled('ul')(__assign({ background: commonColors.background, borderRadius: borderRadius.m, padding: 0, margin: space.xxs + " 0", '&:focus': {
|
|
43
42
|
outline: 'none',
|
|
44
43
|
} }, hideMouseFocus));
|
|
@@ -46,7 +45,7 @@ var Menu = /** @class */ (function (_super) {
|
|
|
46
45
|
__extends(Menu, _super);
|
|
47
46
|
function Menu(props) {
|
|
48
47
|
var _this = _super.call(this, props) || this;
|
|
49
|
-
_this.id =
|
|
48
|
+
_this.id = generateUniqueId();
|
|
50
49
|
_this.getNormalizedItemIndex = function (index) {
|
|
51
50
|
var itemCount = React.Children.count(_this.props.children);
|
|
52
51
|
var firstItem = 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../select/lib/Select.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../select/lib/Select.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EAKV,MAAM,kCAAkC,CAAC;AAE1C,OAAmB,EAAC,mBAAmB,EAAE,MAAM,EAAmB,MAAM,cAAc,CAAC;AAIvF,MAAM,WAAW,WAAY,SAAQ,mBAAmB;IACtD;;;;;;;;;;;;;;OAcG;IACH,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;CAC9B;AAmiBD,eAAO,MAAM,MAAM;;CAUjB,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
|
@@ -34,11 +34,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
34
34
|
return t;
|
|
35
35
|
};
|
|
36
36
|
import * as React from 'react';
|
|
37
|
-
import { ErrorType, createComponent, useForkRef } from '@workday/canvas-kit-react/common';
|
|
37
|
+
import { ErrorType, createComponent, useForkRef, generateUniqueId, } from '@workday/canvas-kit-react/common';
|
|
38
38
|
import { menuAnimationDuration } from './SelectMenu';
|
|
39
39
|
import SelectBase from './SelectBase';
|
|
40
40
|
import { getCorrectedIndexByValue } from './utils';
|
|
41
|
-
import uuid from 'uuid/v4';
|
|
42
41
|
var SelectContainer = /** @class */ (function (_super) {
|
|
43
42
|
__extends(SelectContainer, _super);
|
|
44
43
|
function SelectContainer(props) {
|
|
@@ -76,14 +75,14 @@ var SelectContainer = /** @class */ (function (_super) {
|
|
|
76
75
|
var disabled, id, label, value;
|
|
77
76
|
if (typeof option === 'string') {
|
|
78
77
|
disabled = false;
|
|
79
|
-
id =
|
|
78
|
+
id = generateUniqueId();
|
|
80
79
|
value = option;
|
|
81
80
|
label = option;
|
|
82
81
|
}
|
|
83
82
|
else {
|
|
84
83
|
data = option.data || data;
|
|
85
84
|
disabled = !!option.disabled;
|
|
86
|
-
id = option.id ||
|
|
85
|
+
id = option.id || generateUniqueId();
|
|
87
86
|
value = option.value;
|
|
88
87
|
label = option.label || option.value;
|
|
89
88
|
}
|
|
@@ -9,12 +9,12 @@ export interface UseSidePanelProps {
|
|
|
9
9
|
initialExpanded?: boolean;
|
|
10
10
|
/**
|
|
11
11
|
* sets the `id` for the panel
|
|
12
|
-
* @default
|
|
12
|
+
* @default unique identifier
|
|
13
13
|
*/
|
|
14
14
|
panelId?: string;
|
|
15
15
|
/**
|
|
16
16
|
* sets the `id` for the label
|
|
17
|
-
* @default
|
|
17
|
+
* @default unique identifier
|
|
18
18
|
*/
|
|
19
19
|
labelId?: string;
|
|
20
20
|
}
|
|
@@ -28,12 +28,12 @@ export interface PanelProps {
|
|
|
28
28
|
expanded: boolean;
|
|
29
29
|
/**
|
|
30
30
|
* the accessible `id`
|
|
31
|
-
* - this will either be a
|
|
31
|
+
* - this will either be a unique identifier value or the `panelId` provided in the config
|
|
32
32
|
*/
|
|
33
33
|
id: string;
|
|
34
34
|
/**
|
|
35
35
|
* the accessible label `id`
|
|
36
|
-
* - this will either be a
|
|
36
|
+
* - this will either be a unique identifier value or the `labelId` provided in the config
|
|
37
37
|
*/
|
|
38
38
|
'aria-labelledby': string;
|
|
39
39
|
/**
|
|
@@ -45,14 +45,14 @@ export interface PanelProps {
|
|
|
45
45
|
export interface LabelProps {
|
|
46
46
|
/**
|
|
47
47
|
* the accessible `id`
|
|
48
|
-
* - this will either be a
|
|
48
|
+
* - this will either be a unique identifier value or the `labelId` provided in the config
|
|
49
49
|
*/
|
|
50
50
|
id: string;
|
|
51
51
|
}
|
|
52
52
|
export interface ControlProps {
|
|
53
53
|
/**
|
|
54
54
|
* the accessible `id` that connects the panel to this control
|
|
55
|
-
* - this will either be a
|
|
55
|
+
* - this will either be a unique identifier value or the `panelId` provided in the config
|
|
56
56
|
*/
|
|
57
57
|
'aria-controls': string;
|
|
58
58
|
/**
|
|
@@ -62,7 +62,7 @@ export interface ControlProps {
|
|
|
62
62
|
'aria-expanded': boolean;
|
|
63
63
|
/**
|
|
64
64
|
* the accessible label `id`
|
|
65
|
-
* - this will either be a
|
|
65
|
+
* - this will either be a unique identifier value or the `labelId` provided in the config
|
|
66
66
|
*/
|
|
67
67
|
'aria-labelledby': string;
|
|
68
68
|
/**
|
package/index.ts
CHANGED
package/menu/lib/Menu.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import styled from '@emotion/styled';
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
import {MenuItemProps} from './MenuItem';
|
|
5
5
|
import {Card} from '@workday/canvas-kit-react/card';
|
|
6
6
|
import {commonColors, space, borderRadius} from '@workday/canvas-kit-react/tokens';
|
|
7
|
-
import {hideMouseFocus, GrowthBehavior} from '@workday/canvas-kit-react/common';
|
|
7
|
+
import {hideMouseFocus, GrowthBehavior, generateUniqueId} from '@workday/canvas-kit-react/common';
|
|
8
8
|
|
|
9
9
|
export interface MenuProps extends GrowthBehavior, React.HTMLAttributes<HTMLUListElement> {
|
|
10
10
|
/**
|
|
@@ -58,7 +58,7 @@ const List = styled('ul')({
|
|
|
58
58
|
});
|
|
59
59
|
|
|
60
60
|
export default class Menu extends React.Component<MenuProps, MenuState> {
|
|
61
|
-
private id =
|
|
61
|
+
private id = generateUniqueId();
|
|
62
62
|
private animateId!: number;
|
|
63
63
|
|
|
64
64
|
private menuRef: React.RefObject<HTMLUListElement>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-preview-react",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.3.0-next.1+698811ca",
|
|
4
4
|
"description": "Canvas Kit Preview is made up of components that have the full design and a11y review, are part of the DS ecosystem and are approved for use in product. The API's could be subject to change, but not without strong communication and migration strategies.",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -54,17 +54,15 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@emotion/core": "^10.0.28",
|
|
56
56
|
"@emotion/styled": "^10.0.27",
|
|
57
|
-
"@
|
|
58
|
-
"@workday/canvas-kit-react": "^6.2.1",
|
|
57
|
+
"@workday/canvas-kit-react": "^6.3.0-next.1+698811ca",
|
|
59
58
|
"@workday/canvas-system-icons-web": "1.0.41",
|
|
60
|
-
"@workday/design-assets-types": "^0.2.4"
|
|
61
|
-
"uuid": "^3.3.3"
|
|
59
|
+
"@workday/design-assets-types": "^0.2.4"
|
|
62
60
|
},
|
|
63
61
|
"devDependencies": {
|
|
64
62
|
"@workday/canvas-accent-icons-web": "^1.0.0",
|
|
65
|
-
"@workday/canvas-kit-labs-react": "^6.
|
|
63
|
+
"@workday/canvas-kit-labs-react": "^6.3.0-next.1+698811ca",
|
|
66
64
|
"formik": "^2.2.9",
|
|
67
65
|
"yup": "^0.31.1"
|
|
68
66
|
},
|
|
69
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "698811ca5c25f3cb4282c0f30cef4d196590c659"
|
|
70
68
|
}
|
package/select/lib/Select.tsx
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
ErrorType,
|
|
4
|
+
StyledType,
|
|
5
|
+
createComponent,
|
|
6
|
+
useForkRef,
|
|
7
|
+
generateUniqueId,
|
|
8
|
+
} from '@workday/canvas-kit-react/common';
|
|
3
9
|
import {menuAnimationDuration} from './SelectMenu';
|
|
4
10
|
import SelectBase, {CoreSelectBaseProps, Option, NormalizedOption} from './SelectBase';
|
|
5
11
|
import {MenuVisibility} from './types';
|
|
6
12
|
import {getCorrectedIndexByValue} from './utils';
|
|
7
|
-
import uuid from 'uuid/v4';
|
|
8
13
|
|
|
9
14
|
export interface SelectProps extends CoreSelectBaseProps {
|
|
10
15
|
/**
|
|
@@ -87,13 +92,13 @@ class SelectContainer extends React.Component<SelectContainerProps, SelectContai
|
|
|
87
92
|
|
|
88
93
|
if (typeof option === 'string') {
|
|
89
94
|
disabled = false;
|
|
90
|
-
id =
|
|
95
|
+
id = generateUniqueId();
|
|
91
96
|
value = option;
|
|
92
97
|
label = option;
|
|
93
98
|
} else {
|
|
94
99
|
data = option.data || data;
|
|
95
100
|
disabled = !!option.disabled;
|
|
96
|
-
id = option.id ||
|
|
101
|
+
id = option.id || generateUniqueId();
|
|
97
102
|
value = option.value;
|
|
98
103
|
label = option.label || option.value;
|
|
99
104
|
}
|
package/side-panel/lib/hooks.ts
CHANGED
|
@@ -12,12 +12,12 @@ export interface UseSidePanelProps {
|
|
|
12
12
|
initialExpanded?: boolean;
|
|
13
13
|
/**
|
|
14
14
|
* sets the `id` for the panel
|
|
15
|
-
* @default
|
|
15
|
+
* @default unique identifier
|
|
16
16
|
*/
|
|
17
17
|
panelId?: string;
|
|
18
18
|
/**
|
|
19
19
|
* sets the `id` for the label
|
|
20
|
-
* @default
|
|
20
|
+
* @default unique identifier
|
|
21
21
|
*/
|
|
22
22
|
labelId?: string;
|
|
23
23
|
}
|
|
@@ -32,12 +32,12 @@ export interface PanelProps {
|
|
|
32
32
|
expanded: boolean;
|
|
33
33
|
/**
|
|
34
34
|
* the accessible `id`
|
|
35
|
-
* - this will either be a
|
|
35
|
+
* - this will either be a unique identifier value or the `panelId` provided in the config
|
|
36
36
|
*/
|
|
37
37
|
id: string;
|
|
38
38
|
/**
|
|
39
39
|
* the accessible label `id`
|
|
40
|
-
* - this will either be a
|
|
40
|
+
* - this will either be a unique identifier value or the `labelId` provided in the config
|
|
41
41
|
*/
|
|
42
42
|
'aria-labelledby': string;
|
|
43
43
|
/**
|
|
@@ -50,7 +50,7 @@ export interface PanelProps {
|
|
|
50
50
|
export interface LabelProps {
|
|
51
51
|
/**
|
|
52
52
|
* the accessible `id`
|
|
53
|
-
* - this will either be a
|
|
53
|
+
* - this will either be a unique identifier value or the `labelId` provided in the config
|
|
54
54
|
*/
|
|
55
55
|
id: string;
|
|
56
56
|
}
|
|
@@ -58,7 +58,7 @@ export interface LabelProps {
|
|
|
58
58
|
export interface ControlProps {
|
|
59
59
|
/**
|
|
60
60
|
* the accessible `id` that connects the panel to this control
|
|
61
|
-
* - this will either be a
|
|
61
|
+
* - this will either be a unique identifier value or the `panelId` provided in the config
|
|
62
62
|
*/
|
|
63
63
|
'aria-controls': string;
|
|
64
64
|
/**
|
|
@@ -68,7 +68,7 @@ export interface ControlProps {
|
|
|
68
68
|
'aria-expanded': boolean;
|
|
69
69
|
/**
|
|
70
70
|
* the accessible label `id`
|
|
71
|
-
* - this will either be a
|
|
71
|
+
* - this will either be a unique identifier value or the `labelId` provided in the config
|
|
72
72
|
*/
|
|
73
73
|
'aria-labelledby': string;
|
|
74
74
|
/**
|
|
@@ -9,12 +9,12 @@ export interface UseSidePanelProps {
|
|
|
9
9
|
initialExpanded?: boolean;
|
|
10
10
|
/**
|
|
11
11
|
* sets the `id` for the panel
|
|
12
|
-
* @default
|
|
12
|
+
* @default unique identifier
|
|
13
13
|
*/
|
|
14
14
|
panelId?: string;
|
|
15
15
|
/**
|
|
16
16
|
* sets the `id` for the label
|
|
17
|
-
* @default
|
|
17
|
+
* @default unique identifier
|
|
18
18
|
*/
|
|
19
19
|
labelId?: string;
|
|
20
20
|
}
|
|
@@ -28,12 +28,12 @@ export interface PanelProps {
|
|
|
28
28
|
expanded: boolean;
|
|
29
29
|
/**
|
|
30
30
|
* the accessible `id`
|
|
31
|
-
* - this will either be a
|
|
31
|
+
* - this will either be a unique identifier value or the `panelId` provided in the config
|
|
32
32
|
*/
|
|
33
33
|
id: string;
|
|
34
34
|
/**
|
|
35
35
|
* the accessible label `id`
|
|
36
|
-
* - this will either be a
|
|
36
|
+
* - this will either be a unique identifier value or the `labelId` provided in the config
|
|
37
37
|
*/
|
|
38
38
|
'aria-labelledby': string;
|
|
39
39
|
/**
|
|
@@ -45,14 +45,14 @@ export interface PanelProps {
|
|
|
45
45
|
export interface LabelProps {
|
|
46
46
|
/**
|
|
47
47
|
* the accessible `id`
|
|
48
|
-
* - this will either be a
|
|
48
|
+
* - this will either be a unique identifier value or the `labelId` provided in the config
|
|
49
49
|
*/
|
|
50
50
|
id: string;
|
|
51
51
|
}
|
|
52
52
|
export interface ControlProps {
|
|
53
53
|
/**
|
|
54
54
|
* the accessible `id` that connects the panel to this control
|
|
55
|
-
* - this will either be a
|
|
55
|
+
* - this will either be a unique identifier value or the `panelId` provided in the config
|
|
56
56
|
*/
|
|
57
57
|
'aria-controls': string;
|
|
58
58
|
/**
|
|
@@ -62,7 +62,7 @@ export interface ControlProps {
|
|
|
62
62
|
'aria-expanded': boolean;
|
|
63
63
|
/**
|
|
64
64
|
* the accessible label `id`
|
|
65
|
-
* - this will either be a
|
|
65
|
+
* - this will either be a unique identifier value or the `labelId` provided in the config
|
|
66
66
|
*/
|
|
67
67
|
'aria-labelledby': string;
|
|
68
68
|
/**
|
|
@@ -9,12 +9,12 @@ export interface UseSidePanelProps {
|
|
|
9
9
|
initialExpanded?: boolean;
|
|
10
10
|
/**
|
|
11
11
|
* sets the `id` for the panel
|
|
12
|
-
* @default
|
|
12
|
+
* @default unique identifier
|
|
13
13
|
*/
|
|
14
14
|
panelId?: string;
|
|
15
15
|
/**
|
|
16
16
|
* sets the `id` for the label
|
|
17
|
-
* @default
|
|
17
|
+
* @default unique identifier
|
|
18
18
|
*/
|
|
19
19
|
labelId?: string;
|
|
20
20
|
}
|
|
@@ -28,12 +28,12 @@ export interface PanelProps {
|
|
|
28
28
|
expanded: boolean;
|
|
29
29
|
/**
|
|
30
30
|
* the accessible `id`
|
|
31
|
-
* - this will either be a
|
|
31
|
+
* - this will either be a unique identifier value or the `panelId` provided in the config
|
|
32
32
|
*/
|
|
33
33
|
id: string;
|
|
34
34
|
/**
|
|
35
35
|
* the accessible label `id`
|
|
36
|
-
* - this will either be a
|
|
36
|
+
* - this will either be a unique identifier value or the `labelId` provided in the config
|
|
37
37
|
*/
|
|
38
38
|
'aria-labelledby': string;
|
|
39
39
|
/**
|
|
@@ -45,14 +45,14 @@ export interface PanelProps {
|
|
|
45
45
|
export interface LabelProps {
|
|
46
46
|
/**
|
|
47
47
|
* the accessible `id`
|
|
48
|
-
* - this will either be a
|
|
48
|
+
* - this will either be a unique identifier value or the `labelId` provided in the config
|
|
49
49
|
*/
|
|
50
50
|
id: string;
|
|
51
51
|
}
|
|
52
52
|
export interface ControlProps {
|
|
53
53
|
/**
|
|
54
54
|
* the accessible `id` that connects the panel to this control
|
|
55
|
-
* - this will either be a
|
|
55
|
+
* - this will either be a unique identifier value or the `panelId` provided in the config
|
|
56
56
|
*/
|
|
57
57
|
'aria-controls': string;
|
|
58
58
|
/**
|
|
@@ -62,7 +62,7 @@ export interface ControlProps {
|
|
|
62
62
|
'aria-expanded': boolean;
|
|
63
63
|
/**
|
|
64
64
|
* the accessible label `id`
|
|
65
|
-
* - this will either be a
|
|
65
|
+
* - this will either be a unique identifier value or the `labelId` provided in the config
|
|
66
66
|
*/
|
|
67
67
|
'aria-labelledby': string;
|
|
68
68
|
/**
|