@verdify/ui 0.1.0
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/LICENSE +12 -0
- package/README.md +117 -0
- package/dist/components/accordion/accordion.d.ts +66 -0
- package/dist/components/accordion/accordion.d.ts.map +1 -0
- package/dist/components/accordion/accordion.js +97 -0
- package/dist/components/accordion/accordion.js.map +1 -0
- package/dist/components/accordion/accordion.variants.d.ts +9 -0
- package/dist/components/accordion/accordion.variants.d.ts.map +1 -0
- package/dist/components/accordion/accordion.variants.js +54 -0
- package/dist/components/accordion/accordion.variants.js.map +1 -0
- package/dist/components/accordion/index.d.ts +3 -0
- package/dist/components/accordion/index.d.ts.map +1 -0
- package/dist/components/accordion/index.js +25 -0
- package/dist/components/accordion/index.js.map +1 -0
- package/dist/components/agent-badge/agent-badge.d.ts +56 -0
- package/dist/components/agent-badge/agent-badge.d.ts.map +1 -0
- package/dist/components/agent-badge/agent-badge.js +35 -0
- package/dist/components/agent-badge/agent-badge.js.map +1 -0
- package/dist/components/agent-badge/agent-badge.variants.d.ts +7 -0
- package/dist/components/agent-badge/agent-badge.variants.d.ts.map +1 -0
- package/dist/components/agent-badge/agent-badge.variants.js +35 -0
- package/dist/components/agent-badge/agent-badge.variants.js.map +1 -0
- package/dist/components/agent-badge/index.d.ts +3 -0
- package/dist/components/agent-badge/index.d.ts.map +1 -0
- package/dist/components/agent-badge/index.js +11 -0
- package/dist/components/agent-badge/index.js.map +1 -0
- package/dist/components/alert/alert.d.ts +94 -0
- package/dist/components/alert/alert.d.ts.map +1 -0
- package/dist/components/alert/alert.js +105 -0
- package/dist/components/alert/alert.js.map +1 -0
- package/dist/components/alert/alert.variants.d.ts +15 -0
- package/dist/components/alert/alert.variants.d.ts.map +1 -0
- package/dist/components/alert/alert.variants.js +74 -0
- package/dist/components/alert/alert.variants.js.map +1 -0
- package/dist/components/alert/index.d.ts +3 -0
- package/dist/components/alert/index.d.ts.map +1 -0
- package/dist/components/alert/index.js +37 -0
- package/dist/components/alert/index.js.map +1 -0
- package/dist/components/avatar/avatar.d.ts +56 -0
- package/dist/components/avatar/avatar.d.ts.map +1 -0
- package/dist/components/avatar/avatar.js +107 -0
- package/dist/components/avatar/avatar.js.map +1 -0
- package/dist/components/avatar/avatar.variants.d.ts +11 -0
- package/dist/components/avatar/avatar.variants.d.ts.map +1 -0
- package/dist/components/avatar/avatar.variants.js +48 -0
- package/dist/components/avatar/avatar.variants.js.map +1 -0
- package/dist/components/avatar/index.d.ts +3 -0
- package/dist/components/avatar/index.d.ts.map +1 -0
- package/dist/components/avatar/index.js +15 -0
- package/dist/components/avatar/index.js.map +1 -0
- package/dist/components/badge/badge.d.ts +30 -0
- package/dist/components/badge/badge.d.ts.map +1 -0
- package/dist/components/badge/badge.js +33 -0
- package/dist/components/badge/badge.js.map +1 -0
- package/dist/components/badge/badge.variants.d.ts +7 -0
- package/dist/components/badge/badge.variants.d.ts.map +1 -0
- package/dist/components/badge/badge.variants.js +33 -0
- package/dist/components/badge/badge.variants.js.map +1 -0
- package/dist/components/badge/index.d.ts +3 -0
- package/dist/components/badge/index.d.ts.map +1 -0
- package/dist/components/badge/index.js +8 -0
- package/dist/components/badge/index.js.map +1 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +90 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb/breadcrumb.js +143 -0
- package/dist/components/breadcrumb/breadcrumb.js.map +1 -0
- package/dist/components/breadcrumb/breadcrumb.variants.d.ts +10 -0
- package/dist/components/breadcrumb/breadcrumb.variants.d.ts.map +1 -0
- package/dist/components/breadcrumb/breadcrumb.variants.js +41 -0
- package/dist/components/breadcrumb/breadcrumb.variants.js.map +1 -0
- package/dist/components/breadcrumb/index.d.ts +3 -0
- package/dist/components/breadcrumb/index.d.ts.map +1 -0
- package/dist/components/breadcrumb/index.js +35 -0
- package/dist/components/breadcrumb/index.js.map +1 -0
- package/dist/components/button/button.d.ts +10 -0
- package/dist/components/button/button.d.ts.map +1 -0
- package/dist/components/button/button.js +42 -0
- package/dist/components/button/button.js.map +1 -0
- package/dist/components/button/button.variants.d.ts +6 -0
- package/dist/components/button/button.variants.d.ts.map +1 -0
- package/dist/components/button/button.variants.js +45 -0
- package/dist/components/button/button.variants.js.map +1 -0
- package/dist/components/button/index.d.ts +3 -0
- package/dist/components/button/index.d.ts.map +1 -0
- package/dist/components/button/index.js +7 -0
- package/dist/components/button/index.js.map +1 -0
- package/dist/components/card/card.d.ts +59 -0
- package/dist/components/card/card.d.ts.map +1 -0
- package/dist/components/card/card.js +101 -0
- package/dist/components/card/card.js.map +1 -0
- package/dist/components/card/card.variants.d.ts +13 -0
- package/dist/components/card/card.variants.d.ts.map +1 -0
- package/dist/components/card/card.variants.js +64 -0
- package/dist/components/card/card.variants.js.map +1 -0
- package/dist/components/card/index.d.ts +3 -0
- package/dist/components/card/index.d.ts.map +1 -0
- package/dist/components/card/index.js +35 -0
- package/dist/components/card/index.js.map +1 -0
- package/dist/components/checkbox/checkbox.d.ts +20 -0
- package/dist/components/checkbox/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox/checkbox.js +102 -0
- package/dist/components/checkbox/checkbox.js.map +1 -0
- package/dist/components/checkbox/checkbox.variants.d.ts +15 -0
- package/dist/components/checkbox/checkbox.variants.d.ts.map +1 -0
- package/dist/components/checkbox/checkbox.variants.js +70 -0
- package/dist/components/checkbox/checkbox.variants.js.map +1 -0
- package/dist/components/checkbox/index.d.ts +3 -0
- package/dist/components/checkbox/index.d.ts.map +1 -0
- package/dist/components/checkbox/index.js +11 -0
- package/dist/components/checkbox/index.js.map +1 -0
- package/dist/components/command-palette/command-palette.d.ts +76 -0
- package/dist/components/command-palette/command-palette.d.ts.map +1 -0
- package/dist/components/command-palette/command-palette.js +271 -0
- package/dist/components/command-palette/command-palette.js.map +1 -0
- package/dist/components/command-palette/command-palette.variants.d.ts +18 -0
- package/dist/components/command-palette/command-palette.variants.d.ts.map +1 -0
- package/dist/components/command-palette/command-palette.variants.js +62 -0
- package/dist/components/command-palette/command-palette.variants.js.map +1 -0
- package/dist/components/command-palette/index.d.ts +3 -0
- package/dist/components/command-palette/index.d.ts.map +1 -0
- package/dist/components/command-palette/index.js +35 -0
- package/dist/components/command-palette/index.js.map +1 -0
- package/dist/components/consent-toggle/consent-toggle.d.ts +107 -0
- package/dist/components/consent-toggle/consent-toggle.d.ts.map +1 -0
- package/dist/components/consent-toggle/consent-toggle.js +68 -0
- package/dist/components/consent-toggle/consent-toggle.js.map +1 -0
- package/dist/components/consent-toggle/consent-toggle.variants.d.ts +10 -0
- package/dist/components/consent-toggle/consent-toggle.variants.d.ts.map +1 -0
- package/dist/components/consent-toggle/consent-toggle.variants.js +29 -0
- package/dist/components/consent-toggle/consent-toggle.variants.js.map +1 -0
- package/dist/components/consent-toggle/index.d.ts +3 -0
- package/dist/components/consent-toggle/index.d.ts.map +1 -0
- package/dist/components/consent-toggle/index.js +19 -0
- package/dist/components/consent-toggle/index.js.map +1 -0
- package/dist/components/credential-card/credential-card.d.ts +144 -0
- package/dist/components/credential-card/credential-card.d.ts.map +1 -0
- package/dist/components/credential-card/credential-card.js +117 -0
- package/dist/components/credential-card/credential-card.js.map +1 -0
- package/dist/components/credential-card/credential-card.variants.d.ts +15 -0
- package/dist/components/credential-card/credential-card.variants.d.ts.map +1 -0
- package/dist/components/credential-card/credential-card.variants.js +48 -0
- package/dist/components/credential-card/credential-card.variants.js.map +1 -0
- package/dist/components/credential-card/index.d.ts +3 -0
- package/dist/components/credential-card/index.d.ts.map +1 -0
- package/dist/components/credential-card/index.js +29 -0
- package/dist/components/credential-card/index.js.map +1 -0
- package/dist/components/data-grid/data-grid.d.ts +247 -0
- package/dist/components/data-grid/data-grid.d.ts.map +1 -0
- package/dist/components/data-grid/data-grid.js +529 -0
- package/dist/components/data-grid/data-grid.js.map +1 -0
- package/dist/components/data-grid/data-grid.variants.d.ts +29 -0
- package/dist/components/data-grid/data-grid.variants.d.ts.map +1 -0
- package/dist/components/data-grid/data-grid.variants.js +110 -0
- package/dist/components/data-grid/data-grid.variants.js.map +1 -0
- package/dist/components/data-grid/index.d.ts +3 -0
- package/dist/components/data-grid/index.d.ts.map +1 -0
- package/dist/components/data-grid/index.js +59 -0
- package/dist/components/data-grid/index.js.map +1 -0
- package/dist/components/dialog/dialog.d.ts +98 -0
- package/dist/components/dialog/dialog.d.ts.map +1 -0
- package/dist/components/dialog/dialog.js +121 -0
- package/dist/components/dialog/dialog.js.map +1 -0
- package/dist/components/dialog/dialog.variants.d.ts +14 -0
- package/dist/components/dialog/dialog.variants.d.ts.map +1 -0
- package/dist/components/dialog/dialog.variants.js +71 -0
- package/dist/components/dialog/dialog.variants.js.map +1 -0
- package/dist/components/dialog/index.d.ts +3 -0
- package/dist/components/dialog/index.d.ts.map +1 -0
- package/dist/components/dialog/index.js +31 -0
- package/dist/components/dialog/index.js.map +1 -0
- package/dist/components/identity-chip/identity-chip.d.ts +121 -0
- package/dist/components/identity-chip/identity-chip.d.ts.map +1 -0
- package/dist/components/identity-chip/identity-chip.js +203 -0
- package/dist/components/identity-chip/identity-chip.js.map +1 -0
- package/dist/components/identity-chip/identity-chip.variants.d.ts +11 -0
- package/dist/components/identity-chip/identity-chip.variants.d.ts.map +1 -0
- package/dist/components/identity-chip/identity-chip.variants.js +61 -0
- package/dist/components/identity-chip/identity-chip.variants.js.map +1 -0
- package/dist/components/identity-chip/index.d.ts +3 -0
- package/dist/components/identity-chip/index.d.ts.map +1 -0
- package/dist/components/identity-chip/index.js +21 -0
- package/dist/components/identity-chip/index.js.map +1 -0
- package/dist/components/input/index.d.ts +3 -0
- package/dist/components/input/index.d.ts.map +1 -0
- package/dist/components/input/index.js +11 -0
- package/dist/components/input/index.js.map +1 -0
- package/dist/components/input/input.d.ts +17 -0
- package/dist/components/input/input.d.ts.map +1 -0
- package/dist/components/input/input.js +71 -0
- package/dist/components/input/input.js.map +1 -0
- package/dist/components/input/input.variants.d.ts +11 -0
- package/dist/components/input/input.variants.d.ts.map +1 -0
- package/dist/components/input/input.variants.js +64 -0
- package/dist/components/input/input.variants.js.map +1 -0
- package/dist/components/label/index.d.ts +3 -0
- package/dist/components/label/index.d.ts.map +1 -0
- package/dist/components/label/index.js +13 -0
- package/dist/components/label/index.js.map +1 -0
- package/dist/components/label/label.d.ts +16 -0
- package/dist/components/label/label.d.ts.map +1 -0
- package/dist/components/label/label.js +27 -0
- package/dist/components/label/label.js.map +1 -0
- package/dist/components/label/label.variants.d.ts +8 -0
- package/dist/components/label/label.variants.d.ts.map +1 -0
- package/dist/components/label/label.variants.js +27 -0
- package/dist/components/label/label.variants.js.map +1 -0
- package/dist/components/menu/index.d.ts +3 -0
- package/dist/components/menu/index.d.ts.map +1 -0
- package/dist/components/menu/index.js +43 -0
- package/dist/components/menu/index.js.map +1 -0
- package/dist/components/menu/menu.d.ts +115 -0
- package/dist/components/menu/menu.d.ts.map +1 -0
- package/dist/components/menu/menu.js +130 -0
- package/dist/components/menu/menu.js.map +1 -0
- package/dist/components/menu/menu.variants.d.ts +13 -0
- package/dist/components/menu/menu.variants.d.ts.map +1 -0
- package/dist/components/menu/menu.variants.js +56 -0
- package/dist/components/menu/menu.variants.js.map +1 -0
- package/dist/components/pagination/index.d.ts +3 -0
- package/dist/components/pagination/index.d.ts.map +1 -0
- package/dist/components/pagination/index.js +37 -0
- package/dist/components/pagination/index.js.map +1 -0
- package/dist/components/pagination/pagination.d.ts +118 -0
- package/dist/components/pagination/pagination.d.ts.map +1 -0
- package/dist/components/pagination/pagination.js +204 -0
- package/dist/components/pagination/pagination.js.map +1 -0
- package/dist/components/pagination/pagination.variants.d.ts +13 -0
- package/dist/components/pagination/pagination.variants.d.ts.map +1 -0
- package/dist/components/pagination/pagination.variants.js +63 -0
- package/dist/components/pagination/pagination.variants.js.map +1 -0
- package/dist/components/popover/index.d.ts +3 -0
- package/dist/components/popover/index.d.ts.map +1 -0
- package/dist/components/popover/index.js +39 -0
- package/dist/components/popover/index.js.map +1 -0
- package/dist/components/popover/popover.d.ts +92 -0
- package/dist/components/popover/popover.d.ts.map +1 -0
- package/dist/components/popover/popover.js +135 -0
- package/dist/components/popover/popover.js.map +1 -0
- package/dist/components/popover/popover.variants.d.ts +9 -0
- package/dist/components/popover/popover.variants.d.ts.map +1 -0
- package/dist/components/popover/popover.variants.js +19 -0
- package/dist/components/popover/popover.variants.js.map +1 -0
- package/dist/components/progress/index.d.ts +3 -0
- package/dist/components/progress/index.d.ts.map +1 -0
- package/dist/components/progress/index.js +23 -0
- package/dist/components/progress/index.js.map +1 -0
- package/dist/components/progress/progress.d.ts +71 -0
- package/dist/components/progress/progress.d.ts.map +1 -0
- package/dist/components/progress/progress.js +91 -0
- package/dist/components/progress/progress.js.map +1 -0
- package/dist/components/progress/progress.variants.d.ts +14 -0
- package/dist/components/progress/progress.variants.d.ts.map +1 -0
- package/dist/components/progress/progress.variants.js +37 -0
- package/dist/components/progress/progress.variants.js.map +1 -0
- package/dist/components/radio/index.d.ts +3 -0
- package/dist/components/radio/index.d.ts.map +1 -0
- package/dist/components/radio/index.js +22 -0
- package/dist/components/radio/index.js.map +1 -0
- package/dist/components/radio/radio.d.ts +23 -0
- package/dist/components/radio/radio.d.ts.map +1 -0
- package/dist/components/radio/radio.js +183 -0
- package/dist/components/radio/radio.js.map +1 -0
- package/dist/components/radio/radio.variants.d.ts +17 -0
- package/dist/components/radio/radio.variants.d.ts.map +1 -0
- package/dist/components/radio/radio.variants.js +60 -0
- package/dist/components/radio/radio.variants.js.map +1 -0
- package/dist/components/select/index.d.ts +3 -0
- package/dist/components/select/index.d.ts.map +1 -0
- package/dist/components/select/index.js +9 -0
- package/dist/components/select/index.js.map +1 -0
- package/dist/components/select/select.d.ts +27 -0
- package/dist/components/select/select.d.ts.map +1 -0
- package/dist/components/select/select.js +145 -0
- package/dist/components/select/select.js.map +1 -0
- package/dist/components/select/select.variants.d.ts +18 -0
- package/dist/components/select/select.variants.d.ts.map +1 -0
- package/dist/components/select/select.variants.js +102 -0
- package/dist/components/select/select.variants.js.map +1 -0
- package/dist/components/separator/index.d.ts +3 -0
- package/dist/components/separator/index.d.ts.map +1 -0
- package/dist/components/separator/index.js +15 -0
- package/dist/components/separator/index.js.map +1 -0
- package/dist/components/separator/separator.d.ts +23 -0
- package/dist/components/separator/separator.d.ts.map +1 -0
- package/dist/components/separator/separator.js +61 -0
- package/dist/components/separator/separator.js.map +1 -0
- package/dist/components/separator/separator.variants.d.ts +13 -0
- package/dist/components/separator/separator.variants.d.ts.map +1 -0
- package/dist/components/separator/separator.variants.js +46 -0
- package/dist/components/separator/separator.variants.js.map +1 -0
- package/dist/components/sheet/index.d.ts +3 -0
- package/dist/components/sheet/index.d.ts.map +1 -0
- package/dist/components/sheet/index.js +31 -0
- package/dist/components/sheet/index.js.map +1 -0
- package/dist/components/sheet/sheet.d.ts +102 -0
- package/dist/components/sheet/sheet.d.ts.map +1 -0
- package/dist/components/sheet/sheet.js +120 -0
- package/dist/components/sheet/sheet.js.map +1 -0
- package/dist/components/sheet/sheet.variants.d.ts +15 -0
- package/dist/components/sheet/sheet.variants.d.ts.map +1 -0
- package/dist/components/sheet/sheet.variants.js +97 -0
- package/dist/components/sheet/sheet.variants.js.map +1 -0
- package/dist/components/sidebar/index.d.ts +3 -0
- package/dist/components/sidebar/index.d.ts.map +1 -0
- package/dist/components/sidebar/index.js +43 -0
- package/dist/components/sidebar/index.js.map +1 -0
- package/dist/components/sidebar/sidebar.d.ts +114 -0
- package/dist/components/sidebar/sidebar.d.ts.map +1 -0
- package/dist/components/sidebar/sidebar.js +202 -0
- package/dist/components/sidebar/sidebar.js.map +1 -0
- package/dist/components/sidebar/sidebar.variants.d.ts +19 -0
- package/dist/components/sidebar/sidebar.variants.d.ts.map +1 -0
- package/dist/components/sidebar/sidebar.variants.js +93 -0
- package/dist/components/sidebar/sidebar.variants.js.map +1 -0
- package/dist/components/skeleton/index.d.ts +3 -0
- package/dist/components/skeleton/index.d.ts.map +1 -0
- package/dist/components/skeleton/index.js +15 -0
- package/dist/components/skeleton/index.js.map +1 -0
- package/dist/components/skeleton/skeleton.d.ts +42 -0
- package/dist/components/skeleton/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton/skeleton.js +54 -0
- package/dist/components/skeleton/skeleton.js.map +1 -0
- package/dist/components/skeleton/skeleton.variants.d.ts +9 -0
- package/dist/components/skeleton/skeleton.variants.d.ts.map +1 -0
- package/dist/components/skeleton/skeleton.variants.js +31 -0
- package/dist/components/skeleton/skeleton.variants.js.map +1 -0
- package/dist/components/spinner/index.d.ts +3 -0
- package/dist/components/spinner/index.d.ts.map +1 -0
- package/dist/components/spinner/index.js +13 -0
- package/dist/components/spinner/index.js.map +1 -0
- package/dist/components/spinner/spinner.d.ts +41 -0
- package/dist/components/spinner/spinner.d.ts.map +1 -0
- package/dist/components/spinner/spinner.js +48 -0
- package/dist/components/spinner/spinner.js.map +1 -0
- package/dist/components/spinner/spinner.variants.d.ts +8 -0
- package/dist/components/spinner/spinner.variants.d.ts.map +1 -0
- package/dist/components/spinner/spinner.variants.js +32 -0
- package/dist/components/spinner/spinner.variants.js.map +1 -0
- package/dist/components/switch/index.d.ts +3 -0
- package/dist/components/switch/index.d.ts.map +1 -0
- package/dist/components/switch/index.js +15 -0
- package/dist/components/switch/index.js.map +1 -0
- package/dist/components/switch/switch.d.ts +20 -0
- package/dist/components/switch/switch.d.ts.map +1 -0
- package/dist/components/switch/switch.js +107 -0
- package/dist/components/switch/switch.js.map +1 -0
- package/dist/components/switch/switch.variants.d.ts +14 -0
- package/dist/components/switch/switch.variants.d.ts.map +1 -0
- package/dist/components/switch/switch.variants.js +69 -0
- package/dist/components/switch/switch.variants.js.map +1 -0
- package/dist/components/table/index.d.ts +3 -0
- package/dist/components/table/index.d.ts.map +1 -0
- package/dist/components/table/index.js +51 -0
- package/dist/components/table/index.js.map +1 -0
- package/dist/components/table/table.d.ts +173 -0
- package/dist/components/table/table.d.ts.map +1 -0
- package/dist/components/table/table.js +172 -0
- package/dist/components/table/table.js.map +1 -0
- package/dist/components/table/table.variants.d.ts +39 -0
- package/dist/components/table/table.variants.d.ts.map +1 -0
- package/dist/components/table/table.variants.js +124 -0
- package/dist/components/table/table.variants.js.map +1 -0
- package/dist/components/tabs/index.d.ts +3 -0
- package/dist/components/tabs/index.d.ts.map +1 -0
- package/dist/components/tabs/index.js +21 -0
- package/dist/components/tabs/index.js.map +1 -0
- package/dist/components/tabs/tabs.d.ts +66 -0
- package/dist/components/tabs/tabs.d.ts.map +1 -0
- package/dist/components/tabs/tabs.js +81 -0
- package/dist/components/tabs/tabs.js.map +1 -0
- package/dist/components/tabs/tabs.variants.d.ts +15 -0
- package/dist/components/tabs/tabs.variants.d.ts.map +1 -0
- package/dist/components/tabs/tabs.variants.js +98 -0
- package/dist/components/tabs/tabs.variants.js.map +1 -0
- package/dist/components/textarea/index.d.ts +3 -0
- package/dist/components/textarea/index.d.ts.map +1 -0
- package/dist/components/textarea/index.js +7 -0
- package/dist/components/textarea/index.js.map +1 -0
- package/dist/components/textarea/textarea.d.ts +18 -0
- package/dist/components/textarea/textarea.d.ts.map +1 -0
- package/dist/components/textarea/textarea.js +136 -0
- package/dist/components/textarea/textarea.js.map +1 -0
- package/dist/components/textarea/textarea.variants.d.ts +6 -0
- package/dist/components/textarea/textarea.variants.d.ts.map +1 -0
- package/dist/components/textarea/textarea.variants.js +53 -0
- package/dist/components/textarea/textarea.variants.js.map +1 -0
- package/dist/components/toast/index.d.ts +3 -0
- package/dist/components/toast/index.d.ts.map +1 -0
- package/dist/components/toast/index.js +43 -0
- package/dist/components/toast/index.js.map +1 -0
- package/dist/components/toast/toast.d.ts +140 -0
- package/dist/components/toast/toast.d.ts.map +1 -0
- package/dist/components/toast/toast.js +123 -0
- package/dist/components/toast/toast.js.map +1 -0
- package/dist/components/toast/toast.variants.d.ts +16 -0
- package/dist/components/toast/toast.variants.d.ts.map +1 -0
- package/dist/components/toast/toast.variants.js +77 -0
- package/dist/components/toast/toast.variants.js.map +1 -0
- package/dist/components/tooltip/index.d.ts +3 -0
- package/dist/components/tooltip/index.d.ts.map +1 -0
- package/dist/components/tooltip/index.js +16 -0
- package/dist/components/tooltip/index.js.map +1 -0
- package/dist/components/tooltip/tooltip.d.ts +81 -0
- package/dist/components/tooltip/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip/tooltip.js +44 -0
- package/dist/components/tooltip/tooltip.js.map +1 -0
- package/dist/components/tooltip/tooltip.variants.d.ts +3 -0
- package/dist/components/tooltip/tooltip.variants.d.ts.map +1 -0
- package/dist/components/tooltip/tooltip.variants.js +7 -0
- package/dist/components/tooltip/tooltip.variants.js.map +1 -0
- package/dist/components/trust-score/index.d.ts +3 -0
- package/dist/components/trust-score/index.d.ts.map +1 -0
- package/dist/components/trust-score/index.js +11 -0
- package/dist/components/trust-score/index.js.map +1 -0
- package/dist/components/trust-score/trust-score.d.ts +100 -0
- package/dist/components/trust-score/trust-score.d.ts.map +1 -0
- package/dist/components/trust-score/trust-score.js +146 -0
- package/dist/components/trust-score/trust-score.js.map +1 -0
- package/dist/components/trust-score/trust-score.variants.d.ts +16 -0
- package/dist/components/trust-score/trust-score.variants.d.ts.map +1 -0
- package/dist/components/trust-score/trust-score.variants.js +50 -0
- package/dist/components/trust-score/trust-score.variants.js.map +1 -0
- package/dist/components/verified-badge/index.d.ts +3 -0
- package/dist/components/verified-badge/index.d.ts.map +1 -0
- package/dist/components/verified-badge/index.js +15 -0
- package/dist/components/verified-badge/index.js.map +1 -0
- package/dist/components/verified-badge/verified-badge.d.ts +55 -0
- package/dist/components/verified-badge/verified-badge.d.ts.map +1 -0
- package/dist/components/verified-badge/verified-badge.js +67 -0
- package/dist/components/verified-badge/verified-badge.js.map +1 -0
- package/dist/components/verified-badge/verified-badge.variants.d.ts +11 -0
- package/dist/components/verified-badge/verified-badge.variants.d.ts.map +1 -0
- package/dist/components/verified-badge/verified-badge.variants.js +45 -0
- package/dist/components/verified-badge/verified-badge.variants.js.map +1 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +322 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/cn.d.ts +3 -0
- package/dist/lib/cn.d.ts.map +1 -0
- package/dist/lib/cn.js +24 -0
- package/dist/lib/cn.js.map +1 -0
- package/package.json +74 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/agent-badge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACxF,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,KAAK,sBAAsB,GAC5B,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/agent-badge/index.ts"],"sourcesContent":["export { AgentBadge, type AgentBadgeProps, type AgentBadgeStatus } from \"./agent-badge\";\nexport {\n agentBadgeVariants,\n agentBadgeIconClass,\n type AgentBadgeVariantProps,\n} from \"./agent-badge.variants\";\n"],"mappings":"AAAA,SAAS,kBAA+D;AACxE;AAAA,EACE;AAAA,EACA;AAAA,OAEK;","names":[]}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type AlertVariantProps } from "./alert.variants";
|
|
3
|
+
type AlertVariant = NonNullable<AlertVariantProps["variant"]>;
|
|
4
|
+
type AlertLive = "off" | "polite" | "assertive";
|
|
5
|
+
export interface AlertProps extends React.HTMLAttributes<HTMLDivElement>, AlertVariantProps {
|
|
6
|
+
/**
|
|
7
|
+
* The status the alert reports (spec §3): `verified` (a verification succeeded — the in-product
|
|
8
|
+
* Verified Green status, never the brand and never generic success), `signal` (default — a
|
|
9
|
+
* neutral, informational heads-up that needs no action), `caution` (something needs attention
|
|
10
|
+
* but is not yet broken), or `critical` (something failed or blocks progress). The variant sets
|
|
11
|
+
* the color and the paired icon; it never sets the brand color (brand != state).
|
|
12
|
+
*/
|
|
13
|
+
variant?: AlertVariant;
|
|
14
|
+
/**
|
|
15
|
+
* The live-region politeness when the alert appears or changes dynamically (spec §7).
|
|
16
|
+
* `"off"` (default) — no live-region role; for a message present from first render that never
|
|
17
|
+
* changes (plain content with a heading). `"polite"` — `role="status"` for a non-interrupting
|
|
18
|
+
* update (signal / routine caution / verified). `"assertive"` — `role="alert"` for a critical
|
|
19
|
+
* (or high-urgency caution) message that must interrupt. Do not put an assertive role on a
|
|
20
|
+
* non-urgent or statically-rendered message (spec §8).
|
|
21
|
+
*/
|
|
22
|
+
live?: AlertLive;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Alert is an inline, in-page message that states the status of a region or task and, where one
|
|
26
|
+
* exists, what to do next (spec §1). Use it for a result that belongs to the surrounding content
|
|
27
|
+
* — a form that failed validation, a section that needs attention, a confirmed verified result —
|
|
28
|
+
* not a transient notification; for a message that floats over the page and dismisses itself use
|
|
29
|
+
* Toast. An alert holds its place in the layout until the condition it reports changes or the
|
|
30
|
+
* reader dismisses it.
|
|
31
|
+
*
|
|
32
|
+
* It is a feedback surface, not the brand: its color comes from the status it reports, never from
|
|
33
|
+
* Sovereign Violet — the brand violet is never a status (spec §1/§8, brand != state). The status
|
|
34
|
+
* is carried by the color AND the fixed per-variant icon AND the text, so it survives for a reader
|
|
35
|
+
* who cannot perceive color (WCAG 1.4.1).
|
|
36
|
+
*
|
|
37
|
+
* It is a message surface, not a control (spec §4/§6): the container is not a tab stop and binds
|
|
38
|
+
* no keys; the reader reads it in place and tabs to the `AlertActions` and `AlertDismiss` controls
|
|
39
|
+
* inside it. A blocking critical alert MAY be programmatically focused to move a keyboard reader
|
|
40
|
+
* to it — pass `tabIndex={-1}` for that move; it is focusable for the move only, never a permanent
|
|
41
|
+
* tab stop. This file is `'use client'`: the variant travels Root -> `AlertIcon` via React context
|
|
42
|
+
* (the Dialog/Sheet/Tabs/Accordion precedent), and `React.createContext` / context Providers are
|
|
43
|
+
* unsupported in React Server Components, so a context-using component must be a Client Component
|
|
44
|
+
* regardless of whether it holds state or a stateful Radix primitive (`useContext` is itself a hook).
|
|
45
|
+
*/
|
|
46
|
+
export declare const Alert: React.ForwardRefExoticComponent<AlertProps & React.RefAttributes<HTMLDivElement>>;
|
|
47
|
+
/**
|
|
48
|
+
* The required leading status glyph (spec §2). It pairs with the variant color and the message
|
|
49
|
+
* text so the status is never carried by color alone (1.4.1). Decorative — `aria-hidden`, so it is
|
|
50
|
+
* not announced twice; the message text carries the status if the icon is dropped. Being
|
|
51
|
+
* decorative, it takes the BRIGHT variant accent color (tokens 0.6.0) via the AlertContext, at
|
|
52
|
+
* the sm icon role.
|
|
53
|
+
*/
|
|
54
|
+
export declare const AlertIcon: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLSpanElement> & React.RefAttributes<HTMLSpanElement>>;
|
|
55
|
+
/**
|
|
56
|
+
* The stacking content column (spec §2): wraps the title, body, and actions so they stack
|
|
57
|
+
* vertically beside the leading icon (the anatomy is inline-start icon, then the content top to
|
|
58
|
+
* bottom). `min-w-0` lets long body text wrap instead of overflowing the row.
|
|
59
|
+
*/
|
|
60
|
+
export declare const AlertContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
61
|
+
/**
|
|
62
|
+
* The optional title (spec §2): a short heading stating the status as a sentence-case statement,
|
|
63
|
+
* ending in a period — no all-caps, no exclamation mark. The h3 type role in primary text.
|
|
64
|
+
* Defaults to a `<div>`; the document outline is the caller's to set where a real heading element
|
|
65
|
+
* is wanted.
|
|
66
|
+
*/
|
|
67
|
+
export declare const AlertTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
68
|
+
/**
|
|
69
|
+
* The required body (spec §2): the message. It names what happened and, for a caution or critical
|
|
70
|
+
* alert, what to do next — honest about hard things, never blaming the reader. The body type role
|
|
71
|
+
* in primary text.
|
|
72
|
+
*/
|
|
73
|
+
export declare const AlertBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
74
|
+
/**
|
|
75
|
+
* The optional actions slot (spec §2): at most one or two controls closing the message — a retry
|
|
76
|
+
* or a link to the failing step — holding at most one primary action (restraint over volume). The
|
|
77
|
+
* controls are real focus stops (Buttons / links) with their own tokens.
|
|
78
|
+
*/
|
|
79
|
+
export declare const AlertActions: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
80
|
+
export interface AlertDismissProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
81
|
+
/** The accessible name for the close control (spec §7). Defaults to `"Dismiss"`. */
|
|
82
|
+
"aria-label"?: string;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* The optional dismiss control (spec §2/§6/§7): a close button on the inline-end edge, present only
|
|
86
|
+
* on the dismissible variant. A native `<button type="button">` so it is a real focus stop and
|
|
87
|
+
* activates on Enter / Space for free; it has an accessible name (default "Dismiss") and a
|
|
88
|
+
* decorative `aria-hidden` glyph. A neutral ghost surface with the target-size floor and the
|
|
89
|
+
* persistent focus ring. Dismissing should return focus to the triggering control or the next
|
|
90
|
+
* focusable element (caller-managed) — never the document body.
|
|
91
|
+
*/
|
|
92
|
+
export declare const AlertDismiss: React.ForwardRefExoticComponent<AlertDismissProps & React.RefAttributes<HTMLButtonElement>>;
|
|
93
|
+
export {};
|
|
94
|
+
//# sourceMappingURL=alert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../src/components/alert/alert.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EASL,KAAK,iBAAiB,EACvB,MAAM,kBAAkB,CAAC;AAE1B,KAAK,YAAY,GAAG,WAAW,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC;AAS9D,KAAK,SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,WAAW,CAAC;AAahD,MAAM,WAAW,UACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAC1C,iBAAiB;IACnB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,KAAK,mFAqBhB,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,+GAYrB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,6GAIxB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,6GAItB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,6GAIrB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,6GAIxB,CAAC;AAEF,MAAM,WAAW,iBACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IACrD,oFAAoF;IACpF,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,6FA4BxB,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../../lib/cn";
|
|
5
|
+
import {
|
|
6
|
+
alertVariants,
|
|
7
|
+
alertIconVariants,
|
|
8
|
+
alertContentClass,
|
|
9
|
+
alertTitleClass,
|
|
10
|
+
alertBodyClass,
|
|
11
|
+
alertActionsClass,
|
|
12
|
+
alertDismissClass,
|
|
13
|
+
alertDismissGlyphClass
|
|
14
|
+
} from "./alert.variants";
|
|
15
|
+
const LIVE_ROLE = {
|
|
16
|
+
off: void 0,
|
|
17
|
+
polite: "status",
|
|
18
|
+
assertive: "alert"
|
|
19
|
+
};
|
|
20
|
+
const AlertContext = React.createContext({ variant: "signal" });
|
|
21
|
+
const Alert = React.forwardRef(function Alert2({ className, variant = "signal", live = "off", children, ...props }, ref) {
|
|
22
|
+
return /* @__PURE__ */ jsx(AlertContext.Provider, { value: { variant }, children: /* @__PURE__ */ jsx(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
ref,
|
|
26
|
+
role: LIVE_ROLE[live],
|
|
27
|
+
className: cn(alertVariants({ variant }), className),
|
|
28
|
+
...props,
|
|
29
|
+
children
|
|
30
|
+
}
|
|
31
|
+
) });
|
|
32
|
+
});
|
|
33
|
+
const AlertIcon = React.forwardRef(
|
|
34
|
+
function AlertIcon2({ className, ...props }, ref) {
|
|
35
|
+
const { variant } = React.useContext(AlertContext);
|
|
36
|
+
return /* @__PURE__ */ jsx(
|
|
37
|
+
"span",
|
|
38
|
+
{
|
|
39
|
+
ref,
|
|
40
|
+
"aria-hidden": "true",
|
|
41
|
+
className: cn(alertIconVariants({ variant }), className),
|
|
42
|
+
...props
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
const AlertContent = React.forwardRef(
|
|
48
|
+
function AlertContent2({ className, ...props }, ref) {
|
|
49
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn(alertContentClass, className), ...props });
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
const AlertTitle = React.forwardRef(
|
|
53
|
+
function AlertTitle2({ className, ...props }, ref) {
|
|
54
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn(alertTitleClass, className), ...props });
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
const AlertBody = React.forwardRef(
|
|
58
|
+
function AlertBody2({ className, ...props }, ref) {
|
|
59
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn(alertBodyClass, className), ...props });
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
const AlertActions = React.forwardRef(
|
|
63
|
+
function AlertActions2({ className, ...props }, ref) {
|
|
64
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn(alertActionsClass, className), ...props });
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
const AlertDismiss = React.forwardRef(
|
|
68
|
+
function AlertDismiss2({ className, children, "aria-label": ariaLabel = "Dismiss", ...props }, ref) {
|
|
69
|
+
return /* @__PURE__ */ jsx(
|
|
70
|
+
"button",
|
|
71
|
+
{
|
|
72
|
+
ref,
|
|
73
|
+
type: "button",
|
|
74
|
+
"aria-label": ariaLabel,
|
|
75
|
+
className: cn(alertDismissClass, className),
|
|
76
|
+
...props,
|
|
77
|
+
children: children ?? // a neutral X glyph drawn with currentColor; decorative — the button carries the name
|
|
78
|
+
/* @__PURE__ */ jsx(
|
|
79
|
+
"svg",
|
|
80
|
+
{
|
|
81
|
+
"data-testid": "alert-dismiss-glyph",
|
|
82
|
+
"aria-hidden": "true",
|
|
83
|
+
viewBox: "0 0 24 24",
|
|
84
|
+
fill: "none",
|
|
85
|
+
stroke: "currentColor",
|
|
86
|
+
strokeWidth: 2,
|
|
87
|
+
strokeLinecap: "round",
|
|
88
|
+
className: alertDismissGlyphClass,
|
|
89
|
+
children: /* @__PURE__ */ jsx("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
export {
|
|
97
|
+
Alert,
|
|
98
|
+
AlertActions,
|
|
99
|
+
AlertBody,
|
|
100
|
+
AlertContent,
|
|
101
|
+
AlertDismiss,
|
|
102
|
+
AlertIcon,
|
|
103
|
+
AlertTitle
|
|
104
|
+
};
|
|
105
|
+
//# sourceMappingURL=alert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/alert/alert.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/cn\";\nimport {\n alertVariants,\n alertIconVariants,\n alertContentClass,\n alertTitleClass,\n alertBodyClass,\n alertActionsClass,\n alertDismissClass,\n alertDismissGlyphClass,\n type AlertVariantProps,\n} from \"./alert.variants\";\n\ntype AlertVariant = NonNullable<AlertVariantProps[\"variant\"]>;\n\n// The live-region politeness an alert applies when it appears or changes dynamically (spec §7).\n// `\"off\"` (default) is plain content with no live-region role — a message present from first\n// render and never changing is read in place; an assertive role on static content either says\n// nothing (it was already there) or wrongly interrupts. `\"polite\"` → role=\"status\" (an implicit\n// polite live region) for signal / routine caution / verified updates that should not interrupt.\n// `\"assertive\"` → role=\"alert\" (an implicit assertive live region) reserved for a critical (or\n// high-urgency caution) message that genuinely warrants interruption.\ntype AlertLive = \"off\" | \"polite\" | \"assertive\";\n\nconst LIVE_ROLE: Record<AlertLive, \"status\" | \"alert\" | undefined> = {\n off: undefined,\n polite: \"status\",\n assertive: \"alert\",\n};\n\n// The variant set on the Root travels to the AlertIcon via context (the Dialog/Sheet/Tabs/\n// Accordion precedent), so the icon takes the matching status fg without the caller repeating\n// `variant` on AlertIcon.\nconst AlertContext = React.createContext<{ variant: AlertVariant }>({ variant: \"signal\" });\n\nexport interface AlertProps\n extends React.HTMLAttributes<HTMLDivElement>,\n AlertVariantProps {\n /**\n * The status the alert reports (spec §3): `verified` (a verification succeeded — the in-product\n * Verified Green status, never the brand and never generic success), `signal` (default — a\n * neutral, informational heads-up that needs no action), `caution` (something needs attention\n * but is not yet broken), or `critical` (something failed or blocks progress). The variant sets\n * the color and the paired icon; it never sets the brand color (brand != state).\n */\n variant?: AlertVariant;\n /**\n * The live-region politeness when the alert appears or changes dynamically (spec §7).\n * `\"off\"` (default) — no live-region role; for a message present from first render that never\n * changes (plain content with a heading). `\"polite\"` — `role=\"status\"` for a non-interrupting\n * update (signal / routine caution / verified). `\"assertive\"` — `role=\"alert\"` for a critical\n * (or high-urgency caution) message that must interrupt. Do not put an assertive role on a\n * non-urgent or statically-rendered message (spec §8).\n */\n live?: AlertLive;\n}\n\n/**\n * Alert is an inline, in-page message that states the status of a region or task and, where one\n * exists, what to do next (spec §1). Use it for a result that belongs to the surrounding content\n * — a form that failed validation, a section that needs attention, a confirmed verified result —\n * not a transient notification; for a message that floats over the page and dismisses itself use\n * Toast. An alert holds its place in the layout until the condition it reports changes or the\n * reader dismisses it.\n *\n * It is a feedback surface, not the brand: its color comes from the status it reports, never from\n * Sovereign Violet — the brand violet is never a status (spec §1/§8, brand != state). The status\n * is carried by the color AND the fixed per-variant icon AND the text, so it survives for a reader\n * who cannot perceive color (WCAG 1.4.1).\n *\n * It is a message surface, not a control (spec §4/§6): the container is not a tab stop and binds\n * no keys; the reader reads it in place and tabs to the `AlertActions` and `AlertDismiss` controls\n * inside it. A blocking critical alert MAY be programmatically focused to move a keyboard reader\n * to it — pass `tabIndex={-1}` for that move; it is focusable for the move only, never a permanent\n * tab stop. This file is `'use client'`: the variant travels Root -> `AlertIcon` via React context\n * (the Dialog/Sheet/Tabs/Accordion precedent), and `React.createContext` / context Providers are\n * unsupported in React Server Components, so a context-using component must be a Client Component\n * regardless of whether it holds state or a stateful Radix primitive (`useContext` is itself a hook).\n */\nexport const Alert = React.forwardRef<HTMLDivElement, AlertProps>(function Alert(\n { className, variant = \"signal\", live = \"off\", children, ...props },\n ref,\n) {\n return (\n <AlertContext.Provider value={{ variant }}>\n {/* The live-region role is chosen by `live` (spec §7): none for static content,\n role=\"status\" (polite) for non-interrupting updates, role=\"alert\" (assertive) for a\n critical interruption. NOT a tab stop by default — the caller passes tabIndex only for\n the programmatic-focus move to a blocking error. Hover/pressed/disabled never apply to\n the container (spec §4). */}\n <div\n ref={ref}\n role={LIVE_ROLE[live]}\n className={cn(alertVariants({ variant }), className)}\n {...props}\n >\n {children}\n </div>\n </AlertContext.Provider>\n );\n});\n\n/**\n * The required leading status glyph (spec §2). It pairs with the variant color and the message\n * text so the status is never carried by color alone (1.4.1). Decorative — `aria-hidden`, so it is\n * not announced twice; the message text carries the status if the icon is dropped. Being\n * decorative, it takes the BRIGHT variant accent color (tokens 0.6.0) via the AlertContext, at\n * the sm icon role.\n */\nexport const AlertIcon = React.forwardRef<HTMLSpanElement, React.HTMLAttributes<HTMLSpanElement>>(\n function AlertIcon({ className, ...props }, ref) {\n const { variant } = React.useContext(AlertContext);\n return (\n <span\n ref={ref}\n aria-hidden=\"true\"\n className={cn(alertIconVariants({ variant }), className)}\n {...props}\n />\n );\n },\n);\n\n/**\n * The stacking content column (spec §2): wraps the title, body, and actions so they stack\n * vertically beside the leading icon (the anatomy is inline-start icon, then the content top to\n * bottom). `min-w-0` lets long body text wrap instead of overflowing the row.\n */\nexport const AlertContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n function AlertContent({ className, ...props }, ref) {\n return <div ref={ref} className={cn(alertContentClass, className)} {...props} />;\n },\n);\n\n/**\n * The optional title (spec §2): a short heading stating the status as a sentence-case statement,\n * ending in a period — no all-caps, no exclamation mark. The h3 type role in primary text.\n * Defaults to a `<div>`; the document outline is the caller's to set where a real heading element\n * is wanted.\n */\nexport const AlertTitle = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n function AlertTitle({ className, ...props }, ref) {\n return <div ref={ref} className={cn(alertTitleClass, className)} {...props} />;\n },\n);\n\n/**\n * The required body (spec §2): the message. It names what happened and, for a caution or critical\n * alert, what to do next — honest about hard things, never blaming the reader. The body type role\n * in primary text.\n */\nexport const AlertBody = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n function AlertBody({ className, ...props }, ref) {\n return <div ref={ref} className={cn(alertBodyClass, className)} {...props} />;\n },\n);\n\n/**\n * The optional actions slot (spec §2): at most one or two controls closing the message — a retry\n * or a link to the failing step — holding at most one primary action (restraint over volume). The\n * controls are real focus stops (Buttons / links) with their own tokens.\n */\nexport const AlertActions = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n function AlertActions({ className, ...props }, ref) {\n return <div ref={ref} className={cn(alertActionsClass, className)} {...props} />;\n },\n);\n\nexport interface AlertDismissProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** The accessible name for the close control (spec §7). Defaults to `\"Dismiss\"`. */\n \"aria-label\"?: string;\n}\n\n/**\n * The optional dismiss control (spec §2/§6/§7): a close button on the inline-end edge, present only\n * on the dismissible variant. A native `<button type=\"button\">` so it is a real focus stop and\n * activates on Enter / Space for free; it has an accessible name (default \"Dismiss\") and a\n * decorative `aria-hidden` glyph. A neutral ghost surface with the target-size floor and the\n * persistent focus ring. Dismissing should return focus to the triggering control or the next\n * focusable element (caller-managed) — never the document body.\n */\nexport const AlertDismiss = React.forwardRef<HTMLButtonElement, AlertDismissProps>(\n function AlertDismiss({ className, children, \"aria-label\": ariaLabel = \"Dismiss\", ...props }, ref) {\n return (\n <button\n ref={ref}\n type=\"button\"\n aria-label={ariaLabel}\n className={cn(alertDismissClass, className)}\n {...props}\n >\n {children ?? (\n // a neutral X glyph drawn with currentColor; decorative — the button carries the name\n <svg\n data-testid=\"alert-dismiss-glyph\"\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n className={alertDismissGlyphClass}\n >\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </svg>\n )}\n </button>\n );\n },\n);\n"],"mappings":";AA6FM;AA3FN,YAAY,WAAW;AACvB,SAAS,UAAU;AACnB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAaP,MAAM,YAA+D;AAAA,EACnE,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,WAAW;AACb;AAKA,MAAM,eAAe,MAAM,cAAyC,EAAE,SAAS,SAAS,CAAC;AA8ClF,MAAM,QAAQ,MAAM,WAAuC,SAASA,OACzE,EAAE,WAAW,UAAU,UAAU,OAAO,OAAO,UAAU,GAAG,MAAM,GAClE,KACA;AACA,SACE,oBAAC,aAAa,UAAb,EAAsB,OAAO,EAAE,QAAQ,GAMtC;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,MAAM,UAAU,IAAI;AAAA,MACpB,WAAW,GAAG,cAAc,EAAE,QAAQ,CAAC,GAAG,SAAS;AAAA,MAClD,GAAG;AAAA,MAEH;AAAA;AAAA,EACH,GACF;AAEJ,CAAC;AASM,MAAM,YAAY,MAAM;AAAA,EAC7B,SAASC,WAAU,EAAE,WAAW,GAAG,MAAM,GAAG,KAAK;AAC/C,UAAM,EAAE,QAAQ,IAAI,MAAM,WAAW,YAAY;AACjD,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAY;AAAA,QACZ,WAAW,GAAG,kBAAkB,EAAE,QAAQ,CAAC,GAAG,SAAS;AAAA,QACtD,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAOO,MAAM,eAAe,MAAM;AAAA,EAChC,SAASC,cAAa,EAAE,WAAW,GAAG,MAAM,GAAG,KAAK;AAClD,WAAO,oBAAC,SAAI,KAAU,WAAW,GAAG,mBAAmB,SAAS,GAAI,GAAG,OAAO;AAAA,EAChF;AACF;AAQO,MAAM,aAAa,MAAM;AAAA,EAC9B,SAASC,YAAW,EAAE,WAAW,GAAG,MAAM,GAAG,KAAK;AAChD,WAAO,oBAAC,SAAI,KAAU,WAAW,GAAG,iBAAiB,SAAS,GAAI,GAAG,OAAO;AAAA,EAC9E;AACF;AAOO,MAAM,YAAY,MAAM;AAAA,EAC7B,SAASC,WAAU,EAAE,WAAW,GAAG,MAAM,GAAG,KAAK;AAC/C,WAAO,oBAAC,SAAI,KAAU,WAAW,GAAG,gBAAgB,SAAS,GAAI,GAAG,OAAO;AAAA,EAC7E;AACF;AAOO,MAAM,eAAe,MAAM;AAAA,EAChC,SAASC,cAAa,EAAE,WAAW,GAAG,MAAM,GAAG,KAAK;AAClD,WAAO,oBAAC,SAAI,KAAU,WAAW,GAAG,mBAAmB,SAAS,GAAI,GAAG,OAAO;AAAA,EAChF;AACF;AAgBO,MAAM,eAAe,MAAM;AAAA,EAChC,SAASC,cAAa,EAAE,WAAW,UAAU,cAAc,YAAY,WAAW,GAAG,MAAM,GAAG,KAAK;AACjG,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,WAAW,GAAG,mBAAmB,SAAS;AAAA,QACzC,GAAG;AAAA,QAEH;AAAA,QAEC;AAAA,UAAC;AAAA;AAAA,YACC,eAAY;AAAA,YACZ,eAAY;AAAA,YACZ,SAAQ;AAAA,YACR,MAAK;AAAA,YACL,QAAO;AAAA,YACP,aAAa;AAAA,YACb,eAAc;AAAA,YACd,WAAW;AAAA,YAEX,8BAAC,UAAK,GAAE,wBAAuB;AAAA;AAAA,QACjC;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;","names":["Alert","AlertIcon","AlertContent","AlertTitle","AlertBody","AlertActions","AlertDismiss"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
export declare const alertVariants: (props?: ({
|
|
3
|
+
variant?: "verified" | "signal" | "caution" | "critical" | null | undefined;
|
|
4
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5
|
+
export declare const alertIconVariants: (props?: ({
|
|
6
|
+
variant?: "verified" | "signal" | "caution" | "critical" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
export declare const alertContentClass = "flex min-w-0 flex-1 flex-col gap-(--space-2)";
|
|
9
|
+
export declare const alertTitleClass = "text-h3 text-text-primary";
|
|
10
|
+
export declare const alertBodyClass = "text-body text-text-primary";
|
|
11
|
+
export declare const alertActionsClass = "flex items-center gap-(--space-2) mt-(--space-1)";
|
|
12
|
+
export declare const alertDismissClass: string;
|
|
13
|
+
export declare const alertDismissGlyphClass = "h-(--size-icon-sm) w-(--size-icon-sm)";
|
|
14
|
+
export type AlertVariantProps = VariantProps<typeof alertVariants>;
|
|
15
|
+
//# sourceMappingURL=alert.variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.variants.d.ts","sourceRoot":"","sources":["../../../src/components/alert/alert.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAoBlE,eAAO,MAAM,aAAa;;8EA4CzB,CAAC;AAQF,eAAO,MAAM,iBAAiB;;8EAU5B,CAAC;AAIH,eAAO,MAAM,iBAAiB,iDAAiD,CAAC;AAKhF,eAAO,MAAM,eAAe,8BAA8B,CAAC;AAM3D,eAAO,MAAM,cAAc,gCAAgC,CAAC;AAM5D,eAAO,MAAM,iBAAiB,qDAAqD,CAAC;AAUpF,eAAO,MAAM,iBAAiB,QAOmE,CAAC;AAKlG,eAAO,MAAM,sBAAsB,0CAA0C,CAAC;AAE9E,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
const alertVariants = cva(
|
|
3
|
+
[
|
|
4
|
+
// layout: the bordered container is a row — leading status icon, then the stacked
|
|
5
|
+
// title/body/actions content; logical-property gap so it mirrors under dir="rtl" (G-U6)
|
|
6
|
+
"flex items-start gap-(--space-2)",
|
|
7
|
+
// the bordered container: internal padding off the edge, the md corner radius, a 1px edge
|
|
8
|
+
"rounded-(--radius-md) border p-(--space-3)",
|
|
9
|
+
// logical-property text alignment so the alert mirrors under dir="rtl" (G-U6)
|
|
10
|
+
"text-start",
|
|
11
|
+
// appearance + dismiss motion: the FAST functional duration on verdify easing, collapsing to
|
|
12
|
+
// the instant endpoint under reduced motion (spec §5). Even a `verified` alert fades in on
|
|
13
|
+
// the fast duration — the 350ms VerifiedBadge-only theatre is NEVER borrowed by an alert
|
|
14
|
+
// appearing (G-U3 motion-theatre gate).
|
|
15
|
+
"transition-[opacity,transform] duration-(--motion-duration-fast) ease-(--motion-easing-verdify)",
|
|
16
|
+
"motion-reduce:duration-(--motion-duration-instant)",
|
|
17
|
+
// FOCUS: the container takes focus only when programmatically focused to move a reader to a
|
|
18
|
+
// blocking error (spec §4/§6/§7). It is NOT a tab stop by default (no tabIndex set in tsx);
|
|
19
|
+
// the caller passes tabIndex={-1} for that move. When it is focused it shows the visible 2px
|
|
20
|
+
// ring at a 2px offset, and the ring is never removed (2.4.7).
|
|
21
|
+
"outline-none",
|
|
22
|
+
"focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-2"
|
|
23
|
+
],
|
|
24
|
+
{
|
|
25
|
+
variants: {
|
|
26
|
+
// STRUCTURAL axis = spec §3: the status the alert reports. The four map one-to-one to the
|
|
27
|
+
// --color-status-* trios; there is no neutral or brand-colored alert. Each trio tints the
|
|
28
|
+
// surface (-bg = the one neutral raised surface) and edges it (-border); the decorative
|
|
29
|
+
// leading icon takes the matching -accent (the readable title/body keep their AA text
|
|
30
|
+
// tokens). NONE binds --color-action-* (brand != state, spec §3/§8).
|
|
31
|
+
variant: {
|
|
32
|
+
// a verification succeeded / a claim is proven — the in-product Verified Green status,
|
|
33
|
+
// NEVER the brand and NEVER generic success (spec §3/§8)
|
|
34
|
+
verified: "bg-status-verified-bg border-status-verified-border",
|
|
35
|
+
// neutral, informational, needs no action — the lowest-urgency variant (spec §3)
|
|
36
|
+
signal: "bg-status-signal-bg border-status-signal-border",
|
|
37
|
+
// needs attention but not yet broken — a soft limit, a pending step (spec §3)
|
|
38
|
+
caution: "bg-status-caution-bg border-status-caution-border",
|
|
39
|
+
// something failed or blocks progress — a rejected proof, a failed validation (spec §3)
|
|
40
|
+
critical: "bg-status-critical-bg border-status-critical-border"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
// the lowest-urgency status is the default; a louder status is spent only when warranted
|
|
44
|
+
defaultVariants: { variant: "signal" }
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
const alertIconVariants = cva("inline-flex shrink-0 h-(--size-icon-sm) w-(--size-icon-sm)", {
|
|
48
|
+
variants: {
|
|
49
|
+
variant: {
|
|
50
|
+
verified: "text-status-verified-accent",
|
|
51
|
+
signal: "text-status-signal-accent",
|
|
52
|
+
caution: "text-status-caution-accent",
|
|
53
|
+
critical: "text-status-critical-accent"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
defaultVariants: { variant: "signal" }
|
|
57
|
+
});
|
|
58
|
+
const alertContentClass = "flex min-w-0 flex-1 flex-col gap-(--space-2)";
|
|
59
|
+
const alertTitleClass = "text-h3 text-text-primary";
|
|
60
|
+
const alertBodyClass = "text-body text-text-primary";
|
|
61
|
+
const alertActionsClass = "flex items-center gap-(--space-2) mt-(--space-1)";
|
|
62
|
+
const alertDismissClass = "inline-flex shrink-0 items-center justify-center rounded-(--radius-md) text-action-ghost-fg hover:bg-action-ghost-bg-hover transition-colors duration-(--motion-duration-fast) ease-(--motion-easing-verdify) motion-reduce:duration-(--motion-duration-instant) min-h-(--size-target-mobile) min-w-(--size-target-mobile) sm:min-h-(--size-target-desktop) sm:min-w-(--size-target-desktop) outline-none focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-2";
|
|
63
|
+
const alertDismissGlyphClass = "h-(--size-icon-sm) w-(--size-icon-sm)";
|
|
64
|
+
export {
|
|
65
|
+
alertActionsClass,
|
|
66
|
+
alertBodyClass,
|
|
67
|
+
alertContentClass,
|
|
68
|
+
alertDismissClass,
|
|
69
|
+
alertDismissGlyphClass,
|
|
70
|
+
alertIconVariants,
|
|
71
|
+
alertTitleClass,
|
|
72
|
+
alertVariants
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=alert.variants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/alert/alert.variants.ts"],"sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\";\n\n// An Alert is an inline, in-page feedback surface — a message that reports the status of a\n// region or task and, where one exists, what to do next (spec §1). It is NOT the brand: its\n// color comes from the status it reports, never from Sovereign Violet, so this file binds\n// nothing from the --color-action-* tier (brand != state, G-U2). This is the ONLY token-binding\n// site (skill §5 hard rule).\n//\n// The alert is a message surface, not a control (spec §4): the container has no hover, pressed,\n// loading, or disabled state — those belong to the controls inside it (the actions and the\n// dismiss button, which carry their own tokens). The container's only own state is FOCUS, shown\n// only when it is programmatically focused to move a reader to a blocking error; the focus ring\n// is in the base and is never removed (spec §4/§7).\n//\n// Container fill (spec §3/§5): every variant paints the SAME one neutral raised surface — the\n// status trio's `-bg` resolves to that surface — so the status color is a quiet TINT and EDGE,\n// not a flood. The meaning is carried by the border (the status -border) and the decorative\n// leading icon (the BRIGHT status accent, tokens 0.6.0), never a saturated fill; restraint over\n// volume. Status is paired with the fixed per-variant icon and the readable title/body text so it\n// survives for a reader who cannot perceive color (WCAG 1.4.1, spec §8).\nexport const alertVariants = cva(\n [\n // layout: the bordered container is a row — leading status icon, then the stacked\n // title/body/actions content; logical-property gap so it mirrors under dir=\"rtl\" (G-U6)\n \"flex items-start gap-(--space-2)\",\n // the bordered container: internal padding off the edge, the md corner radius, a 1px edge\n \"rounded-(--radius-md) border p-(--space-3)\",\n // logical-property text alignment so the alert mirrors under dir=\"rtl\" (G-U6)\n \"text-start\",\n // appearance + dismiss motion: the FAST functional duration on verdify easing, collapsing to\n // the instant endpoint under reduced motion (spec §5). Even a `verified` alert fades in on\n // the fast duration — the 350ms VerifiedBadge-only theatre is NEVER borrowed by an alert\n // appearing (G-U3 motion-theatre gate).\n \"transition-[opacity,transform] duration-(--motion-duration-fast) ease-(--motion-easing-verdify)\",\n \"motion-reduce:duration-(--motion-duration-instant)\",\n // FOCUS: the container takes focus only when programmatically focused to move a reader to a\n // blocking error (spec §4/§6/§7). It is NOT a tab stop by default (no tabIndex set in tsx);\n // the caller passes tabIndex={-1} for that move. When it is focused it shows the visible 2px\n // ring at a 2px offset, and the ring is never removed (2.4.7).\n \"outline-none\",\n \"focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-2\",\n ],\n {\n variants: {\n // STRUCTURAL axis = spec §3: the status the alert reports. The four map one-to-one to the\n // --color-status-* trios; there is no neutral or brand-colored alert. Each trio tints the\n // surface (-bg = the one neutral raised surface) and edges it (-border); the decorative\n // leading icon takes the matching -accent (the readable title/body keep their AA text\n // tokens). NONE binds --color-action-* (brand != state, spec §3/§8).\n variant: {\n // a verification succeeded / a claim is proven — the in-product Verified Green status,\n // NEVER the brand and NEVER generic success (spec §3/§8)\n verified: \"bg-status-verified-bg border-status-verified-border\",\n // neutral, informational, needs no action — the lowest-urgency variant (spec §3)\n signal: \"bg-status-signal-bg border-status-signal-border\",\n // needs attention but not yet broken — a soft limit, a pending step (spec §3)\n caution: \"bg-status-caution-bg border-status-caution-border\",\n // something failed or blocks progress — a rejected proof, a failed validation (spec §3)\n critical: \"bg-status-critical-bg border-status-critical-border\",\n },\n },\n // the lowest-urgency status is the default; a louder status is spent only when warranted\n defaultVariants: { variant: \"signal\" },\n },\n);\n\n// The leading status glyph (spec §2/§5): one fixed per-variant icon at the sm icon role. It\n// pairs with the color AND the text so status is never carried by color alone (1.4.1). Because\n// the glyph is DECORATIVE (aria-hidden in tsx) and the message TITLE/body text carries the\n// status meaning, the icon is exempt from the AA text floor and takes the BRIGHT variant ACCENT\n// via the matching --color-status-*-accent (tokens 0.6.0) — the vivid status color reads as an\n// emphasis mark on the quiet surface, while the readable title/body keep their AA text tokens.\nexport const alertIconVariants = cva(\"inline-flex shrink-0 h-(--size-icon-sm) w-(--size-icon-sm)\", {\n variants: {\n variant: {\n verified: \"text-status-verified-accent\",\n signal: \"text-status-signal-accent\",\n caution: \"text-status-caution-accent\",\n critical: \"text-status-critical-accent\",\n },\n },\n defaultVariants: { variant: \"signal\" },\n});\n\n// The stacked content column (spec §2): title, body, then actions, at the small stacked gap.\n// min-w-0 lets long body text wrap instead of overflowing the row.\nexport const alertContentClass = \"flex min-w-0 flex-1 flex-col gap-(--space-2)\";\n\n// The title (spec §2/§5): a short heading stating the status as a sentence-case statement, in\n// the h3 type role + primary text color. The type role already avoids label tracking — no\n// all-caps, no exclamation mark. Brand violet never paints the title.\nexport const alertTitleClass = \"text-h3 text-text-primary\";\n\n// The body (spec §2/§5): the message, in the body type role + primary text color. It names what\n// happened and, for a caution or critical alert, what to do next — honest about hard things,\n// never blaming the reader (spec §1/§8). Supporting/secondary lines use --color-text-secondary\n// (text-text-secondary) where the caller needs them.\nexport const alertBodyClass = \"text-body text-text-primary\";\n\n// The actions slot (spec §2): at most one or two controls closing the message (a retry, a link\n// to the failing step), holding at most one primary action (restraint over volume). The controls\n// are Buttons — the alert does not restate their --color-action-* bindings. Logical-property row\n// with the small gap; a little top margin separates it from the body.\nexport const alertActionsClass = \"flex items-center gap-(--space-2) mt-(--space-1)\";\n\n// The dismiss control (spec §2/§6/§7): a close button on the inline-end edge, present only on the\n// dismissible variant. A NEUTRAL ghost surface — the glyph in --color-action-ghost-fg at rest,\n// the restrained ghost hover fill (no bg/border at rest) — so the close affordance is neutral and\n// never competes with the status. It is a real focus stop with the target-size floor (44px touch\n// / 40px pointer, spec §7 / DEC-B; the height EMERGES from the floor, never fixed below it), the\n// persistent focus ring, and the fast functional hover motion + verdify easing, instant under\n// reduced motion (G-U3). The ghost fg/hover is the control's OWN action treatment, not the\n// alert's status (the brand != state gate scopes status keys to the container variant only).\nexport const alertDismissClass =\n \"inline-flex shrink-0 items-center justify-center rounded-(--radius-md) \" +\n \"text-action-ghost-fg hover:bg-action-ghost-bg-hover \" +\n \"transition-colors duration-(--motion-duration-fast) ease-(--motion-easing-verdify) \" +\n \"motion-reduce:duration-(--motion-duration-instant) \" +\n \"min-h-(--size-target-mobile) min-w-(--size-target-mobile) \" +\n \"sm:min-h-(--size-target-desktop) sm:min-w-(--size-target-desktop) \" +\n \"outline-none focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-2\";\n\n// The dismiss glyph (spec §7): a neutral X at the sm icon role, drawn with currentColor so it\n// inherits the button's ghost fg. Decorative (aria-hidden in tsx) — the button carries the\n// accessible name.\nexport const alertDismissGlyphClass = \"h-(--size-icon-sm) w-(--size-icon-sm)\";\n\nexport type AlertVariantProps = VariantProps<typeof alertVariants>;\n"],"mappings":"AAAA,SAAS,WAA8B;AAoBhC,MAAM,gBAAgB;AAAA,EAC3B;AAAA;AAAA;AAAA,IAGE;AAAA;AAAA,IAEA;AAAA;AAAA,IAEA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMR,SAAS;AAAA;AAAA;AAAA,QAGP,UAAU;AAAA;AAAA,QAEV,QAAQ;AAAA;AAAA,QAER,SAAS;AAAA;AAAA,QAET,UAAU;AAAA,MACZ;AAAA,IACF;AAAA;AAAA,IAEA,iBAAiB,EAAE,SAAS,SAAS;AAAA,EACvC;AACF;AAQO,MAAM,oBAAoB,IAAI,8DAA8D;AAAA,EACjG,UAAU;AAAA,IACR,SAAS;AAAA,MACP,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,UAAU;AAAA,IACZ;AAAA,EACF;AAAA,EACA,iBAAiB,EAAE,SAAS,SAAS;AACvC,CAAC;AAIM,MAAM,oBAAoB;AAK1B,MAAM,kBAAkB;AAMxB,MAAM,iBAAiB;AAMvB,MAAM,oBAAoB;AAU1B,MAAM,oBACX;AAWK,MAAM,yBAAyB;","names":[]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { Alert, AlertIcon, AlertContent, AlertTitle, AlertBody, AlertActions, AlertDismiss, type AlertProps, type AlertDismissProps, } from "./alert";
|
|
2
|
+
export { alertVariants, alertIconVariants, alertContentClass, alertTitleClass, alertBodyClass, alertActionsClass, alertDismissClass, alertDismissGlyphClass, type AlertVariantProps, } from "./alert.variants";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/alert/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,SAAS,EACT,YAAY,EACZ,UAAU,EACV,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,KAAK,UAAU,EACf,KAAK,iBAAiB,GACvB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,KAAK,iBAAiB,GACvB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Alert,
|
|
3
|
+
AlertIcon,
|
|
4
|
+
AlertContent,
|
|
5
|
+
AlertTitle,
|
|
6
|
+
AlertBody,
|
|
7
|
+
AlertActions,
|
|
8
|
+
AlertDismiss
|
|
9
|
+
} from "./alert";
|
|
10
|
+
import {
|
|
11
|
+
alertVariants,
|
|
12
|
+
alertIconVariants,
|
|
13
|
+
alertContentClass,
|
|
14
|
+
alertTitleClass,
|
|
15
|
+
alertBodyClass,
|
|
16
|
+
alertActionsClass,
|
|
17
|
+
alertDismissClass,
|
|
18
|
+
alertDismissGlyphClass
|
|
19
|
+
} from "./alert.variants";
|
|
20
|
+
export {
|
|
21
|
+
Alert,
|
|
22
|
+
AlertActions,
|
|
23
|
+
AlertBody,
|
|
24
|
+
AlertContent,
|
|
25
|
+
AlertDismiss,
|
|
26
|
+
AlertIcon,
|
|
27
|
+
AlertTitle,
|
|
28
|
+
alertActionsClass,
|
|
29
|
+
alertBodyClass,
|
|
30
|
+
alertContentClass,
|
|
31
|
+
alertDismissClass,
|
|
32
|
+
alertDismissGlyphClass,
|
|
33
|
+
alertIconVariants,
|
|
34
|
+
alertTitleClass,
|
|
35
|
+
alertVariants
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/alert/index.ts"],"sourcesContent":["export {\n Alert,\n AlertIcon,\n AlertContent,\n AlertTitle,\n AlertBody,\n AlertActions,\n AlertDismiss,\n type AlertProps,\n type AlertDismissProps,\n} from \"./alert\";\nexport {\n alertVariants,\n alertIconVariants,\n alertContentClass,\n alertTitleClass,\n alertBodyClass,\n alertActionsClass,\n alertDismissClass,\n alertDismissGlyphClass,\n type AlertVariantProps,\n} from \"./alert.variants\";\n"],"mappings":"AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;","names":[]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type AvatarVariantProps } from "./avatar.variants";
|
|
3
|
+
/** The shape of the Avatar container (spec §3). Defaults to `circle`. */
|
|
4
|
+
export type AvatarShape = NonNullable<AvatarVariantProps["shape"]>;
|
|
5
|
+
/** The size of the Avatar (spec §3). Defaults to `md`. */
|
|
6
|
+
export type AvatarSize = NonNullable<AvatarVariantProps["size"]>;
|
|
7
|
+
export interface AvatarProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "role">, Pick<AvatarVariantProps, "shape" | "size" | "bordered"> {
|
|
8
|
+
/**
|
|
9
|
+
* The picture for the identity (spec §2). When it loads it is cropped to the Avatar
|
|
10
|
+
* shape; while it is fetching a Skeleton shows in the Avatar's shape; if it is missing
|
|
11
|
+
* or fails to load the `fallback` shows instead. The image is never the only signal of
|
|
12
|
+
* who the identity is — the accessible name always carries it (spec §7).
|
|
13
|
+
*/
|
|
14
|
+
src?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The text alternative that NAMES the identity (spec §7) — for example the display
|
|
17
|
+
* name. It is the Avatar's accessible name, carried by the container so it reaches the
|
|
18
|
+
* accessibility tree as text whether the picture or the fallback is showing (1.1.1 /
|
|
19
|
+
* 1.3.1). Required for an informative Avatar; ignored when `decorative` is set.
|
|
20
|
+
*/
|
|
21
|
+
alt: string;
|
|
22
|
+
/**
|
|
23
|
+
* The display name the fallback initials are derived from (spec §2/§4) — one or two
|
|
24
|
+
* characters, never invented. Omit when no name is available and a neutral generic
|
|
25
|
+
* glyph is shown instead. Initials are never guessed from an identifier that is not a
|
|
26
|
+
* name (spec §4/§8).
|
|
27
|
+
*/
|
|
28
|
+
name?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Mark the Avatar decorative when the same name is already shown as adjacent text
|
|
31
|
+
* (spec §7/§8), so a screen reader does not announce the identity twice. The container
|
|
32
|
+
* is `aria-hidden` and carries no name; everything inside it is decorative too.
|
|
33
|
+
*/
|
|
34
|
+
decorative?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* An Avatar is a small, NON-INTERACTIVE image that stands in for an identity — a person
|
|
38
|
+
* or an AI agent — in lists, headers, tables, and comment threads (spec §1). Its one job
|
|
39
|
+
* is recognition. When there is no picture it falls back to initials, then to a neutral
|
|
40
|
+
* generic glyph, so the identity is always placed.
|
|
41
|
+
*
|
|
42
|
+
* An Avatar PICTURES an identity; it never reports a credential or a verification result.
|
|
43
|
+
* A photo, a ring, or a colored fill says nothing about whether the identity is verified —
|
|
44
|
+
* identity is not credentials, so the Avatar keeps the two apart and binds nothing from
|
|
45
|
+
* the status or action tier (brand != state, spec §1/§8). The verified status is carried
|
|
46
|
+
* by the VerifiedBadge molecule placed BESIDE the Avatar as an external sibling adornment,
|
|
47
|
+
* never by the Avatar itself; the Avatar only reserves the position (spec §2/§8).
|
|
48
|
+
*
|
|
49
|
+
* It is non-interactive (spec §4/§6): it takes no focus, binds no keys, is never a tab
|
|
50
|
+
* stop, and renders no focus ring or target-size floor. An Avatar that must be clickable —
|
|
51
|
+
* to open a profile or a menu — is not a new variant: wrap it in a Button or link that
|
|
52
|
+
* owns the interaction, its keyboard model, and its focus ring; the Avatar stays a passive
|
|
53
|
+
* image and is marked `decorative` inside the wrapper (spec §3/§6).
|
|
54
|
+
*/
|
|
55
|
+
export declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>>;
|
|
56
|
+
//# sourceMappingURL=avatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../src/components/avatar/avatar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAKL,KAAK,kBAAkB,EACxB,MAAM,mBAAmB,CAAC;AAE3B,yEAAyE;AACzE,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;AACnE,0DAA0D;AAC1D,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;AAEjE,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC,EACzD,IAAI,CAAC,kBAAkB,EAAE,OAAO,GAAG,MAAM,GAAG,UAAU,CAAC;IACzD;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAiCD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,MAAM,qFAsElB,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Avatar as AvatarPrimitive } from "radix-ui";
|
|
5
|
+
import { cn } from "../../lib/cn";
|
|
6
|
+
import { Skeleton } from "../skeleton";
|
|
7
|
+
import {
|
|
8
|
+
avatarVariants,
|
|
9
|
+
avatarFallbackClass,
|
|
10
|
+
avatarImageClass,
|
|
11
|
+
avatarGlyphClass
|
|
12
|
+
} from "./avatar.variants";
|
|
13
|
+
function initialsFromName(name) {
|
|
14
|
+
const parts = name.trim().split(/\s+/).filter(Boolean);
|
|
15
|
+
if (parts.length === 0) return "";
|
|
16
|
+
if (parts.length === 1) return parts[0].charAt(0).toUpperCase();
|
|
17
|
+
return (parts[0].charAt(0) + parts.at(-1).charAt(0)).toUpperCase();
|
|
18
|
+
}
|
|
19
|
+
function GenericGlyph() {
|
|
20
|
+
return /* @__PURE__ */ jsxs(
|
|
21
|
+
"svg",
|
|
22
|
+
{
|
|
23
|
+
"data-testid": "avatar-glyph",
|
|
24
|
+
className: avatarGlyphClass,
|
|
25
|
+
viewBox: "0 0 24 24",
|
|
26
|
+
fill: "none",
|
|
27
|
+
stroke: "currentColor",
|
|
28
|
+
strokeWidth: "2",
|
|
29
|
+
strokeLinecap: "round",
|
|
30
|
+
strokeLinejoin: "round",
|
|
31
|
+
"aria-hidden": "true",
|
|
32
|
+
children: [
|
|
33
|
+
/* @__PURE__ */ jsx("path", { d: "M20 21a8 8 0 0 0-16 0" }),
|
|
34
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "7", r: "4" })
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
const Avatar = React.forwardRef(
|
|
40
|
+
function Avatar2({ className, shape, size, bordered, src, alt, name, decorative, ...props }, ref) {
|
|
41
|
+
const [status, setStatus] = React.useState(
|
|
42
|
+
"idle"
|
|
43
|
+
);
|
|
44
|
+
const isLoading = src !== void 0 && (status === "idle" || status === "loading");
|
|
45
|
+
const initials = name ? initialsFromName(name) : "";
|
|
46
|
+
const identity = decorative ? { "aria-hidden": true } : { role: "img", "aria-label": alt };
|
|
47
|
+
return /* @__PURE__ */ jsxs(
|
|
48
|
+
AvatarPrimitive.Root,
|
|
49
|
+
{
|
|
50
|
+
ref,
|
|
51
|
+
className: cn(avatarVariants({ shape, size, bordered }), className),
|
|
52
|
+
...identity,
|
|
53
|
+
...props,
|
|
54
|
+
children: [
|
|
55
|
+
src !== void 0 ? (
|
|
56
|
+
// the picture: rendered by Radix only once it has loaded, cropped to the shape.
|
|
57
|
+
// it is decorative — the container's accessible name already carries the
|
|
58
|
+
// identity, so the picture is not announced as a second name (spec §7).
|
|
59
|
+
/* @__PURE__ */ jsx(
|
|
60
|
+
AvatarPrimitive.Image,
|
|
61
|
+
{
|
|
62
|
+
src,
|
|
63
|
+
alt: "",
|
|
64
|
+
"aria-hidden": "true",
|
|
65
|
+
className: avatarImageClass,
|
|
66
|
+
onLoadingStatusChange: setStatus
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
) : null,
|
|
70
|
+
isLoading ? (
|
|
71
|
+
// LOADING (spec §4): a Skeleton in the Avatar's shape while the image is fetched.
|
|
72
|
+
// It is decorative (the Skeleton itself is aria-hidden); the picture or the
|
|
73
|
+
// fallback replaces it on resolve.
|
|
74
|
+
/* @__PURE__ */ jsx(
|
|
75
|
+
Skeleton,
|
|
76
|
+
{
|
|
77
|
+
variant: "circle",
|
|
78
|
+
"data-testid": "avatar-skeleton",
|
|
79
|
+
className: "absolute inset-0 rounded-[inherit]"
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
) : (
|
|
83
|
+
// FALLBACK (spec §2/§4): the resting state for an identity without a picture, and
|
|
84
|
+
// the state the image fails into. The initials (or a neutral generic glyph) are
|
|
85
|
+
// DECORATIVE — the fallback letters are not exposed as their own text; the
|
|
86
|
+
// container's accessible name carries the identity, so a screen reader hears the
|
|
87
|
+
// name, not the letters (spec §7). Neutral surface + secondary text only — never a
|
|
88
|
+
// status color and never the brand (spec §3/§5/§8, brand != state).
|
|
89
|
+
/* @__PURE__ */ jsx(
|
|
90
|
+
AvatarPrimitive.Fallback,
|
|
91
|
+
{
|
|
92
|
+
"data-testid": "avatar-fallback",
|
|
93
|
+
"aria-hidden": "true",
|
|
94
|
+
className: avatarFallbackClass,
|
|
95
|
+
children: initials ? initials : /* @__PURE__ */ jsx(GenericGlyph, {})
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
)
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
export {
|
|
105
|
+
Avatar
|
|
106
|
+
};
|
|
107
|
+
//# sourceMappingURL=avatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/avatar/avatar.tsx"],"sourcesContent":["\"use client\";\nimport * as React from \"react\";\nimport { Avatar as AvatarPrimitive } from \"radix-ui\";\nimport { cn } from \"../../lib/cn\";\nimport { Skeleton } from \"../skeleton\";\nimport {\n avatarVariants,\n avatarFallbackClass,\n avatarImageClass,\n avatarGlyphClass,\n type AvatarVariantProps,\n} from \"./avatar.variants\";\n\n/** The shape of the Avatar container (spec §3). Defaults to `circle`. */\nexport type AvatarShape = NonNullable<AvatarVariantProps[\"shape\"]>;\n/** The size of the Avatar (spec §3). Defaults to `md`. */\nexport type AvatarSize = NonNullable<AvatarVariantProps[\"size\"]>;\n\nexport interface AvatarProps\n extends Omit<React.HTMLAttributes<HTMLSpanElement>, \"role\">,\n Pick<AvatarVariantProps, \"shape\" | \"size\" | \"bordered\"> {\n /**\n * The picture for the identity (spec §2). When it loads it is cropped to the Avatar\n * shape; while it is fetching a Skeleton shows in the Avatar's shape; if it is missing\n * or fails to load the `fallback` shows instead. The image is never the only signal of\n * who the identity is — the accessible name always carries it (spec §7).\n */\n src?: string;\n /**\n * The text alternative that NAMES the identity (spec §7) — for example the display\n * name. It is the Avatar's accessible name, carried by the container so it reaches the\n * accessibility tree as text whether the picture or the fallback is showing (1.1.1 /\n * 1.3.1). Required for an informative Avatar; ignored when `decorative` is set.\n */\n alt: string;\n /**\n * The display name the fallback initials are derived from (spec §2/§4) — one or two\n * characters, never invented. Omit when no name is available and a neutral generic\n * glyph is shown instead. Initials are never guessed from an identifier that is not a\n * name (spec §4/§8).\n */\n name?: string;\n /**\n * Mark the Avatar decorative when the same name is already shown as adjacent text\n * (spec §7/§8), so a screen reader does not announce the identity twice. The container\n * is `aria-hidden` and carries no name; everything inside it is decorative too.\n */\n decorative?: boolean;\n}\n\n/** Derive one or two uppercase initials from a display name — never invented (spec §2/§4). */\nfunction initialsFromName(name: string): string {\n const parts = name.trim().split(/\\s+/).filter(Boolean);\n if (parts.length === 0) return \"\";\n if (parts.length === 1) return parts[0]!.charAt(0).toUpperCase();\n return (parts[0]!.charAt(0) + parts.at(-1)!.charAt(0)).toUpperCase();\n}\n\n/**\n * A neutral generic glyph shown when no name is available to derive initials from\n * (spec §2/§4/§5). Decorative — the container's accessible name carries the identity.\n */\nfunction GenericGlyph() {\n return (\n <svg\n data-testid=\"avatar-glyph\"\n className={avatarGlyphClass}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M20 21a8 8 0 0 0-16 0\" />\n <circle cx=\"12\" cy=\"7\" r=\"4\" />\n </svg>\n );\n}\n\n/**\n * An Avatar is a small, NON-INTERACTIVE image that stands in for an identity — a person\n * or an AI agent — in lists, headers, tables, and comment threads (spec §1). Its one job\n * is recognition. When there is no picture it falls back to initials, then to a neutral\n * generic glyph, so the identity is always placed.\n *\n * An Avatar PICTURES an identity; it never reports a credential or a verification result.\n * A photo, a ring, or a colored fill says nothing about whether the identity is verified —\n * identity is not credentials, so the Avatar keeps the two apart and binds nothing from\n * the status or action tier (brand != state, spec §1/§8). The verified status is carried\n * by the VerifiedBadge molecule placed BESIDE the Avatar as an external sibling adornment,\n * never by the Avatar itself; the Avatar only reserves the position (spec §2/§8).\n *\n * It is non-interactive (spec §4/§6): it takes no focus, binds no keys, is never a tab\n * stop, and renders no focus ring or target-size floor. An Avatar that must be clickable —\n * to open a profile or a menu — is not a new variant: wrap it in a Button or link that\n * owns the interaction, its keyboard model, and its focus ring; the Avatar stays a passive\n * image and is marked `decorative` inside the wrapper (spec §3/§6).\n */\nexport const Avatar = React.forwardRef<HTMLSpanElement, AvatarProps>(\n function Avatar(\n { className, shape, size, bordered, src, alt, name, decorative, ...props },\n ref,\n ) {\n // Track the image load status so the LOADING state shows a Skeleton in the Avatar's\n // shape rather than a flash of empty container or guessed initials (spec §4). Radix\n // drives idle -> loading -> loaded/error; the initials/glyph fallback is the resting\n // state for any identity without a picture (a normal presentation, not an error).\n const [status, setStatus] = React.useState<\"idle\" | \"loading\" | \"loaded\" | \"error\">(\n \"idle\",\n );\n const isLoading = src !== undefined && (status === \"idle\" || status === \"loading\");\n const initials = name ? initialsFromName(name) : \"\";\n\n // The container is the single carrier of the accessible name (spec §7): role=\"img\"\n // + the alt names the identity in EVERY state (picture, loading, or fallback). When\n // decorative, the same name is shown beside it, so the container is aria-hidden and\n // everything inside is decorative — the identity is not announced twice.\n const identity = decorative\n ? { \"aria-hidden\": true as const }\n : { role: \"img\", \"aria-label\": alt };\n\n return (\n <AvatarPrimitive.Root\n ref={ref}\n className={cn(avatarVariants({ shape, size, bordered }), className)}\n {...identity}\n {...props}\n >\n {src !== undefined ? (\n // the picture: rendered by Radix only once it has loaded, cropped to the shape.\n // it is decorative — the container's accessible name already carries the\n // identity, so the picture is not announced as a second name (spec §7).\n <AvatarPrimitive.Image\n src={src}\n alt=\"\"\n aria-hidden=\"true\"\n className={avatarImageClass}\n onLoadingStatusChange={setStatus}\n />\n ) : null}\n\n {isLoading ? (\n // LOADING (spec §4): a Skeleton in the Avatar's shape while the image is fetched.\n // It is decorative (the Skeleton itself is aria-hidden); the picture or the\n // fallback replaces it on resolve.\n <Skeleton\n variant=\"circle\"\n data-testid=\"avatar-skeleton\"\n className=\"absolute inset-0 rounded-[inherit]\"\n />\n ) : (\n // FALLBACK (spec §2/§4): the resting state for an identity without a picture, and\n // the state the image fails into. The initials (or a neutral generic glyph) are\n // DECORATIVE — the fallback letters are not exposed as their own text; the\n // container's accessible name carries the identity, so a screen reader hears the\n // name, not the letters (spec §7). Neutral surface + secondary text only — never a\n // status color and never the brand (spec §3/§5/§8, brand != state).\n <AvatarPrimitive.Fallback\n data-testid=\"avatar-fallback\"\n aria-hidden=\"true\"\n className={avatarFallbackClass}\n >\n {initials ? initials : <GenericGlyph />}\n </AvatarPrimitive.Fallback>\n )}\n </AvatarPrimitive.Root>\n );\n },\n);\n"],"mappings":";AAgEI,SAWE,KAXF;AA/DJ,YAAY,WAAW;AACvB,SAAS,UAAU,uBAAuB;AAC1C,SAAS,UAAU;AACnB,SAAS,gBAAgB;AACzB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAwCP,SAAS,iBAAiB,MAAsB;AAC9C,QAAM,QAAQ,KAAK,KAAK,EAAE,MAAM,KAAK,EAAE,OAAO,OAAO;AACrD,MAAI,MAAM,WAAW,EAAG,QAAO;AAC/B,MAAI,MAAM,WAAW,EAAG,QAAO,MAAM,CAAC,EAAG,OAAO,CAAC,EAAE,YAAY;AAC/D,UAAQ,MAAM,CAAC,EAAG,OAAO,CAAC,IAAI,MAAM,GAAG,EAAE,EAAG,OAAO,CAAC,GAAG,YAAY;AACrE;AAMA,SAAS,eAAe;AACtB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAY;AAAA,MACZ,WAAW;AAAA,MACX,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,QAAO;AAAA,MACP,aAAY;AAAA,MACZ,eAAc;AAAA,MACd,gBAAe;AAAA,MACf,eAAY;AAAA,MAEZ;AAAA,4BAAC,UAAK,GAAE,yBAAwB;AAAA,QAChC,oBAAC,YAAO,IAAG,MAAK,IAAG,KAAI,GAAE,KAAI;AAAA;AAAA;AAAA,EAC/B;AAEJ;AAqBO,MAAM,SAAS,MAAM;AAAA,EAC1B,SAASA,QACP,EAAE,WAAW,OAAO,MAAM,UAAU,KAAK,KAAK,MAAM,YAAY,GAAG,MAAM,GACzE,KACA;AAKA,UAAM,CAAC,QAAQ,SAAS,IAAI,MAAM;AAAA,MAChC;AAAA,IACF;AACA,UAAM,YAAY,QAAQ,WAAc,WAAW,UAAU,WAAW;AACxE,UAAM,WAAW,OAAO,iBAAiB,IAAI,IAAI;AAMjD,UAAM,WAAW,aACb,EAAE,eAAe,KAAc,IAC/B,EAAE,MAAM,OAAO,cAAc,IAAI;AAErC,WACE;AAAA,MAAC,gBAAgB;AAAA,MAAhB;AAAA,QACC;AAAA,QACA,WAAW,GAAG,eAAe,EAAE,OAAO,MAAM,SAAS,CAAC,GAAG,SAAS;AAAA,QACjE,GAAG;AAAA,QACH,GAAG;AAAA,QAEH;AAAA,kBAAQ;AAAA;AAAA;AAAA;AAAA,YAIP;AAAA,cAAC,gBAAgB;AAAA,cAAhB;AAAA,gBACC;AAAA,gBACA,KAAI;AAAA,gBACJ,eAAY;AAAA,gBACZ,WAAW;AAAA,gBACX,uBAAuB;AAAA;AAAA,YACzB;AAAA,cACE;AAAA,UAEH;AAAA;AAAA;AAAA;AAAA,YAIC;AAAA,cAAC;AAAA;AAAA,gBACC,SAAQ;AAAA,gBACR,eAAY;AAAA,gBACZ,WAAU;AAAA;AAAA,YACZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAQA;AAAA,cAAC,gBAAgB;AAAA,cAAhB;AAAA,gBACC,eAAY;AAAA,gBACZ,eAAY;AAAA,gBACZ,WAAW;AAAA,gBAEV,qBAAW,WAAW,oBAAC,gBAAa;AAAA;AAAA,YACvC;AAAA;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;","names":["Avatar"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
export declare const avatarVariants: (props?: ({
|
|
3
|
+
shape?: "rounded" | "circle" | null | undefined;
|
|
4
|
+
size?: "md" | "sm" | "lg" | null | undefined;
|
|
5
|
+
bordered?: boolean | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export declare const avatarFallbackClass: string;
|
|
8
|
+
export declare const avatarImageClass = "h-full w-full object-cover";
|
|
9
|
+
export declare const avatarGlyphClass = "h-(--size-icon-md) w-(--size-icon-md)";
|
|
10
|
+
export type AvatarVariantProps = VariantProps<typeof avatarVariants>;
|
|
11
|
+
//# sourceMappingURL=avatar.variants.d.ts.map
|