@salesql/sql_components_vue3 3.0.0 → 3.2.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.
package/llms-full.txt CHANGED
@@ -1,4 +1,4 @@
1
- # @salesql/sql_components_vue3 — SalesQL Design System (v3.0.0)
1
+ # @salesql/sql_components_vue3 — SalesQL Design System (v3.2.0)
2
2
 
3
3
  > Librería de componentes Vue 3 (SalesQL) Presentational-only Vue 3 components (props in, events out; the consuming app owns state, i18n and data). This file is auto-generated from the component stories for LLM/agent consumption — do not edit by hand.
4
4
 
@@ -11,7 +11,33 @@ import '@salesql/sql_components_vue3/dist/style.css'; // once, at app entry
11
11
 
12
12
  All components are named exports with the `Ds` prefix. Variant constants and TypeScript types ship alongside each component (e.g. `DS_BUTTON_VARIANTS`, `DsButtonVariant`). Components never fetch data or hold app state — drive them with props and listen to their events.
13
13
 
14
- ## Components (30)
14
+ ## Icon font — REQUIRED in the consuming app
15
+
16
+ Components that draw an icon emit `<i class="material-symbols-filled">{ligature}</i>`. The library ships **neither the font nor that class** — a component library must not impose a global baseline (see SALESQL-3454). The app MUST provide both, or every glyph renders as its own ligature name (a literal `close` instead of ✕).
17
+
18
+ 1. Load the font, e.g. in `index.html`:
19
+
20
+ ```html
21
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,400,0..1,0" />
22
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0..1,0" />
23
+ ```
24
+
25
+ 2. Define the object class globally:
26
+
27
+ ```css
28
+ .material-symbols-filled {
29
+ font-family: 'Material Symbols Rounded';
30
+ font-weight: normal;
31
+ font-style: normal;
32
+ font-size: 20px;
33
+ line-height: 20px;
34
+ font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
35
+ }
36
+ ```
37
+
38
+ Components size their own glyphs (their scoped rules outrank the 20px default), so the class only has to supply the family and fill. Consumers with a `#leading`/`#trailing` slot may pass any element they like instead.
39
+
40
+ ## Components (32)
15
41
 
16
42
  - **DsAvatar** (Core) — Contact/user avatar: an image, generated initials with a deterministic color hash, or an
17
43
  - **DsBadge** (Core) — Solid, white-text pill for value types and counts (e.g. "Work", "New"). **Presentational
@@ -43,6 +69,8 @@ All components are named exports with the `Ds` prefix. Variant constants and Typ
43
69
  - **DsTextarea** (Forms) — Multi-line text field — the DS "Textarea", sibling of `DsInput` with the same
44
70
  - **DsMenuItem** (Navigation) — Sidebar navigation row: an icon with an optional label, usable full-width or collapsed to
45
71
  - **DsWizardStepper** (Navigation) — Numbered multi-step flow: a row of step chips (completed / active / incomplete / neutral)
72
+ - **DsDrawer** (Overlays) — Side panel over a backdrop. Built **native** — no `element-plus` — so the Vue 2 twin
73
+ - **DsPopover** (Overlays) — Click-triggered card panel anchored to a trigger. Built **native** — no `element-plus`,
46
74
 
47
75
  ---
48
76
  <!-- DsAvatar · Core -->
@@ -517,7 +545,7 @@ label via the default slot, intent out via `click`.
517
545
 
518
546
  | Prop | Type | Default | Description |
519
547
  | ------------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------ |
520
- | `icon` | `string` | `''` | Material Icons ligature name; when set, renders a trailing icon button. |
548
+ | `icon` | `string` | `''` | Material Symbols ligature name; when set, renders a trailing icon button. |
521
549
  | `background` | `string` | `''` | Free-form CSS color (e.g. a dynamic tag/folder color); when empty, falls back to the default token background (`$slate-soft`). |
522
550
  | `iconLabel` | `string` | `''` | Accessible name for the trailing icon button (icon-only control). |
523
551
 
@@ -1058,7 +1086,7 @@ only the current selection it's handed via `item`.
1058
1086
  | Prop | Type | Default | Description |
1059
1087
  | ------------ | ------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1060
1088
  | `item` | `DsSelectorItem \| null` | `null` | Selected item (`{ name, color? }`); `null`/absent renders the empty state. |
1061
- | `icon` | `string` | `''` | Material Icons ligature (e.g. `folder`); omitted entirely (no icon rendered) when unset. |
1089
+ | `icon` | `string` | `''` | Material Symbols ligature (e.g. `folder`); omitted entirely (no icon rendered) when unset. |
1062
1090
  | `emptyTitle` | `string` | `''` | Visible label shown when `item` is empty. |
1063
1091
  | `ariaLabel` | `string` | `''` | Accessible name for the button. Required when the empty state has no `emptyTitle` (otherwise the button would have no name); when `item.name`/`emptyTitle` render, that visible text already names it. |
1064
1092
  | `disabled` | `boolean` | `false` | Disables the button (opacity 0.6) and blocks the click handler. |
@@ -1275,7 +1303,7 @@ an icon-only rail. **Presentational only**: it renders as a real `<button>` and
1275
1303
 
1276
1304
  | Prop | Type | Default | Description |
1277
1305
  | ----------- | --------- | ------------ | --------------------------------------------------------------------------------------------------------- |
1278
- | `icon` | `string` | — (required) | Material Icons ligature name. |
1306
+ | `icon` | `string` | — (required) | Material Symbols ligature name. |
1279
1307
  | `text` | `string` | `''` | Row label; a default slot overrides it. Stays in the DOM (visually hidden, not removed) when `collapsed`. |
1280
1308
  | `active` | `boolean` | `false` | Marks the current row: white surface, tinted border, `aria-current="page"`. |
1281
1309
  | `collapsed` | `boolean` | `false` | Icon-only collapsed rail. |
@@ -1348,3 +1376,190 @@ the current step (`value`) and the button copy.
1348
1376
  user needs to see progress and jump back to prior steps.
1349
1377
  - For a non-linear sidebar/rail instead, use `DsMenuItem`; for an unlabeled
1350
1378
  percentage/quota breakdown use `DsSegmentedProgressBar`.
1379
+
1380
+ ---
1381
+
1382
+ <!-- DsDrawer · Overlays -->
1383
+
1384
+ ## DsDrawer
1385
+
1386
+ Side panel over a backdrop. Built **native** — no `element-plus` — so the Vue 2 twin
1387
+ (`@salesql/sql_components`, for `front` and `extension-lite`) can replicate the same API
1388
+ and markup; Element Plus is Vue 3 only (SALESQL-3968).
1389
+
1390
+ Everything `el-drawer` used to give for free is carried here: portal to `body`, backdrop,
1391
+ enter/leave transition, Escape, body scroll lock, **focus trap + focus restoration**,
1392
+ cancelable `before-close`, and an edge dragger clamped **during** the drag.
1393
+
1394
+ **Presentational only**: it never closes itself — the consumer holds `open` and flips it
1395
+ off on `close`. It never stores a width either — it clamps and emits; persisting is the
1396
+ consumer's job (frontend-app's `usePersistedWidth`).
1397
+
1398
+ ### Props
1399
+
1400
+ | Prop | Type | Default | Description |
1401
+ | ---------------- | ----------------------- | --------- | --------------------------------------------------------------------------------- |
1402
+ | `open` | `boolean` | `false` | Controls visibility. |
1403
+ | `title` | `string` | `''` | Header text; shows the header row (with `showClose`). |
1404
+ | `showClose` | `boolean` | `true` | Show the icon-only × close button. |
1405
+ | `closeLabel` | `string` | `'Close'` | `aria-label` for the × button. |
1406
+ | `direction` | `'rtl' \| 'ltr'` | `'rtl'` | Edge the panel is pinned to. `rtl` = right (ring on its left border). |
1407
+ | `width` | `number` | `440` | Panel width in **px**. 440 is the frozen contract's value (SALESQL-3548). |
1408
+ | `resizable` | `boolean` | `false` | Enable the edge dragger. |
1409
+ | `minWidth` | `number` | `360` | Lower bound, enforced **during** the drag. |
1410
+ | `maxWidth` | `number` | `720` | Upper bound, enforced **during** the drag. |
1411
+ | `closeOnOverlay` | `boolean` | `true` | Clicking the backdrop requests a close. |
1412
+ | `closeOnEscape` | `boolean` | `true` | Escape requests a close. |
1413
+ | `beforeClose` | `() => boolean \| void` | `null` | Return `false` (or a promise of it) to **cancel** the close — gates every path. |
1414
+ | `fixed` | `boolean` | `true` | `false` renders in-flow (no portal / backdrop / scroll lock), for specimen cards. |
1415
+
1416
+ ### Slots
1417
+
1418
+ | Slot | Description |
1419
+ | -------- | -------------------------------------------------------- |
1420
+ | default | Panel body. |
1421
+ | `header` | Replaces the default title element (the × button stays). |
1422
+ | `footer` | Optional action row; omitted entirely when not provided. |
1423
+
1424
+ ### Events
1425
+
1426
+ | Event | Payload | When |
1427
+ | -------------- | --------------- | -------------------------------------------------------------------- |
1428
+ | `close` | — | ×, backdrop or Escape — **after** `beforeClose` allowed it. |
1429
+ | `resize-start` | `width: number` | Drag began. |
1430
+ | `resize` | `width: number` | Every move while dragging, already clamped to `minWidth`/`maxWidth`. |
1431
+ | `resize-end` | `width: number` | Drag released, final clamped width. |
1432
+
1433
+ A consumer that only wants to store the result listens to `resize-end` alone:
1434
+
1435
+ ```vue
1436
+ <DsDrawer :width="width" resizable :min-width="360" :max-width="720" @resize-end="setWidth" />
1437
+ ```
1438
+
1439
+ ### Accessibility
1440
+
1441
+ - `role="dialog"` + `aria-modal="true"` in portal mode.
1442
+ - `aria-labelledby` points at the visible title; a custom `#header` falls back to
1443
+ `aria-label="drawer"` rather than referencing a node that no longer exists.
1444
+ - **Focus trap**: Tab from the last control returns to the first, Shift+Tab from the first
1445
+ goes to the last, and with nothing focusable inside, Tab cannot reach the page behind
1446
+ the overlay. Focus moves into the panel on open and **restores to the opener** on close.
1447
+ - Body scroll locks while a fixed/open drawer is mounted.
1448
+ - The dragger is `aria-hidden` — it is a pointer affordance, not a control to land on.
1449
+
1450
+ ### Chrome
1451
+
1452
+ **Header — from the DS, not from the app.** 48px tall, title left-aligned at body size and
1453
+ bold (`slate-main`), truncating with an ellipsis, `slate-tint` hairline underneath, and the
1454
+ control cluster at the trailing edge.
1455
+
1456
+ frontend-app's `el-drawer.scss` override had drifted from the DS on five counts — 50px,
1457
+ centred title, 16px, a 24px inset and `slate-shadow`. `DESIGN-SYSTEM.md` makes the DS the
1458
+ only style authority and forbids taking values from a consuming app, so the DS wins:
1459
+ **the full profile will look different once it adopts this**, by design.
1460
+
1461
+ Residual deltas, reconciled onto the 8px grid instead of copied off-grid: the DS's
1462
+ `0 14px 0 16px` inset becomes a symmetric 16px, and its 10px gap becomes 12px.
1463
+
1464
+ **Header controls.** The close is a bare glyph (20px, `slate-main`) with **no hover
1465
+ surface** — it is a plain icon in the DS, not a filled button. It stays a real `<button>`
1466
+ with an `aria-label` and a focus-visible ring, which the DS's `<span onClick>` is not.
1467
+ `#actions` renders before it in the softer `slate-soft`, glyphs at 18px.
1468
+
1469
+ **Surfaces.** The panel is the grey surface (`slate-bg`) and the chrome bars — header and
1470
+ footer — paint white on top of it. The body paints nothing and shows the grey through,
1471
+ with a 16px inset. That is why the drawer needs neither an inner wrapper nor a background
1472
+ prop: the DS answers it structurally, and a colour prop would be a style escape hatch the
1473
+ DS never defines. The footer's white is the one inferred value here — the DS full profile
1474
+ has no footer, and white matches the header as the other chrome bar.
1475
+
1476
+ **Edge.** A **1px grey ring** on the opening edge. The dragger's rule is `slate-mid` on
1477
+ hover and while dragging — **grey in every state**. Element Plus painted it with
1478
+ `--el-color-primary` (the lavender accent); that is the bug this component inherits
1479
+ already fixed.
1480
+
1481
+ ---
1482
+
1483
+ <!-- DsPopover · Overlays -->
1484
+
1485
+ ## DsPopover
1486
+
1487
+ Click-triggered card panel anchored to a trigger. Built **native** — no `element-plus`,
1488
+ no `floating-ui` — for the same reason as `DsDrawer`: the Vue 2 twin has to replicate this
1489
+ API and markup, and Element Plus is Vue 3 only (SALESQL-3968).
1490
+
1491
+ It replaces frontend-app's `el-popper` override (the company card), which added a 1px grey
1492
+ ring and 8px of padding on top of Element Plus. Positioning is pure CSS.
1493
+
1494
+ **Presentational only**: it never closes itself — it asks the consumer through
1495
+ `v-model:open`.
1496
+
1497
+ ### Props
1498
+
1499
+ | Prop | Type | Default | Description |
1500
+ | ---------------- | ------------------------- | ---------- | ------------------------------------------------------------- |
1501
+ | `open` | `boolean` | `false` | Visibility. Pair with `v-model:open`. |
1502
+ | `placement` | `DsPopoverPlacement` (12) | `'bottom'` | Where the panel opens — see **Placement** below. |
1503
+ | `width` | `string` | `''` | Panel width (any CSS length). Empty = fit content. |
1504
+ | `closeOnEscape` | `boolean` | `true` | Escape requests a close. |
1505
+ | `closeOnOutside` | `boolean` | `true` | A press outside the trigger and panel requests a close. |
1506
+ | `triggerOnClick` | `boolean` | `true` | Let the trigger slot toggle the panel. Off = consumer-driven. |
1507
+
1508
+ ### Placement
1509
+
1510
+ `side` or `side-alignment`, 12 values from `DS_POPOVER_PLACEMENTS`:
1511
+
1512
+ | Form | Where the panel goes |
1513
+ | ------------------------------------- | --------------------------------------------------------------- |
1514
+ | `bottom` | Below, **centred** on the trigger. |
1515
+ | `bottom-start` | Below, flush with the trigger's **leading** edge (`left: 0`). |
1516
+ | `bottom-end` | Below, flush with the trigger's **trailing** edge (`right: 0`). |
1517
+ | `top` · `top-start` · `top-end` | Same three, above the trigger. |
1518
+ | `left` · `left-start` · `left-end` | Beside it; the alignment runs on the **vertical** axis. |
1519
+ | `right` · `right-start` · `right-end` | Idem, on the other side. |
1520
+
1521
+ The aligned forms are not decoration. The DS company card is
1522
+ `{ position: absolute, top: 'calc(100% + 6px)', left: 0 }` — i.e. **`bottom-start`**.
1523
+ Centring it would move the card off its trigger's edge, which is why the four bare sides
1524
+ alone could not express it.
1525
+
1526
+ The bare sides keep their 3.1.0 meaning (centred), so this is purely additive.
1527
+
1528
+ > `DsTooltip` deliberately stays 4-way: no consumer needs an aligned tooltip, and adding
1529
+ > API on symmetry alone is speculative. The shared `useViewportClamp` already accepts the
1530
+ > suffixed form — it reads only the side — so adopting it there later is a type change,
1531
+ > not a rewrite.
1532
+
1533
+ ### Slots
1534
+
1535
+ | Slot | Description |
1536
+ | --------- | --------------------------------- |
1537
+ | `trigger` | The element the panel anchors to. |
1538
+ | default | Panel content. |
1539
+
1540
+ ### Events
1541
+
1542
+ | Event | Payload | When |
1543
+ | ------------- | --------- | ----------------------------------------------------------- |
1544
+ | `update:open` | `boolean` | Trigger clicked, Escape pressed, or a press landed outside. |
1545
+
1546
+ ```vue
1547
+ <DsPopover v-model:open="open" width="260px">
1548
+ <template #trigger><DsButton variant="tertiary">Stripe</DsButton></template>
1549
+ <CompanyCard :company="company" />
1550
+ </DsPopover>
1551
+ ```
1552
+
1553
+ ### Accessibility
1554
+
1555
+ - `role="dialog"` on the panel; it takes focus on open and **returns focus to the trigger**
1556
+ on close, so a keyboard user is never dumped at the top of the document.
1557
+ - Escape closes when `closeOnEscape` is true.
1558
+ - Outside dismissal listens on `mousedown`, so a press that starts outside dismisses the
1559
+ panel even if the pointer is released over it.
1560
+
1561
+ ### Chrome
1562
+
1563
+ **1px grey ring** (`slate-tint`), `spacing(1)` (8px) padding, card radius and the dropdown
1564
+ shadow — the values carried over from the `.el-popper.card-popover` override. Grey, never
1565
+ the accent.
package/llms.txt CHANGED
@@ -34,6 +34,8 @@
34
34
  - DsTextarea (Forms): Multi-line text field — the DS "Textarea", sibling of `DsInput` with the same
35
35
  - DsMenuItem (Navigation): Sidebar navigation row: an icon with an optional label, usable full-width or collapsed to
36
36
  - DsWizardStepper (Navigation): Numbered multi-step flow: a row of step chips (completed / active / incomplete / neutral)
37
+ - DsDrawer (Overlays): Side panel over a backdrop. Built **native** — no `element-plus` — so the Vue 2 twin
38
+ - DsPopover (Overlays): Click-triggered card panel anchored to a trigger. Built **native** — no `element-plus`,
37
39
 
38
40
  ## Full documentation
39
41
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesql/sql_components_vue3",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "Librería de componentes Vue 3 (SalesQL)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",