@wallarm-org/design-system 3.2.0-rc-feat-app-shell-aside.1 → 3.2.0-rc-feat-app-shell-aside.2

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.
@@ -6,11 +6,16 @@ import { cn } from "../../utils/cn.js";
6
6
  import { TestIdProvider } from "../../utils/testId.js";
7
7
  import { AppShellAmbient } from "./AppShellAmbient.js";
8
8
  import { AppShellContext } from "./AppShellContext.js";
9
+ import { ASIDE_SLIDE_EASE, ASIDE_SLIDE_MS } from "./constants.js";
9
10
  import { ExpandOverlay } from "./ExpandOverlay.js";
10
11
  import { RevealOverlay } from "./RevealOverlay.js";
11
12
  import { useShellAnimation } from "./useShellAnimation.js";
13
+ const ASIDE_MOTION = {
14
+ "--app-shell-aside-duration": `${ASIDE_SLIDE_MS}ms`,
15
+ "--app-shell-aside-ease": ASIDE_SLIDE_EASE
16
+ };
12
17
  const AppShell = (t0)=>{
13
- const $ = c(50);
18
+ const $ = c(52);
14
19
  let appearedProp;
15
20
  let children;
16
21
  let className;
@@ -80,92 +85,101 @@ const AppShell = (t0)=>{
80
85
  } else t4 = $[19];
81
86
  let t5;
82
87
  if ($[20] !== className) {
83
- t5 = cn('relative isolate grid h-screen overscroll-none [grid-template-areas:"header_header_header""rail_remote_aside"] [grid-template-columns:auto_1fr_auto] [grid-template-rows:auto_1fr] bg-component-app-shell-bg', className);
88
+ t5 = cn('relative isolate grid h-screen overscroll-none [grid-template-areas:"header_header_header""rail_remote_aside"] [grid-template-columns:auto_1fr_0px] [grid-template-rows:auto_1fr] bg-component-app-shell-bg', "[--app-shell-aside-width:--spacing(480)]", "has-[>[data-slot=app-shell-aside][data-state=open]]:[grid-template-columns:auto_1fr_calc(var(--app-shell-aside-width)+var(--spacing-8)*2)] has-[>[data-slot=app-shell-aside]]:overflow-x-clip", "transition-[grid-template-columns] duration-(--app-shell-aside-duration) ease-(--app-shell-aside-ease) motion-reduce:transition-none", className);
84
89
  $[20] = className;
85
90
  $[21] = t5;
86
91
  } else t5 = $[21];
87
- const t6 = expandFrom ? handleExpandTransitionEnd : void 0;
88
- let t7;
89
- if ($[22] !== ambient) {
90
- t7 = ambient && /*#__PURE__*/ jsx(AppShellAmbient, {});
91
- $[22] = ambient;
92
- $[23] = t7;
93
- } else t7 = $[23];
92
+ let t6;
93
+ if ($[22] !== expandStyle) {
94
+ t6 = {
95
+ ...ASIDE_MOTION,
96
+ ...expandStyle
97
+ };
98
+ $[22] = expandStyle;
99
+ $[23] = t6;
100
+ } else t6 = $[23];
101
+ const t7 = expandFrom ? handleExpandTransitionEnd : void 0;
94
102
  let t8;
95
- if ($[24] !== expandFrom || $[25] !== phase || $[26] !== targetRect) {
96
- t8 = expandFrom && /*#__PURE__*/ jsx(ExpandOverlay, {
103
+ if ($[24] !== ambient) {
104
+ t8 = ambient && /*#__PURE__*/ jsx(AppShellAmbient, {});
105
+ $[24] = ambient;
106
+ $[25] = t8;
107
+ } else t8 = $[25];
108
+ let t9;
109
+ if ($[26] !== expandFrom || $[27] !== phase || $[28] !== targetRect) {
110
+ t9 = expandFrom && /*#__PURE__*/ jsx(ExpandOverlay, {
97
111
  phase: phase,
98
112
  expandFrom: expandFrom,
99
113
  targetRect: targetRect
100
114
  });
101
- $[24] = expandFrom;
102
- $[25] = phase;
103
- $[26] = targetRect;
104
- $[27] = t8;
105
- } else t8 = $[27];
106
- let t9;
107
- if ($[28] !== expandFrom || $[29] !== handleRevealOverlayTransitionEnd || $[30] !== phase || $[31] !== targetRect) {
108
- t9 = !expandFrom && /*#__PURE__*/ jsx(RevealOverlay, {
115
+ $[26] = expandFrom;
116
+ $[27] = phase;
117
+ $[28] = targetRect;
118
+ $[29] = t9;
119
+ } else t9 = $[29];
120
+ let t10;
121
+ if ($[30] !== expandFrom || $[31] !== handleRevealOverlayTransitionEnd || $[32] !== phase || $[33] !== targetRect) {
122
+ t10 = !expandFrom && /*#__PURE__*/ jsx(RevealOverlay, {
109
123
  phase: phase,
110
124
  targetRect: targetRect,
111
125
  onTransitionEnd: handleRevealOverlayTransitionEnd
112
126
  });
113
- $[28] = expandFrom;
114
- $[29] = handleRevealOverlayTransitionEnd;
115
- $[30] = phase;
116
- $[31] = targetRect;
117
- $[32] = t9;
118
- } else t9 = $[32];
119
- let t10;
120
- if ($[33] !== children || $[34] !== expandStyle || $[35] !== props || $[36] !== t4 || $[37] !== t5 || $[38] !== t6 || $[39] !== t7 || $[40] !== t8 || $[41] !== t9 || $[42] !== testId) {
121
- t10 = /*#__PURE__*/ jsxs("div", {
127
+ $[30] = expandFrom;
128
+ $[31] = handleRevealOverlayTransitionEnd;
129
+ $[32] = phase;
130
+ $[33] = targetRect;
131
+ $[34] = t10;
132
+ } else t10 = $[34];
133
+ let t11;
134
+ if ($[35] !== children || $[36] !== props || $[37] !== t10 || $[38] !== t4 || $[39] !== t5 || $[40] !== t6 || $[41] !== t7 || $[42] !== t8 || $[43] !== t9 || $[44] !== testId) {
135
+ t11 = /*#__PURE__*/ jsxs("div", {
122
136
  ...props,
123
137
  ref: t4,
124
138
  "data-slot": "app-shell",
125
139
  "data-testid": testId,
126
140
  className: t5,
127
- style: expandStyle,
128
- onTransitionEnd: t6,
141
+ style: t6,
142
+ onTransitionEnd: t7,
129
143
  children: [
130
- t7,
131
- children,
132
144
  t8,
133
- t9
145
+ children,
146
+ t9,
147
+ t10
134
148
  ]
135
149
  });
136
- $[33] = children;
137
- $[34] = expandStyle;
138
- $[35] = props;
139
- $[36] = t4;
140
- $[37] = t5;
141
- $[38] = t6;
142
- $[39] = t7;
143
- $[40] = t8;
144
- $[41] = t9;
145
- $[42] = testId;
146
- $[43] = t10;
147
- } else t10 = $[43];
148
- let t11;
149
- if ($[44] !== shellContext || $[45] !== t10) {
150
- t11 = /*#__PURE__*/ jsx(AppShellContext.Provider, {
151
- value: shellContext,
152
- children: t10
153
- });
154
- $[44] = shellContext;
155
- $[45] = t10;
156
- $[46] = t11;
157
- } else t11 = $[46];
150
+ $[35] = children;
151
+ $[36] = props;
152
+ $[37] = t10;
153
+ $[38] = t4;
154
+ $[39] = t5;
155
+ $[40] = t6;
156
+ $[41] = t7;
157
+ $[42] = t8;
158
+ $[43] = t9;
159
+ $[44] = testId;
160
+ $[45] = t11;
161
+ } else t11 = $[45];
158
162
  let t12;
159
- if ($[47] !== t11 || $[48] !== testId) {
160
- t12 = /*#__PURE__*/ jsx(TestIdProvider, {
161
- value: testId,
163
+ if ($[46] !== shellContext || $[47] !== t11) {
164
+ t12 = /*#__PURE__*/ jsx(AppShellContext.Provider, {
165
+ value: shellContext,
162
166
  children: t11
163
167
  });
168
+ $[46] = shellContext;
164
169
  $[47] = t11;
165
- $[48] = testId;
170
+ $[48] = t12;
171
+ } else t12 = $[48];
172
+ let t13;
173
+ if ($[49] !== t12 || $[50] !== testId) {
174
+ t13 = /*#__PURE__*/ jsx(TestIdProvider, {
175
+ value: testId,
176
+ children: t12
177
+ });
166
178
  $[49] = t12;
167
- } else t12 = $[49];
168
- return t12;
179
+ $[50] = testId;
180
+ $[51] = t13;
181
+ } else t13 = $[51];
182
+ return t13;
169
183
  };
170
184
  AppShell.displayName = "AppShell";
171
185
  export { AppShell };
@@ -2,8 +2,10 @@ import type { FC, HTMLAttributes, ReactNode, Ref } from 'react';
2
2
  export interface AppShellAsideProps extends HTMLAttributes<HTMLElement> {
3
3
  ref?: Ref<HTMLElement>;
4
4
  /**
5
- * Shows the panel. Closed, the region takes no space and is `hidden` and `inert`, but its
6
- * children stay mounted, so whatever state they hold survives a close and reopen.
5
+ * Shows the panel, sliding it in from the right as the canvas narrows. Closing makes it
6
+ * `hidden` and `inert` at once and slides it back out, after which it takes no space; under
7
+ * reduced motion both are instant. Its children stay mounted throughout, so whatever state
8
+ * they hold survives a close and reopen.
7
9
  */
8
10
  open: boolean;
9
11
  children?: ReactNode;
@@ -11,5 +13,13 @@ export interface AppShellAsideProps extends HTMLAttributes<HTMLElement> {
11
13
  /**
12
14
  * A panel docked right of the content surface, in the shell's `aside` grid area. Render it
13
15
  * after `AppShellRemote`: while it is open, the remote turns into a card beside it.
16
+ *
17
+ * It is 480px wide. To change that, set `--app-shell-aside-width` on the `AppShell` (for example
18
+ * `className='[--app-shell-aside-width:400px]'`), not a width class here: the shell sizes its
19
+ * track from the same variable.
20
+ *
21
+ * Desktop-first: while it is open the shell needs room for the rail plus the panel. In a
22
+ * narrower window the right end (the panel and the header's last actions) is clipped rather
23
+ * than scrolled to, so keep a min-width on the host or close the panel on narrow viewports.
14
24
  */
15
25
  export declare const AppShellAside: FC<AppShellAsideProps>;
@@ -30,7 +30,7 @@ const AppShellAside = (t0)=>{
30
30
  const t3 = open ? "open" : "closed";
31
31
  let t4;
32
32
  if ($[6] !== className) {
33
- t4 = cn("[grid-area:aside] mx-8 mb-8 data-[state=open]:flex w-480 flex-col overflow-auto overscroll-none rounded-12 border border-border-primary-light bg-bg-page-bg pb-4", className);
33
+ t4 = cn("[grid-area:aside] mx-8 mb-8 data-[state=open]:flex w-(--app-shell-aside-width) flex-col overflow-auto overscroll-none rounded-12 border border-border-primary-light bg-bg-page-bg pb-4", "transition-[display] transition-discrete duration-(--app-shell-aside-duration) ease-(--app-shell-aside-ease) motion-reduce:transition-none", className);
34
34
  $[6] = className;
35
35
  $[7] = t4;
36
36
  } else t4 = $[7];
@@ -24,7 +24,7 @@ const AppShellRemote = (t0)=>{
24
24
  const testId = useTestId("remote");
25
25
  let t1;
26
26
  if ($[5] !== className) {
27
- t1 = cn("[grid-area:remote] relative overflow-auto overscroll-none rounded-tl-12 border-t border-l border-border-primary-light bg-bg-page-bg", "has-[~[data-slot=app-shell-aside][data-state=open]]:rounded-tr-12 has-[~[data-slot=app-shell-aside][data-state=open]]:border-r", className);
27
+ t1 = cn("[grid-area:remote] relative overflow-auto overscroll-none rounded-tl-12 border-t border-l border-border-primary-light bg-bg-page-bg", "has-[~[data-slot=app-shell-aside][data-state=open]]:rounded-tr-12 has-[~[data-slot=app-shell-aside][data-state=open]]:border-r", "transition-[border-top-right-radius,border-right-width] duration-(--app-shell-aside-duration) ease-(--app-shell-aside-ease) motion-reduce:transition-none", className);
28
28
  $[5] = className;
29
29
  $[6] = t1;
30
30
  } else t1 = $[6];
@@ -4,3 +4,6 @@ export declare const MORPH_MS = 600;
4
4
  export declare const EXPAND_MS = 560;
5
5
  export declare const EXPAND_BORDER_MS = 400;
6
6
  export declare const SKELETON_DELAY = 250;
7
+ /** AppShellAside's slide. Starts on the boot expand's border timing; tune it on its own. */
8
+ export declare const ASIDE_SLIDE_MS = 400;
9
+ export declare const ASIDE_SLIDE_EASE = "cubic-bezier(0.4, 0, 0.2, 1)";
@@ -4,4 +4,6 @@ const MORPH_MS = 600;
4
4
  const EXPAND_MS = 560;
5
5
  const EXPAND_BORDER_MS = 400;
6
6
  const SKELETON_DELAY = 250;
7
- export { EMPHASIZED_DECEL, EXPAND_BORDER_MS, EXPAND_MS, HERO_EASE, MORPH_MS, SKELETON_DELAY };
7
+ const ASIDE_SLIDE_MS = 400;
8
+ const ASIDE_SLIDE_EASE = HERO_EASE;
9
+ export { ASIDE_SLIDE_EASE, ASIDE_SLIDE_MS, EMPHASIZED_DECEL, EXPAND_BORDER_MS, EXPAND_MS, HERO_EASE, MORPH_MS, SKELETON_DELAY };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": "3.1.0",
3
- "generatedAt": "2026-10-21T12:04:49.932Z",
3
+ "generatedAt": "2026-10-21T13:45:39.845Z",
4
4
  "components": [
5
5
  {
6
6
  "name": "Accordion",
@@ -4519,7 +4519,7 @@
4519
4519
  "name": "open",
4520
4520
  "type": "boolean",
4521
4521
  "required": true,
4522
- "description": "Shows the panel. Closed, the region takes no space and is `hidden` and `inert`, but its\nchildren stay mounted, so whatever state they hold survives a close and reopen."
4522
+ "description": "Shows the panel, sliding it in from the right as the canvas narrows. Closing makes it\n`hidden` and `inert` at once and slides it back out, after which it takes no space; under\nreduced motion both are instant. Its children stay mounted throughout, so whatever state\nthey hold survives a close and reopen."
4523
4523
  },
4524
4524
  {
4525
4525
  "name": "defaultChecked",
@@ -5633,7 +5633,7 @@
5633
5633
  {
5634
5634
  "name": "WithAside",
5635
5635
  "code": "({ ambient }) => (\n <StoryRouter>\n <Shell ambient={ambient} aside />\n </StoryRouter>\n)",
5636
- "description": "`AppShellAside` docks a panel right of the content surface — a stand-in assistant here, toggled from the header — and closing it hides the region without unmounting what is inside, so text typed into the panel survives a close and reopen."
5636
+ "description": "`AppShellAside` docks a panel right of the content surface — a stand-in assistant here, toggled from the header — that slides in as the canvas narrows and back out on close, hiding the region without unmounting what is inside, so text typed into the panel survives a close and reopen."
5637
5637
  },
5638
5638
  {
5639
5639
  "name": "RevealFlow",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wallarm-org/design-system",
3
- "version": "3.2.0-rc-feat-app-shell-aside.1",
3
+ "version": "3.2.0-rc-feat-app-shell-aside.2",
4
4
  "description": "Core design system library with React components and Storybook documentation",
5
5
  "publishConfig": {
6
6
  "access": "public",