@brightlocal/ui-components 3.2.0 → 3.4.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 +3 -1
- package/component-meta.json +1458 -380
- package/deprecations.json +44 -0
- 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 +6 -4
- package/dist/alert-dialog.d.ts.map +1 -1
- package/dist/alert-dialog.js +85 -133
- 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 +106 -168
- 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 +23 -1
- package/dist/badge.d.ts.map +1 -1
- package/dist/badge.js +90 -91
- package/dist/banner.cjs +1 -1
- package/dist/banner.js +102 -148
- package/dist/blocks/empty-state.cjs +1 -1
- package/dist/blocks/empty-state.d.ts +20 -3
- package/dist/blocks/empty-state.d.ts.map +1 -1
- package/dist/blocks/empty-state.js +73 -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 +138 -178
- package/dist/blocks/progress-state.cjs +1 -1
- package/dist/blocks/progress-state.js +223 -347
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +11 -6
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +763 -1092
- package/dist/brand-illustration-motif.cjs +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 +10 -4
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +233 -316
- 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 +23 -13
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +445 -651
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +36 -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 +439 -638
- 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 +280 -129
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +687 -948
- 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-list.cjs +1 -0
- package/dist/description-list.d.ts +142 -0
- package/dist/description-list.d.ts.map +1 -0
- package/dist/description-list.js +173 -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.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.js +9 -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 +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +658 -614
- package/dist/info-tooltip.cjs +1 -1
- package/dist/info-tooltip.js +22 -36
- 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 +181 -230
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.js +174 -221
- 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 +12 -16
- 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 +1 -1
- package/dist/lib/block-illustration.d.ts.map +1 -1
- package/dist/lib/block-illustration.js +16 -18
- 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 +14 -8
- 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.js +26 -33
- 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 +224 -39
- package/dist/list.d.ts.map +1 -1
- package/dist/list.js +323 -171
- 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 -1
- package/dist/multi-select-filter.d.ts +9 -1
- package/dist/multi-select-filter.d.ts.map +1 -1
- package/dist/multi-select-filter.js +357 -446
- 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 +17 -2
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +116 -162
- 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 -1
- package/dist/relative-date.d.ts.map +1 -1
- package/dist/relative-date.js +73 -89
- 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 +59 -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 +10 -10
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +118 -238
- package/dist/separator.cjs +1 -1
- package/dist/separator.js +90 -78
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +8 -5
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +250 -317
- package/dist/single-select-filter.cjs +1 -1
- package/dist/single-select-filter.d.ts +32 -0
- package/dist/single-select-filter.d.ts.map +1 -1
- package/dist/single-select-filter.js +201 -203
- 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 +101 -125
- package/dist/spinner.cjs +1 -1
- package/dist/spinner.js +22 -31
- package/dist/split-layout.cjs +1 -1
- package/dist/split-layout.js +52 -101
- 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 +103 -30
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +170 -209
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.d.ts.map +1 -1
- package/dist/tabs.js +102 -147
- 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 +22 -35
- 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 +2 -2
- package/dist/tooltip.d.ts.map +1 -1
- package/dist/tooltip.js +157 -249
- 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.js +27 -57
- package/dist/typography.cjs +1 -1
- package/dist/typography.js +132 -340
- package/package.json +47 -47
- package/src/blocks/empty-state.tsx +34 -18
- package/src/blocks/input-list.tsx +14 -9
- package/src/blocks/sidebar.tsx +86 -31
- package/src/components/accordion.tsx +1 -1
- package/src/components/alert-dialog.tsx +4 -2
- package/src/components/badge.tsx +127 -15
- 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 +63 -10
- package/src/components/carousel.tsx +4 -1
- package/src/components/chart.tsx +151 -17
- package/src/components/checkbox.tsx +1 -1
- package/src/components/collapsible.tsx +4 -1
- package/src/components/combobox.tsx +40 -7
- package/src/components/command.tsx +9 -10
- package/src/components/context-menu.tsx +4 -4
- package/src/components/data-table.tsx +619 -237
- package/src/components/date-picker.tsx +31 -4
- package/src/components/delta.tsx +217 -0
- package/src/components/description-list.tsx +445 -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/input-chip.tsx +51 -7
- package/src/components/input-group.tsx +1 -1
- package/src/components/input-password.tsx +15 -19
- package/src/components/input.tsx +10 -1
- package/src/components/list.tsx +695 -72
- 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 +255 -121
- package/src/components/navigation-menu.tsx +2 -2
- package/src/components/pagination.tsx +86 -26
- package/src/components/progress.tsx +91 -23
- package/src/components/rating.tsx +200 -74
- package/src/components/relative-date.tsx +19 -11
- 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 +2 -2
- package/src/components/sheet.tsx +14 -4
- package/src/components/single-select-filter.tsx +136 -41
- package/src/components/slider.tsx +2 -2
- package/src/components/status.tsx +162 -0
- package/src/components/switch.tsx +1 -1
- package/src/components/table.tsx +278 -106
- package/src/components/tabs.tsx +1 -0
- package/src/components/textarea.tsx +20 -2
- package/src/components/toggle.tsx +2 -2
- package/src/components/tooltip.tsx +11 -20
- package/src/hooks/use-filter-search-params.ts +302 -0
- package/src/index.ts +7 -0
- 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/empty-chip.ts +0 -24
package/dist/delta.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as N from "react";
|
|
2
|
+
import { ArrowDown as h, ArrowUp as I, Minus as w } from "@brightlocal/icons";
|
|
3
|
+
import { cn as D } from "@brightlocal/ui-components/lib/utils";
|
|
4
|
+
import { Fragment as T, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
|
+
import { cva as k } from "class-variance-authority";
|
|
6
|
+
var y = k("relative inline-flex items-center gap-0.5 tabular-nums", {
|
|
7
|
+
variants: { variant: {
|
|
8
|
+
inline: "text-label [&>svg]:size-4",
|
|
9
|
+
pill: "text-label-sm rounded-full px-1.5 py-0.5 [&>svg]:size-3"
|
|
10
|
+
} },
|
|
11
|
+
defaultVariants: { variant: "inline" }
|
|
12
|
+
}), A = {
|
|
13
|
+
better: "text-score-strong-ink",
|
|
14
|
+
worse: "text-score-poor-ink",
|
|
15
|
+
none: "text-muted-foreground"
|
|
16
|
+
}, R = {
|
|
17
|
+
better: "bg-score-strong/15",
|
|
18
|
+
worse: "bg-score-poor/15",
|
|
19
|
+
none: "bg-muted"
|
|
20
|
+
}, F = new Intl.NumberFormat("en-US", { maximumFractionDigits: 2 });
|
|
21
|
+
function M(n) {
|
|
22
|
+
const e = Math.abs(n);
|
|
23
|
+
return e > 0 && e < 5e-3 ? "<0.01" : F.format(e);
|
|
24
|
+
}
|
|
25
|
+
var O = {
|
|
26
|
+
increase: I,
|
|
27
|
+
decrease: h,
|
|
28
|
+
none: w
|
|
29
|
+
}, U = N.forwardRef(({ className: n, value: e, greenWhen: c = "up", variant: a = "inline", increasedLabel: d, decreasedLabel: l, unchangedLabel: m, dataHook: p, trackingEl: u, trackingLabel: f, children: g, ...b }, x) => {
|
|
30
|
+
const r = e > 0 ? "increase" : e < 0 ? "decrease" : "none", t = r === "none" ? "none" : r === "increase" == (c === "up") ? "better" : "worse", i = g ?? M(e), v = O[r];
|
|
31
|
+
return /* @__PURE__ */ s("span", {
|
|
32
|
+
ref: x,
|
|
33
|
+
className: D(y({ variant: a }), A[t], a === "pill" && R[t], n),
|
|
34
|
+
"data-direction": r,
|
|
35
|
+
"data-hook": p,
|
|
36
|
+
"data-slot": "delta",
|
|
37
|
+
"data-tracking-el": u,
|
|
38
|
+
"data-tracking-label": f,
|
|
39
|
+
"data-trend": t,
|
|
40
|
+
"data-variant": a,
|
|
41
|
+
...b,
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ o(v, { "aria-hidden": !0 }),
|
|
44
|
+
/* @__PURE__ */ o("span", {
|
|
45
|
+
"aria-hidden": !0,
|
|
46
|
+
children: i
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ o("span", {
|
|
49
|
+
className: "sr-only",
|
|
50
|
+
children: r === "none" ? m ?? "Unchanged" : /* @__PURE__ */ s(T, { children: [
|
|
51
|
+
r === "increase" ? d ?? "Increased by" : l ?? "Decreased by",
|
|
52
|
+
" ",
|
|
53
|
+
i
|
|
54
|
+
] })
|
|
55
|
+
})
|
|
56
|
+
]
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
U.displayName = "Delta";
|
|
60
|
+
export {
|
|
61
|
+
U as Delta
|
|
62
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";const h=require("./_virtual/_rolldown/runtime.cjs");let t=require("react");t=h.__toESM(t,1);let d=require("@brightlocal/ui-components/lib/utils"),n=require("react/jsx-runtime"),u=require("class-variance-authority");var c=t.createContext({layout:"inline",align:"start",autoTerm:!1}),f=(0,u.cva)("min-w-0",{variants:{layout:{inline:"flex flex-col",stacked:"flex flex-col",responsive:"flex flex-col",container:"flex flex-col",grid:"grid grid-cols-[repeat(auto-fill,minmax(8rem,1fr))] gap-x-6 gap-y-4"},divided:{true:["divide-border divide-y","[&>[data-slot=description-list-item]]:py-3","[&>[data-slot=description-list-item]:first-child]:pt-0","[&>[data-slot=description-list-item]:last-child]:pb-0"],false:""}},compoundVariants:[{layout:"inline",divided:!1,className:"gap-3"},{layout:"stacked",divided:!1,className:"gap-3"},{layout:"responsive",divided:!1,className:"gap-3"},{layout:"container",divided:!1,className:"gap-3"}],defaultVariants:{layout:"inline",divided:!1}}),N=(0,u.cva)("flex min-w-0",{variants:{layout:{inline:"flex-row items-baseline gap-4",stacked:"flex-col gap-1",responsive:"flex-col gap-1 sm:flex-row sm:items-baseline sm:gap-4",container:"flex-col gap-1 @md:flex-row @md:items-baseline @md:gap-4",grid:"flex-col gap-1"}},defaultVariants:{layout:"inline"}}),k=(0,u.cva)("text-muted-foreground text-body-sm shrink-0",{variants:{layout:{inline:"w-(--dl-term-width)",stacked:"",responsive:"sm:w-(--dl-term-width)",container:"@md:w-(--dl-term-width)",grid:""}},defaultVariants:{layout:"inline"}}),T={inline:"grid grid-cols-[max-content_1fr] gap-x-4",responsive:"sm:grid sm:grid-cols-[max-content_1fr] sm:gap-x-4",container:"@md:grid @md:grid-cols-[max-content_1fr] @md:gap-x-4"},j={inline:"col-span-2 grid grid-cols-subgrid",responsive:"sm:col-span-2 sm:grid sm:grid-cols-subgrid",container:"@md:col-span-2 @md:grid @md:grid-cols-subgrid"},I=["inline","responsive","container"],x=t.forwardRef(({className:a,style:r,layout:e="inline",termWidth:s=128,align:i="start",divided:l=!1,dataHook:o,trackingEl:m,trackingLabel:D,...L},b)=>{const p=I.includes(e)&&!(i==="end"&&e==="inline")&&s==="auto",_=t.useMemo(()=>({layout:e,align:i,autoTerm:p}),[e,i,p]);return(0,n.jsx)(c.Provider,{value:_,children:(0,n.jsx)("dl",{ref:b,className:(0,d.cn)(f({layout:e,divided:e==="grid"?!1:l}),p&&T[e],a),"data-align":i,"data-hook":o,"data-layout":e,"data-slot":"description-list","data-tracking-el":m||"description-list","data-tracking-label":D,style:{...typeof s=="number"&&{"--dl-term-width":`${s}px`},...r},...L})})});x.displayName="DescriptionList";var g=t.forwardRef(({className:a,dataHook:r,...e},s)=>{const{layout:i,align:l,autoTerm:o}=t.useContext(c),m=l==="end"&&i==="inline";return(0,n.jsx)("div",{ref:s,className:(0,d.cn)(N({layout:i}),m&&"justify-between",o&&j[i],a),"data-hook":r,"data-slot":"description-list-item",...e})});g.displayName="DescriptionListItem";var v=t.forwardRef(({className:a,dataHook:r,...e},s)=>{const{layout:i,align:l,autoTerm:o}=t.useContext(c);return(0,n.jsx)("dt",{ref:s,className:(0,d.cn)(k({layout:l==="end"||o?"stacked":i}),a),"data-hook":r,"data-slot":"description-list-term",...e})});v.displayName="DescriptionListTerm";var y=t.forwardRef(({className:a,color:r="foreground",dataHook:e,...s},i)=>{const{layout:l,align:o}=t.useContext(c);return(0,n.jsx)("dd",{ref:i,className:(0,d.cn)("text-body-sm min-w-0 flex-1 break-words",r==="muted"?"text-muted-foreground":"text-foreground",o==="end"&&l==="inline"&&"text-right tabular-nums",a),"data-hook":e,"data-slot":"description-list-details",...s})});y.displayName="DescriptionListDetails";var w=t.forwardRef(({className:a,icon:r,children:e,...s},i)=>(0,n.jsxs)("span",{ref:i,className:(0,d.cn)("inline-flex max-w-full items-center gap-2 align-bottom [&_svg:not([class*='size-'])]:size-4",a),"data-slot":"description-list-icon-text",...s,children:[(0,n.jsx)("span",{"aria-hidden":"true",className:"inline-flex size-4 shrink-0 items-center justify-center",children:r}),(0,n.jsx)("span",{className:"min-w-0",children:e})]}));w.displayName="DescriptionListIconText";exports.DescriptionList=x;exports.DescriptionListDetails=y;exports.DescriptionListIconText=w;exports.DescriptionListItem=g;exports.DescriptionListTerm=v;exports.descriptionListVariants=f;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* How each term sits against its value.
|
|
4
|
+
* - `inline` — term column beside the value, every value starts on the same line
|
|
5
|
+
* - `stacked` — term above the value
|
|
6
|
+
* - `responsive` — stacked below the `sm` breakpoint, inline from `sm` up
|
|
7
|
+
* - `container` — stacked until the nearest `@container` is `@md` (28rem) wide,
|
|
8
|
+
* for lists in narrow panels on wide screens
|
|
9
|
+
* - `grid` — stacked items flowing into as many columns as fit (facts, plan limits)
|
|
10
|
+
*/
|
|
11
|
+
export type DescriptionListLayout = "inline" | "stacked" | "responsive" | "container" | "grid";
|
|
12
|
+
/**
|
|
13
|
+
* Where the value sits in an `inline` row (other layouts ignore it).
|
|
14
|
+
* - `start` — values line up in a column after the term
|
|
15
|
+
* - `end` — values pushed to the row's end (receipts, totals, counts)
|
|
16
|
+
*/
|
|
17
|
+
export type DescriptionListAlign = "start" | "end";
|
|
18
|
+
declare const descriptionListVariants: (props?: ({
|
|
19
|
+
layout?: "grid" | "inline" | "container" | "stacked" | "responsive" | null | undefined;
|
|
20
|
+
divided?: boolean | null | undefined;
|
|
21
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
22
|
+
/**
|
|
23
|
+
* Props for the DescriptionList root.
|
|
24
|
+
* Extends native `<dl>` props with layout options and testing/analytics attributes.
|
|
25
|
+
*/
|
|
26
|
+
export interface DescriptionListProps extends React.ComponentProps<"dl"> {
|
|
27
|
+
/**
|
|
28
|
+
* Data hook for automated testing (required).
|
|
29
|
+
* @example "review-details", "plan-limits"
|
|
30
|
+
*/
|
|
31
|
+
dataHook: string;
|
|
32
|
+
/**
|
|
33
|
+
* Tracking element identifier for analytics.
|
|
34
|
+
* @default "description-list"
|
|
35
|
+
*/
|
|
36
|
+
trackingEl?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Tracking label for analytics context.
|
|
39
|
+
*/
|
|
40
|
+
trackingLabel?: string;
|
|
41
|
+
/**
|
|
42
|
+
* How each term sits against its value.
|
|
43
|
+
* @default "inline"
|
|
44
|
+
*/
|
|
45
|
+
layout?: DescriptionListLayout;
|
|
46
|
+
/**
|
|
47
|
+
* Width of the term column when the term sits beside its value. A number is
|
|
48
|
+
* pixels; `"auto"` sizes the column to the longest term.
|
|
49
|
+
* Ignored by `stacked` and `grid`, and by `align="end"` on `inline`.
|
|
50
|
+
* @default 128
|
|
51
|
+
*/
|
|
52
|
+
termWidth?: number | "auto";
|
|
53
|
+
/**
|
|
54
|
+
* Where the value sits in an `inline` row. `end` pushes values to the row's
|
|
55
|
+
* end, for receipts and totals; other layouts ignore it.
|
|
56
|
+
* @default "start"
|
|
57
|
+
*/
|
|
58
|
+
align?: DescriptionListAlign;
|
|
59
|
+
/**
|
|
60
|
+
* Draw a hairline between items. Not used by the `grid` layout.
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
divided?: boolean;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Label-and-value pairs describing one record: the details of a review, the
|
|
67
|
+
* read view of a settings card, a receipt. Renders a semantic `<dl>`.
|
|
68
|
+
*
|
|
69
|
+
* For several records compared by the same attributes, use Table instead.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```tsx
|
|
73
|
+
* <DescriptionList dataHook="review-details">
|
|
74
|
+
* <DescriptionListItem>
|
|
75
|
+
* <DescriptionListTerm>Source</DescriptionListTerm>
|
|
76
|
+
* <DescriptionListDetails>Google</DescriptionListDetails>
|
|
77
|
+
* </DescriptionListItem>
|
|
78
|
+
* </DescriptionList>
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
declare const DescriptionList: React.ForwardRefExoticComponent<Omit<DescriptionListProps, "ref"> & React.RefAttributes<HTMLDListElement>>;
|
|
82
|
+
/**
|
|
83
|
+
* Props for DescriptionListItem — one term and its value.
|
|
84
|
+
*/
|
|
85
|
+
export interface DescriptionListItemProps extends React.ComponentProps<"div"> {
|
|
86
|
+
/**
|
|
87
|
+
* Data hook for automated testing.
|
|
88
|
+
*/
|
|
89
|
+
dataHook?: string;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* One term and its value. Renders a `<div>`, the grouping element HTML allows
|
|
93
|
+
* inside a `<dl>`.
|
|
94
|
+
*/
|
|
95
|
+
declare const DescriptionListItem: React.ForwardRefExoticComponent<Omit<DescriptionListItemProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
96
|
+
/**
|
|
97
|
+
* Props for DescriptionListTerm — the label.
|
|
98
|
+
*/
|
|
99
|
+
export interface DescriptionListTermProps extends React.ComponentProps<"dt"> {
|
|
100
|
+
/**
|
|
101
|
+
* Data hook for automated testing.
|
|
102
|
+
*/
|
|
103
|
+
dataHook?: string;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* The label of a pair. Muted, `text-body-sm`.
|
|
107
|
+
*/
|
|
108
|
+
declare const DescriptionListTerm: React.ForwardRefExoticComponent<Omit<DescriptionListTermProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
109
|
+
/**
|
|
110
|
+
* Props for DescriptionListDetails — the value.
|
|
111
|
+
*/
|
|
112
|
+
export interface DescriptionListDetailsProps extends React.ComponentProps<"dd"> {
|
|
113
|
+
/**
|
|
114
|
+
* Data hook for automated testing.
|
|
115
|
+
*/
|
|
116
|
+
dataHook?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Text colour of the value. Use `muted` for an empty value ("Not set").
|
|
119
|
+
* @default "foreground"
|
|
120
|
+
*/
|
|
121
|
+
color?: "foreground" | "muted";
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* The value of a pair: text, a Badge, a Rating, a Link or an icon with text.
|
|
125
|
+
* Long values wrap.
|
|
126
|
+
*/
|
|
127
|
+
declare const DescriptionListDetails: React.ForwardRefExoticComponent<Omit<DescriptionListDetailsProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
128
|
+
/**
|
|
129
|
+
* Props for DescriptionListIconText — an icon or logo beside a text value.
|
|
130
|
+
*/
|
|
131
|
+
export interface DescriptionListIconTextProps extends React.ComponentProps<"span"> {
|
|
132
|
+
/**
|
|
133
|
+
* The icon or logo, sized to 16px.
|
|
134
|
+
*/
|
|
135
|
+
icon: React.ReactNode;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* An icon or logo beside a text value, such as a review source and its name.
|
|
139
|
+
*/
|
|
140
|
+
declare const DescriptionListIconText: React.ForwardRefExoticComponent<Omit<DescriptionListIconTextProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
141
|
+
export { DescriptionList, DescriptionListItem, DescriptionListTerm, DescriptionListDetails, DescriptionListIconText, descriptionListVariants, };
|
|
142
|
+
//# sourceMappingURL=description-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"description-list.d.ts","sourceRoot":"","sources":["../../src/components/description-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B;;;;;;;;GAQG;AACH,MAAM,MAAM,qBAAqB,GAC/B,QAAQ,GAAG,SAAS,GAAG,YAAY,GAAG,WAAW,GAAG,MAAM,CAAC;AAE7D;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,KAAK,CAAC;AAiBnD,QAAA,MAAM,uBAAuB;;;8EAiC3B,CAAC;AA6DH;;;GAGG;AACH,MAAM,WAAW,oBAAqB,SAAQ,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC;IACtE;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAC7B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;;GAeG;AACH,QAAA,MAAM,eAAe,4GA2DpB,CAAC;AAOF;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IAC3E;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,QAAA,MAAM,mBAAmB,8GAqBvB,CAAC;AAOH;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC;IAC1E;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,QAAA,MAAM,mBAAmB,2GAsBvB,CAAC;AAOH;;GAEG;AACH,MAAM,WAAW,2BAA4B,SAAQ,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC;IAC7E;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC;CAChC;AAED;;;GAGG;AACH,QAAA,MAAM,sBAAsB,8GAqB1B,CAAC;AAOH;;GAEG;AACH,MAAM,WAAW,4BAA6B,SAAQ,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC;IAChF;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;CACvB;AAED;;GAEG;AACH,QAAA,MAAM,uBAAuB,mHAqB3B,CAAC;AAOH,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,GACxB,CAAC"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as a from "react";
|
|
3
|
+
import { cn as d } from "@brightlocal/ui-components/lib/utils";
|
|
4
|
+
import { jsx as o, jsxs as y } from "react/jsx-runtime";
|
|
5
|
+
import { cva as f } from "class-variance-authority";
|
|
6
|
+
var c = a.createContext({
|
|
7
|
+
layout: "inline",
|
|
8
|
+
align: "start",
|
|
9
|
+
autoTerm: !1
|
|
10
|
+
}), w = f("min-w-0", {
|
|
11
|
+
variants: {
|
|
12
|
+
layout: {
|
|
13
|
+
inline: "flex flex-col",
|
|
14
|
+
stacked: "flex flex-col",
|
|
15
|
+
responsive: "flex flex-col",
|
|
16
|
+
container: "flex flex-col",
|
|
17
|
+
grid: "grid grid-cols-[repeat(auto-fill,minmax(8rem,1fr))] gap-x-6 gap-y-4"
|
|
18
|
+
},
|
|
19
|
+
divided: {
|
|
20
|
+
true: [
|
|
21
|
+
"divide-border divide-y",
|
|
22
|
+
"[&>[data-slot=description-list-item]]:py-3",
|
|
23
|
+
"[&>[data-slot=description-list-item]:first-child]:pt-0",
|
|
24
|
+
"[&>[data-slot=description-list-item]:last-child]:pb-0"
|
|
25
|
+
],
|
|
26
|
+
false: ""
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
compoundVariants: [
|
|
30
|
+
{
|
|
31
|
+
layout: "inline",
|
|
32
|
+
divided: !1,
|
|
33
|
+
className: "gap-3"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
layout: "stacked",
|
|
37
|
+
divided: !1,
|
|
38
|
+
className: "gap-3"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
layout: "responsive",
|
|
42
|
+
divided: !1,
|
|
43
|
+
className: "gap-3"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
layout: "container",
|
|
47
|
+
divided: !1,
|
|
48
|
+
className: "gap-3"
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
defaultVariants: {
|
|
52
|
+
layout: "inline",
|
|
53
|
+
divided: !1
|
|
54
|
+
}
|
|
55
|
+
}), b = f("flex min-w-0", {
|
|
56
|
+
variants: { layout: {
|
|
57
|
+
inline: "flex-row items-baseline gap-4",
|
|
58
|
+
stacked: "flex-col gap-1",
|
|
59
|
+
responsive: "flex-col gap-1 sm:flex-row sm:items-baseline sm:gap-4",
|
|
60
|
+
container: "flex-col gap-1 @md:flex-row @md:items-baseline @md:gap-4",
|
|
61
|
+
grid: "flex-col gap-1"
|
|
62
|
+
} },
|
|
63
|
+
defaultVariants: { layout: "inline" }
|
|
64
|
+
}), N = f("text-muted-foreground text-body-sm shrink-0", {
|
|
65
|
+
variants: { layout: {
|
|
66
|
+
inline: "w-(--dl-term-width)",
|
|
67
|
+
stacked: "",
|
|
68
|
+
responsive: "sm:w-(--dl-term-width)",
|
|
69
|
+
container: "@md:w-(--dl-term-width)",
|
|
70
|
+
grid: ""
|
|
71
|
+
} },
|
|
72
|
+
defaultVariants: { layout: "inline" }
|
|
73
|
+
}), h = {
|
|
74
|
+
inline: "grid grid-cols-[max-content_1fr] gap-x-4",
|
|
75
|
+
responsive: "sm:grid sm:grid-cols-[max-content_1fr] sm:gap-x-4",
|
|
76
|
+
container: "@md:grid @md:grid-cols-[max-content_1fr] @md:gap-x-4"
|
|
77
|
+
}, D = {
|
|
78
|
+
inline: "col-span-2 grid grid-cols-subgrid",
|
|
79
|
+
responsive: "sm:col-span-2 sm:grid sm:grid-cols-subgrid",
|
|
80
|
+
container: "@md:col-span-2 @md:grid @md:grid-cols-subgrid"
|
|
81
|
+
}, L = [
|
|
82
|
+
"inline",
|
|
83
|
+
"responsive",
|
|
84
|
+
"container"
|
|
85
|
+
], k = a.forwardRef(({ className: s, style: r, layout: e = "inline", termWidth: t = 128, align: i = "start", divided: n = !1, dataHook: l, trackingEl: m, trackingLabel: g, ...u }, x) => {
|
|
86
|
+
const p = L.includes(e) && !(i === "end" && e === "inline") && t === "auto", v = a.useMemo(() => ({
|
|
87
|
+
layout: e,
|
|
88
|
+
align: i,
|
|
89
|
+
autoTerm: p
|
|
90
|
+
}), [
|
|
91
|
+
e,
|
|
92
|
+
i,
|
|
93
|
+
p
|
|
94
|
+
]);
|
|
95
|
+
return /* @__PURE__ */ o(c.Provider, {
|
|
96
|
+
value: v,
|
|
97
|
+
children: /* @__PURE__ */ o("dl", {
|
|
98
|
+
ref: x,
|
|
99
|
+
className: d(w({
|
|
100
|
+
layout: e,
|
|
101
|
+
divided: e === "grid" ? !1 : n
|
|
102
|
+
}), p && h[e], s),
|
|
103
|
+
"data-align": i,
|
|
104
|
+
"data-hook": l,
|
|
105
|
+
"data-layout": e,
|
|
106
|
+
"data-slot": "description-list",
|
|
107
|
+
"data-tracking-el": m || "description-list",
|
|
108
|
+
"data-tracking-label": g,
|
|
109
|
+
style: {
|
|
110
|
+
...typeof t == "number" && { "--dl-term-width": `${t}px` },
|
|
111
|
+
...r
|
|
112
|
+
},
|
|
113
|
+
...u
|
|
114
|
+
})
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
k.displayName = "DescriptionList";
|
|
118
|
+
var T = a.forwardRef(({ className: s, dataHook: r, ...e }, t) => {
|
|
119
|
+
const { layout: i, align: n, autoTerm: l } = a.useContext(c), m = n === "end" && i === "inline";
|
|
120
|
+
return /* @__PURE__ */ o("div", {
|
|
121
|
+
ref: t,
|
|
122
|
+
className: d(b({ layout: i }), m && "justify-between", l && D[i], s),
|
|
123
|
+
"data-hook": r,
|
|
124
|
+
"data-slot": "description-list-item",
|
|
125
|
+
...e
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
T.displayName = "DescriptionListItem";
|
|
129
|
+
var I = a.forwardRef(({ className: s, dataHook: r, ...e }, t) => {
|
|
130
|
+
const { layout: i, align: n, autoTerm: l } = a.useContext(c);
|
|
131
|
+
return /* @__PURE__ */ o("dt", {
|
|
132
|
+
ref: t,
|
|
133
|
+
className: d(N({ layout: n === "end" || l ? "stacked" : i }), s),
|
|
134
|
+
"data-hook": r,
|
|
135
|
+
"data-slot": "description-list-term",
|
|
136
|
+
...e
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
I.displayName = "DescriptionListTerm";
|
|
140
|
+
var C = a.forwardRef(({ className: s, color: r = "foreground", dataHook: e, ...t }, i) => {
|
|
141
|
+
const { layout: n, align: l } = a.useContext(c);
|
|
142
|
+
return /* @__PURE__ */ o("dd", {
|
|
143
|
+
ref: i,
|
|
144
|
+
className: d("text-body-sm min-w-0 flex-1 break-words", r === "muted" ? "text-muted-foreground" : "text-foreground", l === "end" && n === "inline" && "text-right tabular-nums", s),
|
|
145
|
+
"data-hook": e,
|
|
146
|
+
"data-slot": "description-list-details",
|
|
147
|
+
...t
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
C.displayName = "DescriptionListDetails";
|
|
151
|
+
var V = a.forwardRef(({ className: s, icon: r, children: e, ...t }, i) => /* @__PURE__ */ y("span", {
|
|
152
|
+
ref: i,
|
|
153
|
+
className: d("inline-flex max-w-full items-center gap-2 align-bottom [&_svg:not([class*='size-'])]:size-4", s),
|
|
154
|
+
"data-slot": "description-list-icon-text",
|
|
155
|
+
...t,
|
|
156
|
+
children: [/* @__PURE__ */ o("span", {
|
|
157
|
+
"aria-hidden": "true",
|
|
158
|
+
className: "inline-flex size-4 shrink-0 items-center justify-center",
|
|
159
|
+
children: r
|
|
160
|
+
}), /* @__PURE__ */ o("span", {
|
|
161
|
+
className: "min-w-0",
|
|
162
|
+
children: e
|
|
163
|
+
})]
|
|
164
|
+
}));
|
|
165
|
+
V.displayName = "DescriptionListIconText";
|
|
166
|
+
export {
|
|
167
|
+
k as DescriptionList,
|
|
168
|
+
C as DescriptionListDetails,
|
|
169
|
+
V as DescriptionListIconText,
|
|
170
|
+
T as DescriptionListItem,
|
|
171
|
+
I as DescriptionListTerm,
|
|
172
|
+
w as descriptionListVariants
|
|
173
|
+
};
|
package/dist/description.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const s=require("./_virtual/_rolldown/runtime.cjs");let e=require("react");e=s.__toESM(e,1);let c=require("@brightlocal/ui-components/lib/utils"),u=require("react/jsx-runtime");var t=e.forwardRef(({className:r,dataHook:i,trackingEl:a,trackingLabel:n,...o},l)=>(0,u.jsx)("p",{ref:l,className:(0,c.cn)("text-body-sm text-muted-foreground text-left","[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",r),"data-hook":i,"data-slot":"description","data-tracking-el":a||"description","data-tracking-label":n,...o}));t.displayName="Description";exports.Description=t;
|
package/dist/description.js
CHANGED
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
2
1
|
import * as d from "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"data-hook": e,
|
|
15
|
-
"data-slot": "description",
|
|
16
|
-
"data-tracking-el": r || "description",
|
|
17
|
-
"data-tracking-label": a,
|
|
18
|
-
...o
|
|
19
|
-
}
|
|
20
|
-
)
|
|
21
|
-
);
|
|
2
|
+
import { cn as n } from "@brightlocal/ui-components/lib/utils";
|
|
3
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
4
|
+
var m = d.forwardRef(({ className: t, dataHook: e, trackingEl: r, trackingLabel: a, ...o }, i) => /* @__PURE__ */ s("p", {
|
|
5
|
+
ref: i,
|
|
6
|
+
className: n("text-body-sm text-muted-foreground text-left", "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4", t),
|
|
7
|
+
"data-hook": e,
|
|
8
|
+
"data-slot": "description",
|
|
9
|
+
"data-tracking-el": r || "description",
|
|
10
|
+
"data-tracking-label": a,
|
|
11
|
+
...o
|
|
12
|
+
}));
|
|
22
13
|
m.displayName = "Description";
|
|
23
14
|
export {
|
|
24
15
|
m as Description
|
package/dist/dialog.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use
|
|
1
|
+
"use client";const g=require("./_virtual/_rolldown/runtime.cjs");let i=require("react");i=g.__toESM(i,1);let N=require("@brightlocal/icons"),s=require("@brightlocal/ui-components/lib/utils"),t=require("react/jsx-runtime"),j=require("@brightlocal/ui-components/hooks/use-overlay-pointer-lock"),l=require("@radix-ui/react-dialog");l=g.__toESM(l,1);var c=l.Root;c.displayName="Dialog";var u=i.forwardRef(({dataHook:a,...e},o)=>(0,t.jsx)(l.Trigger,{ref:o,"data-slot":"dialog-trigger",...a!=null&&{"data-hook":a},...e}));u.displayName="DialogTrigger";function d({...a}){return(0,t.jsx)(l.Portal,{...a})}d.displayName="DialogPortal";var f=i.forwardRef(({...a},e)=>(0,t.jsx)(l.Close,{ref:e,"data-slot":"dialog-close",...a}));f.displayName="DialogClose";var n=i.forwardRef(({className:a,...e},o)=>(0,t.jsx)(l.Overlay,{ref:o,className:(0,s.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=open]:duration-slow fixed inset-0 z-50 bg-black/50 ease-out data-[state=closed]:duration-250 data-[state=closed]:ease-in",a),"data-slot":"dialog-overlay",...e}));n.displayName="DialogOverlay";var p=i.forwardRef(({className:a,children:e,dataHook:o,trackingEl:r,trackingLabel:v,closeLabel:y,...b},h)=>((0,j.useOverlayPointerLock)(),(0,t.jsxs)(d,{children:[(0,t.jsx)(n,{}),(0,t.jsxs)(l.Content,{ref:h,className:(0,s.cn)("bg-background text-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 border-card-border data-[state=open]:duration-slow fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-8 rounded-xl border p-8 shadow-lg ease-out data-[state=closed]:duration-250 data-[state=closed]:ease-in sm:max-w-lg",a),"data-hook":o,"data-slot":"dialog-content","data-tracking-el":r,"data-tracking-label":v,...b,children:[e,(0,t.jsxs)(l.Close,{className:"ring-offset-background focus-visible:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground duration-fast absolute top-8 right-8 rounded-xs opacity-70 outline-hidden transition-opacity ease-out hover:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0",children:[(0,t.jsx)(N.X,{}),(0,t.jsx)("span",{className:"sr-only",children:y??"Close"})]})]})]})));p.displayName="DialogContent";var m=i.forwardRef(({className:a,...e},o)=>(0,t.jsx)("div",{ref:o,className:(0,s.cn)("flex flex-col gap-2 text-center sm:text-left",a),"data-slot":"dialog-header",...e}));m.displayName="DialogHeader";var x=i.forwardRef(({className:a,...e},o)=>(0,t.jsx)("div",{ref:o,className:(0,s.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",a),"data-slot":"dialog-footer",...e}));x.displayName="DialogFooter";var D=i.forwardRef(({className:a,dataHook:e,...o},r)=>(0,t.jsx)(l.Title,{ref:r,className:(0,s.cn)("text-heading-section",a),"data-hook":e,"data-slot":"dialog-title",...o}));D.displayName="DialogTitle";var _=i.forwardRef(({className:a,dataHook:e,...o},r)=>(0,t.jsx)(l.Description,{ref:r,className:(0,s.cn)("text-body-sm text-muted-foreground",a),"data-hook":e,"data-slot":"dialog-description",...o}));_.displayName="DialogDescription";exports.Dialog=c;exports.DialogClose=f;exports.DialogContent=p;exports.DialogDescription=_;exports.DialogFooter=x;exports.DialogHeader=m;exports.DialogOverlay=n;exports.DialogPortal=d;exports.DialogTitle=D;exports.DialogTrigger=u;
|
package/dist/dialog.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ declare const DialogTrigger: React.ForwardRefExoticComponent<Omit<DialogTriggerP
|
|
|
23
23
|
* DialogPortal - Portal for rendering dialog outside of DOM hierarchy
|
|
24
24
|
* @description Renders dialog content in a React portal
|
|
25
25
|
*/
|
|
26
|
-
declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>):
|
|
26
|
+
declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element;
|
|
27
27
|
declare namespace DialogPortal {
|
|
28
28
|
var displayName: string;
|
|
29
29
|
}
|
package/dist/dialog.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/components/dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAM1D;;;GAGG;AACH,QAAA,MAAM,MAAM,uCAAuB,CAAC;AAGpC;;GAEG;AACH,UAAU,kBAAmB,SAAQ,KAAK,CAAC,cAAc,CACvD,OAAO,eAAe,CAAC,OAAO,CAC/B;IACC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,QAAA,MAAM,aAAa,2GAUjB,CAAC;AAGH;;;GAGG;AACH,iBAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/components/dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAM1D;;;GAGG;AACH,QAAA,MAAM,MAAM,uCAAuB,CAAC;AAGpC;;GAEG;AACH,UAAU,kBAAmB,SAAQ,KAAK,CAAC,cAAc,CACvD,OAAO,eAAe,CAAC,OAAO,CAC/B;IACC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,QAAA,MAAM,aAAa,2GAUjB,CAAC;AAGH;;;GAGG;AACH,iBAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,MAAM,CAAC,qBAErD;kBAJQ,YAAY;;;AAOrB;;;GAGG;AACH,QAAA,MAAM,WAAW,kKAKf,CAAC;AAGH;;;GAGG;AACH,QAAA,MAAM,aAAa,8JAajB,CAAC;AAGH;;GAEG;AACH,UAAU,kBAAmB,SAAQ,KAAK,CAAC,cAAc,CACvD,OAAO,eAAe,CAAC,OAAO,CAC/B;IACC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,QAAA,MAAM,aAAa,wGAwClB,CAAC;AAGF;;;GAGG;AACH,QAAA,MAAM,YAAY,mKAUhB,CAAC;AAGH;;;GAGG;AACH,QAAA,MAAM,YAAY,mKAahB,CAAC;AAGH;;GAEG;AACH,UAAU,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CACrD,OAAO,eAAe,CAAC,KAAK,CAC7B;IACC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,QAAA,MAAM,WAAW,0GAWf,CAAC;AAGH;;GAEG;AACH,UAAU,sBAAuB,SAAQ,KAAK,CAAC,cAAc,CAC3D,OAAO,eAAe,CAAC,WAAW,CACnC;IACC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,QAAA,MAAM,iBAAiB,kHAWrB,CAAC;AAGH,OAAO,EACL,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,GACd,CAAC;AAEF,YAAY,EACV,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,GACnB,CAAC"}
|