highsoft-ui 1.0.178 → 1.0.180
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/CLAUDE.md +102 -1
- package/dist/ProductNotice-CtgDdo5_.js +144 -0
- package/dist/components/ProductNotice/index.js +4 -0
- package/dist/components/ProductNotice/tracking.js +25 -0
- package/dist/highsoft-ui.css +1 -1
- package/dist/lib/components/ProductNotice/index.d.ts +60 -0
- package/dist/lib/components/ProductNotice/tracking.d.ts +40 -0
- package/dist/lib/main.d.ts +4 -0
- package/dist/lib/tracking.d.ts +52 -0
- package/dist/main.js +61 -58
- package/dist/tracking.js +47 -0
- package/package.json +1 -1
package/CLAUDE.md
CHANGED
|
@@ -178,8 +178,14 @@ import { LinkExternal01 } from '@untitled-ui/icons-react'
|
|
|
178
178
|
|
|
179
179
|
// Controlled
|
|
180
180
|
<AccordionItem title="Shipping" open={open} onOpenChange={setOpen}>…</AccordionItem>
|
|
181
|
+
|
|
182
|
+
// One open at a time: the same name on every item
|
|
183
|
+
<Accordion>
|
|
184
|
+
<AccordionItem name="faq" title="Pricing">…</AccordionItem>
|
|
185
|
+
<AccordionItem name="faq" title="Licensing">…</AccordionItem>
|
|
186
|
+
</Accordion>
|
|
181
187
|
```
|
|
182
|
-
- **`Accordion`:** a flex column with 8px between items (`--item-spacing-400`). Each item opens and closes on its own
|
|
188
|
+
- **`Accordion`:** a flex column with 8px between items (`--item-spacing-400`) that fills its parent (`width: 100%`, `min-width: 0`), so it holds its width in a flex row or a start-aligned flex column too. The items' `container-type: inline-size` gives them no content width, so without that a parent that sizes to content would shrink the list to its borders. Each item opens and closes on its own. **For one open at a time, give every item the same `name`:** that makes them an exclusive `<details>` group and the browser closes the others itself (Chrome 120+, Safari 17.2+, Firefox 130+; older browsers ignore `name` and open items independently). Controlled items in a group hear about the browser closing them through `onOpenChange(false)`. **`headingLevel`** (`2`–`6`) renders every item's title as that heading; unset, titles are plain text (`<span>`).
|
|
183
189
|
- **`AccordionItem`:** **`title`** (the headline, `ReactNode`), **`children`** (the body), **`headingLevel`** (overrides the Accordion's for this item), **`defaultOpen`** or controlled **`open`** + **`onOpenChange(open)`**. Other props and the ref go to the `<details>`. Uncontrolled, `defaultOpen` is rendered as the `open` attribute, so server HTML is already open. Controlled, a summary click calls `onOpenChange` instead of toggling, and changes the browser makes on its own (find-in-page) are reported through `onOpenChange` too.
|
|
184
190
|
- **States, from Figma:** closed items are transparent with a 1px `--HS-surface-ui-border-100` stroke and a `--HS-text-secondary-default` title, so they sit on the page. Open: `--HS-surface-ui-background-0` card, `--HS-surface-ui-border-200`, primary title. Hover (pointer devices only, `@media (hover: hover)`): background-0 card, `--HS-surface-ui-border-300`, primary title, and the indicator takes the transparent Button hover. Keyboard focus: background-0 card and the two-tone ring (the `a11y-focus-ring` mixin with the Figma "Focus/A11Y" 5px outer).
|
|
185
191
|
- **Title element:** the title is `Typography` 400 semi rendered as a `<span>` or, with `headingLevel`, an `<h2>`–`<h6>` — same look either way (margins and any site-wide heading font are reset). There is no paragraph option, unlike the blocks' "Title element" setting: `<summary>` accepts phrasing or heading content, and a `<p>` is neither. The Storybook **Title element** control maps to this prop.
|
|
@@ -193,6 +199,7 @@ import { LinkExternal01 } from '@untitled-ui/icons-react'
|
|
|
193
199
|
- The indicator is `aria-hidden`, so the button is named by the title alone. A closed body is out of the tab order and the accessibility tree.
|
|
194
200
|
- **Headings:** set `headingLevel` when the items are sections of the page, at the level that fits the outline (`3` under a section's `<h2>`), rather than putting a `Heading` inside `title`. Leave it unset for a list of short questions or options. The heading sits inside the `<summary>`, which is valid HTML, but screen readers differ: some list it in their headings navigation, others treat the summary as a button and read only its text. So write the title to work as a button name too.
|
|
195
201
|
- Focus is drawn on the card edge (`:has(> summary:focus-visible)`) rather than on the summary, since the card is what you click. The ring is the background-coloured gap + brand outer, as on the other form controls.
|
|
202
|
+
- **One-open groups (`name`)** are the browser's own exclusive `<details>`: opening an item closes the open one without moving focus. The activated summary announces its new expanded state, and the item that closed reads as collapsed when you reach it. The group itself isn't announced, so the closing is not something to rely on to convey meaning.
|
|
196
203
|
|
|
197
204
|
### Button
|
|
198
205
|
```tsx
|
|
@@ -1117,6 +1124,73 @@ heading, provide an appropriate accessible section label and distinct CTA label
|
|
|
1117
1124
|
through `action.buttonProps` as needed. Preserve reduced-motion handling and
|
|
1118
1125
|
keyboard operation of the media control.
|
|
1119
1126
|
|
|
1127
|
+
### ProductNotice
|
|
1128
|
+
Slim, closable product notice on a brand surface: a product icon, a semibold run-in title and its description, up to two buttons and a close button. Under 760px of its own width it switches to a compact layout. Reports views, clicks and closes to the page's tracker (see [Tracking](#tracking)). Figma "orbit Banner shop" in the Kartoffel shop file (wide 4055:77089, mobile 4061:42944).
|
|
1129
|
+
```tsx
|
|
1130
|
+
import { Mail01 } from '@untitled-ui/icons-react'
|
|
1131
|
+
|
|
1132
|
+
<ProductNotice
|
|
1133
|
+
product="orbit"
|
|
1134
|
+
title="Highcharts Orbit is here."
|
|
1135
|
+
description="It’s sold through our sales team, so you won’t find it in the configurator below."
|
|
1136
|
+
compactDescription="It’s sold through our sales team."
|
|
1137
|
+
actions={[
|
|
1138
|
+
{ label: 'Explore Orbit', href: '/products/orbit' },
|
|
1139
|
+
{ label: 'Contact sales', href: '/contact-sales', iconRight: <Mail01 /> }
|
|
1140
|
+
]}
|
|
1141
|
+
tracking={{ id: 'orbit-shop-notice', name: 'Highcharts Orbit (shop)' }}
|
|
1142
|
+
/>
|
|
1143
|
+
|
|
1144
|
+
// One button, no close
|
|
1145
|
+
<ProductNotice product="stock" title="…" description="…" actions={[{ label: 'Read more', href: '…' }]} closable={false} />
|
|
1146
|
+
|
|
1147
|
+
// Any other logo in place of the product icon: it then needs a tracking id (or tracking={false})
|
|
1148
|
+
<ProductNotice icon={<FrameworkIcon icon="python" size={24} />} title="…" tracking={{ id: 'python-notice' }} />
|
|
1149
|
+
```
|
|
1150
|
+
- **`product`:** a `ProductIconName` (default `orbit`), drawn as a monochrome 24px `ProductIcon`; also the default `promotion_id` and `item_id`. **`icon`** replaces it with any element (a `FrameworkIcon`, an `<img>`); it sits in an `aria-hidden` slot, so it is decorative — the title names the product. `product` and `icon` are exclusive, and with `icon` the types require `tracking={{ id }}` or `tracking={false}`, so a Python notice can't report as Orbit.
|
|
1151
|
+
- **`title`** / **`description`:** one 16px paragraph (`Typography` 200, 130%), the title in a semibold `<strong>`, the description regular. **`compactDescription`** is the shorter text for the compact layout (defaults to `description`).
|
|
1152
|
+
- **`actions`:** zero, one or two `{ label, href?, onClick?, iconLeft?, iconRight?, buttonProps?, tracking? }`, rendered as transparent `Button`s; variant and size are fixed by the design. A third item is ignored. `label` is a string because it is also the tracked `link_text`. `buttonProps` can't override the variant, size, `href` or the tracked click; an `onClick` in it still runs after the notice's own handler.
|
|
1153
|
+
- **`closable`** (default `true`) shows a plain icon-only `Button` with `X`; clicking it hides the notice and calls **`onClose`**. Nothing is remembered: to keep it closed across page loads, store that in `onClose` and stop rendering it. **`closeLabel`** (default `'Close'`) is its accessible name.
|
|
1154
|
+
- **Wide layout:** `Box` (1px border, 8px radius, `--shadow-size-100`, 12px padding, 20px from the left edge to the content): icon and text, then size-100 buttons and close on the same row.
|
|
1155
|
+
- **Compact layout** (under 760px, Figma mobile): no icon and no shadow, 12px padding all round, the text with a size-200 close top right, and size-200 buttons on their own row below. It is a **container query** on the notice's own width, so a narrow column gets it too, not only a phone. Both button sets are rendered and the hidden one is `display: none`; so each action renders twice — don't put an `id` in `buttonProps`.
|
|
1156
|
+
- **Colours** are the component's own light/dark pair from primitives, as in PromoBanner: light brand-200 surface, brand-300 stroke, brand-1000 text; dark brand-1000 surface, brand-900 stroke, brand-50 text (`--product-notice-bg` / `-border` / `-text`, remapped under `[data-theme='dark']`). The semantic brand tokens would give brand-800 and brand-600 in dark.
|
|
1157
|
+
|
|
1158
|
+
**Tracking.** Events go to the page's tracker: a `TrackingProvider` at the app root, or the notice's own **`tracker`** prop (see [Tracking](#tracking)). With neither, nothing is sent. The default event names are GA4's promotion events (`dismiss_promotion` is a custom one):
|
|
1159
|
+
|
|
1160
|
+
| Interaction | Default event | Extra params |
|
|
1161
|
+
|---|---|---|
|
|
1162
|
+
| half the notice on screen (once per mount) | `view_promotion` | `items` |
|
|
1163
|
+
| a button click | `select_promotion` | `items`, `link_text`, `link_url` |
|
|
1164
|
+
| close | `dismiss_promotion` | — |
|
|
1165
|
+
|
|
1166
|
+
Every event carries `promotion_id` (`tracking.id`, default the `product`) and `promotion_name` (`tracking.name`, default the id). View and click also carry GA4's **`items`**: GA4 requires them on `view_promotion`, and the Promotions report leaves out a `select_promotion` without them. The default is the product, `[{ item_id: 'orbit' }]` (with a custom `icon`, the tracking id); pass `tracking.items` for your own (each needs an `item_id` or an `item_name`), or `false` for none. Change any of it through **`tracking`**:
|
|
1167
|
+
```tsx
|
|
1168
|
+
<ProductNotice
|
|
1169
|
+
tracking={{
|
|
1170
|
+
id: 'orbit-shop-notice',
|
|
1171
|
+
events: { view: false, close: 'shop_notice_close' }, // rename or skip an event
|
|
1172
|
+
items: [{ item_id: 'orbit', item_name: 'Highcharts Orbit' }], // GA4 items for view and click
|
|
1173
|
+
params: { creative_slot: 'shop_configurator' } // sent with every event
|
|
1174
|
+
}}
|
|
1175
|
+
tracker={({ event, params }) => Google.analytics({ event, ...params })} // this notice only, instead of the provider's
|
|
1176
|
+
actions={[
|
|
1177
|
+
{ label: 'Explore Orbit', href: '…', tracking: false }, // this button isn't tracked
|
|
1178
|
+
{ label: 'Contact sales', href: '…', tracking: { event: 'generate_lead', params: { lead_source: 'orbit_shop_notice' } } }
|
|
1179
|
+
]}
|
|
1180
|
+
/>
|
|
1181
|
+
|
|
1182
|
+
<ProductNotice tracking={false} … /> // send nothing
|
|
1183
|
+
```
|
|
1184
|
+
Params merge in this order, later winning: `promotion_id`/`promotion_name`/`items` → `link_text`/`link_url` → `tracking.params` → the button's `tracking.params`. Undefined values are dropped. The tracker receives `{ event, params }`. An inline `tracking` object doesn't restart the view observer; the latest config is read when an event fires.
|
|
1185
|
+
|
|
1186
|
+
**Accessibility:**
|
|
1187
|
+
- The buttons are real `Button`s (links when `href` is set) with the shared focus ring; the close button is named by `closeLabel`. Tab order follows the layout: the buttons then close in the wide row; close then the buttons in the compact one, top to bottom.
|
|
1188
|
+
- The layout not shown is `display: none`, so assistive technology and the tab order only ever meet one set of buttons and one description.
|
|
1189
|
+
- The icon is decorative (`aria-hidden`); the title carries the product name.
|
|
1190
|
+
- Text is brand-1000 on brand-200 in light and brand-50 on brand-1000 in dark, both well above 4.5:1.
|
|
1191
|
+
- Closing removes the notice, so focus falls back to the page; if the notice sits before important content, move focus there in `onClose`.
|
|
1192
|
+
- Nothing animates.
|
|
1193
|
+
|
|
1120
1194
|
### TableOfContents
|
|
1121
1195
|
"On this page" navigation for an article: a rule down the left, a semibold title and one link per heading. Uncontrolled by default with a built-in scroll spy; pass `activeId` to drive the highlight yourself.
|
|
1122
1196
|
|
|
@@ -1153,6 +1227,33 @@ const items: TableOfContentsItem[] = [
|
|
|
1153
1227
|
- Hover and current states pair the bar with a text-colour change, so neither rests on colour alone. The bar's width grows on the bounce token and is instant under `prefers-reduced-motion: reduce`, which leaves nothing animating; colours switch instantly in every mode. The spy only swaps which row is current.
|
|
1154
1228
|
- Rows are 18px tall on a 25px pitch: under the 24px minimum of WCAG 2.5.8, but the pitch keeps every target at least 24px from the next, which is the criterion's spacing exception. Nested rows indent without shrinking.
|
|
1155
1229
|
|
|
1230
|
+
## Tracking
|
|
1231
|
+
|
|
1232
|
+
Components that report interactions (currently `ProductNotice`) don't know which analytics a site runs. They hand each event, `{ event, params }` in GA4 shape, to a **tracker**, and the site chooses the tracker. Set it once at the app root:
|
|
1233
|
+
|
|
1234
|
+
```tsx
|
|
1235
|
+
import { TrackingProvider, dataLayerTracker, gtagTracker } from 'highsoft-ui'
|
|
1236
|
+
|
|
1237
|
+
// Google Tag Manager (highcharts.com): pushes { event, ...params } onto window.dataLayer
|
|
1238
|
+
<TrackingProvider tracker={dataLayerTracker()}>…</TrackingProvider>
|
|
1239
|
+
|
|
1240
|
+
// GTM with a renamed data layer
|
|
1241
|
+
<TrackingProvider tracker={dataLayerTracker({ name: 'siteLayer' })}>…</TrackingProvider>
|
|
1242
|
+
|
|
1243
|
+
// gtag.js straight to GA4, routed to this site's measurement ID
|
|
1244
|
+
<TrackingProvider tracker={gtagTracker({ sendTo: 'G-XXXXXXX' })}>…</TrackingProvider>
|
|
1245
|
+
|
|
1246
|
+
// The site's own wrapper, which keeps its consent check (the shop's Cookiebot-gated Google.analytics)
|
|
1247
|
+
<TrackingProvider tracker={({ event, params }) => Google.analytics({ event, ...params })}>…</TrackingProvider>
|
|
1248
|
+
```
|
|
1249
|
+
- **`Tracker`** is `(event: TrackingEvent) => void`; any function works, so a site can also log, sample, or send to two places at once.
|
|
1250
|
+
- A component's own **`tracker`** prop beats the provider. No provider and no prop: no events are sent.
|
|
1251
|
+
- `dataLayerTracker` pushes everything at the top level, `items` included: `{ event, promotion_id, items, … }`. Google's GTM ecommerce examples nest them under an `ecommerce` key, which is what a GA4 event tag's "Send Ecommerce data" option reads; with this tracker, map `items` as an event parameter in the tag instead.
|
|
1252
|
+
- **Consent belongs to the site.** `dataLayerTracker`/`gtagTracker` push unconditionally; GTM consent mode or the site's wrapper decides what is sent. Never point a consent-gated site at the raw adapters.
|
|
1253
|
+
- Trackers run inside a `try/catch`: a broken analytics script logs an error but never blocks the click or the navigation. The adapters do nothing during SSR, and `gtagTracker` does nothing until the gtag snippet has run.
|
|
1254
|
+
- `useTracker(prop?)` returns the resolved, never-throwing tracker, for new components that track.
|
|
1255
|
+
- Functions can't cross the Next.js Server → Client Component boundary: create the tracker in a client component (e.g. a `'use client'` providers file at the root).
|
|
1256
|
+
|
|
1156
1257
|
## Hooks
|
|
1157
1258
|
|
|
1158
1259
|
### useSuccessFlash
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useTracker as e } from "./tracking.js";
|
|
3
|
+
import { t } from "./Box-BZgeSeCV.js";
|
|
4
|
+
import { t as n } from "./clsx-BWCAbrjV.js";
|
|
5
|
+
import { r } from "./esm-CqcQTziN.js";
|
|
6
|
+
import { t as i } from "./Button-DtCIaVhq.js";
|
|
7
|
+
import { n as a } from "./Typography-DI1AkqiO.js";
|
|
8
|
+
import { t as o } from "./ProductIcon-Cr6E2K9a.js";
|
|
9
|
+
import { trackProductNotice as s } from "./components/ProductNotice/tracking.js";
|
|
10
|
+
import { useEffect as c, useRef as l, useState as u } from "react";
|
|
11
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
12
|
+
var m = {
|
|
13
|
+
actions: "hJxRhW_actions",
|
|
14
|
+
compactActions: "hJxRhW_compactActions",
|
|
15
|
+
compactClose: "hJxRhW_compactClose",
|
|
16
|
+
compactText: "hJxRhW_compactText",
|
|
17
|
+
content: "hJxRhW_content",
|
|
18
|
+
icon: "hJxRhW_icon",
|
|
19
|
+
message: "hJxRhW_message",
|
|
20
|
+
notice: "hJxRhW_notice",
|
|
21
|
+
"product-notice": "hJxRhW_product-notice",
|
|
22
|
+
surface: "hJxRhW_surface",
|
|
23
|
+
title: "hJxRhW_title",
|
|
24
|
+
wideActions: "hJxRhW_wideActions",
|
|
25
|
+
wideText: "hJxRhW_wideText"
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region lib/components/ProductNotice/index.tsx
|
|
29
|
+
function h({ product: h, icon: g, title: _, description: v, compactDescription: y, actions: b, closable: x = !0, onClose: S, closeLabel: C = "Close", tracking: w, tracker: T, className: E, ...D }) {
|
|
30
|
+
let O = l(null), [k, A] = u(!1), j = e(T), M = g ? void 0 : h ?? "orbit", N = l({
|
|
31
|
+
tracking: w,
|
|
32
|
+
promoted: M,
|
|
33
|
+
send: j
|
|
34
|
+
});
|
|
35
|
+
if (c(() => {
|
|
36
|
+
N.current = {
|
|
37
|
+
tracking: w,
|
|
38
|
+
promoted: M,
|
|
39
|
+
send: j
|
|
40
|
+
};
|
|
41
|
+
}), c(() => {
|
|
42
|
+
let e = O.current;
|
|
43
|
+
if (!e) return;
|
|
44
|
+
let t = !1, n = () => {
|
|
45
|
+
t || (t = !0, s(N.current.send, N.current.tracking, "view", N.current.promoted));
|
|
46
|
+
};
|
|
47
|
+
if (typeof IntersectionObserver > "u") {
|
|
48
|
+
n();
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
let r = new IntersectionObserver((e) => {
|
|
52
|
+
e.some((e) => e.isIntersecting) && (r.disconnect(), n());
|
|
53
|
+
}, { threshold: .5 });
|
|
54
|
+
return r.observe(e), () => r.disconnect();
|
|
55
|
+
}, []), k) return null;
|
|
56
|
+
let P = () => {
|
|
57
|
+
s(j, w, "close", M), A(!0), S?.();
|
|
58
|
+
}, F = (b ?? []).slice(0, 2).filter((e) => !!e), I = (e) => F.map((t, n) => {
|
|
59
|
+
let { onClick: r, ...a } = t.buttonProps ?? {};
|
|
60
|
+
return /* @__PURE__ */ f(i, {
|
|
61
|
+
...a,
|
|
62
|
+
variant: "transparent",
|
|
63
|
+
size: e,
|
|
64
|
+
href: t.href,
|
|
65
|
+
iconLeft: t.iconLeft,
|
|
66
|
+
iconRight: t.iconRight,
|
|
67
|
+
onClick: (e) => {
|
|
68
|
+
t.tracking !== !1 && s(j, w, "click", M, {
|
|
69
|
+
...t.tracking,
|
|
70
|
+
defaults: {
|
|
71
|
+
link_text: t.label,
|
|
72
|
+
link_url: t.href
|
|
73
|
+
}
|
|
74
|
+
}), t.onClick?.(e), r?.(e);
|
|
75
|
+
},
|
|
76
|
+
children: t.label
|
|
77
|
+
}, `${t.label}-${n}`);
|
|
78
|
+
}), L = (e) => /* @__PURE__ */ f(i, {
|
|
79
|
+
variant: "plain",
|
|
80
|
+
size: e,
|
|
81
|
+
"aria-label": C,
|
|
82
|
+
onClick: P,
|
|
83
|
+
children: /* @__PURE__ */ f(r, {})
|
|
84
|
+
});
|
|
85
|
+
return /* @__PURE__ */ f("div", {
|
|
86
|
+
ref: O,
|
|
87
|
+
className: n("hsui-product-notice", m.notice, E),
|
|
88
|
+
...D,
|
|
89
|
+
children: /* @__PURE__ */ p(t, {
|
|
90
|
+
border: !0,
|
|
91
|
+
radius: 8,
|
|
92
|
+
padding: 300,
|
|
93
|
+
shadow: 100,
|
|
94
|
+
className: m.surface,
|
|
95
|
+
children: [
|
|
96
|
+
/* @__PURE__ */ p("div", {
|
|
97
|
+
className: m.content,
|
|
98
|
+
children: [/* @__PURE__ */ f("span", {
|
|
99
|
+
className: m.icon,
|
|
100
|
+
"aria-hidden": "true",
|
|
101
|
+
children: g ?? /* @__PURE__ */ f(o, {
|
|
102
|
+
icon: M ?? "orbit",
|
|
103
|
+
theme: "monochrome",
|
|
104
|
+
size: 24
|
|
105
|
+
})
|
|
106
|
+
}), /* @__PURE__ */ p(a, {
|
|
107
|
+
as: "p",
|
|
108
|
+
size: 200,
|
|
109
|
+
className: m.message,
|
|
110
|
+
style: { "--hsui-typography-color": "var(--product-notice-text)" },
|
|
111
|
+
children: [
|
|
112
|
+
_ != null && /* @__PURE__ */ f("strong", {
|
|
113
|
+
className: m.title,
|
|
114
|
+
children: _
|
|
115
|
+
}),
|
|
116
|
+
_ != null && (v != null || y != null) && " ",
|
|
117
|
+
y == null ? v : /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("span", {
|
|
118
|
+
className: m.wideText,
|
|
119
|
+
children: v
|
|
120
|
+
}), /* @__PURE__ */ f("span", {
|
|
121
|
+
className: m.compactText,
|
|
122
|
+
children: y
|
|
123
|
+
})] })
|
|
124
|
+
]
|
|
125
|
+
})]
|
|
126
|
+
}),
|
|
127
|
+
(F.length > 0 || x) && /* @__PURE__ */ p("div", {
|
|
128
|
+
className: n(m.actions, m.wideActions),
|
|
129
|
+
children: [I(100), x && L(100)]
|
|
130
|
+
}),
|
|
131
|
+
x && /* @__PURE__ */ f("div", {
|
|
132
|
+
className: m.compactClose,
|
|
133
|
+
children: L(200)
|
|
134
|
+
}),
|
|
135
|
+
F.length > 0 && /* @__PURE__ */ f("div", {
|
|
136
|
+
className: n(m.actions, m.compactActions),
|
|
137
|
+
children: I(200)
|
|
138
|
+
})
|
|
139
|
+
]
|
|
140
|
+
})
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
//#endregion
|
|
144
|
+
export { h as t };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region lib/components/ProductNotice/tracking.ts
|
|
2
|
+
var e = {
|
|
3
|
+
view: "view_promotion",
|
|
4
|
+
click: "select_promotion",
|
|
5
|
+
close: "dismiss_promotion"
|
|
6
|
+
};
|
|
7
|
+
function t(t, n, r, i, a) {
|
|
8
|
+
if (n === !1) return;
|
|
9
|
+
let o = a?.event ?? n?.events?.[r] ?? e[r];
|
|
10
|
+
if (o === !1) return;
|
|
11
|
+
let s = n?.id ?? i, c = i ?? s, l = r === "close" || n?.items === !1 ? void 0 : n?.items ?? (c ? [{ item_id: c }] : void 0), u = {
|
|
12
|
+
promotion_id: s,
|
|
13
|
+
promotion_name: n?.name ?? s,
|
|
14
|
+
items: l,
|
|
15
|
+
...a?.defaults,
|
|
16
|
+
...n?.params,
|
|
17
|
+
...a?.params
|
|
18
|
+
};
|
|
19
|
+
t({
|
|
20
|
+
event: o,
|
|
21
|
+
params: Object.fromEntries(Object.entries(u).filter(([, e]) => e !== void 0))
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { e as PRODUCT_NOTICE_EVENTS, t as trackProductNotice };
|