@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
|
@@ -1,448 +0,0 @@
|
|
|
1
|
-
import { isPlatformBrowser, NgTemplateOutlet } from '@angular/common';
|
|
2
|
-
import {
|
|
3
|
-
ChangeDetectionStrategy,
|
|
4
|
-
Component,
|
|
5
|
-
DestroyRef,
|
|
6
|
-
Directive,
|
|
7
|
-
TemplateRef,
|
|
8
|
-
ViewEncapsulation,
|
|
9
|
-
PLATFORM_ID,
|
|
10
|
-
afterNextRender,
|
|
11
|
-
booleanAttribute,
|
|
12
|
-
computed,
|
|
13
|
-
contentChild,
|
|
14
|
-
effect,
|
|
15
|
-
inject,
|
|
16
|
-
input,
|
|
17
|
-
model,
|
|
18
|
-
} from '@angular/core';
|
|
19
|
-
import {
|
|
20
|
-
KjCommandPalette,
|
|
21
|
-
KjCommandInput,
|
|
22
|
-
KjCommandList,
|
|
23
|
-
KjCommandGroup,
|
|
24
|
-
KjCommandSeparator,
|
|
25
|
-
KjCommandEmpty,
|
|
26
|
-
KjListItem,
|
|
27
|
-
injectListItem,
|
|
28
|
-
} from '@kouji-ui/core';
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Marker directive for projecting custom footer content into a
|
|
32
|
-
* `<kj-command-palette>`. When present, the wrapper hides its default
|
|
33
|
-
* keyboard-hint footer and renders the projected content instead.
|
|
34
|
-
*
|
|
35
|
-
* @doc-css-var
|
|
36
|
-
* --kj-command-item-direction — Flex direction on each command row. Defaults to `row`; switch to `column` for stacked layouts.
|
|
37
|
-
* --kj-command-item-align — Cross-axis alignment of row contents. Defaults to `center`.
|
|
38
|
-
* --kj-command-item-gap — Gap between icon and label inside a row. Defaults to --kj-space-md.
|
|
39
|
-
*
|
|
40
|
-
* @doc
|
|
41
|
-
* @doc-name command-palette
|
|
42
|
-
* @doc-description Themed Cmd-K modal command palette with fuzzy filtering, grouped results, and keyboard navigation.
|
|
43
|
-
* @doc-is-main
|
|
44
|
-
*/
|
|
45
|
-
@Directive({
|
|
46
|
-
selector: '[kjCommandPaletteFooter]',
|
|
47
|
-
standalone: true,
|
|
48
|
-
})
|
|
49
|
-
export class KjCommandPaletteFooter {}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Marker directive for the per-item template used by `<kj-command-palette>`
|
|
53
|
-
* when the consumer passes `[kjItems]`. The template's implicit context is the
|
|
54
|
-
* item itself; `index` is also exposed.
|
|
55
|
-
*
|
|
56
|
-
* @example
|
|
57
|
-
* ```html
|
|
58
|
-
* <kj-command-palette [kjItems]="results">
|
|
59
|
-
* <ng-template kjCommandPaletteItemTemplate let-item let-i="index">
|
|
60
|
-
* <kj-command-item [kjValue]="item.id">{{ item.label }}</kj-command-item>
|
|
61
|
-
* </ng-template>
|
|
62
|
-
* </kj-command-palette>
|
|
63
|
-
* ```
|
|
64
|
-
* @doc
|
|
65
|
-
* @doc-name command-palette
|
|
66
|
-
*/
|
|
67
|
-
@Directive({
|
|
68
|
-
selector: 'ng-template[kjCommandPaletteItemTemplate]',
|
|
69
|
-
standalone: true,
|
|
70
|
-
})
|
|
71
|
-
export class KjCommandPaletteItemTemplate<T = unknown> {
|
|
72
|
-
readonly tpl = inject<TemplateRef<{ $implicit: T; index: number }>>(TemplateRef);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Modal command palette component. Renders a centered dialog with backdrop
|
|
77
|
-
* when `kjOpen()` is `true`. Composes `[kjCommandPalette]` on its host so all
|
|
78
|
-
* filter/activate semantics work for both projected items and items rendered
|
|
79
|
-
* via `[kjItems]` + `<ng-template kjCommandPaletteItemTemplate>`.
|
|
80
|
-
*
|
|
81
|
-
* Open/close via `[(kjOpen)]` 2-way binding. Optional Cmd-K (or any chord)
|
|
82
|
-
* hotkey via `[kjHotkey]`.
|
|
83
|
-
*
|
|
84
|
-
* @doc-example Default
|
|
85
|
-
* A trigger button opens the modal; type to filter the projected items.
|
|
86
|
-
* @doc-file command-palette.example.ts
|
|
87
|
-
* @doc-example Usage
|
|
88
|
-
* A walkthrough of the most common command-palette usages — Cmd-K hotkey,
|
|
89
|
-
* grouped rows, and a trigger button.
|
|
90
|
-
* @doc-file command-palette.usage.example.ts
|
|
91
|
-
* @doc-example With trigger and hotkey
|
|
92
|
-
* Bind a global `mod+k` chord that toggles the palette open and closed.
|
|
93
|
-
* @doc-file command-palette.dialog.example.ts
|
|
94
|
-
* @doc-example With groups
|
|
95
|
-
* `<kj-command-group>` clusters related commands under a label heading.
|
|
96
|
-
* @doc-file command-palette.groups.example.ts
|
|
97
|
-
* @doc-example Async with item template
|
|
98
|
-
* `[kjItems]` + `kjCommandPaletteItemTemplate` for remote search results.
|
|
99
|
-
* @doc-file command-palette.async.example.ts
|
|
100
|
-
* @doc-example Fuzzy filter
|
|
101
|
-
* Drop in a fuzzy `[kjFilter]` for typo-tolerant matching.
|
|
102
|
-
* @doc-file command-palette.fuzzy.example.ts
|
|
103
|
-
*
|
|
104
|
-
* @doc-keyboard
|
|
105
|
-
* ArrowDown|ArrowUp — Moves the active item through the visible list
|
|
106
|
-
* Enter — Activates the highlighted item (emits `kjValueChange`)
|
|
107
|
-
* Escape — Closes the palette and returns focus to the trigger
|
|
108
|
-
* mod+k — Default hotkey toggles open / closed (configurable via `[kjHotkey]`)
|
|
109
|
-
* Printable keys — Type into the search input to filter
|
|
110
|
-
*
|
|
111
|
-
* @doc-aria
|
|
112
|
-
* role="dialog" — On the panel; `aria-modal="true"` while open
|
|
113
|
-
* aria-label — Defaults to "Command palette"; override via `[kjAriaLabel]`
|
|
114
|
-
* role="listbox" — On the inner list (provided by `[kjCommandList]`)
|
|
115
|
-
* role="option" — On each `[kjCommandItem]`
|
|
116
|
-
* aria-disabled — Reflected per item when `[kjDisabled]` is true
|
|
117
|
-
* aria-live — The empty state announces "No results found" politely
|
|
118
|
-
*
|
|
119
|
-
* @doc-touch
|
|
120
|
-
* Each command row enforces `min-height: 2.75rem` (44px) via CSS — every
|
|
121
|
-
* row is a valid touch target. The footer keyboard hints are decorative.
|
|
122
|
-
*
|
|
123
|
-
* @doc-a11y
|
|
124
|
-
* The palette is a modal dialog with backdrop and an inert siblings posture
|
|
125
|
-
* while open. The search input keeps focus; the active item is tracked via
|
|
126
|
-
* `aria-activedescendant`. When projected items are filtered out, groups
|
|
127
|
-
* auto-hide so the announced "results found" count stays accurate. The
|
|
128
|
-
* `[kjAutoCloseOnActivate]` posture (true by default) closes the palette
|
|
129
|
-
* after activation and restores focus to the trigger.
|
|
130
|
-
*
|
|
131
|
-
* @doc-related dropdown-menu,dialog,menubar
|
|
132
|
-
*
|
|
133
|
-
* @doc-category Library/Actions
|
|
134
|
-
* @doc
|
|
135
|
-
* @doc-name command-palette
|
|
136
|
-
*/
|
|
137
|
-
@Component({
|
|
138
|
-
selector: 'kj-command-palette',
|
|
139
|
-
standalone: true,
|
|
140
|
-
imports: [NgTemplateOutlet, KjCommandInput, KjCommandList, KjCommandEmpty],
|
|
141
|
-
hostDirectives: [{
|
|
142
|
-
directive: KjCommandPalette,
|
|
143
|
-
inputs: ['kjShouldFilter', 'kjLoading', 'kjAutoActivateFirst', 'kjDismissOnActivate', 'kjValue', 'kjQuery', 'kjFilter'],
|
|
144
|
-
outputs: ['kjValueChange', 'kjQueryChange', 'kjActivate'],
|
|
145
|
-
}],
|
|
146
|
-
template: `
|
|
147
|
-
<div class="kj-command-palette__shell" [class.is-open]="kjOpen()">
|
|
148
|
-
<div class="kj-command-palette__backdrop" (click)="close()" aria-hidden="true"></div>
|
|
149
|
-
<div
|
|
150
|
-
class="kj-command-palette__dialog"
|
|
151
|
-
role="dialog"
|
|
152
|
-
aria-modal="true"
|
|
153
|
-
[attr.aria-label]="kjAriaLabel()"
|
|
154
|
-
(keydown.escape)="close()"
|
|
155
|
-
>
|
|
156
|
-
<div class="kj-command-palette__input-wrapper">
|
|
157
|
-
<svg class="kj-command-palette__search-icon" aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
158
|
-
<circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/>
|
|
159
|
-
</svg>
|
|
160
|
-
<input
|
|
161
|
-
#searchInput
|
|
162
|
-
kjCommandInput
|
|
163
|
-
type="search"
|
|
164
|
-
class="kj-command-palette__input"
|
|
165
|
-
[placeholder]="kjPlaceholder()"
|
|
166
|
-
autocomplete="off"
|
|
167
|
-
spellcheck="false"
|
|
168
|
-
/>
|
|
169
|
-
@if (kjEscBadge()) {
|
|
170
|
-
<kbd class="kj-command-palette__esc-kbd">esc</kbd>
|
|
171
|
-
}
|
|
172
|
-
</div>
|
|
173
|
-
<div kjCommandList class="kj-command-palette__list">
|
|
174
|
-
<div kjCommandEmpty class="kj-command-palette__empty">No results found.</div>
|
|
175
|
-
@if (itemTpl(); as t) {
|
|
176
|
-
@for (item of kjItems(); track $index; let i = $index) {
|
|
177
|
-
<ng-container *ngTemplateOutlet="t.tpl; context: { $implicit: item, index: i }" />
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
<ng-content />
|
|
181
|
-
</div>
|
|
182
|
-
@if (customFooter()) {
|
|
183
|
-
<ng-content select="[kjCommandPaletteFooter]" />
|
|
184
|
-
} @else {
|
|
185
|
-
<div class="kj-command-palette__footer">
|
|
186
|
-
<span><kbd>↑↓</kbd> navigate</span>
|
|
187
|
-
<span><kbd>↵</kbd> open</span>
|
|
188
|
-
<span><kbd>esc</kbd> close</span>
|
|
189
|
-
</div>
|
|
190
|
-
}
|
|
191
|
-
</div>
|
|
192
|
-
</div>
|
|
193
|
-
`,
|
|
194
|
-
styleUrl: './command-palette.css',
|
|
195
|
-
encapsulation: ViewEncapsulation.None,
|
|
196
|
-
host: {
|
|
197
|
-
class: 'kj-command-palette',
|
|
198
|
-
style: 'display: contents;',
|
|
199
|
-
'(kjActivate)': 'onActivate()',
|
|
200
|
-
},
|
|
201
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
202
|
-
})
|
|
203
|
-
export class KjCommandPaletteComponent {
|
|
204
|
-
/** Input placeholder text. */
|
|
205
|
-
readonly kjPlaceholder = input<string>('Search commands…');
|
|
206
|
-
|
|
207
|
-
/** Show an `esc` kbd badge on the right of the input. @default true */
|
|
208
|
-
readonly kjEscBadge = input<boolean, unknown>(true, { transform: booleanAttribute });
|
|
209
|
-
|
|
210
|
-
/** Accessible label for the dialog. @default 'Command palette' */
|
|
211
|
-
readonly kjAriaLabel = input<string>('Command palette');
|
|
212
|
-
|
|
213
|
-
/** Two-way bindable open state. */
|
|
214
|
-
readonly kjOpen = model<boolean>(false);
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* Optional keyboard chord that toggles open/close. Empty string disables.
|
|
218
|
-
* `mod` resolves to `Meta` on macOS, `Ctrl` elsewhere.
|
|
219
|
-
* @default ''
|
|
220
|
-
*/
|
|
221
|
-
readonly kjHotkey = input<string>('');
|
|
222
|
-
|
|
223
|
-
/** Items list — rendered via `KjCommandPaletteItemTemplate` when provided. */
|
|
224
|
-
readonly kjItems = input<readonly unknown[]>([]);
|
|
225
|
-
|
|
226
|
-
/** Close the palette automatically when an item activates. @default true */
|
|
227
|
-
readonly kjAutoCloseOnActivate = input<boolean, unknown>(true, { transform: booleanAttribute });
|
|
228
|
-
|
|
229
|
-
protected readonly itemTpl = contentChild(KjCommandPaletteItemTemplate);
|
|
230
|
-
protected readonly customFooter = contentChild(KjCommandPaletteFooter);
|
|
231
|
-
|
|
232
|
-
private readonly destroyRef = inject(DestroyRef);
|
|
233
|
-
private readonly platformId = inject(PLATFORM_ID);
|
|
234
|
-
|
|
235
|
-
constructor() {
|
|
236
|
-
afterNextRender(() => {
|
|
237
|
-
if (!isPlatformBrowser(this.platformId)) return;
|
|
238
|
-
const handler = (e: KeyboardEvent) => {
|
|
239
|
-
const chord = this.kjHotkey();
|
|
240
|
-
if (chord && this.matchesHotkey(e, chord)) {
|
|
241
|
-
e.preventDefault();
|
|
242
|
-
this.kjOpen.update(v => !v);
|
|
243
|
-
}
|
|
244
|
-
};
|
|
245
|
-
document.addEventListener('keydown', handler);
|
|
246
|
-
this.destroyRef.onDestroy(() => document.removeEventListener('keydown', handler));
|
|
247
|
-
});
|
|
248
|
-
|
|
249
|
-
// Focus the search input when the palette opens.
|
|
250
|
-
effect(() => {
|
|
251
|
-
if (!this.kjOpen()) return;
|
|
252
|
-
if (!isPlatformBrowser(this.platformId)) return;
|
|
253
|
-
queueMicrotask(() => {
|
|
254
|
-
document.querySelector<HTMLInputElement>('.kj-command-palette__dialog .kj-command-palette__input')?.focus();
|
|
255
|
-
});
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
/** Programmatically close the palette. */
|
|
260
|
-
close(): void {
|
|
261
|
-
this.kjOpen.set(false);
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
/** Programmatically open the palette. */
|
|
265
|
-
open(): void {
|
|
266
|
-
this.kjOpen.set(true);
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
protected onActivate(): void {
|
|
270
|
-
if (this.kjAutoCloseOnActivate()) this.close();
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
private matchesHotkey(event: KeyboardEvent, chord: string): boolean {
|
|
274
|
-
const parts = chord.toLowerCase().split('+');
|
|
275
|
-
const key = parts[parts.length - 1];
|
|
276
|
-
const needsMod = parts.includes('mod');
|
|
277
|
-
const needsShift = parts.includes('shift');
|
|
278
|
-
const needsAlt = parts.includes('alt');
|
|
279
|
-
|
|
280
|
-
const isMac = typeof navigator !== 'undefined' &&
|
|
281
|
-
(navigator.platform?.toLowerCase().includes('mac') ||
|
|
282
|
-
(navigator as Navigator & { userAgentData?: { platform: string } })
|
|
283
|
-
.userAgentData?.platform?.toLowerCase().includes('mac'));
|
|
284
|
-
const modPressed = isMac ? event.metaKey : event.ctrlKey;
|
|
285
|
-
|
|
286
|
-
if (needsMod && !modPressed) return false;
|
|
287
|
-
if (needsShift && !event.shiftKey) return false;
|
|
288
|
-
if (needsAlt && !event.altKey) return false;
|
|
289
|
-
return event.key.toLowerCase() === key;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* Styled command item. Renders a `<button>` with `[kjCommandItem]` applied.
|
|
295
|
-
*
|
|
296
|
-
* @doc-category Library/Actions
|
|
297
|
-
* @doc
|
|
298
|
-
* @doc-name command-palette
|
|
299
|
-
*/
|
|
300
|
-
@Component({
|
|
301
|
-
selector: 'kj-command-item',
|
|
302
|
-
standalone: true,
|
|
303
|
-
// Compose `KjListItem` directly on the wrapper host so that
|
|
304
|
-
// `KjCommandPalette.items = contentChildren(KjListItem)` resolves to
|
|
305
|
-
// the wrapper element itself — content queries do not cross into a
|
|
306
|
-
// child component's view template, so the previous shape (an inner
|
|
307
|
-
// `<button kjCommandItem>` inside this view) left the palette's
|
|
308
|
-
// `items()` empty and the empty-state slot permanently visible.
|
|
309
|
-
//
|
|
310
|
-
// The `role`, `data-active`, and `aria-selected` semantics that the
|
|
311
|
-
// `KjCommandItem` directive ordinarily contributes are inlined below
|
|
312
|
-
// because Angular's `hostDirectives` input-forwarding does not chain
|
|
313
|
-
// transitively (composing `KjCommandItem` here and re-forwarding its
|
|
314
|
-
// forwarded inputs fails the NG2017 check).
|
|
315
|
-
hostDirectives: [{
|
|
316
|
-
directive: KjListItem,
|
|
317
|
-
inputs: [
|
|
318
|
-
'kjItemValue:kjValue',
|
|
319
|
-
'kjItemKeywords:kjKeywords',
|
|
320
|
-
'kjShortcut',
|
|
321
|
-
'kjDisabled',
|
|
322
|
-
],
|
|
323
|
-
}],
|
|
324
|
-
template: `<ng-content />`,
|
|
325
|
-
styleUrl: './command-palette.css',
|
|
326
|
-
encapsulation: ViewEncapsulation.None,
|
|
327
|
-
host: {
|
|
328
|
-
'class': 'kj-command-item',
|
|
329
|
-
'role': 'option',
|
|
330
|
-
'[attr.aria-selected]': 'isActive() ? "true" : "false"',
|
|
331
|
-
'[attr.data-active]': 'isActive() ? "" : null',
|
|
332
|
-
},
|
|
333
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
334
|
-
})
|
|
335
|
-
export class KjCommandItemComponent {
|
|
336
|
-
/** Value emitted on activation. */
|
|
337
|
-
readonly kjValue = input<unknown>(undefined);
|
|
338
|
-
/** Extra filter keywords. */
|
|
339
|
-
readonly kjKeywords = input<readonly string[]>([]);
|
|
340
|
-
/** ARIA keyboard shortcut hint (bound to `aria-keyshortcuts`). */
|
|
341
|
-
readonly kjShortcut = input<string | null>(null);
|
|
342
|
-
/** Disable this item. */
|
|
343
|
-
readonly kjDisabled = input<boolean, unknown>(false, { transform: booleanAttribute });
|
|
344
|
-
|
|
345
|
-
private readonly _item = injectListItem<unknown>();
|
|
346
|
-
private readonly _palette = inject(KjCommandPalette);
|
|
347
|
-
|
|
348
|
-
/** Whether this item is the active (highlighted) one in the palette. */
|
|
349
|
-
protected readonly isActive = computed(() =>
|
|
350
|
-
this._palette.activeId() !== null && this._palette.activeId() === this._item.id,
|
|
351
|
-
);
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
/**
|
|
355
|
-
* Styled command group. Auto-hides when all child items are filtered out.
|
|
356
|
-
*
|
|
357
|
-
* @doc-category Library/Actions
|
|
358
|
-
* @doc
|
|
359
|
-
* @doc-name command-palette
|
|
360
|
-
*/
|
|
361
|
-
@Component({
|
|
362
|
-
selector: 'kj-command-group',
|
|
363
|
-
standalone: true,
|
|
364
|
-
hostDirectives: [KjCommandGroup],
|
|
365
|
-
template: `
|
|
366
|
-
@if (kjLabel()) {
|
|
367
|
-
<div class="kj-command-group__label">{{ kjLabel() }}</div>
|
|
368
|
-
}
|
|
369
|
-
<ng-content />
|
|
370
|
-
`,
|
|
371
|
-
styleUrl: './command-palette.css',
|
|
372
|
-
encapsulation: ViewEncapsulation.None,
|
|
373
|
-
host: { class: 'kj-command-group' },
|
|
374
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
375
|
-
})
|
|
376
|
-
export class KjCommandGroupComponent {
|
|
377
|
-
/** Optional visible label for the group. */
|
|
378
|
-
readonly kjLabel = input<string>('');
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
/**
|
|
382
|
-
* Styled command input wrapper. Renders an `<input type="search">` with
|
|
383
|
-
* the combobox ARIA wiring from `[kjCommandInput]`. Useful when consumers
|
|
384
|
-
* build a custom palette layout outside `<kj-command-palette>`.
|
|
385
|
-
*
|
|
386
|
-
* @doc-category Library/Actions
|
|
387
|
-
* @doc
|
|
388
|
-
* @doc-name command-palette
|
|
389
|
-
*/
|
|
390
|
-
@Component({
|
|
391
|
-
selector: 'kj-command-input',
|
|
392
|
-
standalone: true,
|
|
393
|
-
imports: [KjCommandInput],
|
|
394
|
-
template: `
|
|
395
|
-
<input
|
|
396
|
-
kjCommandInput
|
|
397
|
-
type="search"
|
|
398
|
-
class="kj-command-input"
|
|
399
|
-
[placeholder]="kjPlaceholder()"
|
|
400
|
-
/>
|
|
401
|
-
`,
|
|
402
|
-
styleUrl: './command-palette.css',
|
|
403
|
-
encapsulation: ViewEncapsulation.None,
|
|
404
|
-
host: { style: 'display: contents;' },
|
|
405
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
406
|
-
})
|
|
407
|
-
export class KjCommandInputComponent {
|
|
408
|
-
/** Input placeholder text. */
|
|
409
|
-
readonly kjPlaceholder = input<string>('Search commands…');
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
/**
|
|
413
|
-
* Styled separator between command groups.
|
|
414
|
-
*
|
|
415
|
-
* @doc-category Library/Actions
|
|
416
|
-
* @doc
|
|
417
|
-
* @doc-name command-palette
|
|
418
|
-
*/
|
|
419
|
-
@Component({
|
|
420
|
-
selector: 'kj-command-separator',
|
|
421
|
-
standalone: true,
|
|
422
|
-
hostDirectives: [KjCommandSeparator],
|
|
423
|
-
template: ``,
|
|
424
|
-
styleUrl: './command-palette.css',
|
|
425
|
-
encapsulation: ViewEncapsulation.None,
|
|
426
|
-
host: { class: 'kj-command-separator' },
|
|
427
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
428
|
-
})
|
|
429
|
-
export class KjCommandSeparatorComponent {}
|
|
430
|
-
|
|
431
|
-
/**
|
|
432
|
-
* Styled empty state slot. Shown when no items match the current query.
|
|
433
|
-
*
|
|
434
|
-
* @doc-category Library/Actions
|
|
435
|
-
* @doc
|
|
436
|
-
* @doc-name command-palette
|
|
437
|
-
*/
|
|
438
|
-
@Component({
|
|
439
|
-
selector: 'kj-command-empty',
|
|
440
|
-
standalone: true,
|
|
441
|
-
hostDirectives: [KjCommandEmpty],
|
|
442
|
-
template: `<ng-content />`,
|
|
443
|
-
styleUrl: './command-palette.css',
|
|
444
|
-
encapsulation: ViewEncapsulation.None,
|
|
445
|
-
host: { class: 'kj-command-empty' },
|
|
446
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
447
|
-
})
|
|
448
|
-
export class KjCommandEmptyComponent {}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
KjCommandPaletteComponent,
|
|
3
|
-
KjCommandPaletteFooter,
|
|
4
|
-
KjCommandPaletteItemTemplate,
|
|
5
|
-
KjCommandItemComponent,
|
|
6
|
-
KjCommandGroupComponent,
|
|
7
|
-
KjCommandInputComponent,
|
|
8
|
-
KjCommandSeparatorComponent,
|
|
9
|
-
KjCommandEmptyComponent,
|
|
10
|
-
} from './command-palette';
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { Component, signal, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
KjConfirmPopupActionComponent,
|
|
4
|
-
KjConfirmPopupActionsComponent,
|
|
5
|
-
KjConfirmPopupCancelComponent,
|
|
6
|
-
KjConfirmPopupComponent,
|
|
7
|
-
KjConfirmPopupContentComponent,
|
|
8
|
-
KjConfirmPopupMessageComponent,
|
|
9
|
-
} from '../confirm-popup';
|
|
10
|
-
import { KjConfirmPopupTrigger } from '@kouji-ui/core';
|
|
11
|
-
import { KjButtonComponent } from '../../button/button';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Destructive confirm popup — `[kjDestructive]="true"` flows through the
|
|
15
|
-
* confirm popup context to the action button, which renders with the
|
|
16
|
-
* `destructive` variant for the AAA-contrast danger token.
|
|
17
|
-
*/
|
|
18
|
-
@Component({
|
|
19
|
-
selector: 'kj-confirm-popup-destructive-example',
|
|
20
|
-
standalone: true,
|
|
21
|
-
imports: [
|
|
22
|
-
KjConfirmPopupComponent,
|
|
23
|
-
KjConfirmPopupTrigger,
|
|
24
|
-
KjConfirmPopupContentComponent,
|
|
25
|
-
KjConfirmPopupMessageComponent,
|
|
26
|
-
KjConfirmPopupActionComponent,
|
|
27
|
-
KjConfirmPopupCancelComponent,
|
|
28
|
-
KjConfirmPopupActionsComponent,
|
|
29
|
-
KjButtonComponent,
|
|
30
|
-
],
|
|
31
|
-
styles: [
|
|
32
|
-
`
|
|
33
|
-
:host {
|
|
34
|
-
display: block;
|
|
35
|
-
padding: var(--kj-space-2xl);
|
|
36
|
-
min-height: 14rem;
|
|
37
|
-
}
|
|
38
|
-
.kj-confirm-popup-example__status {
|
|
39
|
-
margin-top: var(--kj-space-md);
|
|
40
|
-
color: var(--kj-fg-default);
|
|
41
|
-
opacity: 0.85;
|
|
42
|
-
font-size: 0.875rem;
|
|
43
|
-
}
|
|
44
|
-
`,
|
|
45
|
-
],
|
|
46
|
-
changeDetection: ChangeDetectionStrategy.Eager,
|
|
47
|
-
template: `
|
|
48
|
-
<kj-confirm-popup [kjDestructive]="true" (kjResult)="onResult($event)">
|
|
49
|
-
<kj-button kjConfirmPopupTrigger #trig="kjConfirmPopupTrigger" kjVariant="destructive"
|
|
50
|
-
>Delete row</kj-button
|
|
51
|
-
>
|
|
52
|
-
<kj-confirm-popup-content [kjFor]="trig">
|
|
53
|
-
<p kjConfirmPopupMessage>Delete this row? This cannot be undone.</p>
|
|
54
|
-
<kj-confirm-popup-actions>
|
|
55
|
-
<kj-confirm-popup-cancel>
|
|
56
|
-
<kj-button kjVariant="ghost">Cancel</kj-button>
|
|
57
|
-
</kj-confirm-popup-cancel>
|
|
58
|
-
<kj-confirm-popup-action>
|
|
59
|
-
<kj-button kjVariant="destructive">Delete</kj-button>
|
|
60
|
-
</kj-confirm-popup-action>
|
|
61
|
-
</kj-confirm-popup-actions>
|
|
62
|
-
</kj-confirm-popup-content>
|
|
63
|
-
</kj-confirm-popup>
|
|
64
|
-
<p class="kj-confirm-popup-example__status">Last result: {{ status() }}</p>
|
|
65
|
-
`,
|
|
66
|
-
})
|
|
67
|
-
export class KjConfirmPopupDestructiveExample {
|
|
68
|
-
readonly status = signal<string>('—');
|
|
69
|
-
onResult(result: boolean): void {
|
|
70
|
-
this.status.set(result ? 'confirmed' : 'cancelled');
|
|
71
|
-
}
|
|
72
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { Component, signal, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
KjConfirmPopupActionComponent,
|
|
4
|
-
KjConfirmPopupActionsComponent,
|
|
5
|
-
KjConfirmPopupCancelComponent,
|
|
6
|
-
KjConfirmPopupComponent,
|
|
7
|
-
KjConfirmPopupContentComponent,
|
|
8
|
-
KjConfirmPopupMessageComponent,
|
|
9
|
-
} from '../confirm-popup';
|
|
10
|
-
import { KjConfirmPopupTrigger } from '@kouji-ui/core';
|
|
11
|
-
import { KjButtonComponent } from '../../button/button';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Default confirm popup — anchored confirmation for a delete action.
|
|
15
|
-
*
|
|
16
|
-
* Flat shape — `<kj-confirm-popup>` owns the state, the trigger button
|
|
17
|
-
* (any element with `[kjConfirmPopupTrigger]`) anchors the panel, and
|
|
18
|
-
* `<kj-confirm-popup-content [kjFor]="trig">` resolves the panel against
|
|
19
|
-
* that trigger ref. The cancel button receives initial focus
|
|
20
|
-
* (WCAG 3.3.4 *Error Prevention*).
|
|
21
|
-
*/
|
|
22
|
-
@Component({
|
|
23
|
-
selector: 'kj-confirm-popup-example',
|
|
24
|
-
standalone: true,
|
|
25
|
-
imports: [
|
|
26
|
-
KjConfirmPopupComponent,
|
|
27
|
-
KjConfirmPopupTrigger,
|
|
28
|
-
KjConfirmPopupContentComponent,
|
|
29
|
-
KjConfirmPopupMessageComponent,
|
|
30
|
-
KjConfirmPopupActionComponent,
|
|
31
|
-
KjConfirmPopupCancelComponent,
|
|
32
|
-
KjConfirmPopupActionsComponent,
|
|
33
|
-
KjButtonComponent,
|
|
34
|
-
],
|
|
35
|
-
styles: [
|
|
36
|
-
`
|
|
37
|
-
:host {
|
|
38
|
-
display: block;
|
|
39
|
-
padding: var(--kj-space-2xl);
|
|
40
|
-
min-height: 14rem;
|
|
41
|
-
}
|
|
42
|
-
.kj-confirm-popup-example__row {
|
|
43
|
-
display: flex;
|
|
44
|
-
align-items: center;
|
|
45
|
-
gap: var(--kj-space-md);
|
|
46
|
-
}
|
|
47
|
-
.kj-confirm-popup-example__status {
|
|
48
|
-
color: var(--kj-fg-default);
|
|
49
|
-
opacity: 0.85;
|
|
50
|
-
font-size: 0.875rem;
|
|
51
|
-
}
|
|
52
|
-
`,
|
|
53
|
-
],
|
|
54
|
-
changeDetection: ChangeDetectionStrategy.Eager,
|
|
55
|
-
template: `
|
|
56
|
-
<div class="kj-confirm-popup-example__row">
|
|
57
|
-
<kj-confirm-popup (kjResult)="onResult($event)">
|
|
58
|
-
<kj-button kjConfirmPopupTrigger #trig="kjConfirmPopupTrigger" kjVariant="default"
|
|
59
|
-
>Delete item</kj-button
|
|
60
|
-
>
|
|
61
|
-
<kj-confirm-popup-content [kjFor]="trig">
|
|
62
|
-
<p kjConfirmPopupMessage class="kj-confirm-popup-message">Delete this item?</p>
|
|
63
|
-
<kj-confirm-popup-actions>
|
|
64
|
-
<kj-confirm-popup-cancel>
|
|
65
|
-
<kj-button kjVariant="ghost">Cancel</kj-button>
|
|
66
|
-
</kj-confirm-popup-cancel>
|
|
67
|
-
<kj-confirm-popup-action>
|
|
68
|
-
<kj-button kjVariant="default">Delete</kj-button>
|
|
69
|
-
</kj-confirm-popup-action>
|
|
70
|
-
</kj-confirm-popup-actions>
|
|
71
|
-
</kj-confirm-popup-content>
|
|
72
|
-
</kj-confirm-popup>
|
|
73
|
-
<span class="kj-confirm-popup-example__status">Last result: {{ status() }}</span>
|
|
74
|
-
</div>
|
|
75
|
-
`,
|
|
76
|
-
})
|
|
77
|
-
export class KjConfirmPopupExample {
|
|
78
|
-
readonly status = signal<string>('—');
|
|
79
|
-
onResult(result: boolean): void {
|
|
80
|
-
this.status.set(result ? 'confirmed' : 'cancelled');
|
|
81
|
-
}
|
|
82
|
-
}
|