{
  "_copyright": "Copyright (c) 2026, Salesforce, Inc., All rights reserved. For full license text, see the LICENSE.txt file",
  "$schema": "https://slds.lightningdesignsystem.com/schemas/uif-system.v1.json",
  "apiVersion": "1.0.0",
  "name": "Publisher",
  "description": "Composer surface that pairs a textarea input with a row of inline actions and a primary submit button, used for posting updates or comments.",
  "extensions": {
    "com.salesforce-ux": {
      "genReady": false
    }
  },
  "cssSource": "./publisher.css",
  "styleApi": {
    "status": "stable",
    "ready": true
  },
  "structure": {
    "name": "publisher",
    "restrict": [
      "div"
    ],
    "description": "Root publisher container that hosts the label, textarea input, and actions row.",
    "attributes": {
      "static": {
        "class": "slds-publisher"
      }
    },
    "variants": [
      {
        "name": "treatment",
        "description": "Mutually exclusive presentation. The base treatment renders inline without a border; the comment treatment is a bordered, height-constrained surface used inside threaded media objects.",
        "options": [
          {
            "value": "base",
            "class": "",
            "description": "Default base publisher with no additional class applied to the root."
          },
          {
            "value": "comment",
            "class": "slds-publisher_comment",
            "description": "Bordered comment publisher used when composing replies inside a comment thread."
          }
        ]
      }
    ],
    "children": [
      {
        "name": "label",
        "restrict": [
          "label"
        ],
        "description": "Visible or visually hidden label associated with the textarea via for/id. In the base treatment it uses the toggle-visibility class so the label is hidden until the publisher is active; in the comment treatment it is permanently visually hidden via slds-assistive-text.",
        "attributes": {
          "static": {
            "class": "slds-publisher__toggle-visibility slds-m-bottom_small"
          }
        },
        "children": [
          {
            "name": "labelAssistiveText",
            "restrict": [
              "span"
            ],
            "description": "Visually hidden text that announces the publisher's purpose to assistive technology.",
            "renderWhen": "propFilled",
            "attributes": {
              "static": {
                "class": "slds-assistive-text"
              }
            }
          }
        ]
      },
      {
        "name": "input",
        "restrict": [
          "textarea"
        ],
        "description": "Multi-line text input where the user composes the post or comment. Carries the absorbed textarea / input_bare and longform-text classes from the rendered markup in addition to the publisher input class.",
        "attributes": {
          "static": {
            "class": "slds-publisher__input slds-textarea slds-text-longform"
          }
        }
      },
      {
        "name": "actions",
        "restrict": [
          "div"
        ],
        "description": "Bottom row that holds the inline icon-button toolbar on the inline-start side and the primary submit button on the inline-end side.",
        "attributes": {
          "static": {
            "class": "slds-publisher__actions slds-grid slds-grid_align-spread"
          }
        },
        "children": [
          {
            "name": "actionsList",
            "restrict": [
              "ul"
            ],
            "description": "List of inline icon-button actions (mention, attach, etc.). In the base treatment this list uses the toggle-visibility class so it is hidden until the publisher is active; in the comment treatment it is always visible.",
            "attributes": {
              "static": {
                "class": "slds-grid slds-publisher__toggle-visibility"
              }
            },
            "children": [
              {
                "name": "actionItem",
                "restrict": [
                  "li"
                ],
                "description": "Single inline action wrapping an icon button.",
                "repeats": true,
                "children": [
                  {
                    "name": "actionButton",
                    "restrict": [
                      "button"
                    ],
                    "description": "Icon button for an inline action such as mention or attach.",
                    "attributes": {
                      "static": {
                        "class": "slds-button slds-button_icon slds-button_icon-container"
                      }
                    },
                    "children": [
                      {
                        "name": "actionIcon",
                        "description": "Glyph rendered inside the inline action button.",
                        "attributes": {
                          "static": {
                            "class": "slds-button__icon"
                          }
                        },
                        "component": "PrimitiveIcon"
                      },
                      {
                        "name": "actionAssistiveText",
                        "restrict": [
                          "span"
                        ],
                        "description": "Visually hidden label that names the inline action for assistive technology.",
                        "attributes": {
                          "static": {
                            "class": "slds-assistive-text"
                          }
                        }
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "name": "submit",
            "restrict": [
              "button"
            ],
            "description": "Primary submit button that posts the composed content (labeled \"Share\" in the base treatment and \"Comment\" in the comment treatment).",
            "attributes": {
              "static": {
                "class": "slds-button slds-button_brand"
              }
            }
          }
        ]
      },
      {
        "name": "attachments",
        "restrict": [
          "div"
        ],
        "description": "Optional attachments region rendered below the actions row inside a comment publisher, hosting previews of files added via the attach action.",
        "attributes": {
          "static": {
            "class": "slds-attachments"
          }
        }
      }
    ]
  },
  "stateClasses": [
    {
      "state": "active",
      "class": "slds-is-active"
    },
    {
      "state": "focused",
      "class": "slds-has-focus"
    }
  ],
  "componentRefs": {
    "PrimitiveIcon": {
      "description": "Bare SVG icon composed directly inside the component. The host node supplies the SVG class (e.g. slds-button__icon, slds-menu__item-icon) via componentProps; PrimitiveIcon contributes the sprite-href binding.",
      "props": {
        "iconName": {
          "type": "string",
          "required": true,
          "description": "Sprite reference for the icon glyph"
        }
      }
    }
  },
  "states": [
    {
      "name": "active",
      "type": "boolean",
      "description": "Whether the component is in the active state"
    },
    {
      "name": "focused",
      "type": "boolean",
      "description": "Whether the component is in the focused state"
    }
  ]
}
