@cloudflare/kumo 2.15.0 → 2.17.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/CHANGELOG.md +40 -0
- package/ai/component-registry.json +49 -11
- package/ai/component-registry.md +102 -4
- package/ai/schemas.ts +5 -3
- package/dist/.build-complete +1 -1
- package/dist/ai/schemas.d.ts +4 -0
- package/dist/ai/schemas.js +2 -0
- package/dist/chunks/{autocomplete-kgp17p6oz4pczxt9.js → autocomplete-evlm6fj7v7w0g2z2.js} +2 -2
- package/dist/chunks/{banner-cpla8vqjxaulggyd.js → banner-lvbgdzxq3yndkbot.js} +1 -1
- package/dist/chunks/{breadcrumbs-oyuqwb09l08uhok2.js → breadcrumbs-fsuyq7z6hdh1thjv.js} +1 -1
- package/dist/chunks/{button-oxy32x5w9x9az80g.js → button-k7axs4vu1rwx89w3.js} +1 -1
- package/dist/chunks/{chart-foxl6xbubuoshfcs.js → chart-hp3vqwe49tbyywqm.js} +17 -6
- package/dist/chunks/{checkbox-o9627970y7c9ciqy.js → checkbox-g8b4f2hs5vux3u26.js} +1 -1
- package/dist/chunks/{clipboard-text-bhy88tgvk1o6wmyl.js → clipboard-text-fffd5tpa0iye6r6m.js} +17 -6
- package/dist/chunks/{combobox-hwrq8etkr7p2id0x.js → combobox-iawd8lxwd5b18fce.js} +2 -2
- package/dist/chunks/{date-picker-oee5ehsrepnlmltj.js → date-picker-kfoxd4u7ckg4nsez.js} +78 -6
- package/dist/chunks/{empty-ft85jcbs7fd5t3tn.js → empty-ir5bg5w4kkisuc1c.js} +1 -1
- package/dist/chunks/{field-jzzlgre0jmrr38o2.js → field-n7gmbg5xvh6oqbom.js} +7 -2
- package/dist/chunks/{input-ksy1w6j1m6olz6ck.js → input-f0pbcvjudf5zb8ek.js} +2 -2
- package/dist/chunks/{input-group-n08mcd8b36wbylro.js → input-group-dqo5tcoewbdx86qx.js} +4 -4
- package/dist/chunks/{input-il37wjigy2xtgdo2.js → input-iev3wgdzhkqpae2k.js} +2 -2
- package/dist/chunks/{label-hugrtzreeqk5mtqu.js → label-njfcj6h9utmg2n9l.js} +2 -2
- package/dist/chunks/{layer-dialog-dwrrgv1wasrerow4.js → layer-dialog-n7foup6icxowm82n.js} +11 -3
- package/dist/chunks/{menubar-m5pqhx7lu5z7mkks.js → menubar-b454nksysu0wicbz.js} +1 -1
- package/dist/chunks/{pagination-h24on80p2z5ugqdb.js → pagination-mwlpbysq4cxmvs45.js} +25 -23
- package/dist/chunks/{select-ey03k4630uckf1rk.js → select-fae2ls189jrq902h.js} +4 -4
- package/dist/chunks/{sensitive-input-lfrrtyg9n5ulq3tb.js → sensitive-input-heb3xapwahzhpq6y.js} +2 -2
- package/dist/chunks/{sidebar-gluq5b5oacrdk4m4.js → sidebar-h6g412ror8p7uo0d.js} +3 -3
- package/dist/chunks/{switch-mqf1ulvle4nd6d2t.js → switch-ktfauhluw1yi5tkk.js} +1 -1
- package/dist/chunks/{table-nysse5tiwf47gg4k.js → table-lp41fsw7mqr751hn.js} +1 -1
- package/dist/chunks/{tag-input-b10gfxoob9vcizpm.js → tag-input-k6vzllby4qebmv63.js} +38 -22
- package/dist/chunks/{toast-b4t9rt9y1sumcmy2.js → toast-kzwscia42707sau6.js} +60 -52
- package/dist/chunks/{toolbar-hov6sa3ui366f447.js → toolbar-nnos2ouwfk7i6tpw.js} +3 -3
- package/dist/chunks/{tooltip-lguwh8bjhxwnjfus.js → tooltip-bcymn9bfyz29fvji.js} +2 -0
- package/dist/code.js +4 -4
- package/dist/components/autocomplete.js +1 -1
- package/dist/components/banner.js +1 -1
- package/dist/components/breadcrumbs.js +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/chart.d.ts +1 -1
- package/dist/components/chart.js +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/clipboard-text.d.ts +1 -1
- package/dist/components/clipboard-text.js +1 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/date-picker.d.ts +1 -1
- package/dist/components/date-picker.js +1 -1
- package/dist/components/empty.js +1 -1
- package/dist/components/field.js +1 -1
- package/dist/components/input-group.js +1 -1
- package/dist/components/input.js +3 -3
- package/dist/components/label.js +1 -1
- package/dist/components/layer-dialog.d.ts +1 -1
- package/dist/components/layer-dialog.js +1 -1
- package/dist/components/menubar.js +1 -1
- package/dist/components/pagination.js +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/sensitive-input.js +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/switch.js +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/tag-input.d.ts +1 -1
- package/dist/components/tag-input.js +1 -1
- package/dist/components/toast.js +1 -1
- package/dist/components/toolbar.js +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/{index-CiwC1j1N.d.ts → index-2jvVmJ8P.d.ts} +9 -0
- package/dist/{index-DJIRVD5B.d.ts → index-CReGk3Dc.d.ts} +6 -0
- package/dist/{index-5bJAnzUo.d.ts → index-Dmbgjww7.d.ts} +1 -0
- package/dist/{index-DNsSKNUe.d.ts → index-bBPKMepR.d.ts} +4 -0
- package/dist/{index-fsZE0vPs.d.ts → index-g-eFm1Bq.d.ts} +2 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +27 -27
- package/dist/styles/kumo-binding.css +159 -0
- package/dist/styles/kumo-standalone.css +1 -1
- package/dist/styles/kumo.css +0 -545
- package/package.json +1 -1
- package/scripts/format-generated.ts +12 -0
- package/scripts/generate-primitives.ts +16 -12
- package/scripts/theme-generator/index.ts +2 -2
|
@@ -352,8 +352,16 @@ function clusterTimeseriesMarkers(markers, interval) {
|
|
|
352
352
|
});
|
|
353
353
|
}
|
|
354
354
|
function getApproximateMarkerClusterInterval(timestamps, tickCount) {
|
|
355
|
-
|
|
356
|
-
|
|
355
|
+
let min = Infinity;
|
|
356
|
+
let max = -Infinity;
|
|
357
|
+
let count = 0;
|
|
358
|
+
for (const timestamp of timestamps) {
|
|
359
|
+
if (timestamp < min) min = timestamp;
|
|
360
|
+
if (timestamp > max) max = timestamp;
|
|
361
|
+
count++;
|
|
362
|
+
}
|
|
363
|
+
if (count < 2) return 0;
|
|
364
|
+
return (max - min) / tickCount;
|
|
357
365
|
}
|
|
358
366
|
function getTimeseriesMarkerFromEvent(params) {
|
|
359
367
|
if (params.componentType !== "markLine") return;
|
|
@@ -539,7 +547,7 @@ const DEFAULT_X_AXIS_TICK_COUNT = 5;
|
|
|
539
547
|
* />
|
|
540
548
|
* ```
|
|
541
549
|
*/
|
|
542
|
-
const TimeseriesChart = forwardRef(function TimeseriesChart({ echarts, type = "line", data, markers, thresholds, xAxisName, xAxisTickCount, xAxisTickFormat, yAxisTickFormat, yAxisTickLabelFormat, yAxisName, yAxisTickCount, yAxisMinInterval, tooltipValueFormat, tooltipTimestampFormat, tooltipFooter, onTimeRangeChange, height = 350, incomplete, enableLegendSelection = false, isDarkMode, gradient, loading, ariaDescription, optionUpdateBehavior, tooltipMode = "all", tooltipMaxItems = 10, tooltipFollowCursor = "both", tooltipBoundary }, ref) {
|
|
550
|
+
const TimeseriesChart = forwardRef(function TimeseriesChart({ echarts, type = "line", data, markers, thresholds, xAxisName, xAxisTickCount, xAxisHideLabelOverlap = true, xAxisTickFormat, yAxisTickFormat, yAxisTickLabelFormat, yAxisName, yAxisTickCount, yAxisMinInterval, tooltipValueFormat, tooltipTimestampFormat, tooltipFooter, onTimeRangeChange, height = 350, incomplete, enableLegendSelection = false, isDarkMode, gradient, loading, ariaDescription, optionUpdateBehavior, tooltipMode = "all", tooltipMaxItems = 10, tooltipFollowCursor = "both", tooltipBoundary }, ref) {
|
|
543
551
|
const chartRef = useRef(null);
|
|
544
552
|
const containerRef = useRef(null);
|
|
545
553
|
const mergedRef = useCallback((instance) => {
|
|
@@ -612,7 +620,7 @@ const TimeseriesChart = forwardRef(function TimeseriesChart({ echarts, type = "l
|
|
|
612
620
|
};
|
|
613
621
|
const thresholdAnnotations = buildTimeseriesThresholdAnnotations(thresholds);
|
|
614
622
|
const thresholdExtent = getThresholdValueExtent(thresholds);
|
|
615
|
-
const markerAnnotations = buildTimeseriesMarkerAnnotations(clusterTimeseriesMarkers(markers, getApproximateMarkerClusterInterval(getTimestamps(data, markers), xAxisTickCount ?? DEFAULT_X_AXIS_TICK_COUNT)), {
|
|
623
|
+
const markerAnnotations = buildTimeseriesMarkerAnnotations(markers?.length ? clusterTimeseriesMarkers(markers, getApproximateMarkerClusterInterval(getTimestamps(data, markers), xAxisTickCount ?? DEFAULT_X_AXIS_TICK_COUNT)) : [], {
|
|
616
624
|
color: markerColor,
|
|
617
625
|
labelBackgroundColor: markerLabelBackgroundColor
|
|
618
626
|
});
|
|
@@ -701,6 +709,7 @@ const TimeseriesChart = forwardRef(function TimeseriesChart({ echarts, type = "l
|
|
|
701
709
|
splitNumber: xAxisTickCount ?? DEFAULT_X_AXIS_TICK_COUNT,
|
|
702
710
|
axisLabel: {
|
|
703
711
|
color: axisTextColor,
|
|
712
|
+
hideOverlap: xAxisHideLabelOverlap,
|
|
704
713
|
...xAxisTickFormat && { formatter: (value) => xAxisTickFormat(value) }
|
|
705
714
|
}
|
|
706
715
|
},
|
|
@@ -743,6 +752,7 @@ const TimeseriesChart = forwardRef(function TimeseriesChart({ echarts, type = "l
|
|
|
743
752
|
data,
|
|
744
753
|
xAxisName,
|
|
745
754
|
xAxisTickCount,
|
|
755
|
+
xAxisHideLabelOverlap,
|
|
746
756
|
xAxisTickFormat,
|
|
747
757
|
yAxisTickFormat,
|
|
748
758
|
yAxisName,
|
|
@@ -924,8 +934,9 @@ function findNearest(data, ts) {
|
|
|
924
934
|
if (lo > 0 && Math.abs(data[lo - 1][0] - ts) < Math.abs(data[lo][0] - ts)) lo--;
|
|
925
935
|
return data[lo][1];
|
|
926
936
|
}
|
|
927
|
-
function getTimestamps(data, markers) {
|
|
928
|
-
|
|
937
|
+
function* getTimestamps(data, markers) {
|
|
938
|
+
for (const series of data) for (const [timestamp] of series.data) yield timestamp;
|
|
939
|
+
for (const marker of markers) yield marker.timestamp;
|
|
929
940
|
}
|
|
930
941
|
function getAllTooltipRowsAtTimestamp(data, ts, legendSelected) {
|
|
931
942
|
const seenNames = /* @__PURE__ */ new Set();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as cn } from "./vendor-styling-gs32v7xt5znc8kg0.js";
|
|
3
|
-
import { r as Label } from "./label-
|
|
3
|
+
import { r as Label } from "./label-njfcj6h9utmg2n9l.js";
|
|
4
4
|
import { n as FieldsetRoot, t as FieldsetLegend } from "./FieldsetLegend-gl9z9eezr0xg9zr7.js";
|
|
5
5
|
import { n as FieldRoot, t as FieldLabel } from "./FieldLabel-fjc7tdis7rcbq8o4.js";
|
|
6
6
|
import { t as CheckboxGroup$1 } from "./CheckboxGroup-581mfftu99wvjb3a.js";
|
package/dist/chunks/{clipboard-text-bhy88tgvk1o6wmyl.js → clipboard-text-fffd5tpa0iye6r6m.js}
RENAMED
|
@@ -3,12 +3,12 @@ import { t as cn } from "./vendor-styling-gs32v7xt5znc8kg0.js";
|
|
|
3
3
|
import { t as resolveVariant } from "./resolve-variant-l6x5ksfrjtu4m66l.js";
|
|
4
4
|
import { a as TooltipTrigger, i as TooltipPortal, n as TooltipPositioner, s as TooltipRoot, t as TooltipPopup } from "./TooltipPopup-furysmeyb68uycbz.js";
|
|
5
5
|
import { t as TooltipProvider } from "./TooltipProvider-hyans0ens4axh1y8.js";
|
|
6
|
-
import { t as Button } from "./button-
|
|
6
|
+
import { t as Button } from "./button-k7axs4vu1rwx89w3.js";
|
|
7
7
|
import { a as ToastDescription, h as ToastProvider, l as ToastRoot, n as useToastManager, p as ToastViewport, r as ToastPositioner, t as createToastManager } from "./createToastManager-cxjmn4jx3ejh85fs.js";
|
|
8
|
-
import { r as inputVariants } from "./input-
|
|
8
|
+
import { r as inputVariants } from "./input-f0pbcvjudf5zb8ek.js";
|
|
9
9
|
import { forwardRef, useCallback, useEffect, useRef, useState } from "react";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
-
import { CheckIcon, CopyIcon } from "@phosphor-icons/react";
|
|
11
|
+
import { CheckIcon, CopyIcon, EyeIcon, EyeSlashIcon } from "@phosphor-icons/react";
|
|
12
12
|
//#region src/components/clipboard-text/clipboard-text.tsx
|
|
13
13
|
const clipboardToastManager = createToastManager();
|
|
14
14
|
const COPIED_FEEDBACK_MS = 1500;
|
|
@@ -37,7 +37,7 @@ const clipboardTextAnimations = { slide: {
|
|
|
37
37
|
end: "pointer-events-none absolute inset-0 flex items-center justify-center opacity-0 -translate-y-full"
|
|
38
38
|
} };
|
|
39
39
|
function clipboardTextVariants({ size = KUMO_CLIPBOARD_TEXT_DEFAULT_VARIANTS.size } = {}) {
|
|
40
|
-
return cn("flex items-center overflow-hidden bg-kumo-base px-0 font-mono", resolveVariant(KUMO_CLIPBOARD_TEXT_VARIANTS.size, size, KUMO_CLIPBOARD_TEXT_DEFAULT_VARIANTS.size).classes);
|
|
40
|
+
return cn("flex items-center gap-0 overflow-hidden bg-kumo-base px-0 font-mono", resolveVariant(KUMO_CLIPBOARD_TEXT_VARIANTS.size, size, KUMO_CLIPBOARD_TEXT_DEFAULT_VARIANTS.size).classes);
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* Anchored toasts viewport - renders "Copied" toasts anchored to buttons
|
|
@@ -77,8 +77,9 @@ function TooltipWrapper({ children }) {
|
|
|
77
77
|
* <ClipboardText text="0c239dd2" />
|
|
78
78
|
* ```
|
|
79
79
|
*/
|
|
80
|
-
const ClipboardText = forwardRef(({ text, textToCopy, className, size = KUMO_CLIPBOARD_TEXT_DEFAULT_VARIANTS.size, onCopy, tooltip, labels: { copyAction = "Copy to clipboard" } = {} }, ref) => {
|
|
80
|
+
const ClipboardText = forwardRef(({ text, textToCopy, masked = false, className, size = KUMO_CLIPBOARD_TEXT_DEFAULT_VARIANTS.size, onCopy, tooltip, labels: { copyAction = "Copy to clipboard", revealAction = "Reveal value", hideAction = "Hide value" } = {} }, ref) => {
|
|
81
81
|
const [copied, setCopied] = useState(false);
|
|
82
|
+
const [revealed, setRevealed] = useState(false);
|
|
82
83
|
const buttonRef = useRef(null);
|
|
83
84
|
const resetTimeoutRef = useRef(null);
|
|
84
85
|
const toastIdRef = useRef(null);
|
|
@@ -163,14 +164,24 @@ const ClipboardText = forwardRef(({ text, textToCopy, className, size = KUMO_CLI
|
|
|
163
164
|
children: /* @__PURE__ */ jsx(CopyIcon, {})
|
|
164
165
|
})]
|
|
165
166
|
});
|
|
167
|
+
const visibilityButton = masked ? /* @__PURE__ */ jsx(Button, {
|
|
168
|
+
size: sizeConfig.buttonSize,
|
|
169
|
+
variant: "ghost",
|
|
170
|
+
className: cn("rounded-none border-l! border-kumo-line! px-3", "focus:ring-kumo-focus/50 focus:ring-inset", "focus-visible:ring-2 focus-visible:ring-kumo-brand focus-visible:ring-inset"),
|
|
171
|
+
onClick: () => setRevealed((value) => !value),
|
|
172
|
+
"aria-label": revealed ? hideAction : revealAction,
|
|
173
|
+
"aria-pressed": revealed,
|
|
174
|
+
children: revealed ? /* @__PURE__ */ jsx(EyeSlashIcon, {}) : /* @__PURE__ */ jsx(EyeIcon, {})
|
|
175
|
+
}) : null;
|
|
166
176
|
return /* @__PURE__ */ jsxs("div", {
|
|
167
177
|
ref,
|
|
168
178
|
className: cn(inputVariants({ size: sizeConfig.buttonSize }), clipboardTextVariants({ size }), className),
|
|
169
179
|
children: [
|
|
170
180
|
/* @__PURE__ */ jsx("span", {
|
|
171
181
|
className: "grow truncate ps-4 pe-2",
|
|
172
|
-
children: text
|
|
182
|
+
children: masked && !revealed ? "••••••••" : text
|
|
173
183
|
}),
|
|
184
|
+
visibilityButton,
|
|
174
185
|
tooltip ? /* @__PURE__ */ jsx(TooltipWrapper, { children: /* @__PURE__ */ jsxs(TooltipRoot, {
|
|
175
186
|
disabled: copied,
|
|
176
187
|
onOpenChange: (open, eventDetails) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as cn } from "./vendor-styling-gs32v7xt5znc8kg0.js";
|
|
3
3
|
import { n as usePortalContainer } from "./portal-provider-eveknxf26oudn7pp.js";
|
|
4
|
-
import { t as Field } from "./field-
|
|
5
|
-
import { n as KUMO_INPUT_VARIANTS, r as inputVariants } from "./input-
|
|
4
|
+
import { t as Field } from "./field-n7gmbg5xvh6oqbom.js";
|
|
5
|
+
import { n as KUMO_INPUT_VARIANTS, r as inputVariants } from "./input-f0pbcvjudf5zb8ek.js";
|
|
6
6
|
import { C as useComboboxFilter, a as ComboboxGroupLabel, c as ComboboxCollection, l as ComboboxInput, n as ComboboxItem, o as ComboboxGroup, s as ComboboxList, t as ComboboxEmpty } from "./ComboboxEmpty-gkt1y5b81a4983v7.js";
|
|
7
7
|
import { a as ComboboxItemIndicator, i as ComboboxChips, n as ComboboxChipRemove, o as ComboboxValue, r as ComboboxChip, s as ComboboxRoot, t as createComboboxItems } from "./createItems-n07tfwx89cdoar18.js";
|
|
8
8
|
import { n as ComboboxIcon, r as ComboboxTrigger, t as ComboboxClear } from "./ComboboxClear-ioejwvtnmqanph88.js";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as __exportAll } from "./rolldown-runtime-hi7ti5xiuxsegr96.js";
|
|
3
3
|
import { t as cn } from "./vendor-styling-gs32v7xt5znc8kg0.js";
|
|
4
|
+
import { i as buttonVariants } from "./button-k7axs4vu1rwx89w3.js";
|
|
4
5
|
import React, { createContext, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
5
6
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import { CaretLeftIcon, CaretRightIcon } from "@phosphor-icons/react";
|
|
7
|
+
import { CaretDownIcon, CaretLeftIcon, CaretRightIcon, CaretUpIcon } from "@phosphor-icons/react";
|
|
7
8
|
//#region ../../node_modules/.pnpm/@date-fns+tz@1.4.1/node_modules/@date-fns/tz/tzName/index.js
|
|
8
9
|
/**
|
|
9
10
|
* Time zone name format.
|
|
@@ -6740,16 +6741,54 @@ function DayPicker(initialProps) {
|
|
|
6740
6741
|
}
|
|
6741
6742
|
//#endregion
|
|
6742
6743
|
//#region src/components/date-picker/date-picker.tsx
|
|
6744
|
+
const CHEVRON_ICONS = {
|
|
6745
|
+
left: CaretLeftIcon,
|
|
6746
|
+
right: CaretRightIcon,
|
|
6747
|
+
up: CaretUpIcon,
|
|
6748
|
+
down: CaretDownIcon
|
|
6749
|
+
};
|
|
6743
6750
|
/**
|
|
6744
6751
|
* Custom Chevron component using Phosphor icons
|
|
6745
6752
|
*/
|
|
6746
|
-
const Chevron = ({
|
|
6747
|
-
|
|
6753
|
+
const Chevron = ({ className, orientation = "left" }) => {
|
|
6754
|
+
const Icon = CHEVRON_ICONS[orientation];
|
|
6755
|
+
return /* @__PURE__ */ jsx(Icon, {
|
|
6748
6756
|
size: 16,
|
|
6749
|
-
|
|
6757
|
+
className,
|
|
6758
|
+
"aria-hidden": true
|
|
6750
6759
|
});
|
|
6751
6760
|
};
|
|
6752
6761
|
/**
|
|
6762
|
+
* Renders the day cell, or a custom `Day`, with markers for where it sits in
|
|
6763
|
+
* a selected range. Day buttons take their styles from their cell, so a
|
|
6764
|
+
* custom `DayButton` keeps them, and so does a custom `Day` that passes its
|
|
6765
|
+
* props on.
|
|
6766
|
+
*/
|
|
6767
|
+
function withRangeMarkers(CustomDay) {
|
|
6768
|
+
return function Day({ day, modifiers, ...props }) {
|
|
6769
|
+
const markers = {
|
|
6770
|
+
"data-range-start": modifiers.range_start || void 0,
|
|
6771
|
+
"data-range-middle": modifiers.range_middle || void 0,
|
|
6772
|
+
"data-range-end": modifiers.range_end || void 0
|
|
6773
|
+
};
|
|
6774
|
+
return CustomDay ? /* @__PURE__ */ jsx(CustomDay, {
|
|
6775
|
+
day,
|
|
6776
|
+
modifiers,
|
|
6777
|
+
...props,
|
|
6778
|
+
...markers
|
|
6779
|
+
}) : /* @__PURE__ */ jsx("td", {
|
|
6780
|
+
...props,
|
|
6781
|
+
...markers
|
|
6782
|
+
});
|
|
6783
|
+
};
|
|
6784
|
+
}
|
|
6785
|
+
/** Square ghost buttons the size of a day square. */
|
|
6786
|
+
const navButtonClassName = cn(buttonVariants({
|
|
6787
|
+
variant: "ghost",
|
|
6788
|
+
shape: "square"
|
|
6789
|
+
}), "size-(--cell-size) rounded-md aria-disabled:cursor-not-allowed aria-disabled:opacity-50");
|
|
6790
|
+
const dayButtonClassName = cn("flex size-(--cell-size) items-center justify-center rounded-md text-base text-kumo-default tabular-nums transition-colors outline-none", "cursor-pointer hover:bg-kumo-tint", "focus-visible:relative focus-visible:z-10 focus-visible:ring-2 focus-visible:ring-kumo-brand", "[td[data-day][data-disabled]_&]:cursor-not-allowed [td[data-day][data-disabled]_&]:text-kumo-inactive [td[data-day][data-disabled]_&]:hover:bg-transparent", "[td[data-day][data-outside]:not([data-selected])_&]:text-kumo-inactive", "[td[data-day][data-today]:not([data-selected],[data-outside])_&]:font-semibold [td[data-day][data-today]:not([data-selected],[data-outside],[data-disabled])_&]:text-kumo-link", "[td[data-day][data-selected]:not([data-range-middle])_&]:bg-kumo-contrast [td[data-day][data-selected]:not([data-range-middle])_&]:text-kumo-inverse [td[data-day][data-selected]:not([data-range-middle])_&]:hover:bg-kumo-contrast", "[td[data-day][data-range-middle]:not([data-disabled])_&]:hover:bg-kumo-interact", "[td[data-day][data-range-start]:not([data-range-end],:last-of-type)_&]:rounded-e-none", "[td[data-day][data-range-end]:not([data-range-start],:first-of-type)_&]:rounded-s-none");
|
|
6791
|
+
/**
|
|
6753
6792
|
* DatePicker — a date selection calendar.
|
|
6754
6793
|
*
|
|
6755
6794
|
* Built on [react-day-picker](https://daypicker.dev) with Kumo styling.
|
|
@@ -6757,6 +6796,10 @@ const Chevron = ({ orientation, ...props }) => {
|
|
|
6757
6796
|
* Outside-month dates are hidden by default in multi-month views to avoid duplicates.
|
|
6758
6797
|
* Set `showOutsideDays` to override this behavior.
|
|
6759
6798
|
*
|
|
6799
|
+
* DatePicker has no internal padding, so it fits a Popover or a page layout
|
|
6800
|
+
* without overrides. The container sets the spacing, e.g.
|
|
6801
|
+
* `<Popover.Content className="p-3">`, or `className="p-3"` on its own.
|
|
6802
|
+
*
|
|
6760
6803
|
* @example
|
|
6761
6804
|
* ```tsx
|
|
6762
6805
|
* // Single date selection
|
|
@@ -6773,18 +6816,47 @@ const Chevron = ({ orientation, ...props }) => {
|
|
|
6773
6816
|
* ```
|
|
6774
6817
|
*/
|
|
6775
6818
|
function DatePicker({ className, classNames, onChange, ...props }) {
|
|
6819
|
+
const defaults = getDefaultClassNames();
|
|
6820
|
+
const hasDropdowns = props.captionLayout?.startsWith("dropdown") ?? false;
|
|
6821
|
+
const hasNavAround = props.navLayout === "around";
|
|
6822
|
+
const customDay = props.components?.Day;
|
|
6823
|
+
const Day = useMemo(() => withRangeMarkers(customDay), [customDay]);
|
|
6776
6824
|
return /* @__PURE__ */ jsx(DayPicker, {
|
|
6777
6825
|
showOutsideDays: (props.numberOfMonths ?? 1) === 1,
|
|
6778
6826
|
animate: true,
|
|
6779
6827
|
...props,
|
|
6780
6828
|
onSelect: onChange,
|
|
6781
6829
|
classNames: {
|
|
6830
|
+
months: cn(defaults.months, "relative isolate flex flex-col gap-4 sm:flex-row"),
|
|
6831
|
+
month: cn(defaults.month, "flex flex-col gap-3", props.navLayout && "relative"),
|
|
6832
|
+
nav: cn(defaults.nav, "absolute end-0.5 top-0 z-1 flex items-center gap-1 rtl:[&_svg]:rotate-180"),
|
|
6833
|
+
button_previous: cn(defaults.button_previous, navButtonClassName, hasNavAround && "absolute start-0.5 top-0 z-1"),
|
|
6834
|
+
button_next: cn(defaults.button_next, navButtonClassName, hasNavAround && "absolute end-0.5 top-0 z-1"),
|
|
6835
|
+
month_caption: cn(defaults.month_caption, "flex h-(--cell-size) items-center px-0.5", hasNavAround && "justify-center px-(--cell-size)"),
|
|
6836
|
+
caption_label: cn(defaults.caption_label, "text-base font-medium text-kumo-default", hasDropdowns && "flex h-7 items-center gap-1 rounded-md ps-2 pe-1 [&>svg]:text-kumo-subtle"),
|
|
6837
|
+
dropdowns: cn(defaults.dropdowns, "flex items-center gap-1.5"),
|
|
6838
|
+
dropdown_root: cn(defaults.dropdown_root, "relative rounded-md ring ring-kumo-line has-focus-visible:ring-2 has-focus-visible:ring-kumo-brand"),
|
|
6839
|
+
dropdown: cn(defaults.dropdown, "absolute inset-0 cursor-pointer opacity-0"),
|
|
6840
|
+
month_grid: cn(defaults.month_grid, "border-collapse"),
|
|
6841
|
+
weekdays: cn(defaults.weekdays, "flex"),
|
|
6842
|
+
weekday: cn(defaults.weekday, "flex h-5 w-(--cell-width) items-center justify-center text-xs font-normal text-kumo-subtle"),
|
|
6843
|
+
week: cn(defaults.week, "mt-2 flex"),
|
|
6844
|
+
week_number_header: cn(defaults.week_number_header, "w-(--cell-width)"),
|
|
6845
|
+
week_number: cn(defaults.week_number, "flex h-(--cell-size) w-(--cell-width) items-center justify-center text-xs text-kumo-subtle"),
|
|
6846
|
+
day: cn(defaults.day, "relative flex h-(--cell-size) w-(--cell-width) justify-center p-0 text-center", "data-selected:first-of-type:rounded-s-md data-selected:last-of-type:rounded-e-md", "data-range-start:data-range-end:bg-none"),
|
|
6847
|
+
day_button: cn(defaults.day_button, dayButtonClassName),
|
|
6848
|
+
range_start: cn(defaults.range_start, "bg-linear-to-r from-transparent from-50% to-kumo-fill to-50% last-of-type:bg-none rtl:bg-linear-to-l"),
|
|
6849
|
+
range_middle: cn(defaults.range_middle, "bg-kumo-fill"),
|
|
6850
|
+
range_end: cn(defaults.range_end, "bg-linear-to-l from-transparent from-50% to-kumo-fill to-50% first-of-type:bg-none rtl:bg-linear-to-r"),
|
|
6851
|
+
hidden: cn(defaults.hidden, "invisible"),
|
|
6852
|
+
footer: cn(defaults.footer, "w-0 min-w-full pt-3"),
|
|
6782
6853
|
...classNames,
|
|
6783
|
-
root: cn("
|
|
6854
|
+
root: cn(defaults.root, "w-fit rounded-xl bg-kumo-base text-sm select-none [--cell-size:--spacing(8)] [--cell-width:--spacing(9)]", classNames?.root, className)
|
|
6784
6855
|
},
|
|
6785
6856
|
components: {
|
|
6786
6857
|
Chevron,
|
|
6787
|
-
...props.components
|
|
6858
|
+
...props.components,
|
|
6859
|
+
Day
|
|
6788
6860
|
}
|
|
6789
6861
|
});
|
|
6790
6862
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as cn } from "./vendor-styling-gs32v7xt5znc8kg0.js";
|
|
3
3
|
import { t as resolveVariant } from "./resolve-variant-l6x5ksfrjtu4m66l.js";
|
|
4
|
-
import { t as Button } from "./button-
|
|
4
|
+
import { t as Button } from "./button-k7axs4vu1rwx89w3.js";
|
|
5
5
|
import { t as Text } from "./text-me99rjbjkaff98gp.js";
|
|
6
6
|
import { t as useCopyFeedback } from "./use-copy-feedback-gl55ghst0csvpv4j.js";
|
|
7
7
|
import { useCallback } from "react";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as cn } from "./vendor-styling-gs32v7xt5znc8kg0.js";
|
|
3
|
-
import { r as Label } from "./label-
|
|
3
|
+
import { r as Label } from "./label-njfcj6h9utmg2n9l.js";
|
|
4
4
|
import { n as FieldRoot, t as FieldLabel } from "./FieldLabel-fjc7tdis7rcbq8o4.js";
|
|
5
5
|
import { n as FieldError, t as FieldDescription } from "./FieldDescription-orix2gepowrp5ni4.js";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -29,6 +29,10 @@ function fieldVariants({ controlFirst = false } = {}) {
|
|
|
29
29
|
"[&>label]:flex-1"
|
|
30
30
|
]);
|
|
31
31
|
}
|
|
32
|
+
/** Values React renders as nothing. */
|
|
33
|
+
function rendersNothing(node) {
|
|
34
|
+
return node == null || typeof node === "boolean" || node === "";
|
|
35
|
+
}
|
|
32
36
|
/**
|
|
33
37
|
* Form field wrapper that provides a label, optional description, and error display
|
|
34
38
|
* around any form control. Built on Base UI Field primitives.
|
|
@@ -42,10 +46,11 @@ function fieldVariants({ controlFirst = false } = {}) {
|
|
|
42
46
|
*/
|
|
43
47
|
function Field({ children, label, required, labelTooltip, error, description, controlFirst = false, hideLabel = false }) {
|
|
44
48
|
const showOptional = required === false;
|
|
49
|
+
const hasLabelContent = !rendersNothing(label) || showOptional || !rendersNothing(labelTooltip);
|
|
45
50
|
return /* @__PURE__ */ jsxs(FieldRoot, {
|
|
46
51
|
className: fieldVariants({ controlFirst }),
|
|
47
52
|
children: [
|
|
48
|
-
!hideLabel && /* @__PURE__ */ jsx(FieldLabel, {
|
|
53
|
+
!hideLabel && hasLabelContent && /* @__PURE__ */ jsx(FieldLabel, {
|
|
49
54
|
className: "m-0 text-base font-medium text-kumo-default select-none",
|
|
50
55
|
children: /* @__PURE__ */ jsx(Label, {
|
|
51
56
|
showOptional,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { t as cn } from "./vendor-styling-gs32v7xt5znc8kg0.js";
|
|
3
3
|
import { t as resolveVariant } from "./resolve-variant-l6x5ksfrjtu4m66l.js";
|
|
4
4
|
import { t as Input$1 } from "./Input-ozudotydd679ly63.js";
|
|
5
|
-
import { a as normalizeFieldError, t as Field } from "./field-
|
|
5
|
+
import { a as normalizeFieldError, t as Field } from "./field-n7gmbg5xvh6oqbom.js";
|
|
6
6
|
import { forwardRef } from "react";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/input/input.tsx
|
|
@@ -42,7 +42,7 @@ const KUMO_INPUT_DEFAULT_VARIANTS = {
|
|
|
42
42
|
variant: "default"
|
|
43
43
|
};
|
|
44
44
|
function inputVariants({ variant = KUMO_INPUT_DEFAULT_VARIANTS.variant, size = KUMO_INPUT_DEFAULT_VARIANTS.size, parentFocusIndicator = false, focusIndicator = false } = {}) {
|
|
45
|
-
return cn("border-0 bg-kumo-control text-kumo-default ring ring-kumo-line outline-none focus:outline-none", "kumo-input-placeholder disabled:text-kumo-
|
|
45
|
+
return cn("border-0 bg-kumo-control text-kumo-default ring ring-kumo-line outline-none focus:outline-none", "kumo-input-placeholder disabled:text-kumo-inactive", resolveVariant(KUMO_INPUT_VARIANTS.size, size, KUMO_INPUT_DEFAULT_VARIANTS.size).classes, resolveVariant(KUMO_INPUT_VARIANTS.variant, variant, KUMO_INPUT_DEFAULT_VARIANTS.variant).classes, parentFocusIndicator && (variant === "error" ? "focus-within:ring-[1.5px] focus-within:ring-kumo-danger/50" : "focus-within:ring-[1.5px] focus-within:ring-kumo-focus/50"), focusIndicator && (variant === "error" ? "focus:ring-[1.5px] focus:ring-kumo-danger/50" : "focus:ring-[1.5px] focus:ring-kumo-focus/50"));
|
|
46
46
|
}
|
|
47
47
|
const Input = forwardRef((props, ref) => {
|
|
48
48
|
const { className, size = "base", variant: variantProp, label, labelTooltip, description, error, passwordManagerIgnore = false, ...inputProps } = props;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as cn } from "./vendor-styling-gs32v7xt5znc8kg0.js";
|
|
3
|
-
import { t as Tooltip } from "./tooltip-
|
|
4
|
-
import { t as Button$1 } from "./button-
|
|
5
|
-
import { t as Field } from "./field-
|
|
6
|
-
import { r as inputVariants, t as Input$1 } from "./input-
|
|
3
|
+
import { t as Tooltip } from "./tooltip-bcymn9bfyz29fvji.js";
|
|
4
|
+
import { t as Button$1 } from "./button-k7axs4vu1rwx89w3.js";
|
|
5
|
+
import { t as Field } from "./field-n7gmbg5xvh6oqbom.js";
|
|
6
|
+
import { r as inputVariants, t as Input$1 } from "./input-f0pbcvjudf5zb8ek.js";
|
|
7
7
|
import React, { Children, cloneElement, createContext, forwardRef, isValidElement, useContext, useId, useMemo } from "react";
|
|
8
8
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/input-group/context.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as cn } from "./vendor-styling-gs32v7xt5znc8kg0.js";
|
|
3
3
|
import { t as FieldControl } from "./FieldControl-hjj2tcqruozadgdi.js";
|
|
4
|
-
import { a as normalizeFieldError, t as Field } from "./field-
|
|
5
|
-
import { r as inputVariants } from "./input-
|
|
4
|
+
import { a as normalizeFieldError, t as Field } from "./field-n7gmbg5xvh6oqbom.js";
|
|
5
|
+
import { r as inputVariants } from "./input-f0pbcvjudf5zb8ek.js";
|
|
6
6
|
import * as React$1 from "react";
|
|
7
7
|
import { useCallback, useEffect, useLayoutEffect, useRef } from "react";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as cn } from "./vendor-styling-gs32v7xt5znc8kg0.js";
|
|
3
|
-
import { t as Tooltip } from "./tooltip-
|
|
4
|
-
import { t as Button } from "./button-
|
|
3
|
+
import { t as Tooltip } from "./tooltip-bcymn9bfyz29fvji.js";
|
|
4
|
+
import { t as Button } from "./button-k7axs4vu1rwx89w3.js";
|
|
5
5
|
import { n as useKumoLocale } from "./locale-provider-e3310bgo4lnffqkd.js";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { Info } from "@phosphor-icons/react";
|
|
@@ -3,7 +3,7 @@ import { t as cn } from "./vendor-styling-gs32v7xt5znc8kg0.js";
|
|
|
3
3
|
import { t as resolveVariant } from "./resolve-variant-l6x5ksfrjtu4m66l.js";
|
|
4
4
|
import { t as addEventListener } from "./addEventListener-ku3x23446prmd1kz.js";
|
|
5
5
|
import { n as usePortalContainer } from "./portal-provider-eveknxf26oudn7pp.js";
|
|
6
|
-
import { t as Button } from "./button-
|
|
6
|
+
import { t as Button } from "./button-k7axs4vu1rwx89w3.js";
|
|
7
7
|
import { n as useKumoLocale } from "./locale-provider-e3310bgo4lnffqkd.js";
|
|
8
8
|
import { t as Text } from "./text-me99rjbjkaff98gp.js";
|
|
9
9
|
import { t as LayerCard } from "./layer-card-mar4dya5kl1vvie6.js";
|
|
@@ -12,7 +12,7 @@ import { i as ScrollAreaViewport, n as ScrollAreaContent, r as ScrollAreaScrollb
|
|
|
12
12
|
import { t as ButtonGroup } from "./button-group-biv43ksvaipc3p5n.js";
|
|
13
13
|
import { a as DrawerRoot, g as DrawerBackdrop, h as DrawerClose, i as DrawerTitle, m as DrawerContent, o as DrawerPortal, p as DrawerDescription, r as DrawerTrigger, s as DrawerPopup, t as DrawerViewport } from "./DrawerViewport-mzqpwvqtylnad8ib.js";
|
|
14
14
|
import * as React$1 from "react";
|
|
15
|
-
import { Children, createContext, isValidElement, useContext, useRef, useState } from "react";
|
|
15
|
+
import { Children, createContext, forwardRef, isValidElement, useContext, useRef, useState } from "react";
|
|
16
16
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
17
|
import { CaretDownIcon, X } from "@phosphor-icons/react";
|
|
18
18
|
import { useSyncExternalStore as useSyncExternalStore$1 } from "use-sync-external-store/shim";
|
|
@@ -298,7 +298,7 @@ function LayerDialogBody({ children }) {
|
|
|
298
298
|
/* @__PURE__ */ jsxs(ScrollAreaRoot, {
|
|
299
299
|
className: "relative flex min-h-0 flex-1 flex-col",
|
|
300
300
|
children: [/* @__PURE__ */ jsx(ScrollAreaViewport, {
|
|
301
|
-
className: "min-h-0 flex-1 overscroll-none [mask-image:linear-gradient(to_bottom,transparent_0,black_min(24px,var(--scroll-area-overflow-y-start,0px)),black_calc(100%-min(24px,var(--scroll-area-overflow-y-end,24px))),transparent_100%)]",
|
|
301
|
+
className: "no-scrollbar min-h-0 flex-1 overscroll-none [mask-image:linear-gradient(to_bottom,transparent_0,black_min(24px,var(--scroll-area-overflow-y-start,0px)),black_calc(100%-min(24px,var(--scroll-area-overflow-y-end,24px))),transparent_100%)]",
|
|
302
302
|
onScroll: handleScroll,
|
|
303
303
|
children: isDesktop ? /* @__PURE__ */ jsx(ScrollAreaContent, {
|
|
304
304
|
className: "px-4.5 pt-0.5 pb-4.5",
|
|
@@ -322,6 +322,13 @@ function LayerDialogBody({ children }) {
|
|
|
322
322
|
});
|
|
323
323
|
}
|
|
324
324
|
LayerDialogBody.displayName = "LayerDialog.Body";
|
|
325
|
+
/** A full-width divider between sections of `LayerDialog.Body`. */
|
|
326
|
+
const LayerDialogSeparator = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("hr", {
|
|
327
|
+
ref,
|
|
328
|
+
className: cn("-mx-4 my-4 h-px border-0 bg-kumo-hairline sm:-mx-4.5", className),
|
|
329
|
+
...props
|
|
330
|
+
}));
|
|
331
|
+
LayerDialogSeparator.displayName = "LayerDialog.Separator";
|
|
325
332
|
function LayerDialogIconClose({ disabled, label }) {
|
|
326
333
|
const close = (closeProps) => /* @__PURE__ */ jsx(Button, {
|
|
327
334
|
...closeProps,
|
|
@@ -399,6 +406,7 @@ const LayerDialog = Object.assign(LayerDialogRoot, {
|
|
|
399
406
|
Title: LayerDialogTitle,
|
|
400
407
|
Description: LayerDialogDescription,
|
|
401
408
|
Body: LayerDialogBody,
|
|
409
|
+
Separator: LayerDialogSeparator,
|
|
402
410
|
Action: LayerDialogAction,
|
|
403
411
|
Actions: LayerDialogActions
|
|
404
412
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as cn } from "./vendor-styling-gs32v7xt5znc8kg0.js";
|
|
3
|
-
import { t as Tooltip } from "./tooltip-
|
|
3
|
+
import { t as Tooltip } from "./tooltip-bcymn9bfyz29fvji.js";
|
|
4
4
|
import { useEffect, useRef } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import { IconContext } from "@phosphor-icons/react";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as cn } from "./vendor-styling-gs32v7xt5znc8kg0.js";
|
|
3
|
-
import { t as InputGroup } from "./input-group-
|
|
4
|
-
import { t as Select } from "./select-
|
|
3
|
+
import { t as InputGroup } from "./input-group-dqo5tcoewbdx86qx.js";
|
|
4
|
+
import { t as Select } from "./select-fae2ls189jrq902h.js";
|
|
5
5
|
import { createContext, useContext, useEffect, useMemo, useState } from "react";
|
|
6
6
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { CaretDoubleLeftIcon, CaretDoubleRightIcon, CaretLeftIcon, CaretRightIcon } from "@phosphor-icons/react";
|
|
@@ -80,7 +80,17 @@ function PaginationControls({ controls = KUMO_PAGINATION_DEFAULT_VARIANTS.contro
|
|
|
80
80
|
const { page, totalCount, hasNextPage, maxPage, setPage, editingPage, setEditingPage, labels } = usePaginationContext();
|
|
81
81
|
const hasKnownTotal = totalCount != null;
|
|
82
82
|
const showFullControls = controls === "full" && !(!hasKnownTotal && hasNextPage !== void 0);
|
|
83
|
-
const isNextDisabled = hasKnownTotal ? page
|
|
83
|
+
const isNextDisabled = hasKnownTotal ? page >= maxPage : hasNextPage !== true;
|
|
84
|
+
const commitEditingPage = () => {
|
|
85
|
+
const value = editingPage.trim();
|
|
86
|
+
if (!/^\d+$/.test(value)) {
|
|
87
|
+
setEditingPage(String(page));
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const clamped = clamp(Number(value), 1, maxPage);
|
|
91
|
+
setPage(clamped);
|
|
92
|
+
setEditingPage(String(clamped));
|
|
93
|
+
};
|
|
84
94
|
return /* @__PURE__ */ jsx("div", {
|
|
85
95
|
"data-slot": "pagination-controls",
|
|
86
96
|
className: cn("flex grow flex-col items-end", className),
|
|
@@ -93,7 +103,7 @@ function PaginationControls({ controls = KUMO_PAGINATION_DEFAULT_VARIANTS.contro
|
|
|
93
103
|
disabled: page <= 1,
|
|
94
104
|
onClick: () => {
|
|
95
105
|
setPage(1);
|
|
96
|
-
setEditingPage(1);
|
|
106
|
+
setEditingPage("1");
|
|
97
107
|
},
|
|
98
108
|
children: /* @__PURE__ */ jsx(CaretDoubleLeftIcon, { size: 16 })
|
|
99
109
|
}),
|
|
@@ -104,7 +114,7 @@ function PaginationControls({ controls = KUMO_PAGINATION_DEFAULT_VARIANTS.contro
|
|
|
104
114
|
onClick: () => {
|
|
105
115
|
const previousPage = Math.max(page - 1, 1);
|
|
106
116
|
setPage(previousPage);
|
|
107
|
-
setEditingPage(previousPage);
|
|
117
|
+
setEditingPage(String(previousPage));
|
|
108
118
|
},
|
|
109
119
|
children: /* @__PURE__ */ jsx(CaretLeftIcon, { size: 16 })
|
|
110
120
|
}),
|
|
@@ -115,7 +125,7 @@ function PaginationControls({ controls = KUMO_PAGINATION_DEFAULT_VARIANTS.contro
|
|
|
115
125
|
onValueChange: (value) => {
|
|
116
126
|
const num = value;
|
|
117
127
|
setPage(num);
|
|
118
|
-
setEditingPage(num);
|
|
128
|
+
setEditingPage(String(num));
|
|
119
129
|
},
|
|
120
130
|
children: Array.from({ length: maxPage }, (_, i) => i + 1).map((p) => /* @__PURE__ */ jsx(Select.Option, {
|
|
121
131
|
value: p,
|
|
@@ -127,19 +137,11 @@ function PaginationControls({ controls = KUMO_PAGINATION_DEFAULT_VARIANTS.contro
|
|
|
127
137
|
"aria-label": labels.pageNumber,
|
|
128
138
|
value: editingPage,
|
|
129
139
|
onValueChange: (value) => {
|
|
130
|
-
setEditingPage(
|
|
131
|
-
},
|
|
132
|
-
onBlur: () => {
|
|
133
|
-
const clamped = clamp(editingPage, 1, maxPage);
|
|
134
|
-
setPage(clamped);
|
|
135
|
-
setEditingPage(clamped);
|
|
140
|
+
setEditingPage(value);
|
|
136
141
|
},
|
|
142
|
+
onBlur: commitEditingPage,
|
|
137
143
|
onKeyDown: (e) => {
|
|
138
|
-
if (e.key === "Enter")
|
|
139
|
-
const clamped = clamp(editingPage, 1, maxPage);
|
|
140
|
-
setPage(clamped);
|
|
141
|
-
setEditingPage(clamped);
|
|
142
|
-
}
|
|
144
|
+
if (e.key === "Enter") commitEditingPage();
|
|
143
145
|
},
|
|
144
146
|
autoComplete: "off",
|
|
145
147
|
"data-1p-ignore": true,
|
|
@@ -153,17 +155,17 @@ function PaginationControls({ controls = KUMO_PAGINATION_DEFAULT_VARIANTS.contro
|
|
|
153
155
|
onClick: () => {
|
|
154
156
|
const nextPage = hasKnownTotal ? Math.min(page + 1, maxPage) : page + 1;
|
|
155
157
|
setPage(nextPage);
|
|
156
|
-
setEditingPage(nextPage);
|
|
158
|
+
setEditingPage(String(nextPage));
|
|
157
159
|
},
|
|
158
160
|
children: /* @__PURE__ */ jsx(CaretRightIcon, { size: 16 })
|
|
159
161
|
}),
|
|
160
162
|
showFullControls && /* @__PURE__ */ jsx(InputGroup.Button, {
|
|
161
163
|
variant: "secondary",
|
|
162
164
|
"aria-label": labels.lastPage,
|
|
163
|
-
disabled: page
|
|
165
|
+
disabled: page >= maxPage,
|
|
164
166
|
onClick: () => {
|
|
165
167
|
setPage(maxPage);
|
|
166
|
-
setEditingPage(maxPage);
|
|
168
|
+
setEditingPage(String(maxPage));
|
|
167
169
|
},
|
|
168
170
|
children: /* @__PURE__ */ jsx(CaretDoubleRightIcon, { size: 16 })
|
|
169
171
|
})
|
|
@@ -205,13 +207,13 @@ function PaginationRoot(props) {
|
|
|
205
207
|
const { page = 1, perPage, totalCount, hasNextPage, setPage, children, className, labels: labelsProp } = props;
|
|
206
208
|
const text = "text" in props ? props.text : void 0;
|
|
207
209
|
const controls = "controls" in props ? props.controls ?? KUMO_PAGINATION_DEFAULT_VARIANTS.controls : KUMO_PAGINATION_DEFAULT_VARIANTS.controls;
|
|
208
|
-
const [editingPage, setEditingPage] = useState(
|
|
210
|
+
const [editingPage, setEditingPage] = useState(String(page));
|
|
209
211
|
const labels = useMemo(() => ({
|
|
210
212
|
...DEFAULT_LABELS,
|
|
211
213
|
...labelsProp
|
|
212
214
|
}), [labelsProp]);
|
|
213
215
|
useEffect(() => {
|
|
214
|
-
setEditingPage(page);
|
|
216
|
+
setEditingPage(String(page));
|
|
215
217
|
}, [page]);
|
|
216
218
|
const pageShowingRange = useMemo(() => {
|
|
217
219
|
let lower = page * (perPage ?? 1) - (perPage ?? 0) + 1;
|
|
@@ -230,7 +232,7 @@ function PaginationRoot(props) {
|
|
|
230
232
|
totalCount,
|
|
231
233
|
hasNextPage,
|
|
232
234
|
maxPage: useMemo(() => {
|
|
233
|
-
return Math.ceil((totalCount ?? 1) / (perPage ?? 1));
|
|
235
|
+
return Math.max(Math.ceil((totalCount ?? 1) / (perPage ?? 1)), 1);
|
|
234
236
|
}, [totalCount, perPage]),
|
|
235
237
|
pageShowingRange,
|
|
236
238
|
setPage,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as cn } from "./vendor-styling-gs32v7xt5znc8kg0.js";
|
|
3
3
|
import { n as usePortalContainer } from "./portal-provider-eveknxf26oudn7pp.js";
|
|
4
|
-
import { i as buttonVariants } from "./button-
|
|
5
|
-
import { r as Label } from "./label-
|
|
6
|
-
import { t as Field } from "./field-
|
|
7
|
-
import { n as KUMO_INPUT_VARIANTS } from "./input-
|
|
4
|
+
import { i as buttonVariants } from "./button-k7axs4vu1rwx89w3.js";
|
|
5
|
+
import { r as Label } from "./label-njfcj6h9utmg2n9l.js";
|
|
6
|
+
import { t as Field } from "./field-n7gmbg5xvh6oqbom.js";
|
|
7
|
+
import { n as KUMO_INPUT_VARIANTS } from "./input-f0pbcvjudf5zb8ek.js";
|
|
8
8
|
import { t as SkeletonLine } from "./skeleton-line-gjf1fecmyy82aejz.js";
|
|
9
9
|
import { _ as SelectLabel, a as SelectItemIndicator, c as SelectPopup, f as SelectPortal, h as SelectTrigger, i as SelectItemText, m as SelectValue, n as SelectGroupLabel, o as SelectItem, p as SelectIcon, r as SelectGroup, s as SelectList, t as SelectSeparator, u as SelectPositioner, v as SelectRoot } from "./SelectSeparator-nnak70azojox8b2b.js";
|
|
10
10
|
import { forwardRef, useId } from "react";
|
package/dist/chunks/{sensitive-input-lfrrtyg9n5ulq3tb.js → sensitive-input-heb3xapwahzhpq6y.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as cn } from "./vendor-styling-gs32v7xt5znc8kg0.js";
|
|
3
3
|
import { t as Input } from "./Input-ozudotydd679ly63.js";
|
|
4
|
-
import { t as Field } from "./field-
|
|
5
|
-
import { n as KUMO_INPUT_VARIANTS, r as inputVariants } from "./input-
|
|
4
|
+
import { t as Field } from "./field-n7gmbg5xvh6oqbom.js";
|
|
5
|
+
import { n as KUMO_INPUT_VARIANTS, r as inputVariants } from "./input-f0pbcvjudf5zb8ek.js";
|
|
6
6
|
import { t as useCopyFeedback } from "./use-copy-feedback-gl55ghst0csvpv4j.js";
|
|
7
7
|
import { forwardRef, useCallback, useId, useRef, useState } from "react";
|
|
8
8
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as cn } from "./vendor-styling-gs32v7xt5znc8kg0.js";
|
|
3
3
|
import { n as useLinkComponent } from "./link-provider-kbwllpbo24fvgioj.js";
|
|
4
|
-
import { n as TooltipProvider, t as Tooltip } from "./tooltip-
|
|
5
|
-
import { t as Button } from "./button-
|
|
4
|
+
import { n as TooltipProvider, t as Tooltip } from "./tooltip-bcymn9bfyz29fvji.js";
|
|
5
|
+
import { t as Button } from "./button-k7axs4vu1rwx89w3.js";
|
|
6
6
|
import { t as SkeletonLine } from "./skeleton-line-gjf1fecmyy82aejz.js";
|
|
7
7
|
import { i as ScrollAreaViewport, n as ScrollAreaContent, r as ScrollAreaScrollbar, s as ScrollAreaRoot, t as ScrollAreaThumb } from "./ScrollAreaThumb-hxig41yn4lrurd3o.js";
|
|
8
8
|
import React, { createContext, forwardRef, useCallback, useContext, useEffect, useId, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
@@ -506,7 +506,7 @@ const SidebarContent = forwardRef(({ className, children, ...props }, ref) => {
|
|
|
506
506
|
children: [/* @__PURE__ */ jsx(ScrollAreaViewport, {
|
|
507
507
|
tabIndex: -1,
|
|
508
508
|
"data-sidebar": "viewport",
|
|
509
|
-
className: cn("h-full px-[11px] py-3 group-not-data-[state=collapsed]/sidebar:px-3.5", "transition-[padding] duration-(--sidebar-animation-duration)", "overflow-x-hidden!", "[mask-image:linear-gradient(to_bottom,transparent_0,black_min(24px,var(--scroll-area-overflow-y-start,24px)),black_calc(100%-min(24px,var(--scroll-area-overflow-y-end,24px))),transparent_100%)]"),
|
|
509
|
+
className: cn("h-full px-[11px] py-3 group-not-data-[state=collapsed]/sidebar:px-3.5", "transition-[padding] duration-(--sidebar-animation-duration)", "overflow-x-hidden!", "no-scrollbar", "[mask-image:linear-gradient(to_bottom,transparent_0,black_min(24px,var(--scroll-area-overflow-y-start,24px)),black_calc(100%-min(24px,var(--scroll-area-overflow-y-end,24px))),transparent_100%)]"),
|
|
510
510
|
children: /* @__PURE__ */ jsx(ScrollAreaContent, {
|
|
511
511
|
className: "flex min-w-0! flex-col",
|
|
512
512
|
children
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as cn } from "./vendor-styling-gs32v7xt5znc8kg0.js";
|
|
3
3
|
import { n as FieldsetRoot, t as FieldsetLegend } from "./FieldsetLegend-gl9z9eezr0xg9zr7.js";
|
|
4
|
-
import { t as Field } from "./field-
|
|
4
|
+
import { t as Field } from "./field-n7gmbg5xvh6oqbom.js";
|
|
5
5
|
import { t as SwitchRoot } from "./SwitchRoot-m4t2tq5zn5wibyxk.js";
|
|
6
6
|
import { createContext, forwardRef, useContext } from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as cn } from "./vendor-styling-gs32v7xt5znc8kg0.js";
|
|
3
3
|
import { t as resolveVariant } from "./resolve-variant-l6x5ksfrjtu4m66l.js";
|
|
4
|
-
import { t as Checkbox } from "./checkbox-
|
|
4
|
+
import { t as Checkbox } from "./checkbox-g8b4f2hs5vux3u26.js";
|
|
5
5
|
import { forwardRef } from "react";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/table/table.tsx
|