@ada-cx/lovelace 1.9.2 → 1.12.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 (91) hide show
  1. package/dist/components/AgentMessage/AgentMessage.css.d.ts +0 -1
  2. package/dist/components/AgentMessage/AgentMessage.css.js +2 -2
  3. package/dist/components/AgentMessage/AgentMessage.css.js.map +1 -1
  4. package/dist/components/AgentMessage/AgentMessage.d.ts +19 -12
  5. package/dist/components/AgentMessage/AgentMessage.js +9 -17
  6. package/dist/components/AgentMessage/AgentMessage.js.map +1 -1
  7. package/dist/components/AttachmentChip/AttachmentChip.css.d.ts +13 -0
  8. package/dist/components/AttachmentChip/AttachmentChip.css.js +16 -0
  9. package/dist/components/AttachmentChip/AttachmentChip.css.js.map +1 -0
  10. package/dist/components/AttachmentChip/AttachmentChip.d.ts +69 -0
  11. package/dist/components/AttachmentChip/AttachmentChip.js +51 -0
  12. package/dist/components/AttachmentChip/AttachmentChip.js.map +1 -0
  13. package/dist/components/AttachmentChip/index.d.ts +2 -0
  14. package/dist/components/Avatar/Avatar.css.d.ts +8 -8
  15. package/dist/components/Avatar/Avatar.css.js +1 -1
  16. package/dist/components/Button/Button.css.d.ts +14 -14
  17. package/dist/components/Checkbox/Checkbox.css.d.ts +1 -1
  18. package/dist/components/Checkbox/Checkbox.css.js.map +1 -1
  19. package/dist/components/Chip/Chip.css.d.ts +4 -4
  20. package/dist/components/Dialog/Dialog.css.d.ts +2 -2
  21. package/dist/components/Divider/Divider.css.d.ts +2 -2
  22. package/dist/components/DropZone/DropZone.js +4 -4
  23. package/dist/components/Icon/icons/Document.d.ts +2 -0
  24. package/dist/components/Icon/icons/Document.js +14 -0
  25. package/dist/components/Icon/icons/Document.js.map +1 -0
  26. package/dist/components/Icon/icons/index.d.ts +1 -0
  27. package/dist/components/IconButton/IconButton.css.d.ts +14 -14
  28. package/dist/components/Input/Input.css.d.ts +5 -0
  29. package/dist/components/Input/Input.css.js.map +1 -1
  30. package/dist/components/Input/InputAttachments.d.ts +13 -2
  31. package/dist/components/Input/InputAttachments.js.map +1 -1
  32. package/dist/components/Input/InputField.d.ts +8 -1
  33. package/dist/components/Input/InputField.js +6 -5
  34. package/dist/components/Input/InputField.js.map +1 -1
  35. package/dist/components/Input/InputRoot.js +4 -4
  36. package/dist/components/Input/InputTextArea.js +7 -7
  37. package/dist/components/Link/Link.d.ts +7 -0
  38. package/dist/components/Link/Link.js.map +1 -1
  39. package/dist/components/MenuItem/MenuItem.css.js.map +1 -1
  40. package/dist/components/MenuItem/MenuItemRoot.js +9 -9
  41. package/dist/components/MessageError/MessageError.css.d.ts +5 -0
  42. package/dist/components/MessageError/MessageError.css.js +7 -0
  43. package/dist/components/MessageError/MessageError.css.js.map +1 -0
  44. package/dist/components/MessageError/MessageError.d.ts +38 -0
  45. package/dist/components/MessageError/MessageError.js +38 -0
  46. package/dist/components/MessageError/MessageError.js.map +1 -0
  47. package/dist/components/MessageError/index.d.ts +1 -0
  48. package/dist/components/MessageProse/MessageProse.css.d.ts +20 -0
  49. package/dist/components/MessageProse/MessageProse.css.js +7 -0
  50. package/dist/components/MessageProse/MessageProse.css.js.map +1 -0
  51. package/dist/components/MessageProse/MessageProse.d.ts +25 -0
  52. package/dist/components/MessageProse/MessageProse.js +17 -0
  53. package/dist/components/MessageProse/MessageProse.js.map +1 -0
  54. package/dist/components/MessageProse/index.d.ts +2 -0
  55. package/dist/components/MessageRow/MessageRow.context.d.ts +5 -0
  56. package/dist/components/MessageRow/MessageRow.context.js +7 -0
  57. package/dist/components/MessageRow/MessageRow.context.js.map +1 -0
  58. package/dist/components/MessageRow/MessageRow.css.d.ts +29 -0
  59. package/dist/components/MessageRow/MessageRow.css.js +39 -0
  60. package/dist/components/MessageRow/MessageRow.css.js.map +1 -0
  61. package/dist/components/MessageRow/MessageRow.d.ts +8 -0
  62. package/dist/components/MessageRow/MessageRow.js +8 -0
  63. package/dist/components/MessageRow/MessageRow.js.map +1 -0
  64. package/dist/components/MessageRow/MessageRowContent.d.ts +20 -0
  65. package/dist/components/MessageRow/MessageRowContent.js +21 -0
  66. package/dist/components/MessageRow/MessageRowContent.js.map +1 -0
  67. package/dist/components/MessageRow/MessageRowRoot.d.ts +23 -0
  68. package/dist/components/MessageRow/MessageRowRoot.js +19 -0
  69. package/dist/components/MessageRow/MessageRowRoot.js.map +1 -0
  70. package/dist/components/MessageRow/index.d.ts +2 -0
  71. package/dist/components/PictureMessage/PictureMessage.css.d.ts +2 -2
  72. package/dist/components/Radio/Radio.css.d.ts +1 -1
  73. package/dist/components/Radio/Radio.css.js.map +1 -1
  74. package/dist/components/ScrollMarker/ScrollMarker.css.d.ts +6 -6
  75. package/dist/components/Spinner/Spinner.css.d.ts +2 -2
  76. package/dist/components/ToastNotification/ToastNotification.css.d.ts +6 -6
  77. package/dist/components/UserMessage/UserMessage.css.d.ts +0 -5
  78. package/dist/components/UserMessage/UserMessage.css.js +2 -2
  79. package/dist/components/UserMessage/UserMessage.css.js.map +1 -1
  80. package/dist/components/UserMessage/UserMessage.d.ts +10 -12
  81. package/dist/components/UserMessage/UserMessage.js +12 -38
  82. package/dist/components/UserMessage/UserMessage.js.map +1 -1
  83. package/dist/components/VideoMessage/VideoMessage.js +4 -4
  84. package/dist/index.d.ts +3 -0
  85. package/dist/index.js +86 -82
  86. package/dist/style.css +1 -1
  87. package/dist/styles/{row.d.ts → control-row.d.ts} +3 -3
  88. package/dist/tokens/generated/tokens.d.ts +1 -1
  89. package/dist/tokens/tokens.d.ts +2 -2
  90. package/dist/tokens.css +6 -0
  91. package/package.json +1 -1
@@ -1,6 +1,11 @@
1
1
  import type { ComplexStyleRule } from "@vanilla-extract/css";
2
2
  import type { RuntimeFn } from "@vanilla-extract/recipes";
3
3
  export declare const inputRoot: string;
4
+ /**
5
+ * Shares the line below the control with the field's own button rather than
6
+ * taking a line of its own: Figma bottom-aligns the chips and the send action
7
+ * on one line, which `Input.Field`'s `align-items: flex-end` then handles.
8
+ */
4
9
  export declare const inputAttachments: string;
5
10
  export declare const inputField: RuntimeFn<{
6
11
  variant: Record<"default" | "composer", ComplexStyleRule>;
@@ -1 +1 @@
1
- {"version":3,"file":"Input.css.js","names":[],"sources":["../../../src/components/Input/Input.css.ts"],"sourcesContent":["import type { ComplexStyleRule } from \"@vanilla-extract/css\";\nimport { globalStyle, style } from \"@vanilla-extract/css\";\nimport type { RuntimeFn } from \"@vanilla-extract/recipes\";\nimport { recipe } from \"@vanilla-extract/recipes\";\nimport { t } from \"../../tokens/index.js\";\n\n// Shared by the text control and the label so their typography stays in lockstep.\nconst bodyText = {\n\tfontFamily: t(\"font-family-body\"),\n\tfontWeight: t(\"font-weight-regular\"),\n\tfontSize: t(\"font-size-body\"),\n\tlineHeight: t(\"line-height-body\"),\n} as const;\n\n// Field and action-button icon glyphs share sizing.\nconst iconSlotSizing = {\n\tflexShrink: 0,\n\tfontSize: t(\"icon-size-control\"),\n} as const;\n\nexport const inputRoot = style({\n\tdisplay: \"flex\",\n\tflexDirection: \"column\",\n\twidth: \"100%\",\n\tfontFamily: t(\"font-family-body\"),\n});\n\n// Empty style used purely as a stable selector anchor for the globalStyle rules\n// below — a recipe class isn't a usable selector string, so descendant styles\n// hang off this base class instead.\nconst inputFieldBase = style({});\n\n// Composer-variant anchor: composed into the `composer` variant so the control's\n// content/placeholder colors (a descendant, not the field) can be re-themed to\n// the composer-* tokens via globalStyle.\nconst inputFieldComposer = style({});\n\nexport const inputAttachments = style({\n\tflexBasis: \"100%\",\n\twidth: \"100%\",\n\tdisplay: \"flex\",\n\tflexWrap: \"wrap\",\n\tgap: t(\"gap-8\"),\n});\n\n// Explicit annotation: the inferred recipe type exceeds tsc's declaration\n// serialization limit (TS7056) under `tsc -p tsconfig.build.json`.\nexport const inputField: RuntimeFn<{\n\tvariant: Record<\"default\" | \"composer\", ComplexStyleRule>;\n}> = recipe({\n\tbase: [\n\t\tinputFieldBase,\n\t\t{\n\t\t\tdisplay: \"flex\",\n\t\t\t// Lets `Input.Attachments` (flex-basis 100%) take its own line.\n\t\t\t// Keep wrapping unconditional because Chrome and Firefox at the floor in\n\t\t\t// `messaging/vite.browser-targets.mjs` lack `:has()`. Without attachments,\n\t\t\t// nothing wraps: the control has flex-basis 0, icons and button are 22px.\n\t\t\tflexWrap: \"wrap\",\n\t\t\talignItems: \"flex-end\",\n\t\t\tgap: t(\"gap-8\"),\n\t\t\twidth: \"100%\",\n\t\t\tminHeight: \"40px\",\n\t\t\tboxSizing: \"border-box\",\n\t\t\tpaddingInline: t(\"padding-12\"),\n\t\t\tpaddingBlock: t(\"padding-8\"),\n\t\t\tborder: `${t(\"border-width-default\")} solid ${t(\"color-border-default\")}`,\n\t\t\tbackgroundColor: t(\"color-background-default\"),\n\t\t\tborderRadius: t(\"border-radius-input\"),\n\t\t\tcursor: \"text\",\n\t\t\tselectors: {\n\t\t\t\t\"&[data-focus-within]\": {\n\t\t\t\t\tborderColor: t(\"color-border-accent\"),\n\t\t\t\t\tboxShadow: `0 0 0 ${t(\"border-width-focus\")} ${t(\"color-border-focus\")}`,\n\t\t\t\t},\n\t\t\t\t// After focus-within so an invalid field keeps its destructive border while focused.\n\t\t\t\t\"&[data-invalid]\": {\n\t\t\t\t\tborderColor: t(\"color-border-destructive\"),\n\t\t\t\t},\n\t\t\t\t\"&[data-disabled]\": {\n\t\t\t\t\tbackgroundColor: t(\"color-background-disabled\"),\n\t\t\t\t\tcursor: \"not-allowed\",\n\t\t\t\t},\n\t\t\t},\n\t\t\t\"@media\": {\n\t\t\t\t\"(prefers-reduced-motion: no-preference)\": {\n\t\t\t\t\ttransitionProperty: \"border-color, box-shadow\",\n\t\t\t\t\ttransitionDuration: t(\"duration-fast\"),\n\t\t\t\t\ttransitionTimingFunction: t(\"easing-standard\"),\n\t\t\t\t},\n\t\t\t\t// Token-color focus ring flattens in forced-colors; redraw with a system color.\n\t\t\t\t\"(forced-colors: active)\": {\n\t\t\t\t\tselectors: {\n\t\t\t\t\t\t\"&[data-focus-within]\": {\n\t\t\t\t\t\t\toutline: \"2px solid Highlight\",\n\t\t\t\t\t\t\toutlineOffset: \"2px\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t],\n\tvariants: {\n\t\tvariant: {\n\t\t\t// Default field styling lives in `base`; this key exists so the variant\n\t\t\t// axis accepts \"default\" as an explicit no-op.\n\t\t\tdefault: {},\n\t\t\tcomposer: [\n\t\t\t\tinputFieldComposer,\n\t\t\t\t{\n\t\t\t\t\tborderRadius: t(\"border-radius-composer\"),\n\t\t\t\t\tborder: `${t(\"border-width-default\")} solid ${t(\"composer-border-default\")}`,\n\t\t\t\t\tbackgroundColor: t(\"composer-background\"),\n\t\t\t\t\tselectors: {\n\t\t\t\t\t\t\"&[data-focus-within]\": {\n\t\t\t\t\t\t\tborderColor: t(\"composer-border-active\"),\n\t\t\t\t\t\t\tboxShadow: `0 0 0 ${t(\"border-width-focus\")} ${t(\"composer-border-focus\")}`,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t// Re-declared after focus-within for the same reason the base does:\n\t\t\t\t\t\t// variant styles are emitted after base at equal specificity, so\n\t\t\t\t\t\t// without this the composer's focus colour would win and an invalid\n\t\t\t\t\t\t// composer would lose its destructive border while focused.\n\t\t\t\t\t\t\"&[data-invalid]\": {\n\t\t\t\t\t\t\tborderColor: t(\"color-border-destructive\"),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tvariant: \"default\",\n\t},\n});\n\nexport const inputControl = style({\n\tflex: 1,\n\tminWidth: 0,\n\tmargin: 0,\n\tpadding: 0,\n\tborder: \"none\",\n\tbackgroundColor: \"transparent\",\n\toutline: \"none\",\n\tappearance: \"none\",\n\t...bodyText,\n\tcolor: t(\"color-content-default\"),\n\tselectors: {\n\t\t\"&::placeholder\": {\n\t\t\tcolor: t(\"color-content-secondary\"),\n\t\t\topacity: 1,\n\t\t},\n\t\t\"&[data-disabled]\": {\n\t\t\tcolor: t(\"color-content-disabled\"),\n\t\t\tcursor: \"not-allowed\",\n\t\t},\n\t\t\"&[data-disabled]::placeholder\": {\n\t\t\tcolor: t(\"color-content-disabled\"),\n\t\t},\n\t},\n});\n\n// Same control base as the single-line inputControl (typography, colors,\n// placeholder/disabled states), plus the multi-line-specific box behavior.\nexport const inputTextArea = style([\n\tinputControl,\n\t{\n\t\tdisplay: \"block\",\n\t\twidth: \"100%\",\n\t\tboxSizing: \"border-box\",\n\t\t// Height is driven by the auto-grow logic in InputTextArea; the user never drags it.\n\t\tresize: \"none\",\n\t\toverflowY: \"auto\",\n\t\toverflowWrap: \"anywhere\",\n\t\twordBreak: \"break-word\",\n\t\tscrollbarWidth: \"thin\",\n\t\tscrollbarColor: `${t(\"color-border-default\")} transparent`,\n\t},\n]);\n\nexport const inputButton = style({\n\tposition: \"relative\",\n\tisolation: \"isolate\",\n\tdisplay: \"inline-flex\",\n\talignItems: \"center\",\n\tjustifyContent: \"center\",\n\tflexShrink: 0,\n\t// Circular send/action button — 22px square per Figma (matches the field's icon size).\n\twidth: \"22px\",\n\theight: \"22px\",\n\tpadding: 0,\n\tborder: \"none\",\n\tborderRadius: t(\"border-radius-full\"),\n\tbackgroundColor: t(\"button-primary-background\"),\n\tcolor: t(\"button-primary-content\"),\n\tcursor: \"pointer\",\n\tappearance: \"none\",\n\toutline: \"none\",\n\toverflow: \"hidden\",\n\t\"::after\": {\n\t\tcontent: '\"\"',\n\t\tposition: \"absolute\",\n\t\tinset: 0,\n\t\tborderRadius: \"inherit\",\n\t\tbackgroundColor: \"currentColor\",\n\t\topacity: 0,\n\t\tpointerEvents: \"none\",\n\t\tzIndex: -1,\n\t},\n\tselectors: {\n\t\t\"&[data-hovered]:not([data-disabled])::after\": {\n\t\t\topacity: t(\"opacity-state-hover\"),\n\t\t},\n\t\t\"&[data-focus-visible]:not([data-disabled])::after\": {\n\t\t\topacity: t(\"opacity-state-focus\"),\n\t\t},\n\t\t\"&[data-pressed]:not([data-disabled])::after\": {\n\t\t\topacity: t(\"opacity-state-pressed\"),\n\t\t},\n\t\t\"&[data-focus-visible]:not([data-disabled])\": {\n\t\t\tboxShadow: `0 0 0 ${t(\"border-width-focus\")} ${t(\"color-border-focus\")}`,\n\t\t},\n\t\t\"&[data-disabled]\": {\n\t\t\tcursor: \"not-allowed\",\n\t\t\tbackgroundColor: t(\"color-background-disabled\"),\n\t\t\tcolor: t(\"color-content-disabled\"),\n\t\t},\n\t},\n\t\"@media\": {\n\t\t\"(prefers-reduced-motion: no-preference)\": {\n\t\t\tselectors: {\n\t\t\t\t\"&::after\": {\n\t\t\t\t\ttransition: `opacity ${t(\"duration-fast\")} ${t(\"easing-standard\")}`,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t// Token-color focus ring flattens in forced-colors; redraw with a system color.\n\t\t\"(forced-colors: active)\": {\n\t\t\tselectors: {\n\t\t\t\t\"&[data-focus-visible]:not([data-disabled])\": {\n\t\t\t\t\toutline: \"2px solid Highlight\",\n\t\t\t\t\toutlineOffset: \"2px\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n});\n\nexport const inputLabel = style({\n\t...bodyText,\n\tmarginBottom: t(\"gap-8\"),\n\tcolor: t(\"color-content-default\"),\n});\n\nexport const inputHelperText = style({\n\tmarginTop: t(\"gap-4\"),\n\tfontFamily: t(\"font-family-body\"),\n\tfontWeight: t(\"font-weight-regular\"),\n\tfontSize: t(\"font-size-caption\"),\n\tlineHeight: t(\"line-height-caption\"),\n\tcolor: t(\"color-content-secondary\"),\n\tselectors: {\n\t\t\"&[data-invalid]\": {\n\t\t\tcolor: t(\"color-content-destructive\"),\n\t\t},\n\t},\n});\n\nglobalStyle(`${inputFieldBase} [data-slot='icon']`, iconSlotSizing);\nglobalStyle(`${inputButton} [data-slot='icon']`, iconSlotSizing);\n\n// Direct child only: field-level icons follow content color. The send button's\n// icon is a deeper descendant, so it deliberately has no rule of its own — it\n// inherits the button's paired tokens (button-primary-content over\n// button-primary-background, or the disabled pair). Giving the icon its own\n// background re-pairs an accent foreground with a neutral backdrop, and those\n// two are unrelated tokens: a customer tint near the surface color then renders\n// the arrow at ~1:1.\nglobalStyle(`${inputFieldBase} > [data-slot='icon']`, {\n\tcolor: t(\"color-content-secondary\"),\n});\n\nglobalStyle(`${inputFieldBase}[data-disabled] > [data-slot='icon']`, {\n\tcolor: t(\"color-content-disabled\"),\n});\n\n// Composer variant re-themes the field's content colors to the composer-* tokens.\n// The control (input/textarea) and field-level icons are descendants of the field,\n// so these ride the composer anchor rather than the field recipe.\nglobalStyle(`${inputFieldComposer} ${inputControl}`, {\n\tcolor: t(\"composer-content-default\"),\n});\n\nglobalStyle(`${inputFieldComposer} ${inputControl}::placeholder`, {\n\tcolor: t(\"composer-content-secondary\"),\n});\n\nglobalStyle(`${inputFieldComposer} > [data-slot='icon']`, {\n\tcolor: t(\"composer-content-secondary\"),\n});\n\n// The composer rules above are descendant selectors, so they tie with the field\n// recipe's [data-disabled] rules on specificity and win on order. Re-assert the\n// disabled colors after them or a disabled control renders as if it were editable.\nglobalStyle(`${inputFieldComposer} ${inputControl}[data-disabled]`, {\n\tcolor: t(\"color-content-disabled\"),\n});\n\nglobalStyle(\n\t`${inputFieldComposer} ${inputControl}[data-disabled]::placeholder`,\n\t{\n\t\tcolor: t(\"color-content-disabled\"),\n\t},\n);\n"],"mappings":""}
1
+ {"version":3,"file":"Input.css.js","names":[],"sources":["../../../src/components/Input/Input.css.ts"],"sourcesContent":["import type { ComplexStyleRule } from \"@vanilla-extract/css\";\nimport { globalStyle, style } from \"@vanilla-extract/css\";\nimport type { RuntimeFn } from \"@vanilla-extract/recipes\";\nimport { recipe } from \"@vanilla-extract/recipes\";\nimport { t } from \"../../tokens/index.js\";\n\n// Shared by the text control and the label so their typography stays in lockstep.\nconst bodyText = {\n\tfontFamily: t(\"font-family-body\"),\n\tfontWeight: t(\"font-weight-regular\"),\n\tfontSize: t(\"font-size-body\"),\n\tlineHeight: t(\"line-height-body\"),\n} as const;\n\n// Field and action-button icon glyphs share sizing.\nconst iconSlotSizing = {\n\tflexShrink: 0,\n\tfontSize: t(\"icon-size-control\"),\n} as const;\n\nexport const inputRoot = style({\n\tdisplay: \"flex\",\n\tflexDirection: \"column\",\n\twidth: \"100%\",\n\tfontFamily: t(\"font-family-body\"),\n});\n\n// Empty style used purely as a stable selector anchor for the globalStyle rules\n// below — a recipe class isn't a usable selector string, so descendant styles\n// hang off this base class instead.\nconst inputFieldBase = style({});\n\n// Composer-variant anchor: composed into the `composer` variant so the control's\n// content/placeholder colors (a descendant, not the field) can be re-themed to\n// the composer-* tokens via globalStyle.\nconst inputFieldComposer = style({});\n\n/**\n * Shares the line below the control with the field's own button rather than\n * taking a line of its own: Figma bottom-aligns the chips and the send action\n * on one line, which `Input.Field`'s `align-items: flex-end` then handles.\n */\nexport const inputAttachments = style({\n\tflex: \"1 1 auto\",\n\tminWidth: 0,\n\tdisplay: \"flex\",\n\tflexWrap: \"wrap\",\n\tgap: t(\"gap-8\"),\n});\n\n// Explicit annotation: the inferred recipe type exceeds tsc's declaration\n// serialization limit (TS7056) under `tsc -p tsconfig.build.json`.\nexport const inputField: RuntimeFn<{\n\tvariant: Record<\"default\" | \"composer\", ComplexStyleRule>;\n}> = recipe({\n\tbase: [\n\t\tinputFieldBase,\n\t\t{\n\t\t\tdisplay: \"flex\",\n\t\t\t// The control takes the whole first line whenever attachments are present\n\t\t\t// (see the `data-has-attachments` rule below), so the chips and the button\n\t\t\t// wrap onto the second. Keep wrapping unconditional because Chrome and\n\t\t\t// Firefox at the floor in `messaging/vite.browser-targets.mjs` lack\n\t\t\t// `:has()`. Without attachments nothing wraps: the control has\n\t\t\t// flex-basis 0, icons and button are 22px.\n\t\t\tflexWrap: \"wrap\",\n\t\t\talignItems: \"flex-end\",\n\t\t\tgap: t(\"gap-8\"),\n\t\t\twidth: \"100%\",\n\t\t\tminHeight: \"40px\",\n\t\t\tboxSizing: \"border-box\",\n\t\t\tpaddingInline: t(\"padding-12\"),\n\t\t\tpaddingBlock: t(\"padding-8\"),\n\t\t\tborder: `${t(\"border-width-default\")} solid ${t(\"color-border-default\")}`,\n\t\t\tbackgroundColor: t(\"color-background-default\"),\n\t\t\tborderRadius: t(\"border-radius-input\"),\n\t\t\tcursor: \"text\",\n\t\t\tselectors: {\n\t\t\t\t\"&[data-focus-within]\": {\n\t\t\t\t\tborderColor: t(\"color-border-accent\"),\n\t\t\t\t\tboxShadow: `0 0 0 ${t(\"border-width-focus\")} ${t(\"color-border-focus\")}`,\n\t\t\t\t},\n\t\t\t\t// After focus-within so an invalid field keeps its destructive border while focused.\n\t\t\t\t\"&[data-invalid]\": {\n\t\t\t\t\tborderColor: t(\"color-border-destructive\"),\n\t\t\t\t},\n\t\t\t\t\"&[data-disabled]\": {\n\t\t\t\t\tbackgroundColor: t(\"color-background-disabled\"),\n\t\t\t\t\tcursor: \"not-allowed\",\n\t\t\t\t},\n\t\t\t},\n\t\t\t\"@media\": {\n\t\t\t\t\"(prefers-reduced-motion: no-preference)\": {\n\t\t\t\t\ttransitionProperty: \"border-color, box-shadow\",\n\t\t\t\t\ttransitionDuration: t(\"duration-fast\"),\n\t\t\t\t\ttransitionTimingFunction: t(\"easing-standard\"),\n\t\t\t\t},\n\t\t\t\t// Token-color focus ring flattens in forced-colors; redraw with a system color.\n\t\t\t\t\"(forced-colors: active)\": {\n\t\t\t\t\tselectors: {\n\t\t\t\t\t\t\"&[data-focus-within]\": {\n\t\t\t\t\t\t\toutline: \"2px solid Highlight\",\n\t\t\t\t\t\t\toutlineOffset: \"2px\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t],\n\tvariants: {\n\t\tvariant: {\n\t\t\t// Default field styling lives in `base`; this key exists so the variant\n\t\t\t// axis accepts \"default\" as an explicit no-op.\n\t\t\tdefault: {},\n\t\t\tcomposer: [\n\t\t\t\tinputFieldComposer,\n\t\t\t\t{\n\t\t\t\t\tborderRadius: t(\"border-radius-composer\"),\n\t\t\t\t\tborder: `${t(\"border-width-default\")} solid ${t(\"composer-border-default\")}`,\n\t\t\t\t\tbackgroundColor: t(\"composer-background\"),\n\t\t\t\t\tselectors: {\n\t\t\t\t\t\t\"&[data-focus-within]\": {\n\t\t\t\t\t\t\tborderColor: t(\"composer-border-active\"),\n\t\t\t\t\t\t\tboxShadow: `0 0 0 ${t(\"border-width-focus\")} ${t(\"composer-border-focus\")}`,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t// Re-declared after focus-within for the same reason the base does:\n\t\t\t\t\t\t// variant styles are emitted after base at equal specificity, so\n\t\t\t\t\t\t// without this the composer's focus colour would win and an invalid\n\t\t\t\t\t\t// composer would lose its destructive border while focused.\n\t\t\t\t\t\t\"&[data-invalid]\": {\n\t\t\t\t\t\t\tborderColor: t(\"color-border-destructive\"),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tvariant: \"default\",\n\t},\n});\n\nexport const inputControl = style({\n\tflex: 1,\n\tminWidth: 0,\n\tmargin: 0,\n\tpadding: 0,\n\tborder: \"none\",\n\tbackgroundColor: \"transparent\",\n\toutline: \"none\",\n\tappearance: \"none\",\n\t...bodyText,\n\tcolor: t(\"color-content-default\"),\n\tselectors: {\n\t\t\"&::placeholder\": {\n\t\t\tcolor: t(\"color-content-secondary\"),\n\t\t\topacity: 1,\n\t\t},\n\t\t\"&[data-disabled]\": {\n\t\t\tcolor: t(\"color-content-disabled\"),\n\t\t\tcursor: \"not-allowed\",\n\t\t},\n\t\t\"&[data-disabled]::placeholder\": {\n\t\t\tcolor: t(\"color-content-disabled\"),\n\t\t},\n\t},\n});\n\n// Same control base as the single-line inputControl (typography, colors,\n// placeholder/disabled states), plus the multi-line-specific box behavior.\nexport const inputTextArea = style([\n\tinputControl,\n\t{\n\t\tdisplay: \"block\",\n\t\twidth: \"100%\",\n\t\tboxSizing: \"border-box\",\n\t\t// Height is driven by the auto-grow logic in InputTextArea; the user never drags it.\n\t\tresize: \"none\",\n\t\toverflowY: \"auto\",\n\t\toverflowWrap: \"anywhere\",\n\t\twordBreak: \"break-word\",\n\t\tscrollbarWidth: \"thin\",\n\t\tscrollbarColor: `${t(\"color-border-default\")} transparent`,\n\t},\n]);\n\nexport const inputButton = style({\n\tposition: \"relative\",\n\tisolation: \"isolate\",\n\tdisplay: \"inline-flex\",\n\talignItems: \"center\",\n\tjustifyContent: \"center\",\n\tflexShrink: 0,\n\t// Circular send/action button — 22px square per Figma (matches the field's icon size).\n\twidth: \"22px\",\n\theight: \"22px\",\n\tpadding: 0,\n\tborder: \"none\",\n\tborderRadius: t(\"border-radius-full\"),\n\tbackgroundColor: t(\"button-primary-background\"),\n\tcolor: t(\"button-primary-content\"),\n\tcursor: \"pointer\",\n\tappearance: \"none\",\n\toutline: \"none\",\n\toverflow: \"hidden\",\n\t\"::after\": {\n\t\tcontent: '\"\"',\n\t\tposition: \"absolute\",\n\t\tinset: 0,\n\t\tborderRadius: \"inherit\",\n\t\tbackgroundColor: \"currentColor\",\n\t\topacity: 0,\n\t\tpointerEvents: \"none\",\n\t\tzIndex: -1,\n\t},\n\tselectors: {\n\t\t\"&[data-hovered]:not([data-disabled])::after\": {\n\t\t\topacity: t(\"opacity-state-hover\"),\n\t\t},\n\t\t\"&[data-focus-visible]:not([data-disabled])::after\": {\n\t\t\topacity: t(\"opacity-state-focus\"),\n\t\t},\n\t\t\"&[data-pressed]:not([data-disabled])::after\": {\n\t\t\topacity: t(\"opacity-state-pressed\"),\n\t\t},\n\t\t\"&[data-focus-visible]:not([data-disabled])\": {\n\t\t\tboxShadow: `0 0 0 ${t(\"border-width-focus\")} ${t(\"color-border-focus\")}`,\n\t\t},\n\t\t\"&[data-disabled]\": {\n\t\t\tcursor: \"not-allowed\",\n\t\t\tbackgroundColor: t(\"color-background-disabled\"),\n\t\t\tcolor: t(\"color-content-disabled\"),\n\t\t},\n\t},\n\t\"@media\": {\n\t\t\"(prefers-reduced-motion: no-preference)\": {\n\t\t\tselectors: {\n\t\t\t\t\"&::after\": {\n\t\t\t\t\ttransition: `opacity ${t(\"duration-fast\")} ${t(\"easing-standard\")}`,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t// Token-color focus ring flattens in forced-colors; redraw with a system color.\n\t\t\"(forced-colors: active)\": {\n\t\t\tselectors: {\n\t\t\t\t\"&[data-focus-visible]:not([data-disabled])\": {\n\t\t\t\t\toutline: \"2px solid Highlight\",\n\t\t\t\t\toutlineOffset: \"2px\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n});\n\nexport const inputLabel = style({\n\t...bodyText,\n\tmarginBottom: t(\"gap-8\"),\n\tcolor: t(\"color-content-default\"),\n});\n\nexport const inputHelperText = style({\n\tmarginTop: t(\"gap-4\"),\n\tfontFamily: t(\"font-family-body\"),\n\tfontWeight: t(\"font-weight-regular\"),\n\tfontSize: t(\"font-size-caption\"),\n\tlineHeight: t(\"line-height-caption\"),\n\tcolor: t(\"color-content-secondary\"),\n\tselectors: {\n\t\t\"&[data-invalid]\": {\n\t\t\tcolor: t(\"color-content-destructive\"),\n\t\t},\n\t},\n});\n\nglobalStyle(`${inputFieldBase} [data-slot='icon']`, iconSlotSizing);\nglobalStyle(`${inputButton} [data-slot='icon']`, iconSlotSizing);\n\n// Direct child only: field-level icons follow content color. The send button's\n// icon is a deeper descendant, so it deliberately has no rule of its own — it\n// inherits the button's paired tokens (button-primary-content over\n// button-primary-background, or the disabled pair). Giving the icon its own\n// background re-pairs an accent foreground with a neutral backdrop, and those\n// two are unrelated tokens: a customer tint near the surface color then renders\n// the arrow at ~1:1.\nglobalStyle(`${inputFieldBase} > [data-slot='icon']`, {\n\tcolor: t(\"color-content-secondary\"),\n});\n\nglobalStyle(`${inputFieldBase}[data-disabled] > [data-slot='icon']`, {\n\tcolor: t(\"color-content-disabled\"),\n});\n\n// Composer variant re-themes the field's content colors to the composer-* tokens.\n// The control (input/textarea) and field-level icons are descendants of the field,\n// so these ride the composer anchor rather than the field recipe.\n/**\n * With attachments in the field the control owns the first line, so the chips\n * and the send button fall onto the second and bottom-align there.\n *\n * Driven by an attribute the caller sets rather than `:has()`, which the iOS 15\n * baseline does not have.\n */\nglobalStyle(`${inputFieldBase}[data-has-attachments] ${inputControl}`, {\n\tflexBasis: \"100%\",\n});\n\n// Figma stacks the text and the chips 20px apart while the send button keeps its\n// 8px from the chips, so the two axes take different gaps.\nglobalStyle(`${inputFieldBase}[data-has-attachments]`, {\n\trowGap: t(\"gap-20\"),\n});\n\nglobalStyle(`${inputFieldComposer} ${inputControl}`, {\n\tcolor: t(\"composer-content-default\"),\n});\n\nglobalStyle(`${inputFieldComposer} ${inputControl}::placeholder`, {\n\tcolor: t(\"composer-content-secondary\"),\n});\n\nglobalStyle(`${inputFieldComposer} > [data-slot='icon']`, {\n\tcolor: t(\"composer-content-secondary\"),\n});\n\n// The composer rules above are descendant selectors, so they tie with the field\n// recipe's [data-disabled] rules on specificity and win on order. Re-assert the\n// disabled colors after them or a disabled control renders as if it were editable.\nglobalStyle(`${inputFieldComposer} ${inputControl}[data-disabled]`, {\n\tcolor: t(\"color-content-disabled\"),\n});\n\nglobalStyle(\n\t`${inputFieldComposer} ${inputControl}[data-disabled]::placeholder`,\n\t{\n\t\tcolor: t(\"color-content-disabled\"),\n\t},\n);\n"],"mappings":""}
@@ -3,7 +3,18 @@ export interface InputAttachmentsProps extends HTMLAttributes<HTMLDivElement> {
3
3
  ref?: Ref<HTMLDivElement>;
4
4
  }
5
5
  /**
6
- * Full-width row inside the field for attachment chips. Render it as the first
7
- * child of `Input.Field`; the control and any buttons keep their own line.
6
+ * Row inside the field holding the attachment chips.
7
+ *
8
+ * Render it AFTER the control and BEFORE the field's button, and set
9
+ * `hasAttachments` on `Input.Field`. The control then takes the first line and
10
+ * the chips share the second with the button, bottom-aligned — which is both
11
+ * the drawn layout and the right reading order: the message, then what is
12
+ * attached to it, then the action that sends them.
13
+ *
14
+ * BREAKING in 1.12.0 in effect though not in type: this row was `flex-basis:
15
+ * 100%`, taking its own line unconditionally. It is now `flex: 1 1 auto`, so
16
+ * the full-width line comes from `hasAttachments` on `Input.Field`. Rendered
17
+ * the pre-1.12.0 way — first child, no flag — it silently shares a line with
18
+ * the control instead of claiming one.
8
19
  */
9
20
  export declare function InputAttachments({ className, children, ...rest }: InputAttachmentsProps): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"InputAttachments.js","names":[],"sources":["../../../src/components/Input/InputAttachments.tsx"],"sourcesContent":["import type { HTMLAttributes, Ref } from \"react\";\nimport { cx } from \"../../utils/cx.js\";\nimport { inputAttachments } from \"./Input.css.js\";\n\nexport interface InputAttachmentsProps extends HTMLAttributes<HTMLDivElement> {\n\tref?: Ref<HTMLDivElement>;\n}\n\n/**\n * Full-width row inside the field for attachment chips. Render it as the first\n * child of `Input.Field`; the control and any buttons keep their own line.\n */\nexport function InputAttachments({\n\tclassName,\n\tchildren,\n\t...rest\n}: InputAttachmentsProps) {\n\treturn (\n\t\t<div {...rest} className={cx(inputAttachments, className)}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;AAYA,SAAgB,EAAiB,EAChC,cACA,aACA,GAAG,KACsB;AACzB,QACC,kBAAC,OAAD;EAAK,GAAI;EAAM,WAAW,EAAG,GAAkB,EAAU;EACvD;EACI,CAAA"}
1
+ {"version":3,"file":"InputAttachments.js","names":[],"sources":["../../../src/components/Input/InputAttachments.tsx"],"sourcesContent":["import type { HTMLAttributes, Ref } from \"react\";\nimport { cx } from \"../../utils/cx.js\";\nimport { inputAttachments } from \"./Input.css.js\";\n\nexport interface InputAttachmentsProps extends HTMLAttributes<HTMLDivElement> {\n\tref?: Ref<HTMLDivElement>;\n}\n\n/**\n * Row inside the field holding the attachment chips.\n *\n * Render it AFTER the control and BEFORE the field's button, and set\n * `hasAttachments` on `Input.Field`. The control then takes the first line and\n * the chips share the second with the button, bottom-aligned — which is both\n * the drawn layout and the right reading order: the message, then what is\n * attached to it, then the action that sends them.\n *\n * BREAKING in 1.12.0 in effect though not in type: this row was `flex-basis:\n * 100%`, taking its own line unconditionally. It is now `flex: 1 1 auto`, so\n * the full-width line comes from `hasAttachments` on `Input.Field`. Rendered\n * the pre-1.12.0 way — first child, no flag — it silently shares a line with\n * the control instead of claiming one.\n */\nexport function InputAttachments({\n\tclassName,\n\tchildren,\n\t...rest\n}: InputAttachmentsProps) {\n\treturn (\n\t\t<div {...rest} className={cx(inputAttachments, className)}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;AAuBA,SAAgB,EAAiB,EAChC,cACA,aACA,GAAG,KACsB;AACzB,QACC,kBAAC,OAAD;EAAK,GAAI;EAAM,WAAW,EAAG,GAAkB,EAAU;EACvD;EACI,CAAA"}
@@ -5,5 +5,12 @@ export interface InputFieldProps extends Omit<AriaGroupProps, "className" | "sty
5
5
  style?: CSSProperties;
6
6
  ref?: Ref<HTMLDivElement>;
7
7
  children?: ReactNode;
8
+ /**
9
+ * Set when `Input.Attachments` is among the children. It gives the control the
10
+ * whole first line, so the chips and the field's button share the second and
11
+ * bottom-align there. A caller-supplied flag rather than `:has()`, which the
12
+ * iOS 15 baseline does not have.
13
+ */
14
+ hasAttachments?: boolean;
8
15
  }
9
- export declare function InputField({ className, children, onPointerDown, ...rest }: InputFieldProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function InputField({ className, children, onPointerDown, hasAttachments, ...rest }: InputFieldProps): import("react/jsx-runtime").JSX.Element;
@@ -4,16 +4,17 @@ import { useInputContext as n } from "./Input.context.js";
4
4
  import { jsx as r } from "react/jsx-runtime";
5
5
  import { Group as i } from "react-aria-components";
6
6
  //#region src/components/Input/InputField.tsx
7
- function a({ className: a, children: o, onPointerDown: s, ...c }) {
8
- let { variant: l } = n(), u = (e) => {
7
+ function a({ className: a, children: o, onPointerDown: s, hasAttachments: c, ...l }) {
8
+ let { variant: u } = n(), d = (e) => {
9
9
  if (s?.(e), e.defaultPrevented || e.target.closest("button, a, input, textarea, select, [tabindex]")) return;
10
10
  let t = e.currentTarget.querySelector("input, textarea");
11
11
  t && (e.preventDefault(), t.focus());
12
12
  };
13
13
  return /* @__PURE__ */ r(i, {
14
- ...c,
15
- onPointerDown: u,
16
- className: e(t({ variant: l }), a),
14
+ ...l,
15
+ "data-has-attachments": c || void 0,
16
+ onPointerDown: d,
17
+ className: e(t({ variant: u }), a),
17
18
  children: o
18
19
  });
19
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"InputField.js","names":[],"sources":["../../../src/components/Input/InputField.tsx"],"sourcesContent":["import type { CSSProperties, PointerEvent, ReactNode, Ref } from \"react\";\nimport type { GroupProps as AriaGroupProps } from \"react-aria-components\";\nimport { Group as AriaGroup } from \"react-aria-components\";\nimport { cx } from \"../../utils/cx.js\";\nimport { useInputContext } from \"./Input.context.js\";\nimport { inputField } from \"./Input.css.js\";\n\nexport interface InputFieldProps\n\textends Omit<AriaGroupProps, \"className\" | \"style\"> {\n\tclassName?: string;\n\tstyle?: CSSProperties;\n\tref?: Ref<HTMLDivElement>;\n\tchildren?: ReactNode;\n}\n\nexport function InputField({\n\tclassName,\n\tchildren,\n\tonPointerDown,\n\t...rest\n}: InputFieldProps) {\n\tconst { variant } = useInputContext();\n\tconst handlePointerDown = (event: PointerEvent<HTMLDivElement>) => {\n\t\tonPointerDown?.(event);\n\t\tif (event.defaultPrevented) {\n\t\t\treturn;\n\t\t}\n\t\tconst target = event.target as HTMLElement;\n\t\tif (target.closest(\"button, a, input, textarea, select, [tabindex]\")) {\n\t\t\treturn;\n\t\t}\n\t\tconst control =\n\t\t\tevent.currentTarget.querySelector<HTMLInputElement>(\"input, textarea\");\n\t\tif (control) {\n\t\t\tevent.preventDefault();\n\t\t\tcontrol.focus();\n\t\t}\n\t};\n\treturn (\n\t\t<AriaGroup\n\t\t\t{...rest}\n\t\t\tonPointerDown={handlePointerDown}\n\t\t\tclassName={cx(inputField({ variant }), className)}\n\t\t>\n\t\t\t{children}\n\t\t</AriaGroup>\n\t);\n}\n"],"mappings":";;;;;;AAeA,SAAgB,EAAW,EAC1B,cACA,aACA,kBACA,GAAG,KACgB;CACnB,IAAM,EAAE,eAAY,GAAiB,EAC/B,KAAqB,MAAwC;AAMlE,MALA,IAAgB,EAAM,EAClB,EAAM,oBAGK,EAAM,OACV,QAAQ,iDAAiD,CACnE;EAED,IAAM,IACL,EAAM,cAAc,cAAgC,kBAAkB;AACvE,EAAI,MACH,EAAM,gBAAgB,EACtB,EAAQ,OAAO;;AAGjB,QACC,kBAAC,GAAD;EACC,GAAI;EACJ,eAAe;EACf,WAAW,EAAG,EAAW,EAAE,YAAS,CAAC,EAAE,EAAU;EAEhD;EACU,CAAA"}
1
+ {"version":3,"file":"InputField.js","names":[],"sources":["../../../src/components/Input/InputField.tsx"],"sourcesContent":["import type { CSSProperties, PointerEvent, ReactNode, Ref } from \"react\";\nimport type { GroupProps as AriaGroupProps } from \"react-aria-components\";\nimport { Group as AriaGroup } from \"react-aria-components\";\nimport { cx } from \"../../utils/cx.js\";\nimport { useInputContext } from \"./Input.context.js\";\nimport { inputField } from \"./Input.css.js\";\n\nexport interface InputFieldProps\n\textends Omit<AriaGroupProps, \"className\" | \"style\"> {\n\tclassName?: string;\n\tstyle?: CSSProperties;\n\tref?: Ref<HTMLDivElement>;\n\tchildren?: ReactNode;\n\t/**\n\t * Set when `Input.Attachments` is among the children. It gives the control the\n\t * whole first line, so the chips and the field's button share the second and\n\t * bottom-align there. A caller-supplied flag rather than `:has()`, which the\n\t * iOS 15 baseline does not have.\n\t */\n\thasAttachments?: boolean;\n}\n\nexport function InputField({\n\tclassName,\n\tchildren,\n\tonPointerDown,\n\thasAttachments,\n\t...rest\n}: InputFieldProps) {\n\tconst { variant } = useInputContext();\n\tconst handlePointerDown = (event: PointerEvent<HTMLDivElement>) => {\n\t\tonPointerDown?.(event);\n\t\tif (event.defaultPrevented) {\n\t\t\treturn;\n\t\t}\n\t\tconst target = event.target as HTMLElement;\n\t\tif (target.closest(\"button, a, input, textarea, select, [tabindex]\")) {\n\t\t\treturn;\n\t\t}\n\t\tconst control =\n\t\t\tevent.currentTarget.querySelector<HTMLInputElement>(\"input, textarea\");\n\t\tif (control) {\n\t\t\tevent.preventDefault();\n\t\t\tcontrol.focus();\n\t\t}\n\t};\n\treturn (\n\t\t<AriaGroup\n\t\t\t{...rest}\n\t\t\tdata-has-attachments={hasAttachments || undefined}\n\t\t\tonPointerDown={handlePointerDown}\n\t\t\tclassName={cx(inputField({ variant }), className)}\n\t\t>\n\t\t\t{children}\n\t\t</AriaGroup>\n\t);\n}\n"],"mappings":";;;;;;AAsBA,SAAgB,EAAW,EAC1B,cACA,aACA,kBACA,mBACA,GAAG,KACgB;CACnB,IAAM,EAAE,eAAY,GAAiB,EAC/B,KAAqB,MAAwC;AAMlE,MALA,IAAgB,EAAM,EAClB,EAAM,oBAGK,EAAM,OACV,QAAQ,iDAAiD,CACnE;EAED,IAAM,IACL,EAAM,cAAc,cAAgC,kBAAkB;AACvE,EAAI,MACH,EAAM,gBAAgB,EACtB,EAAQ,OAAO;;AAGjB,QACC,kBAAC,GAAD;EACC,GAAI;EACJ,wBAAsB,KAAkB,KAAA;EACxC,eAAe;EACf,WAAW,EAAG,EAAW,EAAE,YAAS,CAAC,EAAE,EAAU;EAEhD;EACU,CAAA"}
@@ -2,11 +2,11 @@ import { cx as e } from "../../utils/cx.js";
2
2
  import { inputRoot as t } from "./Input.css.js";
3
3
  import { InputContext as n } from "./Input.context.js";
4
4
  import { jsx as r } from "react/jsx-runtime";
5
- import { useMemo as i } from "react";
6
- import { TextField as a } from "react-aria-components";
5
+ import { TextField as i } from "react-aria-components";
6
+ import { useMemo as a } from "react";
7
7
  //#region src/components/Input/InputRoot.tsx
8
8
  function o({ className: o, children: s, variant: c = "default", ...l }) {
9
- let u = l.isDisabled ?? !1, d = l.isInvalid ?? !1, f = i(() => ({
9
+ let u = l.isDisabled ?? !1, d = l.isInvalid ?? !1, f = a(() => ({
10
10
  isDisabled: u,
11
11
  isInvalid: d,
12
12
  variant: c
@@ -15,7 +15,7 @@ function o({ className: o, children: s, variant: c = "default", ...l }) {
15
15
  d,
16
16
  c
17
17
  ]);
18
- return /* @__PURE__ */ r(a, {
18
+ return /* @__PURE__ */ r(i, {
19
19
  ...l,
20
20
  className: e(t, o),
21
21
  children: /* @__PURE__ */ r(n.Provider, {
@@ -1,12 +1,12 @@
1
1
  import { cx as e } from "../../utils/cx.js";
2
2
  import { inputTextArea as t } from "./Input.css.js";
3
3
  import { jsx as n } from "react/jsx-runtime";
4
- import { useCallback as r, useLayoutEffect as i } from "react";
5
- import { useObjectRef as a } from "react-aria/useObjectRef";
6
- import { TextArea as o } from "react-aria-components";
4
+ import { TextArea as r } from "react-aria-components";
5
+ import { useCallback as i, useLayoutEffect as a } from "react";
6
+ import { useObjectRef as o } from "react-aria/useObjectRef";
7
7
  //#region src/components/Input/InputTextArea.tsx
8
8
  function s({ className: s, ref: c, minRows: l = 1, maxRows: u, rows: d, onInput: f, ...p }) {
9
- let m = a(c), h = r(() => {
9
+ let m = o(c), h = i(() => {
10
10
  let e = m.current;
11
11
  if (!e) return;
12
12
  let t = Number.parseFloat(getComputedStyle(e).lineHeight);
@@ -19,13 +19,13 @@ function s({ className: s, ref: c, minRows: l = 1, maxRows: u, rows: d, onInput:
19
19
  l,
20
20
  u
21
21
  ]);
22
- i(() => {
22
+ a(() => {
23
23
  h();
24
24
  });
25
- let g = r((e) => {
25
+ let g = i((e) => {
26
26
  h(), f?.(e);
27
27
  }, [h, f]);
28
- return /* @__PURE__ */ n(o, {
28
+ return /* @__PURE__ */ n(r, {
29
29
  ...p,
30
30
  ref: m,
31
31
  rows: d ?? l,
@@ -9,4 +9,11 @@ export interface LinkProps extends Omit<AriaLinkProps, "children" | "className"
9
9
  ref?: Ref<HTMLAnchorElement>;
10
10
  children?: ReactNode;
11
11
  }
12
+ /**
13
+ * A standalone link affordance — a label with a trailing external-link or download
14
+ * icon, sized and spaced as its own control.
15
+ *
16
+ * Not an inline prose link: the box is `inline-flex`, so it cannot fragment across
17
+ * a line break. A link inside a message body is styled by `messageProse` instead.
18
+ */
12
19
  export declare function Link({ underlined, showIcon, download, className, children, ...rest }: LinkProps): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"Link.js","names":[],"sources":["../../../src/components/Link/Link.tsx"],"sourcesContent":["import type { CSSProperties, ReactNode, Ref } from \"react\";\nimport type { LinkProps as AriaLinkProps } from \"react-aria-components\";\nimport { Link as AriaLink } from \"react-aria-components\";\nimport { cx } from \"../../utils/cx.js\";\nimport { ArrowNortheast, Download } from \"../Icon/icons/index.js\";\nimport { linkRoot } from \"./Link.css.js\";\n\nexport interface LinkProps\n\textends Omit<AriaLinkProps, \"children\" | \"className\" | \"style\"> {\n\tunderlined?: boolean;\n\tshowIcon?: boolean;\n\tdownload?: boolean | string;\n\tclassName?: string;\n\tstyle?: CSSProperties;\n\tref?: Ref<HTMLAnchorElement>;\n\tchildren?: ReactNode;\n}\n\nexport function Link({\n\tunderlined = false,\n\tshowIcon = true,\n\tdownload,\n\tclassName,\n\tchildren,\n\t...rest\n}: LinkProps) {\n\tconst isDownload = download !== undefined && download !== false;\n\treturn (\n\t\t<AriaLink\n\t\t\t{...rest}\n\t\t\tdownload={download}\n\t\t\tdata-slot=\"link\"\n\t\t\tdata-icon={showIcon || undefined}\n\t\t\tdata-underlined={underlined || undefined}\n\t\t\tdata-download={isDownload || undefined}\n\t\t\tclassName={cx(linkRoot({ underlined }), className)}\n\t\t>\n\t\t\t{children}\n\t\t\t{showIcon && (isDownload ? <Download /> : <ArrowNortheast />)}\n\t\t</AriaLink>\n\t);\n}\n"],"mappings":";;;;;;;AAkBA,SAAgB,EAAK,EACpB,gBAAa,IACb,cAAW,IACX,aACA,cACA,aACA,GAAG,KACU;CACb,IAAM,IAAa,MAAa,KAAA,KAAa,MAAa;AAC1D,QACC,kBAAC,GAAD;EACC,GAAI;EACM;EACV,aAAU;EACV,aAAW,KAAY,KAAA;EACvB,mBAAiB,KAAc,KAAA;EAC/B,iBAAe,KAAc,KAAA;EAC7B,WAAW,EAAG,EAAS,EAAE,eAAY,CAAC,EAAE,EAAU;YAPnD,CASE,GACA,KAA0B,EAAb,IAAc,IAAe,GAAhB,EAAY,CAAqB,CAClD"}
1
+ {"version":3,"file":"Link.js","names":[],"sources":["../../../src/components/Link/Link.tsx"],"sourcesContent":["import type { CSSProperties, ReactNode, Ref } from \"react\";\nimport type { LinkProps as AriaLinkProps } from \"react-aria-components\";\nimport { Link as AriaLink } from \"react-aria-components\";\nimport { cx } from \"../../utils/cx.js\";\nimport { ArrowNortheast, Download } from \"../Icon/icons/index.js\";\nimport { linkRoot } from \"./Link.css.js\";\n\nexport interface LinkProps\n\textends Omit<AriaLinkProps, \"children\" | \"className\" | \"style\"> {\n\tunderlined?: boolean;\n\tshowIcon?: boolean;\n\tdownload?: boolean | string;\n\tclassName?: string;\n\tstyle?: CSSProperties;\n\tref?: Ref<HTMLAnchorElement>;\n\tchildren?: ReactNode;\n}\n\n/**\n * A standalone link affordance — a label with a trailing external-link or download\n * icon, sized and spaced as its own control.\n *\n * Not an inline prose link: the box is `inline-flex`, so it cannot fragment across\n * a line break. A link inside a message body is styled by `messageProse` instead.\n */\nexport function Link({\n\tunderlined = false,\n\tshowIcon = true,\n\tdownload,\n\tclassName,\n\tchildren,\n\t...rest\n}: LinkProps) {\n\tconst isDownload = download !== undefined && download !== false;\n\treturn (\n\t\t<AriaLink\n\t\t\t{...rest}\n\t\t\tdownload={download}\n\t\t\tdata-slot=\"link\"\n\t\t\tdata-icon={showIcon || undefined}\n\t\t\tdata-underlined={underlined || undefined}\n\t\t\tdata-download={isDownload || undefined}\n\t\t\tclassName={cx(linkRoot({ underlined }), className)}\n\t\t>\n\t\t\t{children}\n\t\t\t{showIcon && (isDownload ? <Download /> : <ArrowNortheast />)}\n\t\t</AriaLink>\n\t);\n}\n"],"mappings":";;;;;;;AAyBA,SAAgB,EAAK,EACpB,gBAAa,IACb,cAAW,IACX,aACA,cACA,aACA,GAAG,KACU;CACb,IAAM,IAAa,MAAa,KAAA,KAAa,MAAa;AAC1D,QACC,kBAAC,GAAD;EACC,GAAI;EACM;EACV,aAAU;EACV,aAAW,KAAY,KAAA;EACvB,mBAAiB,KAAc,KAAA;EAC/B,iBAAe,KAAc,KAAA;EAC7B,WAAW,EAAG,EAAS,EAAE,eAAY,CAAC,EAAE,EAAU;YAPnD,CASE,GACA,KAA0B,EAAb,IAAc,IAAe,GAAhB,EAAY,CAAqB,CAClD"}
@@ -1 +1 @@
1
- {"version":3,"file":"MenuItem.css.js","names":[],"sources":["../../../src/components/MenuItem/MenuItem.css.ts"],"sourcesContent":["import { globalStyle, style } from \"@vanilla-extract/css\";\nimport { rowFrame, rowSlotRules } from \"../../styles/row.js\";\n\nexport const menu = style({\n\tdisplay: \"flex\",\n\tflexDirection: \"column\",\n\toutline: \"none\",\n});\n\nexport const menuItem = style(rowFrame);\n\nglobalStyle(`${menuItem} > [data-slot=\"icon\"]`, rowSlotRules.icon);\nglobalStyle(`${menuItem} > [data-slot=\"label\"]`, rowSlotRules.label);\n"],"mappings":""}
1
+ {"version":3,"file":"MenuItem.css.js","names":[],"sources":["../../../src/components/MenuItem/MenuItem.css.ts"],"sourcesContent":["import { globalStyle, style } from \"@vanilla-extract/css\";\nimport {\n\tcontrolRowFrame,\n\tcontrolRowSlotRules,\n} from \"../../styles/control-row.js\";\n\nexport const menu = style({\n\tdisplay: \"flex\",\n\tflexDirection: \"column\",\n\toutline: \"none\",\n});\n\nexport const menuItem = style(controlRowFrame);\n\nglobalStyle(`${menuItem} > [data-slot=\"icon\"]`, controlRowSlotRules.icon);\nglobalStyle(`${menuItem} > [data-slot=\"label\"]`, controlRowSlotRules.label);\n"],"mappings":""}
@@ -2,20 +2,20 @@ import { cx as e } from "../../utils/cx.js";
2
2
  import { menuItem as t } from "./MenuItem.css.js";
3
3
  import { MenuItemLabel as n } from "./MenuItemLabel.js";
4
4
  import { jsx as r } from "react/jsx-runtime";
5
- import { Children as i, isValidElement as a } from "react";
6
- import { MenuItem as o } from "react-aria-components";
5
+ import { MenuItem as i } from "react-aria-components";
6
+ import { Children as a, isValidElement as o } from "react";
7
7
  //#region src/components/MenuItem/MenuItemRoot.tsx
8
8
  function s(e) {
9
- let t = i.toArray(e).find((e) => a(e) && e.type === n);
10
- if (a(t)) return typeof t.props.children == "string" ? t.props.children : void 0;
9
+ let t = a.toArray(e).find((e) => o(e) && e.type === n);
10
+ if (o(t)) return typeof t.props.children == "string" ? t.props.children : void 0;
11
11
  }
12
- function c({ className: n, children: i, textValue: a, ...c }) {
13
- let l = s(typeof i == "function" ? null : i);
14
- return /* @__PURE__ */ r(o, {
12
+ function c({ className: n, children: a, textValue: o, ...c }) {
13
+ let l = s(typeof a == "function" ? null : a);
14
+ return /* @__PURE__ */ r(i, {
15
15
  ...c,
16
- textValue: a ?? l,
16
+ textValue: o ?? l,
17
17
  className: e(t, n),
18
- children: i
18
+ children: a
19
19
  });
20
20
  }
21
21
  //#endregion
@@ -0,0 +1,5 @@
1
+ export declare const messageErrorRoot: string;
2
+ export declare const messageErrorContent: string;
3
+ export declare const messageErrorRetry: string;
4
+ export declare const messageErrorAnnouncement: string;
5
+ export declare const messageErrorText: string;
@@ -0,0 +1,7 @@
1
+ /* empty css */
2
+ //#region src/components/MessageError/MessageError.css.ts
3
+ var e = "_1pxs3ha0", t = "_1pxs3ha1", n = "_1pxs3ha2 _1pxs3ha1", r = "_1pxs3ha3", i = "_1pxs3ha4";
4
+ //#endregion
5
+ export { r as messageErrorAnnouncement, t as messageErrorContent, n as messageErrorRetry, e as messageErrorRoot, i as messageErrorText };
6
+
7
+ //# sourceMappingURL=MessageError.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MessageError.css.js","names":[],"sources":["../../../src/components/MessageError/MessageError.css.ts"],"sourcesContent":["import { globalStyle, style } from \"@vanilla-extract/css\";\nimport { t } from \"../../tokens/index.js\";\n\nexport const messageErrorRoot = style({\n\tdisplay: \"flex\",\n});\n\n// Shared layout for the failed-to-send row — icon + destructive-colored caption.\n// Used both interactively (the retry Button) and statically (no `onRetry`).\nexport const messageErrorContent = style({\n\tdisplay: \"inline-flex\",\n\talignItems: \"center\",\n\t// Sized to the error icon, and reserved even in the static variant that carries\n\t// none, so the row does not change height when a retry becomes available.\n\tminHeight: t(\"icon-size-lg\"),\n\tgap: t(\"gap-4\"),\n\tmargin: 0,\n\tcolor: t(\"color-content-destructive\"),\n});\n\n// The interactive retry control layers button affordances over the shared row.\nexport const messageErrorRetry = style([\n\tmessageErrorContent,\n\t{\n\t\tpadding: 0,\n\t\tborder: \"none\",\n\t\tbackground: \"none\",\n\t\tborderRadius: t(\"border-radius-6\"),\n\t\tcursor: \"pointer\",\n\t\toutline: \"none\",\n\t\tselectors: {\n\t\t\t\"&[data-focus-visible]\": {\n\t\t\t\tboxShadow: `0 0 0 ${t(\"border-width-focus\")} ${t(\"color-border-focus\")}`,\n\t\t\t},\n\t\t},\n\t\t\"@media\": {\n\t\t\t\"(forced-colors: active)\": {\n\t\t\t\tselectors: {\n\t\t\t\t\t\"&[data-focus-visible]\": {\n\t\t\t\t\t\toutline: \"2px solid Highlight\",\n\t\t\t\t\t\toutlineOffset: \"2px\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n]);\n\n// Carries the announced failure copy as real text (live regions announce\n// rendered text, not `aria-label`), while staying out of the visual layout.\nexport const messageErrorAnnouncement = style({\n\tposition: \"absolute\",\n\twidth: 1,\n\theight: 1,\n\tpadding: 0,\n\tmargin: -1,\n\toverflow: \"hidden\",\n\tclip: \"rect(0, 0, 0, 0)\",\n\twhiteSpace: \"nowrap\",\n\tborder: 0,\n\t// Clipped text is still selectable, so a select-all over the transcript would\n\t// otherwise copy the failure copy twice (EXP-1479).\n\tuserSelect: \"none\",\n\tWebkitUserSelect: \"none\",\n});\n\nexport const messageErrorText = style({\n\tmargin: 0,\n\tcolor: \"inherit\",\n\tfontFamily: t(\"font-family-body\"),\n\tfontWeight: t(\"font-weight-regular\"),\n\tfontSize: t(\"font-size-caption\"),\n\tlineHeight: t(\"line-height-caption\"),\n});\n\n// The exclamation.sync glyph renders at icon-size-lg (24px, Figma), driving\n// `<Icon>`'s 1em box — the same value that sets the row's reserved min-height.\nglobalStyle(`${messageErrorContent} [data-slot='icon']`, {\n\tfontSize: t(\"icon-size-lg\"),\n});\n"],"mappings":""}
@@ -0,0 +1,38 @@
1
+ import type { CSSProperties, Ref } from "react";
2
+ export interface MessageErrorProps {
3
+ /**
4
+ * Localized failure copy. With `onRetry` it is also the retry control's
5
+ * accessible name, and it is the announced string unless `announce` is off.
6
+ *
7
+ * A string rather than a node: the copy renders in both the announcement and
8
+ * the visible row, so a node would mount twice and duplicate every id and
9
+ * focus target it carries.
10
+ */
11
+ children: string;
12
+ /** Invoked when the retry affordance is activated (click / Enter / Space). */
13
+ onRetry?: () => void;
14
+ /**
15
+ * Announce the failure on mount through a visually-hidden `role="alert"`.
16
+ * Pass `false` on a surface that already announces message failures through
17
+ * a live region of its own: two regions announce the same text twice, in an
18
+ * order neither controls.
19
+ */
20
+ announce?: boolean;
21
+ className?: string;
22
+ style?: CSSProperties;
23
+ ref?: Ref<HTMLDivElement>;
24
+ }
25
+ /**
26
+ * The failed-to-send row shown beneath a message bubble: the copy, the retry
27
+ * affordance, and — unless `announce` is off — a visually-hidden `role="alert"`
28
+ * carrying the same copy, so a failure is announced without the consumer
29
+ * hand-rolling a live region. With `onRetry` the visible copy stays exposed
30
+ * rather than `aria-hidden`, because it is the retry control's accessible name
31
+ * on focus. Without `onRetry` there is nothing to retry, so the copy renders as
32
+ * static text rather than a control that does nothing — and it is hidden from
33
+ * assistive tech while `announce` is on, since it would otherwise be read once
34
+ * as the alert and again as ordinary transcript text. Alignment is the
35
+ * consumer's: the row lays out at its container's leading edge until placed
36
+ * otherwise.
37
+ */
38
+ export declare function MessageError({ children, onRetry, announce, className, ...rest }: MessageErrorProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,38 @@
1
+ import { cx as e } from "../../utils/cx.js";
2
+ import { ExclamationSync as t } from "../Icon/icons/ExclamationSync.js";
3
+ import { messageErrorContent as n, messageErrorRetry as r, messageErrorRoot as i, messageErrorText as a } from "./MessageError.css.js";
4
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
5
+ import { Button as c } from "react-aria-components";
6
+ //#region src/components/MessageError/MessageError.tsx
7
+ function l({ children: l, onRetry: u, announce: d = !0, className: f, ...p }) {
8
+ return /* @__PURE__ */ s("div", {
9
+ ...p,
10
+ className: e(i, f),
11
+ children: [d && /* @__PURE__ */ o("span", {
12
+ dir: "auto",
13
+ role: "alert",
14
+ className: "_1pxs3ha3",
15
+ children: l
16
+ }), u ? /* @__PURE__ */ s(c, {
17
+ className: r,
18
+ onPress: u,
19
+ children: [/* @__PURE__ */ o(t, {}), /* @__PURE__ */ o("span", {
20
+ dir: "auto",
21
+ className: a,
22
+ children: l
23
+ })]
24
+ }) : /* @__PURE__ */ o("span", {
25
+ className: n,
26
+ "aria-hidden": d || void 0,
27
+ children: /* @__PURE__ */ o("span", {
28
+ dir: "auto",
29
+ className: a,
30
+ children: l
31
+ })
32
+ })]
33
+ });
34
+ }
35
+ //#endregion
36
+ export { l as MessageError };
37
+
38
+ //# sourceMappingURL=MessageError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MessageError.js","names":[],"sources":["../../../src/components/MessageError/MessageError.tsx"],"sourcesContent":["import type { CSSProperties, Ref } from \"react\";\nimport { Button as AriaButton } from \"react-aria-components\";\nimport { cx } from \"../../utils/cx.js\";\nimport { ExclamationSync } from \"../Icon/icons/index.js\";\nimport {\n\tmessageErrorAnnouncement,\n\tmessageErrorContent,\n\tmessageErrorRetry,\n\tmessageErrorRoot,\n\tmessageErrorText,\n} from \"./MessageError.css.js\";\n\nexport interface MessageErrorProps {\n\t/**\n\t * Localized failure copy. With `onRetry` it is also the retry control's\n\t * accessible name, and it is the announced string unless `announce` is off.\n\t *\n\t * A string rather than a node: the copy renders in both the announcement and\n\t * the visible row, so a node would mount twice and duplicate every id and\n\t * focus target it carries.\n\t */\n\tchildren: string;\n\t/** Invoked when the retry affordance is activated (click / Enter / Space). */\n\tonRetry?: () => void;\n\t/**\n\t * Announce the failure on mount through a visually-hidden `role=\"alert\"`.\n\t * Pass `false` on a surface that already announces message failures through\n\t * a live region of its own: two regions announce the same text twice, in an\n\t * order neither controls.\n\t */\n\tannounce?: boolean;\n\tclassName?: string;\n\tstyle?: CSSProperties;\n\tref?: Ref<HTMLDivElement>;\n}\n\n/**\n * The failed-to-send row shown beneath a message bubble: the copy, the retry\n * affordance, and — unless `announce` is off — a visually-hidden `role=\"alert\"`\n * carrying the same copy, so a failure is announced without the consumer\n * hand-rolling a live region. With `onRetry` the visible copy stays exposed\n * rather than `aria-hidden`, because it is the retry control's accessible name\n * on focus. Without `onRetry` there is nothing to retry, so the copy renders as\n * static text rather than a control that does nothing — and it is hidden from\n * assistive tech while `announce` is on, since it would otherwise be read once\n * as the alert and again as ordinary transcript text. Alignment is the\n * consumer's: the row lays out at its container's leading edge until placed\n * otherwise.\n */\nexport function MessageError({\n\tchildren,\n\tonRetry,\n\tannounce = true,\n\tclassName,\n\t...rest\n}: MessageErrorProps) {\n\treturn (\n\t\t<div {...rest} className={cx(messageErrorRoot, className)}>\n\t\t\t{announce && (\n\t\t\t\t<span dir=\"auto\" role=\"alert\" className={messageErrorAnnouncement}>\n\t\t\t\t\t{children}\n\t\t\t\t</span>\n\t\t\t)}\n\t\t\t{onRetry ? (\n\t\t\t\t<AriaButton className={messageErrorRetry} onPress={onRetry}>\n\t\t\t\t\t<ExclamationSync />\n\t\t\t\t\t<span dir=\"auto\" className={messageErrorText}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</span>\n\t\t\t\t</AriaButton>\n\t\t\t) : (\n\t\t\t\t// No control to name here, so the copy is exposed only when nothing else\n\t\t\t\t// announces it — otherwise the hidden alert above already reads it and a\n\t\t\t\t// reader browsing the transcript would hear the failure twice.\n\t\t\t\t<span\n\t\t\t\t\tclassName={messageErrorContent}\n\t\t\t\t\taria-hidden={announce || undefined}\n\t\t\t\t>\n\t\t\t\t\t<span dir=\"auto\" className={messageErrorText}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</span>\n\t\t\t\t</span>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;AAiDA,SAAgB,EAAa,EAC5B,aACA,YACA,cAAW,IACX,cACA,GAAG,KACkB;AACrB,QACC,kBAAC,OAAD;EAAK,GAAI;EAAM,WAAW,EAAG,GAAkB,EAAU;YAAzD,CACE,KACA,kBAAC,QAAD;GAAM,KAAI;GAAO,MAAK;GAAQ,WAAA;GAC5B;GACK,CAAA,EAEP,IACA,kBAAC,GAAD;GAAY,WAAW;GAAmB,SAAS;aAAnD,CACC,kBAAC,GAAD,EAAmB,CAAA,EACnB,kBAAC,QAAD;IAAM,KAAI;IAAO,WAAW;IAC1B;IACK,CAAA,CACK;OAKb,kBAAC,QAAD;GACC,WAAW;GACX,eAAa,KAAY,KAAA;aAEzB,kBAAC,QAAD;IAAM,KAAI;IAAO,WAAW;IAC1B;IACK,CAAA;GACD,CAAA,CAEH"}
@@ -0,0 +1 @@
1
+ export { MessageError, type MessageErrorProps } from "./MessageError.js";
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Block-flow rules for a message body hosting rendered Markdown.
3
+ *
4
+ * One class rather than a spread `StyleRule` (the `controlRowFrame` shape):
5
+ * these are descendant rules, and vanilla-extract's `selectors` key can only
6
+ * target `&` itself, so `p + p` is only expressible through `globalStyle`
7
+ * against a real class. The host is a prose body with no role of its own, so unlike a row it
8
+ * can carry a cascade safely.
9
+ *
10
+ * Typography lives here rather than on each message component, and reads the
11
+ * `message-content-*` Component tokens rather than the semantic tiers directly.
12
+ * Those alias the tiers today, so this is zero-change — they exist so message
13
+ * text can later be sized or coloured independently of UI text (a readability
14
+ * and accessibility ask) without a second hard-coded scale. `UserMessage`
15
+ * re-points the colour for its accent fill, the same way it re-points the link.
16
+ *
17
+ * `Text` (EXP-1054) is deliberately not the owner: it is UI typography, and a
18
+ * message body is a document tree a renderer emits, not a UI element.
19
+ */
20
+ export declare const messageProse: string;
@@ -0,0 +1,7 @@
1
+ /* empty css */
2
+ //#region src/components/MessageProse/MessageProse.css.ts
3
+ var e = "slrdvx0";
4
+ //#endregion
5
+ export { e as messageProse };
6
+
7
+ //# sourceMappingURL=MessageProse.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MessageProse.css.js","names":[],"sources":["../../../src/components/MessageProse/MessageProse.css.ts"],"sourcesContent":["import { globalStyle, style } from \"@vanilla-extract/css\";\nimport { t } from \"../../tokens/index.js\";\n\n/**\n * Block-flow rules for a message body hosting rendered Markdown.\n *\n * One class rather than a spread `StyleRule` (the `controlRowFrame` shape):\n * these are descendant rules, and vanilla-extract's `selectors` key can only\n * target `&` itself, so `p + p` is only expressible through `globalStyle`\n * against a real class. The host is a prose body with no role of its own, so unlike a row it\n * can carry a cascade safely.\n *\n * Typography lives here rather than on each message component, and reads the\n * `message-content-*` Component tokens rather than the semantic tiers directly.\n * Those alias the tiers today, so this is zero-change — they exist so message\n * text can later be sized or coloured independently of UI text (a readability\n * and accessibility ask) without a second hard-coded scale. `UserMessage`\n * re-points the colour for its accent fill, the same way it re-points the link.\n *\n * `Text` (EXP-1054) is deliberately not the owner: it is UI typography, and a\n * message body is a document tree a renderer emits, not a UI element.\n */\nexport const messageProse = style({\n\tcolor: t(\"message-content-default\"),\n\tfontFamily: t(\"font-family-body\"),\n\tfontWeight: t(\"font-weight-regular\"),\n\tfontSize: t(\"message-content-font-size-body\"),\n\tlineHeight: t(\"message-content-line-height-body\"),\n\t// Bot-authored and chatter-typed text can both carry an unbroken token\n\t// longer than the bubble.\n\toverflowWrap: \"anywhere\",\n\twordBreak: \"break-word\",\n});\n\n// Lovelace ships no global reset, so a consumer's rendered Markdown arrives with\n// UA margins. `packages/app` never sees them: `packages/ui/src/styles/global.ts`\n// zeroes every margin app-wide, and the rules below add the spacing back.\nglobalStyle(\n\t`${messageProse} :is(p, ul, ol, h1, h2, h3, h4, h5, h6, pre, blockquote, table, hr)`,\n\t{\n\t\tmargin: 0,\n\t},\n);\n\nglobalStyle(`${messageProse} :is(ul, ol)`, {\n\t// Legacy chat indents 15px; the nearest token wins over an untokenized value.\n\tpaddingInlineStart: t(\"padding-16\"),\n\tmargin: `${t(\"gap-4\")} 0`,\n});\n\n// Legacy chat has no paragraphs — it renders Markdown into a `pre-wrap` container\n// and spaces blank lines with a 1rem `double-line-break` span. 16px is that gap.\nglobalStyle(`${messageProse} p + p`, {\n\tmarginTop: t(\"gap-16\"),\n});\n\n// `:where()` keeps the mark rules at (0,0,1) so a component placed in the body\n// keeps its own styling: unguarded, `.messageProse a` at (0,1,1) would beat\n// `Link`'s `linkRoot` at (0,1,0).\nglobalStyle(`:where(${messageProse}) a`, {\n\t// Re-pointed per body rather than reading `color-content-link` directly —\n\t// `UserMessage` moves it for the accent fill.\n\tcolor: t(\"message-content-link\"),\n\t// The non-color cue a link needs to read as one (WCAG 1.4.1).\n\ttextDecoration: \"underline\",\n});\n\nglobalStyle(`:where(${messageProse}) strong`, {\n\tfontWeight: t(\"font-weight-semi-bold\"),\n});\n"],"mappings":""}
@@ -0,0 +1,25 @@
1
+ import type { CSSProperties, ReactNode, Ref } from "react";
2
+ export interface MessageProseProps {
3
+ /** The per-sender class the hosting message component adds. */
4
+ className?: string;
5
+ style?: CSSProperties;
6
+ ref?: Ref<HTMLDivElement>;
7
+ children?: ReactNode;
8
+ }
9
+ /**
10
+ * The body element of a message: the prose rules, message typography, and
11
+ * `dir="auto"`.
12
+ *
13
+ * Internal — not exported from the package. It exists because the pairing of
14
+ * `dir="auto"` with the prose class is an invariant that a shared *style*
15
+ * cannot carry: direction detection is markup. Both message components
16
+ * repeated the pair with nothing enforcing it.
17
+ *
18
+ * It stamps `data-slot="message-body"`, which is the only stable way to find a
19
+ * rendered message body: the class names are build hashes. Both message
20
+ * components inherit the hook by composing this.
21
+ *
22
+ * `dir` is applied after the caller's props so a consumer cannot break the
23
+ * pairing by passing one.
24
+ */
25
+ export declare function MessageProse({ className, children, ...rest }: MessageProseProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { cx as e } from "../../utils/cx.js";
2
+ import { messageProse as t } from "./MessageProse.css.js";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ //#region src/components/MessageProse/MessageProse.tsx
5
+ function r({ className: r, children: i, ...a }) {
6
+ return /* @__PURE__ */ n("div", {
7
+ ...a,
8
+ dir: "auto",
9
+ "data-slot": "message-body",
10
+ className: e(t, r),
11
+ children: i
12
+ });
13
+ }
14
+ //#endregion
15
+ export { r as MessageProse };
16
+
17
+ //# sourceMappingURL=MessageProse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MessageProse.js","names":[],"sources":["../../../src/components/MessageProse/MessageProse.tsx"],"sourcesContent":["import type { CSSProperties, ReactNode, Ref } from \"react\";\nimport { cx } from \"../../utils/cx.js\";\nimport { messageProse } from \"./MessageProse.css.js\";\n\nexport interface MessageProseProps {\n\t/** The per-sender class the hosting message component adds. */\n\tclassName?: string;\n\tstyle?: CSSProperties;\n\tref?: Ref<HTMLDivElement>;\n\tchildren?: ReactNode;\n}\n\n/**\n * The body element of a message: the prose rules, message typography, and\n * `dir=\"auto\"`.\n *\n * Internal — not exported from the package. It exists because the pairing of\n * `dir=\"auto\"` with the prose class is an invariant that a shared *style*\n * cannot carry: direction detection is markup. Both message components\n * repeated the pair with nothing enforcing it.\n *\n * It stamps `data-slot=\"message-body\"`, which is the only stable way to find a\n * rendered message body: the class names are build hashes. Both message\n * components inherit the hook by composing this.\n *\n * `dir` is applied after the caller's props so a consumer cannot break the\n * pairing by passing one.\n */\nexport function MessageProse({\n\tclassName,\n\tchildren,\n\t...rest\n}: MessageProseProps) {\n\treturn (\n\t\t<div\n\t\t\t{...rest}\n\t\t\tdir=\"auto\"\n\t\t\tdata-slot=\"message-body\"\n\t\t\tclassName={cx(messageProse, className)}\n\t\t>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;AA4BA,SAAgB,EAAa,EAC5B,cACA,aACA,GAAG,KACkB;AACrB,QACC,kBAAC,OAAD;EACC,GAAI;EACJ,KAAI;EACJ,aAAU;EACV,WAAW,EAAG,GAAc,EAAU;EAErC;EACI,CAAA"}
@@ -0,0 +1,2 @@
1
+ export type { MessageProseProps } from "./MessageProse.js";
2
+ export { MessageProse } from "./MessageProse.js";
@@ -0,0 +1,5 @@
1
+ export type MessageSender = "user" | "agent";
2
+ /** Lets `MessageRow.Content` align and cap itself, so a caller cannot pass a
3
+ * row and a column that disagree on the sender. */
4
+ export declare const MessageRowContext: import("react").Context<MessageSender>;
5
+ export declare const useMessageRowSender: () => MessageSender;
@@ -0,0 +1,7 @@
1
+ import { createContext as e, useContext as t } from "react";
2
+ //#region src/components/MessageRow/MessageRow.context.ts
3
+ var n = e("agent"), r = () => t(n);
4
+ //#endregion
5
+ export { n as MessageRowContext, r as useMessageRowSender };
6
+
7
+ //# sourceMappingURL=MessageRow.context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MessageRow.context.js","names":[],"sources":["../../../src/components/MessageRow/MessageRow.context.ts"],"sourcesContent":["import { createContext, useContext } from \"react\";\n\nexport type MessageSender = \"user\" | \"agent\";\n\n/** Lets `MessageRow.Content` align and cap itself, so a caller cannot pass a\n * row and a column that disagree on the sender. */\nexport const MessageRowContext = createContext<MessageSender>(\"agent\");\n\nexport const useMessageRowSender = () => useContext(MessageRowContext);\n"],"mappings":";;AAMA,IAAa,IAAoB,EAA6B,QAAQ,EAEzD,UAA4B,EAAW,EAAkB"}
@@ -0,0 +1,29 @@
1
+ export declare const messageRowRoot: import("@vanilla-extract/recipes").RuntimeFn<{
2
+ sender: {
3
+ agent: {
4
+ justifyContent: "flex-start";
5
+ };
6
+ user: {
7
+ justifyContent: "flex-end";
8
+ };
9
+ };
10
+ }>;
11
+ export declare const messageRowContent: import("@vanilla-extract/recipes").RuntimeFn<{
12
+ sender: {
13
+ user: {
14
+ alignItems: "flex-end";
15
+ };
16
+ agent: {
17
+ alignItems: "stretch";
18
+ };
19
+ };
20
+ fill: {
21
+ true: {
22
+ flex: "1 1 0";
23
+ maxWidth: "100%";
24
+ };
25
+ false: {
26
+ flex: "0 1 auto";
27
+ };
28
+ };
29
+ }>;
@@ -0,0 +1,39 @@
1
+ import { createRuntimeFn as e } from "../../vendor/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js";
2
+ /* empty css */
3
+ //#region src/components/MessageRow/MessageRow.css.ts
4
+ var t = e({
5
+ defaultClassName: "_16xwgyj0",
6
+ variantClassNames: { sender: {
7
+ agent: "_16xwgyj1",
8
+ user: "_16xwgyj2"
9
+ } },
10
+ defaultVariants: { sender: "agent" },
11
+ compoundVariants: []
12
+ }), n = e({
13
+ defaultClassName: "_16xwgyj3",
14
+ variantClassNames: {
15
+ sender: {
16
+ user: "_16xwgyj4",
17
+ agent: "_16xwgyj5"
18
+ },
19
+ fill: {
20
+ true: "_16xwgyj6",
21
+ false: "_16xwgyj7"
22
+ }
23
+ },
24
+ defaultVariants: {
25
+ sender: "agent",
26
+ fill: !1
27
+ },
28
+ compoundVariants: [[{
29
+ sender: "user",
30
+ fill: !1
31
+ }, "_16xwgyj8"], [{
32
+ sender: "agent",
33
+ fill: !1
34
+ }, "_16xwgyj9"]]
35
+ });
36
+ //#endregion
37
+ export { n as messageRowContent, t as messageRowRoot };
38
+
39
+ //# sourceMappingURL=MessageRow.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MessageRow.css.js","names":[],"sources":["../../../src/components/MessageRow/MessageRow.css.ts"],"sourcesContent":["import { recipe } from \"@vanilla-extract/recipes\";\nimport { t } from \"../../tokens/index.js\";\n\nexport const messageRowRoot = recipe({\n\tbase: {\n\t\tdisplay: \"flex\",\n\t\talignItems: \"flex-start\",\n\t\tgap: t(\"gap-12\"),\n\t},\n\tvariants: {\n\t\tsender: {\n\t\t\tagent: { justifyContent: \"flex-start\" },\n\t\t\tuser: { justifyContent: \"flex-end\" },\n\t\t},\n\t},\n\tdefaultVariants: { sender: \"agent\" },\n});\n\nexport const messageRowContent = recipe({\n\tbase: {\n\t\tdisplay: \"flex\",\n\t\tflexDirection: \"column\",\n\t\tminWidth: 0,\n\t\t// Message type and wrapping sit here rather than on the message body, so a\n\t\t// row whose content is a card, a widget or media reads at message size and\n\t\t// still breaks an unbroken token. Those rows render no message body, and\n\t\t// without this they fall through to the consumer's document default.\n\t\tfontFamily: t(\"font-family-body\"),\n\t\tfontSize: t(\"message-content-font-size-body\"),\n\t\tlineHeight: t(\"message-content-line-height-body\"),\n\t\tcolor: t(\"message-content-default\"),\n\t\toverflowWrap: \"anywhere\",\n\t\twordBreak: \"break-word\",\n\t},\n\tvariants: {\n\t\tsender: {\n\t\t\t// The chatter's bubble shrink-wraps. A sibling can be wider, as a\n\t\t\t// delivery-failure row usually is, and nothing else would hold that\n\t\t\t// sibling against the trailing edge.\n\t\t\tuser: { alignItems: \"flex-end\" },\n\t\t\tagent: { alignItems: \"stretch\" },\n\t\t},\n\t\tfill: {\n\t\t\ttrue: { flex: \"1 1 0\", maxWidth: \"100%\" },\n\t\t\tfalse: { flex: \"0 1 auto\" },\n\t\t},\n\t},\n\tcompoundVariants: [\n\t\t// The cap is a share of the whole row, avatar gutter included. Capping the\n\t\t// content's own box instead would subtract the avatar and the gap again and\n\t\t// run the text about 36px narrower.\n\t\t//\n\t\t// Only the chatter takes the narrow arm. Legacy chat splits on `nonBubble`,\n\t\t// which in the generative engine is true for every bot and agent group, so\n\t\t// the sender split here is the same rule. Legacy's own 70% chatter cap reads\n\t\t// too tight against 90%, and its `max-width: 60%` arm under 374px is not\n\t\t// ported: it spends about 115px of a 288px row on empty gutter, and legacy\n\t\t// emits it at equal specificity so it drags the bot down too.\n\t\t{ variants: { sender: \"user\", fill: false }, style: { maxWidth: \"80%\" } },\n\t\t{ variants: { sender: \"agent\", fill: false }, style: { maxWidth: \"90%\" } },\n\t],\n\tdefaultVariants: { sender: \"agent\", fill: false },\n});\n"],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import { MessageRowContent } from "./MessageRowContent.js";
2
+ import { MessageRowRoot } from "./MessageRowRoot.js";
3
+ export type { MessageSender } from "./MessageRow.context.js";
4
+ export type { MessageRowContentProps } from "./MessageRowContent.js";
5
+ export type { MessageRowProps } from "./MessageRowRoot.js";
6
+ export declare const MessageRow: typeof MessageRowRoot & {
7
+ Content: typeof MessageRowContent;
8
+ };