@phillips/seldon 1.90.0 → 1.91.1

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.
@@ -1,4 +1,5 @@
1
1
  import { default as React } from 'react';
2
+ import { HeightUnits } from './utils';
2
3
  export interface ContentPeekProps extends React.HTMLAttributes<HTMLDivElement> {
3
4
  /**
4
5
  * Unique id for component testing
@@ -20,6 +21,14 @@ export interface ContentPeekProps extends React.HTMLAttributes<HTMLDivElement> {
20
21
  * Maximum height of the content when collapsed
21
22
  */
22
23
  maxHeight?: number;
24
+ /**
25
+ * Used to set a minimum height for the content before enabling the Peek functionality. Defaults to the same value as maxHeight if not provided.
26
+ */
27
+ minHeightThreshold?: number;
28
+ /**
29
+ * The unit used for setting height values. Defaults to 'px'.
30
+ */
31
+ heightUnits?: HeightUnits;
23
32
  }
24
33
  /**
25
34
  * ## Overview
@@ -1,55 +1,61 @@
1
- import { jsxs as m, jsx as o } from "react/jsx-runtime";
2
- import { forwardRef as N, useState as i, useRef as x, useEffect as $, useCallback as P } from "react";
3
- import c from "../../node_modules/classnames/index.js";
4
- import { getCommonProps as b } from "../../utils/index.js";
5
- import k from "../Button/Button.js";
6
- import { ButtonVariants as R } from "../Button/types.js";
7
- import w from "../Collapsible/Collapsible.js";
8
- import E from "../Collapsible/CollapsibleContent.js";
9
- import M from "../Collapsible/CollapsibleTrigger.js";
10
- import O from "../../assets/plus.svg.js";
11
- import S from "../../assets/minus.svg.js";
12
- const j = N(
1
+ import { jsxs as f, jsx as o } from "react/jsx-runtime";
2
+ import { forwardRef as P, useState as i, useRef as b, useEffect as k, useCallback as R } from "react";
3
+ import d from "../../node_modules/classnames/index.js";
4
+ import { getCommonProps as w } from "../../utils/index.js";
5
+ import E from "../Button/Button.js";
6
+ import { ButtonVariants as M } from "../Button/types.js";
7
+ import O from "../Collapsible/Collapsible.js";
8
+ import S from "../Collapsible/CollapsibleContent.js";
9
+ import j from "../Collapsible/CollapsibleTrigger.js";
10
+ import B from "../../assets/plus.svg.js";
11
+ import I from "../../assets/minus.svg.js";
12
+ import { HeightUnits as L } from "./utils.js";
13
+ const U = P(
13
14
  ({
14
- className: f,
15
- children: n,
16
- contentExpandText: d = "Read More",
17
- contentCollapseText: u = "Read Less",
18
- maxHeight: a = 480,
19
- ...r
20
- }, p) => {
21
- const { className: e, ...g } = b(r, "ContentPeek"), [t, v] = i(!1), [l, C] = i(!1), s = x(null);
22
- $(() => {
23
- s.current && C(s.current.scrollHeight > a);
24
- }, [n, a]);
25
- const h = P(() => {
26
- v((y) => !y);
15
+ className: p,
16
+ children: m,
17
+ contentExpandText: u = "Read More",
18
+ contentCollapseText: v = "Read Less",
19
+ maxHeight: s = 480,
20
+ minHeightThreshold: a,
21
+ heightUnits: C = L.px,
22
+ ...t
23
+ }, g) => {
24
+ const { className: e, ...y } = w(t, "ContentPeek"), [r, N] = i(!1), [c, $] = i(!1), n = b(null);
25
+ k(() => {
26
+ if (n.current) {
27
+ const l = a != null ? a : s;
28
+ $(n.current.scrollHeight > l);
29
+ }
30
+ }, [m, s, a]);
31
+ const x = R(() => {
32
+ N((l) => !l);
27
33
  }, []);
28
- return /* @__PURE__ */ m(
29
- w,
34
+ return /* @__PURE__ */ f(
35
+ O,
30
36
  {
31
- id: r == null ? void 0 : r.id,
32
- open: t,
33
- onOpenChange: h,
34
- className: c(e, f),
37
+ id: t == null ? void 0 : t.id,
38
+ open: r,
39
+ onOpenChange: x,
40
+ className: d(e, p),
35
41
  style: {
36
- "--content-peek-max-height": `${a}px`
42
+ "--content-peek-max-height": `${s}${C}`
37
43
  },
38
- ref: p,
39
- ...g,
40
- ...r,
44
+ ref: g,
45
+ ...y,
46
+ ...t,
41
47
  children: [
42
- /* @__PURE__ */ o(E, { className: `${e}-content`, ref: s, forceMount: !0, children: n }),
43
- l ? /* @__PURE__ */ o(
48
+ /* @__PURE__ */ o(S, { className: `${e}-content`, ref: n, forceMount: !0, children: m }),
49
+ c ? /* @__PURE__ */ o(
44
50
  "div",
45
51
  {
46
- className: c(`${e}-overlay`, {
47
- [`${e}-overlay--expanded`]: t,
48
- [`${e}-overlay--gradient`]: l && !t
52
+ className: d(`${e}-overlay`, {
53
+ [`${e}-overlay--expanded`]: r,
54
+ [`${e}-overlay--gradient`]: c && !r
49
55
  }),
50
- children: /* @__PURE__ */ o("div", { className: `${e}-overlay-trigger-wrapper`, children: /* @__PURE__ */ o(M, { asChild: !0, className: `${e}-overlay-trigger`, children: /* @__PURE__ */ m(k, { variant: R.secondary, children: [
51
- t ? /* @__PURE__ */ o(S, {}) : /* @__PURE__ */ o(O, {}),
52
- t ? u : d
56
+ children: /* @__PURE__ */ o("div", { className: `${e}-overlay-trigger-wrapper`, children: /* @__PURE__ */ o(j, { asChild: !0, className: `${e}-overlay-trigger`, children: /* @__PURE__ */ f(E, { variant: M.secondary, children: [
57
+ r ? /* @__PURE__ */ o(I, {}) : /* @__PURE__ */ o(B, {}),
58
+ r ? v : u
53
59
  ] }) }) })
54
60
  }
55
61
  ) : null
@@ -58,7 +64,7 @@ const j = N(
58
64
  );
59
65
  }
60
66
  );
61
- j.displayName = "ContentPeek";
67
+ U.displayName = "ContentPeek";
62
68
  export {
63
- j as default
69
+ U as default
64
70
  };
@@ -12,6 +12,9 @@ declare const meta: {
12
12
  maxHeight: {
13
13
  control: "number";
14
14
  };
15
+ minHeightThreshold: {
16
+ control: "number";
17
+ };
15
18
  };
16
19
  };
17
20
  export default meta;
@@ -1 +1,2 @@
1
1
  export { default as ContentPeek, type ContentPeekProps } from './ContentPeek';
2
+ export { HeightUnits as ContentPeekHeightUnits } from './utils';
@@ -0,0 +1,4 @@
1
+ export declare enum HeightUnits {
2
+ px = "px",
3
+ rem = "rem"
4
+ }
@@ -0,0 +1,4 @@
1
+ var e = /* @__PURE__ */ ((r) => (r.px = "px", r.rem = "rem", r))(e || {});
2
+ export {
3
+ e as HeightUnits
4
+ };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { PaddingTokens as f, SpacingTokens as s, defaultYear as l, emailValidation as m, encodeURLSearchParams as d, findChildrenExcludingTypes as p, findChildrenOfType as u, generatePaddingClassName as x, getCommonProps as n, noOp as i, px as g, useNormalizedInputProps as c } from "./utils/index.js";
1
+ import { PaddingTokens as f, SpacingTokens as s, defaultYear as l, emailValidation as m, encodeURLSearchParams as p, findChildrenExcludingTypes as d, findChildrenOfType as u, generatePaddingClassName as x, getCommonProps as n, noOp as i, px as g, useNormalizedInputProps as c } from "./utils/index.js";
2
2
  import { default as S } from "./assets/account_circle.svg.js";
3
3
  import { default as P } from "./assets/arrowPrev.svg.js";
4
4
  import { default as I } from "./assets/calendar.svg.js";
@@ -7,11 +7,11 @@ import { default as A } from "./assets/chevronNext.svg.js";
7
7
  import { default as v } from "./assets/chevronRight.svg.js";
8
8
  import { default as y } from "./assets/close.svg.js";
9
9
  import { default as D } from "./assets/favoriteOutline.svg.js";
10
- import { default as R } from "./assets/icon-footer-facebook.svg.js";
11
- import { default as M } from "./assets/icon-footer-instagram.svg.js";
12
- import { default as G } from "./assets/icon-footer-linkedin.svg.js";
13
- import { default as W } from "./assets/icon-footer-red.svg.js";
14
- import { default as Q } from "./assets/icon-footer-wechat.svg.js";
10
+ import { default as H } from "./assets/icon-footer-facebook.svg.js";
11
+ import { default as F } from "./assets/icon-footer-instagram.svg.js";
12
+ import { default as U } from "./assets/icon-footer-linkedin.svg.js";
13
+ import { default as O } from "./assets/icon-footer-red.svg.js";
14
+ import { default as E } from "./assets/icon-footer-wechat.svg.js";
15
15
  import { default as Y } from "./assets/instagram.svg.js";
16
16
  import { default as Z } from "./assets/lock.svg.js";
17
17
  import { default as q } from "./assets/minus.svg.js";
@@ -23,7 +23,7 @@ import { default as te } from "./assets/share.svg.js";
23
23
  import { default as ae } from "./assets/spotify.svg.js";
24
24
  import { default as se } from "./assets/wechat.svg.js";
25
25
  import { default as me } from "./assets/youtube.svg.js";
26
- import { default as pe } from "./pages/Page.js";
26
+ import { default as de } from "./pages/Page.js";
27
27
  import { usePendingState as xe } from "./utils/hooks.js";
28
28
  import { SSRMediaQuery as ie, ssrMediaQueryStyle as ge } from "./providers/SeldonProvider/utils.js";
29
29
  import { default as Ce } from "./components/Button/Button.js";
@@ -35,11 +35,11 @@ import { Grid as Ve } from "./components/Grid/Grid.js";
35
35
  import { default as we } from "./site-furniture/Header/Header.js";
36
36
  import { default as Be } from "./components/Navigation/Navigation.js";
37
37
  import { default as Ne } from "./components/Navigation/NavigationItem/NavigationItem.js";
38
- import { default as Fe } from "./components/Navigation/NavigationItemTrigger/NavigationItemTrigger.js";
39
- import { default as He } from "./components/Navigation/NavigationList/NavigationList.js";
40
- import { default as Oe } from "./patterns/HeroBanner/HeroBanner.js";
41
- import { default as Ee } from "./components/Input/Input.js";
42
- import { default as Ue } from "./components/Link/Link.js";
38
+ import { default as Re } from "./components/Navigation/NavigationItemTrigger/NavigationItemTrigger.js";
39
+ import { default as Me } from "./components/Navigation/NavigationList/NavigationList.js";
40
+ import { default as Ge } from "./patterns/HeroBanner/HeroBanner.js";
41
+ import { default as We } from "./components/Input/Input.js";
42
+ import { default as Qe } from "./components/Link/Link.js";
43
43
  import { LinkVariants as ze } from "./components/Link/types.js";
44
44
  import { default as je } from "./components/LinkBlock/LinkBlock.js";
45
45
  import { default as Je } from "./components/LinkList/LinkList.js";
@@ -61,11 +61,11 @@ import { default as Ao } from "./patterns/ViewingsList/StatefulViewingsList.js";
61
61
  import { TextVariants as vo } from "./components/Text/types.js";
62
62
  import { default as yo } from "./components/Text/Text.js";
63
63
  import { TextSymbolVariants as Do } from "./components/TextSymbol/types.js";
64
- import { default as Ro } from "./components/TextSymbol/TextSymbol.js";
65
- import { default as Mo } from "./components/Accordion/Accordion.js";
66
- import { default as Go } from "./components/Accordion/AccordionItem.js";
67
- import { AccordionItemVariant as Wo, AccordionVariants as Eo } from "./components/Accordion/types.js";
68
- import { default as Uo } from "./patterns/UserManagement/UserManagement.js";
64
+ import { default as Ho } from "./components/TextSymbol/TextSymbol.js";
65
+ import { default as Fo } from "./components/Accordion/Accordion.js";
66
+ import { default as Uo } from "./components/Accordion/AccordionItem.js";
67
+ import { AccordionItemVariant as Oo, AccordionVariants as Wo } from "./components/Accordion/types.js";
68
+ import { default as Qo } from "./patterns/UserManagement/UserManagement.js";
69
69
  import { AuthState as zo } from "./patterns/UserManagement/types.js";
70
70
  import { SupportedLanguages as jo } from "./types/commonTypes.js";
71
71
  import { default as Jo } from "./components/Breadcrumb/Breadcrumb.js";
@@ -75,102 +75,104 @@ import { default as Xo } from "./components/Dropdown/Dropdown.js";
75
75
  import { default as $o } from "./components/Video/Video.js";
76
76
  import { default as ot } from "./patterns/LanguageSelector/LanguageSelector.js";
77
77
  import { default as rt } from "./components/ContentPeek/ContentPeek.js";
78
- import { default as ft } from "./components/Collapsible/Collapsible.js";
79
- import { default as lt } from "./components/Collapsible/CollapsibleContent.js";
80
- import { default as dt } from "./components/Collapsible/CollapsibleTrigger.js";
81
- import { SeldonProvider as ut } from "./providers/SeldonProvider/SeldonProvider.js";
82
- import { default as nt } from "./components/PageContentWrapper/PageContentWrapper.js";
83
- import { default as gt } from "./components/Carousel/Carousel.js";
84
- import { default as Ct } from "./components/Carousel/CarouselContent.js";
85
- import { default as Lt } from "./components/Carousel/CarouselItem.js";
86
- import { default as ht } from "./components/Carousel/CarouselDots.js";
87
- import { default as bt } from "./components/Detail/Detail.js";
88
- import { default as kt } from "./patterns/DetailList/DetailList.js";
89
- import { DetailListAlignment as Vt } from "./patterns/DetailList/types.js";
90
- import { default as wt } from "./components/PinchZoom/PinchZoom.js";
91
- import { default as Bt } from "./components/Tabs/TabsContainer.js";
92
- import { default as Nt } from "./components/Tabs/TabsContent.js";
93
- import { default as Ft } from "./components/SeldonImage/SeldonImage.js";
94
- import { default as Ht } from "./patterns/SaleHeaderBanner/SaleHeaderBanner.js";
95
- import { default as Ot } from "./patterns/SaleHeaderBanner/SaleHeaderBrowseAuctions.js";
96
- import { AuctionState as Et } from "./patterns/SaleHeaderBanner/types.js";
97
- import { default as Ut } from "./components/Countdown/Countdown.js";
98
- import { CountdownVariants as zt } from "./components/Countdown/types.js";
78
+ import { HeightUnits as ft } from "./components/ContentPeek/utils.js";
79
+ import { default as lt } from "./components/Collapsible/Collapsible.js";
80
+ import { default as pt } from "./components/Collapsible/CollapsibleContent.js";
81
+ import { default as ut } from "./components/Collapsible/CollapsibleTrigger.js";
82
+ import { SeldonProvider as nt } from "./providers/SeldonProvider/SeldonProvider.js";
83
+ import { default as gt } from "./components/PageContentWrapper/PageContentWrapper.js";
84
+ import { default as Ct } from "./components/Carousel/Carousel.js";
85
+ import { default as Lt } from "./components/Carousel/CarouselContent.js";
86
+ import { default as ht } from "./components/Carousel/CarouselItem.js";
87
+ import { default as bt } from "./components/Carousel/CarouselDots.js";
88
+ import { default as kt } from "./components/Detail/Detail.js";
89
+ import { default as Vt } from "./patterns/DetailList/DetailList.js";
90
+ import { DetailListAlignment as wt } from "./patterns/DetailList/types.js";
91
+ import { default as Bt } from "./components/PinchZoom/PinchZoom.js";
92
+ import { default as Nt } from "./components/Tabs/TabsContainer.js";
93
+ import { default as Rt } from "./components/Tabs/TabsContent.js";
94
+ import { default as Mt } from "./components/SeldonImage/SeldonImage.js";
95
+ import { default as Gt } from "./patterns/SaleHeaderBanner/SaleHeaderBanner.js";
96
+ import { default as Wt } from "./patterns/SaleHeaderBanner/SaleHeaderBrowseAuctions.js";
97
+ import { AuctionState as Qt } from "./patterns/SaleHeaderBanner/types.js";
98
+ import { default as zt } from "./components/Countdown/Countdown.js";
99
+ import { CountdownVariants as jt } from "./components/Countdown/types.js";
99
100
  export {
100
- Mo as Accordion,
101
- Go as AccordionItem,
102
- Wo as AccordionItemVariant,
103
- Eo as AccordionVariants,
101
+ Fo as Accordion,
102
+ Uo as AccordionItem,
103
+ Oo as AccordionItemVariant,
104
+ Wo as AccordionVariants,
104
105
  S as AccountCircle,
105
106
  P as ArrowPrev,
106
- Et as AuctionState,
107
+ Qt as AuctionState,
107
108
  zo as AuthState,
108
109
  Jo as Breadcrumb,
109
110
  Ce as Button,
110
111
  Le as ButtonVariants,
111
112
  I as Calendar,
112
- gt as Carousel,
113
- Ct as CarouselContent,
114
- ht as CarouselDots,
115
- Lt as CarouselItem,
113
+ Ct as Carousel,
114
+ Lt as CarouselContent,
115
+ bt as CarouselDots,
116
+ ht as CarouselItem,
116
117
  T as ChevronDown,
117
118
  A as ChevronNext,
118
119
  v as ChevronRight,
119
120
  y as Close,
120
- ft as Collapsible,
121
- lt as CollapsibleContent,
122
- dt as CollapsibleTrigger,
121
+ lt as Collapsible,
122
+ pt as CollapsibleContent,
123
+ ut as CollapsibleTrigger,
123
124
  rt as ContentPeek,
124
- Ut as Countdown,
125
- zt as CountdownVariants,
126
- bt as Detail,
127
- kt as DetailList,
128
- Vt as DetailListAlignment,
125
+ ft as ContentPeekHeightUnits,
126
+ zt as Countdown,
127
+ jt as CountdownVariants,
128
+ kt as Detail,
129
+ Vt as DetailList,
130
+ wt as DetailListAlignment,
129
131
  Po as Drawer,
130
132
  Xo as Dropdown,
131
133
  be as ErrorBoundary,
132
- R as Facebook,
134
+ H as Facebook,
133
135
  D as FavoriteOutline,
134
136
  ke as Footer,
135
- M as FooterInstagram,
136
- Q as FooterWeChat,
137
+ F as FooterInstagram,
138
+ E as FooterWeChat,
137
139
  Ve as Grid,
138
140
  $e as GridItem,
139
141
  oo as GridItemAlign,
140
142
  we as Header,
141
- Oe as HeroBanner,
143
+ Ge as HeroBanner,
142
144
  he as IconButton,
143
- Ee as Input,
145
+ We as Input,
144
146
  Y as Instagram,
145
147
  ot as LanguageSelector,
146
- Ue as Link,
148
+ Qe as Link,
147
149
  je as LinkBlock,
148
150
  Je as LinkList,
149
151
  ze as LinkVariants,
150
- G as LinkedIn,
152
+ U as LinkedIn,
151
153
  Z as Lock,
152
154
  q as Minus,
153
155
  So as Modal,
154
156
  Be as Navigation,
155
157
  Ne as NavigationItem,
156
- Fe as NavigationItemTrigger,
157
- He as NavigationList,
158
+ Re as NavigationItemTrigger,
159
+ Me as NavigationList,
158
160
  f as PaddingTokens,
159
- pe as Page,
160
- nt as PageContentWrapper,
161
+ de as Page,
162
+ gt as PageContentWrapper,
161
163
  Io as Pagination,
162
164
  K as PhillipsLogo,
163
- wt as PinchZoom,
165
+ Bt as PinchZoom,
164
166
  _ as Plus,
165
167
  ee as React,
166
- W as Reddit,
168
+ O as Reddit,
167
169
  Xe as Row,
168
170
  ie as SSRMediaQuery,
169
- Ht as SaleHeaderBanner,
170
- Ot as SaleHeaderBrowseAuctions,
171
+ Gt as SaleHeaderBanner,
172
+ Wt as SaleHeaderBrowseAuctions,
171
173
  ro as Search,
172
- Ft as SeldonImage,
173
- ut as SeldonProvider,
174
+ Mt as SeldonImage,
175
+ nt as SeldonProvider,
174
176
  fo as Select,
175
177
  te as Share,
176
178
  io as Social,
@@ -181,22 +183,22 @@ export {
181
183
  po as Subscribe,
182
184
  xo as SubscriptionState,
183
185
  jo as SupportedLanguages,
184
- Bt as TabsContainer,
185
- Nt as TabsContent,
186
+ Nt as TabsContainer,
187
+ Rt as TabsContent,
186
188
  To as TagsList,
187
189
  yo as Text,
188
190
  Do as TextSymbolVariants,
189
- Ro as TextSymbols,
191
+ Ho as TextSymbols,
190
192
  vo as TextVariants,
191
- Uo as UserManagement,
193
+ Qo as UserManagement,
192
194
  $o as Video,
193
195
  co as ViewingsList,
194
196
  se as WeChat,
195
197
  me as Youtube,
196
198
  l as defaultYear,
197
199
  m as emailValidation,
198
- d as encodeURLSearchParams,
199
- p as findChildrenExcludingTypes,
200
+ p as encodeURLSearchParams,
201
+ d as findChildrenExcludingTypes,
200
202
  u as findChildrenOfType,
201
203
  x as generatePaddingClassName,
202
204
  n as getCommonProps,
@@ -1,4 +1,4 @@
1
- import { __module as t } from "../../_virtual/index6.js";
1
+ import { __module as t } from "../../_virtual/index5.js";
2
2
  /*!
3
3
  Copyright (c) 2015 Jed Watson.
4
4
  Based on code that is Copyright 2013-2015, Facebook, Inc.
@@ -1,4 +1,4 @@
1
- import { __module as e } from "../../../../_virtual/index5.js";
1
+ import { __module as e } from "../../../../_virtual/index6.js";
2
2
  import { __require as o } from "./cjs/react-is.production.min.js";
3
3
  import { __require as t } from "./cjs/react-is.development.js";
4
4
  var r;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.90.0",
3
+ "version": "1.91.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"