# RamonAI Widget

A responsive shopping assistant widget built with React and Vite. It renders a floating launcher and a chat panel that you can drop into any storefront.

## Usage / embedding

### Single tag (CDN or self-hosted)

Add one script tag anywhere in your page. Works in all projects (vanilla HTML, React, Vue, Next.js, etc.). `type="module"` is fine, but not required.

```html
<script
  type="module"
  id="ramonai-widget"
  src="https://cdn.jsdelivr.net/npm/ramonai-widget@latest/dist/ramonai-widget.js"
  data-shop-name="Your Shop"
  <!-- data-accent="#242424" -->
  <!-- data-target="#ramonai-host" -->
></script>
```

Supported attributes map to the public API:

- `data-shop-name`: display name shown in the UI.
- `data-accent` (alias `data-accent-color`): hex/color string for the accent.
- `data-target`: optional CSS selector for a host element to mount into. If omitted, the widget creates a fixed host element and mounts into `<body>`.

Note: `data-autoinit` is not required. The widget auto-initializes when it detects the `id="ramonai-widget"` script or any meaningful config attributes.

### Options

| name | type | default | description |
| --- | --- | --- | --- |
| `shopName` | `string` | `"فروشگاه شما"` | Display name shown in the widget greeting/labels. |
| `accent` | `string` | `#242424` | Accent color used by the UI. |
| `target` | `HTMLElement` | `undefined` | Optional host element to mount the widget into. If omitted, a default fixed host is appended to `<body>`. |

Notes:

- The script auto-initializes from the tag and reads the attributes listed above. `data-accent-color` is accepted as an alias for `data-accent`.
- The library build inlines `process.env` at build time, so no client polyfills are necessary.