@godxjp/ui 23.2.1 → 23.4.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 (101) hide show
  1. package/dist/app/timezones.js +2 -1
  2. package/dist/components/charts/chart-cartesian.js +2 -4
  3. package/dist/components/charts/chart-frame.js +2 -1
  4. package/dist/components/data-display/card.d.ts +87 -1
  5. package/dist/components/data-display/card.js +88 -15
  6. package/dist/components/data-display/index.d.ts +5 -1
  7. package/dist/components/data-display/index.js +5 -0
  8. package/dist/components/data-display/thought-chain.d.ts +42 -0
  9. package/dist/components/data-display/thought-chain.js +177 -0
  10. package/dist/components/data-display/welcome.d.ts +26 -0
  11. package/dist/components/data-display/welcome.js +37 -0
  12. package/dist/components/data-entry/attachments.d.ts +19 -0
  13. package/dist/components/data-entry/attachments.js +322 -0
  14. package/dist/components/data-entry/date-picker.js +12 -14
  15. package/dist/components/data-entry/index.d.ts +2 -0
  16. package/dist/components/data-entry/index.js +2 -0
  17. package/dist/components/data-entry/number-input.js +2 -1
  18. package/dist/components/feedback/dialog.d.ts +10 -7
  19. package/dist/components/feedback/dialog.js +40 -17
  20. package/dist/components/feedback/index.d.ts +3 -3
  21. package/dist/components/feedback/index.js +2 -0
  22. package/dist/components/feedback/skeleton.d.ts +11 -2
  23. package/dist/components/feedback/skeleton.js +8 -0
  24. package/dist/components/general/actions.d.ts +59 -0
  25. package/dist/components/general/actions.js +253 -0
  26. package/dist/components/general/activity.js +1 -0
  27. package/dist/components/general/button.js +2 -1
  28. package/dist/components/general/float-button.d.ts +41 -0
  29. package/dist/components/general/float-button.js +336 -0
  30. package/dist/components/general/index.d.ts +6 -2
  31. package/dist/components/general/index.js +12 -1
  32. package/dist/components/general/typography.d.ts +79 -4
  33. package/dist/components/general/typography.js +598 -54
  34. package/dist/components/layout/draggable-panel.d.ts +18 -0
  35. package/dist/components/layout/draggable-panel.js +189 -0
  36. package/dist/components/layout/error-surface.js +3 -2
  37. package/dist/components/layout/index.d.ts +2 -0
  38. package/dist/components/layout/index.js +2 -0
  39. package/dist/components/navigation/conversations.d.ts +39 -0
  40. package/dist/components/navigation/conversations.js +371 -0
  41. package/dist/components/navigation/index.d.ts +2 -0
  42. package/dist/components/navigation/index.js +2 -0
  43. package/dist/components/ui/card.js +1 -0
  44. package/dist/components/ui/toggle.js +2 -1
  45. package/dist/i18n/messages/en.json +53 -0
  46. package/dist/i18n/messages/ja.json +53 -0
  47. package/dist/i18n/messages/vi.json +53 -0
  48. package/dist/i18n/translate.js +3 -2
  49. package/dist/lib/datetime/picker-format.js +2 -1
  50. package/dist/lib/format.js +3 -2
  51. package/dist/lib/intl-cache.d.ts +32 -0
  52. package/dist/lib/intl-cache.js +29 -0
  53. package/dist/props/components/data-display.prop.d.ts +143 -1
  54. package/dist/props/components/data-entry.prop.d.ts +87 -0
  55. package/dist/props/components/feedback.prop.d.ts +53 -1
  56. package/dist/props/components/general.prop.d.ts +440 -3
  57. package/dist/props/components/index.d.ts +2 -2
  58. package/dist/props/components/layout.prop.d.ts +63 -1
  59. package/dist/props/components/navigation.prop.d.ts +150 -0
  60. package/dist/props/registry.d.ts +431 -0
  61. package/dist/props/registry.js +551 -0
  62. package/dist/props/vocabulary/index.d.ts +1 -1
  63. package/dist/props/vocabulary/interaction.prop.d.ts +113 -0
  64. package/dist/styles/alert-layout.css +22 -0
  65. package/dist/styles/card-layout.css +34 -0
  66. package/dist/styles/core.css +1 -0
  67. package/dist/styles/data-display-layout.css +236 -0
  68. package/dist/styles/float-button-layout.css +168 -0
  69. package/dist/styles/form-layout.css +11 -1
  70. package/dist/styles/index.css +1 -0
  71. package/dist/styles/layout.css +196 -0
  72. package/dist/styles/navigation-layout.css +139 -0
  73. package/dist/styles/text-layout.css +156 -0
  74. package/dist/tokens/axes.css +5 -0
  75. package/dist/tokens/base.css +7 -0
  76. package/dist/tokens/components/actions.css +14 -0
  77. package/dist/tokens/components/attachments.css +15 -0
  78. package/dist/tokens/components/conversations.css +28 -0
  79. package/dist/tokens/components/draggable-panel.css +25 -0
  80. package/dist/tokens/components/float-button.css +39 -0
  81. package/dist/tokens/components/text.css +13 -0
  82. package/dist/tokens/components/thought-chain.css +31 -0
  83. package/dist/tokens/components/welcome.css +19 -0
  84. package/dist/tokens/foundation.css +6 -4
  85. package/docs/DESIGN-AUTHORITY.md +133 -20
  86. package/docs/FRAME-COVERAGE-REPORT.md +5 -2
  87. package/docs/data-display/card/examples/tab-list.tsx +97 -0
  88. package/docs/data-display/thought-chain.tsx +176 -0
  89. package/docs/data-display/welcome.tsx +115 -0
  90. package/docs/data-entry/attachments.tsx +160 -0
  91. package/docs/feedback/dialog.tsx +50 -0
  92. package/docs/general/actions.tsx +175 -0
  93. package/docs/general/float-button.tsx +133 -0
  94. package/docs/general/typography.tsx +63 -1
  95. package/docs/layout/draggable-panel.tsx +127 -0
  96. package/docs/navigation/conversations.tsx +176 -0
  97. package/docs/roadmap/parity-audit-layout-navigation-general.md +17 -16
  98. package/package.json +20 -4
  99. package/scripts/_agent-setup.mjs +36 -5
  100. package/scripts/guinea-pig-skill.md +14 -0
  101. package/scripts/ui-audit.mjs +69 -9
@@ -1,7 +1,7 @@
1
1
  /** Layout component prop types — @see docs/COMPONENTS.md#layout */
2
2
  import type * as React from "react";
3
3
  import type { ComponentType, ReactNode, SVGProps } from "react";
4
- import type { BreadcrumbProp, TitleProp, SubtitleProp, StatusProp, ExtraProp, FooterProp, PageDensityProp, PageContainerVariantProp, CenteredShellWidthProp, CenteredShellAlignProp, CenteredShellPresetProp, ErrorSurfaceModeProp, ErrorSurfaceStatusProp, AuthShellPresetProp, MobileShellHeightProp, MobileShellWidthProp, OrientationProp, TextAlignProp, TextToneProp, BreakpointProp, GapProp, PadProp, PadRawProp, ClassNameProp, ChildrenProp, IdProp, DisabledProp, DescriptionProp, ActionProp, IconProp, HeadingLevelProp, ToneProp, WidthProp } from "../vocabulary/index.js";
4
+ import type { BreadcrumbProp, TitleProp, SubtitleProp, StatusProp, ExtraProp, FooterProp, PageDensityProp, PageContainerVariantProp, CenteredShellWidthProp, CenteredShellAlignProp, CenteredShellPresetProp, ErrorSurfaceModeProp, ErrorSurfaceStatusProp, AuthShellPresetProp, MobileShellHeightProp, MobileShellWidthProp, OrientationProp, TextAlignProp, TextToneProp, BreakpointProp, GapProp, PadProp, PadRawProp, ClassNameProp, ChildrenProp, IdProp, DisabledProp, DescriptionProp, ActionProp, IconProp, HeadingLevelProp, ToneProp, WidthProp, SizeProp } from "../vocabulary/index.js";
5
5
  import type { EmptyStateToneProp } from "./data-display.prop.js";
6
6
  /**
7
7
  * Arrangement of the page header's title band and its `extra` slot below the 640px step.
@@ -1418,3 +1418,65 @@ export type ServiceRolePanelProp = {
1418
1418
  id?: IdProp;
1419
1419
  className?: ClassNameProp;
1420
1420
  };
1421
+ /**
1422
+ * Which axis a `DraggablePanel` moves on. react-draggable's `axis`, ported verbatim including
1423
+ * `"none"` (mounted, but pinned where it started).
1424
+ */
1425
+ export type DragAxisProp = "both" | "x" | "y" | "none";
1426
+ /**
1427
+ * How far a `DraggablePanel` may travel. react-draggable's `bounds`, trimmed to the two forms that
1428
+ * survive this library's rules: `"viewport"` keeps the whole panel on screen, `"none"` lets it go
1429
+ * anywhere. react-draggable also accepts `'parent'`, a CSS selector and a `{left, top, right,
1430
+ * bottom}` object — the selector is a back door into internal DOM (the layer
1431
+ * docs/DESIGN-AUTHORITY.md refuses alongside antd's `components` / `prefixCls`), and the object is
1432
+ * spelled in PHYSICAL directions, which cannot mirror for an RTL locale.
1433
+ */
1434
+ export type DragBoundsProp = "viewport" | "none";
1435
+ /** Resting corner of a `DraggablePanel`, in logical directions so it mirrors under RTL. */
1436
+ export type DraggablePanelPlacementProp = "top-start" | "top-end" | "bottom-start" | "bottom-end";
1437
+ /**
1438
+ * Offset from the resting corner, in CSS pixels, on the PHYSICAL axes — the same frame the pointer
1439
+ * reports in, so no RTL sign flip exists to get wrong. react-draggable's `{x, y}`.
1440
+ */
1441
+ export type DraggablePanelPositionProp = {
1442
+ x: number;
1443
+ y: number;
1444
+ };
1445
+ /**
1446
+ * @see DraggablePanel — a floating surface the person using it can MOVE, so a docked assistant
1447
+ * stops covering the thing they are asking about.
1448
+ *
1449
+ * The movement props take react-draggable's names, because react-draggable is what antd's own
1450
+ * "Draggable Modal" demo prescribes and antd has no component of its own for this. The library is
1451
+ * NOT a dependency here: the drag is the repo's existing window-level pointer pattern.
1452
+ */
1453
+ export type DraggablePanelProp = Omit<React.HTMLAttributes<HTMLElement>, "title" | "children" | "onDrag"> & {
1454
+ /** Panel name. A string also becomes the region's accessible name. */
1455
+ title: TitleProp;
1456
+ children?: ChildrenProp;
1457
+ /** Trailing slot in the title bar, before the close control. */
1458
+ extra?: ExtraProp;
1459
+ /** Resting corner before any movement. Default `bottom-end`. */
1460
+ placement?: DraggablePanelPlacementProp;
1461
+ /** Panel width, from the token scale. Default `md`. */
1462
+ width?: Extract<SizeProp, "sm" | "md" | "lg">;
1463
+ /** react-draggable `axis`. Default `both`. */
1464
+ axis?: DragAxisProp;
1465
+ /** react-draggable `bounds`. Default `viewport`. */
1466
+ bounds?: DragBoundsProp;
1467
+ /** react-draggable `position` — controlled offset. Pair with `onPositionChange`. */
1468
+ position?: DraggablePanelPositionProp;
1469
+ /** react-draggable `defaultPosition` — starting offset when uncontrolled. */
1470
+ defaultPosition?: DraggablePanelPositionProp;
1471
+ /**
1472
+ * Fires with the clamped offset after every pointer frame and every keyboard nudge. The panel
1473
+ * REPORTS its position and never stores it: where it is remembered, and per what scope, is the
1474
+ * consumer's decision.
1475
+ */
1476
+ onPositionChange?: (position: DraggablePanelPositionProp) => void;
1477
+ /** Presence renders the close control in the title bar (antd Modal's `onCancel`). */
1478
+ onClose?: () => void;
1479
+ /** react-draggable `disabled` — the panel stays, the handle stops moving it. */
1480
+ disabled?: DisabledProp;
1481
+ className?: ClassNameProp;
1482
+ };
@@ -466,3 +466,153 @@ export type TabsProp = {
466
466
  listClassName?: ClassNameProp;
467
467
  contentClassName?: ClassNameProp;
468
468
  };
469
+ /**
470
+ * One conversation in the rail. Ant Design X `ConversationItemType`, field for field:
471
+ * `key`, `label`, `group`, `icon`, `disabled`.
472
+ *
473
+ * `key` is `string` and REQUIRED, as it is in Ant X — the rail's whole contract (which row is
474
+ * active, which row a menu command was aimed at, which row the roving tabindex is parked on) is
475
+ * addressed by it, and an optional identity would make every one of those "probably this one".
476
+ * @see Conversations
477
+ */
478
+ /**
479
+ * One row. Ant Design X calls this `Conversation` and this type carries every field of it.
480
+ *
481
+ * THREE ANT DESIGN X PROPS ARE DELIBERATELY ABSENT from `ConversationsProp`, and under
482
+ * `docs/DESIGN-AUTHORITY.md` an undocumented deviation is a bug, so here are the reasons:
483
+ * `styles`, `classNames` and `rootClassName` are antd's per-part style escape hatches. This
484
+ * library's equivalent is the token tier — a service retunes every Conversations list at once by
485
+ * rebinding `--conversations-*`, and `check:no-hardcoded-css-values` plus the CONSUMER-RULES ban
486
+ * on utility classes exist precisely so a call site cannot paint one list differently from its
487
+ * neighbours. Accepting them would hand back the thing those gates are for.
488
+ */
489
+ export type ConversationsItemProp = {
490
+ /** Unique identity of the conversation. Ant Design X `key`. */
491
+ key: string;
492
+ /** What the row reads. Ant Design X `label`. */
493
+ label?: React.ReactNode;
494
+ /** Bucket this row belongs to, honoured only while `groupable` is on. Ant Design X `group`. */
495
+ group?: string;
496
+ /** Decorative leading node. Ant Design X `icon`. */
497
+ icon?: React.ReactNode;
498
+ /** Row stays visible and reachable by arrow key, but cannot be activated. Ant Design X `disabled`. */
499
+ disabled?: DisabledProp;
500
+ /**
501
+ * When the conversation last moved, as an epoch milliseconds number — Ant Design X `timestamp`.
502
+ *
503
+ * A NUMBER, not a formatted string, and that is the whole point: the row renders it through the
504
+ * app's own locale and timezone from `AppProvider`, so a Japanese tenant reads 2026/03/15 and a
505
+ * Vietnamese one reads 15/03/2026 from the SAME data. Handing the component a pre-formatted
506
+ * string is what `docs/DATETIME.md` rule 1 forbids, and it is the reason this prop is not
507
+ * `ReactNode` even though every other field here is.
508
+ */
509
+ timestamp?: number;
510
+ };
511
+ /**
512
+ * A rule between two runs of conversations. Ant Design X `DividerItemType`.
513
+ * @see Conversations
514
+ */
515
+ export type ConversationsDividerProp = {
516
+ type: "divider";
517
+ key?: string;
518
+ /** Ant Design X `dashed`. */
519
+ dashed?: boolean;
520
+ };
521
+ /** Either kind of row `items` accepts. Ant Design X `ItemType`. @see Conversations */
522
+ export type ConversationsEntryProp = ConversationsItemProp | ConversationsDividerProp;
523
+ /**
524
+ * One command on a row's overflow menu — rename, duplicate, delete.
525
+ * @see Conversations
526
+ */
527
+ export type ConversationsMenuItemProp = {
528
+ /** Identity handed back to `menu.onClick`. */
529
+ key: string;
530
+ label: React.ReactNode;
531
+ icon?: React.ReactNode;
532
+ /** Paints the command as irreversible (`DropdownMenuItem variant="destructive"`). Ant Design `danger`. */
533
+ danger?: boolean;
534
+ disabled?: DisabledProp;
535
+ };
536
+ /**
537
+ * The per-row overflow menu. Ant Design X takes antd's whole `MenuProps` here; this takes the two
538
+ * fields of it a conversation rail uses — the commands, and where a click lands — plus the
539
+ * accessible name the icon-only trigger needs and Ant X never had.
540
+ * @see Conversations
541
+ */
542
+ export type ConversationsMenuProp = {
543
+ items: readonly ConversationsMenuItemProp[];
544
+ /** Fires with the command and the row it was aimed at. */
545
+ onClick?: (info: {
546
+ key: string;
547
+ conversation: ConversationsItemProp;
548
+ }) => void;
549
+ /**
550
+ * Accessible name of the icon-only trigger. Receives the row so the name can name it
551
+ * ("More actions for 請求書の下書き"), which is what keeps twelve identical "More" buttons apart
552
+ * in a screen reader's element list. A localized default applies when omitted.
553
+ */
554
+ triggerLabel?: (conversation: ConversationsItemProp) => string;
555
+ };
556
+ /**
557
+ * Grouping options. Ant Design X `GroupableProps` — `label`, `collapsible`, and the
558
+ * `defaultExpandedKeys` / `expandedKeys` / `onExpand` triad it inherits from `CollapsibleOptions`.
559
+ * @see Conversations
560
+ */
561
+ export type ConversationsGroupableProp = {
562
+ /** Heading for a bucket. A function receives the raw `group` string. Ant Design X `label`. */
563
+ label?: React.ReactNode | ((group: string) => React.ReactNode);
564
+ /** Whether a bucket's heading collapses it. A function decides per bucket. Ant Design X `collapsible`. */
565
+ collapsible?: boolean | ((group: string) => boolean);
566
+ /** Uncontrolled initially-open buckets. Ant Design X `defaultExpandedKeys`. */
567
+ defaultExpandedKeys?: readonly string[];
568
+ /** Controlled open buckets. Ant Design X `expandedKeys`. */
569
+ expandedKeys?: readonly string[];
570
+ /** Fires with the next open set. Ant Design X `onExpand`. */
571
+ onExpand?: (keys: string[]) => void;
572
+ };
573
+ /**
574
+ * The "new conversation" button pinned above the rail. Ant Design X `creation`.
575
+ * @see Conversations
576
+ */
577
+ export type ConversationsCreationProp = {
578
+ /** Button text. A localized default applies when omitted. Ant Design X `label`. */
579
+ label?: React.ReactNode;
580
+ /** Leading glyph. Defaults to a plus. Ant Design X `icon`. */
581
+ icon?: React.ReactNode;
582
+ disabled?: DisabledProp;
583
+ onClick?: () => void;
584
+ };
585
+ /**
586
+ * @see Conversations — the session rail of a chat surface (Ant Design X `Conversations`): the list
587
+ * of past conversations, the current one marked, a per-row overflow menu, and recency buckets.
588
+ *
589
+ * Ant X's own rail is a bare `<ul>` of `<li onClick>` with no roles, no `tabIndex` and no key
590
+ * handling — measured in `@ant-design/x@2.9.0`, `es/conversations/Item.js` renders a `<li>` whose
591
+ * only interactive affordance is `onClick`. That is the half of it this port does NOT copy: the
592
+ * rows here are real `Button`s under a single roving tabindex, so the whole rail is ONE tab stop
593
+ * and ↑/↓/Home/End move between conversations. Everything a caller passes keeps Ant X's spelling.
594
+ */
595
+ export type ConversationsProp = {
596
+ /** The rows. Ant Design X `items`. */
597
+ items?: readonly ConversationsEntryProp[];
598
+ /** Controlled selection. Ant Design X `activeKey`. */
599
+ activeKey?: string;
600
+ /** Uncontrolled initial selection. Ant Design X `defaultActiveKey`. */
601
+ defaultActiveKey?: string;
602
+ /** Fires with the picked key and the entry behind it. Ant Design X `onActiveChange`. */
603
+ onActiveChange?: (key: string, item?: ConversationsEntryProp) => void;
604
+ /** One menu for every row, or a function returning the menu for one. Ant Design X `menu`. */
605
+ menu?: ConversationsMenuProp | ((conversation: ConversationsItemProp) => ConversationsMenuProp | undefined);
606
+ /** Bucket rows by their `group` field. Ant Design X `groupable`. */
607
+ groupable?: boolean | ConversationsGroupableProp;
608
+ /** The "new conversation" button above the rail. Ant Design X `creation`. */
609
+ creation?: ConversationsCreationProp;
610
+ /**
611
+ * Accessible name of the rail — a plain STRING, because it lands on `aria-label`, which is a
612
+ * text attribute and cannot carry a node. Ant X has no equivalent because its rail has no role
613
+ * to name; a localized default applies when omitted.
614
+ */
615
+ label?: string;
616
+ id?: IdProp;
617
+ className?: ClassNameProp;
618
+ };