highsoft-ui 1.0.186 → 1.0.188
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/dist/ProductIconFrame-CGrI3X4C.js +38 -0
- package/dist/ProductNotice-BfI0v5Ag.js +158 -0
- package/dist/components/ProductIcon/ProductIconFrame.js +2 -0
- package/dist/components/ProductIcon/index.js +54 -2
- package/dist/components/ProductNotice/index.js +1 -1
- package/dist/highsoft-ui.css +1 -1
- package/dist/lib/components/ProductIcon/ProductIconFrame.d.ts +24 -0
- package/dist/lib/components/ProductIcon/index.d.ts +3 -0
- package/dist/lib/components/ProductNotice/index.d.ts +21 -2
- package/dist/lib/main.d.ts +3 -1
- package/dist/main.js +50 -49
- package/package.json +5 -1
- package/dist/ProductIcon-Cr6E2K9a.js +0 -75
- package/dist/ProductNotice-CtgDdo5_.js +0 -144
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FC, SVGProps } from 'react';
|
|
2
|
+
import { IconSize } from '../Icon';
|
|
3
|
+
export interface ProductIconFrameProps extends Omit<SVGProps<SVGSVGElement>, 'name'> {
|
|
4
|
+
/** One product icon component, e.g. from `highsoft-ui/product-icons/multi/Orbit` */
|
|
5
|
+
icon: FC<SVGProps<SVGSVGElement>>;
|
|
6
|
+
/** Size in pixels — must be a design-system size (12 | 16 | 20 | 24 | 32 | 40 | 52 | 64 | 72) */
|
|
7
|
+
size?: IconSize;
|
|
8
|
+
/** Wraps the icon in the layered box tile, as `ProductIcon`'s `box` does. */
|
|
9
|
+
box?: boolean;
|
|
10
|
+
/** Additional class name */
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Draws one product icon component the way `ProductIcon` does. `ProductIcon`
|
|
15
|
+
* looks its name up in every theme, which bundles every product icon; import
|
|
16
|
+
* the icon you need and pass it here to ship only that one.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* import Orbit from 'highsoft-ui/product-icons/multi/Orbit';
|
|
21
|
+
* <ProductIconFrame icon={Orbit} size={52} box />
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function ProductIconFrame({ icon: IconComponent, size, box, className, style, ...props }: ProductIconFrameProps): import("react").JSX.Element;
|
|
@@ -49,6 +49,9 @@ export interface ProductIconProps extends Omit<SVGProps<SVGSVGElement>, 'name'>
|
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
51
|
* ProductIcon displays Highcharts product and feature icons with theme variants.
|
|
52
|
+
* It bundles every icon of every theme; where size matters, import one icon
|
|
53
|
+
* from `highsoft-ui/product-icons/<theme>/<Name>` and draw it with
|
|
54
|
+
* `ProductIconFrame`.
|
|
52
55
|
*
|
|
53
56
|
* @example
|
|
54
57
|
* ```tsx
|
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
import { AnchorHTMLAttributes, HTMLAttributes, MouseEvent, ReactElement, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { default as Core } from '../ProductIcon/icons/monochrome/Core';
|
|
3
|
+
import { default as Dashboards } from '../ProductIcon/icons/monochrome/Dashboards';
|
|
4
|
+
import { default as Gantt } from '../ProductIcon/icons/monochrome/Gantt';
|
|
5
|
+
import { default as Grid } from '../ProductIcon/icons/monochrome/Grid';
|
|
6
|
+
import { default as Maps } from '../ProductIcon/icons/monochrome/Maps';
|
|
7
|
+
import { default as Morningstar } from '../ProductIcon/icons/monochrome/Morningstar';
|
|
8
|
+
import { default as Orbit } from '../ProductIcon/icons/monochrome/Orbit';
|
|
9
|
+
import { default as Stock } from '../ProductIcon/icons/monochrome/Stock';
|
|
3
10
|
import { Tracker } from '../../tracking';
|
|
4
11
|
import { ProductNoticeActionTracking, ProductNoticeTracking } from './tracking';
|
|
5
12
|
export type { ProductNoticeActionTracking, ProductNoticeInteraction, ProductNoticeTracking, ProductNoticeTrackingParams } from './tracking';
|
|
6
13
|
export { PRODUCT_NOTICE_EVENTS } from './tracking';
|
|
14
|
+
declare const productIcons: {
|
|
15
|
+
core: typeof Core;
|
|
16
|
+
stock: typeof Stock;
|
|
17
|
+
maps: typeof Maps;
|
|
18
|
+
gantt: typeof Gantt;
|
|
19
|
+
dashboards: typeof Dashboards;
|
|
20
|
+
grid: typeof Grid;
|
|
21
|
+
orbit: typeof Orbit;
|
|
22
|
+
morningstar: typeof Morningstar;
|
|
23
|
+
};
|
|
24
|
+
/** A product a notice can promote. */
|
|
25
|
+
export type ProductNoticeProduct = keyof typeof productIcons;
|
|
7
26
|
/** One of the (at most two) buttons of the notice. */
|
|
8
27
|
export interface ProductNoticeAction {
|
|
9
28
|
/** Button text. Also sent as `link_text` on the click event. */
|
|
@@ -42,7 +61,7 @@ interface ProductNoticeBaseProps extends Omit<HTMLAttributes<HTMLDivElement>, 't
|
|
|
42
61
|
}
|
|
43
62
|
interface ProductNoticeProductProps {
|
|
44
63
|
/** Product whose icon leads the notice; also its default `promotion_id` and `item_id`. Default `'orbit'`. */
|
|
45
|
-
product?:
|
|
64
|
+
product?: ProductNoticeProduct;
|
|
46
65
|
icon?: undefined;
|
|
47
66
|
/** Event names and parameters, or `false` to send nothing. */
|
|
48
67
|
tracking?: ProductNoticeTracking | false;
|
package/dist/lib/main.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export type { ListProps, ListItemProps, ListSize, ListVariant, ListIcon } from '
|
|
|
10
10
|
export type { FeaturesProps, FeaturesColumns, FeatureItemProps, FeatureIcon, FeatureHeadingLevel, FeatureDescriptionColor } from './components/Features';
|
|
11
11
|
export type { LinkProps, LinkVariant } from './components/Link';
|
|
12
12
|
export type { ProductIconProps, ProductIconTheme, ProductIconName } from './components/ProductIcon';
|
|
13
|
+
export type { ProductIconFrameProps } from './components/ProductIcon/ProductIconFrame';
|
|
13
14
|
export type { FrameworkIconProps, FrameworkIconTheme, FrameworkIconName } from './components/FrameworkIcon';
|
|
14
15
|
export type { InputSoloProps, InputSoloVariant, InputSoloSize } from './components/InputSolo';
|
|
15
16
|
export type { SearchDropdownProps, SearchDropdownItem } from './components/SearchDropdown';
|
|
@@ -34,6 +35,7 @@ export type { LogoCarouselProps } from './components/LogoCarousel';
|
|
|
34
35
|
export { Icon } from './components/Icon';
|
|
35
36
|
export { Link } from './components/Link';
|
|
36
37
|
export { ProductIcon } from './components/ProductIcon';
|
|
38
|
+
export { ProductIconFrame } from './components/ProductIcon/ProductIconFrame';
|
|
37
39
|
export { FrameworkIcon } from './components/FrameworkIcon';
|
|
38
40
|
export { Button } from './components/Button';
|
|
39
41
|
export { ButtonGroup } from './components/ButtonGroup';
|
|
@@ -82,7 +84,7 @@ export { PrevNextNav } from './components/PrevNextNav';
|
|
|
82
84
|
export { PromoBanner, promoBannerProducts, promoBannerFraming } from './components/PromoBanner';
|
|
83
85
|
export type { PromoBannerProps, PromoBannerAction, PromoBannerProduct, PromoBannerProductDefaults, PromoBannerFraming } from './components/PromoBanner';
|
|
84
86
|
export { ProductNotice, PRODUCT_NOTICE_EVENTS } from './components/ProductNotice';
|
|
85
|
-
export type { ProductNoticeProps, ProductNoticeAction, ProductNoticeActionTracking, ProductNoticeInteraction, ProductNoticeTracking, ProductNoticeTrackingParams } from './components/ProductNotice';
|
|
87
|
+
export type { ProductNoticeProps, ProductNoticeProduct, ProductNoticeAction, ProductNoticeActionTracking, ProductNoticeInteraction, ProductNoticeTracking, ProductNoticeTrackingParams } from './components/ProductNotice';
|
|
86
88
|
export { TrackingProvider, useTracker, dataLayerTracker, gtagTracker } from './tracking';
|
|
87
89
|
export type { Tracker, TrackingEvent, TrackingItem, TrackingParams } from './tracking';
|
|
88
90
|
export { Breadcrumb } from './components/Breadcrumb';
|
package/dist/main.js
CHANGED
|
@@ -13,53 +13,54 @@ import { t as y } from "./CodeBlock-BM_Vefdj.js";
|
|
|
13
13
|
import { n as b, t as x } from "./ClientLogo-Dj7K48YL.js";
|
|
14
14
|
import { t as S } from "./LogoCarousel-e-1WK43R.js";
|
|
15
15
|
import { t as C } from "./Link-CYR92_U0.js";
|
|
16
|
-
import { t as w } from "./
|
|
17
|
-
import {
|
|
18
|
-
import { t as E } from "./
|
|
19
|
-
import { t as D } from "./
|
|
20
|
-
import {
|
|
21
|
-
import { t as M } from "./
|
|
22
|
-
import { t as N } from "./
|
|
23
|
-
import { t as P } from "./
|
|
24
|
-
import {
|
|
25
|
-
import { n as
|
|
26
|
-
import { t as z } from "./
|
|
27
|
-
import { t as B } from "./
|
|
28
|
-
import {
|
|
29
|
-
import { t as W } from "./
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import { t as Y } from "./
|
|
34
|
-
import { t as X } from "./
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import { t as te } from "./
|
|
39
|
-
import {
|
|
40
|
-
import { n as
|
|
41
|
-
import { t as oe } from "./
|
|
42
|
-
import { t as se } from "./
|
|
43
|
-
import { t as ce } from "./
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
16
|
+
import { t as w } from "./ProductIconFrame-CGrI3X4C.js";
|
|
17
|
+
import { ProductIcon as T } from "./components/ProductIcon/index.js";
|
|
18
|
+
import { t as E } from "./ButtonGroup-6tLQmpEH.js";
|
|
19
|
+
import { t as D } from "./InputSolo-CbnsJlJu.js";
|
|
20
|
+
import { t as O } from "./SearchDropdown-cml8LqKq.js";
|
|
21
|
+
import { i as k, n as A, r as j, t as M } from "./InputGrouped-B3WGuESX.js";
|
|
22
|
+
import { t as N } from "./Container-BDssaLig.js";
|
|
23
|
+
import { t as P } from "./DiscordInvite-DfPVlJ5G.js";
|
|
24
|
+
import { t as F } from "./Heading-DNDHqYWO.js";
|
|
25
|
+
import { n as I, t as L } from "./List-gHC2SJgK.js";
|
|
26
|
+
import { n as R, t as z } from "./Features-BQ5o3wcc.js";
|
|
27
|
+
import { t as B } from "./Logo-Bz0G2G-k.js";
|
|
28
|
+
import { t as V } from "./NewsletterSignup-Dk1cwk-W.js";
|
|
29
|
+
import { n as H, r as U, t as W } from "./Dropdown-BgY76epB.js";
|
|
30
|
+
import { t as G } from "./PrefPanel-DTbo6QDa.js";
|
|
31
|
+
import { n as K, t as q } from "./Label-DwiX1ZiD.js";
|
|
32
|
+
import { VideoCover as J } from "./components/VideoCover/index.js";
|
|
33
|
+
import { t as Y } from "./VideoPlayer-Cg9MFkP5.js";
|
|
34
|
+
import { t as X } from "./VideoPlayerModal-BzYnI2f2.js";
|
|
35
|
+
import { t as Z } from "./Footer-BjrF6d17.js";
|
|
36
|
+
import { n as Q } from "./GPTInput-g460kfc6.js";
|
|
37
|
+
import { t as $ } from "./Notification-D93nzw6M.js";
|
|
38
|
+
import { n as ee, t as te } from "./Header-Dbi8eOiH.js";
|
|
39
|
+
import { t as ne } from "./Tabs-TRXBM5Zr.js";
|
|
40
|
+
import { n as re, t as ie } from "./RadioBox-C7bDjItJ.js";
|
|
41
|
+
import { n as ae, t as oe } from "./Checkbox-CqFkzrVk.js";
|
|
42
|
+
import { t as se } from "./Toggle-BHjptO7-.js";
|
|
43
|
+
import { t as ce } from "./ToggleCard-kMpxzTnh.js";
|
|
44
|
+
import { t as le } from "./ToggleList-Dh7wb2-W.js";
|
|
45
|
+
import { Modal as ue } from "./components/Modal/index.js";
|
|
46
|
+
import { t as de } from "./RoadmapDetails-DIByXo2r.js";
|
|
47
|
+
import { ModalContactFooter as fe } from "./components/Modal/ModalContactFooter.js";
|
|
48
|
+
import { useOptionalSidebarLayout as pe, useSidebarLayout as me } from "./components/Sidebar/context.js";
|
|
49
|
+
import { SidebarLayout as he, SidebarMain as ge } from "./components/Sidebar/SidebarLayout.js";
|
|
50
|
+
import { SidebarResizer as _e } from "./components/Sidebar/SidebarResizer.js";
|
|
51
|
+
import { Sidebar as ve, SidebarBody as ye, SidebarHeader as be, SidebarSection as xe } from "./components/Sidebar/Sidebar.js";
|
|
52
|
+
import { SidebarSwitcher as Se } from "./components/Sidebar/SidebarSwitcher.js";
|
|
53
|
+
import { NavItem as Ce } from "./components/Sidebar/NavItem.js";
|
|
54
|
+
import { NavGroup as we } from "./components/Sidebar/NavGroup.js";
|
|
55
|
+
import { NavDisclosure as Te } from "./components/Sidebar/NavDisclosure.js";
|
|
55
56
|
import "./components/Sidebar/index.js";
|
|
56
|
-
import { t as
|
|
57
|
-
import { productFraming as
|
|
58
|
-
import { promoBannerProducts as
|
|
59
|
-
import { PromoBanner as
|
|
60
|
-
import { PRODUCT_NOTICE_EVENTS as
|
|
61
|
-
import { t as
|
|
62
|
-
import { t as
|
|
63
|
-
import { t as
|
|
64
|
-
import { ThemeLoader as
|
|
65
|
-
export { p as Accordion, f as AccordionItem, l as Box,
|
|
57
|
+
import { t as Ee } from "./PrevNextNav-C406puU6.js";
|
|
58
|
+
import { productFraming as De } from "./components/PromoBanner/product-framing.js";
|
|
59
|
+
import { promoBannerProducts as Oe } from "./components/PromoBanner/products.js";
|
|
60
|
+
import { PromoBanner as ke } from "./components/PromoBanner/index.js";
|
|
61
|
+
import { PRODUCT_NOTICE_EVENTS as Ae } from "./components/ProductNotice/tracking.js";
|
|
62
|
+
import { t as je } from "./ProductNotice-BfI0v5Ag.js";
|
|
63
|
+
import { t as Me } from "./Breadcrumb-BQzfkMH0.js";
|
|
64
|
+
import { t as Ne } from "./TableOfContents-d26S7KYx.js";
|
|
65
|
+
import { ThemeLoader as Pe, themeLoaderScript as Fe } from "./components/ThemeLoader/index.js";
|
|
66
|
+
export { p as Accordion, f as AccordionItem, l as Box, Me as Breadcrumb, m as BrowserFrame, u as Button, E as ButtonGroup, oe as Checkbox, ae as CheckboxGroup, x as ClientLogo, y as CodeBlock, N as Container, _ as CopyCode, P as DiscordInvite, W as Dropdown, H as DropdownItem, U as DropdownSeparator, z as FeatureItem, R as Features, g as Figure, Z as Footer, M as FormGroup, A as FormRow, v as FrameworkIcon, Q as GPTInput, te as Header, F as Heading, h as Icon, j as InputGrouped, D as InputSolo, q as Label, C as Link, L as List, I as ListItem, B as Logo, S as LogoCarousel, ue as Modal, fe as ModalContactFooter, Te as NavDisclosure, we as NavGroup, Ce as NavItem, K as NewTag, V as NewsletterSignup, $ as Notification, Ae as PRODUCT_NOTICE_EVENTS, G as PrefPanel, Ee as PrevNextNav, T as ProductIcon, w as ProductIconFrame, je as ProductNotice, ke as PromoBanner, ie as RadioBox, re as RadioBoxGroup, de as RoadmapDetails, O as SearchDropdown, k as SelectGrouped, ve as Sidebar, ye as SidebarBody, be as SidebarHeader, he as SidebarLayout, ge as SidebarMain, _e as SidebarResizer, xe as SidebarSection, Se as SidebarSwitcher, ee as SubHeader, Ne as TableOfContents, ne as Tabs, Pe as ThemeLoader, i as ThemeProvider, se as Toggle, ce as ToggleCard, le as ToggleList, a as TrackingProvider, d as Typography, J as VideoCover, Y as VideoPlayer, X as VideoPlayerModal, b as clientLogoLabels, o as dataLayerTracker, s as gtagTracker, De as promoBannerFraming, Oe as promoBannerProducts, Fe as themeLoaderScript, n as useClipboard, t as useNextTheme, pe as useOptionalSidebarLayout, me as useSidebarLayout, r as useSuccessFlash, e as useTheme, c as useTracker };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "highsoft-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.188",
|
|
4
4
|
"description": "Highsoft UI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
"import": "./dist/main.js",
|
|
15
15
|
"types": "./dist/lib/main.d.ts"
|
|
16
16
|
},
|
|
17
|
+
"./product-icons/*": {
|
|
18
|
+
"import": "./dist/components/ProductIcon/icons/*.js",
|
|
19
|
+
"types": "./dist/lib/components/ProductIcon/icons/*.d.ts"
|
|
20
|
+
},
|
|
17
21
|
"./css": "./dist/highsoft-ui.css",
|
|
18
22
|
"./scss/mixins": "./dist/scss/mixins.scss",
|
|
19
23
|
"./scss/variables": "./dist/scss/variables.scss",
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./clsx-BWCAbrjV.js";
|
|
2
|
-
import { t } from "./components/ProductIcon/icons/multi/index.js";
|
|
3
|
-
import { t as n } from "./components/ProductIcon/icons/monochrome/index.js";
|
|
4
|
-
import { t as r } from "./components/ProductIcon/icons/grayscale/index.js";
|
|
5
|
-
import { t as i } from "./components/ProductIcon/icons/line/index.js";
|
|
6
|
-
import { jsx as a } from "react/jsx-runtime";
|
|
7
|
-
var o = {
|
|
8
|
-
boxInner: "dUDeZG_boxInner",
|
|
9
|
-
boxOuter: "dUDeZG_boxOuter",
|
|
10
|
-
icon: "dUDeZG_icon",
|
|
11
|
-
svg: "dUDeZG_svg"
|
|
12
|
-
}, s = {
|
|
13
|
-
core: "Core",
|
|
14
|
-
stock: "Stock",
|
|
15
|
-
maps: "Maps",
|
|
16
|
-
gantt: "Gantt",
|
|
17
|
-
dashboards: "Dashboards",
|
|
18
|
-
grid: "Grid",
|
|
19
|
-
orbit: "Orbit",
|
|
20
|
-
morningstar: "Morningstar",
|
|
21
|
-
demos: "Demos",
|
|
22
|
-
docs: "Docs",
|
|
23
|
-
API: "Api",
|
|
24
|
-
changelog: "Changelog",
|
|
25
|
-
roadmap: "Roadmap",
|
|
26
|
-
"chart chooser": "ChartChooser",
|
|
27
|
-
hca: "Hca",
|
|
28
|
-
a11y: "Accessibility",
|
|
29
|
-
"edu license": "EduLicense",
|
|
30
|
-
gpt: "Gpt",
|
|
31
|
-
editor: "Editor",
|
|
32
|
-
"export server": "ExportServer",
|
|
33
|
-
python: "Python",
|
|
34
|
-
lab: "Lab",
|
|
35
|
-
support: "Support",
|
|
36
|
-
"custom projects": "CustomProjects",
|
|
37
|
-
"case studies": "CaseStudies",
|
|
38
|
-
license: "License",
|
|
39
|
-
"ADV+": "Advantageplus"
|
|
40
|
-
}, c = {
|
|
41
|
-
multi: t,
|
|
42
|
-
monochrome: n,
|
|
43
|
-
grayscale: r,
|
|
44
|
-
line: i
|
|
45
|
-
};
|
|
46
|
-
function l({ icon: t, theme: n = "multi", size: r = 24, box: i = !1, className: l, style: u, ...d }) {
|
|
47
|
-
let f = s[t], p = c[n][f];
|
|
48
|
-
if (!p) return console.warn(`ProductIcon: No icon found for "${t}" with theme "${n}"`), null;
|
|
49
|
-
let m = /* @__PURE__ */ a("span", {
|
|
50
|
-
className: e("hsui-product-icon", o.icon, l),
|
|
51
|
-
style: {
|
|
52
|
-
width: r,
|
|
53
|
-
height: r
|
|
54
|
-
},
|
|
55
|
-
children: /* @__PURE__ */ a(p, {
|
|
56
|
-
width: r,
|
|
57
|
-
height: r,
|
|
58
|
-
style: {
|
|
59
|
-
width: r,
|
|
60
|
-
height: r,
|
|
61
|
-
...u
|
|
62
|
-
},
|
|
63
|
-
...d
|
|
64
|
-
})
|
|
65
|
-
});
|
|
66
|
-
return i ? /* @__PURE__ */ a("span", {
|
|
67
|
-
className: o.boxOuter,
|
|
68
|
-
children: /* @__PURE__ */ a("span", {
|
|
69
|
-
className: o.boxInner,
|
|
70
|
-
children: m
|
|
71
|
-
})
|
|
72
|
-
}) : m;
|
|
73
|
-
}
|
|
74
|
-
//#endregion
|
|
75
|
-
export { l as t };
|
|
@@ -1,144 +0,0 @@
|
|
|
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 };
|