@momentum-design/components 0.4.16 → 0.4.18
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/browser/index.js +24 -23
- package/dist/browser/index.js.map +4 -4
- package/dist/components/badge/badge.component.d.ts +39 -15
- package/dist/components/badge/badge.component.js +40 -22
- package/dist/components/badge/badge.styles.js +1 -0
- package/dist/components/text/text.component.d.ts +2 -3
- package/dist/components/text/text.component.js +13 -13
- package/dist/components/text/text.constants.d.ts +46 -7
- package/dist/components/text/text.constants.js +46 -47
- package/dist/custom-elements.json +200 -201
- package/dist/react/badge/index.d.ts +16 -4
- package/dist/react/badge/index.js +16 -4
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +1 -1
- package/package.json +1 -1
- package/dist/components/text/text.types.d.ts +0 -2
- package/dist/components/text/text.types.js +0 -1
@@ -114,191 +114,22 @@
|
|
114
114
|
}
|
115
115
|
]
|
116
116
|
},
|
117
|
-
{
|
118
|
-
"kind": "javascript-module",
|
119
|
-
"path": "components/icon/icon.component.js",
|
120
|
-
"declarations": [
|
121
|
-
{
|
122
|
-
"kind": "class",
|
123
|
-
"description": "Icon component that dynamically displays SVG icons based on a valid name.\n\nThis component must be mounted within an `IconProvider` component.\n\nThe `IconProvider` defines the source URL from which icons are consumed.\nThe `Icon` component accepts a `name` attribute, which corresponds to\nthe file name of the icon to be loaded from the specified URL.\n\nOnce fetched, the icon will be rendered. If the fetching process is unsuccessful,\nno icon will be displayed.\n\nThe `size` attribute allows for dynamic sizing of the icon based on the provided\n`length-unit` attribute. This unit can either come from the `IconProvider`\nor can be overridden for each individual icon. For example:\nif `size = 1` and `length-unit = 'em'`, the dimensions of the icon will be\n`width: 1em; height: 1em`.\n\nRegarding accessibility, there are two types of icons: decorative and informative.\n\n### Decorative Icons\n- Decorative icons do not convey any essential information to the content of a page.\n- They should be hidden from screen readers (SR) to prevent confusion for users.\n- For decorative icons, an `aria-label` is not required, and the `role` will be set to null.\n\n### Informative Icons\n- Informative icons convey important information that is not adequately represented\n by surrounding text or components.\n- They provide valuable context and must be announced by assistive technologies.\n- For informative icons, an `aria-label` is required, and the `role` will be set to \"img\".\n- If an `aria-label` is provided, the role will be set to 'img'; if it is absent,\n the role will be unset.",
|
124
|
-
"name": "Icon",
|
125
|
-
"cssProperties": [
|
126
|
-
{
|
127
|
-
"description": "Allows customization of the default fill color.",
|
128
|
-
"name": "--mdc-icon-fill-color"
|
129
|
-
}
|
130
|
-
],
|
131
|
-
"members": [
|
132
|
-
{
|
133
|
-
"kind": "field",
|
134
|
-
"name": "iconData",
|
135
|
-
"type": {
|
136
|
-
"text": "HTMLElement | undefined"
|
137
|
-
},
|
138
|
-
"privacy": "private"
|
139
|
-
},
|
140
|
-
{
|
141
|
-
"kind": "field",
|
142
|
-
"name": "lengthUnitFromContext",
|
143
|
-
"type": {
|
144
|
-
"text": "string | undefined"
|
145
|
-
},
|
146
|
-
"privacy": "private"
|
147
|
-
},
|
148
|
-
{
|
149
|
-
"kind": "field",
|
150
|
-
"name": "sizeFromContext",
|
151
|
-
"type": {
|
152
|
-
"text": "number | undefined"
|
153
|
-
},
|
154
|
-
"privacy": "private"
|
155
|
-
},
|
156
|
-
{
|
157
|
-
"kind": "field",
|
158
|
-
"name": "name",
|
159
|
-
"type": {
|
160
|
-
"text": "string | undefined"
|
161
|
-
},
|
162
|
-
"description": "Name of the icon (= filename)",
|
163
|
-
"attribute": "name",
|
164
|
-
"reflects": true
|
165
|
-
},
|
166
|
-
{
|
167
|
-
"kind": "field",
|
168
|
-
"name": "size",
|
169
|
-
"type": {
|
170
|
-
"text": "number | undefined"
|
171
|
-
},
|
172
|
-
"description": "Size of the icon (works in combination with length unit)",
|
173
|
-
"attribute": "size"
|
174
|
-
},
|
175
|
-
{
|
176
|
-
"kind": "field",
|
177
|
-
"name": "lengthUnit",
|
178
|
-
"type": {
|
179
|
-
"text": "string | undefined"
|
180
|
-
},
|
181
|
-
"description": "Length unit attribute for overriding length-unit from `IconProvider`",
|
182
|
-
"attribute": "length-unit"
|
183
|
-
},
|
184
|
-
{
|
185
|
-
"kind": "field",
|
186
|
-
"name": "ariaLabel",
|
187
|
-
"type": {
|
188
|
-
"text": "string | null"
|
189
|
-
},
|
190
|
-
"default": "null",
|
191
|
-
"description": "Aria-label attribute to be set for accessibility",
|
192
|
-
"attribute": "aria-label"
|
193
|
-
},
|
194
|
-
{
|
195
|
-
"kind": "field",
|
196
|
-
"name": "iconProviderContext",
|
197
|
-
"privacy": "private",
|
198
|
-
"readonly": true
|
199
|
-
},
|
200
|
-
{
|
201
|
-
"kind": "method",
|
202
|
-
"name": "getIconData",
|
203
|
-
"privacy": "private",
|
204
|
-
"description": "Get Icon Data function which will fetch the icon (currently only svg)\nand sets state and attributes once fetched successfully"
|
205
|
-
},
|
206
|
-
{
|
207
|
-
"kind": "method",
|
208
|
-
"name": "updateSize",
|
209
|
-
"privacy": "private",
|
210
|
-
"description": "Updates the size by setting the width and height"
|
211
|
-
},
|
212
|
-
{
|
213
|
-
"kind": "method",
|
214
|
-
"name": "setRoleOnIcon",
|
215
|
-
"privacy": "private"
|
216
|
-
},
|
217
|
-
{
|
218
|
-
"kind": "method",
|
219
|
-
"name": "setAriaHiddenOnIcon",
|
220
|
-
"privacy": "private"
|
221
|
-
},
|
222
|
-
{
|
223
|
-
"kind": "method",
|
224
|
-
"name": "setAriaLabelOnIcon",
|
225
|
-
"privacy": "private"
|
226
|
-
},
|
227
|
-
{
|
228
|
-
"kind": "field",
|
229
|
-
"name": "computedIconSize",
|
230
|
-
"privacy": "private",
|
231
|
-
"readonly": true
|
232
|
-
}
|
233
|
-
],
|
234
|
-
"attributes": [
|
235
|
-
{
|
236
|
-
"name": "name",
|
237
|
-
"type": {
|
238
|
-
"text": "string | undefined"
|
239
|
-
},
|
240
|
-
"description": "Name of the icon (= filename)",
|
241
|
-
"fieldName": "name"
|
242
|
-
},
|
243
|
-
{
|
244
|
-
"name": "size",
|
245
|
-
"type": {
|
246
|
-
"text": "number | undefined"
|
247
|
-
},
|
248
|
-
"description": "Size of the icon (works in combination with length unit)",
|
249
|
-
"fieldName": "size"
|
250
|
-
},
|
251
|
-
{
|
252
|
-
"name": "length-unit",
|
253
|
-
"type": {
|
254
|
-
"text": "string | undefined"
|
255
|
-
},
|
256
|
-
"description": "Length unit attribute for overriding length-unit from `IconProvider`",
|
257
|
-
"fieldName": "lengthUnit"
|
258
|
-
},
|
259
|
-
{
|
260
|
-
"name": "aria-label",
|
261
|
-
"type": {
|
262
|
-
"text": "string | null"
|
263
|
-
},
|
264
|
-
"default": "null",
|
265
|
-
"description": "Aria-label attribute to be set for accessibility",
|
266
|
-
"fieldName": "ariaLabel"
|
267
|
-
}
|
268
|
-
],
|
269
|
-
"superclass": {
|
270
|
-
"name": "Component",
|
271
|
-
"module": "/src/models"
|
272
|
-
},
|
273
|
-
"tagName": "mdc-icon",
|
274
|
-
"jsDoc": "/**\n * Icon component that dynamically displays SVG icons based on a valid name.\n *\n * This component must be mounted within an `IconProvider` component.\n *\n * The `IconProvider` defines the source URL from which icons are consumed.\n * The `Icon` component accepts a `name` attribute, which corresponds to\n * the file name of the icon to be loaded from the specified URL.\n *\n * Once fetched, the icon will be rendered. If the fetching process is unsuccessful,\n * no icon will be displayed.\n *\n * The `size` attribute allows for dynamic sizing of the icon based on the provided\n * `length-unit` attribute. This unit can either come from the `IconProvider`\n * or can be overridden for each individual icon. For example:\n * if `size = 1` and `length-unit = 'em'`, the dimensions of the icon will be\n * `width: 1em; height: 1em`.\n *\n * Regarding accessibility, there are two types of icons: decorative and informative.\n *\n * ### Decorative Icons\n * - Decorative icons do not convey any essential information to the content of a page.\n * - They should be hidden from screen readers (SR) to prevent confusion for users.\n * - For decorative icons, an `aria-label` is not required, and the `role` will be set to null.\n *\n * ### Informative Icons\n * - Informative icons convey important information that is not adequately represented\n * by surrounding text or components.\n * - They provide valuable context and must be announced by assistive technologies.\n * - For informative icons, an `aria-label` is required, and the `role` will be set to \"img\".\n * - If an `aria-label` is provided, the role will be set to 'img'; if it is absent,\n * the role will be unset.\n *\n * @tagname mdc-icon\n *\n * @cssproperty --mdc-icon-fill-color - Allows customization of the default fill color.\n */",
|
275
|
-
"customElement": true
|
276
|
-
}
|
277
|
-
],
|
278
|
-
"exports": [
|
279
|
-
{
|
280
|
-
"kind": "js",
|
281
|
-
"name": "default",
|
282
|
-
"declaration": {
|
283
|
-
"name": "Icon",
|
284
|
-
"module": "components/icon/icon.component.js"
|
285
|
-
}
|
286
|
-
}
|
287
|
-
]
|
288
|
-
},
|
289
117
|
{
|
290
118
|
"kind": "javascript-module",
|
291
119
|
"path": "components/badge/badge.component.js",
|
292
120
|
"declarations": [
|
293
121
|
{
|
294
122
|
"kind": "class",
|
295
|
-
"description": "
|
123
|
+
"description": "The `mdc-badge` component is a versatile UI element used to\ndisplay dot, icons, counters, success, warning and error type badge.\n\nSupported badge types:\n- `dot`: Displays a dot notification badge with a blue color.\n- `icon`: Displays a badge with a specified icon using the `icon-name` attribute.\n- `counter`: Displays a badge with a counter value. If the counter exceeds the `max-counter`,\nit shows `maxCounter+`. The maximum value of the counter is 999 and anything about that will be set to `999+`.\n- `success`: Displays a success badge with a check circle icon and green color.\n- `warning`: Displays a warning badge with a warning icon and yellow color.\n- `error`: Displays a error badge with a error legacy icon and red color.\n\nFor `icon`, `success`, `warning` and `error` types, the `mdc-icon` component is used to render the icon.\n\nFor the `counter` type, the `mdc-text` component is used to render the counter value.",
|
296
124
|
"name": "Badge",
|
297
125
|
"members": [
|
298
126
|
{
|
299
127
|
"kind": "field",
|
300
128
|
"name": "type",
|
301
|
-
"
|
129
|
+
"type": {
|
130
|
+
"text": "string | undefined"
|
131
|
+
},
|
132
|
+
"description": "Type of the badge\nCan be `dot` (notification) , `icon`, `counter`, `success`, `warning` or `error`.",
|
302
133
|
"attribute": "type",
|
303
134
|
"reflects": true
|
304
135
|
},
|
@@ -308,13 +139,13 @@
|
|
308
139
|
"type": {
|
309
140
|
"text": "string | undefined"
|
310
141
|
},
|
311
|
-
"description": "
|
142
|
+
"description": "Name of the icon (= filename).\n\nIf no `icon-name` is provided, no icon will be rendered.",
|
312
143
|
"attribute": "icon-name"
|
313
144
|
},
|
314
145
|
{
|
315
146
|
"kind": "field",
|
316
147
|
"name": "variant",
|
317
|
-
"description": "
|
148
|
+
"description": "Type of the variant can be `primary` or `secondary`.\nIt defines the background and foreground color of the icon.",
|
318
149
|
"attribute": "variant"
|
319
150
|
},
|
320
151
|
{
|
@@ -323,6 +154,7 @@
|
|
323
154
|
"type": {
|
324
155
|
"text": "number | undefined"
|
325
156
|
},
|
157
|
+
"description": "Counter is the number which can be provided in the badge.",
|
326
158
|
"attribute": "counter"
|
327
159
|
},
|
328
160
|
{
|
@@ -331,6 +163,7 @@
|
|
331
163
|
"type": {
|
332
164
|
"text": "number"
|
333
165
|
},
|
166
|
+
"description": "The maximum number can be set up to 999, anything about that will be rendered as _999+_.\nThe max counter can be `9`, `99` or `999`.",
|
334
167
|
"attribute": "max-counter"
|
335
168
|
},
|
336
169
|
{
|
@@ -340,6 +173,7 @@
|
|
340
173
|
"text": "boolean"
|
341
174
|
},
|
342
175
|
"default": "false",
|
176
|
+
"description": "Overlay is to add a thin outline to the badge.\nThis will help distinguish between the badge and the button,\nwhere the badge will be layered on top of a button.",
|
343
177
|
"attribute": "overlay"
|
344
178
|
},
|
345
179
|
{
|
@@ -395,33 +229,32 @@
|
|
395
229
|
"type": {
|
396
230
|
"text": "string"
|
397
231
|
},
|
398
|
-
"description": "name of the icon
|
232
|
+
"description": "the name of the icon from the icon set"
|
399
233
|
},
|
400
234
|
{
|
401
235
|
"name": "overlay",
|
402
236
|
"type": {
|
403
237
|
"text": "boolean"
|
404
|
-
}
|
238
|
+
},
|
239
|
+
"description": "boolean indicating whether the badge should have an overlay."
|
405
240
|
},
|
406
241
|
{
|
407
242
|
"name": "iconVariant",
|
408
243
|
"type": {
|
409
244
|
"text": "string"
|
410
|
-
}
|
245
|
+
},
|
246
|
+
"description": "the variant of the icon badge."
|
411
247
|
},
|
412
248
|
{
|
413
249
|
"name": "type",
|
414
250
|
"optional": true,
|
415
251
|
"type": {
|
416
252
|
"text": "string"
|
417
|
-
}
|
418
|
-
|
419
|
-
{
|
420
|
-
"description": "variant of the badge.",
|
421
|
-
"name": "variant"
|
253
|
+
},
|
254
|
+
"description": "the type of the badge."
|
422
255
|
}
|
423
256
|
],
|
424
|
-
"description": "Method to generate the badge icon
|
257
|
+
"description": "Method to generate the badge icon."
|
425
258
|
},
|
426
259
|
{
|
427
260
|
"kind": "method",
|
@@ -539,7 +372,10 @@
|
|
539
372
|
"attributes": [
|
540
373
|
{
|
541
374
|
"name": "type",
|
542
|
-
"
|
375
|
+
"type": {
|
376
|
+
"text": "string | undefined"
|
377
|
+
},
|
378
|
+
"description": "Type of the badge\nCan be `dot` (notification) , `icon`, `counter`, `success`, `warning` or `error`.",
|
543
379
|
"fieldName": "type"
|
544
380
|
},
|
545
381
|
{
|
@@ -547,12 +383,12 @@
|
|
547
383
|
"type": {
|
548
384
|
"text": "string | undefined"
|
549
385
|
},
|
550
|
-
"description": "
|
386
|
+
"description": "Name of the icon (= filename).\n\nIf no `icon-name` is provided, no icon will be rendered.",
|
551
387
|
"fieldName": "iconName"
|
552
388
|
},
|
553
389
|
{
|
554
390
|
"name": "variant",
|
555
|
-
"description": "
|
391
|
+
"description": "Type of the variant can be `primary` or `secondary`.\nIt defines the background and foreground color of the icon.",
|
556
392
|
"fieldName": "variant"
|
557
393
|
},
|
558
394
|
{
|
@@ -560,6 +396,7 @@
|
|
560
396
|
"type": {
|
561
397
|
"text": "number | undefined"
|
562
398
|
},
|
399
|
+
"description": "Counter is the number which can be provided in the badge.",
|
563
400
|
"fieldName": "counter"
|
564
401
|
},
|
565
402
|
{
|
@@ -567,6 +404,7 @@
|
|
567
404
|
"type": {
|
568
405
|
"text": "number"
|
569
406
|
},
|
407
|
+
"description": "The maximum number can be set up to 999, anything about that will be rendered as _999+_.\nThe max counter can be `9`, `99` or `999`.",
|
570
408
|
"fieldName": "maxCounter"
|
571
409
|
},
|
572
410
|
{
|
@@ -575,6 +413,7 @@
|
|
575
413
|
"text": "boolean"
|
576
414
|
},
|
577
415
|
"default": "false",
|
416
|
+
"description": "Overlay is to add a thin outline to the badge.\nThis will help distinguish between the badge and the button,\nwhere the badge will be layered on top of a button.",
|
578
417
|
"fieldName": "overlay"
|
579
418
|
},
|
580
419
|
{
|
@@ -592,7 +431,7 @@
|
|
592
431
|
"module": "/src/models"
|
593
432
|
},
|
594
433
|
"tagName": "mdc-badge",
|
595
|
-
"jsDoc": "/**\n *
|
434
|
+
"jsDoc": "/**\n * The `mdc-badge` component is a versatile UI element used to\n * display dot, icons, counters, success, warning and error type badge.\n *\n * Supported badge types:\n * - `dot`: Displays a dot notification badge with a blue color.\n * - `icon`: Displays a badge with a specified icon using the `icon-name` attribute.\n * - `counter`: Displays a badge with a counter value. If the counter exceeds the `max-counter`,\n * it shows `maxCounter+`. The maximum value of the counter is 999 and anything about that will be set to `999+`.\n * - `success`: Displays a success badge with a check circle icon and green color.\n * - `warning`: Displays a warning badge with a warning icon and yellow color.\n * - `error`: Displays a error badge with a error legacy icon and red color.\n *\n * For `icon`, `success`, `warning` and `error` types, the `mdc-icon` component is used to render the icon.\n *\n * For the `counter` type, the `mdc-text` component is used to render the counter value.\n *\n * @dependency mdc-icon\n * @dependency mdc-text\n *\n * @tagname mdc-badge\n */",
|
596
435
|
"customElement": true
|
597
436
|
}
|
598
437
|
],
|
@@ -607,6 +446,178 @@
|
|
607
446
|
}
|
608
447
|
]
|
609
448
|
},
|
449
|
+
{
|
450
|
+
"kind": "javascript-module",
|
451
|
+
"path": "components/icon/icon.component.js",
|
452
|
+
"declarations": [
|
453
|
+
{
|
454
|
+
"kind": "class",
|
455
|
+
"description": "Icon component that dynamically displays SVG icons based on a valid name.\n\nThis component must be mounted within an `IconProvider` component.\n\nThe `IconProvider` defines the source URL from which icons are consumed.\nThe `Icon` component accepts a `name` attribute, which corresponds to\nthe file name of the icon to be loaded from the specified URL.\n\nOnce fetched, the icon will be rendered. If the fetching process is unsuccessful,\nno icon will be displayed.\n\nThe `size` attribute allows for dynamic sizing of the icon based on the provided\n`length-unit` attribute. This unit can either come from the `IconProvider`\nor can be overridden for each individual icon. For example:\nif `size = 1` and `length-unit = 'em'`, the dimensions of the icon will be\n`width: 1em; height: 1em`.\n\nRegarding accessibility, there are two types of icons: decorative and informative.\n\n### Decorative Icons\n- Decorative icons do not convey any essential information to the content of a page.\n- They should be hidden from screen readers (SR) to prevent confusion for users.\n- For decorative icons, an `aria-label` is not required, and the `role` will be set to null.\n\n### Informative Icons\n- Informative icons convey important information that is not adequately represented\n by surrounding text or components.\n- They provide valuable context and must be announced by assistive technologies.\n- For informative icons, an `aria-label` is required, and the `role` will be set to \"img\".\n- If an `aria-label` is provided, the role will be set to 'img'; if it is absent,\n the role will be unset.",
|
456
|
+
"name": "Icon",
|
457
|
+
"cssProperties": [
|
458
|
+
{
|
459
|
+
"description": "Allows customization of the default fill color.",
|
460
|
+
"name": "--mdc-icon-fill-color"
|
461
|
+
}
|
462
|
+
],
|
463
|
+
"members": [
|
464
|
+
{
|
465
|
+
"kind": "field",
|
466
|
+
"name": "iconData",
|
467
|
+
"type": {
|
468
|
+
"text": "HTMLElement | undefined"
|
469
|
+
},
|
470
|
+
"privacy": "private"
|
471
|
+
},
|
472
|
+
{
|
473
|
+
"kind": "field",
|
474
|
+
"name": "lengthUnitFromContext",
|
475
|
+
"type": {
|
476
|
+
"text": "string | undefined"
|
477
|
+
},
|
478
|
+
"privacy": "private"
|
479
|
+
},
|
480
|
+
{
|
481
|
+
"kind": "field",
|
482
|
+
"name": "sizeFromContext",
|
483
|
+
"type": {
|
484
|
+
"text": "number | undefined"
|
485
|
+
},
|
486
|
+
"privacy": "private"
|
487
|
+
},
|
488
|
+
{
|
489
|
+
"kind": "field",
|
490
|
+
"name": "name",
|
491
|
+
"type": {
|
492
|
+
"text": "string | undefined"
|
493
|
+
},
|
494
|
+
"description": "Name of the icon (= filename)",
|
495
|
+
"attribute": "name",
|
496
|
+
"reflects": true
|
497
|
+
},
|
498
|
+
{
|
499
|
+
"kind": "field",
|
500
|
+
"name": "size",
|
501
|
+
"type": {
|
502
|
+
"text": "number | undefined"
|
503
|
+
},
|
504
|
+
"description": "Size of the icon (works in combination with length unit)",
|
505
|
+
"attribute": "size"
|
506
|
+
},
|
507
|
+
{
|
508
|
+
"kind": "field",
|
509
|
+
"name": "lengthUnit",
|
510
|
+
"type": {
|
511
|
+
"text": "string | undefined"
|
512
|
+
},
|
513
|
+
"description": "Length unit attribute for overriding length-unit from `IconProvider`",
|
514
|
+
"attribute": "length-unit"
|
515
|
+
},
|
516
|
+
{
|
517
|
+
"kind": "field",
|
518
|
+
"name": "ariaLabel",
|
519
|
+
"type": {
|
520
|
+
"text": "string | null"
|
521
|
+
},
|
522
|
+
"default": "null",
|
523
|
+
"description": "Aria-label attribute to be set for accessibility",
|
524
|
+
"attribute": "aria-label"
|
525
|
+
},
|
526
|
+
{
|
527
|
+
"kind": "field",
|
528
|
+
"name": "iconProviderContext",
|
529
|
+
"privacy": "private",
|
530
|
+
"readonly": true
|
531
|
+
},
|
532
|
+
{
|
533
|
+
"kind": "method",
|
534
|
+
"name": "getIconData",
|
535
|
+
"privacy": "private",
|
536
|
+
"description": "Get Icon Data function which will fetch the icon (currently only svg)\nand sets state and attributes once fetched successfully"
|
537
|
+
},
|
538
|
+
{
|
539
|
+
"kind": "method",
|
540
|
+
"name": "updateSize",
|
541
|
+
"privacy": "private",
|
542
|
+
"description": "Updates the size by setting the width and height"
|
543
|
+
},
|
544
|
+
{
|
545
|
+
"kind": "method",
|
546
|
+
"name": "setRoleOnIcon",
|
547
|
+
"privacy": "private"
|
548
|
+
},
|
549
|
+
{
|
550
|
+
"kind": "method",
|
551
|
+
"name": "setAriaHiddenOnIcon",
|
552
|
+
"privacy": "private"
|
553
|
+
},
|
554
|
+
{
|
555
|
+
"kind": "method",
|
556
|
+
"name": "setAriaLabelOnIcon",
|
557
|
+
"privacy": "private"
|
558
|
+
},
|
559
|
+
{
|
560
|
+
"kind": "field",
|
561
|
+
"name": "computedIconSize",
|
562
|
+
"privacy": "private",
|
563
|
+
"readonly": true
|
564
|
+
}
|
565
|
+
],
|
566
|
+
"attributes": [
|
567
|
+
{
|
568
|
+
"name": "name",
|
569
|
+
"type": {
|
570
|
+
"text": "string | undefined"
|
571
|
+
},
|
572
|
+
"description": "Name of the icon (= filename)",
|
573
|
+
"fieldName": "name"
|
574
|
+
},
|
575
|
+
{
|
576
|
+
"name": "size",
|
577
|
+
"type": {
|
578
|
+
"text": "number | undefined"
|
579
|
+
},
|
580
|
+
"description": "Size of the icon (works in combination with length unit)",
|
581
|
+
"fieldName": "size"
|
582
|
+
},
|
583
|
+
{
|
584
|
+
"name": "length-unit",
|
585
|
+
"type": {
|
586
|
+
"text": "string | undefined"
|
587
|
+
},
|
588
|
+
"description": "Length unit attribute for overriding length-unit from `IconProvider`",
|
589
|
+
"fieldName": "lengthUnit"
|
590
|
+
},
|
591
|
+
{
|
592
|
+
"name": "aria-label",
|
593
|
+
"type": {
|
594
|
+
"text": "string | null"
|
595
|
+
},
|
596
|
+
"default": "null",
|
597
|
+
"description": "Aria-label attribute to be set for accessibility",
|
598
|
+
"fieldName": "ariaLabel"
|
599
|
+
}
|
600
|
+
],
|
601
|
+
"superclass": {
|
602
|
+
"name": "Component",
|
603
|
+
"module": "/src/models"
|
604
|
+
},
|
605
|
+
"tagName": "mdc-icon",
|
606
|
+
"jsDoc": "/**\n * Icon component that dynamically displays SVG icons based on a valid name.\n *\n * This component must be mounted within an `IconProvider` component.\n *\n * The `IconProvider` defines the source URL from which icons are consumed.\n * The `Icon` component accepts a `name` attribute, which corresponds to\n * the file name of the icon to be loaded from the specified URL.\n *\n * Once fetched, the icon will be rendered. If the fetching process is unsuccessful,\n * no icon will be displayed.\n *\n * The `size` attribute allows for dynamic sizing of the icon based on the provided\n * `length-unit` attribute. This unit can either come from the `IconProvider`\n * or can be overridden for each individual icon. For example:\n * if `size = 1` and `length-unit = 'em'`, the dimensions of the icon will be\n * `width: 1em; height: 1em`.\n *\n * Regarding accessibility, there are two types of icons: decorative and informative.\n *\n * ### Decorative Icons\n * - Decorative icons do not convey any essential information to the content of a page.\n * - They should be hidden from screen readers (SR) to prevent confusion for users.\n * - For decorative icons, an `aria-label` is not required, and the `role` will be set to null.\n *\n * ### Informative Icons\n * - Informative icons convey important information that is not adequately represented\n * by surrounding text or components.\n * - They provide valuable context and must be announced by assistive technologies.\n * - For informative icons, an `aria-label` is required, and the `role` will be set to \"img\".\n * - If an `aria-label` is provided, the role will be set to 'img'; if it is absent,\n * the role will be unset.\n *\n * @tagname mdc-icon\n *\n * @cssproperty --mdc-icon-fill-color - Allows customization of the default fill color.\n */",
|
607
|
+
"customElement": true
|
608
|
+
}
|
609
|
+
],
|
610
|
+
"exports": [
|
611
|
+
{
|
612
|
+
"kind": "js",
|
613
|
+
"name": "default",
|
614
|
+
"declaration": {
|
615
|
+
"name": "Icon",
|
616
|
+
"module": "components/icon/icon.component.js"
|
617
|
+
}
|
618
|
+
}
|
619
|
+
]
|
620
|
+
},
|
610
621
|
{
|
611
622
|
"kind": "javascript-module",
|
612
623
|
"path": "components/iconprovider/iconprovider.component.js",
|
@@ -765,9 +776,6 @@
|
|
765
776
|
{
|
766
777
|
"kind": "field",
|
767
778
|
"name": "type",
|
768
|
-
"type": {
|
769
|
-
"text": "FontType"
|
770
|
-
},
|
771
779
|
"privacy": "public",
|
772
780
|
"description": "Specifies the text style to be applied.\n\nAcceptable values include:\n\n- 'body-small-regular'\n- 'body-small-medium'\n- 'body-small-bold'\n- 'body-midsize-regular'\n- 'body-midsize-medium'\n- 'body-midsize-bold'\n- 'body-large-regular'\n- 'body-large-medium'\n- 'body-large-bold'\n- 'body-small-regular-underline'\n- 'body-small-medium-underline'\n- 'body-midsize-regular-underline'\n- 'body-midsize-medium-underline'\n- 'body-large-regular-underline'\n- 'body-large-medium-underline'\n- 'heading-small-regular'\n- 'heading-small-medium'\n- 'heading-small-bold'\n- 'heading-midsize-regular'\n- 'heading-midsize-medium'\n- 'heading-midsize-bold'\n- 'heading-large-regular'\n- 'heading-large-medium'\n- 'heading-large-bold'\n- 'heading-xlarge-regular'\n- 'heading-xlarge-medium'\n- 'heading-xlarge-bold'\n- 'headline-small-light'\n- 'headline-small-regular'",
|
773
781
|
"attribute": "type",
|
@@ -776,9 +784,6 @@
|
|
776
784
|
{
|
777
785
|
"kind": "field",
|
778
786
|
"name": "tagname",
|
779
|
-
"type": {
|
780
|
-
"text": "ValidTextTags | undefined"
|
781
|
-
},
|
782
787
|
"privacy": "public",
|
783
788
|
"description": "Specifies the HTML tag name for the text element. The default tag name is `p`.\nThis attribute is optional. When set, it changes the tag name of the text element.\n\nAcceptable values include:\n\n- 'h1'\n- 'h2'\n- 'h3'\n- 'h4'\n- 'h5'\n- 'h6'\n- 'p'\n- 'small'\n- 'span'\n- 'div'\n\nFor instance, setting this attribute to `h2` will render the text element as an `h2` element.\nNote that the styling is determined by the `type` attribute.",
|
784
789
|
"attribute": "tagname",
|
@@ -788,17 +793,11 @@
|
|
788
793
|
"attributes": [
|
789
794
|
{
|
790
795
|
"name": "type",
|
791
|
-
"type": {
|
792
|
-
"text": "FontType"
|
793
|
-
},
|
794
796
|
"description": "Specifies the text style to be applied.\n\nAcceptable values include:\n\n- 'body-small-regular'\n- 'body-small-medium'\n- 'body-small-bold'\n- 'body-midsize-regular'\n- 'body-midsize-medium'\n- 'body-midsize-bold'\n- 'body-large-regular'\n- 'body-large-medium'\n- 'body-large-bold'\n- 'body-small-regular-underline'\n- 'body-small-medium-underline'\n- 'body-midsize-regular-underline'\n- 'body-midsize-medium-underline'\n- 'body-large-regular-underline'\n- 'body-large-medium-underline'\n- 'heading-small-regular'\n- 'heading-small-medium'\n- 'heading-small-bold'\n- 'heading-midsize-regular'\n- 'heading-midsize-medium'\n- 'heading-midsize-bold'\n- 'heading-large-regular'\n- 'heading-large-medium'\n- 'heading-large-bold'\n- 'heading-xlarge-regular'\n- 'heading-xlarge-medium'\n- 'heading-xlarge-bold'\n- 'headline-small-light'\n- 'headline-small-regular'",
|
795
797
|
"fieldName": "type"
|
796
798
|
},
|
797
799
|
{
|
798
800
|
"name": "tagname",
|
799
|
-
"type": {
|
800
|
-
"text": "ValidTextTags | undefined"
|
801
|
-
},
|
802
801
|
"description": "Specifies the HTML tag name for the text element. The default tag name is `p`.\nThis attribute is optional. When set, it changes the tag name of the text element.\n\nAcceptable values include:\n\n- 'h1'\n- 'h2'\n- 'h3'\n- 'h4'\n- 'h5'\n- 'h6'\n- 'p'\n- 'small'\n- 'span'\n- 'div'\n\nFor instance, setting this attribute to `h2` will render the text element as an `h2` element.\nNote that the styling is determined by the `type` attribute.",
|
803
802
|
"fieldName": "tagname"
|
804
803
|
}
|
@@ -1,9 +1,21 @@
|
|
1
1
|
import Component from '../../components/badge';
|
2
2
|
/**
|
3
|
-
*
|
4
|
-
*
|
5
|
-
*
|
6
|
-
*
|
3
|
+
* The `mdc-badge` component is a versatile UI element used to
|
4
|
+
* display dot, icons, counters, success, warning and error type badge.
|
5
|
+
*
|
6
|
+
* Supported badge types:
|
7
|
+
* - `dot`: Displays a dot notification badge with a blue color.
|
8
|
+
* - `icon`: Displays a badge with a specified icon using the `icon-name` attribute.
|
9
|
+
* - `counter`: Displays a badge with a counter value. If the counter exceeds the `max-counter`,
|
10
|
+
* it shows `maxCounter+`. The maximum value of the counter is 999 and anything about that will be set to `999+`.
|
11
|
+
* - `success`: Displays a success badge with a check circle icon and green color.
|
12
|
+
* - `warning`: Displays a warning badge with a warning icon and yellow color.
|
13
|
+
* - `error`: Displays a error badge with a error legacy icon and red color.
|
14
|
+
*
|
15
|
+
* For `icon`, `success`, `warning` and `error` types, the `mdc-icon` component is used to render the icon.
|
16
|
+
*
|
17
|
+
* For the `counter` type, the `mdc-text` component is used to render the counter value.
|
18
|
+
*
|
7
19
|
* @dependency mdc-icon
|
8
20
|
* @dependency mdc-text
|
9
21
|
*
|
@@ -3,10 +3,22 @@ import { createComponent } from '@lit/react';
|
|
3
3
|
import Component from '../../components/badge';
|
4
4
|
import { TAG_NAME } from '../../components/badge/badge.constants';
|
5
5
|
/**
|
6
|
-
*
|
7
|
-
*
|
8
|
-
*
|
9
|
-
*
|
6
|
+
* The `mdc-badge` component is a versatile UI element used to
|
7
|
+
* display dot, icons, counters, success, warning and error type badge.
|
8
|
+
*
|
9
|
+
* Supported badge types:
|
10
|
+
* - `dot`: Displays a dot notification badge with a blue color.
|
11
|
+
* - `icon`: Displays a badge with a specified icon using the `icon-name` attribute.
|
12
|
+
* - `counter`: Displays a badge with a counter value. If the counter exceeds the `max-counter`,
|
13
|
+
* it shows `maxCounter+`. The maximum value of the counter is 999 and anything about that will be set to `999+`.
|
14
|
+
* - `success`: Displays a success badge with a check circle icon and green color.
|
15
|
+
* - `warning`: Displays a warning badge with a warning icon and yellow color.
|
16
|
+
* - `error`: Displays a error badge with a error legacy icon and red color.
|
17
|
+
*
|
18
|
+
* For `icon`, `success`, `warning` and `error` types, the `mdc-icon` component is used to render the icon.
|
19
|
+
*
|
20
|
+
* For the `counter` type, the `mdc-text` component is used to render the counter value.
|
21
|
+
*
|
10
22
|
* @dependency mdc-icon
|
11
23
|
* @dependency mdc-text
|
12
24
|
*
|
package/dist/react/index.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
export { default as Avatar } from './avatar';
|
2
|
-
export { default as Icon } from './icon';
|
3
2
|
export { default as Badge } from './badge';
|
3
|
+
export { default as Icon } from './icon';
|
4
4
|
export { default as IconProvider } from './iconprovider';
|
5
5
|
export { default as Text } from './text';
|
6
6
|
export { default as ThemeProvider } from './themeprovider';
|
package/dist/react/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
export { default as Avatar } from './avatar';
|
2
|
-
export { default as Icon } from './icon';
|
3
2
|
export { default as Badge } from './badge';
|
3
|
+
export { default as Icon } from './icon';
|
4
4
|
export { default as IconProvider } from './iconprovider';
|
5
5
|
export { default as Text } from './text';
|
6
6
|
export { default as ThemeProvider } from './themeprovider';
|
package/package.json
CHANGED
@@ -1,2 +0,0 @@
|
|
1
|
-
export type FontType = 'body-small-regular' | 'body-small-medium' | 'body-small-bold' | 'body-midsize-regular' | 'body-midsize-medium' | 'body-midsize-bold' | 'body-large-regular' | 'body-large-medium' | 'body-large-bold' | 'body-small-regular-underline' | 'body-small-medium-underline' | 'body-midsize-regular-underline' | 'body-midsize-medium-underline' | 'body-large-regular-underline' | 'body-large-medium-underline' | 'heading-small-regular' | 'heading-small-medium' | 'heading-small-bold' | 'heading-midsize-regular' | 'heading-midsize-medium' | 'heading-midsize-bold' | 'heading-large-regular' | 'heading-large-medium' | 'heading-large-bold' | 'heading-xlarge-regular' | 'heading-xlarge-medium' | 'heading-xlarge-bold' | 'headline-small-light' | 'headline-small-regular';
|
2
|
-
export type ValidTextTags = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'small' | 'span' | 'div';
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|