@cloudflare/kumo 2.2.2 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/ai/component-registry.json +28 -5
- package/ai/component-registry.md +64 -7
- package/ai/schemas.ts +1 -0
- package/dist/.build-complete +1 -1
- package/dist/ai/schemas.d.ts +12 -4
- package/dist/ai/schemas.d.ts.map +1 -1
- package/dist/ai/schemas.js +2 -0
- package/dist/ai/schemas.js.map +1 -1
- package/dist/chunks/SankeyChart-krkvltewpn3bbupw.js +651 -0
- package/dist/chunks/{SankeyChart-dkq90770ad7hgzx3.js.map → SankeyChart-krkvltewpn3bbupw.js.map} +1 -1
- package/dist/chunks/{autocomplete-mhrvtq4y5n21vr0t.js → autocomplete-h39m8kzoq0csjh9l.js} +82 -68
- package/dist/chunks/autocomplete-h39m8kzoq0csjh9l.js.map +1 -0
- package/dist/chunks/{badge-kqox9toi0sygfbno.js → badge-e9w8qrjmeu9nocf6.js} +80 -19
- package/dist/chunks/badge-e9w8qrjmeu9nocf6.js.map +1 -0
- package/dist/chunks/{breadcrumbs-ohstavaqvycoremm.js → breadcrumbs-g4pyoikibpoxsgw4.js} +2 -2
- package/dist/chunks/{breadcrumbs-ohstavaqvycoremm.js.map → breadcrumbs-g4pyoikibpoxsgw4.js.map} +1 -1
- package/dist/chunks/{button-oevxukl0zmwoq4tb.js → button-fxdpoacmq5rv1adk.js} +2 -2
- package/dist/chunks/{button-oevxukl0zmwoq4tb.js.map → button-fxdpoacmq5rv1adk.js.map} +1 -1
- package/dist/chunks/{checkbox-h6vkv17lnq854z2c.js → checkbox-dtoq56ieijj9m6vr.js} +3 -3
- package/dist/chunks/{checkbox-h6vkv17lnq854z2c.js.map → checkbox-dtoq56ieijj9m6vr.js.map} +1 -1
- package/dist/chunks/{clipboard-text-kyy71jmx7umdh8k8.js → clipboard-text-nvdsloomefwgcxat.js} +4 -4
- package/dist/chunks/{clipboard-text-kyy71jmx7umdh8k8.js.map → clipboard-text-nvdsloomefwgcxat.js.map} +1 -1
- package/dist/chunks/{collapsible-ej6p2bq758sw30nk.js → collapsible-cnsxmp7dko87pgx0.js} +2 -2
- package/dist/chunks/{collapsible-ej6p2bq758sw30nk.js.map → collapsible-cnsxmp7dko87pgx0.js.map} +1 -1
- package/dist/chunks/{combobox-g3cudlfajecou4va.js → combobox-jcqn64ixr4557a0s.js} +126 -126
- package/dist/chunks/combobox-jcqn64ixr4557a0s.js.map +1 -0
- package/dist/chunks/{command-palette-eep807rf6iapoz8r.js → command-palette-jrq7p16tff6n46nj.js} +11 -11
- package/dist/chunks/{command-palette-eep807rf6iapoz8r.js.map → command-palette-jrq7p16tff6n46nj.js.map} +1 -1
- package/dist/chunks/dialog-gndju3sqg1lmpb3f.js +118 -0
- package/dist/chunks/{dialog-fo3qhv9fgiadq5gp.js.map → dialog-gndju3sqg1lmpb3f.js.map} +1 -1
- package/dist/chunks/{dropdown-cobpydatw4vlb3ov.js → dropdown-k6orz4j043xybf54.js} +2 -2
- package/dist/chunks/{dropdown-cobpydatw4vlb3ov.js.map → dropdown-k6orz4j043xybf54.js.map} +1 -1
- package/dist/chunks/{empty-n3r7xutkb9sxjaso.js → empty-ni12ufom1kkakbuc.js} +2 -2
- package/dist/chunks/{empty-n3r7xutkb9sxjaso.js.map → empty-ni12ufom1kkakbuc.js.map} +1 -1
- package/dist/chunks/{field-l1oapopp6kjnephi.js → field-n16udu32tpyq5udz.js} +3 -3
- package/dist/chunks/{field-l1oapopp6kjnephi.js.map → field-n16udu32tpyq5udz.js.map} +1 -1
- package/dist/chunks/{input-area-gudamx1ruz8rxiw2.js → input-area-hhhpgg0ev8bowtrk.js} +4 -4
- package/dist/chunks/{input-area-gudamx1ruz8rxiw2.js.map → input-area-hhhpgg0ev8bowtrk.js.map} +1 -1
- package/dist/chunks/{input-group-gy08vju7eoogil8k.js → input-group-kkw5j7rwzhj66h10.js} +70 -70
- package/dist/chunks/input-group-kkw5j7rwzhj66h10.js.map +1 -0
- package/dist/chunks/{input-i3os21puacqw4r75.js → input-mv7giprcc6hfkpq3.js} +3 -3
- package/dist/chunks/{input-i3os21puacqw4r75.js.map → input-mv7giprcc6hfkpq3.js.map} +1 -1
- package/dist/chunks/{label-i0bj94d43irz0k1x.js → label-f6yvqca8qhbpvkq8.js} +3 -3
- package/dist/chunks/{label-i0bj94d43irz0k1x.js.map → label-f6yvqca8qhbpvkq8.js.map} +1 -1
- package/dist/chunks/{layer-card-hyz8lfxceudt05pv.js → layer-card-gegkqhkjy65l1ueo.js} +2 -2
- package/dist/chunks/{layer-card-hyz8lfxceudt05pv.js.map → layer-card-gegkqhkjy65l1ueo.js.map} +1 -1
- package/dist/chunks/{link-lkzjiitte3l29q87.js → link-jjk7qolyol7s1jkk.js} +2 -2
- package/dist/chunks/{link-lkzjiitte3l29q87.js.map → link-jjk7qolyol7s1jkk.js.map} +1 -1
- package/dist/chunks/{menubar-jalggrag4utvdpey.js → menubar-d5s6h96nw8ggy04a.js} +2 -2
- package/dist/chunks/{menubar-jalggrag4utvdpey.js.map → menubar-d5s6h96nw8ggy04a.js.map} +1 -1
- package/dist/chunks/{meter-jbxkh6gfggx1kjna.js → meter-kxn34sy6l2mz5dwq.js} +2 -2
- package/dist/chunks/{meter-jbxkh6gfggx1kjna.js.map → meter-kxn34sy6l2mz5dwq.js.map} +1 -1
- package/dist/chunks/{pagination-ceetno8sc1rd0wr2.js → pagination-ixbq8ssuuo0jxaa4.js} +3 -3
- package/dist/chunks/{pagination-ceetno8sc1rd0wr2.js.map → pagination-ixbq8ssuuo0jxaa4.js.map} +1 -1
- package/dist/chunks/{popover-i4opvl9g0as52fyx.js → popover-js5ds3szd43kspja.js} +2 -2
- package/dist/chunks/{popover-i4opvl9g0as52fyx.js.map → popover-js5ds3szd43kspja.js.map} +1 -1
- package/dist/chunks/{radio-g56o5rftpu1qpxuv.js → radio-nyw89v4eafptepmz.js} +2 -2
- package/dist/chunks/{radio-g56o5rftpu1qpxuv.js.map → radio-nyw89v4eafptepmz.js.map} +1 -1
- package/dist/chunks/{select-g1xvti1k1hj7xe5t.js → select-o2i7aovnu8v1zv8t.js} +39 -38
- package/dist/chunks/{select-g1xvti1k1hj7xe5t.js.map → select-o2i7aovnu8v1zv8t.js.map} +1 -1
- package/dist/chunks/{sensitive-input-hokm527ollnz9dqc.js → sensitive-input-bjg6m791yz7g6bn3.js} +93 -90
- package/dist/chunks/sensitive-input-bjg6m791yz7g6bn3.js.map +1 -0
- package/dist/chunks/{sidebar-oan40ylmqkyui21w.js → sidebar-izcfqkrzt4vqn8ez.js} +37 -37
- package/dist/chunks/{sidebar-oan40ylmqkyui21w.js.map → sidebar-izcfqkrzt4vqn8ez.js.map} +1 -1
- package/dist/chunks/{surface-ck1nt2uqfzmod4sz.js → surface-lzwbh3f5t0gxc83t.js} +2 -2
- package/dist/chunks/{surface-ck1nt2uqfzmod4sz.js.map → surface-lzwbh3f5t0gxc83t.js.map} +1 -1
- package/dist/chunks/{switch-fv0ttj24uhocvuh8.js → switch-d9cs31oj4rjtg717.js} +3 -3
- package/dist/chunks/{switch-fv0ttj24uhocvuh8.js.map → switch-d9cs31oj4rjtg717.js.map} +1 -1
- package/dist/chunks/{table-nsfcgpo93gfetrhh.js → table-c6qemc2jmv22cv3p.js} +2 -2
- package/dist/chunks/{table-nsfcgpo93gfetrhh.js.map → table-c6qemc2jmv22cv3p.js.map} +1 -1
- package/dist/chunks/{tabs-g8ier5pehjpfxauf.js → tabs-f0ztlooi91ko9g04.js} +2 -2
- package/dist/chunks/{tabs-g8ier5pehjpfxauf.js.map → tabs-f0ztlooi91ko9g04.js.map} +1 -1
- package/dist/chunks/{toast-ofqlfmddcyka091n.js → toast-ejfm5cbt9yulqhol.js} +3 -3
- package/dist/chunks/{toast-ofqlfmddcyka091n.js.map → toast-ejfm5cbt9yulqhol.js.map} +1 -1
- package/dist/chunks/{tooltip-icvb67awe1zolz61.js → tooltip-o6xfw9jjclv9pxaj.js} +16 -16
- package/dist/chunks/{tooltip-icvb67awe1zolz61.js.map → tooltip-o6xfw9jjclv9pxaj.js.map} +1 -1
- package/dist/chunks/vendor-base-ui-mzjqwv5teijixz8h.js +24703 -0
- package/dist/chunks/vendor-base-ui-mzjqwv5teijixz8h.js.map +1 -0
- package/dist/chunks/{vendor-floating-ui-dwag5e88viikh2zs.js → vendor-floating-ui-c4mwmh0xmfzevy9l.js} +5 -5
- package/dist/chunks/{vendor-floating-ui-dwag5e88viikh2zs.js.map → vendor-floating-ui-c4mwmh0xmfzevy9l.js.map} +1 -1
- package/dist/chunks/vendor-utils-m5h2xu7s2rs3pgk5.js +217 -0
- package/dist/chunks/vendor-utils-m5h2xu7s2rs3pgk5.js.map +1 -0
- package/dist/code.js +1 -1
- package/dist/components/autocomplete.js +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/breadcrumbs.js +1 -1
- 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.js +1 -1
- package/dist/components/collapsible.js +1 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/command-palette.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/input-group.js +1 -1
- package/dist/components/input.js +3 -3
- package/dist/components/label.js +1 -1
- package/dist/components/layer-card.js +1 -1
- package/dist/components/link.js +1 -1
- package/dist/components/menubar.js +1 -1
- package/dist/components/meter.js +1 -1
- package/dist/components/pagination.js +1 -1
- package/dist/components/popover.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/surface.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/toast.js +2 -2
- package/dist/components/tooltip.js +1 -1
- package/dist/index.js +38 -38
- package/dist/primitives/accordion.js +1 -1
- package/dist/primitives/alert-dialog.js +1 -1
- package/dist/primitives/autocomplete.js +1 -1
- package/dist/primitives/avatar.js +1 -1
- package/dist/primitives/button.js +1 -1
- package/dist/primitives/checkbox-group.js +1 -1
- package/dist/primitives/checkbox.js +1 -1
- package/dist/primitives/collapsible.js +1 -1
- package/dist/primitives/combobox.js +1 -1
- package/dist/primitives/context-menu.js +1 -1
- package/dist/primitives/csp-provider.js +1 -1
- package/dist/primitives/dialog.js +1 -1
- package/dist/primitives/direction-provider.js +1 -1
- package/dist/primitives/drawer.js +1 -1
- package/dist/primitives/field.js +1 -1
- package/dist/primitives/fieldset.js +1 -1
- package/dist/primitives/form.js +1 -1
- package/dist/primitives/input.js +1 -1
- package/dist/primitives/menu.js +1 -1
- package/dist/primitives/menubar.js +1 -1
- package/dist/primitives/meter.js +1 -1
- package/dist/primitives/navigation-menu.js +1 -1
- package/dist/primitives/number-field.js +1 -1
- package/dist/primitives/otp-field.js +1 -1
- package/dist/primitives/popover.js +1 -1
- package/dist/primitives/preview-card.js +1 -1
- package/dist/primitives/progress.js +1 -1
- package/dist/primitives/radio-group.js +1 -1
- package/dist/primitives/radio.js +1 -1
- package/dist/primitives/scroll-area.js +1 -1
- package/dist/primitives/select.js +1 -1
- package/dist/primitives/separator.js +1 -1
- package/dist/primitives/slider.js +1 -1
- package/dist/primitives/switch.js +1 -1
- package/dist/primitives/tabs.js +1 -1
- package/dist/primitives/toast.js +1 -1
- package/dist/primitives/toggle-group.js +1 -1
- package/dist/primitives/toggle.js +1 -1
- package/dist/primitives/toolbar.js +1 -1
- package/dist/primitives/tooltip.js +1 -1
- package/dist/primitives.js +1 -1
- package/dist/scripts/theme-generator/config.js +3 -3
- package/dist/scripts/theme-generator/config.js.map +1 -1
- package/dist/src/components/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/src/components/badge/badge.d.ts +51 -3
- package/dist/src/components/badge/badge.d.ts.map +1 -1
- package/dist/src/components/chart/SankeyChart.d.ts +6 -1
- package/dist/src/components/chart/SankeyChart.d.ts.map +1 -1
- package/dist/src/components/combobox/combobox.d.ts.map +1 -1
- package/dist/src/components/dialog/dialog.d.ts +11 -4
- package/dist/src/components/dialog/dialog.d.ts.map +1 -1
- package/dist/src/components/input-group/input-group-button.d.ts.map +1 -1
- package/dist/src/components/input-group/input-group-input.d.ts.map +1 -1
- package/dist/src/components/input-group/input-group.d.ts.map +1 -1
- package/dist/src/components/select/select.d.ts.map +1 -1
- package/dist/src/components/sensitive-input/sensitive-input.d.ts.map +1 -1
- package/dist/src/components/toast/toast.d.ts.map +1 -1
- package/dist/styles/kumo-binding.css +0 -18
- package/dist/styles/kumo-standalone.css +1 -1
- package/dist/styles/theme-kumo.css +6 -6
- package/package.json +2 -2
- package/scripts/generate-primitives.ts +6 -1
- package/scripts/theme-generator/config.ts +3 -3
- package/dist/chunks/SankeyChart-dkq90770ad7hgzx3.js +0 -635
- package/dist/chunks/autocomplete-mhrvtq4y5n21vr0t.js.map +0 -1
- package/dist/chunks/badge-kqox9toi0sygfbno.js.map +0 -1
- package/dist/chunks/combobox-g3cudlfajecou4va.js.map +0 -1
- package/dist/chunks/dialog-fo3qhv9fgiadq5gp.js +0 -115
- package/dist/chunks/input-group-gy08vju7eoogil8k.js.map +0 -1
- package/dist/chunks/sensitive-input-hokm527ollnz9dqc.js.map +0 -1
- package/dist/chunks/vendor-base-ui-nbyiqqi138hcoz52.js +0 -24639
- package/dist/chunks/vendor-base-ui-nbyiqqi138hcoz52.js.map +0 -1
- package/dist/chunks/vendor-utils-ixnhxmehwihk5tr7.js +0 -534
- package/dist/chunks/vendor-utils-ixnhxmehwihk5tr7.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empty-
|
|
1
|
+
{"version":3,"file":"empty-ni12ufom1kkakbuc.js","sources":["../../src/components/empty/empty.tsx"],"sourcesContent":["import { CheckIcon, CopyIcon } from \"@phosphor-icons/react\";\nimport { useState } from \"react\";\nimport { Button } from \"../../components/button\";\nimport { cn } from \"../../utils/cn\";\nimport { resolveVariant } from \"../../utils/resolve-variant\";\n\n/** Empty state size variant definitions mapping sizes to their Tailwind classes. */\nexport const KUMO_EMPTY_VARIANTS = {\n size: {\n sm: {\n classes: \"px-6 py-8 gap-4\",\n description: \"Compact empty state for smaller containers\",\n },\n base: {\n classes: \"px-10 py-16 gap-6\",\n description: \"Default empty state size\",\n },\n lg: {\n classes: \"px-12 py-20 gap-8\",\n description: \"Large empty state for prominent placement\",\n },\n },\n} as const;\n\nexport const KUMO_EMPTY_DEFAULT_VARIANTS = {\n size: \"base\",\n} as const;\n\nexport type KumoEmptySize = keyof typeof KUMO_EMPTY_VARIANTS.size;\n\nexport interface KumoEmptyVariantsProps {\n /**\n * Size of the empty state container.\n * - `\"sm\"` — Compact empty state for smaller containers\n * - `\"base\"` — Default empty state size\n * - `\"lg\"` — Large empty state for prominent placement\n * @default \"base\"\n */\n size?: KumoEmptySize;\n}\n\nexport function emptyVariants({\n size = KUMO_EMPTY_DEFAULT_VARIANTS.size,\n}: KumoEmptyVariantsProps = {}) {\n return cn(\n \"flex w-full flex-col items-center rounded-xl border border-kumo-fill bg-kumo-control text-kumo-default\",\n resolveVariant(KUMO_EMPTY_VARIANTS.size, size, KUMO_EMPTY_DEFAULT_VARIANTS.size).classes,\n );\n}\n\n/**\n * Empty state component props.\n *\n * @example\n * ```tsx\n * <Empty\n * icon={<PackageIcon size={48} />}\n * title=\"No packages found\"\n * description=\"Get started by installing your first package.\"\n * commandLine=\"npm install @cloudflare/kumo\"\n * />\n * ```\n */\nexport interface EmptyProps extends KumoEmptyVariantsProps {\n /** Decorative icon displayed above the title (e.g. from `@phosphor-icons/react`). */\n icon?: React.ReactNode;\n /** Primary heading text for the empty state. */\n title: string;\n /** Secondary description text displayed below the title. */\n description?: string;\n /** Shell command displayed in a copyable code block. */\n commandLine?: string;\n /** Additional content (buttons, links) rendered below the description. */\n contents?: React.ReactNode;\n /** Additional CSS classes merged via `cn()`. */\n className?: string;\n}\n\n/**\n * Placeholder shown when a list, table, or page has no content to display.\n *\n * @example\n * ```tsx\n * <Empty title=\"No results found\" description=\"Try adjusting your search.\" />\n * ```\n */\nexport function Empty({\n icon,\n title,\n description,\n commandLine,\n contents,\n size = \"base\",\n className,\n}: EmptyProps) {\n const [emptyStateCopied, setEmptyStateCopied] = useState<boolean>(false);\n\n return (\n <div className={cn(emptyVariants({ size }), className)}>\n {icon}\n <h2 className=\"text-2xl font-semibold\">{title}</h2>\n\n {description && (\n <p className=\"max-w-140 text-center text-kumo-subtle\">{description}</p>\n )}\n\n {commandLine && (\n <div\n className={cn(\n \"group/cmd relative inline-flex h-10 max-w-8/10 transform-gpu items-center gap-2 rounded-lg font-mono shadow-sm\",\n \"bg-kumo-overlay pr-2 pl-3\",\n \"transition-all duration-300 hover:border-kumo-interact/80 hover:shadow-md\",\n \"border border-kumo-fill/60\",\n )}\n >\n <span className=\"text-xs text-kumo-inactive select-none\">$</span>\n <span className=\"no-scrollbar overflow-scroll text-base whitespace-nowrap text-kumo-brand\">\n {commandLine}\n </span>\n <Button\n className=\"group\"\n size=\"sm\"\n variant=\"ghost\"\n shape=\"square\"\n aria-label=\"Copy command\"\n onClick={async () => {\n setEmptyStateCopied(true);\n setTimeout(() => {\n setEmptyStateCopied(false);\n }, 1000);\n await navigator.clipboard.writeText(commandLine);\n }}\n >\n {emptyStateCopied ? (\n <CheckIcon size={16} className=\"animate-bounce-in text-kumo-success\" />\n ) : (\n <CopyIcon\n size={16}\n className=\"text-kumo-inactive group-hover:text-kumo-brand\"\n />\n )}\n </Button>\n </div>\n )}\n\n {contents}\n </div>\n );\n}\n"],"names":["KUMO_EMPTY_VARIANTS","KUMO_EMPTY_DEFAULT_VARIANTS","emptyVariants","size","cn","resolveVariant","Empty","icon","title","description","commandLine","contents","className","emptyStateCopied","setEmptyStateCopied","useState","jsxs","jsx","Button","CheckIcon","CopyIcon"],"mappings":";;;;;;;AAOO,MAAMA,I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AAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,MAAK;AAAA,cACL,SAAQ;AAAA,cACR,OAAM;AAAA,cACN,cAAW;AAAA,cACX,SAAS,YAAY;AACnB,gBAAAJ,EAAoB,EAAI,GACxB,WAAW,MAAM;AACf,kBAAAA,EAAoB,EAAK;AAAA,gBAC3B,GAAG,GAAI,GACP,MAAM,UAAU,UAAU,UAAUJ,CAAW;AAAA,cACjD;AAAA,cAEC,cACC,gBAAAO,EAACE,GAAA,EAAU,MAAM,IAAI,WAAU,uCAAsC,IAErE,gBAAAF;AAAA,gBAACG;AAAA,gBAAA;AAAA,kBACC,MAAM;AAAA,kBACN,WAAU;AAAA,gBAAA;AAAA,cAAA;AAAA,YACZ;AAAA,UAAA;AAAA,QAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,IAIHT;AAAA,EAAA,GACH;AAEJ;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as m, jsx as t } from "react/jsx-runtime";
|
|
3
3
|
import { c as a } from "./cn-ct4n7r74mh8y0f48.js";
|
|
4
|
-
import { L as f } from "./label-
|
|
5
|
-
import { O as u, P as p,
|
|
4
|
+
import { L as f } from "./label-f6yvqca8qhbpvkq8.js";
|
|
5
|
+
import { O as u, P as p, aS as x, aT as d } from "./vendor-base-ui-mzjqwv5teijixz8h.js";
|
|
6
6
|
function y(e) {
|
|
7
7
|
if (e)
|
|
8
8
|
return typeof e == "string" ? { message: e, match: !0 } : e;
|
|
@@ -74,4 +74,4 @@ export {
|
|
|
74
74
|
g as f,
|
|
75
75
|
y as n
|
|
76
76
|
};
|
|
77
|
-
//# sourceMappingURL=field-
|
|
77
|
+
//# sourceMappingURL=field-n16udu32tpyq5udz.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-
|
|
1
|
+
{"version":3,"file":"field-n16udu32tpyq5udz.js","sources":["../../src/components/field/field.tsx"],"sourcesContent":["import { Field as FieldBase } from \"@base-ui/react/field\";\nimport type { ReactNode } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Label } from \"../label\";\n\n/**\n * Normalizes an error prop that may be a string or structured object\n * into the `{ message, match }` shape expected by `<Field>`.\n *\n * Returns `undefined` when the input is falsy.\n */\nexport function normalizeFieldError(\n error: string | { message: ReactNode; match: FieldErrorMatch } | undefined,\n): { message: ReactNode; match: FieldErrorMatch } | undefined {\n if (!error) return undefined;\n if (typeof error === \"string\") return { message: error, match: true };\n return error;\n}\n\n/** Field variant definitions (currently empty, reserved for future additions). */\nexport const KUMO_FIELD_VARIANTS = {\n // Field currently has no variant options but structure is ready for future additions\n} as const;\n\nexport const KUMO_FIELD_DEFAULT_VARIANTS = {} as const;\n\n// Derived types from KUMO_FIELD_VARIANTS\nexport interface KumoFieldVariantsProps {\n /**\n * When true, places the control (checkbox/switch) before the label visually.\n * When false (default), places the label before the control.\n * Used to support different layout patterns (e.g., iOS-style toggles on the right).\n */\n controlFirst?: boolean;\n}\n\nexport function fieldVariants({\n controlFirst = false,\n}: KumoFieldVariantsProps = {}) {\n return cn(\n // Base styles - vertical layout (default)\n \"grid gap-2\",\n\n // Horizontal layout for checkbox and switch\n // Default: Grid auto-reverses in RTL (desired)\n \"has-[input[type=checkbox]]:grid-cols-[auto_1fr] has-[input[type=checkbox]]:items-center\",\n \"has-[[role=switch]]:grid-cols-[auto_1fr] has-[[role=switch]]:items-center\",\n\n // Control first: use flexbox with row-reverse to flip visual order without affecting text direction\n // flex-row-reverse in LTR: Control→Label, in RTL: Label→Control (opposite of grid default)\n controlFirst && [\n \"has-[input[type=checkbox]]:flex has-[input[type=checkbox]]:flex-row-reverse has-[input[type=checkbox]]:flex-wrap has-[input[type=checkbox]]:items-center\",\n \"has-[[role=switch]]:flex has-[[role=switch]]:flex-row-reverse has-[[role=switch]]:flex-wrap has-[[role=switch]]:items-center\",\n \"[&>label]:flex-1\",\n ],\n );\n}\n\n/**\n * Match type for field validation errors.\n * Can be a boolean or a key from the browser's ValidityState interface.\n * Source: BaseErrorProps[\"match\"] (ComponentPropsWithoutRef<typeof FieldBase.Error>)\n */\nexport type FieldErrorMatch =\n | boolean\n | \"badInput\"\n | \"customError\"\n | \"patternMismatch\"\n | \"rangeOverflow\"\n | \"rangeUnderflow\"\n | \"stepMismatch\"\n | \"tooLong\"\n | \"tooShort\"\n | \"typeMismatch\"\n | \"valid\"\n | \"valueMissing\";\n\n/**\n * Field component props — wraps a form control with label, description, and error message.\n *\n * @example\n * ```tsx\n * <Field label=\"Email\" required>\n * <Input placeholder=\"you@example.com\" />\n * </Field>\n *\n * <Field label=\"Phone\" required={false} description=\"We'll only use this for account recovery.\">\n * <Input placeholder=\"+1 555-0000\" />\n * </Field>\n * ```\n */\nexport interface FieldProps extends KumoFieldVariantsProps {\n /** The form control element(s) to wrap (Input, Select, Checkbox, etc.). */\n children: ReactNode;\n /** The label content — can be a string or any React node. */\n label: ReactNode;\n /**\n * When explicitly `false`, shows gray \"(optional)\" text after the label.\n * When `true` or `undefined`, no indicator is shown.\n */\n required?: boolean;\n /** Tooltip content displayed next to the label via an info icon. */\n labelTooltip?: ReactNode;\n /** Validation error with a message and a browser `ValidityState` match key. */\n error?: {\n message: ReactNode;\n match: FieldErrorMatch;\n };\n /** Helper text displayed below the control (hidden when `error` is present). */\n description?: ReactNode;\n /** When `true`, places the control before the label (for checkbox/switch layouts). */\n controlFirst?: boolean;\n /**\n * When `true`, Field renders layout, description, and error but skips\n * the `<label>` element. Use when the child component provides its own\n * accessible label (e.g. Select uses Base UI's `Select.Label` to avoid\n * hover/focus coupling from native `<label>`).\n * @default false\n */\n hideLabel?: boolean;\n}\n\n/**\n * Form field wrapper that provides a label, optional description, and error display\n * around any form control. Built on Base UI Field primitives.\n *\n * @example\n * ```tsx\n * <Field label=\"Username\">\n * <Input placeholder=\"Choose a username\" />\n * </Field>\n * ```\n */\nexport function Field({\n children,\n label,\n required,\n labelTooltip,\n error,\n description,\n controlFirst = false,\n hideLabel = false,\n}: FieldProps) {\n // Show \"(optional)\" when required is explicitly false\n const showOptional = required === false;\n\n return (\n <FieldBase.Root className={fieldVariants({ controlFirst })}>\n {!hideLabel && (\n <FieldBase.Label className=\"m-0 select-none text-base font-medium text-kumo-default\">\n <Label showOptional={showOptional} tooltip={labelTooltip} asContent>\n {label}\n </Label>\n </FieldBase.Label>\n )}\n {children}\n {error ? (\n <FieldBase.Error\n className={cn(\n \"text-sm leading-snug text-kumo-danger\",\n // Span full width in horizontal layout\n \"col-span-full\",\n )}\n match={error.match}\n >\n {error.message}\n </FieldBase.Error>\n ) : (\n description && (\n <FieldBase.Description\n className={cn(\n \"text-sm leading-snug text-kumo-subtle\",\n // Span full width in horizontal layout\n \"col-span-full\",\n )}\n >\n {description}\n </FieldBase.Description>\n )\n )}\n </FieldBase.Root>\n );\n}\n"],"names":["normalizeFieldError","error","KUMO_FIELD_VARIANTS","KUMO_FIELD_DEFAULT_VARIANTS","fieldVariants","controlFirst","cn","Field","children","label","required","labelTooltip","description","hideLabel","showOptional","jsxs","FieldBase.Root","jsx","FieldBase.Label","Label","FieldBase.Error","FieldBase.Description"],"mappings":";;;;;AAWO,SAASA,EACdC,GAC4D;AAC5D,MAAKA;AACL,WAAI,OAAOA,KAAU,WAAiB,EAAE,SAASA,GAAO,OAAO,GAAA,IACxDA;AACT;AAGO,MAAMC,IAAsB;AAAA;AAEnC,GAEaC,IAA8B,CAAA;AAYpC,SAASC,EAAc;AAAA,EAC5B,cAAAC,IAAe;AACjB,IAA4B,IAAI;AAC9B,SAAOC;AAAA;AAAA,IAEL;AAAA;AAAA;AAAA,IAIA;AAAA,IACA;AAAA;AAAA;AAAA,IAIAD,KAAgB;AAAA,MACd;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EACF;AAEJ;AA6EO,SAASE,EAAM;AAAA,EACpB,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,OAAAV;AAAA,EACA,aAAAW;AAAA,EACA,cAAAP,IAAe;AAAA,EACf,WAAAQ,IAAY;AACd,GAAe;AAEb,QAAMC,IAAeJ,MAAa;AAElC,SACE,gBAAAK,EAACC,GAAA,EAAe,WAAWZ,EAAc,EAAE,cAAAC,EAAA,CAAc,GACtD,UAAA;AAAA,IAAA,CAACQ,KACA,gBAAAI,EAACC,GAAA,EAAgB,WAAU,2DACzB,UAAA,gBAAAD,EAACE,GAAA,EAAM,cAAAL,GAA4B,SAASH,GAAc,WAAS,IAChE,aACH,GACF;AAAA,IAEDH;AAAA,IACAP,IACC,gBAAAgB;AAAA,MAACG;AAAAA,MAAA;AAAA,QACC,WAAWd;AAAA,UACT;AAAA;AAAA,UAEA;AAAA,QAAA;AAAA,QAEF,OAAOL,EAAM;AAAA,QAEZ,UAAAA,EAAM;AAAA,MAAA;AAAA,IAAA,IAGTW,KACE,gBAAAK;AAAA,MAACI;AAAAA,MAAA;AAAA,QACC,WAAWf;AAAA,UACT;AAAA;AAAA,UAEA;AAAA,QAAA;AAAA,QAGD,UAAAM;AAAA,MAAA;AAAA,IAAA;AAAA,EACH,GAGN;AAEJ;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as a } from "react/jsx-runtime";
|
|
3
|
-
import { i as N } from "./input-
|
|
3
|
+
import { i as N } from "./input-mv7giprcc6hfkpq3.js";
|
|
4
4
|
import { c as x } from "./cn-ct4n7r74mh8y0f48.js";
|
|
5
5
|
import * as y from "react";
|
|
6
6
|
import { useCallback as I } from "react";
|
|
7
|
-
import { F as b, n as w } from "./field-
|
|
8
|
-
import {
|
|
7
|
+
import { F as b, n as w } from "./field-n16udu32tpyq5udz.js";
|
|
8
|
+
import { aU as E } from "./vendor-base-ui-mzjqwv5teijixz8h.js";
|
|
9
9
|
const u = y.forwardRef(
|
|
10
10
|
(d, t) => {
|
|
11
11
|
const {
|
|
@@ -75,4 +75,4 @@ export {
|
|
|
75
75
|
u as I,
|
|
76
76
|
j as T
|
|
77
77
|
};
|
|
78
|
-
//# sourceMappingURL=input-area-
|
|
78
|
+
//# sourceMappingURL=input-area-hhhpgg0ev8bowtrk.js.map
|
package/dist/chunks/{input-area-gudamx1ruz8rxiw2.js.map → input-area-hhhpgg0ev8bowtrk.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-area-
|
|
1
|
+
{"version":3,"file":"input-area-hhhpgg0ev8bowtrk.js","sources":["../../src/components/input/input-area.tsx"],"sourcesContent":["import { inputVariants } from \"./input\";\nimport { cn } from \"../../utils/cn\";\nimport { useCallback, type ReactNode } from \"react\";\nimport * as React from \"react\";\nimport { Field as FieldBase } from \"@base-ui/react/field\";\nimport { Field as KumoField, normalizeFieldError, type FieldErrorMatch } from \"../field/field\";\n\nexport const InputArea = React.forwardRef<HTMLTextAreaElement, InputAreaProps>(\n (props, ref) => {\n const {\n className,\n onValueChange,\n size = \"base\",\n variant: variantProp,\n onChange,\n label,\n labelTooltip,\n description,\n error,\n ...inputProps\n } = props;\n\n // Deprecation warning for variant=\"error\"\n if (process.env.NODE_ENV !== \"production\" && variantProp === \"error\") {\n console.warn(\n '[Kumo InputArea]: variant=\"error\" is deprecated. ' +\n \"Error styling is now automatically applied when the `error` prop is truthy. \" +\n \"Simply remove the variant prop and pass an error message instead.\",\n );\n }\n\n // Auto-apply error styling when error prop is truthy\n // Explicit variant prop takes precedence for backwards compatibility\n const variant = variantProp ?? (error ? \"error\" : \"default\");\n\n // Extract required from inputProps to pass to Field for label decoration\n const { required } = inputProps;\n const handleChange = useCallback(\n (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n onChange?.(event);\n onValueChange?.(event.target.value);\n },\n [onChange, onValueChange],\n );\n\n const textareaClassName = cn(\n inputVariants({ size, variant, focusIndicator: true }),\n \"h-auto py-2\", // Input variant always comes with size, but it does not apply for textarea\n className,\n );\n\n // Render with Field wrapper if label, error, or description is provided\n // Use FieldBase.Control with render callback to ensure proper label-textarea association.\n // The render callback receives props with the correct id/aria-labelledby from Field context.\n if (label || error || description) {\n return (\n <KumoField\n label={label}\n required={required}\n labelTooltip={labelTooltip}\n description={description}\n error={normalizeFieldError(error)}\n >\n <FieldBase.Control\n render={(controlProps) => (\n <textarea\n {...controlProps}\n ref={ref}\n className={textareaClassName}\n onChange={handleChange}\n {...inputProps}\n />\n )}\n />\n </KumoField>\n );\n }\n\n // Render bare textarea without Field wrapper\n return (\n <textarea\n ref={ref}\n className={textareaClassName}\n onChange={handleChange}\n {...inputProps}\n />\n );\n },\n);\n\nInputArea.displayName = \"InputArea\";\n\n/** Alias for InputArea — provided for discoverability when migrating from other libraries */\nexport const Textarea = InputArea;\n\n/**\n * InputArea component props\n * @property {ReactNode} [label] - Label content for the textarea (enables Field wrapper)\n * @property {ReactNode} [description] - Helper text displayed below the textarea\n * @property {string | { message: ReactNode, match: FieldErrorMatch }} [error] - Error message or validation error object\n */\nexport type InputAreaProps = {\n onValueChange?: (value: string) => void;\n variant?: \"default\" | \"error\";\n size?: \"xs\" | \"sm\" | \"base\" | \"lg\";\n // Then other custom props\n children?: React.ReactNode;\n className?: string;\n /** Label content for the textarea (enables Field wrapper) - can be a string or any React node */\n label?: ReactNode;\n /** Tooltip content to display next to the label via an info icon */\n labelTooltip?: ReactNode;\n /** Helper text displayed below the textarea */\n description?: ReactNode;\n /** Error message or validation error object */\n error?: string | { message: ReactNode; match: FieldErrorMatch };\n\n // Finally, spread the native input props (least important)\n} & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, \"size\">;\n"],"names":["InputArea","React","props","ref","className","onValueChange","size","variantProp","onChange","label","labelTooltip","description","error","inputProps","variant","required","handleChange","useCallback","event","textareaClassName","cn","inputVariants","jsx","KumoField","normalizeFieldError","FieldBase.Control","controlProps","Textarea"],"mappings":";;;;;;;;AAOO,MAAMA,IAAYC,EAAM;AAAA,EAC7B,CAACC,GAAOC,MAAQ;AACd,UAAM;AAAA,MACJ,WAAAC;AAAA,MACA,eAAAC;AAAA,MACA,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,MAAM2B,IAAW3B;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as s, jsxs as O, Fragment as $ } from "react/jsx-runtime";
|
|
3
|
-
import P, { createContext as T, Children as _, isValidElement as E, useContext as V, forwardRef as
|
|
3
|
+
import P, { createContext as T, Children as _, isValidElement as E, useContext as V, forwardRef as x, cloneElement as H, useId as J, useMemo as Q } from "react";
|
|
4
4
|
import { c as l } from "./cn-ct4n7r74mh8y0f48.js";
|
|
5
|
-
import { I as W, i as A } from "./input-
|
|
6
|
-
import { F as C } from "./field-
|
|
7
|
-
import { B as X } from "./button-
|
|
8
|
-
import { T as Y } from "./tooltip-
|
|
5
|
+
import { I as W, i as A } from "./input-mv7giprcc6hfkpq3.js";
|
|
6
|
+
import { F as C } from "./field-n16udu32tpyq5udz.js";
|
|
7
|
+
import { B as X } from "./button-fxdpoacmq5rv1adk.js";
|
|
8
|
+
import { T as Y } from "./tooltip-o6xfw9jjclv9pxaj.js";
|
|
9
9
|
const G = {
|
|
10
10
|
xs: {
|
|
11
11
|
inputOuter: "px-1.5",
|
|
@@ -93,7 +93,7 @@ function tt(t) {
|
|
|
93
93
|
r !== void 0 && r !== "ghost" && (n = !0);
|
|
94
94
|
}), n && o ? "hybrid" : n ? "individual" : "container";
|
|
95
95
|
}
|
|
96
|
-
const D =
|
|
96
|
+
const D = x(
|
|
97
97
|
(t, n) => {
|
|
98
98
|
const o = S("Input");
|
|
99
99
|
process.env.NODE_ENV !== "production" && o && (t.size !== void 0 && console.warn(
|
|
@@ -118,27 +118,23 @@ const D = m(
|
|
|
118
118
|
className: l(
|
|
119
119
|
// Base input layout: fill height, allow shrinking, strip native border/radius
|
|
120
120
|
"flex h-full min-w-0 grow items-center rounded-none border-0 bg-transparent font-sans",
|
|
121
|
-
// Always use full outer padding — the container's has-[] rules reduce
|
|
122
|
-
// pl/pr to inputSeam on sides that touch an addon.
|
|
121
|
+
// Always use full outer padding — the container's has-[] rules reduce pl/pr to inputSeam on sides that touch an addon.
|
|
123
122
|
i.inputOuter,
|
|
124
123
|
// Truncate overflowing text with "…" instead of expanding the input
|
|
125
124
|
"text-ellipsis",
|
|
126
125
|
// Individual mode: each element owns its own border instead of sharing a container ring
|
|
127
126
|
u ? [
|
|
128
|
-
// Own border replaces the container's shared ring
|
|
129
|
-
"relative ring-0 border border-kumo-line",
|
|
130
|
-
// Inherit border-radius only on outer edges; inner edges are flat
|
|
127
|
+
// Own border replaces the container's shared ring; suppress the base Input's focus:ring so only the border-swap shows
|
|
128
|
+
"relative ring-0 focus:ring-0 border border-kumo-line",
|
|
131
129
|
"first:rounded-l-[inherit] last:rounded-r-[inherit]",
|
|
132
|
-
//
|
|
133
|
-
"not-first
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
"focus:z-[2] focus:border-kumo-line focus:outline focus:-outline-offset-1"
|
|
130
|
+
// Negative margin (not border-l-0) so the border is still paintable on focus
|
|
131
|
+
"not-first:-ml-px",
|
|
132
|
+
"hover:z-1 hover:border-kumo-line",
|
|
133
|
+
// z-[2] lifts above hovered siblings so focus border isn't clipped
|
|
134
|
+
"focus:z-2 focus:border-kumo-focus/50"
|
|
138
135
|
].join(" ") : (
|
|
139
|
-
// Container mode: kill all focus indicators — the container handles them
|
|
140
|
-
|
|
141
|
-
"relative z-[1] ring-0! shadow-none outline-none focus:ring-0! focus:outline-none"
|
|
136
|
+
// Container mode: kill all focus indicators — the container handles them z-1 lifts the input above the invisible label overlay so cursor/selection work
|
|
137
|
+
"relative z-1 ring-0! shadow-none outline-none focus:ring-0! focus:outline-none"
|
|
142
138
|
),
|
|
143
139
|
t.className
|
|
144
140
|
)
|
|
@@ -152,7 +148,7 @@ const nt = {
|
|
|
152
148
|
sm: "xs",
|
|
153
149
|
base: "sm",
|
|
154
150
|
lg: "base"
|
|
155
|
-
}, w =
|
|
151
|
+
}, w = x(
|
|
156
152
|
({
|
|
157
153
|
children: t,
|
|
158
154
|
className: n,
|
|
@@ -164,14 +160,14 @@ const nt = {
|
|
|
164
160
|
icon: a,
|
|
165
161
|
...f
|
|
166
162
|
}, p) => {
|
|
167
|
-
const d = S("Button"),
|
|
168
|
-
process.env.NODE_ENV !== "production" && d && h === "ghost" && !
|
|
163
|
+
const d = S("Button"), b = V(j), c = i ?? d?.disabled, m = d?.focusMode === "individual" || d?.focusMode === "hybrid", h = o ?? "ghost";
|
|
164
|
+
process.env.NODE_ENV !== "production" && d && h === "ghost" && !b && console.warn(
|
|
169
165
|
"InputGroup.Button: Ghost buttons should be wrapped in <InputGroup.Addon> for correct spacing."
|
|
170
166
|
), process.env.NODE_ENV !== "production" && d && e !== void 0 && console.warn(
|
|
171
167
|
"InputGroup.Button: Set `size` on <InputGroup> instead of <InputGroup.Button>."
|
|
172
168
|
);
|
|
173
|
-
const v = typeof u == "string" && !f["aria-label"] ? u : void 0,
|
|
174
|
-
size:
|
|
169
|
+
const v = typeof u == "string" && !f["aria-label"] ? u : void 0, g = d ? G[d.size ?? "base"].iconSize : void 0, I = a && g && (typeof a == "function" || typeof a == "object" && a !== null && !P.isValidElement(a)) ? P.createElement(a, {
|
|
170
|
+
size: g
|
|
175
171
|
}) : a, z = /* @__PURE__ */ s(
|
|
176
172
|
X,
|
|
177
173
|
{
|
|
@@ -180,27 +176,29 @@ const nt = {
|
|
|
180
176
|
disabled: c,
|
|
181
177
|
"aria-label": v,
|
|
182
178
|
...f,
|
|
183
|
-
icon:
|
|
179
|
+
icon: I,
|
|
184
180
|
variant: o ?? "ghost",
|
|
185
|
-
size: e ?? (
|
|
181
|
+
size: e ?? (m ? d?.size ?? "sm" : nt[d?.size ?? "base"] ?? "sm"),
|
|
186
182
|
className: l(
|
|
187
183
|
// Ensure clicks register even when parent has pointer-events-none (e.g. disabled overlay)
|
|
188
184
|
"pointer-events-auto",
|
|
185
|
+
// Suppress the base Button's non-visible focus ring in all modes
|
|
186
|
+
"focus:ring-0",
|
|
187
|
+
// Container-zone buttons: use a subtle ring as focus indicator
|
|
188
|
+
// (outline doesn't work because the base Button's `focus:outline-none`
|
|
189
|
+
// sets `outline-style: none` which our outline-width/color can't override)
|
|
190
|
+
!m && "focus-visible:ring-[1.5px] focus-visible:ring-kumo-focus/50",
|
|
189
191
|
// Individual mode: each button owns its own border and focus indicator
|
|
190
|
-
|
|
192
|
+
m && [
|
|
191
193
|
// Own border replaces the container's shared ring; force full height
|
|
192
|
-
"relative h-full! rounded-none ring-0 border border-kumo-line",
|
|
193
|
-
// Inherit border-radius only on outer edges; inner edges are flat
|
|
194
|
+
"relative h-full! rounded-none ring-0 focus-visible:ring-0 border border-kumo-line",
|
|
194
195
|
"first:rounded-l-[inherit] last:rounded-r-[inherit]",
|
|
195
|
-
//
|
|
196
|
-
"not-first
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
"focus
|
|
201
|
-
// Suppress the base Button's focus ring so only our outline shows
|
|
202
|
-
"focus-visible:ring-2 focus-visible:ring-kumo-focus",
|
|
203
|
-
// Match the group's disabled visual treatment
|
|
196
|
+
// Negative margin (not border-l-0) so the border is still paintable on focus
|
|
197
|
+
"not-first:-ml-px",
|
|
198
|
+
"hover:z-1",
|
|
199
|
+
// z-2 lifts above hovered siblings so focus border isn't clipped
|
|
200
|
+
"focus:z-2",
|
|
201
|
+
"focus-visible:border-kumo-focus/50",
|
|
204
202
|
"disabled:bg-kumo-overlay disabled:text-kumo-inactive!"
|
|
205
203
|
],
|
|
206
204
|
n
|
|
@@ -212,7 +210,7 @@ const nt = {
|
|
|
212
210
|
}
|
|
213
211
|
);
|
|
214
212
|
w.displayName = "InputGroup.Button";
|
|
215
|
-
const y =
|
|
213
|
+
const y = x(
|
|
216
214
|
({ align: t = "start", className: n, children: o }, e) => {
|
|
217
215
|
const u = S("Addon")?.size ?? "base", r = G[u];
|
|
218
216
|
let a = !1;
|
|
@@ -246,7 +244,7 @@ const y = m(
|
|
|
246
244
|
}
|
|
247
245
|
);
|
|
248
246
|
y.displayName = "InputGroup.Addon";
|
|
249
|
-
const B =
|
|
247
|
+
const B = x(
|
|
250
248
|
({ className: t, children: n }, o) => {
|
|
251
249
|
const i = S("Suffix")?.size ?? "base", u = G[i];
|
|
252
250
|
return /* @__PURE__ */ s(
|
|
@@ -287,7 +285,7 @@ const dt = {
|
|
|
287
285
|
}
|
|
288
286
|
}, pt = {
|
|
289
287
|
size: "base"
|
|
290
|
-
}, M =
|
|
288
|
+
}, M = x(
|
|
291
289
|
({
|
|
292
290
|
size: t = "base",
|
|
293
291
|
children: n,
|
|
@@ -300,15 +298,15 @@ const dt = {
|
|
|
300
298
|
labelTooltip: f,
|
|
301
299
|
...p
|
|
302
300
|
}, d) => {
|
|
303
|
-
const
|
|
301
|
+
const b = J(), c = tt(n), m = Q(
|
|
304
302
|
() => ({
|
|
305
303
|
size: t,
|
|
306
304
|
focusMode: c,
|
|
307
305
|
disabled: e,
|
|
308
306
|
error: r,
|
|
309
|
-
inputId:
|
|
307
|
+
inputId: b
|
|
310
308
|
}),
|
|
311
|
-
[t, c, e, r,
|
|
309
|
+
[t, c, e, r, b]
|
|
312
310
|
), h = l(
|
|
313
311
|
// Establish positioning context and make the whole area a click target
|
|
314
312
|
"relative w-full cursor-text",
|
|
@@ -323,7 +321,7 @@ const dt = {
|
|
|
323
321
|
c === "container" ? [
|
|
324
322
|
"overflow-hidden",
|
|
325
323
|
// Focus state must come AFTER inputVariants to override ring-kumo-line
|
|
326
|
-
"focus-within:ring-kumo-focus"
|
|
324
|
+
"focus-within:ring-kumo-focus/50 focus-within:ring-[1.5px]"
|
|
327
325
|
] : (
|
|
328
326
|
// isolate creates a new stacking context so z-index in children doesn't leak out
|
|
329
327
|
"isolate overflow-visible ring-0 shadow-none"
|
|
@@ -352,7 +350,7 @@ const dt = {
|
|
|
352
350
|
};
|
|
353
351
|
if (c === "hybrid") {
|
|
354
352
|
const { containerZone: z, individualZone: Z } = q(n), R = {
|
|
355
|
-
...
|
|
353
|
+
...m,
|
|
356
354
|
focusMode: "container"
|
|
357
355
|
}, K = /* @__PURE__ */ O($, { children: [
|
|
358
356
|
/* @__PURE__ */ s(N.Provider, { value: R, children: /* @__PURE__ */ O(
|
|
@@ -374,27 +372,29 @@ const dt = {
|
|
|
374
372
|
// so the zone matches adjacent individual-mode buttons exactly.
|
|
375
373
|
"ring-0 shadow-none",
|
|
376
374
|
"border border-kumo-line",
|
|
377
|
-
"focus-within:
|
|
378
|
-
//
|
|
379
|
-
"
|
|
380
|
-
//
|
|
381
|
-
|
|
375
|
+
"focus-within:border-kumo-focus/50",
|
|
376
|
+
// z-[2] lifts above adjacent button's -ml-px overlap so focus border shows
|
|
377
|
+
"focus-within:z-2",
|
|
378
|
+
// Negative margin (not border-l-0) so the border is still paintable on focus
|
|
379
|
+
"not-first:-ml-px",
|
|
380
|
+
// Outer edges inherit radius; inner edges are flat against sibling buttons
|
|
382
381
|
"first:rounded-l-[inherit] last:rounded-r-[inherit] rounded-none",
|
|
383
382
|
// Size-specific padding adjustments when addons or suffixes are present
|
|
384
383
|
U[t],
|
|
385
384
|
// When a suffix is present, let the input shrink to its content width
|
|
386
|
-
"has-
|
|
387
|
-
"has-
|
|
388
|
-
"has-
|
|
389
|
-
"has-
|
|
385
|
+
"has-data-[slot=input-group-suffix]:[&_input]:field-sizing-content",
|
|
386
|
+
"has-data-[slot=input-group-suffix]:[&_input]:max-w-full",
|
|
387
|
+
"has-data-[slot=input-group-suffix]:[&_input]:grow-0",
|
|
388
|
+
"has-data-[slot=input-group-suffix]:[&_input]:pr-0"
|
|
390
389
|
),
|
|
391
390
|
children: [
|
|
392
|
-
i && //
|
|
391
|
+
i && // Invisible overlay for click-to-focus; the visible Field label handles a11y
|
|
392
|
+
// eslint-disable-next-line jsx-a11y/label-has-associated-control
|
|
393
393
|
/* @__PURE__ */ s(
|
|
394
394
|
"label",
|
|
395
395
|
{
|
|
396
|
-
htmlFor:
|
|
397
|
-
className: "absolute inset-0 z-0 cursor-text
|
|
396
|
+
htmlFor: b,
|
|
397
|
+
className: "absolute inset-0 z-0 cursor-text mb-0!",
|
|
398
398
|
"aria-hidden": "true"
|
|
399
399
|
}
|
|
400
400
|
),
|
|
@@ -403,7 +403,7 @@ const dt = {
|
|
|
403
403
|
}
|
|
404
404
|
) }),
|
|
405
405
|
Z
|
|
406
|
-
] }), k = /* @__PURE__ */ s(N.Provider, { value:
|
|
406
|
+
] }), k = /* @__PURE__ */ s(N.Provider, { value: m, children: /* @__PURE__ */ s(
|
|
407
407
|
"div",
|
|
408
408
|
{
|
|
409
409
|
ref: d,
|
|
@@ -425,7 +425,7 @@ const dt = {
|
|
|
425
425
|
}
|
|
426
426
|
) : k;
|
|
427
427
|
}
|
|
428
|
-
const
|
|
428
|
+
const g = !i && c === "container", I = /* @__PURE__ */ s(N.Provider, { value: m, children: i ? /* @__PURE__ */ O(
|
|
429
429
|
"div",
|
|
430
430
|
{
|
|
431
431
|
ref: d,
|
|
@@ -436,22 +436,22 @@ const dt = {
|
|
|
436
436
|
/* @__PURE__ */ s(
|
|
437
437
|
"label",
|
|
438
438
|
{
|
|
439
|
-
htmlFor:
|
|
440
|
-
className: "absolute inset-0 z-0
|
|
439
|
+
htmlFor: b,
|
|
440
|
+
className: "absolute inset-0 z-0 mb-0!",
|
|
441
441
|
"aria-hidden": "true"
|
|
442
442
|
}
|
|
443
443
|
),
|
|
444
444
|
n
|
|
445
445
|
]
|
|
446
446
|
}
|
|
447
|
-
) :
|
|
447
|
+
) : g ? (
|
|
448
448
|
// Standalone container mode: <label> enables click-to-focus on empty space.
|
|
449
449
|
/* @__PURE__ */ s(
|
|
450
450
|
"label",
|
|
451
451
|
{
|
|
452
452
|
ref: d,
|
|
453
453
|
...v,
|
|
454
|
-
className: l(h, "
|
|
454
|
+
className: l(h, "mb-0!"),
|
|
455
455
|
...p,
|
|
456
456
|
children: n
|
|
457
457
|
}
|
|
@@ -477,15 +477,15 @@ const dt = {
|
|
|
477
477
|
error: r,
|
|
478
478
|
required: a,
|
|
479
479
|
labelTooltip: f,
|
|
480
|
-
children:
|
|
480
|
+
children: I
|
|
481
481
|
}
|
|
482
|
-
) :
|
|
482
|
+
) : I;
|
|
483
483
|
}
|
|
484
484
|
);
|
|
485
485
|
M.displayName = "InputGroup";
|
|
486
|
-
const F =
|
|
486
|
+
const F = x((t, n) => /* @__PURE__ */ s(y, { ref: n, align: "start", ...t }));
|
|
487
487
|
F.displayName = "InputGroup.Label";
|
|
488
|
-
const L =
|
|
488
|
+
const L = x((t, n) => /* @__PURE__ */ s(B, { ref: n, ...t }));
|
|
489
489
|
L.displayName = "InputGroup.Description";
|
|
490
490
|
const lt = Object.assign(M, {
|
|
491
491
|
Input: D,
|
|
@@ -502,4 +502,4 @@ export {
|
|
|
502
502
|
dt as K,
|
|
503
503
|
pt as a
|
|
504
504
|
};
|
|
505
|
-
//# sourceMappingURL=input-group-
|
|
505
|
+
//# sourceMappingURL=input-group-kkw5j7rwzhj66h10.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-group-kkw5j7rwzhj66h10.js","sources":["../../src/components/input-group/context.ts","../../src/components/input-group/input-group-input.tsx","../../src/components/input-group/input-group-button.tsx","../../src/components/input-group/input-group-addon.tsx","../../src/components/input-group/input-group-suffix.tsx","../../src/components/input-group/input-group.tsx"],"sourcesContent":["import {\n Children,\n createContext,\n isValidElement,\n useContext,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport type { KumoInputSize } from \"../input/input\";\nimport type { FieldProps } from \"../field/field\";\n\n// Spacing model\n//\n// Each element type has a fixed outer padding. The container uses has-[] CSS\n// to reduce the input's padding on sides that touch an addon.\n//\n// Input outer: px-3 (12px base) — full padding when at the edge\n// Input seam: pl-2 / pr-2 (8px base) — applied by container has-[]\n// Addon outer: pl-2 / pr-2 (8px base) — on the container-edge side\n// Addon seam: nothing — input owns the gap entirely\n//\n// has-[] rules on the container override [&_input]:pl-{seam} when a start\n// addon is present, and [&_input]:pr-{seam} when an end addon is present.\n\nexport interface InputGroupSizeTokens {\n /** Full outer padding — matches standalone Input (e.g. px-3). */\n inputOuter: string;\n /**\n * Directional outer padding for Addon at the container edge.\n *\n * These MUST be static pl-/pr- strings (not derived at runtime via\n * `\"px-N\".replace(…)`) so Tailwind JIT can detect them during its\n * source-file scan. Dynamic string construction produces class names\n * that never appear as literals, so Tailwind never generates the CSS.\n */\n addonOuterStart: string;\n addonOuterEnd: string;\n /**\n * Reduced outer padding when the Addon contains a Button.\n * Buttons have their own internal padding, so the Addon can use\n * less outer padding to keep the visual gap balanced.\n */\n addonButtonOuterStart: string;\n addonButtonOuterEnd: string;\n /** pr- for suffix when no end addon. */\n suffixPad: string;\n fontSize: string;\n /** Icon size in px. */\n iconSize: number;\n}\n\nexport const INPUT_GROUP_SIZE: Record<KumoInputSize, InputGroupSizeTokens> = {\n xs: {\n inputOuter: \"px-1.5\",\n addonOuterStart: \"pl-1.5\",\n addonOuterEnd: \"pr-1.5\",\n addonButtonOuterStart: \"pl-1\",\n addonButtonOuterEnd: \"pr-1\",\n suffixPad: \"pr-1.5\",\n fontSize: \"text-xs\",\n iconSize: 10,\n },\n sm: {\n inputOuter: \"px-2\",\n addonOuterStart: \"pl-1.5\",\n addonOuterEnd: \"pr-1.5\",\n addonButtonOuterStart: \"pl-1\",\n addonButtonOuterEnd: \"pr-1\",\n suffixPad: \"pr-2\",\n fontSize: \"text-xs\",\n iconSize: 13,\n },\n base: {\n inputOuter: \"px-3\",\n addonOuterStart: \"pl-2\",\n addonOuterEnd: \"pr-2\",\n addonButtonOuterStart: \"pl-1\",\n addonButtonOuterEnd: \"pr-1\",\n suffixPad: \"pr-3\",\n fontSize: \"text-base\",\n iconSize: 18,\n },\n lg: {\n inputOuter: \"px-4\",\n addonOuterStart: \"pl-2.5\",\n addonOuterEnd: \"pr-2.5\",\n addonButtonOuterStart: \"pl-1.5\",\n addonButtonOuterEnd: \"pr-1.5\",\n suffixPad: \"pr-4\",\n fontSize: \"text-base\",\n iconSize: 20,\n },\n};\n\n// Build the has-[] container classes that reduce input padding when addons\n// are present. These are static strings so Tailwind JIT can detect them.\nexport const INPUT_GROUP_HAS_CLASSES: Record<KumoInputSize, string> = {\n xs: [\n \"has-[[data-slot=input-group-addon-start]]:[&_input]:pl-1\",\n \"has-[[data-slot=input-group-addon-end]]:[&_input]:pr-1\",\n ].join(\" \"),\n sm: [\n \"has-[[data-slot=input-group-addon-start]]:[&_input]:pl-1.5\",\n \"has-[[data-slot=input-group-addon-end]]:[&_input]:pr-1.5\",\n ].join(\" \"),\n base: [\n \"has-[[data-slot=input-group-addon-start]]:[&_input]:pl-2\",\n \"has-[[data-slot=input-group-addon-end]]:[&_input]:pr-2\",\n ].join(\" \"),\n lg: [\n \"has-[[data-slot=input-group-addon-start]]:[&_input]:pl-2.5\",\n \"has-[[data-slot=input-group-addon-end]]:[&_input]:pr-2.5\",\n ].join(\" \"),\n};\n\n// Context\n\n/**\n * Props for `InputGroup.Root`. Focus mode is auto-detected from children\n * (see `detectFocusMode`), so it is not part of the public or internal API.\n */\nexport interface InputGroupRootPropsInternal\n extends HTMLAttributes<HTMLElement>,\n Partial<\n Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\" | \"labelTooltip\"\n >\n > {\n size?: KumoInputSize | undefined;\n disabled?: boolean;\n}\n\n/** Public InputGroup.Root props — identical to the internal type. */\nexport type InputGroupRootProps = InputGroupRootPropsInternal;\n\nexport interface InputGroupContextValue {\n size?: KumoInputSize;\n focusMode: \"container\" | \"individual\" | \"hybrid\";\n disabled: boolean;\n error?: FieldProps[\"error\"];\n /** Auto-generated id for the input element; used by the invisible label overlay. */\n inputId: string;\n}\n\nexport const InputGroupContext = createContext<InputGroupContextValue | null>(\n null,\n);\n\n/**\n * Set to `true` by `InputGroup.Addon` so that `InputGroup.Button` can detect\n * whether it's wrapped in an Addon. Ghost buttons should always live inside\n * an Addon for correct spacing.\n */\nexport const InputGroupAddonContext = createContext(false);\n\n/**\n * Reads InputGroupContext and warns in development when the context is null\n * (i.e. when a sub-component is rendered outside of `<InputGroup>`).\n */\nexport function useInputGroupContext(componentName: string) {\n const context = useContext(InputGroupContext);\n if (process.env.NODE_ENV !== \"production\" && !context) {\n console.warn(\n `<InputGroup.${componentName}> must be used within <InputGroup>. Falling back to default values.`,\n );\n }\n return context;\n}\n\n/**\n * Partitions InputGroup children for hybrid focus mode.\n *\n * Container zone: Addon, Input, Suffix, text nodes — everything that should\n * share a single container-style border.\n *\n * Individual zone: Direct `InputGroup.Button` elements that manage their own\n * border and focus ring.\n *\n * Uses `displayName` comparison to identify elements, avoiding circular\n * imports between `context.ts` and the sub-component files.\n */\nexport function partitionChildren(children: ReactNode): {\n containerZone: ReactNode[];\n individualZone: ReactNode[];\n} {\n const containerZone: ReactNode[] = [];\n const individualZone: ReactNode[] = [];\n\n Children.forEach(children, (child) => {\n if (\n isValidElement(child) &&\n (child.type as { displayName?: string })?.displayName ===\n \"InputGroup.Button\"\n ) {\n individualZone.push(child);\n } else {\n containerZone.push(child);\n }\n });\n\n return { containerZone, individualZone };\n}\n\n/**\n * Analyzes the direct children of `InputGroup` to determine the focus mode.\n *\n * Returns `\"hybrid\"` when BOTH an `InputGroup.Addon` AND a non-ghost direct\n * `InputGroup.Button` are present. In hybrid mode, Addon+Input share a\n * container-style border while Buttons get individual borders.\n *\n * Returns `\"individual\"` when a non-ghost direct `InputGroup.Button` is\n * present WITHOUT any `InputGroup.Addon`. This signals a toolbar/pagination\n * layout where each element manages its own focus ring.\n *\n * Returns `\"container\"` (default) in all other cases — the container owns a\n * single shared focus ring.\n *\n * Uses `displayName` comparison to identify elements, avoiding circular\n * imports between `context.ts` and the sub-component files.\n */\nexport function detectFocusMode(\n children: ReactNode,\n): \"container\" | \"individual\" | \"hybrid\" {\n let hasNonGhostDirectButton = false;\n let hasAddon = false;\n\n Children.forEach(children, (child) => {\n if (!isValidElement(child)) return;\n\n // Identify components by displayName to avoid circular imports.\n const type = child.type;\n const displayName =\n typeof type === \"function\" || typeof type === \"object\"\n ? (type as { displayName?: string }).displayName\n : undefined;\n\n if (displayName === \"InputGroup.Addon\") {\n hasAddon = true;\n return;\n }\n\n if (displayName !== \"InputGroup.Button\") return;\n\n // A direct-child Button is by definition NOT inside an Addon (Addon's\n // children are children of the Addon element, not of InputGroup).\n // Check whether the variant is explicitly non-ghost.\n const variant = (child.props as { variant?: string }).variant;\n if (variant !== undefined && variant !== \"ghost\") {\n hasNonGhostDirectButton = true;\n }\n });\n\n if (hasNonGhostDirectButton && hasAddon) return \"hybrid\";\n if (hasNonGhostDirectButton) return \"individual\";\n return \"container\";\n}\n","import { forwardRef } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Input as InputExternal, type InputProps } from \"../input/input\";\nimport { useInputGroupContext, INPUT_GROUP_SIZE } from \"./context\";\n\n/** Props for InputGroup.Input — omits Field props since InputGroup handles them. */\nexport type InputGroupInputProps = Omit<\n InputProps,\n \"label\" | \"labelTooltip\" | \"description\" | \"error\" | \"size\" | \"disabled\"\n>;\n\n/**\n * Text input that inherits size, disabled, and error state from InputGroup context.\n * Automatically sets `aria-invalid` when parent has an error.\n */\nexport const Input = forwardRef<HTMLInputElement, InputGroupInputProps>(\n (props, ref) => {\n const context = useInputGroupContext(\"Input\");\n\n // Warn when props that belong on <InputGroup> are passed directly\n if (process.env.NODE_ENV !== \"production\" && context) {\n if ((props as any).size !== undefined) {\n console.warn(\n \"InputGroup.Input: Set `size` on <InputGroup> instead of <InputGroup.Input>.\",\n );\n }\n if ((props as any).disabled !== undefined) {\n console.warn(\n \"InputGroup.Input: Set `disabled` on <InputGroup> instead of <InputGroup.Input>.\",\n );\n }\n if ((props as any).label !== undefined) {\n console.warn(\n \"InputGroup.Input: Use the `label` prop on <InputGroup> instead of <InputGroup.Input>.\",\n );\n }\n if ((props as any).description !== undefined) {\n console.warn(\n \"InputGroup.Input: Use <InputGroup.Suffix> instead of passing `description` to <InputGroup.Input>.\",\n );\n }\n }\n\n const size = context?.size ?? \"base\";\n const tokens = INPUT_GROUP_SIZE[size];\n const isIndividual = context?.focusMode === \"individual\";\n\n // Auto-set aria-invalid when error is present in context\n const hasError = Boolean(context?.error);\n\n // Use explicit id if provided, otherwise fall back to context id\n // (links the input to the invisible label overlay for click-to-focus).\n const inputId = props.id ?? context?.inputId;\n\n return (\n <InputExternal\n ref={ref}\n size={context?.size}\n disabled={context?.disabled || (props as any).disabled}\n aria-invalid={hasError || props[\"aria-invalid\"]}\n {...props}\n id={inputId}\n className={cn(\n // Base input layout: fill height, allow shrinking, strip native border/radius\n \"flex h-full min-w-0 grow items-center rounded-none border-0 bg-transparent font-sans\",\n // Always use full outer padding — the container's has-[] rules reduce pl/pr to inputSeam on sides that touch an addon.\n tokens.inputOuter,\n // Truncate overflowing text with \"…\" instead of expanding the input\n \"text-ellipsis\",\n // Individual mode: each element owns its own border instead of sharing a container ring\n isIndividual\n ? [\n // Own border replaces the container's shared ring; suppress the base Input's focus:ring so only the border-swap shows\n \"relative ring-0 focus:ring-0 border border-kumo-line\",\n \"first:rounded-l-[inherit] last:rounded-r-[inherit]\",\n // Negative margin (not border-l-0) so the border is still paintable on focus\n \"not-first:-ml-px\",\n \"hover:z-1 hover:border-kumo-line\",\n // z-[2] lifts above hovered siblings so focus border isn't clipped\n \"focus:z-2 focus:border-kumo-focus/50\",\n ].join(\" \")\n : // Container mode: kill all focus indicators — the container handles them z-1 lifts the input above the invisible label overlay so cursor/selection work\n \"relative z-1 ring-0! shadow-none outline-none focus:ring-0! focus:outline-none\",\n props.className,\n )}\n />\n );\n },\n);\nInput.displayName = \"InputGroup.Input\";\n","import React, {\n forwardRef,\n useContext,\n type PropsWithChildren,\n type ReactNode,\n} from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { type ButtonProps, Button as ButtonExternal } from \"../button/button\";\nimport { Tooltip, type KumoTooltipSide } from \"../tooltip/tooltip\";\nimport type { KumoInputSize } from \"../input/input\";\nimport {\n INPUT_GROUP_SIZE,\n InputGroupAddonContext,\n useInputGroupContext,\n} from \"./context\";\n\n/**\n * In container mode, buttons render \"one size down\" so they stay visually\n * subordinate to the input. In individual mode the size passes through\n * unchanged (pagination / toolbar buttons should match the input height).\n */\nconst COMPACT_BUTTON_SIZE: Record<KumoInputSize, KumoInputSize> = {\n xs: \"xs\",\n sm: \"xs\",\n base: \"sm\",\n lg: \"base\",\n};\n\nexport type InputGroupButtonProps = ButtonProps & {\n /**\n * When provided, wraps the button in a `Tooltip` showing this content on hover.\n * Automatically sets `aria-label` from a string value when no `aria-label` is set.\n *\n * @example\n * ```tsx\n * <InputGroup.Addon align=\"end\">\n * <InputGroup.Button tooltip=\"Query language help\" aria-label=\"Query language help\">\n * <QuestionIcon size={16} />\n * </InputGroup.Button>\n * </InputGroup.Addon>\n * ```\n */\n tooltip?: ReactNode;\n /**\n * Preferred side for the tooltip popup.\n * @default \"bottom\"\n */\n tooltipSide?: KumoTooltipSide;\n};\n\n/**\n * Button for secondary actions rendered inside `InputGroup.Addon`\n * (toggle, copy, help).\n *\n * In `focusMode=\"container\"` (default), renders as a compact ghost button\n * subordinate to the input. In `focusMode=\"individual\"`, renders as a full\n * standalone button with its own focus ring, matching toolbar/pagination usage.\n *\n * Pass a `tooltip` prop to show a tooltip on hover.\n */\nexport const Button = forwardRef<\n HTMLButtonElement,\n PropsWithChildren<InputGroupButtonProps>\n>(\n (\n {\n children,\n className,\n variant,\n size,\n disabled,\n tooltip,\n tooltipSide = \"bottom\",\n icon,\n ...props\n }: PropsWithChildren<InputGroupButtonProps>,\n ref: React.ForwardedRef<HTMLButtonElement>,\n ) => {\n const context = useInputGroupContext(\"Button\");\n const isInsideAddon = useContext(InputGroupAddonContext);\n const isDisabled = disabled ?? context?.disabled;\n const isIndividual =\n context?.focusMode === \"individual\" || context?.focusMode === \"hybrid\";\n const effectiveVariant = variant ?? \"ghost\";\n\n if (\n process.env.NODE_ENV !== \"production\" &&\n context &&\n effectiveVariant === \"ghost\" &&\n !isInsideAddon\n ) {\n console.warn(\n \"InputGroup.Button: Ghost buttons should be wrapped in <InputGroup.Addon> for correct spacing.\",\n );\n }\n\n if (\n process.env.NODE_ENV !== \"production\" &&\n context &&\n size !== undefined\n ) {\n console.warn(\n \"InputGroup.Button: Set `size` on <InputGroup> instead of <InputGroup.Button>.\",\n );\n }\n\n // Derive aria-label from tooltip string when the button has no explicit label.\n // Icon-only buttons require an aria-label for a11y.\n const tooltipAriaLabel =\n typeof tooltip === \"string\" && !props[\"aria-label\"] ? tooltip : undefined;\n\n // Pre-render the icon with the context-derived size so it matches the\n // Addon icon sizing (e.g. 18px at \"base\"). Without this, Button's\n // internal renderIconNode renders `<Icon />` with no size prop,\n // falling back to CSS font-size (~14px).\n const contextIconSize = context\n ? INPUT_GROUP_SIZE[context.size ?? \"base\"].iconSize\n : undefined;\n\n const sizedIcon =\n icon &&\n contextIconSize &&\n (typeof icon === \"function\" ||\n (typeof icon === \"object\" &&\n icon !== null &&\n !React.isValidElement(icon)))\n ? React.createElement(icon as React.ComponentType<{ size?: number }>, {\n size: contextIconSize,\n })\n : icon;\n\n const btn = (\n <ButtonExternal\n ref={ref}\n type=\"button\"\n disabled={isDisabled}\n aria-label={tooltipAriaLabel}\n {...props}\n icon={sizedIcon}\n variant={variant ?? \"ghost\"}\n // Individual: use the group's size directly so buttons match the input height.\n // Container: render one size down so the button stays subordinate to the input.\n size={\n size ??\n (isIndividual\n ? (context?.size ?? \"sm\")\n : (COMPACT_BUTTON_SIZE[context?.size ?? \"base\"] ?? \"sm\"))\n }\n className={cn(\n // Ensure clicks register even when parent has pointer-events-none (e.g. disabled overlay)\n \"pointer-events-auto\",\n // Suppress the base Button's non-visible focus ring in all modes\n \"focus:ring-0\",\n // Container-zone buttons: use a subtle ring as focus indicator\n // (outline doesn't work because the base Button's `focus:outline-none`\n // sets `outline-style: none` which our outline-width/color can't override)\n !isIndividual &&\n \"focus-visible:ring-[1.5px] focus-visible:ring-kumo-focus/50\",\n // Individual mode: each button owns its own border and focus indicator\n isIndividual && [\n // Own border replaces the container's shared ring; force full height\n \"relative h-full! rounded-none ring-0 focus-visible:ring-0 border border-kumo-line\",\n \"first:rounded-l-[inherit] last:rounded-r-[inherit]\",\n // Negative margin (not border-l-0) so the border is still paintable on focus\n \"not-first:-ml-px\",\n \"hover:z-1\",\n // z-2 lifts above hovered siblings so focus border isn't clipped\n \"focus:z-2\",\n \"focus-visible:border-kumo-focus/50\",\n \"disabled:bg-kumo-overlay disabled:text-kumo-inactive!\",\n ],\n className,\n )}\n >\n {children}\n </ButtonExternal>\n );\n\n if (tooltip) {\n return (\n <Tooltip content={tooltip} side={tooltipSide} asChild>\n {btn}\n </Tooltip>\n );\n }\n\n return btn;\n },\n);\nButton.displayName = \"InputGroup.Button\";\n","import {\n Children,\n cloneElement,\n forwardRef,\n isValidElement,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport {\n useInputGroupContext,\n INPUT_GROUP_SIZE,\n InputGroupAddonContext,\n} from \"./context\";\nimport { Button } from \"./input-group-button\";\n\nexport interface InputGroupAddonProps {\n /** Position relative to the input. @default \"start\" */\n align?: \"start\" | \"end\";\n /** Additional CSS classes. */\n className?: string;\n /** Addon content: icons, buttons, spinners, text. */\n children?: ReactNode;\n}\n\n/**\n * Container for icons, text, or compact buttons positioned at the start or end\n * of the input. Automatically sizes icon children to match the input size.\n */\nexport const Addon = forwardRef<HTMLDivElement, InputGroupAddonProps>(\n ({ align = \"start\", className, children }, ref) => {\n const context = useInputGroupContext(\"Addon\");\n\n const size = context?.size ?? \"base\";\n const tokens = INPUT_GROUP_SIZE[size];\n\n // Inject size into direct icon children that don't already have one set.\n // Skips buttons (which have their own size handling) and non-element nodes.\n // Also tracks whether a Button is present so we can reduce outer padding.\n let containsButton = false;\n const sizedChildren = Children.map(children, (child) => {\n if (!isValidElement(child)) return child;\n if (child.type === Button) {\n containsButton = true;\n return child;\n }\n const props = child.props as { size?: unknown };\n if (props.size !== undefined) return child;\n return cloneElement(child as ReactElement<{ size?: number }>, {\n size: tokens.iconSize,\n });\n });\n\n // Always use flex-based positioning. CSS order controls visual placement.\n return (\n <div\n ref={ref}\n data-slot={\n align === \"start\"\n ? \"input-group-addon-start\"\n : \"input-group-addon-end\"\n }\n className={cn(\n \"relative z-[1] pointer-events-none flex shrink-0 items-center gap-1.5\",\n \"text-kumo-subtle\",\n tokens.fontSize,\n \"*:pointer-events-auto\",\n align === \"start\"\n ? cn(\n \"-order-1\",\n containsButton\n ? tokens.addonButtonOuterStart\n : tokens.addonOuterStart,\n \"pr-0\",\n )\n : cn(\n \"order-1\",\n \"pl-0\",\n containsButton\n ? tokens.addonButtonOuterEnd\n : tokens.addonOuterEnd,\n ),\n className,\n )}\n >\n <InputGroupAddonContext.Provider value={true}>\n {sizedChildren}\n </InputGroupAddonContext.Provider>\n </div>\n );\n },\n);\nAddon.displayName = \"InputGroup.Addon\";\n","import { forwardRef, type ReactNode } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { useInputGroupContext, INPUT_GROUP_SIZE } from \"./context\";\n\nexport interface InputGroupSuffixProps {\n /** Additional CSS classes. */\n className?: string;\n /** Suffix content (e.g., \".workers.dev\"). */\n children?: ReactNode;\n}\n\n/**\n * Inline suffix that flows seamlessly next to the typed input value.\n * Input width adjusts automatically via CSS `field-sizing: content`.\n */\nexport const Suffix = forwardRef<HTMLDivElement, InputGroupSuffixProps>(\n ({ className, children }, ref) => {\n const context = useInputGroupContext(\"Suffix\");\n\n const size = context?.size ?? \"base\";\n const tokens = INPUT_GROUP_SIZE[size];\n\n return (\n <div\n ref={ref}\n data-slot=\"input-group-suffix\"\n className={cn(\n \"pointer-events-none flex min-w-0 grow select-none items-center text-kumo-subtle\",\n tokens.fontSize,\n tokens.suffixPad,\n className,\n )}\n >\n <span className=\"truncate\">{children}</span>\n </div>\n );\n },\n);\nSuffix.displayName = \"InputGroup.Suffix\";\n","import {\n forwardRef,\n useId,\n useMemo,\n type ComponentPropsWithoutRef,\n type PropsWithChildren,\n} from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { inputVariants } from \"../input/input\";\nimport { Field } from \"../field/field\";\nimport {\n InputGroupContext,\n INPUT_GROUP_HAS_CLASSES,\n detectFocusMode,\n partitionChildren,\n type InputGroupRootPropsInternal,\n} from \"./context\";\nimport { Input } from \"./input-group-input\";\nimport { Button } from \"./input-group-button\";\nimport { Addon } from \"./input-group-addon\";\nimport { Suffix } from \"./input-group-suffix\";\n\nexport { type InputGroupRootProps } from \"./context\";\nexport { type InputGroupInputProps } from \"./input-group-input\";\nexport { type InputGroupButtonProps } from \"./input-group-button\";\nexport { type InputGroupAddonProps } from \"./input-group-addon\";\nexport { type InputGroupSuffixProps } from \"./input-group-suffix\";\n\nexport const KUMO_INPUT_GROUP_VARIANTS = {\n size: {\n xs: {\n classes: \"h-6 text-xs\",\n description: \"Extra small size.\",\n },\n sm: {\n classes: \"h-7 text-xs\",\n description: \"Small size.\",\n },\n base: {\n classes: \"h-9 text-base\",\n description: \"Default size.\",\n },\n lg: {\n classes: \"h-11 text-base\",\n description: \"Large size.\",\n },\n },\n} as const;\n\nexport const KUMO_INPUT_GROUP_DEFAULT_VARIANTS = {\n size: \"base\",\n} as const;\n\n/**\n * Compound input component for building inputs with icons, addons, inline\n * suffixes, and action buttons. Accepts Field props and wraps content in\n * Field when label is provided.\n *\n * Renders as `<label>` only in standalone container mode (single input, no\n * sibling buttons) so clicking empty space focuses the input. Otherwise\n * renders as `<div>` to avoid nested `<label>` (when Field provides one) or\n * the browser's `:hover` propagation from `<label>` to its first labelable\n * descendant (when multiple labelable controls are siblings).\n *\n * @note Do not wrap InputGroup inside an external Field without using the `label` prop —\n * this creates invalid nested `<label>` elements. Use InputGroup's own `label` prop instead.\n *\n * @example\n * ```tsx\n * <InputGroup label=\"Email\" error={{ message: \"Invalid\", match: true }}>\n * <InputGroup.Addon><EnvelopeIcon /></InputGroup.Addon>\n * <InputGroup.Input placeholder=\"you@example.com\" />\n * </InputGroup>\n * ```\n *\n * @example\n * ```tsx\n * <InputGroup>\n * <InputGroup.Input placeholder=\"my-worker\" />\n * <InputGroup.Suffix>.workers.dev</InputGroup.Suffix>\n * </InputGroup>\n * ```\n */\nconst Root = forwardRef<\n HTMLElement,\n PropsWithChildren<InputGroupRootPropsInternal>\n>(\n (\n {\n size = \"base\",\n children,\n className,\n disabled = false,\n label,\n description,\n error,\n required,\n labelTooltip,\n ...rest\n },\n forwardedRef,\n ) => {\n const inputId = useId();\n const focusMode = detectFocusMode(children);\n\n const contextValue = useMemo(\n () => ({\n size,\n focusMode,\n disabled,\n error,\n inputId,\n }),\n [size, focusMode, disabled, error, inputId],\n );\n\n // When label is provided, Field already renders a <label> with htmlFor\n // that handles click-to-focus. Using <div> avoids nested <label> elements\n // (invalid HTML with undefined assistive technology behavior).\n // When standalone (no label), a native <label> preserves click-to-focus.\n const containerClassName = cn(\n // Establish positioning context and make the whole area a click target\n \"relative w-full cursor-text\",\n // inputVariants provides base ring-kumo-line; must come before state overrides\n inputVariants({ size }),\n // Subtle drop shadow to separate the group from the page surface\n \"shadow-xs\",\n // Disabled state: prevent interaction and dim the entire group\n \"data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n // Container mode: clip children to rounded corners and show a shared focus ring\n // Individual mode: disable container ring/shadow so each child owns its own border\n focusMode === \"container\"\n ? [\n \"overflow-hidden\",\n // Focus state must come AFTER inputVariants to override ring-kumo-line\n \"focus-within:ring-kumo-focus/50 focus-within:ring-[1.5px]\",\n ]\n : // isolate creates a new stacking context so z-index in children doesn't leak out\n \"isolate overflow-visible ring-0 shadow-none\",\n // Error state must also come after inputVariants\n \"has-[input[aria-invalid=true]]:ring-kumo-danger\",\n // Reset horizontal padding — children handle their own spacing\n \"px-0\",\n // Horizontal layout with no gap — children control their own internal spacing\n \"flex items-center gap-0\",\n // When a suffix is present, let the input shrink to its content width\n // so the suffix stays visually adjacent\n \"has-[[data-slot=input-group-suffix]]:[&_input]:[field-sizing:content]\",\n \"has-[[data-slot=input-group-suffix]]:[&_input]:max-w-full\",\n \"has-[[data-slot=input-group-suffix]]:[&_input]:grow-0\",\n \"has-[[data-slot=input-group-suffix]]:[&_input]:pr-0\",\n // Size-specific padding adjustments when addons or suffixes are present\n INPUT_GROUP_HAS_CLASSES[size],\n // Reset bottom margin to avoid inherited spacing from parent <label> styles\n \"!mb-0\",\n className,\n );\n\n // Data attributes drive CSS selectors in kumo-binding.css (focus outline)\n // and enable child components to query their parent's state.\n const dataProps = {\n \"data-slot\": \"input-group\" as const,\n \"data-focus-mode\": focusMode,\n \"data-disabled\": disabled ? (\"\" as const) : undefined,\n };\n\n // Hybrid mode: splits children into two rendering zones:\n // 1. Container zone (Addon + Input + Suffix) — shares a single border/ring\n // 2. Individual zone (standalone Buttons) — each button owns its own border\n // This lets inputs and addons look unified while buttons remain independent.\n if (focusMode === \"hybrid\") {\n // Partition children by type: addons/inputs/suffixes → container, buttons → individual\n const { containerZone, individualZone } = partitionChildren(children);\n\n // Override focusMode to \"container\" for children inside the zone\n // so InputGroup.Input uses container-mode styling (ring-0!, no own border).\n const containerZoneContext = {\n ...contextValue,\n focusMode: \"container\" as const,\n };\n\n const hybridContent = (\n <>\n {/* Container zone wrapper — shares a single border/ring */}\n <InputGroupContext.Provider value={containerZoneContext}>\n <div\n data-slot=\"input-group-container-zone\"\n className={cn(\n // Base input sizing/shape from shared variant function\n inputVariants({ size }),\n // Clip children to rounded corners within the zone\n \"overflow-hidden\",\n // Show red ring on validation error\n \"has-[input[aria-invalid=true]]:ring-kumo-danger\",\n // Reset horizontal padding — children handle their own spacing\n \"px-0\",\n // Fill available width but allow shrinking when sibling buttons are present\n \"flex min-w-0 flex-1 items-center gap-0\",\n // Use a clean 1px CSS border instead of ring+shadow from inputVariants\n // so the zone matches adjacent individual-mode buttons exactly.\n \"ring-0 shadow-none\",\n \"border border-kumo-line\",\n \"focus-within:border-kumo-focus/50\",\n // z-[2] lifts above adjacent button's -ml-px overlap so focus border shows\n \"focus-within:z-2\",\n // Negative margin (not border-l-0) so the border is still paintable on focus\n \"not-first:-ml-px\",\n // Outer edges inherit radius; inner edges are flat against sibling buttons\n \"first:rounded-l-[inherit] last:rounded-r-[inherit] rounded-none\",\n // Size-specific padding adjustments when addons or suffixes are present\n INPUT_GROUP_HAS_CLASSES[size],\n // When a suffix is present, let the input shrink to its content width\n \"has-data-[slot=input-group-suffix]:[&_input]:field-sizing-content\",\n \"has-data-[slot=input-group-suffix]:[&_input]:max-w-full\",\n \"has-data-[slot=input-group-suffix]:[&_input]:grow-0\",\n \"has-data-[slot=input-group-suffix]:[&_input]:pr-0\",\n )}\n >\n {/* When label exists, an invisible <label> overlay enables click-to-focus inside the container zone without nesting visible <label> elements */}\n {label && (\n // Invisible overlay for click-to-focus; the visible Field label handles a11y\n // eslint-disable-next-line jsx-a11y/label-has-associated-control\n <label\n htmlFor={inputId}\n // Positioned behind children (z-0) so it catches clicks on empty space\n className=\"absolute inset-0 z-0 cursor-text mb-0!\"\n aria-hidden=\"true\"\n />\n )}\n {containerZone}\n </div>\n </InputGroupContext.Provider>\n {/* Individual zone — buttons with their own borders */}\n {individualZone}\n </>\n );\n\n // Hybrid always uses a <div> container (never <label>) because individual-zone buttons are siblings — wrapping them in a <label> would be semantically incorrect.\n const hybridContainer = (\n <InputGroupContext.Provider value={contextValue}>\n <div\n ref={forwardedRef as React.Ref<HTMLDivElement>}\n {...dataProps}\n className={containerClassName}\n {...rest}\n >\n {hybridContent}\n </div>\n </InputGroupContext.Provider>\n );\n\n if (label) {\n return (\n <Field\n label={label}\n description={description}\n error={error}\n required={required}\n labelTooltip={labelTooltip}\n >\n {hybridContainer}\n </Field>\n );\n }\n\n return hybridContainer;\n }\n\n // Container / Individual mode (non-hybrid)\n // Use <label> only when there's exactly one labelable descendant; otherwise <label> would propagate :hover to its first labelable descendant.\n const useLabelContainer = !label && focusMode === \"container\";\n const container = (\n <InputGroupContext.Provider value={contextValue}>\n {/* When label is set, use <div> to avoid nested <label> (Field provides one). An invisible <label> overlay handles click-to-focus on empty space. */}\n {label ? (\n <div\n ref={forwardedRef as React.Ref<HTMLDivElement>}\n {...dataProps}\n className={containerClassName}\n {...rest}\n >\n {/* eslint-disable-next-line jsx-a11y/label-has-associated-control -- invisible overlay for click-to-focus; the visible Field label handles a11y */}\n <label\n htmlFor={inputId}\n // Positioned behind children (z-0) so it catches clicks on empty space\n className=\"absolute inset-0 z-0 mb-0!\"\n aria-hidden=\"true\"\n />\n {children}\n </div>\n ) : useLabelContainer ? (\n // Standalone container mode: <label> enables click-to-focus on empty space.\n <label\n ref={forwardedRef as React.Ref<HTMLLabelElement>}\n {...dataProps}\n className={cn(containerClassName, \"mb-0!\")}\n {...rest}\n >\n {children}\n </label>\n ) : (\n // Individual mode: <div> avoids :hover propagating to the first labelable sibling.\n <div\n ref={forwardedRef as React.Ref<HTMLDivElement>}\n {...dataProps}\n className={containerClassName}\n {...rest}\n >\n {children}\n </div>\n )}\n </InputGroupContext.Provider>\n );\n\n if (label) {\n return (\n <Field\n label={label}\n description={description}\n error={error}\n required={required}\n labelTooltip={labelTooltip}\n >\n {container}\n </Field>\n );\n }\n\n return container;\n },\n);\nRoot.displayName = \"InputGroup\";\n\n/** @deprecated Use `InputGroup.Addon` instead. */\nconst Label = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof Addon>\n>((props, ref) => <Addon ref={ref} align=\"start\" {...props} />);\nLabel.displayName = \"InputGroup.Label\";\n\n/** @deprecated Use `InputGroup.Suffix` instead. */\nconst Description = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof Suffix>\n>((props, ref) => <Suffix ref={ref} {...props} />);\nDescription.displayName = \"InputGroup.Description\";\n\nexport const InputGroup = Object.assign(Root, {\n Input,\n Button,\n Addon,\n Suffix,\n /** @deprecated Use `InputGroup.Addon` instead. */\n Label,\n /** @deprecated Use `InputGroup.Suffix` instead. */\n Description,\n});\n"],"names":["INPUT_GROUP_SIZE","INPUT_GROUP_HAS_CLASSES","InputGroupContext","createContext","InputGroupAddonContext","useInputGroupContext","componentName","context","useContext","partitionChildren","children","containerZone","individualZone","Children","child","isValidElement","detectFocusMode","hasNonGhostDirectButton","hasAddon","type","displayName","variant","Input","forwardRef","props","ref","size","tokens","isIndividual","hasError","inputId","jsx","InputExternal","cn","COMPACT_BUTTON_SIZE","Button","className","disabled","tooltip","tooltipSide","icon","isInsideAddon","isDisabled","effectiveVariant","tooltipAriaLabel","contextIconSize","sizedIcon","React","btn","ButtonExternal","Tooltip","Addon","align","containsButton","sizedChildren","cloneElement","Suffix","KUMO_INPUT_GROUP_VARIANTS","KUMO_INPUT_GROUP_DEFAULT_VARIANTS","Root","label","description","error","required","labelTooltip","rest","forwardedRef","useId","focusMode","contextValue","useMemo","containerClassName","inputVariants","dataProps","containerZoneContext","hybridContent","jsxs","Fragment","hybridContainer","Field","useLabelContainer","container","Label","Description","InputGroup"],"mappings":";;;;;;;;AAmDO,MAAMA,IAAgE;AAAA,EAC3E,IAAI;AAAA,IACF,YAAY;AAAA,IACZ,iBAAiB;AAAA,IACjB,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,qBAAqB;AAAA,IACrB,WAAW;AAAA,IACX,UAAU;AAAA,IACV,UAAU;AAAA,EAAA;AAAA,EAEZ,IAAI;AAAA,IACF,YAAY;AAAA,IACZ,iBAAiB;AAAA,IACjB,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,qBAAqB;AAAA,IACrB,WAAW;AAAA,IACX,UAAU;AAAA,IACV,UAAU;AAAA,EAAA;AAAA,EAEZ,MAAM;AAAA,IACJ,YAAY;AAAA,IACZ,iBAAiB;AAAA,IACjB,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,qBAAqB;AAAA,IACrB,WAAW;AAAA,IACX,UAAU;AAAA,IACV,UAAU;AAAA,EAAA;AAAA,EAEZ,IAAI;AAAA,IACF,YAAY;AAAA,IACZ,iBAAiB;AAAA,IACjB,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,qBAAqB;AAAA,IACrB,WAAW;AAAA,IACX,UAAU;AAAA,IACV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} from "./cn-ct4n7r74mh8y0f48.js";
|
|
4
4
|
import { r as f } from "./resolve-variant-gw6eh7fa4st8ej7m.js";
|
|
5
5
|
import { forwardRef as w } from "react";
|
|
6
|
-
import { F as E, n as N } from "./field-
|
|
7
|
-
import { I as y } from "./vendor-base-ui-
|
|
6
|
+
import { F as E, n as N } from "./field-n16udu32tpyq5udz.js";
|
|
7
|
+
import { I as y } from "./vendor-base-ui-mzjqwv5teijixz8h.js";
|
|
8
8
|
const m = {
|
|
9
9
|
size: {
|
|
10
10
|
xs: {
|
|
@@ -127,4 +127,4 @@ export {
|
|
|
127
127
|
m as K,
|
|
128
128
|
z as i
|
|
129
129
|
};
|
|
130
|
-
//# sourceMappingURL=input-
|
|
130
|
+
//# sourceMappingURL=input-mv7giprcc6hfkpq3.js.map
|