@brightlocal/ui-components 3.1.0 → 3.3.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/AI_USAGE.md +10 -0
- package/README.md +8 -1
- package/component-meta.json +1591 -123
- package/deprecations.json +45 -1
- package/dist/_virtual/_rolldown/runtime.cjs +1 -0
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.js +73 -102
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.d.ts +36 -5
- package/dist/alert-dialog.d.ts.map +1 -1
- package/dist/alert-dialog.js +83 -128
- package/dist/alert.cjs +1 -1
- package/dist/alert.d.ts +4 -4
- package/dist/alert.d.ts.map +1 -1
- package/dist/alert.js +116 -177
- package/dist/aspect-ratio.cjs +1 -1
- package/dist/aspect-ratio.js +13 -16
- package/dist/avatar.cjs +1 -1
- package/dist/avatar.js +30 -45
- package/dist/badge.cjs +1 -1
- package/dist/badge.d.ts +32 -1
- package/dist/badge.d.ts.map +1 -1
- package/dist/badge.js +90 -71
- package/dist/banner.cjs +1 -0
- package/dist/banner.d.ts +81 -0
- package/dist/banner.d.ts.map +1 -0
- package/dist/banner.js +130 -0
- package/dist/blocks/empty-state.cjs +1 -1
- package/dist/blocks/empty-state.d.ts +24 -6
- package/dist/blocks/empty-state.d.ts.map +1 -1
- package/dist/blocks/empty-state.js +74 -140
- package/dist/blocks/input-list.cjs +2 -2
- package/dist/blocks/input-list.d.ts +2 -2
- package/dist/blocks/input-list.d.ts.map +1 -1
- package/dist/blocks/input-list.js +136 -176
- package/dist/blocks/progress-state.cjs +1 -1
- package/dist/blocks/progress-state.d.ts +2 -2
- package/dist/blocks/progress-state.js +223 -347
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +28 -6
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +763 -1086
- package/dist/brand-illustration-motif.cjs +1 -1
- package/dist/brand-illustration-motif.d.ts +1 -1
- package/dist/brand-illustration-motif.js +40 -61
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.js +62 -102
- package/dist/button-group.cjs +1 -1
- package/dist/button-group.js +23 -31
- package/dist/button.cjs +1 -1
- package/dist/button.d.ts +4 -2
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +149 -189
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.d.ts +87 -3
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +116 -173
- package/dist/callout.cjs +1 -1
- package/dist/callout.js +73 -96
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +92 -6
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +240 -234
- package/dist/carousel.cjs +1 -1
- package/dist/carousel.d.ts +3 -3
- package/dist/carousel.d.ts.map +1 -1
- package/dist/carousel.js +174 -268
- package/dist/centred-layout.cjs +1 -1
- package/dist/centred-layout.js +27 -48
- package/dist/chart-empty.cjs +1 -1
- package/dist/chart-empty.js +18 -27
- package/dist/chart.cjs +7 -7
- package/dist/chart.d.ts +253 -25
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +465 -511
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.d.ts +1 -1
- package/dist/checkbox.d.ts.map +1 -1
- package/dist/checkbox.js +37 -69
- package/dist/chip.cjs +1 -1
- package/dist/chip.js +116 -173
- package/dist/collapsible.cjs +1 -1
- package/dist/collapsible.d.ts.map +1 -1
- package/dist/collapsible.js +35 -41
- package/dist/combobox.cjs +3 -3
- package/dist/combobox.d.ts +14 -4
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +440 -639
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +273 -420
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.d.ts +5 -5
- package/dist/context-menu.d.ts.map +1 -1
- package/dist/context-menu.js +121 -191
- package/dist/data-table.cjs +1 -1
- package/dist/data-table.d.ts +442 -144
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +708 -835
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.d.ts +15 -4
- package/dist/date-picker.d.ts.map +1 -1
- package/dist/date-picker.js +156 -231
- package/dist/delta.cjs +1 -0
- package/dist/delta.d.ts +79 -0
- package/dist/delta.d.ts.map +1 -0
- package/dist/delta.js +62 -0
- package/dist/description.cjs +1 -1
- package/dist/description.js +11 -20
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.d.ts +1 -1
- package/dist/dialog.d.ts.map +1 -1
- package/dist/dialog.js +76 -116
- package/dist/drawer.cjs +1 -1
- package/dist/drawer.d.ts +11 -11
- package/dist/drawer.d.ts.map +1 -1
- package/dist/drawer.js +76 -134
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.d.ts +6 -6
- package/dist/dropdown-menu.d.ts.map +1 -1
- package/dist/dropdown-menu.js +179 -300
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts +9 -9
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +166 -286
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.js +203 -342
- package/dist/grid.cjs +1 -1
- package/dist/grid.d.ts +24 -1
- package/dist/grid.d.ts.map +1 -1
- package/dist/grid.js +16 -29
- package/dist/header.cjs +1 -1
- package/dist/header.js +21 -38
- package/dist/height-transition.cjs +1 -1
- package/dist/height-transition.js +38 -55
- package/dist/hooks/use-breakpoint.cjs +1 -1
- package/dist/hooks/use-breakpoint.d.ts +1 -1
- package/dist/hooks/use-breakpoint.d.ts.map +1 -1
- package/dist/hooks/use-breakpoint.js +10 -9
- package/dist/hooks/use-debounce.cjs +1 -1
- package/dist/hooks/use-debounce.js +12 -11
- package/dist/hooks/use-delayed-pending.cjs +1 -1
- package/dist/hooks/use-delayed-pending.js +8 -9
- package/dist/hooks/use-filter-search-params.cjs +1 -0
- package/dist/hooks/use-filter-search-params.d.ts +93 -0
- package/dist/hooks/use-filter-search-params.d.ts.map +1 -0
- package/dist/hooks/use-filter-search-params.js +122 -0
- package/dist/hooks/use-mobile.cjs +1 -1
- package/dist/hooks/use-mobile.js +6 -6
- package/dist/hooks/use-overlay-pointer-lock.cjs +1 -1
- package/dist/hooks/use-overlay-pointer-lock.js +8 -9
- package/dist/hooks/use-prefers-reduced-motion.cjs +1 -1
- package/dist/hooks/use-prefers-reduced-motion.js +5 -8
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.d.ts +1 -1
- package/dist/hover-card.d.ts.map +1 -1
- package/dist/hover-card.js +30 -62
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +636 -582
- package/dist/info-tooltip.cjs +1 -0
- package/dist/info-tooltip.d.ts +39 -0
- package/dist/info-tooltip.d.ts.map +1 -0
- package/dist/info-tooltip.js +27 -0
- package/dist/input-chip.cjs +1 -1
- package/dist/input-chip.d.ts +32 -3
- package/dist/input-chip.d.ts.map +1 -1
- package/dist/input-chip.js +182 -231
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.d.ts +33 -2
- package/dist/input-group.d.ts.map +1 -1
- package/dist/input-group.js +188 -122
- package/dist/input-otp.cjs +1 -1
- package/dist/input-otp.d.ts +3 -3
- package/dist/input-otp.d.ts.map +1 -1
- package/dist/input-otp.js +102 -146
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts +26 -8
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +139 -171
- package/dist/input.cjs +1 -1
- package/dist/input.d.ts.map +1 -1
- package/dist/input.js +51 -73
- package/dist/label.cjs +1 -1
- package/dist/label.js +20 -38
- package/dist/lib/block-illustration.cjs +1 -1
- package/dist/lib/block-illustration.d.ts +5 -2
- package/dist/lib/block-illustration.d.ts.map +1 -1
- package/dist/lib/block-illustration.js +16 -17
- package/dist/lib/compose-event-handlers.cjs +1 -0
- package/dist/lib/compose-event-handlers.d.ts +9 -0
- package/dist/lib/compose-event-handlers.d.ts.map +1 -0
- package/dist/lib/compose-event-handlers.js +8 -0
- package/dist/lib/download-file.cjs +1 -0
- package/dist/lib/download-file.d.ts +14 -0
- package/dist/lib/download-file.d.ts.map +1 -0
- package/dist/lib/download-file.js +40 -0
- package/dist/lib/empty-canvas.cjs +1 -1
- package/dist/lib/empty-canvas.js +28 -56
- package/dist/lib/empty-chip.cjs +1 -1
- package/dist/lib/empty-chip.d.ts +14 -3
- package/dist/lib/empty-chip.d.ts.map +1 -1
- package/dist/lib/empty-chip.js +15 -11
- package/dist/lib/field-aria.cjs +1 -0
- package/dist/lib/field-aria.d.ts +34 -0
- package/dist/lib/field-aria.d.ts.map +1 -0
- package/dist/lib/field-aria.js +52 -0
- package/dist/lib/image-file-info.cjs +1 -0
- package/dist/lib/image-file-info.d.ts +25 -0
- package/dist/lib/image-file-info.d.ts.map +1 -0
- package/dist/lib/image-file-info.js +67 -0
- package/dist/lib/media-viewer-content.cjs +1 -0
- package/dist/lib/media-viewer-content.d.ts +102 -0
- package/dist/lib/media-viewer-content.d.ts.map +1 -0
- package/dist/lib/media-viewer-content.js +650 -0
- package/dist/lib/media-viewer-internal.cjs +1 -0
- package/dist/lib/media-viewer-internal.d.ts +98 -0
- package/dist/lib/media-viewer-internal.d.ts.map +1 -0
- package/dist/lib/media-viewer-internal.js +61 -0
- package/dist/lib/media-viewer-motion.cjs +1 -0
- package/dist/lib/media-viewer-motion.d.ts +40 -0
- package/dist/lib/media-viewer-motion.d.ts.map +1 -0
- package/dist/lib/media-viewer-motion.js +37 -0
- package/dist/lib/motion.cjs +1 -1
- package/dist/lib/motion.d.ts +8 -0
- package/dist/lib/motion.d.ts.map +1 -1
- package/dist/lib/motion.js +11 -10
- package/dist/lib/optical-center.cjs +1 -1
- package/dist/lib/optical-center.d.ts +1 -1
- package/dist/lib/optical-center.d.ts.map +1 -1
- package/dist/lib/optical-center.js +12 -5
- package/dist/lib/spring-settle.cjs +1 -1
- package/dist/lib/spring-settle.js +1 -1
- package/dist/lib/table-internal.cjs +1 -0
- package/dist/lib/table-internal.d.ts +62 -0
- package/dist/lib/table-internal.d.ts.map +1 -0
- package/dist/lib/table-internal.js +18 -0
- package/dist/lib/use-controllable.cjs +1 -0
- package/dist/lib/use-controllable.d.ts +12 -0
- package/dist/lib/use-controllable.d.ts.map +1 -0
- package/dist/lib/use-controllable.js +15 -0
- package/dist/lib/use-dev-warning.cjs +1 -1
- package/dist/lib/utils.cjs +1 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +29 -35
- package/dist/link.cjs +1 -1
- package/dist/link.d.ts +1 -1
- package/dist/link.js +78 -124
- package/dist/list.cjs +1 -1
- package/dist/list.d.ts +8 -0
- package/dist/list.d.ts.map +1 -1
- package/dist/list.js +94 -156
- package/dist/loading.cjs +1 -1
- package/dist/loading.js +124 -151
- package/dist/logo-mark.cjs +1 -0
- package/dist/logo-mark.d.ts +79 -0
- package/dist/logo-mark.d.ts.map +1 -0
- package/dist/logo-mark.js +219 -0
- package/dist/logo.cjs +1 -1
- package/dist/logo.d.ts +1 -1
- package/dist/logo.d.ts.map +1 -1
- package/dist/logo.js +51 -87
- package/dist/map.cjs +1 -1
- package/dist/map.d.ts.map +1 -1
- package/dist/map.js +390 -586
- package/dist/media-empty.cjs +1 -1
- package/dist/media-empty.js +27 -42
- package/dist/media-viewer.cjs +1 -0
- package/dist/media-viewer.d.ts +224 -0
- package/dist/media-viewer.d.ts.map +1 -0
- package/dist/media-viewer.js +295 -0
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.d.ts +14 -14
- package/dist/menubar.d.ts.map +1 -1
- package/dist/menubar.js +130 -267
- package/dist/multi-select-filter.cjs +1 -0
- package/dist/multi-select-filter.d.ts +186 -0
- package/dist/multi-select-filter.d.ts.map +1 -0
- package/dist/multi-select-filter.js +374 -0
- package/dist/navigation-menu.cjs +1 -1
- package/dist/navigation-menu.js +108 -172
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts +36 -12
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +208 -281
- package/dist/popover.cjs +1 -1
- package/dist/popover.d.ts +1 -1
- package/dist/popover.d.ts.map +1 -1
- package/dist/popover.js +34 -45
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts +139 -17
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +116 -148
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +90 -146
- package/dist/rating.cjs +1 -1
- package/dist/rating.d.ts +80 -13
- package/dist/rating.d.ts.map +1 -1
- package/dist/rating.js +70 -65
- package/dist/relative-date.cjs +1 -0
- package/dist/relative-date.d.ts +65 -0
- package/dist/relative-date.d.ts.map +1 -0
- package/dist/relative-date.js +112 -0
- package/dist/resizable.cjs +1 -1
- package/dist/resizable.d.ts +39 -23
- package/dist/resizable.d.ts.map +1 -1
- package/dist/resizable.js +42 -44
- package/dist/result-count.cjs +1 -0
- package/dist/result-count.d.ts +110 -0
- package/dist/result-count.d.ts.map +1 -0
- package/dist/result-count.js +49 -0
- package/dist/route-progress.cjs +1 -1
- package/dist/route-progress.js +58 -102
- package/dist/scroll-area.cjs +1 -1
- package/dist/scroll-area.d.ts +9 -1
- package/dist/scroll-area.d.ts.map +1 -1
- package/dist/scroll-area.js +44 -79
- package/dist/select.cjs +2 -2
- package/dist/select.d.ts +20 -10
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +132 -236
- package/dist/separator.cjs +1 -1
- package/dist/separator.js +90 -78
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +86 -7
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +275 -235
- package/dist/single-select-filter.cjs +1 -0
- package/dist/single-select-filter.d.ts +113 -0
- package/dist/single-select-filter.d.ts.map +1 -0
- package/dist/single-select-filter.js +224 -0
- package/dist/skeleton.cjs +1 -1
- package/dist/skeleton.js +24 -38
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +51 -81
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts +1 -1
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +113 -137
- package/dist/spinner.cjs +1 -1
- package/dist/spinner.js +22 -31
- package/dist/split-layout.cjs +1 -1
- package/dist/split-layout.d.ts +1 -1
- package/dist/split-layout.js +53 -102
- package/dist/status.cjs +1 -0
- package/dist/status.d.ts +51 -0
- package/dist/status.d.ts.map +1 -0
- package/dist/status.js +60 -0
- package/dist/stepper.cjs +1 -1
- package/dist/stepper.js +184 -316
- package/dist/switch.cjs +1 -1
- package/dist/switch.js +17 -32
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts +127 -13
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +170 -192
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.d.ts +12 -1
- package/dist/tabs.d.ts.map +1 -1
- package/dist/tabs.js +123 -146
- package/dist/text-reveal-motion.cjs +1 -1
- package/dist/text-reveal-motion.js +307 -363
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.d.ts.map +1 -1
- package/dist/textarea.js +23 -36
- package/dist/toggle-group.cjs +1 -1
- package/dist/toggle-group.js +43 -62
- package/dist/toggle.cjs +1 -1
- package/dist/toggle.js +34 -46
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.d.ts +38 -36
- package/dist/tooltip.d.ts.map +1 -1
- package/dist/tooltip.js +175 -78
- package/dist/typography-heading.cjs +1 -1
- package/dist/typography-heading.js +25 -61
- package/dist/typography-text.cjs +1 -1
- package/dist/typography-text.d.ts +1 -2
- package/dist/typography-text.d.ts.map +1 -1
- package/dist/typography-text.js +27 -57
- package/dist/typography.cjs +1 -1
- package/dist/typography.d.ts +1 -1
- package/dist/typography.js +132 -340
- package/package.json +45 -46
- package/src/blocks/empty-state.tsx +42 -21
- package/src/blocks/progress-state.tsx +2 -2
- package/src/blocks/sidebar.tsx +111 -32
- package/src/components/accordion.tsx +1 -1
- package/src/components/alert-dialog.tsx +52 -5
- package/src/components/alert.tsx +16 -8
- package/src/components/badge.tsx +152 -3
- package/src/components/banner.tsx +288 -0
- package/src/components/brand-illustration-motif.tsx +1 -1
- package/src/components/breadcrumb.tsx +1 -1
- package/src/components/button.tsx +8 -6
- package/src/components/calendar.tsx +155 -9
- package/src/components/card.tsx +266 -26
- package/src/components/carousel.tsx +4 -1
- package/src/components/chart.tsx +664 -42
- package/src/components/checkbox.tsx +2 -2
- package/src/components/collapsible.tsx +4 -1
- package/src/components/combobox.tsx +42 -9
- package/src/components/command.tsx +10 -11
- package/src/components/context-menu.tsx +4 -4
- package/src/components/data-table.tsx +1363 -398
- package/src/components/date-picker.tsx +31 -4
- package/src/components/delta.tsx +217 -0
- package/src/components/drawer.tsx +5 -5
- package/src/components/dropdown-menu.tsx +4 -4
- package/src/components/field.tsx +36 -15
- package/src/components/global-layout.tsx +1 -1
- package/src/components/grid.tsx +32 -1
- package/src/components/info-tooltip.tsx +94 -0
- package/src/components/input-chip.tsx +52 -8
- package/src/components/input-group.tsx +247 -12
- package/src/components/input-otp.tsx +1 -1
- package/src/components/input-password.tsx +29 -11
- package/src/components/input.tsx +11 -2
- package/src/components/list.tsx +15 -3
- package/src/components/logo-mark.tsx +345 -0
- package/src/components/map.tsx +18 -20
- package/src/components/media-viewer.tsx +908 -0
- package/src/components/multi-select-filter.tsx +1046 -0
- package/src/components/navigation-menu.tsx +2 -2
- package/src/components/pagination.tsx +86 -26
- package/src/components/progress.tsx +281 -54
- package/src/components/rating.tsx +200 -74
- package/src/components/relative-date.tsx +238 -0
- package/src/components/resizable.tsx +86 -33
- package/src/components/result-count.tsx +253 -0
- package/src/components/scroll-area.tsx +31 -5
- package/src/components/select.tsx +37 -7
- package/src/components/sheet.tsx +252 -6
- package/src/components/single-select-filter.tsx +538 -0
- package/src/components/slider.tsx +2 -2
- package/src/components/sonner.tsx +16 -5
- package/src/components/split-layout.tsx +2 -2
- package/src/components/status.tsx +162 -0
- package/src/components/switch.tsx +1 -1
- package/src/components/table.tsx +305 -73
- package/src/components/tabs.tsx +94 -46
- package/src/components/textarea.tsx +21 -3
- package/src/components/toggle.tsx +2 -2
- package/src/components/tooltip.tsx +431 -68
- package/src/components/typography-text.tsx +1 -2
- package/src/components/typography.tsx +1 -1
- package/src/hooks/use-breakpoint.ts +2 -1
- package/src/hooks/use-filter-search-params.ts +302 -0
- package/src/index.ts +11 -0
- package/src/lib/block-illustration.tsx +5 -1
- package/src/lib/compose-event-handlers.ts +14 -0
- package/src/lib/download-file.ts +61 -0
- package/src/lib/empty-chip.tsx +52 -0
- package/src/lib/field-aria.tsx +97 -0
- package/src/lib/image-file-info.ts +102 -0
- package/src/lib/media-viewer-content.tsx +1587 -0
- package/src/lib/media-viewer-internal.tsx +191 -0
- package/src/lib/media-viewer-motion.ts +120 -0
- package/src/lib/motion.ts +9 -0
- package/src/lib/table-internal.ts +74 -0
- package/src/lib/use-controllable.ts +43 -0
- package/src/lib/utils.ts +1 -0
- package/src/lib/empty-chip.ts +0 -24
package/src/components/badge.tsx
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
1
3
|
import * as React from "react";
|
|
2
4
|
import { Slot } from "@radix-ui/react-slot";
|
|
3
5
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
4
6
|
|
|
5
7
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
8
|
+
import { useDevWarning } from "@brightlocal/ui-components/lib/use-dev-warning";
|
|
9
|
+
import {
|
|
10
|
+
Tooltip,
|
|
11
|
+
TooltipContent,
|
|
12
|
+
TooltipProvider,
|
|
13
|
+
TooltipTrigger,
|
|
14
|
+
} from "@brightlocal/ui-components/tooltip";
|
|
6
15
|
|
|
7
16
|
const badgeVariants = cva(
|
|
8
17
|
[
|
|
@@ -16,8 +25,11 @@ const badgeVariants = cva(
|
|
|
16
25
|
// Typography — type-scale role for badges (12/16 Figma 500; the weight
|
|
17
26
|
// drop from the old semibold is intentional, DS-925)
|
|
18
27
|
"text-label-sm whitespace-nowrap",
|
|
19
|
-
// Icons
|
|
28
|
+
// Icons — direct children, the `srLabel` wrapper (display: contents),
|
|
29
|
+
// and the truncation label span
|
|
20
30
|
"[&>svg]:size-3 [&>svg]:pointer-events-none",
|
|
31
|
+
"[&>.contents>svg]:size-3 [&>.contents>svg]:pointer-events-none",
|
|
32
|
+
"[&>[data-slot=badge-label]>svg]:size-3 [&>[data-slot=badge-label]>svg]:pointer-events-none",
|
|
21
33
|
// Transition
|
|
22
34
|
"transition-[color,background-color,border-color,box-shadow] duration-fast ease-out",
|
|
23
35
|
// Focus
|
|
@@ -26,6 +38,8 @@ const badgeVariants = cva(
|
|
|
26
38
|
"dark:focus-visible:shadow-[0_0_0_1px_var(--background),0_0_0_2px_var(--color-ring),0_0_0_4px_rgba(255,255,255,0.1)]",
|
|
27
39
|
// Number badge (single digit)
|
|
28
40
|
"data-[number=true]:size-5 data-[number=true]:p-0 data-[number=true]:aspect-square",
|
|
41
|
+
// Icon-only mark (a round 20px disc holding one icon)
|
|
42
|
+
"data-[icon-only=true]:size-5 data-[icon-only=true]:p-0 data-[icon-only=true]:aspect-square",
|
|
29
43
|
],
|
|
30
44
|
{
|
|
31
45
|
variants: {
|
|
@@ -38,6 +52,9 @@ const badgeVariants = cva(
|
|
|
38
52
|
"border-transparent bg-destructive text-destructive-foreground",
|
|
39
53
|
outline:
|
|
40
54
|
"bg-background border-border text-foreground focus-visible:border-ring",
|
|
55
|
+
// Gold: a top or exceptional outcome (DS-1202) — not a warning
|
|
56
|
+
"highlight-gold":
|
|
57
|
+
"border-transparent bg-highlight-gold text-highlight-gold-foreground",
|
|
41
58
|
},
|
|
42
59
|
},
|
|
43
60
|
defaultVariants: {
|
|
@@ -67,6 +84,37 @@ interface BadgeProps
|
|
|
67
84
|
* Tracking label for analytics context
|
|
68
85
|
*/
|
|
69
86
|
trackingLabel?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Screen-reader phrase that replaces the visible content. A bare numeral
|
|
89
|
+
* tells a screen-reader user nothing about what it counts, so a count
|
|
90
|
+
* badge passes the phrase here ("3 active", "2 selected") and the numeral
|
|
91
|
+
* stays visual only. Ignored with `asChild` — the Slot's single child is
|
|
92
|
+
* the consumer's element, so put the phrase inside it instead.
|
|
93
|
+
* @example srLabel="3 active"
|
|
94
|
+
*/
|
|
95
|
+
srLabel?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Round icon-only mark: a 20px disc holding a single icon. The icon is
|
|
98
|
+
* decorative, so `srLabel` is the accessible name and is required in
|
|
99
|
+
* practice (a dev warning fires without it). Ignored with `asChild`.
|
|
100
|
+
* @default false
|
|
101
|
+
* @example <Badge iconOnly variant="highlight-gold" srLabel="In the knowledge panel"><Crown /></Badge>
|
|
102
|
+
*/
|
|
103
|
+
iconOnly?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Truncate long text with an ellipsis. When the visible text overflows,
|
|
106
|
+
* a tooltip shows the full content on hover / tap — the same pattern
|
|
107
|
+
* Chip uses. The parent layout must constrain the badge's width for
|
|
108
|
+
* truncation to take effect (e.g. a flex parent, or an explicit
|
|
109
|
+
* `maxWidth`). Ignored with `asChild`.
|
|
110
|
+
* @default false
|
|
111
|
+
*/
|
|
112
|
+
truncate?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Maximum width of the badge label before truncation (in pixels).
|
|
115
|
+
* Only applies when `truncate` is true.
|
|
116
|
+
*/
|
|
117
|
+
maxWidth?: number;
|
|
70
118
|
}
|
|
71
119
|
|
|
72
120
|
/**
|
|
@@ -82,29 +130,130 @@ const Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(
|
|
|
82
130
|
dataHook,
|
|
83
131
|
trackingEl,
|
|
84
132
|
trackingLabel,
|
|
133
|
+
srLabel,
|
|
134
|
+
iconOnly = false,
|
|
135
|
+
truncate = false,
|
|
136
|
+
maxWidth,
|
|
85
137
|
children,
|
|
86
138
|
...props
|
|
87
139
|
},
|
|
88
140
|
ref
|
|
89
141
|
) => {
|
|
90
142
|
const Comp = asChild ? Slot : "span";
|
|
143
|
+
const srLabelApplies = srLabel !== undefined && !asChild;
|
|
144
|
+
const truncateApplies = truncate && !asChild;
|
|
145
|
+
|
|
146
|
+
useDevWarning(
|
|
147
|
+
() => asChild && srLabel !== undefined,
|
|
148
|
+
"srLabel is set on a <Badge asChild>. Slot renders the child element as-is, " +
|
|
149
|
+
"so the phrase cannot be injected — add an sr-only span inside the child instead.",
|
|
150
|
+
[asChild, srLabel]
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
useDevWarning(
|
|
154
|
+
() => iconOnly && !asChild && srLabel === undefined,
|
|
155
|
+
"Badge iconOnly has no srLabel. An icon-only mark has no text, so pass srLabel as its accessible name.",
|
|
156
|
+
[iconOnly, asChild, srLabel]
|
|
157
|
+
);
|
|
158
|
+
|
|
159
|
+
useDevWarning(
|
|
160
|
+
() => asChild && truncate,
|
|
161
|
+
"truncate is set on a <Badge asChild>. Slot renders the child element as-is, " +
|
|
162
|
+
"so truncation cannot be applied — add truncation to the child instead.",
|
|
163
|
+
[asChild, truncate]
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
const labelRef = React.useRef<HTMLSpanElement>(null);
|
|
167
|
+
const [isTruncated, setIsTruncated] = React.useState(false);
|
|
168
|
+
|
|
169
|
+
React.useEffect(() => {
|
|
170
|
+
if (!truncateApplies) return;
|
|
171
|
+
|
|
172
|
+
const checkTruncation = () => {
|
|
173
|
+
if (labelRef.current) {
|
|
174
|
+
setIsTruncated(
|
|
175
|
+
labelRef.current.scrollWidth > labelRef.current.clientWidth
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
checkTruncation();
|
|
181
|
+
window.addEventListener("resize", checkTruncation);
|
|
182
|
+
return () => window.removeEventListener("resize", checkTruncation);
|
|
183
|
+
}, [truncateApplies, children]);
|
|
91
184
|
|
|
92
185
|
// Check if children is a single digit number (0-9)
|
|
93
186
|
const isNumberBadge =
|
|
94
187
|
typeof children === "string" && /^[0-9]$/.test(children);
|
|
95
188
|
|
|
189
|
+
// Build inner content — three modes: truncate, srLabel, or passthrough
|
|
190
|
+
let innerContent: React.ReactNode;
|
|
191
|
+
|
|
192
|
+
if (truncateApplies) {
|
|
193
|
+
const labelSpan = (
|
|
194
|
+
<span
|
|
195
|
+
ref={labelRef}
|
|
196
|
+
aria-hidden={srLabelApplies || undefined}
|
|
197
|
+
className="truncate"
|
|
198
|
+
data-slot="badge-label"
|
|
199
|
+
style={maxWidth ? { maxWidth } : undefined}
|
|
200
|
+
>
|
|
201
|
+
{children}
|
|
202
|
+
</span>
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
const wrappedLabel = isTruncated ? (
|
|
206
|
+
<TooltipProvider>
|
|
207
|
+
<Tooltip>
|
|
208
|
+
<TooltipTrigger asChild>{labelSpan}</TooltipTrigger>
|
|
209
|
+
<TooltipContent dataHook={`${dataHook}-tooltip`} sideOffset={8}>
|
|
210
|
+
{children}
|
|
211
|
+
</TooltipContent>
|
|
212
|
+
</Tooltip>
|
|
213
|
+
</TooltipProvider>
|
|
214
|
+
) : (
|
|
215
|
+
labelSpan
|
|
216
|
+
);
|
|
217
|
+
|
|
218
|
+
innerContent = srLabelApplies ? (
|
|
219
|
+
<>
|
|
220
|
+
{wrappedLabel}
|
|
221
|
+
<span className="sr-only">{srLabel}</span>
|
|
222
|
+
</>
|
|
223
|
+
) : (
|
|
224
|
+
wrappedLabel
|
|
225
|
+
);
|
|
226
|
+
} else if (srLabelApplies) {
|
|
227
|
+
innerContent = (
|
|
228
|
+
<>
|
|
229
|
+
<span aria-hidden="true" className="contents">
|
|
230
|
+
{children}
|
|
231
|
+
</span>
|
|
232
|
+
<span className="sr-only">{srLabel}</span>
|
|
233
|
+
</>
|
|
234
|
+
);
|
|
235
|
+
} else {
|
|
236
|
+
innerContent = children;
|
|
237
|
+
}
|
|
238
|
+
|
|
96
239
|
return (
|
|
97
240
|
<Comp
|
|
98
241
|
ref={ref}
|
|
99
|
-
className={cn(
|
|
242
|
+
className={cn(
|
|
243
|
+
badgeVariants({ variant }),
|
|
244
|
+
truncateApplies && "max-w-full min-w-0 shrink",
|
|
245
|
+
srLabelApplies && "relative",
|
|
246
|
+
className
|
|
247
|
+
)}
|
|
100
248
|
data-hook={dataHook}
|
|
249
|
+
data-icon-only={iconOnly || undefined}
|
|
101
250
|
data-number={isNumberBadge}
|
|
102
251
|
data-slot="badge"
|
|
103
252
|
data-tracking-el={trackingEl}
|
|
104
253
|
data-tracking-label={trackingLabel}
|
|
105
254
|
{...props}
|
|
106
255
|
>
|
|
107
|
-
{
|
|
256
|
+
{innerContent}
|
|
108
257
|
</Comp>
|
|
109
258
|
);
|
|
110
259
|
}
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { X } from "@brightlocal/icons";
|
|
4
|
+
|
|
5
|
+
import { Button } from "@brightlocal/ui-components/button";
|
|
6
|
+
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
7
|
+
|
|
8
|
+
/** Highlight surface the banner sits on — one per `highlight-*` token role */
|
|
9
|
+
type BannerVariant = "sky" | "violet";
|
|
10
|
+
|
|
11
|
+
/** Document outline level for the banner title */
|
|
12
|
+
type BannerTitleLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
13
|
+
|
|
14
|
+
// Compact on purpose: a banner is a note, not a hero. Below `md` the parts
|
|
15
|
+
// stack (illustration, content, actions); from `md` they sit in one row with
|
|
16
|
+
// the actions vertically centred on the right.
|
|
17
|
+
const bannerVariants = cva(
|
|
18
|
+
"relative flex w-full flex-col gap-3 rounded-xl p-4 md:flex-row md:items-center md:gap-5 md:pl-5",
|
|
19
|
+
{
|
|
20
|
+
variants: {
|
|
21
|
+
variant: {
|
|
22
|
+
sky: "bg-highlight-sky text-highlight-sky-foreground",
|
|
23
|
+
violet: "bg-highlight-violet text-highlight-violet-foreground",
|
|
24
|
+
},
|
|
25
|
+
dismissible: {
|
|
26
|
+
// Keep the content clear of the absolutely positioned close button.
|
|
27
|
+
true: "pr-12 md:pr-14",
|
|
28
|
+
false: "",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
defaultVariants: {
|
|
32
|
+
variant: "sky",
|
|
33
|
+
dismissible: false,
|
|
34
|
+
},
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const descriptionColorMap: Record<BannerVariant, string> = {
|
|
39
|
+
sky: "text-highlight-sky-muted-foreground",
|
|
40
|
+
violet: "text-highlight-violet-muted-foreground",
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const dismissColorMap: Record<BannerVariant, string> = {
|
|
44
|
+
sky: "text-highlight-sky-foreground hover:bg-highlight-sky-foreground/10",
|
|
45
|
+
violet:
|
|
46
|
+
"text-highlight-violet-foreground hover:bg-highlight-violet-foreground/10",
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// The parts read the surface from the root, so colours and the region's
|
|
50
|
+
// accessible name stay the component's job whatever the composition.
|
|
51
|
+
interface BannerContextValue {
|
|
52
|
+
variant: BannerVariant;
|
|
53
|
+
titleId: string;
|
|
54
|
+
registerTitle: () => () => void;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const BannerContext = React.createContext<BannerContextValue>({
|
|
58
|
+
variant: "sky",
|
|
59
|
+
titleId: "",
|
|
60
|
+
registerTitle: () => () => {},
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
/** Props for the Banner root */
|
|
64
|
+
interface BannerProps extends React.ComponentPropsWithoutRef<"section"> {
|
|
65
|
+
/** Required test hook identifier */
|
|
66
|
+
dataHook: string;
|
|
67
|
+
/**
|
|
68
|
+
* Highlight surface. Sky is the default; violet is the alternative when
|
|
69
|
+
* two banners must read as different invitations.
|
|
70
|
+
* @default "sky"
|
|
71
|
+
*/
|
|
72
|
+
variant?: BannerVariant;
|
|
73
|
+
/**
|
|
74
|
+
* Called when the close button is pressed. The close button renders only
|
|
75
|
+
* when this is set; the consumer decides where the dismissal is remembered.
|
|
76
|
+
*/
|
|
77
|
+
onDismiss?: () => void;
|
|
78
|
+
/**
|
|
79
|
+
* Accessible label for the close button.
|
|
80
|
+
* @default "Dismiss"
|
|
81
|
+
*/
|
|
82
|
+
dismissLabel?: string;
|
|
83
|
+
/** Analytics element identifier */
|
|
84
|
+
trackingEl?: string;
|
|
85
|
+
/** Analytics label */
|
|
86
|
+
trackingLabel?: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Branded, dismissible banner that invites the user to do something optional
|
|
91
|
+
* — an invitation, not a fault. Use an Alert when something happened.
|
|
92
|
+
*
|
|
93
|
+
* Compose it from `BannerIllustration`, `BannerContent` (with `BannerTitle`
|
|
94
|
+
* and `BannerDescription`) and `BannerActions`. The root owns the surface,
|
|
95
|
+
* the layout and the close button.
|
|
96
|
+
*/
|
|
97
|
+
const Banner = React.forwardRef<HTMLElement, BannerProps>(
|
|
98
|
+
(
|
|
99
|
+
{
|
|
100
|
+
className,
|
|
101
|
+
variant = "sky",
|
|
102
|
+
onDismiss,
|
|
103
|
+
dismissLabel,
|
|
104
|
+
dataHook,
|
|
105
|
+
trackingEl,
|
|
106
|
+
trackingLabel,
|
|
107
|
+
children,
|
|
108
|
+
...props
|
|
109
|
+
},
|
|
110
|
+
ref
|
|
111
|
+
) => {
|
|
112
|
+
const titleId = React.useId();
|
|
113
|
+
// Only point aria-labelledby at a title that is actually rendered.
|
|
114
|
+
const [titleCount, setTitleCount] = React.useState(0);
|
|
115
|
+
const registerTitle = React.useCallback(() => {
|
|
116
|
+
setTitleCount((count) => count + 1);
|
|
117
|
+
return () => setTitleCount((count) => count - 1);
|
|
118
|
+
}, []);
|
|
119
|
+
const context = React.useMemo(
|
|
120
|
+
() => ({ variant, titleId, registerTitle }),
|
|
121
|
+
[variant, titleId, registerTitle]
|
|
122
|
+
);
|
|
123
|
+
const dismissible = onDismiss != null;
|
|
124
|
+
|
|
125
|
+
return (
|
|
126
|
+
<BannerContext.Provider value={context}>
|
|
127
|
+
<section
|
|
128
|
+
ref={ref}
|
|
129
|
+
aria-labelledby={titleCount > 0 ? titleId : undefined}
|
|
130
|
+
className={cn(bannerVariants({ variant, dismissible }), className)}
|
|
131
|
+
data-hook={dataHook}
|
|
132
|
+
data-slot="banner"
|
|
133
|
+
data-tracking-el={trackingEl || `banner-${variant}`}
|
|
134
|
+
data-tracking-label={trackingLabel}
|
|
135
|
+
{...props}
|
|
136
|
+
>
|
|
137
|
+
{children}
|
|
138
|
+
{dismissible && (
|
|
139
|
+
<Button
|
|
140
|
+
iconOnly
|
|
141
|
+
className={cn("absolute top-2 right-2", dismissColorMap[variant])}
|
|
142
|
+
dataHook={`${dataHook}-dismiss`}
|
|
143
|
+
variant="ghost"
|
|
144
|
+
onClick={onDismiss}
|
|
145
|
+
>
|
|
146
|
+
<X />
|
|
147
|
+
<span className="sr-only">{dismissLabel ?? "Dismiss"}</span>
|
|
148
|
+
</Button>
|
|
149
|
+
)}
|
|
150
|
+
</section>
|
|
151
|
+
</BannerContext.Provider>
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
);
|
|
155
|
+
Banner.displayName = "Banner";
|
|
156
|
+
|
|
157
|
+
/** Shared props for the Banner parts */
|
|
158
|
+
interface BannerPartProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
159
|
+
/** Test hook identifier */
|
|
160
|
+
dataHook?: string;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Decorative illustration from `@brightlocal/illustrations`, sized by the
|
|
165
|
+
* banner (56px, 64px from `md`). Hidden from assistive technologies. Leave
|
|
166
|
+
* the illustration's `variant` unset so it follows light/dark mode.
|
|
167
|
+
*/
|
|
168
|
+
const BannerIllustration = React.forwardRef<HTMLDivElement, BannerPartProps>(
|
|
169
|
+
({ className, dataHook, ...props }, ref) => (
|
|
170
|
+
<div
|
|
171
|
+
ref={ref}
|
|
172
|
+
aria-hidden="true"
|
|
173
|
+
className={cn(
|
|
174
|
+
"flex size-14 shrink-0 md:size-16 [&>svg]:size-full",
|
|
175
|
+
className
|
|
176
|
+
)}
|
|
177
|
+
data-hook={dataHook}
|
|
178
|
+
data-slot="banner-illustration"
|
|
179
|
+
{...props}
|
|
180
|
+
/>
|
|
181
|
+
)
|
|
182
|
+
);
|
|
183
|
+
BannerIllustration.displayName = "BannerIllustration";
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* The text column — takes the remaining width. Holds `BannerTitle` and
|
|
187
|
+
* `BannerDescription`, plus anything else the composition needs.
|
|
188
|
+
*/
|
|
189
|
+
const BannerContent = React.forwardRef<HTMLDivElement, BannerPartProps>(
|
|
190
|
+
({ className, dataHook, ...props }, ref) => (
|
|
191
|
+
<div
|
|
192
|
+
ref={ref}
|
|
193
|
+
className={cn("flex min-w-0 flex-1 flex-col gap-1", className)}
|
|
194
|
+
data-hook={dataHook}
|
|
195
|
+
data-slot="banner-content"
|
|
196
|
+
{...props}
|
|
197
|
+
/>
|
|
198
|
+
)
|
|
199
|
+
);
|
|
200
|
+
BannerContent.displayName = "BannerContent";
|
|
201
|
+
|
|
202
|
+
/** Props for BannerTitle */
|
|
203
|
+
interface BannerTitleProps extends Omit<BannerPartProps, "id"> {
|
|
204
|
+
/**
|
|
205
|
+
* Document outline level — renders the title as the corresponding heading
|
|
206
|
+
* element (`h1`–`h6`). With no `level` the title renders a `div`; it still
|
|
207
|
+
* names the banner region either way.
|
|
208
|
+
* @example <BannerTitle level={2}>Connect Facebook</BannerTitle>
|
|
209
|
+
*/
|
|
210
|
+
level?: BannerTitleLevel;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/** Heading — what the user is being invited to do. Names the banner region. */
|
|
214
|
+
const BannerTitle = React.forwardRef<HTMLHeadingElement, BannerTitleProps>(
|
|
215
|
+
({ className, level, dataHook, ...props }, ref) => {
|
|
216
|
+
const { titleId, registerTitle } = React.useContext(BannerContext);
|
|
217
|
+
React.useLayoutEffect(() => registerTitle(), [registerTitle]);
|
|
218
|
+
const Title = level ? (`h${level}` as const) : "div";
|
|
219
|
+
|
|
220
|
+
return (
|
|
221
|
+
<Title
|
|
222
|
+
ref={ref}
|
|
223
|
+
className={cn("text-heading-subsection break-words", className)}
|
|
224
|
+
data-hook={dataHook}
|
|
225
|
+
data-slot="banner-title"
|
|
226
|
+
id={titleId}
|
|
227
|
+
{...props}
|
|
228
|
+
/>
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
);
|
|
232
|
+
BannerTitle.displayName = "BannerTitle";
|
|
233
|
+
|
|
234
|
+
/** One or two lines of supporting copy, in the surface's muted text role */
|
|
235
|
+
const BannerDescription = React.forwardRef<HTMLDivElement, BannerPartProps>(
|
|
236
|
+
({ className, dataHook, ...props }, ref) => {
|
|
237
|
+
const { variant } = React.useContext(BannerContext);
|
|
238
|
+
|
|
239
|
+
return (
|
|
240
|
+
<div
|
|
241
|
+
ref={ref}
|
|
242
|
+
className={cn(
|
|
243
|
+
"text-body-sm break-words",
|
|
244
|
+
descriptionColorMap[variant],
|
|
245
|
+
className
|
|
246
|
+
)}
|
|
247
|
+
data-hook={dataHook}
|
|
248
|
+
data-slot="banner-description"
|
|
249
|
+
{...props}
|
|
250
|
+
/>
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
);
|
|
254
|
+
BannerDescription.displayName = "BannerDescription";
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* The action(s) — usually one outline `sm` Button. Sits on the right from
|
|
258
|
+
* `md`, under the text on phones.
|
|
259
|
+
*/
|
|
260
|
+
const BannerActions = React.forwardRef<HTMLDivElement, BannerPartProps>(
|
|
261
|
+
({ className, dataHook, ...props }, ref) => (
|
|
262
|
+
<div
|
|
263
|
+
ref={ref}
|
|
264
|
+
className={cn("flex shrink-0 flex-wrap items-center gap-2", className)}
|
|
265
|
+
data-hook={dataHook}
|
|
266
|
+
data-slot="banner-actions"
|
|
267
|
+
{...props}
|
|
268
|
+
/>
|
|
269
|
+
)
|
|
270
|
+
);
|
|
271
|
+
BannerActions.displayName = "BannerActions";
|
|
272
|
+
|
|
273
|
+
export {
|
|
274
|
+
Banner,
|
|
275
|
+
BannerIllustration,
|
|
276
|
+
BannerContent,
|
|
277
|
+
BannerTitle,
|
|
278
|
+
BannerDescription,
|
|
279
|
+
BannerActions,
|
|
280
|
+
bannerVariants,
|
|
281
|
+
};
|
|
282
|
+
export type {
|
|
283
|
+
BannerProps,
|
|
284
|
+
BannerPartProps,
|
|
285
|
+
BannerTitleProps,
|
|
286
|
+
BannerVariant,
|
|
287
|
+
BannerTitleLevel,
|
|
288
|
+
};
|
|
@@ -65,7 +65,7 @@ interface BrandIllustrationMotifProps
|
|
|
65
65
|
size?: "sm" | "md" | "lg";
|
|
66
66
|
/**
|
|
67
67
|
* The illustration to render over the motif backdrop — typically a brand
|
|
68
|
-
* illustration such as
|
|
68
|
+
* illustration such as Robot at 144px. Only rendered for the `lg`
|
|
69
69
|
* size; `sm`/`md` show the motif mark alone.
|
|
70
70
|
*/
|
|
71
71
|
children?: React.ReactNode;
|
|
@@ -112,7 +112,7 @@ const BreadcrumbLink = React.forwardRef<HTMLAnchorElement, BreadcrumbLinkProps>(
|
|
|
112
112
|
<Comp
|
|
113
113
|
ref={ref}
|
|
114
114
|
className={cn(
|
|
115
|
-
"hover:text-foreground focus-visible:shadow-default duration-fast rounded-sm transition-colors ease-out outline-none",
|
|
115
|
+
"hover:text-foreground focus-visible:shadow-default duration-fast cursor-pointer rounded-sm transition-colors ease-out outline-none",
|
|
116
116
|
className
|
|
117
117
|
)}
|
|
118
118
|
data-slot="breadcrumb-link"
|
|
@@ -19,6 +19,7 @@ type ButtonVariantProps = {
|
|
|
19
19
|
| "outline"
|
|
20
20
|
| "secondary"
|
|
21
21
|
| "ghost"
|
|
22
|
+
/** @deprecated Use `secondary` for moderate-risk actions or `destructive` for deletions. Will be removed in the next major version. */
|
|
22
23
|
| "warning";
|
|
23
24
|
/**
|
|
24
25
|
* Size variant of the button
|
|
@@ -72,12 +73,6 @@ const ButtonVariants = cva(
|
|
|
72
73
|
"hover:bg-secondary/80",
|
|
73
74
|
"focus-visible:shadow-default",
|
|
74
75
|
],
|
|
75
|
-
warning: [
|
|
76
|
-
"bg-warning-background",
|
|
77
|
-
"hover:bg-warning-background/80",
|
|
78
|
-
"text-warning-foreground",
|
|
79
|
-
"focus-visible:shadow-default",
|
|
80
|
-
],
|
|
81
76
|
destructive: [
|
|
82
77
|
"bg-destructive",
|
|
83
78
|
"dark:bg-red-400/90",
|
|
@@ -101,6 +96,13 @@ const ButtonVariants = cva(
|
|
|
101
96
|
"focus-visible:shadow-default",
|
|
102
97
|
"focus-visible:border-ring",
|
|
103
98
|
],
|
|
99
|
+
/** @deprecated Use `secondary` or `destructive` instead. */
|
|
100
|
+
warning: [
|
|
101
|
+
"bg-warning-background",
|
|
102
|
+
"hover:bg-warning-background/80",
|
|
103
|
+
"text-warning-foreground",
|
|
104
|
+
"focus-visible:shadow-default",
|
|
105
|
+
],
|
|
104
106
|
ghost: [
|
|
105
107
|
"bg-transparent",
|
|
106
108
|
"text-foreground",
|