@kouji-ui/components 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/kouji-ui-components.mjs +17668 -0
- package/fesm2022/kouji-ui-components.mjs.map +1 -0
- package/package.json +17 -10
- package/types/kouji-ui-components.d.ts +8032 -0
- package/.turbo/turbo-build.log +0 -29
- package/CHANGELOG.md +0 -192
- package/ng-package.json +0 -7
- package/src/accordion/_examples/accordion.default.example.ts +0 -31
- package/src/accordion/_examples/accordion.disabled.example.ts +0 -38
- package/src/accordion/_examples/accordion.multiple.example.ts +0 -31
- package/src/accordion/_examples/accordion.rich-content.example.ts +0 -49
- package/src/accordion/_examples/index.ts +0 -6
- package/src/accordion/accordion.arrow-nav.example.ts +0 -39
- package/src/accordion/accordion.css +0 -68
- package/src/accordion/accordion.playground.ts +0 -119
- package/src/accordion/accordion.spec.ts +0 -117
- package/src/accordion/accordion.ts +0 -153
- package/src/accordion/accordion.usage.example.ts +0 -38
- package/src/accordion/accordion.value.example.ts +0 -60
- package/src/accordion/index.ts +0 -1
- package/src/alert/_examples/alert.banner.example.ts +0 -56
- package/src/alert/_examples/alert.dismissible.example.ts +0 -53
- package/src/alert/_examples/alert.example.ts +0 -40
- package/src/alert/_examples/alert.variants.example.ts +0 -66
- package/src/alert/_examples/alert.with-actions.example.ts +0 -57
- package/src/alert/_examples/index.ts +0 -7
- package/src/alert/alert.css +0 -133
- package/src/alert/alert.playground.ts +0 -111
- package/src/alert/alert.spec.ts +0 -167
- package/src/alert/alert.ts +0 -250
- package/src/alert/alert.usage.example.ts +0 -58
- package/src/alert/index.ts +0 -8
- package/src/avatar/_examples/avatar-group.example.ts +0 -31
- package/src/avatar/_examples/avatar-group.list.example.ts +0 -45
- package/src/avatar/_examples/avatar-group.overflow.example.ts +0 -33
- package/src/avatar/_examples/avatar-group.shapes.example.ts +0 -39
- package/src/avatar/_examples/avatar-group.sizes.example.ts +0 -44
- package/src/avatar/_examples/avatar.default.example.ts +0 -18
- package/src/avatar/_examples/avatar.initials.example.ts +0 -20
- package/src/avatar/_examples/avatar.shapes.example.ts +0 -22
- package/src/avatar/_examples/avatar.sizes.example.ts +0 -26
- package/src/avatar/_examples/avatar.with-image.example.ts +0 -20
- package/src/avatar/_examples/index.ts +0 -12
- package/src/avatar/avatar-group.spec.ts +0 -138
- package/src/avatar/avatar-group.ts +0 -127
- package/src/avatar/avatar-group.usage.example.ts +0 -30
- package/src/avatar/avatar.css +0 -58
- package/src/avatar/avatar.playground.ts +0 -95
- package/src/avatar/avatar.ts +0 -123
- package/src/avatar/index.ts +0 -2
- package/src/badge/_examples/badge.default.example.ts +0 -18
- package/src/badge/_examples/badge.sizes.example.ts +0 -25
- package/src/badge/_examples/badge.variants.example.ts +0 -24
- package/src/badge/_examples/badge.with-dot.example.ts +0 -31
- package/src/badge/_examples/badge.with-icon.example.ts +0 -23
- package/src/badge/_examples/index.ts +0 -7
- package/src/badge/badge.css +0 -59
- package/src/badge/badge.playground.ts +0 -49
- package/src/badge/badge.ts +0 -86
- package/src/badge/badge.usage.example.ts +0 -22
- package/src/badge/index.ts +0 -1
- package/src/breadcrumb/_examples/breadcrumb.custom-separator.example.ts +0 -53
- package/src/breadcrumb/_examples/breadcrumb.example.ts +0 -48
- package/src/breadcrumb/_examples/breadcrumb.long-path.example.ts +0 -58
- package/src/breadcrumb/_examples/breadcrumb.truncated.example.ts +0 -59
- package/src/breadcrumb/_examples/breadcrumb.with-icons.example.ts +0 -66
- package/src/breadcrumb/_examples/index.ts +0 -7
- package/src/breadcrumb/breadcrumb.css +0 -121
- package/src/breadcrumb/breadcrumb.playground.ts +0 -93
- package/src/breadcrumb/breadcrumb.spec.ts +0 -230
- package/src/breadcrumb/breadcrumb.ts +0 -272
- package/src/breadcrumb/breadcrumb.usage.example.ts +0 -45
- package/src/breadcrumb/index.ts +0 -1
- package/src/button/_examples/button.anchor.example.ts +0 -18
- package/src/button/_examples/button.configured.example.ts +0 -43
- package/src/button/_examples/button.disabled.example.ts +0 -25
- package/src/button/_examples/button.example.ts +0 -22
- package/src/button/_examples/button.icon.example.ts +0 -27
- package/src/button/_examples/button.loading.example.ts +0 -31
- package/src/button/_examples/button.pressed.example.ts +0 -24
- package/src/button/_examples/button.sizes.example.ts +0 -26
- package/src/button/_examples/button.usage.example.ts +0 -66
- package/src/button/_examples/button.variants.example.ts +0 -26
- package/src/button/_examples/index.ts +0 -12
- package/src/button/button.css +0 -263
- package/src/button/button.playground.ts +0 -79
- package/src/button/button.spec.ts +0 -100
- package/src/button/button.ts +0 -150
- package/src/button/index.ts +0 -1
- package/src/button-group/_examples/button-group.example.ts +0 -30
- package/src/button-group/_examples/button-group.icon-only.example.ts +0 -30
- package/src/button-group/_examples/button-group.toggle.example.ts +0 -36
- package/src/button-group/_examples/button-group.variants.example.ts +0 -40
- package/src/button-group/_examples/button-group.vertical.example.ts +0 -29
- package/src/button-group/_examples/index.ts +0 -7
- package/src/button-group/button-group.css +0 -80
- package/src/button-group/button-group.playground.ts +0 -94
- package/src/button-group/button-group.spec.ts +0 -119
- package/src/button-group/button-group.ts +0 -130
- package/src/button-group/button-group.usage.example.ts +0 -35
- package/src/button-group/index.ts +0 -1
- package/src/calendar/_examples/calendar.example.ts +0 -33
- package/src/calendar/_examples/index.ts +0 -3
- package/src/calendar/calendar.css +0 -129
- package/src/calendar/calendar.playground.ts +0 -84
- package/src/calendar/calendar.spec.ts +0 -50
- package/src/calendar/calendar.ts +0 -171
- package/src/calendar/calendar.usage.example.ts +0 -33
- package/src/calendar/index.ts +0 -1
- package/src/card/_examples/card.cover.example.ts +0 -53
- package/src/card/_examples/card.example.ts +0 -27
- package/src/card/_examples/card.full.example.ts +0 -51
- package/src/card/_examples/index.ts +0 -5
- package/src/card/card.css +0 -120
- package/src/card/card.playground.ts +0 -116
- package/src/card/card.spec.ts +0 -50
- package/src/card/card.ts +0 -194
- package/src/card/card.usage.example.ts +0 -46
- package/src/card/index.ts +0 -1
- package/src/carousel/_examples/carousel.autoplay.example.ts +0 -69
- package/src/carousel/_examples/carousel.example.ts +0 -60
- package/src/carousel/_examples/carousel.indicators.example.ts +0 -64
- package/src/carousel/_examples/carousel.lazy-load.example.ts +0 -85
- package/src/carousel/_examples/carousel.tabs-pattern.example.ts +0 -61
- package/src/carousel/_examples/index.ts +0 -7
- package/src/carousel/carousel.css +0 -181
- package/src/carousel/carousel.playground.ts +0 -135
- package/src/carousel/carousel.spec.ts +0 -211
- package/src/carousel/carousel.ts +0 -399
- package/src/carousel/carousel.usage.example.ts +0 -46
- package/src/carousel/index.ts +0 -1
- package/src/cascade-select/_examples/cascade-select.data-driven.example.ts +0 -119
- package/src/cascade-select/_examples/cascade-select.disabled.example.ts +0 -74
- package/src/cascade-select/_examples/cascade-select.example.ts +0 -80
- package/src/cascade-select/_examples/cascade-select.field.example.ts +0 -73
- package/src/cascade-select/_examples/cascade-select.path.example.ts +0 -85
- package/src/cascade-select/_examples/index.ts +0 -7
- package/src/cascade-select/cascade-select.css +0 -120
- package/src/cascade-select/cascade-select.playground.ts +0 -133
- package/src/cascade-select/cascade-select.ts +0 -201
- package/src/cascade-select/cascade-select.usage.example.ts +0 -44
- package/src/cascade-select/index.ts +0 -5
- package/src/chat/_examples/chat-bubble.example.ts +0 -71
- package/src/chat/_examples/chat-bubble.grouped.example.ts +0 -69
- package/src/chat/_examples/chat-bubble.sides.example.ts +0 -41
- package/src/chat/_examples/chat-bubble.variants.example.ts +0 -58
- package/src/chat/_examples/chat-bubble.with-state.example.ts +0 -57
- package/src/chat/_examples/index.ts +0 -7
- package/src/chat/chat.css +0 -231
- package/src/chat/chat.playground.ts +0 -171
- package/src/chat/chat.spec.ts +0 -343
- package/src/chat/chat.ts +0 -269
- package/src/chat/chat.usage.example.ts +0 -49
- package/src/chat/index.ts +0 -13
- package/src/checkbox/_examples/checkbox.checked.example.ts +0 -20
- package/src/checkbox/_examples/checkbox.default.example.ts +0 -20
- package/src/checkbox/_examples/checkbox.disabled.example.ts +0 -26
- package/src/checkbox/_examples/checkbox.indeterminate.example.ts +0 -20
- package/src/checkbox/_examples/checkbox.usage.example.ts +0 -62
- package/src/checkbox/_examples/index.ts +0 -7
- package/src/checkbox/checkbox.css +0 -74
- package/src/checkbox/checkbox.playground.ts +0 -68
- package/src/checkbox/checkbox.ts +0 -122
- package/src/checkbox/index.ts +0 -1
- package/src/color-picker/_examples/color-picker.alpha.example.ts +0 -36
- package/src/color-picker/_examples/color-picker.example.ts +0 -34
- package/src/color-picker/_examples/color-picker.hex-input.example.ts +0 -53
- package/src/color-picker/_examples/color-picker.in-form.example.ts +0 -60
- package/src/color-picker/_examples/color-picker.usage.example.ts +0 -58
- package/src/color-picker/_examples/color-picker.with-presets.example.ts +0 -45
- package/src/color-picker/_examples/index.ts +0 -8
- package/src/color-picker/color-picker.css +0 -183
- package/src/color-picker/color-picker.playground.ts +0 -83
- package/src/color-picker/color-picker.spec.ts +0 -94
- package/src/color-picker/color-picker.ts +0 -234
- package/src/color-picker/index.ts +0 -1
- package/src/combobox/_examples/combobox.async.example.ts +0 -85
- package/src/combobox/_examples/combobox.empty-state.example.ts +0 -36
- package/src/combobox/_examples/combobox.example.ts +0 -36
- package/src/combobox/_examples/combobox.free-text.example.ts +0 -42
- package/src/combobox/_examples/combobox.usage.example.ts +0 -51
- package/src/combobox/_examples/combobox.with-icons.example.ts +0 -49
- package/src/combobox/_examples/index.ts +0 -8
- package/src/combobox/combobox.css +0 -101
- package/src/combobox/combobox.playground.ts +0 -90
- package/src/combobox/combobox.spec.ts +0 -111
- package/src/combobox/combobox.ts +0 -219
- package/src/combobox/index.ts +0 -6
- package/src/command-palette/_examples/command-palette.async.example.ts +0 -99
- package/src/command-palette/_examples/command-palette.dialog.example.ts +0 -90
- package/src/command-palette/_examples/command-palette.example.ts +0 -40
- package/src/command-palette/_examples/command-palette.fuzzy.example.ts +0 -54
- package/src/command-palette/_examples/command-palette.groups.example.ts +0 -55
- package/src/command-palette/_examples/command-palette.usage.example.ts +0 -49
- package/src/command-palette/_examples/index.ts +0 -8
- package/src/command-palette/command-palette.css +0 -234
- package/src/command-palette/command-palette.playground.ts +0 -119
- package/src/command-palette/command-palette.ts +0 -448
- package/src/command-palette/index.ts +0 -10
- package/src/confirm-popup/_examples/confirm-popup.destructive.example.ts +0 -72
- package/src/confirm-popup/_examples/confirm-popup.example.ts +0 -82
- package/src/confirm-popup/_examples/confirm-popup.placement.example.ts +0 -97
- package/src/confirm-popup/_examples/confirm-popup.usage.example.ts +0 -94
- package/src/confirm-popup/_examples/confirm-popup.with-message.example.ts +0 -76
- package/src/confirm-popup/_examples/index.ts +0 -7
- package/src/confirm-popup/confirm-popup.css +0 -47
- package/src/confirm-popup/confirm-popup.playground.ts +0 -109
- package/src/confirm-popup/confirm-popup.spec.ts +0 -209
- package/src/confirm-popup/confirm-popup.ts +0 -279
- package/src/confirm-popup/index.ts +0 -1
- package/src/date-picker/_examples/date-picker.disabled-dates.example.ts +0 -44
- package/src/date-picker/_examples/date-picker.example.ts +0 -38
- package/src/date-picker/_examples/date-picker.locale.example.ts +0 -50
- package/src/date-picker/_examples/date-picker.readonly.example.ts +0 -32
- package/src/date-picker/_examples/date-picker.usage.example.ts +0 -60
- package/src/date-picker/_examples/date-picker.with-min-max.example.ts +0 -47
- package/src/date-picker/_examples/index.ts +0 -8
- package/src/date-picker/date-picker.css +0 -61
- package/src/date-picker/date-picker.playground.ts +0 -79
- package/src/date-picker/date-picker.spec.ts +0 -71
- package/src/date-picker/date-picker.ts +0 -185
- package/src/date-picker/index.ts +0 -1
- package/src/dialog/_examples/dialog.confirmation.example.ts +0 -30
- package/src/dialog/_examples/dialog.default.example.ts +0 -30
- package/src/dialog/_examples/dialog.nested.example.ts +0 -86
- package/src/dialog/_examples/dialog.scrollable.example.ts +0 -30
- package/src/dialog/_examples/dialog.usage.example.ts +0 -57
- package/src/dialog/_examples/dialog.with-form.example.ts +0 -48
- package/src/dialog/_examples/index.ts +0 -8
- package/src/dialog/dialog.css +0 -56
- package/src/dialog/dialog.playground.ts +0 -136
- package/src/dialog/dialog.ts +0 -82
- package/src/dialog/index.ts +0 -1
- package/src/divider/_examples/divider.example.ts +0 -27
- package/src/divider/_examples/divider.sizes.example.ts +0 -33
- package/src/divider/_examples/divider.structural.example.ts +0 -55
- package/src/divider/_examples/divider.usage.example.ts +0 -48
- package/src/divider/_examples/divider.variants.example.ts +0 -33
- package/src/divider/_examples/divider.vertical.example.ts +0 -38
- package/src/divider/_examples/divider.with-content.example.ts +0 -38
- package/src/divider/_examples/index.ts +0 -9
- package/src/divider/divider.css +0 -93
- package/src/divider/divider.playground.ts +0 -97
- package/src/divider/divider.spec.ts +0 -207
- package/src/divider/divider.ts +0 -220
- package/src/divider/index.ts +0 -1
- package/src/drawer/_examples/drawer.example.ts +0 -30
- package/src/drawer/_examples/drawer.modal-vs-non-modal.example.ts +0 -27
- package/src/drawer/_examples/drawer.scrollable.example.ts +0 -30
- package/src/drawer/_examples/drawer.sides.example.ts +0 -32
- package/src/drawer/_examples/drawer.usage.example.ts +0 -56
- package/src/drawer/_examples/drawer.with-form.example.ts +0 -48
- package/src/drawer/_examples/index.ts +0 -8
- package/src/drawer/drawer.css +0 -130
- package/src/drawer/drawer.playground.ts +0 -107
- package/src/drawer/drawer.spec.ts +0 -216
- package/src/drawer/drawer.ts +0 -85
- package/src/drawer/index.ts +0 -1
- package/src/dropdown-menu/_examples/dropdown-menu.disabled.example.ts +0 -19
- package/src/dropdown-menu/_examples/dropdown-menu.example.ts +0 -20
- package/src/dropdown-menu/_examples/dropdown-menu.shortcuts.example.ts +0 -31
- package/src/dropdown-menu/_examples/dropdown-menu.sides.example.ts +0 -18
- package/src/dropdown-menu/_examples/dropdown-menu.usage.example.ts +0 -56
- package/src/dropdown-menu/_examples/dropdown-menu.with-icons.example.ts +0 -31
- package/src/dropdown-menu/_examples/dropdown-menu.with-separator.example.ts +0 -41
- package/src/dropdown-menu/_examples/index.ts +0 -9
- package/src/dropdown-menu/dropdown-menu.css +0 -108
- package/src/dropdown-menu/dropdown-menu.playground.ts +0 -109
- package/src/dropdown-menu/dropdown-menu.spec.ts +0 -5
- package/src/dropdown-menu/dropdown-menu.ts +0 -128
- package/src/dropdown-menu/index.ts +0 -1
- package/src/empty-state/_examples/empty-state.error.example.ts +0 -63
- package/src/empty-state/_examples/empty-state.example.ts +0 -59
- package/src/empty-state/_examples/empty-state.search.example.ts +0 -82
- package/src/empty-state/_examples/empty-state.sizes.example.ts +0 -76
- package/src/empty-state/_examples/empty-state.usage.example.ts +0 -66
- package/src/empty-state/_examples/empty-state.with-actions.example.ts +0 -68
- package/src/empty-state/_examples/index.ts +0 -8
- package/src/empty-state/empty-state.css +0 -114
- package/src/empty-state/empty-state.playground.ts +0 -87
- package/src/empty-state/empty-state.spec.ts +0 -211
- package/src/empty-state/empty-state.ts +0 -276
- package/src/empty-state/index.ts +0 -1
- package/src/example-components.ts +0 -396
- package/src/field/_examples/field.disabled.example.ts +0 -49
- package/src/field/_examples/field.example.ts +0 -51
- package/src/field/_examples/field.required.example.ts +0 -46
- package/src/field/_examples/field.with-error.example.ts +0 -73
- package/src/field/_examples/field.with-prefix-suffix.example.ts +0 -63
- package/src/field/_examples/index.ts +0 -7
- package/src/field/field.css +0 -138
- package/src/field/field.playground.ts +0 -108
- package/src/field/field.spec.ts +0 -132
- package/src/field/field.ts +0 -232
- package/src/field/field.usage.example.ts +0 -63
- package/src/field/index.ts +0 -7
- package/src/file-upload/_examples/file-upload.dropzone.example.ts +0 -32
- package/src/file-upload/_examples/file-upload.example.ts +0 -29
- package/src/file-upload/_examples/file-upload.image-preview.example.ts +0 -31
- package/src/file-upload/_examples/file-upload.multiple.example.ts +0 -23
- package/src/file-upload/_examples/file-upload.with-progress.example.ts +0 -59
- package/src/file-upload/_examples/index.ts +0 -7
- package/src/file-upload/file-upload.css +0 -207
- package/src/file-upload/file-upload.playground.ts +0 -84
- package/src/file-upload/file-upload.spec.ts +0 -94
- package/src/file-upload/file-upload.ts +0 -301
- package/src/file-upload/file-upload.usage.example.ts +0 -45
- package/src/file-upload/index.ts +0 -1
- package/src/form/_examples/form.async-submit.example.ts +0 -72
- package/src/form/_examples/form.compound.example.ts +0 -93
- package/src/form/_examples/form.example.ts +0 -70
- package/src/form/_examples/form.validation.example.ts +0 -67
- package/src/form/_examples/index.ts +0 -6
- package/src/form/form.css +0 -63
- package/src/form/form.playground.ts +0 -145
- package/src/form/form.spec.ts +0 -96
- package/src/form/form.ts +0 -216
- package/src/form/form.usage.example.ts +0 -63
- package/src/form/index.ts +0 -5
- package/src/icon/_examples/icon.gallery.example.ts +0 -199
- package/src/icon/_examples/icon.usage.example.ts +0 -46
- package/src/icon/_examples/index.ts +0 -4
- package/src/icon/icon.playground.ts +0 -63
- package/src/icon/index.ts +0 -5
- package/src/icon/lucide/icon-names.generated.ts +0 -1708
- package/src/icon/lucide/icon-names.ts +0 -18
- package/src/icon/lucide/index.ts +0 -2
- package/src/icon/lucide/provide-lucide-icons.ts +0 -96
- package/src/input/_examples/index.ts +0 -4
- package/src/input/_examples/input.color.example.ts +0 -33
- package/src/input/_examples/input.example.ts +0 -22
- package/src/input/index.ts +0 -1
- package/src/input/input.css +0 -70
- package/src/input/input.playground.ts +0 -79
- package/src/input/input.spec.ts +0 -98
- package/src/input/input.ts +0 -158
- package/src/input/input.usage.example.ts +0 -40
- package/src/input-group/_examples/index.ts +0 -7
- package/src/input-group/_examples/input-group.button.example.ts +0 -43
- package/src/input-group/_examples/input-group.example.ts +0 -39
- package/src/input-group/_examples/input-group.icon.example.ts +0 -49
- package/src/input-group/_examples/input-group.url.example.ts +0 -36
- package/src/input-group/_examples/input-group.variants.example.ts +0 -39
- package/src/input-group/index.ts +0 -1
- package/src/input-group/input-group.css +0 -125
- package/src/input-group/input-group.playground.ts +0 -90
- package/src/input-group/input-group.ts +0 -142
- package/src/input-group/input-group.usage.example.ts +0 -47
- package/src/input-mask/_examples/index.ts +0 -8
- package/src/input-mask/_examples/input-mask.credit-card.example.ts +0 -90
- package/src/input-mask/_examples/input-mask.custom-tokens.example.ts +0 -87
- package/src/input-mask/_examples/input-mask.date.example.ts +0 -61
- package/src/input-mask/_examples/input-mask.example.ts +0 -61
- package/src/input-mask/_examples/input-mask.usage.example.ts +0 -44
- package/src/input-mask/_examples/input-mask.validation.example.ts +0 -80
- package/src/input-mask/index.ts +0 -9
- package/src/input-mask/input-mask.css +0 -39
- package/src/input-mask/input-mask.playground.ts +0 -79
- package/src/input-mask/input-mask.ts +0 -130
- package/src/input-otp/_examples/index.ts +0 -8
- package/src/input-otp/_examples/input-otp.autosubmit.example.ts +0 -71
- package/src/input-otp/_examples/input-otp.example.ts +0 -47
- package/src/input-otp/_examples/input-otp.lengths.example.ts +0 -67
- package/src/input-otp/_examples/input-otp.masked.example.ts +0 -46
- package/src/input-otp/_examples/input-otp.reactive.example.ts +0 -58
- package/src/input-otp/_examples/input-otp.separator.example.ts +0 -49
- package/src/input-otp/index.ts +0 -1
- package/src/input-otp/input-otp.css +0 -87
- package/src/input-otp/input-otp.playground.ts +0 -107
- package/src/input-otp/input-otp.ts +0 -244
- package/src/input-otp/input-otp.usage.example.ts +0 -45
- package/src/kbd/_examples/index.ts +0 -6
- package/src/kbd/_examples/kbd.combo.example.ts +0 -24
- package/src/kbd/_examples/kbd.example.ts +0 -22
- package/src/kbd/_examples/kbd.in-tooltip.example.ts +0 -43
- package/src/kbd/_examples/kbd.sizes.example.ts +0 -31
- package/src/kbd/index.ts +0 -1
- package/src/kbd/kbd.css +0 -67
- package/src/kbd/kbd.playground.ts +0 -51
- package/src/kbd/kbd.spec.ts +0 -123
- package/src/kbd/kbd.ts +0 -123
- package/src/kbd/kbd.usage.example.ts +0 -38
- package/src/link/_examples/index.ts +0 -8
- package/src/link/_examples/link.disabled.example.ts +0 -23
- package/src/link/_examples/link.example.ts +0 -26
- package/src/link/_examples/link.external.example.ts +0 -33
- package/src/link/_examples/link.in-prose.example.ts +0 -36
- package/src/link/_examples/link.sizes.example.ts +0 -28
- package/src/link/_examples/link.variants.example.ts +0 -25
- package/src/link/index.ts +0 -1
- package/src/link/link.css +0 -104
- package/src/link/link.playground.ts +0 -98
- package/src/link/link.spec.ts +0 -146
- package/src/link/link.ts +0 -133
- package/src/link/link.usage.example.ts +0 -37
- package/src/list/_examples/index.ts +0 -7
- package/src/list/_examples/list.divided.example.ts +0 -32
- package/src/list/_examples/list.example.ts +0 -31
- package/src/list/_examples/list.interactive.example.ts +0 -51
- package/src/list/_examples/list.nav.example.ts +0 -44
- package/src/list/_examples/list.with-icons.example.ts +0 -97
- package/src/list/index.ts +0 -1
- package/src/list/list.css +0 -166
- package/src/list/list.playground.ts +0 -90
- package/src/list/list.spec.ts +0 -121
- package/src/list/list.ts +0 -227
- package/src/list/list.usage.example.ts +0 -45
- package/src/menubar/_examples/index.ts +0 -6
- package/src/menubar/_examples/menubar.disabled-item.example.ts +0 -23
- package/src/menubar/_examples/menubar.example.ts +0 -22
- package/src/menubar/_examples/menubar.with-shortcuts.example.ts +0 -33
- package/src/menubar/_examples/menubar.with-submenu.example.ts +0 -76
- package/src/menubar/index.ts +0 -1
- package/src/menubar/menubar.css +0 -62
- package/src/menubar/menubar.playground.ts +0 -96
- package/src/menubar/menubar.ts +0 -160
- package/src/menubar/menubar.usage.example.ts +0 -33
- package/src/number-input/_examples/index.ts +0 -7
- package/src/number-input/_examples/number-input.currency.example.ts +0 -35
- package/src/number-input/_examples/number-input.decimal.example.ts +0 -34
- package/src/number-input/_examples/number-input.example.ts +0 -24
- package/src/number-input/_examples/number-input.min-max.example.ts +0 -33
- package/src/number-input/_examples/number-input.with-stepper.example.ts +0 -45
- package/src/number-input/index.ts +0 -1
- package/src/number-input/number-input.css +0 -115
- package/src/number-input/number-input.playground.ts +0 -92
- package/src/number-input/number-input.spec.ts +0 -102
- package/src/number-input/number-input.ts +0 -212
- package/src/number-input/number-input.usage.example.ts +0 -73
- package/src/overlay/overlay.css +0 -32
- package/src/overlay-badge/_examples/index.ts +0 -7
- package/src/overlay-badge/_examples/overlay-badge.described.example.ts +0 -36
- package/src/overlay-badge/_examples/overlay-badge.dot.example.ts +0 -28
- package/src/overlay-badge/_examples/overlay-badge.example.ts +0 -34
- package/src/overlay-badge/_examples/overlay-badge.on-avatar.example.ts +0 -38
- package/src/overlay-badge/_examples/overlay-badge.positions.example.ts +0 -39
- package/src/overlay-badge/index.ts +0 -1
- package/src/overlay-badge/overlay-badge.css +0 -118
- package/src/overlay-badge/overlay-badge.playground.ts +0 -92
- package/src/overlay-badge/overlay-badge.spec.ts +0 -174
- package/src/overlay-badge/overlay-badge.ts +0 -232
- package/src/overlay-badge/overlay-badge.usage.example.ts +0 -44
- package/src/pagination/_examples/index.ts +0 -7
- package/src/pagination/_examples/pagination.boundaries.example.ts +0 -56
- package/src/pagination/_examples/pagination.compact.example.ts +0 -42
- package/src/pagination/_examples/pagination.example.ts +0 -55
- package/src/pagination/_examples/pagination.large.example.ts +0 -54
- package/src/pagination/_examples/pagination.with-info.example.ts +0 -49
- package/src/pagination/index.ts +0 -1
- package/src/pagination/pagination.css +0 -146
- package/src/pagination/pagination.playground.ts +0 -107
- package/src/pagination/pagination.spec.ts +0 -202
- package/src/pagination/pagination.ts +0 -432
- package/src/pagination/pagination.usage.example.ts +0 -50
- package/src/password-input/_examples/index.ts +0 -6
- package/src/password-input/_examples/password-input.example.ts +0 -24
- package/src/password-input/_examples/password-input.strength.example.ts +0 -45
- package/src/password-input/_examples/password-input.toggle.example.ts +0 -43
- package/src/password-input/_examples/password-input.with-rules.example.ts +0 -78
- package/src/password-input/index.ts +0 -1
- package/src/password-input/password-input.css +0 -155
- package/src/password-input/password-input.playground.ts +0 -81
- package/src/password-input/password-input.spec.ts +0 -129
- package/src/password-input/password-input.ts +0 -254
- package/src/password-input/password-input.usage.example.ts +0 -55
- package/src/playground-types.ts +0 -47
- package/src/popover/_examples/index.ts +0 -7
- package/src/popover/_examples/popover.cancellable.example.ts +0 -20
- package/src/popover/_examples/popover.example.ts +0 -20
- package/src/popover/_examples/popover.modal.example.ts +0 -22
- package/src/popover/_examples/popover.sides.example.ts +0 -37
- package/src/popover/_examples/popover.with-form.example.ts +0 -38
- package/src/popover/index.ts +0 -1
- package/src/popover/popover.css +0 -71
- package/src/popover/popover.playground.ts +0 -86
- package/src/popover/popover.spec.ts +0 -5
- package/src/popover/popover.ts +0 -94
- package/src/popover/popover.usage.example.ts +0 -48
- package/src/progress-bar/_examples/index.ts +0 -7
- package/src/progress-bar/_examples/progress-bar.example.ts +0 -22
- package/src/progress-bar/_examples/progress-bar.indeterminate.example.ts +0 -23
- package/src/progress-bar/_examples/progress-bar.sizes.example.ts +0 -29
- package/src/progress-bar/_examples/progress-bar.variants.example.ts +0 -30
- package/src/progress-bar/_examples/progress-bar.with-label.example.ts +0 -30
- package/src/progress-bar/index.ts +0 -1
- package/src/progress-bar/progress-bar.css +0 -113
- package/src/progress-bar/progress-bar.playground.ts +0 -87
- package/src/progress-bar/progress-bar.spec.ts +0 -233
- package/src/progress-bar/progress-bar.ts +0 -155
- package/src/progress-bar/progress-bar.usage.example.ts +0 -52
- package/src/public-api.ts +0 -61
- package/src/radio/_examples/index.ts +0 -6
- package/src/radio/_examples/radio.default.example.ts +0 -26
- package/src/radio/_examples/radio.disabled.example.ts +0 -26
- package/src/radio/_examples/radio.group.example.ts +0 -27
- package/src/radio/_examples/radio.inline.example.ts +0 -26
- package/src/radio/index.ts +0 -1
- package/src/radio/radio.css +0 -58
- package/src/radio/radio.playground.ts +0 -90
- package/src/radio/radio.ts +0 -143
- package/src/radio/radio.usage.example.ts +0 -54
- package/src/select/_examples/index.ts +0 -6
- package/src/select/_examples/select.default.example.ts +0 -26
- package/src/select/_examples/select.disabled.example.ts +0 -24
- package/src/select/_examples/select.grouped.example.ts +0 -37
- package/src/select/_examples/select.placeholder.example.ts +0 -26
- package/src/select/index.ts +0 -1
- package/src/select/select.css +0 -65
- package/src/select/select.playground.ts +0 -81
- package/src/select/select.ts +0 -176
- package/src/select/select.usage.example.ts +0 -64
- package/src/skeleton/_examples/index.ts +0 -6
- package/src/skeleton/_examples/skeleton.animations.example.ts +0 -52
- package/src/skeleton/_examples/skeleton.card.example.ts +0 -68
- package/src/skeleton/_examples/skeleton.example.ts +0 -24
- package/src/skeleton/_examples/skeleton.shapes.example.ts +0 -55
- package/src/skeleton/index.ts +0 -1
- package/src/skeleton/skeleton.css +0 -111
- package/src/skeleton/skeleton.playground.ts +0 -80
- package/src/skeleton/skeleton.spec.ts +0 -126
- package/src/skeleton/skeleton.ts +0 -155
- package/src/skeleton/skeleton.usage.example.ts +0 -49
- package/src/slider/_examples/index.ts +0 -7
- package/src/slider/_examples/slider.example.ts +0 -41
- package/src/slider/_examples/slider.formatted.example.ts +0 -53
- package/src/slider/_examples/slider.range.example.ts +0 -48
- package/src/slider/_examples/slider.vertical.example.ts +0 -48
- package/src/slider/_examples/slider.with-marks.example.ts +0 -46
- package/src/slider/index.ts +0 -1
- package/src/slider/slider.css +0 -172
- package/src/slider/slider.playground.ts +0 -88
- package/src/slider/slider.spec.ts +0 -139
- package/src/slider/slider.ts +0 -246
- package/src/slider/slider.usage.example.ts +0 -68
- package/src/speed-dial/_examples/index.ts +0 -7
- package/src/speed-dial/_examples/speed-dial.directions.example.ts +0 -85
- package/src/speed-dial/_examples/speed-dial.disabled.example.ts +0 -71
- package/src/speed-dial/_examples/speed-dial.example.ts +0 -48
- package/src/speed-dial/_examples/speed-dial.usage.example.ts +0 -59
- package/src/speed-dial/_examples/speed-dial.with-tooltips.example.ts +0 -65
- package/src/speed-dial/index.ts +0 -1
- package/src/speed-dial/speed-dial.css +0 -137
- package/src/speed-dial/speed-dial.playground.ts +0 -137
- package/src/speed-dial/speed-dial.spec.ts +0 -191
- package/src/speed-dial/speed-dial.ts +0 -257
- package/src/spinner/_examples/index.ts +0 -8
- package/src/spinner/_examples/spinner.animations.example.ts +0 -54
- package/src/spinner/_examples/spinner.example.ts +0 -26
- package/src/spinner/_examples/spinner.in-button.example.ts +0 -51
- package/src/spinner/_examples/spinner.sizes.example.ts +0 -31
- package/src/spinner/_examples/spinner.usage.example.ts +0 -45
- package/src/spinner/_examples/spinner.variants.example.ts +0 -34
- package/src/spinner/index.ts +0 -1
- package/src/spinner/spinner.css +0 -161
- package/src/spinner/spinner.playground.ts +0 -68
- package/src/spinner/spinner.spec.ts +0 -184
- package/src/spinner/spinner.ts +0 -185
- package/src/stepper/_examples/index.ts +0 -8
- package/src/stepper/_examples/stepper.example.ts +0 -62
- package/src/stepper/_examples/stepper.non-linear.example.ts +0 -63
- package/src/stepper/_examples/stepper.optional-step.example.ts +0 -62
- package/src/stepper/_examples/stepper.usage.example.ts +0 -73
- package/src/stepper/_examples/stepper.vertical.example.ts +0 -66
- package/src/stepper/_examples/stepper.with-error.example.ts +0 -63
- package/src/stepper/index.ts +0 -1
- package/src/stepper/stepper.css +0 -147
- package/src/stepper/stepper.playground.ts +0 -88
- package/src/stepper/stepper.spec.ts +0 -200
- package/src/stepper/stepper.ts +0 -242
- package/src/table/_examples/index.ts +0 -23
- package/src/table/_examples/table.column-pinning.example.ts +0 -55
- package/src/table/_examples/table.column-resize.example.ts +0 -49
- package/src/table/_examples/table.column-visibility.example.ts +0 -52
- package/src/table/_examples/table.density.example.ts +0 -71
- package/src/table/_examples/table.editable.example.ts +0 -85
- package/src/table/_examples/table.empty-and-error.example.ts +0 -112
- package/src/table/_examples/table.example.ts +0 -45
- package/src/table/_examples/table.export.example.ts +0 -82
- package/src/table/_examples/table.filterable.example.ts +0 -67
- package/src/table/_examples/table.grouping.example.ts +0 -63
- package/src/table/_examples/table.keyboard.example.ts +0 -115
- package/src/table/_examples/table.master-detail.example.ts +0 -102
- package/src/table/_examples/table.persistence.example.ts +0 -85
- package/src/table/_examples/table.playground.ts +0 -154
- package/src/table/_examples/table.row-pinning.example.ts +0 -71
- package/src/table/_examples/table.selection.example.ts +0 -67
- package/src/table/_examples/table.server-mode.example.ts +0 -120
- package/src/table/_examples/table.sortable.example.ts +0 -49
- package/src/table/_examples/table.theming.example.ts +0 -64
- package/src/table/_examples/table.usage.example.ts +0 -90
- package/src/table/_examples/table.virtualized.example.ts +0 -122
- package/src/table/index.ts +0 -11
- package/src/table/table-cell-editor-outlet.ts +0 -111
- package/src/table/table-editors/boolean-editor.ts +0 -71
- package/src/table/table-editors/date-editor.ts +0 -117
- package/src/table/table-editors/editors.spec.ts +0 -147
- package/src/table/table-editors/index.ts +0 -41
- package/src/table/table-editors/number-editor.ts +0 -89
- package/src/table/table-editors/select-editor.ts +0 -107
- package/src/table/table-editors/text-editor.ts +0 -82
- package/src/table/table-export.spec.ts +0 -33
- package/src/table/table-export.ts +0 -53
- package/src/table/table-filter-outlet.ts +0 -137
- package/src/table/table-filters/date-filter.ts +0 -122
- package/src/table/table-filters/filters.css +0 -53
- package/src/table/table-filters/filters.spec.ts +0 -277
- package/src/table/table-filters/index.ts +0 -11
- package/src/table/table-filters/number-filter.ts +0 -232
- package/src/table/table-filters/select-filter.ts +0 -129
- package/src/table/table-filters/text-filter.ts +0 -110
- package/src/table/table-pagination.spec.ts +0 -118
- package/src/table/table-pagination.ts +0 -191
- package/src/table/table-side-panel.spec.ts +0 -170
- package/src/table/table-side-panel.ts +0 -263
- package/src/table/table-status-bar.spec.ts +0 -78
- package/src/table/table-status-bar.ts +0 -70
- package/src/table/table-toolbar.spec.ts +0 -180
- package/src/table/table-toolbar.ts +0 -244
- package/src/table/table-virtual.spec.ts +0 -103
- package/src/table/table-virtual.ts +0 -180
- package/src/table/table.css +0 -468
- package/src/table/table.spec.ts +0 -175
- package/src/table/table.ts +0 -1009
- package/src/tabs/_examples/index.ts +0 -8
- package/src/tabs/_examples/tabs.controlled.example.ts +0 -59
- package/src/tabs/_examples/tabs.disabled.example.ts +0 -34
- package/src/tabs/_examples/tabs.example.ts +0 -34
- package/src/tabs/_examples/tabs.manual-activation.example.ts +0 -34
- package/src/tabs/_examples/tabs.usage.example.ts +0 -43
- package/src/tabs/_examples/tabs.vertical.example.ts +0 -33
- package/src/tabs/index.ts +0 -1
- package/src/tabs/tabs.css +0 -80
- package/src/tabs/tabs.playground.ts +0 -88
- package/src/tabs/tabs.spec.ts +0 -135
- package/src/tabs/tabs.ts +0 -204
- package/src/tag/_examples/index.ts +0 -9
- package/src/tag/_examples/tag.example.ts +0 -22
- package/src/tag/_examples/tag.list.example.ts +0 -38
- package/src/tag/_examples/tag.removable.example.ts +0 -39
- package/src/tag/_examples/tag.selectable.example.ts +0 -33
- package/src/tag/_examples/tag.sizes.example.ts +0 -25
- package/src/tag/_examples/tag.usage.example.ts +0 -62
- package/src/tag/_examples/tag.variants.example.ts +0 -29
- package/src/tag/index.ts +0 -1
- package/src/tag/tag.css +0 -167
- package/src/tag/tag.playground.ts +0 -63
- package/src/tag/tag.spec.ts +0 -153
- package/src/tag/tag.ts +0 -186
- package/src/test-setup.ts +0 -5
- package/src/textarea/_examples/index.ts +0 -8
- package/src/textarea/_examples/textarea.autoresize.example.ts +0 -37
- package/src/textarea/_examples/textarea.character-count.example.ts +0 -34
- package/src/textarea/_examples/textarea.example.ts +0 -22
- package/src/textarea/_examples/textarea.no-resize.example.ts +0 -28
- package/src/textarea/_examples/textarea.usage.example.ts +0 -50
- package/src/textarea/_examples/textarea.with-field.example.ts +0 -66
- package/src/textarea/index.ts +0 -1
- package/src/textarea/textarea.css +0 -117
- package/src/textarea/textarea.playground.ts +0 -70
- package/src/textarea/textarea.spec.ts +0 -161
- package/src/textarea/textarea.ts +0 -339
- package/src/time-picker/_examples/index.ts +0 -8
- package/src/time-picker/_examples/time-picker.12-hour.example.ts +0 -24
- package/src/time-picker/_examples/time-picker.example.ts +0 -24
- package/src/time-picker/_examples/time-picker.formatted.example.ts +0 -32
- package/src/time-picker/_examples/time-picker.range.example.ts +0 -54
- package/src/time-picker/_examples/time-picker.usage.example.ts +0 -53
- package/src/time-picker/_examples/time-picker.with-seconds.example.ts +0 -24
- package/src/time-picker/index.ts +0 -1
- package/src/time-picker/time-picker.css +0 -126
- package/src/time-picker/time-picker.playground.ts +0 -72
- package/src/time-picker/time-picker.spec.ts +0 -77
- package/src/time-picker/time-picker.ts +0 -207
- package/src/toast/_examples/index.ts +0 -7
- package/src/toast/_examples/toast.default.example.ts +0 -37
- package/src/toast/_examples/toast.dismissible.example.ts +0 -38
- package/src/toast/_examples/toast.usage.example.ts +0 -57
- package/src/toast/_examples/toast.variants.example.ts +0 -43
- package/src/toast/_examples/toast.with-action.example.ts +0 -46
- package/src/toast/index.ts +0 -1
- package/src/toast/toast.css +0 -115
- package/src/toast/toast.playground.ts +0 -61
- package/src/toast/toast.ts +0 -168
- package/src/toggle/_examples/index.ts +0 -7
- package/src/toggle/_examples/toggle.checked.example.ts +0 -20
- package/src/toggle/_examples/toggle.default.example.ts +0 -20
- package/src/toggle/_examples/toggle.disabled.example.ts +0 -26
- package/src/toggle/_examples/toggle.usage.example.ts +0 -51
- package/src/toggle/_examples/toggle.with-label.example.ts +0 -30
- package/src/toggle/index.ts +0 -1
- package/src/toggle/toggle.css +0 -123
- package/src/toggle/toggle.playground.ts +0 -65
- package/src/toggle/toggle.ts +0 -113
- package/src/tooltip/_examples/index.ts +0 -9
- package/src/tooltip/_examples/tooltip.delays.example.ts +0 -16
- package/src/tooltip/_examples/tooltip.disabled.example.ts +0 -16
- package/src/tooltip/_examples/tooltip.example.ts +0 -16
- package/src/tooltip/_examples/tooltip.group.example.ts +0 -20
- package/src/tooltip/_examples/tooltip.rich.example.ts +0 -19
- package/src/tooltip/_examples/tooltip.sides.example.ts +0 -18
- package/src/tooltip/_examples/tooltip.usage.example.ts +0 -50
- package/src/tooltip/index.ts +0 -1
- package/src/tooltip/tooltip.css +0 -61
- package/src/tooltip/tooltip.playground.ts +0 -79
- package/src/tooltip/tooltip.spec.ts +0 -5
- package/src/tooltip/tooltip.ts +0 -102
- package/src/tree-select/_examples/index.ts +0 -8
- package/src/tree-select/_examples/tree-select.disabled.example.ts +0 -106
- package/src/tree-select/_examples/tree-select.example.ts +0 -65
- package/src/tree-select/_examples/tree-select.expanded.example.ts +0 -72
- package/src/tree-select/_examples/tree-select.field.example.ts +0 -77
- package/src/tree-select/_examples/tree-select.multi.example.ts +0 -73
- package/src/tree-select/_examples/tree-select.usage.example.ts +0 -85
- package/src/tree-select/index.ts +0 -1
- package/src/tree-select/tree-select.css +0 -220
- package/src/tree-select/tree-select.playground.ts +0 -83
- package/src/tree-select/tree-select.ts +0 -348
- package/src/typography/_examples/index.ts +0 -9
- package/src/typography/_examples/typography.blockquote.example.ts +0 -34
- package/src/typography/_examples/typography.code.example.ts +0 -32
- package/src/typography/_examples/typography.example.ts +0 -42
- package/src/typography/_examples/typography.lead.example.ts +0 -37
- package/src/typography/_examples/typography.muted.example.ts +0 -27
- package/src/typography/_examples/typography.truncate.example.ts +0 -41
- package/src/typography/_examples/typography.usage.example.ts +0 -44
- package/src/typography/index.ts +0 -8
- package/src/typography/typography.playground.ts +0 -101
- package/src/typography/typography.spec.ts +0 -70
- package/src/typography/typography.ts +0 -105
- package/tsconfig.lib.json +0 -25
- package/tsconfig.lib.prod.json +0 -17
- package/tsconfig.spec.json +0 -16
- package/vite.config.ts +0 -33
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
/* ─────────────────────────────────────────────────────────────
|
|
2
|
-
.kj-password-input — component-layer tokens + structural CSS
|
|
3
|
-
Same pattern as input.css / button.css: tokens default to the
|
|
4
|
-
shared layer; variants/states retarget the component tokens.
|
|
5
|
-
──────────────────────────────────────────────────────────── */
|
|
6
|
-
|
|
7
|
-
@layer kj.component {
|
|
8
|
-
.kj-password-input {
|
|
9
|
-
--kj-password-input-bg: var(--kj-bg-field);
|
|
10
|
-
--kj-password-input-fg: var(--kj-fg-default);
|
|
11
|
-
--kj-password-input-border-color: var(--kj-border-default);
|
|
12
|
-
--kj-password-input-border-style: solid;
|
|
13
|
-
--kj-password-input-border-width: var(--kj-border);
|
|
14
|
-
--kj-password-input-radius: var(--kj-radius-field);
|
|
15
|
-
--kj-password-input-padding-x: var(--kj-space-md);
|
|
16
|
-
--kj-password-input-padding-y: var(--kj-space-sm);
|
|
17
|
-
--kj-password-input-font: var(--kj-font-sans);
|
|
18
|
-
--kj-password-input-font-size: var(--kj-text-sm);
|
|
19
|
-
--kj-password-input-placeholder-fg: var(--kj-fg-muted);
|
|
20
|
-
--kj-password-input-toggle-fg: var(--kj-fg-muted);
|
|
21
|
-
--kj-password-input-toggle-fg-hover: var(--kj-fg-default);
|
|
22
|
-
/* Explicit height contract (same pattern as input.css / button.css) so
|
|
23
|
-
password-input lines up with sibling inputs in a form row. */
|
|
24
|
-
--kj-password-input-height: 2.25rem;
|
|
25
|
-
|
|
26
|
-
display: inline-flex;
|
|
27
|
-
align-items: center;
|
|
28
|
-
gap: var(--kj-space-xs);
|
|
29
|
-
inline-size: 100%;
|
|
30
|
-
height: var(--kj-password-input-height);
|
|
31
|
-
background: var(--kj-password-input-bg);
|
|
32
|
-
color: var(--kj-password-input-fg);
|
|
33
|
-
border: var(--kj-password-input-border-width)
|
|
34
|
-
var(--kj-password-input-border-style)
|
|
35
|
-
var(--kj-password-input-border-color);
|
|
36
|
-
border-radius: var(--kj-password-input-radius);
|
|
37
|
-
padding: 0 var(--kj-password-input-padding-x);
|
|
38
|
-
font: var(--kj-password-input-font-size) / 1.4 var(--kj-password-input-font);
|
|
39
|
-
transition: var(--kj-transition);
|
|
40
|
-
}
|
|
41
|
-
.kj-password-input[data-size="sm"] { --kj-password-input-height: 2rem; --kj-password-input-font-size: 0.8125rem; }
|
|
42
|
-
.kj-password-input[data-size="lg"] { --kj-password-input-height: 2.75rem; --kj-password-input-font-size: 1rem; }
|
|
43
|
-
|
|
44
|
-
.kj-password-input__field {
|
|
45
|
-
flex: 1 1 auto;
|
|
46
|
-
inline-size: 100%;
|
|
47
|
-
height: 100%;
|
|
48
|
-
background: transparent;
|
|
49
|
-
color: inherit;
|
|
50
|
-
border: 0;
|
|
51
|
-
outline: 0;
|
|
52
|
-
padding: 0;
|
|
53
|
-
font: inherit;
|
|
54
|
-
}
|
|
55
|
-
.kj-password-input__field::placeholder {
|
|
56
|
-
color: var(--kj-password-input-placeholder-fg);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.kj-password-input:focus-within {
|
|
60
|
-
outline: 2px solid var(--kj-fg-primary);
|
|
61
|
-
outline-offset: 2px;
|
|
62
|
-
--kj-password-input-border-color: var(--kj-fg-primary);
|
|
63
|
-
}
|
|
64
|
-
.kj-password-input:has([aria-invalid="true"]) {
|
|
65
|
-
--kj-password-input-border-color: var(--kj-fg-danger);
|
|
66
|
-
}
|
|
67
|
-
.kj-password-input:has([aria-disabled="true"]),
|
|
68
|
-
.kj-password-input:has(:disabled) {
|
|
69
|
-
opacity: 0.55;
|
|
70
|
-
cursor: not-allowed;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/* eye-icon toggle button: ghost, square, in-row */
|
|
74
|
-
.kj-password-input__toggle {
|
|
75
|
-
display: inline-flex;
|
|
76
|
-
align-items: center;
|
|
77
|
-
justify-content: center;
|
|
78
|
-
inline-size: 1.75rem;
|
|
79
|
-
block-size: 1.75rem;
|
|
80
|
-
margin-inline-start: var(--kj-space-xs);
|
|
81
|
-
color: var(--kj-password-input-toggle-fg);
|
|
82
|
-
background: transparent;
|
|
83
|
-
border: 0;
|
|
84
|
-
border-radius: var(--kj-radius-field);
|
|
85
|
-
cursor: pointer;
|
|
86
|
-
}
|
|
87
|
-
.kj-password-input__toggle:hover,
|
|
88
|
-
.kj-password-input__toggle:focus-visible {
|
|
89
|
-
color: var(--kj-password-input-toggle-fg-hover);
|
|
90
|
-
}
|
|
91
|
-
.kj-password-input__toggle:focus-visible {
|
|
92
|
-
outline: 2px solid var(--kj-fg-primary);
|
|
93
|
-
outline-offset: 2px;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.kj-password-input__icon {
|
|
97
|
-
inline-size: 1rem;
|
|
98
|
-
block-size: 1rem;
|
|
99
|
-
fill: none;
|
|
100
|
-
stroke: currentColor;
|
|
101
|
-
stroke-width: 1.5;
|
|
102
|
-
stroke-linecap: round;
|
|
103
|
-
stroke-linejoin: round;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/* strength meter — 4-segment bar, colour ramp owned here */
|
|
107
|
-
.kj-password-strength {
|
|
108
|
-
display: flex;
|
|
109
|
-
gap: var(--kj-space-xs);
|
|
110
|
-
inline-size: 100%;
|
|
111
|
-
margin-block-start: var(--kj-space-xs);
|
|
112
|
-
}
|
|
113
|
-
.kj-password-strength__seg {
|
|
114
|
-
flex: 1 1 0;
|
|
115
|
-
block-size: 0.25rem;
|
|
116
|
-
background: var(--kj-bg-surface);
|
|
117
|
-
border-radius: 2px;
|
|
118
|
-
transition: background-color var(--kj-transition);
|
|
119
|
-
}
|
|
120
|
-
.kj-password-strength[data-score="1"] .kj-password-strength__seg:nth-child(-n+1),
|
|
121
|
-
.kj-password-strength[data-score="2"] .kj-password-strength__seg:nth-child(-n+2),
|
|
122
|
-
.kj-password-strength[data-score="3"] .kj-password-strength__seg:nth-child(-n+3),
|
|
123
|
-
.kj-password-strength[data-score="4"] .kj-password-strength__seg:nth-child(-n+4) {
|
|
124
|
-
background: var(--kj-password-strength-color, var(--kj-bg-primary));
|
|
125
|
-
}
|
|
126
|
-
.kj-password-strength[data-score="1"] {
|
|
127
|
-
--kj-password-strength-color: var(--kj-bg-danger);
|
|
128
|
-
}
|
|
129
|
-
.kj-password-strength[data-score="2"] {
|
|
130
|
-
--kj-password-strength-color: var(--kj-bg-warning, #d97706);
|
|
131
|
-
}
|
|
132
|
-
.kj-password-strength[data-score="3"] {
|
|
133
|
-
--kj-password-strength-color: var(--kj-bg-success, #059669);
|
|
134
|
-
}
|
|
135
|
-
.kj-password-strength[data-score="4"] {
|
|
136
|
-
--kj-password-strength-color: var(--kj-bg-success, #059669);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.kj-password-strength__label {
|
|
140
|
-
display: block;
|
|
141
|
-
margin-block-start: var(--kj-space-xs);
|
|
142
|
-
font-size: var(--kj-text-xs);
|
|
143
|
-
color: var(--kj-fg-muted);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.kj-password-caps-lock-warning {
|
|
147
|
-
display: block;
|
|
148
|
-
margin-block-start: var(--kj-space-xs);
|
|
149
|
-
font-size: var(--kj-text-xs);
|
|
150
|
-
color: var(--kj-fg-warning, #d97706);
|
|
151
|
-
}
|
|
152
|
-
.kj-password-caps-lock-warning[hidden] {
|
|
153
|
-
display: none;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, signal } from '@angular/core';
|
|
2
|
-
import { KjPasswordInputComponent } from './password-input';
|
|
3
|
-
import type { PlaygroundFile } from '@kouji-ui/components/playground-types';
|
|
4
|
-
|
|
5
|
-
const passwordValue = signal<string>('');
|
|
6
|
-
const placeholder = signal<string>('Enter your password');
|
|
7
|
-
const showToggle = signal(true);
|
|
8
|
-
const showStrength = signal(false);
|
|
9
|
-
const showCapsLockWarning = signal(false);
|
|
10
|
-
const disabled = signal(false);
|
|
11
|
-
const invalid = signal(false);
|
|
12
|
-
|
|
13
|
-
@Component({
|
|
14
|
-
selector: 'kj-password-input-playground',
|
|
15
|
-
standalone: true,
|
|
16
|
-
imports: [KjPasswordInputComponent],
|
|
17
|
-
template: `
|
|
18
|
-
<kj-password-input
|
|
19
|
-
[(kjValue)]="passwordValue"
|
|
20
|
-
[kjPlaceholder]="placeholder()"
|
|
21
|
-
[kjShowToggle]="showToggle()"
|
|
22
|
-
[kjShowStrength]="showStrength()"
|
|
23
|
-
[kjShowCapsLockWarning]="showCapsLockWarning()"
|
|
24
|
-
[kjDisabled]="disabled()"
|
|
25
|
-
[kjInvalid]="invalid()"
|
|
26
|
-
kjAutocomplete="current-password"
|
|
27
|
-
/>
|
|
28
|
-
`,
|
|
29
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
30
|
-
})
|
|
31
|
-
export class KjPasswordInputPlaygroundDemo {
|
|
32
|
-
protected readonly passwordValue = passwordValue;
|
|
33
|
-
protected readonly placeholder = placeholder;
|
|
34
|
-
protected readonly showToggle = showToggle;
|
|
35
|
-
protected readonly showStrength = showStrength;
|
|
36
|
-
protected readonly showCapsLockWarning = showCapsLockWarning;
|
|
37
|
-
protected readonly disabled = disabled;
|
|
38
|
-
protected readonly invalid = invalid;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export const PLAYGROUND: PlaygroundFile = {
|
|
42
|
-
component: KjPasswordInputPlaygroundDemo,
|
|
43
|
-
state: {
|
|
44
|
-
passwordValue: passwordValue as unknown as ReturnType<typeof signal>,
|
|
45
|
-
placeholder: placeholder as unknown as ReturnType<typeof signal>,
|
|
46
|
-
showToggle: showToggle as unknown as ReturnType<typeof signal>,
|
|
47
|
-
showStrength: showStrength as unknown as ReturnType<typeof signal>,
|
|
48
|
-
showCapsLockWarning: showCapsLockWarning as unknown as ReturnType<typeof signal>,
|
|
49
|
-
disabled: disabled as unknown as ReturnType<typeof signal>,
|
|
50
|
-
invalid: invalid as unknown as ReturnType<typeof signal>,
|
|
51
|
-
},
|
|
52
|
-
controls: [
|
|
53
|
-
{ kind: 'text', name: 'placeholder', label: 'placeholder' },
|
|
54
|
-
{ kind: 'toggle', name: 'showToggle', label: 'show toggle' },
|
|
55
|
-
{ kind: 'toggle', name: 'showStrength', label: 'show strength meter' },
|
|
56
|
-
{ kind: 'toggle', name: 'showCapsLockWarning', label: 'caps-lock warning' },
|
|
57
|
-
{ kind: 'toggle', name: 'disabled', label: 'disabled' },
|
|
58
|
-
{ kind: 'toggle', name: 'invalid', label: 'invalid' },
|
|
59
|
-
],
|
|
60
|
-
snippet: (values) => {
|
|
61
|
-
const s = values as {
|
|
62
|
-
placeholder: string;
|
|
63
|
-
showToggle: boolean;
|
|
64
|
-
showStrength: boolean;
|
|
65
|
-
showCapsLockWarning: boolean;
|
|
66
|
-
disabled: boolean;
|
|
67
|
-
invalid: boolean;
|
|
68
|
-
};
|
|
69
|
-
const attrs: string[] = [
|
|
70
|
-
`[(kjValue)]="password"`,
|
|
71
|
-
`kjPlaceholder="${s.placeholder}"`,
|
|
72
|
-
];
|
|
73
|
-
if (!s.showToggle) attrs.push('[kjShowToggle]="false"');
|
|
74
|
-
if (s.showStrength) attrs.push('[kjShowStrength]="true"');
|
|
75
|
-
if (s.showCapsLockWarning) attrs.push('[kjShowCapsLockWarning]="true"');
|
|
76
|
-
if (s.disabled) attrs.push('[kjDisabled]="true"');
|
|
77
|
-
if (s.invalid) attrs.push('[kjInvalid]="true"');
|
|
78
|
-
attrs.push('kjAutocomplete="current-password"');
|
|
79
|
-
return `<kj-password-input\n ${attrs.join('\n ')}\n/>`;
|
|
80
|
-
},
|
|
81
|
-
};
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
-
import { TestBed } from '@angular/core/testing';
|
|
3
|
-
import { beforeEach, describe, expect, test } from 'vitest';
|
|
4
|
-
import { KjPasswordInputComponent } from './password-input';
|
|
5
|
-
|
|
6
|
-
@Component({
|
|
7
|
-
standalone: true,
|
|
8
|
-
imports: [KjPasswordInputComponent],
|
|
9
|
-
changeDetection: ChangeDetectionStrategy.Eager,
|
|
10
|
-
template: `
|
|
11
|
-
<kj-password-input
|
|
12
|
-
[kjAutocomplete]="autocomplete"
|
|
13
|
-
[kjMaxLength]="maxLength"
|
|
14
|
-
[kjDisabled]="disabled"
|
|
15
|
-
[kjInvalid]="invalid"
|
|
16
|
-
[kjPlaceholder]="placeholder"
|
|
17
|
-
[kjShowToggle]="showToggle"
|
|
18
|
-
[kjShowStrength]="showStrength"
|
|
19
|
-
[kjShowCapsLockWarning]="showCapsLock"
|
|
20
|
-
/>
|
|
21
|
-
`,
|
|
22
|
-
})
|
|
23
|
-
class HostComponent {
|
|
24
|
-
autocomplete: 'current-password' | 'new-password' | 'off' = 'current-password';
|
|
25
|
-
maxLength: number | undefined = undefined;
|
|
26
|
-
disabled = false;
|
|
27
|
-
invalid = false;
|
|
28
|
-
placeholder = '';
|
|
29
|
-
showToggle = true;
|
|
30
|
-
showStrength = false;
|
|
31
|
-
showCapsLock = false;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
describe('KjPasswordInputComponent', () => {
|
|
35
|
-
beforeEach(() => {
|
|
36
|
-
TestBed.configureTestingModule({ imports: [HostComponent] });
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
test('renders an inner <input> with type="password"', () => {
|
|
40
|
-
const fixture = TestBed.createComponent(HostComponent);
|
|
41
|
-
fixture.detectChanges();
|
|
42
|
-
const input = fixture.nativeElement.querySelector('kj-password-input input');
|
|
43
|
-
expect(input).not.toBeNull();
|
|
44
|
-
expect(input.getAttribute('type')).toBe('password');
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
test('forwards kjAutocomplete to the inner input', () => {
|
|
48
|
-
const fixture = TestBed.createComponent(HostComponent);
|
|
49
|
-
fixture.componentInstance.autocomplete = 'new-password';
|
|
50
|
-
fixture.detectChanges();
|
|
51
|
-
expect(
|
|
52
|
-
fixture.nativeElement.querySelector('kj-password-input input').getAttribute('autocomplete'),
|
|
53
|
-
).toBe('new-password');
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
test('forwards kjMaxLength to native maxlength', () => {
|
|
57
|
-
const fixture = TestBed.createComponent(HostComponent);
|
|
58
|
-
fixture.componentInstance.maxLength = 24;
|
|
59
|
-
fixture.detectChanges();
|
|
60
|
-
expect(
|
|
61
|
-
fixture.nativeElement.querySelector('kj-password-input input').getAttribute('maxlength'),
|
|
62
|
-
).toBe('24');
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
test('forwards kjPlaceholder to native placeholder', () => {
|
|
66
|
-
const fixture = TestBed.createComponent(HostComponent);
|
|
67
|
-
fixture.componentInstance.placeholder = 'Enter password';
|
|
68
|
-
fixture.detectChanges();
|
|
69
|
-
expect(
|
|
70
|
-
fixture.nativeElement.querySelector('kj-password-input input').getAttribute('placeholder'),
|
|
71
|
-
).toBe('Enter password');
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
test('renders the show/hide toggle by default', () => {
|
|
75
|
-
const fixture = TestBed.createComponent(HostComponent);
|
|
76
|
-
fixture.detectChanges();
|
|
77
|
-
const button = fixture.nativeElement.querySelector('kj-password-input button');
|
|
78
|
-
expect(button).not.toBeNull();
|
|
79
|
-
expect(button.getAttribute('aria-label')).toBe('Show password');
|
|
80
|
-
expect(button.getAttribute('aria-controls')).toBeTruthy();
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
test('hides the toggle when kjShowToggle is false', () => {
|
|
84
|
-
const fixture = TestBed.createComponent(HostComponent);
|
|
85
|
-
fixture.componentInstance.showToggle = false;
|
|
86
|
-
fixture.detectChanges();
|
|
87
|
-
expect(fixture.nativeElement.querySelector('kj-password-input button')).toBeNull();
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
test('clicking the toggle flips the input type', async () => {
|
|
91
|
-
const fixture = TestBed.createComponent(HostComponent);
|
|
92
|
-
fixture.detectChanges();
|
|
93
|
-
const input = fixture.nativeElement.querySelector('kj-password-input input');
|
|
94
|
-
const button = fixture.nativeElement.querySelector('kj-password-input button');
|
|
95
|
-
expect(input.getAttribute('type')).toBe('password');
|
|
96
|
-
button.click();
|
|
97
|
-
fixture.detectChanges();
|
|
98
|
-
await new Promise((r) => setTimeout(r, 0));
|
|
99
|
-
fixture.detectChanges();
|
|
100
|
-
expect(input.getAttribute('type')).toBe('text');
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
test('renders the strength meter when kjShowStrength is true', () => {
|
|
104
|
-
const fixture = TestBed.createComponent(HostComponent);
|
|
105
|
-
fixture.componentInstance.showStrength = true;
|
|
106
|
-
fixture.detectChanges();
|
|
107
|
-
const meter = fixture.nativeElement.querySelector('[kjPasswordStrength]');
|
|
108
|
-
expect(meter).not.toBeNull();
|
|
109
|
-
expect(meter.getAttribute('role')).toBe('progressbar');
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
test('renders the caps lock warning when kjShowCapsLockWarning is true', () => {
|
|
113
|
-
const fixture = TestBed.createComponent(HostComponent);
|
|
114
|
-
fixture.componentInstance.showCapsLock = true;
|
|
115
|
-
fixture.detectChanges();
|
|
116
|
-
const warn = fixture.nativeElement.querySelector('[kjPasswordCapsLockWarning]');
|
|
117
|
-
expect(warn).not.toBeNull();
|
|
118
|
-
expect(warn.getAttribute('role')).toBe('status');
|
|
119
|
-
expect(warn.hasAttribute('hidden')).toBe(true);
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
test('forwards kjDisabled to aria-disabled on the input', () => {
|
|
123
|
-
const fixture = TestBed.createComponent(HostComponent);
|
|
124
|
-
fixture.componentInstance.disabled = true;
|
|
125
|
-
fixture.detectChanges();
|
|
126
|
-
const input = fixture.nativeElement.querySelector('kj-password-input input');
|
|
127
|
-
expect(input.getAttribute('aria-disabled')).toBe('true');
|
|
128
|
-
});
|
|
129
|
-
});
|
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ChangeDetectionStrategy,
|
|
3
|
-
Component,
|
|
4
|
-
type OnInit,
|
|
5
|
-
ViewEncapsulation,
|
|
6
|
-
booleanAttribute,
|
|
7
|
-
computed,
|
|
8
|
-
inject,
|
|
9
|
-
input,
|
|
10
|
-
model,
|
|
11
|
-
} from '@angular/core';
|
|
12
|
-
import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
13
|
-
import {
|
|
14
|
-
KJ_PASSWORD_INPUT,
|
|
15
|
-
KjButton,
|
|
16
|
-
KjPasswordCapsLockWarning,
|
|
17
|
-
KjPasswordInput,
|
|
18
|
-
KjPasswordInputScope,
|
|
19
|
-
KjPasswordStrength,
|
|
20
|
-
KjPasswordToggle,
|
|
21
|
-
type KjPasswordAutocomplete,
|
|
22
|
-
type KjPasswordScore,
|
|
23
|
-
} from '@kouji-ui/core';
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Styled wrapper around the headless `KjPasswordInput` directive family. Owns
|
|
27
|
-
* the visual shape of the input + toggle button, and renders the optional
|
|
28
|
-
* strength meter and Caps Lock warning when their feature flags are on.
|
|
29
|
-
*
|
|
30
|
-
* The component composes four directives behind a single API:
|
|
31
|
-
* - `KjPasswordInputScope` on the wrapper (provides the shared context).
|
|
32
|
-
* - `KjPasswordInput` on the inner `<input>`.
|
|
33
|
-
* - `KjPasswordToggle` on a composed `[kjButton]` next to the input.
|
|
34
|
-
* - `KjPasswordStrength` and `KjPasswordCapsLockWarning` rendered conditionally.
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```html
|
|
38
|
-
* <kj-password-input
|
|
39
|
-
* [(kjValue)]="password"
|
|
40
|
-
* kjAutocomplete="new-password"
|
|
41
|
-
* [kjShowStrength]="true"
|
|
42
|
-
* [kjShowCapsLockWarning]="true" />
|
|
43
|
-
* ```
|
|
44
|
-
*
|
|
45
|
-
* @doc-example Default
|
|
46
|
-
* The bare-minimum recipe — a sign-in password input with the toggle button.
|
|
47
|
-
* @doc-file password-input.example.ts
|
|
48
|
-
* @doc-example Usage
|
|
49
|
-
* A walkthrough of the most common usages — sign-in, sign-up with strength
|
|
50
|
-
* meter, and a disabled state. Use this as the copy-paste starting point.
|
|
51
|
-
* @doc-file password-input.usage.example.ts
|
|
52
|
-
* @doc-example Show / hide toggle
|
|
53
|
-
* Two-way bind `[(kjRevealed)]` to drive the inner icon from outside.
|
|
54
|
-
* @doc-file password-input.toggle.example.ts
|
|
55
|
-
* @doc-example Strength meter
|
|
56
|
-
* `[kjShowStrength]="true"` renders the four-segment estimator under the row.
|
|
57
|
-
* @doc-file password-input.strength.example.ts
|
|
58
|
-
* @doc-example With validation rules
|
|
59
|
-
* Live rule list bound to the value; pairs well with reactive forms.
|
|
60
|
-
* @doc-file password-input.with-rules.example.ts
|
|
61
|
-
*
|
|
62
|
-
* @doc-keyboard
|
|
63
|
-
* Tab — Moves focus into the input, then onto the toggle button
|
|
64
|
-
* Enter — Submits the parent <form> when present (native input behavior)
|
|
65
|
-
* Space (on toggle) — Flips the reveal state
|
|
66
|
-
*
|
|
67
|
-
* @doc-aria
|
|
68
|
-
* type="password"|"text" — Native attribute toggles when `kjRevealed` flips
|
|
69
|
-
* aria-pressed — Reflected on the toggle button (mirrors `kjRevealed`)
|
|
70
|
-
* aria-label — Wired from `kjShowLabel` / `kjHideLabel` per state
|
|
71
|
-
* aria-invalid — Reflected on the input when `kjInvalid` is true
|
|
72
|
-
* aria-disabled — Reflected on input and toggle when `kjDisabled` is true
|
|
73
|
-
* role="status" — Used by the optional Caps Lock warning paragraph
|
|
74
|
-
*
|
|
75
|
-
* @doc-touch
|
|
76
|
-
* The toggle button uses `kjSize="icon"` (44×44) so it meets WCAG 2.5.5.
|
|
77
|
-
* The input row matches `kj-input` height for form-row alignment.
|
|
78
|
-
*
|
|
79
|
-
* @doc-a11y
|
|
80
|
-
* The toggle button never reads the password aloud — it only flips the
|
|
81
|
-
* native input type. The Caps Lock warning is a live region so AT
|
|
82
|
-
* announces the state change without stealing focus. Strength feedback is
|
|
83
|
-
* rendered as decorative segments — pair with a textual cue if the score
|
|
84
|
-
* is the only signal carrying meaning.
|
|
85
|
-
*
|
|
86
|
-
* @doc-related input,field,form
|
|
87
|
-
*
|
|
88
|
-
* @doc-css-var
|
|
89
|
-
* --kj-password-input-bg — Background fill. Inherits --kj-bg-field.
|
|
90
|
-
* --kj-password-input-fg — Foreground (text) color.
|
|
91
|
-
* --kj-password-input-border-color — Border color. Flips to danger when invalid.
|
|
92
|
-
* --kj-password-input-border-style — Border style. Defaults to solid.
|
|
93
|
-
* --kj-password-input-border-width — Border thickness. Inherits --kj-border.
|
|
94
|
-
* --kj-password-input-radius — Corner radius. Inherits --kj-radius-field.
|
|
95
|
-
* --kj-password-input-padding-x — Horizontal padding inside the field row.
|
|
96
|
-
* --kj-password-input-padding-y — Vertical padding inside the field row.
|
|
97
|
-
* --kj-password-input-font — Font family. Defaults to --kj-font-sans.
|
|
98
|
-
* --kj-password-input-font-size — Font size. Size attributes override.
|
|
99
|
-
* --kj-password-input-placeholder-fg — Placeholder text color.
|
|
100
|
-
* --kj-password-input-toggle-fg — Show/hide toggle icon color.
|
|
101
|
-
* --kj-password-input-toggle-fg-hover — Show/hide toggle icon color on hover or focus.
|
|
102
|
-
* --kj-password-input-height — Row height. Matches input/select for form alignment.
|
|
103
|
-
*
|
|
104
|
-
* @doc-category Library/Data input
|
|
105
|
-
* @doc
|
|
106
|
-
* @doc-name password-input
|
|
107
|
-
* @doc-description Themed password input with show/hide toggle, optional strength meter, and Caps Lock warning.
|
|
108
|
-
* @doc-is-main
|
|
109
|
-
*/
|
|
110
|
-
@Component({
|
|
111
|
-
selector: 'kj-password-input',
|
|
112
|
-
standalone: true,
|
|
113
|
-
imports: [
|
|
114
|
-
FormsModule,
|
|
115
|
-
ReactiveFormsModule,
|
|
116
|
-
KjButton,
|
|
117
|
-
KjPasswordInput,
|
|
118
|
-
KjPasswordInputScope,
|
|
119
|
-
KjPasswordToggle,
|
|
120
|
-
KjPasswordStrength,
|
|
121
|
-
KjPasswordCapsLockWarning,
|
|
122
|
-
],
|
|
123
|
-
template: `
|
|
124
|
-
<div kjPasswordInputScope class="kj-password-input">
|
|
125
|
-
<input
|
|
126
|
-
kjPasswordInput
|
|
127
|
-
class="kj-password-input__field"
|
|
128
|
-
[kjAutocomplete]="kjAutocomplete()"
|
|
129
|
-
[kjMaxLength]="kjMaxLength()"
|
|
130
|
-
[kjDisabled]="kjDisabled()"
|
|
131
|
-
[kjInvalid]="kjInvalid()"
|
|
132
|
-
[(kjRevealed)]="kjRevealed"
|
|
133
|
-
[placeholder]="kjPlaceholder()"
|
|
134
|
-
[formControl]="control"
|
|
135
|
-
/>
|
|
136
|
-
@if (kjShowToggle()) {
|
|
137
|
-
<button
|
|
138
|
-
kjButton
|
|
139
|
-
kjPasswordToggle
|
|
140
|
-
class="kj-password-input__toggle"
|
|
141
|
-
[kjVariant]="'ghost'"
|
|
142
|
-
[kjSize]="'icon'"
|
|
143
|
-
[kjShowLabel]="kjShowLabel()"
|
|
144
|
-
[kjHideLabel]="kjHideLabel()"
|
|
145
|
-
>
|
|
146
|
-
@if (kjRevealed()) {
|
|
147
|
-
<svg class="kj-password-input__icon" viewBox="0 0 24 24" aria-hidden="true">
|
|
148
|
-
<path d="M3 3l18 18M10.7 10.7a3 3 0 0 0 4.2 4.2M9.3 5.5A10.5 10.5 0 0 1 12 5c5 0 9.3 3.4 10.5 7-.3 1-.9 2-1.7 2.9M6.6 6.6C4.4 8 2.9 9.9 2 11.5 3.2 15.1 7.5 18.5 12 18.5c1.5 0 2.9-.4 4.2-1" />
|
|
149
|
-
</svg>
|
|
150
|
-
} @else {
|
|
151
|
-
<svg class="kj-password-input__icon" viewBox="0 0 24 24" aria-hidden="true">
|
|
152
|
-
<path d="M2 12c2-4 5.5-7 10-7s8 3 10 7c-2 4-5.5 7-10 7s-8-3-10-7z" />
|
|
153
|
-
<circle cx="12" cy="12" r="3" />
|
|
154
|
-
</svg>
|
|
155
|
-
}
|
|
156
|
-
</button>
|
|
157
|
-
}
|
|
158
|
-
@if (kjShowStrength()) {
|
|
159
|
-
<div class="kj-password-strength" kjPasswordStrength [attr.data-score]="score()">
|
|
160
|
-
<span class="kj-password-strength__seg"></span>
|
|
161
|
-
<span class="kj-password-strength__seg"></span>
|
|
162
|
-
<span class="kj-password-strength__seg"></span>
|
|
163
|
-
<span class="kj-password-strength__seg"></span>
|
|
164
|
-
</div>
|
|
165
|
-
}
|
|
166
|
-
@if (kjShowCapsLockWarning()) {
|
|
167
|
-
<p kjPasswordCapsLockWarning class="kj-password-caps-lock-warning">
|
|
168
|
-
{{ kjCapsLockMessage() }}
|
|
169
|
-
</p>
|
|
170
|
-
}
|
|
171
|
-
</div>
|
|
172
|
-
`,
|
|
173
|
-
styleUrl: './password-input.css',
|
|
174
|
-
encapsulation: ViewEncapsulation.None,
|
|
175
|
-
host: { 'style': 'display: contents;' },
|
|
176
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
177
|
-
})
|
|
178
|
-
export class KjPasswordInputComponent implements OnInit {
|
|
179
|
-
/**
|
|
180
|
-
* Native `autocomplete` attribute. Restricted to `'current-password'` |
|
|
181
|
-
* `'new-password'` | `'off'`.
|
|
182
|
-
* @default 'current-password'
|
|
183
|
-
*/
|
|
184
|
-
readonly kjAutocomplete = input<KjPasswordAutocomplete>('current-password');
|
|
185
|
-
|
|
186
|
-
/** Native `maxlength` attribute. */
|
|
187
|
-
readonly kjMaxLength = input<number>(Number.POSITIVE_INFINITY);
|
|
188
|
-
|
|
189
|
-
/** Disabled state. Reflects to the host `KjPasswordInput`. */
|
|
190
|
-
readonly kjDisabled = input(false, { transform: booleanAttribute });
|
|
191
|
-
|
|
192
|
-
/** Invalid state — wires to ARIA-invalid via the host `KjInput`. */
|
|
193
|
-
readonly kjInvalid = input(false, { transform: booleanAttribute });
|
|
194
|
-
|
|
195
|
-
/** Two-way bindable plain-text reveal state. @default false */
|
|
196
|
-
readonly kjRevealed = model<boolean>(false);
|
|
197
|
-
|
|
198
|
-
/** Placeholder text on the inner `<input>`. */
|
|
199
|
-
readonly kjPlaceholder = input<string>('');
|
|
200
|
-
|
|
201
|
-
/** Two-way bindable value (proxy CVA for non-form usage). */
|
|
202
|
-
readonly kjValue = model<string>('');
|
|
203
|
-
|
|
204
|
-
/** Show the show/hide toggle button. @default true */
|
|
205
|
-
readonly kjShowToggle = input(true, { transform: booleanAttribute });
|
|
206
|
-
|
|
207
|
-
/** Show the strength meter under the input. @default false */
|
|
208
|
-
readonly kjShowStrength = input(false, { transform: booleanAttribute });
|
|
209
|
-
|
|
210
|
-
/** Show the Caps Lock warning element. @default false */
|
|
211
|
-
readonly kjShowCapsLockWarning = input(false, { transform: booleanAttribute });
|
|
212
|
-
|
|
213
|
-
/** `aria-label` for the toggle when password is hidden. @default 'Show password' */
|
|
214
|
-
readonly kjShowLabel = input<string>('Show password');
|
|
215
|
-
|
|
216
|
-
/** `aria-label` for the toggle when password is revealed. @default 'Hide password' */
|
|
217
|
-
readonly kjHideLabel = input<string>('Hide password');
|
|
218
|
-
|
|
219
|
-
/** Caps Lock warning message (overridable for i18n). */
|
|
220
|
-
readonly kjCapsLockMessage = input<string>('Caps Lock is on.');
|
|
221
|
-
|
|
222
|
-
/** @internal — bridges template-bound `[(kjValue)]` to the inner `KjPasswordInput`. */
|
|
223
|
-
protected readonly control = new FormControl<string>('', { nonNullable: true });
|
|
224
|
-
|
|
225
|
-
/** @internal — exposes the score for the strength meter's data attr. */
|
|
226
|
-
protected readonly score = computed<KjPasswordScore>(() => {
|
|
227
|
-
// The directive provides the full `KJ_PASSWORD_INPUT` context; we re-read
|
|
228
|
-
// the score for the data-attribute styling hook on our wrapper element.
|
|
229
|
-
// The host-bound `data-score` from `KjPasswordStrength` already exists,
|
|
230
|
-
// but mirroring it here lets CSS target the wrapper without `:has()`.
|
|
231
|
-
const ctx = this._ctx;
|
|
232
|
-
return ctx?.score() ?? 0;
|
|
233
|
-
});
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* @internal — context resolved from the same scope. Optional because the
|
|
237
|
-
* component itself owns the `[kjPasswordInputScope]` element, so injection
|
|
238
|
-
* resolves up via the providers chain after init. If unavailable, the
|
|
239
|
-
* meter still renders with score 0.
|
|
240
|
-
*/
|
|
241
|
-
private readonly _ctx = inject(KJ_PASSWORD_INPUT, { optional: true });
|
|
242
|
-
|
|
243
|
-
constructor() {
|
|
244
|
-
// Two-way bind value <-> control.
|
|
245
|
-
this.control.valueChanges.subscribe(v => this.kjValue.set(v ?? ''));
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
ngOnInit(): void {
|
|
249
|
-
if (this.kjValue() !== this.control.value) {
|
|
250
|
-
this.control.setValue(this.kjValue(), { emitEvent: false });
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
-
import { KjPasswordInputComponent } from './password-input';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* A walkthrough of the most common password-input usages — a sign-in field,
|
|
6
|
-
* a sign-up field with the strength meter and Caps Lock warning, and a
|
|
7
|
-
* disabled state. Use this as the copy-paste starting point for auth forms.
|
|
8
|
-
*/
|
|
9
|
-
@Component({
|
|
10
|
-
selector: 'kj-password-input-usage-example',
|
|
11
|
-
standalone: true,
|
|
12
|
-
imports: [KjPasswordInputComponent],
|
|
13
|
-
styles: [
|
|
14
|
-
`
|
|
15
|
-
:host {
|
|
16
|
-
display: flex;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
gap: var(--kj-space-lg);
|
|
19
|
-
max-width: 22rem;
|
|
20
|
-
}
|
|
21
|
-
label {
|
|
22
|
-
display: grid;
|
|
23
|
-
gap: var(--kj-space-xs);
|
|
24
|
-
font-size: 0.875rem;
|
|
25
|
-
color: var(--kj-fg-default);
|
|
26
|
-
}
|
|
27
|
-
`,
|
|
28
|
-
],
|
|
29
|
-
changeDetection: ChangeDetectionStrategy.Eager,
|
|
30
|
-
template: `
|
|
31
|
-
<!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -->
|
|
32
|
-
<label>
|
|
33
|
-
Current password
|
|
34
|
-
<kj-password-input kjAutocomplete="current-password" kjPlaceholder="Enter your password" />
|
|
35
|
-
</label>
|
|
36
|
-
|
|
37
|
-
<!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -->
|
|
38
|
-
<label>
|
|
39
|
-
New password
|
|
40
|
-
<kj-password-input
|
|
41
|
-
kjAutocomplete="new-password"
|
|
42
|
-
kjPlaceholder="Choose a strong one"
|
|
43
|
-
[kjShowStrength]="true"
|
|
44
|
-
[kjShowCapsLockWarning]="true"
|
|
45
|
-
/>
|
|
46
|
-
</label>
|
|
47
|
-
|
|
48
|
-
<!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -->
|
|
49
|
-
<label>
|
|
50
|
-
Read-only (disabled)
|
|
51
|
-
<kj-password-input [kjDisabled]="true" kjPlaceholder="Locked" />
|
|
52
|
-
</label>
|
|
53
|
-
`,
|
|
54
|
-
})
|
|
55
|
-
export class KjPasswordInputUsageExample {}
|