@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
package/src/tabs/tabs.ts
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
ViewEncapsulation,
|
|
5
|
+
inject,
|
|
6
|
+
input,
|
|
7
|
+
} from '@angular/core';
|
|
8
|
+
import { KjTabs, KjTabList, KjTab, KjTabPanel } from '@kouji-ui/core';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Styled wrapper around the headless `KjTabs` directive — root of the tabs
|
|
12
|
+
* compound. Re-maps the `kjValue`/`kjOrientation`/`kjActivationMode` inputs to
|
|
13
|
+
* terse public names and reflects them as `data-*` attributes for CSS chrome.
|
|
14
|
+
*
|
|
15
|
+
* Compose the four wrappers — `<kj-tabs>`, `<kj-tab-list>`, `<kj-tab>`,
|
|
16
|
+
* `<kj-tab-panel>` — to mirror the four-directive shape. The wiring between
|
|
17
|
+
* a tab and its panel is by string `value`, not by parent-child structure.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```html
|
|
21
|
+
* <kj-tabs [(value)]="active">
|
|
22
|
+
* <kj-tab-list>
|
|
23
|
+
* <kj-tab value="overview">Overview</kj-tab>
|
|
24
|
+
* <kj-tab value="billing">Billing</kj-tab>
|
|
25
|
+
* </kj-tab-list>
|
|
26
|
+
* <kj-tab-panel value="overview">Overview content.</kj-tab-panel>
|
|
27
|
+
* <kj-tab-panel value="billing">Billing content.</kj-tab-panel>
|
|
28
|
+
* </kj-tabs>
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @doc-keyboard
|
|
32
|
+
* ArrowRight|ArrowLeft — Moves focus between tabs when orientation is "horizontal" (off-axis arrows are swallowed)
|
|
33
|
+
* ArrowDown|ArrowUp — Moves focus between tabs when orientation is "vertical"
|
|
34
|
+
* Home — Moves focus to the first tab
|
|
35
|
+
* End — Moves focus to the last tab
|
|
36
|
+
* Enter|Space — Activates the focused tab (always honoured; required in `activationMode="manual"`)
|
|
37
|
+
* Delete — Fires `kjClose` when the tab has `kjClosable="true"`
|
|
38
|
+
* Tab — Single tab stop: leaves the tablist and moves to the active panel (roving tabindex)
|
|
39
|
+
*
|
|
40
|
+
* @doc-aria
|
|
41
|
+
* role="tablist" — on `<kj-tab-list>`
|
|
42
|
+
* aria-orientation — reflects [orientation] ("horizontal" | "vertical")
|
|
43
|
+
* role="tab" — on each `<kj-tab>` host button
|
|
44
|
+
* aria-selected — "true" on the active tab, "false" otherwise
|
|
45
|
+
* aria-controls — links each tab to the id of its panel
|
|
46
|
+
* aria-disabled — set to "true" when [disabled] is true on a tab
|
|
47
|
+
* role="tabpanel" — on each `<kj-tab-panel>`
|
|
48
|
+
* aria-labelledby — links each panel to the id of its tab
|
|
49
|
+
* hidden — set on inactive panels (toggled, not destroyed, after first mount)
|
|
50
|
+
* data-state — "active" | "inactive" mirror for CSS targeting
|
|
51
|
+
*
|
|
52
|
+
* @doc-touch
|
|
53
|
+
* Default tab padding produces a ~32–36px hit area. For touch-first layouts, increase tab padding to reach 44px or pair tabs with a larger pill variant — the WCAG 2.5.5 "inline" exception applies when tabs sit inside a horizontal navigation strip with labels.
|
|
54
|
+
*
|
|
55
|
+
* @doc-a11y
|
|
56
|
+
* Implements the WAI-ARIA Tabs APG pattern. Roving tabindex via
|
|
57
|
+
* `KjRovingTabindex` keeps the tablist as a single Tab stop; arrow keys move
|
|
58
|
+
* focus among tabs. `activationMode="automatic"` (default) activates the tab
|
|
59
|
+
* as focus lands on it; `activationMode="manual"` separates focus from
|
|
60
|
+
* activation so screen reader users can browse tab labels before committing
|
|
61
|
+
* to a panel. Panels use a lazy-then-persistent mount: content is created on
|
|
62
|
+
* first activation and kept thereafter (only `hidden` toggles), preserving
|
|
63
|
+
* form state and aria live regions across tab switches.
|
|
64
|
+
*
|
|
65
|
+
* @doc-related tab-list,segmented,stepper
|
|
66
|
+
*
|
|
67
|
+
* @doc-example Default
|
|
68
|
+
* The default playground — three tabs, automatic activation, horizontal.
|
|
69
|
+
* @doc-file tabs.example.ts
|
|
70
|
+
* @doc-example Usage
|
|
71
|
+
* A walkthrough of the most common tabs usages — controlled value, default
|
|
72
|
+
* active, disabled tab, and a panel that reads from the active value.
|
|
73
|
+
* @doc-file tabs.usage.example.ts
|
|
74
|
+
* @doc-example Vertical
|
|
75
|
+
* `[orientation]="'vertical'"` stacks the tabs and panels side-by-side.
|
|
76
|
+
* @doc-file tabs.vertical.example.ts
|
|
77
|
+
* @doc-example Manual activation
|
|
78
|
+
* `[activationMode]="'manual'"` separates focus from activation — useful
|
|
79
|
+
* for tabs that swap heavy content.
|
|
80
|
+
* @doc-file tabs.manual-activation.example.ts
|
|
81
|
+
* @doc-example Disabled tab
|
|
82
|
+
* `[disabled]="true"` on a `<kj-tab>` removes it from activation; arrow keys skip it.
|
|
83
|
+
* @doc-file tabs.disabled.example.ts
|
|
84
|
+
* @doc-example Controlled
|
|
85
|
+
* Two-way bind `[(value)]` to drive activation from outside the strip.
|
|
86
|
+
* @doc-file tabs.controlled.example.ts
|
|
87
|
+
* @doc-category Library/Navigation
|
|
88
|
+
* @doc
|
|
89
|
+
* @doc-name tabs
|
|
90
|
+
* @doc-description Themed tab strip with default and pill variants and manual or automatic activation.
|
|
91
|
+
* @doc-is-main
|
|
92
|
+
*/
|
|
93
|
+
@Component({
|
|
94
|
+
selector: 'kj-tabs',
|
|
95
|
+
standalone: true,
|
|
96
|
+
hostDirectives: [
|
|
97
|
+
{
|
|
98
|
+
directive: KjTabs,
|
|
99
|
+
inputs: [
|
|
100
|
+
'kjValue: value',
|
|
101
|
+
'kjOrientation: orientation',
|
|
102
|
+
'kjActivationMode: activationMode',
|
|
103
|
+
],
|
|
104
|
+
outputs: ['kjValueChange: valueChange'],
|
|
105
|
+
},
|
|
106
|
+
],
|
|
107
|
+
template: `<ng-content />`,
|
|
108
|
+
styleUrl: './tabs.css',
|
|
109
|
+
encapsulation: ViewEncapsulation.None,
|
|
110
|
+
host: {
|
|
111
|
+
class: 'kj-tabs',
|
|
112
|
+
'[attr.data-variant]': 'variant()',
|
|
113
|
+
},
|
|
114
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
115
|
+
})
|
|
116
|
+
export class KjTabsComponent {
|
|
117
|
+
/** Visual chrome for the tab strip. Reflected as `data-variant` on the host. */
|
|
118
|
+
readonly variant = input<'default' | 'pills'>('default');
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Styled wrapper around `KjTabList`. Hosts `role="tablist"` (provided by the
|
|
123
|
+
* underlying directive) and the roving-tabindex behaviour. Place inside a
|
|
124
|
+
* `<kj-tabs>` and project `<kj-tab>` children.
|
|
125
|
+
*
|
|
126
|
+
* @doc-category Library/Navigation
|
|
127
|
+
* @doc
|
|
128
|
+
* @doc-name tabs
|
|
129
|
+
*/
|
|
130
|
+
@Component({
|
|
131
|
+
selector: 'kj-tab-list',
|
|
132
|
+
standalone: true,
|
|
133
|
+
hostDirectives: [KjTabList],
|
|
134
|
+
template: `<ng-content />`,
|
|
135
|
+
encapsulation: ViewEncapsulation.None,
|
|
136
|
+
host: { class: 'kj-tab-list' },
|
|
137
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
138
|
+
})
|
|
139
|
+
export class KjTabListComponent {}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Styled wrapper around `KjTab`. Renders a `<button role="tab">` and forwards
|
|
143
|
+
* the required `value` and optional `disabled` inputs to the directive.
|
|
144
|
+
* Project the tab's label as content.
|
|
145
|
+
*
|
|
146
|
+
* @doc-category Library/Navigation
|
|
147
|
+
* @doc
|
|
148
|
+
* @doc-name tabs
|
|
149
|
+
*/
|
|
150
|
+
@Component({
|
|
151
|
+
selector: 'kj-tab',
|
|
152
|
+
standalone: true,
|
|
153
|
+
imports: [KjTab],
|
|
154
|
+
template: `
|
|
155
|
+
<button
|
|
156
|
+
type="button"
|
|
157
|
+
kjTab
|
|
158
|
+
class="kj-tab"
|
|
159
|
+
[kjTabValue]="value()"
|
|
160
|
+
[kjTabDisabled]="disabled()"
|
|
161
|
+
>
|
|
162
|
+
<ng-content />
|
|
163
|
+
</button>
|
|
164
|
+
`,
|
|
165
|
+
encapsulation: ViewEncapsulation.None,
|
|
166
|
+
host: { style: 'display: contents;' },
|
|
167
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
168
|
+
})
|
|
169
|
+
export class KjTabComponent {
|
|
170
|
+
/** String key wiring this tab to the panel of the same `value`. */
|
|
171
|
+
readonly value = input.required<string>();
|
|
172
|
+
/** When true, the tab is announced as disabled and cannot be activated. */
|
|
173
|
+
readonly disabled = input(false);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Styled wrapper around `KjTabPanel`. Renders the panel host with
|
|
178
|
+
* `role="tabpanel"` and the lazy-then-persistent mount posture: projected
|
|
179
|
+
* content is created on first activation and kept thereafter — subsequent
|
|
180
|
+
* deactivations only toggle `hidden`.
|
|
181
|
+
*
|
|
182
|
+
* @doc-category Library/Navigation
|
|
183
|
+
* @doc
|
|
184
|
+
* @doc-name tabs
|
|
185
|
+
*/
|
|
186
|
+
@Component({
|
|
187
|
+
selector: 'kj-tab-panel',
|
|
188
|
+
standalone: true,
|
|
189
|
+
hostDirectives: [{ directive: KjTabPanel, inputs: ['kjPanelValue: value'] }],
|
|
190
|
+
template: `
|
|
191
|
+
@if (panel.mounted()) {
|
|
192
|
+
<ng-content />
|
|
193
|
+
}
|
|
194
|
+
`,
|
|
195
|
+
encapsulation: ViewEncapsulation.None,
|
|
196
|
+
host: { class: 'kj-tab-panel' },
|
|
197
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
198
|
+
})
|
|
199
|
+
export class KjTabPanelComponent {
|
|
200
|
+
// Read the host directive instance from the element injector so the template
|
|
201
|
+
// can gate `<ng-content>` on its `mounted()` signal — implements the
|
|
202
|
+
// lazy-then-persistent mount posture without re-creating it here.
|
|
203
|
+
protected readonly panel = inject(KjTabPanel);
|
|
204
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
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 { KjTagExample } from './tag.example';
|
|
4
|
+
export { KjTagListExample } from './tag.list.example';
|
|
5
|
+
export { KjTagRemovableExample } from './tag.removable.example';
|
|
6
|
+
export { KjTagSelectableExample } from './tag.selectable.example';
|
|
7
|
+
export { KjTagSizesExample } from './tag.sizes.example';
|
|
8
|
+
export { KjTagUsageExample } from './tag.usage.example';
|
|
9
|
+
export { KjTagVariantsExample } from './tag.variants.example';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
+
import { KjTagComponent } from '../tag';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Default usage example for KjTagComponent — a static decorative chip.
|
|
6
|
+
* Visually identical to the matching `<kj-badge>`.
|
|
7
|
+
*/
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'kj-tag-example',
|
|
10
|
+
standalone: true,
|
|
11
|
+
imports: [KjTagComponent],
|
|
12
|
+
styles: [
|
|
13
|
+
`
|
|
14
|
+
:host {
|
|
15
|
+
display: block;
|
|
16
|
+
}
|
|
17
|
+
`,
|
|
18
|
+
],
|
|
19
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
20
|
+
template: `<kj-tag>New</kj-tag>`,
|
|
21
|
+
})
|
|
22
|
+
export class KjTagExample {}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Component, signal, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
+
import { KjTagComponent, KjTagListComponent } from '../tag';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Group of selectable chips inside a `<kj-tag-list kjTagListRole="listbox">`
|
|
6
|
+
* container. The container provides one tab stop, roving arrow-key
|
|
7
|
+
* navigation between chips, and `aria-multiselectable="true"` for the
|
|
8
|
+
* filter-chips pattern.
|
|
9
|
+
*/
|
|
10
|
+
@Component({
|
|
11
|
+
selector: 'kj-tag-list-example',
|
|
12
|
+
standalone: true,
|
|
13
|
+
imports: [KjTagComponent, KjTagListComponent],
|
|
14
|
+
styles: [
|
|
15
|
+
`
|
|
16
|
+
:host {
|
|
17
|
+
display: block;
|
|
18
|
+
}
|
|
19
|
+
`,
|
|
20
|
+
],
|
|
21
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
22
|
+
template: `
|
|
23
|
+
<kj-tag-list kjTagListRole="listbox" [kjTagListMultiple]="true" aria-label="Filter by tag">
|
|
24
|
+
<kj-tag [kjTagSelectable]="true" [(kjTagSelected)]="frontend">Frontend</kj-tag>
|
|
25
|
+
<kj-tag [kjTagSelectable]="true" [(kjTagSelected)]="backend">Backend</kj-tag>
|
|
26
|
+
<kj-tag [kjTagSelectable]="true" [(kjTagSelected)]="mobile">Mobile</kj-tag>
|
|
27
|
+
<kj-tag [kjTagSelectable]="true" [(kjTagSelected)]="devops">DevOps</kj-tag>
|
|
28
|
+
<kj-tag [kjTagSelectable]="true" [(kjTagSelected)]="design">Design</kj-tag>
|
|
29
|
+
</kj-tag-list>
|
|
30
|
+
`,
|
|
31
|
+
})
|
|
32
|
+
export class KjTagListExample {
|
|
33
|
+
protected readonly frontend = signal(true);
|
|
34
|
+
protected readonly backend = signal(false);
|
|
35
|
+
protected readonly mobile = signal(false);
|
|
36
|
+
protected readonly devops = signal(true);
|
|
37
|
+
protected readonly design = signal(false);
|
|
38
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Component, signal, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
+
import { KjTagComponent, KjTagRemoveComponent } from '../tag';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Removable tags. Each chip projects a `<kj-tag-remove>` X button whose
|
|
6
|
+
* `aria-label` is auto-derived from the parent's text content (`"Remove
|
|
7
|
+
* Acme Corp"`). The host's `(kjTagRemoved)` output drops the chip from
|
|
8
|
+
* the controlled signal.
|
|
9
|
+
*/
|
|
10
|
+
@Component({
|
|
11
|
+
selector: 'kj-tag-removable-example',
|
|
12
|
+
standalone: true,
|
|
13
|
+
imports: [KjTagComponent, KjTagRemoveComponent],
|
|
14
|
+
styles: [
|
|
15
|
+
`
|
|
16
|
+
:host {
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-wrap: wrap;
|
|
19
|
+
gap: 0.5rem;
|
|
20
|
+
}
|
|
21
|
+
`,
|
|
22
|
+
],
|
|
23
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
24
|
+
template: `
|
|
25
|
+
@for (tag of tags(); track tag) {
|
|
26
|
+
<kj-tag kjVariant="secondary" (kjTagRemoved)="remove(tag)">
|
|
27
|
+
{{ tag }}
|
|
28
|
+
<kj-tag-remove>×</kj-tag-remove>
|
|
29
|
+
</kj-tag>
|
|
30
|
+
}
|
|
31
|
+
`,
|
|
32
|
+
})
|
|
33
|
+
export class KjTagRemovableExample {
|
|
34
|
+
protected readonly tags = signal(['Acme Corp', 'Globex', 'Initech', 'Umbrella']);
|
|
35
|
+
|
|
36
|
+
protected remove(tag: string): void {
|
|
37
|
+
this.tags.update((list) => list.filter((t) => t !== tag));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Component, signal, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
+
import { KjTagComponent } from '../tag';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Selectable / toggle chips. Each chip is `role="button"` with
|
|
6
|
+
* `aria-pressed` mirrored from the two-way `kjTagSelected` model. Click
|
|
7
|
+
* or press Space / Enter to toggle.
|
|
8
|
+
*/
|
|
9
|
+
@Component({
|
|
10
|
+
selector: 'kj-tag-selectable-example',
|
|
11
|
+
standalone: true,
|
|
12
|
+
imports: [KjTagComponent],
|
|
13
|
+
styles: [
|
|
14
|
+
`
|
|
15
|
+
:host {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-wrap: wrap;
|
|
18
|
+
gap: 0.5rem;
|
|
19
|
+
}
|
|
20
|
+
`,
|
|
21
|
+
],
|
|
22
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
23
|
+
template: `
|
|
24
|
+
<kj-tag [kjTagSelectable]="true" [(kjTagSelected)]="design">Design</kj-tag>
|
|
25
|
+
<kj-tag [kjTagSelectable]="true" [(kjTagSelected)]="engineering">Engineering</kj-tag>
|
|
26
|
+
<kj-tag [kjTagSelectable]="true" [(kjTagSelected)]="research">Research</kj-tag>
|
|
27
|
+
`,
|
|
28
|
+
})
|
|
29
|
+
export class KjTagSelectableExample {
|
|
30
|
+
protected readonly design = signal(true);
|
|
31
|
+
protected readonly engineering = signal(false);
|
|
32
|
+
protected readonly research = signal(false);
|
|
33
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
+
import { KjTagComponent } from '../tag';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'kj-tag-sizes-example',
|
|
6
|
+
standalone: true,
|
|
7
|
+
imports: [KjTagComponent],
|
|
8
|
+
styles: [
|
|
9
|
+
`
|
|
10
|
+
:host {
|
|
11
|
+
display: flex;
|
|
12
|
+
gap: 0.5rem;
|
|
13
|
+
align-items: center;
|
|
14
|
+
}
|
|
15
|
+
`,
|
|
16
|
+
],
|
|
17
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
18
|
+
template: `
|
|
19
|
+
<kj-tag kjSize="xs">Extra small</kj-tag>
|
|
20
|
+
<kj-tag kjSize="sm">Small</kj-tag>
|
|
21
|
+
<kj-tag kjSize="md">Medium</kj-tag>
|
|
22
|
+
<kj-tag kjSize="lg">Large</kj-tag>
|
|
23
|
+
`,
|
|
24
|
+
})
|
|
25
|
+
export class KjTagSizesExample {}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Component, signal, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
+
import { KjTagComponent, KjTagRemoveComponent, KjTagListComponent } from '../tag';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A walkthrough of the most common tag usages — decorative variants, a
|
|
6
|
+
* removable chip with a (kjTagRemoved) handler, a selectable filter pill, and
|
|
7
|
+
* a tag list with arrow-key navigation. Copy-paste starting point.
|
|
8
|
+
*/
|
|
9
|
+
@Component({
|
|
10
|
+
selector: 'kj-tag-usage-example',
|
|
11
|
+
standalone: true,
|
|
12
|
+
imports: [KjTagComponent, KjTagRemoveComponent, KjTagListComponent],
|
|
13
|
+
styles: [
|
|
14
|
+
`
|
|
15
|
+
:host {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
gap: var(--kj-space-md);
|
|
19
|
+
}
|
|
20
|
+
.row {
|
|
21
|
+
display: flex;
|
|
22
|
+
gap: var(--kj-space-sm);
|
|
23
|
+
flex-wrap: wrap;
|
|
24
|
+
align-items: center;
|
|
25
|
+
}
|
|
26
|
+
`,
|
|
27
|
+
],
|
|
28
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
29
|
+
template: `
|
|
30
|
+
<div class="row">
|
|
31
|
+
<kj-tag kjVariant="default">New</kj-tag>
|
|
32
|
+
<kj-tag kjVariant="success">Shipped</kj-tag>
|
|
33
|
+
<kj-tag kjVariant="warning">Pending</kj-tag>
|
|
34
|
+
<kj-tag kjVariant="destructive">Failed</kj-tag>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div class="row">
|
|
38
|
+
@for (t of remaining(); track t) {
|
|
39
|
+
<kj-tag>
|
|
40
|
+
{{ t }}
|
|
41
|
+
<kj-tag-remove (click)="remove(t)">×</kj-tag-remove>
|
|
42
|
+
</kj-tag>
|
|
43
|
+
}
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<kj-tag-list class="row">
|
|
47
|
+
<kj-tag [kjTagSelectable]="true" [(kjTagSelected)]="onlyMine">Only mine</kj-tag>
|
|
48
|
+
<kj-tag [kjTagSelectable]="true" [(kjTagSelected)]="recent">Recent</kj-tag>
|
|
49
|
+
<kj-tag [kjTagSelectable]="true" [(kjTagSelected)]="archived">Archived</kj-tag>
|
|
50
|
+
</kj-tag-list>
|
|
51
|
+
`,
|
|
52
|
+
})
|
|
53
|
+
export class KjTagUsageExample {
|
|
54
|
+
readonly remaining = signal<string[]>(['design', 'engineering', 'launch']);
|
|
55
|
+
readonly onlyMine = signal(false);
|
|
56
|
+
readonly recent = signal(true);
|
|
57
|
+
readonly archived = signal(false);
|
|
58
|
+
|
|
59
|
+
remove(t: string): void {
|
|
60
|
+
this.remaining.update((list) => list.filter((x) => x !== t));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
+
import { KjTagComponent } from '../tag';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'kj-tag-variants-example',
|
|
6
|
+
standalone: true,
|
|
7
|
+
imports: [KjTagComponent],
|
|
8
|
+
styles: [
|
|
9
|
+
`
|
|
10
|
+
:host {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-wrap: wrap;
|
|
13
|
+
gap: 0.5rem;
|
|
14
|
+
}
|
|
15
|
+
`,
|
|
16
|
+
],
|
|
17
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
18
|
+
template: `
|
|
19
|
+
<kj-tag kjVariant="default">Default</kj-tag>
|
|
20
|
+
<kj-tag kjVariant="secondary">Secondary</kj-tag>
|
|
21
|
+
<kj-tag kjVariant="success">Success</kj-tag>
|
|
22
|
+
<kj-tag kjVariant="warning">Warning</kj-tag>
|
|
23
|
+
<kj-tag kjVariant="destructive">Destructive</kj-tag>
|
|
24
|
+
<kj-tag kjVariant="info">Info</kj-tag>
|
|
25
|
+
<kj-tag kjVariant="outline">Outline</kj-tag>
|
|
26
|
+
<kj-tag kjVariant="ghost">Ghost</kj-tag>
|
|
27
|
+
`,
|
|
28
|
+
})
|
|
29
|
+
export class KjTagVariantsExample {}
|
package/src/tag/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tag';
|
package/src/tag/tag.css
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/* ─────────────────────────────────────────────────────────────
|
|
2
|
+
.kj-tag — component-layer tokens + structural CSS
|
|
3
|
+
Mirrors .kj-badge's chrome (rounded pill, density tokens) and
|
|
4
|
+
layers in the interactive states (hover, focus-visible, pressed,
|
|
5
|
+
disabled) that distinguish a tag from a static badge.
|
|
6
|
+
──────────────────────────────────────────────────────────── */
|
|
7
|
+
|
|
8
|
+
@layer kj.component {
|
|
9
|
+
.kj-tag {
|
|
10
|
+
--kj-tag-bg: var(--kj-bg-primary);
|
|
11
|
+
--kj-tag-fg: var(--kj-fg-on-primary);
|
|
12
|
+
--kj-tag-border-color: transparent;
|
|
13
|
+
--kj-tag-radius: var(--kj-radius-selector);
|
|
14
|
+
--kj-tag-padding-x: var(--kj-space-sm);
|
|
15
|
+
--kj-tag-padding-y: 0.125rem;
|
|
16
|
+
--kj-tag-font-size: 0.75rem;
|
|
17
|
+
--kj-tag-gap: 0.25rem;
|
|
18
|
+
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: var(--kj-tag-gap);
|
|
22
|
+
background: var(--kj-tag-bg);
|
|
23
|
+
color: var(--kj-tag-fg);
|
|
24
|
+
border: var(--kj-border) solid var(--kj-tag-border-color);
|
|
25
|
+
border-radius: var(--kj-tag-radius);
|
|
26
|
+
padding: var(--kj-tag-padding-y) var(--kj-tag-padding-x);
|
|
27
|
+
font: var(--kj-tag-font-size) / 1 var(--kj-font-sans);
|
|
28
|
+
font-weight: 500;
|
|
29
|
+
transition: background-color var(--kj-transition),
|
|
30
|
+
color var(--kj-transition),
|
|
31
|
+
border-color var(--kj-transition);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* ── Variants (parity with KjBadge) ──────────────────────────────── */
|
|
35
|
+
.kj-tag[data-variant="secondary"] {
|
|
36
|
+
--kj-tag-bg: var(--kj-bg-field);
|
|
37
|
+
--kj-tag-fg: var(--kj-fg-default);
|
|
38
|
+
}
|
|
39
|
+
.kj-tag[data-variant="destructive"],
|
|
40
|
+
.kj-tag[data-variant="danger"] {
|
|
41
|
+
--kj-tag-bg: var(--kj-bg-danger);
|
|
42
|
+
--kj-tag-fg: var(--kj-fg-on-danger);
|
|
43
|
+
}
|
|
44
|
+
.kj-tag[data-variant="success"] {
|
|
45
|
+
--kj-tag-bg: var(--kj-bg-success, var(--kj-bg-primary));
|
|
46
|
+
--kj-tag-fg: var(--kj-fg-on-success, var(--kj-fg-on-primary));
|
|
47
|
+
}
|
|
48
|
+
.kj-tag[data-variant="warning"] {
|
|
49
|
+
--kj-tag-bg: var(--kj-bg-warning, var(--kj-bg-primary));
|
|
50
|
+
--kj-tag-fg: var(--kj-fg-on-warning, var(--kj-fg-on-primary));
|
|
51
|
+
}
|
|
52
|
+
.kj-tag[data-variant="info"] {
|
|
53
|
+
--kj-tag-bg: var(--kj-bg-info, var(--kj-bg-primary));
|
|
54
|
+
--kj-tag-fg: var(--kj-fg-on-info, var(--kj-fg-on-primary));
|
|
55
|
+
}
|
|
56
|
+
.kj-tag[data-variant="outline"] {
|
|
57
|
+
--kj-tag-bg: transparent;
|
|
58
|
+
--kj-tag-fg: var(--kj-fg-default);
|
|
59
|
+
--kj-tag-border-color: var(--kj-border-default);
|
|
60
|
+
}
|
|
61
|
+
.kj-tag[data-variant="ghost"] {
|
|
62
|
+
--kj-tag-bg: transparent;
|
|
63
|
+
--kj-tag-fg: var(--kj-fg-default);
|
|
64
|
+
--kj-tag-border-color: transparent;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* ── Sizes (strict ladder: xs < sm < default/md < lg) ───────────── */
|
|
68
|
+
.kj-tag[data-size="xs"] {
|
|
69
|
+
--kj-tag-padding-x: 0.1875rem;
|
|
70
|
+
--kj-tag-padding-y: 0.03125rem;
|
|
71
|
+
--kj-tag-font-size: 0.5625rem; /* 9px — dense/meta chips only */
|
|
72
|
+
--kj-tag-gap: 0.125rem;
|
|
73
|
+
}
|
|
74
|
+
.kj-tag[data-size="sm"] {
|
|
75
|
+
--kj-tag-padding-x: 0.375rem;
|
|
76
|
+
--kj-tag-padding-y: 0.125rem;
|
|
77
|
+
--kj-tag-font-size: 0.6875rem; /* 11px — step above xs */
|
|
78
|
+
}
|
|
79
|
+
.kj-tag[data-size="lg"] {
|
|
80
|
+
--kj-tag-padding-x: var(--kj-space-md);
|
|
81
|
+
--kj-tag-font-size: 0.875rem;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* ── Interactive states (selectable / listbox option) ────────────── */
|
|
85
|
+
.kj-tag[role="button"],
|
|
86
|
+
.kj-tag[role="option"] {
|
|
87
|
+
cursor: pointer;
|
|
88
|
+
user-select: none;
|
|
89
|
+
}
|
|
90
|
+
.kj-tag[role="button"]:hover,
|
|
91
|
+
.kj-tag[role="option"]:hover {
|
|
92
|
+
--kj-tag-bg: color-mix(in oklab, var(--kj-tag-bg) 88%, var(--kj-fg-default));
|
|
93
|
+
}
|
|
94
|
+
.kj-tag[aria-pressed="true"],
|
|
95
|
+
.kj-tag[aria-selected="true"],
|
|
96
|
+
.kj-tag[data-selected] {
|
|
97
|
+
--kj-tag-bg: var(--kj-bg-primary);
|
|
98
|
+
--kj-tag-fg: var(--kj-fg-on-primary);
|
|
99
|
+
--kj-tag-border-color: var(--kj-bg-primary);
|
|
100
|
+
}
|
|
101
|
+
.kj-tag[data-focus-visible]:focus,
|
|
102
|
+
.kj-tag:focus-visible {
|
|
103
|
+
outline: 2px solid var(--kj-bg-primary);
|
|
104
|
+
outline-offset: 2px;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* ── Disabled ─────────────────────────────────────────────────────── */
|
|
108
|
+
.kj-tag[aria-disabled="true"],
|
|
109
|
+
.kj-tag[data-disabled] {
|
|
110
|
+
opacity: 0.45;
|
|
111
|
+
cursor: not-allowed;
|
|
112
|
+
pointer-events: none;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* ── Remove button ────────────────────────────────────────────────── */
|
|
116
|
+
.kj-tag-remove {
|
|
117
|
+
display: inline-flex;
|
|
118
|
+
align-items: center;
|
|
119
|
+
justify-content: center;
|
|
120
|
+
width: 1rem;
|
|
121
|
+
height: 1rem;
|
|
122
|
+
margin-inline-start: 0.125rem;
|
|
123
|
+
padding: 0;
|
|
124
|
+
border: none;
|
|
125
|
+
background: transparent;
|
|
126
|
+
color: inherit;
|
|
127
|
+
border-radius: 999px;
|
|
128
|
+
cursor: pointer;
|
|
129
|
+
line-height: 1;
|
|
130
|
+
font: inherit;
|
|
131
|
+
/* Touch-target enlargement (WCAG 2.5.5): visible glyph stays small,
|
|
132
|
+
the hit area grows via a transparent ::after overlay so it does
|
|
133
|
+
not inflate the chip's visible footprint. */
|
|
134
|
+
position: relative;
|
|
135
|
+
}
|
|
136
|
+
.kj-tag-remove::after {
|
|
137
|
+
content: '';
|
|
138
|
+
position: absolute;
|
|
139
|
+
inset: -0.875rem;
|
|
140
|
+
border-radius: inherit;
|
|
141
|
+
}
|
|
142
|
+
.kj-tag-remove:hover {
|
|
143
|
+
background: color-mix(in oklab, currentColor 18%, transparent);
|
|
144
|
+
}
|
|
145
|
+
.kj-tag-remove:focus-visible {
|
|
146
|
+
outline: 2px solid currentColor;
|
|
147
|
+
outline-offset: 2px;
|
|
148
|
+
}
|
|
149
|
+
.kj-tag-remove[aria-disabled="true"] {
|
|
150
|
+
opacity: 0.45;
|
|
151
|
+
cursor: not-allowed;
|
|
152
|
+
pointer-events: none;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/* ── Tag list container ───────────────────────────────────────────── */
|
|
156
|
+
.kj-tag-list {
|
|
157
|
+
display: inline-flex;
|
|
158
|
+
flex-wrap: wrap;
|
|
159
|
+
gap: var(--kj-space-sm);
|
|
160
|
+
align-items: center;
|
|
161
|
+
}
|
|
162
|
+
.kj-tag-list[role="listbox"]:focus-visible,
|
|
163
|
+
.kj-tag-list[role="grid"]:focus-visible {
|
|
164
|
+
outline: 2px solid var(--kj-bg-primary);
|
|
165
|
+
outline-offset: 2px;
|
|
166
|
+
}
|
|
167
|
+
}
|