@workday/canvas-kit-react 16.0.0-alpha.0492-next.0 → 16.0.0-alpha.0494-next.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.
- package/dist/commonjs/side-panel/lib/SidePanel.d.ts +14 -6
- package/dist/commonjs/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/commonjs/side-panel/lib/SidePanel.js +13 -10
- package/dist/commonjs/side-panel/lib/SidePanelHeading.d.ts.map +1 -1
- package/dist/commonjs/side-panel/lib/SidePanelHeading.js +3 -3
- package/dist/commonjs/side-panel/lib/SidePanelToggleButton.d.ts +9 -21
- package/dist/commonjs/side-panel/lib/SidePanelToggleButton.d.ts.map +1 -1
- package/dist/commonjs/side-panel/lib/SidePanelToggleButton.js +17 -29
- package/dist/commonjs/side-panel/lib/useSidePanelModel.d.ts +26 -24
- package/dist/commonjs/side-panel/lib/useSidePanelModel.d.ts.map +1 -1
- package/dist/commonjs/side-panel/lib/useSidePanelModel.js +4 -3
- package/dist/es6/side-panel/lib/SidePanel.d.ts +14 -6
- package/dist/es6/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/es6/side-panel/lib/SidePanel.js +13 -10
- package/dist/es6/side-panel/lib/SidePanelHeading.d.ts.map +1 -1
- package/dist/es6/side-panel/lib/SidePanelHeading.js +3 -3
- package/dist/es6/side-panel/lib/SidePanelToggleButton.d.ts +9 -21
- package/dist/es6/side-panel/lib/SidePanelToggleButton.d.ts.map +1 -1
- package/dist/es6/side-panel/lib/SidePanelToggleButton.js +19 -31
- package/dist/es6/side-panel/lib/useSidePanelModel.d.ts +26 -24
- package/dist/es6/side-panel/lib/useSidePanelModel.d.ts.map +1 -1
- package/dist/es6/side-panel/lib/useSidePanelModel.js +4 -3
- package/package.json +4 -4
- package/side-panel/lib/SidePanel.tsx +14 -6
- package/side-panel/lib/SidePanelHeading.tsx +10 -1
- package/side-panel/lib/SidePanelToggleButton.tsx +21 -73
- package/side-panel/lib/useSidePanelModel.ts +4 -3
|
@@ -24,7 +24,7 @@ export declare const useSidePanelContainer: import("@workday/canvas-kit-react/co
|
|
|
24
24
|
readonly 'aria-labelledby': string;
|
|
25
25
|
readonly onTransitionEnd: (event: React.TransitionEvent<HTMLDivElement>) => React.TransitionEvent<HTMLDivElement>;
|
|
26
26
|
}>;
|
|
27
|
-
export type SidePanelVariant = 'standard' | '
|
|
27
|
+
export type SidePanelVariant = 'standard' | 'alternative' | 'overlay';
|
|
28
28
|
export interface SidePanelProps extends CSProps {
|
|
29
29
|
/**
|
|
30
30
|
* The width of the component (in `px` if it's a `number`) when it is collapsed.
|
|
@@ -39,7 +39,10 @@ export interface SidePanelProps extends CSProps {
|
|
|
39
39
|
*/
|
|
40
40
|
expandedWidth?: number | string;
|
|
41
41
|
/**
|
|
42
|
-
* The style variant of the side panel.
|
|
42
|
+
* The style variant of the side panel.
|
|
43
|
+
* - `'standard'`: navigation surface background (`system.legacy.color.surface.navigation`), no depth.
|
|
44
|
+
* - `'alternative'`: raised surface background (`system.legacy.color.surface.raised`), no depth.
|
|
45
|
+
* - `'overlay'`: default surface background (`system.legacy.color.surface.default`) with level 6 depth, for panels that need to look lifted off the page. This is a visual treatment only — it adds no dialog semantics, focus trapping, or backdrop.
|
|
43
46
|
*
|
|
44
47
|
* @default 'standard'
|
|
45
48
|
*/
|
|
@@ -48,9 +51,12 @@ export interface SidePanelProps extends CSProps {
|
|
|
48
51
|
}
|
|
49
52
|
export declare const panelStencil: import("@workday/canvas-kit-styling").Stencil<{
|
|
50
53
|
variant: {
|
|
51
|
-
|
|
54
|
+
overlay: {
|
|
52
55
|
backgroundColor: "var(--cnvs-sys-color-surface-default, var(--cnvs-sys-color-bg-default, oklch(1 0 0 / 1)))";
|
|
53
|
-
boxShadow: "--cnvs-sys-depth-
|
|
56
|
+
boxShadow: "--cnvs-sys-depth-6";
|
|
57
|
+
};
|
|
58
|
+
alternative: {
|
|
59
|
+
backgroundColor: "var(--cnvs-sys-color-surface-raised, var(--cnvs-sys-color-bg-alt-softer, oklch(0.4688 0.0781 250.43 / 0.03)))";
|
|
54
60
|
};
|
|
55
61
|
standard: {
|
|
56
62
|
backgroundColor: "var(--cnvs-sys-color-surface-navigation, oklch(0.9692 0.0035 248.23 / 1))";
|
|
@@ -183,8 +189,10 @@ export declare const SidePanel: import("@workday/canvas-kit-react/common").Eleme
|
|
|
183
189
|
* It must be used within the `SidePanel` component as a child. For accessibility purposes,
|
|
184
190
|
* it should be the first focusable element in the panel.
|
|
185
191
|
*
|
|
186
|
-
* The button automatically receives `aria-controls
|
|
187
|
-
*
|
|
192
|
+
* The button automatically receives `aria-controls` (the panel's `id`), `aria-pressed` (`true`
|
|
193
|
+
* when the panel is collapsed), and `aria-describedby` (the heading's `id`) from the model.
|
|
194
|
+
* Provide a static `aria-label` for the button's accessible name — `aria-pressed` already
|
|
195
|
+
* conveys the state, so the label should not change between states.
|
|
188
196
|
*/
|
|
189
197
|
ToggleButton: import("@workday/canvas-kit-react/common").ElementComponentM<"button", import("./SidePanelToggleButton").SidePanelToggleButtonProps, {
|
|
190
198
|
state: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidePanel.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/SidePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,OAAO,EAAsC,MAAM,6BAA6B,CAAC;AAOzF;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;EAMhC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"SidePanel.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/SidePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,OAAO,EAAsC,MAAM,6BAA6B,CAAC;AAOzF;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;EAMhC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,aAAa,GAAG,SAAS,CAAC;AAEtE,MAAM,WAAW,cAAe,SAAQ,OAAO;IAC7C;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA4CvB,CAAC;AAEH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKlB;;;;;;;;;OASG;;;;;;;;;;;;;;;;;IAEH;;;;OAIG;;;;;;;;;;;;;;;;;CAgCN,CAAC"}
|
|
@@ -24,20 +24,21 @@ exports.panelStencil = (0, canvas_kit_styling_1.createStencil)({
|
|
|
24
24
|
expandedWidth: '',
|
|
25
25
|
collapsedWidth: '',
|
|
26
26
|
},
|
|
27
|
-
base: { name: "
|
|
27
|
+
base: { name: "266imo", styles: "box-sizing:border-box;overflow:hidden;position:relative;height:100%;outline:0.0625rem solid transparent;transition:width ease-out 200ms, max-width ease-out 200ms;" },
|
|
28
28
|
modifiers: {
|
|
29
29
|
variant: {
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
overlay: { name: "3jhjbz", styles: "background-color:var(--cnvs-sys-color-surface-default, var(--cnvs-sys-color-bg-default, oklch(1 0 0 / 1)));box-shadow:var(--cnvs-sys-depth-6);" },
|
|
31
|
+
alternative: { name: "zloh7", styles: "background-color:var(--cnvs-sys-color-surface-raised, var(--cnvs-sys-color-bg-alt-softer, oklch(0.4688 0.0781 250.43 / 0.03)));" },
|
|
32
|
+
standard: { name: "1ujtij", styles: "background-color:var(--cnvs-sys-color-surface-navigation, oklch(0.9692 0.0035 248.23 / 1));" }
|
|
32
33
|
},
|
|
33
34
|
expanded: {
|
|
34
|
-
expanded: { name: "
|
|
35
|
-
collapsed: { name: "
|
|
36
|
-
expanding: { name: "
|
|
37
|
-
collapsing: { name: "
|
|
35
|
+
expanded: { name: "2ii7mh", styles: "width:var(--expandedWidth-panel-bd0abc);max-width:var(--expandedWidth-panel-bd0abc);" },
|
|
36
|
+
collapsed: { name: "31yo9a", styles: "width:var(--collapsedWidth-panel-bd0abc);max-width:var(--collapsedWidth-panel-bd0abc);" },
|
|
37
|
+
expanding: { name: "3i6sk2", styles: "width:var(--expandedWidth-panel-bd0abc);max-width:var(--expandedWidth-panel-bd0abc);" },
|
|
38
|
+
collapsing: { name: "fh1bz", styles: "width:var(--collapsedWidth-panel-bd0abc);max-width:var(--collapsedWidth-panel-bd0abc);" }
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
|
-
}, "panel-
|
|
41
|
+
}, "panel-bd0abc");
|
|
41
42
|
exports.SidePanel = (0, common_1.createContainer)('section')({
|
|
42
43
|
displayName: 'SidePanel',
|
|
43
44
|
modelHook: useSidePanelModel_1.useSidePanelModel,
|
|
@@ -48,8 +49,10 @@ exports.SidePanel = (0, common_1.createContainer)('section')({
|
|
|
48
49
|
* It must be used within the `SidePanel` component as a child. For accessibility purposes,
|
|
49
50
|
* it should be the first focusable element in the panel.
|
|
50
51
|
*
|
|
51
|
-
* The button automatically receives `aria-controls
|
|
52
|
-
*
|
|
52
|
+
* The button automatically receives `aria-controls` (the panel's `id`), `aria-pressed` (`true`
|
|
53
|
+
* when the panel is collapsed), and `aria-describedby` (the heading's `id`) from the model.
|
|
54
|
+
* Provide a static `aria-label` for the button's accessible name — `aria-pressed` already
|
|
55
|
+
* conveys the state, so the label should not change between states.
|
|
53
56
|
*/
|
|
54
57
|
ToggleButton: SidePanelToggleButton_1.SidePanelToggleButton,
|
|
55
58
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidePanelHeading.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/SidePanelHeading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,YAAY,EAGb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,OAAO,EAAE,cAAc,EAAiB,MAAM,gCAAgC,CAAC;AAMvF,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,YAAY,CAAC,OAAO,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAC9F;;;OAGG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IAC9B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"SidePanelHeading.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/SidePanelHeading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,YAAY,EAGb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,OAAO,EAAE,cAAc,EAAiB,MAAM,gCAAgC,CAAC;AAMvF,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,YAAY,CAAC,OAAO,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAC9F;;;OAGG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IAC9B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAsBlC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;EAK9B,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;EAa3B,CAAC"}
|
|
@@ -9,11 +9,11 @@ const canvas_tokens_web_1 = require("@workday/canvas-tokens-web");
|
|
|
9
9
|
const useSidePanelModel_1 = require("./useSidePanelModel");
|
|
10
10
|
exports.sidePanelHeadingStencil = (0, canvas_kit_styling_1.createStencil)({
|
|
11
11
|
extends: text_1.headingStencil,
|
|
12
|
-
base: { name: "
|
|
12
|
+
base: { name: "1ywp21", styles: "box-sizing:border-box;display:flex;align-items:center;padding:var(--cnvs-sys-padding-sm, var(--cnvs-sys-space-x3, 0.75rem));padding-inline-start:var(--cnvs-sys-padding-md, var(--cnvs-sys-space-x4, 1rem));min-height:var(--cnvs-sys-size-xxl, var(--cnvs-sys-space-x16, 4rem));margin:0;&:where([hidden]){display:none;}" },
|
|
13
13
|
modifiers: {
|
|
14
14
|
origin: {
|
|
15
|
-
end: { name: "
|
|
16
|
-
start: { name: "
|
|
15
|
+
end: { name: "397xkx", styles: "padding-inline-start:4.25rem;" },
|
|
16
|
+
start: { name: "y9ngj", styles: "" }
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
}, "side-panel-heading-9d38c2");
|
|
@@ -22,43 +22,31 @@ export declare const sidePanelToggleButtonStencil: import("@workday/canvas-kit-s
|
|
|
22
22
|
state: {
|
|
23
23
|
collapsing: {
|
|
24
24
|
margin: number;
|
|
25
|
-
transform: string;
|
|
26
|
-
':dir(rtl)': {
|
|
27
|
-
transform: string;
|
|
28
|
-
};
|
|
29
25
|
};
|
|
30
26
|
collapsed: {
|
|
31
27
|
margin: string;
|
|
32
|
-
transform: string;
|
|
33
|
-
':dir(rtl)': {
|
|
34
|
-
transform: string;
|
|
35
|
-
};
|
|
36
28
|
};
|
|
37
29
|
expanded: {
|
|
38
30
|
margin: number;
|
|
39
|
-
transform: string;
|
|
40
|
-
':dir(rtl)': {
|
|
41
|
-
transform: string;
|
|
42
|
-
};
|
|
43
31
|
};
|
|
44
32
|
expanding: {
|
|
45
33
|
margin: number;
|
|
46
|
-
transform: string;
|
|
47
|
-
':dir(rtl)': {
|
|
48
|
-
transform: string;
|
|
49
|
-
};
|
|
50
34
|
};
|
|
51
35
|
};
|
|
52
36
|
origin: {
|
|
53
|
-
start: {
|
|
37
|
+
start: {
|
|
38
|
+
insetInlineEnd: "var(--cnvs-base-size-150, 0.75rem)";
|
|
39
|
+
};
|
|
54
40
|
end: {
|
|
55
|
-
|
|
56
|
-
':dir(rtl)': {
|
|
57
|
-
transform: string;
|
|
58
|
-
};
|
|
41
|
+
insetInlineStart: "var(--cnvs-base-size-150, 0.75rem)";
|
|
59
42
|
};
|
|
60
43
|
};
|
|
61
44
|
}, {}, {}, never, never>;
|
|
45
|
+
/**
|
|
46
|
+
* Adds the necessary ARIA attributes to the SidePanel's toggle button.
|
|
47
|
+
* This includes `aria-controls` pointing at the panel, `aria-pressed` to convey the collapsed
|
|
48
|
+
* state, and `aria-describedby` pointing at the panel's heading.
|
|
49
|
+
*/
|
|
62
50
|
export declare const useSidePanelToggleButton: import("@workday/canvas-kit-react/common").BehaviorHook<{
|
|
63
51
|
state: {
|
|
64
52
|
panelId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidePanelToggleButton.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/SidePanelToggleButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,cAAc,EAAC,MAAM,kCAAkC,CAAC;AAChE,OAAO,EACL,YAAY,EAGb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAU,YAAY,EAAC,MAAM,mCAAmC,CAAC;AAOxE,MAAM,WAAW,0BAA2B,SAAQ,YAAY,CAAC,OAAO,cAAc,CAAC;IACrF;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;CAC/C;AAED,eAAO,MAAM,4BAA4B
|
|
1
|
+
{"version":3,"file":"SidePanelToggleButton.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/SidePanelToggleButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,cAAc,EAAC,MAAM,kCAAkC,CAAC;AAChE,OAAO,EACL,YAAY,EAGb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAU,YAAY,EAAC,MAAM,mCAAmC,CAAC;AAOxE,MAAM,WAAW,0BAA2B,SAAQ,YAAY,CAAC,OAAO,cAAc,CAAC;IACrF;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;CAC/C;AAED,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;wBAiCvC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;EAMnC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;EAkDjC,CAAC"}
|
|
@@ -10,38 +10,25 @@ const canvas_system_icons_web_1 = require("@workday/canvas-system-icons-web");
|
|
|
10
10
|
const canvas_tokens_web_1 = require("@workday/canvas-tokens-web");
|
|
11
11
|
const useSidePanelModel_1 = require("./useSidePanelModel");
|
|
12
12
|
exports.sidePanelToggleButtonStencil = (0, canvas_kit_styling_1.createStencil)({
|
|
13
|
-
base: { name: "
|
|
13
|
+
base: { name: "1tc2s5", styles: "box-sizing:border-box;position:absolute;top:0.75rem;width:var(--cnvs-sys-size-md, var(--cnvs-sys-space-x10, 2.5rem));:dir(rtl){transform:scaleX(-1);}" },
|
|
14
14
|
modifiers: {
|
|
15
15
|
state: {
|
|
16
|
-
collapsing: { name: "
|
|
17
|
-
collapsed: { name: "
|
|
18
|
-
expanded: { name: "
|
|
19
|
-
expanding: { name: "
|
|
16
|
+
collapsing: { name: "188d5g", styles: "margin:0;" },
|
|
17
|
+
collapsed: { name: "32hqvm", styles: "margin:auto;" },
|
|
18
|
+
expanded: { name: "1k9rz5", styles: "margin:0;" },
|
|
19
|
+
expanding: { name: "2joyzc", styles: "margin:0;" }
|
|
20
20
|
},
|
|
21
21
|
origin: {
|
|
22
|
-
start: { name: "
|
|
23
|
-
end: { name: "
|
|
22
|
+
start: { name: "2j8xn2", styles: "inset-inline-end:var(--cnvs-base-size-150, 0.75rem);" },
|
|
23
|
+
end: { name: "1pjclt", styles: "inset-inline-start:var(--cnvs-base-size-150, 0.75rem);" }
|
|
24
24
|
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
modifiers: { state: 'collapsing', origin: 'end' },
|
|
33
|
-
styles: { name: "1xw2ag", styles: "transform:scaleX(-1);inset-inline-start:var(--cnvs-base-size-150, 0.75rem);:dir(rtl){transform:scaleX(1);inset-inline-end:var(--cnvs-base-size-150, 0.75rem);}" }
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
modifiers: { state: 'expanded', origin: 'end' },
|
|
37
|
-
styles: { name: "jlmhn", styles: "transform:scaleX(1);inset-inline-start:var(--cnvs-base-size-150, 0.75rem);:dir(rtl){transform:scaleX(-1);inset-inline-end:var(--cnvs-base-size-150, 0.75rem);}" }
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
modifiers: { state: 'expanding', origin: 'end' },
|
|
41
|
-
styles: { name: "385gh9", styles: "transform:scaleX(1);inset-inline-start:var(--cnvs-base-size-150, 0.75rem);:dir(rtl){transform:scaleX(-1);inset-inline-end:var(--cnvs-base-size-150, 0.75rem);}" }
|
|
42
|
-
}
|
|
43
|
-
]
|
|
44
|
-
}, "side-panel-toggle-button-e78d70");
|
|
25
|
+
}
|
|
26
|
+
}, "side-panel-toggle-button-61b45f");
|
|
27
|
+
/**
|
|
28
|
+
* Adds the necessary ARIA attributes to the SidePanel's toggle button.
|
|
29
|
+
* This includes `aria-controls` pointing at the panel, `aria-pressed` to convey the collapsed
|
|
30
|
+
* state, and `aria-describedby` pointing at the panel's heading.
|
|
31
|
+
*/
|
|
45
32
|
exports.useSidePanelToggleButton = (0, common_1.createElemPropsHook)(useSidePanelModel_1.useSidePanelModel)(({ state }) => {
|
|
46
33
|
return {
|
|
47
34
|
'aria-controls': state.panelId,
|
|
@@ -53,9 +40,10 @@ exports.SidePanelToggleButton = (0, common_1.createSubcomponent)('button')({
|
|
|
53
40
|
displayName: 'SidePanel.ToggleButton',
|
|
54
41
|
modelHook: useSidePanelModel_1.useSidePanelModel,
|
|
55
42
|
elemPropsHook: exports.useSidePanelToggleButton,
|
|
56
|
-
})(({ variant = undefined, icon
|
|
43
|
+
})(({ variant = undefined, icon, tooltipTextExpand = 'Expand View', tooltipTextCollapse = 'Collapse View', tooltipProps, tooltipText, ...elemProps }, Element, model) => {
|
|
44
|
+
const sidePanelIcon = icon || (model.state.origin === 'start' ? canvas_system_icons_web_1.sidebarLeftIcon : canvas_system_icons_web_1.sidebarRightIcon);
|
|
57
45
|
return ((0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { type: "muted", ...tooltipProps, title: tooltipText ||
|
|
58
|
-
(model.state.transitionState === 'expanded' ? tooltipTextCollapse : tooltipTextExpand), children: (0, jsx_runtime_1.jsx)(button_1.TertiaryButton, { icon:
|
|
46
|
+
(model.state.transitionState === 'expanded' ? tooltipTextCollapse : tooltipTextExpand), children: (0, jsx_runtime_1.jsx)(button_1.TertiaryButton, { icon: sidePanelIcon, as: Element, variant: variant, "aria-label": tooltipText, ...(0, canvas_kit_styling_1.handleCsProp)(elemProps, (0, exports.sidePanelToggleButtonStencil)({
|
|
59
47
|
state: model.state.transitionState,
|
|
60
48
|
origin: model.state.origin,
|
|
61
49
|
})), onClick: (event) => {
|
|
@@ -27,7 +27,8 @@ export declare const useSidePanelModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
27
27
|
panelId: string;
|
|
28
28
|
/**
|
|
29
29
|
* The unique ID for the panel's label element. If not provided, a unique ID will be generated.
|
|
30
|
-
* This ID is used for the `aria-labelledby` attribute on
|
|
30
|
+
* This ID is used for the `aria-labelledby` attribute on the panel and the `aria-describedby`
|
|
31
|
+
* attribute on the toggle button.
|
|
31
32
|
*/
|
|
32
33
|
labelId: string;
|
|
33
34
|
/**
|
|
@@ -43,8 +44,8 @@ export declare const useSidePanelModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
43
44
|
*/
|
|
44
45
|
panelId: string;
|
|
45
46
|
/**
|
|
46
|
-
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel
|
|
47
|
-
* and
|
|
47
|
+
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel to
|
|
48
|
+
* provide its accessible name, and for `aria-describedby` on the toggle button.
|
|
48
49
|
*/
|
|
49
50
|
labelId: string;
|
|
50
51
|
/**
|
|
@@ -77,8 +78,8 @@ export declare const useSidePanelModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
77
78
|
*/
|
|
78
79
|
panelId: string;
|
|
79
80
|
/**
|
|
80
|
-
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel
|
|
81
|
-
* and
|
|
81
|
+
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel to
|
|
82
|
+
* provide its accessible name, and for `aria-describedby` on the toggle button.
|
|
82
83
|
*/
|
|
83
84
|
labelId: string;
|
|
84
85
|
/**
|
|
@@ -111,8 +112,8 @@ export declare const useSidePanelModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
111
112
|
*/
|
|
112
113
|
panelId: string;
|
|
113
114
|
/**
|
|
114
|
-
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel
|
|
115
|
-
* and
|
|
115
|
+
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel to
|
|
116
|
+
* provide its accessible name, and for `aria-describedby` on the toggle button.
|
|
116
117
|
*/
|
|
117
118
|
labelId: string;
|
|
118
119
|
/**
|
|
@@ -145,8 +146,8 @@ export declare const useSidePanelModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
145
146
|
*/
|
|
146
147
|
panelId: string;
|
|
147
148
|
/**
|
|
148
|
-
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel
|
|
149
|
-
* and
|
|
149
|
+
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel to
|
|
150
|
+
* provide its accessible name, and for `aria-describedby` on the toggle button.
|
|
150
151
|
*/
|
|
151
152
|
labelId: string;
|
|
152
153
|
/**
|
|
@@ -180,8 +181,8 @@ export declare const useSidePanelModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
180
181
|
*/
|
|
181
182
|
panelId: string;
|
|
182
183
|
/**
|
|
183
|
-
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel
|
|
184
|
-
* and
|
|
184
|
+
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel to
|
|
185
|
+
* provide its accessible name, and for `aria-describedby` on the toggle button.
|
|
185
186
|
*/
|
|
186
187
|
labelId: string;
|
|
187
188
|
/**
|
|
@@ -214,8 +215,8 @@ export declare const useSidePanelModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
214
215
|
*/
|
|
215
216
|
panelId: string;
|
|
216
217
|
/**
|
|
217
|
-
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel
|
|
218
|
-
* and
|
|
218
|
+
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel to
|
|
219
|
+
* provide its accessible name, and for `aria-describedby` on the toggle button.
|
|
219
220
|
*/
|
|
220
221
|
labelId: string;
|
|
221
222
|
/**
|
|
@@ -248,8 +249,8 @@ export declare const useSidePanelModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
248
249
|
*/
|
|
249
250
|
panelId: string;
|
|
250
251
|
/**
|
|
251
|
-
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel
|
|
252
|
-
* and
|
|
252
|
+
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel to
|
|
253
|
+
* provide its accessible name, and for `aria-describedby` on the toggle button.
|
|
253
254
|
*/
|
|
254
255
|
labelId: string;
|
|
255
256
|
/**
|
|
@@ -282,8 +283,8 @@ export declare const useSidePanelModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
282
283
|
*/
|
|
283
284
|
panelId: string;
|
|
284
285
|
/**
|
|
285
|
-
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel
|
|
286
|
-
* and
|
|
286
|
+
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel to
|
|
287
|
+
* provide its accessible name, and for `aria-describedby` on the toggle button.
|
|
287
288
|
*/
|
|
288
289
|
labelId: string;
|
|
289
290
|
/**
|
|
@@ -317,8 +318,8 @@ export declare const useSidePanelModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
317
318
|
*/
|
|
318
319
|
panelId: string;
|
|
319
320
|
/**
|
|
320
|
-
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel
|
|
321
|
-
* and
|
|
321
|
+
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel to
|
|
322
|
+
* provide its accessible name, and for `aria-describedby` on the toggle button.
|
|
322
323
|
*/
|
|
323
324
|
labelId: string;
|
|
324
325
|
/**
|
|
@@ -388,7 +389,8 @@ export declare const useSidePanelModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
388
389
|
panelId: string;
|
|
389
390
|
/**
|
|
390
391
|
* The unique ID for the panel's label element. If not provided, a unique ID will be generated.
|
|
391
|
-
* This ID is used for the `aria-labelledby` attribute on
|
|
392
|
+
* This ID is used for the `aria-labelledby` attribute on the panel and the `aria-describedby`
|
|
393
|
+
* attribute on the toggle button.
|
|
392
394
|
*/
|
|
393
395
|
labelId: string;
|
|
394
396
|
/**
|
|
@@ -403,8 +405,8 @@ export declare const useSidePanelModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
403
405
|
*/
|
|
404
406
|
panelId: string;
|
|
405
407
|
/**
|
|
406
|
-
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel
|
|
407
|
-
* and
|
|
408
|
+
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel to
|
|
409
|
+
* provide its accessible name, and for `aria-describedby` on the toggle button.
|
|
408
410
|
*/
|
|
409
411
|
labelId: string;
|
|
410
412
|
/**
|
|
@@ -459,8 +461,8 @@ export declare const useSidePanelModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
459
461
|
*/
|
|
460
462
|
panelId: string;
|
|
461
463
|
/**
|
|
462
|
-
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel
|
|
463
|
-
* and
|
|
464
|
+
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel to
|
|
465
|
+
* provide its accessible name, and for `aria-describedby` on the toggle button.
|
|
464
466
|
*/
|
|
465
467
|
labelId: string;
|
|
466
468
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSidePanelModel.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/useSidePanelModel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;;;;;GAMG;AACH,MAAM,MAAM,yBAAyB,GAAG,WAAW,GAAG,YAAY,GAAG,UAAU,GAAG,WAAW,CAAC;AAE9F,eAAO,MAAM,iBAAiB;IAE1B;;;OAGG;;IAEH;;;;;OAKG;;IAEH;;;OAGG;;IAEH
|
|
1
|
+
{"version":3,"file":"useSidePanelModel.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/useSidePanelModel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;;;;;GAMG;AACH,MAAM,MAAM,yBAAyB,GAAG,WAAW,GAAG,YAAY,GAAG,UAAU,GAAG,WAAW,CAAC;AAE9F,eAAO,MAAM,iBAAiB;IAE1B;;;OAGG;;IAEH;;;;;OAKG;;IAEH;;;OAGG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;6BACsB,yBAAyB;;;QAsBlD;;WAEG;;QAEH;;;WAGG;;QAEH;;;WAGG;;QA9DH;;;WAGG;;QAEH;;;;;WAKG;;QAaH;;;;WAIG;iCACsB,yBAAyB;;;QAsBlD;;WAEG;;QAEH;;;WAGG;;QAEH;;;WAGG;;QA9DH;;;WAGG;;QAEH;;;;;WAKG;;QAaH;;;;WAIG;iCACsB,yBAAyB;;;QAsBlD;;WAEG;;QAEH;;;WAGG;;QAEH;;;WAGG;;QA9DH;;;WAGG;;QAEH;;;;;WAKG;;QAaH;;;;WAIG;iCACsB,yBAAyB;;;QAsBlD;;WAEG;;QAEH;;;WAGG;;QAEH;;;WAGG;;QA9DH;;;WAGG;;QAEH;;;;;WAKG;;QAaH;;;;WAIG;iCACsB,yBAAyB;;;;QAsBlD;;WAEG;;QAEH;;;WAGG;;QAEH;;;WAGG;;QA9DH;;;WAGG;;QAEH;;;;;WAKG;;QAaH;;;;WAIG;iCACsB,yBAAyB;;;QAsBlD;;WAEG;;QAEH;;;WAGG;;QAEH;;;WAGG;;QA9DH;;;WAGG;;QAEH;;;;;WAKG;;QAaH;;;;WAIG;iCACsB,yBAAyB;;;QAsBlD;;WAEG;;QAEH;;;WAGG;;QAEH;;;WAGG;;QA9DH;;;WAGG;;QAEH;;;;;WAKG;;QAaH;;;;WAIG;iCACsB,yBAAyB;;;QAsBlD;;WAEG;;QAEH;;;WAGG;;QAEH;;;WAGG;;QA9DH;;;WAGG;;QAEH;;;;;WAKG;;QAaH;;;;WAIG;iCACsB,yBAAyB;;;;QAsBlD;;WAEG;;QAEH;;;WAGG;;QAEH;;;WAGG;;QA9DH;;;WAGG;;QAEH;;;;;WAKG;;QAaH;;;;WAIG;iCACsB,yBAAyB;;;QAuClD;;;WAGG;;QAKH;;;WAGG;;QAKH;;;;WAIG;kCACuB,qBAAqB,CAAC,cAAc,CAAC;QAW/D;;;WAGG;;;;IAtGH;;;OAGG;;IAEH;;;;;OAKG;;IAEH;;;OAGG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;6BACsB,yBAAyB;;IAsBlD;;OAEG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IA9DH;;;OAGG;;IAEH;;;;;OAKG;;IAaH;;;;OAIG;6BACsB,yBAAyB;;IAuClD;;;OAGG;;IAKH;;;OAGG;;IAKH;;;;OAIG;8BACuB,qBAAqB,CAAC,cAAc,CAAC;IAW/D;;;OAGG;;;;QApDH;;WAEG;;QAEH;;;WAGG;;QAEH;;;WAGG;;QA9DH;;;WAGG;;QAEH;;;;;WAKG;;QAaH;;;;WAIG;iCACsB,yBAAyB;;;QAuClD;;;WAGG;;QAKH;;;WAGG;;QAKH;;;;WAIG;kCACuB,qBAAqB,CAAC,cAAc,CAAC;QAW/D;;;WAGG;;;EAYL,CAAC"}
|
|
@@ -47,7 +47,8 @@ exports.useSidePanelModel = (0, common_1.createModelHook)({
|
|
|
47
47
|
panelId: '',
|
|
48
48
|
/**
|
|
49
49
|
* The unique ID for the panel's label element. If not provided, a unique ID will be generated.
|
|
50
|
-
* This ID is used for the `aria-labelledby` attribute on
|
|
50
|
+
* This ID is used for the `aria-labelledby` attribute on the panel and the `aria-describedby`
|
|
51
|
+
* attribute on the toggle button.
|
|
51
52
|
*/
|
|
52
53
|
labelId: '',
|
|
53
54
|
/**
|
|
@@ -75,8 +76,8 @@ exports.useSidePanelModel = (0, common_1.createModelHook)({
|
|
|
75
76
|
*/
|
|
76
77
|
panelId,
|
|
77
78
|
/**
|
|
78
|
-
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel
|
|
79
|
-
* and
|
|
79
|
+
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel to
|
|
80
|
+
* provide its accessible name, and for `aria-describedby` on the toggle button.
|
|
80
81
|
*/
|
|
81
82
|
labelId,
|
|
82
83
|
/**
|
|
@@ -24,7 +24,7 @@ export declare const useSidePanelContainer: import("@workday/canvas-kit-react/co
|
|
|
24
24
|
readonly 'aria-labelledby': string;
|
|
25
25
|
readonly onTransitionEnd: (event: React.TransitionEvent<HTMLDivElement>) => React.TransitionEvent<HTMLDivElement>;
|
|
26
26
|
}>;
|
|
27
|
-
export type SidePanelVariant = 'standard' | '
|
|
27
|
+
export type SidePanelVariant = 'standard' | 'alternative' | 'overlay';
|
|
28
28
|
export interface SidePanelProps extends CSProps {
|
|
29
29
|
/**
|
|
30
30
|
* The width of the component (in `px` if it's a `number`) when it is collapsed.
|
|
@@ -39,7 +39,10 @@ export interface SidePanelProps extends CSProps {
|
|
|
39
39
|
*/
|
|
40
40
|
expandedWidth?: number | string;
|
|
41
41
|
/**
|
|
42
|
-
* The style variant of the side panel.
|
|
42
|
+
* The style variant of the side panel.
|
|
43
|
+
* - `'standard'`: navigation surface background (`system.legacy.color.surface.navigation`), no depth.
|
|
44
|
+
* - `'alternative'`: raised surface background (`system.legacy.color.surface.raised`), no depth.
|
|
45
|
+
* - `'overlay'`: default surface background (`system.legacy.color.surface.default`) with level 6 depth, for panels that need to look lifted off the page. This is a visual treatment only — it adds no dialog semantics, focus trapping, or backdrop.
|
|
43
46
|
*
|
|
44
47
|
* @default 'standard'
|
|
45
48
|
*/
|
|
@@ -48,9 +51,12 @@ export interface SidePanelProps extends CSProps {
|
|
|
48
51
|
}
|
|
49
52
|
export declare const panelStencil: import("@workday/canvas-kit-styling").Stencil<{
|
|
50
53
|
variant: {
|
|
51
|
-
|
|
54
|
+
overlay: {
|
|
52
55
|
backgroundColor: "var(--cnvs-sys-color-surface-default, var(--cnvs-sys-color-bg-default, oklch(1 0 0 / 1)))";
|
|
53
|
-
boxShadow: "--cnvs-sys-depth-
|
|
56
|
+
boxShadow: "--cnvs-sys-depth-6";
|
|
57
|
+
};
|
|
58
|
+
alternative: {
|
|
59
|
+
backgroundColor: "var(--cnvs-sys-color-surface-raised, var(--cnvs-sys-color-bg-alt-softer, oklch(0.4688 0.0781 250.43 / 0.03)))";
|
|
54
60
|
};
|
|
55
61
|
standard: {
|
|
56
62
|
backgroundColor: "var(--cnvs-sys-color-surface-navigation, oklch(0.9692 0.0035 248.23 / 1))";
|
|
@@ -183,8 +189,10 @@ export declare const SidePanel: import("@workday/canvas-kit-react/common").Eleme
|
|
|
183
189
|
* It must be used within the `SidePanel` component as a child. For accessibility purposes,
|
|
184
190
|
* it should be the first focusable element in the panel.
|
|
185
191
|
*
|
|
186
|
-
* The button automatically receives `aria-controls
|
|
187
|
-
*
|
|
192
|
+
* The button automatically receives `aria-controls` (the panel's `id`), `aria-pressed` (`true`
|
|
193
|
+
* when the panel is collapsed), and `aria-describedby` (the heading's `id`) from the model.
|
|
194
|
+
* Provide a static `aria-label` for the button's accessible name — `aria-pressed` already
|
|
195
|
+
* conveys the state, so the label should not change between states.
|
|
188
196
|
*/
|
|
189
197
|
ToggleButton: import("@workday/canvas-kit-react/common").ElementComponentM<"button", import("./SidePanelToggleButton").SidePanelToggleButtonProps, {
|
|
190
198
|
state: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidePanel.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/SidePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,OAAO,EAAsC,MAAM,6BAA6B,CAAC;AAOzF;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;EAMhC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"SidePanel.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/SidePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,OAAO,EAAsC,MAAM,6BAA6B,CAAC;AAOzF;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;EAMhC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,aAAa,GAAG,SAAS,CAAC;AAEtE,MAAM,WAAW,cAAe,SAAQ,OAAO;IAC7C;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA4CvB,CAAC;AAEH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKlB;;;;;;;;;OASG;;;;;;;;;;;;;;;;;IAEH;;;;OAIG;;;;;;;;;;;;;;;;;CAgCN,CAAC"}
|
|
@@ -21,20 +21,21 @@ export const panelStencil = createStencil({
|
|
|
21
21
|
expandedWidth: '',
|
|
22
22
|
collapsedWidth: '',
|
|
23
23
|
},
|
|
24
|
-
base: { name: "
|
|
24
|
+
base: { name: "266imo", styles: "box-sizing:border-box;overflow:hidden;position:relative;height:100%;outline:0.0625rem solid transparent;transition:width ease-out 200ms, max-width ease-out 200ms;" },
|
|
25
25
|
modifiers: {
|
|
26
26
|
variant: {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
overlay: { name: "3jhjbz", styles: "background-color:var(--cnvs-sys-color-surface-default, var(--cnvs-sys-color-bg-default, oklch(1 0 0 / 1)));box-shadow:var(--cnvs-sys-depth-6);" },
|
|
28
|
+
alternative: { name: "zloh7", styles: "background-color:var(--cnvs-sys-color-surface-raised, var(--cnvs-sys-color-bg-alt-softer, oklch(0.4688 0.0781 250.43 / 0.03)));" },
|
|
29
|
+
standard: { name: "1ujtij", styles: "background-color:var(--cnvs-sys-color-surface-navigation, oklch(0.9692 0.0035 248.23 / 1));" }
|
|
29
30
|
},
|
|
30
31
|
expanded: {
|
|
31
|
-
expanded: { name: "
|
|
32
|
-
collapsed: { name: "
|
|
33
|
-
expanding: { name: "
|
|
34
|
-
collapsing: { name: "
|
|
32
|
+
expanded: { name: "2ii7mh", styles: "width:var(--expandedWidth-panel-bd0abc);max-width:var(--expandedWidth-panel-bd0abc);" },
|
|
33
|
+
collapsed: { name: "31yo9a", styles: "width:var(--collapsedWidth-panel-bd0abc);max-width:var(--collapsedWidth-panel-bd0abc);" },
|
|
34
|
+
expanding: { name: "3i6sk2", styles: "width:var(--expandedWidth-panel-bd0abc);max-width:var(--expandedWidth-panel-bd0abc);" },
|
|
35
|
+
collapsing: { name: "fh1bz", styles: "width:var(--collapsedWidth-panel-bd0abc);max-width:var(--collapsedWidth-panel-bd0abc);" }
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
|
-
}, "panel-
|
|
38
|
+
}, "panel-bd0abc");
|
|
38
39
|
export const SidePanel = createContainer('section')({
|
|
39
40
|
displayName: 'SidePanel',
|
|
40
41
|
modelHook: useSidePanelModel,
|
|
@@ -45,8 +46,10 @@ export const SidePanel = createContainer('section')({
|
|
|
45
46
|
* It must be used within the `SidePanel` component as a child. For accessibility purposes,
|
|
46
47
|
* it should be the first focusable element in the panel.
|
|
47
48
|
*
|
|
48
|
-
* The button automatically receives `aria-controls
|
|
49
|
-
*
|
|
49
|
+
* The button automatically receives `aria-controls` (the panel's `id`), `aria-pressed` (`true`
|
|
50
|
+
* when the panel is collapsed), and `aria-describedby` (the heading's `id`) from the model.
|
|
51
|
+
* Provide a static `aria-label` for the button's accessible name — `aria-pressed` already
|
|
52
|
+
* conveys the state, so the label should not change between states.
|
|
50
53
|
*/
|
|
51
54
|
ToggleButton: SidePanelToggleButton,
|
|
52
55
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidePanelHeading.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/SidePanelHeading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,YAAY,EAGb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,OAAO,EAAE,cAAc,EAAiB,MAAM,gCAAgC,CAAC;AAMvF,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,YAAY,CAAC,OAAO,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAC9F;;;OAGG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IAC9B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"SidePanelHeading.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/SidePanelHeading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,YAAY,EAGb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,OAAO,EAAE,cAAc,EAAiB,MAAM,gCAAgC,CAAC;AAMvF,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,YAAY,CAAC,OAAO,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAC9F;;;OAGG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IAC9B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAsBlC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;EAK9B,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;EAa3B,CAAC"}
|
|
@@ -6,11 +6,11 @@ import { system } from '@workday/canvas-tokens-web';
|
|
|
6
6
|
import { useSidePanelModel } from './useSidePanelModel';
|
|
7
7
|
export const sidePanelHeadingStencil = createStencil({
|
|
8
8
|
extends: headingStencil,
|
|
9
|
-
base: { name: "
|
|
9
|
+
base: { name: "1ywp21", styles: "box-sizing:border-box;display:flex;align-items:center;padding:var(--cnvs-sys-padding-sm, var(--cnvs-sys-space-x3, 0.75rem));padding-inline-start:var(--cnvs-sys-padding-md, var(--cnvs-sys-space-x4, 1rem));min-height:var(--cnvs-sys-size-xxl, var(--cnvs-sys-space-x16, 4rem));margin:0;&:where([hidden]){display:none;}" },
|
|
10
10
|
modifiers: {
|
|
11
11
|
origin: {
|
|
12
|
-
end: { name: "
|
|
13
|
-
start: { name: "
|
|
12
|
+
end: { name: "397xkx", styles: "padding-inline-start:4.25rem;" },
|
|
13
|
+
start: { name: "y9ngj", styles: "" }
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
}, "side-panel-heading-9d38c2");
|
|
@@ -22,43 +22,31 @@ export declare const sidePanelToggleButtonStencil: import("@workday/canvas-kit-s
|
|
|
22
22
|
state: {
|
|
23
23
|
collapsing: {
|
|
24
24
|
margin: number;
|
|
25
|
-
transform: string;
|
|
26
|
-
':dir(rtl)': {
|
|
27
|
-
transform: string;
|
|
28
|
-
};
|
|
29
25
|
};
|
|
30
26
|
collapsed: {
|
|
31
27
|
margin: string;
|
|
32
|
-
transform: string;
|
|
33
|
-
':dir(rtl)': {
|
|
34
|
-
transform: string;
|
|
35
|
-
};
|
|
36
28
|
};
|
|
37
29
|
expanded: {
|
|
38
30
|
margin: number;
|
|
39
|
-
transform: string;
|
|
40
|
-
':dir(rtl)': {
|
|
41
|
-
transform: string;
|
|
42
|
-
};
|
|
43
31
|
};
|
|
44
32
|
expanding: {
|
|
45
33
|
margin: number;
|
|
46
|
-
transform: string;
|
|
47
|
-
':dir(rtl)': {
|
|
48
|
-
transform: string;
|
|
49
|
-
};
|
|
50
34
|
};
|
|
51
35
|
};
|
|
52
36
|
origin: {
|
|
53
|
-
start: {
|
|
37
|
+
start: {
|
|
38
|
+
insetInlineEnd: "var(--cnvs-base-size-150, 0.75rem)";
|
|
39
|
+
};
|
|
54
40
|
end: {
|
|
55
|
-
|
|
56
|
-
':dir(rtl)': {
|
|
57
|
-
transform: string;
|
|
58
|
-
};
|
|
41
|
+
insetInlineStart: "var(--cnvs-base-size-150, 0.75rem)";
|
|
59
42
|
};
|
|
60
43
|
};
|
|
61
44
|
}, {}, {}, never, never>;
|
|
45
|
+
/**
|
|
46
|
+
* Adds the necessary ARIA attributes to the SidePanel's toggle button.
|
|
47
|
+
* This includes `aria-controls` pointing at the panel, `aria-pressed` to convey the collapsed
|
|
48
|
+
* state, and `aria-describedby` pointing at the panel's heading.
|
|
49
|
+
*/
|
|
62
50
|
export declare const useSidePanelToggleButton: import("@workday/canvas-kit-react/common").BehaviorHook<{
|
|
63
51
|
state: {
|
|
64
52
|
panelId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidePanelToggleButton.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/SidePanelToggleButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,cAAc,EAAC,MAAM,kCAAkC,CAAC;AAChE,OAAO,EACL,YAAY,EAGb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAU,YAAY,EAAC,MAAM,mCAAmC,CAAC;AAOxE,MAAM,WAAW,0BAA2B,SAAQ,YAAY,CAAC,OAAO,cAAc,CAAC;IACrF;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;CAC/C;AAED,eAAO,MAAM,4BAA4B
|
|
1
|
+
{"version":3,"file":"SidePanelToggleButton.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/SidePanelToggleButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,cAAc,EAAC,MAAM,kCAAkC,CAAC;AAChE,OAAO,EACL,YAAY,EAGb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAU,YAAY,EAAC,MAAM,mCAAmC,CAAC;AAOxE,MAAM,WAAW,0BAA2B,SAAQ,YAAY,CAAC,OAAO,cAAc,CAAC;IACrF;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;CAC/C;AAED,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;wBAiCvC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;EAMnC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;EAkDjC,CAAC"}
|
|
@@ -2,43 +2,30 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { TertiaryButton } from '@workday/canvas-kit-react/button';
|
|
3
3
|
import { createElemPropsHook, createSubcomponent, } from '@workday/canvas-kit-react/common';
|
|
4
4
|
import { Tooltip } from '@workday/canvas-kit-react/tooltip';
|
|
5
|
-
import { createStencil, handleCsProp } from '@workday/canvas-kit-styling';
|
|
6
|
-
import {
|
|
5
|
+
import { createStencil, handleCsProp, px2rem } from '@workday/canvas-kit-styling';
|
|
6
|
+
import { sidebarLeftIcon, sidebarRightIcon } from '@workday/canvas-system-icons-web';
|
|
7
7
|
import { base, system } from '@workday/canvas-tokens-web';
|
|
8
8
|
import { useSidePanelModel } from './useSidePanelModel';
|
|
9
9
|
export const sidePanelToggleButtonStencil = createStencil({
|
|
10
|
-
base: { name: "
|
|
10
|
+
base: { name: "1tc2s5", styles: "box-sizing:border-box;position:absolute;top:0.75rem;width:var(--cnvs-sys-size-md, var(--cnvs-sys-space-x10, 2.5rem));:dir(rtl){transform:scaleX(-1);}" },
|
|
11
11
|
modifiers: {
|
|
12
12
|
state: {
|
|
13
|
-
collapsing: { name: "
|
|
14
|
-
collapsed: { name: "
|
|
15
|
-
expanded: { name: "
|
|
16
|
-
expanding: { name: "
|
|
13
|
+
collapsing: { name: "188d5g", styles: "margin:0;" },
|
|
14
|
+
collapsed: { name: "32hqvm", styles: "margin:auto;" },
|
|
15
|
+
expanded: { name: "1k9rz5", styles: "margin:0;" },
|
|
16
|
+
expanding: { name: "2joyzc", styles: "margin:0;" }
|
|
17
17
|
},
|
|
18
18
|
origin: {
|
|
19
|
-
start: { name: "
|
|
20
|
-
end: { name: "
|
|
19
|
+
start: { name: "2j8xn2", styles: "inset-inline-end:var(--cnvs-base-size-150, 0.75rem);" },
|
|
20
|
+
end: { name: "1pjclt", styles: "inset-inline-start:var(--cnvs-base-size-150, 0.75rem);" }
|
|
21
21
|
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
modifiers: { state: 'collapsing', origin: 'end' },
|
|
30
|
-
styles: { name: "1xw2ag", styles: "transform:scaleX(-1);inset-inline-start:var(--cnvs-base-size-150, 0.75rem);:dir(rtl){transform:scaleX(1);inset-inline-end:var(--cnvs-base-size-150, 0.75rem);}" }
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
modifiers: { state: 'expanded', origin: 'end' },
|
|
34
|
-
styles: { name: "jlmhn", styles: "transform:scaleX(1);inset-inline-start:var(--cnvs-base-size-150, 0.75rem);:dir(rtl){transform:scaleX(-1);inset-inline-end:var(--cnvs-base-size-150, 0.75rem);}" }
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
modifiers: { state: 'expanding', origin: 'end' },
|
|
38
|
-
styles: { name: "385gh9", styles: "transform:scaleX(1);inset-inline-start:var(--cnvs-base-size-150, 0.75rem);:dir(rtl){transform:scaleX(-1);inset-inline-end:var(--cnvs-base-size-150, 0.75rem);}" }
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
}, "side-panel-toggle-button-e78d70");
|
|
22
|
+
}
|
|
23
|
+
}, "side-panel-toggle-button-61b45f");
|
|
24
|
+
/**
|
|
25
|
+
* Adds the necessary ARIA attributes to the SidePanel's toggle button.
|
|
26
|
+
* This includes `aria-controls` pointing at the panel, `aria-pressed` to convey the collapsed
|
|
27
|
+
* state, and `aria-describedby` pointing at the panel's heading.
|
|
28
|
+
*/
|
|
42
29
|
export const useSidePanelToggleButton = createElemPropsHook(useSidePanelModel)(({ state }) => {
|
|
43
30
|
return {
|
|
44
31
|
'aria-controls': state.panelId,
|
|
@@ -50,9 +37,10 @@ export const SidePanelToggleButton = createSubcomponent('button')({
|
|
|
50
37
|
displayName: 'SidePanel.ToggleButton',
|
|
51
38
|
modelHook: useSidePanelModel,
|
|
52
39
|
elemPropsHook: useSidePanelToggleButton,
|
|
53
|
-
})(({ variant = undefined, icon
|
|
40
|
+
})(({ variant = undefined, icon, tooltipTextExpand = 'Expand View', tooltipTextCollapse = 'Collapse View', tooltipProps, tooltipText, ...elemProps }, Element, model) => {
|
|
41
|
+
const sidePanelIcon = icon || (model.state.origin === 'start' ? sidebarLeftIcon : sidebarRightIcon);
|
|
54
42
|
return (_jsx(Tooltip, { type: "muted", ...tooltipProps, title: tooltipText ||
|
|
55
|
-
(model.state.transitionState === 'expanded' ? tooltipTextCollapse : tooltipTextExpand), children: _jsx(TertiaryButton, { icon:
|
|
43
|
+
(model.state.transitionState === 'expanded' ? tooltipTextCollapse : tooltipTextExpand), children: _jsx(TertiaryButton, { icon: sidePanelIcon, as: Element, variant: variant, "aria-label": tooltipText, ...handleCsProp(elemProps, sidePanelToggleButtonStencil({
|
|
56
44
|
state: model.state.transitionState,
|
|
57
45
|
origin: model.state.origin,
|
|
58
46
|
})), onClick: (event) => {
|
|
@@ -27,7 +27,8 @@ export declare const useSidePanelModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
27
27
|
panelId: string;
|
|
28
28
|
/**
|
|
29
29
|
* The unique ID for the panel's label element. If not provided, a unique ID will be generated.
|
|
30
|
-
* This ID is used for the `aria-labelledby` attribute on
|
|
30
|
+
* This ID is used for the `aria-labelledby` attribute on the panel and the `aria-describedby`
|
|
31
|
+
* attribute on the toggle button.
|
|
31
32
|
*/
|
|
32
33
|
labelId: string;
|
|
33
34
|
/**
|
|
@@ -43,8 +44,8 @@ export declare const useSidePanelModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
43
44
|
*/
|
|
44
45
|
panelId: string;
|
|
45
46
|
/**
|
|
46
|
-
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel
|
|
47
|
-
* and
|
|
47
|
+
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel to
|
|
48
|
+
* provide its accessible name, and for `aria-describedby` on the toggle button.
|
|
48
49
|
*/
|
|
49
50
|
labelId: string;
|
|
50
51
|
/**
|
|
@@ -77,8 +78,8 @@ export declare const useSidePanelModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
77
78
|
*/
|
|
78
79
|
panelId: string;
|
|
79
80
|
/**
|
|
80
|
-
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel
|
|
81
|
-
* and
|
|
81
|
+
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel to
|
|
82
|
+
* provide its accessible name, and for `aria-describedby` on the toggle button.
|
|
82
83
|
*/
|
|
83
84
|
labelId: string;
|
|
84
85
|
/**
|
|
@@ -111,8 +112,8 @@ export declare const useSidePanelModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
111
112
|
*/
|
|
112
113
|
panelId: string;
|
|
113
114
|
/**
|
|
114
|
-
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel
|
|
115
|
-
* and
|
|
115
|
+
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel to
|
|
116
|
+
* provide its accessible name, and for `aria-describedby` on the toggle button.
|
|
116
117
|
*/
|
|
117
118
|
labelId: string;
|
|
118
119
|
/**
|
|
@@ -145,8 +146,8 @@ export declare const useSidePanelModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
145
146
|
*/
|
|
146
147
|
panelId: string;
|
|
147
148
|
/**
|
|
148
|
-
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel
|
|
149
|
-
* and
|
|
149
|
+
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel to
|
|
150
|
+
* provide its accessible name, and for `aria-describedby` on the toggle button.
|
|
150
151
|
*/
|
|
151
152
|
labelId: string;
|
|
152
153
|
/**
|
|
@@ -180,8 +181,8 @@ export declare const useSidePanelModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
180
181
|
*/
|
|
181
182
|
panelId: string;
|
|
182
183
|
/**
|
|
183
|
-
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel
|
|
184
|
-
* and
|
|
184
|
+
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel to
|
|
185
|
+
* provide its accessible name, and for `aria-describedby` on the toggle button.
|
|
185
186
|
*/
|
|
186
187
|
labelId: string;
|
|
187
188
|
/**
|
|
@@ -214,8 +215,8 @@ export declare const useSidePanelModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
214
215
|
*/
|
|
215
216
|
panelId: string;
|
|
216
217
|
/**
|
|
217
|
-
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel
|
|
218
|
-
* and
|
|
218
|
+
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel to
|
|
219
|
+
* provide its accessible name, and for `aria-describedby` on the toggle button.
|
|
219
220
|
*/
|
|
220
221
|
labelId: string;
|
|
221
222
|
/**
|
|
@@ -248,8 +249,8 @@ export declare const useSidePanelModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
248
249
|
*/
|
|
249
250
|
panelId: string;
|
|
250
251
|
/**
|
|
251
|
-
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel
|
|
252
|
-
* and
|
|
252
|
+
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel to
|
|
253
|
+
* provide its accessible name, and for `aria-describedby` on the toggle button.
|
|
253
254
|
*/
|
|
254
255
|
labelId: string;
|
|
255
256
|
/**
|
|
@@ -282,8 +283,8 @@ export declare const useSidePanelModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
282
283
|
*/
|
|
283
284
|
panelId: string;
|
|
284
285
|
/**
|
|
285
|
-
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel
|
|
286
|
-
* and
|
|
286
|
+
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel to
|
|
287
|
+
* provide its accessible name, and for `aria-describedby` on the toggle button.
|
|
287
288
|
*/
|
|
288
289
|
labelId: string;
|
|
289
290
|
/**
|
|
@@ -317,8 +318,8 @@ export declare const useSidePanelModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
317
318
|
*/
|
|
318
319
|
panelId: string;
|
|
319
320
|
/**
|
|
320
|
-
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel
|
|
321
|
-
* and
|
|
321
|
+
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel to
|
|
322
|
+
* provide its accessible name, and for `aria-describedby` on the toggle button.
|
|
322
323
|
*/
|
|
323
324
|
labelId: string;
|
|
324
325
|
/**
|
|
@@ -388,7 +389,8 @@ export declare const useSidePanelModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
388
389
|
panelId: string;
|
|
389
390
|
/**
|
|
390
391
|
* The unique ID for the panel's label element. If not provided, a unique ID will be generated.
|
|
391
|
-
* This ID is used for the `aria-labelledby` attribute on
|
|
392
|
+
* This ID is used for the `aria-labelledby` attribute on the panel and the `aria-describedby`
|
|
393
|
+
* attribute on the toggle button.
|
|
392
394
|
*/
|
|
393
395
|
labelId: string;
|
|
394
396
|
/**
|
|
@@ -403,8 +405,8 @@ export declare const useSidePanelModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
403
405
|
*/
|
|
404
406
|
panelId: string;
|
|
405
407
|
/**
|
|
406
|
-
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel
|
|
407
|
-
* and
|
|
408
|
+
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel to
|
|
409
|
+
* provide its accessible name, and for `aria-describedby` on the toggle button.
|
|
408
410
|
*/
|
|
409
411
|
labelId: string;
|
|
410
412
|
/**
|
|
@@ -459,8 +461,8 @@ export declare const useSidePanelModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
459
461
|
*/
|
|
460
462
|
panelId: string;
|
|
461
463
|
/**
|
|
462
|
-
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel
|
|
463
|
-
* and
|
|
464
|
+
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel to
|
|
465
|
+
* provide its accessible name, and for `aria-describedby` on the toggle button.
|
|
464
466
|
*/
|
|
465
467
|
labelId: string;
|
|
466
468
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSidePanelModel.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/useSidePanelModel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;;;;;GAMG;AACH,MAAM,MAAM,yBAAyB,GAAG,WAAW,GAAG,YAAY,GAAG,UAAU,GAAG,WAAW,CAAC;AAE9F,eAAO,MAAM,iBAAiB;IAE1B;;;OAGG;;IAEH;;;;;OAKG;;IAEH;;;OAGG;;IAEH
|
|
1
|
+
{"version":3,"file":"useSidePanelModel.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/useSidePanelModel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;;;;;GAMG;AACH,MAAM,MAAM,yBAAyB,GAAG,WAAW,GAAG,YAAY,GAAG,UAAU,GAAG,WAAW,CAAC;AAE9F,eAAO,MAAM,iBAAiB;IAE1B;;;OAGG;;IAEH;;;;;OAKG;;IAEH;;;OAGG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;6BACsB,yBAAyB;;;QAsBlD;;WAEG;;QAEH;;;WAGG;;QAEH;;;WAGG;;QA9DH;;;WAGG;;QAEH;;;;;WAKG;;QAaH;;;;WAIG;iCACsB,yBAAyB;;;QAsBlD;;WAEG;;QAEH;;;WAGG;;QAEH;;;WAGG;;QA9DH;;;WAGG;;QAEH;;;;;WAKG;;QAaH;;;;WAIG;iCACsB,yBAAyB;;;QAsBlD;;WAEG;;QAEH;;;WAGG;;QAEH;;;WAGG;;QA9DH;;;WAGG;;QAEH;;;;;WAKG;;QAaH;;;;WAIG;iCACsB,yBAAyB;;;QAsBlD;;WAEG;;QAEH;;;WAGG;;QAEH;;;WAGG;;QA9DH;;;WAGG;;QAEH;;;;;WAKG;;QAaH;;;;WAIG;iCACsB,yBAAyB;;;;QAsBlD;;WAEG;;QAEH;;;WAGG;;QAEH;;;WAGG;;QA9DH;;;WAGG;;QAEH;;;;;WAKG;;QAaH;;;;WAIG;iCACsB,yBAAyB;;;QAsBlD;;WAEG;;QAEH;;;WAGG;;QAEH;;;WAGG;;QA9DH;;;WAGG;;QAEH;;;;;WAKG;;QAaH;;;;WAIG;iCACsB,yBAAyB;;;QAsBlD;;WAEG;;QAEH;;;WAGG;;QAEH;;;WAGG;;QA9DH;;;WAGG;;QAEH;;;;;WAKG;;QAaH;;;;WAIG;iCACsB,yBAAyB;;;QAsBlD;;WAEG;;QAEH;;;WAGG;;QAEH;;;WAGG;;QA9DH;;;WAGG;;QAEH;;;;;WAKG;;QAaH;;;;WAIG;iCACsB,yBAAyB;;;;QAsBlD;;WAEG;;QAEH;;;WAGG;;QAEH;;;WAGG;;QA9DH;;;WAGG;;QAEH;;;;;WAKG;;QAaH;;;;WAIG;iCACsB,yBAAyB;;;QAuClD;;;WAGG;;QAKH;;;WAGG;;QAKH;;;;WAIG;kCACuB,qBAAqB,CAAC,cAAc,CAAC;QAW/D;;;WAGG;;;;IAtGH;;;OAGG;;IAEH;;;;;OAKG;;IAEH;;;OAGG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;6BACsB,yBAAyB;;IAsBlD;;OAEG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IA9DH;;;OAGG;;IAEH;;;;;OAKG;;IAaH;;;;OAIG;6BACsB,yBAAyB;;IAuClD;;;OAGG;;IAKH;;;OAGG;;IAKH;;;;OAIG;8BACuB,qBAAqB,CAAC,cAAc,CAAC;IAW/D;;;OAGG;;;;QApDH;;WAEG;;QAEH;;;WAGG;;QAEH;;;WAGG;;QA9DH;;;WAGG;;QAEH;;;;;WAKG;;QAaH;;;;WAIG;iCACsB,yBAAyB;;;QAuClD;;;WAGG;;QAKH;;;WAGG;;QAKH;;;;WAIG;kCACuB,qBAAqB,CAAC,cAAc,CAAC;QAW/D;;;WAGG;;;EAYL,CAAC"}
|
|
@@ -21,7 +21,8 @@ export const useSidePanelModel = createModelHook({
|
|
|
21
21
|
panelId: '',
|
|
22
22
|
/**
|
|
23
23
|
* The unique ID for the panel's label element. If not provided, a unique ID will be generated.
|
|
24
|
-
* This ID is used for the `aria-labelledby` attribute on
|
|
24
|
+
* This ID is used for the `aria-labelledby` attribute on the panel and the `aria-describedby`
|
|
25
|
+
* attribute on the toggle button.
|
|
25
26
|
*/
|
|
26
27
|
labelId: '',
|
|
27
28
|
/**
|
|
@@ -49,8 +50,8 @@ export const useSidePanelModel = createModelHook({
|
|
|
49
50
|
*/
|
|
50
51
|
panelId,
|
|
51
52
|
/**
|
|
52
|
-
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel
|
|
53
|
-
* and
|
|
53
|
+
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel to
|
|
54
|
+
* provide its accessible name, and for `aria-describedby` on the toggle button.
|
|
54
55
|
*/
|
|
55
56
|
labelId,
|
|
56
57
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-react",
|
|
3
|
-
"version": "16.0.0-alpha.
|
|
3
|
+
"version": "16.0.0-alpha.0494-next.0",
|
|
4
4
|
"description": "The parent module that contains all Workday Canvas Kit React components",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"@tanstack/react-virtual": "^3.13.9",
|
|
54
54
|
"@workday/canvas-colors-web": "^2.0.0",
|
|
55
55
|
"@workday/canvas-expressive-icons-web": "1.0.2",
|
|
56
|
-
"@workday/canvas-kit-popup-stack": "^16.0.0-alpha.
|
|
57
|
-
"@workday/canvas-kit-styling": "^16.0.0-alpha.
|
|
56
|
+
"@workday/canvas-kit-popup-stack": "^16.0.0-alpha.0494-next.0",
|
|
57
|
+
"@workday/canvas-kit-styling": "^16.0.0-alpha.0494-next.0",
|
|
58
58
|
"@workday/canvas-system-icons-web": "5.0.1",
|
|
59
59
|
"@workday/canvas-tokens-web": "4.4.0-beta.13",
|
|
60
60
|
"@workday/design-assets-types": "^0.3.0",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"@workday/canvas-accent-icons-web": "^3.0.0",
|
|
70
70
|
"@workday/canvas-applet-icons-web": "^2.0.0"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "7bde57a5a6d4e41fd4a2e08f9f035c609ff4a8f0"
|
|
73
73
|
}
|
|
@@ -20,7 +20,7 @@ export const useSidePanelContainer = createElemPropsHook(useSidePanelModel)(({st
|
|
|
20
20
|
};
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
export type SidePanelVariant = 'standard' | '
|
|
23
|
+
export type SidePanelVariant = 'standard' | 'alternative' | 'overlay';
|
|
24
24
|
|
|
25
25
|
export interface SidePanelProps extends CSProps {
|
|
26
26
|
/**
|
|
@@ -36,7 +36,10 @@ export interface SidePanelProps extends CSProps {
|
|
|
36
36
|
*/
|
|
37
37
|
expandedWidth?: number | string;
|
|
38
38
|
/**
|
|
39
|
-
* The style variant of the side panel.
|
|
39
|
+
* The style variant of the side panel.
|
|
40
|
+
* - `'standard'`: navigation surface background (`system.legacy.color.surface.navigation`), no depth.
|
|
41
|
+
* - `'alternative'`: raised surface background (`system.legacy.color.surface.raised`), no depth.
|
|
42
|
+
* - `'overlay'`: default surface background (`system.legacy.color.surface.default`) with level 6 depth, for panels that need to look lifted off the page. This is a visual treatment only — it adds no dialog semantics, focus trapping, or backdrop.
|
|
40
43
|
*
|
|
41
44
|
* @default 'standard'
|
|
42
45
|
*/
|
|
@@ -58,9 +61,12 @@ export const panelStencil = createStencil({
|
|
|
58
61
|
}),
|
|
59
62
|
modifiers: {
|
|
60
63
|
variant: {
|
|
61
|
-
|
|
64
|
+
overlay: {
|
|
62
65
|
backgroundColor: system.legacy.color.surface.default,
|
|
63
|
-
boxShadow: system.depth[
|
|
66
|
+
boxShadow: system.depth[6],
|
|
67
|
+
},
|
|
68
|
+
alternative: {
|
|
69
|
+
backgroundColor: system.legacy.color.surface.raised,
|
|
64
70
|
},
|
|
65
71
|
standard: {
|
|
66
72
|
backgroundColor: system.legacy.color.surface.navigation,
|
|
@@ -97,8 +103,10 @@ export const SidePanel = createContainer('section')({
|
|
|
97
103
|
* It must be used within the `SidePanel` component as a child. For accessibility purposes,
|
|
98
104
|
* it should be the first focusable element in the panel.
|
|
99
105
|
*
|
|
100
|
-
* The button automatically receives `aria-controls
|
|
101
|
-
*
|
|
106
|
+
* The button automatically receives `aria-controls` (the panel's `id`), `aria-pressed` (`true`
|
|
107
|
+
* when the panel is collapsed), and `aria-describedby` (the heading's `id`) from the model.
|
|
108
|
+
* Provide a static `aria-label` for the button's accessible name — `aria-pressed` already
|
|
109
|
+
* conveys the state, so the label should not change between states.
|
|
102
110
|
*/
|
|
103
111
|
ToggleButton: SidePanelToggleButton,
|
|
104
112
|
/**
|
|
@@ -23,7 +23,16 @@ export interface SidePanelHeadingProps extends Omit<ExtractProps<typeof Heading,
|
|
|
23
23
|
export const sidePanelHeadingStencil = createStencil({
|
|
24
24
|
extends: headingStencil,
|
|
25
25
|
base: {
|
|
26
|
-
|
|
26
|
+
display: 'flex',
|
|
27
|
+
alignItems: 'center',
|
|
28
|
+
padding: system.legacy.padding.sm,
|
|
29
|
+
paddingInlineStart: system.legacy.padding.md,
|
|
30
|
+
minHeight: system.legacy.size.xxl,
|
|
31
|
+
margin: 0,
|
|
32
|
+
// `display` from this stencil outranks the user agent's `[hidden] {display: none}`
|
|
33
|
+
'&:where([hidden])': {
|
|
34
|
+
display: 'none',
|
|
35
|
+
},
|
|
27
36
|
},
|
|
28
37
|
modifiers: {
|
|
29
38
|
origin: {
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
createSubcomponent,
|
|
8
8
|
} from '@workday/canvas-kit-react/common';
|
|
9
9
|
import {Tooltip, TooltipProps} from '@workday/canvas-kit-react/tooltip';
|
|
10
|
-
import {createStencil, handleCsProp} from '@workday/canvas-kit-styling';
|
|
11
|
-
import {
|
|
10
|
+
import {createStencil, handleCsProp, px2rem} from '@workday/canvas-kit-styling';
|
|
11
|
+
import {sidebarLeftIcon, sidebarRightIcon} from '@workday/canvas-system-icons-web';
|
|
12
12
|
import {base, system} from '@workday/canvas-tokens-web';
|
|
13
13
|
|
|
14
14
|
import {useSidePanelModel} from './useSidePanelModel';
|
|
@@ -33,98 +33,43 @@ export interface SidePanelToggleButtonProps extends ExtractProps<typeof Tertiary
|
|
|
33
33
|
export const sidePanelToggleButtonStencil = createStencil({
|
|
34
34
|
base: {
|
|
35
35
|
position: 'absolute',
|
|
36
|
-
top:
|
|
37
|
-
width: system.legacy.
|
|
38
|
-
|
|
36
|
+
top: px2rem(12),
|
|
37
|
+
width: system.legacy.size.md,
|
|
38
|
+
':dir(rtl)': {
|
|
39
|
+
transform: `scaleX(-1)`,
|
|
40
|
+
},
|
|
39
41
|
},
|
|
40
42
|
modifiers: {
|
|
41
43
|
state: {
|
|
42
44
|
collapsing: {
|
|
43
45
|
margin: 0,
|
|
44
|
-
transform: `scaleX(1)`,
|
|
45
|
-
':dir(rtl)': {
|
|
46
|
-
transform: `scaleX(-1)`,
|
|
47
|
-
},
|
|
48
46
|
},
|
|
49
47
|
collapsed: {
|
|
50
48
|
margin: 'auto',
|
|
51
|
-
transform: `scaleX(1)`,
|
|
52
|
-
':dir(rtl)': {
|
|
53
|
-
transform: `scaleX(-1)`,
|
|
54
|
-
},
|
|
55
49
|
},
|
|
56
50
|
expanded: {
|
|
57
51
|
margin: 0,
|
|
58
|
-
transform: `scaleX(-1)`,
|
|
59
|
-
':dir(rtl)': {
|
|
60
|
-
transform: `scaleX(1)`,
|
|
61
|
-
},
|
|
62
52
|
},
|
|
63
53
|
expanding: {
|
|
64
54
|
margin: 0,
|
|
65
|
-
transform: `scaleX(-1)`,
|
|
66
|
-
':dir(rtl)': {
|
|
67
|
-
transform: `scaleX(1)`,
|
|
68
|
-
},
|
|
69
55
|
},
|
|
70
56
|
},
|
|
71
57
|
origin: {
|
|
72
|
-
start: {
|
|
73
|
-
|
|
74
|
-
transform: `scaleX(1)`,
|
|
75
|
-
':dir(rtl)': {
|
|
76
|
-
transform: `scaleX(-1)`,
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
compound: [
|
|
83
|
-
{
|
|
84
|
-
modifiers: {state: 'collapsed', origin: 'end'},
|
|
85
|
-
styles: {
|
|
86
|
-
transform: `scaleX(-1)`,
|
|
87
|
-
':dir(rtl)': {
|
|
88
|
-
transform: `scaleX(1)`,
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
modifiers: {state: 'collapsing', origin: 'end'},
|
|
94
|
-
styles: {
|
|
95
|
-
transform: `scaleX(-1)`,
|
|
96
|
-
insetInlineStart: base.legacy.size150,
|
|
97
|
-
':dir(rtl)': {
|
|
98
|
-
transform: `scaleX(1)`,
|
|
99
|
-
insetInlineEnd: base.legacy.size150,
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
modifiers: {state: 'expanded', origin: 'end'},
|
|
105
|
-
styles: {
|
|
106
|
-
transform: `scaleX(1)`,
|
|
107
|
-
insetInlineStart: base.legacy.size150,
|
|
108
|
-
':dir(rtl)': {
|
|
109
|
-
transform: `scaleX(-1)`,
|
|
110
|
-
insetInlineEnd: base.legacy.size150,
|
|
111
|
-
},
|
|
58
|
+
start: {
|
|
59
|
+
insetInlineEnd: base.legacy.size150,
|
|
112
60
|
},
|
|
113
|
-
|
|
114
|
-
{
|
|
115
|
-
modifiers: {state: 'expanding', origin: 'end'},
|
|
116
|
-
styles: {
|
|
117
|
-
transform: `scaleX(1)`,
|
|
61
|
+
end: {
|
|
118
62
|
insetInlineStart: base.legacy.size150,
|
|
119
|
-
':dir(rtl)': {
|
|
120
|
-
transform: `scaleX(-1)`,
|
|
121
|
-
insetInlineEnd: base.legacy.size150,
|
|
122
|
-
},
|
|
123
63
|
},
|
|
124
64
|
},
|
|
125
|
-
|
|
65
|
+
},
|
|
126
66
|
});
|
|
127
67
|
|
|
68
|
+
/**
|
|
69
|
+
* Adds the necessary ARIA attributes to the SidePanel's toggle button.
|
|
70
|
+
* This includes `aria-controls` pointing at the panel, `aria-pressed` to convey the collapsed
|
|
71
|
+
* state, and `aria-describedby` pointing at the panel's heading.
|
|
72
|
+
*/
|
|
128
73
|
export const useSidePanelToggleButton = createElemPropsHook(useSidePanelModel)(({state}) => {
|
|
129
74
|
return {
|
|
130
75
|
'aria-controls': state.panelId,
|
|
@@ -141,7 +86,7 @@ export const SidePanelToggleButton = createSubcomponent('button')({
|
|
|
141
86
|
(
|
|
142
87
|
{
|
|
143
88
|
variant = undefined,
|
|
144
|
-
icon
|
|
89
|
+
icon,
|
|
145
90
|
tooltipTextExpand = 'Expand View',
|
|
146
91
|
tooltipTextCollapse = 'Collapse View',
|
|
147
92
|
tooltipProps,
|
|
@@ -151,6 +96,9 @@ export const SidePanelToggleButton = createSubcomponent('button')({
|
|
|
151
96
|
Element,
|
|
152
97
|
model
|
|
153
98
|
) => {
|
|
99
|
+
const sidePanelIcon =
|
|
100
|
+
icon || (model.state.origin === 'start' ? sidebarLeftIcon : sidebarRightIcon);
|
|
101
|
+
|
|
154
102
|
return (
|
|
155
103
|
<Tooltip
|
|
156
104
|
type="muted"
|
|
@@ -161,7 +109,7 @@ export const SidePanelToggleButton = createSubcomponent('button')({
|
|
|
161
109
|
}
|
|
162
110
|
>
|
|
163
111
|
<TertiaryButton
|
|
164
|
-
icon={
|
|
112
|
+
icon={sidePanelIcon}
|
|
165
113
|
as={Element}
|
|
166
114
|
variant={variant}
|
|
167
115
|
aria-label={tooltipText}
|
|
@@ -32,7 +32,8 @@ export const useSidePanelModel = createModelHook({
|
|
|
32
32
|
panelId: '',
|
|
33
33
|
/**
|
|
34
34
|
* The unique ID for the panel's label element. If not provided, a unique ID will be generated.
|
|
35
|
-
* This ID is used for the `aria-labelledby` attribute on
|
|
35
|
+
* This ID is used for the `aria-labelledby` attribute on the panel and the `aria-describedby`
|
|
36
|
+
* attribute on the toggle button.
|
|
36
37
|
*/
|
|
37
38
|
labelId: '',
|
|
38
39
|
/**
|
|
@@ -67,8 +68,8 @@ export const useSidePanelModel = createModelHook({
|
|
|
67
68
|
*/
|
|
68
69
|
panelId,
|
|
69
70
|
/**
|
|
70
|
-
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel
|
|
71
|
-
* and
|
|
71
|
+
* The unique ID for the panel's label element. Used for `aria-labelledby` on the panel to
|
|
72
|
+
* provide its accessible name, and for `aria-describedby` on the toggle button.
|
|
72
73
|
*/
|
|
73
74
|
labelId,
|
|
74
75
|
/**
|