@kouji-ui/components 0.1.1 → 0.1.3
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 +21 -11
- 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
package/src/alert/alert.css
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
@layer kj.component {
|
|
2
|
-
.kj-alert {
|
|
3
|
-
/* component knobs — themes/users override any of these */
|
|
4
|
-
--kj-alert-bg: var(--kj-bg-body);
|
|
5
|
-
--kj-alert-fg: var(--kj-fg-default);
|
|
6
|
-
--kj-alert-border-color: var(--kj-border-default);
|
|
7
|
-
--kj-alert-accent: var(--kj-fg-info);
|
|
8
|
-
--kj-alert-radius: var(--kj-radius-box, 0.5rem);
|
|
9
|
-
--kj-alert-padding-x: var(--kj-space-lg, 1rem);
|
|
10
|
-
--kj-alert-padding-y: var(--kj-space-md, 0.75rem);
|
|
11
|
-
--kj-alert-gap: var(--kj-space-md, 0.75rem);
|
|
12
|
-
--kj-alert-font-size: var(--kj-text-sm, 0.875rem);
|
|
13
|
-
|
|
14
|
-
display: flex;
|
|
15
|
-
align-items: flex-start;
|
|
16
|
-
gap: var(--kj-alert-gap);
|
|
17
|
-
background: var(--kj-alert-bg);
|
|
18
|
-
color: var(--kj-alert-fg);
|
|
19
|
-
border: var(--kj-border, 1px) solid var(--kj-alert-border-color);
|
|
20
|
-
border-left: 4px solid var(--kj-alert-accent);
|
|
21
|
-
border-radius: var(--kj-alert-radius);
|
|
22
|
-
padding: var(--kj-alert-padding-y) var(--kj-alert-padding-x);
|
|
23
|
-
font: var(--kj-alert-font-size) / 1.45 var(--kj-font-sans, sans-serif);
|
|
24
|
-
transition: opacity 200ms ease, transform 200ms ease;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.kj-alert[data-dismissed="true"] {
|
|
28
|
-
opacity: 0;
|
|
29
|
-
transform: translateY(-4px);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/* Severity variants — flip accent + (optionally) bg/fg. */
|
|
33
|
-
.kj-alert[data-variant="info"] { --kj-alert-accent: var(--kj-fg-info, #2563eb); }
|
|
34
|
-
.kj-alert[data-variant="success"] { --kj-alert-accent: var(--kj-fg-success, #16a34a); }
|
|
35
|
-
.kj-alert[data-variant="warning"] { --kj-alert-accent: var(--kj-fg-warning, #d97706); }
|
|
36
|
-
.kj-alert[data-variant="error"] { --kj-alert-accent: var(--kj-fg-danger, #dc2626); }
|
|
37
|
-
.kj-alert[data-variant="neutral"] { --kj-alert-accent: var(--kj-fg-muted, #6b7280); }
|
|
38
|
-
|
|
39
|
-
/* Static / banner mode — span full width, sticky-friendly chrome. */
|
|
40
|
-
.kj-alert[data-mode="static"] {
|
|
41
|
-
border-left-width: var(--kj-border, 1px);
|
|
42
|
-
border-top: 4px solid var(--kj-alert-accent);
|
|
43
|
-
border-radius: 0;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/* Sizes */
|
|
47
|
-
.kj-alert[data-size="sm"] {
|
|
48
|
-
--kj-alert-padding-x: var(--kj-space-md, 0.75rem);
|
|
49
|
-
--kj-alert-padding-y: var(--kj-space-sm, 0.5rem);
|
|
50
|
-
--kj-alert-font-size: 0.8125rem;
|
|
51
|
-
}
|
|
52
|
-
.kj-alert[data-size="lg"] {
|
|
53
|
-
--kj-alert-padding-x: var(--kj-space-xl, 1.25rem);
|
|
54
|
-
--kj-alert-padding-y: var(--kj-space-lg, 1rem);
|
|
55
|
-
--kj-alert-font-size: 1rem;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/* ── Body wrapper ─────────────────────────────────────────────── */
|
|
59
|
-
.kj-alert__body {
|
|
60
|
-
flex: 1 1 auto;
|
|
61
|
-
min-width: 0;
|
|
62
|
-
display: flex;
|
|
63
|
-
flex-direction: column;
|
|
64
|
-
gap: 0.25rem;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/* ── Title / Description ──────────────────────────────────────── */
|
|
68
|
-
.kj-alert__title {
|
|
69
|
-
margin: 0;
|
|
70
|
-
font-weight: 600;
|
|
71
|
-
font-size: 1em;
|
|
72
|
-
color: var(--kj-alert-accent);
|
|
73
|
-
line-height: 1.3;
|
|
74
|
-
}
|
|
75
|
-
.kj-alert__description {
|
|
76
|
-
margin: 0;
|
|
77
|
-
color: var(--kj-alert-fg);
|
|
78
|
-
opacity: 0.9;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/* ── Icon ─────────────────────────────────────────────────────── */
|
|
82
|
-
.kj-alert__icon {
|
|
83
|
-
flex: 0 0 auto;
|
|
84
|
-
display: inline-flex;
|
|
85
|
-
align-items: center;
|
|
86
|
-
justify-content: center;
|
|
87
|
-
width: 1.25em;
|
|
88
|
-
height: 1.25em;
|
|
89
|
-
color: var(--kj-alert-accent);
|
|
90
|
-
margin-top: 0.1em;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/* ── Actions ──────────────────────────────────────────────────── */
|
|
94
|
-
.kj-alert__actions {
|
|
95
|
-
flex: 0 0 auto;
|
|
96
|
-
display: inline-flex;
|
|
97
|
-
align-items: center;
|
|
98
|
-
gap: var(--kj-space-sm, 0.5rem);
|
|
99
|
-
margin-left: auto;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/* ── Dismiss ──────────────────────────────────────────────────── */
|
|
103
|
-
.kj-alert__dismiss {
|
|
104
|
-
flex: 0 0 auto;
|
|
105
|
-
appearance: none;
|
|
106
|
-
background: transparent;
|
|
107
|
-
border: 0;
|
|
108
|
-
color: inherit;
|
|
109
|
-
cursor: pointer;
|
|
110
|
-
padding: 4px 8px;
|
|
111
|
-
border-radius: 4px;
|
|
112
|
-
line-height: 1;
|
|
113
|
-
font-size: 1.1rem;
|
|
114
|
-
opacity: 0.7;
|
|
115
|
-
margin-left: auto;
|
|
116
|
-
/* Touch-target floor (WCAG 2.5.5) */
|
|
117
|
-
min-width: 2.75rem;
|
|
118
|
-
min-height: 2.75rem;
|
|
119
|
-
display: inline-flex;
|
|
120
|
-
align-items: center;
|
|
121
|
-
justify-content: center;
|
|
122
|
-
}
|
|
123
|
-
.kj-alert__dismiss:hover { opacity: 1; background: rgb(0 0 0 / 0.06); }
|
|
124
|
-
.kj-alert__dismiss:focus-visible {
|
|
125
|
-
outline: 2px solid var(--kj-alert-accent);
|
|
126
|
-
outline-offset: 2px;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/* When actions and dismiss coexist, dismiss should not push actions away. */
|
|
130
|
-
.kj-alert__actions + .kj-alert__dismiss {
|
|
131
|
-
margin-left: 0;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, signal } from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
KjAlertComponent,
|
|
4
|
-
KjAlertDescriptionComponent,
|
|
5
|
-
KjAlertDismissComponent,
|
|
6
|
-
KjAlertIconComponent,
|
|
7
|
-
KjAlertTitleComponent,
|
|
8
|
-
} from './alert';
|
|
9
|
-
import { KjButtonComponent } from '../button/button';
|
|
10
|
-
import type { PlaygroundFile } from '@kouji-ui/components/playground-types';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Playground state — module-scope signals. Knobs cover severity, size,
|
|
14
|
-
* banner mode, dismiss button, and the action row to exercise every slot
|
|
15
|
-
* on the alert composition.
|
|
16
|
-
*/
|
|
17
|
-
const variant = signal<'info' | 'success' | 'warning' | 'error'>('info');
|
|
18
|
-
const size = signal<'sm' | 'md' | 'lg'>('md');
|
|
19
|
-
const banner = signal(false);
|
|
20
|
-
const dismissible = signal(false);
|
|
21
|
-
const withActions = signal(false);
|
|
22
|
-
const title = signal('Heads up');
|
|
23
|
-
const description = signal('New theme tokens just landed — try the dark variant in your settings.');
|
|
24
|
-
|
|
25
|
-
@Component({
|
|
26
|
-
selector: 'kj-alert-playground',
|
|
27
|
-
standalone: true,
|
|
28
|
-
imports: [
|
|
29
|
-
KjAlertComponent,
|
|
30
|
-
KjAlertIconComponent,
|
|
31
|
-
KjAlertTitleComponent,
|
|
32
|
-
KjAlertDescriptionComponent,
|
|
33
|
-
KjAlertDismissComponent,
|
|
34
|
-
KjButtonComponent,
|
|
35
|
-
],
|
|
36
|
-
template: `
|
|
37
|
-
<kj-alert
|
|
38
|
-
[kjVariant]="variant()"
|
|
39
|
-
[kjSize]="size()"
|
|
40
|
-
[kjAlertStatic]="banner()"
|
|
41
|
-
>
|
|
42
|
-
<kj-alert-icon>i</kj-alert-icon>
|
|
43
|
-
<kj-alert-title>{{ title() }}</kj-alert-title>
|
|
44
|
-
<kj-alert-description>{{ description() }}</kj-alert-description>
|
|
45
|
-
@if (withActions()) {
|
|
46
|
-
<kj-button kjVariant="outline" kjSize="sm">Retry</kj-button>
|
|
47
|
-
}
|
|
48
|
-
@if (dismissible()) {
|
|
49
|
-
<kj-alert-dismiss />
|
|
50
|
-
}
|
|
51
|
-
</kj-alert>
|
|
52
|
-
`,
|
|
53
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
54
|
-
})
|
|
55
|
-
export class KjAlertPlaygroundDemo {
|
|
56
|
-
protected readonly variant = variant;
|
|
57
|
-
protected readonly size = size;
|
|
58
|
-
protected readonly banner = banner;
|
|
59
|
-
protected readonly dismissible = dismissible;
|
|
60
|
-
protected readonly withActions = withActions;
|
|
61
|
-
protected readonly title = title;
|
|
62
|
-
protected readonly description = description;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export const PLAYGROUND: PlaygroundFile = {
|
|
66
|
-
component: KjAlertPlaygroundDemo,
|
|
67
|
-
state: {
|
|
68
|
-
variant: variant as unknown as ReturnType<typeof signal>,
|
|
69
|
-
size: size as unknown as ReturnType<typeof signal>,
|
|
70
|
-
banner: banner as unknown as ReturnType<typeof signal>,
|
|
71
|
-
dismissible: dismissible as unknown as ReturnType<typeof signal>,
|
|
72
|
-
withActions: withActions as unknown as ReturnType<typeof signal>,
|
|
73
|
-
title: title as unknown as ReturnType<typeof signal>,
|
|
74
|
-
description: description as unknown as ReturnType<typeof signal>,
|
|
75
|
-
},
|
|
76
|
-
controls: [
|
|
77
|
-
{
|
|
78
|
-
kind: 'chips',
|
|
79
|
-
name: 'variant',
|
|
80
|
-
label: 'variant',
|
|
81
|
-
options: ['info', 'success', 'warning', 'error'],
|
|
82
|
-
},
|
|
83
|
-
{ kind: 'chips', name: 'size', label: 'size', options: ['sm', 'md', 'lg'] },
|
|
84
|
-
{ kind: 'text', name: 'title', label: 'title' },
|
|
85
|
-
{ kind: 'text', name: 'description', label: 'description' },
|
|
86
|
-
{ kind: 'toggle', name: 'banner', label: 'banner mode' },
|
|
87
|
-
{ kind: 'toggle', name: 'dismissible', label: 'dismissible' },
|
|
88
|
-
{ kind: 'toggle', name: 'withActions', label: 'with action' },
|
|
89
|
-
],
|
|
90
|
-
snippet: (values) => {
|
|
91
|
-
const s = values as {
|
|
92
|
-
variant: string;
|
|
93
|
-
size: string;
|
|
94
|
-
banner: boolean;
|
|
95
|
-
dismissible: boolean;
|
|
96
|
-
withActions: boolean;
|
|
97
|
-
title: string;
|
|
98
|
-
description: string;
|
|
99
|
-
};
|
|
100
|
-
const attrs: string[] = [`kjVariant="${s.variant}"`, `kjSize="${s.size}"`];
|
|
101
|
-
if (s.banner) attrs.push('[kjAlertStatic]="true"');
|
|
102
|
-
const slots: string[] = [
|
|
103
|
-
` <kj-alert-icon>i</kj-alert-icon>`,
|
|
104
|
-
` <kj-alert-title>${s.title}</kj-alert-title>`,
|
|
105
|
-
` <kj-alert-description>${s.description}</kj-alert-description>`,
|
|
106
|
-
];
|
|
107
|
-
if (s.withActions) slots.push(` <kj-button kjVariant="outline" kjSize="sm">Retry</kj-button>`);
|
|
108
|
-
if (s.dismissible) slots.push(` <kj-alert-dismiss />`);
|
|
109
|
-
return `<kj-alert\n ${attrs.join('\n ')}\n>\n${slots.join('\n')}\n</kj-alert>`;
|
|
110
|
-
},
|
|
111
|
-
};
|
package/src/alert/alert.spec.ts
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { Component, signal, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
-
import { TestBed } from '@angular/core/testing';
|
|
3
|
-
import { describe, expect, test, beforeEach } from 'vitest';
|
|
4
|
-
import {
|
|
5
|
-
KjAlertActionsComponent,
|
|
6
|
-
KjAlertComponent,
|
|
7
|
-
KjAlertDescriptionComponent,
|
|
8
|
-
KjAlertDismissComponent,
|
|
9
|
-
KjAlertIconComponent,
|
|
10
|
-
KjAlertTitleComponent,
|
|
11
|
-
} from './alert';
|
|
12
|
-
|
|
13
|
-
@Component({
|
|
14
|
-
standalone: true,
|
|
15
|
-
imports: [
|
|
16
|
-
KjAlertComponent,
|
|
17
|
-
KjAlertIconComponent,
|
|
18
|
-
KjAlertTitleComponent,
|
|
19
|
-
KjAlertDescriptionComponent,
|
|
20
|
-
KjAlertActionsComponent,
|
|
21
|
-
KjAlertDismissComponent,
|
|
22
|
-
],
|
|
23
|
-
changeDetection: ChangeDetectionStrategy.Eager,
|
|
24
|
-
template: `
|
|
25
|
-
@if (visible()) {
|
|
26
|
-
<kj-alert
|
|
27
|
-
[kjVariant]="variant"
|
|
28
|
-
[kjSize]="size"
|
|
29
|
-
[kjAlertStatic]="staticBanner"
|
|
30
|
-
[kjAlertMode]="mode"
|
|
31
|
-
(kjAlertDismissed)="onDismissed()"
|
|
32
|
-
>
|
|
33
|
-
<kj-alert-icon />
|
|
34
|
-
<kj-alert-title>Title</kj-alert-title>
|
|
35
|
-
<kj-alert-description>Body</kj-alert-description>
|
|
36
|
-
<kj-alert-actions>
|
|
37
|
-
<button>Retry</button>
|
|
38
|
-
</kj-alert-actions>
|
|
39
|
-
<kj-alert-dismiss />
|
|
40
|
-
</kj-alert>
|
|
41
|
-
}
|
|
42
|
-
`,
|
|
43
|
-
})
|
|
44
|
-
class HostComponent {
|
|
45
|
-
variant = 'info';
|
|
46
|
-
size = 'md';
|
|
47
|
-
staticBanner = false;
|
|
48
|
-
mode: 'assertive' | 'polite' | 'static' | 'off' | undefined = undefined;
|
|
49
|
-
visible = signal(true);
|
|
50
|
-
fired = 0;
|
|
51
|
-
onDismissed(): void {
|
|
52
|
-
this.fired++;
|
|
53
|
-
this.visible.set(false);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
describe('KjAlertComponent', () => {
|
|
58
|
-
beforeEach(() => {
|
|
59
|
-
TestBed.configureTestingModule({ imports: [HostComponent] });
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
test('renders kj-alert host with role="status" by default', () => {
|
|
63
|
-
const fixture = TestBed.createComponent(HostComponent);
|
|
64
|
-
fixture.detectChanges();
|
|
65
|
-
const root = fixture.nativeElement.querySelector('kj-alert')!;
|
|
66
|
-
expect(root.getAttribute('role')).toBe('status');
|
|
67
|
-
expect(root.getAttribute('aria-live')).toBe('polite');
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
test('forwards kjVariant via host directive (data-variant)', () => {
|
|
71
|
-
const fixture = TestBed.createComponent(HostComponent);
|
|
72
|
-
fixture.componentInstance.variant = 'warning';
|
|
73
|
-
fixture.detectChanges();
|
|
74
|
-
const root = fixture.nativeElement.querySelector('kj-alert')!;
|
|
75
|
-
expect(root.getAttribute('data-variant')).toBe('warning');
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
test('forwards kjSize via host directive (data-size)', () => {
|
|
79
|
-
const fixture = TestBed.createComponent(HostComponent);
|
|
80
|
-
fixture.componentInstance.size = 'lg';
|
|
81
|
-
fixture.detectChanges();
|
|
82
|
-
const root = fixture.nativeElement.querySelector('kj-alert')!;
|
|
83
|
-
expect(root.getAttribute('data-size')).toBe('lg');
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
test('error variant resolves to assertive (role="alert")', () => {
|
|
87
|
-
const fixture = TestBed.createComponent(HostComponent);
|
|
88
|
-
fixture.componentInstance.variant = 'error';
|
|
89
|
-
fixture.detectChanges();
|
|
90
|
-
const root = fixture.nativeElement.querySelector('kj-alert')!;
|
|
91
|
-
expect(root.getAttribute('role')).toBe('alert');
|
|
92
|
-
expect(root.getAttribute('aria-live')).toBe('assertive');
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
test('kjAlertStatic switches to role="region" with no aria-live', () => {
|
|
96
|
-
const fixture = TestBed.createComponent(HostComponent);
|
|
97
|
-
fixture.componentInstance.staticBanner = true;
|
|
98
|
-
fixture.detectChanges();
|
|
99
|
-
const root = fixture.nativeElement.querySelector('kj-alert')!;
|
|
100
|
-
expect(root.getAttribute('role')).toBe('region');
|
|
101
|
-
expect(root.getAttribute('aria-live')).toBeNull();
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
test('explicit kjAlertMode wins over the matrix', () => {
|
|
105
|
-
const fixture = TestBed.createComponent(HostComponent);
|
|
106
|
-
fixture.componentInstance.variant = 'error';
|
|
107
|
-
fixture.componentInstance.mode = 'polite';
|
|
108
|
-
fixture.detectChanges();
|
|
109
|
-
const root = fixture.nativeElement.querySelector('kj-alert')!;
|
|
110
|
-
expect(root.getAttribute('role')).toBe('status');
|
|
111
|
-
expect(root.getAttribute('aria-live')).toBe('polite');
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
test('renders icon, title, description, actions, dismiss slots', () => {
|
|
115
|
-
const fixture = TestBed.createComponent(HostComponent);
|
|
116
|
-
fixture.detectChanges();
|
|
117
|
-
expect(fixture.nativeElement.querySelector('kj-alert-icon')).not.toBeNull();
|
|
118
|
-
expect(fixture.nativeElement.querySelector('kj-alert-title')).not.toBeNull();
|
|
119
|
-
expect(fixture.nativeElement.querySelector('kj-alert-description')).not.toBeNull();
|
|
120
|
-
expect(fixture.nativeElement.querySelector('kj-alert-actions')).not.toBeNull();
|
|
121
|
-
expect(fixture.nativeElement.querySelector('button.kj-alert__dismiss')).not.toBeNull();
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
test('alert root wires aria-labelledby to the title id', () => {
|
|
125
|
-
const fixture = TestBed.createComponent(HostComponent);
|
|
126
|
-
fixture.detectChanges();
|
|
127
|
-
const root = fixture.nativeElement.querySelector('kj-alert')!;
|
|
128
|
-
const title = fixture.nativeElement.querySelector('kj-alert-title')!;
|
|
129
|
-
expect(title.getAttribute('id')).toMatch(/-title$/);
|
|
130
|
-
expect(root.getAttribute('aria-labelledby')).toBe(title.getAttribute('id'));
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
test('actions container exposes role="group"', () => {
|
|
134
|
-
const fixture = TestBed.createComponent(HostComponent);
|
|
135
|
-
fixture.detectChanges();
|
|
136
|
-
const actions = fixture.nativeElement.querySelector('kj-alert-actions');
|
|
137
|
-
expect(actions.getAttribute('role')).toBe('group');
|
|
138
|
-
expect(actions.getAttribute('aria-label')).toBe('Alert actions');
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
test('clicking the dismiss button fires kjAlertDismissed and consumer unmounts', () => {
|
|
142
|
-
const fixture = TestBed.createComponent(HostComponent);
|
|
143
|
-
fixture.detectChanges();
|
|
144
|
-
const dismissBtn = fixture.nativeElement.querySelector('button.kj-alert__dismiss');
|
|
145
|
-
expect(dismissBtn).not.toBeNull();
|
|
146
|
-
dismissBtn.click();
|
|
147
|
-
fixture.detectChanges();
|
|
148
|
-
expect(fixture.componentInstance.fired).toBe(1);
|
|
149
|
-
expect(fixture.nativeElement.querySelector('kj-alert')).toBeNull();
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
test('dismiss button has aria-label="Dismiss"', () => {
|
|
153
|
-
const fixture = TestBed.createComponent(HostComponent);
|
|
154
|
-
fixture.detectChanges();
|
|
155
|
-
const dismissBtn = fixture.nativeElement.querySelector('button.kj-alert__dismiss');
|
|
156
|
-
expect(dismissBtn.getAttribute('aria-label')).toBe('Dismiss');
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
test('icon picks up aria-hidden="true" and data-variant from context', () => {
|
|
160
|
-
const fixture = TestBed.createComponent(HostComponent);
|
|
161
|
-
fixture.componentInstance.variant = 'success';
|
|
162
|
-
fixture.detectChanges();
|
|
163
|
-
const icon = fixture.nativeElement.querySelector('kj-alert-icon')!;
|
|
164
|
-
expect(icon.getAttribute('aria-hidden')).toBe('true');
|
|
165
|
-
expect(icon.getAttribute('data-variant')).toBe('success');
|
|
166
|
-
});
|
|
167
|
-
});
|
package/src/alert/alert.ts
DELETED
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ChangeDetectionStrategy,
|
|
3
|
-
Component,
|
|
4
|
-
ViewEncapsulation,
|
|
5
|
-
booleanAttribute,
|
|
6
|
-
input,
|
|
7
|
-
} from '@angular/core';
|
|
8
|
-
import {
|
|
9
|
-
KjAlert,
|
|
10
|
-
KjAlertActions,
|
|
11
|
-
KjAlertDescription,
|
|
12
|
-
KjAlertDismiss,
|
|
13
|
-
KjAlertIcon,
|
|
14
|
-
KjAlertTitle,
|
|
15
|
-
KjIconDirective,
|
|
16
|
-
} from '@kouji-ui/core';
|
|
17
|
-
import type { KjAlertMode } from '@kouji-ui/core';
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Styled wrapper around the `KjAlert` directive family. Provides the
|
|
21
|
-
* persistent in-flow notification surface (severity-aware chrome, severity
|
|
22
|
-
* border accent, banner mode, dismiss button). Visibility is consumer-managed
|
|
23
|
-
* — bind a signal via `@if` and clear it from `(kjAlertDismissed)`.
|
|
24
|
-
*
|
|
25
|
-
* Re-exposes `KjAlert`'s contract directly (variant, size, mode, static, role)
|
|
26
|
-
* with no new wrapper-layer inputs. Severity defaults: `error` → assertive,
|
|
27
|
-
* others → polite, `kjAlertStatic` → static region.
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```html
|
|
31
|
-
* <kj-alert kjVariant="error" (kjAlertDismissed)="show.set(false)">
|
|
32
|
-
* <kj-alert-icon />
|
|
33
|
-
* <kj-alert-title>Could not save draft</kj-alert-title>
|
|
34
|
-
* <kj-alert-description>Network request timed out — retry?</kj-alert-description>
|
|
35
|
-
* <kj-alert-actions>
|
|
36
|
-
* <kj-button (click)="retry()">Retry</kj-button>
|
|
37
|
-
* </kj-alert-actions>
|
|
38
|
-
* <kj-alert-dismiss />
|
|
39
|
-
* </kj-alert>
|
|
40
|
-
* ```
|
|
41
|
-
* @doc-example Default
|
|
42
|
-
* The default playground — `info` severity with icon, title, and description.
|
|
43
|
-
* @doc-file alert.example.ts
|
|
44
|
-
* @doc-example Usage
|
|
45
|
-
* A walkthrough of the common shapes — severity variants, dismissible flow,
|
|
46
|
-
* and an action button row. Use this as the copy-paste starting point.
|
|
47
|
-
* @doc-file alert.usage.example.ts
|
|
48
|
-
* @doc-example Variants
|
|
49
|
-
* Info / success / warning / error — severity drives the stripe and icon tint.
|
|
50
|
-
* @doc-file alert.variants.example.ts
|
|
51
|
-
* @doc-example Dismissible
|
|
52
|
-
* Project `<kj-alert-dismiss>` and listen to `(kjAlertDismissed)` to clear.
|
|
53
|
-
* @doc-file alert.dismissible.example.ts
|
|
54
|
-
* @doc-example With actions
|
|
55
|
-
* Drop `<kj-button>`s inside `<kj-alert-actions>` for retry / view-details flows.
|
|
56
|
-
* @doc-file alert.with-actions.example.ts
|
|
57
|
-
* @doc-example Static banner
|
|
58
|
-
* `kjAlertStatic` removes the live region — use for page-persistent notices.
|
|
59
|
-
* @doc-file alert.banner.example.ts
|
|
60
|
-
*
|
|
61
|
-
* @doc-keyboard
|
|
62
|
-
* Tab — Moves focus through interactive children (actions, dismiss)
|
|
63
|
-
* Enter|Space — Activates the focused dismiss button or action
|
|
64
|
-
*
|
|
65
|
-
* @doc-aria
|
|
66
|
-
* role — `alert` for error severity (assertive), `status` otherwise (polite); `kjAlertStatic` switches to `region`
|
|
67
|
-
* aria-live — `assertive` for error, `polite` for info/success/warning
|
|
68
|
-
* aria-labelledby — Wired to the title id when `<kj-alert-title>` is projected
|
|
69
|
-
* aria-describedby — Wired to the description id when `<kj-alert-description>` is projected
|
|
70
|
-
* data-variant — Mirrors the severity for theme/scope hooks
|
|
71
|
-
*
|
|
72
|
-
* @doc-touch
|
|
73
|
-
* The dismiss button defaults to `size="icon"` (44×44) so it meets WCAG 2.5.5
|
|
74
|
-
* out of the box. Action buttons inherit `<kj-button>` size rules.
|
|
75
|
-
*
|
|
76
|
-
* @doc-a11y
|
|
77
|
-
* Severity drives the live region politeness so screen readers announce
|
|
78
|
-
* errors immediately but don't interrupt for routine info. Dismiss is a
|
|
79
|
-
* real `<button>` with `aria-label="Dismiss"`; consumers can swap the
|
|
80
|
-
* label via `kjAlertDismissLabel`. Decorative icons are `aria-hidden="true"`.
|
|
81
|
-
*
|
|
82
|
-
* @doc-related toast,dialog,banner
|
|
83
|
-
*
|
|
84
|
-
* @doc-css-var
|
|
85
|
-
* --kj-alert-bg — Background fill. Defaults to --kj-bg-body.
|
|
86
|
-
* --kj-alert-fg — Foreground (body text) color. Defaults to --kj-fg-default.
|
|
87
|
-
* --kj-alert-border-color — Outer border color. Defaults to --kj-border-default.
|
|
88
|
-
* --kj-alert-accent — Severity stripe + icon + title color. Variants set this per severity.
|
|
89
|
-
* --kj-alert-radius — Corner radius. Inherits --kj-radius-box.
|
|
90
|
-
* --kj-alert-padding-x — Horizontal padding. Sizes override.
|
|
91
|
-
* --kj-alert-padding-y — Vertical padding. Sizes override.
|
|
92
|
-
* --kj-alert-gap — Gap between icon, body, and actions.
|
|
93
|
-
* --kj-alert-font-size — Body font size. Sizes override.
|
|
94
|
-
*
|
|
95
|
-
* @doc-category Library/Feedback
|
|
96
|
-
* @doc
|
|
97
|
-
* @doc-name alert
|
|
98
|
-
* @doc-description Themed in-flow notification with severity variants, optional dismiss button, and action slots.
|
|
99
|
-
* @doc-is-main
|
|
100
|
-
*/
|
|
101
|
-
@Component({
|
|
102
|
-
selector: 'kj-alert',
|
|
103
|
-
standalone: true,
|
|
104
|
-
hostDirectives: [
|
|
105
|
-
{
|
|
106
|
-
directive: KjAlert,
|
|
107
|
-
inputs: [
|
|
108
|
-
'kjVariant',
|
|
109
|
-
'kjSize',
|
|
110
|
-
'kjAlertMode',
|
|
111
|
-
'kjAlertStatic',
|
|
112
|
-
'kjAlertRole',
|
|
113
|
-
],
|
|
114
|
-
outputs: ['kjAlertDismissed'],
|
|
115
|
-
},
|
|
116
|
-
],
|
|
117
|
-
template: `
|
|
118
|
-
<ng-content select="[kjAlertIcon],kj-alert-icon" />
|
|
119
|
-
<div class="kj-alert__body">
|
|
120
|
-
<ng-content select="[kjAlertTitle],kj-alert-title" />
|
|
121
|
-
<ng-content select="[kjAlertDescription],kj-alert-description" />
|
|
122
|
-
<ng-content />
|
|
123
|
-
</div>
|
|
124
|
-
<ng-content select="[kjAlertActions],kj-alert-actions" />
|
|
125
|
-
<ng-content select="[kjAlertDismiss],kj-alert-dismiss" />
|
|
126
|
-
`,
|
|
127
|
-
styleUrl: './alert.css',
|
|
128
|
-
encapsulation: ViewEncapsulation.None,
|
|
129
|
-
host: { class: 'kj-alert' },
|
|
130
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
131
|
-
})
|
|
132
|
-
export class KjAlertComponent {
|
|
133
|
-
// Inputs are forwarded via `hostDirectives.inputs` above. Re-declared here
|
|
134
|
-
// only to surface them in the docs extractor (which inspects the wrapper
|
|
135
|
-
// class). The actual signal lives on the composed directive.
|
|
136
|
-
readonly kjVariant = input<string>('info');
|
|
137
|
-
readonly kjSize = input<string>('md');
|
|
138
|
-
readonly kjAlertMode = input<KjAlertMode | undefined>(undefined);
|
|
139
|
-
readonly kjAlertStatic = input(false, { transform: booleanAttribute });
|
|
140
|
-
readonly kjAlertRole = input<string | undefined>(undefined);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Decorative icon slot inside `<kj-alert>`. Wraps `KjAlertIcon` so it picks
|
|
145
|
-
* up `aria-hidden="true"` and `data-variant` from the parent alert context.
|
|
146
|
-
*
|
|
147
|
-
* @doc-category Library/Feedback
|
|
148
|
-
* @doc
|
|
149
|
-
* @doc-name alert
|
|
150
|
-
*/
|
|
151
|
-
@Component({
|
|
152
|
-
selector: 'kj-alert-icon',
|
|
153
|
-
standalone: true,
|
|
154
|
-
hostDirectives: [KjAlertIcon],
|
|
155
|
-
template: `<ng-content />`,
|
|
156
|
-
encapsulation: ViewEncapsulation.None,
|
|
157
|
-
host: { class: 'kj-alert__icon' },
|
|
158
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
159
|
-
})
|
|
160
|
-
export class KjAlertIconComponent {}
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Title for the alert. Apply to a heading element (or rely on the wrapper —
|
|
164
|
-
* the wrapper defaults to a `<strong>`-styled element via CSS, but consumers
|
|
165
|
-
* SHOULD use `<h3 kjAlertTitle>` when the alert lives in a content region).
|
|
166
|
-
*
|
|
167
|
-
* @doc-category Library/Feedback
|
|
168
|
-
* @doc
|
|
169
|
-
* @doc-name alert
|
|
170
|
-
*/
|
|
171
|
-
@Component({
|
|
172
|
-
selector: 'kj-alert-title',
|
|
173
|
-
standalone: true,
|
|
174
|
-
hostDirectives: [KjAlertTitle],
|
|
175
|
-
template: `<ng-content />`,
|
|
176
|
-
encapsulation: ViewEncapsulation.None,
|
|
177
|
-
host: { class: 'kj-alert__title' },
|
|
178
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
179
|
-
})
|
|
180
|
-
export class KjAlertTitleComponent {}
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Description body for the alert. Wires `aria-describedby` via `KjAlertDescription`.
|
|
184
|
-
*
|
|
185
|
-
* @doc-category Library/Feedback
|
|
186
|
-
* @doc
|
|
187
|
-
* @doc-name alert
|
|
188
|
-
*/
|
|
189
|
-
@Component({
|
|
190
|
-
selector: 'kj-alert-description',
|
|
191
|
-
standalone: true,
|
|
192
|
-
hostDirectives: [KjAlertDescription],
|
|
193
|
-
template: `<ng-content />`,
|
|
194
|
-
encapsulation: ViewEncapsulation.None,
|
|
195
|
-
host: { class: 'kj-alert__description' },
|
|
196
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
197
|
-
})
|
|
198
|
-
export class KjAlertDescriptionComponent {}
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Container for action buttons (Retry, View details, …). Sets `role="group"`
|
|
202
|
-
* with an overridable `aria-label`. Compose `<kj-button>` instances inside.
|
|
203
|
-
*
|
|
204
|
-
* @doc-category Library/Feedback
|
|
205
|
-
* @doc
|
|
206
|
-
* @doc-name alert
|
|
207
|
-
*/
|
|
208
|
-
@Component({
|
|
209
|
-
selector: 'kj-alert-actions',
|
|
210
|
-
standalone: true,
|
|
211
|
-
hostDirectives: [{ directive: KjAlertActions, inputs: ['kjAlertActionsLabel'] }],
|
|
212
|
-
template: `<ng-content />`,
|
|
213
|
-
encapsulation: ViewEncapsulation.None,
|
|
214
|
-
host: { class: 'kj-alert__actions' },
|
|
215
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
216
|
-
})
|
|
217
|
-
export class KjAlertActionsComponent {
|
|
218
|
-
readonly kjAlertActionsLabel = input<string>('Alert actions');
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Dismiss button. Renders a real `<button kjAlertDismiss>` so the directive
|
|
223
|
-
* picks up the full `KjButton` chrome (focus ring, ARIA-disabled). Default
|
|
224
|
-
* content is `×`; override via projected content. Place inside `<kj-alert>`.
|
|
225
|
-
*
|
|
226
|
-
* @doc-category Library/Feedback
|
|
227
|
-
* @doc
|
|
228
|
-
* @doc-name alert
|
|
229
|
-
*/
|
|
230
|
-
@Component({
|
|
231
|
-
selector: 'kj-alert-dismiss',
|
|
232
|
-
standalone: true,
|
|
233
|
-
imports: [KjAlertDismiss, KjIconDirective],
|
|
234
|
-
template: `<button
|
|
235
|
-
type="button"
|
|
236
|
-
kjAlertDismiss
|
|
237
|
-
class="kj-alert__dismiss"
|
|
238
|
-
[kjAlertDismissLabel]="kjAlertDismissLabel()"
|
|
239
|
-
[kjAlertDismissVariant]="kjAlertDismissVariant()"
|
|
240
|
-
[kjAlertDismissSize]="kjAlertDismissSize()"
|
|
241
|
-
><ng-content><i kjIcon="x"></i></ng-content></button>`,
|
|
242
|
-
encapsulation: ViewEncapsulation.None,
|
|
243
|
-
host: { style: 'display: contents;' },
|
|
244
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
245
|
-
})
|
|
246
|
-
export class KjAlertDismissComponent {
|
|
247
|
-
readonly kjAlertDismissLabel = input<string>('Dismiss');
|
|
248
|
-
readonly kjAlertDismissVariant = input<string>('ghost');
|
|
249
|
-
readonly kjAlertDismissSize = input<string>('icon');
|
|
250
|
-
}
|