@panneau/ui 5.0.0-alpha.27 → 5.0.0-alpha.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/aside/Aside.css +255 -0
- package/dist/aside/Aside.d.ts +86 -0
- package/dist/aside/Aside.d.ts.map +1 -0
- package/dist/aside/Aside.js +403 -0
- package/dist/aside/Aside.js.map +1 -0
- package/dist/aside/Aside.module.js +46 -0
- package/dist/aside/Aside.module.js.map +1 -0
- package/dist/aside/tokens.d.ts +3 -0
- package/dist/aside/tokens.d.ts.map +1 -0
- package/dist/aside/tokens.js +23 -0
- package/dist/aside/tokens.js.map +1 -0
- package/dist/button/Button.css +13 -1
- package/dist/button/Button.module.js.map +1 -1
- package/dist/button/tokens.d.ts +1 -1
- package/dist/button/tokens.d.ts.map +1 -1
- package/dist/button/tokens.js +4 -0
- package/dist/button/tokens.js.map +1 -1
- package/dist/card/tokens.d.ts +1 -1
- package/dist/checkbox/Checkbox.css +15 -16
- package/dist/checkbox/Checkbox.module.js.map +1 -1
- package/dist/checkbox/tokens.js +2 -2
- package/dist/checkbox/tokens.js.map +1 -1
- package/dist/date-picker/DatePicker.css +10 -4
- package/dist/date-picker/DatePicker.module.js.map +1 -1
- package/dist/date-picker/calendarTokens.js +2 -2
- package/dist/date-picker/calendarTokens.js.map +1 -1
- package/dist/date-range-picker/DateRangePicker.css +1 -1
- package/dist/date-range-picker/DateRangePicker.module.js.map +1 -1
- package/dist/field/Field.css +4 -4
- package/dist/field/Field.module.js.map +1 -1
- package/dist/field/inputTokens.d.ts +1 -1
- package/dist/field/inputTokens.d.ts.map +1 -1
- package/dist/field/inputTokens.js +7 -1
- package/dist/field/inputTokens.js.map +1 -1
- package/dist/field/tokens.d.ts +1 -1
- package/dist/field/tokens.d.ts.map +1 -1
- package/dist/field/tokens.js +3 -1
- package/dist/field/tokens.js.map +1 -1
- package/dist/icon/Icon.css +5 -0
- package/dist/icon/Icon.d.ts +5 -1
- package/dist/icon/Icon.d.ts.map +1 -1
- package/dist/icon/Icon.js +20 -19
- package/dist/icon/Icon.js.map +1 -1
- package/dist/icon/Icon.module.js.map +1 -1
- package/dist/icon/tokens.d.ts +3 -0
- package/dist/icon/tokens.d.ts.map +1 -0
- package/dist/icon/tokens.js +13 -0
- package/dist/icon/tokens.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/pill-trigger/tokens.d.ts +1 -1
- package/dist/popover/tokens.d.ts +1 -1
- package/dist/radio-group/RadioGroup.css +15 -15
- package/dist/radio-group/RadioGroup.module.js.map +1 -1
- package/dist/radio-group/tokens.js +2 -2
- package/dist/radio-group/tokens.js.map +1 -1
- package/dist/root/PanneauRoot.css +5 -0
- package/dist/root/PanneauRoot.module.js.map +1 -1
- package/dist/segmented-control/SegmentedControl.css +5 -1
- package/dist/segmented-control/SegmentedControl.module.js.map +1 -1
- package/dist/segmented-control/tokens.d.ts +1 -1
- package/dist/segmented-control/tokens.d.ts.map +1 -1
- package/dist/segmented-control/tokens.js +5 -1
- package/dist/segmented-control/tokens.js.map +1 -1
- package/dist/select/ListBox.css +2 -0
- package/dist/select/ListBox.module.js.map +1 -1
- package/dist/slider/Slider.css +6 -5
- package/dist/slider/Slider.module.js.map +1 -1
- package/dist/switch/Switch.css +16 -10
- package/dist/switch/Switch.module.js.map +1 -1
- package/dist/switch/tokens.d.ts +1 -1
- package/dist/switch/tokens.d.ts.map +1 -1
- package/dist/switch/tokens.js +4 -2
- package/dist/switch/tokens.js.map +1 -1
- package/dist/tabs/Tabs.css +4 -1
- package/dist/tabs/Tabs.module.js.map +1 -1
- package/dist/tabs/tokens.js +1 -1
- package/dist/tabs/tokens.js.map +1 -1
- package/dist/tags-input/TagsInput.css +15 -2
- package/dist/tags-input/TagsInput.module.js.map +1 -1
- package/dist/theme/checkTheme.d.ts +4 -2
- package/dist/theme/checkTheme.d.ts.map +1 -1
- package/dist/theme/checkTheme.js +30 -7
- package/dist/theme/checkTheme.js.map +1 -1
- package/dist/theme/color.d.ts +13 -0
- package/dist/theme/color.d.ts.map +1 -1
- package/dist/theme/color.js +41 -1
- package/dist/theme/color.js.map +1 -1
- package/dist/theme/components.d.ts +13 -10
- package/dist/theme/components.d.ts.map +1 -1
- package/dist/theme/components.js +6 -0
- package/dist/theme/components.js.map +1 -1
- package/dist/theme/selectedTokens.d.ts +11 -0
- package/dist/theme/selectedTokens.d.ts.map +1 -0
- package/dist/theme/selectedTokens.js +23 -0
- package/dist/theme/selectedTokens.js.map +1 -0
- package/dist/theme/semanticTokens.d.ts +1 -1
- package/dist/theme/semanticTokens.d.ts.map +1 -1
- package/dist/theme/semanticTokens.js +1 -0
- package/dist/theme/semanticTokens.js.map +1 -1
- package/dist/toast/tokens.d.ts +1 -1
- package/dist/tooltip/tokens.d.ts +1 -1
- package/dist/utils/preference.d.ts +7 -0
- package/dist/utils/preference.d.ts.map +1 -0
- package/dist/utils/preference.js +54 -0
- package/dist/utils/preference.js.map +1 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -214,7 +214,7 @@ Responsive values are inline CSS variables, read by static rules in each contain
|
|
|
214
214
|
|
|
215
215
|
### Density
|
|
216
216
|
|
|
217
|
-
A density is a set of tokens: `--panneau-control-height` and `-sm`, `--panneau-font-size-control`, `--panneau-control-padding-x` (inputs and buttons)
|
|
217
|
+
A density is a set of tokens: `--panneau-control-height` and `-sm`, `--panneau-font-size-control`, `--panneau-control-padding-x` (inputs and buttons), `--panneau-row-padding-y` (rows of tables, options of lists) and `--panneau-target-size`, the smallest size of what a pointer or a finger hits that isn't a control (rows of checkboxes, radios and switches, links of the sidebar, sortable headers): 1.5rem, and 2.75rem in the touch density. The `density` of the root picks one, and the `size` props of components (`size="sm"`) stay relative to it.
|
|
218
218
|
|
|
219
219
|
A theme redefines a density in `densities`. Density tokens set in `tokens` instead apply to every density, which then no longer changes them.
|
|
220
220
|
|
|
@@ -423,6 +423,8 @@ toasts.show(
|
|
|
423
423
|
|
|
424
424
|
Components take icons as components: any Lucide icon (`icon={Pencil}`), or a component with the same props.
|
|
425
425
|
|
|
426
|
+
The stroke of icons scales with them, so every size has the same weight: `--panneau-icon-stroke-width` is in units of Lucide's 24-unit grid (`2` by default, about 1.33px at 16px). A theme sets it for a lighter or a bolder icon set.
|
|
427
|
+
|
|
426
428
|
Definitions name their icons (`"icon": "send"`, a name of [lucide.dev/icons](https://lucide.dev/icons)). `getNamedIcon(name)` turns a name into an icon component that goes wherever an icon component goes, and loads it with the `iconLoader` of `PanneauRoot`:
|
|
427
429
|
|
|
428
430
|
```tsx
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/* The column next to the main content (decision 0074): below it or over it on narrow layouts,
|
|
2
|
+
beside it from 56rem of the layout, where it stays in view. */
|
|
3
|
+
|
|
4
|
+
.panneau-aside-layout {
|
|
5
|
+
container: panneau-aside-layout / inline-size;
|
|
6
|
+
min-width: 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.panneau-aside-grid {
|
|
10
|
+
display: grid;
|
|
11
|
+
grid-template-columns: minmax(0, 1fr);
|
|
12
|
+
align-items: start;
|
|
13
|
+
gap: var(--panneau-space-6);
|
|
14
|
+
min-width: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.panneau-aside-main {
|
|
18
|
+
min-width: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.panneau-aside {
|
|
22
|
+
container: panneau-aside / inline-size;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
min-width: 0;
|
|
26
|
+
background: var(--panneau-aside-bg, var(--panneau-color-surface));
|
|
27
|
+
border: var(
|
|
28
|
+
--panneau-aside-border,
|
|
29
|
+
var(--panneau-border-width) solid var(--panneau-color-border)
|
|
30
|
+
);
|
|
31
|
+
border-radius: var(--panneau-aside-radius, var(--panneau-radius-lg));
|
|
32
|
+
box-shadow: var(--panneau-aside-shadow, var(--panneau-shadow-sm));
|
|
33
|
+
outline: none;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.panneau-aside:focus-visible {
|
|
37
|
+
box-shadow:
|
|
38
|
+
var(--panneau-aside-shadow, var(--panneau-shadow-sm)),
|
|
39
|
+
0 0 0 var(--panneau-focus-width) var(--panneau-color-focus);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Over the content, on its right: the whole height of the screen, the whole width on a phone. */
|
|
43
|
+
.panneau-aside-overlay > .panneau-aside {
|
|
44
|
+
position: fixed;
|
|
45
|
+
inset-block: 0;
|
|
46
|
+
inset-inline-end: 0;
|
|
47
|
+
z-index: var(--panneau-z-overlay);
|
|
48
|
+
width: min(100%, var(--panneau-aside-width, 22rem));
|
|
49
|
+
border-block: 0;
|
|
50
|
+
border-inline-end: 0;
|
|
51
|
+
border-radius: 0;
|
|
52
|
+
box-shadow: var(--panneau-shadow-lg);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.panneau-aside-overlay > .panneau-aside[data-wide] {
|
|
56
|
+
width: min(100%, var(--panneau-aside-width-wide, 50%));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.panneau-aside-overlay > .panneau-aside:focus-visible {
|
|
60
|
+
box-shadow:
|
|
61
|
+
var(--panneau-shadow-lg),
|
|
62
|
+
inset 0 0 0 var(--panneau-focus-width) var(--panneau-color-focus);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* Widening only matters beside the content, or over it. */
|
|
66
|
+
.panneau-aside-widen {
|
|
67
|
+
display: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.panneau-aside-overlay > .panneau-aside .panneau-aside-widen {
|
|
71
|
+
display: inline-flex;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* On a phone, over the whole width: there is nothing to widen. */
|
|
75
|
+
@container panneau-aside-layout (max-width: 40rem) {
|
|
76
|
+
.panneau-aside-overlay > .panneau-aside,
|
|
77
|
+
.panneau-aside-overlay > .panneau-aside[data-wide] {
|
|
78
|
+
width: 100%;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.panneau-aside-overlay > .panneau-aside .panneau-aside-widen {
|
|
82
|
+
display: none;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@container panneau-aside-layout (min-width: 56rem) {
|
|
87
|
+
.panneau-aside-with-aside {
|
|
88
|
+
grid-template-columns: minmax(0, 1fr) var(--panneau-aside-width, 22rem);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.panneau-aside-with-aside:has(> .panneau-aside[data-wide]) {
|
|
92
|
+
grid-template-columns: minmax(0, 1fr) var(--panneau-aside-width-wide, 50%);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.panneau-aside-grid > .panneau-aside,
|
|
96
|
+
.panneau-aside-grid.panneau-aside-overlay > .panneau-aside {
|
|
97
|
+
position: sticky;
|
|
98
|
+
inset-block: var(--panneau-space-4) auto;
|
|
99
|
+
z-index: auto;
|
|
100
|
+
width: auto;
|
|
101
|
+
max-height: calc(100dvh - 2 * var(--panneau-space-4) - var(--panneau-frame-bottom, 0px));
|
|
102
|
+
border: var(
|
|
103
|
+
--panneau-aside-border,
|
|
104
|
+
var(--panneau-border-width) solid var(--panneau-color-border)
|
|
105
|
+
);
|
|
106
|
+
border-radius: var(--panneau-aside-radius, var(--panneau-radius-lg));
|
|
107
|
+
box-shadow: var(--panneau-aside-shadow, var(--panneau-shadow-sm));
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.panneau-aside-grid > .panneau-aside:focus-visible,
|
|
111
|
+
.panneau-aside-grid.panneau-aside-overlay > .panneau-aside:focus-visible {
|
|
112
|
+
box-shadow:
|
|
113
|
+
var(--panneau-aside-shadow, var(--panneau-shadow-sm)),
|
|
114
|
+
0 0 0 var(--panneau-focus-width) var(--panneau-color-focus);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.panneau-aside-grid > .panneau-aside .panneau-aside-widen {
|
|
118
|
+
display: inline-flex;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.panneau-aside-header {
|
|
123
|
+
display: flex;
|
|
124
|
+
align-items: flex-start;
|
|
125
|
+
justify-content: space-between;
|
|
126
|
+
gap: var(--panneau-space-2);
|
|
127
|
+
padding: var(--panneau-aside-padding, var(--panneau-space-4))
|
|
128
|
+
var(--panneau-aside-padding, var(--panneau-space-4)) var(--panneau-space-2);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.panneau-aside-header-buttons {
|
|
132
|
+
display: flex;
|
|
133
|
+
flex: none;
|
|
134
|
+
gap: var(--panneau-space-1);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.panneau-aside-title {
|
|
138
|
+
min-width: 0;
|
|
139
|
+
margin: 0;
|
|
140
|
+
overflow-wrap: anywhere;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* The title while it loads: a line of the heading's size. */
|
|
144
|
+
.panneau-aside-title-skeleton {
|
|
145
|
+
font-size: var(--panneau-heading-2-font-size, 1.375rem);
|
|
146
|
+
line-height: var(--panneau-heading-2-line-height, var(--panneau-line-height-tight));
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.panneau-aside-toolbar {
|
|
150
|
+
display: flex;
|
|
151
|
+
flex-wrap: wrap;
|
|
152
|
+
gap: var(--panneau-space-2);
|
|
153
|
+
padding: 0 var(--panneau-aside-padding, var(--panneau-space-4)) var(--panneau-space-3);
|
|
154
|
+
border-bottom: var(--panneau-border-width) solid var(--panneau-color-border);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.panneau-aside-body {
|
|
158
|
+
display: flex;
|
|
159
|
+
flex: 1 1 auto;
|
|
160
|
+
flex-direction: column;
|
|
161
|
+
min-height: 0;
|
|
162
|
+
padding: var(--panneau-aside-padding, var(--panneau-space-4));
|
|
163
|
+
overflow-y: auto;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/* A block of the aside, under a line when it follows another. */
|
|
167
|
+
.panneau-aside-panel {
|
|
168
|
+
display: flex;
|
|
169
|
+
flex-direction: column;
|
|
170
|
+
min-width: 0;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* A panel with nothing to show, such as the errors of a form before a failed save, takes no
|
|
174
|
+
space. So does a panel shown beside the content only, below or over it. Lines separate the
|
|
175
|
+
panels that show. */
|
|
176
|
+
.panneau-aside-panel:empty,
|
|
177
|
+
.panneau-aside-panel[data-beside-only] {
|
|
178
|
+
display: none;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.panneau-aside-panel:not(:empty, [data-beside-only]) ~ .panneau-aside-panel:not(:empty, [data-beside-only]) {
|
|
182
|
+
margin-top: var(--panneau-aside-padding, var(--panneau-space-4));
|
|
183
|
+
padding-top: var(--panneau-aside-padding, var(--panneau-space-4));
|
|
184
|
+
border-top: var(--panneau-border-width) solid var(--panneau-color-border);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
@container panneau-aside-layout (min-width: 56rem) {
|
|
188
|
+
.panneau-aside-panel[data-beside-only]:not(:empty) {
|
|
189
|
+
display: flex;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.panneau-aside-panel:not(:empty) ~ .panneau-aside-panel:not(:empty) {
|
|
193
|
+
margin-top: var(--panneau-aside-padding, var(--panneau-space-4));
|
|
194
|
+
padding-top: var(--panneau-aside-padding, var(--panneau-space-4));
|
|
195
|
+
border-top: var(--panneau-border-width) solid var(--panneau-color-border);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.panneau-aside-panel-heading {
|
|
200
|
+
margin: 0;
|
|
201
|
+
font: inherit;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.panneau-aside-panel-title {
|
|
205
|
+
flex: 1 1 auto;
|
|
206
|
+
min-width: 0;
|
|
207
|
+
margin: 0;
|
|
208
|
+
font-size: var(--panneau-font-size-md);
|
|
209
|
+
font-weight: var(--panneau-font-weight-bold);
|
|
210
|
+
line-height: var(--panneau-line-height-tight);
|
|
211
|
+
color: var(--panneau-color-text);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.panneau-aside-panel-trigger {
|
|
215
|
+
display: flex;
|
|
216
|
+
align-items: center;
|
|
217
|
+
gap: var(--panneau-space-2);
|
|
218
|
+
width: 100%;
|
|
219
|
+
min-height: var(--panneau-target-size, 1.5rem);
|
|
220
|
+
padding: 0;
|
|
221
|
+
text-align: start;
|
|
222
|
+
cursor: pointer;
|
|
223
|
+
background: transparent;
|
|
224
|
+
border: 0;
|
|
225
|
+
border-radius: var(--panneau-radius-sm);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.panneau-aside-panel-trigger[data-focus-visible] {
|
|
229
|
+
outline: var(--panneau-focus-width) solid var(--panneau-color-focus);
|
|
230
|
+
outline-offset: 2px;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.panneau-aside-chevron {
|
|
234
|
+
flex: none;
|
|
235
|
+
color: var(--panneau-color-text-muted);
|
|
236
|
+
transition: transform var(--panneau-duration);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.panneau-aside-panel:not([data-expanded]) .panneau-aside-chevron {
|
|
240
|
+
transform: rotate(-90deg);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/* A panel with a title, which can't be collapsed. */
|
|
244
|
+
section.panneau-aside-panel > .panneau-aside-panel-title {
|
|
245
|
+
margin-bottom: var(--panneau-space-3);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.panneau-aside-panel-content {
|
|
249
|
+
min-width: 0;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/* Collapsed, the content is hidden with its space. */
|
|
253
|
+
.panneau-aside-panel-heading + .panneau-aside-panel-content {
|
|
254
|
+
padding-top: var(--panneau-space-3);
|
|
255
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { type ReactNode, type Ref } from 'react';
|
|
2
|
+
import { type HeadingLevel } from '../heading/Heading.js';
|
|
3
|
+
export interface AsideLayoutProps {
|
|
4
|
+
/** The main content: a list, a form. */
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
/** The aside next to it, or nothing. The content keeps its place when it opens or closes. */
|
|
7
|
+
aside?: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Where the aside goes when the layout is too narrow to put it beside the content (56rem):
|
|
10
|
+
* `below` the content, or `overlay`, over the content on its right, the whole width on a phone,
|
|
11
|
+
* for an aside that opens on demand and closes. Defaults to `below`.
|
|
12
|
+
*/
|
|
13
|
+
narrow?: 'below' | 'overlay';
|
|
14
|
+
className?: string;
|
|
15
|
+
mainClassName?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Places an aside next to the main content of a page or a form (decision 0074): beside it from
|
|
19
|
+
* 56rem of the layout, below it or over it otherwise. Beside the content, the aside stays in view
|
|
20
|
+
* as the page scrolls.
|
|
21
|
+
*/
|
|
22
|
+
export declare function AsideLayout({ children, aside, narrow, className, mainClassName, }: AsideLayoutProps): import("react").JSX.Element;
|
|
23
|
+
export interface AsideProps {
|
|
24
|
+
/** Accessible name of the aside, a region of the page. */
|
|
25
|
+
label: string;
|
|
26
|
+
/** Title in its header. */
|
|
27
|
+
title?: ReactNode;
|
|
28
|
+
/** Heading level of the title. Defaults to 2. */
|
|
29
|
+
headingLevel?: HeadingLevel;
|
|
30
|
+
/** Its title loads: a skeleton of a line in its place (decision 0034). */
|
|
31
|
+
isLoading?: boolean;
|
|
32
|
+
/** Under the header: the actions of what the aside shows. */
|
|
33
|
+
toolbar?: ReactNode;
|
|
34
|
+
/** Its panels (`AsidePanel`), or any content. */
|
|
35
|
+
children?: ReactNode;
|
|
36
|
+
/** Shows a button that widens it, for previews. */
|
|
37
|
+
isWidenable?: boolean;
|
|
38
|
+
/** Shows a close button, also run by Escape. */
|
|
39
|
+
onClose?: () => void;
|
|
40
|
+
/**
|
|
41
|
+
* The key under which the browser remembers its width and its collapsed panels:
|
|
42
|
+
* `panneau:<key>-size` and `panneau:<key>-panel-<id>`. Without one, they last as long as the
|
|
43
|
+
* page.
|
|
44
|
+
*/
|
|
45
|
+
storageKey?: string;
|
|
46
|
+
/** `-1` makes it focusable, to move the focus to it when it shows something else. */
|
|
47
|
+
tabIndex?: number;
|
|
48
|
+
ref?: Ref<HTMLElement>;
|
|
49
|
+
className?: string;
|
|
50
|
+
bodyClassName?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The column next to the main content of a page or a form, made of panels (decision 0074): the
|
|
54
|
+
* details of an item next to its list, the sidebar of a form. Placed by `AsideLayout`.
|
|
55
|
+
*/
|
|
56
|
+
export declare function Aside({ label, title, headingLevel, isLoading, toolbar, children, isWidenable, onClose, storageKey, tabIndex, ref, className, bodyClassName, }: AsideProps): import("react").JSX.Element;
|
|
57
|
+
export interface AsidePanelProps {
|
|
58
|
+
/** Identifies the panel, so that the browser remembers whether it is collapsed. */
|
|
59
|
+
id?: string;
|
|
60
|
+
/** Its title. A panel without one is its content, and can't be collapsed. */
|
|
61
|
+
title?: ReactNode;
|
|
62
|
+
/** Content after the title: a count of errors. */
|
|
63
|
+
titleEnd?: ReactNode;
|
|
64
|
+
/** Heading level of the title. Defaults to 3. */
|
|
65
|
+
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
66
|
+
/** With a title, the user can collapse it. Defaults to true. */
|
|
67
|
+
isCollapsible?: boolean;
|
|
68
|
+
/** Starts collapsed, until the user expands it. */
|
|
69
|
+
defaultCollapsed?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Shows only beside the content: below it or over it, something else in the page does its
|
|
72
|
+
* work, such as the footer of a form for its Save button.
|
|
73
|
+
*/
|
|
74
|
+
isBesideOnly?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Whether it is expanded, for a panel that something else opens, such as a form on an error.
|
|
77
|
+
* The browser then remembers nothing: the owner does.
|
|
78
|
+
*/
|
|
79
|
+
isExpanded?: boolean;
|
|
80
|
+
onExpandedChange?: (isExpanded: boolean) => void;
|
|
81
|
+
children?: ReactNode;
|
|
82
|
+
className?: string;
|
|
83
|
+
}
|
|
84
|
+
/** A block of an aside: a title, which collapses it, and its content. Panels are separated by a line. */
|
|
85
|
+
export declare function AsidePanel({ id, title, titleEnd, headingLevel, isCollapsible, defaultCollapsed, isBesideOnly, isExpanded, onExpandedChange, children, className, }: AsidePanelProps): import("react").JSX.Element;
|
|
86
|
+
//# sourceMappingURL=Aside.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Aside.d.ts","sourceRoot":"","sources":["../../src/aside/Aside.tsx"],"names":[],"mappings":"AACA,OAAO,EAAsB,KAAK,SAAS,EAAE,KAAK,GAAG,EAAsB,MAAM,OAAO,CAAC;AAQzF,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAgBhE,MAAM,WAAW,gBAAgB;IAC7B,wCAAwC;IACxC,QAAQ,EAAE,SAAS,CAAC;IACpB,6FAA6F;IAC7F,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EACxB,QAAQ,EACR,KAAK,EACL,MAAgB,EAChB,SAAS,EACT,aAAa,GAChB,EAAE,gBAAgB,+BAgBlB;AAED,MAAM,WAAW,UAAU;IACvB,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,iDAAiD;IACjD,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,0EAA0E;IAC1E,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,mDAAmD;IACnD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qFAAqF;IACrF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,EAClB,KAAK,EACL,KAAK,EACL,YAAgB,EAChB,SAAiB,EACjB,OAAO,EACP,QAAQ,EACR,WAAmB,EACnB,OAAO,EACP,UAAU,EACV,QAAQ,EACR,GAAG,EACH,SAAS,EACT,aAAa,GAChB,EAAE,UAAU,+BAoEZ;AAED,MAAM,WAAW,eAAe;IAC5B,mFAAmF;IACnF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,6EAA6E;IAC7E,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,iDAAiD;IACjD,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACjC,gEAAgE;IAChE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mDAAmD;IACnD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,yGAAyG;AACzG,wBAAgB,UAAU,CAAC,EACvB,EAAE,EACF,KAAK,EACL,QAAQ,EACR,YAAgB,EAChB,aAAoB,EACpB,gBAAwB,EACxB,YAAoB,EACpB,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,SAAS,GACZ,EAAE,eAAe,+BAuDjB"}
|