@brightlocal/ui-components 3.2.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 +3 -1
- package/component-meta.json +1271 -428
- 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 +136 -176
- 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.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 +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +630 -608
- 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 +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.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 +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 -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 +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 +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 +46 -46
- package/src/blocks/empty-state.tsx +34 -18
- 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/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 +14 -2
- 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 +6 -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/header.js
CHANGED
|
@@ -1,41 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
variants: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
trackingLabel: i,
|
|
23
|
-
children: s,
|
|
24
|
-
...f
|
|
25
|
-
}, l) => /* @__PURE__ */ n(
|
|
26
|
-
"header",
|
|
27
|
-
{
|
|
28
|
-
ref: l,
|
|
29
|
-
className: c(m({ align: e }), a),
|
|
30
|
-
"data-hook": t,
|
|
31
|
-
"data-slot": "header",
|
|
32
|
-
"data-tracking-el": r,
|
|
33
|
-
"data-tracking-label": i,
|
|
34
|
-
...f,
|
|
35
|
-
children: s
|
|
36
|
-
}
|
|
37
|
-
)
|
|
38
|
-
);
|
|
1
|
+
import * as d from "react";
|
|
2
|
+
import { cn as n } from "@brightlocal/ui-components/lib/utils";
|
|
3
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
4
|
+
import { cva as m } from "class-variance-authority";
|
|
5
|
+
var c = m("flex w-full items-center", {
|
|
6
|
+
variants: { align: {
|
|
7
|
+
left: "justify-start",
|
|
8
|
+
center: "justify-center",
|
|
9
|
+
right: "justify-end"
|
|
10
|
+
} },
|
|
11
|
+
defaultVariants: { align: "left" }
|
|
12
|
+
}), p = d.forwardRef(({ className: a, dataHook: e, align: t = "left", trackingEl: r, trackingLabel: i, children: f, ...l }, s) => /* @__PURE__ */ o("header", {
|
|
13
|
+
ref: s,
|
|
14
|
+
className: n(c({ align: t }), a),
|
|
15
|
+
"data-hook": e,
|
|
16
|
+
"data-slot": "header",
|
|
17
|
+
"data-tracking-el": r,
|
|
18
|
+
"data-tracking-label": i,
|
|
19
|
+
...l,
|
|
20
|
+
children: f
|
|
21
|
+
}));
|
|
39
22
|
p.displayName = "Header";
|
|
40
23
|
export {
|
|
41
24
|
p as Header
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use
|
|
1
|
+
"use client";const f=require("./_virtual/_rolldown/runtime.cjs");let t=require("react");t=f.__toESM(t,1);let g=require("@brightlocal/ui-components/lib/utils"),u=require("react/jsx-runtime");function b(){const n=t.useRef(null),[r,o]=t.useState();return t.useLayoutEffect(()=>{const e=n.current;if(!e||typeof ResizeObserver>"u")return;const i=new ResizeObserver(s=>{if(e.offsetParent===null)return;const a=s[0]?.borderBoxSize?.[0]?.blockSize??e.getBoundingClientRect().height;o(a)});return i.observe(e),()=>i.disconnect()},[]),{contentRef:n,height:r}}var c=t.forwardRef(({className:n,style:r,dataHook:o,trackingEl:e,trackingLabel:i,children:s,...a},l)=>{const{contentRef:h,height:d}=b();return(0,u.jsx)("div",{ref:l,className:(0,g.cn)("duration-base overflow-hidden transition-[height] ease-out",n),"data-hook":o,"data-slot":"height-transition","data-tracking-el":e||"height-transition","data-tracking-label":i,style:{...r,height:d},...a,children:(0,u.jsx)("div",{ref:h,className:"flow-root","data-slot":"height-transition-content",children:s})})});c.displayName="HeightTransition";exports.HeightTransition=c;
|
|
@@ -1,62 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
import * as
|
|
3
|
-
import { cn as
|
|
1
|
+
"use client";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import { cn as d } from "@brightlocal/ui-components/lib/utils";
|
|
4
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
4
5
|
function l() {
|
|
5
|
-
const
|
|
6
|
-
return
|
|
7
|
-
const
|
|
8
|
-
if (!
|
|
9
|
-
return;
|
|
6
|
+
const t = i.useRef(null), [r, o] = i.useState();
|
|
7
|
+
return i.useLayoutEffect(() => {
|
|
8
|
+
const e = t.current;
|
|
9
|
+
if (!e || typeof ResizeObserver > "u") return;
|
|
10
10
|
const n = new ResizeObserver((s) => {
|
|
11
|
-
if (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
i(a);
|
|
11
|
+
if (e.offsetParent === null) return;
|
|
12
|
+
const a = s[0]?.borderBoxSize?.[0]?.blockSize ?? e.getBoundingClientRect().height;
|
|
13
|
+
o(a);
|
|
15
14
|
});
|
|
16
|
-
return n.observe(
|
|
17
|
-
}, []), {
|
|
15
|
+
return n.observe(e), () => n.disconnect();
|
|
16
|
+
}, []), {
|
|
17
|
+
contentRef: t,
|
|
18
|
+
height: r
|
|
19
|
+
};
|
|
18
20
|
}
|
|
19
|
-
|
|
20
|
-
(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"data-tracking-label": n,
|
|
42
|
-
style: {
|
|
43
|
-
...r,
|
|
44
|
-
height: d
|
|
45
|
-
},
|
|
46
|
-
...c,
|
|
47
|
-
children: /* @__PURE__ */ f(
|
|
48
|
-
"div",
|
|
49
|
-
{
|
|
50
|
-
ref: h,
|
|
51
|
-
className: "flow-root",
|
|
52
|
-
"data-slot": "height-transition-content",
|
|
53
|
-
children: s
|
|
54
|
-
}
|
|
55
|
-
)
|
|
56
|
-
}
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
);
|
|
21
|
+
var g = i.forwardRef(({ className: t, style: r, dataHook: o, trackingEl: e, trackingLabel: n, children: s, ...a }, f) => {
|
|
22
|
+
const { contentRef: h, height: u } = l();
|
|
23
|
+
return /* @__PURE__ */ c("div", {
|
|
24
|
+
ref: f,
|
|
25
|
+
className: d("duration-base overflow-hidden transition-[height] ease-out", t),
|
|
26
|
+
"data-hook": o,
|
|
27
|
+
"data-slot": "height-transition",
|
|
28
|
+
"data-tracking-el": e || "height-transition",
|
|
29
|
+
"data-tracking-label": n,
|
|
30
|
+
style: {
|
|
31
|
+
...r,
|
|
32
|
+
height: u
|
|
33
|
+
},
|
|
34
|
+
...a,
|
|
35
|
+
children: /* @__PURE__ */ c("div", {
|
|
36
|
+
ref: h,
|
|
37
|
+
className: "flow-root",
|
|
38
|
+
"data-slot": "height-transition-content",
|
|
39
|
+
children: s
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
});
|
|
60
43
|
g.displayName = "HeightTransition";
|
|
61
44
|
export {
|
|
62
45
|
g as HeightTransition
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const c=require("../_virtual/_rolldown/runtime.cjs");let n=require("react");n=c.__toESM(n,1);var a={xs:480,sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function o(e="sm"){if(typeof document>"u")return a[e];const r=getComputedStyle(document.documentElement).getPropertyValue(`--ds-breakpoint-${e}`).trim(),t=parseInt(r,10);return Number.isNaN(t)?a[e]:t}function d(e="sm"){return typeof window<"u"&&window.innerWidth<o(e)}function m(e="sm"){const[r,t]=n.useState(()=>d(e));return n.useEffect(()=>{const i=o(e),u=window.matchMedia(`(max-width: ${i-1}px)`),s=()=>{t(window.innerWidth<i)};return u.addEventListener("change",s),()=>u.removeEventListener("change",s)},[e]),r}exports.getBreakpointValue=o;exports.isBelowBreakpoint=d;exports.useIsBelowBreakpoint=m;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as s from "react";
|
|
2
|
-
|
|
2
|
+
var a = {
|
|
3
3
|
xs: 480,
|
|
4
4
|
sm: 640,
|
|
5
5
|
md: 768,
|
|
@@ -7,25 +7,25 @@ const d = {
|
|
|
7
7
|
xl: 1280,
|
|
8
8
|
"2xl": 1536
|
|
9
9
|
};
|
|
10
|
-
function
|
|
11
|
-
if (typeof document > "u") return
|
|
10
|
+
function d(e = "sm") {
|
|
11
|
+
if (typeof document > "u") return a[e];
|
|
12
12
|
const n = getComputedStyle(document.documentElement).getPropertyValue(`--ds-breakpoint-${e}`).trim(), t = parseInt(n, 10);
|
|
13
|
-
return Number.isNaN(t) ?
|
|
13
|
+
return Number.isNaN(t) ? a[e] : t;
|
|
14
14
|
}
|
|
15
15
|
function u(e = "sm") {
|
|
16
|
-
return typeof window < "u" && window.innerWidth <
|
|
16
|
+
return typeof window < "u" && window.innerWidth < d(e);
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function m(e = "sm") {
|
|
19
19
|
const [n, t] = s.useState(() => u(e));
|
|
20
20
|
return s.useEffect(() => {
|
|
21
|
-
const o =
|
|
21
|
+
const o = d(e), r = window.matchMedia(`(max-width: ${o - 1}px)`), i = () => {
|
|
22
22
|
t(window.innerWidth < o);
|
|
23
23
|
};
|
|
24
24
|
return r.addEventListener("change", i), () => r.removeEventListener("change", i);
|
|
25
25
|
}, [e]), n;
|
|
26
26
|
}
|
|
27
27
|
export {
|
|
28
|
-
|
|
28
|
+
d as getBreakpointValue,
|
|
29
29
|
u as isBelowBreakpoint,
|
|
30
|
-
|
|
30
|
+
m as useIsBelowBreakpoint
|
|
31
31
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
let r=require("react");function l(u,t=300){const[s,n]=(0,r.useState)(u),e=(0,r.useRef)(null),c=(0,r.useRef)(u);return(0,r.useEffect)(()=>{c.current=u},[u]),(0,r.useEffect)(()=>(e.current=setTimeout(()=>{e.current=null,n(u)},t),()=>{e.current&&(clearTimeout(e.current),e.current=null)}),[u,t]),{debouncedValue:s,flush:(0,r.useCallback)(()=>{e.current&&(clearTimeout(e.current),e.current=null),n(c.current)},[])}}exports.useDebounce=l;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function
|
|
3
|
-
const [s, u] = f(r), e =
|
|
4
|
-
|
|
1
|
+
import { useCallback as l, useEffect as c, useRef as o, useState as f } from "react";
|
|
2
|
+
function m(r, t = 300) {
|
|
3
|
+
const [s, u] = f(r), e = o(null), n = o(r);
|
|
4
|
+
return c(() => {
|
|
5
5
|
n.current = r;
|
|
6
|
-
}, [r]),
|
|
6
|
+
}, [r]), c(() => (e.current = setTimeout(() => {
|
|
7
7
|
e.current = null, u(r);
|
|
8
8
|
}, t), () => {
|
|
9
9
|
e.current && (clearTimeout(e.current), e.current = null);
|
|
10
|
-
}), [r, t])
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
}), [r, t]), {
|
|
11
|
+
debouncedValue: s,
|
|
12
|
+
flush: l(() => {
|
|
13
|
+
e.current && (clearTimeout(e.current), e.current = null), u(n.current);
|
|
14
|
+
}, [])
|
|
15
|
+
};
|
|
15
16
|
}
|
|
16
17
|
export {
|
|
17
|
-
|
|
18
|
+
m as useDebounce
|
|
18
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
let s=require("react");var l=150;function n(e,t=150){const[u,r]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{if(!e)return;const a=setTimeout(()=>r(!0),t);return()=>{clearTimeout(a),r(!1)}},[e,t]),e&&u}exports.FLASH_THRESHOLD_MS=l;exports.useDelayedPending=n;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
function
|
|
4
|
-
const [s, r] =
|
|
5
|
-
return
|
|
6
|
-
if (!e)
|
|
7
|
-
return;
|
|
1
|
+
import { useEffect as o, useState as a } from "react";
|
|
2
|
+
var c = 150;
|
|
3
|
+
function i(e, t = 150) {
|
|
4
|
+
const [s, r] = a(!1);
|
|
5
|
+
return o(() => {
|
|
6
|
+
if (!e) return;
|
|
8
7
|
const u = setTimeout(() => r(!0), t);
|
|
9
8
|
return () => {
|
|
10
9
|
clearTimeout(u), r(!1);
|
|
@@ -12,6 +11,6 @@ function n(e, t = a) {
|
|
|
12
11
|
}, [e, t]), e && s;
|
|
13
12
|
}
|
|
14
13
|
export {
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
c as FLASH_THRESHOLD_MS,
|
|
15
|
+
i as useDelayedPending
|
|
17
16
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";const P=require("../_virtual/_rolldown/runtime.cjs");let i=require("react");i=P.__toESM(i,1);var b="ds:filter-search-params";function $(e){return window.addEventListener("popstate",e),window.addEventListener(b,e),()=>{window.removeEventListener("popstate",e),window.removeEventListener(b,e)}}var q=()=>window.location.search,M=()=>"",S=null;function j(e){if(e!==void 0)return e===""||e.startsWith("?")?e:`?${e}`}function N(e,t){const r=new URLSearchParams(t),n={};for(const u of Object.keys(e)){const p=y(e,u),l=r.get(u);n[u]=l===null?p.default:p.parse(l)}return n}function y(e,t){return e[t]}function L(e,t){return e.serialize(t)===e.serialize(e.default)}function R(e,t={}){const r=i.useSyncExternalStore($,q,M),n=j(t.search)??r,u=i.useMemo(()=>N(e,n),[e,n]),p=i.useMemo(()=>Object.keys(e).filter(s=>!L(y(e,s),u[s])),[e,u]),l=i.useRef({schema:e,options:t});i.useEffect(()=>{l.current={schema:e,options:t}});const E=i.useCallback(s=>{const{schema:f,options:o}=l.current,a=j(o.search)??window.location.search,d=S&&S.from===a?S.to:a,c=new URLSearchParams(d);for(const[w,z]of Object.entries(s)){const h=f[w];if(!h)continue;const O=z===void 0?h.default:z;L(h,O)?c.delete(w):c.set(w,h.serialize(O))}const g=c.toString(),m=g?`?${g}`:"";if(m===d)return;S={from:a,to:m};const k=(o.history??"replace")==="replace";if(o.navigate)o.navigate(m,{replace:k});else{const w=`${window.location.pathname}${m}${window.location.hash}`;k?window.history.replaceState(window.history.state,"",w):window.history.pushState(window.history.state,"",w)}window.dispatchEvent(new Event(b))},[]),v=i.useCallback(s=>{const{schema:f,options:o}=l.current,a=o.resetOnChange??("page"in f?["page"]:[]),d={...s};if(Object.keys(s).some(c=>!a.includes(c)))for(const c of a)c in d||(d[c]=y(f,c).default);E(d)},[E]);return{values:u,set:i.useCallback(s=>v(s),[v]),reset:i.useCallback(s=>{const{schema:f}=l.current,o={};for(const a of s??Object.keys(f))o[a]=y(f,a).default;v(o)},[v]),changed:p,search:n}}var _={string(e=""){return{default:e,parse:t=>t,serialize:t=>t}},oneOf(e,t){return{default:t,parse:r=>e.find(n=>n===r)??t,serialize:r=>r}},list(e,t=[]){return{default:t,parse:r=>r.split(",").filter(n=>e.includes(n)),serialize:r=>r.join(",")}},number(e,t=1){return{default:e,parse:r=>{if(!/^\d+$/.test(r))return e;const n=Number(r);return Number.isSafeInteger(n)&&n>=t?n:e},serialize:r=>String(r)}},boolean(e=!1){return{default:e,parse:t=>t==="1"||t==="true",serialize:t=>t?"1":"0"}}};exports.filterParam=_;exports.useFilterSearchParams=R;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How one key reads from and writes to the query string. Build these with
|
|
3
|
+
* `filterParam` rather than by hand.
|
|
4
|
+
*/
|
|
5
|
+
export interface FilterParamCodec<T> {
|
|
6
|
+
/** The value when the key is absent from the link. */
|
|
7
|
+
default: T;
|
|
8
|
+
/** Reads the raw string. Anything unknown comes back as the default. */
|
|
9
|
+
parse(raw: string): T;
|
|
10
|
+
/** Writes the value. The key is dropped when this equals the default's. */
|
|
11
|
+
serialize(value: T): string;
|
|
12
|
+
}
|
|
13
|
+
export type FilterParamSchema = Record<string, FilterParamCodec<unknown>>;
|
|
14
|
+
/** The decoded values of a schema. */
|
|
15
|
+
export type FilterParamValues<S extends FilterParamSchema> = {
|
|
16
|
+
[K in keyof S]: S[K] extends FilterParamCodec<infer T> ? T : never;
|
|
17
|
+
};
|
|
18
|
+
export interface UseFilterSearchParamsOptions<S extends FilterParamSchema> {
|
|
19
|
+
/**
|
|
20
|
+
* Keys that go back to their default whenever another key changes — the
|
|
21
|
+
* pattern's "any filter, search or sort change goes back to page 1".
|
|
22
|
+
* @default ["page"] when the schema has a `page` key, otherwise none
|
|
23
|
+
*/
|
|
24
|
+
resetOnChange?: (keyof S)[];
|
|
25
|
+
/**
|
|
26
|
+
* `"replace"` rewrites the current history entry so filtering doesn't fill
|
|
27
|
+
* the back button; `"push"` adds one per change.
|
|
28
|
+
* @default "replace"
|
|
29
|
+
*/
|
|
30
|
+
history?: "push" | "replace";
|
|
31
|
+
/**
|
|
32
|
+
* Hand the write to a router instead of `window.history` — React Router's
|
|
33
|
+
* `navigate({ search }, { replace })`, Next's `router.replace(...)`. Pair
|
|
34
|
+
* it with `search` when the router commits the address asynchronously.
|
|
35
|
+
*/
|
|
36
|
+
navigate?: (search: string, options: {
|
|
37
|
+
replace: boolean;
|
|
38
|
+
}) => void;
|
|
39
|
+
/**
|
|
40
|
+
* The query string to read when a router owns it — React Router's
|
|
41
|
+
* `useLocation().search`, Next's `useSearchParams().toString()`; with or
|
|
42
|
+
* without the leading `?`. Without it the hook reads `window.location`,
|
|
43
|
+
* which is current as long as the URL is written through `window.history`.
|
|
44
|
+
* A router that commits the address asynchronously (a data router with
|
|
45
|
+
* loaders, Next's app router) updates `window.location` only after
|
|
46
|
+
* `navigate` returns, so pass its search here to stay in step with it.
|
|
47
|
+
*/
|
|
48
|
+
search?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface UseFilterSearchParamsResult<S extends FilterParamSchema> {
|
|
51
|
+
/** The current values, decoded from the link. */
|
|
52
|
+
values: FilterParamValues<S>;
|
|
53
|
+
/**
|
|
54
|
+
* Change one or more keys in a single write. Keys in `resetOnChange` go
|
|
55
|
+
* back to default; a key set to `undefined` goes back to its default too.
|
|
56
|
+
*/
|
|
57
|
+
set: (patch: Partial<FilterParamValues<S>>) => void;
|
|
58
|
+
/**
|
|
59
|
+
* Put the given keys — or every key — back to their default. Keys in
|
|
60
|
+
* `resetOnChange` go back too, so clearing a filter also returns to page 1.
|
|
61
|
+
*/
|
|
62
|
+
reset: (keys?: (keyof S)[]) => void;
|
|
63
|
+
/** The keys that are off their default: "Clear filters" shows while any filter key is here. */
|
|
64
|
+
changed: (keyof S)[];
|
|
65
|
+
/** The query string as it stands (with the leading `?`, or empty), for building links. */
|
|
66
|
+
search: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Keeps a section's filters, search, sort and page in the link, so sharing the
|
|
70
|
+
* address shares the view and the back button works. Defaults stay out of the
|
|
71
|
+
* address; keys the schema doesn't name (a router's own, `utm_*`) are left
|
|
72
|
+
* untouched; any change to one key resets the `page` key, as the Filtering
|
|
73
|
+
* pattern asks. Layout and density belong in local storage, the selection
|
|
74
|
+
* nowhere — don't put them here.
|
|
75
|
+
*
|
|
76
|
+
* @param schema - One `filterParam` codec per key, defined outside the component.
|
|
77
|
+
* @param options - Which keys reset on change, replace vs push, and a router's navigate and search.
|
|
78
|
+
*/
|
|
79
|
+
export declare function useFilterSearchParams<S extends FilterParamSchema>(schema: S, options?: UseFilterSearchParamsOptions<S>): UseFilterSearchParamsResult<S>;
|
|
80
|
+
/** Codecs for the usual keys. Each takes the default — what an absent key means. */
|
|
81
|
+
export declare const filterParam: {
|
|
82
|
+
/** Free text: the search box. */
|
|
83
|
+
string(fallback?: string): FilterParamCodec<string>;
|
|
84
|
+
/** One of a fixed set: a single-select filter, a sort column, a view. Unknown reads as the default. */
|
|
85
|
+
oneOf<T extends string>(options: readonly T[], fallback: T): FilterParamCodec<T>;
|
|
86
|
+
/** Several of a fixed set, comma-joined: a multi-select filter. Unknown entries are dropped. */
|
|
87
|
+
list<T extends string>(options: readonly T[], fallback?: T[]): FilterParamCodec<T[]>;
|
|
88
|
+
/** A whole number at or above `min`: the page. Anything else — `2.7`, `2junk`, `-1` — reads as the default. */
|
|
89
|
+
number(fallback: number, min?: number): FilterParamCodec<number>;
|
|
90
|
+
/** A flag: present as `1`, absent otherwise. */
|
|
91
|
+
boolean(fallback?: boolean): FilterParamCodec<boolean>;
|
|
92
|
+
};
|
|
93
|
+
//# sourceMappingURL=use-filter-search-params.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-filter-search-params.d.ts","sourceRoot":"","sources":["../../src/hooks/use-filter-search-params.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,sDAAsD;IACtD,OAAO,EAAE,CAAC,CAAC;IACX,wEAAwE;IACxE,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC;IACtB,2EAA2E;IAC3E,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC;CAC7B;AAMD,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;AAE1E,sCAAsC;AACtC,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,iBAAiB,IAAI;KAC1D,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,gBAAgB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK;CACnE,CAAC;AAEF,MAAM,WAAW,4BAA4B,CAAC,CAAC,SAAS,iBAAiB;IACvE;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;IAC5B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IACnE;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,2BAA2B,CAAC,CAAC,SAAS,iBAAiB;IACtE,iDAAiD;IACjD,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAC7B;;;OAGG;IACH,GAAG,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IACpD;;;OAGG;IACH,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC;IACpC,+FAA+F;IAC/F,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;IACrB,0FAA0F;IAC1F,MAAM,EAAE,MAAM,CAAC;CAChB;AA0DD;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,iBAAiB,EAC/D,MAAM,EAAE,CAAC,EACT,OAAO,GAAE,4BAA4B,CAAC,CAAC,CAAM,GAC5C,2BAA2B,CAAC,CAAC,CAAC,CAsGhC;AAED,oFAAoF;AACpF,eAAO,MAAM,WAAW;IACtB,iCAAiC;+BACV,gBAAgB,CAAC,MAAM,CAAC;IAG/C,uGAAuG;UACjG,CAAC,SAAS,MAAM,WACX,SAAS,CAAC,EAAE,YACX,CAAC,GACV,gBAAgB,CAAC,CAAC,CAAC;IAOtB,gGAAgG;SAC3F,CAAC,SAAS,MAAM,WACV,SAAS,CAAC,EAAE,aACX,CAAC,EAAE,GACZ,gBAAgB,CAAC,CAAC,EAAE,CAAC;IAQxB,+GAA+G;qBAC9F,MAAM,iBAAY,gBAAgB,CAAC,MAAM,CAAC;IAW3D,gDAAgD;iCACrB,gBAAgB,CAAC,OAAO,CAAC;CAOrD,CAAC"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as c from "react";
|
|
3
|
+
var b = "ds:filter-search-params";
|
|
4
|
+
function $(e) {
|
|
5
|
+
return window.addEventListener("popstate", e), window.addEventListener(b, e), () => {
|
|
6
|
+
window.removeEventListener("popstate", e), window.removeEventListener(b, e);
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
var R = () => window.location.search, N = () => "", y = null;
|
|
10
|
+
function j(e) {
|
|
11
|
+
if (e !== void 0)
|
|
12
|
+
return e === "" || e.startsWith("?") ? e : `?${e}`;
|
|
13
|
+
}
|
|
14
|
+
function P(e, t) {
|
|
15
|
+
const r = new URLSearchParams(t), n = {};
|
|
16
|
+
for (const u of Object.keys(e)) {
|
|
17
|
+
const p = S(e, u), l = r.get(u);
|
|
18
|
+
n[u] = l === null ? p.default : p.parse(l);
|
|
19
|
+
}
|
|
20
|
+
return n;
|
|
21
|
+
}
|
|
22
|
+
function S(e, t) {
|
|
23
|
+
return e[t];
|
|
24
|
+
}
|
|
25
|
+
function L(e, t) {
|
|
26
|
+
return e.serialize(t) === e.serialize(e.default);
|
|
27
|
+
}
|
|
28
|
+
function x(e, t = {}) {
|
|
29
|
+
const r = c.useSyncExternalStore($, R, N), n = j(t.search) ?? r, u = c.useMemo(() => P(e, n), [e, n]), p = c.useMemo(() => Object.keys(e).filter((s) => !L(S(e, s), u[s])), [e, u]), l = c.useRef({
|
|
30
|
+
schema: e,
|
|
31
|
+
options: t
|
|
32
|
+
});
|
|
33
|
+
c.useEffect(() => {
|
|
34
|
+
l.current = {
|
|
35
|
+
schema: e,
|
|
36
|
+
options: t
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
const g = c.useCallback((s) => {
|
|
40
|
+
const { schema: f, options: o } = l.current, i = j(o.search) ?? window.location.search, d = y && y.from === i ? y.to : i, a = new URLSearchParams(d);
|
|
41
|
+
for (const [w, z] of Object.entries(s)) {
|
|
42
|
+
const h = f[w];
|
|
43
|
+
if (!h) continue;
|
|
44
|
+
const O = z === void 0 ? h.default : z;
|
|
45
|
+
L(h, O) ? a.delete(w) : a.set(w, h.serialize(O));
|
|
46
|
+
}
|
|
47
|
+
const E = a.toString(), m = E ? `?${E}` : "";
|
|
48
|
+
if (m === d) return;
|
|
49
|
+
y = {
|
|
50
|
+
from: i,
|
|
51
|
+
to: m
|
|
52
|
+
};
|
|
53
|
+
const k = (o.history ?? "replace") === "replace";
|
|
54
|
+
if (o.navigate) o.navigate(m, { replace: k });
|
|
55
|
+
else {
|
|
56
|
+
const w = `${window.location.pathname}${m}${window.location.hash}`;
|
|
57
|
+
k ? window.history.replaceState(window.history.state, "", w) : window.history.pushState(window.history.state, "", w);
|
|
58
|
+
}
|
|
59
|
+
window.dispatchEvent(new Event(b));
|
|
60
|
+
}, []), v = c.useCallback((s) => {
|
|
61
|
+
const { schema: f, options: o } = l.current, i = o.resetOnChange ?? ("page" in f ? ["page"] : []), d = { ...s };
|
|
62
|
+
if (Object.keys(s).some((a) => !i.includes(a)))
|
|
63
|
+
for (const a of i) a in d || (d[a] = S(f, a).default);
|
|
64
|
+
g(d);
|
|
65
|
+
}, [g]);
|
|
66
|
+
return {
|
|
67
|
+
values: u,
|
|
68
|
+
set: c.useCallback((s) => v(s), [v]),
|
|
69
|
+
reset: c.useCallback((s) => {
|
|
70
|
+
const { schema: f } = l.current, o = {};
|
|
71
|
+
for (const i of s ?? Object.keys(f)) o[i] = S(f, i).default;
|
|
72
|
+
v(o);
|
|
73
|
+
}, [v]),
|
|
74
|
+
changed: p,
|
|
75
|
+
search: n
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
var C = {
|
|
79
|
+
string(e = "") {
|
|
80
|
+
return {
|
|
81
|
+
default: e,
|
|
82
|
+
parse: (t) => t,
|
|
83
|
+
serialize: (t) => t
|
|
84
|
+
};
|
|
85
|
+
},
|
|
86
|
+
oneOf(e, t) {
|
|
87
|
+
return {
|
|
88
|
+
default: t,
|
|
89
|
+
parse: (r) => e.find((n) => n === r) ?? t,
|
|
90
|
+
serialize: (r) => r
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
list(e, t = []) {
|
|
94
|
+
return {
|
|
95
|
+
default: t,
|
|
96
|
+
parse: (r) => r.split(",").filter((n) => e.includes(n)),
|
|
97
|
+
serialize: (r) => r.join(",")
|
|
98
|
+
};
|
|
99
|
+
},
|
|
100
|
+
number(e, t = 1) {
|
|
101
|
+
return {
|
|
102
|
+
default: e,
|
|
103
|
+
parse: (r) => {
|
|
104
|
+
if (!/^\d+$/.test(r)) return e;
|
|
105
|
+
const n = Number(r);
|
|
106
|
+
return Number.isSafeInteger(n) && n >= t ? n : e;
|
|
107
|
+
},
|
|
108
|
+
serialize: (r) => String(r)
|
|
109
|
+
};
|
|
110
|
+
},
|
|
111
|
+
boolean(e = !1) {
|
|
112
|
+
return {
|
|
113
|
+
default: e,
|
|
114
|
+
parse: (t) => t === "1" || t === "true",
|
|
115
|
+
serialize: (t) => t ? "1" : "0"
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
export {
|
|
120
|
+
C as filterParam,
|
|
121
|
+
x as useFilterSearchParams
|
|
122
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./use-breakpoint.cjs");exports.getBreakpointValue=e.getBreakpointValue;exports.getMobileBreakpoint=e.getBreakpointValue;exports.isMobileViewport=e.isBelowBreakpoint;exports.useIsBelowBreakpoint=e.useIsBelowBreakpoint;exports.useIsMobile=e.useIsBelowBreakpoint;
|
package/dist/hooks/use-mobile.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { getBreakpointValue as
|
|
1
|
+
import { getBreakpointValue as o, isBelowBreakpoint as i, useIsBelowBreakpoint as s } from "./use-breakpoint.js";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
o as getBreakpointValue,
|
|
4
|
+
o as getMobileBreakpoint,
|
|
5
|
+
i as isMobileViewport,
|
|
6
|
+
s as useIsBelowBreakpoint,
|
|
7
|
+
s as useIsMobile
|
|
8
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use
|
|
1
|
+
"use client";const a=require("../_virtual/_rolldown/runtime.cjs");let e=require("react");e=a.__toESM(e,1);var i=['[data-slot="dialog-content"][data-state="open"]','[data-slot="alert-dialog-content"][data-state="open"]','[data-slot="sheet-content"][data-state="open"]','[data-slot="dropdown-menu-content"][data-state="open"]','[data-slot="dropdown-menu-sub-content"][data-state="open"]','[data-slot="context-menu-content"][data-state="open"]','[data-slot="context-menu-sub-content"][data-state="open"]','[data-slot="popover-content"][data-state="open"]','[data-slot="select-content"][data-state="open"]','[role="dialog"][data-state="open"]','[role="alertdialog"][data-state="open"]','[role="menu"][data-state="open"]','[role="listbox"][data-state="open"]'].join(","),n=!1;function t(){typeof document>"u"||document.body.style.pointerEvents==="none"&&document.querySelector(i)===null&&(document.body.style.pointerEvents="")}function d(){typeof requestAnimationFrame=="function"?requestAnimationFrame(t):typeof setTimeout=="function"&&setTimeout(t,0)}function o(){typeof document>"u"||document.visibilityState==="visible"&&t()}function r(){n||typeof document>"u"||(n=!0,document.addEventListener("visibilitychange",o),window.addEventListener("pageshow",o),typeof MutationObserver<"u"&&new MutationObserver(t).observe(document.body,{attributes:!0,attributeFilter:["style"]}))}function s(){e.useEffect(()=>(r(),d),[])}exports.useOverlayPointerLock=s;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import * as o from "react";
|
|
2
|
-
|
|
3
|
+
var a = [
|
|
3
4
|
'[data-slot="dialog-content"][data-state="open"]',
|
|
4
5
|
'[data-slot="alert-dialog-content"][data-state="open"]',
|
|
5
6
|
'[data-slot="sheet-content"][data-state="open"]',
|
|
@@ -9,31 +10,29 @@ const a = [
|
|
|
9
10
|
'[data-slot="context-menu-sub-content"][data-state="open"]',
|
|
10
11
|
'[data-slot="popover-content"][data-state="open"]',
|
|
11
12
|
'[data-slot="select-content"][data-state="open"]',
|
|
12
|
-
// Generic fallbacks: any open Radix overlay (or overridden DS one) by role.
|
|
13
13
|
'[role="dialog"][data-state="open"]',
|
|
14
14
|
'[role="alertdialog"][data-state="open"]',
|
|
15
15
|
'[role="menu"][data-state="open"]',
|
|
16
16
|
'[role="listbox"][data-state="open"]'
|
|
17
|
-
].join(",");
|
|
18
|
-
let e = !1;
|
|
17
|
+
].join(","), e = !1;
|
|
19
18
|
function t() {
|
|
20
19
|
typeof document > "u" || document.body.style.pointerEvents === "none" && document.querySelector(a) === null && (document.body.style.pointerEvents = "");
|
|
21
20
|
}
|
|
22
|
-
function
|
|
21
|
+
function d() {
|
|
23
22
|
typeof requestAnimationFrame == "function" ? requestAnimationFrame(t) : typeof setTimeout == "function" && setTimeout(t, 0);
|
|
24
23
|
}
|
|
25
24
|
function n() {
|
|
26
25
|
typeof document > "u" || document.visibilityState === "visible" && t();
|
|
27
26
|
}
|
|
28
|
-
function
|
|
27
|
+
function s() {
|
|
29
28
|
e || typeof document > "u" || (e = !0, document.addEventListener("visibilitychange", n), window.addEventListener("pageshow", n), typeof MutationObserver < "u" && new MutationObserver(t).observe(document.body, {
|
|
30
29
|
attributes: !0,
|
|
31
30
|
attributeFilter: ["style"]
|
|
32
31
|
}));
|
|
33
32
|
}
|
|
34
|
-
function
|
|
35
|
-
o.useEffect(() => (
|
|
33
|
+
function i() {
|
|
34
|
+
o.useEffect(() => (s(), d), []);
|
|
36
35
|
}
|
|
37
36
|
export {
|
|
38
|
-
|
|
37
|
+
i as useOverlayPointerLock
|
|
39
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use
|
|
1
|
+
"use client";let n=require("react");var r="(prefers-reduced-motion: reduce)",o=(0,n.createContext)(null);function u(e){const t=window.matchMedia(r);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function c(){return window.matchMedia(r).matches}function d(){return!1}function i(){const e=(0,n.useContext)(o),t=(0,n.useSyncExternalStore)(u,c,d);return e??t}exports.ReducedMotionOverrideContext=o;exports.usePrefersReducedMotion=i;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { createContext as r, useContext as o, useSyncExternalStore as c } from "react";
|
|
2
|
-
|
|
3
|
-
function
|
|
3
|
+
var n = "(prefers-reduced-motion: reduce)", i = r(null);
|
|
4
|
+
function s(e) {
|
|
4
5
|
const t = window.matchMedia(n);
|
|
5
6
|
return t.addEventListener("change", e), () => t.removeEventListener("change", e);
|
|
6
7
|
}
|
|
@@ -11,14 +12,10 @@ function d() {
|
|
|
11
12
|
return !1;
|
|
12
13
|
}
|
|
13
14
|
function f() {
|
|
14
|
-
const e = o(
|
|
15
|
-
i,
|
|
16
|
-
u,
|
|
17
|
-
d
|
|
18
|
-
);
|
|
15
|
+
const e = o(i), t = c(s, u, d);
|
|
19
16
|
return e ?? t;
|
|
20
17
|
}
|
|
21
18
|
export {
|
|
22
|
-
|
|
19
|
+
i as ReducedMotionOverrideContext,
|
|
23
20
|
f as usePrefersReducedMotion
|
|
24
21
|
};
|