@krizaka/ui 3.4.0 → 3.5.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/dist/argument-card.js +3 -3
- package/dist/chat.d.ts +187 -0
- package/dist/chat.js +132 -0
- package/dist/chat.js.map +1 -0
- package/dist/chunk-ECSCA3CN.js +128 -0
- package/dist/chunk-ECSCA3CN.js.map +1 -0
- package/dist/chunk-F2GKFIYK.js +47 -0
- package/dist/chunk-F2GKFIYK.js.map +1 -0
- package/dist/data-table.js +20 -134
- package/dist/data-table.js.map +1 -1
- package/dist/match-dialog.d.ts +30 -0
- package/dist/match-dialog.js +146 -0
- package/dist/match-dialog.js.map +1 -0
- package/dist/native.d.ts +421 -106
- package/dist/native.js +1535 -973
- package/dist/native.js.map +1 -1
- package/dist/page-hero.js +3 -3
- package/dist/photo-grid.d.ts +122 -0
- package/dist/photo-grid.js +94 -0
- package/dist/photo-grid.js.map +1 -0
- package/dist/step-progress.d.ts +20 -0
- package/dist/step-progress.js +17 -0
- package/dist/step-progress.js.map +1 -0
- package/dist/swipe-deck.d.ts +183 -0
- package/dist/swipe-deck.js +144 -0
- package/dist/swipe-deck.js.map +1 -0
- package/dist/tag-selector.d.ts +26 -0
- package/dist/tag-selector.js +21 -0
- package/dist/tag-selector.js.map +1 -0
- package/dist/verified-badge.d.ts +16 -0
- package/dist/verified-badge.js +23 -0
- package/dist/verified-badge.js.map +1 -0
- package/package.json +105 -7
- package/registry/achievement.json +1 -1
- package/registry/action-bar.json +1 -1
- package/registry/activity-feed.json +1 -1
- package/registry/alert.json +1 -1
- package/registry/app-shell.json +1 -1
- package/registry/argument-card.json +1 -1
- package/registry/audio-player.json +1 -1
- package/registry/auth-layout.json +1 -1
- package/registry/avatar.json +1 -1
- package/registry/badge.json +1 -1
- package/registry/button.json +1 -1
- package/registry/card-grid.json +1 -1
- package/registry/card.json +1 -1
- package/registry/catalogue-page.json +1 -1
- package/registry/changelog-page.json +1 -1
- package/registry/chat.json +917 -0
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.json +1 -1
- package/registry/chip.json +1 -1
- package/registry/choice-grid.json +1 -1
- package/registry/code-block.json +1 -1
- package/registry/combobox.json +1 -1
- package/registry/command.json +1 -1
- package/registry/component-page.json +1 -1
- package/registry/confirm-button.json +1 -1
- package/registry/contact-page.json +1 -1
- package/registry/continue-prompt.json +1 -1
- package/registry/countdown.json +1 -1
- package/registry/cta-panel.json +1 -1
- package/registry/dashboard-layout.json +1 -1
- package/registry/data-table.json +1 -1
- package/registry/date-picker.json +1 -1
- package/registry/decision-list.json +1 -1
- package/registry/description-list.json +1 -1
- package/registry/detail-layout.json +1 -1
- package/registry/dialog.json +1 -1
- package/registry/docs-article-page.json +1 -1
- package/registry/docs-hub-page.json +1 -1
- package/registry/docs-layout.json +1 -1
- package/registry/dropdown-menu.json +1 -1
- package/registry/empty-state.json +1 -1
- package/registry/error-page.json +1 -1
- package/registry/examples/chat/conversation.d.ts +4 -0
- package/registry/examples/chat/conversation.js +22 -0
- package/registry/examples/chat/conversation.tsx +21 -0
- package/registry/examples/chat/inbox.d.ts +4 -0
- package/registry/examples/chat/inbox.js +15 -0
- package/registry/examples/chat/inbox.tsx +12 -0
- package/registry/examples/chat/native/conversation.d.ts +4 -0
- package/registry/examples/chat/native/conversation.dark.png +0 -0
- package/registry/examples/chat/native/conversation.js +23 -0
- package/registry/examples/chat/native/conversation.light.png +0 -0
- package/registry/examples/chat/native/conversation.tsx +20 -0
- package/registry/examples/chat/native/inbox.d.ts +4 -0
- package/registry/examples/chat/native/inbox.dark.png +0 -0
- package/registry/examples/chat/native/inbox.js +16 -0
- package/registry/examples/chat/native/inbox.light.png +0 -0
- package/registry/examples/chat/native/inbox.tsx +13 -0
- package/registry/examples/match-dialog/its-a-match.d.ts +4 -0
- package/registry/examples/match-dialog/its-a-match.js +29 -0
- package/registry/examples/match-dialog/its-a-match.tsx +25 -0
- package/registry/examples/match-dialog/native/its-a-match.d.ts +4 -0
- package/registry/examples/match-dialog/native/its-a-match.dark.png +0 -0
- package/registry/examples/match-dialog/native/its-a-match.js +28 -0
- package/registry/examples/match-dialog/native/its-a-match.light.png +0 -0
- package/registry/examples/match-dialog/native/its-a-match.tsx +22 -0
- package/registry/examples/photo-grid/native/profile-photos.d.ts +4 -0
- package/registry/examples/photo-grid/native/profile-photos.dark.png +0 -0
- package/registry/examples/photo-grid/native/profile-photos.js +27 -0
- package/registry/examples/photo-grid/native/profile-photos.light.png +0 -0
- package/registry/examples/photo-grid/native/profile-photos.tsx +24 -0
- package/registry/examples/photo-grid/profile-photos.d.ts +4 -0
- package/registry/examples/photo-grid/profile-photos.js +28 -0
- package/registry/examples/photo-grid/profile-photos.tsx +25 -0
- package/registry/examples/screen/native/app-shell.d.ts +4 -0
- package/registry/examples/screen/native/app-shell.dark.png +0 -0
- package/registry/examples/screen/native/app-shell.js +25 -0
- package/registry/examples/screen/native/app-shell.light.png +0 -0
- package/registry/examples/screen/native/app-shell.tsx +33 -0
- package/registry/examples/screen/native/auth.d.ts +4 -0
- package/registry/examples/screen/native/auth.dark.png +0 -0
- package/registry/examples/screen/native/auth.js +24 -0
- package/registry/examples/screen/native/auth.light.png +0 -0
- package/registry/examples/screen/native/auth.tsx +20 -0
- package/registry/examples/screen/native/chat.d.ts +4 -0
- package/registry/examples/screen/native/chat.dark.png +0 -0
- package/registry/examples/screen/native/chat.js +27 -0
- package/registry/examples/screen/native/chat.light.png +0 -0
- package/registry/examples/screen/native/chat.tsx +22 -0
- package/registry/examples/screen/native/feed.d.ts +4 -0
- package/registry/examples/screen/native/feed.dark.png +0 -0
- package/registry/examples/screen/native/feed.js +24 -0
- package/registry/examples/screen/native/feed.light.png +0 -0
- package/registry/examples/screen/native/feed.tsx +34 -0
- package/registry/examples/screen/native/profile.d.ts +4 -0
- package/registry/examples/screen/native/profile.dark.png +0 -0
- package/registry/examples/screen/native/profile.js +29 -0
- package/registry/examples/screen/native/profile.light.png +0 -0
- package/registry/examples/screen/native/profile.tsx +27 -0
- package/registry/examples/screen/native/settings.d.ts +4 -0
- package/registry/examples/screen/native/settings.dark.png +0 -0
- package/registry/examples/screen/native/settings.js +20 -0
- package/registry/examples/screen/native/settings.light.png +0 -0
- package/registry/examples/screen/native/settings.tsx +19 -0
- package/registry/examples/step-progress/native/sign-up.d.ts +4 -0
- package/registry/examples/step-progress/native/sign-up.dark.png +0 -0
- package/registry/examples/step-progress/native/sign-up.js +12 -0
- package/registry/examples/step-progress/native/sign-up.light.png +0 -0
- package/registry/examples/step-progress/native/sign-up.tsx +11 -0
- package/registry/examples/step-progress/sign-up.d.ts +4 -0
- package/registry/examples/step-progress/sign-up.js +22 -0
- package/registry/examples/step-progress/sign-up.tsx +16 -0
- package/registry/examples/swipe-deck/discover.d.ts +4 -0
- package/registry/examples/swipe-deck/discover.js +41 -0
- package/registry/examples/swipe-deck/discover.tsx +37 -0
- package/registry/examples/swipe-deck/native/discover.d.ts +4 -0
- package/registry/examples/swipe-deck/native/discover.dark.png +0 -0
- package/registry/examples/swipe-deck/native/discover.js +39 -0
- package/registry/examples/swipe-deck/native/discover.light.png +0 -0
- package/registry/examples/swipe-deck/native/discover.tsx +35 -0
- package/registry/examples/tag-selector/interests.d.ts +4 -0
- package/registry/examples/tag-selector/interests.js +14 -0
- package/registry/examples/tag-selector/interests.tsx +12 -0
- package/registry/examples/tag-selector/native/interests.d.ts +4 -0
- package/registry/examples/tag-selector/native/interests.dark.png +0 -0
- package/registry/examples/tag-selector/native/interests.js +15 -0
- package/registry/examples/tag-selector/native/interests.light.png +0 -0
- package/registry/examples/tag-selector/native/interests.tsx +15 -0
- package/registry/examples/verified-badge/native/verified.d.ts +4 -0
- package/registry/examples/verified-badge/native/verified.dark.png +0 -0
- package/registry/examples/verified-badge/native/verified.js +18 -0
- package/registry/examples/verified-badge/native/verified.light.png +0 -0
- package/registry/examples/verified-badge/native/verified.tsx +15 -0
- package/registry/examples/verified-badge/verified.d.ts +4 -0
- package/registry/examples/verified-badge/verified.js +17 -0
- package/registry/examples/verified-badge/verified.tsx +13 -0
- package/registry/field.json +1 -1
- package/registry/file-upload.json +1 -1
- package/registry/filter-bar.json +1 -1
- package/registry/form.json +1 -1
- package/registry/gallery-page.json +1 -1
- package/registry/glow-card.json +1 -1
- package/registry/goal-gauge.json +1 -1
- package/registry/how-it-works-page.json +1 -1
- package/registry/image-cropper.json +1 -1
- package/registry/index.json +144 -2
- package/registry/iso.json +1 -1
- package/registry/kanban.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/landing-page.json +1 -1
- package/registry/landscape.json +1 -1
- package/registry/legal-page.json +1 -1
- package/registry/link-card.json +1 -1
- package/registry/list.json +1 -1
- package/registry/loader.json +1 -1
- package/registry/longform-page.json +1 -1
- package/registry/map.json +2 -2
- package/registry/marketing-layout.json +1 -1
- package/registry/marquee.json +1 -1
- package/registry/mascot-quote.json +1 -1
- package/registry/mascot-state.json +1 -1
- package/registry/mascots.json +1 -1
- package/registry/match-dialog.json +300 -0
- package/registry/media-capture.json +1 -1
- package/registry/meter.json +1 -1
- package/registry/nav-bar.json +1 -1
- package/registry/number-ticker.json +1 -1
- package/registry/page-header.json +1 -1
- package/registry/page-hero.json +1 -1
- package/registry/page.json +1 -1
- package/registry/pagination.json +1 -1
- package/registry/photo-grid.json +302 -0
- package/registry/pointer-light.json +1 -1
- package/registry/popover.json +1 -1
- package/registry/pricing-page.json +1 -1
- package/registry/product-page.json +1 -1
- package/registry/profile-card.json +1 -1
- package/registry/progress.json +1 -1
- package/registry/promise-card.json +1 -1
- package/registry/radio-group.json +1 -1
- package/registry/screen.json +184 -0
- package/registry/scroll-stage.json +1 -1
- package/registry/search-field.json +1 -1
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +1 -1
- package/registry/settings-layout.json +1 -1
- package/registry/skeleton.json +1 -1
- package/registry/slider.json +1 -1
- package/registry/slot.json +1 -1
- package/registry/spinner.json +1 -1
- package/registry/split-view.json +1 -1
- package/registry/stage-banner.json +1 -1
- package/registry/stat.json +1 -1
- package/registry/status-page.json +1 -1
- package/registry/step-progress.json +255 -0
- package/registry/stepper.json +1 -1
- package/registry/swipe-deck.json +512 -0
- package/registry/switch.json +1 -1
- package/registry/tabs.json +1 -1
- package/registry/tag-input.json +1 -1
- package/registry/tag-selector.json +276 -0
- package/registry/terminal-replay.json +1 -1
- package/registry/theme.json +1 -1
- package/registry/toast.json +1 -1
- package/registry/toc.json +1 -1
- package/registry/tooltip.json +1 -1
- package/registry/tree-view.json +1 -1
- package/registry/verified-badge.json +202 -0
- package/registry/video-player.json +1 -1
- package/registry/video-trimmer.json +1 -1
- package/registry/virtual.json +1 -1
package/dist/data-table.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Button
|
|
4
|
+
} from "./chunk-ECSCA3CN.js";
|
|
2
5
|
import {
|
|
3
6
|
Checkbox
|
|
4
7
|
} from "./chunk-7Z4KHPFC.js";
|
|
@@ -766,127 +769,10 @@ function ResizeHandle({
|
|
|
766
769
|
);
|
|
767
770
|
}
|
|
768
771
|
|
|
769
|
-
// src/
|
|
770
|
-
import { Slot } from "radix-ui";
|
|
772
|
+
// src/field/field.tsx
|
|
771
773
|
import { tv as tv3 } from "tailwind-variants";
|
|
772
|
-
|
|
773
|
-
// src/spinner/glyph.tsx
|
|
774
774
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
775
|
-
var
|
|
776
|
-
function LoaderGlyph({ state = "loading", value, ...props }) {
|
|
777
|
-
const known = typeof value === "number" && Number.isFinite(value);
|
|
778
|
-
const fill = state !== "loading" ? 100 : known ? Math.round(Math.min(1, Math.max(0, value)) * 100) : null;
|
|
779
|
-
return /* @__PURE__ */ jsxs3("svg", { viewBox: "0 0 24 24", fill: "none", "aria-hidden": true, "data-state": state, "data-progress": fill === null ? void 0 : fill, ...props, children: [
|
|
780
|
-
/* @__PURE__ */ jsx3("path", { d: HEX, stroke: "currentColor", strokeOpacity: "0.22", strokeWidth: "2.2", strokeLinejoin: "round" }),
|
|
781
|
-
/* @__PURE__ */ jsx3(
|
|
782
|
-
"path",
|
|
783
|
-
{
|
|
784
|
-
d: HEX,
|
|
785
|
-
pathLength: 100,
|
|
786
|
-
stroke: "currentColor",
|
|
787
|
-
strokeWidth: "2.2",
|
|
788
|
-
strokeLinejoin: "round",
|
|
789
|
-
strokeLinecap: "round",
|
|
790
|
-
className: "kz-loader-trace",
|
|
791
|
-
strokeDasharray: fill === null ? void 0 : `${fill} ${100 - fill}`
|
|
792
|
-
}
|
|
793
|
-
),
|
|
794
|
-
state === "loading" && /* @__PURE__ */ jsx3("circle", { cx: "12", cy: "12", r: "2.6", fill: "currentColor", className: "kz-loader-node" }),
|
|
795
|
-
state === "success" && /* @__PURE__ */ jsx3("path", { d: "M8.3 12.3l2.6 2.6 4.9-5.3", pathLength: 20, stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round", className: "kz-loader-mark" }),
|
|
796
|
-
state === "error" && /* @__PURE__ */ jsx3("path", { d: "M9.4 9.4l5.2 5.2M14.6 9.4l-5.2 5.2", pathLength: 20, stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", className: "kz-loader-mark" })
|
|
797
|
-
] });
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
// src/button/button.tsx
|
|
801
|
-
import { Fragment as Fragment3, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
802
|
-
var buttonVariants = tv3({
|
|
803
|
-
base: "inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap font-semibold transition-all focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-0 disabled:pointer-events-none disabled:opacity-40 data-loading:cursor-progress active:scale-[0.98] [&[data-loading]]:opacity-100",
|
|
804
|
-
variants: {
|
|
805
|
-
variant: {
|
|
806
|
-
primary: "bg-accent text-on-accent shadow-sm hover:bg-accent-hover",
|
|
807
|
-
// The brand's signature: accent → accent-2 (on-accent reads on both stops, tested in @krizaka/tokens).
|
|
808
|
-
gradient: "bg-linear-to-r from-accent to-accent-2 text-on-accent shadow-sm hover:brightness-110",
|
|
809
|
-
secondary: "border border-border-default bg-surface-2 text-fg hover:border-border-strong hover:bg-surface-3",
|
|
810
|
-
outline: "border border-border-default bg-transparent text-fg hover:border-accent hover:text-fg-accent",
|
|
811
|
-
ghost: "text-fg-secondary hover:bg-surface-2 hover:text-fg",
|
|
812
|
-
// The border and the tint carry the danger; the label stays the primary text role, legible on the tint at rest
|
|
813
|
-
// and hovered over every surface (`text-fg-danger` is for text set directly on a surface).
|
|
814
|
-
danger: "border border-danger/50 bg-danger/10 text-fg hover:border-danger hover:bg-danger/20"
|
|
815
|
-
},
|
|
816
|
-
size: { sm: "h-8 px-3 text-xs", md: "h-10 px-4 text-sm", lg: "h-12 px-6 text-sm", icon: "h-10 w-10" },
|
|
817
|
-
// `cut`: the Krizaka chamfer — 45° corners (CSS corner-shape, where supported; rounded elsewhere). The border, the
|
|
818
|
-
// focus ring and the hover follow the cut, unlike a clip-path.
|
|
819
|
-
shape: { rounded: "rounded-lg", pill: "rounded-full", cut: "rounded-[10px] [corner-shape:bevel]" }
|
|
820
|
-
},
|
|
821
|
-
defaultVariants: { variant: "secondary", size: "md", shape: "rounded" }
|
|
822
|
-
});
|
|
823
|
-
var STATUS_TEXT = { success: "text-fg-success", error: "text-fg-danger" };
|
|
824
|
-
function Button({
|
|
825
|
-
asChild,
|
|
826
|
-
loading,
|
|
827
|
-
progress,
|
|
828
|
-
status,
|
|
829
|
-
announce,
|
|
830
|
-
indicator = true,
|
|
831
|
-
shimmer,
|
|
832
|
-
magnetic,
|
|
833
|
-
variant,
|
|
834
|
-
size,
|
|
835
|
-
shape,
|
|
836
|
-
className,
|
|
837
|
-
disabled,
|
|
838
|
-
children,
|
|
839
|
-
...props
|
|
840
|
-
}) {
|
|
841
|
-
const Comp = asChild ? Slot.Root : "button";
|
|
842
|
-
const known = loading && typeof progress === "number" && Number.isFinite(progress);
|
|
843
|
-
const ratio = known ? Math.min(1, Math.max(0, progress)) : 0;
|
|
844
|
-
const glyph = indicator && !asChild && (loading || status) ? status ?? "loading" : null;
|
|
845
|
-
const filled = variant === "primary" || variant === "gradient";
|
|
846
|
-
const button = /* @__PURE__ */ jsx4(
|
|
847
|
-
Comp,
|
|
848
|
-
{
|
|
849
|
-
type: asChild ? void 0 : "button",
|
|
850
|
-
"aria-busy": loading || void 0,
|
|
851
|
-
"data-loading": loading ? "" : void 0,
|
|
852
|
-
"data-variant": variant ?? "secondary",
|
|
853
|
-
"data-kz-status": status ?? void 0,
|
|
854
|
-
"data-kz-magnetic": magnetic ? "" : void 0,
|
|
855
|
-
disabled: asChild ? void 0 : disabled || loading,
|
|
856
|
-
"aria-disabled": asChild && (disabled || loading) ? true : void 0,
|
|
857
|
-
className: buttonVariants({
|
|
858
|
-
variant,
|
|
859
|
-
size,
|
|
860
|
-
shape,
|
|
861
|
-
className: [known && "relative isolate overflow-hidden", shimmer && "kz-sheen", className].filter(Boolean).join(" ") || void 0
|
|
862
|
-
}),
|
|
863
|
-
...props,
|
|
864
|
-
children: asChild ? children : /* @__PURE__ */ jsxs4(Fragment3, { children: [
|
|
865
|
-
known && /* @__PURE__ */ jsx4("span", { "aria-hidden": true, className: "absolute inset-y-0 left-0 -z-10 bg-current opacity-15 transition-[width] duration-500", style: { width: `${ratio * 100}%` } }),
|
|
866
|
-
glyph && /* @__PURE__ */ jsx4(
|
|
867
|
-
"span",
|
|
868
|
-
{
|
|
869
|
-
"aria-hidden": true,
|
|
870
|
-
"data-slot": "indicator",
|
|
871
|
-
className: "-my-1 grid grid-cols-[1fr] transition-[grid-template-columns,margin,opacity] duration-300 starting:-mr-2 starting:grid-cols-[0fr] starting:opacity-0",
|
|
872
|
-
children: /* @__PURE__ */ jsx4("span", { className: "overflow-hidden", children: /* @__PURE__ */ jsx4(LoaderGlyph, { state: glyph, value: known ? ratio : null, className: ["h-4 w-4", glyph !== "loading" && !filled && STATUS_TEXT[glyph]].filter(Boolean).join(" ") }) })
|
|
873
|
-
}
|
|
874
|
-
),
|
|
875
|
-
children
|
|
876
|
-
] })
|
|
877
|
-
}
|
|
878
|
-
);
|
|
879
|
-
if (announce === void 0 || asChild) return button;
|
|
880
|
-
return /* @__PURE__ */ jsxs4(Fragment3, { children: [
|
|
881
|
-
button,
|
|
882
|
-
/* @__PURE__ */ jsx4("span", { role: "status", className: "sr-only", children: announce })
|
|
883
|
-
] });
|
|
884
|
-
}
|
|
885
|
-
|
|
886
|
-
// src/field/field.tsx
|
|
887
|
-
import { tv as tv4 } from "tailwind-variants";
|
|
888
|
-
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
889
|
-
var field2 = tv4({
|
|
775
|
+
var field2 = tv3({
|
|
890
776
|
slots: {
|
|
891
777
|
root: "flex flex-col gap-1.5",
|
|
892
778
|
label: "text-xs font-semibold text-fg-secondary",
|
|
@@ -901,11 +787,11 @@ var field2 = tv4({
|
|
|
901
787
|
var s = field2();
|
|
902
788
|
var invalidProps = (invalid) => invalid ? { "aria-invalid": true, "data-invalid": "" } : {};
|
|
903
789
|
function Input({ invalid, className, ...props }) {
|
|
904
|
-
return /* @__PURE__ */
|
|
790
|
+
return /* @__PURE__ */ jsx3("input", { ...invalidProps(invalid), className: s.control({ className }), ...props });
|
|
905
791
|
}
|
|
906
792
|
|
|
907
793
|
// src/data-table/toolbar.tsx
|
|
908
|
-
import { jsx as
|
|
794
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
909
795
|
var asRange = (value) => Array.isArray(value) && value.length === 2 && (typeof value[0] !== "string" || typeof value[1] !== "string") ? [value[0], value[1]] : [null, null];
|
|
910
796
|
var asList = (value) => Array.isArray(value) ? value : [];
|
|
911
797
|
var number = (text) => text.trim() === "" || Number.isNaN(Number(text)) ? null : Number(text);
|
|
@@ -937,7 +823,7 @@ function DataTableFilters({ debounce = 250, children, className }) {
|
|
|
937
823
|
const label = labels.activeFilter(column.header, text);
|
|
938
824
|
return [{ id: column.id, label, onRemove: () => set(column.id, null) }];
|
|
939
825
|
});
|
|
940
|
-
return /* @__PURE__ */
|
|
826
|
+
return /* @__PURE__ */ jsxs4(
|
|
941
827
|
FilterBar,
|
|
942
828
|
{
|
|
943
829
|
label: labels.filters,
|
|
@@ -950,7 +836,7 @@ function DataTableFilters({ debounce = 250, children, className }) {
|
|
|
950
836
|
children: [
|
|
951
837
|
filterable.map((column) => {
|
|
952
838
|
if (column.filter === "text")
|
|
953
|
-
return /* @__PURE__ */
|
|
839
|
+
return /* @__PURE__ */ jsx4(
|
|
954
840
|
SearchField,
|
|
955
841
|
{
|
|
956
842
|
label: labels.search(column.header),
|
|
@@ -966,11 +852,11 @@ function DataTableFilters({ debounce = 250, children, className }) {
|
|
|
966
852
|
column.id
|
|
967
853
|
);
|
|
968
854
|
if (column.filter === "facet")
|
|
969
|
-
return /* @__PURE__ */
|
|
855
|
+
return /* @__PURE__ */ jsx4(FilterMenu, { label: column.header, options: optionsOf(column), value: asList(filters[column.id]), onValueChange: (value) => set(column.id, value) }, column.id);
|
|
970
856
|
const [min, max] = asRange(filters[column.id]);
|
|
971
857
|
const bounds = manualFiltering ? void 0 : table.getColumn(column.id)?.getFacetedMinMaxValues();
|
|
972
|
-
return /* @__PURE__ */
|
|
973
|
-
/* @__PURE__ */
|
|
858
|
+
return /* @__PURE__ */ jsxs4("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
859
|
+
/* @__PURE__ */ jsx4(
|
|
974
860
|
Input,
|
|
975
861
|
{
|
|
976
862
|
type: "number",
|
|
@@ -982,8 +868,8 @@ function DataTableFilters({ debounce = 250, children, className }) {
|
|
|
982
868
|
className: "h-11 w-28"
|
|
983
869
|
}
|
|
984
870
|
),
|
|
985
|
-
/* @__PURE__ */
|
|
986
|
-
/* @__PURE__ */
|
|
871
|
+
/* @__PURE__ */ jsx4("span", { "aria-hidden": true, className: "text-fg-secondary", children: "\u2013" }),
|
|
872
|
+
/* @__PURE__ */ jsx4(
|
|
987
873
|
Input,
|
|
988
874
|
{
|
|
989
875
|
type: "number",
|
|
@@ -1004,14 +890,14 @@ function DataTableFilters({ debounce = 250, children, className }) {
|
|
|
1004
890
|
}
|
|
1005
891
|
function DataTableColumnsMenu({ defaultOpen, className }) {
|
|
1006
892
|
const { table, columns, labels } = useDataTable();
|
|
1007
|
-
return /* @__PURE__ */
|
|
1008
|
-
/* @__PURE__ */
|
|
893
|
+
return /* @__PURE__ */ jsxs4(DropdownMenu.Root, { defaultOpen, modal: false, children: [
|
|
894
|
+
/* @__PURE__ */ jsx4(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs4(Button, { variant: "outline", size: "sm", className, children: [
|
|
1009
895
|
labels.columns,
|
|
1010
|
-
/* @__PURE__ */
|
|
896
|
+
/* @__PURE__ */ jsx4(ChevronGlyph, { className: "h-4 w-4" })
|
|
1011
897
|
] }) }),
|
|
1012
|
-
/* @__PURE__ */
|
|
898
|
+
/* @__PURE__ */ jsx4(DropdownMenu.Content, { align: "end", "aria-label": labels.columns, children: columns.filter((column) => column.hideable !== false).map((column) => {
|
|
1013
899
|
const instance = table.getColumn(column.id);
|
|
1014
|
-
return /* @__PURE__ */
|
|
900
|
+
return /* @__PURE__ */ jsx4(
|
|
1015
901
|
DropdownMenu.CheckboxItem,
|
|
1016
902
|
{
|
|
1017
903
|
checked: instance?.getIsVisible() ?? true,
|
|
@@ -1035,7 +921,7 @@ function DataTableExport({ filename = "export.csv", onExport, className }) {
|
|
|
1035
921
|
link.click();
|
|
1036
922
|
setTimeout(() => URL.revokeObjectURL(url), 0);
|
|
1037
923
|
};
|
|
1038
|
-
return /* @__PURE__ */
|
|
924
|
+
return /* @__PURE__ */ jsx4(Button, { variant: "outline", size: "sm", className, onClick: run, children: labels.export });
|
|
1039
925
|
}
|
|
1040
926
|
export {
|
|
1041
927
|
DataTable,
|