@nanahoshi/mona-ui 0.25.1 → 0.26.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/README.md +2 -0
- package/command/package.json +4 -0
- package/docs/auto-complete.md +733 -0
- package/docs/avatar.md +220 -0
- package/docs/breadcrumb.md +320 -0
- package/docs/button-group.md +392 -0
- package/docs/button.md +256 -0
- package/docs/calendar.md +515 -0
- package/docs/card.md +292 -0
- package/docs/chart.md +4058 -0
- package/docs/checkbox.md +374 -0
- package/docs/chip.md +339 -0
- package/docs/circular-progress-bar.md +287 -0
- package/docs/collapsible.md +308 -0
- package/docs/color-gradient.md +336 -0
- package/docs/color-palette.md +317 -0
- package/docs/color-picker.md +387 -0
- package/docs/combo-box.md +764 -0
- package/docs/command.md +582 -0
- package/docs/contextmenu.md +530 -0
- package/docs/date-picker.md +251 -0
- package/docs/datetime-picker.md +284 -0
- package/docs/decimal-textbox.md +260 -0
- package/docs/dialog.md +822 -0
- package/docs/dropdown-button.md +507 -0
- package/docs/dropdown-list.md +779 -0
- package/docs/editor.md +374 -0
- package/docs/expansion-panel.md +348 -0
- package/docs/fieldset.md +217 -0
- package/docs/forms.md +162 -0
- package/docs/grid.md +2053 -0
- package/docs/input.md +197 -0
- package/docs/installation.md +54 -0
- package/docs/introduction.md +46 -0
- package/docs/label.md +340 -0
- package/docs/list-box.md +637 -0
- package/docs/list-view.md +584 -0
- package/docs/menubar.md +559 -0
- package/docs/multi-select.md +765 -0
- package/docs/notification.md +460 -0
- package/docs/numeric-textbox.md +301 -0
- package/docs/otp-input.md +539 -0
- package/docs/pager.md +513 -0
- package/docs/placeholder.md +176 -0
- package/docs/popover.md +423 -0
- package/docs/popup-menu.md +658 -0
- package/docs/popup.md +617 -0
- package/docs/progress-bar.md +368 -0
- package/docs/radio-button.md +451 -0
- package/docs/range-slider.md +367 -0
- package/docs/rating.md +518 -0
- package/docs/scroll-view.md +375 -0
- package/docs/segmented.md +434 -0
- package/docs/sheet.md +348 -0
- package/docs/sidebar.md +1126 -0
- package/docs/skeleton.md +181 -0
- package/docs/slider.md +423 -0
- package/docs/spinner.md +370 -0
- package/docs/split-button.md +522 -0
- package/docs/splitter.md +342 -0
- package/docs/stepper.md +539 -0
- package/docs/switch.md +340 -0
- package/docs/tabs.md +542 -0
- package/docs/textarea.md +196 -0
- package/docs/textbox.md +332 -0
- package/docs/theming.md +403 -0
- package/docs/time-picker.md +254 -0
- package/docs/tooltip-directive.md +340 -0
- package/docs/tooltip.md +321 -0
- package/docs/tree-view.md +1018 -0
- package/docs/window.md +663 -0
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +8 -0
- package/fesm2022/nanahoshi-mona-ui-button.mjs +12 -0
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +5 -2
- package/fesm2022/nanahoshi-mona-ui-chart.mjs +86 -0
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +4 -0
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +4 -0
- package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +16 -2
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-command.mjs +924 -0
- package/fesm2022/nanahoshi-mona-ui-common.mjs +4 -0
- package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +10 -6
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +2 -1
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +2 -1
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +9 -5
- package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +9 -5
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +55 -1
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +3 -2
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +13 -0
- package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +5 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-2tVhD2hK.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-DjNnVxHE.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-BAN70Wcn.mjs → nanahoshi-mona-ui-grid-grid-list.component-ihQIKeP-.mjs} +5 -5
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-C_kCaA5b.mjs → nanahoshi-mona-ui-grid-grid-row.component-BpnybNcs.mjs} +18 -35
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-BsNfrAHz.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-CYlgfc7c.mjs} +5 -5
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-CEfVa7eo.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-LCzfCYd3.mjs} +4653 -4529
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +1 -0
- package/fesm2022/nanahoshi-mona-ui-internal-popup-menu.mjs +168 -0
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +19 -1
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +14 -0
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +32 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +15 -8
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +8 -5
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +9 -0
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +5 -0
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +2 -1
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +14 -6
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +48 -183
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +16 -0
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +4 -0
- package/fesm2022/nanahoshi-mona-ui-rating.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-segmented.mjs +1 -0
- package/fesm2022/nanahoshi-mona-ui-sheet.mjs +5 -5
- package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +7 -2
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +9 -6
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +18 -21
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +11 -8
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +9 -1
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +2 -1
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +16 -5
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +13 -11
- package/fesm2022/nanahoshi-mona-ui-window.mjs +12 -5
- package/i18n/catalogs/en-US.messages.json +10 -0
- package/internal/popup-menu/package.json +4 -0
- package/llms.txt +123 -0
- package/locales/ar-sa/ar-sa.messages.json +10 -0
- package/locales/de-de/de-de.messages.json +10 -0
- package/locales/es-es/es-es.messages.json +10 -0
- package/locales/fr-fr/fr-fr.messages.json +10 -0
- package/locales/id-id/id-id.messages.json +10 -0
- package/locales/it-it/it-it.messages.json +10 -0
- package/locales/ja-jp/ja-jp.messages.json +10 -0
- package/locales/ko-kr/ko-kr.messages.json +10 -0
- package/locales/pt-br/pt-br.messages.json +10 -0
- package/locales/ru-ru/ru-ru.messages.json +10 -0
- package/locales/tr-tr/tr-tr.messages.json +10 -0
- package/locales/zh-cn/zh-cn.messages.json +10 -0
- package/locales/zh-tw/zh-tw.messages.json +10 -0
- package/package.json +9 -1
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +1 -1
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +8 -0
- package/types/nanahoshi-mona-ui-button.d.ts +12 -0
- package/types/nanahoshi-mona-ui-calendar.d.ts +3 -0
- package/types/nanahoshi-mona-ui-chart.d.ts +200 -0
- package/types/nanahoshi-mona-ui-check-box.d.ts +4 -0
- package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +4 -0
- package/types/nanahoshi-mona-ui-collapsible.d.ts +10 -0
- package/types/nanahoshi-mona-ui-combo-box.d.ts +1 -1
- package/types/nanahoshi-mona-ui-command.d.ts +253 -0
- package/types/nanahoshi-mona-ui-common.d.ts +17 -1
- package/types/nanahoshi-mona-ui-contextmenu.d.ts +5 -2
- package/types/nanahoshi-mona-ui-date-picker.d.ts +2 -1
- package/types/nanahoshi-mona-ui-datetime-picker.d.ts +2 -1
- package/types/nanahoshi-mona-ui-dialog.d.ts +58 -1
- package/types/nanahoshi-mona-ui-dropdown-button.d.ts +7 -3
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +55 -1
- package/types/nanahoshi-mona-ui-editor.d.ts +31 -0
- package/types/nanahoshi-mona-ui-expansion-panel.d.ts +13 -0
- package/types/nanahoshi-mona-ui-fieldset.d.ts +5 -0
- package/types/nanahoshi-mona-ui-grid.d.ts +162 -35
- package/types/nanahoshi-mona-ui-i18n.d.ts +144 -1
- package/types/nanahoshi-mona-ui-internal-list.d.ts +16 -1
- package/types/nanahoshi-mona-ui-internal-popup-menu.d.ts +165 -0
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +21 -2
- package/types/nanahoshi-mona-ui-internal.d.ts +4 -5
- package/types/nanahoshi-mona-ui-label.d.ts +1 -0
- package/types/nanahoshi-mona-ui-list-box.d.ts +27 -4
- package/types/nanahoshi-mona-ui-list-view.d.ts +34 -1
- package/types/nanahoshi-mona-ui-list.d.ts +1 -1
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +10 -0
- package/types/nanahoshi-mona-ui-menubar.d.ts +10 -3
- package/types/nanahoshi-mona-ui-multi-select.d.ts +3 -3
- package/types/nanahoshi-mona-ui-notification.d.ts +9 -0
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +1 -1
- package/types/nanahoshi-mona-ui-otp-input.d.ts +1 -0
- package/types/nanahoshi-mona-ui-pager.d.ts +5 -1
- package/types/nanahoshi-mona-ui-popover.d.ts +9 -1
- package/types/nanahoshi-mona-ui-popup-menu.d.ts +48 -161
- package/types/nanahoshi-mona-ui-popup.d.ts +16 -0
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +4 -0
- package/types/nanahoshi-mona-ui-rating.d.ts +2 -0
- package/types/nanahoshi-mona-ui-segmented.d.ts +1 -0
- package/types/nanahoshi-mona-ui-sheet.d.ts +1 -1
- package/types/nanahoshi-mona-ui-slider.d.ts +2 -0
- package/types/nanahoshi-mona-ui-spinner.d.ts +7 -0
- package/types/nanahoshi-mona-ui-split-button.d.ts +7 -4
- package/types/nanahoshi-mona-ui-stepper.d.ts +11 -2
- package/types/nanahoshi-mona-ui-tabs.d.ts +4 -1
- package/types/nanahoshi-mona-ui-text-box.d.ts +9 -1
- package/types/nanahoshi-mona-ui-time-picker.d.ts +2 -1
- package/types/nanahoshi-mona-ui-tooltip.d.ts +10 -2
- package/types/nanahoshi-mona-ui-tree-view.d.ts +6 -5
- package/types/nanahoshi-mona-ui-window.d.ts +66 -1
package/docs/card.md
ADDED
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
# Card
|
|
2
|
+
|
|
3
|
+
> Groups related content and actions on one raised surface.
|
|
4
|
+
|
|
5
|
+
Entry point: `@nanahoshi/mona-ui/card`
|
|
6
|
+
|
|
7
|
+
A card groups related content and actions on one raised surface, with an optional header and footer. Its regions take their corners from the card, so they stay inside its rounded edge.
|
|
8
|
+
|
|
9
|
+
Use it for self-contained content such as a login form or a summary. For a section that opens and closes, use the expansion panel.
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
**Use Card when:**
|
|
14
|
+
|
|
15
|
+
- Related content and its actions belong on one raised surface, such as a login form or a summary.
|
|
16
|
+
- The content needs a header with a title, a description and actions, or a footer.
|
|
17
|
+
|
|
18
|
+
**Use something else when:**
|
|
19
|
+
|
|
20
|
+
- The section opens and closes: use Expansion Panel.
|
|
21
|
+
- You are grouping form controls under a label: use Fieldset, which renders a native `<fieldset>` and `<legend>`.
|
|
22
|
+
|
|
23
|
+
## Import & Quick Start
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
import { Component } from "@angular/core";
|
|
27
|
+
import { ButtonDirective } from "@nanahoshi/mona-ui/button";
|
|
28
|
+
import {
|
|
29
|
+
CardActionDirective,
|
|
30
|
+
CardComponent,
|
|
31
|
+
CardContentDirective,
|
|
32
|
+
CardDescriptionDirective,
|
|
33
|
+
CardFooterComponent,
|
|
34
|
+
CardHeaderComponent,
|
|
35
|
+
CardTitleDirective
|
|
36
|
+
} from "@nanahoshi/mona-ui/card";
|
|
37
|
+
|
|
38
|
+
@Component({
|
|
39
|
+
selector: "app-account-card",
|
|
40
|
+
imports: [
|
|
41
|
+
ButtonDirective,
|
|
42
|
+
CardActionDirective,
|
|
43
|
+
CardComponent,
|
|
44
|
+
CardContentDirective,
|
|
45
|
+
CardDescriptionDirective,
|
|
46
|
+
CardFooterComponent,
|
|
47
|
+
CardHeaderComponent,
|
|
48
|
+
CardTitleDirective
|
|
49
|
+
],
|
|
50
|
+
templateUrl: "./account-card.component.html"
|
|
51
|
+
})
|
|
52
|
+
export class AccountCardComponent {}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
```html
|
|
56
|
+
<mona-card role="region">
|
|
57
|
+
<mona-card-header>
|
|
58
|
+
<h3 *monaCardTitle>Your account</h3>
|
|
59
|
+
<p *monaCardDescription>Signed in on two devices.</p>
|
|
60
|
+
<button monaButton look="link" size="small" *monaCardAction>Manage</button>
|
|
61
|
+
</mona-card-header>
|
|
62
|
+
|
|
63
|
+
<div *monaCardContent>The card's content.</div>
|
|
64
|
+
|
|
65
|
+
<mona-card-footer>
|
|
66
|
+
<button monaButton>Sign out</button>
|
|
67
|
+
</mona-card-footer>
|
|
68
|
+
</mona-card>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Everything is optional except the content, which only shows if it's on `monaCardContent`. Text placed directly in `<mona-card>` isn't rendered.
|
|
72
|
+
|
|
73
|
+
The header and footer can be written in any order, because the card always renders header, content, then footer.
|
|
74
|
+
|
|
75
|
+
## Examples
|
|
76
|
+
|
|
77
|
+
### Article
|
|
78
|
+
|
|
79
|
+
A self-contained item takes `role="article"`, and its title names it.
|
|
80
|
+
|
|
81
|
+
`article-example.component.ts`
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
import { Component } from "@angular/core";
|
|
85
|
+
import { ButtonDirective } from "@nanahoshi/mona-ui/button";
|
|
86
|
+
import {
|
|
87
|
+
CardActionDirective,
|
|
88
|
+
CardComponent,
|
|
89
|
+
CardContentDirective,
|
|
90
|
+
CardDescriptionDirective,
|
|
91
|
+
CardFooterComponent,
|
|
92
|
+
CardHeaderComponent,
|
|
93
|
+
CardTitleDirective
|
|
94
|
+
} from "@nanahoshi/mona-ui/card";
|
|
95
|
+
|
|
96
|
+
@Component({
|
|
97
|
+
selector: "app-card-article-example",
|
|
98
|
+
imports: [
|
|
99
|
+
ButtonDirective,
|
|
100
|
+
CardActionDirective,
|
|
101
|
+
CardComponent,
|
|
102
|
+
CardContentDirective,
|
|
103
|
+
CardDescriptionDirective,
|
|
104
|
+
CardFooterComponent,
|
|
105
|
+
CardHeaderComponent,
|
|
106
|
+
CardTitleDirective
|
|
107
|
+
],
|
|
108
|
+
templateUrl: "./article-example.component.html"
|
|
109
|
+
})
|
|
110
|
+
export class CardArticleExampleComponent {}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
`article-example.component.html`
|
|
114
|
+
|
|
115
|
+
```html
|
|
116
|
+
<mona-card class="max-w-sm" role="article">
|
|
117
|
+
<mona-card-header>
|
|
118
|
+
<h3 *monaCardTitle class="font-semibold">Release 4.2</h3>
|
|
119
|
+
<p *monaCardDescription class="text-sm">Published on 3 November</p>
|
|
120
|
+
<button *monaCardAction monaButton look="link" size="small" type="button">Share</button>
|
|
121
|
+
</mona-card-header>
|
|
122
|
+
|
|
123
|
+
<p *monaCardContent class="px-4 text-sm">
|
|
124
|
+
This release adds a dark theme, faster search and keyboard shortcuts for the editor.
|
|
125
|
+
</p>
|
|
126
|
+
|
|
127
|
+
<mona-card-footer class="flex justify-end gap-2">
|
|
128
|
+
<button monaButton size="small" type="button">Dismiss</button>
|
|
129
|
+
<button monaButton look="primary" size="small" type="button">Read the notes</button>
|
|
130
|
+
</mona-card-footer>
|
|
131
|
+
</mona-card>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Form in a card
|
|
135
|
+
|
|
136
|
+
`form-example.component.ts`
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
import { Component, signal } from "@angular/core";
|
|
140
|
+
import { ButtonDirective } from "@nanahoshi/mona-ui/button";
|
|
141
|
+
import {
|
|
142
|
+
CardComponent,
|
|
143
|
+
CardContentDirective,
|
|
144
|
+
CardDescriptionDirective,
|
|
145
|
+
CardFooterComponent,
|
|
146
|
+
CardHeaderComponent,
|
|
147
|
+
CardTitleDirective
|
|
148
|
+
} from "@nanahoshi/mona-ui/card";
|
|
149
|
+
import { LabelComponent } from "@nanahoshi/mona-ui/label";
|
|
150
|
+
import { TextBoxComponent } from "@nanahoshi/mona-ui/text-box";
|
|
151
|
+
|
|
152
|
+
@Component({
|
|
153
|
+
selector: "app-card-form-example",
|
|
154
|
+
imports: [
|
|
155
|
+
ButtonDirective,
|
|
156
|
+
CardComponent,
|
|
157
|
+
CardContentDirective,
|
|
158
|
+
CardDescriptionDirective,
|
|
159
|
+
CardFooterComponent,
|
|
160
|
+
CardHeaderComponent,
|
|
161
|
+
CardTitleDirective,
|
|
162
|
+
LabelComponent,
|
|
163
|
+
TextBoxComponent
|
|
164
|
+
],
|
|
165
|
+
templateUrl: "./form-example.component.html"
|
|
166
|
+
})
|
|
167
|
+
export class CardFormExampleComponent {
|
|
168
|
+
protected readonly email = signal("");
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
`form-example.component.html`
|
|
173
|
+
|
|
174
|
+
```html
|
|
175
|
+
<mona-card class="max-w-sm">
|
|
176
|
+
<mona-card-header>
|
|
177
|
+
<h3 *monaCardTitle class="font-semibold">Invite a teammate</h3>
|
|
178
|
+
<p *monaCardDescription class="text-sm">They'll get an email with a link to join.</p>
|
|
179
|
+
</mona-card-header>
|
|
180
|
+
|
|
181
|
+
<div *monaCardContent class="flex flex-col gap-2 px-4">
|
|
182
|
+
<mona-label for="card-invite-email">Email</mona-label>
|
|
183
|
+
<mona-text-box inputId="card-invite-email" placeholder="name@example.com" type="email" [(value)]="email" />
|
|
184
|
+
</div>
|
|
185
|
+
|
|
186
|
+
<mona-card-footer class="flex justify-end gap-2">
|
|
187
|
+
<button monaButton size="small" type="button" (click)="email.set('')">Cancel</button>
|
|
188
|
+
<button monaButton look="primary" size="small" type="button" [disabled]="!email()">Send invite</button>
|
|
189
|
+
</mona-card-footer>
|
|
190
|
+
</mona-card>
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Appearance & Styling
|
|
194
|
+
|
|
195
|
+
`rounded` sets the corners of the card and of its header and footer. `class` on `<mona-card>`, `<mona-card-header>` and `<mona-card-footer>` is merged through `tailwind-merge`.
|
|
196
|
+
|
|
197
|
+
A card's colors come from `--color-card` and `--color-card-foreground`, and its shadow from `--shadow-raised`, so a theme can change all three.
|
|
198
|
+
|
|
199
|
+
## Accessibility
|
|
200
|
+
|
|
201
|
+
- **Name:** a card with a title takes `role` (`group` by default) and is named by the title, with the description as its `aria-describedby`. Use `article` for self-contained content, or `region` for a landmark.
|
|
202
|
+
- **No title, no role:** a name only counts on an element with a role, so a card without a title has none. If it needs a name, give it a title.
|
|
203
|
+
- **`let id`:** the title and description templates receive an id, as in `*monaCardTitle="let id"`. The card doesn't need it for its name, so use it only if something else has to refer to that element.
|
|
204
|
+
- **Headings:** `monaCardTitle` doesn't make a heading for you. Use the level that fits the page, as the `h3` above does.
|
|
205
|
+
- **Actions:** the actions are in a group named by the `card.actionsLabel` message, "Card actions" in English. Each action still needs its own name.
|
|
206
|
+
- **Keyboard:** a card isn't interactive and takes no focus. Only what you put in it does.
|
|
207
|
+
|
|
208
|
+
## API
|
|
209
|
+
|
|
210
|
+
Everything below is imported from `@nanahoshi/mona-ui/card`.
|
|
211
|
+
|
|
212
|
+
### `CardComponent`
|
|
213
|
+
|
|
214
|
+
**Selector:** `mona-card`
|
|
215
|
+
|
|
216
|
+
#### Inputs
|
|
217
|
+
|
|
218
|
+
| Name | Type | Default | Description |
|
|
219
|
+
| --- | --- | --- | --- |
|
|
220
|
+
| `class` | `string` | `""` | Additional CSS classes merged onto the host element via `tailwind-merge`. |
|
|
221
|
+
| `role` | `"article" \| "group" \| "region"` | `"group"` | The role the card takes when it has a title, which then names it. Use `article` for self-contained content or `region` for a landmark. |
|
|
222
|
+
| `rounded` | `"large" \| "medium" \| "none" \| "small" \| "xlarge" \| "xxlarge"` | `"medium"` | Controls the border radius applied to the card and its header/footer regions. |
|
|
223
|
+
|
|
224
|
+
### `CardFooterComponent`
|
|
225
|
+
|
|
226
|
+
**Selector:** `mona-card-footer`
|
|
227
|
+
|
|
228
|
+
#### Inputs
|
|
229
|
+
|
|
230
|
+
| Name | Type | Default | Description |
|
|
231
|
+
| --- | --- | --- | --- |
|
|
232
|
+
| `class` | `ClassInputType` | `""` | Additional CSS classes merged onto the rendered footer element via `tailwind-merge`. |
|
|
233
|
+
|
|
234
|
+
### `CardHeaderComponent`
|
|
235
|
+
|
|
236
|
+
**Selector:** `mona-card-header`
|
|
237
|
+
|
|
238
|
+
#### Inputs
|
|
239
|
+
|
|
240
|
+
| Name | Type | Default | Description |
|
|
241
|
+
| --- | --- | --- | --- |
|
|
242
|
+
| `class` | `ClassInputType` | `""` | Additional CSS classes merged onto the rendered header element via `tailwind-merge`. |
|
|
243
|
+
|
|
244
|
+
### `CardActionDirective`
|
|
245
|
+
|
|
246
|
+
**Selector:** `ng-template[monaCardAction]`
|
|
247
|
+
|
|
248
|
+
### `CardContentDirective`
|
|
249
|
+
|
|
250
|
+
**Selector:** `ng-template[monaCardContent]`
|
|
251
|
+
|
|
252
|
+
### `CardDescriptionDirective`
|
|
253
|
+
|
|
254
|
+
**Selector:** `ng-template[monaCardDescription]`
|
|
255
|
+
|
|
256
|
+
#### Template context
|
|
257
|
+
|
|
258
|
+
| Name | Type | Description |
|
|
259
|
+
| --- | --- | --- |
|
|
260
|
+
| `$implicit` | `string` | An id for the element in the template, if something needs to refer to it. The card doesn't need it for its name. |
|
|
261
|
+
|
|
262
|
+
### `CardTitleDirective`
|
|
263
|
+
|
|
264
|
+
**Selector:** `ng-template[monaCardTitle]`
|
|
265
|
+
|
|
266
|
+
#### Template context
|
|
267
|
+
|
|
268
|
+
| Name | Type | Description |
|
|
269
|
+
| --- | --- | --- |
|
|
270
|
+
| `$implicit` | `string` | An id for the element in the template, if something needs to refer to it. The card doesn't need it for its name. |
|
|
271
|
+
|
|
272
|
+
### Types
|
|
273
|
+
|
|
274
|
+
#### `CARD_DEFAULT_MESSAGES`
|
|
275
|
+
|
|
276
|
+
```typescript
|
|
277
|
+
const CARD_DEFAULT_MESSAGES: { actionsLabel: string; };
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
#### `CardTemplateContext`
|
|
281
|
+
|
|
282
|
+
| Name | Type | Description |
|
|
283
|
+
| --- | --- | --- |
|
|
284
|
+
| `$implicit` (read-only) | `string` | An id for the element in the template, if something needs to refer to it. The card doesn't need it for its name. |
|
|
285
|
+
|
|
286
|
+
#### `ClassInputType`
|
|
287
|
+
|
|
288
|
+
From `@nanahoshi/mona-ui/common`.
|
|
289
|
+
|
|
290
|
+
```typescript
|
|
291
|
+
type ClassInputType = string | string[] | Record<string, unknown> | null | undefined;
|
|
292
|
+
```
|