@kouji-ui/components 0.1.1
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/.turbo/turbo-build.log +29 -0
- package/CHANGELOG.md +192 -0
- package/ng-package.json +7 -0
- package/package.json +43 -0
- package/src/accordion/_examples/accordion.default.example.ts +31 -0
- package/src/accordion/_examples/accordion.disabled.example.ts +38 -0
- package/src/accordion/_examples/accordion.multiple.example.ts +31 -0
- package/src/accordion/_examples/accordion.rich-content.example.ts +49 -0
- package/src/accordion/_examples/index.ts +6 -0
- package/src/accordion/accordion.arrow-nav.example.ts +39 -0
- package/src/accordion/accordion.css +68 -0
- package/src/accordion/accordion.playground.ts +119 -0
- package/src/accordion/accordion.spec.ts +117 -0
- package/src/accordion/accordion.ts +153 -0
- package/src/accordion/accordion.usage.example.ts +38 -0
- package/src/accordion/accordion.value.example.ts +60 -0
- package/src/accordion/index.ts +1 -0
- package/src/alert/_examples/alert.banner.example.ts +56 -0
- package/src/alert/_examples/alert.dismissible.example.ts +53 -0
- package/src/alert/_examples/alert.example.ts +40 -0
- package/src/alert/_examples/alert.variants.example.ts +66 -0
- package/src/alert/_examples/alert.with-actions.example.ts +57 -0
- package/src/alert/_examples/index.ts +7 -0
- package/src/alert/alert.css +133 -0
- package/src/alert/alert.playground.ts +111 -0
- package/src/alert/alert.spec.ts +167 -0
- package/src/alert/alert.ts +250 -0
- package/src/alert/alert.usage.example.ts +58 -0
- package/src/alert/index.ts +8 -0
- package/src/avatar/_examples/avatar-group.example.ts +31 -0
- package/src/avatar/_examples/avatar-group.list.example.ts +45 -0
- package/src/avatar/_examples/avatar-group.overflow.example.ts +33 -0
- package/src/avatar/_examples/avatar-group.shapes.example.ts +39 -0
- package/src/avatar/_examples/avatar-group.sizes.example.ts +44 -0
- package/src/avatar/_examples/avatar.default.example.ts +18 -0
- package/src/avatar/_examples/avatar.initials.example.ts +20 -0
- package/src/avatar/_examples/avatar.shapes.example.ts +22 -0
- package/src/avatar/_examples/avatar.sizes.example.ts +26 -0
- package/src/avatar/_examples/avatar.with-image.example.ts +20 -0
- package/src/avatar/_examples/index.ts +12 -0
- package/src/avatar/avatar-group.spec.ts +138 -0
- package/src/avatar/avatar-group.ts +127 -0
- package/src/avatar/avatar-group.usage.example.ts +30 -0
- package/src/avatar/avatar.css +58 -0
- package/src/avatar/avatar.playground.ts +95 -0
- package/src/avatar/avatar.ts +123 -0
- package/src/avatar/index.ts +2 -0
- package/src/badge/_examples/badge.default.example.ts +18 -0
- package/src/badge/_examples/badge.sizes.example.ts +25 -0
- package/src/badge/_examples/badge.variants.example.ts +24 -0
- package/src/badge/_examples/badge.with-dot.example.ts +31 -0
- package/src/badge/_examples/badge.with-icon.example.ts +23 -0
- package/src/badge/_examples/index.ts +7 -0
- package/src/badge/badge.css +59 -0
- package/src/badge/badge.playground.ts +49 -0
- package/src/badge/badge.ts +86 -0
- package/src/badge/badge.usage.example.ts +22 -0
- package/src/badge/index.ts +1 -0
- package/src/breadcrumb/_examples/breadcrumb.custom-separator.example.ts +53 -0
- package/src/breadcrumb/_examples/breadcrumb.example.ts +48 -0
- package/src/breadcrumb/_examples/breadcrumb.long-path.example.ts +58 -0
- package/src/breadcrumb/_examples/breadcrumb.truncated.example.ts +59 -0
- package/src/breadcrumb/_examples/breadcrumb.with-icons.example.ts +66 -0
- package/src/breadcrumb/_examples/index.ts +7 -0
- package/src/breadcrumb/breadcrumb.css +121 -0
- package/src/breadcrumb/breadcrumb.playground.ts +93 -0
- package/src/breadcrumb/breadcrumb.spec.ts +230 -0
- package/src/breadcrumb/breadcrumb.ts +272 -0
- package/src/breadcrumb/breadcrumb.usage.example.ts +45 -0
- package/src/breadcrumb/index.ts +1 -0
- package/src/button/_examples/button.anchor.example.ts +18 -0
- package/src/button/_examples/button.configured.example.ts +43 -0
- package/src/button/_examples/button.disabled.example.ts +25 -0
- package/src/button/_examples/button.example.ts +22 -0
- package/src/button/_examples/button.icon.example.ts +27 -0
- package/src/button/_examples/button.loading.example.ts +31 -0
- package/src/button/_examples/button.pressed.example.ts +24 -0
- package/src/button/_examples/button.sizes.example.ts +26 -0
- package/src/button/_examples/button.usage.example.ts +66 -0
- package/src/button/_examples/button.variants.example.ts +26 -0
- package/src/button/_examples/index.ts +12 -0
- package/src/button/button.css +263 -0
- package/src/button/button.playground.ts +79 -0
- package/src/button/button.spec.ts +100 -0
- package/src/button/button.ts +150 -0
- package/src/button/index.ts +1 -0
- package/src/button-group/_examples/button-group.example.ts +30 -0
- package/src/button-group/_examples/button-group.icon-only.example.ts +30 -0
- package/src/button-group/_examples/button-group.toggle.example.ts +36 -0
- package/src/button-group/_examples/button-group.variants.example.ts +40 -0
- package/src/button-group/_examples/button-group.vertical.example.ts +29 -0
- package/src/button-group/_examples/index.ts +7 -0
- package/src/button-group/button-group.css +80 -0
- package/src/button-group/button-group.playground.ts +94 -0
- package/src/button-group/button-group.spec.ts +119 -0
- package/src/button-group/button-group.ts +130 -0
- package/src/button-group/button-group.usage.example.ts +35 -0
- package/src/button-group/index.ts +1 -0
- package/src/calendar/_examples/calendar.example.ts +33 -0
- package/src/calendar/_examples/index.ts +3 -0
- package/src/calendar/calendar.css +129 -0
- package/src/calendar/calendar.playground.ts +84 -0
- package/src/calendar/calendar.spec.ts +50 -0
- package/src/calendar/calendar.ts +171 -0
- package/src/calendar/calendar.usage.example.ts +33 -0
- package/src/calendar/index.ts +1 -0
- package/src/card/_examples/card.cover.example.ts +53 -0
- package/src/card/_examples/card.example.ts +27 -0
- package/src/card/_examples/card.full.example.ts +51 -0
- package/src/card/_examples/index.ts +5 -0
- package/src/card/card.css +120 -0
- package/src/card/card.playground.ts +116 -0
- package/src/card/card.spec.ts +50 -0
- package/src/card/card.ts +194 -0
- package/src/card/card.usage.example.ts +46 -0
- package/src/card/index.ts +1 -0
- package/src/carousel/_examples/carousel.autoplay.example.ts +69 -0
- package/src/carousel/_examples/carousel.example.ts +60 -0
- package/src/carousel/_examples/carousel.indicators.example.ts +64 -0
- package/src/carousel/_examples/carousel.lazy-load.example.ts +85 -0
- package/src/carousel/_examples/carousel.tabs-pattern.example.ts +61 -0
- package/src/carousel/_examples/index.ts +7 -0
- package/src/carousel/carousel.css +181 -0
- package/src/carousel/carousel.playground.ts +135 -0
- package/src/carousel/carousel.spec.ts +211 -0
- package/src/carousel/carousel.ts +399 -0
- package/src/carousel/carousel.usage.example.ts +46 -0
- package/src/carousel/index.ts +1 -0
- package/src/cascade-select/_examples/cascade-select.data-driven.example.ts +119 -0
- package/src/cascade-select/_examples/cascade-select.disabled.example.ts +74 -0
- package/src/cascade-select/_examples/cascade-select.example.ts +80 -0
- package/src/cascade-select/_examples/cascade-select.field.example.ts +73 -0
- package/src/cascade-select/_examples/cascade-select.path.example.ts +85 -0
- package/src/cascade-select/_examples/index.ts +7 -0
- package/src/cascade-select/cascade-select.css +120 -0
- package/src/cascade-select/cascade-select.playground.ts +133 -0
- package/src/cascade-select/cascade-select.ts +201 -0
- package/src/cascade-select/cascade-select.usage.example.ts +44 -0
- package/src/cascade-select/index.ts +5 -0
- package/src/chat/_examples/chat-bubble.example.ts +71 -0
- package/src/chat/_examples/chat-bubble.grouped.example.ts +69 -0
- package/src/chat/_examples/chat-bubble.sides.example.ts +41 -0
- package/src/chat/_examples/chat-bubble.variants.example.ts +58 -0
- package/src/chat/_examples/chat-bubble.with-state.example.ts +57 -0
- package/src/chat/_examples/index.ts +7 -0
- package/src/chat/chat.css +231 -0
- package/src/chat/chat.playground.ts +171 -0
- package/src/chat/chat.spec.ts +343 -0
- package/src/chat/chat.ts +269 -0
- package/src/chat/chat.usage.example.ts +49 -0
- package/src/chat/index.ts +13 -0
- package/src/checkbox/_examples/checkbox.checked.example.ts +20 -0
- package/src/checkbox/_examples/checkbox.default.example.ts +20 -0
- package/src/checkbox/_examples/checkbox.disabled.example.ts +26 -0
- package/src/checkbox/_examples/checkbox.indeterminate.example.ts +20 -0
- package/src/checkbox/_examples/checkbox.usage.example.ts +62 -0
- package/src/checkbox/_examples/index.ts +7 -0
- package/src/checkbox/checkbox.css +74 -0
- package/src/checkbox/checkbox.playground.ts +68 -0
- package/src/checkbox/checkbox.ts +122 -0
- package/src/checkbox/index.ts +1 -0
- package/src/color-picker/_examples/color-picker.alpha.example.ts +36 -0
- package/src/color-picker/_examples/color-picker.example.ts +34 -0
- package/src/color-picker/_examples/color-picker.hex-input.example.ts +53 -0
- package/src/color-picker/_examples/color-picker.in-form.example.ts +60 -0
- package/src/color-picker/_examples/color-picker.usage.example.ts +58 -0
- package/src/color-picker/_examples/color-picker.with-presets.example.ts +45 -0
- package/src/color-picker/_examples/index.ts +8 -0
- package/src/color-picker/color-picker.css +183 -0
- package/src/color-picker/color-picker.playground.ts +83 -0
- package/src/color-picker/color-picker.spec.ts +94 -0
- package/src/color-picker/color-picker.ts +234 -0
- package/src/color-picker/index.ts +1 -0
- package/src/combobox/_examples/combobox.async.example.ts +85 -0
- package/src/combobox/_examples/combobox.empty-state.example.ts +36 -0
- package/src/combobox/_examples/combobox.example.ts +36 -0
- package/src/combobox/_examples/combobox.free-text.example.ts +42 -0
- package/src/combobox/_examples/combobox.usage.example.ts +51 -0
- package/src/combobox/_examples/combobox.with-icons.example.ts +49 -0
- package/src/combobox/_examples/index.ts +8 -0
- package/src/combobox/combobox.css +101 -0
- package/src/combobox/combobox.playground.ts +90 -0
- package/src/combobox/combobox.spec.ts +111 -0
- package/src/combobox/combobox.ts +219 -0
- package/src/combobox/index.ts +6 -0
- package/src/command-palette/_examples/command-palette.async.example.ts +99 -0
- package/src/command-palette/_examples/command-palette.dialog.example.ts +90 -0
- package/src/command-palette/_examples/command-palette.example.ts +40 -0
- package/src/command-palette/_examples/command-palette.fuzzy.example.ts +54 -0
- package/src/command-palette/_examples/command-palette.groups.example.ts +55 -0
- package/src/command-palette/_examples/command-palette.usage.example.ts +49 -0
- package/src/command-palette/_examples/index.ts +8 -0
- package/src/command-palette/command-palette.css +234 -0
- package/src/command-palette/command-palette.playground.ts +119 -0
- package/src/command-palette/command-palette.ts +448 -0
- package/src/command-palette/index.ts +10 -0
- package/src/confirm-popup/_examples/confirm-popup.destructive.example.ts +72 -0
- package/src/confirm-popup/_examples/confirm-popup.example.ts +82 -0
- package/src/confirm-popup/_examples/confirm-popup.placement.example.ts +97 -0
- package/src/confirm-popup/_examples/confirm-popup.usage.example.ts +94 -0
- package/src/confirm-popup/_examples/confirm-popup.with-message.example.ts +76 -0
- package/src/confirm-popup/_examples/index.ts +7 -0
- package/src/confirm-popup/confirm-popup.css +47 -0
- package/src/confirm-popup/confirm-popup.playground.ts +109 -0
- package/src/confirm-popup/confirm-popup.spec.ts +209 -0
- package/src/confirm-popup/confirm-popup.ts +279 -0
- package/src/confirm-popup/index.ts +1 -0
- package/src/date-picker/_examples/date-picker.disabled-dates.example.ts +44 -0
- package/src/date-picker/_examples/date-picker.example.ts +38 -0
- package/src/date-picker/_examples/date-picker.locale.example.ts +50 -0
- package/src/date-picker/_examples/date-picker.readonly.example.ts +32 -0
- package/src/date-picker/_examples/date-picker.usage.example.ts +60 -0
- package/src/date-picker/_examples/date-picker.with-min-max.example.ts +47 -0
- package/src/date-picker/_examples/index.ts +8 -0
- package/src/date-picker/date-picker.css +61 -0
- package/src/date-picker/date-picker.playground.ts +79 -0
- package/src/date-picker/date-picker.spec.ts +71 -0
- package/src/date-picker/date-picker.ts +185 -0
- package/src/date-picker/index.ts +1 -0
- package/src/dialog/_examples/dialog.confirmation.example.ts +30 -0
- package/src/dialog/_examples/dialog.default.example.ts +30 -0
- package/src/dialog/_examples/dialog.nested.example.ts +86 -0
- package/src/dialog/_examples/dialog.scrollable.example.ts +30 -0
- package/src/dialog/_examples/dialog.usage.example.ts +57 -0
- package/src/dialog/_examples/dialog.with-form.example.ts +48 -0
- package/src/dialog/_examples/index.ts +8 -0
- package/src/dialog/dialog.css +56 -0
- package/src/dialog/dialog.playground.ts +136 -0
- package/src/dialog/dialog.ts +82 -0
- package/src/dialog/index.ts +1 -0
- package/src/divider/_examples/divider.example.ts +27 -0
- package/src/divider/_examples/divider.sizes.example.ts +33 -0
- package/src/divider/_examples/divider.structural.example.ts +55 -0
- package/src/divider/_examples/divider.usage.example.ts +48 -0
- package/src/divider/_examples/divider.variants.example.ts +33 -0
- package/src/divider/_examples/divider.vertical.example.ts +38 -0
- package/src/divider/_examples/divider.with-content.example.ts +38 -0
- package/src/divider/_examples/index.ts +9 -0
- package/src/divider/divider.css +93 -0
- package/src/divider/divider.playground.ts +97 -0
- package/src/divider/divider.spec.ts +207 -0
- package/src/divider/divider.ts +220 -0
- package/src/divider/index.ts +1 -0
- package/src/drawer/_examples/drawer.example.ts +30 -0
- package/src/drawer/_examples/drawer.modal-vs-non-modal.example.ts +27 -0
- package/src/drawer/_examples/drawer.scrollable.example.ts +30 -0
- package/src/drawer/_examples/drawer.sides.example.ts +32 -0
- package/src/drawer/_examples/drawer.usage.example.ts +56 -0
- package/src/drawer/_examples/drawer.with-form.example.ts +48 -0
- package/src/drawer/_examples/index.ts +8 -0
- package/src/drawer/drawer.css +130 -0
- package/src/drawer/drawer.playground.ts +107 -0
- package/src/drawer/drawer.spec.ts +216 -0
- package/src/drawer/drawer.ts +85 -0
- package/src/drawer/index.ts +1 -0
- package/src/dropdown-menu/_examples/dropdown-menu.disabled.example.ts +19 -0
- package/src/dropdown-menu/_examples/dropdown-menu.example.ts +20 -0
- package/src/dropdown-menu/_examples/dropdown-menu.shortcuts.example.ts +31 -0
- package/src/dropdown-menu/_examples/dropdown-menu.sides.example.ts +18 -0
- package/src/dropdown-menu/_examples/dropdown-menu.usage.example.ts +56 -0
- package/src/dropdown-menu/_examples/dropdown-menu.with-icons.example.ts +31 -0
- package/src/dropdown-menu/_examples/dropdown-menu.with-separator.example.ts +41 -0
- package/src/dropdown-menu/_examples/index.ts +9 -0
- package/src/dropdown-menu/dropdown-menu.css +108 -0
- package/src/dropdown-menu/dropdown-menu.playground.ts +109 -0
- package/src/dropdown-menu/dropdown-menu.spec.ts +5 -0
- package/src/dropdown-menu/dropdown-menu.ts +128 -0
- package/src/dropdown-menu/index.ts +1 -0
- package/src/empty-state/_examples/empty-state.error.example.ts +63 -0
- package/src/empty-state/_examples/empty-state.example.ts +59 -0
- package/src/empty-state/_examples/empty-state.search.example.ts +82 -0
- package/src/empty-state/_examples/empty-state.sizes.example.ts +76 -0
- package/src/empty-state/_examples/empty-state.usage.example.ts +66 -0
- package/src/empty-state/_examples/empty-state.with-actions.example.ts +68 -0
- package/src/empty-state/_examples/index.ts +8 -0
- package/src/empty-state/empty-state.css +114 -0
- package/src/empty-state/empty-state.playground.ts +87 -0
- package/src/empty-state/empty-state.spec.ts +211 -0
- package/src/empty-state/empty-state.ts +276 -0
- package/src/empty-state/index.ts +1 -0
- package/src/example-components.ts +396 -0
- package/src/field/_examples/field.disabled.example.ts +49 -0
- package/src/field/_examples/field.example.ts +51 -0
- package/src/field/_examples/field.required.example.ts +46 -0
- package/src/field/_examples/field.with-error.example.ts +73 -0
- package/src/field/_examples/field.with-prefix-suffix.example.ts +63 -0
- package/src/field/_examples/index.ts +7 -0
- package/src/field/field.css +138 -0
- package/src/field/field.playground.ts +108 -0
- package/src/field/field.spec.ts +132 -0
- package/src/field/field.ts +232 -0
- package/src/field/field.usage.example.ts +63 -0
- package/src/field/index.ts +7 -0
- package/src/file-upload/_examples/file-upload.dropzone.example.ts +32 -0
- package/src/file-upload/_examples/file-upload.example.ts +29 -0
- package/src/file-upload/_examples/file-upload.image-preview.example.ts +31 -0
- package/src/file-upload/_examples/file-upload.multiple.example.ts +23 -0
- package/src/file-upload/_examples/file-upload.with-progress.example.ts +59 -0
- package/src/file-upload/_examples/index.ts +7 -0
- package/src/file-upload/file-upload.css +207 -0
- package/src/file-upload/file-upload.playground.ts +84 -0
- package/src/file-upload/file-upload.spec.ts +94 -0
- package/src/file-upload/file-upload.ts +301 -0
- package/src/file-upload/file-upload.usage.example.ts +45 -0
- package/src/file-upload/index.ts +1 -0
- package/src/form/_examples/form.async-submit.example.ts +72 -0
- package/src/form/_examples/form.compound.example.ts +93 -0
- package/src/form/_examples/form.example.ts +70 -0
- package/src/form/_examples/form.validation.example.ts +67 -0
- package/src/form/_examples/index.ts +6 -0
- package/src/form/form.css +63 -0
- package/src/form/form.playground.ts +145 -0
- package/src/form/form.spec.ts +96 -0
- package/src/form/form.ts +216 -0
- package/src/form/form.usage.example.ts +63 -0
- package/src/form/index.ts +5 -0
- package/src/icon/_examples/icon.gallery.example.ts +199 -0
- package/src/icon/_examples/icon.usage.example.ts +46 -0
- package/src/icon/_examples/index.ts +4 -0
- package/src/icon/icon.playground.ts +63 -0
- package/src/icon/index.ts +5 -0
- package/src/icon/lucide/icon-names.generated.ts +1708 -0
- package/src/icon/lucide/icon-names.ts +18 -0
- package/src/icon/lucide/index.ts +2 -0
- package/src/icon/lucide/provide-lucide-icons.ts +96 -0
- package/src/input/_examples/index.ts +4 -0
- package/src/input/_examples/input.color.example.ts +33 -0
- package/src/input/_examples/input.example.ts +22 -0
- package/src/input/index.ts +1 -0
- package/src/input/input.css +70 -0
- package/src/input/input.playground.ts +79 -0
- package/src/input/input.spec.ts +98 -0
- package/src/input/input.ts +158 -0
- package/src/input/input.usage.example.ts +40 -0
- package/src/input-group/_examples/index.ts +7 -0
- package/src/input-group/_examples/input-group.button.example.ts +43 -0
- package/src/input-group/_examples/input-group.example.ts +39 -0
- package/src/input-group/_examples/input-group.icon.example.ts +49 -0
- package/src/input-group/_examples/input-group.url.example.ts +36 -0
- package/src/input-group/_examples/input-group.variants.example.ts +39 -0
- package/src/input-group/index.ts +1 -0
- package/src/input-group/input-group.css +125 -0
- package/src/input-group/input-group.playground.ts +90 -0
- package/src/input-group/input-group.ts +142 -0
- package/src/input-group/input-group.usage.example.ts +47 -0
- package/src/input-mask/_examples/index.ts +8 -0
- package/src/input-mask/_examples/input-mask.credit-card.example.ts +90 -0
- package/src/input-mask/_examples/input-mask.custom-tokens.example.ts +87 -0
- package/src/input-mask/_examples/input-mask.date.example.ts +61 -0
- package/src/input-mask/_examples/input-mask.example.ts +61 -0
- package/src/input-mask/_examples/input-mask.usage.example.ts +44 -0
- package/src/input-mask/_examples/input-mask.validation.example.ts +80 -0
- package/src/input-mask/index.ts +9 -0
- package/src/input-mask/input-mask.css +39 -0
- package/src/input-mask/input-mask.playground.ts +79 -0
- package/src/input-mask/input-mask.ts +130 -0
- package/src/input-otp/_examples/index.ts +8 -0
- package/src/input-otp/_examples/input-otp.autosubmit.example.ts +71 -0
- package/src/input-otp/_examples/input-otp.example.ts +47 -0
- package/src/input-otp/_examples/input-otp.lengths.example.ts +67 -0
- package/src/input-otp/_examples/input-otp.masked.example.ts +46 -0
- package/src/input-otp/_examples/input-otp.reactive.example.ts +58 -0
- package/src/input-otp/_examples/input-otp.separator.example.ts +49 -0
- package/src/input-otp/index.ts +1 -0
- package/src/input-otp/input-otp.css +87 -0
- package/src/input-otp/input-otp.playground.ts +107 -0
- package/src/input-otp/input-otp.ts +244 -0
- package/src/input-otp/input-otp.usage.example.ts +45 -0
- package/src/kbd/_examples/index.ts +6 -0
- package/src/kbd/_examples/kbd.combo.example.ts +24 -0
- package/src/kbd/_examples/kbd.example.ts +22 -0
- package/src/kbd/_examples/kbd.in-tooltip.example.ts +43 -0
- package/src/kbd/_examples/kbd.sizes.example.ts +31 -0
- package/src/kbd/index.ts +1 -0
- package/src/kbd/kbd.css +67 -0
- package/src/kbd/kbd.playground.ts +51 -0
- package/src/kbd/kbd.spec.ts +123 -0
- package/src/kbd/kbd.ts +123 -0
- package/src/kbd/kbd.usage.example.ts +38 -0
- package/src/link/_examples/index.ts +8 -0
- package/src/link/_examples/link.disabled.example.ts +23 -0
- package/src/link/_examples/link.example.ts +26 -0
- package/src/link/_examples/link.external.example.ts +33 -0
- package/src/link/_examples/link.in-prose.example.ts +36 -0
- package/src/link/_examples/link.sizes.example.ts +28 -0
- package/src/link/_examples/link.variants.example.ts +25 -0
- package/src/link/index.ts +1 -0
- package/src/link/link.css +104 -0
- package/src/link/link.playground.ts +98 -0
- package/src/link/link.spec.ts +146 -0
- package/src/link/link.ts +133 -0
- package/src/link/link.usage.example.ts +37 -0
- package/src/list/_examples/index.ts +7 -0
- package/src/list/_examples/list.divided.example.ts +32 -0
- package/src/list/_examples/list.example.ts +31 -0
- package/src/list/_examples/list.interactive.example.ts +51 -0
- package/src/list/_examples/list.nav.example.ts +44 -0
- package/src/list/_examples/list.with-icons.example.ts +97 -0
- package/src/list/index.ts +1 -0
- package/src/list/list.css +166 -0
- package/src/list/list.playground.ts +90 -0
- package/src/list/list.spec.ts +121 -0
- package/src/list/list.ts +227 -0
- package/src/list/list.usage.example.ts +45 -0
- package/src/menubar/_examples/index.ts +6 -0
- package/src/menubar/_examples/menubar.disabled-item.example.ts +23 -0
- package/src/menubar/_examples/menubar.example.ts +22 -0
- package/src/menubar/_examples/menubar.with-shortcuts.example.ts +33 -0
- package/src/menubar/_examples/menubar.with-submenu.example.ts +76 -0
- package/src/menubar/index.ts +1 -0
- package/src/menubar/menubar.css +62 -0
- package/src/menubar/menubar.playground.ts +96 -0
- package/src/menubar/menubar.ts +160 -0
- package/src/menubar/menubar.usage.example.ts +33 -0
- package/src/number-input/_examples/index.ts +7 -0
- package/src/number-input/_examples/number-input.currency.example.ts +35 -0
- package/src/number-input/_examples/number-input.decimal.example.ts +34 -0
- package/src/number-input/_examples/number-input.example.ts +24 -0
- package/src/number-input/_examples/number-input.min-max.example.ts +33 -0
- package/src/number-input/_examples/number-input.with-stepper.example.ts +45 -0
- package/src/number-input/index.ts +1 -0
- package/src/number-input/number-input.css +115 -0
- package/src/number-input/number-input.playground.ts +92 -0
- package/src/number-input/number-input.spec.ts +102 -0
- package/src/number-input/number-input.ts +212 -0
- package/src/number-input/number-input.usage.example.ts +73 -0
- package/src/overlay/overlay.css +32 -0
- package/src/overlay-badge/_examples/index.ts +7 -0
- package/src/overlay-badge/_examples/overlay-badge.described.example.ts +36 -0
- package/src/overlay-badge/_examples/overlay-badge.dot.example.ts +28 -0
- package/src/overlay-badge/_examples/overlay-badge.example.ts +34 -0
- package/src/overlay-badge/_examples/overlay-badge.on-avatar.example.ts +38 -0
- package/src/overlay-badge/_examples/overlay-badge.positions.example.ts +39 -0
- package/src/overlay-badge/index.ts +1 -0
- package/src/overlay-badge/overlay-badge.css +118 -0
- package/src/overlay-badge/overlay-badge.playground.ts +92 -0
- package/src/overlay-badge/overlay-badge.spec.ts +174 -0
- package/src/overlay-badge/overlay-badge.ts +232 -0
- package/src/overlay-badge/overlay-badge.usage.example.ts +44 -0
- package/src/pagination/_examples/index.ts +7 -0
- package/src/pagination/_examples/pagination.boundaries.example.ts +56 -0
- package/src/pagination/_examples/pagination.compact.example.ts +42 -0
- package/src/pagination/_examples/pagination.example.ts +55 -0
- package/src/pagination/_examples/pagination.large.example.ts +54 -0
- package/src/pagination/_examples/pagination.with-info.example.ts +49 -0
- package/src/pagination/index.ts +1 -0
- package/src/pagination/pagination.css +146 -0
- package/src/pagination/pagination.playground.ts +107 -0
- package/src/pagination/pagination.spec.ts +202 -0
- package/src/pagination/pagination.ts +432 -0
- package/src/pagination/pagination.usage.example.ts +50 -0
- package/src/password-input/_examples/index.ts +6 -0
- package/src/password-input/_examples/password-input.example.ts +24 -0
- package/src/password-input/_examples/password-input.strength.example.ts +45 -0
- package/src/password-input/_examples/password-input.toggle.example.ts +43 -0
- package/src/password-input/_examples/password-input.with-rules.example.ts +78 -0
- package/src/password-input/index.ts +1 -0
- package/src/password-input/password-input.css +155 -0
- package/src/password-input/password-input.playground.ts +81 -0
- package/src/password-input/password-input.spec.ts +129 -0
- package/src/password-input/password-input.ts +254 -0
- package/src/password-input/password-input.usage.example.ts +55 -0
- package/src/playground-types.ts +47 -0
- package/src/popover/_examples/index.ts +7 -0
- package/src/popover/_examples/popover.cancellable.example.ts +20 -0
- package/src/popover/_examples/popover.example.ts +20 -0
- package/src/popover/_examples/popover.modal.example.ts +22 -0
- package/src/popover/_examples/popover.sides.example.ts +37 -0
- package/src/popover/_examples/popover.with-form.example.ts +38 -0
- package/src/popover/index.ts +1 -0
- package/src/popover/popover.css +71 -0
- package/src/popover/popover.playground.ts +86 -0
- package/src/popover/popover.spec.ts +5 -0
- package/src/popover/popover.ts +94 -0
- package/src/popover/popover.usage.example.ts +48 -0
- package/src/progress-bar/_examples/index.ts +7 -0
- package/src/progress-bar/_examples/progress-bar.example.ts +22 -0
- package/src/progress-bar/_examples/progress-bar.indeterminate.example.ts +23 -0
- package/src/progress-bar/_examples/progress-bar.sizes.example.ts +29 -0
- package/src/progress-bar/_examples/progress-bar.variants.example.ts +30 -0
- package/src/progress-bar/_examples/progress-bar.with-label.example.ts +30 -0
- package/src/progress-bar/index.ts +1 -0
- package/src/progress-bar/progress-bar.css +113 -0
- package/src/progress-bar/progress-bar.playground.ts +87 -0
- package/src/progress-bar/progress-bar.spec.ts +233 -0
- package/src/progress-bar/progress-bar.ts +155 -0
- package/src/progress-bar/progress-bar.usage.example.ts +52 -0
- package/src/public-api.ts +61 -0
- package/src/radio/_examples/index.ts +6 -0
- package/src/radio/_examples/radio.default.example.ts +26 -0
- package/src/radio/_examples/radio.disabled.example.ts +26 -0
- package/src/radio/_examples/radio.group.example.ts +27 -0
- package/src/radio/_examples/radio.inline.example.ts +26 -0
- package/src/radio/index.ts +1 -0
- package/src/radio/radio.css +58 -0
- package/src/radio/radio.playground.ts +90 -0
- package/src/radio/radio.ts +143 -0
- package/src/radio/radio.usage.example.ts +54 -0
- package/src/select/_examples/index.ts +6 -0
- package/src/select/_examples/select.default.example.ts +26 -0
- package/src/select/_examples/select.disabled.example.ts +24 -0
- package/src/select/_examples/select.grouped.example.ts +37 -0
- package/src/select/_examples/select.placeholder.example.ts +26 -0
- package/src/select/index.ts +1 -0
- package/src/select/select.css +65 -0
- package/src/select/select.playground.ts +81 -0
- package/src/select/select.ts +176 -0
- package/src/select/select.usage.example.ts +64 -0
- package/src/skeleton/_examples/index.ts +6 -0
- package/src/skeleton/_examples/skeleton.animations.example.ts +52 -0
- package/src/skeleton/_examples/skeleton.card.example.ts +68 -0
- package/src/skeleton/_examples/skeleton.example.ts +24 -0
- package/src/skeleton/_examples/skeleton.shapes.example.ts +55 -0
- package/src/skeleton/index.ts +1 -0
- package/src/skeleton/skeleton.css +111 -0
- package/src/skeleton/skeleton.playground.ts +80 -0
- package/src/skeleton/skeleton.spec.ts +126 -0
- package/src/skeleton/skeleton.ts +155 -0
- package/src/skeleton/skeleton.usage.example.ts +49 -0
- package/src/slider/_examples/index.ts +7 -0
- package/src/slider/_examples/slider.example.ts +41 -0
- package/src/slider/_examples/slider.formatted.example.ts +53 -0
- package/src/slider/_examples/slider.range.example.ts +48 -0
- package/src/slider/_examples/slider.vertical.example.ts +48 -0
- package/src/slider/_examples/slider.with-marks.example.ts +46 -0
- package/src/slider/index.ts +1 -0
- package/src/slider/slider.css +172 -0
- package/src/slider/slider.playground.ts +88 -0
- package/src/slider/slider.spec.ts +139 -0
- package/src/slider/slider.ts +246 -0
- package/src/slider/slider.usage.example.ts +68 -0
- package/src/speed-dial/_examples/index.ts +7 -0
- package/src/speed-dial/_examples/speed-dial.directions.example.ts +85 -0
- package/src/speed-dial/_examples/speed-dial.disabled.example.ts +71 -0
- package/src/speed-dial/_examples/speed-dial.example.ts +48 -0
- package/src/speed-dial/_examples/speed-dial.usage.example.ts +59 -0
- package/src/speed-dial/_examples/speed-dial.with-tooltips.example.ts +65 -0
- package/src/speed-dial/index.ts +1 -0
- package/src/speed-dial/speed-dial.css +137 -0
- package/src/speed-dial/speed-dial.playground.ts +137 -0
- package/src/speed-dial/speed-dial.spec.ts +191 -0
- package/src/speed-dial/speed-dial.ts +257 -0
- package/src/spinner/_examples/index.ts +8 -0
- package/src/spinner/_examples/spinner.animations.example.ts +54 -0
- package/src/spinner/_examples/spinner.example.ts +26 -0
- package/src/spinner/_examples/spinner.in-button.example.ts +51 -0
- package/src/spinner/_examples/spinner.sizes.example.ts +31 -0
- package/src/spinner/_examples/spinner.usage.example.ts +45 -0
- package/src/spinner/_examples/spinner.variants.example.ts +34 -0
- package/src/spinner/index.ts +1 -0
- package/src/spinner/spinner.css +161 -0
- package/src/spinner/spinner.playground.ts +68 -0
- package/src/spinner/spinner.spec.ts +184 -0
- package/src/spinner/spinner.ts +185 -0
- package/src/stepper/_examples/index.ts +8 -0
- package/src/stepper/_examples/stepper.example.ts +62 -0
- package/src/stepper/_examples/stepper.non-linear.example.ts +63 -0
- package/src/stepper/_examples/stepper.optional-step.example.ts +62 -0
- package/src/stepper/_examples/stepper.usage.example.ts +73 -0
- package/src/stepper/_examples/stepper.vertical.example.ts +66 -0
- package/src/stepper/_examples/stepper.with-error.example.ts +63 -0
- package/src/stepper/index.ts +1 -0
- package/src/stepper/stepper.css +147 -0
- package/src/stepper/stepper.playground.ts +88 -0
- package/src/stepper/stepper.spec.ts +200 -0
- package/src/stepper/stepper.ts +242 -0
- package/src/table/_examples/index.ts +23 -0
- package/src/table/_examples/table.column-pinning.example.ts +55 -0
- package/src/table/_examples/table.column-resize.example.ts +49 -0
- package/src/table/_examples/table.column-visibility.example.ts +52 -0
- package/src/table/_examples/table.density.example.ts +71 -0
- package/src/table/_examples/table.editable.example.ts +85 -0
- package/src/table/_examples/table.empty-and-error.example.ts +112 -0
- package/src/table/_examples/table.example.ts +45 -0
- package/src/table/_examples/table.export.example.ts +82 -0
- package/src/table/_examples/table.filterable.example.ts +67 -0
- package/src/table/_examples/table.grouping.example.ts +63 -0
- package/src/table/_examples/table.keyboard.example.ts +115 -0
- package/src/table/_examples/table.master-detail.example.ts +102 -0
- package/src/table/_examples/table.persistence.example.ts +85 -0
- package/src/table/_examples/table.playground.ts +154 -0
- package/src/table/_examples/table.row-pinning.example.ts +71 -0
- package/src/table/_examples/table.selection.example.ts +67 -0
- package/src/table/_examples/table.server-mode.example.ts +120 -0
- package/src/table/_examples/table.sortable.example.ts +49 -0
- package/src/table/_examples/table.theming.example.ts +64 -0
- package/src/table/_examples/table.usage.example.ts +90 -0
- package/src/table/_examples/table.virtualized.example.ts +122 -0
- package/src/table/index.ts +11 -0
- package/src/table/table-cell-editor-outlet.ts +111 -0
- package/src/table/table-editors/boolean-editor.ts +71 -0
- package/src/table/table-editors/date-editor.ts +117 -0
- package/src/table/table-editors/editors.spec.ts +147 -0
- package/src/table/table-editors/index.ts +41 -0
- package/src/table/table-editors/number-editor.ts +89 -0
- package/src/table/table-editors/select-editor.ts +107 -0
- package/src/table/table-editors/text-editor.ts +82 -0
- package/src/table/table-export.spec.ts +33 -0
- package/src/table/table-export.ts +53 -0
- package/src/table/table-filter-outlet.ts +137 -0
- package/src/table/table-filters/date-filter.ts +122 -0
- package/src/table/table-filters/filters.css +53 -0
- package/src/table/table-filters/filters.spec.ts +277 -0
- package/src/table/table-filters/index.ts +11 -0
- package/src/table/table-filters/number-filter.ts +232 -0
- package/src/table/table-filters/select-filter.ts +129 -0
- package/src/table/table-filters/text-filter.ts +110 -0
- package/src/table/table-pagination.spec.ts +118 -0
- package/src/table/table-pagination.ts +191 -0
- package/src/table/table-side-panel.spec.ts +170 -0
- package/src/table/table-side-panel.ts +263 -0
- package/src/table/table-status-bar.spec.ts +78 -0
- package/src/table/table-status-bar.ts +70 -0
- package/src/table/table-toolbar.spec.ts +180 -0
- package/src/table/table-toolbar.ts +244 -0
- package/src/table/table-virtual.spec.ts +103 -0
- package/src/table/table-virtual.ts +180 -0
- package/src/table/table.css +468 -0
- package/src/table/table.spec.ts +175 -0
- package/src/table/table.ts +1009 -0
- package/src/tabs/_examples/index.ts +8 -0
- package/src/tabs/_examples/tabs.controlled.example.ts +59 -0
- package/src/tabs/_examples/tabs.disabled.example.ts +34 -0
- package/src/tabs/_examples/tabs.example.ts +34 -0
- package/src/tabs/_examples/tabs.manual-activation.example.ts +34 -0
- package/src/tabs/_examples/tabs.usage.example.ts +43 -0
- package/src/tabs/_examples/tabs.vertical.example.ts +33 -0
- package/src/tabs/index.ts +1 -0
- package/src/tabs/tabs.css +80 -0
- package/src/tabs/tabs.playground.ts +88 -0
- package/src/tabs/tabs.spec.ts +135 -0
- package/src/tabs/tabs.ts +204 -0
- package/src/tag/_examples/index.ts +9 -0
- package/src/tag/_examples/tag.example.ts +22 -0
- package/src/tag/_examples/tag.list.example.ts +38 -0
- package/src/tag/_examples/tag.removable.example.ts +39 -0
- package/src/tag/_examples/tag.selectable.example.ts +33 -0
- package/src/tag/_examples/tag.sizes.example.ts +25 -0
- package/src/tag/_examples/tag.usage.example.ts +62 -0
- package/src/tag/_examples/tag.variants.example.ts +29 -0
- package/src/tag/index.ts +1 -0
- package/src/tag/tag.css +167 -0
- package/src/tag/tag.playground.ts +63 -0
- package/src/tag/tag.spec.ts +153 -0
- package/src/tag/tag.ts +186 -0
- package/src/test-setup.ts +5 -0
- package/src/textarea/_examples/index.ts +8 -0
- package/src/textarea/_examples/textarea.autoresize.example.ts +37 -0
- package/src/textarea/_examples/textarea.character-count.example.ts +34 -0
- package/src/textarea/_examples/textarea.example.ts +22 -0
- package/src/textarea/_examples/textarea.no-resize.example.ts +28 -0
- package/src/textarea/_examples/textarea.usage.example.ts +50 -0
- package/src/textarea/_examples/textarea.with-field.example.ts +66 -0
- package/src/textarea/index.ts +1 -0
- package/src/textarea/textarea.css +117 -0
- package/src/textarea/textarea.playground.ts +70 -0
- package/src/textarea/textarea.spec.ts +161 -0
- package/src/textarea/textarea.ts +339 -0
- package/src/time-picker/_examples/index.ts +8 -0
- package/src/time-picker/_examples/time-picker.12-hour.example.ts +24 -0
- package/src/time-picker/_examples/time-picker.example.ts +24 -0
- package/src/time-picker/_examples/time-picker.formatted.example.ts +32 -0
- package/src/time-picker/_examples/time-picker.range.example.ts +54 -0
- package/src/time-picker/_examples/time-picker.usage.example.ts +53 -0
- package/src/time-picker/_examples/time-picker.with-seconds.example.ts +24 -0
- package/src/time-picker/index.ts +1 -0
- package/src/time-picker/time-picker.css +126 -0
- package/src/time-picker/time-picker.playground.ts +72 -0
- package/src/time-picker/time-picker.spec.ts +77 -0
- package/src/time-picker/time-picker.ts +207 -0
- package/src/toast/_examples/index.ts +7 -0
- package/src/toast/_examples/toast.default.example.ts +37 -0
- package/src/toast/_examples/toast.dismissible.example.ts +38 -0
- package/src/toast/_examples/toast.usage.example.ts +57 -0
- package/src/toast/_examples/toast.variants.example.ts +43 -0
- package/src/toast/_examples/toast.with-action.example.ts +46 -0
- package/src/toast/index.ts +1 -0
- package/src/toast/toast.css +115 -0
- package/src/toast/toast.playground.ts +61 -0
- package/src/toast/toast.ts +168 -0
- package/src/toggle/_examples/index.ts +7 -0
- package/src/toggle/_examples/toggle.checked.example.ts +20 -0
- package/src/toggle/_examples/toggle.default.example.ts +20 -0
- package/src/toggle/_examples/toggle.disabled.example.ts +26 -0
- package/src/toggle/_examples/toggle.usage.example.ts +51 -0
- package/src/toggle/_examples/toggle.with-label.example.ts +30 -0
- package/src/toggle/index.ts +1 -0
- package/src/toggle/toggle.css +123 -0
- package/src/toggle/toggle.playground.ts +65 -0
- package/src/toggle/toggle.ts +113 -0
- package/src/tooltip/_examples/index.ts +9 -0
- package/src/tooltip/_examples/tooltip.delays.example.ts +16 -0
- package/src/tooltip/_examples/tooltip.disabled.example.ts +16 -0
- package/src/tooltip/_examples/tooltip.example.ts +16 -0
- package/src/tooltip/_examples/tooltip.group.example.ts +20 -0
- package/src/tooltip/_examples/tooltip.rich.example.ts +19 -0
- package/src/tooltip/_examples/tooltip.sides.example.ts +18 -0
- package/src/tooltip/_examples/tooltip.usage.example.ts +50 -0
- package/src/tooltip/index.ts +1 -0
- package/src/tooltip/tooltip.css +61 -0
- package/src/tooltip/tooltip.playground.ts +79 -0
- package/src/tooltip/tooltip.spec.ts +5 -0
- package/src/tooltip/tooltip.ts +102 -0
- package/src/tree-select/_examples/index.ts +8 -0
- package/src/tree-select/_examples/tree-select.disabled.example.ts +106 -0
- package/src/tree-select/_examples/tree-select.example.ts +65 -0
- package/src/tree-select/_examples/tree-select.expanded.example.ts +72 -0
- package/src/tree-select/_examples/tree-select.field.example.ts +77 -0
- package/src/tree-select/_examples/tree-select.multi.example.ts +73 -0
- package/src/tree-select/_examples/tree-select.usage.example.ts +85 -0
- package/src/tree-select/index.ts +1 -0
- package/src/tree-select/tree-select.css +220 -0
- package/src/tree-select/tree-select.playground.ts +83 -0
- package/src/tree-select/tree-select.ts +348 -0
- package/src/typography/_examples/index.ts +9 -0
- package/src/typography/_examples/typography.blockquote.example.ts +34 -0
- package/src/typography/_examples/typography.code.example.ts +32 -0
- package/src/typography/_examples/typography.example.ts +42 -0
- package/src/typography/_examples/typography.lead.example.ts +37 -0
- package/src/typography/_examples/typography.muted.example.ts +27 -0
- package/src/typography/_examples/typography.truncate.example.ts +41 -0
- package/src/typography/_examples/typography.usage.example.ts +44 -0
- package/src/typography/index.ts +8 -0
- package/src/typography/typography.playground.ts +101 -0
- package/src/typography/typography.spec.ts +70 -0
- package/src/typography/typography.ts +105 -0
- package/tsconfig.lib.json +25 -0
- package/tsconfig.lib.prod.json +17 -0
- package/tsconfig.spec.json +16 -0
- package/vite.config.ts +33 -0
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
ModelSignal,
|
|
5
|
+
ViewEncapsulation,
|
|
6
|
+
input,
|
|
7
|
+
model,
|
|
8
|
+
} from '@angular/core';
|
|
9
|
+
import {
|
|
10
|
+
KjIconDirective,
|
|
11
|
+
KjPagination,
|
|
12
|
+
KjPaginationItem,
|
|
13
|
+
KjPaginationPrevious,
|
|
14
|
+
KjPaginationNext,
|
|
15
|
+
KjPaginationFirst,
|
|
16
|
+
KjPaginationLast,
|
|
17
|
+
KjPaginationEllipsis,
|
|
18
|
+
KjPaginationInfo,
|
|
19
|
+
} from '@kouji-ui/core';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Styled wrapper around the headless `KjPagination` directive — root of the
|
|
23
|
+
* pagination compound. Re-maps the `kjPage` / `kjTotalPages` /
|
|
24
|
+
* `kjSiblingCount` / `kjBoundaryCount` / `kjVariant` / `kjSize` inputs and
|
|
25
|
+
* mirrors the `kjPageChange` output. Hosts `<nav aria-label="Pagination">`
|
|
26
|
+
* via the underlying directive.
|
|
27
|
+
*
|
|
28
|
+
* Compose the eight wrappers — `<kj-pagination>`, `<kj-pagination-item>`,
|
|
29
|
+
* `<kj-pagination-previous>`, `<kj-pagination-next>`, `<kj-pagination-first>`,
|
|
30
|
+
* `<kj-pagination-last>`, `<kj-pagination-ellipsis>`, `<kj-pagination-info>`
|
|
31
|
+
* — to mirror the directive family. The root exposes the directive's
|
|
32
|
+
* `pages()` computed via the `#p="kjPagination"` template ref so the
|
|
33
|
+
* `@for` over numeric tokens / ellipsis tokens lives in the consumer's
|
|
34
|
+
* template (the same tag-agnostic compound shape as the directives).
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```html
|
|
38
|
+
* <kj-pagination [(kjPage)]="page" [kjTotalPages]="10" #p="kjPagination">
|
|
39
|
+
* <kj-pagination-previous>Previous</kj-pagination-previous>
|
|
40
|
+
* @for (token of p.pages(); track token) {
|
|
41
|
+
* @if (token === 'ellipsis-left' || token === 'ellipsis-right') {
|
|
42
|
+
* <kj-pagination-ellipsis>…</kj-pagination-ellipsis>
|
|
43
|
+
* } @else {
|
|
44
|
+
* <kj-pagination-item [kjPage]="token">{{ token }}</kj-pagination-item>
|
|
45
|
+
* }
|
|
46
|
+
* }
|
|
47
|
+
* <kj-pagination-next>Next</kj-pagination-next>
|
|
48
|
+
* </kj-pagination>
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @doc-example Default
|
|
52
|
+
* The canonical hand-authored compound — First / Prev / pages / Next / Last.
|
|
53
|
+
* @doc-file pagination.example.ts
|
|
54
|
+
* @doc-example Usage
|
|
55
|
+
* A walkthrough of the most common usages via the `<kj-pagination-default>`
|
|
56
|
+
* convenience wrapper. Use this as the copy-paste starting point.
|
|
57
|
+
* @doc-file pagination.usage.example.ts
|
|
58
|
+
* @doc-example Large dataset (ellipsis)
|
|
59
|
+
* Larger total counts surface the ellipsis windowing pattern.
|
|
60
|
+
* @doc-file pagination.large.example.ts
|
|
61
|
+
* @doc-example Boundaries
|
|
62
|
+
* First / Last buttons jump to the edges of the range.
|
|
63
|
+
* @doc-file pagination.boundaries.example.ts
|
|
64
|
+
* @doc-example Compact
|
|
65
|
+
* `kjSize="sm"` shrinks the row for dense table footers.
|
|
66
|
+
* @doc-file pagination.compact.example.ts
|
|
67
|
+
* @doc-example With info
|
|
68
|
+
* `<kj-pagination-info>` renders the localised "Page N of M" status.
|
|
69
|
+
* @doc-file pagination.with-info.example.ts
|
|
70
|
+
*
|
|
71
|
+
* @doc-keyboard
|
|
72
|
+
* Tab — Moves focus across the visible page / boundary buttons
|
|
73
|
+
* Enter|Space — Activates the focused button (navigates to that page)
|
|
74
|
+
*
|
|
75
|
+
* @doc-aria
|
|
76
|
+
* role="navigation" — On the host `<nav>` (provided by the directive)
|
|
77
|
+
* aria-label — "Pagination" by default; localise via the directive's input
|
|
78
|
+
* aria-current="page" — Reflected on the active page item
|
|
79
|
+
* aria-disabled — Reflected on boundary buttons when at range edges
|
|
80
|
+
* data-active — Mirrors the current page for theme/scope hooks
|
|
81
|
+
*
|
|
82
|
+
* @doc-touch
|
|
83
|
+
* Items render at 2.75rem (44px) square via `--kj-pagination-item-size` —
|
|
84
|
+
* meets WCAG 2.5.5 by default. `kjSize="sm"` drops to 32px and relies on
|
|
85
|
+
* the inline-text-link exception; reserve for dense desktop tables.
|
|
86
|
+
*
|
|
87
|
+
* @doc-a11y
|
|
88
|
+
* The compound emits real `<button>` elements so native focus and click
|
|
89
|
+
* semantics are preserved. The ellipsis indicator is `aria-hidden` with a
|
|
90
|
+
* visually-hidden "More pages" label appended at render time. Boundary
|
|
91
|
+
* buttons reflect their disabled state via `aria-disabled` rather than
|
|
92
|
+
* `disabled` so they remain focusable (and announce a reason).
|
|
93
|
+
*
|
|
94
|
+
* @doc-related table,list,carousel
|
|
95
|
+
*
|
|
96
|
+
* @doc-css-var
|
|
97
|
+
* --kj-pagination-gap — Gap between adjacent page items and boundary controls.
|
|
98
|
+
* --kj-pagination-item-size — Min width/height of each item. 2.75rem for WCAG 2.5.5.
|
|
99
|
+
* --kj-pagination-item-radius — Corner radius for items and boundary buttons.
|
|
100
|
+
* --kj-pagination-item-bg — Item background fill. Variants override.
|
|
101
|
+
* --kj-pagination-item-bg-hover — Item hover background fill.
|
|
102
|
+
* --kj-pagination-item-bg-current — Background fill on the active page.
|
|
103
|
+
* --kj-pagination-item-fg — Item foreground (label) color.
|
|
104
|
+
* --kj-pagination-item-fg-current — Label color on the active page.
|
|
105
|
+
* --kj-pagination-item-border-color — Item border color. Variants override.
|
|
106
|
+
* --kj-pagination-item-border-width — Item border thickness. Inherits --kj-border.
|
|
107
|
+
* --kj-pagination-item-font — Item font family. Defaults to --kj-font-sans.
|
|
108
|
+
* --kj-pagination-item-font-size — Item font size. Sizes override.
|
|
109
|
+
* --kj-pagination-ellipsis-color — Color of the ellipsis gap glyph.
|
|
110
|
+
* --kj-pagination-info-color — Color of the trailing "Page N of M" info text.
|
|
111
|
+
*
|
|
112
|
+
* @doc-category Library/Navigation
|
|
113
|
+
* @doc
|
|
114
|
+
* @doc-name pagination
|
|
115
|
+
* @doc-description Themed pagination control with ellipsis windowing, accessible nav, and two-way page binding.
|
|
116
|
+
* @doc-is-main
|
|
117
|
+
*/
|
|
118
|
+
@Component({
|
|
119
|
+
selector: 'kj-pagination',
|
|
120
|
+
standalone: true,
|
|
121
|
+
hostDirectives: [
|
|
122
|
+
{
|
|
123
|
+
directive: KjPagination,
|
|
124
|
+
inputs: [
|
|
125
|
+
'kjPage',
|
|
126
|
+
'kjTotalPages',
|
|
127
|
+
'kjSiblingCount',
|
|
128
|
+
'kjBoundaryCount',
|
|
129
|
+
'kjVariant',
|
|
130
|
+
'kjSize',
|
|
131
|
+
],
|
|
132
|
+
outputs: ['kjPageChange'],
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
template: `<ng-content />`,
|
|
136
|
+
styleUrl: './pagination.css',
|
|
137
|
+
encapsulation: ViewEncapsulation.None,
|
|
138
|
+
host: { class: 'kj-pagination' },
|
|
139
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
140
|
+
})
|
|
141
|
+
export class KjPaginationComponent {}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Per-page button within a `<kj-pagination>`. Wraps `KjPaginationItem` and
|
|
145
|
+
* forwards the required `kjPage` plus optional `kjDisabled` / `kjVariant` /
|
|
146
|
+
* `kjSize` inputs. Reflects `aria-current="page"` on the active page.
|
|
147
|
+
*
|
|
148
|
+
* @doc-category Library/Navigation
|
|
149
|
+
* @doc
|
|
150
|
+
* @doc-name pagination
|
|
151
|
+
*/
|
|
152
|
+
@Component({
|
|
153
|
+
selector: 'kj-pagination-item',
|
|
154
|
+
standalone: true,
|
|
155
|
+
imports: [KjPaginationItem],
|
|
156
|
+
template: `
|
|
157
|
+
<button
|
|
158
|
+
type="button"
|
|
159
|
+
kjPaginationItem
|
|
160
|
+
class="kj-pagination-item"
|
|
161
|
+
[kjPage]="kjPage()"
|
|
162
|
+
[kjDisabled]="kjDisabled()"
|
|
163
|
+
[kjVariant]="kjVariant()"
|
|
164
|
+
[kjSize]="kjSize()"
|
|
165
|
+
>
|
|
166
|
+
<ng-content />
|
|
167
|
+
</button>
|
|
168
|
+
`,
|
|
169
|
+
encapsulation: ViewEncapsulation.None,
|
|
170
|
+
host: { style: 'display: contents;' },
|
|
171
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
172
|
+
})
|
|
173
|
+
export class KjPaginationItemComponent {
|
|
174
|
+
/** Page number this item navigates to (1-indexed). Required. */
|
|
175
|
+
readonly kjPage = input.required<number>();
|
|
176
|
+
/** Per-item disabled state. Suppresses click and reflects `aria-disabled`. */
|
|
177
|
+
readonly kjDisabled = input<boolean>(false);
|
|
178
|
+
readonly kjVariant = input<string | undefined>(undefined);
|
|
179
|
+
readonly kjSize = input<string | undefined>(undefined);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Boundary control that retreats one page. Disabled (via `aria-disabled`)
|
|
184
|
+
* when the parent is on page 1 or the dataset is empty.
|
|
185
|
+
*
|
|
186
|
+
* @doc-category Library/Navigation
|
|
187
|
+
* @doc
|
|
188
|
+
* @doc-name pagination
|
|
189
|
+
*/
|
|
190
|
+
@Component({
|
|
191
|
+
selector: 'kj-pagination-previous',
|
|
192
|
+
standalone: true,
|
|
193
|
+
imports: [KjPaginationPrevious],
|
|
194
|
+
template: `
|
|
195
|
+
<button
|
|
196
|
+
type="button"
|
|
197
|
+
kjPaginationPrevious
|
|
198
|
+
class="kj-pagination-action kj-pagination-action--previous"
|
|
199
|
+
[kjVariant]="kjVariant()"
|
|
200
|
+
[kjSize]="kjSize()"
|
|
201
|
+
>
|
|
202
|
+
<ng-content />
|
|
203
|
+
</button>
|
|
204
|
+
`,
|
|
205
|
+
encapsulation: ViewEncapsulation.None,
|
|
206
|
+
host: { style: 'display: contents;' },
|
|
207
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
208
|
+
})
|
|
209
|
+
export class KjPaginationPreviousComponent {
|
|
210
|
+
readonly kjVariant = input<string | undefined>(undefined);
|
|
211
|
+
readonly kjSize = input<string | undefined>(undefined);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Boundary control that advances one page. Disabled when the parent is on
|
|
216
|
+
* the last page or the dataset is empty.
|
|
217
|
+
*
|
|
218
|
+
* @doc-category Library/Navigation
|
|
219
|
+
* @doc
|
|
220
|
+
* @doc-name pagination
|
|
221
|
+
*/
|
|
222
|
+
@Component({
|
|
223
|
+
selector: 'kj-pagination-next',
|
|
224
|
+
standalone: true,
|
|
225
|
+
imports: [KjPaginationNext],
|
|
226
|
+
template: `
|
|
227
|
+
<button
|
|
228
|
+
type="button"
|
|
229
|
+
kjPaginationNext
|
|
230
|
+
class="kj-pagination-action kj-pagination-action--next"
|
|
231
|
+
[kjVariant]="kjVariant()"
|
|
232
|
+
[kjSize]="kjSize()"
|
|
233
|
+
>
|
|
234
|
+
<ng-content />
|
|
235
|
+
</button>
|
|
236
|
+
`,
|
|
237
|
+
encapsulation: ViewEncapsulation.None,
|
|
238
|
+
host: { style: 'display: contents;' },
|
|
239
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
240
|
+
})
|
|
241
|
+
export class KjPaginationNextComponent {
|
|
242
|
+
readonly kjVariant = input<string | undefined>(undefined);
|
|
243
|
+
readonly kjSize = input<string | undefined>(undefined);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Boundary control that jumps to page 1. Disabled when already on the
|
|
248
|
+
* first page or the dataset is empty.
|
|
249
|
+
*
|
|
250
|
+
* @doc-category Library/Navigation
|
|
251
|
+
* @doc
|
|
252
|
+
* @doc-name pagination
|
|
253
|
+
*/
|
|
254
|
+
@Component({
|
|
255
|
+
selector: 'kj-pagination-first',
|
|
256
|
+
standalone: true,
|
|
257
|
+
imports: [KjPaginationFirst],
|
|
258
|
+
template: `
|
|
259
|
+
<button
|
|
260
|
+
type="button"
|
|
261
|
+
kjPaginationFirst
|
|
262
|
+
class="kj-pagination-action kj-pagination-action--first"
|
|
263
|
+
[kjVariant]="kjVariant()"
|
|
264
|
+
[kjSize]="kjSize()"
|
|
265
|
+
>
|
|
266
|
+
<ng-content />
|
|
267
|
+
</button>
|
|
268
|
+
`,
|
|
269
|
+
encapsulation: ViewEncapsulation.None,
|
|
270
|
+
host: { style: 'display: contents;' },
|
|
271
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
272
|
+
})
|
|
273
|
+
export class KjPaginationFirstComponent {
|
|
274
|
+
readonly kjVariant = input<string | undefined>(undefined);
|
|
275
|
+
readonly kjSize = input<string | undefined>(undefined);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Boundary control that jumps to the last page. Disabled when already on
|
|
280
|
+
* the last page or the dataset is empty.
|
|
281
|
+
*
|
|
282
|
+
* @doc-category Library/Navigation
|
|
283
|
+
* @doc
|
|
284
|
+
* @doc-name pagination
|
|
285
|
+
*/
|
|
286
|
+
@Component({
|
|
287
|
+
selector: 'kj-pagination-last',
|
|
288
|
+
standalone: true,
|
|
289
|
+
imports: [KjPaginationLast],
|
|
290
|
+
template: `
|
|
291
|
+
<button
|
|
292
|
+
type="button"
|
|
293
|
+
kjPaginationLast
|
|
294
|
+
class="kj-pagination-action kj-pagination-action--last"
|
|
295
|
+
[kjVariant]="kjVariant()"
|
|
296
|
+
[kjSize]="kjSize()"
|
|
297
|
+
>
|
|
298
|
+
<ng-content />
|
|
299
|
+
</button>
|
|
300
|
+
`,
|
|
301
|
+
encapsulation: ViewEncapsulation.None,
|
|
302
|
+
host: { style: 'display: contents;' },
|
|
303
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
304
|
+
})
|
|
305
|
+
export class KjPaginationLastComponent {
|
|
306
|
+
readonly kjVariant = input<string | undefined>(undefined);
|
|
307
|
+
readonly kjSize = input<string | undefined>(undefined);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Gap indicator within a `<kj-pagination>`. Wraps `KjPaginationEllipsis`;
|
|
312
|
+
* the visible glyph is decorative, an AT-readable visually-hidden label
|
|
313
|
+
* ("More pages") is appended at render time.
|
|
314
|
+
*
|
|
315
|
+
* @doc-category Library/Navigation
|
|
316
|
+
* @doc
|
|
317
|
+
* @doc-name pagination
|
|
318
|
+
*/
|
|
319
|
+
@Component({
|
|
320
|
+
selector: 'kj-pagination-ellipsis',
|
|
321
|
+
standalone: true,
|
|
322
|
+
hostDirectives: [KjPaginationEllipsis],
|
|
323
|
+
template: `<ng-content />`,
|
|
324
|
+
encapsulation: ViewEncapsulation.None,
|
|
325
|
+
host: { class: 'kj-pagination-ellipsis' },
|
|
326
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
327
|
+
})
|
|
328
|
+
export class KjPaginationEllipsisComponent {}
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Renders the localised "Page N of M" status text for a `<kj-pagination>`.
|
|
332
|
+
* Wraps `KjPaginationInfo`; when the consumer projects their own content
|
|
333
|
+
* the directive yields and the projection wins.
|
|
334
|
+
*
|
|
335
|
+
* @doc-category Library/Navigation
|
|
336
|
+
* @doc
|
|
337
|
+
* @doc-name pagination
|
|
338
|
+
*/
|
|
339
|
+
@Component({
|
|
340
|
+
selector: 'kj-pagination-info',
|
|
341
|
+
standalone: true,
|
|
342
|
+
hostDirectives: [KjPaginationInfo],
|
|
343
|
+
template: `<ng-content />`,
|
|
344
|
+
encapsulation: ViewEncapsulation.None,
|
|
345
|
+
host: { class: 'kj-pagination-info' },
|
|
346
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
347
|
+
})
|
|
348
|
+
export class KjPaginationInfoComponent {}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Convenience wrapper that auto-renders the canonical pagination layout
|
|
352
|
+
* (Previous, First, page tokens with ellipsis, Last, Next) given just
|
|
353
|
+
* `kjPage` + `kjTotalPages`. Use this for the 80% case where the consumer
|
|
354
|
+
* does not need to hand-author the layout.
|
|
355
|
+
*
|
|
356
|
+
* Drop down to the compound (`<kj-pagination>` + child wrappers + `@for`)
|
|
357
|
+
* when more control is required.
|
|
358
|
+
*
|
|
359
|
+
* @example
|
|
360
|
+
* ```html
|
|
361
|
+
* <kj-pagination-default [(kjPage)]="page" [kjTotalPages]="10" />
|
|
362
|
+
* ```
|
|
363
|
+
*
|
|
364
|
+
* @doc-category Library/Navigation
|
|
365
|
+
* @doc
|
|
366
|
+
* @doc-name pagination
|
|
367
|
+
*/
|
|
368
|
+
@Component({
|
|
369
|
+
selector: 'kj-pagination-default',
|
|
370
|
+
standalone: true,
|
|
371
|
+
imports: [
|
|
372
|
+
KjPaginationComponent,
|
|
373
|
+
KjPaginationItemComponent,
|
|
374
|
+
KjPaginationPreviousComponent,
|
|
375
|
+
KjPaginationNextComponent,
|
|
376
|
+
KjPaginationFirstComponent,
|
|
377
|
+
KjPaginationLastComponent,
|
|
378
|
+
KjPaginationEllipsisComponent,
|
|
379
|
+
KjPaginationInfoComponent,
|
|
380
|
+
KjIconDirective,
|
|
381
|
+
],
|
|
382
|
+
template: `
|
|
383
|
+
<kj-pagination
|
|
384
|
+
[(kjPage)]="kjPage"
|
|
385
|
+
[kjTotalPages]="kjTotalPages()"
|
|
386
|
+
[kjSiblingCount]="kjSiblingCount()"
|
|
387
|
+
[kjBoundaryCount]="kjBoundaryCount()"
|
|
388
|
+
[kjVariant]="kjVariant()"
|
|
389
|
+
[kjSize]="kjSize()"
|
|
390
|
+
#p="kjPagination"
|
|
391
|
+
>
|
|
392
|
+
@if (kjShowFirstLast()) {
|
|
393
|
+
<kj-pagination-first>«</kj-pagination-first>
|
|
394
|
+
}
|
|
395
|
+
<kj-pagination-previous>‹</kj-pagination-previous>
|
|
396
|
+
@for (token of p.pages(); track token) {
|
|
397
|
+
@if (token === 'ellipsis-left' || token === 'ellipsis-right') {
|
|
398
|
+
<kj-pagination-ellipsis>…</kj-pagination-ellipsis>
|
|
399
|
+
} @else {
|
|
400
|
+
<kj-pagination-item [kjPage]="token">{{ token }}</kj-pagination-item>
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
<kj-pagination-next><i kjIcon="chevron-right"></i></kj-pagination-next>
|
|
404
|
+
@if (kjShowFirstLast()) {
|
|
405
|
+
<kj-pagination-last>»</kj-pagination-last>
|
|
406
|
+
}
|
|
407
|
+
@if (kjShowInfo()) {
|
|
408
|
+
<kj-pagination-info />
|
|
409
|
+
}
|
|
410
|
+
</kj-pagination>
|
|
411
|
+
`,
|
|
412
|
+
encapsulation: ViewEncapsulation.None,
|
|
413
|
+
host: { style: 'display: contents;' },
|
|
414
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
415
|
+
})
|
|
416
|
+
export class KjPaginationDefaultComponent {
|
|
417
|
+
/**
|
|
418
|
+
* Current page (1-indexed). Two-way bound.
|
|
419
|
+
* Field annotation matches the directive's so ng-packagr does not narrow
|
|
420
|
+
* the model signal and break the `[(kjPage)]` binding through the wrapper.
|
|
421
|
+
*/
|
|
422
|
+
readonly kjPage: ModelSignal<number> = model<number>(1);
|
|
423
|
+
readonly kjTotalPages = input.required<number>();
|
|
424
|
+
readonly kjSiblingCount = input<number>(1);
|
|
425
|
+
readonly kjBoundaryCount = input<number>(1);
|
|
426
|
+
readonly kjVariant = input<string>('default');
|
|
427
|
+
readonly kjSize = input<string>('md');
|
|
428
|
+
/** Render the First / Last boundary buttons. Default `true`. */
|
|
429
|
+
readonly kjShowFirstLast = input<boolean>(true);
|
|
430
|
+
/** Render the trailing "Page N of M" info span. Default `false`. */
|
|
431
|
+
readonly kjShowInfo = input<boolean>(false);
|
|
432
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Component, signal, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
+
import { KjPaginationDefaultComponent } from './pagination';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A walkthrough of the most common pagination usages — the
|
|
6
|
+
* `<kj-pagination-default>` convenience wrapper with a small dataset, a
|
|
7
|
+
* larger one that exposes ellipsis windowing, and a layout that surfaces the
|
|
8
|
+
* trailing "Page N of M" info text.
|
|
9
|
+
*/
|
|
10
|
+
@Component({
|
|
11
|
+
selector: 'kj-pagination-usage-example',
|
|
12
|
+
standalone: true,
|
|
13
|
+
imports: [KjPaginationDefaultComponent],
|
|
14
|
+
styles: [
|
|
15
|
+
`
|
|
16
|
+
:host {
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
gap: var(--kj-space-lg);
|
|
20
|
+
}
|
|
21
|
+
.label {
|
|
22
|
+
font-size: 0.75rem;
|
|
23
|
+
color: var(--kj-fg-default);
|
|
24
|
+
opacity: 0.7;
|
|
25
|
+
text-transform: uppercase;
|
|
26
|
+
letter-spacing: 0.04em;
|
|
27
|
+
}
|
|
28
|
+
`,
|
|
29
|
+
],
|
|
30
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
31
|
+
template: `
|
|
32
|
+
<div>
|
|
33
|
+
<span class="label">Compact (5 pages)</span>
|
|
34
|
+
<kj-pagination-default [(kjPage)]="pageA" [kjTotalPages]="5" />
|
|
35
|
+
</div>
|
|
36
|
+
<div>
|
|
37
|
+
<span class="label">Large (20 pages)</span>
|
|
38
|
+
<kj-pagination-default [(kjPage)]="pageB" [kjTotalPages]="20" />
|
|
39
|
+
</div>
|
|
40
|
+
<div>
|
|
41
|
+
<span class="label">With info</span>
|
|
42
|
+
<kj-pagination-default [(kjPage)]="pageC" [kjTotalPages]="10" [kjShowInfo]="true" />
|
|
43
|
+
</div>
|
|
44
|
+
`,
|
|
45
|
+
})
|
|
46
|
+
export class KjPaginationUsageExample {
|
|
47
|
+
readonly pageA = signal(1);
|
|
48
|
+
readonly pageB = signal(7);
|
|
49
|
+
readonly pageC = signal(3);
|
|
50
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// AUTO-GENERATED by scripts/migrate-examples.mjs
|
|
2
|
+
// One barrel per component folder — used by the docs app as a lazy chunk.
|
|
3
|
+
export { KjPasswordInputExample } from './password-input.example';
|
|
4
|
+
export { KjPasswordInputStrengthExample } from './password-input.strength.example';
|
|
5
|
+
export { KjPasswordInputToggleExample } from './password-input.toggle.example';
|
|
6
|
+
export { KjPasswordInputWithRulesExample } from './password-input.with-rules.example';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
+
import { KjPasswordInputComponent } from '../password-input';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Default usage example for KjPasswordInputComponent.
|
|
6
|
+
* Login-form shape: type="password", show/hide toggle, no meter, no Caps Lock warning.
|
|
7
|
+
*/
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'kj-password-input-example',
|
|
10
|
+
standalone: true,
|
|
11
|
+
imports: [KjPasswordInputComponent],
|
|
12
|
+
styles: [
|
|
13
|
+
`
|
|
14
|
+
:host {
|
|
15
|
+
display: block;
|
|
16
|
+
}
|
|
17
|
+
`,
|
|
18
|
+
],
|
|
19
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
20
|
+
template: `
|
|
21
|
+
<kj-password-input kjAutocomplete="current-password" kjPlaceholder="Enter your password" />
|
|
22
|
+
`,
|
|
23
|
+
})
|
|
24
|
+
export class KjPasswordInputExample {}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Component, signal, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
+
import { KjPasswordInputComponent } from '../password-input';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Strength meter example. `kjShowStrength` enables the four-segment bar; the
|
|
6
|
+
* built-in heuristic scorer drives it. Use `[kjStrengthScorer]` on the
|
|
7
|
+
* directive (core API) to swap in `zxcvbn` or a server-side checker.
|
|
8
|
+
*/
|
|
9
|
+
@Component({
|
|
10
|
+
selector: 'kj-password-input-strength-example',
|
|
11
|
+
standalone: true,
|
|
12
|
+
imports: [KjPasswordInputComponent],
|
|
13
|
+
styles: [
|
|
14
|
+
`
|
|
15
|
+
:host {
|
|
16
|
+
display: block;
|
|
17
|
+
}
|
|
18
|
+
.row {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
gap: var(--kj-space-sm);
|
|
22
|
+
max-width: 360px;
|
|
23
|
+
}
|
|
24
|
+
label {
|
|
25
|
+
font-size: var(--kj-text-xs);
|
|
26
|
+
color: var(--kj-fg-muted);
|
|
27
|
+
}
|
|
28
|
+
`,
|
|
29
|
+
],
|
|
30
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
31
|
+
template: `
|
|
32
|
+
<div class="row">
|
|
33
|
+
<label for="signup-pw">Choose a password</label>
|
|
34
|
+
<kj-password-input
|
|
35
|
+
kjAutocomplete="new-password"
|
|
36
|
+
kjPlaceholder="Mix letters, numbers, symbols"
|
|
37
|
+
[kjShowStrength]="true"
|
|
38
|
+
[(kjValue)]="value"
|
|
39
|
+
/>
|
|
40
|
+
</div>
|
|
41
|
+
`,
|
|
42
|
+
})
|
|
43
|
+
export class KjPasswordInputStrengthExample {
|
|
44
|
+
readonly value = signal('');
|
|
45
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Component, signal, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
+
import { KjPasswordInputComponent } from '../password-input';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Show / hide toggle example. The toggle is on by default; the example wires
|
|
6
|
+
* a two-way `[(kjRevealed)]` so the parent component can inspect the state.
|
|
7
|
+
*/
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'kj-password-input-toggle-example',
|
|
10
|
+
standalone: true,
|
|
11
|
+
imports: [KjPasswordInputComponent],
|
|
12
|
+
styles: [
|
|
13
|
+
`
|
|
14
|
+
:host {
|
|
15
|
+
display: block;
|
|
16
|
+
}
|
|
17
|
+
.row {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
gap: var(--kj-space-sm);
|
|
21
|
+
max-width: 360px;
|
|
22
|
+
}
|
|
23
|
+
.state {
|
|
24
|
+
font-size: var(--kj-text-xs);
|
|
25
|
+
color: var(--kj-fg-muted);
|
|
26
|
+
}
|
|
27
|
+
`,
|
|
28
|
+
],
|
|
29
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
30
|
+
template: `
|
|
31
|
+
<div class="row">
|
|
32
|
+
<kj-password-input
|
|
33
|
+
kjAutocomplete="current-password"
|
|
34
|
+
kjPlaceholder="Click the eye to reveal"
|
|
35
|
+
[(kjRevealed)]="revealed"
|
|
36
|
+
/>
|
|
37
|
+
<span class="state">revealed: {{ revealed() }}</span>
|
|
38
|
+
</div>
|
|
39
|
+
`,
|
|
40
|
+
})
|
|
41
|
+
export class KjPasswordInputToggleExample {
|
|
42
|
+
readonly revealed = signal(false);
|
|
43
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Component, computed, signal, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
+
import { KjPasswordInputComponent } from '../password-input';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Validation-rules display example. Renders a checklist of policy rules
|
|
6
|
+
* alongside the password input; each rule flips green when satisfied. The
|
|
7
|
+
* strength meter and Caps Lock warning are both on so the example shows the
|
|
8
|
+
* full sign-up shape.
|
|
9
|
+
*/
|
|
10
|
+
@Component({
|
|
11
|
+
selector: 'kj-password-input-with-rules-example',
|
|
12
|
+
standalone: true,
|
|
13
|
+
imports: [KjPasswordInputComponent],
|
|
14
|
+
styles: [
|
|
15
|
+
`
|
|
16
|
+
:host {
|
|
17
|
+
display: block;
|
|
18
|
+
}
|
|
19
|
+
.row {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
gap: var(--kj-space-sm);
|
|
23
|
+
max-width: 380px;
|
|
24
|
+
}
|
|
25
|
+
label {
|
|
26
|
+
font-size: var(--kj-text-xs);
|
|
27
|
+
color: var(--kj-fg-muted);
|
|
28
|
+
}
|
|
29
|
+
.rules {
|
|
30
|
+
list-style: none;
|
|
31
|
+
padding: 0;
|
|
32
|
+
margin: var(--kj-space-xs) 0 0;
|
|
33
|
+
display: grid;
|
|
34
|
+
gap: 0.25rem;
|
|
35
|
+
font-size: var(--kj-text-xs);
|
|
36
|
+
}
|
|
37
|
+
.rules li {
|
|
38
|
+
color: var(--kj-fg-muted);
|
|
39
|
+
}
|
|
40
|
+
.rules li[data-pass='true'] {
|
|
41
|
+
color: var(--kj-fg-success, #059669);
|
|
42
|
+
}
|
|
43
|
+
.rules li::before {
|
|
44
|
+
content: '○ ';
|
|
45
|
+
}
|
|
46
|
+
.rules li[data-pass='true']::before {
|
|
47
|
+
content: '✓ ';
|
|
48
|
+
}
|
|
49
|
+
`,
|
|
50
|
+
],
|
|
51
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
52
|
+
template: `
|
|
53
|
+
<div class="row">
|
|
54
|
+
<label for="signup-pw">Create a password</label>
|
|
55
|
+
<kj-password-input
|
|
56
|
+
kjAutocomplete="new-password"
|
|
57
|
+
kjPlaceholder="At least 8 characters"
|
|
58
|
+
[kjShowStrength]="true"
|
|
59
|
+
[kjShowCapsLockWarning]="true"
|
|
60
|
+
[(kjValue)]="value"
|
|
61
|
+
/>
|
|
62
|
+
|
|
63
|
+
<ul class="rules" aria-label="Password requirements">
|
|
64
|
+
<li [attr.data-pass]="hasMinLength()">8+ characters</li>
|
|
65
|
+
<li [attr.data-pass]="hasUpper()">An uppercase letter</li>
|
|
66
|
+
<li [attr.data-pass]="hasNumber()">A number</li>
|
|
67
|
+
<li [attr.data-pass]="hasSymbol()">A symbol</li>
|
|
68
|
+
</ul>
|
|
69
|
+
</div>
|
|
70
|
+
`,
|
|
71
|
+
})
|
|
72
|
+
export class KjPasswordInputWithRulesExample {
|
|
73
|
+
readonly value = signal('');
|
|
74
|
+
readonly hasMinLength = computed(() => this.value().length >= 8);
|
|
75
|
+
readonly hasUpper = computed(() => /[A-Z]/.test(this.value()));
|
|
76
|
+
readonly hasNumber = computed(() => /\d/.test(this.value()));
|
|
77
|
+
readonly hasSymbol = computed(() => /[^a-zA-Z0-9]/.test(this.value()));
|
|
78
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './password-input';
|