@godxjp/ui 20.2.1 → 22.0.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 (141) hide show
  1. package/dist/app/app-provider.js +2 -1
  2. package/dist/components/data-display/badge.d.ts +28 -1
  3. package/dist/components/data-display/badge.js +2 -0
  4. package/dist/components/data-display/chat-bubble.d.ts +30 -0
  5. package/dist/components/data-display/chat-bubble.js +229 -0
  6. package/dist/components/data-display/data-table.d.ts +18 -2
  7. package/dist/components/data-display/data-table.js +4 -0
  8. package/dist/components/data-display/descriptions.js +4 -1
  9. package/dist/components/data-display/index.d.ts +5 -3
  10. package/dist/components/data-display/index.js +5 -2
  11. package/dist/components/data-display/popover.d.ts +19 -1
  12. package/dist/components/data-display/popover.js +12 -3
  13. package/dist/components/data-display/progress.d.ts +37 -0
  14. package/dist/components/data-display/progress.js +57 -5
  15. package/dist/components/data-display/scroll-area.js +26 -1
  16. package/dist/components/data-display/tree.d.ts +8 -0
  17. package/dist/components/data-display/tree.js +426 -0
  18. package/dist/components/data-entry/chat-composer.d.ts +50 -0
  19. package/dist/components/data-entry/chat-composer.js +163 -0
  20. package/dist/components/data-entry/chat-suggestion.d.ts +28 -0
  21. package/dist/components/data-entry/chat-suggestion.js +285 -0
  22. package/dist/components/data-entry/date-picker.d.ts +10 -3
  23. package/dist/components/data-entry/date-picker.js +503 -238
  24. package/dist/components/data-entry/form-field.d.ts +1 -1
  25. package/dist/components/data-entry/form-field.js +4 -1
  26. package/dist/components/data-entry/form.js +10 -1
  27. package/dist/components/data-entry/index.d.ts +4 -6
  28. package/dist/components/data-entry/index.js +4 -6
  29. package/dist/components/data-entry/label.d.ts +14 -1
  30. package/dist/components/data-entry/label.js +6 -1
  31. package/dist/components/data-entry/radio.d.ts +27 -6
  32. package/dist/components/data-entry/radio.js +88 -43
  33. package/dist/components/data-entry/search-select.js +8 -1
  34. package/dist/components/data-entry/select.js +2 -0
  35. package/dist/components/data-entry/switch.d.ts +6 -3
  36. package/dist/components/data-entry/switch.js +34 -11
  37. package/dist/components/data-entry/textarea.js +3 -1
  38. package/dist/components/data-entry/tree-utils.d.ts +10 -48
  39. package/dist/components/data-entry/tree-utils.js +1 -154
  40. package/dist/components/layout/mobile-shell.d.ts +1 -1
  41. package/dist/components/layout/mobile-shell.js +2 -0
  42. package/dist/components/navigation/menubar.d.ts +10 -3
  43. package/dist/components/navigation/steps.d.ts +1 -1
  44. package/dist/components/navigation/steps.js +3 -1
  45. package/dist/components/navigation/tabs-scroll.d.ts +27 -0
  46. package/dist/components/navigation/tabs-scroll.js +52 -1
  47. package/dist/components/navigation/tabs.d.ts +2 -2
  48. package/dist/components/navigation/tabs.js +88 -23
  49. package/dist/components/ui/index.d.ts +0 -1
  50. package/dist/components/ui/index.js +0 -1
  51. package/dist/components/ui/segmented.d.ts +15 -1
  52. package/dist/components/ui/segmented.js +13 -6
  53. package/dist/i18n/messages/en.json +48 -2
  54. package/dist/i18n/messages/ja.json +46 -2
  55. package/dist/i18n/messages/vi.json +47 -2
  56. package/dist/lib/datetime/picker-format.d.ts +18 -0
  57. package/dist/lib/datetime/picker-format.js +35 -1
  58. package/dist/lib/field-a11y.d.ts +12 -0
  59. package/dist/lib/field-a11y.js +14 -1
  60. package/dist/lib/tree.d.ts +53 -0
  61. package/dist/lib/tree.js +155 -0
  62. package/dist/props/components/data-display.prop.d.ts +194 -1
  63. package/dist/props/components/data-entry.prop.d.ts +307 -99
  64. package/dist/props/components/index.d.ts +1 -1
  65. package/dist/props/components/layout.prop.d.ts +12 -1
  66. package/dist/props/components/navigation.prop.d.ts +76 -1
  67. package/dist/props/registry.d.ts +156 -19
  68. package/dist/props/registry.js +218 -18
  69. package/dist/props/vocabulary/data.prop.d.ts +12 -0
  70. package/dist/props/vocabulary/index.d.ts +2 -2
  71. package/dist/props/vocabulary/layout.prop.d.ts +11 -0
  72. package/dist/styles/badge-layout.css +4 -0
  73. package/dist/styles/card-layout.css +6 -6
  74. package/dist/styles/control.css +22 -6
  75. package/dist/styles/data-display-layout.css +385 -68
  76. package/dist/styles/data-entry-layout.css +64 -0
  77. package/dist/styles/focus-ring.css +4 -2
  78. package/dist/styles/navigation-layout.css +25 -0
  79. package/dist/styles/shell-layout.css +7 -1
  80. package/dist/styles/table-layout.css +34 -0
  81. package/dist/tokens/base.css +3 -0
  82. package/dist/tokens/components/chat-bubble.css +36 -0
  83. package/dist/tokens/components/chat-composer.css +19 -0
  84. package/dist/tokens/components/data-display.css +9 -6
  85. package/dist/tokens/components/descriptions.css +4 -0
  86. package/dist/tokens/components/navigation.css +6 -0
  87. package/dist/tokens/components/segmented.css +0 -2
  88. package/dist/tokens/components/shell.css +3 -0
  89. package/dist/tokens/components/table.css +3 -0
  90. package/dist/tokens/components/tree.css +27 -0
  91. package/dist/tokens/foundation.css +7 -0
  92. package/docs/COMPONENTS.md +14 -14
  93. package/docs/CONSUMER-RULES.md +24 -1
  94. package/docs/FRAME-COVERAGE-LEDGER.md +1 -1
  95. package/docs/FRAME-COVERAGE-REPORT.md +9 -7
  96. package/docs/TOKENS.md +65 -0
  97. package/docs/data-display/badge.tsx +37 -0
  98. package/docs/data-display/chat-bubble.tsx +397 -0
  99. package/docs/data-display/data-table/index.tsx +18 -0
  100. package/docs/data-display/popover.tsx +41 -1
  101. package/docs/data-display/progress.tsx +28 -0
  102. package/docs/data-display/timeline.tsx +46 -0
  103. package/docs/data-display/tree.tsx +394 -0
  104. package/docs/data-entry/calendar.tsx +2 -2
  105. package/docs/data-entry/chat-composer.tsx +464 -0
  106. package/docs/data-entry/chat-suggestion.tsx +301 -0
  107. package/docs/data-entry/date-picker.tsx +143 -3
  108. package/docs/data-entry/form/examples/invoice-form.tsx +2 -2
  109. package/docs/data-entry/form-field/examples/a11y-contract.tsx +3 -5
  110. package/docs/data-entry/form.tsx +4 -4
  111. package/docs/data-entry/number-input.tsx +31 -0
  112. package/docs/data-entry/segmented.tsx +103 -1
  113. package/docs/layout/mobile-shell.tsx +5 -0
  114. package/docs/navigation/tabs.tsx +149 -0
  115. package/docs/roadmap/ai-chat-components.md +207 -0
  116. package/docs/roadmap/antd-parity.md +155 -0
  117. package/docs/roadmap/badge-tag-chip-count.md +172 -0
  118. package/docs/roadmap/list-masonry.md +159 -0
  119. package/docs/roadmap/parity-audit-data-display-feedback.md +567 -0
  120. package/docs/roadmap/parity-audit-data-entry.md +357 -0
  121. package/docs/roadmap/parity-audit-layout-navigation-general.md +464 -0
  122. package/docs/roadmap/parity-backlog.md +78 -0
  123. package/docs/roadmap/tree-components.md +151 -0
  124. package/docs/showcase/acme-portal.tsx +7 -0
  125. package/docs/showcase/table-tree-rows.tsx +4 -4
  126. package/package.json +13 -23
  127. package/scripts/ui-audit.mjs +17 -4
  128. package/dist/components/data-display/tree-list.d.ts +0 -13
  129. package/dist/components/data-display/tree-list.js +0 -26
  130. package/dist/components/data-entry/date-range-picker.d.ts +0 -11
  131. package/dist/components/data-entry/date-range-picker.js +0 -349
  132. package/dist/components/data-entry/month-picker.d.ts +0 -10
  133. package/dist/components/data-entry/month-picker.js +0 -241
  134. package/dist/components/data-entry/month-range-picker.d.ts +0 -10
  135. package/dist/components/data-entry/month-range-picker.js +0 -301
  136. package/dist/components/ui/date-range-picker.d.ts +0 -1
  137. package/dist/components/ui/date-range-picker.js +0 -2
  138. package/docs/data-display/tree-list.tsx +0 -107
  139. package/docs/data-entry/date-range-picker.tsx +0 -175
  140. package/docs/data-entry/month-picker.tsx +0 -101
  141. package/docs/data-entry/month-range-picker.tsx +0 -115
@@ -28,7 +28,8 @@ export type ProseProp = {
28
28
  className?: ClassNameProp;
29
29
  children?: ChildrenProp;
30
30
  };
31
- import type { ActionProp, ClassNameProp, DescriptionProp, IconProp, TitleProp, ColumnDefProp, GetRowIdProp, OnRowClickProp, OnSelectChangeProp, OnSortChangeProp, OnTableDensityChangeProp, SelectedIdsProp, SortStateProp, TableDensityProp, TablePresetProp, BreakpointProp, DensityProp, ChildrenProp, ToneProp, AvatarShapeProp, HeadingLevelProp, HandlerProp, SizeProp, LabelProp, IdProp, DescriptionsLayoutProp, DescriptionsColumnProp, DescriptionsSpanProp, DescriptionsItemsProp, SortDirectionProp, OnColumnFilterChangeProp, OnRowProp, TableExpandableProp, TableRowSelectionProp, TableScrollProp, TableStickyProp, TableSummaryProp } from "../vocabulary/index.js";
31
+ import type { ActionProp, ClassNameProp, DescriptionProp, IconProp, TitleProp, ColumnDefProp, GetRowIdProp, OnRowClickProp, OnSelectChangeProp, OnSortChangeProp, OnTableDensityChangeProp, SelectedIdsProp, SortStateProp, TableDensityProp, TablePresetProp, BreakpointProp, DensityProp, ChildrenProp, PendingProp, ToneProp, AvatarShapeProp, HeadingLevelProp, HandlerProp, SizeProp, LabelProp, IdProp, DescriptionsLayoutProp, DescriptionsColumnProp, DescriptionsSpanProp, DescriptionsItemsProp, SortDirectionProp, OnColumnFilterChangeProp, OnRowProp, TableExpandableProp, TableRowSelectionProp, TableScrollProp, TableStickyProp, TableSummaryProp, DisabledProp, ValueProp, DefaultValueProp, OnValueChangeProp } from "../vocabulary/index.js";
32
+ import type { TreeFieldNamesProp, TreeOptionProp } from "./data-entry.prop.js";
32
33
  /**
33
34
  * One key in a `Legend`: a tone, and the words that tone stands for.
34
35
  *
@@ -186,6 +187,13 @@ export type BadgeProp = {
186
187
  icon?: React.ComponentType<{
187
188
  className?: string;
188
189
  }> | null;
190
+ /**
191
+ * Lining, fixed-width figures — for a chip whose content is a COUNT sitting in a column with
192
+ * other counts. The same axis `Text`, `TableCell` and `StatCard` already carry; its absence here
193
+ * was an asymmetry, not a decision. Off by default, because tabular figures are wider and a chip
194
+ * carrying words should not pay for them.
195
+ */
196
+ tabular?: boolean;
189
197
  className?: ClassNameProp;
190
198
  children?: ChildrenProp;
191
199
  };
@@ -493,3 +501,188 @@ export type TimelineGridProp = {
493
501
  className?: ClassNameProp;
494
502
  id?: IdProp;
495
503
  };
504
+ /**
505
+ * @see Tree — one node of the standalone, on-page tree view.
506
+ *
507
+ * Structurally the same node `TreeSelect`/`Cascader` take (one tree model, two surfaces — the
508
+ * normalizer lives in `src/lib/tree.ts`), plus the per-node glyph the ON-PAGE surface needs and a
509
+ * dropdown does not.
510
+ */
511
+ export type TreeNodeProp = TreeOptionProp & {
512
+ /** Glyph drawn before the label when `showIcon` is on. Decorative — the label carries the name. */
513
+ icon?: React.ReactNode;
514
+ children?: TreeNodeProp[];
515
+ };
516
+ /**
517
+ * @see Tree — the WAI-ARIA APG "Tree View" on a page (Ant's `Tree` / `DirectoryTree`).
518
+ *
519
+ * `TreeSelect` is the same hierarchy inside a Popover. A flat indented list only LOOKS like a tree
520
+ * (that was `TreeList`, removed in 21.0.0 with `Tree` as its replacement), so reach for `Tree`
521
+ * whenever nodes expand, collapse, or are navigated by keyboard.
522
+ *
523
+ * Ant's key-shaped names are mapped onto this package's controlled vocabulary and NOT re-spelled:
524
+ * selection is `value`/`defaultValue`/`onValueChange`, expansion is
525
+ * `expandedValues`/`defaultExpandedValues`/`onExpandedValuesChange`, checks are
526
+ * `checkedValues`/`defaultCheckedValues`/`onCheckedValuesChange`.
527
+ * @see docs/roadmap/tree-components.md §3
528
+ */
529
+ export type TreeProp = {
530
+ /** The hierarchy (antd `treeData`). Use `fieldNames` to remap keys off an API response. */
531
+ treeData: readonly TreeNodeProp[];
532
+ /** Remap the data's own key names (antd `fieldNames`). */
533
+ fieldNames?: TreeFieldNamesProp;
534
+ /** Controlled selection. `string` while single, `string[]` once `multiple` is on. */
535
+ value?: ValueProp<string | string[]>;
536
+ /** Uncontrolled initial selection (controlled-triad rule). */
537
+ defaultValue?: DefaultValueProp<string | string[]>;
538
+ /** Selection change. Emits `string | undefined` while single, `string[]` once `multiple` is on. */
539
+ onValueChange?: OnValueChangeProp<string | string[] | undefined>;
540
+ /** Allow more than one selected node (antd `multiple`). Also sets `aria-multiselectable`. */
541
+ multiple?: boolean;
542
+ /** Draw a checkbox on every node (antd `checkable`). Checks are a SEPARATE axis from selection. */
543
+ checkable?: boolean;
544
+ /** Parent and child checks are independent (antd `checkStrictly`) — no cascade, no `mixed`. */
545
+ checkStrictly?: boolean;
546
+ /** Controlled checked nodes (antd `checkedKeys`). */
547
+ checkedValues?: readonly string[];
548
+ /** Uncontrolled initial checked nodes (antd `defaultCheckedKeys`). */
549
+ defaultCheckedValues?: readonly string[];
550
+ /** Checked-set change (antd `onCheck`). Fires for controlled and uncontrolled trees alike. */
551
+ onCheckedValuesChange?: (values: string[]) => void;
552
+ /** Controlled expanded branches (antd `expandedKeys`). */
553
+ expandedValues?: readonly string[];
554
+ /** Uncontrolled initial expanded branches (antd `defaultExpandedKeys`). */
555
+ defaultExpandedValues?: readonly string[];
556
+ /** Expansion change (antd `onExpand`). Fires for controlled and uncontrolled trees alike. */
557
+ onExpandedValuesChange?: (values: string[]) => void;
558
+ /** Start with every branch open (antd `defaultExpandAll`). Seeded once, never re-applied. */
559
+ defaultExpandAll?: boolean;
560
+ /**
561
+ * Lazy children (antd `loadData`). Called ONCE per node the first time a branch with no
562
+ * `children` and `isLeaf !== true` is expanded; push the fetched children into `treeData`.
563
+ */
564
+ loadData?: (node: TreeNodeProp) => void | Promise<void>;
565
+ /** Render a node's title (antd `titleRender`). */
566
+ titleRender?: (node: TreeNodeProp) => React.ReactNode;
567
+ /** Draw the connector rails between a parent and its children (antd `showLine`). */
568
+ showLine?: boolean;
569
+ /** Draw each node's `icon` (antd `showIcon`). `variant="directory"` supplies folder/file glyphs. */
570
+ showIcon?: boolean;
571
+ /** `directory` is antd's `<DirectoryTree>`: folder/file glyphs and a full-row selected band. */
572
+ variant?: "default" | "directory";
573
+ /** Row height tier — the shared `--control-height` ladder. Default `md`. */
574
+ size?: SizeProp;
575
+ /** Disable the whole tree: nothing selects, checks or expands; nodes stay readable. */
576
+ disabled?: DisabledProp;
577
+ className?: ClassNameProp;
578
+ id?: IdProp;
579
+ /** Accessible name of the `role="tree"` container. Required unless `aria-labelledby` is given. */
580
+ "aria-label"?: string;
581
+ "aria-labelledby"?: string;
582
+ };
583
+ /**
584
+ * @see ChatBubble — which side of the conversation the message sits on. LOGICAL, not physical:
585
+ * `start` is the inline start of the reading direction (left in `ltr`, right in `rtl`), so a feed
586
+ * flips correctly under `dir="rtl"` with no per-locale branch. `start` = the other party,
587
+ * `end` = the reader's own messages, which is the convention every chat client shares.
588
+ */
589
+ export type ChatBubblePlacementProp = "start" | "end";
590
+ /**
591
+ * @see ChatBubble — STRUCTURAL treatment of the message body, orthogonal to `tone` (which owns
592
+ * colour). Ant Design X's `shadow` is deliberately absent: this design system is a 1px-border
593
+ * system with no drop shadows (docs/TOKENS.md).
594
+ *
595
+ * - `filled` (default) — the quiet `--chat-bubble-background` wash.
596
+ * - `outlined` — transparent body inside a 1px `--chat-bubble-border-color` edge.
597
+ * - `borderless` — no fill and no edge; long assistant prose that should read as page copy.
598
+ */
599
+ export type ChatBubbleVariantProp = "filled" | "borderless" | "outlined";
600
+ /**
601
+ * @see ChatBubble — status intent for a message that is not ordinary conversation (a failed send,
602
+ * a rate-limit warning, a tool result). A subset of `ToneProp`: `muted` and `neutral` are not
603
+ * offered because a bubble is already the quiet surface, so they would name no distinct state.
604
+ *
605
+ * Never colour alone (WCAG 1.4.1): a toned bubble also renders a localized `sr-only` tone word.
606
+ */
607
+ export type ChatBubbleToneProp = Extract<ToneProp, "default" | "info" | "success" | "warning" | "destructive">;
608
+ /**
609
+ * @see ChatBubble — the streaming type-on animation. `true` takes the defaults (1 character every
610
+ * 50ms); the object form retunes them per instance.
611
+ *
612
+ * It animates only when `children` is a plain string — a `ReactNode` has no character count to
613
+ * reveal — and it is DROPPED ENTIRELY under `prefers-reduced-motion: reduce`, which renders the
614
+ * full text immediately (WCAG 2.2 SC 2.3.3).
615
+ */
616
+ export type ChatBubbleTypingProp = boolean | {
617
+ step?: number;
618
+ interval?: number;
619
+ };
620
+ /** @see ChatBubble — one message in a conversation. */
621
+ export type ChatBubbleProp = {
622
+ /** The message. A `ReactNode`; pass a plain string to make `typing` animatable. */
623
+ children?: ChildrenProp;
624
+ /** Which side of the feed the message sits on. Default `start`. */
625
+ placement?: ChatBubblePlacementProp;
626
+ /** Structural treatment of the body. Default `filled`. */
627
+ variant?: ChatBubbleVariantProp;
628
+ /**
629
+ * The author's mark — a real `<Avatar>` node, never a styled div. It is decorative when the
630
+ * `header` already names the author, so mark it `aria-hidden` at the call site.
631
+ */
632
+ avatar?: ChildrenProp;
633
+ /**
634
+ * Line above the body — the author, and anything that identifies the turn. When it is present
635
+ * the bubble takes its ACCESSIBLE NAME from it, so keep it text.
636
+ */
637
+ header?: ChildrenProp;
638
+ /** Line below the body — timestamps, per-message actions, token counts. */
639
+ footer?: ChildrenProp;
640
+ /** The reply has been requested and has not arrived: renders `Skeleton`, sets `aria-busy`. */
641
+ loading?: PendingProp;
642
+ /** Stream the text in character by character. Honours `prefers-reduced-motion`. */
643
+ typing?: ChatBubbleTypingProp;
644
+ /** Type step and inner inset. Default `md`. */
645
+ size?: SizeProp;
646
+ /** Status intent. Default `default`. */
647
+ tone?: ChatBubbleToneProp;
648
+ className?: ClassNameProp;
649
+ id?: IdProp;
650
+ };
651
+ /** @see ChatBubbleList — one entry of the feed: a `ChatBubble`'s own props plus its identity. */
652
+ export type ChatMessageProp = Omit<ChatBubbleProp, "children" | "id"> & {
653
+ /** Stable message id. Also the React key and the rendered `<article>`'s DOM id. */
654
+ id: IdProp;
655
+ /** Key into the list's `roles` map — `"user"`, `"assistant"`, `"system"`, or your own. */
656
+ role?: string;
657
+ /** The message body. Named `content` here because `children` is not a data field. */
658
+ content?: ChildrenProp;
659
+ };
660
+ /**
661
+ * @see ChatBubbleList — the message feed.
662
+ *
663
+ * It scrolls inside itself, so it needs a DEFINITE height from the caller (`className="h-96"`, or
664
+ * a flex/grid parent that gives it a track). Without one it grows to its content and nothing ever
665
+ * overflows, which silently disables `autoScroll` and the jump-to-latest affordance.
666
+ */
667
+ export type ChatBubbleListProp = {
668
+ /** Messages in conversation order, oldest first. */
669
+ items: readonly ChatMessageProp[];
670
+ /**
671
+ * Per-role bubble defaults, merged UNDER each message's own props. This is what keeps a feed
672
+ * consistent: `{ assistant: { placement: "start", variant: "filled" }, user: { placement:
673
+ * "end" } }` is written once instead of on every message.
674
+ */
675
+ roles?: Record<string, Partial<ChatBubbleProp>>;
676
+ /**
677
+ * Keep the newest message in view while the reader is already at the bottom. Default `true`.
678
+ *
679
+ * It is NOT "scroll to the bottom when content arrives": the moment the reader scrolls up the
680
+ * pin is revoked and a focusable "jump to latest" affordance appears instead, because yanking a
681
+ * reader back mid-sentence is a change of context they did not request (WCAG 3.2.5).
682
+ */
683
+ autoScroll?: boolean;
684
+ /** Accessible name of the feed. A plain string — it lands on `aria-label`. Defaults via `t()`. */
685
+ label?: Extract<LabelProp, string>;
686
+ className?: ClassNameProp;
687
+ id?: IdProp;
688
+ };