@nanahoshi/mona-ui 0.41.0 → 0.43.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.
Files changed (154) hide show
  1. package/README.md +2 -0
  2. package/docs/api/alert.json +1 -0
  3. package/docs/api/auto-complete.json +1 -0
  4. package/docs/api/auto-complete.md +2 -0
  5. package/docs/api/avatar.json +1 -0
  6. package/docs/api/badge.json +1 -0
  7. package/docs/api/breadcrumb.json +1 -0
  8. package/docs/api/button-group.json +1 -0
  9. package/docs/api/button.json +1 -0
  10. package/docs/api/calendar.json +1 -0
  11. package/docs/api/card.json +1 -0
  12. package/docs/api/chart.json +1 -0
  13. package/docs/api/check-box.json +1 -0
  14. package/docs/api/chip.json +1 -0
  15. package/docs/api/circular-progress-bar.json +1 -0
  16. package/docs/api/collapsible.json +1 -0
  17. package/docs/api/color-gradient.json +1 -0
  18. package/docs/api/color-palette.json +1 -0
  19. package/docs/api/color-picker.json +1 -0
  20. package/docs/api/combo-box.json +1 -0
  21. package/docs/api/combo-box.md +2 -0
  22. package/docs/api/command.json +1 -0
  23. package/docs/api/common.json +1 -0
  24. package/docs/api/contextmenu.json +1 -0
  25. package/docs/api/date-input.json +1 -0
  26. package/docs/api/date-picker.json +1 -0
  27. package/docs/api/date-range-picker.json +1 -0
  28. package/docs/api/datetime-picker.json +1 -0
  29. package/docs/api/dialog.json +1 -0
  30. package/docs/api/dropdown-button.json +1 -0
  31. package/docs/api/dropdown-list.json +1 -0
  32. package/docs/api/dropdown-tree.json +1 -0
  33. package/docs/api/dropdowns.json +1 -0
  34. package/docs/api/dropdowns.md +3 -1
  35. package/docs/api/editor.json +1 -0
  36. package/docs/api/expansion-panel.json +1 -0
  37. package/docs/api/fieldset.json +1 -0
  38. package/docs/api/file-upload.json +1 -0
  39. package/docs/api/filter.json +1 -0
  40. package/docs/api/form-field.json +1 -0
  41. package/docs/api/grid.json +1 -0
  42. package/docs/api/i18n.json +1 -0
  43. package/docs/api/i18n.md +20 -0
  44. package/docs/api/index.json +1 -0
  45. package/docs/api/kanban.json +1 -0
  46. package/docs/api/label.json +1 -0
  47. package/docs/api/list-box.json +1 -0
  48. package/docs/api/list-view.json +1 -0
  49. package/docs/api/list.json +1 -0
  50. package/docs/api/locales.json +1 -0
  51. package/docs/api/locales.md +14 -14
  52. package/docs/api/masked-text-box.json +1 -0
  53. package/docs/api/menubar.json +1 -0
  54. package/docs/api/multi-select-tree.json +1 -0
  55. package/docs/api/multi-select.json +1 -0
  56. package/docs/api/notification.json +1 -0
  57. package/docs/api/numeric-text-box.json +1 -0
  58. package/docs/api/otp-input.json +1 -0
  59. package/docs/api/pager.json +1 -0
  60. package/docs/api/placeholder.json +1 -0
  61. package/docs/api/popover.json +1 -0
  62. package/docs/api/popup-menu.json +1 -0
  63. package/docs/api/popup.json +1 -0
  64. package/docs/api/progress-bar.json +1 -0
  65. package/docs/api/qr-code.json +1 -0
  66. package/docs/api/query.json +1 -0
  67. package/docs/api/radio-button.json +1 -0
  68. package/docs/api/rating.json +1 -0
  69. package/docs/api/scroll-view.json +1 -0
  70. package/docs/api/segmented.json +1 -0
  71. package/docs/api/separator.json +1 -0
  72. package/docs/api/sheet.json +1 -0
  73. package/docs/api/sidebar.json +1 -0
  74. package/docs/api/skeleton.json +1 -0
  75. package/docs/api/slider.json +1 -0
  76. package/docs/api/sortable.json +1 -0
  77. package/docs/api/sparkline.json +1 -0
  78. package/docs/api/sparkline.md +85 -0
  79. package/docs/api/spinner.json +1 -0
  80. package/docs/api/split-button.json +1 -0
  81. package/docs/api/splitter.json +1 -0
  82. package/docs/api/stepper.json +1 -0
  83. package/docs/api/switch.json +1 -0
  84. package/docs/api/tabs.json +1 -0
  85. package/docs/api/text-area.json +1 -0
  86. package/docs/api/text-box.json +1 -0
  87. package/docs/api/theme.json +1 -0
  88. package/docs/api/time-picker.json +1 -0
  89. package/docs/api/time-selector.json +1 -0
  90. package/docs/api/toolbar.json +1 -0
  91. package/docs/api/tooltip.json +1 -0
  92. package/docs/api/tree-view.json +1 -0
  93. package/docs/api/window.json +1 -0
  94. package/docs/auto-complete.md +64 -0
  95. package/docs/combo-box.md +65 -0
  96. package/docs/installation.md +8 -0
  97. package/docs/manifest.json +1 -0
  98. package/docs/sparkline.md +303 -0
  99. package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +95 -30
  100. package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +58 -5
  101. package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +64 -29
  102. package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +39 -0
  103. package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +5 -0
  104. package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +5 -0
  105. package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +5 -0
  106. package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +5 -0
  107. package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +5 -0
  108. package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +5 -0
  109. package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +5 -0
  110. package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +5 -0
  111. package/fesm2022/nanahoshi-mona-ui-locales-pl-pl.mjs +25 -0
  112. package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +5 -0
  113. package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +25 -0
  114. package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +5 -0
  115. package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +5 -0
  116. package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +5 -0
  117. package/fesm2022/nanahoshi-mona-ui-sparkline.mjs +573 -0
  118. package/i18n/catalogs/en-US.messages.json +5 -0
  119. package/llms.txt +3 -1
  120. package/locales/ar-sa/ar-sa.messages.json +5 -0
  121. package/locales/de-de/de-de.messages.json +5 -0
  122. package/locales/es-es/es-es.messages.json +5 -0
  123. package/locales/fr-fr/fr-fr.messages.json +5 -0
  124. package/locales/id-id/id-id.messages.json +5 -0
  125. package/locales/it-it/it-it.messages.json +5 -0
  126. package/locales/ja-jp/ja-jp.messages.json +5 -0
  127. package/locales/ko-kr/ko-kr.messages.json +5 -0
  128. package/locales/pl-pl/pl-pl.messages.json +5 -0
  129. package/locales/pt-br/pt-br.messages.json +5 -0
  130. package/locales/ru-ru/ru-ru.messages.json +5 -0
  131. package/locales/tr-tr/tr-tr.messages.json +5 -0
  132. package/locales/zh-cn/zh-cn.messages.json +5 -0
  133. package/locales/zh-tw/zh-tw.messages.json +5 -0
  134. package/package.json +5 -1
  135. package/sparkline/package.json +4 -0
  136. package/types/nanahoshi-mona-ui-auto-complete.d.ts +42 -1
  137. package/types/nanahoshi-mona-ui-combo-box.d.ts +37 -1
  138. package/types/nanahoshi-mona-ui-dropdowns.d.ts +54 -4
  139. package/types/nanahoshi-mona-ui-i18n.d.ts +12 -0
  140. package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +5 -0
  141. package/types/nanahoshi-mona-ui-locales-de-de.d.ts +5 -0
  142. package/types/nanahoshi-mona-ui-locales-es-es.d.ts +5 -0
  143. package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +5 -0
  144. package/types/nanahoshi-mona-ui-locales-id-id.d.ts +5 -0
  145. package/types/nanahoshi-mona-ui-locales-it-it.d.ts +5 -0
  146. package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +5 -0
  147. package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +5 -0
  148. package/types/nanahoshi-mona-ui-locales-pl-pl.d.ts +5 -0
  149. package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +5 -0
  150. package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +5 -0
  151. package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +5 -0
  152. package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +5 -0
  153. package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +5 -0
  154. package/types/nanahoshi-mona-ui-sparkline.d.ts +228 -0
@@ -0,0 +1,228 @@
1
+ import * as i0 from "@angular/core";
2
+ import { MonaSparklineMessages } from "@nanahoshi/mona-ui/i18n";
3
+ /**
4
+ * How a line or an area sparkline joins its values, as a chart's line series does: `"linear"` with straight segments,
5
+ * `"monotone-x"` with a smooth curve that never swings past the values, `"natural"` with a smoother curve that can,
6
+ * `"step"` in steps that change halfway between values, and `"step-after"` in steps that hold each value until the
7
+ * next one.
8
+ */
9
+ type SparklineCurve = "linear" | "monotone-x" | "natural" | "step" | "step-after";
10
+ /** A value a line or area sparkline marks with a dot: its first, its last, its lowest or its highest. */
11
+ type SparklineMarker = "first" | "last" | "max" | "min";
12
+ /**
13
+ * How a sparkline draws its values: `"line"` joins them, `"area"` fills under the line, `"column"` draws a bar for
14
+ * each from zero, and `"win-loss"` draws a bar up for each positive value, down for each negative one and a short tick
15
+ * for each zero, all of one height.
16
+ */
17
+ type SparklineType = "area" | "column" | "line" | "win-loss";
18
+ type SparklineBarKind = "negative" | "positive" | "zero";
19
+ interface SparklineBar {
20
+ readonly height: number;
21
+ readonly kind: SparklineBarKind;
22
+ readonly width: number;
23
+ readonly x: number;
24
+ readonly y: number;
25
+ }
26
+ /** What a sparkline draws, in the drawing's coordinates. */
27
+ interface SparklineGeometry {
28
+ /** The area under the line of an area sparkline, one closed shape for each run of values. */
29
+ readonly areaPath: string;
30
+ /** The bars of a column or win-loss sparkline. */
31
+ readonly bars: readonly SparklineBar[];
32
+ /** Where zero is, for a column sparkline with values on both sides of it; `null` otherwise. */
33
+ readonly baselineY: number | null;
34
+ /** Dots for the values a line has no segment for, between gaps or alone. */
35
+ readonly dotsPath: string;
36
+ /** The line through the values, joined by the curve and broken where a value is missing. */
37
+ readonly linePath: string;
38
+ /** Dots for the marked values. */
39
+ readonly markersPath: string;
40
+ /** Where the reference value is; `null` without one, or for a win-loss sparkline. */
41
+ readonly referenceY: number | null;
42
+ }
43
+ /**
44
+ * A word-sized chart of a series of values, to sit on a line of text or in a table cell: a line, an area, columns or
45
+ * wins and losses. It's an image to assistive technology, which reads its name and a summary of its values: how many,
46
+ * the first, the last, the lowest and the highest, or how many wins, losses and draws.
47
+ *
48
+ * Values run from left to right, also in a right-to-left layout, as on a chart's axis.
49
+ */
50
+ export declare class SparklineComponent {
51
+ #private;
52
+ /** Its name, or without one, the summary of its values. */
53
+ protected readonly accessibleName: import("@angular/core").Signal<string | null>;
54
+ protected readonly areaClass = "fill-(--mona-sparkline-color) stroke-none [fill-opacity:0.2]";
55
+ protected readonly barClasses: {
56
+ readonly negative: "fill-(--mona-sparkline-negative-color)";
57
+ readonly positive: "fill-(--mona-sparkline-color)";
58
+ readonly zero: "fill-muted-foreground forced-colors:fill-[CanvasText]";
59
+ };
60
+ protected readonly baseClass: import("@angular/core").Signal<string>;
61
+ protected readonly baselineClass = "fill-none stroke-border [stroke-width:1px] forced-colors:stroke-[GrayText]";
62
+ /** With a name, the summary of its values is its description, after any the application gives. */
63
+ protected readonly describedBy: import("@angular/core").Signal<string | null>;
64
+ protected readonly descriptionId: string;
65
+ protected readonly dotClass = "fill-none stroke-(--mona-sparkline-color) [stroke-linecap:round] [stroke-width:5px]";
66
+ protected readonly geometry: import("@angular/core").Signal<SparklineGeometry>;
67
+ protected readonly lineClass = "fill-none stroke-(--mona-sparkline-color) [stroke-linecap:round] [stroke-linejoin:round] [stroke-width:1.5px]";
68
+ protected readonly referenceClass = "fill-none stroke-muted-foreground [stroke-dasharray:3_2] [stroke-width:1px] forced-colors:stroke-[GrayText]";
69
+ protected readonly showDescription: import("@angular/core").Signal<boolean>;
70
+ protected readonly summary: import("@angular/core").Signal<string>;
71
+ protected readonly svgClass = "\n block size-full overflow-visible forced-color-adjust-none\n forced-colors:[--mona-sparkline-color:CanvasText] forced-colors:[--mona-sparkline-negative-color:CanvasText]\n";
72
+ /**
73
+ * @description Ids of elements that describe the sparkline further. The summary of its values is added after them
74
+ * when it has a name.
75
+ * @default ""
76
+ */
77
+ readonly ariaDescribedBy: import("@angular/core").InputSignal<string>;
78
+ /**
79
+ * @description The sparkline's name, what its values are, such as "Weekly sales". Assistive technology reads the
80
+ * summary of its values after it. Without a name, the summary is the name.
81
+ * @default ""
82
+ */
83
+ readonly ariaLabel: import("@angular/core").InputSignal<string>;
84
+ /**
85
+ * @description The color of the line, the area and the bars, as a CSS color. The first chart color when empty.
86
+ * The `--mona-sparkline-color` custom property sets it from a style sheet.
87
+ * @default ""
88
+ */
89
+ readonly color: import("@angular/core").InputSignal<string>;
90
+ /**
91
+ * @description How a line or an area joins its values, as a chart's line series does: `"linear"`, `"monotone-x"`
92
+ * (smooth, never past the values), `"natural"` (smoother, but it can swing past them), `"step"` (changing halfway
93
+ * between values) or `"step-after"` (holding each value until the next). Columns and win-loss bars ignore it.
94
+ * @default "linear"
95
+ */
96
+ readonly curve: import("@angular/core").InputSignal<SparklineCurve>;
97
+ /**
98
+ * @description The values, in order. A `null`, or anything that isn't a finite number, leaves a gap.
99
+ * @default []
100
+ */
101
+ readonly data: import("@angular/core").InputSignal<Iterable<number | null | undefined>>;
102
+ /**
103
+ * @description Hides the sparkline from assistive technology, for one beside text that already gives its values.
104
+ * @default false
105
+ */
106
+ readonly decorative: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
107
+ /**
108
+ * @description How the values are formatted in the summary assistive technology reads, such as
109
+ * `{ style: "currency", currency: "EUR" }`. The locale's number format when `null`.
110
+ * @default null
111
+ */
112
+ readonly format: import("@angular/core").InputSignal<Intl.NumberFormatOptions | null>;
113
+ /**
114
+ * @description Values a line or area sparkline marks with a dot: `"first"`, `"last"`, `"min"` and `"max"`.
115
+ * @default []
116
+ */
117
+ readonly markers: import("@angular/core").InputSignal<readonly SparklineMarker[]>;
118
+ /**
119
+ * @description The value at the top of the sparkline. Give several sparklines the same `min` and `max` to compare
120
+ * them. When `null`, the highest value, or zero for columns, or the reference value when it's higher.
121
+ * @default null
122
+ */
123
+ readonly max: import("@angular/core").InputSignal<number | null>;
124
+ /**
125
+ * @description The value at the bottom of the sparkline. When `null`, the lowest value, or zero for columns, or the
126
+ * reference value when it's lower.
127
+ * @default null
128
+ */
129
+ readonly min: import("@angular/core").InputSignal<number | null>;
130
+ /**
131
+ * @description The color of column bars below zero and of losses, as a CSS color. The error color when empty. The
132
+ * `--mona-sparkline-negative-color` custom property sets it from a style sheet.
133
+ * @default ""
134
+ */
135
+ readonly negativeColor: import("@angular/core").InputSignal<string>;
136
+ /**
137
+ * @description A value to draw a dashed line at, such as a target or an average. Not drawn on a win-loss
138
+ * sparkline.
139
+ * @default null
140
+ */
141
+ readonly referenceValue: import("@angular/core").InputSignal<number | null>;
142
+ /**
143
+ * @description How the values are drawn: `"line"`, `"area"`, `"column"` or `"win-loss"`.
144
+ * @default "line"
145
+ */
146
+ readonly type: import("@angular/core").InputSignal<SparklineType>;
147
+ /**
148
+ * @description Additional CSS classes merged onto the host element via `tailwind-merge`, such as a size: it's
149
+ * 6rem wide and 1.5rem tall by default.
150
+ * @default ""
151
+ */
152
+ readonly userClass: import("@angular/core").InputSignal<string>;
153
+ static ɵfac: i0.ɵɵFactoryDeclaration<SparklineComponent, never>;
154
+ static ɵcmp: i0.ɵɵComponentDeclaration<SparklineComponent, "mona-sparkline", never, {
155
+ "ariaDescribedBy": {
156
+ "alias": "aria-describedby";
157
+ "required": false;
158
+ "isSignal": true;
159
+ };
160
+ "ariaLabel": {
161
+ "alias": "aria-label";
162
+ "required": false;
163
+ "isSignal": true;
164
+ };
165
+ "color": {
166
+ "alias": "color";
167
+ "required": false;
168
+ "isSignal": true;
169
+ };
170
+ "curve": {
171
+ "alias": "curve";
172
+ "required": false;
173
+ "isSignal": true;
174
+ };
175
+ "data": {
176
+ "alias": "data";
177
+ "required": false;
178
+ "isSignal": true;
179
+ };
180
+ "decorative": {
181
+ "alias": "decorative";
182
+ "required": false;
183
+ "isSignal": true;
184
+ };
185
+ "format": {
186
+ "alias": "format";
187
+ "required": false;
188
+ "isSignal": true;
189
+ };
190
+ "markers": {
191
+ "alias": "markers";
192
+ "required": false;
193
+ "isSignal": true;
194
+ };
195
+ "max": {
196
+ "alias": "max";
197
+ "required": false;
198
+ "isSignal": true;
199
+ };
200
+ "min": {
201
+ "alias": "min";
202
+ "required": false;
203
+ "isSignal": true;
204
+ };
205
+ "negativeColor": {
206
+ "alias": "negativeColor";
207
+ "required": false;
208
+ "isSignal": true;
209
+ };
210
+ "referenceValue": {
211
+ "alias": "referenceValue";
212
+ "required": false;
213
+ "isSignal": true;
214
+ };
215
+ "type": {
216
+ "alias": "type";
217
+ "required": false;
218
+ "isSignal": true;
219
+ };
220
+ "userClass": {
221
+ "alias": "class";
222
+ "required": false;
223
+ "isSignal": true;
224
+ };
225
+ }, {}, never, never, true, never>;
226
+ }
227
+ export declare const SPARKLINE_DEFAULT_MESSAGES: MonaSparklineMessages;
228
+ export type { SparklineCurve, SparklineMarker, SparklineType };