@cognite/aura 0.2.0 → 0.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/README.md +36 -3
- package/dist/colors.css +30 -0
- package/dist/components/index.d.ts +6 -36
- package/dist/components/index.js +311 -347
- package/dist/components/ui/core/accordion/accordion.d.ts +7 -7
- package/dist/components/ui/core/accordion/accordion.js +49 -47
- package/dist/components/ui/core/action-toolbar/action-toolbar.d.ts +41 -0
- package/dist/components/ui/core/action-toolbar/action-toolbar.js +176 -0
- package/dist/components/ui/core/alert/alert.d.ts +23 -12
- package/dist/components/ui/core/alert/alert.js +123 -120
- package/dist/components/ui/core/avatar/avatar.d.ts +12 -8
- package/dist/components/ui/core/badge/badge.d.ts +11 -8
- package/dist/components/ui/core/banner/banner.d.ts +18 -28
- package/dist/components/ui/core/banner/banner.js +6 -6
- package/dist/components/ui/core/breadcrumb/breadcrumb.d.ts +10 -9
- package/dist/components/ui/core/breadcrumb/breadcrumb.js +98 -88
- package/dist/components/ui/core/button/button.d.ts +8 -5
- package/dist/components/ui/core/button/button.js +22 -19
- package/dist/components/ui/core/button-group/button-group.d.ts +7 -6
- package/dist/components/ui/core/card/card.d.ts +17 -16
- package/dist/components/ui/core/chart/chart.d.ts +69 -0
- package/dist/components/ui/core/chart/chart.js +215 -0
- package/dist/components/ui/core/chart/index.d.ts +2 -0
- package/dist/components/ui/core/chart/index.js +8 -0
- package/dist/components/ui/core/checkbox/checkbox.d.ts +13 -9
- package/dist/components/ui/core/checkbox/checkbox.js +38 -34
- package/dist/components/ui/core/code-block/code-block.d.ts +6 -9
- package/dist/components/ui/core/code-block/code-block.js +52 -48
- package/dist/components/ui/core/collapsible/collapsible.d.ts +5 -3
- package/dist/components/ui/core/combobox/combobox.d.ts +2 -2
- package/dist/components/ui/core/command/command.d.ts +11 -78
- package/dist/components/ui/core/command/command.js +53 -52
- package/dist/components/ui/core/count/count.d.ts +7 -6
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.d.ts +15 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js +99 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/index.d.ts +3 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/types.d.ts +25 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.d.ts +4 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js +82 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.d.ts +17 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js +190 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/index.d.ts +3 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.d.ts +42 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.d.ts +3 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js +161 -0
- package/dist/components/ui/core/date-time-pickers/index.d.ts +6 -0
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.d.ts +7 -0
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.js +57 -0
- package/dist/components/ui/core/date-time-pickers/shared/calendar/calendar.d.ts +13 -0
- package/dist/components/ui/core/date-time-pickers/shared/calendar/calendar.js +119 -0
- package/dist/components/ui/core/date-time-pickers/shared/calendar-header/calendar-header.d.ts +10 -0
- package/dist/components/ui/core/date-time-pickers/shared/calendar-header/calendar-header.js +93 -0
- package/dist/components/ui/core/date-time-pickers/shared/constants.d.ts +20 -0
- package/dist/components/ui/core/date-time-pickers/shared/constants.js +14 -0
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.d.ts +19 -0
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js +99 -0
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.d.ts +12 -0
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.js +68 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.d.ts +12 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js +40 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.d.ts +29 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.js +63 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.d.ts +8 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.js +19 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.d.ts +17 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.js +34 -0
- package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.d.ts +8 -0
- package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.js +7 -0
- package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.d.ts +13 -0
- package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.js +31 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.d.ts +10 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.js +52 -0
- package/dist/components/ui/core/date-time-pickers/utils/calendar-utils.d.ts +48 -0
- package/dist/components/ui/core/date-time-pickers/utils/calendar-utils.js +52 -0
- package/dist/components/ui/core/date-time-pickers/utils/date-range-utils.d.ts +26 -0
- package/dist/components/ui/core/date-time-pickers/utils/format-utils.d.ts +37 -0
- package/dist/components/ui/core/date-time-pickers/utils/segment-utils.d.ts +34 -0
- package/dist/components/ui/core/date-time-pickers/utils/time-utils.d.ts +43 -0
- package/dist/components/ui/core/date-time-pickers/utils/time-utils.js +15 -0
- package/dist/components/ui/core/date-time-pickers/utils/time-validation.d.ts +23 -0
- package/dist/components/ui/core/dialog/dialog.d.ts +10 -10
- package/dist/components/ui/core/dialog/dialog.js +12 -3
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +24 -47
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +125 -123
- package/dist/components/ui/core/empty-state/empty-state.context.d.ts +10 -0
- package/dist/components/ui/core/empty-state/empty-state.context.js +8 -0
- package/dist/components/ui/core/empty-state/empty-state.d.ts +18 -0
- package/dist/components/ui/core/empty-state/empty-state.js +139 -0
- package/dist/components/ui/core/helper-text/helper-text.d.ts +7 -5
- package/dist/components/ui/core/hover-card/hover-card.d.ts +5 -7
- package/dist/components/ui/core/hover-card/hover-card.js +26 -25
- package/dist/components/ui/core/inline-citation/inline-citation.d.ts +10 -10
- package/dist/components/ui/core/inline-citation/inline-citation.js +57 -49
- package/dist/components/ui/core/input/input.d.ts +2 -1
- package/dist/components/ui/core/input-group/input-group.d.ts +17 -13
- package/dist/components/ui/core/input-group/input-group.js +35 -36
- package/dist/components/ui/core/kbd/kbd.d.ts +3 -2
- package/dist/components/ui/core/label/label.d.ts +3 -2
- package/dist/components/ui/core/loader/loader.d.ts +2 -2
- package/dist/components/ui/core/message/message.d.ts +18 -17
- package/dist/components/ui/core/message/message.js +15 -13
- package/dist/components/ui/core/pagination/pagination-size-context.d.ts +5 -0
- package/dist/components/ui/core/pagination/pagination-size-context.js +6 -0
- package/dist/components/ui/core/pagination/pagination-teleport.d.ts +11 -0
- package/dist/components/ui/core/pagination/pagination-teleport.js +108 -0
- package/dist/components/ui/core/pagination/pagination-teleport.utils.d.ts +1 -0
- package/dist/components/ui/core/pagination/pagination-teleport.utils.js +7 -0
- package/dist/components/ui/core/pagination/pagination.d.ts +41 -0
- package/dist/components/ui/core/pagination/pagination.js +335 -0
- package/dist/components/ui/core/popover/popover.d.ts +12 -16
- package/dist/components/ui/core/popover/popover.js +52 -51
- package/dist/components/ui/core/progress/progress.d.ts +7 -4
- package/dist/components/ui/core/prompt-input/prompt-input.d.ts +36 -103
- package/dist/components/ui/core/prompt-input/prompt-input.js +193 -180
- package/dist/components/ui/core/radio-group/radio-group.d.ts +12 -8
- package/dist/components/ui/core/radio-group/radio-group.js +58 -55
- package/dist/components/ui/core/reasoning/reasoning.d.ts +5 -5
- package/dist/components/ui/core/reasoning/reasoning.js +1 -1
- package/dist/components/ui/core/scroll-area/scroll-area.d.ts +4 -2
- package/dist/components/ui/core/search/search.d.ts +10 -0
- package/dist/components/ui/core/search/search.js +99 -0
- package/dist/components/ui/core/segmented-control/segmented-control.d.ts +15 -11
- package/dist/components/ui/core/segmented-control/segmented-control.js +7 -4
- package/dist/components/ui/core/select/select.d.ts +13 -13
- package/dist/components/ui/core/select/select.js +13 -10
- package/dist/components/ui/core/separator/separator.d.ts +2 -4
- package/dist/components/ui/core/separator/separator.js +4 -5
- package/dist/components/ui/core/shimmer/shimmer.d.ts +3 -5
- package/dist/components/ui/core/shimmer/shimmer.js +25 -26
- package/dist/components/ui/core/skeleton/skeleton.d.ts +2 -1
- package/dist/components/ui/core/sonner-toast/sonner-toast.d.ts +2 -1
- package/dist/components/ui/core/sources/sources.d.ts +3 -3
- package/dist/components/ui/core/sources/sources.js +6 -1
- package/dist/components/ui/core/switch/switch.d.ts +11 -0
- package/dist/components/ui/core/{button/button.metadata.d.ts → switch/switch.metadata.d.ts} +1 -1
- package/dist/components/ui/core/tabs/tabs.d.ts +21 -17
- package/dist/components/ui/core/tabs/tabs.js +14 -12
- package/dist/components/ui/core/textarea/textarea.d.ts +2 -1
- package/dist/components/ui/core/textarea/textarea.js +20 -18
- package/dist/components/ui/core/tool/tool.d.ts +7 -6
- package/dist/components/ui/core/tool/tool.js +48 -44
- package/dist/components/ui/core/tooltip/tooltip.d.ts +6 -5
- package/dist/components/ui/core/tooltip/tooltip.js +10 -8
- package/dist/components/ui/core/topbar/topbar.d.ts +11 -13
- package/dist/eslint/index.d.ts +2 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +302 -336
- package/dist/lib/portal-container-context.d.ts +2 -1
- package/dist/lib/portal-container-context.js +1 -3
- package/dist/styles.css +1 -1
- package/dist/styles.source.css +9 -1
- package/package.json +22 -1
- package/dist/components/ui/core/accordion/accordion.metadata.d.ts +0 -2
- package/dist/components/ui/core/accordion/accordion.metadata.js +0 -9
- package/dist/components/ui/core/alert/alert.metadata.d.ts +0 -2
- package/dist/components/ui/core/alert/alert.metadata.js +0 -9
- package/dist/components/ui/core/avatar/avatar.metadata.d.ts +0 -8
- package/dist/components/ui/core/avatar/avatar.metadata.js +0 -9
- package/dist/components/ui/core/badge/badge.metadata.d.ts +0 -2
- package/dist/components/ui/core/badge/badge.metadata.js +0 -8
- package/dist/components/ui/core/banner/banner.metadata.d.ts +0 -2
- package/dist/components/ui/core/banner/banner.metadata.js +0 -9
- package/dist/components/ui/core/breadcrumb/breadcrumb.metadata.d.ts +0 -2
- package/dist/components/ui/core/breadcrumb/breadcrumb.metadata.js +0 -9
- package/dist/components/ui/core/button/button.metadata.js +0 -9
- package/dist/components/ui/core/button-group/button-group.metadata.d.ts +0 -2
- package/dist/components/ui/core/button-group/button-group.metadata.js +0 -8
- package/dist/components/ui/core/card/card.metadata.d.ts +0 -8
- package/dist/components/ui/core/card/card.metadata.js +0 -9
- package/dist/components/ui/core/code-block/code-block.metadata.d.ts +0 -2
- package/dist/components/ui/core/code-block/code-block.metadata.js +0 -8
- package/dist/components/ui/core/collapsible/collapsible.metadata.d.ts +0 -2
- package/dist/components/ui/core/collapsible/collapsible.metadata.js +0 -9
- package/dist/components/ui/core/combobox/combobox.metadata.d.ts +0 -2
- package/dist/components/ui/core/command/command.metadata.d.ts +0 -2
- package/dist/components/ui/core/command/command.metadata.js +0 -9
- package/dist/components/ui/core/dialog/dialog.metadata.d.ts +0 -2
- package/dist/components/ui/core/dialog/dialog.metadata.js +0 -9
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.metadata.d.ts +0 -2
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.metadata.js +0 -9
- package/dist/components/ui/core/helper-text/helper-text.metadata.d.ts +0 -2
- package/dist/components/ui/core/helper-text/helper-text.metadata.js +0 -9
- package/dist/components/ui/core/hover-card/hover-card.metadata.d.ts +0 -2
- package/dist/components/ui/core/hover-card/hover-card.metadata.js +0 -8
- package/dist/components/ui/core/inline-citation/inline-citation.metadata.d.ts +0 -2
- package/dist/components/ui/core/inline-citation/inline-citation.metadata.js +0 -8
- package/dist/components/ui/core/input/input.metadata.d.ts +0 -2
- package/dist/components/ui/core/input/input.metadata.js +0 -9
- package/dist/components/ui/core/input-group/input-group.metadata.d.ts +0 -2
- package/dist/components/ui/core/input-group/input-group.metadata.js +0 -9
- package/dist/components/ui/core/kbd/kbd.metadata.d.ts +0 -2
- package/dist/components/ui/core/kbd/kbd.metadata.js +0 -9
- package/dist/components/ui/core/label/label.metadata.d.ts +0 -2
- package/dist/components/ui/core/label/label.metadata.js +0 -9
- package/dist/components/ui/core/loader/loader.metadata.d.ts +0 -2
- package/dist/components/ui/core/loader/loader.metadata.js +0 -9
- package/dist/components/ui/core/message/message.metadata.d.ts +0 -2
- package/dist/components/ui/core/popover/popover.metadata.d.ts +0 -2
- package/dist/components/ui/core/popover/popover.metadata.js +0 -9
- package/dist/components/ui/core/progress/progress.metadata.d.ts +0 -2
- package/dist/components/ui/core/progress/progress.metadata.js +0 -9
- package/dist/components/ui/core/prompt-input/prompt-input.metadata.d.ts +0 -2
- package/dist/components/ui/core/prompt-input/prompt-input.metadata.js +0 -9
- package/dist/components/ui/core/radio-group/radio-group.metadata.d.ts +0 -2
- package/dist/components/ui/core/radio-group/radio-group.metadata.js +0 -9
- package/dist/components/ui/core/reasoning/reasoning.metadata.d.ts +0 -2
- package/dist/components/ui/core/reasoning/reasoning.metadata.js +0 -8
- package/dist/components/ui/core/scroll-area/scroll-area.metadata.d.ts +0 -2
- package/dist/components/ui/core/scroll-area/scroll-area.metadata.js +0 -9
- package/dist/components/ui/core/select/select.metadata.d.ts +0 -2
- package/dist/components/ui/core/select/select.metadata.js +0 -9
- package/dist/components/ui/core/separator/separator.metadata.d.ts +0 -2
- package/dist/components/ui/core/separator/separator.metadata.js +0 -8
- package/dist/components/ui/core/shimmer/shimmer.metadata.d.ts +0 -2
- package/dist/components/ui/core/shimmer/shimmer.metadata.js +0 -9
- package/dist/components/ui/core/skeleton/skeleton.metadata.d.ts +0 -2
- package/dist/components/ui/core/skeleton/skeleton.metadata.js +0 -9
- package/dist/components/ui/core/sonner-toast/sonner-toast.metadata.d.ts +0 -2
- package/dist/components/ui/core/sonner-toast/sonner-toast.metadata.js +0 -9
- package/dist/components/ui/core/sources/sources.metadata.d.ts +0 -2
- package/dist/components/ui/core/textarea/textarea.metadata.d.ts +0 -2
- package/dist/components/ui/core/textarea/textarea.metadata.js +0 -9
- package/dist/components/ui/core/tool/tool.metadata.d.ts +0 -2
- package/dist/components/ui/core/tool/tool.metadata.js +0 -8
- package/dist/components/ui/core/tooltip/tooltip.metadata.d.ts +0 -8
- package/dist/components/ui/core/tooltip/tooltip.metadata.js +0 -9
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { jsx as P } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as T, useRef as v, useLayoutEffect as k, useState as x } from "react";
|
|
3
|
+
import { cva as N } from "class-variance-authority";
|
|
4
|
+
import { cn as S } from "../../../../lib/utils.js";
|
|
5
|
+
import { Input as V } from "../input/input.js";
|
|
6
|
+
import { usePaginationSize as I } from "./pagination-size-context.js";
|
|
7
|
+
import { getPaginationTeleportWidth as R } from "./pagination-teleport.utils.js";
|
|
8
|
+
const C = N(
|
|
9
|
+
[
|
|
10
|
+
"tabular-nums text-center font-normal",
|
|
11
|
+
"bg-background text-secondary-foreground border-border-emphasized",
|
|
12
|
+
"[&:not(:placeholder-shown):not(:focus)]:bg-background [&:not(:placeholder-shown)]:text-secondary-foreground",
|
|
13
|
+
"hover:bg-accent-background [&:not(:placeholder-shown):not(:focus):hover]:bg-accent-background hover:border-border-emphasized",
|
|
14
|
+
"focus-visible:bg-background focus-visible:text-secondary-foreground focus-visible:border-border-emphasized focus-visible:shadow-focus-ring"
|
|
15
|
+
],
|
|
16
|
+
{
|
|
17
|
+
variants: {
|
|
18
|
+
size: {
|
|
19
|
+
default: "h-9 rounded-lg px-3 py-0 text-base leading-5 tracking-tightest",
|
|
20
|
+
small: "h-7 rounded-md px-2 py-0 text-sm leading-4.5 tracking-tight"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
size: "default"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
), W = {
|
|
28
|
+
small: {
|
|
29
|
+
minWidthPx: 43,
|
|
30
|
+
paddingPx: 16
|
|
31
|
+
},
|
|
32
|
+
default: {
|
|
33
|
+
minWidthPx: 55,
|
|
34
|
+
paddingPx: 24
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
function B({
|
|
38
|
+
currentPage: o,
|
|
39
|
+
totalPages: c,
|
|
40
|
+
onPageChange: i
|
|
41
|
+
}) {
|
|
42
|
+
const s = Math.max(1, c), [d, r] = x(""), [u, t] = x(!1), n = v(!1);
|
|
43
|
+
return {
|
|
44
|
+
displayValue: u ? d : `${o}/${s}`,
|
|
45
|
+
isEditing: u,
|
|
46
|
+
onChange: (e) => {
|
|
47
|
+
const a = e.target.value;
|
|
48
|
+
(a === "" || /^\d+$/.test(a)) && r(a);
|
|
49
|
+
},
|
|
50
|
+
onFocus: () => {
|
|
51
|
+
n.current = !1, t(!0), r(o.toString());
|
|
52
|
+
},
|
|
53
|
+
onBlur: () => {
|
|
54
|
+
if (t(!1), n.current) {
|
|
55
|
+
n.current = !1;
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const e = Number.parseInt(d, 10);
|
|
59
|
+
!Number.isNaN(e) && e >= 1 && e <= s && i(e);
|
|
60
|
+
},
|
|
61
|
+
onKeyDown: (e) => {
|
|
62
|
+
e.key === "Enter" ? e.currentTarget.blur() : e.key === "Escape" && (n.current = !0, r(o.toString()), e.currentTarget.blur());
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
const D = T(
|
|
67
|
+
({ className: o, currentPage: c, totalPages: i, onPageChange: s, size: d, style: r, ...u }, t) => {
|
|
68
|
+
const n = I(), l = d ?? n, { displayValue: h, isEditing: g, onChange: m, onFocus: b, onBlur: e, onKeyDown: a } = B({
|
|
69
|
+
currentPage: c,
|
|
70
|
+
totalPages: i,
|
|
71
|
+
onPageChange: s
|
|
72
|
+
}), f = v(null), w = (p) => {
|
|
73
|
+
f.current = p, typeof t == "function" ? t(p) : t && (t.current = p);
|
|
74
|
+
};
|
|
75
|
+
k(() => {
|
|
76
|
+
g && f.current && f.current.select();
|
|
77
|
+
}, [g]);
|
|
78
|
+
const y = W[l], z = R(
|
|
79
|
+
i,
|
|
80
|
+
y.minWidthPx,
|
|
81
|
+
y.paddingPx
|
|
82
|
+
), E = S(
|
|
83
|
+
C({ size: l }),
|
|
84
|
+
o
|
|
85
|
+
);
|
|
86
|
+
return /* @__PURE__ */ P(
|
|
87
|
+
V,
|
|
88
|
+
{
|
|
89
|
+
ref: w,
|
|
90
|
+
type: "text",
|
|
91
|
+
inputMode: "numeric",
|
|
92
|
+
value: h,
|
|
93
|
+
onChange: m,
|
|
94
|
+
onFocus: b,
|
|
95
|
+
onBlur: e,
|
|
96
|
+
onKeyDown: a,
|
|
97
|
+
"data-slot": "pagination-teleport",
|
|
98
|
+
className: E,
|
|
99
|
+
style: { width: z, ...r },
|
|
100
|
+
...u
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
D.displayName = "PaginationTeleport";
|
|
106
|
+
export {
|
|
107
|
+
D as PaginationTeleport
|
|
108
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getPaginationTeleportWidth(totalPages: number, minWidthPx: number, paddingPx: number): string;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ForwardRefExoticComponent, RefAttributes, ComponentProps } from 'react';
|
|
2
|
+
import { SelectTriggerProps } from '@base-ui/react';
|
|
3
|
+
import { PaginationSize } from './pagination-size-context';
|
|
4
|
+
import { PaginationTeleport } from './pagination-teleport';
|
|
5
|
+
declare const Pagination: ForwardRefExoticComponent<Omit<ComponentProps<'nav'> & {
|
|
6
|
+
size?: PaginationSize;
|
|
7
|
+
}, 'ref'> & RefAttributes<HTMLElement>>;
|
|
8
|
+
declare const PaginationContent: ForwardRefExoticComponent<Omit<ComponentProps<'ul'> & {
|
|
9
|
+
size?: PaginationSize;
|
|
10
|
+
}, 'ref'> & RefAttributes<HTMLUListElement>>;
|
|
11
|
+
declare const PaginationItem: ForwardRefExoticComponent<ComponentProps<'li'> & RefAttributes<HTMLLIElement>>;
|
|
12
|
+
declare const PaginationStatus: ForwardRefExoticComponent<ComponentProps<'output'> & RefAttributes<HTMLOutputElement>>;
|
|
13
|
+
declare const PaginationSelectTrigger: ForwardRefExoticComponent<Omit<SelectTriggerProps & {
|
|
14
|
+
size?: 'sm' | 'default';
|
|
15
|
+
errorMessage?: string;
|
|
16
|
+
}, 'ref'> & RefAttributes<HTMLButtonElement>>;
|
|
17
|
+
type PaginationLinkProps = {
|
|
18
|
+
isActive?: boolean;
|
|
19
|
+
isDisabled?: boolean;
|
|
20
|
+
size?: PaginationSize;
|
|
21
|
+
} & ComponentProps<'a'>;
|
|
22
|
+
declare const PaginationLink: ForwardRefExoticComponent<Omit<PaginationLinkProps, 'ref'> & RefAttributes<HTMLAnchorElement>>;
|
|
23
|
+
declare const PaginationFirst: ForwardRefExoticComponent<Omit<Omit<PaginationLinkProps, 'isActive'> & {
|
|
24
|
+
label?: string;
|
|
25
|
+
}, 'ref'> & RefAttributes<HTMLAnchorElement>>;
|
|
26
|
+
declare const PaginationPrevious: ForwardRefExoticComponent<Omit<Omit<PaginationLinkProps, 'isActive'> & {
|
|
27
|
+
label?: string;
|
|
28
|
+
}, 'ref'> & RefAttributes<HTMLAnchorElement>>;
|
|
29
|
+
declare const PaginationNext: ForwardRefExoticComponent<Omit<Omit<PaginationLinkProps, 'isActive'> & {
|
|
30
|
+
label?: string;
|
|
31
|
+
}, 'ref'> & RefAttributes<HTMLAnchorElement>>;
|
|
32
|
+
declare const PaginationLast: ForwardRefExoticComponent<Omit<Omit<PaginationLinkProps, 'isActive'> & {
|
|
33
|
+
label?: string;
|
|
34
|
+
}, 'ref'> & RefAttributes<HTMLAnchorElement>>;
|
|
35
|
+
declare const PaginationEllipsis: ForwardRefExoticComponent<Omit<ComponentProps<'span'> & {
|
|
36
|
+
size?: PaginationSize;
|
|
37
|
+
label?: string;
|
|
38
|
+
}, 'ref'> & RefAttributes<HTMLSpanElement>>;
|
|
39
|
+
declare const PaginationResultsPerPage: ForwardRefExoticComponent<ComponentProps<'li'> & RefAttributes<HTMLLIElement>>;
|
|
40
|
+
declare const PaginationResultsPerPageLabel: ForwardRefExoticComponent<ComponentProps<'span'> & RefAttributes<HTMLSpanElement>>;
|
|
41
|
+
export { Pagination, PaginationContent, PaginationEllipsis, PaginationFirst, PaginationItem, PaginationLast, PaginationLink, PaginationNext, PaginationPrevious, PaginationResultsPerPage, PaginationResultsPerPageLabel, PaginationSelectTrigger, PaginationStatus, PaginationTeleport, };
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
import { jsx as i, jsxs as L } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as r } from "react";
|
|
3
|
+
import { IconDots as I, IconChevronsLeft as w, IconChevronsRight as C, IconChevronRight as T, IconChevronLeft as B } from "@tabler/icons-react";
|
|
4
|
+
import { cva as x } from "class-variance-authority";
|
|
5
|
+
import { cn as l } from "../../../../lib/utils.js";
|
|
6
|
+
import { Button as z } from "../button/button.js";
|
|
7
|
+
import { SelectTrigger as _ } from "../select/select.js";
|
|
8
|
+
import { PaginationSizeContext as k, usePaginationSize as g } from "./pagination-size-context.js";
|
|
9
|
+
const y = x(
|
|
10
|
+
"text-base font-normal leading-5 tracking-tightest text-secondary-foreground hover:bg-active-muted-background-hover hover:text-active-foreground focus-visible:bg-active-muted-background focus-visible:text-active-foreground focus-visible:shadow-focus-ring",
|
|
11
|
+
{
|
|
12
|
+
variants: {
|
|
13
|
+
size: {
|
|
14
|
+
default: "",
|
|
15
|
+
small: "text-sm leading-4.5 tracking-tight"
|
|
16
|
+
},
|
|
17
|
+
active: {
|
|
18
|
+
true: "bg-active-muted-background text-active-foreground",
|
|
19
|
+
false: ""
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
size: "default",
|
|
24
|
+
active: !1
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
), R = x(
|
|
28
|
+
"flex items-center justify-center text-secondary-foreground",
|
|
29
|
+
{
|
|
30
|
+
variants: {
|
|
31
|
+
size: {
|
|
32
|
+
default: "h-9 w-9",
|
|
33
|
+
small: "h-7 w-7"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
defaultVariants: {
|
|
37
|
+
size: "default"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
), W = x(
|
|
41
|
+
[
|
|
42
|
+
"w-auto whitespace-nowrap min-h-0 py-1.75 text-sm leading-4.5 tracking-normal font-medium",
|
|
43
|
+
"bg-background text-foreground border-border-emphasized",
|
|
44
|
+
"hover:bg-accent-background hover:border-border-emphasized",
|
|
45
|
+
"focus-visible:bg-background focus-visible:text-foreground focus-visible:border-border-emphasized",
|
|
46
|
+
"dark:bg-background dark:hover:bg-accent-background"
|
|
47
|
+
],
|
|
48
|
+
{
|
|
49
|
+
variants: {
|
|
50
|
+
size: {
|
|
51
|
+
default: "h-9 gap-2 rounded-lg px-3 min-w-19",
|
|
52
|
+
sm: "h-7 gap-1.5 rounded-md px-2 min-w-16"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
defaultVariants: {
|
|
56
|
+
size: "default"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
), E = {
|
|
60
|
+
small: "max-w-7",
|
|
61
|
+
default: "max-w-9"
|
|
62
|
+
}, V = {
|
|
63
|
+
small: "min-w-7",
|
|
64
|
+
default: "min-w-9"
|
|
65
|
+
}, N = (a = "default") => {
|
|
66
|
+
const t = a === "small" ? "sm" : "default", e = a === "small" ? "rounded-md" : "rounded-lg", n = E[a], o = V[a];
|
|
67
|
+
return {
|
|
68
|
+
buttonSize: t,
|
|
69
|
+
radiusClass: e,
|
|
70
|
+
iconButtonWidth: n,
|
|
71
|
+
textLinkWidth: o
|
|
72
|
+
};
|
|
73
|
+
}, j = r(({ className: a, size: t = "default", ...e }, n) => /* @__PURE__ */ i(k.Provider, { value: t, children: /* @__PURE__ */ i(
|
|
74
|
+
"nav",
|
|
75
|
+
{
|
|
76
|
+
ref: n,
|
|
77
|
+
"aria-label": "pagination",
|
|
78
|
+
"data-slot": "pagination",
|
|
79
|
+
className: l("mx-auto flex w-full justify-center gap-2", a),
|
|
80
|
+
...e
|
|
81
|
+
}
|
|
82
|
+
) }));
|
|
83
|
+
j.displayName = "Pagination";
|
|
84
|
+
const G = r(({ className: a, size: t, ...e }, n) => {
|
|
85
|
+
const o = g(), s = t ?? o;
|
|
86
|
+
return /* @__PURE__ */ i(k.Provider, { value: s, children: /* @__PURE__ */ i(
|
|
87
|
+
"ul",
|
|
88
|
+
{
|
|
89
|
+
ref: n,
|
|
90
|
+
"data-slot": "pagination-content",
|
|
91
|
+
"data-size": s,
|
|
92
|
+
className: l("flex flex-row items-center gap-1", a),
|
|
93
|
+
...e
|
|
94
|
+
}
|
|
95
|
+
) });
|
|
96
|
+
});
|
|
97
|
+
G.displayName = "PaginationContent";
|
|
98
|
+
const F = r((a, t) => /* @__PURE__ */ i("li", { ref: t, "data-slot": "pagination-item", ...a }));
|
|
99
|
+
F.displayName = "PaginationItem";
|
|
100
|
+
const H = r(
|
|
101
|
+
({ className: a, ...t }, e) => /* @__PURE__ */ i(
|
|
102
|
+
"output",
|
|
103
|
+
{
|
|
104
|
+
ref: e,
|
|
105
|
+
"data-slot": "pagination-status",
|
|
106
|
+
className: l(
|
|
107
|
+
"flex items-center text-sm leading-4.5 tracking-tight font-normal text-muted-foreground",
|
|
108
|
+
a
|
|
109
|
+
),
|
|
110
|
+
...t
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
);
|
|
114
|
+
H.displayName = "PaginationStatus";
|
|
115
|
+
const O = r(({ className: a, size: t, style: e, ...n }, o) => {
|
|
116
|
+
const d = g() === "small" && t === void 0, c = t ?? (d ? "sm" : "default");
|
|
117
|
+
return /* @__PURE__ */ i(
|
|
118
|
+
_,
|
|
119
|
+
{
|
|
120
|
+
ref: o,
|
|
121
|
+
size: c,
|
|
122
|
+
"data-slot": "pagination-select-trigger",
|
|
123
|
+
style: e,
|
|
124
|
+
className: l(
|
|
125
|
+
W({ size: c }),
|
|
126
|
+
a
|
|
127
|
+
),
|
|
128
|
+
...n
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
});
|
|
132
|
+
O.displayName = "PaginationSelectTrigger";
|
|
133
|
+
const Y = r(
|
|
134
|
+
({ children: a, className: t, isActive: e, isDisabled: n, onClick: o, size: s, ...d }, c) => {
|
|
135
|
+
const v = g(), m = s ?? v, { buttonSize: p, radiusClass: h, textLinkWidth: P } = N(m), b = (f) => {
|
|
136
|
+
if (n) {
|
|
137
|
+
f.preventDefault();
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
o?.(f);
|
|
141
|
+
};
|
|
142
|
+
return /* @__PURE__ */ i(
|
|
143
|
+
z,
|
|
144
|
+
{
|
|
145
|
+
variant: "ghost",
|
|
146
|
+
size: p,
|
|
147
|
+
"data-slot": "pagination-link",
|
|
148
|
+
"data-active": e,
|
|
149
|
+
className: l(
|
|
150
|
+
h,
|
|
151
|
+
P,
|
|
152
|
+
y({ size: m, active: e }),
|
|
153
|
+
n && "pointer-events-none opacity-50",
|
|
154
|
+
t
|
|
155
|
+
),
|
|
156
|
+
render: /* @__PURE__ */ i(
|
|
157
|
+
"a",
|
|
158
|
+
{
|
|
159
|
+
ref: c,
|
|
160
|
+
"aria-current": e ? "page" : void 0,
|
|
161
|
+
"aria-disabled": n || void 0,
|
|
162
|
+
onClick: b,
|
|
163
|
+
tabIndex: n ? -1 : void 0,
|
|
164
|
+
...d,
|
|
165
|
+
children: a
|
|
166
|
+
}
|
|
167
|
+
)
|
|
168
|
+
}
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
);
|
|
172
|
+
Y.displayName = "PaginationLink";
|
|
173
|
+
const u = r(
|
|
174
|
+
({
|
|
175
|
+
ariaLabel: a,
|
|
176
|
+
className: t,
|
|
177
|
+
dataSlot: e,
|
|
178
|
+
icon: n,
|
|
179
|
+
isDisabled: o,
|
|
180
|
+
onClick: s,
|
|
181
|
+
size: d,
|
|
182
|
+
...c
|
|
183
|
+
}, v) => {
|
|
184
|
+
const m = g(), p = d ?? m, { buttonSize: h, radiusClass: P, iconButtonWidth: b } = N(p), f = (S) => {
|
|
185
|
+
if (o) {
|
|
186
|
+
S.preventDefault();
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
s?.(S);
|
|
190
|
+
};
|
|
191
|
+
return /* @__PURE__ */ i(
|
|
192
|
+
z,
|
|
193
|
+
{
|
|
194
|
+
variant: "ghost",
|
|
195
|
+
size: h,
|
|
196
|
+
"data-slot": e,
|
|
197
|
+
className: l(
|
|
198
|
+
P,
|
|
199
|
+
b,
|
|
200
|
+
y({ size: p, active: !1 }),
|
|
201
|
+
o && "pointer-events-none opacity-50",
|
|
202
|
+
t
|
|
203
|
+
),
|
|
204
|
+
render: /* @__PURE__ */ i(
|
|
205
|
+
"a",
|
|
206
|
+
{
|
|
207
|
+
ref: v,
|
|
208
|
+
"aria-label": a,
|
|
209
|
+
"aria-disabled": o || void 0,
|
|
210
|
+
onClick: f,
|
|
211
|
+
tabIndex: o ? -1 : void 0,
|
|
212
|
+
...c,
|
|
213
|
+
children: n
|
|
214
|
+
}
|
|
215
|
+
)
|
|
216
|
+
}
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
);
|
|
220
|
+
u.displayName = "PaginationIconLink";
|
|
221
|
+
const Z = r(({ className: a, size: t, label: e = "Go to first page", ...n }, o) => /* @__PURE__ */ i(
|
|
222
|
+
u,
|
|
223
|
+
{
|
|
224
|
+
ref: o,
|
|
225
|
+
dataSlot: "pagination-first",
|
|
226
|
+
ariaLabel: e,
|
|
227
|
+
icon: /* @__PURE__ */ i(w, {}),
|
|
228
|
+
className: a,
|
|
229
|
+
size: t,
|
|
230
|
+
...n
|
|
231
|
+
}
|
|
232
|
+
));
|
|
233
|
+
Z.displayName = "PaginationFirst";
|
|
234
|
+
const K = r(({ className: a, size: t, label: e = "Go to previous page", ...n }, o) => /* @__PURE__ */ i(
|
|
235
|
+
u,
|
|
236
|
+
{
|
|
237
|
+
ref: o,
|
|
238
|
+
dataSlot: "pagination-previous",
|
|
239
|
+
ariaLabel: e,
|
|
240
|
+
icon: /* @__PURE__ */ i(B, {}),
|
|
241
|
+
className: a,
|
|
242
|
+
size: t,
|
|
243
|
+
...n
|
|
244
|
+
}
|
|
245
|
+
));
|
|
246
|
+
K.displayName = "PaginationPrevious";
|
|
247
|
+
const M = r(({ className: a, size: t, label: e = "Go to next page", ...n }, o) => /* @__PURE__ */ i(
|
|
248
|
+
u,
|
|
249
|
+
{
|
|
250
|
+
ref: o,
|
|
251
|
+
dataSlot: "pagination-next",
|
|
252
|
+
ariaLabel: e,
|
|
253
|
+
icon: /* @__PURE__ */ i(T, {}),
|
|
254
|
+
className: a,
|
|
255
|
+
size: t,
|
|
256
|
+
...n
|
|
257
|
+
}
|
|
258
|
+
));
|
|
259
|
+
M.displayName = "PaginationNext";
|
|
260
|
+
const U = r(({ className: a, size: t, label: e = "Go to last page", ...n }, o) => /* @__PURE__ */ i(
|
|
261
|
+
u,
|
|
262
|
+
{
|
|
263
|
+
ref: o,
|
|
264
|
+
dataSlot: "pagination-last",
|
|
265
|
+
ariaLabel: e,
|
|
266
|
+
icon: /* @__PURE__ */ i(C, {}),
|
|
267
|
+
className: a,
|
|
268
|
+
size: t,
|
|
269
|
+
...n
|
|
270
|
+
}
|
|
271
|
+
));
|
|
272
|
+
U.displayName = "PaginationLast";
|
|
273
|
+
const X = r(({ className: a, size: t, label: e = "More pages", ...n }, o) => {
|
|
274
|
+
const s = g(), d = t ?? s, { iconButtonWidth: c } = N(d);
|
|
275
|
+
return /* @__PURE__ */ L(
|
|
276
|
+
"span",
|
|
277
|
+
{
|
|
278
|
+
ref: o,
|
|
279
|
+
"data-slot": "pagination-ellipsis",
|
|
280
|
+
className: l(
|
|
281
|
+
c,
|
|
282
|
+
R({ size: d }),
|
|
283
|
+
a
|
|
284
|
+
),
|
|
285
|
+
...n,
|
|
286
|
+
children: [
|
|
287
|
+
/* @__PURE__ */ i(I, { "aria-hidden": "true", className: "h-4 w-4" }),
|
|
288
|
+
/* @__PURE__ */ i("span", { className: "sr-only", children: e })
|
|
289
|
+
]
|
|
290
|
+
}
|
|
291
|
+
);
|
|
292
|
+
});
|
|
293
|
+
X.displayName = "PaginationEllipsis";
|
|
294
|
+
const q = r(
|
|
295
|
+
({ className: a, ...t }, e) => /* @__PURE__ */ i(
|
|
296
|
+
"li",
|
|
297
|
+
{
|
|
298
|
+
ref: e,
|
|
299
|
+
"data-slot": "pagination-results-per-page",
|
|
300
|
+
className: l("flex items-center gap-2 pl-3", a),
|
|
301
|
+
...t
|
|
302
|
+
}
|
|
303
|
+
)
|
|
304
|
+
);
|
|
305
|
+
q.displayName = "PaginationResultsPerPage";
|
|
306
|
+
const J = r(
|
|
307
|
+
({ className: a, ...t }, e) => /* @__PURE__ */ i(
|
|
308
|
+
"span",
|
|
309
|
+
{
|
|
310
|
+
ref: e,
|
|
311
|
+
"data-slot": "pagination-results-per-page-label",
|
|
312
|
+
className: l(
|
|
313
|
+
"text-sm leading-4.5 tracking-tight font-normal text-muted-foreground",
|
|
314
|
+
a
|
|
315
|
+
),
|
|
316
|
+
...t
|
|
317
|
+
}
|
|
318
|
+
)
|
|
319
|
+
);
|
|
320
|
+
J.displayName = "PaginationResultsPerPageLabel";
|
|
321
|
+
export {
|
|
322
|
+
j as Pagination,
|
|
323
|
+
G as PaginationContent,
|
|
324
|
+
X as PaginationEllipsis,
|
|
325
|
+
Z as PaginationFirst,
|
|
326
|
+
F as PaginationItem,
|
|
327
|
+
U as PaginationLast,
|
|
328
|
+
Y as PaginationLink,
|
|
329
|
+
M as PaginationNext,
|
|
330
|
+
K as PaginationPrevious,
|
|
331
|
+
q as PaginationResultsPerPage,
|
|
332
|
+
J as PaginationResultsPerPageLabel,
|
|
333
|
+
O as PaginationSelectTrigger,
|
|
334
|
+
H as PaginationStatus
|
|
335
|
+
};
|
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
declare
|
|
7
|
-
declare const
|
|
8
|
-
declare const
|
|
9
|
-
declare const
|
|
10
|
-
declare const
|
|
11
|
-
declare const
|
|
12
|
-
declare const
|
|
13
|
-
variant?: "default" | "secondary" | "outline" | "ghost" | "destructive" | null | undefined;
|
|
14
|
-
size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
|
|
15
|
-
} & import('class-variance-authority/types').ClassProp) | undefined) => string>, "ref"> & import('react').RefAttributes<HTMLElement>, "ref"> & import('react').RefAttributes<HTMLElement>>;
|
|
16
|
-
declare const PopoverContent: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').PopoverPopupProps & Pick<import('@base-ui/react').PopoverPositionerProps, "align" | "alignOffset" | "side" | "sideOffset">, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
1
|
+
import { ForwardRefExoticComponent, RefAttributes, ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import { PopoverPopupProps, PopoverPositionerProps, Popover as PopoverPrimitive } from '@base-ui/react/popover';
|
|
3
|
+
import { Button } from '../button/button';
|
|
4
|
+
declare function Popover(props: PopoverPrimitive.Root.Props): ReactNode;
|
|
5
|
+
declare function PopoverTrigger({ children, ...props }: PopoverPrimitive.Trigger.Props): ReactNode;
|
|
6
|
+
declare const PopoverHeader: ForwardRefExoticComponent<ComponentProps<'div'> & RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const PopoverHeaderContent: ForwardRefExoticComponent<ComponentProps<'div'> & RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const PopoverTitle: ForwardRefExoticComponent<ComponentProps<'h3'> & RefAttributes<HTMLHeadingElement>>;
|
|
9
|
+
declare const PopoverDescription: ForwardRefExoticComponent<ComponentProps<'p'> & RefAttributes<HTMLParagraphElement>>;
|
|
10
|
+
declare const PopoverSlot: ForwardRefExoticComponent<ComponentProps<'div'> & RefAttributes<HTMLDivElement>>;
|
|
11
|
+
declare const PopoverClose: ForwardRefExoticComponent<Omit<ComponentProps<typeof Button>, 'ref'> & RefAttributes<HTMLElement>>;
|
|
12
|
+
declare const PopoverContent: ForwardRefExoticComponent<Omit<PopoverPopupProps & Pick<PopoverPositionerProps, 'align' | 'alignOffset' | 'side' | 'sideOffset'>, 'ref'> & RefAttributes<HTMLDivElement>>;
|
|
17
13
|
export { Popover, PopoverClose, PopoverContent, PopoverDescription, PopoverHeader, PopoverHeaderContent, PopoverSlot, PopoverTitle, PopoverTrigger, };
|