@salesql/sql_components_vue3 3.1.0 → 3.3.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 (46) hide show
  1. package/README.md +46 -0
  2. package/dist/composables/useViewportClamp.d.ts +9 -2
  3. package/dist/constants/contact-data.d.ts +100 -0
  4. package/dist/constants/events.d.ts +8 -0
  5. package/dist/constants/pickers.d.ts +36 -0
  6. package/dist/index.cjs +1 -1
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.d.ts +21 -0
  9. package/dist/index.es.js +2372 -1354
  10. package/dist/index.es.js.map +1 -1
  11. package/dist/sql_components_vue3.css +1 -1
  12. package/dist/stories/StoryStage.vue.d.ts +12 -0
  13. package/dist/ui/DsAddToSequence/DsAddToSequence.types.d.ts +35 -0
  14. package/dist/ui/DsAddToSequence/DsAddToSequence.vue.d.ts +146 -0
  15. package/dist/ui/DsAddToSequence/index.d.ts +2 -0
  16. package/dist/ui/DsButton/DsButton.types.d.ts +1 -0
  17. package/dist/ui/DsButton/DsButton.vue.d.ts +3 -0
  18. package/dist/ui/DsContactCell/DsContactCell.types.d.ts +45 -0
  19. package/dist/ui/DsContactCell/DsContactCell.vue.d.ts +203 -0
  20. package/dist/ui/DsContactCell/index.d.ts +2 -0
  21. package/dist/ui/DsContactList/DsContactList.types.d.ts +26 -0
  22. package/dist/ui/DsContactList/DsContactList.vue.d.ts +139 -0
  23. package/dist/ui/DsContactList/index.d.ts +2 -0
  24. package/dist/ui/DsDeliverabilityBadge/DsDeliverabilityBadge.types.d.ts +13 -0
  25. package/dist/ui/DsDeliverabilityBadge/DsDeliverabilityBadge.vue.d.ts +41 -0
  26. package/dist/ui/DsDeliverabilityBadge/index.d.ts +2 -0
  27. package/dist/ui/DsItemSelectorButton/DsItemSelectorButton.types.d.ts +1 -1
  28. package/dist/ui/DsMaskedValue/DsMaskedValue.types.d.ts +9 -0
  29. package/dist/ui/DsMaskedValue/DsMaskedValue.vue.d.ts +32 -0
  30. package/dist/ui/DsMaskedValue/index.d.ts +2 -0
  31. package/dist/ui/DsMoreCountChip/DsMoreCountChip.types.d.ts +8 -0
  32. package/dist/ui/DsMoreCountChip/DsMoreCountChip.vue.d.ts +31 -0
  33. package/dist/ui/DsMoreCountChip/index.d.ts +2 -0
  34. package/dist/ui/DsPill/DsPill.types.d.ts +1 -1
  35. package/dist/ui/DsPopover/DsPopover.types.d.ts +35 -1
  36. package/dist/ui/DsPopover/DsPopover.vue.d.ts +18 -0
  37. package/dist/ui/DsSavedButton/DsSavedButton.types.d.ts +23 -0
  38. package/dist/ui/DsSavedButton/DsSavedButton.vue.d.ts +135 -0
  39. package/dist/ui/DsSavedButton/index.d.ts +2 -0
  40. package/dist/ui/DsSelect/DsSelect.types.d.ts +1 -1
  41. package/dist/ui/DsTagPicker/DsTagPicker.types.d.ts +25 -0
  42. package/dist/ui/DsTagPicker/DsTagPicker.vue.d.ts +130 -0
  43. package/dist/ui/DsTagPicker/index.d.ts +2 -0
  44. package/llms-full.txt +568 -15
  45. package/llms.txt +8 -0
  46. package/package.json +1 -1
package/README.md CHANGED
@@ -127,6 +127,52 @@ Los estilos de los componentes viajan scoped en `dist/style.css` (importalo una
127
127
  vez en tu app). El reset de documento (`base.scss`) **no** va en ese bundle: se
128
128
  publica aparte como `dist/reset.css`, opt-in (SALESQL-3454).
129
129
 
130
+ ### 🔤 Fuente de iconos — REQUERIDA en la app consumidora
131
+
132
+ Los componentes que dibujan un icono emiten
133
+ `<i class="material-symbols-filled">{ligadura}</i>`. La librería **no envía ni la
134
+ fuente ni esa clase**: un component library no debe imponer una baseline global
135
+ (mismo criterio que SALESQL-3454). La app tiene que aportar las dos, o **cada
136
+ glifo se pinta como su propia ligadura** — un `close` literal en vez de ✕.
137
+
138
+ 1. Cargar la fuente en `index.html`:
139
+
140
+ ```html
141
+ <link
142
+ rel="stylesheet"
143
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,400,0..1,0"
144
+ />
145
+ <link
146
+ rel="stylesheet"
147
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0..1,0"
148
+ />
149
+ ```
150
+
151
+ 2. Definir la clase global:
152
+
153
+ ```css
154
+ .material-symbols-filled {
155
+ font-family: 'Material Symbols Rounded';
156
+ font-weight: normal;
157
+ font-style: normal;
158
+ font-size: 20px;
159
+ line-height: 20px;
160
+ font-variation-settings:
161
+ 'FILL' 1,
162
+ 'wght' 400,
163
+ 'GRAD' 0,
164
+ 'opsz' 20;
165
+ }
166
+ ```
167
+
168
+ Los componentes dimensionan su propio glifo (sus reglas scoped le ganan al 20px
169
+ por defecto), así que la clase sólo tiene que aportar familia y relleno.
170
+
171
+ > Hasta SALESQL-3968 la librería marcaba `.material-icons`, una familia que
172
+ > ninguna app de SalesQL linkea — y el playground de Histoire la cargaba, así que
173
+ > el bug sólo se veía del lado consumidor. El playground ahora carga exactamente
174
+ > lo mismo que la app.
175
+
130
176
  ---
131
177
 
132
178
  ## 🤖 Docs para agentes de IA (LLM)
@@ -3,8 +3,15 @@ import { type Ref } from 'vue';
3
3
  export declare const VIEWPORT_SHIFT_VAR = "--ds-overlay-shift";
4
4
  /** Gap kept between the floating element and the viewport edge, in px. */
5
5
  export declare const VIEWPORT_MARGIN = 8;
6
- /** The 4-way placement vocabulary shared by the overlay family. */
7
- export type ClampPlacement = 'top' | 'bottom' | 'left' | 'right';
6
+ /** The side a floating element opens on. `over` (DsPopover) covers the trigger and aligns on X. */
7
+ export type ClampSide = 'top' | 'bottom' | 'left' | 'right' | 'over';
8
+ /**
9
+ * Placement vocabulary shared by the overlay family: a bare side (centred) or a
10
+ * `side-start` / `side-end` alignment. Only the SIDE matters here — it decides which
11
+ * axis can overflow — so both vocabularies feed the same clamp (DsTooltip is 4-way,
12
+ * DsPopover is 12-way).
13
+ */
14
+ export type ClampPlacement = ClampSide | `${ClampSide}-start` | `${ClampSide}-end`;
8
15
  export declare function useViewportClamp(elRef: Ref<HTMLElement | null>, placement: () => ClampPlacement): {
9
16
  shift: Ref<number, number>;
10
17
  shiftStyle: import("vue").ComputedRef<{
@@ -0,0 +1,100 @@
1
+ /** Which group an item came from. It is a property of the LIST, never of the item. */
2
+ export declare const DS_CONTACT_KINDS: {
3
+ readonly EMAIL: "email";
4
+ readonly PHONE: "phone";
5
+ };
6
+ export type DsContactKind = (typeof DS_CONTACT_KINDS)[keyof typeof DS_CONTACT_KINDS];
7
+ /**
8
+ * The contract's whole type vocabulary (§3.2: Work · Direct · Mobile · HQ · Other), keyed
9
+ * by the view model's own bucket values so a label and a bucket cannot drift apart. The
10
+ * visible LABEL for each is copy and arrives by prop; the type itself is a design key.
11
+ */
12
+ export declare const DS_CONTACT_TYPES: {
13
+ readonly WORK: "work";
14
+ readonly DIRECT: "direct";
15
+ readonly MOBILE: "mobile";
16
+ readonly HQ: "hq";
17
+ readonly OTHER: "other";
18
+ };
19
+ export type DsContactType = (typeof DS_CONTACT_TYPES)[keyof typeof DS_CONTACT_TYPES];
20
+ /**
21
+ * In a contact-data row the type is an ICON on the left, not text (§3.2). These are the
22
+ * Material Symbols ligatures the design export assigns per type (`TYPE_META`); icons are
23
+ * design, so the mapping is the library's — the app never picks a glyph.
24
+ */
25
+ export declare const DS_CONTACT_TYPE_ICONS: Readonly<Record<DsContactType, string>>;
26
+ /**
27
+ * The one item shape every DsContact* component reads. Deliberately the five facts a
28
+ * row needs and nothing else — the consuming app adapts its own view model to this
29
+ * (one line per field), so the library survives the app's model changing under it:
30
+ *
31
+ * legacy view model (§3.8) typed `contact_data` block (§3.11)
32
+ * id: item.id item.uid
33
+ * value: item.value item.is_revealed ? item.value : item.preview
34
+ * masked: item.isMasked !item.is_revealed
35
+ * valid: item.status === 'valid' item.verification === 'valid'
36
+ * primary: item.isPrimary item.is_primary
37
+ *
38
+ * A component never classifies, fetches or formats: `value` is rendered verbatim and
39
+ * `masked` decides only the two-tone rendering of a string the SERVER already masked.
40
+ */
41
+ export interface DsContactItem {
42
+ /** Stable identity for keys and event payloads. `null` when the API sends none. */
43
+ id: string | number | null;
44
+ /** The string to display, already resolved by the consumer. Never re-formatted. */
45
+ value: string;
46
+ /** `true` when `value` is the server's masked preview. Reports; never hides. */
47
+ masked: boolean;
48
+ /** `true` only for a `valid` verdict — the sole state that renders the A+ badge. */
49
+ valid: boolean;
50
+ /** The group's primary. Rendered first; the cell shows it as the single value. */
51
+ primary: boolean;
52
+ /** The user's own rating of this item: correct / incorrect / unrated. */
53
+ rating?: boolean | null;
54
+ /**
55
+ * This row's own type, for lists that mix types (the unified Emails / Phones popovers).
56
+ * Sets the row glyph; a single-type list reads the list's `type` instead.
57
+ */
58
+ type?: DsContactType;
59
+ }
60
+ /**
61
+ * One typed band of a unified list (export `DataPopover` subgroups): «WORK (2)» above its
62
+ * rows. The label is copy (the app's `TYPE_LABEL`); the type is the design key for the glyph.
63
+ */
64
+ export interface DsContactSection {
65
+ type: DsContactType;
66
+ label: string;
67
+ items: DsContactItem[];
68
+ }
69
+ /**
70
+ * The three glyphs a server-masked value can be built from (contract §3.7 `MASK`):
71
+ * asterisks on the typed block's email `preview`, BULLET U+2022 on phones, and the
72
+ * ASCII dots the legacy arrays actually ship. Recognised, never produced.
73
+ */
74
+ export declare const MASK_GLYPHS: readonly string[];
75
+ export interface DsMaskedSegment {
76
+ text: string;
77
+ /** Rendered in the mask tone (`$contact-data-mask-ink`) when true. */
78
+ masked: boolean;
79
+ }
80
+ /**
81
+ * The `+N` chip shows the OVERFLOW, not the group size (§3.5): `counts` in the view model
82
+ * are group sizes, so the consumer subtracts through this and `+0` never renders.
83
+ * Frozen as a function because three surfaces subtracting differently is exactly the
84
+ * divergence the contract exists to prevent.
85
+ */
86
+ export declare function overflowFromGroupSize(groupSize: number): number;
87
+ /**
88
+ * Splits a string the server ALREADY masked into segments for the two-tone rendering
89
+ * (§3.7: «splitting an already-masked string leaks nothing»). The caller knows the value
90
+ * is masked — this never decides that, and never touches an unmasked value.
91
+ *
92
+ * - Email: the whole local part is the redaction, the domain stays visible (the quality
93
+ * signal). No `@` means the server masked the whole thing.
94
+ * - Phone: every run of mask glyphs is a redaction; a SINGLE dot is a real separator
95
+ * (`+1.415.555.0100`), so it stays visible. No prefix is assumed: `8008...` was
96
+ * measured with no `+` at all.
97
+ *
98
+ * Concatenating the segments always yields the input — nothing is re-grouped.
99
+ */
100
+ export declare function splitMaskedValue(value: string, kind: DsContactKind): DsMaskedSegment[];
@@ -44,3 +44,11 @@ export declare const RESIZE_END: "resize-end";
44
44
  export type ResizeEndEventName = typeof RESIZE_END;
45
45
  export declare const UPDATE_OPEN: "update:open";
46
46
  export type UpdateOpenEventName = typeof UPDATE_OPEN;
47
+ export declare const PICK: "pick";
48
+ export type PickEventName = typeof PICK;
49
+ export declare const APPLY: "apply";
50
+ export type ApplyEventName = typeof APPLY;
51
+ export declare const ADD: "add";
52
+ export type AddEventName = typeof ADD;
53
+ export declare const CREATE: "create";
54
+ export type CreateEventName = typeof CREATE;
@@ -0,0 +1,36 @@
1
+ import { type DsPopoverPlacement } from '@shared/ui/DsPopover';
2
+ /** One selectable thing: a folder, a tag, a campaign. `color` tints the row glyph / dot. */
3
+ export interface DsPickerOption {
4
+ id: string | number;
5
+ name: string;
6
+ color?: string;
7
+ }
8
+ /** Trigger height — `medium` for rows and the full profile, `large` for action / bulk bars. */
9
+ export declare const DS_PICKER_SIZES: {
10
+ readonly MEDIUM: "medium";
11
+ readonly LARGE: "large";
12
+ };
13
+ export type DsPickerSize = (typeof DS_PICKER_SIZES)[keyof typeof DS_PICKER_SIZES];
14
+ /** Which edge of the trigger the panel hangs from. */
15
+ export declare const DS_PICKER_ALIGNS: {
16
+ readonly START: "start";
17
+ readonly END: "end";
18
+ };
19
+ export type DsPickerAlign = (typeof DS_PICKER_ALIGNS)[keyof typeof DS_PICKER_ALIGNS];
20
+ /** The "send to" choice of Add to sequence — the contract's email kinds that can be mailed. */
21
+ export declare const DS_SEQUENCE_CHANNELS: {
22
+ readonly WORK: "work";
23
+ readonly DIRECT: "direct";
24
+ };
25
+ export type DsSequenceChannel = (typeof DS_SEQUENCE_CHANNELS)[keyof typeof DS_SEQUENCE_CHANNELS];
26
+ export interface DsSequenceChannelOption {
27
+ value: DsSequenceChannel;
28
+ /** Copy — the app passes it ("Work email"). */
29
+ label: string;
30
+ }
31
+ /** Case-insensitive, trimmed `includes` on `name`. An empty query keeps every option. */
32
+ export declare function filterOptions<T extends {
33
+ name: string;
34
+ }>(options: readonly T[], query: string): T[];
35
+ /** The panel opens below the trigger, aligned to the edge the consumer asked for. */
36
+ export declare function pickerPlacement(align: DsPickerAlign): DsPopoverPlacement;