@kouji-ui/components 0.1.1 → 0.1.2
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/fesm2022/kouji-ui-components.mjs +17668 -0
- package/fesm2022/kouji-ui-components.mjs.map +1 -0
- package/package.json +17 -10
- package/types/kouji-ui-components.d.ts +8032 -0
- package/.turbo/turbo-build.log +0 -29
- package/CHANGELOG.md +0 -192
- package/ng-package.json +0 -7
- package/src/accordion/_examples/accordion.default.example.ts +0 -31
- package/src/accordion/_examples/accordion.disabled.example.ts +0 -38
- package/src/accordion/_examples/accordion.multiple.example.ts +0 -31
- package/src/accordion/_examples/accordion.rich-content.example.ts +0 -49
- package/src/accordion/_examples/index.ts +0 -6
- package/src/accordion/accordion.arrow-nav.example.ts +0 -39
- package/src/accordion/accordion.css +0 -68
- package/src/accordion/accordion.playground.ts +0 -119
- package/src/accordion/accordion.spec.ts +0 -117
- package/src/accordion/accordion.ts +0 -153
- package/src/accordion/accordion.usage.example.ts +0 -38
- package/src/accordion/accordion.value.example.ts +0 -60
- package/src/accordion/index.ts +0 -1
- package/src/alert/_examples/alert.banner.example.ts +0 -56
- package/src/alert/_examples/alert.dismissible.example.ts +0 -53
- package/src/alert/_examples/alert.example.ts +0 -40
- package/src/alert/_examples/alert.variants.example.ts +0 -66
- package/src/alert/_examples/alert.with-actions.example.ts +0 -57
- package/src/alert/_examples/index.ts +0 -7
- package/src/alert/alert.css +0 -133
- package/src/alert/alert.playground.ts +0 -111
- package/src/alert/alert.spec.ts +0 -167
- package/src/alert/alert.ts +0 -250
- package/src/alert/alert.usage.example.ts +0 -58
- package/src/alert/index.ts +0 -8
- package/src/avatar/_examples/avatar-group.example.ts +0 -31
- package/src/avatar/_examples/avatar-group.list.example.ts +0 -45
- package/src/avatar/_examples/avatar-group.overflow.example.ts +0 -33
- package/src/avatar/_examples/avatar-group.shapes.example.ts +0 -39
- package/src/avatar/_examples/avatar-group.sizes.example.ts +0 -44
- package/src/avatar/_examples/avatar.default.example.ts +0 -18
- package/src/avatar/_examples/avatar.initials.example.ts +0 -20
- package/src/avatar/_examples/avatar.shapes.example.ts +0 -22
- package/src/avatar/_examples/avatar.sizes.example.ts +0 -26
- package/src/avatar/_examples/avatar.with-image.example.ts +0 -20
- package/src/avatar/_examples/index.ts +0 -12
- package/src/avatar/avatar-group.spec.ts +0 -138
- package/src/avatar/avatar-group.ts +0 -127
- package/src/avatar/avatar-group.usage.example.ts +0 -30
- package/src/avatar/avatar.css +0 -58
- package/src/avatar/avatar.playground.ts +0 -95
- package/src/avatar/avatar.ts +0 -123
- package/src/avatar/index.ts +0 -2
- package/src/badge/_examples/badge.default.example.ts +0 -18
- package/src/badge/_examples/badge.sizes.example.ts +0 -25
- package/src/badge/_examples/badge.variants.example.ts +0 -24
- package/src/badge/_examples/badge.with-dot.example.ts +0 -31
- package/src/badge/_examples/badge.with-icon.example.ts +0 -23
- package/src/badge/_examples/index.ts +0 -7
- package/src/badge/badge.css +0 -59
- package/src/badge/badge.playground.ts +0 -49
- package/src/badge/badge.ts +0 -86
- package/src/badge/badge.usage.example.ts +0 -22
- package/src/badge/index.ts +0 -1
- package/src/breadcrumb/_examples/breadcrumb.custom-separator.example.ts +0 -53
- package/src/breadcrumb/_examples/breadcrumb.example.ts +0 -48
- package/src/breadcrumb/_examples/breadcrumb.long-path.example.ts +0 -58
- package/src/breadcrumb/_examples/breadcrumb.truncated.example.ts +0 -59
- package/src/breadcrumb/_examples/breadcrumb.with-icons.example.ts +0 -66
- package/src/breadcrumb/_examples/index.ts +0 -7
- package/src/breadcrumb/breadcrumb.css +0 -121
- package/src/breadcrumb/breadcrumb.playground.ts +0 -93
- package/src/breadcrumb/breadcrumb.spec.ts +0 -230
- package/src/breadcrumb/breadcrumb.ts +0 -272
- package/src/breadcrumb/breadcrumb.usage.example.ts +0 -45
- package/src/breadcrumb/index.ts +0 -1
- package/src/button/_examples/button.anchor.example.ts +0 -18
- package/src/button/_examples/button.configured.example.ts +0 -43
- package/src/button/_examples/button.disabled.example.ts +0 -25
- package/src/button/_examples/button.example.ts +0 -22
- package/src/button/_examples/button.icon.example.ts +0 -27
- package/src/button/_examples/button.loading.example.ts +0 -31
- package/src/button/_examples/button.pressed.example.ts +0 -24
- package/src/button/_examples/button.sizes.example.ts +0 -26
- package/src/button/_examples/button.usage.example.ts +0 -66
- package/src/button/_examples/button.variants.example.ts +0 -26
- package/src/button/_examples/index.ts +0 -12
- package/src/button/button.css +0 -263
- package/src/button/button.playground.ts +0 -79
- package/src/button/button.spec.ts +0 -100
- package/src/button/button.ts +0 -150
- package/src/button/index.ts +0 -1
- package/src/button-group/_examples/button-group.example.ts +0 -30
- package/src/button-group/_examples/button-group.icon-only.example.ts +0 -30
- package/src/button-group/_examples/button-group.toggle.example.ts +0 -36
- package/src/button-group/_examples/button-group.variants.example.ts +0 -40
- package/src/button-group/_examples/button-group.vertical.example.ts +0 -29
- package/src/button-group/_examples/index.ts +0 -7
- package/src/button-group/button-group.css +0 -80
- package/src/button-group/button-group.playground.ts +0 -94
- package/src/button-group/button-group.spec.ts +0 -119
- package/src/button-group/button-group.ts +0 -130
- package/src/button-group/button-group.usage.example.ts +0 -35
- package/src/button-group/index.ts +0 -1
- package/src/calendar/_examples/calendar.example.ts +0 -33
- package/src/calendar/_examples/index.ts +0 -3
- package/src/calendar/calendar.css +0 -129
- package/src/calendar/calendar.playground.ts +0 -84
- package/src/calendar/calendar.spec.ts +0 -50
- package/src/calendar/calendar.ts +0 -171
- package/src/calendar/calendar.usage.example.ts +0 -33
- package/src/calendar/index.ts +0 -1
- package/src/card/_examples/card.cover.example.ts +0 -53
- package/src/card/_examples/card.example.ts +0 -27
- package/src/card/_examples/card.full.example.ts +0 -51
- package/src/card/_examples/index.ts +0 -5
- package/src/card/card.css +0 -120
- package/src/card/card.playground.ts +0 -116
- package/src/card/card.spec.ts +0 -50
- package/src/card/card.ts +0 -194
- package/src/card/card.usage.example.ts +0 -46
- package/src/card/index.ts +0 -1
- package/src/carousel/_examples/carousel.autoplay.example.ts +0 -69
- package/src/carousel/_examples/carousel.example.ts +0 -60
- package/src/carousel/_examples/carousel.indicators.example.ts +0 -64
- package/src/carousel/_examples/carousel.lazy-load.example.ts +0 -85
- package/src/carousel/_examples/carousel.tabs-pattern.example.ts +0 -61
- package/src/carousel/_examples/index.ts +0 -7
- package/src/carousel/carousel.css +0 -181
- package/src/carousel/carousel.playground.ts +0 -135
- package/src/carousel/carousel.spec.ts +0 -211
- package/src/carousel/carousel.ts +0 -399
- package/src/carousel/carousel.usage.example.ts +0 -46
- package/src/carousel/index.ts +0 -1
- package/src/cascade-select/_examples/cascade-select.data-driven.example.ts +0 -119
- package/src/cascade-select/_examples/cascade-select.disabled.example.ts +0 -74
- package/src/cascade-select/_examples/cascade-select.example.ts +0 -80
- package/src/cascade-select/_examples/cascade-select.field.example.ts +0 -73
- package/src/cascade-select/_examples/cascade-select.path.example.ts +0 -85
- package/src/cascade-select/_examples/index.ts +0 -7
- package/src/cascade-select/cascade-select.css +0 -120
- package/src/cascade-select/cascade-select.playground.ts +0 -133
- package/src/cascade-select/cascade-select.ts +0 -201
- package/src/cascade-select/cascade-select.usage.example.ts +0 -44
- package/src/cascade-select/index.ts +0 -5
- package/src/chat/_examples/chat-bubble.example.ts +0 -71
- package/src/chat/_examples/chat-bubble.grouped.example.ts +0 -69
- package/src/chat/_examples/chat-bubble.sides.example.ts +0 -41
- package/src/chat/_examples/chat-bubble.variants.example.ts +0 -58
- package/src/chat/_examples/chat-bubble.with-state.example.ts +0 -57
- package/src/chat/_examples/index.ts +0 -7
- package/src/chat/chat.css +0 -231
- package/src/chat/chat.playground.ts +0 -171
- package/src/chat/chat.spec.ts +0 -343
- package/src/chat/chat.ts +0 -269
- package/src/chat/chat.usage.example.ts +0 -49
- package/src/chat/index.ts +0 -13
- package/src/checkbox/_examples/checkbox.checked.example.ts +0 -20
- package/src/checkbox/_examples/checkbox.default.example.ts +0 -20
- package/src/checkbox/_examples/checkbox.disabled.example.ts +0 -26
- package/src/checkbox/_examples/checkbox.indeterminate.example.ts +0 -20
- package/src/checkbox/_examples/checkbox.usage.example.ts +0 -62
- package/src/checkbox/_examples/index.ts +0 -7
- package/src/checkbox/checkbox.css +0 -74
- package/src/checkbox/checkbox.playground.ts +0 -68
- package/src/checkbox/checkbox.ts +0 -122
- package/src/checkbox/index.ts +0 -1
- package/src/color-picker/_examples/color-picker.alpha.example.ts +0 -36
- package/src/color-picker/_examples/color-picker.example.ts +0 -34
- package/src/color-picker/_examples/color-picker.hex-input.example.ts +0 -53
- package/src/color-picker/_examples/color-picker.in-form.example.ts +0 -60
- package/src/color-picker/_examples/color-picker.usage.example.ts +0 -58
- package/src/color-picker/_examples/color-picker.with-presets.example.ts +0 -45
- package/src/color-picker/_examples/index.ts +0 -8
- package/src/color-picker/color-picker.css +0 -183
- package/src/color-picker/color-picker.playground.ts +0 -83
- package/src/color-picker/color-picker.spec.ts +0 -94
- package/src/color-picker/color-picker.ts +0 -234
- package/src/color-picker/index.ts +0 -1
- package/src/combobox/_examples/combobox.async.example.ts +0 -85
- package/src/combobox/_examples/combobox.empty-state.example.ts +0 -36
- package/src/combobox/_examples/combobox.example.ts +0 -36
- package/src/combobox/_examples/combobox.free-text.example.ts +0 -42
- package/src/combobox/_examples/combobox.usage.example.ts +0 -51
- package/src/combobox/_examples/combobox.with-icons.example.ts +0 -49
- package/src/combobox/_examples/index.ts +0 -8
- package/src/combobox/combobox.css +0 -101
- package/src/combobox/combobox.playground.ts +0 -90
- package/src/combobox/combobox.spec.ts +0 -111
- package/src/combobox/combobox.ts +0 -219
- package/src/combobox/index.ts +0 -6
- package/src/command-palette/_examples/command-palette.async.example.ts +0 -99
- package/src/command-palette/_examples/command-palette.dialog.example.ts +0 -90
- package/src/command-palette/_examples/command-palette.example.ts +0 -40
- package/src/command-palette/_examples/command-palette.fuzzy.example.ts +0 -54
- package/src/command-palette/_examples/command-palette.groups.example.ts +0 -55
- package/src/command-palette/_examples/command-palette.usage.example.ts +0 -49
- package/src/command-palette/_examples/index.ts +0 -8
- package/src/command-palette/command-palette.css +0 -234
- package/src/command-palette/command-palette.playground.ts +0 -119
- package/src/command-palette/command-palette.ts +0 -448
- package/src/command-palette/index.ts +0 -10
- package/src/confirm-popup/_examples/confirm-popup.destructive.example.ts +0 -72
- package/src/confirm-popup/_examples/confirm-popup.example.ts +0 -82
- package/src/confirm-popup/_examples/confirm-popup.placement.example.ts +0 -97
- package/src/confirm-popup/_examples/confirm-popup.usage.example.ts +0 -94
- package/src/confirm-popup/_examples/confirm-popup.with-message.example.ts +0 -76
- package/src/confirm-popup/_examples/index.ts +0 -7
- package/src/confirm-popup/confirm-popup.css +0 -47
- package/src/confirm-popup/confirm-popup.playground.ts +0 -109
- package/src/confirm-popup/confirm-popup.spec.ts +0 -209
- package/src/confirm-popup/confirm-popup.ts +0 -279
- package/src/confirm-popup/index.ts +0 -1
- package/src/date-picker/_examples/date-picker.disabled-dates.example.ts +0 -44
- package/src/date-picker/_examples/date-picker.example.ts +0 -38
- package/src/date-picker/_examples/date-picker.locale.example.ts +0 -50
- package/src/date-picker/_examples/date-picker.readonly.example.ts +0 -32
- package/src/date-picker/_examples/date-picker.usage.example.ts +0 -60
- package/src/date-picker/_examples/date-picker.with-min-max.example.ts +0 -47
- package/src/date-picker/_examples/index.ts +0 -8
- package/src/date-picker/date-picker.css +0 -61
- package/src/date-picker/date-picker.playground.ts +0 -79
- package/src/date-picker/date-picker.spec.ts +0 -71
- package/src/date-picker/date-picker.ts +0 -185
- package/src/date-picker/index.ts +0 -1
- package/src/dialog/_examples/dialog.confirmation.example.ts +0 -30
- package/src/dialog/_examples/dialog.default.example.ts +0 -30
- package/src/dialog/_examples/dialog.nested.example.ts +0 -86
- package/src/dialog/_examples/dialog.scrollable.example.ts +0 -30
- package/src/dialog/_examples/dialog.usage.example.ts +0 -57
- package/src/dialog/_examples/dialog.with-form.example.ts +0 -48
- package/src/dialog/_examples/index.ts +0 -8
- package/src/dialog/dialog.css +0 -56
- package/src/dialog/dialog.playground.ts +0 -136
- package/src/dialog/dialog.ts +0 -82
- package/src/dialog/index.ts +0 -1
- package/src/divider/_examples/divider.example.ts +0 -27
- package/src/divider/_examples/divider.sizes.example.ts +0 -33
- package/src/divider/_examples/divider.structural.example.ts +0 -55
- package/src/divider/_examples/divider.usage.example.ts +0 -48
- package/src/divider/_examples/divider.variants.example.ts +0 -33
- package/src/divider/_examples/divider.vertical.example.ts +0 -38
- package/src/divider/_examples/divider.with-content.example.ts +0 -38
- package/src/divider/_examples/index.ts +0 -9
- package/src/divider/divider.css +0 -93
- package/src/divider/divider.playground.ts +0 -97
- package/src/divider/divider.spec.ts +0 -207
- package/src/divider/divider.ts +0 -220
- package/src/divider/index.ts +0 -1
- package/src/drawer/_examples/drawer.example.ts +0 -30
- package/src/drawer/_examples/drawer.modal-vs-non-modal.example.ts +0 -27
- package/src/drawer/_examples/drawer.scrollable.example.ts +0 -30
- package/src/drawer/_examples/drawer.sides.example.ts +0 -32
- package/src/drawer/_examples/drawer.usage.example.ts +0 -56
- package/src/drawer/_examples/drawer.with-form.example.ts +0 -48
- package/src/drawer/_examples/index.ts +0 -8
- package/src/drawer/drawer.css +0 -130
- package/src/drawer/drawer.playground.ts +0 -107
- package/src/drawer/drawer.spec.ts +0 -216
- package/src/drawer/drawer.ts +0 -85
- package/src/drawer/index.ts +0 -1
- package/src/dropdown-menu/_examples/dropdown-menu.disabled.example.ts +0 -19
- package/src/dropdown-menu/_examples/dropdown-menu.example.ts +0 -20
- package/src/dropdown-menu/_examples/dropdown-menu.shortcuts.example.ts +0 -31
- package/src/dropdown-menu/_examples/dropdown-menu.sides.example.ts +0 -18
- package/src/dropdown-menu/_examples/dropdown-menu.usage.example.ts +0 -56
- package/src/dropdown-menu/_examples/dropdown-menu.with-icons.example.ts +0 -31
- package/src/dropdown-menu/_examples/dropdown-menu.with-separator.example.ts +0 -41
- package/src/dropdown-menu/_examples/index.ts +0 -9
- package/src/dropdown-menu/dropdown-menu.css +0 -108
- package/src/dropdown-menu/dropdown-menu.playground.ts +0 -109
- package/src/dropdown-menu/dropdown-menu.spec.ts +0 -5
- package/src/dropdown-menu/dropdown-menu.ts +0 -128
- package/src/dropdown-menu/index.ts +0 -1
- package/src/empty-state/_examples/empty-state.error.example.ts +0 -63
- package/src/empty-state/_examples/empty-state.example.ts +0 -59
- package/src/empty-state/_examples/empty-state.search.example.ts +0 -82
- package/src/empty-state/_examples/empty-state.sizes.example.ts +0 -76
- package/src/empty-state/_examples/empty-state.usage.example.ts +0 -66
- package/src/empty-state/_examples/empty-state.with-actions.example.ts +0 -68
- package/src/empty-state/_examples/index.ts +0 -8
- package/src/empty-state/empty-state.css +0 -114
- package/src/empty-state/empty-state.playground.ts +0 -87
- package/src/empty-state/empty-state.spec.ts +0 -211
- package/src/empty-state/empty-state.ts +0 -276
- package/src/empty-state/index.ts +0 -1
- package/src/example-components.ts +0 -396
- package/src/field/_examples/field.disabled.example.ts +0 -49
- package/src/field/_examples/field.example.ts +0 -51
- package/src/field/_examples/field.required.example.ts +0 -46
- package/src/field/_examples/field.with-error.example.ts +0 -73
- package/src/field/_examples/field.with-prefix-suffix.example.ts +0 -63
- package/src/field/_examples/index.ts +0 -7
- package/src/field/field.css +0 -138
- package/src/field/field.playground.ts +0 -108
- package/src/field/field.spec.ts +0 -132
- package/src/field/field.ts +0 -232
- package/src/field/field.usage.example.ts +0 -63
- package/src/field/index.ts +0 -7
- package/src/file-upload/_examples/file-upload.dropzone.example.ts +0 -32
- package/src/file-upload/_examples/file-upload.example.ts +0 -29
- package/src/file-upload/_examples/file-upload.image-preview.example.ts +0 -31
- package/src/file-upload/_examples/file-upload.multiple.example.ts +0 -23
- package/src/file-upload/_examples/file-upload.with-progress.example.ts +0 -59
- package/src/file-upload/_examples/index.ts +0 -7
- package/src/file-upload/file-upload.css +0 -207
- package/src/file-upload/file-upload.playground.ts +0 -84
- package/src/file-upload/file-upload.spec.ts +0 -94
- package/src/file-upload/file-upload.ts +0 -301
- package/src/file-upload/file-upload.usage.example.ts +0 -45
- package/src/file-upload/index.ts +0 -1
- package/src/form/_examples/form.async-submit.example.ts +0 -72
- package/src/form/_examples/form.compound.example.ts +0 -93
- package/src/form/_examples/form.example.ts +0 -70
- package/src/form/_examples/form.validation.example.ts +0 -67
- package/src/form/_examples/index.ts +0 -6
- package/src/form/form.css +0 -63
- package/src/form/form.playground.ts +0 -145
- package/src/form/form.spec.ts +0 -96
- package/src/form/form.ts +0 -216
- package/src/form/form.usage.example.ts +0 -63
- package/src/form/index.ts +0 -5
- package/src/icon/_examples/icon.gallery.example.ts +0 -199
- package/src/icon/_examples/icon.usage.example.ts +0 -46
- package/src/icon/_examples/index.ts +0 -4
- package/src/icon/icon.playground.ts +0 -63
- package/src/icon/index.ts +0 -5
- package/src/icon/lucide/icon-names.generated.ts +0 -1708
- package/src/icon/lucide/icon-names.ts +0 -18
- package/src/icon/lucide/index.ts +0 -2
- package/src/icon/lucide/provide-lucide-icons.ts +0 -96
- package/src/input/_examples/index.ts +0 -4
- package/src/input/_examples/input.color.example.ts +0 -33
- package/src/input/_examples/input.example.ts +0 -22
- package/src/input/index.ts +0 -1
- package/src/input/input.css +0 -70
- package/src/input/input.playground.ts +0 -79
- package/src/input/input.spec.ts +0 -98
- package/src/input/input.ts +0 -158
- package/src/input/input.usage.example.ts +0 -40
- package/src/input-group/_examples/index.ts +0 -7
- package/src/input-group/_examples/input-group.button.example.ts +0 -43
- package/src/input-group/_examples/input-group.example.ts +0 -39
- package/src/input-group/_examples/input-group.icon.example.ts +0 -49
- package/src/input-group/_examples/input-group.url.example.ts +0 -36
- package/src/input-group/_examples/input-group.variants.example.ts +0 -39
- package/src/input-group/index.ts +0 -1
- package/src/input-group/input-group.css +0 -125
- package/src/input-group/input-group.playground.ts +0 -90
- package/src/input-group/input-group.ts +0 -142
- package/src/input-group/input-group.usage.example.ts +0 -47
- package/src/input-mask/_examples/index.ts +0 -8
- package/src/input-mask/_examples/input-mask.credit-card.example.ts +0 -90
- package/src/input-mask/_examples/input-mask.custom-tokens.example.ts +0 -87
- package/src/input-mask/_examples/input-mask.date.example.ts +0 -61
- package/src/input-mask/_examples/input-mask.example.ts +0 -61
- package/src/input-mask/_examples/input-mask.usage.example.ts +0 -44
- package/src/input-mask/_examples/input-mask.validation.example.ts +0 -80
- package/src/input-mask/index.ts +0 -9
- package/src/input-mask/input-mask.css +0 -39
- package/src/input-mask/input-mask.playground.ts +0 -79
- package/src/input-mask/input-mask.ts +0 -130
- package/src/input-otp/_examples/index.ts +0 -8
- package/src/input-otp/_examples/input-otp.autosubmit.example.ts +0 -71
- package/src/input-otp/_examples/input-otp.example.ts +0 -47
- package/src/input-otp/_examples/input-otp.lengths.example.ts +0 -67
- package/src/input-otp/_examples/input-otp.masked.example.ts +0 -46
- package/src/input-otp/_examples/input-otp.reactive.example.ts +0 -58
- package/src/input-otp/_examples/input-otp.separator.example.ts +0 -49
- package/src/input-otp/index.ts +0 -1
- package/src/input-otp/input-otp.css +0 -87
- package/src/input-otp/input-otp.playground.ts +0 -107
- package/src/input-otp/input-otp.ts +0 -244
- package/src/input-otp/input-otp.usage.example.ts +0 -45
- package/src/kbd/_examples/index.ts +0 -6
- package/src/kbd/_examples/kbd.combo.example.ts +0 -24
- package/src/kbd/_examples/kbd.example.ts +0 -22
- package/src/kbd/_examples/kbd.in-tooltip.example.ts +0 -43
- package/src/kbd/_examples/kbd.sizes.example.ts +0 -31
- package/src/kbd/index.ts +0 -1
- package/src/kbd/kbd.css +0 -67
- package/src/kbd/kbd.playground.ts +0 -51
- package/src/kbd/kbd.spec.ts +0 -123
- package/src/kbd/kbd.ts +0 -123
- package/src/kbd/kbd.usage.example.ts +0 -38
- package/src/link/_examples/index.ts +0 -8
- package/src/link/_examples/link.disabled.example.ts +0 -23
- package/src/link/_examples/link.example.ts +0 -26
- package/src/link/_examples/link.external.example.ts +0 -33
- package/src/link/_examples/link.in-prose.example.ts +0 -36
- package/src/link/_examples/link.sizes.example.ts +0 -28
- package/src/link/_examples/link.variants.example.ts +0 -25
- package/src/link/index.ts +0 -1
- package/src/link/link.css +0 -104
- package/src/link/link.playground.ts +0 -98
- package/src/link/link.spec.ts +0 -146
- package/src/link/link.ts +0 -133
- package/src/link/link.usage.example.ts +0 -37
- package/src/list/_examples/index.ts +0 -7
- package/src/list/_examples/list.divided.example.ts +0 -32
- package/src/list/_examples/list.example.ts +0 -31
- package/src/list/_examples/list.interactive.example.ts +0 -51
- package/src/list/_examples/list.nav.example.ts +0 -44
- package/src/list/_examples/list.with-icons.example.ts +0 -97
- package/src/list/index.ts +0 -1
- package/src/list/list.css +0 -166
- package/src/list/list.playground.ts +0 -90
- package/src/list/list.spec.ts +0 -121
- package/src/list/list.ts +0 -227
- package/src/list/list.usage.example.ts +0 -45
- package/src/menubar/_examples/index.ts +0 -6
- package/src/menubar/_examples/menubar.disabled-item.example.ts +0 -23
- package/src/menubar/_examples/menubar.example.ts +0 -22
- package/src/menubar/_examples/menubar.with-shortcuts.example.ts +0 -33
- package/src/menubar/_examples/menubar.with-submenu.example.ts +0 -76
- package/src/menubar/index.ts +0 -1
- package/src/menubar/menubar.css +0 -62
- package/src/menubar/menubar.playground.ts +0 -96
- package/src/menubar/menubar.ts +0 -160
- package/src/menubar/menubar.usage.example.ts +0 -33
- package/src/number-input/_examples/index.ts +0 -7
- package/src/number-input/_examples/number-input.currency.example.ts +0 -35
- package/src/number-input/_examples/number-input.decimal.example.ts +0 -34
- package/src/number-input/_examples/number-input.example.ts +0 -24
- package/src/number-input/_examples/number-input.min-max.example.ts +0 -33
- package/src/number-input/_examples/number-input.with-stepper.example.ts +0 -45
- package/src/number-input/index.ts +0 -1
- package/src/number-input/number-input.css +0 -115
- package/src/number-input/number-input.playground.ts +0 -92
- package/src/number-input/number-input.spec.ts +0 -102
- package/src/number-input/number-input.ts +0 -212
- package/src/number-input/number-input.usage.example.ts +0 -73
- package/src/overlay/overlay.css +0 -32
- package/src/overlay-badge/_examples/index.ts +0 -7
- package/src/overlay-badge/_examples/overlay-badge.described.example.ts +0 -36
- package/src/overlay-badge/_examples/overlay-badge.dot.example.ts +0 -28
- package/src/overlay-badge/_examples/overlay-badge.example.ts +0 -34
- package/src/overlay-badge/_examples/overlay-badge.on-avatar.example.ts +0 -38
- package/src/overlay-badge/_examples/overlay-badge.positions.example.ts +0 -39
- package/src/overlay-badge/index.ts +0 -1
- package/src/overlay-badge/overlay-badge.css +0 -118
- package/src/overlay-badge/overlay-badge.playground.ts +0 -92
- package/src/overlay-badge/overlay-badge.spec.ts +0 -174
- package/src/overlay-badge/overlay-badge.ts +0 -232
- package/src/overlay-badge/overlay-badge.usage.example.ts +0 -44
- package/src/pagination/_examples/index.ts +0 -7
- package/src/pagination/_examples/pagination.boundaries.example.ts +0 -56
- package/src/pagination/_examples/pagination.compact.example.ts +0 -42
- package/src/pagination/_examples/pagination.example.ts +0 -55
- package/src/pagination/_examples/pagination.large.example.ts +0 -54
- package/src/pagination/_examples/pagination.with-info.example.ts +0 -49
- package/src/pagination/index.ts +0 -1
- package/src/pagination/pagination.css +0 -146
- package/src/pagination/pagination.playground.ts +0 -107
- package/src/pagination/pagination.spec.ts +0 -202
- package/src/pagination/pagination.ts +0 -432
- package/src/pagination/pagination.usage.example.ts +0 -50
- package/src/password-input/_examples/index.ts +0 -6
- package/src/password-input/_examples/password-input.example.ts +0 -24
- package/src/password-input/_examples/password-input.strength.example.ts +0 -45
- package/src/password-input/_examples/password-input.toggle.example.ts +0 -43
- package/src/password-input/_examples/password-input.with-rules.example.ts +0 -78
- package/src/password-input/index.ts +0 -1
- package/src/password-input/password-input.css +0 -155
- package/src/password-input/password-input.playground.ts +0 -81
- package/src/password-input/password-input.spec.ts +0 -129
- package/src/password-input/password-input.ts +0 -254
- package/src/password-input/password-input.usage.example.ts +0 -55
- package/src/playground-types.ts +0 -47
- package/src/popover/_examples/index.ts +0 -7
- package/src/popover/_examples/popover.cancellable.example.ts +0 -20
- package/src/popover/_examples/popover.example.ts +0 -20
- package/src/popover/_examples/popover.modal.example.ts +0 -22
- package/src/popover/_examples/popover.sides.example.ts +0 -37
- package/src/popover/_examples/popover.with-form.example.ts +0 -38
- package/src/popover/index.ts +0 -1
- package/src/popover/popover.css +0 -71
- package/src/popover/popover.playground.ts +0 -86
- package/src/popover/popover.spec.ts +0 -5
- package/src/popover/popover.ts +0 -94
- package/src/popover/popover.usage.example.ts +0 -48
- package/src/progress-bar/_examples/index.ts +0 -7
- package/src/progress-bar/_examples/progress-bar.example.ts +0 -22
- package/src/progress-bar/_examples/progress-bar.indeterminate.example.ts +0 -23
- package/src/progress-bar/_examples/progress-bar.sizes.example.ts +0 -29
- package/src/progress-bar/_examples/progress-bar.variants.example.ts +0 -30
- package/src/progress-bar/_examples/progress-bar.with-label.example.ts +0 -30
- package/src/progress-bar/index.ts +0 -1
- package/src/progress-bar/progress-bar.css +0 -113
- package/src/progress-bar/progress-bar.playground.ts +0 -87
- package/src/progress-bar/progress-bar.spec.ts +0 -233
- package/src/progress-bar/progress-bar.ts +0 -155
- package/src/progress-bar/progress-bar.usage.example.ts +0 -52
- package/src/public-api.ts +0 -61
- package/src/radio/_examples/index.ts +0 -6
- package/src/radio/_examples/radio.default.example.ts +0 -26
- package/src/radio/_examples/radio.disabled.example.ts +0 -26
- package/src/radio/_examples/radio.group.example.ts +0 -27
- package/src/radio/_examples/radio.inline.example.ts +0 -26
- package/src/radio/index.ts +0 -1
- package/src/radio/radio.css +0 -58
- package/src/radio/radio.playground.ts +0 -90
- package/src/radio/radio.ts +0 -143
- package/src/radio/radio.usage.example.ts +0 -54
- package/src/select/_examples/index.ts +0 -6
- package/src/select/_examples/select.default.example.ts +0 -26
- package/src/select/_examples/select.disabled.example.ts +0 -24
- package/src/select/_examples/select.grouped.example.ts +0 -37
- package/src/select/_examples/select.placeholder.example.ts +0 -26
- package/src/select/index.ts +0 -1
- package/src/select/select.css +0 -65
- package/src/select/select.playground.ts +0 -81
- package/src/select/select.ts +0 -176
- package/src/select/select.usage.example.ts +0 -64
- package/src/skeleton/_examples/index.ts +0 -6
- package/src/skeleton/_examples/skeleton.animations.example.ts +0 -52
- package/src/skeleton/_examples/skeleton.card.example.ts +0 -68
- package/src/skeleton/_examples/skeleton.example.ts +0 -24
- package/src/skeleton/_examples/skeleton.shapes.example.ts +0 -55
- package/src/skeleton/index.ts +0 -1
- package/src/skeleton/skeleton.css +0 -111
- package/src/skeleton/skeleton.playground.ts +0 -80
- package/src/skeleton/skeleton.spec.ts +0 -126
- package/src/skeleton/skeleton.ts +0 -155
- package/src/skeleton/skeleton.usage.example.ts +0 -49
- package/src/slider/_examples/index.ts +0 -7
- package/src/slider/_examples/slider.example.ts +0 -41
- package/src/slider/_examples/slider.formatted.example.ts +0 -53
- package/src/slider/_examples/slider.range.example.ts +0 -48
- package/src/slider/_examples/slider.vertical.example.ts +0 -48
- package/src/slider/_examples/slider.with-marks.example.ts +0 -46
- package/src/slider/index.ts +0 -1
- package/src/slider/slider.css +0 -172
- package/src/slider/slider.playground.ts +0 -88
- package/src/slider/slider.spec.ts +0 -139
- package/src/slider/slider.ts +0 -246
- package/src/slider/slider.usage.example.ts +0 -68
- package/src/speed-dial/_examples/index.ts +0 -7
- package/src/speed-dial/_examples/speed-dial.directions.example.ts +0 -85
- package/src/speed-dial/_examples/speed-dial.disabled.example.ts +0 -71
- package/src/speed-dial/_examples/speed-dial.example.ts +0 -48
- package/src/speed-dial/_examples/speed-dial.usage.example.ts +0 -59
- package/src/speed-dial/_examples/speed-dial.with-tooltips.example.ts +0 -65
- package/src/speed-dial/index.ts +0 -1
- package/src/speed-dial/speed-dial.css +0 -137
- package/src/speed-dial/speed-dial.playground.ts +0 -137
- package/src/speed-dial/speed-dial.spec.ts +0 -191
- package/src/speed-dial/speed-dial.ts +0 -257
- package/src/spinner/_examples/index.ts +0 -8
- package/src/spinner/_examples/spinner.animations.example.ts +0 -54
- package/src/spinner/_examples/spinner.example.ts +0 -26
- package/src/spinner/_examples/spinner.in-button.example.ts +0 -51
- package/src/spinner/_examples/spinner.sizes.example.ts +0 -31
- package/src/spinner/_examples/spinner.usage.example.ts +0 -45
- package/src/spinner/_examples/spinner.variants.example.ts +0 -34
- package/src/spinner/index.ts +0 -1
- package/src/spinner/spinner.css +0 -161
- package/src/spinner/spinner.playground.ts +0 -68
- package/src/spinner/spinner.spec.ts +0 -184
- package/src/spinner/spinner.ts +0 -185
- package/src/stepper/_examples/index.ts +0 -8
- package/src/stepper/_examples/stepper.example.ts +0 -62
- package/src/stepper/_examples/stepper.non-linear.example.ts +0 -63
- package/src/stepper/_examples/stepper.optional-step.example.ts +0 -62
- package/src/stepper/_examples/stepper.usage.example.ts +0 -73
- package/src/stepper/_examples/stepper.vertical.example.ts +0 -66
- package/src/stepper/_examples/stepper.with-error.example.ts +0 -63
- package/src/stepper/index.ts +0 -1
- package/src/stepper/stepper.css +0 -147
- package/src/stepper/stepper.playground.ts +0 -88
- package/src/stepper/stepper.spec.ts +0 -200
- package/src/stepper/stepper.ts +0 -242
- package/src/table/_examples/index.ts +0 -23
- package/src/table/_examples/table.column-pinning.example.ts +0 -55
- package/src/table/_examples/table.column-resize.example.ts +0 -49
- package/src/table/_examples/table.column-visibility.example.ts +0 -52
- package/src/table/_examples/table.density.example.ts +0 -71
- package/src/table/_examples/table.editable.example.ts +0 -85
- package/src/table/_examples/table.empty-and-error.example.ts +0 -112
- package/src/table/_examples/table.example.ts +0 -45
- package/src/table/_examples/table.export.example.ts +0 -82
- package/src/table/_examples/table.filterable.example.ts +0 -67
- package/src/table/_examples/table.grouping.example.ts +0 -63
- package/src/table/_examples/table.keyboard.example.ts +0 -115
- package/src/table/_examples/table.master-detail.example.ts +0 -102
- package/src/table/_examples/table.persistence.example.ts +0 -85
- package/src/table/_examples/table.playground.ts +0 -154
- package/src/table/_examples/table.row-pinning.example.ts +0 -71
- package/src/table/_examples/table.selection.example.ts +0 -67
- package/src/table/_examples/table.server-mode.example.ts +0 -120
- package/src/table/_examples/table.sortable.example.ts +0 -49
- package/src/table/_examples/table.theming.example.ts +0 -64
- package/src/table/_examples/table.usage.example.ts +0 -90
- package/src/table/_examples/table.virtualized.example.ts +0 -122
- package/src/table/index.ts +0 -11
- package/src/table/table-cell-editor-outlet.ts +0 -111
- package/src/table/table-editors/boolean-editor.ts +0 -71
- package/src/table/table-editors/date-editor.ts +0 -117
- package/src/table/table-editors/editors.spec.ts +0 -147
- package/src/table/table-editors/index.ts +0 -41
- package/src/table/table-editors/number-editor.ts +0 -89
- package/src/table/table-editors/select-editor.ts +0 -107
- package/src/table/table-editors/text-editor.ts +0 -82
- package/src/table/table-export.spec.ts +0 -33
- package/src/table/table-export.ts +0 -53
- package/src/table/table-filter-outlet.ts +0 -137
- package/src/table/table-filters/date-filter.ts +0 -122
- package/src/table/table-filters/filters.css +0 -53
- package/src/table/table-filters/filters.spec.ts +0 -277
- package/src/table/table-filters/index.ts +0 -11
- package/src/table/table-filters/number-filter.ts +0 -232
- package/src/table/table-filters/select-filter.ts +0 -129
- package/src/table/table-filters/text-filter.ts +0 -110
- package/src/table/table-pagination.spec.ts +0 -118
- package/src/table/table-pagination.ts +0 -191
- package/src/table/table-side-panel.spec.ts +0 -170
- package/src/table/table-side-panel.ts +0 -263
- package/src/table/table-status-bar.spec.ts +0 -78
- package/src/table/table-status-bar.ts +0 -70
- package/src/table/table-toolbar.spec.ts +0 -180
- package/src/table/table-toolbar.ts +0 -244
- package/src/table/table-virtual.spec.ts +0 -103
- package/src/table/table-virtual.ts +0 -180
- package/src/table/table.css +0 -468
- package/src/table/table.spec.ts +0 -175
- package/src/table/table.ts +0 -1009
- package/src/tabs/_examples/index.ts +0 -8
- package/src/tabs/_examples/tabs.controlled.example.ts +0 -59
- package/src/tabs/_examples/tabs.disabled.example.ts +0 -34
- package/src/tabs/_examples/tabs.example.ts +0 -34
- package/src/tabs/_examples/tabs.manual-activation.example.ts +0 -34
- package/src/tabs/_examples/tabs.usage.example.ts +0 -43
- package/src/tabs/_examples/tabs.vertical.example.ts +0 -33
- package/src/tabs/index.ts +0 -1
- package/src/tabs/tabs.css +0 -80
- package/src/tabs/tabs.playground.ts +0 -88
- package/src/tabs/tabs.spec.ts +0 -135
- package/src/tabs/tabs.ts +0 -204
- package/src/tag/_examples/index.ts +0 -9
- package/src/tag/_examples/tag.example.ts +0 -22
- package/src/tag/_examples/tag.list.example.ts +0 -38
- package/src/tag/_examples/tag.removable.example.ts +0 -39
- package/src/tag/_examples/tag.selectable.example.ts +0 -33
- package/src/tag/_examples/tag.sizes.example.ts +0 -25
- package/src/tag/_examples/tag.usage.example.ts +0 -62
- package/src/tag/_examples/tag.variants.example.ts +0 -29
- package/src/tag/index.ts +0 -1
- package/src/tag/tag.css +0 -167
- package/src/tag/tag.playground.ts +0 -63
- package/src/tag/tag.spec.ts +0 -153
- package/src/tag/tag.ts +0 -186
- package/src/test-setup.ts +0 -5
- package/src/textarea/_examples/index.ts +0 -8
- package/src/textarea/_examples/textarea.autoresize.example.ts +0 -37
- package/src/textarea/_examples/textarea.character-count.example.ts +0 -34
- package/src/textarea/_examples/textarea.example.ts +0 -22
- package/src/textarea/_examples/textarea.no-resize.example.ts +0 -28
- package/src/textarea/_examples/textarea.usage.example.ts +0 -50
- package/src/textarea/_examples/textarea.with-field.example.ts +0 -66
- package/src/textarea/index.ts +0 -1
- package/src/textarea/textarea.css +0 -117
- package/src/textarea/textarea.playground.ts +0 -70
- package/src/textarea/textarea.spec.ts +0 -161
- package/src/textarea/textarea.ts +0 -339
- package/src/time-picker/_examples/index.ts +0 -8
- package/src/time-picker/_examples/time-picker.12-hour.example.ts +0 -24
- package/src/time-picker/_examples/time-picker.example.ts +0 -24
- package/src/time-picker/_examples/time-picker.formatted.example.ts +0 -32
- package/src/time-picker/_examples/time-picker.range.example.ts +0 -54
- package/src/time-picker/_examples/time-picker.usage.example.ts +0 -53
- package/src/time-picker/_examples/time-picker.with-seconds.example.ts +0 -24
- package/src/time-picker/index.ts +0 -1
- package/src/time-picker/time-picker.css +0 -126
- package/src/time-picker/time-picker.playground.ts +0 -72
- package/src/time-picker/time-picker.spec.ts +0 -77
- package/src/time-picker/time-picker.ts +0 -207
- package/src/toast/_examples/index.ts +0 -7
- package/src/toast/_examples/toast.default.example.ts +0 -37
- package/src/toast/_examples/toast.dismissible.example.ts +0 -38
- package/src/toast/_examples/toast.usage.example.ts +0 -57
- package/src/toast/_examples/toast.variants.example.ts +0 -43
- package/src/toast/_examples/toast.with-action.example.ts +0 -46
- package/src/toast/index.ts +0 -1
- package/src/toast/toast.css +0 -115
- package/src/toast/toast.playground.ts +0 -61
- package/src/toast/toast.ts +0 -168
- package/src/toggle/_examples/index.ts +0 -7
- package/src/toggle/_examples/toggle.checked.example.ts +0 -20
- package/src/toggle/_examples/toggle.default.example.ts +0 -20
- package/src/toggle/_examples/toggle.disabled.example.ts +0 -26
- package/src/toggle/_examples/toggle.usage.example.ts +0 -51
- package/src/toggle/_examples/toggle.with-label.example.ts +0 -30
- package/src/toggle/index.ts +0 -1
- package/src/toggle/toggle.css +0 -123
- package/src/toggle/toggle.playground.ts +0 -65
- package/src/toggle/toggle.ts +0 -113
- package/src/tooltip/_examples/index.ts +0 -9
- package/src/tooltip/_examples/tooltip.delays.example.ts +0 -16
- package/src/tooltip/_examples/tooltip.disabled.example.ts +0 -16
- package/src/tooltip/_examples/tooltip.example.ts +0 -16
- package/src/tooltip/_examples/tooltip.group.example.ts +0 -20
- package/src/tooltip/_examples/tooltip.rich.example.ts +0 -19
- package/src/tooltip/_examples/tooltip.sides.example.ts +0 -18
- package/src/tooltip/_examples/tooltip.usage.example.ts +0 -50
- package/src/tooltip/index.ts +0 -1
- package/src/tooltip/tooltip.css +0 -61
- package/src/tooltip/tooltip.playground.ts +0 -79
- package/src/tooltip/tooltip.spec.ts +0 -5
- package/src/tooltip/tooltip.ts +0 -102
- package/src/tree-select/_examples/index.ts +0 -8
- package/src/tree-select/_examples/tree-select.disabled.example.ts +0 -106
- package/src/tree-select/_examples/tree-select.example.ts +0 -65
- package/src/tree-select/_examples/tree-select.expanded.example.ts +0 -72
- package/src/tree-select/_examples/tree-select.field.example.ts +0 -77
- package/src/tree-select/_examples/tree-select.multi.example.ts +0 -73
- package/src/tree-select/_examples/tree-select.usage.example.ts +0 -85
- package/src/tree-select/index.ts +0 -1
- package/src/tree-select/tree-select.css +0 -220
- package/src/tree-select/tree-select.playground.ts +0 -83
- package/src/tree-select/tree-select.ts +0 -348
- package/src/typography/_examples/index.ts +0 -9
- package/src/typography/_examples/typography.blockquote.example.ts +0 -34
- package/src/typography/_examples/typography.code.example.ts +0 -32
- package/src/typography/_examples/typography.example.ts +0 -42
- package/src/typography/_examples/typography.lead.example.ts +0 -37
- package/src/typography/_examples/typography.muted.example.ts +0 -27
- package/src/typography/_examples/typography.truncate.example.ts +0 -41
- package/src/typography/_examples/typography.usage.example.ts +0 -44
- package/src/typography/index.ts +0 -8
- package/src/typography/typography.playground.ts +0 -101
- package/src/typography/typography.spec.ts +0 -70
- package/src/typography/typography.ts +0 -105
- package/tsconfig.lib.json +0 -25
- package/tsconfig.lib.prod.json +0 -17
- package/tsconfig.spec.json +0 -16
- package/vite.config.ts +0 -33
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, signal } from '@angular/core';
|
|
2
|
-
import { KjButtonComponent } from '../button/button';
|
|
3
|
-
import {
|
|
4
|
-
KjAlertActionsComponent,
|
|
5
|
-
KjAlertComponent,
|
|
6
|
-
KjAlertDescriptionComponent,
|
|
7
|
-
KjAlertDismissComponent,
|
|
8
|
-
KjAlertIconComponent,
|
|
9
|
-
KjAlertTitleComponent,
|
|
10
|
-
} from './alert';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Common alert shapes — info, success, error with retry action, and a
|
|
14
|
-
* dismissible warning. Use this as the copy-paste starting point.
|
|
15
|
-
*/
|
|
16
|
-
@Component({
|
|
17
|
-
selector: 'kj-alert-usage-example',
|
|
18
|
-
standalone: true,
|
|
19
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
20
|
-
imports: [
|
|
21
|
-
KjAlertComponent,
|
|
22
|
-
KjAlertIconComponent,
|
|
23
|
-
KjAlertTitleComponent,
|
|
24
|
-
KjAlertDescriptionComponent,
|
|
25
|
-
KjAlertActionsComponent,
|
|
26
|
-
KjAlertDismissComponent,
|
|
27
|
-
KjButtonComponent,
|
|
28
|
-
],
|
|
29
|
-
styles: [`:host { display: flex; flex-direction: column; gap: var(--kj-space-md); }`],
|
|
30
|
-
template: `
|
|
31
|
-
<kj-alert kjVariant="info">
|
|
32
|
-
<kj-alert-icon>i</kj-alert-icon>
|
|
33
|
-
<kj-alert-title>New theme tokens</kj-alert-title>
|
|
34
|
-
<kj-alert-description>Try the brutalist preset in your settings.</kj-alert-description>
|
|
35
|
-
</kj-alert>
|
|
36
|
-
|
|
37
|
-
<kj-alert kjVariant="error">
|
|
38
|
-
<kj-alert-icon>!</kj-alert-icon>
|
|
39
|
-
<kj-alert-title>Could not save draft</kj-alert-title>
|
|
40
|
-
<kj-alert-description>Network request timed out.</kj-alert-description>
|
|
41
|
-
<kj-alert-actions>
|
|
42
|
-
<kj-button kjSize="sm" (click)="retry()">Retry</kj-button>
|
|
43
|
-
</kj-alert-actions>
|
|
44
|
-
</kj-alert>
|
|
45
|
-
|
|
46
|
-
@if (show()) {
|
|
47
|
-
<kj-alert kjVariant="warning" (kjAlertDismissed)="show.set(false)">
|
|
48
|
-
<kj-alert-icon>!</kj-alert-icon>
|
|
49
|
-
<kj-alert-description>Storage is 92% full.</kj-alert-description>
|
|
50
|
-
<kj-alert-dismiss />
|
|
51
|
-
</kj-alert>
|
|
52
|
-
}
|
|
53
|
-
`,
|
|
54
|
-
})
|
|
55
|
-
export class KjAlertUsageExample {
|
|
56
|
-
readonly show = signal(true);
|
|
57
|
-
retry(): void { /* re-fetch */ }
|
|
58
|
-
}
|
package/src/alert/index.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
-
import { KjAvatarGroupComponent } from '../avatar-group';
|
|
3
|
-
import { KjAvatarComponent } from '../avatar';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Default usage example for KjAvatarGroupComponent.
|
|
7
|
-
* Stacks four `<kj-avatar>` children with the group's defaults
|
|
8
|
-
* (`kjMax=4`, `kjShape='circle'`, `role="group"`).
|
|
9
|
-
*/
|
|
10
|
-
@Component({
|
|
11
|
-
selector: 'kj-avatar-group-example',
|
|
12
|
-
standalone: true,
|
|
13
|
-
imports: [KjAvatarGroupComponent, KjAvatarComponent],
|
|
14
|
-
styles: [
|
|
15
|
-
`
|
|
16
|
-
:host {
|
|
17
|
-
display: block;
|
|
18
|
-
}
|
|
19
|
-
`,
|
|
20
|
-
],
|
|
21
|
-
changeDetection: ChangeDetectionStrategy.Eager,
|
|
22
|
-
template: `
|
|
23
|
-
<kj-avatar-group kjAriaLabel="collaborators">
|
|
24
|
-
<kj-avatar content="AL" alt="Ada Lovelace" />
|
|
25
|
-
<kj-avatar content="GH" alt="Grace Hopper" />
|
|
26
|
-
<kj-avatar content="AT" alt="Alan Turing" />
|
|
27
|
-
<kj-avatar content="KJ" alt="Katherine Johnson" />
|
|
28
|
-
</kj-avatar-group>
|
|
29
|
-
`,
|
|
30
|
-
})
|
|
31
|
-
export class KjAvatarGroupExample {}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
-
import { KjAvatarGroupComponent } from '../avatar-group';
|
|
3
|
-
import { KjAvatarComponent } from '../avatar';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Semantic `role="list"` variant: when the group's children are interactive
|
|
7
|
-
* (e.g. links to teammate profiles), set `kjRole="list"` so AT announces a
|
|
8
|
-
* list of items rather than a generic group. Each child anchor carries
|
|
9
|
-
* `role="listitem"` so the listitem semantics survive the wrapping `<a>`.
|
|
10
|
-
*/
|
|
11
|
-
@Component({
|
|
12
|
-
selector: 'kj-avatar-group-list-example',
|
|
13
|
-
standalone: true,
|
|
14
|
-
imports: [KjAvatarGroupComponent, KjAvatarComponent],
|
|
15
|
-
styles: [
|
|
16
|
-
`
|
|
17
|
-
:host {
|
|
18
|
-
display: block;
|
|
19
|
-
}
|
|
20
|
-
a {
|
|
21
|
-
display: inline-flex;
|
|
22
|
-
text-decoration: none;
|
|
23
|
-
color: inherit;
|
|
24
|
-
}
|
|
25
|
-
`,
|
|
26
|
-
],
|
|
27
|
-
changeDetection: ChangeDetectionStrategy.Eager,
|
|
28
|
-
template: `
|
|
29
|
-
<kj-avatar-group kjRole="list" kjAriaLabel="teammates">
|
|
30
|
-
<a role="listitem" href="#ada" aria-label="Ada Lovelace">
|
|
31
|
-
<kj-avatar content="AL" alt="Ada Lovelace" />
|
|
32
|
-
</a>
|
|
33
|
-
<a role="listitem" href="#grace" aria-label="Grace Hopper">
|
|
34
|
-
<kj-avatar content="GH" alt="Grace Hopper" />
|
|
35
|
-
</a>
|
|
36
|
-
<a role="listitem" href="#alan" aria-label="Alan Turing">
|
|
37
|
-
<kj-avatar content="AT" alt="Alan Turing" />
|
|
38
|
-
</a>
|
|
39
|
-
<a role="listitem" href="#katherine" aria-label="Katherine Johnson">
|
|
40
|
-
<kj-avatar content="KJ" alt="Katherine Johnson" />
|
|
41
|
-
</a>
|
|
42
|
-
</kj-avatar-group>
|
|
43
|
-
`,
|
|
44
|
-
})
|
|
45
|
-
export class KjAvatarGroupListExample {}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
-
import { KjAvatarGroupComponent } from '../avatar-group';
|
|
3
|
-
import { KjAvatarComponent } from '../avatar';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Overflow example: seven projected avatars with `kjMax=3` cap show three
|
|
7
|
-
* faces plus a `+4` chip. The count-aware label reads `3 of 7 collaborators`.
|
|
8
|
-
*/
|
|
9
|
-
@Component({
|
|
10
|
-
selector: 'kj-avatar-group-overflow-example',
|
|
11
|
-
standalone: true,
|
|
12
|
-
imports: [KjAvatarGroupComponent, KjAvatarComponent],
|
|
13
|
-
styles: [
|
|
14
|
-
`
|
|
15
|
-
:host {
|
|
16
|
-
display: block;
|
|
17
|
-
}
|
|
18
|
-
`,
|
|
19
|
-
],
|
|
20
|
-
changeDetection: ChangeDetectionStrategy.Eager,
|
|
21
|
-
template: `
|
|
22
|
-
<kj-avatar-group [kjMax]="3" kjAriaLabel="collaborators">
|
|
23
|
-
<kj-avatar content="AL" alt="Ada Lovelace" />
|
|
24
|
-
<kj-avatar content="GH" alt="Grace Hopper" />
|
|
25
|
-
<kj-avatar content="AT" alt="Alan Turing" />
|
|
26
|
-
<kj-avatar content="KJ" alt="Katherine Johnson" />
|
|
27
|
-
<kj-avatar content="MH" alt="Margaret Hamilton" />
|
|
28
|
-
<kj-avatar content="DK" alt="Donald Knuth" />
|
|
29
|
-
<kj-avatar content="BL" alt="Barbara Liskov" />
|
|
30
|
-
</kj-avatar-group>
|
|
31
|
-
`,
|
|
32
|
-
})
|
|
33
|
-
export class KjAvatarGroupOverflowExample {}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
-
import { KjAvatarGroupComponent } from '../avatar-group';
|
|
3
|
-
import { KjAvatarComponent } from '../avatar';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Shape propagation: `kjShape` on the group cascades to children — and to
|
|
7
|
-
* the overflow chip — via the `KJ_AVATAR_GROUP` context. Two groups
|
|
8
|
-
* demonstrate the `'circle'` (default) and `'rounded'` variants without
|
|
9
|
-
* setting `shape` on individual avatars.
|
|
10
|
-
*/
|
|
11
|
-
@Component({
|
|
12
|
-
selector: 'kj-avatar-group-shapes-example',
|
|
13
|
-
standalone: true,
|
|
14
|
-
imports: [KjAvatarGroupComponent, KjAvatarComponent],
|
|
15
|
-
styles: [
|
|
16
|
-
`
|
|
17
|
-
:host {
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-direction: column;
|
|
20
|
-
gap: var(--kj-space-md);
|
|
21
|
-
}
|
|
22
|
-
`,
|
|
23
|
-
],
|
|
24
|
-
changeDetection: ChangeDetectionStrategy.Eager,
|
|
25
|
-
template: `
|
|
26
|
-
<kj-avatar-group kjShape="circle" kjAriaLabel="circle collaborators">
|
|
27
|
-
<kj-avatar content="AL" alt="Ada Lovelace" />
|
|
28
|
-
<kj-avatar content="GH" alt="Grace Hopper" />
|
|
29
|
-
<kj-avatar content="AT" alt="Alan Turing" />
|
|
30
|
-
</kj-avatar-group>
|
|
31
|
-
|
|
32
|
-
<kj-avatar-group kjShape="rounded" kjAriaLabel="rounded collaborators">
|
|
33
|
-
<kj-avatar content="AL" alt="Ada Lovelace" />
|
|
34
|
-
<kj-avatar content="GH" alt="Grace Hopper" />
|
|
35
|
-
<kj-avatar content="AT" alt="Alan Turing" />
|
|
36
|
-
</kj-avatar-group>
|
|
37
|
-
`,
|
|
38
|
-
})
|
|
39
|
-
export class KjAvatarGroupShapesExample {}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
-
import { KjAvatarGroupComponent } from '../avatar-group';
|
|
3
|
-
import { KjAvatarComponent } from '../avatar';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Size propagation: `kjSize` on the group cascades to children via the
|
|
7
|
-
* `KJ_AVATAR_GROUP` context. Three groups render at small, medium, and
|
|
8
|
-
* large without setting `size` on each child.
|
|
9
|
-
*/
|
|
10
|
-
@Component({
|
|
11
|
-
selector: 'kj-avatar-group-sizes-example',
|
|
12
|
-
standalone: true,
|
|
13
|
-
imports: [KjAvatarGroupComponent, KjAvatarComponent],
|
|
14
|
-
styles: [
|
|
15
|
-
`
|
|
16
|
-
:host {
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
gap: var(--kj-space-md);
|
|
20
|
-
}
|
|
21
|
-
`,
|
|
22
|
-
],
|
|
23
|
-
changeDetection: ChangeDetectionStrategy.Eager,
|
|
24
|
-
template: `
|
|
25
|
-
<kj-avatar-group kjSize="sm" kjAriaLabel="small collaborators">
|
|
26
|
-
<kj-avatar content="AL" alt="Ada Lovelace" />
|
|
27
|
-
<kj-avatar content="GH" alt="Grace Hopper" />
|
|
28
|
-
<kj-avatar content="AT" alt="Alan Turing" />
|
|
29
|
-
</kj-avatar-group>
|
|
30
|
-
|
|
31
|
-
<kj-avatar-group kjSize="md" kjAriaLabel="medium collaborators">
|
|
32
|
-
<kj-avatar content="AL" alt="Ada Lovelace" />
|
|
33
|
-
<kj-avatar content="GH" alt="Grace Hopper" />
|
|
34
|
-
<kj-avatar content="AT" alt="Alan Turing" />
|
|
35
|
-
</kj-avatar-group>
|
|
36
|
-
|
|
37
|
-
<kj-avatar-group kjSize="lg" kjAriaLabel="large collaborators">
|
|
38
|
-
<kj-avatar content="AL" alt="Ada Lovelace" />
|
|
39
|
-
<kj-avatar content="GH" alt="Grace Hopper" />
|
|
40
|
-
<kj-avatar content="AT" alt="Alan Turing" />
|
|
41
|
-
</kj-avatar-group>
|
|
42
|
-
`,
|
|
43
|
-
})
|
|
44
|
-
export class KjAvatarGroupSizesExample {}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
-
import { KjAvatarComponent } from '../avatar';
|
|
3
|
-
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'kj-avatar-default-example',
|
|
6
|
-
standalone: true,
|
|
7
|
-
imports: [KjAvatarComponent],
|
|
8
|
-
styles: [
|
|
9
|
-
`
|
|
10
|
-
:host {
|
|
11
|
-
display: block;
|
|
12
|
-
}
|
|
13
|
-
`,
|
|
14
|
-
],
|
|
15
|
-
changeDetection: ChangeDetectionStrategy.Eager,
|
|
16
|
-
template: ` <kj-avatar content="JD" /> `,
|
|
17
|
-
})
|
|
18
|
-
export class KjAvatarDefaultExample {}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
-
import { KjAvatarComponent } from '../avatar';
|
|
3
|
-
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'kj-avatar-initials-example',
|
|
6
|
-
standalone: true,
|
|
7
|
-
imports: [KjAvatarComponent],
|
|
8
|
-
styles: [
|
|
9
|
-
`
|
|
10
|
-
:host {
|
|
11
|
-
display: block;
|
|
12
|
-
}
|
|
13
|
-
`,
|
|
14
|
-
],
|
|
15
|
-
changeDetection: ChangeDetectionStrategy.Eager,
|
|
16
|
-
template: `
|
|
17
|
-
<kj-avatar size="lg" src="https://example.invalid/missing.png" alt="Missing" content="NA" />
|
|
18
|
-
`,
|
|
19
|
-
})
|
|
20
|
-
export class KjAvatarInitialsExample {}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
-
import { KjAvatarComponent } from '../avatar';
|
|
3
|
-
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'kj-avatar-shapes-example',
|
|
6
|
-
standalone: true,
|
|
7
|
-
imports: [KjAvatarComponent],
|
|
8
|
-
styles: [
|
|
9
|
-
`
|
|
10
|
-
:host {
|
|
11
|
-
display: flex;
|
|
12
|
-
gap: 0.75rem;
|
|
13
|
-
}
|
|
14
|
-
`,
|
|
15
|
-
],
|
|
16
|
-
changeDetection: ChangeDetectionStrategy.Eager,
|
|
17
|
-
template: `
|
|
18
|
-
<kj-avatar shape="circle" content="C" />
|
|
19
|
-
<kj-avatar shape="rounded" content="R" />
|
|
20
|
-
`,
|
|
21
|
-
})
|
|
22
|
-
export class KjAvatarShapesExample {}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
-
import { KjAvatarComponent } from '../avatar';
|
|
3
|
-
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'kj-avatar-sizes-example',
|
|
6
|
-
standalone: true,
|
|
7
|
-
imports: [KjAvatarComponent],
|
|
8
|
-
styles: [
|
|
9
|
-
`
|
|
10
|
-
:host {
|
|
11
|
-
display: flex;
|
|
12
|
-
gap: 0.75rem;
|
|
13
|
-
align-items: center;
|
|
14
|
-
}
|
|
15
|
-
`,
|
|
16
|
-
],
|
|
17
|
-
changeDetection: ChangeDetectionStrategy.Eager,
|
|
18
|
-
template: `
|
|
19
|
-
<kj-avatar size="xs" content="XS" />
|
|
20
|
-
<kj-avatar size="sm" content="SM" />
|
|
21
|
-
<kj-avatar size="md" content="MD" />
|
|
22
|
-
<kj-avatar size="lg" content="LG" />
|
|
23
|
-
<kj-avatar size="xl" content="XL" />
|
|
24
|
-
`,
|
|
25
|
-
})
|
|
26
|
-
export class KjAvatarSizesExample {}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
-
import { KjAvatarComponent } from '../avatar';
|
|
3
|
-
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'kj-avatar-with-image-example',
|
|
6
|
-
standalone: true,
|
|
7
|
-
imports: [KjAvatarComponent],
|
|
8
|
-
styles: [
|
|
9
|
-
`
|
|
10
|
-
:host {
|
|
11
|
-
display: block;
|
|
12
|
-
}
|
|
13
|
-
`,
|
|
14
|
-
],
|
|
15
|
-
changeDetection: ChangeDetectionStrategy.Eager,
|
|
16
|
-
template: `
|
|
17
|
-
<kj-avatar size="lg" src="https://i.pravatar.cc/96?img=12" alt="Jane Doe" content="JD" />
|
|
18
|
-
`,
|
|
19
|
-
})
|
|
20
|
-
export class KjAvatarWithImageExample {}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// AUTO-GENERATED by scripts/migrate-examples.mjs
|
|
2
|
-
// One barrel per component folder — used by the docs app as a lazy chunk.
|
|
3
|
-
export { KjAvatarDefaultExample } from './avatar.default.example';
|
|
4
|
-
export { KjAvatarGroupExample } from './avatar-group.example';
|
|
5
|
-
export { KjAvatarGroupListExample } from './avatar-group.list.example';
|
|
6
|
-
export { KjAvatarGroupOverflowExample } from './avatar-group.overflow.example';
|
|
7
|
-
export { KjAvatarGroupShapesExample } from './avatar-group.shapes.example';
|
|
8
|
-
export { KjAvatarGroupSizesExample } from './avatar-group.sizes.example';
|
|
9
|
-
export { KjAvatarInitialsExample } from './avatar.initials.example';
|
|
10
|
-
export { KjAvatarShapesExample } from './avatar.shapes.example';
|
|
11
|
-
export { KjAvatarSizesExample } from './avatar.sizes.example';
|
|
12
|
-
export { KjAvatarWithImageExample } from './avatar.with-image.example';
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { Component } from '@angular/core';
|
|
2
|
-
import { render } from '@testing-library/angular';
|
|
3
|
-
|
|
4
|
-
import { KjAvatarComponent } from './avatar';
|
|
5
|
-
import { KjAvatarGroupComponent } from './avatar-group';
|
|
6
|
-
|
|
7
|
-
const imports = [KjAvatarComponent, KjAvatarGroupComponent];
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Allow Angular's signal-driven `effect()`s and `contentChildren` queries to
|
|
11
|
-
* settle before the assertions read host attributes. Mirrors the helper used
|
|
12
|
-
* by the core `KjAvatarGroup` spec.
|
|
13
|
-
*/
|
|
14
|
-
async function flush(): Promise<void> {
|
|
15
|
-
await new Promise<void>((resolve) => setTimeout(resolve, 0));
|
|
16
|
-
await Promise.resolve();
|
|
17
|
-
await Promise.resolve();
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
describe('KjAvatarGroupComponent', () => {
|
|
21
|
-
it('renders projected <kj-avatar> children', async () => {
|
|
22
|
-
@Component({
|
|
23
|
-
standalone: true,
|
|
24
|
-
imports,
|
|
25
|
-
template: `
|
|
26
|
-
<kj-avatar-group>
|
|
27
|
-
<kj-avatar content="A" />
|
|
28
|
-
<kj-avatar content="B" />
|
|
29
|
-
<kj-avatar content="C" />
|
|
30
|
-
</kj-avatar-group>`,
|
|
31
|
-
})
|
|
32
|
-
class Host {}
|
|
33
|
-
|
|
34
|
-
const { container } = await render(Host);
|
|
35
|
-
await flush();
|
|
36
|
-
|
|
37
|
-
const groupEl = container.querySelector('kj-avatar-group') as HTMLElement;
|
|
38
|
-
expect(groupEl).toBeTruthy();
|
|
39
|
-
// The class binding mirrors the wrapper's host class.
|
|
40
|
-
expect(groupEl.classList.contains('kj-avatar-group')).toBe(true);
|
|
41
|
-
|
|
42
|
-
// Three projected avatars + (potentially) the chip. With default kjMax=4
|
|
43
|
-
// and three children, the chip should NOT render.
|
|
44
|
-
expect(groupEl.querySelectorAll('kj-avatar')).toHaveLength(3);
|
|
45
|
-
expect(groupEl.querySelector('.kj-avatar-group-overflow')).toBeNull();
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it('renders the overflow chip with "+N" when children exceed kjMax', async () => {
|
|
49
|
-
@Component({
|
|
50
|
-
standalone: true,
|
|
51
|
-
imports,
|
|
52
|
-
template: `
|
|
53
|
-
<kj-avatar-group [kjMax]="2">
|
|
54
|
-
<kj-avatar content="A" />
|
|
55
|
-
<kj-avatar content="B" />
|
|
56
|
-
<kj-avatar content="C" />
|
|
57
|
-
<kj-avatar content="D" />
|
|
58
|
-
<kj-avatar content="E" />
|
|
59
|
-
</kj-avatar-group>`,
|
|
60
|
-
})
|
|
61
|
-
class Host {}
|
|
62
|
-
|
|
63
|
-
const { container } = await render(Host);
|
|
64
|
-
await flush();
|
|
65
|
-
|
|
66
|
-
const chip = container.querySelector('.kj-avatar-group-overflow') as HTMLElement;
|
|
67
|
-
expect(chip).toBeTruthy();
|
|
68
|
-
// 5 projected children, kjMax=2 → overflow = 3.
|
|
69
|
-
expect(chip.textContent?.trim()).toBe('+3');
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it('overflow chip is aria-hidden so it does not duplicate the count-aware label', async () => {
|
|
73
|
-
@Component({
|
|
74
|
-
standalone: true,
|
|
75
|
-
imports,
|
|
76
|
-
template: `
|
|
77
|
-
<kj-avatar-group [kjMax]="1">
|
|
78
|
-
<kj-avatar content="A" />
|
|
79
|
-
<kj-avatar content="B" />
|
|
80
|
-
<kj-avatar content="C" />
|
|
81
|
-
</kj-avatar-group>`,
|
|
82
|
-
})
|
|
83
|
-
class Host {}
|
|
84
|
-
|
|
85
|
-
const { container } = await render(Host);
|
|
86
|
-
await flush();
|
|
87
|
-
|
|
88
|
-
const chip = container.querySelector('.kj-avatar-group-overflow') as HTMLElement;
|
|
89
|
-
expect(chip).toBeTruthy();
|
|
90
|
-
expect(chip.getAttribute('aria-hidden')).toBe('true');
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
it('forwards aliased inputs (kjMax, kjAriaLabel, kjTotal) to the underlying directive', async () => {
|
|
94
|
-
@Component({
|
|
95
|
-
standalone: true,
|
|
96
|
-
imports,
|
|
97
|
-
template: `
|
|
98
|
-
<kj-avatar-group [kjMax]="3" kjAriaLabel="collaborators" [kjTotal]="42">
|
|
99
|
-
<kj-avatar content="A" />
|
|
100
|
-
<kj-avatar content="B" />
|
|
101
|
-
<kj-avatar content="C" />
|
|
102
|
-
</kj-avatar-group>`,
|
|
103
|
-
})
|
|
104
|
-
class Host {}
|
|
105
|
-
|
|
106
|
-
const { container } = await render(Host);
|
|
107
|
-
await flush();
|
|
108
|
-
|
|
109
|
-
const groupEl = container.querySelector('kj-avatar-group') as HTMLElement;
|
|
110
|
-
// Count-aware label proves kjAriaLabel + kjTotal reached the directive.
|
|
111
|
-
expect(groupEl.getAttribute('aria-label')).toBe('3 of 42 collaborators');
|
|
112
|
-
expect(groupEl.getAttribute('role')).toBe('group');
|
|
113
|
-
|
|
114
|
-
// Chip with kjMax=3 and 3 projected (and kjTotal=42) → overflow = 39.
|
|
115
|
-
const chip = container.querySelector('.kj-avatar-group-overflow') as HTMLElement;
|
|
116
|
-
expect(chip).toBeTruthy();
|
|
117
|
-
expect(chip.textContent?.trim()).toBe('+39');
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
it('renders nothing problematic when the group is empty', async () => {
|
|
121
|
-
@Component({
|
|
122
|
-
standalone: true,
|
|
123
|
-
imports,
|
|
124
|
-
template: `<kj-avatar-group [kjMax]="3"></kj-avatar-group>`,
|
|
125
|
-
})
|
|
126
|
-
class Host {}
|
|
127
|
-
|
|
128
|
-
const { container } = await render(Host);
|
|
129
|
-
await flush();
|
|
130
|
-
|
|
131
|
-
const groupEl = container.querySelector('kj-avatar-group') as HTMLElement;
|
|
132
|
-
expect(groupEl).toBeTruthy();
|
|
133
|
-
// No chip when there is nothing to overflow.
|
|
134
|
-
expect(container.querySelector('.kj-avatar-group-overflow')).toBeNull();
|
|
135
|
-
// Empty group omits aria-label entirely (count-aware label suppressed at total === 0).
|
|
136
|
-
expect(groupEl.hasAttribute('aria-label')).toBe(false);
|
|
137
|
-
});
|
|
138
|
-
});
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, ViewEncapsulation, computed, inject } from '@angular/core';
|
|
2
|
-
import { KjAvatarGroup, KJ_AVATAR_GROUP, type KjAvatarGroupAriaLabelFormat, type KjAvatarShape } from '@kouji-ui/core';
|
|
3
|
-
import { KjAvatarComponent } from './avatar';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Avatar group wrapper. Stacks projected `<kj-avatar>` children with a
|
|
7
|
-
* count-aware `aria-label`, an overflow chip when `kjMax` is exceeded, and
|
|
8
|
-
* RTL-aware z-index ordering — all handled by the composed `KjAvatarGroup`
|
|
9
|
-
* core directive. The wrapper supplies the chip element and the host
|
|
10
|
-
* `<ng-content/>` slot.
|
|
11
|
-
*
|
|
12
|
-
* The overflow chip is a regular `<kj-avatar>` rendering `'+N'` text; it is
|
|
13
|
-
* `aria-hidden` because the group's count-aware label already conveys
|
|
14
|
-
* totality (e.g. `"3 of 8 collaborators"`), so exposing the chip again would
|
|
15
|
-
* duplicate the announcement.
|
|
16
|
-
*
|
|
17
|
-
* @doc-example Default
|
|
18
|
-
* The default playground — five stacked avatars with the group's defaults.
|
|
19
|
-
* @doc-file avatar-group.example.ts
|
|
20
|
-
* @doc-example Usage
|
|
21
|
-
* The common shape: a small face-pile with an overflow chip, accessible label,
|
|
22
|
-
* and a list-mode variant for documents-shared screens.
|
|
23
|
-
* @doc-file avatar-group.usage.example.ts
|
|
24
|
-
* @doc-example Overflow
|
|
25
|
-
* `kjMax` caps visible avatars; the remainder collapses into a "+N" chip.
|
|
26
|
-
* @doc-file avatar-group.overflow.example.ts
|
|
27
|
-
* @doc-example Sizes
|
|
28
|
-
* Group `kjSize` cascades onto every projected `<kj-avatar>` for a uniform pile.
|
|
29
|
-
* @doc-file avatar-group.sizes.example.ts
|
|
30
|
-
* @doc-example Shapes
|
|
31
|
-
* Group `kjShape` cascades to children; the +N chip mirrors it for a consistent silhouette.
|
|
32
|
-
* @doc-file avatar-group.shapes.example.ts
|
|
33
|
-
* @doc-example List
|
|
34
|
-
* `kjRole="list"` switches to a list landmark — use for "shared by" rows in docs UIs.
|
|
35
|
-
* @doc-file avatar-group.list.example.ts
|
|
36
|
-
*
|
|
37
|
-
* @doc-aria
|
|
38
|
-
* aria-label — Count-aware label like "3 of 8 collaborators"; override via `kjAriaLabelOverride`
|
|
39
|
-
* role — Defaults to `img` (face-pile); set `kjRole="list"` for a true list landmark
|
|
40
|
-
* aria-hidden — Forced on the +N chip so the count isn't re-announced
|
|
41
|
-
*
|
|
42
|
-
* @doc-touch
|
|
43
|
-
* Stacked avatars are decorative — they aren't tab stops. Pair the group
|
|
44
|
-
* with an interactive trigger (button/link) sized ≥ 44×44 when clicking is
|
|
45
|
-
* meaningful (e.g. opens a collaborator dialog).
|
|
46
|
-
*
|
|
47
|
-
* @doc-a11y
|
|
48
|
-
* The face-pile is an `img` landmark with a count-aware accessible name so
|
|
49
|
-
* AT users hear "3 of 8 collaborators" rather than every initial. Switch to
|
|
50
|
-
* `role="list"` whenever the order/identity of each face matters
|
|
51
|
-
* semantically. The overflow chip is always `aria-hidden` because the
|
|
52
|
-
* group's name already conveys totality.
|
|
53
|
-
*
|
|
54
|
-
* @doc-related avatar,badge,tag
|
|
55
|
-
*
|
|
56
|
-
* @doc-css-var
|
|
57
|
-
* --kj-avatar-size — Avatar diameter. Sizes (xs/sm/md/lg/xl) override.
|
|
58
|
-
* --kj-avatar-bg — Avatar background. Defaults to --kj-bg-field; the +N chip inherits this too.
|
|
59
|
-
* --kj-avatar-fg — Avatar foreground (initials, fallback glyph). Defaults to --kj-fg-default.
|
|
60
|
-
* --kj-avatar-radius — Corner radius. `circle` shape pins it to 9999px; `rounded` swaps to --kj-radius-box.
|
|
61
|
-
*
|
|
62
|
-
* @doc-category Library/Data display
|
|
63
|
-
* @doc
|
|
64
|
-
* @doc-name avatar
|
|
65
|
-
* @doc-description Themed avatar facepile that stacks avatars with an overflow chip and an accessible count label.
|
|
66
|
-
* @doc-is-main
|
|
67
|
-
*/
|
|
68
|
-
@Component({
|
|
69
|
-
selector: 'kj-avatar-group',
|
|
70
|
-
standalone: true,
|
|
71
|
-
hostDirectives: [
|
|
72
|
-
{
|
|
73
|
-
directive: KjAvatarGroup,
|
|
74
|
-
inputs: [
|
|
75
|
-
'kjMax',
|
|
76
|
-
'kjTotal',
|
|
77
|
-
'kjSize',
|
|
78
|
-
'kjShape',
|
|
79
|
-
'kjAriaLabel',
|
|
80
|
-
'kjAriaLabelFormat',
|
|
81
|
-
'kjRole',
|
|
82
|
-
'kjAriaLabelOverride',
|
|
83
|
-
],
|
|
84
|
-
},
|
|
85
|
-
],
|
|
86
|
-
imports: [KjAvatarComponent],
|
|
87
|
-
template: `
|
|
88
|
-
<ng-content />
|
|
89
|
-
@if (overflowCount() > 0) {
|
|
90
|
-
<kj-avatar
|
|
91
|
-
class="kj-avatar-group-overflow"
|
|
92
|
-
aria-hidden="true"
|
|
93
|
-
[content]="overflowLabel()"
|
|
94
|
-
[shape]="chipShape()"
|
|
95
|
-
/>
|
|
96
|
-
}
|
|
97
|
-
`,
|
|
98
|
-
encapsulation: ViewEncapsulation.None,
|
|
99
|
-
host: {
|
|
100
|
-
'class': 'kj-avatar-group',
|
|
101
|
-
},
|
|
102
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
103
|
-
})
|
|
104
|
-
export class KjAvatarGroupComponent {
|
|
105
|
-
/**
|
|
106
|
-
* Read-only handle to the composed `KjAvatarGroup` directive. The directive
|
|
107
|
-
* `provide`s itself under `KJ_AVATAR_GROUP`, so injecting the token returns
|
|
108
|
-
* the same instance and gives us access to `overflowCount`, `shape`, etc.
|
|
109
|
-
*/
|
|
110
|
-
private readonly group = inject(KJ_AVATAR_GROUP);
|
|
111
|
-
|
|
112
|
-
protected readonly overflowCount = this.group.overflowCount;
|
|
113
|
-
|
|
114
|
-
protected readonly overflowLabel = computed(() => `+${this.overflowCount()}`);
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Chip shape mirrors the group's default shape so the chip visually
|
|
118
|
-
* matches the avatars. `<kj-avatar>`'s own `shape` default is `'circle'`,
|
|
119
|
-
* which is also the group's default — so a missing group shape cleanly
|
|
120
|
-
* collapses to `'circle'`.
|
|
121
|
-
*/
|
|
122
|
-
protected readonly chipShape = computed<'circle' | 'rounded'>(
|
|
123
|
-
() => (this.group.shape() as KjAvatarShape | undefined) ?? 'circle',
|
|
124
|
-
);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export type { KjAvatarGroupAriaLabelFormat };
|