@cloudflare/kumo 2.16.0 → 2.18.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 +47 -0
- package/ai/USAGE.md +6 -0
- package/ai/component-registry.json +37 -10
- package/ai/component-registry.md +81 -3
- package/ai/schemas.ts +3 -0
- package/dist/.build-complete +1 -1
- package/dist/ai/schemas.d.ts +4 -0
- package/dist/ai/schemas.js +2 -0
- package/dist/{button-Bbi7gFL7.d.ts → button-DBuj7_fo.d.ts} +2 -2
- package/dist/catalog.d.ts +4 -1
- package/dist/catalog.js +37 -14
- package/dist/chunks/{autocomplete-ht782okfv7nv75mq.js → autocomplete-ngrji5wk0xdpq2qc.js} +2 -2
- package/dist/chunks/{badge-kyz53p7p0ng393bs.js → badge-f27mwe9gasi4inb6.js} +3 -1
- package/dist/chunks/{banner-cpla8vqjxaulggyd.js → banner-m68xx7eqplxwi73f.js} +21 -10
- package/dist/chunks/{breadcrumbs-oyuqwb09l08uhok2.js → breadcrumbs-2ra74bio44h1fvuj.js} +2 -2
- package/dist/chunks/{button-oxy32x5w9x9az80g.js → button-cyea767mx5dwgavm.js} +12 -17
- package/dist/chunks/{chart-hp3vqwe49tbyywqm.js → chart-g4dnsqiamjh39chn.js} +1 -1
- package/dist/chunks/{checkbox-o9627970y7c9ciqy.js → checkbox-bcpt8k7ck95vgjc1.js} +5 -5
- package/dist/chunks/{clipboard-text-c0ad6lzyxauxduv1.js → clipboard-text-k9ae6rsreg9ol6y2.js} +17 -6
- package/dist/chunks/{combobox-kgf0gmniahm15n81.js → combobox-iuuzrkczst4nmoyh.js} +18 -6
- package/dist/chunks/{date-picker-oee5ehsrepnlmltj.js → date-picker-o6iov1n67oc4rbom.js} +78 -6
- package/dist/chunks/{date-range-picker-hpx3cdu9ve01jx6d.js → date-range-picker-oivlshld01jbel29.js} +1 -1
- package/dist/chunks/{dialog-lgrwmsumwpftp2u8.js → dialog-h3zgi4kmimpesv5j.js} +1 -1
- package/dist/chunks/{dropdown-o875yxeqod7qp871.js → dropdown-m5a8nwer5hpvnkfk.js} +3 -1
- package/dist/chunks/{empty-ft85jcbs7fd5t3tn.js → empty-ghcpxo6x75jg7mw9.js} +1 -1
- package/dist/chunks/{field-jzzlgre0jmrr38o2.js → field-crf1hw5exr2oxemk.js} +7 -2
- package/dist/chunks/{inline-copy-text-57r67slswfqvgbaf.js → inline-copy-text-c6wa49ys72pj7k53.js} +1 -1
- package/dist/chunks/{input-jk86hoj6nqfhl5u8.js → input-d1230n06m5b1p3rd.js} +2 -2
- package/dist/chunks/{input-group-hc2qp3m6gsfomqvr.js → input-group-gg4aurpe2s60van9.js} +9 -7
- package/dist/chunks/{input-jsnp6etq7rbjjj9e.js → input-m6nvwwnydvbdz8rf.js} +2 -2
- package/dist/chunks/{label-hugrtzreeqk5mtqu.js → label-cecukn2rbow4ghxg.js} +2 -2
- package/dist/chunks/{layer-dialog-dwrrgv1wasrerow4.js → layer-dialog-eeecim8yf0dzhs2m.js} +12 -4
- package/dist/chunks/{menubar-m5pqhx7lu5z7mkks.js → menubar-gzlyhmmc4i24prn1.js} +2 -2
- package/dist/chunks/{pagination-nyknrk1lyexwgyrx.js → pagination-fkjx0m380ku9zqv9.js} +2 -2
- package/dist/chunks/{radio-d3pkrvsldfbdefav.js → radio-co7gt6ihfp5w4jr0.js} +4 -4
- package/dist/chunks/{select-owq85889zm4y23ws.js → select-ha59x0uq5ocr1x36.js} +6 -6
- package/dist/chunks/{sensitive-input-nzwvjuwlpb51ze04.js → sensitive-input-hg58r9x2d9njtysl.js} +3 -3
- package/dist/chunks/{sidebar-gluq5b5oacrdk4m4.js → sidebar-dgyce0z35tpnxj8t.js} +13 -11
- package/dist/chunks/skeleton-line-kmhnp0lx3rxhioxa.js +74 -0
- package/dist/chunks/{slider-juwif2d8xa5n0429.js → slider-e395gihi5cjd62ss.js} +1 -1
- package/dist/chunks/{switch-mqf1ulvle4nd6d2t.js → switch-hqj8v7ll9g14p5my.js} +4 -4
- package/dist/chunks/{table-nysse5tiwf47gg4k.js → table-b491wlpxd8jbr9b5.js} +1 -1
- package/dist/chunks/{tabs-mmkz7q5rofnmogwt.js → tabs-oi64kuuf2poro26u.js} +2 -2
- package/dist/chunks/{tag-input-fjfzlsaxmnqee7dk.js → tag-input-0ombmb7yrn4xk3in.js} +4 -4
- package/dist/chunks/{toast-b4t9rt9y1sumcmy2.js → toast-cmj0e7xvoh9gxxao.js} +60 -52
- package/dist/chunks/{toolbar-l9laewk5jvf4u0si.js → toolbar-bx2w3vk2if6mp36l.js} +3 -3
- package/dist/chunks/{tooltip-lguwh8bjhxwnjfus.js → tooltip-bcymn9bfyz29fvji.js} +2 -0
- package/dist/chunks/unwrap-lazy-element-hzbdkmujhd7iksau.js +45 -0
- package/dist/code.js +1 -1
- package/dist/components/autocomplete.js +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/banner.d.ts +1 -1
- package/dist/components/banner.js +1 -1
- package/dist/components/breadcrumbs.js +1 -1
- package/dist/components/button.d.ts +2 -2
- package/dist/components/button.js +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.d.ts +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/date-range-picker.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/dropdown.js +1 -1
- package/dist/components/empty.js +1 -1
- package/dist/components/field.js +1 -1
- package/dist/components/inline-copy-text.d.ts +1 -1
- package/dist/components/inline-copy-text.js +1 -1
- package/dist/components/input-group.d.ts +1 -1
- package/dist/components/input-group.js +1 -1
- package/dist/components/input.d.ts +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/loader.d.ts +1 -1
- package/dist/components/loader.js +1 -1
- package/dist/components/menubar.js +1 -1
- package/dist/components/pagination.js +1 -1
- package/dist/components/radio.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/slider.js +1 -1
- package/dist/components/switch.js +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/tabs.js +1 -1
- package/dist/components/tag-input.js +1 -1
- package/dist/components/toast.d.ts +1 -1
- package/dist/components/toast.js +1 -1
- package/dist/components/toolbar.d.ts +1 -1
- package/dist/components/toolbar.js +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/{index-BMe3cpLB.d.ts → index--HBggSGH.d.ts} +2 -2
- package/dist/{index-CSWbPhke.d.ts → index-BAFvYacU.d.ts} +15 -5
- package/dist/{index--RbAKeBL.d.ts → index-BfoZI9Hf.d.ts} +2 -2
- package/dist/{index-DJIRVD5B.d.ts → index-CReGk3Dc.d.ts} +6 -0
- package/dist/{index-jNWPjJl9.d.ts → index-D4_C1J_8.d.ts} +1 -1
- package/dist/{index-5bJAnzUo.d.ts → index-Dmbgjww7.d.ts} +1 -0
- package/dist/{index-BAQwS4mL.d.ts → index-Dx7hOWUc.d.ts} +24 -1
- package/dist/{index-CrQi3QCY.d.ts → index-DxOyYZaJ.d.ts} +4 -3
- package/dist/index-WCjW8Iot.d.ts +1 -0
- package/dist/{index-DNsSKNUe.d.ts → index-bBPKMepR.d.ts} +4 -0
- package/dist/index.d.ts +12 -12
- package/dist/index.js +36 -36
- package/dist/{input-group-B3M_WRqm.d.ts → input-group-oXVkmPrY.d.ts} +1 -1
- 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/component-registry/schema-generator.ts +2 -0
- package/scripts/format-generated.ts +12 -0
- package/scripts/generate-primitives.ts +16 -12
- package/scripts/theme-generator/index.ts +2 -2
- package/dist/chunks/skeleton-line-gjf1fecmyy82aejz.js +0 -43
- package/dist/index-B-hCpI5K.d.ts +0 -1
- package/dist/index-DhOvcB0m.d.ts +0 -60
|
@@ -1,6 +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 unwrapLazyElement } from "./unwrap-lazy-element-hzbdkmujhd7iksau.js";
|
|
4
5
|
import React from "react";
|
|
5
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
//#region src/components/badge/badge.tsx
|
|
@@ -123,7 +124,8 @@ function badgeVariants({ variant = KUMO_BADGE_DEFAULT_VARIANTS.variant, appearan
|
|
|
123
124
|
const appearanceClasses = resolveVariant(KUMO_BADGE_VARIANTS.appearance, appearance, KUMO_BADGE_DEFAULT_VARIANTS.appearance).classes;
|
|
124
125
|
return cn(KUMO_BADGE_BASE_STYLES, appearance === "dot" ? "" : variantClasses, appearanceClasses);
|
|
125
126
|
}
|
|
126
|
-
const renderIconNode = (
|
|
127
|
+
const renderIconNode = (iconProp) => {
|
|
128
|
+
const IconComponent = unwrapLazyElement(iconProp);
|
|
127
129
|
if (!IconComponent) return null;
|
|
128
130
|
const Component = IconComponent;
|
|
129
131
|
const icon = React.isValidElement(IconComponent) ? IconComponent : /* @__PURE__ */ jsx(Component, {});
|
|
@@ -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 { r as Link } from "./link-h84bkh8eem39p529.js";
|
|
5
|
-
import { t as Button } from "./button-
|
|
5
|
+
import { n as LinkButton, t as Button } from "./button-cyea767mx5dwgavm.js";
|
|
6
6
|
import { createContext, forwardRef, isValidElement, useContext } from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/banner/banner-action.tsx
|
|
@@ -53,28 +53,39 @@ function bannerActionAccentVars(accent) {
|
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
|
-
* A banner CTA built on Kumo's `Button
|
|
57
|
-
*
|
|
56
|
+
* A banner CTA built on Kumo's `Button`, or `LinkButton` when `href` is set. It
|
|
57
|
+
* inherits their sizing, interaction, and accessibility behavior while supplying
|
|
58
|
+
* banner-specific accent styles.
|
|
58
59
|
*
|
|
59
60
|
* @example
|
|
60
61
|
* ```tsx
|
|
61
62
|
* <Banner.Action onClick={retry}>Retry</Banner.Action>
|
|
63
|
+
* <Banner.Action href="/billing">Manage payments</Banner.Action>
|
|
62
64
|
* <Banner.Action variant="ghost" icon={<X />} aria-label="Dismiss" />
|
|
63
65
|
* ```
|
|
64
66
|
*/
|
|
65
|
-
const BannerAction = forwardRef(function BannerAction(
|
|
67
|
+
const BannerAction = forwardRef(function BannerAction(props, ref) {
|
|
66
68
|
const banner = useContext(BannerActionContext);
|
|
69
|
+
const variant = props.variant ?? "primary";
|
|
67
70
|
const styles = BANNER_ACTION_ACCENTS[banner.variant];
|
|
68
|
-
|
|
69
|
-
ref,
|
|
71
|
+
const shared = {
|
|
70
72
|
variant: variant === "secondary" ? "outline" : variant,
|
|
71
73
|
size: banner.size,
|
|
72
|
-
className: cn(variant !== "primary" && styles[variant], className),
|
|
74
|
+
className: cn(variant !== "primary" && styles[variant], props.className),
|
|
73
75
|
style: variant === "primary" ? {
|
|
74
76
|
...bannerActionAccentVars(styles.accent),
|
|
75
|
-
...style
|
|
76
|
-
} : style
|
|
77
|
-
|
|
77
|
+
...props.style
|
|
78
|
+
} : props.style
|
|
79
|
+
};
|
|
80
|
+
if (props.href !== void 0) return /* @__PURE__ */ jsx(LinkButton, {
|
|
81
|
+
ref,
|
|
82
|
+
...props,
|
|
83
|
+
...shared
|
|
84
|
+
});
|
|
85
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
86
|
+
ref,
|
|
87
|
+
...props,
|
|
88
|
+
...shared
|
|
78
89
|
});
|
|
79
90
|
});
|
|
80
91
|
BannerAction.displayName = "Banner.Action";
|
|
@@ -2,9 +2,9 @@
|
|
|
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 { n as useLinkComponent } from "./link-provider-kbwllpbo24fvgioj.js";
|
|
5
|
-
import { t as Button } from "./button-
|
|
5
|
+
import { t as Button } from "./button-cyea767mx5dwgavm.js";
|
|
6
6
|
import { t as useCopyFeedback } from "./use-copy-feedback-gl55ghst0csvpv4j.js";
|
|
7
|
-
import { t as SkeletonLine } from "./skeleton-line-
|
|
7
|
+
import { t as SkeletonLine } from "./skeleton-line-kmhnp0lx3rxhioxa.js";
|
|
8
8
|
import { Children, cloneElement, isValidElement } from "react";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { CheckIcon, CopyIcon } from "@phosphor-icons/react";
|
|
@@ -1,9 +1,10 @@
|
|
|
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 unwrapLazyElement } from "./unwrap-lazy-element-hzbdkmujhd7iksau.js";
|
|
4
5
|
import { n as useLinkComponent } from "./link-provider-kbwllpbo24fvgioj.js";
|
|
5
6
|
import { t as Loader } from "./loader-kv5nk8j8tsuesxqo.js";
|
|
6
|
-
import { t as Tooltip } from "./tooltip-
|
|
7
|
+
import { t as Tooltip } from "./tooltip-bcymn9bfyz29fvji.js";
|
|
7
8
|
import React from "react";
|
|
8
9
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
10
|
import { ArrowsClockwise } from "@phosphor-icons/react";
|
|
@@ -34,11 +35,11 @@ const KUMO_BUTTON_VARIANTS = {
|
|
|
34
35
|
description: "Small button for secondary actions"
|
|
35
36
|
},
|
|
36
37
|
base: {
|
|
37
|
-
classes: "h-9 gap-1.5 rounded-lg px-3 text-base",
|
|
38
|
+
classes: "h-9 gap-1.5 rounded-lg px-3 text-base leading-5",
|
|
38
39
|
description: "Default button size"
|
|
39
40
|
},
|
|
40
41
|
lg: {
|
|
41
|
-
classes: "h-10 gap-2 rounded-lg px-4 text-base",
|
|
42
|
+
classes: "h-10 gap-2 rounded-lg px-4 text-base leading-5",
|
|
42
43
|
description: "Large button for primary CTAs"
|
|
43
44
|
}
|
|
44
45
|
},
|
|
@@ -82,27 +83,21 @@ const KUMO_BUTTON_DEFAULT_VARIANTS = {
|
|
|
82
83
|
};
|
|
83
84
|
function buttonVariants({ variant = KUMO_BUTTON_DEFAULT_VARIANTS.variant, size = KUMO_BUTTON_DEFAULT_VARIANTS.size, shape = KUMO_BUTTON_DEFAULT_VARIANTS.shape } = {}) {
|
|
84
85
|
const isCompactShape = shape === "square" || shape === "circle";
|
|
85
|
-
return cn("group flex w-max shrink-0 items-center font-medium select-none", "border-0 shadow-xs", "focus:ring-kumo-focus/50 focus:outline-
|
|
86
|
+
return cn("group flex w-max shrink-0 items-center font-medium select-none", "border-0 shadow-xs", "focus:ring-kumo-focus/50 focus:outline-hidden focus-visible:ring-2 focus-visible:ring-kumo-brand", "cursor-pointer", "disabled:cursor-not-allowed disabled:text-kumo-subtle", resolveVariant(KUMO_BUTTON_VARIANTS.size, size, KUMO_BUTTON_DEFAULT_VARIANTS.size).classes, resolveVariant(KUMO_BUTTON_VARIANTS.shape, shape, KUMO_BUTTON_DEFAULT_VARIANTS.shape).classes, isCompactShape && resolveVariant(KUMO_BUTTON_VARIANTS.compactSize, size, KUMO_BUTTON_DEFAULT_VARIANTS.size).classes, resolveVariant(KUMO_BUTTON_VARIANTS.variant, variant, KUMO_BUTTON_DEFAULT_VARIANTS.variant).classes);
|
|
86
87
|
}
|
|
87
|
-
const TEXT_LIFT_CLASSES = {
|
|
88
|
-
xs: "pb-px [--kumo-button-text-lift:0.5px]",
|
|
89
|
-
sm: "pb-px [--kumo-button-text-lift:0.5px]",
|
|
90
|
-
base: "pb-0.5 [--kumo-button-text-lift:1px]",
|
|
91
|
-
lg: "pb-0.5 [--kumo-button-text-lift:1px]"
|
|
92
|
-
};
|
|
93
88
|
const ICON_LEADING_PADDING = {
|
|
94
89
|
xs: "pl-1",
|
|
95
90
|
sm: "pl-1.5",
|
|
96
91
|
base: "pl-2.5",
|
|
97
92
|
lg: "pl-3.5"
|
|
98
93
|
};
|
|
99
|
-
const
|
|
100
|
-
const getTextClasses = (shape, size, iconNode, children) => {
|
|
94
|
+
const getIconPaddingClasses = (shape, size, iconNode, children) => {
|
|
101
95
|
const hasText = React.Children.toArray(children).some((child) => child !== "");
|
|
102
|
-
if (shape !== "base" || !hasText) return void 0;
|
|
103
|
-
return
|
|
96
|
+
if (shape !== "base" || !hasText || iconNode == null) return void 0;
|
|
97
|
+
return ICON_LEADING_PADDING[size];
|
|
104
98
|
};
|
|
105
|
-
const renderIconNode = (
|
|
99
|
+
const renderIconNode = (iconProp) => {
|
|
100
|
+
const IconComponent = unwrapLazyElement(iconProp);
|
|
106
101
|
if (!IconComponent) return null;
|
|
107
102
|
if (React.isValidElement(IconComponent)) return IconComponent;
|
|
108
103
|
return /* @__PURE__ */ jsx(IconComponent, {});
|
|
@@ -180,7 +175,7 @@ const Button = React.forwardRef(({ children, className, disabled, loading, shape
|
|
|
180
175
|
variant,
|
|
181
176
|
size,
|
|
182
177
|
shape
|
|
183
|
-
}),
|
|
178
|
+
}), getIconPaddingClasses(shape, size, iconNode, children), disabled && "cursor-not-allowed opacity-50", className),
|
|
184
179
|
disabled: loading || disabled,
|
|
185
180
|
style: emphasisStyle ? {
|
|
186
181
|
...emphasisStyle,
|
|
@@ -257,7 +252,7 @@ const LinkButton = React.forwardRef(({ children, className, disabled = false, ex
|
|
|
257
252
|
variant,
|
|
258
253
|
size,
|
|
259
254
|
shape
|
|
260
|
-
}),
|
|
255
|
+
}), getIconPaddingClasses(shape, size, iconNode, children), "flex items-center no-underline! select-text", className),
|
|
261
256
|
href,
|
|
262
257
|
style: emphasisStyle ? {
|
|
263
258
|
...emphasisStyle,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { t as cn } from "./vendor-styling-gs32v7xt5znc8kg0.js";
|
|
3
3
|
import { a as TooltipTrigger, i as TooltipPortal, n as TooltipPositioner, s as TooltipRoot, t as TooltipPopup } from "./TooltipPopup-furysmeyb68uycbz.js";
|
|
4
4
|
import { t as Text } from "./text-me99rjbjkaff98gp.js";
|
|
5
|
-
import { t as SkeletonLine } from "./skeleton-line-
|
|
5
|
+
import { t as SkeletonLine } from "./skeleton-line-kmhnp0lx3rxhioxa.js";
|
|
6
6
|
import { forwardRef, memo, useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
7
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/chart/Color.ts
|
|
@@ -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-cecukn2rbow4ghxg.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";
|
|
@@ -56,7 +56,7 @@ const CheckboxBase = forwardRef(({ className, checked, indeterminate, disabled,
|
|
|
56
56
|
indeterminate,
|
|
57
57
|
disabled,
|
|
58
58
|
onCheckedChange,
|
|
59
|
-
className: cn("relative flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border-0 bg-kumo-base ring after:absolute after:-inset-x-3 after:-inset-y-2 focus:outline-
|
|
59
|
+
className: cn("relative flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border-0 bg-kumo-base ring after:absolute after:-inset-x-3 after:-inset-y-2 focus:outline-hidden", label && "mt-0.5", variant === "error" ? "ring-kumo-danger" : "ring-kumo-hairline", !disabled && "hover:ring-kumo-hairline focus:ring-2 focus:ring-kumo-focus focus-visible:ring-2 focus-visible:ring-kumo-brand", "data-[checked]:bg-kumo-contrast data-[checked]:ring-kumo-contrast data-[indeterminate]:bg-kumo-contrast data-[indeterminate]:ring-kumo-contrast", disabled && "cursor-not-allowed opacity-50", className),
|
|
60
60
|
...props,
|
|
61
61
|
children: /* @__PURE__ */ jsx(CheckboxIndicator, {
|
|
62
62
|
keepMounted: true,
|
|
@@ -117,7 +117,7 @@ const CheckboxItem = forwardRef(({ className, checked, indeterminate, disabled,
|
|
|
117
117
|
className: "text-base font-medium text-kumo-default",
|
|
118
118
|
children: label
|
|
119
119
|
}), description && /* @__PURE__ */ jsx("span", {
|
|
120
|
-
className: "text-sm text-kumo-subtle",
|
|
120
|
+
className: "text-sm leading-snug text-pretty text-kumo-subtle",
|
|
121
121
|
children: description
|
|
122
122
|
})]
|
|
123
123
|
}), /* @__PURE__ */ jsx(CheckboxRoot, {
|
|
@@ -130,7 +130,7 @@ const CheckboxItem = forwardRef(({ className, checked, indeterminate, disabled,
|
|
|
130
130
|
indeterminate,
|
|
131
131
|
disabled,
|
|
132
132
|
onCheckedChange,
|
|
133
|
-
className: cn("relative mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border-0 bg-kumo-base ring focus:ring-kumo-focus focus:outline-
|
|
133
|
+
className: cn("relative mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border-0 bg-kumo-base ring focus:ring-kumo-focus focus:outline-hidden focus-visible:ring-2 focus-visible:ring-kumo-brand", variant === "error" ? "ring-kumo-danger" : "ring-kumo-line", !disabled && variant !== "error" && "group-hover:ring-kumo-hairline", "data-[checked]:bg-kumo-contrast data-[checked]:ring-kumo-contrast data-[indeterminate]:bg-kumo-contrast data-[indeterminate]:ring-kumo-contrast"),
|
|
134
134
|
children: indicator
|
|
135
135
|
})]
|
|
136
136
|
});
|
|
@@ -193,7 +193,7 @@ function CheckboxGroup({ legend, children, error, description, defaultValue, val
|
|
|
193
193
|
children: error
|
|
194
194
|
}),
|
|
195
195
|
description && /* @__PURE__ */ jsx("p", {
|
|
196
|
-
className: "text-sm text-kumo-subtle",
|
|
196
|
+
className: "text-sm leading-snug text-pretty text-kumo-subtle",
|
|
197
197
|
children: description
|
|
198
198
|
})
|
|
199
199
|
]
|
package/dist/chunks/{clipboard-text-c0ad6lzyxauxduv1.js → clipboard-text-k9ae6rsreg9ol6y2.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-cyea767mx5dwgavm.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-d1230n06m5b1p3rd.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-crf1hw5exr2oxemk.js";
|
|
5
|
+
import { n as KUMO_INPUT_VARIANTS, r as inputVariants } from "./input-d1230n06m5b1p3rd.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";
|
|
@@ -86,18 +86,29 @@ const triggerValueIconStyles = {
|
|
|
86
86
|
iconRight: "right-3"
|
|
87
87
|
}
|
|
88
88
|
};
|
|
89
|
-
|
|
89
|
+
/**
|
|
90
|
+
* Drops keys whose value is `undefined`. Base UI's `mergeProps` lets an
|
|
91
|
+
* explicit `undefined` override internal props, so e.g.
|
|
92
|
+
* `aria-labelledby={undefined}` would erase the Field label's id.
|
|
93
|
+
*/
|
|
94
|
+
function omitUndefined(props) {
|
|
95
|
+
return Object.fromEntries(Object.entries(props).filter(([, value]) => value !== void 0));
|
|
96
|
+
}
|
|
97
|
+
function TriggerValue({ className, children, placeholder, ...triggerProps }) {
|
|
90
98
|
const { size, hasError } = useContext(ComboboxContext);
|
|
91
99
|
const iconStyles = triggerValueIconStyles[size];
|
|
92
100
|
return /* @__PURE__ */ jsxs(ComboboxTrigger, {
|
|
93
101
|
"data-kumo-component": "Combobox",
|
|
94
102
|
"data-kumo-part": "trigger",
|
|
95
|
-
|
|
103
|
+
...omitUndefined(triggerProps),
|
|
96
104
|
className: cn(inputVariants({
|
|
97
105
|
size,
|
|
98
106
|
variant: hasError ? "error" : "default"
|
|
99
107
|
}), "relative flex items-center", "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50", "data-[placeholder]:text-kumo-placeholder", iconStyles.padding, className),
|
|
100
|
-
children: [/* @__PURE__ */ jsx(ComboboxValue, {
|
|
108
|
+
children: [/* @__PURE__ */ jsx(ComboboxValue, {
|
|
109
|
+
placeholder,
|
|
110
|
+
children
|
|
111
|
+
}), /* @__PURE__ */ jsx(ComboboxIcon, {
|
|
101
112
|
className: cn("absolute top-1/2 flex -translate-y-1/2 items-center text-kumo-subtle", iconStyles.iconRight),
|
|
102
113
|
children: /* @__PURE__ */ jsx(CaretUpDownIcon, {
|
|
103
114
|
size: iconStyles.iconSize,
|
|
@@ -233,10 +244,11 @@ const sizeToMinHeight = {
|
|
|
233
244
|
base: "min-h-9",
|
|
234
245
|
lg: "min-h-10"
|
|
235
246
|
};
|
|
236
|
-
function TriggerMultipleWithInput({ placeholder, renderItem, className, inputSide = "right", value: controlledValue }) {
|
|
247
|
+
function TriggerMultipleWithInput({ placeholder, renderItem, className, inputSide = "right", value: controlledValue, ...inputProps }) {
|
|
237
248
|
const { size, hasError } = useContext(ComboboxContext);
|
|
238
249
|
const chipsToRender = controlledValue;
|
|
239
250
|
const renderTriggerInput = (className) => /* @__PURE__ */ jsx(ComboboxInput, {
|
|
251
|
+
...omitUndefined(inputProps),
|
|
240
252
|
placeholder,
|
|
241
253
|
className
|
|
242
254
|
});
|
|
@@ -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-cyea767mx5dwgavm.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("m-0 border-0 bg-transparent p-0", "flex size-(--cell-size) items-center justify-center rounded-md text-base text-kumo-default tabular-nums transition-colors outline-none focus-visible:outline-hidden", "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 [&_thead]:bg-transparent"),
|
|
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
|
}
|
package/dist/chunks/{date-range-picker-hpx3cdu9ve01jx6d.js → date-range-picker-oivlshld01jbel29.js}
RENAMED
|
@@ -299,7 +299,7 @@ function DateRangeMonthHeader({ month, year, size = KUMO_DATE_RANGE_PICKER_DEFAU
|
|
|
299
299
|
children: /* @__PURE__ */ jsx("input", {
|
|
300
300
|
"aria-label": "Edit month and year",
|
|
301
301
|
defaultValue: `${month} ${year}`,
|
|
302
|
-
className: cn("w-full rounded-md border-none bg-transparent py-1.5 text-center font-semibold text-kumo-default transition-all duration-200 focus:ring-[1.5px] focus:ring-kumo-focus/50 focus:outline-
|
|
302
|
+
className: cn("w-full rounded-md border-none bg-transparent py-1.5 text-center font-semibold text-kumo-default transition-all duration-200 focus:ring-[1.5px] focus:ring-kumo-focus/50 focus:outline-hidden", sizeConfig.textSize),
|
|
303
303
|
onBlur: (e) => {
|
|
304
304
|
if (e.currentTarget.value.length === 0) return;
|
|
305
305
|
updateCurrentMonth?.(e.currentTarget.value);
|
|
@@ -51,7 +51,7 @@ function useDialogRole() {
|
|
|
51
51
|
return useContext(DialogRoleContext);
|
|
52
52
|
}
|
|
53
53
|
function dialogVariants({ size = KUMO_DIALOG_DEFAULT_VARIANTS.size } = {}) {
|
|
54
|
-
return cn("shadow-m ring ring-kumo-line fixed top-8 left-1/2 sm:top-16 w-full max-w-[calc(100vw-2rem)] -translate-x-1/2 overflow-hidden rounded-xl bg-kumo-base text-kumo-default duration-150 data-ending-style:scale-90 data-ending-style:opacity-0 data-starting-style:scale-90 data-starting-style:opacity-0", resolveVariant(KUMO_DIALOG_VARIANTS.size, size, KUMO_DIALOG_DEFAULT_VARIANTS.size).classes);
|
|
54
|
+
return cn("shadow-m ring ring-kumo-line fixed top-8 left-1/2 sm:top-16 w-full max-w-[calc(100vw-2rem)] max-h-[calc(100dvh-4rem)] sm:max-h-[calc(100dvh-6rem)] -translate-x-1/2 overflow-x-hidden overflow-y-auto overscroll-contain *:shrink-0 rounded-xl bg-kumo-base text-kumo-default duration-150 data-ending-style:scale-90 data-ending-style:opacity-0 data-starting-style:scale-90 data-starting-style:opacity-0", resolveVariant(KUMO_DIALOG_VARIANTS.size, size, KUMO_DIALOG_DEFAULT_VARIANTS.size).classes);
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
57
|
* Modal dialog overlay with backdrop. Compound component with `Dialog.Root`,
|
|
@@ -1,6 +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 unwrapLazyElement } from "./unwrap-lazy-element-hzbdkmujhd7iksau.js";
|
|
4
5
|
import { n as useLinkComponent } from "./link-provider-kbwllpbo24fvgioj.js";
|
|
5
6
|
import { n as usePortalContainer } from "./portal-provider-eveknxf26oudn7pp.js";
|
|
6
7
|
import { t as Separator } from "./Separator-fhwve0tfny3tht3a.js";
|
|
@@ -31,7 +32,8 @@ function dropdownVariants({ variant = KUMO_DROPDOWN_DEFAULT_VARIANTS.variant } =
|
|
|
31
32
|
* identically. The slot also lets icon-less rows detect that a sibling has an
|
|
32
33
|
* icon and inset themselves to keep the text aligned.
|
|
33
34
|
*/
|
|
34
|
-
const renderIconNode = (
|
|
35
|
+
const renderIconNode = (iconProp) => {
|
|
36
|
+
const IconComponent = unwrapLazyElement(iconProp);
|
|
35
37
|
if (!IconComponent) return null;
|
|
36
38
|
let icon;
|
|
37
39
|
if (React$1.isValidElement(IconComponent)) icon = React$1.cloneElement(IconComponent, { className: cn("h-4 w-4", IconComponent.props.className) });
|
|
@@ -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-cyea767mx5dwgavm.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-cecukn2rbow4ghxg.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,
|
package/dist/chunks/{inline-copy-text-57r67slswfqvgbaf.js → inline-copy-text-c6wa49ys72pj7k53.js}
RENAMED
|
@@ -18,7 +18,7 @@ function resolveCopyValue(children, value) {
|
|
|
18
18
|
const KUMO_INLINE_COPY_TEXT_VARIANTS = {};
|
|
19
19
|
const KUMO_INLINE_COPY_TEXT_DEFAULT_VARIANTS = {};
|
|
20
20
|
/** Base classes shared by every InlineCopyText. */
|
|
21
|
-
const KUMO_INLINE_COPY_TEXT_STYLING = { baseClasses: "group/inline-copy flex min-w-0 max-w-full cursor-pointer items-center gap-1 rounded-xs border-0 bg-transparent p-0 focus-visible:outline-
|
|
21
|
+
const KUMO_INLINE_COPY_TEXT_STYLING = { baseClasses: "group/inline-copy flex min-w-0 max-w-full cursor-pointer items-center gap-1 rounded-xs border-0 bg-transparent p-0 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-kumo-brand" };
|
|
22
22
|
/**
|
|
23
23
|
* Compact, borderless copy control for IDs and other short values displayed
|
|
24
24
|
* inline or inside dense table cells.
|
|
@@ -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-crf1hw5exr2oxemk.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-
|
|
45
|
+
return cn("border-0 bg-kumo-control text-kumo-default ring ring-kumo-line outline-none focus:outline-hidden", "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 && "has-focus-visible:outline-hidden", 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;
|