@nanahoshi/mona-ui 0.46.0 → 0.48.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/docs/api/button.json +1 -1
- package/docs/api/button.md +1 -0
- package/docs/api/check-box.json +1 -1
- package/docs/api/check-box.md +1 -0
- package/docs/api/chip.json +1 -1
- package/docs/api/chip.md +1 -0
- package/docs/api/common.json +1 -1
- package/docs/api/common.md +1 -1
- package/docs/api/grid.json +1 -1
- package/docs/api/grid.md +18 -0
- package/docs/api/index.json +1 -1
- package/docs/api/radio-button.json +1 -1
- package/docs/api/radio-button.md +1 -0
- package/docs/api/ripple.json +1 -0
- package/docs/api/ripple.md +75 -0
- package/docs/api/sidebar.json +1 -1
- package/docs/api/sidebar.md +1 -0
- package/docs/api/switch.json +1 -1
- package/docs/api/switch.md +1 -0
- package/docs/grid-rows.md +36 -0
- package/docs/grid-server.md +6 -0
- package/docs/grid.md +3 -2
- package/docs/manifest.json +1 -1
- package/docs/ripple.md +360 -0
- package/docs/sidebar-menus.md +8 -0
- package/fesm2022/{grid-colgroup.component-B4jx10Yi.mjs → grid-colgroup.component-BFbiAvkG.mjs} +2 -2
- package/fesm2022/{grid-footer-row.component-CVUltI39.mjs → grid-footer-row.component-DpSu7jvG.mjs} +3 -2
- package/fesm2022/{grid-list.component-Cv1KB5VQ.mjs → grid-list.component-B-F4bvFL.mjs} +5 -5
- package/fesm2022/{grid-row.component-BauMmps5.mjs → grid-row.component-CuCQ_Z5F.mjs} +37 -9
- package/fesm2022/{grid-virtual-list.component-DNjoZfHq.mjs → grid-virtual-list.component-rIz5AUOU.mjs} +31 -12
- package/fesm2022/{grid.styles-BJHVTT_v.mjs → grid.styles-D6jP3vwD.mjs} +110 -35
- package/fesm2022/nanahoshi-mona-ui-button.mjs +20 -2
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +11 -3
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +30 -5
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +13 -0
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +16 -20
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +9 -1
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +9 -3
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +12 -4
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +11 -3
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +27 -3
- package/fesm2022/nanahoshi-mona-ui-ripple.mjs +196 -0
- package/fesm2022/nanahoshi-mona-ui-segmented.mjs +9 -3
- package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +21 -1
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +5 -1
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +28 -3
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +7 -1
- package/llms.txt +3 -1
- package/package.json +5 -1
- package/ripple/package.json +5 -0
- package/types/nanahoshi-mona-ui-button.d.ts +8 -1
- package/types/nanahoshi-mona-ui-calendar.d.ts +1 -0
- package/types/nanahoshi-mona-ui-check-box.d.ts +10 -1
- package/types/nanahoshi-mona-ui-chip.d.ts +8 -1
- package/types/nanahoshi-mona-ui-grid.d.ts +35 -4
- package/types/nanahoshi-mona-ui-radio-button.d.ts +9 -1
- package/types/nanahoshi-mona-ui-ripple.d.ts +72 -0
- package/types/nanahoshi-mona-ui-sidebar.d.ts +12 -0
- package/types/nanahoshi-mona-ui-switch.d.ts +10 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"links":{"RadioButtonComponent":"radio-button","RadioButtonDirective":"radio-button","RadioButtonDirectiveProps":"radio-button","RadioGroupComponent":"radio-button"},"name":"radio-button","pages":[{"path":"radio-button","title":"Radio Button"}],"symbols":[{"description":"","implements":["FormValueControl<T>"],"kind":"component","name":"RadioButtonComponent","selector":"mona-radio-button","typeParameters":["T = unknown"],"inputs":[{"alias":"aria-describedby","defaultValue":"\"\"","description":"Id of an element that describes the radio button, such as an error message.","name":"ariaDescribedBy","type":"string"},{"alias":"aria-label","defaultValue":"\"\"","description":"Accessible name of the radio button when it has no visible label.","name":"ariaLabel","type":"string"},{"alias":"aria-labelledby","defaultValue":"\"\"","description":"Id of the element that labels the radio button.","name":"ariaLabelledBy","type":"string"},{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the label container element via `tailwind-merge`.","name":"userClass","type":"string"},{"defaultValue":"false","description":"Sets the disabled state of the radio button.","name":"disabled","type":"boolean"},{"defaultValue":"generated","description":"Id of the native radio input. Point a `<label for>` at it to label the radio button from outside.\nA unique id is generated when it isn't set.","name":"inputId","type":"string"},{"defaultValue":"false","description":"Marks the radio button as invalid. When bound to a signal form field via `[formField]`, this is\nwritten by the `FormField` directive.","name":"invalid","type":"boolean"},{"defaultValue":"\"\"","description":"Text label displayed alongside the radio button.\nWhen provided, takes precedence over projected content.\nWhen empty, projected content inside `<mona-radio-button>` is used.\nWhen both are absent, name the radio button with `aria-label` or `aria-labelledby`.","name":"label","type":"string"},{"defaultValue":"\"after\"","description":"Position of the label relative to the radio button circle.","name":"labelPosition","type":"\"before\" | \"after\""},{"defaultValue":"\"medium\"","description":"Font size applied to the label text.","name":"labelSize","type":"\"large\" | \"medium\" | \"small\""},{"defaultValue":"\"\"","description":"HTML `name` attribute forwarded to the native input.\nRadio buttons that share the same `name` form a mutually exclusive group in the browser.","name":"name","type":"string"},{"defaultValue":"undefined","description":"The identity value of this radio button within a group.\nCompared against `value()` to determine whether this button is selected.\nWhen this button is chosen, its `radioValue` is written to the form as the new group value.\nA radio button without one can't be selected.","name":"radioValue","type":"T"},{"defaultValue":"false","description":"Prevents value changes while the control stays focusable and readable. When bound to a signal form\nfield via `[formField]`, this is written by the `FormField` directive.","name":"readonly","type":"boolean"},{"defaultValue":"false","description":"Marks the radio button as required, as the native `required` attribute. When bound to a signal form\nfield via `[formField]`, this is written by the `FormField` directive.","name":"required","type":"boolean"},{"defaultValue":"\"full\"","description":"Sets the border radius of the radio button circle and indicator.","name":"rounded","type":"\"full\" | \"large\" | \"medium\" | \"none\" | \"small\""},{"defaultValue":"false","description":"Marks the radio button as touched. Error styling requires both `invalid` and `touched` to be `true`.\nWhen bound to a signal form field via `[formField]`, this is written by the `FormField` directive.","name":"touched","type":"boolean"},{"defaultValue":"undefined","description":"The currently selected value of a group of radio buttons that aren't in a `mona-radio-group`. When\nbound to a signal form field via `[formField]`, the `FormField` directive keeps it in sync.","name":"value","twoWay":true,"type":"T"}],"methods":[{"description":"Moves focus to the native radio input.","name":"focus","signature":"focus(options?: FocusOptions): void"}],"outputs":[{"description":"Emits when the input loses focus.","name":"inputBlur","type":"FocusEvent"},{"description":"Emits when the input is clicked.","name":"inputClick","type":"MouseEvent"},{"description":"Emits when the input receives focus.","name":"inputFocus","type":"FocusEvent"},{"description":"Emits when the radio button loses focus or is selected.","name":"touch","type":"void"}],"properties":[],"page":{"path":"radio-button","title":"Radio Button"}},{"description":"","implements":["FormValueControl<T>"],"kind":"component","name":"RadioGroupComponent","selector":"mona-radio-group","typeParameters":["T = unknown"],"inputs":[{"alias":"aria-describedby","defaultValue":"\"\"","description":"Id of an element that describes the group, such as an error message.","name":"ariaDescribedBy","type":"string"},{"alias":"aria-label","defaultValue":"\"\"","description":"Accessible name of the group. A group needs a name from this, `aria-labelledby` or a `mona-label`.","name":"ariaLabel","type":"string"},{"alias":"aria-labelledby","defaultValue":"\"\"","description":"Id of the element that labels the group.","name":"ariaLabelledBy","type":"string"},{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the group via `tailwind-merge`.","name":"userClass","type":"string"},{"defaultValue":"false","description":"Disables every radio button in the group. When bound to a signal form field via `[formField]`, this\nis written by the `FormField` directive.","name":"disabled","type":"boolean"},{"defaultValue":"false","description":"Marks the group as invalid. It shows once `touched` is also true. When bound to a signal form field\nvia `[formField]`, this is written by the `FormField` directive.","name":"invalid","type":"boolean"},{"defaultValue":"\"\"","description":"The native `name` shared by the radio buttons in the group. A unique name is generated when it isn't\nset. When bound to a signal form field via `[formField]`, this is written by the `FormField` directive.","name":"name","type":"string"},{"defaultValue":"\"vertical\"","description":"The direction the radio buttons are laid out and announced in.","name":"orientation","type":"\"horizontal\" | \"vertical\""},{"defaultValue":"false","description":"Prevents value changes while the radio buttons stay focusable and readable. When bound to a signal\nform field via `[formField]`, this is written by the `FormField` directive.","name":"readonly","type":"boolean"},{"defaultValue":"false","description":"Marks the group as required. When bound to a signal form field via `[formField]`, this is written by\nthe `FormField` directive.","name":"required","type":"boolean"},{"defaultValue":"false","description":"Marks the group as touched. Error styling needs both `invalid` and `touched`. When bound to a signal\nform field via `[formField]`, this is written by the `FormField` directive.","name":"touched","type":"boolean"},{"defaultValue":"undefined","description":"The `radioValue` of the selected radio button.","name":"value","twoWay":true,"type":"T"}],"methods":[{"description":"Moves focus to the selected radio button, or the first enabled one.","name":"focus","signature":"focus(options?: FocusOptions): void"}],"outputs":[{"description":"Emits when a radio button is selected and when focus leaves the group.","name":"touch","type":"void"}],"properties":[],"page":{"path":"radio-button","title":"Radio Button"}},{"description":"","kind":"directive","name":"RadioButtonDirective","selector":"input[type='radio'][monaRadioButton]","inputs":[{"defaultValue":"false","description":"Marks the radio button as invalid, triggering error border and ring styling.","name":"invalid","type":"boolean"},{"defaultValue":"\"full\"","description":"Sets the border radius of the radio button.","name":"rounded","type":"RadioButtonDirectiveProps[\"rounded\"]"},{"defaultValue":"false","description":"Marks the radio button as touched. Error styling is only shown when both `invalid` and `touched` are `true`.","name":"touched","type":"boolean"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"radio-button","title":"Radio Button"}},{"description":"","kind":"type","name":"RadioButtonDirectiveProps","signature":"type RadioButtonDirectiveProps = VariantProps<typeof radioButtonDirectiveThemeVariants>;","page":{"path":"radio-button","title":"Radio Button"},"usedBy":["RadioButtonDirective"]}]}
|
|
1
|
+
{"links":{"RadioButtonComponent":"radio-button","RadioButtonDirective":"radio-button","RadioButtonDirectiveProps":"radio-button","RadioGroupComponent":"radio-button"},"name":"radio-button","pages":[{"path":"radio-button","title":"Radio Button"}],"symbols":[{"description":"","implements":["FormValueControl<T>"],"kind":"component","name":"RadioButtonComponent","selector":"mona-radio-button","typeParameters":["T = unknown"],"inputs":[{"alias":"aria-describedby","defaultValue":"\"\"","description":"Id of an element that describes the radio button, such as an error message.","name":"ariaDescribedBy","type":"string"},{"alias":"aria-label","defaultValue":"\"\"","description":"Accessible name of the radio button when it has no visible label.","name":"ariaLabel","type":"string"},{"alias":"aria-labelledby","defaultValue":"\"\"","description":"Id of the element that labels the radio button.","name":"ariaLabelledBy","type":"string"},{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the label container element via `tailwind-merge`.","name":"userClass","type":"string"},{"defaultValue":"false","description":"Sets the disabled state of the radio button.","name":"disabled","type":"boolean"},{"defaultValue":"generated","description":"Id of the native radio input. Point a `<label for>` at it to label the radio button from outside.\nA unique id is generated when it isn't set.","name":"inputId","type":"string"},{"defaultValue":"false","description":"Marks the radio button as invalid. When bound to a signal form field via `[formField]`, this is\nwritten by the `FormField` directive.","name":"invalid","type":"boolean"},{"defaultValue":"\"\"","description":"Text label displayed alongside the radio button.\nWhen provided, takes precedence over projected content.\nWhen empty, projected content inside `<mona-radio-button>` is used.\nWhen both are absent, name the radio button with `aria-label` or `aria-labelledby`.","name":"label","type":"string"},{"defaultValue":"\"after\"","description":"Position of the label relative to the radio button circle.","name":"labelPosition","type":"\"before\" | \"after\""},{"defaultValue":"\"medium\"","description":"Font size applied to the label text.","name":"labelSize","type":"\"large\" | \"medium\" | \"small\""},{"defaultValue":"false","description":"Turns the ripple off for this element while ripples are on.","name":"monaRippleDisabled","type":"boolean"},{"defaultValue":"\"\"","description":"HTML `name` attribute forwarded to the native input.\nRadio buttons that share the same `name` form a mutually exclusive group in the browser.","name":"name","type":"string"},{"defaultValue":"undefined","description":"The identity value of this radio button within a group.\nCompared against `value()` to determine whether this button is selected.\nWhen this button is chosen, its `radioValue` is written to the form as the new group value.\nA radio button without one can't be selected.","name":"radioValue","type":"T"},{"defaultValue":"false","description":"Prevents value changes while the control stays focusable and readable. When bound to a signal form\nfield via `[formField]`, this is written by the `FormField` directive.","name":"readonly","type":"boolean"},{"defaultValue":"false","description":"Marks the radio button as required, as the native `required` attribute. When bound to a signal form\nfield via `[formField]`, this is written by the `FormField` directive.","name":"required","type":"boolean"},{"defaultValue":"\"full\"","description":"Sets the border radius of the radio button circle and indicator.","name":"rounded","type":"\"full\" | \"large\" | \"medium\" | \"none\" | \"small\""},{"defaultValue":"false","description":"Marks the radio button as touched. Error styling requires both `invalid` and `touched` to be `true`.\nWhen bound to a signal form field via `[formField]`, this is written by the `FormField` directive.","name":"touched","type":"boolean"},{"defaultValue":"undefined","description":"The currently selected value of a group of radio buttons that aren't in a `mona-radio-group`. When\nbound to a signal form field via `[formField]`, the `FormField` directive keeps it in sync.","name":"value","twoWay":true,"type":"T"}],"methods":[{"description":"Moves focus to the native radio input.","name":"focus","signature":"focus(options?: FocusOptions): void"}],"outputs":[{"description":"Emits when the input loses focus.","name":"inputBlur","type":"FocusEvent"},{"description":"Emits when the input is clicked.","name":"inputClick","type":"MouseEvent"},{"description":"Emits when the input receives focus.","name":"inputFocus","type":"FocusEvent"},{"description":"Emits when the radio button loses focus or is selected.","name":"touch","type":"void"}],"properties":[],"page":{"path":"radio-button","title":"Radio Button"}},{"description":"","implements":["FormValueControl<T>"],"kind":"component","name":"RadioGroupComponent","selector":"mona-radio-group","typeParameters":["T = unknown"],"inputs":[{"alias":"aria-describedby","defaultValue":"\"\"","description":"Id of an element that describes the group, such as an error message.","name":"ariaDescribedBy","type":"string"},{"alias":"aria-label","defaultValue":"\"\"","description":"Accessible name of the group. A group needs a name from this, `aria-labelledby` or a `mona-label`.","name":"ariaLabel","type":"string"},{"alias":"aria-labelledby","defaultValue":"\"\"","description":"Id of the element that labels the group.","name":"ariaLabelledBy","type":"string"},{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the group via `tailwind-merge`.","name":"userClass","type":"string"},{"defaultValue":"false","description":"Disables every radio button in the group. When bound to a signal form field via `[formField]`, this\nis written by the `FormField` directive.","name":"disabled","type":"boolean"},{"defaultValue":"false","description":"Marks the group as invalid. It shows once `touched` is also true. When bound to a signal form field\nvia `[formField]`, this is written by the `FormField` directive.","name":"invalid","type":"boolean"},{"defaultValue":"\"\"","description":"The native `name` shared by the radio buttons in the group. A unique name is generated when it isn't\nset. When bound to a signal form field via `[formField]`, this is written by the `FormField` directive.","name":"name","type":"string"},{"defaultValue":"\"vertical\"","description":"The direction the radio buttons are laid out and announced in.","name":"orientation","type":"\"horizontal\" | \"vertical\""},{"defaultValue":"false","description":"Prevents value changes while the radio buttons stay focusable and readable. When bound to a signal\nform field via `[formField]`, this is written by the `FormField` directive.","name":"readonly","type":"boolean"},{"defaultValue":"false","description":"Marks the group as required. When bound to a signal form field via `[formField]`, this is written by\nthe `FormField` directive.","name":"required","type":"boolean"},{"defaultValue":"false","description":"Marks the group as touched. Error styling needs both `invalid` and `touched`. When bound to a signal\nform field via `[formField]`, this is written by the `FormField` directive.","name":"touched","type":"boolean"},{"defaultValue":"undefined","description":"The `radioValue` of the selected radio button.","name":"value","twoWay":true,"type":"T"}],"methods":[{"description":"Moves focus to the selected radio button, or the first enabled one.","name":"focus","signature":"focus(options?: FocusOptions): void"}],"outputs":[{"description":"Emits when a radio button is selected and when focus leaves the group.","name":"touch","type":"void"}],"properties":[],"page":{"path":"radio-button","title":"Radio Button"}},{"description":"","kind":"directive","name":"RadioButtonDirective","selector":"input[type='radio'][monaRadioButton]","inputs":[{"defaultValue":"false","description":"Marks the radio button as invalid, triggering error border and ring styling.","name":"invalid","type":"boolean"},{"defaultValue":"\"full\"","description":"Sets the border radius of the radio button.","name":"rounded","type":"RadioButtonDirectiveProps[\"rounded\"]"},{"defaultValue":"false","description":"Marks the radio button as touched. Error styling is only shown when both `invalid` and `touched` are `true`.","name":"touched","type":"boolean"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"radio-button","title":"Radio Button"}},{"description":"","kind":"type","name":"RadioButtonDirectiveProps","signature":"type RadioButtonDirectiveProps = VariantProps<typeof radioButtonDirectiveThemeVariants>;","page":{"path":"radio-button","title":"Radio Button"},"usedBy":["RadioButtonDirective"]}]}
|
package/docs/api/radio-button.md
CHANGED
|
@@ -26,6 +26,7 @@ Component.
|
|
|
26
26
|
| `label` | `string` | `""` | Text label displayed alongside the radio button. When provided, takes precedence over projected content. When empty, projected content inside `<mona-radio-button>` is used. When both are absent, name the radio button with `aria-label` or `aria-labelledby`. |
|
|
27
27
|
| `labelPosition` | `"before" \| "after"` | `"after"` | Position of the label relative to the radio button circle. |
|
|
28
28
|
| `labelSize` | `"large" \| "medium" \| "small"` | `"medium"` | Font size applied to the label text. |
|
|
29
|
+
| `monaRippleDisabled` | `boolean` | `false` | Turns the ripple off for this element while ripples are on. |
|
|
29
30
|
| `name` | `string` | `""` | HTML `name` attribute forwarded to the native input. Radio buttons that share the same `name` form a mutually exclusive group in the browser. |
|
|
30
31
|
| `radioValue` | `T` | `undefined` | The identity value of this radio button within a group. Compared against `value()` to determine whether this button is selected. When this button is chosen, its `radioValue` is written to the form as the new group value. A radio button without one can't be selected. |
|
|
31
32
|
| `readonly` | `boolean` | `false` | Prevents value changes while the control stays focusable and readable. When bound to a signal form field via `[formField]`, this is written by the `FormField` directive. |
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"links":{"DEFAULT_RIPPLE_OPTIONS":"ripple","RIPPLE_OPTIONS":"ripple","RippleDirective":"ripple","RippleOptions":"ripple","provideRipple":"ripple"},"name":"ripple","pages":[],"symbols":[{"description":"Draws a ripple when the element is pressed: a wave in its text color that spreads from the pointer, stays while the\nelement is held and fades once it is let go. Mona UI's buttons and other pressable components apply it themselves.\nIt draws nothing until ripples are turned on with `provideRipple()`.\n\nThe wave covers the element's padding box, over its background and under its content. For that, the first press\ngives the element `isolation: isolate`, and makes it `relative` if its position is `static`. The wave spreads over\n`--mona-ripple-duration`, 450ms unless set, fades over `--mona-ripple-fade-duration`, 300ms unless set, and its\nopacity is `--mona-ripple-opacity`, 12% unless set.\n\nThere is no ripple on a disabled or `aria-disabled` element, with the system's reduced motion setting, or in forced\ncolors. Keyboard presses have none either: the focus indicator already shows where they act. Nor does a press on a\ncontrol inside the element, such as a button or a link, which belongs to that control, unless the element is the\n`<label>` of that control.","kind":"directive","name":"RippleDirective","selector":"[monaRipple]","inputs":[{"alias":"monaRippleDisabled","defaultValue":"false","description":"Turns the ripple off for this element while ripples are on.","name":"disabled","type":"boolean"}],"methods":[],"outputs":[],"properties":[]},{"description":"Turns on the ripple Mona UI's buttons, and elements with the `monaRipple` directive, draw when pressed. Pass\n`{ enabled: false }` to keep them off, for example behind a setting.","kind":"function","name":"provideRipple","signature":"function provideRipple(options: Partial<RippleOptions> = {}): EnvironmentProviders;"},{"description":"The settings used when nothing is provided with `provideRipple()`: no ripples.","kind":"constant","name":"DEFAULT_RIPPLE_OPTIONS","signature":"const DEFAULT_RIPPLE_OPTIONS: RippleOptions;"},{"description":"Ripple settings. Set them for the application with `provideRipple()`, or provide this token on a\ncomponent to turn ripples on or off for everything inside it.","kind":"constant","name":"RIPPLE_OPTIONS","signature":"const RIPPLE_OPTIONS: InjectionToken<RippleOptions>;"},{"description":"Ripple settings. Set them for the application with `provideRipple()`.","extends":[],"kind":"interface","methods":[],"name":"RippleOptions","properties":[{"description":"Whether pressing a button, or another element with the `monaRipple` directive, draws a ripple.\nRipples are off until `provideRipple()` turns them on.","name":"enabled","readonly":true,"type":"boolean"}],"usedBy":["DEFAULT_RIPPLE_OPTIONS","provideRipple","RIPPLE_OPTIONS"]}]}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# `@nanahoshi/mona-ui/ripple`
|
|
2
|
+
|
|
3
|
+
Everything `@nanahoshi/mona-ui/ripple` exports.
|
|
4
|
+
|
|
5
|
+
## `RippleDirective`
|
|
6
|
+
|
|
7
|
+
Directive.
|
|
8
|
+
|
|
9
|
+
Draws a ripple when the element is pressed: a wave in its text color that spreads from the pointer, stays while the
|
|
10
|
+
element is held and fades once it is let go. Mona UI's buttons and other pressable components apply it themselves.
|
|
11
|
+
It draws nothing until ripples are turned on with `provideRipple()`.
|
|
12
|
+
|
|
13
|
+
The wave covers the element's padding box, over its background and under its content. For that, the first press
|
|
14
|
+
gives the element `isolation: isolate`, and makes it `relative` if its position is `static`. The wave spreads over
|
|
15
|
+
`--mona-ripple-duration`, 450ms unless set, fades over `--mona-ripple-fade-duration`, 300ms unless set, and its
|
|
16
|
+
opacity is `--mona-ripple-opacity`, 12% unless set.
|
|
17
|
+
|
|
18
|
+
There is no ripple on a disabled or `aria-disabled` element, with the system's reduced motion setting, or in forced
|
|
19
|
+
colors. Keyboard presses have none either: the focus indicator already shows where they act. Nor does a press on a
|
|
20
|
+
control inside the element, such as a button or a link, which belongs to that control, unless the element is the
|
|
21
|
+
`<label>` of that control.
|
|
22
|
+
|
|
23
|
+
**Selector:** `[monaRipple]`
|
|
24
|
+
|
|
25
|
+
### Inputs
|
|
26
|
+
|
|
27
|
+
| Name | Type | Default | Description |
|
|
28
|
+
| --- | --- | --- | --- |
|
|
29
|
+
| `monaRippleDisabled` | `boolean` | `false` | Turns the ripple off for this element while ripples are on. |
|
|
30
|
+
|
|
31
|
+
## `provideRipple`
|
|
32
|
+
|
|
33
|
+
Function.
|
|
34
|
+
|
|
35
|
+
Turns on the ripple Mona UI's buttons, and elements with the `monaRipple` directive, draw when pressed. Pass
|
|
36
|
+
`{ enabled: false }` to keep them off, for example behind a setting.
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
function provideRipple(options: Partial<RippleOptions> = {}): EnvironmentProviders;
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## `DEFAULT_RIPPLE_OPTIONS`
|
|
43
|
+
|
|
44
|
+
Constant.
|
|
45
|
+
|
|
46
|
+
The settings used when nothing is provided with `provideRipple()`: no ripples.
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
const DEFAULT_RIPPLE_OPTIONS: RippleOptions;
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## `RIPPLE_OPTIONS`
|
|
53
|
+
|
|
54
|
+
Constant.
|
|
55
|
+
|
|
56
|
+
Ripple settings. Set them for the application with `provideRipple()`, or provide this token on a
|
|
57
|
+
component to turn ripples on or off for everything inside it.
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
const RIPPLE_OPTIONS: InjectionToken<RippleOptions>;
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## `RippleOptions`
|
|
64
|
+
|
|
65
|
+
Interface.
|
|
66
|
+
|
|
67
|
+
Ripple settings. Set them for the application with `provideRipple()`.
|
|
68
|
+
|
|
69
|
+
### Properties
|
|
70
|
+
|
|
71
|
+
| Name | Type | Description |
|
|
72
|
+
| --- | --- | --- |
|
|
73
|
+
| `enabled` (read-only) | `boolean` | Whether pressing a button, or another element with the `monaRipple` directive, draws a ripple. Ripples are off until `provideRipple()` turns them on. |
|
|
74
|
+
|
|
75
|
+
**Used by:** [`DEFAULT_RIPPLE_OPTIONS`](ripple.md#default-ripple-options), [`provideRipple`](ripple.md#provideripple), [`RIPPLE_OPTIONS`](ripple.md#ripple-options)
|
package/docs/api/sidebar.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"links":{"ClassInputType":"common","InjectSidebarOptions":"sidebar","LocalStorageSidebarStorage":"sidebar","MonaSidebarMessages":"i18n","SIDEBAR_DEFAULT_MESSAGES":"sidebar","SIDEBAR_STORAGE":"sidebar","SidebarCollapsibleMode":"sidebar","SidebarComponent":"sidebar","SidebarContentDirective":"sidebar","SidebarController":"sidebar","SidebarFooterDirective":"sidebar","SidebarGroupActionDirective":"sidebar","SidebarGroupContentDirective":"sidebar","SidebarGroupDirective":"sidebar","SidebarGroupHeaderDirective":"sidebar","SidebarGroupLabelDirective":"sidebar","SidebarHeaderDirective":"sidebar","SidebarInputDirective":"sidebar","SidebarInsetDirective":"sidebar","SidebarLayoutComponent":"sidebar","SidebarLogicalSide":"sidebar","SidebarMenuActionDirective":"sidebar","SidebarMenuBadgeDirective":"sidebar","SidebarMenuButtonDirective":"sidebar","SidebarMenuButtonSize":"sidebar","SidebarMenuDirective":"sidebar","SidebarMenuItemDirective":"sidebar","SidebarMenuSkeletonComponent":"sidebar","SidebarMenuSubDirective":"sidebar","SidebarModalScope":"sidebar","SidebarRailDirective":"sidebar","SidebarSeparatorDirective":"sidebar","SidebarSide":"sidebar","SidebarStorage":"sidebar","SidebarTriggerDirective":"sidebar","SidebarVariant":"sidebar","injectSidebar":"sidebar","provideSidebarStorage":"sidebar"},"name":"sidebar","pages":[{"path":"sidebar","title":"Sidebar"},{"path":"sidebar/menus","title":"Sidebar Menus"},{"path":"sidebar/state","title":"Sidebar State & Behavior"}],"symbols":[{"description":"The sidebar region itself. Content is projected in author order, so header, content and footer\nparts appear exactly where they are written.\n\nBelow the layout's `mobileBreakpoint` it presents as a modal overlay drawer: focus is trapped\ninside it while open, restored to whatever opened it on close, and everything outside it is made\ninert, as far as the layout's `modalScope` says. It is not a navigation landmark by itself — wrap\nthe menus in a labelled `nav`, or set `role` and `aria-label` if the whole region is navigation.","kind":"component","name":"SidebarComponent","selector":"mona-sidebar","inputs":[{"alias":"aria-label","defaultValue":"\"\"","description":"Accessible name for the sidebar region. Required when `role` is set, and used as the\ndrawer's name on compact viewports, which otherwise has a localized default.","name":"ariaLabel","type":"string"},{"alias":"aria-labelledby","defaultValue":"\"\"","description":"The id of the element that names the sidebar region, in place of `aria-label`. A docked sidebar with no\n`role` ignores it.","name":"ariaLabelledBy","type":"string"},{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the host element via `tailwind-merge`.","name":"userClass","type":"ClassInputType"},{"defaultValue":"\"offcanvas\"","description":"How the sidebar behaves when collapsed. `\"icon\"` keeps a narrow rail of icons visible,\n`\"offcanvas\"` removes it from the layout entirely, and `\"none\"` disables collapsing altogether.","name":"collapsible","type":"SidebarCollapsibleMode"},{"defaultValue":"true","description":"Sets whether this sidebar is open. Supports two-way binding. While the viewport is\ncompact this reflects the drawer, so one binding drives both presentations, and it reads `false` on\na phone from the start. To remember the docked state, use `persistKey` rather than saving this.","name":"expanded","twoWay":true,"type":"boolean"},{"defaultValue":"\"3rem\"","description":"Width of the icon rail while collapsed. Only applies when `collapsible` is `\"icon\"`.\nNumbers are treated as pixels.","name":"iconWidth","type":"string | number"},{"defaultValue":"\"\"","description":"Id for the sidebar element, referenced by triggers through `aria-controls`. Supply a\nstable value when the markup is server rendered, so the client does not hydrate onto a different\ngenerated id. Falls back to a generated id.","name":"id","type":"string"},{"defaultValue":"\"18rem\"","description":"Width of the overlay drawer on compact viewports. Numbers are treated as pixels.","name":"mobileWidth","type":"string | number"},{"defaultValue":"\"\"","description":"Remembers whether this sidebar was left open, under this key. Unset means nothing is\nstored — no key, no storage written.\n\nOnly the docked state is kept. A drawer is never restored open: on the viewport that makes one,\nit would cover the page on load. A stored value wins over `expanded`, and is pushed back out\nthrough that binding, so do not set a key on a sidebar whose state is already restored elsewhere.\n\nWhere it is kept is `SIDEBAR_STORAGE`, which defaults to `localStorage`. A server-rendered\napplication cannot read that until hydration and so flashes the default first; supply storage the\nserver can read through `provideSidebarStorage()`.","name":"persistKey","type":"string"},{"defaultValue":"\"\"","description":"ARIA role for the sidebar region. Leave unset and wrap the menus in a labelled `nav`\nwhen the sidebar holds more than navigation; set `\"navigation\"` with an `aria-label` when it does\nnot. Ignored on compact viewports, where the drawer is a `dialog`.","name":"role","type":"string"},{"defaultValue":"\"start\"","description":"Which edge the sidebar sits on. Prefer `\"start\"` and `\"end\"`, which follow the\ndocument's writing direction; `\"left\"` and `\"right\"` are aliases of them.","name":"side","type":"SidebarSide"},{"defaultValue":"\"sidebar\"","description":"The visual treatment of the sidebar. `\"floating\"` detaches it from the edge on its own\nsurface, and `\"inset\"` moves that raised surface onto the region beside it instead.","name":"variant","type":"SidebarVariant"},{"defaultValue":"\"16rem\"","description":"Width of the sidebar while expanded. Numbers are treated as pixels.","name":"width","type":"string | number"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar","title":"Sidebar"}},{"description":"Lays its children out in a row and owns what they share. Project one or more `mona-sidebar`\nelements and an element marked with `monaSidebarInset` into it. Each sidebar keeps its own open\nstate, on its own `[(expanded)]` binding, so a layout can hold a navigation column on one edge and\nan inspector on the other.\n\nBelow `mobileBreakpoint` sidebars present as overlay drawers instead of columns. A drawer has its\nown open state, so a sidebar collapsed on a desktop does not come back open on a phone, and it is\nreset whenever the viewport crosses the breakpoint. Only one drawer is open at a time: opening one\ncloses any other, and they share the single backdrop this layout paints behind them.","kind":"component","name":"SidebarLayoutComponent","selector":"mona-sidebar-layout","inputs":[{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the host element via `tailwind-merge`.","name":"userClass","type":"ClassInputType"},{"defaultValue":"768","description":"Viewport width, in pixels, below which the sidebar presents as an overlay drawer.\nSet to `0` to keep the docked presentation at every size.","name":"mobileBreakpoint","type":"number"},{"defaultValue":"\"page\"","description":"How far an open drawer's modality reaches. `\"page\"` makes everything outside the drawer inert and\nlocks the page's scroll. Use `\"layout\"` for a sidebar embedded in part of a page: what's around the layout stays\nusable, so the drawer isn't `aria-modal`.","name":"modalScope","type":"SidebarModalScope"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar","title":"Sidebar"}},{"description":"A loading placeholder shaped like a menu item. Its label bar is clipped on the icon rail, where the\nreal labels are not visible either.","kind":"component","name":"SidebarMenuSkeletonComponent","selector":"mona-sidebar-menu-skeleton","inputs":[{"defaultValue":"\"60%\"","description":"Width of the label bar. Varying it across a list keeps the placeholder from looking\nlike a rigid grid. Numbers are treated as pixels.","name":"labelWidth","type":"string | number"},{"defaultValue":"true","description":"Renders a square standing in for the item's icon.","name":"showIcon","type":"boolean"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar/menus","title":"Sidebar Menus"}},{"description":"A row in a sidebar menu. Applies to a `button` for an action and to an `a` for a destination —\nan anchor keeps `href`, `routerLink`, middle-click, open-in-new-tab and the browser's own status\nbar preview, none of which a button can offer.\n\nOn a compact viewport, following a link closes the drawer, since the destination it navigates to is\nunderneath it. A row that opens a submenu leaves the drawer open, and on the icon rail it expands the\nsidebar, since that's the only place the submenu can open.","exportAs":"monaSidebarMenuButton","kind":"directive","name":"SidebarMenuButtonDirective","selector":"a[monaSidebarMenuButton], button[monaSidebarMenuButton]","inputs":[{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the host element via `tailwind-merge`.","name":"userClass","type":"ClassInputType"},{"defaultValue":"undefined","description":"Closes the overlay drawer after this row is activated. Only applies on compact\nviewports, where the drawer covers the destination being navigated to. Set to `false` for rows\nthat do not navigate. Leave it unset on a `monaCollapsibleTrigger`, which keeps the drawer open.","name":"closeOnSelect","type":"boolean | undefined"},{"defaultValue":"false","description":"Renders the row as unavailable and suppresses activation, including a `routerLink` and any `click`\nhandler on it. A disabled anchor gives up its `href`.","name":"disabled","type":"boolean"},{"defaultValue":"\"medium\"","description":"How much room this row's leading visual needs. Use `\"large\"` when it opens with\nsomething avatar sized, so the icon rail lets it fill the square instead of insetting and clipping it.","name":"size","type":"SidebarMenuButtonSize"},{"defaultValue":"\"\"","description":"Text identifying this item while the sidebar is collapsed to its icon rail, where the\nlabel is clipped away. Shown as a tooltip on hover and on keyboard focus, on the rail only.","name":"tooltip","type":"string"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar/menus","title":"Sidebar Menus"}},{"description":"","kind":"directive","name":"SidebarMenuItemDirective","selector":"li[monaSidebarMenuItem]","inputs":[{"defaultValue":"false","description":"Marks this row as the current sidebar destination. The row owns the selected\nsurface so trailing badges and actions remain inside one continuous highlight.","name":"active","type":"boolean"},{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the host element via `tailwind-merge`.","name":"userClass","type":"ClassInputType"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar/menus","title":"Sidebar Menus"}},{"description":"The region at the bottom of the sidebar, below its content. Holds what stays put while the content\nscrolls — a profile menu, a sign-out.","kind":"directive","name":"SidebarFooterDirective","selector":"[monaSidebarFooter]","inputs":[{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the host element via `tailwind-merge`.","name":"userClass","type":"ClassInputType"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar","title":"Sidebar"}},{"description":"The region at the top of the sidebar, above its content. Holds what stays put while the content\nscrolls — a workspace switcher, a search box.","kind":"directive","name":"SidebarHeaderDirective","selector":"[monaSidebarHeader]","inputs":[{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the host element via `tailwind-merge`.","name":"userClass","type":"ClassInputType"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar","title":"Sidebar"}},{"description":"Marks the main region beside the sidebar. Fills the remaining width and scrolls independently.\nTakes on the raised surface when the sidebar uses the `inset` variant.\n\nIt sits beside the sidebars rather than inside one, so it answers to the layout as a whole: it steps\nout of the way for whichever drawer is open, and where a layout holds more than one sidebar it takes\nits surface from the first one in author order.","kind":"directive","name":"SidebarInsetDirective","selector":"[monaSidebarInset]","inputs":[{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the host element via `tailwind-merge`.","name":"userClass","type":"ClassInputType"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar","title":"Sidebar"}},{"description":"A trailing count or status badge on a menu item. Stands down on the icon rail, where it would\ncrowd out the icon it belongs to.","kind":"directive","name":"SidebarMenuBadgeDirective","selector":"[monaSidebarMenuBadge]","inputs":[{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the host element via `tailwind-merge`.","name":"userClass","type":"ClassInputType"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar/menus","title":"Sidebar Menus"}},{"description":"","kind":"directive","name":"SidebarMenuDirective","selector":"ul[monaSidebarMenu]","inputs":[{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the host element via `tailwind-merge`.","name":"userClass","type":"ClassInputType"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar/menus","title":"Sidebar Menus"}},{"description":"An indented submenu inside a `monaSidebarMenuItem` that is also a `monaCollapsible`.\n\nIt carries no hiding of its own on the icon rail. `SidebarMenuItemDirective` closes the disclosure\nthere instead, which leaves the trigger's `aria-expanded` truthful and lets the collapsible content\ndirective apply its own `inert`. Hiding it here as well used to produce the opposite: a submenu the\ntrigger still described as expanded, with focusable items, that nobody could see.","kind":"directive","name":"SidebarMenuSubDirective","selector":"ul[monaSidebarMenuSub]","inputs":[{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the host element via `tailwind-merge`.","name":"userClass","type":"ClassInputType"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar/menus","title":"Sidebar Menus"}},{"description":"A thin strip along the sidebar's inner edge that toggles it. Place it inside `mona-sidebar`,\nwhich positions it. Hidden on narrow viewports, where the edge is too easy to hit by accident.\n\nDeliberately outside the tab order: it is a pointer shortcut for what `monaSidebarTrigger` already\ndoes, and a second tab stop onto a 4px strip would be noise for keyboard users. Provide a\n`monaSidebarTrigger` as well — the rail is not a substitute for it.","kind":"directive","name":"SidebarRailDirective","selector":"button[monaSidebarRail]","inputs":[{"alias":"aria-label","defaultValue":"\"\"","description":"Accessible name of the rail, which otherwise has a localized default.","name":"ariaLabel","type":"string"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar","title":"Sidebar"}},{"description":"A horizontal rule between sidebar regions. Tightens its inset on the icon rail.","kind":"directive","name":"SidebarSeparatorDirective","selector":"[monaSidebarSeparator]","inputs":[{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the host element via `tailwind-merge`.","name":"userClass","type":"ClassInputType"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar","title":"Sidebar"}},{"description":"Toggles a sidebar. Can be placed anywhere inside a `mona-sidebar-layout`, including in the inset,\nand adds no styling of its own.\n\nBy default it drives the sidebar it is written inside. Set `for` to the id of a `mona-sidebar` to\ndrive that one instead, which is what a trigger in a shared header needs when the layout holds more\nthan one sidebar. A `for` that matches no sidebar leaves the trigger inert rather than throwing, so\na sidebar that has not rendered yet does not take the page down with it, and warns in development.\n\nA `button` is the right host and needs nothing further. On any other element the directive supplies\nthe rest of the button contract — `role`, a tab stop, and Enter/Space activation — so a `div`, a\n`span` or an `a` without `href` is still operable by keyboard rather than silently mouse-only.\n\nA sidebar that can't collapse has nothing for a trigger to do on a wide viewport, so the trigger\nreports itself as disabled there rather than as an open disclosure.","exportAs":"monaSidebarTrigger","kind":"directive","name":"SidebarTriggerDirective","selector":"[monaSidebarTrigger]","inputs":[{"defaultValue":"\"\"","description":"Id of the `mona-sidebar` to toggle. Leave unset to toggle the sidebar this trigger\nis written inside.","name":"for","type":"string"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar","title":"Sidebar"}},{"description":"","kind":"directive","name":"SidebarContentDirective","selector":"[monaSidebarContent]","inputs":[],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar","title":"Sidebar"}},{"description":"A control in the corner of a group header — an add or overflow button. Stands down on the icon\nrail, where there is no header row left to sit in. Give it an `aria-label`: it is icon-only.","kind":"directive","name":"SidebarGroupActionDirective","selector":"button[monaSidebarGroupAction]","inputs":[],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar/menus","title":"Sidebar Menus"}},{"description":"The body of a `monaSidebarGroup`, below its header. Wraps the menu itself.","kind":"directive","name":"SidebarGroupContentDirective","selector":"[monaSidebarGroupContent]","inputs":[],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar/menus","title":"Sidebar Menus"}},{"description":"A titled section of the sidebar, grouping a label and its menu. Stack as many as the sidebar\nneeds; each is an ordinary block, so a `monaSidebarSeparator` between them is optional. A\n`monaSidebarGroupLabel` inside it names the group.","kind":"directive","name":"SidebarGroupDirective","selector":"[monaSidebarGroup]","inputs":[],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar/menus","title":"Sidebar Menus"}},{"description":"The row above a group's content, holding its label and any group action. Collapses to nothing on\nthe icon rail rather than leaving an empty gap where the label used to be.","kind":"directive","name":"SidebarGroupHeaderDirective","selector":"[monaSidebarGroupHeader]","inputs":[],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar/menus","title":"Sidebar Menus"}},{"description":"The name of a group, which the enclosing `monaSidebarGroup` is labelled by. Fades out on the icon\nrail, where there is no width to read it in.","kind":"directive","name":"SidebarGroupLabelDirective","selector":"[monaSidebarGroupLabel]","inputs":[],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar/menus","title":"Sidebar Menus"}},{"description":"A text input sized for the sidebar, composing `monaTextBox`. Stands down on the icon rail,\nwhere there is no room to type.","kind":"directive","name":"SidebarInputDirective","selector":"input[monaSidebarInput]","inputs":[],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar/menus","title":"Sidebar Menus"}},{"description":"A trailing control on a menu item — an overflow menu, a pin. Sits inside the row's highlight and\nstands down on the icon rail. Give it an `aria-label`: it is icon-only.","kind":"directive","name":"SidebarMenuActionDirective","selector":"button[monaSidebarMenuAction]","inputs":[],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar/menus","title":"Sidebar Menus"}},{"description":"The default `SidebarStorage`: `localStorage`, under the sidebar's `persistKey`.\n\nReads report `null` anywhere `localStorage` cannot answer, and writes are dropped there. That\ncovers the server, where there is no such thing, and a browser that refuses it — Safari's private\nmode throws on access rather than returning empty, and a full quota throws on write. None of that\nis worth taking an application down over: the sidebar simply opens the way its input says.\n\nA server-rendered application gets the default state in its markup and the remembered one on\nhydration, which shows as a flash. Storage that the server can read too — a cookie, or state\ntransferred from the request — avoids it; supply it through `provideSidebarStorage()`.","kind":"class","name":"LocalStorageSidebarStorage","inputs":[],"methods":[{"description":"","name":"read","signature":"read(key: string): boolean | null"},{"description":"","name":"write","signature":"write(key: string, expanded: boolean): void"}],"outputs":[],"properties":[],"page":{"path":"sidebar/state","title":"Sidebar State & Behavior"}},{"description":"Reads a sidebar from an injection context: the one that encloses the caller, or from elsewhere in a\n`mona-sidebar-layout`, such as a toolbar in the inset, the layout's first sidebar. Name another one with `for`.\n\nReturns the sidebar's state and the commands that are safe to issue from anywhere — opening,\nclosing and toggling, each routed to whichever presentation is current. Structural facts such as\nthe side, variant and collapsible mode are readable but not settable; those are authored as inputs\non `mona-sidebar`, and writing them from a descendant would only desynchronise the two.\n\nIn a layout it follows the sidebar rather than holding it, because the caller may be created first. Until there is\none, it reads as closed and its commands do nothing.","kind":"function","name":"injectSidebar","signature":"function injectSidebar(options: InjectSidebarOptions & { optional: true }): SidebarController | null;\nfunction injectSidebar(options?: InjectSidebarOptions): SidebarController;","page":{"path":"sidebar/state","title":"Sidebar State & Behavior"}},{"description":"Replaces where sidebars remember whether they were left open. The default is `localStorage`, which\nthe server cannot read; supply a cookie- or request-backed storage here to have a server-rendered\napplication render the remembered state rather than correcting it on hydration.","kind":"function","name":"provideSidebarStorage","signature":"function provideSidebarStorage(storage: SidebarStorage | (() => SidebarStorage)): EnvironmentProviders;","page":{"path":"sidebar/state","title":"Sidebar State & Behavior"}},{"description":"","kind":"constant","name":"SIDEBAR_DEFAULT_MESSAGES","signature":"const SIDEBAR_DEFAULT_MESSAGES: MonaSidebarMessages;","page":{"path":"sidebar","title":"Sidebar"}},{"description":"Where sidebars given a `persistKey` remember whether they were left open. Defaults to\n`localStorage`. Replace it with `provideSidebarStorage()` — with something the server can read too,\nfor an application that renders there.","kind":"constant","name":"SIDEBAR_STORAGE","signature":"const SIDEBAR_STORAGE: InjectionToken<SidebarStorage>;","page":{"path":"sidebar/state","title":"Sidebar State & Behavior"}},{"description":"The safe, read-and-command view of one sidebar, returned by `injectSidebar()`.\n\nStructural facts — side, variant, collapsible mode — are readable but not settable. They are\nauthored as inputs on `mona-sidebar`, and letting a descendant write them would leave the service\nand the component disagreeing about the same sidebar, with the component winning on the next\nchange detection pass. Consumers who need them to change should bind the inputs.","extends":[],"kind":"interface","methods":[{"description":"Closes the sidebar. On a compact viewport this closes the drawer instead.","name":"collapse","signature":"collapse(): void"},{"description":"Opens the sidebar. On a compact viewport this opens the drawer instead.","name":"expand","signature":"expand(): void"},{"description":"Flips the sidebar between open and closed, on whichever presentation is current.","name":"toggle","signature":"toggle(): void"}],"name":"SidebarController","properties":[{"description":"How the sidebar behaves when collapsed, as authored on `mona-sidebar`.","name":"collapsible","readonly":true,"type":"Signal<SidebarCollapsibleMode>"},{"description":"Whether the viewport is narrow enough that the sidebar presents as an overlay drawer rather\nthan as a column in the layout.","name":"compact","readonly":true,"type":"Signal<boolean>"},{"description":"Whether the sidebar is showing at full width. On a compact viewport this reports the drawer's\nstate, so a single binding drives both presentations.","name":"expanded","readonly":true,"type":"Signal<boolean>"},{"description":"Whether the sidebar is currently reduced to its icon rail, meaning parts that only make sense\nat full width — labels, trailing actions, submenus — should step aside. Never true while\ncompact, where the drawer always presents at full width.","name":"iconOnly","readonly":true,"type":"Signal<boolean>"},{"description":"Whether the overlay drawer is open. Only meaningful while `compact` is true.","name":"mobileOpen","readonly":true,"type":"Signal<boolean>"},{"description":"Which edge the sidebar sits on, resolved to a direction-relative side.","name":"side","readonly":true,"type":"Signal<SidebarLogicalSide>"},{"description":"The id of the sidebar element, for `aria-controls` on a custom trigger.","name":"sidebarId","readonly":true,"type":"Signal<string>"},{"description":"The expanded state as a string, for `data-state` bindings and styling hooks.","name":"state","readonly":true,"type":"Signal<\"expanded\" | \"collapsed\">"},{"description":"The visual treatment of the sidebar, as authored on `mona-sidebar`.","name":"variant","readonly":true,"type":"Signal<SidebarVariant>"}],"page":{"path":"sidebar/state","title":"Sidebar State & Behavior"},"usedBy":["injectSidebar"]},{"description":"Where a sidebar remembers whether it was left open. Supplied through `SIDEBAR_STORAGE`, and only\never consulted for a sidebar that was given a `persistKey`.\n\nOnly the docked state is ever handed to it. A drawer on a compact viewport is deliberately never\npersisted: restoring one open would cover the page on load, in front of the content the reader\nasked for.","extends":[],"kind":"interface","methods":[{"description":"The remembered state for `key`, or `null` when nothing has been stored under it — including\nwhen this storage cannot answer, such as on the server. A `null` leaves the sidebar on whatever\nits `expanded` input says.","name":"read","signature":"read(key: string): boolean | null"},{"description":"Records the docked state for `key`. Failing to store it must not throw.","name":"write","signature":"write(key: string, expanded: boolean): void"}],"name":"SidebarStorage","properties":[],"page":{"path":"sidebar/state","title":"Sidebar State & Behavior"},"usedBy":["provideSidebarStorage","SIDEBAR_STORAGE"]},{"description":"","extends":[],"kind":"interface","methods":[],"name":"InjectSidebarOptions","properties":[{"description":"Reads the sidebar with this id in the enclosing layout, rather than the nearest one. Needs a layout.","name":"for","optional":true,"readonly":true,"type":"string"},{"description":"Returns `null` instead of throwing when there is no enclosing sidebar or layout.","name":"optional","optional":true,"readonly":true,"type":"boolean"}],"page":{"path":"sidebar/state","title":"Sidebar State & Behavior"},"usedBy":["injectSidebar"]},{"description":"How the sidebar behaves when it is collapsed.\n\n- `offcanvas` — the sidebar collapses to zero width and leaves the layout.\n- `icon` — the sidebar shrinks to a narrow rail that keeps icons visible.\n- `none` — the sidebar cannot be collapsed and stays at its full width.","kind":"type","name":"SidebarCollapsibleMode","signature":"type SidebarCollapsibleMode = \"offcanvas\" | \"icon\" | \"none\";","page":{"path":"sidebar/state","title":"Sidebar State & Behavior"},"usedBy":["SidebarComponent","SidebarController"]},{"description":"The direction-relative side, once the `left`/`right` aliases have been folded in.","kind":"type","name":"SidebarLogicalSide","signature":"type SidebarLogicalSide = \"start\" | \"end\";","page":{"path":"sidebar","title":"Sidebar"},"usedBy":["SidebarController"]},{"description":"How much room the button's leading visual needs.\n\n- `medium` — sized for an icon, which the icon rail insets so it sits centred in the square.\n- `large` — sized for a full-height visual such as an avatar, which fills the rail square edge to\n edge, and which is given a taller row while the sidebar is expanded.","kind":"type","name":"SidebarMenuButtonSize","signature":"type SidebarMenuButtonSize = \"medium\" | \"large\";","page":{"path":"sidebar/menus","title":"Sidebar Menus"},"usedBy":["SidebarMenuButtonDirective"]},{"description":"How far an open drawer's modality reaches.\n- `\"page\"` makes everything outside the drawer inert and locks the page's scroll, and the drawer is `aria-modal`.\n- `\"layout\"` does that within `mona-sidebar-layout` only, for a sidebar embedded in part of a page. What's around the\n layout stays usable, so the drawer isn't `aria-modal`.","kind":"type","name":"SidebarModalScope","signature":"type SidebarModalScope = \"page\" | \"layout\";","page":{"path":"sidebar/state","title":"Sidebar State & Behavior"},"usedBy":["SidebarLayoutComponent"]},{"description":"Which edge of the layout the sidebar sits on. Also determines its order within the layout\nand which side its rail and border are drawn on.\n\n`start` and `end` are the preferred values: they follow the document's writing direction, so a\n`start` sidebar sits on the left in LTR and on the right in RTL without the consumer branching.\n\n`left` and `right` are retained as aliases of `start` and `end`. They were always a poor\ndescription of the behaviour — the layout orders the sidebar with flexbox, which is\ndirection-relative, so `side=\"left\"` already rendered on the right under RTL.","kind":"type","name":"SidebarSide","signature":"type SidebarSide = \"start\" | \"end\" | \"left\" | \"right\";","page":{"path":"sidebar","title":"Sidebar"},"usedBy":["SidebarComponent"]},{"description":"The visual treatment of the sidebar region.\n\n- `sidebar` — flush against the edge of the layout, separated by a single border.\n- `floating` — detached from the edge, with its own rounded, bordered surface.\n- `inset` — the sidebar itself is plain, and the inset region beside it becomes the raised surface.","kind":"type","name":"SidebarVariant","signature":"type SidebarVariant = \"sidebar\" | \"floating\" | \"inset\";","page":{"path":"sidebar","title":"Sidebar"},"usedBy":["SidebarComponent","SidebarController"]}]}
|
|
1
|
+
{"links":{"ClassInputType":"common","InjectSidebarOptions":"sidebar","LocalStorageSidebarStorage":"sidebar","MonaSidebarMessages":"i18n","SIDEBAR_DEFAULT_MESSAGES":"sidebar","SIDEBAR_STORAGE":"sidebar","SidebarCollapsibleMode":"sidebar","SidebarComponent":"sidebar","SidebarContentDirective":"sidebar","SidebarController":"sidebar","SidebarFooterDirective":"sidebar","SidebarGroupActionDirective":"sidebar","SidebarGroupContentDirective":"sidebar","SidebarGroupDirective":"sidebar","SidebarGroupHeaderDirective":"sidebar","SidebarGroupLabelDirective":"sidebar","SidebarHeaderDirective":"sidebar","SidebarInputDirective":"sidebar","SidebarInsetDirective":"sidebar","SidebarLayoutComponent":"sidebar","SidebarLogicalSide":"sidebar","SidebarMenuActionDirective":"sidebar","SidebarMenuBadgeDirective":"sidebar","SidebarMenuButtonDirective":"sidebar","SidebarMenuButtonSize":"sidebar","SidebarMenuDirective":"sidebar","SidebarMenuItemDirective":"sidebar","SidebarMenuSkeletonComponent":"sidebar","SidebarMenuSubDirective":"sidebar","SidebarModalScope":"sidebar","SidebarRailDirective":"sidebar","SidebarSeparatorDirective":"sidebar","SidebarSide":"sidebar","SidebarStorage":"sidebar","SidebarTriggerDirective":"sidebar","SidebarVariant":"sidebar","injectSidebar":"sidebar","provideSidebarStorage":"sidebar"},"name":"sidebar","pages":[{"path":"sidebar","title":"Sidebar"},{"path":"sidebar/menus","title":"Sidebar Menus"},{"path":"sidebar/state","title":"Sidebar State & Behavior"}],"symbols":[{"description":"The sidebar region itself. Content is projected in author order, so header, content and footer\nparts appear exactly where they are written.\n\nBelow the layout's `mobileBreakpoint` it presents as a modal overlay drawer: focus is trapped\ninside it while open, restored to whatever opened it on close, and everything outside it is made\ninert, as far as the layout's `modalScope` says. It is not a navigation landmark by itself — wrap\nthe menus in a labelled `nav`, or set `role` and `aria-label` if the whole region is navigation.","kind":"component","name":"SidebarComponent","selector":"mona-sidebar","inputs":[{"alias":"aria-label","defaultValue":"\"\"","description":"Accessible name for the sidebar region. Required when `role` is set, and used as the\ndrawer's name on compact viewports, which otherwise has a localized default.","name":"ariaLabel","type":"string"},{"alias":"aria-labelledby","defaultValue":"\"\"","description":"The id of the element that names the sidebar region, in place of `aria-label`. A docked sidebar with no\n`role` ignores it.","name":"ariaLabelledBy","type":"string"},{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the host element via `tailwind-merge`.","name":"userClass","type":"ClassInputType"},{"defaultValue":"\"offcanvas\"","description":"How the sidebar behaves when collapsed. `\"icon\"` keeps a narrow rail of icons visible,\n`\"offcanvas\"` removes it from the layout entirely, and `\"none\"` disables collapsing altogether.","name":"collapsible","type":"SidebarCollapsibleMode"},{"defaultValue":"true","description":"Sets whether this sidebar is open. Supports two-way binding. While the viewport is\ncompact this reflects the drawer, so one binding drives both presentations, and it reads `false` on\na phone from the start. To remember the docked state, use `persistKey` rather than saving this.","name":"expanded","twoWay":true,"type":"boolean"},{"defaultValue":"\"3rem\"","description":"Width of the icon rail while collapsed. Only applies when `collapsible` is `\"icon\"`.\nNumbers are treated as pixels.","name":"iconWidth","type":"string | number"},{"defaultValue":"\"\"","description":"Id for the sidebar element, referenced by triggers through `aria-controls`. Supply a\nstable value when the markup is server rendered, so the client does not hydrate onto a different\ngenerated id. Falls back to a generated id.","name":"id","type":"string"},{"defaultValue":"\"18rem\"","description":"Width of the overlay drawer on compact viewports. Numbers are treated as pixels.","name":"mobileWidth","type":"string | number"},{"defaultValue":"\"\"","description":"Remembers whether this sidebar was left open, under this key. Unset means nothing is\nstored — no key, no storage written.\n\nOnly the docked state is kept. A drawer is never restored open: on the viewport that makes one,\nit would cover the page on load. A stored value wins over `expanded`, and is pushed back out\nthrough that binding, so do not set a key on a sidebar whose state is already restored elsewhere.\n\nWhere it is kept is `SIDEBAR_STORAGE`, which defaults to `localStorage`. A server-rendered\napplication cannot read that until hydration and so flashes the default first; supply storage the\nserver can read through `provideSidebarStorage()`.","name":"persistKey","type":"string"},{"defaultValue":"\"\"","description":"ARIA role for the sidebar region. Leave unset and wrap the menus in a labelled `nav`\nwhen the sidebar holds more than navigation; set `\"navigation\"` with an `aria-label` when it does\nnot. Ignored on compact viewports, where the drawer is a `dialog`.","name":"role","type":"string"},{"defaultValue":"\"start\"","description":"Which edge the sidebar sits on. Prefer `\"start\"` and `\"end\"`, which follow the\ndocument's writing direction; `\"left\"` and `\"right\"` are aliases of them.","name":"side","type":"SidebarSide"},{"defaultValue":"\"sidebar\"","description":"The visual treatment of the sidebar. `\"floating\"` detaches it from the edge on its own\nsurface, and `\"inset\"` moves that raised surface onto the region beside it instead.","name":"variant","type":"SidebarVariant"},{"defaultValue":"\"16rem\"","description":"Width of the sidebar while expanded. Numbers are treated as pixels.","name":"width","type":"string | number"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar","title":"Sidebar"}},{"description":"Lays its children out in a row and owns what they share. Project one or more `mona-sidebar`\nelements and an element marked with `monaSidebarInset` into it. Each sidebar keeps its own open\nstate, on its own `[(expanded)]` binding, so a layout can hold a navigation column on one edge and\nan inspector on the other.\n\nBelow `mobileBreakpoint` sidebars present as overlay drawers instead of columns. A drawer has its\nown open state, so a sidebar collapsed on a desktop does not come back open on a phone, and it is\nreset whenever the viewport crosses the breakpoint. Only one drawer is open at a time: opening one\ncloses any other, and they share the single backdrop this layout paints behind them.","kind":"component","name":"SidebarLayoutComponent","selector":"mona-sidebar-layout","inputs":[{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the host element via `tailwind-merge`.","name":"userClass","type":"ClassInputType"},{"defaultValue":"768","description":"Viewport width, in pixels, below which the sidebar presents as an overlay drawer.\nSet to `0` to keep the docked presentation at every size.","name":"mobileBreakpoint","type":"number"},{"defaultValue":"\"page\"","description":"How far an open drawer's modality reaches. `\"page\"` makes everything outside the drawer inert and\nlocks the page's scroll. Use `\"layout\"` for a sidebar embedded in part of a page: what's around the layout stays\nusable, so the drawer isn't `aria-modal`.","name":"modalScope","type":"SidebarModalScope"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar","title":"Sidebar"}},{"description":"A loading placeholder shaped like a menu item. Its label bar is clipped on the icon rail, where the\nreal labels are not visible either.","kind":"component","name":"SidebarMenuSkeletonComponent","selector":"mona-sidebar-menu-skeleton","inputs":[{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the host element via `tailwind-merge`. Give it the\nsame height and padding as the menu buttons it stands in for when those are restyled, such as\n`h-7 px-2` for a denser menu, so the rows don't jump when the real ones arrive.","name":"userClass","type":"ClassInputType"},{"defaultValue":"\"60%\"","description":"Width of the label bar. Varying it across a list keeps the placeholder from looking\nlike a rigid grid. Numbers are treated as pixels.","name":"labelWidth","type":"string | number"},{"defaultValue":"true","description":"Renders a square standing in for the item's icon.","name":"showIcon","type":"boolean"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar/menus","title":"Sidebar Menus"}},{"description":"A row in a sidebar menu. Applies to a `button` for an action and to an `a` for a destination —\nan anchor keeps `href`, `routerLink`, middle-click, open-in-new-tab and the browser's own status\nbar preview, none of which a button can offer.\n\nOn a compact viewport, following a link closes the drawer, since the destination it navigates to is\nunderneath it. A row that opens a submenu leaves the drawer open, and on the icon rail it expands the\nsidebar, since that's the only place the submenu can open.","exportAs":"monaSidebarMenuButton","kind":"directive","name":"SidebarMenuButtonDirective","selector":"a[monaSidebarMenuButton], button[monaSidebarMenuButton]","inputs":[{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the host element via `tailwind-merge`.","name":"userClass","type":"ClassInputType"},{"defaultValue":"undefined","description":"Closes the overlay drawer after this row is activated. Only applies on compact\nviewports, where the drawer covers the destination being navigated to. Set to `false` for rows\nthat do not navigate. Leave it unset on a `monaCollapsibleTrigger`, which keeps the drawer open.","name":"closeOnSelect","type":"boolean | undefined"},{"defaultValue":"false","description":"Renders the row as unavailable and suppresses activation, including a `routerLink` and any `click`\nhandler on it. A disabled anchor gives up its `href`.","name":"disabled","type":"boolean"},{"defaultValue":"\"medium\"","description":"How much room this row's leading visual needs. Use `\"large\"` when it opens with\nsomething avatar sized, so the icon rail lets it fill the square instead of insetting and clipping it.","name":"size","type":"SidebarMenuButtonSize"},{"defaultValue":"\"\"","description":"Text identifying this item while the sidebar is collapsed to its icon rail, where the\nlabel is clipped away. Shown as a tooltip on hover and on keyboard focus, on the rail only.","name":"tooltip","type":"string"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar/menus","title":"Sidebar Menus"}},{"description":"","kind":"directive","name":"SidebarMenuItemDirective","selector":"li[monaSidebarMenuItem]","inputs":[{"defaultValue":"false","description":"Marks this row as the current sidebar destination. The row owns the selected\nsurface so trailing badges and actions remain inside one continuous highlight.","name":"active","type":"boolean"},{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the host element via `tailwind-merge`.","name":"userClass","type":"ClassInputType"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar/menus","title":"Sidebar Menus"}},{"description":"The region at the bottom of the sidebar, below its content. Holds what stays put while the content\nscrolls — a profile menu, a sign-out.","kind":"directive","name":"SidebarFooterDirective","selector":"[monaSidebarFooter]","inputs":[{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the host element via `tailwind-merge`.","name":"userClass","type":"ClassInputType"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar","title":"Sidebar"}},{"description":"The region at the top of the sidebar, above its content. Holds what stays put while the content\nscrolls — a workspace switcher, a search box.","kind":"directive","name":"SidebarHeaderDirective","selector":"[monaSidebarHeader]","inputs":[{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the host element via `tailwind-merge`.","name":"userClass","type":"ClassInputType"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar","title":"Sidebar"}},{"description":"Marks the main region beside the sidebar. Fills the remaining width and scrolls independently.\nTakes on the raised surface when the sidebar uses the `inset` variant.\n\nIt sits beside the sidebars rather than inside one, so it answers to the layout as a whole: it steps\nout of the way for whichever drawer is open, and where a layout holds more than one sidebar it takes\nits surface from the first one in author order.","kind":"directive","name":"SidebarInsetDirective","selector":"[monaSidebarInset]","inputs":[{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the host element via `tailwind-merge`.","name":"userClass","type":"ClassInputType"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar","title":"Sidebar"}},{"description":"A trailing count or status badge on a menu item. Stands down on the icon rail, where it would\ncrowd out the icon it belongs to.","kind":"directive","name":"SidebarMenuBadgeDirective","selector":"[monaSidebarMenuBadge]","inputs":[{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the host element via `tailwind-merge`.","name":"userClass","type":"ClassInputType"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar/menus","title":"Sidebar Menus"}},{"description":"","kind":"directive","name":"SidebarMenuDirective","selector":"ul[monaSidebarMenu]","inputs":[{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the host element via `tailwind-merge`.","name":"userClass","type":"ClassInputType"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar/menus","title":"Sidebar Menus"}},{"description":"An indented submenu inside a `monaSidebarMenuItem` that is also a `monaCollapsible`.\n\nIt carries no hiding of its own on the icon rail. `SidebarMenuItemDirective` closes the disclosure\nthere instead, which leaves the trigger's `aria-expanded` truthful and lets the collapsible content\ndirective apply its own `inert`. Hiding it here as well used to produce the opposite: a submenu the\ntrigger still described as expanded, with focusable items, that nobody could see.","kind":"directive","name":"SidebarMenuSubDirective","selector":"ul[monaSidebarMenuSub]","inputs":[{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the host element via `tailwind-merge`.","name":"userClass","type":"ClassInputType"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar/menus","title":"Sidebar Menus"}},{"description":"A thin strip along the sidebar's inner edge that toggles it. Place it inside `mona-sidebar`,\nwhich positions it. Hidden on narrow viewports, where the edge is too easy to hit by accident.\n\nDeliberately outside the tab order: it is a pointer shortcut for what `monaSidebarTrigger` already\ndoes, and a second tab stop onto a 4px strip would be noise for keyboard users. Provide a\n`monaSidebarTrigger` as well — the rail is not a substitute for it.","kind":"directive","name":"SidebarRailDirective","selector":"button[monaSidebarRail]","inputs":[{"alias":"aria-label","defaultValue":"\"\"","description":"Accessible name of the rail, which otherwise has a localized default.","name":"ariaLabel","type":"string"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar","title":"Sidebar"}},{"description":"A horizontal rule between sidebar regions. Tightens its inset on the icon rail.","kind":"directive","name":"SidebarSeparatorDirective","selector":"[monaSidebarSeparator]","inputs":[{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the host element via `tailwind-merge`.","name":"userClass","type":"ClassInputType"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar","title":"Sidebar"}},{"description":"Toggles a sidebar. Can be placed anywhere inside a `mona-sidebar-layout`, including in the inset,\nand adds no styling of its own.\n\nBy default it drives the sidebar it is written inside. Set `for` to the id of a `mona-sidebar` to\ndrive that one instead, which is what a trigger in a shared header needs when the layout holds more\nthan one sidebar. A `for` that matches no sidebar leaves the trigger inert rather than throwing, so\na sidebar that has not rendered yet does not take the page down with it, and warns in development.\n\nA `button` is the right host and needs nothing further. On any other element the directive supplies\nthe rest of the button contract — `role`, a tab stop, and Enter/Space activation — so a `div`, a\n`span` or an `a` without `href` is still operable by keyboard rather than silently mouse-only.\n\nA sidebar that can't collapse has nothing for a trigger to do on a wide viewport, so the trigger\nreports itself as disabled there rather than as an open disclosure.","exportAs":"monaSidebarTrigger","kind":"directive","name":"SidebarTriggerDirective","selector":"[monaSidebarTrigger]","inputs":[{"defaultValue":"\"\"","description":"Id of the `mona-sidebar` to toggle. Leave unset to toggle the sidebar this trigger\nis written inside.","name":"for","type":"string"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar","title":"Sidebar"}},{"description":"","kind":"directive","name":"SidebarContentDirective","selector":"[monaSidebarContent]","inputs":[],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar","title":"Sidebar"}},{"description":"A control in the corner of a group header — an add or overflow button. Stands down on the icon\nrail, where there is no header row left to sit in. Give it an `aria-label`: it is icon-only.","kind":"directive","name":"SidebarGroupActionDirective","selector":"button[monaSidebarGroupAction]","inputs":[],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar/menus","title":"Sidebar Menus"}},{"description":"The body of a `monaSidebarGroup`, below its header. Wraps the menu itself.","kind":"directive","name":"SidebarGroupContentDirective","selector":"[monaSidebarGroupContent]","inputs":[],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar/menus","title":"Sidebar Menus"}},{"description":"A titled section of the sidebar, grouping a label and its menu. Stack as many as the sidebar\nneeds; each is an ordinary block, so a `monaSidebarSeparator` between them is optional. A\n`monaSidebarGroupLabel` inside it names the group.","kind":"directive","name":"SidebarGroupDirective","selector":"[monaSidebarGroup]","inputs":[],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar/menus","title":"Sidebar Menus"}},{"description":"The row above a group's content, holding its label and any group action. Collapses to nothing on\nthe icon rail rather than leaving an empty gap where the label used to be.","kind":"directive","name":"SidebarGroupHeaderDirective","selector":"[monaSidebarGroupHeader]","inputs":[],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar/menus","title":"Sidebar Menus"}},{"description":"The name of a group, which the enclosing `monaSidebarGroup` is labelled by. Fades out on the icon\nrail, where there is no width to read it in.","kind":"directive","name":"SidebarGroupLabelDirective","selector":"[monaSidebarGroupLabel]","inputs":[],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar/menus","title":"Sidebar Menus"}},{"description":"A text input sized for the sidebar, composing `monaTextBox`. Stands down on the icon rail,\nwhere there is no room to type.","kind":"directive","name":"SidebarInputDirective","selector":"input[monaSidebarInput]","inputs":[],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar/menus","title":"Sidebar Menus"}},{"description":"A trailing control on a menu item — an overflow menu, a pin. Sits inside the row's highlight and\nstands down on the icon rail. Give it an `aria-label`: it is icon-only.","kind":"directive","name":"SidebarMenuActionDirective","selector":"button[monaSidebarMenuAction]","inputs":[],"methods":[],"outputs":[],"properties":[],"page":{"path":"sidebar/menus","title":"Sidebar Menus"}},{"description":"The default `SidebarStorage`: `localStorage`, under the sidebar's `persistKey`.\n\nReads report `null` anywhere `localStorage` cannot answer, and writes are dropped there. That\ncovers the server, where there is no such thing, and a browser that refuses it — Safari's private\nmode throws on access rather than returning empty, and a full quota throws on write. None of that\nis worth taking an application down over: the sidebar simply opens the way its input says.\n\nA server-rendered application gets the default state in its markup and the remembered one on\nhydration, which shows as a flash. Storage that the server can read too — a cookie, or state\ntransferred from the request — avoids it; supply it through `provideSidebarStorage()`.","kind":"class","name":"LocalStorageSidebarStorage","inputs":[],"methods":[{"description":"","name":"read","signature":"read(key: string): boolean | null"},{"description":"","name":"write","signature":"write(key: string, expanded: boolean): void"}],"outputs":[],"properties":[],"page":{"path":"sidebar/state","title":"Sidebar State & Behavior"}},{"description":"Reads a sidebar from an injection context: the one that encloses the caller, or from elsewhere in a\n`mona-sidebar-layout`, such as a toolbar in the inset, the layout's first sidebar. Name another one with `for`.\n\nReturns the sidebar's state and the commands that are safe to issue from anywhere — opening,\nclosing and toggling, each routed to whichever presentation is current. Structural facts such as\nthe side, variant and collapsible mode are readable but not settable; those are authored as inputs\non `mona-sidebar`, and writing them from a descendant would only desynchronise the two.\n\nIn a layout it follows the sidebar rather than holding it, because the caller may be created first. Until there is\none, it reads as closed and its commands do nothing.","kind":"function","name":"injectSidebar","signature":"function injectSidebar(options: InjectSidebarOptions & { optional: true }): SidebarController | null;\nfunction injectSidebar(options?: InjectSidebarOptions): SidebarController;","page":{"path":"sidebar/state","title":"Sidebar State & Behavior"}},{"description":"Replaces where sidebars remember whether they were left open. The default is `localStorage`, which\nthe server cannot read; supply a cookie- or request-backed storage here to have a server-rendered\napplication render the remembered state rather than correcting it on hydration.","kind":"function","name":"provideSidebarStorage","signature":"function provideSidebarStorage(storage: SidebarStorage | (() => SidebarStorage)): EnvironmentProviders;","page":{"path":"sidebar/state","title":"Sidebar State & Behavior"}},{"description":"","kind":"constant","name":"SIDEBAR_DEFAULT_MESSAGES","signature":"const SIDEBAR_DEFAULT_MESSAGES: MonaSidebarMessages;","page":{"path":"sidebar","title":"Sidebar"}},{"description":"Where sidebars given a `persistKey` remember whether they were left open. Defaults to\n`localStorage`. Replace it with `provideSidebarStorage()` — with something the server can read too,\nfor an application that renders there.","kind":"constant","name":"SIDEBAR_STORAGE","signature":"const SIDEBAR_STORAGE: InjectionToken<SidebarStorage>;","page":{"path":"sidebar/state","title":"Sidebar State & Behavior"}},{"description":"The safe, read-and-command view of one sidebar, returned by `injectSidebar()`.\n\nStructural facts — side, variant, collapsible mode — are readable but not settable. They are\nauthored as inputs on `mona-sidebar`, and letting a descendant write them would leave the service\nand the component disagreeing about the same sidebar, with the component winning on the next\nchange detection pass. Consumers who need them to change should bind the inputs.","extends":[],"kind":"interface","methods":[{"description":"Closes the sidebar. On a compact viewport this closes the drawer instead.","name":"collapse","signature":"collapse(): void"},{"description":"Opens the sidebar. On a compact viewport this opens the drawer instead.","name":"expand","signature":"expand(): void"},{"description":"Flips the sidebar between open and closed, on whichever presentation is current.","name":"toggle","signature":"toggle(): void"}],"name":"SidebarController","properties":[{"description":"How the sidebar behaves when collapsed, as authored on `mona-sidebar`.","name":"collapsible","readonly":true,"type":"Signal<SidebarCollapsibleMode>"},{"description":"Whether the viewport is narrow enough that the sidebar presents as an overlay drawer rather\nthan as a column in the layout.","name":"compact","readonly":true,"type":"Signal<boolean>"},{"description":"Whether the sidebar is showing at full width. On a compact viewport this reports the drawer's\nstate, so a single binding drives both presentations.","name":"expanded","readonly":true,"type":"Signal<boolean>"},{"description":"Whether the sidebar is currently reduced to its icon rail, meaning parts that only make sense\nat full width — labels, trailing actions, submenus — should step aside. Never true while\ncompact, where the drawer always presents at full width.","name":"iconOnly","readonly":true,"type":"Signal<boolean>"},{"description":"Whether the overlay drawer is open. Only meaningful while `compact` is true.","name":"mobileOpen","readonly":true,"type":"Signal<boolean>"},{"description":"Which edge the sidebar sits on, resolved to a direction-relative side.","name":"side","readonly":true,"type":"Signal<SidebarLogicalSide>"},{"description":"The id of the sidebar element, for `aria-controls` on a custom trigger.","name":"sidebarId","readonly":true,"type":"Signal<string>"},{"description":"The expanded state as a string, for `data-state` bindings and styling hooks.","name":"state","readonly":true,"type":"Signal<\"expanded\" | \"collapsed\">"},{"description":"The visual treatment of the sidebar, as authored on `mona-sidebar`.","name":"variant","readonly":true,"type":"Signal<SidebarVariant>"}],"page":{"path":"sidebar/state","title":"Sidebar State & Behavior"},"usedBy":["injectSidebar"]},{"description":"Where a sidebar remembers whether it was left open. Supplied through `SIDEBAR_STORAGE`, and only\never consulted for a sidebar that was given a `persistKey`.\n\nOnly the docked state is ever handed to it. A drawer on a compact viewport is deliberately never\npersisted: restoring one open would cover the page on load, in front of the content the reader\nasked for.","extends":[],"kind":"interface","methods":[{"description":"The remembered state for `key`, or `null` when nothing has been stored under it — including\nwhen this storage cannot answer, such as on the server. A `null` leaves the sidebar on whatever\nits `expanded` input says.","name":"read","signature":"read(key: string): boolean | null"},{"description":"Records the docked state for `key`. Failing to store it must not throw.","name":"write","signature":"write(key: string, expanded: boolean): void"}],"name":"SidebarStorage","properties":[],"page":{"path":"sidebar/state","title":"Sidebar State & Behavior"},"usedBy":["provideSidebarStorage","SIDEBAR_STORAGE"]},{"description":"","extends":[],"kind":"interface","methods":[],"name":"InjectSidebarOptions","properties":[{"description":"Reads the sidebar with this id in the enclosing layout, rather than the nearest one. Needs a layout.","name":"for","optional":true,"readonly":true,"type":"string"},{"description":"Returns `null` instead of throwing when there is no enclosing sidebar or layout.","name":"optional","optional":true,"readonly":true,"type":"boolean"}],"page":{"path":"sidebar/state","title":"Sidebar State & Behavior"},"usedBy":["injectSidebar"]},{"description":"How the sidebar behaves when it is collapsed.\n\n- `offcanvas` — the sidebar collapses to zero width and leaves the layout.\n- `icon` — the sidebar shrinks to a narrow rail that keeps icons visible.\n- `none` — the sidebar cannot be collapsed and stays at its full width.","kind":"type","name":"SidebarCollapsibleMode","signature":"type SidebarCollapsibleMode = \"offcanvas\" | \"icon\" | \"none\";","page":{"path":"sidebar/state","title":"Sidebar State & Behavior"},"usedBy":["SidebarComponent","SidebarController"]},{"description":"The direction-relative side, once the `left`/`right` aliases have been folded in.","kind":"type","name":"SidebarLogicalSide","signature":"type SidebarLogicalSide = \"start\" | \"end\";","page":{"path":"sidebar","title":"Sidebar"},"usedBy":["SidebarController"]},{"description":"How much room the button's leading visual needs.\n\n- `medium` — sized for an icon, which the icon rail insets so it sits centred in the square.\n- `large` — sized for a full-height visual such as an avatar, which fills the rail square edge to\n edge, and which is given a taller row while the sidebar is expanded.","kind":"type","name":"SidebarMenuButtonSize","signature":"type SidebarMenuButtonSize = \"medium\" | \"large\";","page":{"path":"sidebar/menus","title":"Sidebar Menus"},"usedBy":["SidebarMenuButtonDirective"]},{"description":"How far an open drawer's modality reaches.\n- `\"page\"` makes everything outside the drawer inert and locks the page's scroll, and the drawer is `aria-modal`.\n- `\"layout\"` does that within `mona-sidebar-layout` only, for a sidebar embedded in part of a page. What's around the\n layout stays usable, so the drawer isn't `aria-modal`.","kind":"type","name":"SidebarModalScope","signature":"type SidebarModalScope = \"page\" | \"layout\";","page":{"path":"sidebar/state","title":"Sidebar State & Behavior"},"usedBy":["SidebarLayoutComponent"]},{"description":"Which edge of the layout the sidebar sits on. Also determines its order within the layout\nand which side its rail and border are drawn on.\n\n`start` and `end` are the preferred values: they follow the document's writing direction, so a\n`start` sidebar sits on the left in LTR and on the right in RTL without the consumer branching.\n\n`left` and `right` are retained as aliases of `start` and `end`. They were always a poor\ndescription of the behaviour — the layout orders the sidebar with flexbox, which is\ndirection-relative, so `side=\"left\"` already rendered on the right under RTL.","kind":"type","name":"SidebarSide","signature":"type SidebarSide = \"start\" | \"end\" | \"left\" | \"right\";","page":{"path":"sidebar","title":"Sidebar"},"usedBy":["SidebarComponent"]},{"description":"The visual treatment of the sidebar region.\n\n- `sidebar` — flush against the edge of the layout, separated by a single border.\n- `floating` — detached from the edge, with its own rounded, bordered surface.\n- `inset` — the sidebar itself is plain, and the inset region beside it becomes the raised surface.","kind":"type","name":"SidebarVariant","signature":"type SidebarVariant = \"sidebar\" | \"floating\" | \"inset\";","page":{"path":"sidebar","title":"Sidebar"},"usedBy":["SidebarComponent","SidebarController"]}]}
|
package/docs/api/sidebar.md
CHANGED
|
@@ -79,6 +79,7 @@ real labels are not visible either.
|
|
|
79
79
|
|
|
80
80
|
| Name | Type | Default | Description |
|
|
81
81
|
| --- | --- | --- | --- |
|
|
82
|
+
| `class` | `ClassInputType` | `""` | Additional CSS classes merged onto the host element via `tailwind-merge`. Give it the same height and padding as the menu buttons it stands in for when those are restyled, such as `h-7 px-2` for a denser menu, so the rows don't jump when the real ones arrive. |
|
|
82
83
|
| `labelWidth` | `string \| number` | `"60%"` | Width of the label bar. Varying it across a list keeps the placeholder from looking like a rigid grid. Numbers are treated as pixels. |
|
|
83
84
|
| `showIcon` | `boolean` | `true` | Renders a square standing in for the item's icon. |
|
|
84
85
|
|
package/docs/api/switch.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"links":{"SwitchComponent":"switch","SwitchHandleContentTemplateContext":"switch","SwitchHandleContentTemplateDirective":"switch","SwitchOffLabelTemplateDirective":"switch","SwitchOnLabelTemplateDirective":"switch"},"name":"switch","pages":[{"path":"switch","title":"Switch"}],"symbols":[{"description":"","implements":["FormCheckboxControl"],"kind":"component","name":"SwitchComponent","selector":"mona-switch","inputs":[{"alias":"aria-describedby","defaultValue":"\"\"","description":"Id of an element that describes the switch, such as a hint or an error message.","name":"ariaDescribedBy","type":"string"},{"alias":"aria-label","defaultValue":"null","description":"Accessible name for the host element. Describe what the component represents.\nWhen empty, assistive technology announces the role without a label.","name":"ariaLabel","type":"string | null"},{"alias":"aria-labelledby","defaultValue":"null","description":"ID of an external element that provides the accessible name for the host element.","name":"ariaLabelledBy","type":"string | null"},{"defaultValue":"false","description":"Whether the control is checked.","name":"checked","twoWay":true,"type":"boolean"},{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the host element via `tailwind-merge`.","name":"userClass","type":"string"},{"defaultValue":"false","description":"Renders the component with reduced visual emphasis and removes pointer interaction.","name":"disabled","type":"boolean"},{"defaultValue":"false","description":"Marks the switch as invalid. When bound to a signal form field via `[formField]`, this is written by\nthe `FormField` directive.","name":"invalid","type":"boolean"},{"defaultValue":"\"\"","description":"Label displayed inside the switch track when it is in the off state.","name":"offLabel","type":"string"},{"defaultValue":"\"\"","description":"Label displayed inside the switch track when it is in the on state.","name":"onLabel","type":"string"},{"defaultValue":"false","description":"Prevents value changes while the control stays focusable and readable. When bound to a signal form\nfield via `[formField]`, this is written by the `FormField` directive.","name":"readonly","type":"boolean"},{"defaultValue":"false","description":"Marks the switch as required for form validation.","name":"required","type":"boolean"},{"defaultValue":"\"full\"","description":"Border-radius preset applied to the component.","name":"rounded","type":"\"full\" | \"large\" | \"medium\" | \"none\" | \"small\""},{"defaultValue":"\"medium\"","description":"Size preset controlling the component's dimensions.","name":"size","type":"\"large\" | \"medium\" | \"small\""},{"defaultValue":"0","description":"Tab index of the switch while it's enabled.","name":"tabindex","type":"string | number"},{"defaultValue":"false","description":"Marks the switch as touched. When bound to a signal form field via `[formField]`, this is written by\nthe `FormField` directive.","name":"touched","type":"boolean"}],"methods":[{"description":"Moves focus to the switch.","name":"focus","signature":"focus(options?: FocusOptions): void"}],"outputs":[{"description":"Emitted when the switch loses focus or its value changes.","name":"touch","type":"void"}],"properties":[],"page":{"path":"switch","title":"Switch"}},{"description":"","kind":"directive","name":"SwitchHandleContentTemplateDirective","selector":"ng-template[monaSwitchHandleContentTemplate]","templateContext":{"members":[{"description":"","name":"$implicit","type":"boolean"}],"type":"SwitchHandleContentTemplateContext"},"inputs":[],"methods":[],"outputs":[],"properties":[],"page":{"path":"switch","title":"Switch"}},{"description":"","kind":"directive","name":"SwitchOffLabelTemplateDirective","selector":"ng-template[monaSwitchOffLabelTemplate]","inputs":[],"methods":[],"outputs":[],"properties":[],"page":{"path":"switch","title":"Switch"}},{"description":"","kind":"directive","name":"SwitchOnLabelTemplateDirective","selector":"ng-template[monaSwitchOnLabelTemplate]","inputs":[],"methods":[],"outputs":[],"properties":[],"page":{"path":"switch","title":"Switch"}},{"description":"","extends":[],"kind":"interface","methods":[],"name":"SwitchHandleContentTemplateContext","properties":[{"description":"","name":"$implicit","readonly":true,"type":"boolean"}],"page":{"path":"switch","title":"Switch"}}]}
|
|
1
|
+
{"links":{"SwitchComponent":"switch","SwitchHandleContentTemplateContext":"switch","SwitchHandleContentTemplateDirective":"switch","SwitchOffLabelTemplateDirective":"switch","SwitchOnLabelTemplateDirective":"switch"},"name":"switch","pages":[{"path":"switch","title":"Switch"}],"symbols":[{"description":"","implements":["FormCheckboxControl"],"kind":"component","name":"SwitchComponent","selector":"mona-switch","inputs":[{"alias":"aria-describedby","defaultValue":"\"\"","description":"Id of an element that describes the switch, such as a hint or an error message.","name":"ariaDescribedBy","type":"string"},{"alias":"aria-label","defaultValue":"null","description":"Accessible name for the host element. Describe what the component represents.\nWhen empty, assistive technology announces the role without a label.","name":"ariaLabel","type":"string | null"},{"alias":"aria-labelledby","defaultValue":"null","description":"ID of an external element that provides the accessible name for the host element.","name":"ariaLabelledBy","type":"string | null"},{"defaultValue":"false","description":"Whether the control is checked.","name":"checked","twoWay":true,"type":"boolean"},{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the host element via `tailwind-merge`.","name":"userClass","type":"string"},{"defaultValue":"false","description":"Renders the component with reduced visual emphasis and removes pointer interaction.","name":"disabled","type":"boolean"},{"defaultValue":"false","description":"Marks the switch as invalid. When bound to a signal form field via `[formField]`, this is written by\nthe `FormField` directive.","name":"invalid","type":"boolean"},{"defaultValue":"false","description":"Turns the ripple off for this element while ripples are on.","name":"monaRippleDisabled","type":"boolean"},{"defaultValue":"\"\"","description":"Label displayed inside the switch track when it is in the off state.","name":"offLabel","type":"string"},{"defaultValue":"\"\"","description":"Label displayed inside the switch track when it is in the on state.","name":"onLabel","type":"string"},{"defaultValue":"false","description":"Prevents value changes while the control stays focusable and readable. When bound to a signal form\nfield via `[formField]`, this is written by the `FormField` directive.","name":"readonly","type":"boolean"},{"defaultValue":"false","description":"Marks the switch as required for form validation.","name":"required","type":"boolean"},{"defaultValue":"\"full\"","description":"Border-radius preset applied to the component.","name":"rounded","type":"\"full\" | \"large\" | \"medium\" | \"none\" | \"small\""},{"defaultValue":"\"medium\"","description":"Size preset controlling the component's dimensions.","name":"size","type":"\"large\" | \"medium\" | \"small\""},{"defaultValue":"0","description":"Tab index of the switch while it's enabled.","name":"tabindex","type":"string | number"},{"defaultValue":"false","description":"Marks the switch as touched. When bound to a signal form field via `[formField]`, this is written by\nthe `FormField` directive.","name":"touched","type":"boolean"}],"methods":[{"description":"Moves focus to the switch.","name":"focus","signature":"focus(options?: FocusOptions): void"}],"outputs":[{"description":"Emitted when the switch loses focus or its value changes.","name":"touch","type":"void"}],"properties":[],"page":{"path":"switch","title":"Switch"}},{"description":"","kind":"directive","name":"SwitchHandleContentTemplateDirective","selector":"ng-template[monaSwitchHandleContentTemplate]","templateContext":{"members":[{"description":"","name":"$implicit","type":"boolean"}],"type":"SwitchHandleContentTemplateContext"},"inputs":[],"methods":[],"outputs":[],"properties":[],"page":{"path":"switch","title":"Switch"}},{"description":"","kind":"directive","name":"SwitchOffLabelTemplateDirective","selector":"ng-template[monaSwitchOffLabelTemplate]","inputs":[],"methods":[],"outputs":[],"properties":[],"page":{"path":"switch","title":"Switch"}},{"description":"","kind":"directive","name":"SwitchOnLabelTemplateDirective","selector":"ng-template[monaSwitchOnLabelTemplate]","inputs":[],"methods":[],"outputs":[],"properties":[],"page":{"path":"switch","title":"Switch"}},{"description":"","extends":[],"kind":"interface","methods":[],"name":"SwitchHandleContentTemplateContext","properties":[{"description":"","name":"$implicit","readonly":true,"type":"boolean"}],"page":{"path":"switch","title":"Switch"}}]}
|
package/docs/api/switch.md
CHANGED
|
@@ -22,6 +22,7 @@ Component.
|
|
|
22
22
|
| `class` | `string` | `""` | Additional CSS classes merged onto the host element via `tailwind-merge`. |
|
|
23
23
|
| `disabled` | `boolean` | `false` | Renders the component with reduced visual emphasis and removes pointer interaction. |
|
|
24
24
|
| `invalid` | `boolean` | `false` | Marks the switch as invalid. When bound to a signal form field via `[formField]`, this is written by the `FormField` directive. |
|
|
25
|
+
| `monaRippleDisabled` | `boolean` | `false` | Turns the ripple off for this element while ripples are on. |
|
|
25
26
|
| `offLabel` | `string` | `""` | Label displayed inside the switch track when it is in the off state. |
|
|
26
27
|
| `onLabel` | `string` | `""` | Label displayed inside the switch track when it is in the on state. |
|
|
27
28
|
| `readonly` | `boolean` | `false` | Prevents value changes while the control stays focusable and readable. When bound to a signal form field via `[formField]`, this is written by the `FormField` directive. |
|
package/docs/grid-rows.md
CHANGED
|
@@ -14,6 +14,7 @@ A `monaGridDetailTemplate` gives each row an expandable detail row underneath, f
|
|
|
14
14
|
| :--- | :--- | :--- |
|
|
15
15
|
| Detail rows | `monaGridDetailTemplate` inside `mona-grid` | `[(expandedKeys)]` on the grid |
|
|
16
16
|
| Row reordering | `monaGridRowReorderable` | `rowReorder` with the reordered data |
|
|
17
|
+
| Row activation | A double-click on a data row, or `Enter` on one of its cells | `rowActivate` on the grid |
|
|
17
18
|
| Row classes | `rowClass` on the grid | — |
|
|
18
19
|
| Row height | Cell templates and editors | — |
|
|
19
20
|
|
|
@@ -136,6 +137,29 @@ protected readonly productLabel = (row: Record<PropertyKey, unknown>): string =>
|
|
|
136
137
|
|
|
137
138
|
A row that can't move shows a disabled handle.
|
|
138
139
|
|
|
140
|
+
### Opening Rows
|
|
141
|
+
|
|
142
|
+
`rowActivate` reports a data row the user opens, the way a file list opens an item: a double-click on the row, or `Enter` on one of its cells. It carries the row's item from `data` as `rowData`, the same object, and the double-click or key press as `originalEvent`, so a modified one such as `Alt+Enter` can do something else.
|
|
143
|
+
|
|
144
|
+
```html
|
|
145
|
+
<mona-grid aria-label="Files" rowKey="path" [data]="files()" (rowActivate)="onRowActivate($event)">
|
|
146
|
+
<mona-grid-column field="name" title="Name"></mona-grid-column>
|
|
147
|
+
<mona-grid-column field="modified" title="Date modified" type="date"></mona-grid-column>
|
|
148
|
+
</mona-grid>
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
protected onRowActivate(event: GridRowActivateEvent<FileEntry>): void {
|
|
153
|
+
if (event.originalEvent instanceof KeyboardEvent && event.originalEvent.altKey) {
|
|
154
|
+
this.showProperties(event.rowData);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
this.open(event.rowData);
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Import `type GridRowActivateEvent` from `@nanahoshi/mona-ui/grid`. The grid reports every activation without a directive, with `monaGridVirtualScroll` too; which keys and clicks count is under [Row activation](#row-activation).
|
|
162
|
+
|
|
139
163
|
### Row Classes
|
|
140
164
|
|
|
141
165
|
`rowClass` returns classes for each data row from its item, such as a muted row for a cancelled order:
|
|
@@ -184,6 +208,17 @@ Import `GridCellTemplateDirective` from `@nanahoshi/mona-ui/grid` and `AvatarCom
|
|
|
184
208
|
|
|
185
209
|
The detail toggle sits in its own column at the start of the grid. `expandedKeys` holds the `rowKey` values of the expanded rows, or the data items when the grid has no `rowKey`; `expandedKeysChange` reports the rows people open and close. Detail rows aren't supported with `monaGridVirtualScroll`, whose rows share one height: the grid ignores the template there and warns in development mode. While detail rows exist, `aria-rowcount` is `-1`, since the grid can't know how many rows the details add.
|
|
186
210
|
|
|
211
|
+
### Row activation
|
|
212
|
+
|
|
213
|
+
Only data rows activate: header, group, group footer, add and detail rows don't. `Enter` keeps every meaning it already had, and activates the row only from a cell where it has none:
|
|
214
|
+
|
|
215
|
+
1. On the detail toggle, it opens or closes the detail row.
|
|
216
|
+
2. On an editable cell, it starts the edit, and with row editing (`mode: "row"`) so does any data cell. In cell mode a double-click on an editable cell edits it too, and doesn't activate the row even when the `edit` event is prevented.
|
|
217
|
+
3. On a cell with controls, such as a button in a cell template, it moves into them.
|
|
218
|
+
4. On any other cell of the row, it activates the row.
|
|
219
|
+
|
|
220
|
+
A double-click on a control inside a cell (a button, link, field, label or editable text) is the control's, and so is one whose default a handler already prevented, such as `(dblclick)="$event.preventDefault()"` in a cell template. Nothing activates while an edit is open. A double-click starts with two clicks, so with `monaGridSelectable` and `selectOnRowClick` the row is selected as usual, then activated.
|
|
221
|
+
|
|
187
222
|
### Row reordering
|
|
188
223
|
|
|
189
224
|
The handle sits in a column of its own, the first in the grid, and rows move only by that handle. The consumer owns the order: `rowReorder` carries the complete reordered data, and the grid never changes `data`. Row order is application data and isn't stored in `GridState`.
|
|
@@ -199,6 +234,7 @@ A row's handle is a button named after the row (`reorderRow`, or `rowAriaLabel`)
|
|
|
199
234
|
| Key | Action |
|
|
200
235
|
| --- | --- |
|
|
201
236
|
| `Enter` / `Alt+ArrowDown` | On a row's detail toggle cell, expands or collapses its detail row. |
|
|
237
|
+
| `Enter` | On any other cell of a data row where it doesn't edit or move into the cell's controls, activates the row (`rowActivate`). |
|
|
202
238
|
| `Alt+ArrowUp` / `Alt+ArrowDown` | On a reorder handle, moves the row up/down one place. Focus stays on the handle, so the row can keep moving. |
|
|
203
239
|
|
|
204
240
|
The rest of the grid's keys are on [Grid Overview](grid.md#keyboard).
|
package/docs/grid-server.md
CHANGED
|
@@ -246,6 +246,12 @@ While `loading` is true, the body shows a localized loading indicator, keeps the
|
|
|
246
246
|
|
|
247
247
|
`height` in the options defaults to **36px** and must be finite and greater than zero. It sets the rendered height and the virtual item size of every row, group header and group footer, and templates taller than it are clipped. Variable-height virtualization isn't provided. Ordinary rows, by contrast, fit their content, see [Rows](grid-rows.md#rows-that-fit-their-content).
|
|
248
248
|
|
|
249
|
+
### Large data in virtual scrolling
|
|
250
|
+
|
|
251
|
+
The grid draws the rows in view and four to eight more on each side, and moves the same row elements to the rows scrolled to instead of building new ones. It measures the viewport again whenever the grid is resized.
|
|
252
|
+
|
|
253
|
+
Data that keeps the items it had and adds more after them, such as `[...files(), ...nextBatch]` after `scrollEnd`, keeps its rows: the grid only reads the new items, so a batch costs about the same however many rows are already loaded. An item keeps its row while it's the same object with the same `rowKey` value, so to change an item that's already loaded in the same update, give a new object for it. Data that removes, reorders or replaces items, or gives the same items again, is read again in full.
|
|
254
|
+
|
|
249
255
|
### Features with virtual scrolling
|
|
250
256
|
|
|
251
257
|
While virtual scrolling is on, the grid shows no pager and no aggregate footer, and ignores detail rows. Selection's `selectAllScope: "page"` covers the whole view, since there are no pages. `Ctrl+End` scrolls to the last row before moving focus there.
|
package/docs/grid.md
CHANGED
|
@@ -224,7 +224,7 @@ Grid styling is implemented with Tailwind utility classes internally; there are
|
|
|
224
224
|
|
|
225
225
|
### Events come from the feature directives
|
|
226
226
|
|
|
227
|
-
`mona-grid` reports only paging (`pageChange`, `skipChange`, `pageSizeChange`)
|
|
227
|
+
`mona-grid` reports only paging (`pageChange`, `skipChange`, `pageSizeChange`), detail rows (`expandedKeysChange`) and row activation (`rowActivate`, see [Rows](grid-rows.md#row-activation)). Every other event comes from the directive that turns its feature on: `columnSort`, `columnResize`, `columnReorder`, `groupChange`, `selectedKeysChange`, `rowReorder`, `cellEdit`, `rowEdit`, `save`, `remove`, `cancel`, `add`, `edit`, `dataStateChange` and `scrollEnd`.
|
|
228
228
|
|
|
229
229
|
### Cancelable events
|
|
230
230
|
|
|
@@ -249,7 +249,7 @@ The grid is one Tab stop. `Tab` moves into the grid at the cell that last had fo
|
|
|
249
249
|
| `Home` / `End` | Move to the first/last cell in the row. |
|
|
250
250
|
| `Ctrl+Home` / `Ctrl+End` (`Cmd` too) | Move to the first/last cell in the grid. With virtual scrolling, the grid scrolls to the last row first. |
|
|
251
251
|
| `PageUp` / `PageDown` | Move up/down by the number of rows that fit in the body. |
|
|
252
|
-
| `Enter` | On a header, sorts the column. On a group row or the detail toggle, expands or collapses it. On an editable cell, starts editing. On any other cell,
|
|
252
|
+
| `Enter` | On a header, sorts the column. On a group row or the detail toggle, expands or collapses it. On an editable cell, starts editing, and with row editing so does any data cell. On a cell with controls, moves into them. On any other cell of a data row, activates the row (`rowActivate`). |
|
|
253
253
|
| `F2` | Starts editing an editable cell; on any other cell, including a header or a filter-row cell, moves into its controls (links, buttons, the filter button, the filter input). |
|
|
254
254
|
| `Ctrl+C` / `Cmd+C` | Copies the focused cell's text (body rows, not while editing, and not when text is selected). |
|
|
255
255
|
| `Tab` / `Shift+Tab` | Leaves the grid. While editing a cell, commits it and edits the next/previous editable cell. |
|
|
@@ -305,6 +305,7 @@ Everything below is imported from `@nanahoshi/mona-ui/grid`. Each name links to
|
|
|
305
305
|
| [`GridToolbarContext`](api/grid.md#gridtoolbarcontext) | Interface | The grid state and actions a toolbar template can use. |
|
|
306
306
|
| [`Column`](api/grid.md#column) | Interface | Set `locked` and `lockedPosition` on a `mona-grid-column` (or `mona-grid-command-column`) to keep it fixed while the grid scrolls horizontally. |
|
|
307
307
|
| [`ColumnConfig`](api/grid.md#columnconfig) | Interface | |
|
|
308
|
+
| [`GridRowActivateEvent`](api/grid.md#gridrowactivateevent) | Interface | Emitted when the user activates a data row, the way a file list opens an item. |
|
|
308
309
|
| [`GridToolbarTemplateContext`](api/grid.md#gridtoolbartemplatecontext) | Interface | Context of `monaGridToolbarTemplate`: the toolbar state, also as `$implicit`. |
|
|
309
310
|
| [`ColumnFormat`](api/grid.md#columnformat) | Type alias | A date format string, for `date` columns, or a formatter function, for any column. |
|
|
310
311
|
| [`ColumnFormatFunction`](api/grid.md#columnformatfunction) | Type alias | Formats a cell's value for display. |
|