@krizaka/ui 3.3.0 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/activity-feed.d.ts +199 -0
- package/dist/activity-feed.js +155 -0
- package/dist/activity-feed.js.map +1 -0
- package/dist/argument-card.js +3 -3
- package/dist/chunk-7Z4KHPFC.js +42 -0
- package/dist/chunk-7Z4KHPFC.js.map +1 -0
- package/dist/data-table.js +98 -131
- package/dist/data-table.js.map +1 -1
- package/dist/description-list.d.ts +105 -0
- package/dist/description-list.js +49 -0
- package/dist/description-list.js.map +1 -0
- package/dist/index.js +13 -66
- package/dist/index.js.map +1 -1
- package/dist/kanban.d.ts +132 -0
- package/dist/kanban.js +187 -0
- package/dist/kanban.js.map +1 -0
- package/dist/list.d.ts +153 -0
- package/dist/list.js +130 -0
- package/dist/list.js.map +1 -0
- package/dist/map.d.ts +463 -0
- package/dist/map.js +952 -0
- package/dist/map.js.map +1 -0
- package/dist/motion.css +12 -1
- package/dist/native/map.d.ts +200 -0
- package/dist/native/map.js +673 -0
- package/dist/native/map.js.map +1 -0
- package/dist/native/media-picker.d.ts +58 -0
- package/dist/native/media-picker.js +63 -0
- package/dist/native/media-picker.js.map +1 -0
- package/dist/native.d.ts +568 -6
- package/dist/native.js +1989 -868
- package/dist/native.js.map +1 -1
- package/dist/page-hero.js +3 -3
- package/dist/stat.d.ts +31 -2
- package/dist/stat.js +21 -4
- package/dist/stat.js.map +1 -1
- package/dist/tree-view.d.ts +111 -0
- package/dist/tree-view.js +154 -0
- package/dist/tree-view.js.map +1 -0
- package/package.json +147 -10
- package/registry/achievement.json +1 -1
- package/registry/action-bar.json +1 -1
- package/registry/action-sheet.json +121 -0
- package/registry/activity-feed.json +468 -0
- 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 +58 -3
- 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/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 +2 -2
- package/registry/decision-list.json +1 -1
- package/registry/description-list.json +232 -0
- 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/action-sheet/native/video-actions.d.ts +4 -0
- package/registry/examples/action-sheet/native/video-actions.dark.png +0 -0
- package/registry/examples/action-sheet/native/video-actions.js +30 -0
- package/registry/examples/action-sheet/native/video-actions.light.png +0 -0
- package/registry/examples/action-sheet/native/video-actions.tsx +24 -0
- package/registry/examples/activity-feed/job-activity.d.ts +4 -0
- package/registry/examples/activity-feed/job-activity.js +21 -0
- package/registry/examples/activity-feed/job-activity.tsx +17 -0
- package/registry/examples/activity-feed/live.d.ts +4 -0
- package/registry/examples/activity-feed/live.js +23 -0
- package/registry/examples/activity-feed/live.tsx +24 -0
- package/registry/examples/activity-feed/native/notifications.d.ts +4 -0
- package/registry/examples/activity-feed/native/notifications.dark.png +0 -0
- package/registry/examples/activity-feed/native/notifications.js +18 -0
- package/registry/examples/activity-feed/native/notifications.light.png +0 -0
- package/registry/examples/activity-feed/native/notifications.tsx +18 -0
- package/registry/examples/activity-feed/timeline.d.ts +4 -0
- package/registry/examples/activity-feed/timeline.js +25 -0
- package/registry/examples/activity-feed/timeline.tsx +19 -0
- package/registry/examples/avatar/native/presence.d.ts +4 -0
- package/registry/examples/avatar/native/presence.dark.png +0 -0
- package/registry/examples/avatar/native/presence.js +18 -0
- package/registry/examples/avatar/native/presence.light.png +0 -0
- package/registry/examples/avatar/native/presence.tsx +15 -0
- package/registry/examples/description-list/job-details.d.ts +4 -0
- package/registry/examples/description-list/job-details.js +23 -0
- package/registry/examples/description-list/job-details.tsx +17 -0
- package/registry/examples/description-list/key-value-grid.d.ts +4 -0
- package/registry/examples/description-list/key-value-grid.js +22 -0
- package/registry/examples/description-list/key-value-grid.tsx +16 -0
- package/registry/examples/description-list/native/job-details.d.ts +4 -0
- package/registry/examples/description-list/native/job-details.dark.png +0 -0
- package/registry/examples/description-list/native/job-details.js +33 -0
- package/registry/examples/description-list/native/job-details.light.png +0 -0
- package/registry/examples/description-list/native/job-details.tsx +24 -0
- package/registry/examples/description-list/receipt.d.ts +4 -0
- package/registry/examples/description-list/receipt.js +23 -0
- package/registry/examples/description-list/receipt.tsx +17 -0
- package/registry/examples/fab/native/extended.d.ts +4 -0
- package/registry/examples/fab/native/extended.dark.png +0 -0
- package/registry/examples/fab/native/extended.js +18 -0
- package/registry/examples/fab/native/extended.light.png +0 -0
- package/registry/examples/fab/native/extended.tsx +23 -0
- package/registry/examples/header/native/large-title.d.ts +4 -0
- package/registry/examples/header/native/large-title.dark.png +0 -0
- package/registry/examples/header/native/large-title.js +23 -0
- package/registry/examples/header/native/large-title.light.png +0 -0
- package/registry/examples/header/native/large-title.tsx +31 -0
- package/registry/examples/image-viewer/native/gallery.d.ts +4 -0
- package/registry/examples/image-viewer/native/gallery.dark.png +0 -0
- package/registry/examples/image-viewer/native/gallery.js +22 -0
- package/registry/examples/image-viewer/native/gallery.light.png +0 -0
- package/registry/examples/image-viewer/native/gallery.tsx +21 -0
- package/registry/examples/kanban/moderation.d.ts +4 -0
- package/registry/examples/kanban/moderation.js +35 -0
- package/registry/examples/kanban/moderation.tsx +37 -0
- package/registry/examples/list/jobs.d.ts +4 -0
- package/registry/examples/list/jobs.js +35 -0
- package/registry/examples/list/jobs.tsx +33 -0
- package/registry/examples/list/selectable.d.ts +4 -0
- package/registry/examples/list/selectable.js +33 -0
- package/registry/examples/list/selectable.tsx +30 -0
- package/registry/examples/list/virtualized.d.ts +4 -0
- package/registry/examples/list/virtualized.js +22 -0
- package/registry/examples/list/virtualized.tsx +17 -0
- package/registry/examples/loader/native/block.d.ts +4 -0
- package/registry/examples/loader/native/block.dark.png +0 -0
- package/registry/examples/loader/native/block.js +12 -0
- package/registry/examples/loader/native/block.light.png +0 -0
- package/registry/examples/loader/native/block.tsx +11 -0
- package/registry/examples/loader/native/job-wait.d.ts +4 -0
- package/registry/examples/loader/native/job-wait.dark.png +0 -0
- package/registry/examples/loader/native/job-wait.js +17 -0
- package/registry/examples/loader/native/job-wait.light.png +0 -0
- package/registry/examples/loader/native/job-wait.tsx +14 -0
- package/registry/examples/map/cluster.d.ts +4 -0
- package/registry/examples/map/cluster.js +16 -0
- package/registry/examples/map/cluster.tsx +18 -0
- package/registry/examples/map/location-picker.d.ts +4 -0
- package/registry/examples/map/location-picker.js +24 -0
- package/registry/examples/map/location-picker.tsx +22 -0
- package/registry/examples/map/native/location-picker.d.ts +4 -0
- package/registry/examples/map/native/location-picker.dark.png +0 -0
- package/registry/examples/map/native/location-picker.js +14 -0
- package/registry/examples/map/native/location-picker.light.png +0 -0
- package/registry/examples/map/native/location-picker.tsx +13 -0
- package/registry/examples/map/native/places.d.ts +4 -0
- package/registry/examples/map/native/places.dark.png +0 -0
- package/registry/examples/map/native/places.js +25 -0
- package/registry/examples/map/native/places.light.png +0 -0
- package/registry/examples/map/native/places.tsx +27 -0
- package/registry/examples/map/places.d.ts +4 -0
- package/registry/examples/map/places.js +28 -0
- package/registry/examples/map/places.tsx +28 -0
- package/registry/examples/map/static.d.ts +4 -0
- package/registry/examples/map/static.js +22 -0
- package/registry/examples/map/static.tsx +18 -0
- package/registry/examples/media-picker/native/story.d.ts +4 -0
- package/registry/examples/media-picker/native/story.dark.png +0 -0
- package/registry/examples/media-picker/native/story.js +30 -0
- package/registry/examples/media-picker/native/story.light.png +0 -0
- package/registry/examples/media-picker/native/story.tsx +26 -0
- package/registry/examples/meter/native/credits.d.ts +4 -0
- package/registry/examples/meter/native/credits.dark.png +0 -0
- package/registry/examples/meter/native/credits.js +15 -0
- package/registry/examples/meter/native/credits.light.png +0 -0
- package/registry/examples/meter/native/credits.tsx +12 -0
- package/registry/examples/meter/native/split-ring.d.ts +4 -0
- package/registry/examples/meter/native/split-ring.dark.png +0 -0
- package/registry/examples/meter/native/split-ring.js +24 -0
- package/registry/examples/meter/native/split-ring.light.png +0 -0
- package/registry/examples/meter/native/split-ring.tsx +19 -0
- package/registry/examples/number-ticker/native/balance.d.ts +4 -0
- package/registry/examples/number-ticker/native/balance.dark.png +0 -0
- package/registry/examples/number-ticker/native/balance.js +18 -0
- package/registry/examples/number-ticker/native/balance.light.png +0 -0
- package/registry/examples/number-ticker/native/balance.tsx +17 -0
- package/registry/examples/onboarding/native/first-launch.d.ts +4 -0
- package/registry/examples/onboarding/native/first-launch.dark.png +0 -0
- package/registry/examples/onboarding/native/first-launch.js +23 -0
- package/registry/examples/onboarding/native/first-launch.light.png +0 -0
- package/registry/examples/onboarding/native/first-launch.tsx +19 -0
- package/registry/examples/otp-input/native/invalid.d.ts +4 -0
- package/registry/examples/otp-input/native/invalid.dark.png +0 -0
- package/registry/examples/otp-input/native/invalid.js +15 -0
- package/registry/examples/otp-input/native/invalid.light.png +0 -0
- package/registry/examples/otp-input/native/invalid.tsx +14 -0
- package/registry/examples/otp-input/native/verify.d.ts +4 -0
- package/registry/examples/otp-input/native/verify.dark.png +0 -0
- package/registry/examples/otp-input/native/verify.js +17 -0
- package/registry/examples/otp-input/native/verify.light.png +0 -0
- package/registry/examples/otp-input/native/verify.tsx +14 -0
- package/registry/examples/permission-prompt/native/blocked.d.ts +4 -0
- package/registry/examples/permission-prompt/native/blocked.dark.png +0 -0
- package/registry/examples/permission-prompt/native/blocked.js +25 -0
- package/registry/examples/permission-prompt/native/blocked.light.png +0 -0
- package/registry/examples/permission-prompt/native/blocked.tsx +21 -0
- package/registry/examples/permission-prompt/native/camera.d.ts +4 -0
- package/registry/examples/permission-prompt/native/camera.dark.png +0 -0
- package/registry/examples/permission-prompt/native/camera.js +25 -0
- package/registry/examples/permission-prompt/native/camera.light.png +0 -0
- package/registry/examples/permission-prompt/native/camera.tsx +21 -0
- package/registry/examples/pull-to-refresh/native/feed.d.ts +4 -0
- package/registry/examples/pull-to-refresh/native/feed.dark.png +0 -0
- package/registry/examples/pull-to-refresh/native/feed.js +14 -0
- package/registry/examples/pull-to-refresh/native/feed.light.png +0 -0
- package/registry/examples/pull-to-refresh/native/feed.tsx +19 -0
- package/registry/examples/search-field/native/cancel.d.ts +4 -0
- package/registry/examples/search-field/native/cancel.dark.png +0 -0
- package/registry/examples/search-field/native/cancel.js +14 -0
- package/registry/examples/search-field/native/cancel.light.png +0 -0
- package/registry/examples/search-field/native/cancel.tsx +13 -0
- package/registry/examples/stat/grid.d.ts +4 -0
- package/registry/examples/stat/grid.js +17 -0
- package/registry/examples/stat/grid.tsx +14 -0
- package/registry/examples/stepper/native/run.d.ts +4 -0
- package/registry/examples/stepper/native/run.dark.png +0 -0
- package/registry/examples/stepper/native/run.js +24 -0
- package/registry/examples/stepper/native/run.light.png +0 -0
- package/registry/examples/stepper/native/run.tsx +20 -0
- package/registry/examples/swipeable-row/native/conversation.d.ts +4 -0
- package/registry/examples/swipeable-row/native/conversation.dark.png +0 -0
- package/registry/examples/swipeable-row/native/conversation.js +30 -0
- package/registry/examples/swipeable-row/native/conversation.light.png +0 -0
- package/registry/examples/swipeable-row/native/conversation.tsx +27 -0
- package/registry/examples/tab-bar/native/main-sections.d.ts +4 -0
- package/registry/examples/tab-bar/native/main-sections.dark.png +0 -0
- package/registry/examples/tab-bar/native/main-sections.js +29 -0
- package/registry/examples/tab-bar/native/main-sections.light.png +0 -0
- package/registry/examples/tab-bar/native/main-sections.tsx +30 -0
- package/registry/examples/tabs/native/sections.d.ts +4 -0
- package/registry/examples/tabs/native/sections.dark.png +0 -0
- package/registry/examples/tabs/native/sections.js +23 -0
- package/registry/examples/tabs/native/sections.light.png +0 -0
- package/registry/examples/tabs/native/sections.tsx +19 -0
- package/registry/examples/tabs/native/segmented.d.ts +4 -0
- package/registry/examples/tabs/native/segmented.dark.png +0 -0
- package/registry/examples/tabs/native/segmented.js +22 -0
- package/registry/examples/tabs/native/segmented.light.png +0 -0
- package/registry/examples/tabs/native/segmented.tsx +18 -0
- package/registry/examples/toast/native/snackbar.d.ts +4 -0
- package/registry/examples/toast/native/snackbar.dark.png +0 -0
- package/registry/examples/toast/native/snackbar.js +23 -0
- package/registry/examples/toast/native/snackbar.light.png +0 -0
- package/registry/examples/toast/native/snackbar.tsx +21 -0
- package/registry/examples/tree-view/docs.d.ts +4 -0
- package/registry/examples/tree-view/docs.js +24 -0
- package/registry/examples/tree-view/docs.tsx +22 -0
- package/registry/examples/tree-view/lazy.d.ts +4 -0
- package/registry/examples/tree-view/lazy.js +21 -0
- package/registry/examples/tree-view/lazy.tsx +19 -0
- package/registry/fab.json +122 -0
- package/registry/field.json +1 -1
- package/registry/file-upload.json +2 -2
- package/registry/filter-bar.json +1 -1
- package/registry/form.json +2 -2
- package/registry/gallery-page.json +1 -1
- package/registry/glow-card.json +1 -1
- package/registry/goal-gauge.json +1 -1
- package/registry/header.json +137 -0
- package/registry/how-it-works-page.json +1 -1
- package/registry/image-cropper.json +1 -1
- package/registry/image-viewer.json +107 -0
- package/registry/index.json +299 -25
- package/registry/iso.json +1 -1
- package/registry/kanban.json +253 -0
- 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 +367 -30
- package/registry/loader.json +157 -4
- package/registry/longform-page.json +1 -1
- package/registry/map.json +1368 -0
- 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/media-capture.json +1 -1
- package/registry/media-picker.json +129 -0
- package/registry/meter.json +136 -4
- package/registry/nav-bar.json +1 -1
- package/registry/number-ticker.json +96 -4
- package/registry/onboarding.json +95 -0
- package/registry/otp-input.json +150 -0
- 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/permission-prompt.json +172 -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 +2 -2
- package/registry/promise-card.json +1 -1
- package/registry/pull-to-refresh.json +74 -0
- package/registry/radio-group.json +1 -1
- package/registry/scroll-stage.json +1 -1
- package/registry/search-field.json +30 -3
- 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 +68 -5
- package/registry/status-page.json +1 -1
- package/registry/stepper.json +75 -4
- package/registry/swipeable-row.json +124 -0
- package/registry/switch.json +1 -1
- package/registry/tab-bar.json +115 -0
- package/registry/tabs.json +94 -4
- package/registry/tag-input.json +1 -1
- package/registry/terminal-replay.json +1 -1
- package/registry/theme.json +8 -1
- package/registry/toast.json +17 -3
- package/registry/toc.json +1 -1
- package/registry/tooltip.json +1 -1
- package/registry/tree-view.json +291 -0
- package/registry/video-player.json +1 -1
- package/registry/video-trimmer.json +1 -1
- package/registry/virtual.json +1 -1
- package/skills/map/SKILL.md +35 -0
package/dist/data-table.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Checkbox
|
|
4
|
+
} from "./chunk-7Z4KHPFC.js";
|
|
2
5
|
import {
|
|
3
6
|
useLayoutFallbacks,
|
|
4
7
|
useVirtualizer
|
|
@@ -41,48 +44,12 @@ function dataTableCsv(rows, columns, separator = ",") {
|
|
|
41
44
|
// src/data-table/data-table.tsx
|
|
42
45
|
import { useTable } from "@tanstack/react-table";
|
|
43
46
|
import * as React from "react";
|
|
44
|
-
import { tv as
|
|
45
|
-
|
|
46
|
-
// src/checkbox/checkbox.tsx
|
|
47
|
-
import { Checkbox as CheckboxPrimitive } from "radix-ui";
|
|
48
|
-
import { tv } from "tailwind-variants";
|
|
49
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
50
|
-
var checkbox = tv({
|
|
51
|
-
slots: {
|
|
52
|
-
root: "peer inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-md border border-border-strong bg-surface-1 text-on-accent transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-0 hover:border-accent disabled:cursor-not-allowed disabled:opacity-40 data-[state=checked]:border-accent data-[state=checked]:bg-accent data-[state=indeterminate]:border-accent data-[state=indeterminate]:bg-accent aria-invalid:border-danger aria-invalid:ring-danger/30",
|
|
53
|
-
indicator: "flex items-center justify-center",
|
|
54
|
-
label: "flex cursor-pointer items-start gap-3 text-sm text-fg has-disabled:cursor-not-allowed has-disabled:opacity-60"
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
function Check() {
|
|
58
|
-
return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", className: "h-3.5 w-3.5", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M20 6 9 17l-5-5" }) });
|
|
59
|
-
}
|
|
60
|
-
function Dash() {
|
|
61
|
-
return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", className: "h-3.5 w-3.5", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M5 12h14" }) });
|
|
62
|
-
}
|
|
63
|
-
function Checkbox({ invalid, className, children, ...props }) {
|
|
64
|
-
const s2 = checkbox();
|
|
65
|
-
const box = /* @__PURE__ */ jsx(
|
|
66
|
-
CheckboxPrimitive.Root,
|
|
67
|
-
{
|
|
68
|
-
"aria-invalid": invalid || void 0,
|
|
69
|
-
"data-invalid": invalid ? "" : void 0,
|
|
70
|
-
className: s2.root({ className: children ? "mt-0.5" : className }),
|
|
71
|
-
...props,
|
|
72
|
-
children: /* @__PURE__ */ jsx(CheckboxPrimitive.Indicator, { className: s2.indicator(), children: props.checked === "indeterminate" ? /* @__PURE__ */ jsx(Dash, {}) : /* @__PURE__ */ jsx(Check, {}) })
|
|
73
|
-
}
|
|
74
|
-
);
|
|
75
|
-
if (!children) return box;
|
|
76
|
-
return /* @__PURE__ */ jsxs("label", { className: s2.label({ className }), children: [
|
|
77
|
-
box,
|
|
78
|
-
/* @__PURE__ */ jsx("span", { className: "min-w-0", children })
|
|
79
|
-
] });
|
|
80
|
-
}
|
|
47
|
+
import { tv as tv2 } from "tailwind-variants";
|
|
81
48
|
|
|
82
49
|
// src/pagination/pagination.tsx
|
|
83
|
-
import { tv
|
|
84
|
-
import { Fragment, jsx
|
|
85
|
-
var pagination =
|
|
50
|
+
import { tv } from "tailwind-variants";
|
|
51
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
52
|
+
var pagination = tv({
|
|
86
53
|
slots: {
|
|
87
54
|
root: "@container flex w-full flex-wrap items-center justify-between gap-3 text-sm",
|
|
88
55
|
list: "flex items-center gap-1",
|
|
@@ -123,12 +90,12 @@ function pageRange(page, pageCount, siblings = 1, boundaries = 1) {
|
|
|
123
90
|
function Item({ href, onClick, disabled, current, label, className, children }) {
|
|
124
91
|
const common = { "aria-label": label, "aria-current": current ? "page" : void 0, className };
|
|
125
92
|
if (href && !disabled) {
|
|
126
|
-
return /* @__PURE__ */
|
|
93
|
+
return /* @__PURE__ */ jsx("a", { href, onClick, ...common, children });
|
|
127
94
|
}
|
|
128
95
|
if (href) {
|
|
129
|
-
return /* @__PURE__ */
|
|
96
|
+
return /* @__PURE__ */ jsx("a", { role: "link", "aria-disabled": true, ...common, children });
|
|
130
97
|
}
|
|
131
|
-
return /* @__PURE__ */
|
|
98
|
+
return /* @__PURE__ */ jsx("button", { type: "button", onClick, disabled, ...common, children });
|
|
132
99
|
}
|
|
133
100
|
function Pagination({
|
|
134
101
|
page = 1,
|
|
@@ -159,25 +126,25 @@ function Pagination({
|
|
|
159
126
|
const canNext = paged ? current < count : Boolean(hasNext);
|
|
160
127
|
const go = (target) => () => onPageChange?.(target);
|
|
161
128
|
const href = (target) => paged && getHref ? getHref(target) : void 0;
|
|
162
|
-
return /* @__PURE__ */
|
|
163
|
-
status !== void 0 || pageSizeOptions ? /* @__PURE__ */
|
|
164
|
-
status !== void 0 && /* @__PURE__ */
|
|
165
|
-
pageSizeOptions && pageSize !== void 0 && /* @__PURE__ */
|
|
129
|
+
return /* @__PURE__ */ jsxs("nav", { "aria-label": labels.nav, className: s2.root({ className }), ...props, children: [
|
|
130
|
+
status !== void 0 || pageSizeOptions ? /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-4", children: [
|
|
131
|
+
status !== void 0 && /* @__PURE__ */ jsx("p", { className: s2.status(), children: status }),
|
|
132
|
+
pageSizeOptions && pageSize !== void 0 && /* @__PURE__ */ jsxs("label", { className: s2.size(), children: [
|
|
166
133
|
labels.pageSize,
|
|
167
|
-
/* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ jsx(
|
|
168
135
|
"select",
|
|
169
136
|
{
|
|
170
137
|
className: s2.select(),
|
|
171
138
|
value: pageSize,
|
|
172
139
|
disabled,
|
|
173
140
|
onChange: (event) => onPageSizeChange?.(Number(event.target.value)),
|
|
174
|
-
children: pageSizeOptions.map((size) => /* @__PURE__ */
|
|
141
|
+
children: pageSizeOptions.map((size) => /* @__PURE__ */ jsx("option", { value: size, children: size }, size))
|
|
175
142
|
}
|
|
176
143
|
)
|
|
177
144
|
] })
|
|
178
145
|
] }) : null,
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ jsxs("ul", { className: s2.list(), children: [
|
|
147
|
+
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
|
|
181
148
|
Item,
|
|
182
149
|
{
|
|
183
150
|
href: href(current - 1),
|
|
@@ -186,18 +153,18 @@ function Pagination({
|
|
|
186
153
|
label: labels.previous,
|
|
187
154
|
className: s2.item({ className: s2.edge() }),
|
|
188
155
|
children: [
|
|
189
|
-
/* @__PURE__ */
|
|
190
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ jsx(ChevronGlyph, { direction: "left" }),
|
|
157
|
+
/* @__PURE__ */ jsx("span", { className: "hidden @lg:inline", children: labels.previous })
|
|
191
158
|
]
|
|
192
159
|
}
|
|
193
160
|
) }),
|
|
194
|
-
paged && /* @__PURE__ */
|
|
195
|
-
/* @__PURE__ */
|
|
196
|
-
(n, i) => n === "\u2026" ? /* @__PURE__ */
|
|
161
|
+
paged && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
162
|
+
/* @__PURE__ */ jsx("li", { className: s2.pages(), children: /* @__PURE__ */ jsx("ul", { className: "contents", children: pageRange(current, count, siblings, boundaries).map(
|
|
163
|
+
(n, i) => n === "\u2026" ? /* @__PURE__ */ jsx("li", { "aria-hidden": true, className: s2.ellipsis(), children: "\u2026" }, `gap-${i}`) : /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Item, { href: href(n), onClick: go(n), disabled, current: n === current, label: labels.page(n), className: s2.item(), children: n }) }, n)
|
|
197
164
|
) }) }),
|
|
198
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ jsx("li", { className: s2.compact(), children: labels.compact(current, count) })
|
|
199
166
|
] }),
|
|
200
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
|
|
201
168
|
Item,
|
|
202
169
|
{
|
|
203
170
|
href: href(current + 1),
|
|
@@ -206,8 +173,8 @@ function Pagination({
|
|
|
206
173
|
label: labels.next,
|
|
207
174
|
className: s2.item({ className: s2.edge() }),
|
|
208
175
|
children: [
|
|
209
|
-
/* @__PURE__ */
|
|
210
|
-
/* @__PURE__ */
|
|
176
|
+
/* @__PURE__ */ jsx("span", { className: "hidden @lg:inline", children: labels.next }),
|
|
177
|
+
/* @__PURE__ */ jsx(ChevronGlyph, { direction: "right" })
|
|
211
178
|
]
|
|
212
179
|
}
|
|
213
180
|
) })
|
|
@@ -282,8 +249,8 @@ filterRange.autoRemove = (value) => !Array.isArray(value) || value[0] == null &&
|
|
|
282
249
|
var FILTERS = { text: filterText, facet: filterFacet, range: filterRange };
|
|
283
250
|
|
|
284
251
|
// src/data-table/data-table.tsx
|
|
285
|
-
import { jsx as
|
|
286
|
-
var dataTable =
|
|
252
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
253
|
+
var dataTable = tv2({
|
|
287
254
|
slots: {
|
|
288
255
|
root: "@container w-full overflow-hidden rounded-xl border border-border-default bg-surface-1",
|
|
289
256
|
toolbar: "border-b border-border-default p-3",
|
|
@@ -573,7 +540,7 @@ function DataTable({
|
|
|
573
540
|
return { "data-pin": position, style: { ["--dt-pin"]: `${offset}px` } };
|
|
574
541
|
};
|
|
575
542
|
const width = (column) => fixedLayout || byId.get(column.id)?.width ? { width: column.getSize() } : void 0;
|
|
576
|
-
const message = (content, alert) => /* @__PURE__ */
|
|
543
|
+
const message = (content, alert) => /* @__PURE__ */ jsx2("tr", { role: "row", className: s2.tr({ className: "hover:bg-transparent" }), children: /* @__PURE__ */ jsx2("td", { role: "cell", colSpan: span, "data-card": "message", className: s2.td({ className: s2.message() }), children: alert ? /* @__PURE__ */ jsx2("div", { role: "alert", children: content }) : content }) });
|
|
577
544
|
const cardOf = (column) => column?.card === "title" ? "title" : column?.card === "hidden" ? "hidden" : void 0;
|
|
578
545
|
const dataCell = (row, cell, first) => {
|
|
579
546
|
const column = byId.get(cell.column.id);
|
|
@@ -584,13 +551,13 @@ function DataTable({
|
|
|
584
551
|
const leaves = row.getLeafRows().filter((r) => !r.getIsGrouped()).map((r) => r.original);
|
|
585
552
|
if (cell.column.id === row.groupingColumnId) {
|
|
586
553
|
const value = display(row.groupingValue);
|
|
587
|
-
content = /* @__PURE__ */
|
|
588
|
-
/* @__PURE__ */
|
|
554
|
+
content = /* @__PURE__ */ jsxs2("button", { type: "button", className: s2.toggle({ className: "px-1.5 font-semibold text-fg" }), "aria-expanded": row.getIsExpanded(), onClick: row.getToggleExpandedHandler(), children: [
|
|
555
|
+
/* @__PURE__ */ jsx2(ChevronGlyph, { direction: "right", className: "h-4 w-4" }),
|
|
589
556
|
labels.group(value, leaves.length)
|
|
590
557
|
] });
|
|
591
558
|
} else content = column.aggregate ? column.aggregate(leaves) : null;
|
|
592
559
|
} else content = column.cell ? column.cell(row.original) : display(valueOf(column, row.original));
|
|
593
|
-
return /* @__PURE__ */
|
|
560
|
+
return /* @__PURE__ */ jsx2(
|
|
594
561
|
"td",
|
|
595
562
|
{
|
|
596
563
|
role: "cell",
|
|
@@ -609,7 +576,7 @@ function DataTable({
|
|
|
609
576
|
const grouped = row.getIsGrouped();
|
|
610
577
|
const canExpand = !grouped && (renderDetail ? true : row.getCanExpand());
|
|
611
578
|
const cells = row.getVisibleCells();
|
|
612
|
-
const main = /* @__PURE__ */
|
|
579
|
+
const main = /* @__PURE__ */ jsxs2(
|
|
613
580
|
"tr",
|
|
614
581
|
{
|
|
615
582
|
role: "row",
|
|
@@ -620,32 +587,32 @@ function DataTable({
|
|
|
620
587
|
"data-group": grouped ? "" : void 0,
|
|
621
588
|
className: s2.tr({ className: grouped ? s2.groupRow() : void 0 }),
|
|
622
589
|
children: [
|
|
623
|
-
selectable && /* @__PURE__ */
|
|
624
|
-
hasExpander && /* @__PURE__ */
|
|
590
|
+
selectable && /* @__PURE__ */ jsx2("td", { role: "cell", className: s2.td({ className: s2.select() }), children: grouped ? null : /* @__PURE__ */ jsx2(Checkbox, { checked: isChosen, onCheckedChange: () => row.toggleSelected(), "aria-label": labels.selectRow(nameOf(row)) }) }),
|
|
591
|
+
hasExpander && /* @__PURE__ */ jsx2("td", { role: "cell", className: s2.td({ className: s2.expander() }), children: canExpand ? /* @__PURE__ */ jsx2("button", { type: "button", className: s2.toggle(), "aria-expanded": row.getIsExpanded(), "aria-label": labels.expandRow(nameOf(row)), onClick: row.getToggleExpandedHandler(), children: /* @__PURE__ */ jsx2(ChevronGlyph, { direction: "right", className: "h-4 w-4" }) }) : null }),
|
|
625
592
|
cells.map((cell, i) => dataCell(row, cell, i === 0))
|
|
626
593
|
]
|
|
627
594
|
},
|
|
628
595
|
row.id
|
|
629
596
|
);
|
|
630
597
|
if (!renderDetail || grouped || !row.getIsExpanded() || virtualized) return main;
|
|
631
|
-
return /* @__PURE__ */
|
|
598
|
+
return /* @__PURE__ */ jsxs2(React.Fragment, { children: [
|
|
632
599
|
main,
|
|
633
|
-
/* @__PURE__ */
|
|
600
|
+
/* @__PURE__ */ jsx2("tr", { role: "row", className: s2.tr({ className: "hover:bg-transparent" }), children: /* @__PURE__ */ jsx2("td", { role: "cell", colSpan: span, "data-card": "message", className: s2.td({ className: s2.detail() }), children: renderDetail(row.original) }) })
|
|
634
601
|
] }, row.id);
|
|
635
602
|
};
|
|
636
603
|
let body;
|
|
637
604
|
if (loading) {
|
|
638
|
-
body = Array.from({ length: loadingRows }, (_, i) => /* @__PURE__ */
|
|
639
|
-
selectable && /* @__PURE__ */
|
|
640
|
-
hasExpander && /* @__PURE__ */
|
|
641
|
-
visibleColumns.map((column) => /* @__PURE__ */
|
|
605
|
+
body = Array.from({ length: loadingRows }, (_, i) => /* @__PURE__ */ jsxs2("tr", { role: "row", "aria-hidden": true, className: s2.tr(), children: [
|
|
606
|
+
selectable && /* @__PURE__ */ jsx2("td", { role: "cell", className: s2.td({ className: s2.select() }) }),
|
|
607
|
+
hasExpander && /* @__PURE__ */ jsx2("td", { role: "cell", className: s2.td({ className: s2.expander() }) }),
|
|
608
|
+
visibleColumns.map((column) => /* @__PURE__ */ jsx2("td", { role: "cell", "data-card": cardOf(byId.get(column.id)), className: s2.td(), children: /* @__PURE__ */ jsx2("div", { className: s2.skeleton() }) }, column.id))
|
|
642
609
|
] }, `loading-${i}`));
|
|
643
610
|
} else if (error) body = message(error, true);
|
|
644
611
|
else if (pageRows.length === 0) body = message(empty2 ?? labels.empty);
|
|
645
612
|
else if (windowItems) body = windowItems.map((item) => renderRow(pageRows[item.index], item.index));
|
|
646
613
|
else body = pageRows.map((row, i) => renderRow(row, i));
|
|
647
614
|
const headers = table.getHeaderGroups().at(-1)?.headers ?? [];
|
|
648
|
-
const tableElement = /* @__PURE__ */
|
|
615
|
+
const tableElement = /* @__PURE__ */ jsxs2(
|
|
649
616
|
"table",
|
|
650
617
|
{
|
|
651
618
|
role: "table",
|
|
@@ -654,12 +621,12 @@ function DataTable({
|
|
|
654
621
|
className: s2.table({ className: fixedLayout ? "table-fixed" : void 0 }),
|
|
655
622
|
style: fixedLayout ? { minWidth: table.getTotalSize() + (selectable ? 40 : 0) + (hasExpander ? 40 : 0) } : void 0,
|
|
656
623
|
children: [
|
|
657
|
-
/* @__PURE__ */
|
|
624
|
+
/* @__PURE__ */ jsxs2("caption", { className: showCaption ? s2.caption() : "sr-only", children: [
|
|
658
625
|
caption,
|
|
659
|
-
loading ? /* @__PURE__ */
|
|
626
|
+
loading ? /* @__PURE__ */ jsx2("span", { className: "sr-only", children: ` \u2014 ${labels.loading}` }) : null
|
|
660
627
|
] }),
|
|
661
|
-
/* @__PURE__ */
|
|
662
|
-
selectable && /* @__PURE__ */
|
|
628
|
+
/* @__PURE__ */ jsx2("thead", { role: "rowgroup", className: s2.thead({ className: virtualized ? "sticky top-0 z-10 bg-surface-2" : void 0 }), children: /* @__PURE__ */ jsxs2("tr", { role: "row", "aria-rowindex": virtualized ? 1 : void 0, className: s2.headRow(), children: [
|
|
629
|
+
selectable && /* @__PURE__ */ jsx2("th", { role: "columnheader", scope: "col", "data-keep": "", className: s2.th({ className: s2.select() }), children: /* @__PURE__ */ jsx2(
|
|
663
630
|
Checkbox,
|
|
664
631
|
{
|
|
665
632
|
checked: allChosen ? true : someChosen ? "indeterminate" : false,
|
|
@@ -668,14 +635,14 @@ function DataTable({
|
|
|
668
635
|
"aria-label": labels.selectAll
|
|
669
636
|
}
|
|
670
637
|
) }),
|
|
671
|
-
hasExpander && /* @__PURE__ */
|
|
638
|
+
hasExpander && /* @__PURE__ */ jsx2("th", { role: "columnheader", scope: "col", className: s2.th({ className: s2.expander() }), children: /* @__PURE__ */ jsx2("span", { className: "sr-only", children: labels.details }) }),
|
|
672
639
|
headers.map((header) => {
|
|
673
640
|
const column = byId.get(header.column.id);
|
|
674
641
|
if (!column) return null;
|
|
675
642
|
const sorted = header.column.getIsSorted();
|
|
676
643
|
const direction = sorted === "asc" ? "ascending" : sorted === "desc" ? "descending" : void 0;
|
|
677
644
|
const { style, ...pinned } = pin(header.column);
|
|
678
|
-
return /* @__PURE__ */
|
|
645
|
+
return /* @__PURE__ */ jsxs2(
|
|
679
646
|
"th",
|
|
680
647
|
{
|
|
681
648
|
role: "columnheader",
|
|
@@ -686,11 +653,11 @@ function DataTable({
|
|
|
686
653
|
className: s2.th({ className: ALIGN[column.align ?? "start"] }),
|
|
687
654
|
style: { ...style, ...width(header.column) },
|
|
688
655
|
children: [
|
|
689
|
-
column.sortable ? /* @__PURE__ */
|
|
656
|
+
column.sortable ? /* @__PURE__ */ jsxs2("button", { type: "button", "aria-pressed": Boolean(direction), className: s2.sortButton(), onClick: () => header.column.toggleSorting(void 0, false), children: [
|
|
690
657
|
column.header,
|
|
691
|
-
/* @__PURE__ */
|
|
692
|
-
] }) : column.headerHidden ? /* @__PURE__ */
|
|
693
|
-
resizing && header.column.getCanResize() ? /* @__PURE__ */
|
|
658
|
+
/* @__PURE__ */ jsx2(SortGlyph, { direction, className: "h-3.5 w-3.5" })
|
|
659
|
+
] }) : column.headerHidden ? /* @__PURE__ */ jsx2("span", { className: "sr-only", children: column.header }) : column.header,
|
|
660
|
+
resizing && header.column.getCanResize() ? /* @__PURE__ */ jsx2(
|
|
694
661
|
ResizeHandle,
|
|
695
662
|
{
|
|
696
663
|
label: labels.resize(column.header),
|
|
@@ -708,10 +675,10 @@ function DataTable({
|
|
|
708
675
|
);
|
|
709
676
|
})
|
|
710
677
|
] }) }),
|
|
711
|
-
/* @__PURE__ */
|
|
712
|
-
before > 0 && /* @__PURE__ */
|
|
678
|
+
/* @__PURE__ */ jsxs2("tbody", { role: "rowgroup", className: s2.tbody(), children: [
|
|
679
|
+
before > 0 && /* @__PURE__ */ jsx2("tr", { "aria-hidden": true, style: { height: before }, children: /* @__PURE__ */ jsx2("td", { colSpan: span }) }),
|
|
713
680
|
body,
|
|
714
|
-
after > 0 && /* @__PURE__ */
|
|
681
|
+
after > 0 && /* @__PURE__ */ jsx2("tr", { "aria-hidden": true, style: { height: after }, children: /* @__PURE__ */ jsx2("td", { colSpan: span }) })
|
|
715
682
|
] })
|
|
716
683
|
]
|
|
717
684
|
}
|
|
@@ -726,7 +693,7 @@ function DataTable({
|
|
|
726
693
|
exportRows: () => table.getSortedRowModel().flatRows.filter((r) => !r.getIsGrouped()).map((r) => r.original),
|
|
727
694
|
manualFiltering: Boolean(manual?.filtering)
|
|
728
695
|
};
|
|
729
|
-
const pagination2 = paginated ? /* @__PURE__ */
|
|
696
|
+
const pagination2 = paginated ? /* @__PURE__ */ jsx2(
|
|
730
697
|
Pagination,
|
|
731
698
|
{
|
|
732
699
|
page: Math.min(page, pageCount),
|
|
@@ -739,11 +706,11 @@ function DataTable({
|
|
|
739
706
|
labels: labels.pagination
|
|
740
707
|
}
|
|
741
708
|
) : null;
|
|
742
|
-
return /* @__PURE__ */
|
|
743
|
-
toolbar ? /* @__PURE__ */
|
|
709
|
+
return /* @__PURE__ */ jsx2(DataTableContext.Provider, { value: context, children: /* @__PURE__ */ jsxs2("div", { className: s2.root({ className }), children: [
|
|
710
|
+
toolbar ? /* @__PURE__ */ jsx2("div", { className: s2.toolbar(), children: toolbar }) : null,
|
|
744
711
|
virtualized ? (
|
|
745
712
|
// A scrolling region the keyboard can reach: Tab lands on it, the arrows scroll it.
|
|
746
|
-
/* @__PURE__ */
|
|
713
|
+
/* @__PURE__ */ jsx2(
|
|
747
714
|
"div",
|
|
748
715
|
{
|
|
749
716
|
ref: scroller,
|
|
@@ -755,8 +722,8 @@ function DataTable({
|
|
|
755
722
|
children: tableElement
|
|
756
723
|
}
|
|
757
724
|
)
|
|
758
|
-
) : /* @__PURE__ */
|
|
759
|
-
pagination2 || footer ? /* @__PURE__ */
|
|
725
|
+
) : /* @__PURE__ */ jsx2("div", { className: s2.scroller(), children: tableElement }),
|
|
726
|
+
pagination2 || footer ? /* @__PURE__ */ jsxs2("div", { className: s2.footer({ className: "flex flex-col gap-3" }), children: [
|
|
760
727
|
pagination2,
|
|
761
728
|
footer
|
|
762
729
|
] }) : null
|
|
@@ -773,7 +740,7 @@ function ResizeHandle({
|
|
|
773
740
|
}) {
|
|
774
741
|
return (
|
|
775
742
|
// A focusable separator is interactive (WAI-ARIA "window splitter"): its value is the width, the arrows change it.
|
|
776
|
-
/* @__PURE__ */
|
|
743
|
+
/* @__PURE__ */ jsx2(
|
|
777
744
|
"div",
|
|
778
745
|
{
|
|
779
746
|
role: "separator",
|
|
@@ -801,17 +768,17 @@ function ResizeHandle({
|
|
|
801
768
|
|
|
802
769
|
// src/button/button.tsx
|
|
803
770
|
import { Slot } from "radix-ui";
|
|
804
|
-
import { tv as
|
|
771
|
+
import { tv as tv3 } from "tailwind-variants";
|
|
805
772
|
|
|
806
773
|
// src/spinner/glyph.tsx
|
|
807
|
-
import { jsx as
|
|
774
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
808
775
|
var HEX = "M12 3 19.79 7.5 19.79 16.5 12 21 4.21 16.5 4.21 7.5Z";
|
|
809
776
|
function LoaderGlyph({ state = "loading", value, ...props }) {
|
|
810
777
|
const known = typeof value === "number" && Number.isFinite(value);
|
|
811
778
|
const fill = state !== "loading" ? 100 : known ? Math.round(Math.min(1, Math.max(0, value)) * 100) : null;
|
|
812
|
-
return /* @__PURE__ */
|
|
813
|
-
/* @__PURE__ */
|
|
814
|
-
/* @__PURE__ */
|
|
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(
|
|
815
782
|
"path",
|
|
816
783
|
{
|
|
817
784
|
d: HEX,
|
|
@@ -824,15 +791,15 @@ function LoaderGlyph({ state = "loading", value, ...props }) {
|
|
|
824
791
|
strokeDasharray: fill === null ? void 0 : `${fill} ${100 - fill}`
|
|
825
792
|
}
|
|
826
793
|
),
|
|
827
|
-
state === "loading" && /* @__PURE__ */
|
|
828
|
-
state === "success" && /* @__PURE__ */
|
|
829
|
-
state === "error" && /* @__PURE__ */
|
|
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" })
|
|
830
797
|
] });
|
|
831
798
|
}
|
|
832
799
|
|
|
833
800
|
// src/button/button.tsx
|
|
834
|
-
import { Fragment as Fragment3, jsx as
|
|
835
|
-
var buttonVariants =
|
|
801
|
+
import { Fragment as Fragment3, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
802
|
+
var buttonVariants = tv3({
|
|
836
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",
|
|
837
804
|
variants: {
|
|
838
805
|
variant: {
|
|
@@ -876,7 +843,7 @@ function Button({
|
|
|
876
843
|
const ratio = known ? Math.min(1, Math.max(0, progress)) : 0;
|
|
877
844
|
const glyph = indicator && !asChild && (loading || status) ? status ?? "loading" : null;
|
|
878
845
|
const filled = variant === "primary" || variant === "gradient";
|
|
879
|
-
const button = /* @__PURE__ */
|
|
846
|
+
const button = /* @__PURE__ */ jsx4(
|
|
880
847
|
Comp,
|
|
881
848
|
{
|
|
882
849
|
type: asChild ? void 0 : "button",
|
|
@@ -894,15 +861,15 @@ function Button({
|
|
|
894
861
|
className: [known && "relative isolate overflow-hidden", shimmer && "kz-sheen", className].filter(Boolean).join(" ") || void 0
|
|
895
862
|
}),
|
|
896
863
|
...props,
|
|
897
|
-
children: asChild ? children : /* @__PURE__ */
|
|
898
|
-
known && /* @__PURE__ */
|
|
899
|
-
glyph && /* @__PURE__ */
|
|
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(
|
|
900
867
|
"span",
|
|
901
868
|
{
|
|
902
869
|
"aria-hidden": true,
|
|
903
870
|
"data-slot": "indicator",
|
|
904
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",
|
|
905
|
-
children: /* @__PURE__ */
|
|
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(" ") }) })
|
|
906
873
|
}
|
|
907
874
|
),
|
|
908
875
|
children
|
|
@@ -910,16 +877,16 @@ function Button({
|
|
|
910
877
|
}
|
|
911
878
|
);
|
|
912
879
|
if (announce === void 0 || asChild) return button;
|
|
913
|
-
return /* @__PURE__ */
|
|
880
|
+
return /* @__PURE__ */ jsxs4(Fragment3, { children: [
|
|
914
881
|
button,
|
|
915
|
-
/* @__PURE__ */
|
|
882
|
+
/* @__PURE__ */ jsx4("span", { role: "status", className: "sr-only", children: announce })
|
|
916
883
|
] });
|
|
917
884
|
}
|
|
918
885
|
|
|
919
886
|
// src/field/field.tsx
|
|
920
|
-
import { tv as
|
|
921
|
-
import { jsx as
|
|
922
|
-
var field2 =
|
|
887
|
+
import { tv as tv4 } from "tailwind-variants";
|
|
888
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
889
|
+
var field2 = tv4({
|
|
923
890
|
slots: {
|
|
924
891
|
root: "flex flex-col gap-1.5",
|
|
925
892
|
label: "text-xs font-semibold text-fg-secondary",
|
|
@@ -934,11 +901,11 @@ var field2 = tv5({
|
|
|
934
901
|
var s = field2();
|
|
935
902
|
var invalidProps = (invalid) => invalid ? { "aria-invalid": true, "data-invalid": "" } : {};
|
|
936
903
|
function Input({ invalid, className, ...props }) {
|
|
937
|
-
return /* @__PURE__ */
|
|
904
|
+
return /* @__PURE__ */ jsx5("input", { ...invalidProps(invalid), className: s.control({ className }), ...props });
|
|
938
905
|
}
|
|
939
906
|
|
|
940
907
|
// src/data-table/toolbar.tsx
|
|
941
|
-
import { jsx as
|
|
908
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
942
909
|
var asRange = (value) => Array.isArray(value) && value.length === 2 && (typeof value[0] !== "string" || typeof value[1] !== "string") ? [value[0], value[1]] : [null, null];
|
|
943
910
|
var asList = (value) => Array.isArray(value) ? value : [];
|
|
944
911
|
var number = (text) => text.trim() === "" || Number.isNaN(Number(text)) ? null : Number(text);
|
|
@@ -970,7 +937,7 @@ function DataTableFilters({ debounce = 250, children, className }) {
|
|
|
970
937
|
const label = labels.activeFilter(column.header, text);
|
|
971
938
|
return [{ id: column.id, label, onRemove: () => set(column.id, null) }];
|
|
972
939
|
});
|
|
973
|
-
return /* @__PURE__ */
|
|
940
|
+
return /* @__PURE__ */ jsxs6(
|
|
974
941
|
FilterBar,
|
|
975
942
|
{
|
|
976
943
|
label: labels.filters,
|
|
@@ -983,7 +950,7 @@ function DataTableFilters({ debounce = 250, children, className }) {
|
|
|
983
950
|
children: [
|
|
984
951
|
filterable.map((column) => {
|
|
985
952
|
if (column.filter === "text")
|
|
986
|
-
return /* @__PURE__ */
|
|
953
|
+
return /* @__PURE__ */ jsx6(
|
|
987
954
|
SearchField,
|
|
988
955
|
{
|
|
989
956
|
label: labels.search(column.header),
|
|
@@ -999,11 +966,11 @@ function DataTableFilters({ debounce = 250, children, className }) {
|
|
|
999
966
|
column.id
|
|
1000
967
|
);
|
|
1001
968
|
if (column.filter === "facet")
|
|
1002
|
-
return /* @__PURE__ */
|
|
969
|
+
return /* @__PURE__ */ jsx6(FilterMenu, { label: column.header, options: optionsOf(column), value: asList(filters[column.id]), onValueChange: (value) => set(column.id, value) }, column.id);
|
|
1003
970
|
const [min, max] = asRange(filters[column.id]);
|
|
1004
971
|
const bounds = manualFiltering ? void 0 : table.getColumn(column.id)?.getFacetedMinMaxValues();
|
|
1005
|
-
return /* @__PURE__ */
|
|
1006
|
-
/* @__PURE__ */
|
|
972
|
+
return /* @__PURE__ */ jsxs6("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
973
|
+
/* @__PURE__ */ jsx6(
|
|
1007
974
|
Input,
|
|
1008
975
|
{
|
|
1009
976
|
type: "number",
|
|
@@ -1015,8 +982,8 @@ function DataTableFilters({ debounce = 250, children, className }) {
|
|
|
1015
982
|
className: "h-11 w-28"
|
|
1016
983
|
}
|
|
1017
984
|
),
|
|
1018
|
-
/* @__PURE__ */
|
|
1019
|
-
/* @__PURE__ */
|
|
985
|
+
/* @__PURE__ */ jsx6("span", { "aria-hidden": true, className: "text-fg-secondary", children: "\u2013" }),
|
|
986
|
+
/* @__PURE__ */ jsx6(
|
|
1020
987
|
Input,
|
|
1021
988
|
{
|
|
1022
989
|
type: "number",
|
|
@@ -1037,14 +1004,14 @@ function DataTableFilters({ debounce = 250, children, className }) {
|
|
|
1037
1004
|
}
|
|
1038
1005
|
function DataTableColumnsMenu({ defaultOpen, className }) {
|
|
1039
1006
|
const { table, columns, labels } = useDataTable();
|
|
1040
|
-
return /* @__PURE__ */
|
|
1041
|
-
/* @__PURE__ */
|
|
1007
|
+
return /* @__PURE__ */ jsxs6(DropdownMenu.Root, { defaultOpen, modal: false, children: [
|
|
1008
|
+
/* @__PURE__ */ jsx6(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs6(Button, { variant: "outline", size: "sm", className, children: [
|
|
1042
1009
|
labels.columns,
|
|
1043
|
-
/* @__PURE__ */
|
|
1010
|
+
/* @__PURE__ */ jsx6(ChevronGlyph, { className: "h-4 w-4" })
|
|
1044
1011
|
] }) }),
|
|
1045
|
-
/* @__PURE__ */
|
|
1012
|
+
/* @__PURE__ */ jsx6(DropdownMenu.Content, { align: "end", "aria-label": labels.columns, children: columns.filter((column) => column.hideable !== false).map((column) => {
|
|
1046
1013
|
const instance = table.getColumn(column.id);
|
|
1047
|
-
return /* @__PURE__ */
|
|
1014
|
+
return /* @__PURE__ */ jsx6(
|
|
1048
1015
|
DropdownMenu.CheckboxItem,
|
|
1049
1016
|
{
|
|
1050
1017
|
checked: instance?.getIsVisible() ?? true,
|
|
@@ -1068,7 +1035,7 @@ function DataTableExport({ filename = "export.csv", onExport, className }) {
|
|
|
1068
1035
|
link.click();
|
|
1069
1036
|
setTimeout(() => URL.revokeObjectURL(url), 0);
|
|
1070
1037
|
};
|
|
1071
|
-
return /* @__PURE__ */
|
|
1038
|
+
return /* @__PURE__ */ jsx6(Button, { variant: "outline", size: "sm", className, onClick: run, children: labels.export });
|
|
1072
1039
|
}
|
|
1073
1040
|
export {
|
|
1074
1041
|
DataTable,
|