@godxjp/ui 31.6.0 → 31.8.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.
Files changed (61) hide show
  1. package/agent/START-HERE.md +4 -4
  2. package/agent/components/Breadcrumb.json +1 -1
  3. package/agent/components/ColorPicker.json +16 -8
  4. package/agent/components/PageContainer.json +1 -1
  5. package/agent/components/Progress.json +12 -1
  6. package/agent/components/Select.json +22 -0
  7. package/agent/components/Text.json +1 -1
  8. package/agent/components.json +53 -12
  9. package/agent/index.json +4 -4
  10. package/agent/llms.txt +5 -5
  11. package/agent/tokens.json +30 -0
  12. package/dist/components/data-display/progress.d.ts +16 -0
  13. package/dist/components/data-display/progress.js +17 -3
  14. package/dist/components/data-entry/chat-composer.js +11 -4
  15. package/dist/components/data-entry/chat-suggestion.js +2 -0
  16. package/dist/components/data-entry/color-picker.d.ts +2 -2
  17. package/dist/components/data-entry/color-picker.js +150 -37
  18. package/dist/components/data-entry/command-palette.js +2 -1
  19. package/dist/components/data-entry/date-picker.js +2 -0
  20. package/dist/components/data-entry/index.d.ts +1 -1
  21. package/dist/components/data-entry/number-input.js +2 -1
  22. package/dist/components/data-entry/search-select.js +55 -17
  23. package/dist/components/data-entry/select.js +1 -1
  24. package/dist/components/data-entry/time-picker.js +3 -0
  25. package/dist/components/feedback/non-modal-layer.js +2 -1
  26. package/dist/components/feedback/tooltip.d.ts +21 -0
  27. package/dist/components/feedback/tooltip.js +101 -0
  28. package/dist/components/general/typography.js +35 -12
  29. package/dist/components/layout/breadcrumb-ellipsis.d.ts +16 -0
  30. package/dist/components/layout/breadcrumb-ellipsis.js +28 -0
  31. package/dist/components/layout/breadcrumb.js +16 -7
  32. package/dist/components/layout/page-container.js +29 -20
  33. package/dist/components/navigation/pagination.js +2 -1
  34. package/dist/components/ui/tag-input.js +2 -1
  35. package/dist/contracts/measurement.json +1 -1
  36. package/dist/i18n/messages/en.json +6 -3
  37. package/dist/i18n/messages/ja.json +6 -3
  38. package/dist/i18n/messages/vi.json +6 -3
  39. package/dist/lib/ime.d.ts +12 -0
  40. package/dist/lib/ime.js +7 -0
  41. package/dist/props/components/data-entry.prop.d.ts +66 -1
  42. package/dist/props/components/index.d.ts +1 -1
  43. package/dist/props/registry.d.ts +20 -0
  44. package/dist/props/registry.js +22 -0
  45. package/dist/props/vocabulary/index.d.ts +1 -1
  46. package/dist/props/vocabulary/navigation.prop.d.ts +14 -0
  47. package/dist/styles/control.css +79 -0
  48. package/dist/styles/layers.json +3 -2
  49. package/dist/styles/layout.css +22 -0
  50. package/dist/styles/table-layout.css +8 -0
  51. package/dist/tokens/components/control.css +8 -0
  52. package/dist/tokens/components/navigation.css +2 -0
  53. package/docs/data-display/progress.tsx +24 -6
  54. package/docs/data-entry/color-picker.tsx +72 -0
  55. package/docs/data-entry/select.tsx +38 -0
  56. package/docs/general/typography.tsx +84 -1
  57. package/docs/i18n/messages/en.json +47 -1
  58. package/docs/i18n/messages/ja.json +47 -1
  59. package/docs/i18n/messages/vi.json +47 -1
  60. package/docs/navigation/breadcrumb.tsx +24 -0
  61. package/package.json +2 -2
@@ -4,9 +4,10 @@ import * as React from "react";
4
4
  import { Check, Copy, LoaderCircle, Pencil } from "lucide-react";
5
5
  import { cn } from "../../lib/utils.js";
6
6
  import { useTranslation } from "../../i18n/use-translation.js";
7
- import { Tooltip, TooltipContent, TooltipTrigger } from "../feedback/tooltip.js";
7
+ import { EllipsisTooltip, Tooltip, TooltipContent, TooltipTrigger } from "../feedback/tooltip.js";
8
8
  import { Textarea } from "../data-entry/textarea.js";
9
9
  import { isDevelopment } from "../../lib/dev.js";
10
+ import { isImeComposing } from "../../lib/ime.js";
10
11
  const COPIED_RESET_MS = 3e3;
11
12
  const DECORATION_ELEMENTS = [
12
13
  ["strong", "strong"],
@@ -133,7 +134,10 @@ function TypographyEditor({
133
134
  inComposition.current = false;
134
135
  },
135
136
  onKeyDown: (event) => {
136
- if (inComposition.current) return;
137
+ if (inComposition.current || isImeComposing(event)) {
138
+ lastKey.current = null;
139
+ return;
140
+ }
137
141
  lastKey.current = event.key;
138
142
  },
139
143
  onKeyUp: (event) => {
@@ -347,7 +351,9 @@ function useTypographyBlock(props, allowRows) {
347
351
  wrapsContent,
348
352
  onTextClick: enableEdit && triggerType.includes("text") ? startEditing : void 0,
349
353
  ellipsisTooltip,
350
- isEllipsis
354
+ isEllipsis,
355
+ anchorRef: elementRef,
356
+ showsEllipsisTooltip: clamping && ellipsisTooltip !== void 0 && ellipsisTooltip !== null && ellipsisTooltip !== false && ellipsisTooltip !== ""
351
357
  };
352
358
  }
353
359
  function usesBlockBehaviour(props) {
@@ -409,7 +415,11 @@ const TextBase = React.forwardRef((props, ref) => {
409
415
  italic: _italic,
410
416
  ...rest
411
417
  } = props;
412
- const block = useTypographyBlock(props, allowRows);
418
+ const asChildElement = asChild && React.isValidElement(children) ? children : null;
419
+ const block = useTypographyBlock(
420
+ asChildElement ? { ...props, children: asChildElement.props.children } : props,
421
+ allowRows
422
+ );
413
423
  const element = as ?? component ?? "span";
414
424
  const clampLines = typeof clamp === "number" && Number.isFinite(clamp) && clamp >= 1 ? Math.floor(clamp) : void 0;
415
425
  const ellipsisRowCount = ellipsis ? ellipsisRows(ellipsis) : 0;
@@ -492,21 +502,29 @@ const TextBase = React.forwardRef((props, ref) => {
492
502
  ) : block.text,
493
503
  block.trailing
494
504
  ] });
505
+ let rendered;
495
506
  if (asChild) {
496
507
  const child = React.Children.only(children);
497
508
  const cloned = {
498
509
  ...typography,
499
510
  ...child.props,
500
- ref,
511
+ // The measuring ref too, or an `asChild` ellipsis never learns it is clipping (gh#1045).
512
+ ref: composeRefs(block.measureRef, ref),
501
513
  className: cn(typography.className, child.props.className)
502
514
  };
503
- return usesBlockBehaviour(props) ? React.cloneElement(child, cloned, body) : React.cloneElement(child, cloned);
515
+ rendered = usesBlockBehaviour(props) ? React.cloneElement(child, cloned, body) : React.cloneElement(child, cloned);
516
+ } else {
517
+ rendered = React.createElement(
518
+ element,
519
+ { ref: composeRefs(block.measureRef, ref), ...typography },
520
+ body
521
+ );
504
522
  }
505
- return React.createElement(
506
- element,
507
- { ref: composeRefs(block.measureRef, ref), ...typography },
508
- body
509
- );
523
+ if (!block.showsEllipsisTooltip) return rendered;
524
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
525
+ rendered,
526
+ /* @__PURE__ */ jsx(EllipsisTooltip, { anchorRef: block.anchorRef, title: block.ellipsisTooltip })
527
+ ] });
510
528
  });
511
529
  TextBase.displayName = "TextBase";
512
530
  const Text = React.forwardRef((props, ref) => /* @__PURE__ */ jsx(TextBase, { ref, ...props }));
@@ -615,7 +633,7 @@ const Title = React.forwardRef((props, ref) => {
615
633
  ) : block.text,
616
634
  block.trailing
617
635
  ] });
618
- return React.createElement(
636
+ const rendered = React.createElement(
619
637
  element,
620
638
  {
621
639
  ref: composeRefs(block.measureRef, ref),
@@ -635,6 +653,11 @@ const Title = React.forwardRef((props, ref) => {
635
653
  },
636
654
  body
637
655
  );
656
+ if (!block.showsEllipsisTooltip) return rendered;
657
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
658
+ rendered,
659
+ /* @__PURE__ */ jsx(EllipsisTooltip, { anchorRef: block.anchorRef, title: block.ellipsisTooltip })
660
+ ] });
638
661
  });
639
662
  Title.displayName = "Title";
640
663
  const TypographyRoot = React.forwardRef(
@@ -0,0 +1,16 @@
1
+ import { type ReactElement } from "react";
2
+ import type { BreadcrumbItemProp, BreadcrumbProp } from "../../props/vocabulary/navigation.prop.js";
3
+ /** `data-ellipsis` for the `<ol>`: present when any crumb truncates, so the trail stays one line. */
4
+ export declare function trailEllipsis(items: BreadcrumbProp): "" | undefined;
5
+ /**
6
+ * gh#1046 — one crumb's text box, bounded to one line with "…", and the full label in a tooltip on
7
+ * hover and on keyboard focus of the link. The crumb element itself is the clipped box (never a
8
+ * wrapper around it), so the link's own focus ring is not clipped. Shared with PageContainer's
9
+ * trail, which renders its own markup.
10
+ */
11
+ export declare function BreadcrumbCrumbText({ item, children, }: {
12
+ item: BreadcrumbItemProp;
13
+ children: ReactElement<{
14
+ className?: string;
15
+ }>;
16
+ }): import("react").JSX.Element;
@@ -0,0 +1,28 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { cloneElement, useRef } from "react";
4
+ import { cn } from "../../lib/utils.js";
5
+ import { EllipsisTooltip } from "../feedback/tooltip.js";
6
+ function trailEllipsis(items) {
7
+ return items.some((item) => item.ellipsis) ? "" : void 0;
8
+ }
9
+ function BreadcrumbCrumbText({
10
+ item,
11
+ children
12
+ }) {
13
+ const anchorRef = useRef(null);
14
+ if (!item.ellipsis) return children;
15
+ const tooltip = typeof item.ellipsis === "object" && "tooltip" in item.ellipsis ? item.ellipsis.tooltip === true ? item.label : item.ellipsis.tooltip : item.label;
16
+ const hasTooltip = tooltip !== void 0 && tooltip !== null && tooltip !== false && tooltip !== "";
17
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
18
+ cloneElement(children, {
19
+ ref: anchorRef,
20
+ className: cn(children.props.className, "ui-breadcrumb-ellipsis")
21
+ }),
22
+ hasTooltip ? /* @__PURE__ */ jsx(EllipsisTooltip, { anchorRef, title: tooltip }) : null
23
+ ] });
24
+ }
25
+ export {
26
+ BreadcrumbCrumbText,
27
+ trailEllipsis
28
+ };
@@ -2,6 +2,7 @@
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { ChevronDown, ChevronRight } from "lucide-react";
4
4
  import { useTranslation } from "../../i18n/use-translation.js";
5
+ import { BreadcrumbCrumbText, trailEllipsis } from "./breadcrumb-ellipsis.js";
5
6
  import {
6
7
  DropdownMenu,
7
8
  DropdownMenuContent,
@@ -17,12 +18,20 @@ function Breadcrumb({
17
18
  }) {
18
19
  const { t } = useTranslation();
19
20
  const separatorNode = separator === void 0 ? /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": "true" }) : separator;
20
- return /* @__PURE__ */ jsx("nav", { "aria-label": ariaLabel ?? t("navigation.breadcrumb.ariaLabel"), className: "ui-breadcrumb", children: /* @__PURE__ */ jsx("ol", { className: "ui-breadcrumb-list", children: items.map((item, index) => {
21
+ return /* @__PURE__ */ jsx("nav", { "aria-label": ariaLabel ?? t("navigation.breadcrumb.ariaLabel"), className: "ui-breadcrumb", children: /* @__PURE__ */ jsx("ol", { className: "ui-breadcrumb-list", "data-ellipsis": trailEllipsis(items), children: items.map((item, index) => {
21
22
  const isLast = index === items.length - 1;
22
- return /* @__PURE__ */ jsxs("li", { className: "ui-breadcrumb-item", children: [
23
- renderBreadcrumbSegment({ item, index, isLast, items, itemRender, LinkComponent }),
24
- !isLast ? /* @__PURE__ */ jsx("span", { className: "ui-breadcrumb-separator", "aria-hidden": "true", children: separatorNode }) : null
25
- ] }, item.to ?? index);
23
+ return /* @__PURE__ */ jsxs(
24
+ "li",
25
+ {
26
+ className: "ui-breadcrumb-item",
27
+ "data-ellipsis": item.ellipsis ? "" : void 0,
28
+ children: [
29
+ renderBreadcrumbSegment({ item, index, isLast, items, itemRender, LinkComponent }),
30
+ !isLast ? /* @__PURE__ */ jsx("span", { className: "ui-breadcrumb-separator", "aria-hidden": "true", children: separatorNode }) : null
31
+ ]
32
+ },
33
+ item.to ?? index
34
+ );
26
35
  }) }) });
27
36
  }
28
37
  function renderBreadcrumbSegment({
@@ -54,9 +63,9 @@ function renderBreadcrumbSegment({
54
63
  ] });
55
64
  }
56
65
  if (item.to && !isLast) {
57
- return /* @__PURE__ */ jsx(LinkComponent, { href: item.to, to: item.to, className: "ui-breadcrumb-link", children: item.label });
66
+ return /* @__PURE__ */ jsx(BreadcrumbCrumbText, { item, children: /* @__PURE__ */ jsx(LinkComponent, { href: item.to, to: item.to, className: "ui-breadcrumb-link", children: item.label }) });
58
67
  }
59
- return /* @__PURE__ */ jsx("span", { className: "ui-breadcrumb-current", "aria-current": isLast ? "page" : void 0, children: item.label });
68
+ return /* @__PURE__ */ jsx(BreadcrumbCrumbText, { item, children: /* @__PURE__ */ jsx("span", { className: "ui-breadcrumb-current", "aria-current": isLast ? "page" : void 0, children: item.label }) });
60
69
  }
61
70
  export {
62
71
  Breadcrumb
@@ -5,6 +5,7 @@ import { ChevronRight } from "lucide-react";
5
5
  import { useTranslation } from "../../i18n/use-translation.js";
6
6
  import { scrollParent, useInView } from "../../lib/hooks.js";
7
7
  import { cn } from "../../lib/utils.js";
8
+ import { BreadcrumbCrumbText, trailEllipsis } from "./breadcrumb-ellipsis.js";
8
9
  import { densityClass, pageContainerVariantClass, padStyle } from "../../lib/variants.js";
9
10
  function useFooterReveal(enabled) {
10
11
  const headerRef = useRef(null);
@@ -92,7 +93,7 @@ function PageContainerRoot({
92
93
  {
93
94
  "aria-label": breadcrumbLabel ?? breadcrumbAriaLabel ?? t("navigation.breadcrumb.ariaLabel"),
94
95
  className: "ui-breadcrumb",
95
- children: /* @__PURE__ */ jsx("ol", { className: "ui-breadcrumb-list", children: breadcrumb.map((item, i) => {
96
+ children: /* @__PURE__ */ jsx("ol", { className: "ui-breadcrumb-list", "data-ellipsis": trailEllipsis(breadcrumb), children: breadcrumb.map((item, i) => {
96
97
  const isLast = i === breadcrumb.length - 1;
97
98
  return (
98
99
  // `--space-inline-xs` gap the previous `.ui-inline-xs` gave, and it brings
@@ -100,25 +101,33 @@ function PageContainerRoot({
100
101
  // longer carries a `size-3` literal. It also drops `.ui-inline-xs`'s
101
102
  // `flex-wrap: wrap` — a crumb must not break between its label and its
102
103
  // chevron; the LIST wraps instead, exactly as <Breadcrumb> already behaves.
103
- /* @__PURE__ */ jsxs("li", { className: "ui-breadcrumb-item", children: [
104
- item.to && !isLast ? /* @__PURE__ */ jsx(
105
- LinkComponent,
106
- {
107
- href: item.to,
108
- to: item.to,
109
- className: "hover:text-foreground hover:underline",
110
- children: item.label
111
- }
112
- ) : /* @__PURE__ */ jsx(
113
- "span",
114
- {
115
- className: isLast ? "text-foreground" : "",
116
- "aria-current": isLast ? "page" : void 0,
117
- children: item.label
118
- }
119
- ),
120
- !isLast && /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": "true" })
121
- ] }, i)
104
+ /* @__PURE__ */ jsxs(
105
+ "li",
106
+ {
107
+ className: "ui-breadcrumb-item",
108
+ "data-ellipsis": item.ellipsis ? "" : void 0,
109
+ children: [
110
+ item.to && !isLast ? /* @__PURE__ */ jsx(BreadcrumbCrumbText, { item, children: /* @__PURE__ */ jsx(
111
+ LinkComponent,
112
+ {
113
+ href: item.to,
114
+ to: item.to,
115
+ className: "hover:text-foreground hover:underline",
116
+ children: item.label
117
+ }
118
+ ) }) : /* @__PURE__ */ jsx(BreadcrumbCrumbText, { item, children: /* @__PURE__ */ jsx(
119
+ "span",
120
+ {
121
+ className: isLast ? "text-foreground" : "",
122
+ "aria-current": isLast ? "page" : void 0,
123
+ children: item.label
124
+ }
125
+ ) }),
126
+ !isLast && /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": "true" })
127
+ ]
128
+ },
129
+ i
130
+ )
122
131
  );
123
132
  }) })
124
133
  }
@@ -17,6 +17,7 @@ import {
17
17
  SelectValue
18
18
  } from "../data-entry/select.js";
19
19
  import { buildPageRange } from "./pagination-utils.js";
20
+ import { isImeComposing } from "../../lib/ime.js";
20
21
  const PaginationContent = React.forwardRef(({ className, ...props }, ref) => {
21
22
  const [scrollRegion, setScrollRegion] = React.useState(null);
22
23
  const setListElement = React.useCallback(
@@ -171,7 +172,7 @@ function Pagination({
171
172
  value: jumperDraft,
172
173
  onChange: (event) => setJumperDraft(event.target.value),
173
174
  onKeyDown: (event) => {
174
- if (event.key !== "Enter") return;
175
+ if (event.key !== "Enter" || isImeComposing(event)) return;
175
176
  event.preventDefault();
176
177
  commitJump();
177
178
  }
@@ -3,6 +3,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { X } from "lucide-react";
5
5
  import { useTranslation } from "../../i18n/use-translation.js";
6
+ import { isImeComposing } from "../../lib/ime.js";
6
7
  import { cn } from "../../lib/utils.js";
7
8
  import {
8
9
  applyMaxTagCount,
@@ -62,7 +63,7 @@ const TagInput = React.forwardRef(
62
63
  const removeAt = (i) => commit(tags.filter((_, idx) => idx !== i));
63
64
  const onKeyDown = (e) => {
64
65
  if (readOnly) return;
65
- if (e.nativeEvent.isComposing) return;
66
+ if (isImeComposing(e)) return;
66
67
  if (e.key === "Enter" || tokenSeparators.includes(e.key)) {
67
68
  e.preventDefault();
68
69
  add(draft);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$comment": "AUTO-GENERATED by scripts/gen-measurement-contract.mjs — do not edit. Read this instead of guessing: docs/MEASUREMENT-CONTRACT.md.",
3
- "version": "31.6.0",
3
+ "version": "31.8.0",
4
4
  "targetSize": {
5
5
  "standard": "WCAG 2.2 SC 2.5.8 Target Size (Minimum), level AA — 24×24 CSS px",
6
6
  "min": 24,
@@ -56,7 +56,8 @@
56
56
  },
57
57
  "colorPicker": {
58
58
  "ariaLabel": "Pick color",
59
- "hexLabel": "Hex color value"
59
+ "hexLabel": "Hex color value",
60
+ "presetEmpty": "Empty"
60
61
  },
61
62
  "upload": {
62
63
  "dropzoneLabel": "Upload files",
@@ -123,7 +124,8 @@
123
124
  "clear": "Clear selection",
124
125
  "loading": "Loading…",
125
126
  "empty": "No results",
126
- "error": "Couldn’t load options"
127
+ "error": "Couldn’t load options",
128
+ "create": "Create “{value}”"
127
129
  },
128
130
  "selection": {
129
131
  "overflow": "+{count}"
@@ -350,7 +352,8 @@
350
352
  },
351
353
  "progress": {
352
354
  "ariaLabel": "Progress",
353
- "breakdownSeparator": ", "
355
+ "breakdownSeparator": ", ",
356
+ "remainder": "Remaining"
354
357
  },
355
358
  "scrollArea": {
356
359
  "region": "Scrollable region"
@@ -56,7 +56,8 @@
56
56
  },
57
57
  "colorPicker": {
58
58
  "ariaLabel": "色を選択",
59
- "hexLabel": "カラーコード(HEX)"
59
+ "hexLabel": "カラーコード(HEX)",
60
+ "presetEmpty": "空"
60
61
  },
61
62
  "upload": {
62
63
  "dropzoneLabel": "ファイルをアップロード",
@@ -123,7 +124,8 @@
123
124
  "clear": "選択をクリア",
124
125
  "loading": "読み込み中…",
125
126
  "empty": "該当なし",
126
- "error": "選択肢を読み込めませんでした"
127
+ "error": "選択肢を読み込めませんでした",
128
+ "create": "「{value}」を作成"
127
129
  },
128
130
  "selection": {
129
131
  "overflow": "他{count}件"
@@ -343,7 +345,8 @@
343
345
  },
344
346
  "progress": {
345
347
  "ariaLabel": "進捗",
346
- "breakdownSeparator": "、"
348
+ "breakdownSeparator": "、",
349
+ "remainder": "残り"
347
350
  },
348
351
  "scrollArea": {
349
352
  "region": "スクロール可能な領域"
@@ -56,7 +56,8 @@
56
56
  },
57
57
  "colorPicker": {
58
58
  "ariaLabel": "Chọn màu",
59
- "hexLabel": "Mã màu hex"
59
+ "hexLabel": "Mã màu hex",
60
+ "presetEmpty": "Trống"
60
61
  },
61
62
  "upload": {
62
63
  "dropzoneLabel": "Tải file lên",
@@ -123,7 +124,8 @@
123
124
  "clear": "Xóa lựa chọn",
124
125
  "loading": "Đang tải…",
125
126
  "empty": "Không có kết quả",
126
- "error": "Không tải được lựa chọn"
127
+ "error": "Không tải được lựa chọn",
128
+ "create": "Tạo “{value}”"
127
129
  },
128
130
  "selection": {
129
131
  "overflow": "+{count}"
@@ -344,7 +346,8 @@
344
346
  },
345
347
  "progress": {
346
348
  "ariaLabel": "Tiến độ",
347
- "breakdownSeparator": ", "
349
+ "breakdownSeparator": ", ",
350
+ "remainder": "Còn lại"
348
351
  },
349
352
  "scrollArea": {
350
353
  "region": "Vùng có thể cuộn"
@@ -0,0 +1,12 @@
1
+ import type * as React from "react";
2
+ /**
3
+ * TRUE WHILE AN IME IS COMPOSING (gh#1054). Between `compositionstart` and `compositionend` a
4
+ * Japanese / Chinese / Korean IME holds a CANDIDATE, and the Enter that confirms the conversion is
5
+ * delivered as an ordinary `keydown` — acting on it creates a tag, submits a form or picks an option
6
+ * from a half-typed reading. Every Enter (and Escape/Tab) handler in the kit asks this first.
7
+ *
8
+ * `isComposing` is the standards answer; `keyCode === 229` is the legacy one some browsers
9
+ * (Safari after `compositionend`, older Chromium on Windows) still report instead. Accepts a React
10
+ * synthetic event or a native `KeyboardEvent`.
11
+ */
12
+ export declare function isImeComposing(event: React.KeyboardEvent | KeyboardEvent): boolean;
@@ -0,0 +1,7 @@
1
+ function isImeComposing(event) {
2
+ const native = "nativeEvent" in event ? event.nativeEvent : event;
3
+ return native.isComposing || native.keyCode === 229;
4
+ }
5
+ export {
6
+ isImeComposing
7
+ };
@@ -1114,6 +1114,39 @@ export type ColorPickerProp = FieldA11yProps & {
1114
1114
  className?: ClassNameProp;
1115
1115
  id?: IdProp;
1116
1116
  showHexInput?: boolean;
1117
+ /**
1118
+ * antd `presets` (gh#1055) — named groups of fixed swatches under the picker. Each group is a
1119
+ * collapsible section (antd renders a ghost `Collapse`); `defaultOpen` (default `true`) is its
1120
+ * initial state and `key` its stable identity (falls back to the index). Each swatch is a radio
1121
+ * named by its hex; the one equal to `value` (case- and shorthand-insensitive) is checked.
1122
+ * Colours are hex strings (`#rgb`/`#rrggbb`) because the value is — antd also takes a colour
1123
+ * object or a gradient, which this picker has no model for.
1124
+ */
1125
+ presets?: ColorPickerPresetProp[];
1126
+ /**
1127
+ * antd `panelRender` — replace the picker's body. `panel` is the default body (the swatch + hex
1128
+ * row, then the presets); `extra.components` hands back each part on its own, so
1129
+ * `panelRender={(_, { components: { Presets } }) => <Presets />}` is the PRESETS-ONLY mode —
1130
+ * the palette with no free-colour entry (antd's own recipe for it). The hidden `name` input
1131
+ * is outside the panel and always submits.
1132
+ */
1133
+ panelRender?: (panel: React.ReactNode, extra: {
1134
+ components: {
1135
+ Picker: React.FC;
1136
+ Presets: React.FC;
1137
+ };
1138
+ }) => React.ReactNode;
1139
+ };
1140
+ /** One `ColorPicker presets` group — antd `PresetsItem` (gh#1055). */
1141
+ export type ColorPickerPresetProp = {
1142
+ /** Group heading; also names the group's radiogroup. */
1143
+ label: LabelProp;
1144
+ /** Hex colours (`#rgb` / `#rrggbb`), in display order. Empty → antd's "Empty" line. */
1145
+ colors: string[];
1146
+ /** Initial expanded state of the group (antd default `true`). */
1147
+ defaultOpen?: DefaultOpenProp;
1148
+ /** Stable identity of the group (antd `key`); defaults to its index. */
1149
+ key?: React.Key;
1117
1150
  };
1118
1151
  /** A SearchSelect option row. `group` buckets it under an optgroup-style heading. */
1119
1152
  export type SearchSelectOptionProp = {
@@ -1503,6 +1536,14 @@ export type SearchSelectBaseProp = {
1503
1536
  * every call site that has ever relied on the default expects a label search.
1504
1537
  */
1505
1538
  optionFilterProp?: "label" | "value" | "sublabel";
1539
+ /**
1540
+ * Match typed text case-SENSITIVELY (gh#1053). Default `false`: the built-in filter, the
1541
+ * `mode="tags"` create row and a `tokenSeparators` run all compare case-folded, so typing "bug"
1542
+ * when "Bug" exists finds "Bug" and never offers a duplicate. antd's filter folds case too; its
1543
+ * create row compares exactly, which is the deviation `true` restores. A custom `filterOption`
1544
+ * owns its own comparison and is not affected.
1545
+ */
1546
+ caseSensitive?: boolean;
1506
1547
  };
1507
1548
  /**
1508
1549
  * Single-select (the default): one `string` in, one `string` out — `""` means nothing selected.
@@ -1578,7 +1619,7 @@ export type SearchSelectMultipleProp = {
1578
1619
  * a token only counts when it matches a row; in `mode="tags"` it is accepted as it stands.
1579
1620
  */
1580
1621
  tokenSeparators?: string[];
1581
- };
1622
+ } & SelectTagsCreateProp;
1582
1623
  /**
1583
1624
  * antd `labelInValue`, single. The value carries its own label, so a screen that never sees the
1584
1625
  * option list can still render what was picked.
@@ -1612,6 +1653,30 @@ export type SelectLabelInValueMultipleProp = {
1612
1653
  index: number;
1613
1654
  disabled: boolean;
1614
1655
  }) => React.ReactNode;
1656
+ } & SelectTagsCreateProp;
1657
+ /**
1658
+ * `mode="tags"` — how typed text becomes a NEW value (gh#1052). antd has no equivalent of these
1659
+ * three: its create row is the bare text and nothing reports that a value was invented. Ignored in
1660
+ * `mode="multiple"`, which never creates.
1661
+ */
1662
+ export type SelectTagsCreateProp = {
1663
+ /**
1664
+ * Whether typed text may become a new value. `false` (or a predicate returning `false` for the
1665
+ * text) hides the create row and drops unknown `tokenSeparators` tokens — values already held
1666
+ * stay listed so they can still be removed. Default `true`.
1667
+ */
1668
+ allowCreate?: boolean | ((text: string) => boolean);
1669
+ /**
1670
+ * The create row's content. Default: the localised `Create "{text}"` (「{text}」を作成). The
1671
+ * value committed is the text itself either way; this only changes what the row says.
1672
+ */
1673
+ createLabel?: (text: string) => React.ReactNode;
1674
+ /**
1675
+ * Fired when a value that is NOT one of the options joins the selection — from the create row,
1676
+ * Enter on it, or a `tokenSeparators` run. Fires beside `onSelect`/`onValueChange`, so a consumer
1677
+ * can tell invented text apart from an option id.
1678
+ */
1679
+ onCreate?: (text: string) => void;
1615
1680
  };
1616
1681
  /** @see Select — the searchable engine. Single by default; `mode="multiple"` switches the shape. */
1617
1682
  export type SearchSelectProp = SearchSelectBaseProp & (SearchSelectSingleProp | SearchSelectMultipleProp);
@@ -1,6 +1,6 @@
1
1
  export type { AppLauncherApp, AppLauncherGroup, AppLauncherLabels, AppLauncherProp, AppShellProp, AuthFooterProp, AuthIdentityProp, OrgSwitcherLabels, OrgSwitcherOrganization, OrgSwitcherProp, DragAxisProp, DragBoundsProp, DraggablePanelLabels, DraggablePanelPlacementProp, DraggablePanelPositionProp, DraggablePanelProp, PageContainerExtraProp, PageContainerProp, PageInsetProp, SidebarItemProp, SidebarProductProp, SidebarProp, SidebarSectionProp, TopbarProp, } from "./layout.prop.js";
2
2
  export type { ButtonProp } from "./general.prop.js";
3
- export type { CommandProp, InputProp, TextareaProp, FormFieldProp, SearchInputProp, CheckboxProp, CheckboxGroupProp, ChoiceOptionProp, RadioProp, RadioGroupProp, SwitchProp, SliderProp, CalendarProp, DatePickerProp, TimePickerProp, ColorPickerProp, UploadProp, UploadFileItemProp, UploadVariantProp, TreeOptionProp, TreeFieldNamesProp, CascaderProp, TreeSelectProp, ShowCheckedStrategyProp, TransferProp, TransferItemProp, } from "./data-entry.prop.js";
3
+ export type { CommandProp, InputProp, TextareaProp, FormFieldProp, SearchInputProp, CheckboxProp, CheckboxGroupProp, ChoiceOptionProp, RadioProp, RadioGroupProp, SwitchProp, SliderProp, CalendarProp, DatePickerProp, TimePickerProp, ColorPickerProp, ColorPickerPresetProp, UploadProp, UploadFileItemProp, UploadVariantProp, TreeOptionProp, TreeFieldNamesProp, CascaderProp, TreeSelectProp, ShowCheckedStrategyProp, TransferProp, TransferItemProp, } from "./data-entry.prop.js";
4
4
  export type { AvatarProp, EmptyStateProp, DescriptionsProp, DescriptionsItemProp, BadgeProp, DataTableProp, QrCodeProp, } from "./data-display.prop.js";
5
5
  export type { ChartDatum, ChartSeriesProp, LineChartProp, BarChartProp, AreaChartProp, PieChartProp, } from "./charts.prop.js";
6
6
  export type { AlertQueryErrorProp, AuthExpiryProviderProp, AlertProp, DialogProp, DialogContentProp, AlertTitleProp, AlertContentProp, AlertDescriptionProp, AlertActionsProp, SheetResponsiveProp, SkeletonRowsProp, } from "./feedback.prop.js";
@@ -604,6 +604,11 @@ export declare const VOCABULARY_REGISTRY: {
604
604
  readonly category: "navigation";
605
605
  readonly description: "Single breadcrumb segment";
606
606
  };
607
+ readonly BreadcrumbItemEllipsisProp: {
608
+ readonly file: "vocabulary/navigation.prop.ts";
609
+ readonly category: "navigation";
610
+ readonly description: "One-line truncation of a breadcrumb segment, with the full label in a tooltip";
611
+ };
607
612
  readonly BreadcrumbProp: {
608
613
  readonly file: "vocabulary/navigation.prop.ts";
609
614
  readonly category: "navigation";
@@ -1739,6 +1744,11 @@ export declare const COMPONENT_PROP_REGISTRY: {
1739
1744
  readonly file: "components/data-entry.prop.ts";
1740
1745
  readonly vocabulary: readonly ["ValueProp", "OnValueChangeProp", "DisabledProp", "IdProp"];
1741
1746
  };
1747
+ readonly ColorPickerPresetProp: {
1748
+ readonly group: "data-entry";
1749
+ readonly file: "components/data-entry.prop.ts";
1750
+ readonly vocabulary: readonly ["LabelProp", "DefaultOpenProp"];
1751
+ };
1742
1752
  readonly SearchSelectBaseProp: {
1743
1753
  readonly group: "data-entry";
1744
1754
  readonly file: "components/data-entry.prop.ts";
@@ -1757,6 +1767,16 @@ export declare const COMPONENT_PROP_REGISTRY: {
1757
1767
  readonly vocabulary: readonly ["ValueProp", "DefaultValueProp", "OnValueChangeProp", "MaxTagCountProp", "MaxTagPlaceholderProp"];
1758
1768
  readonly note: 'Internal — the `mode="multiple"` value shape of `<Select options>`; use Select.';
1759
1769
  };
1770
+ readonly SelectTagsCreateProp: {
1771
+ readonly group: "data-entry";
1772
+ readonly file: "components/data-entry.prop.ts";
1773
+ readonly vocabulary: readonly [{
1774
+ readonly field: "onCreate";
1775
+ readonly local: true;
1776
+ readonly reason: "An EVENT, not a value channel: fires once per invented text as it joins the selection, beside onSelect/onValueChange, so a consumer can tell typed-new text from an option id (antd has no equivalent, gh#1052).";
1777
+ }];
1778
+ readonly note: 'Internal — `mode="tags"` create-row knobs (allowCreate / createLabel / onCreate, gh#1052) shared by both multi-value shapes of `<Select options>`.';
1779
+ };
1760
1780
  readonly SearchSelectProp: {
1761
1781
  readonly group: "data-entry";
1762
1782
  readonly file: "components/data-entry.prop.ts";
@@ -604,6 +604,11 @@ const VOCABULARY_REGISTRY = {
604
604
  category: "navigation",
605
605
  description: "Single breadcrumb segment"
606
606
  },
607
+ BreadcrumbItemEllipsisProp: {
608
+ file: "vocabulary/navigation.prop.ts",
609
+ category: "navigation",
610
+ description: "One-line truncation of a breadcrumb segment, with the full label in a tooltip"
611
+ },
607
612
  BreadcrumbProp: {
608
613
  file: "vocabulary/navigation.prop.ts",
609
614
  category: "navigation",
@@ -2008,6 +2013,11 @@ const COMPONENT_PROP_REGISTRY = {
2008
2013
  file: "components/data-entry.prop.ts",
2009
2014
  vocabulary: ["ValueProp", "OnValueChangeProp", "DisabledProp", "IdProp"]
2010
2015
  },
2016
+ ColorPickerPresetProp: {
2017
+ group: "data-entry",
2018
+ file: "components/data-entry.prop.ts",
2019
+ vocabulary: ["LabelProp", "DefaultOpenProp"]
2020
+ },
2011
2021
  SearchSelectBaseProp: {
2012
2022
  group: "data-entry",
2013
2023
  file: "components/data-entry.prop.ts",
@@ -2049,6 +2059,18 @@ const COMPONENT_PROP_REGISTRY = {
2049
2059
  ],
2050
2060
  note: 'Internal \u2014 the `mode="multiple"` value shape of `<Select options>`; use Select.'
2051
2061
  },
2062
+ SelectTagsCreateProp: {
2063
+ group: "data-entry",
2064
+ file: "components/data-entry.prop.ts",
2065
+ vocabulary: [
2066
+ {
2067
+ field: "onCreate",
2068
+ local: true,
2069
+ reason: "An EVENT, not a value channel: fires once per invented text as it joins the selection, beside onSelect/onValueChange, so a consumer can tell typed-new text from an option id (antd has no equivalent, gh#1052)."
2070
+ }
2071
+ ],
2072
+ note: 'Internal \u2014 `mode="tags"` create-row knobs (allowCreate / createLabel / onCreate, gh#1052) shared by both multi-value shapes of `<Select options>`.'
2073
+ },
2052
2074
  SearchSelectProp: {
2053
2075
  group: "data-entry",
2054
2076
  file: "components/data-entry.prop.ts",
@@ -3,5 +3,5 @@ export type { ClassNameProp, ChildrenProp, IdProp, OpenProp, DefaultOpenProp, On
3
3
  export type { TitleProp, SubtitleProp, StatusProp, DescriptionProp, ExtraProp, FooterProp, ActionProp, IconProp, ConfirmLabelProp, CancelLabelProp, ActionsProp, EmptyMessageProp, } from "./content.prop.js";
4
4
  export type { PageDensityProp, PageContainerVariantProp, CenteredShellWidthProp, CenteredShellAlignProp, CenteredShellPresetProp, ErrorSurfaceModeProp, ErrorSurfaceStatusProp, AuthShellPresetProp, MobileShellHeightProp, MobileShellWidthProp, OrientationProp, TableDensityProp, DensityProp, GapNameProp, PadProp, PadRawProp, PadSides, GapProp, GapStepProp, } from "./layout.prop.js";
5
5
  export type { ButtonVariantProp, ButtonSizeProp, BadgeVariantProp, AppSettingPickerAppearanceProp, AppSettingToggleAppearanceProp, ShapeProp, AvatarShapeProp, TextSizeProp, TextToneProp, FontWeightProp, HeadingLevelProp, TextAlignProp, TextWhitespaceProp, TextBreakProp, TypographyTypeProp, TitleLevelProp, TypographyCopyConfigProp, TypographyEditConfigProp, TypographyEllipsisConfigProp, TypographyActionsConfigProp, SizeProp, ControlStatusProp, ControlVariantProp, FormLayoutProp, DescriptionsLayoutProp, BreakpointProp, ConfirmVariantProp, ToneProp, AlertVariantProp, CalloutKindProp, SortDirectionProp, ColumnAlignProp, SortStateProp, RevealDelayProp, RevealTriggerProp, InViewAmountProp, ActivityVariantProp, ActivityAnnounceProp, IconSizeProp, } from "./interaction.prop.js";
6
- export type { BreadcrumbItemProp, BreadcrumbProp, BreadcrumbItemMenuProp, BreadcrumbItemMenuEntryProp, BreadcrumbSeparatorProp, BreadcrumbItemRenderProp, } from "./navigation.prop.js";
6
+ export type { BreadcrumbItemProp, BreadcrumbProp, BreadcrumbItemMenuProp, BreadcrumbItemEllipsisProp, BreadcrumbItemMenuEntryProp, BreadcrumbSeparatorProp, BreadcrumbItemRenderProp, } from "./navigation.prop.js";
7
7
  export type { GetRowIdProp, GetRowLabelProp, OnRowClickProp, ColumnDefProp, TablePresetProp, TableColumnPriorityProp, TableCellIndentProp, SelectedIdsProp, OnSelectChangeProp, OnTableDensityChangeProp, TableRowToneProp, RowToneProp, OnSortChangeProp, OnSearchChangeProp, OnClearFiltersProp, HasActiveFiltersProp, StickyProp, ColumnFixedProp, ColumnFilterValueProp, ColumnFilterItemProp, ColumnFilterStateProp, OnColumnFilterChangeProp, ColumnCompareProp, ColumnSorterProp, TableSelectionItemProp, TableSelectionBuiltInProp, TableSelectAllMatchingProp, TableRowSelectionProp, TableExpandableProp, TableSummaryProp, TableScrollProp, TableStickyProp, OnRowProp, TablePaginationProp, TablePaginationPositionProp, DescriptionsColumnProp, DescriptionsSpanProp, DescriptionsItemsProp, } from "./data.prop.js";