@phillips/seldon 1.75.4 → 1.77.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/dist/components/PageContentWrapper/index.d.ts +1 -0
- package/dist/components/Tabs/TabTrigger.d.ts +25 -0
- package/dist/components/Tabs/TabTrigger.js +14 -0
- package/dist/components/Tabs/TabsContainer.d.ts +47 -0
- package/dist/components/Tabs/TabsContainer.js +42 -0
- package/dist/components/Tabs/TabsContent.d.ts +23 -0
- package/dist/components/Tabs/TabsContent.js +26 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +77 -65
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +180 -0
- package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +163 -0
- package/dist/node_modules/@radix-ui/react-tabs/node_modules/@radix-ui/react-context/dist/index.js +55 -0
- package/dist/node_modules/@radix-ui/react-tabs/node_modules/@radix-ui/react-presence/dist/index.js +75 -0
- package/dist/patterns/SaleHeaderBanner/SaleHeaderBanner.d.ts +49 -0
- package/dist/patterns/SaleHeaderBanner/SaleHeaderBanner.js +55 -0
- package/dist/patterns/SaleHeaderBanner/SaleHeaderBrowseAuctions.d.ts +7 -0
- package/dist/patterns/SaleHeaderBanner/SaleHeaderBrowseAuctions.js +20 -0
- package/dist/patterns/SaleHeaderBanner/SaleHeaderCountdown.d.ts +8 -0
- package/dist/patterns/SaleHeaderBanner/SaleHeaderCountdown.js +35 -0
- package/dist/patterns/SaleHeaderBanner/index.d.ts +4 -0
- package/dist/patterns/SaleHeaderBanner/types.d.ts +5 -0
- package/dist/patterns/SaleHeaderBanner/types.js +4 -0
- package/dist/scss/componentStyles.scss +2 -0
- package/dist/scss/components/Tabs/_tabs.scss +75 -0
- package/dist/scss/patterns/SaleHeaderBanner/_saleHeaderBanner.scss +70 -0
- package/package.json +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as PageContentWrapper, type PageContentWrapperProps } from './PageContentWrapper';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
export interface TabTriggerProps extends ComponentProps<'div'> {
|
|
3
|
+
/**
|
|
4
|
+
* Value corresponding to the tab
|
|
5
|
+
*/
|
|
6
|
+
value: string;
|
|
7
|
+
/**
|
|
8
|
+
* Optional onClick handler
|
|
9
|
+
* @param value
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
onTabClick?: (value: string) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Tab label
|
|
15
|
+
*/
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* TabTrigger component that serves as the clickable tab.
|
|
20
|
+
*
|
|
21
|
+
* @param {TabTriggerProps} props - The props for the TabTrigger component.
|
|
22
|
+
* @returns {JSX.Element} The rendered TabTrigger component.
|
|
23
|
+
*/
|
|
24
|
+
declare const TabTrigger: import("react").ForwardRefExoticComponent<Omit<TabTriggerProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
25
|
+
export default TabTrigger;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as g } from "react";
|
|
3
|
+
import { getCommonProps as f } from "../../utils/index.js";
|
|
4
|
+
import { Trigger as n } from "../../node_modules/@radix-ui/react-tabs/dist/index.js";
|
|
5
|
+
const p = g(({ value: r, onTabClick: o, children: a, ...s }, e) => {
|
|
6
|
+
const m = () => {
|
|
7
|
+
o && o(r);
|
|
8
|
+
}, { className: t } = f(s, "TabsContainer");
|
|
9
|
+
return /* @__PURE__ */ i(n, { value: r, className: `${t}__tabs-trigger`, onClick: m, ref: e, children: a });
|
|
10
|
+
});
|
|
11
|
+
p.displayName = "TabTrigger";
|
|
12
|
+
export {
|
|
13
|
+
p as default
|
|
14
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
export interface Tab {
|
|
3
|
+
/**
|
|
4
|
+
* button label
|
|
5
|
+
*/
|
|
6
|
+
label: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Button value
|
|
9
|
+
*/
|
|
10
|
+
value: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* TabsContainer renders a tab interface allowing switching between different content.
|
|
14
|
+
*
|
|
15
|
+
* @param {TabsContainerProps} props - The component props containing an array of tabs.
|
|
16
|
+
* @returns {JSX.Element} The rendered tab component.
|
|
17
|
+
*/
|
|
18
|
+
export interface TabsContainerProps extends ComponentProps<'div'> {
|
|
19
|
+
tabs: Tab[];
|
|
20
|
+
/**
|
|
21
|
+
* Specify the default tab
|
|
22
|
+
*/
|
|
23
|
+
defaultValue?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Aria-label for specific tab list view
|
|
26
|
+
*/
|
|
27
|
+
tabListLabel?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Optional handler when a tab is clicked
|
|
30
|
+
*/
|
|
31
|
+
onTabClick?: (value: string) => void;
|
|
32
|
+
/**
|
|
33
|
+
* TabContent components will be passed here
|
|
34
|
+
*/
|
|
35
|
+
children?: React.ReactNode;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* ## Overview
|
|
39
|
+
*
|
|
40
|
+
* Overview of Tabs component
|
|
41
|
+
*
|
|
42
|
+
* [Figma Link](https://www.figma.com/file/hMu9IWH5N3KamJy8tLFdyV?type=design&node-id=10838%3A22184&mode=dev)
|
|
43
|
+
*
|
|
44
|
+
* [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-tabs--overview)
|
|
45
|
+
*/
|
|
46
|
+
declare const TabsContainer: import("react").ForwardRefExoticComponent<Omit<TabsContainerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
47
|
+
export default TabsContainer;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsxs as o, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as d } from "react";
|
|
3
|
+
import { getCommonProps as u } from "../../utils/index.js";
|
|
4
|
+
import b from "../../node_modules/classnames/index.js";
|
|
5
|
+
import { Root as T, List as N } from "../../node_modules/@radix-ui/react-tabs/dist/index.js";
|
|
6
|
+
import g from "./TabTrigger.js";
|
|
7
|
+
import { TextVariants as v } from "../Text/types.js";
|
|
8
|
+
import _ from "../Text/Text.js";
|
|
9
|
+
const x = d(
|
|
10
|
+
({ className: l, tabs: s = [], tabListLabel: m = "Sale Page Tabs", children: t, defaultValue: i, onTabClick: n, ...c }, f) => {
|
|
11
|
+
const { className: a, ...p } = u(c, "TabsContainer");
|
|
12
|
+
return /* @__PURE__ */ o(
|
|
13
|
+
T,
|
|
14
|
+
{
|
|
15
|
+
defaultValue: i || s[0].value,
|
|
16
|
+
...p,
|
|
17
|
+
className: b(`${a}`, l),
|
|
18
|
+
ref: f,
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ o(N, { "aria-label": m, className: `${a}__tabs-list`, children: [
|
|
21
|
+
s.map((e) => /* @__PURE__ */ r(
|
|
22
|
+
g,
|
|
23
|
+
{
|
|
24
|
+
value: e.value,
|
|
25
|
+
className: `${a}__tabs-trigger`,
|
|
26
|
+
onTabClick: n,
|
|
27
|
+
children: /* @__PURE__ */ r(_, { variant: v.label, children: e.label })
|
|
28
|
+
},
|
|
29
|
+
e.value
|
|
30
|
+
)),
|
|
31
|
+
/* @__PURE__ */ r("div", { className: `${a}__full-bleed-underline` })
|
|
32
|
+
] }),
|
|
33
|
+
t
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
x.displayName = "TabsContainer";
|
|
40
|
+
export {
|
|
41
|
+
x as default
|
|
42
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
export interface TabContentProps extends ComponentProps<'div'> {
|
|
3
|
+
/**
|
|
4
|
+
* The value that corresponds to the Trigger
|
|
5
|
+
*/
|
|
6
|
+
value: string;
|
|
7
|
+
/**
|
|
8
|
+
* Content to be displayed when this tab is active
|
|
9
|
+
*/
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* The className for the Tab content container.
|
|
13
|
+
*/
|
|
14
|
+
containerClassName?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* TabContent component renders the content for a specific tab.
|
|
18
|
+
*
|
|
19
|
+
* @param {TabContentProps} props - The props for the TabContent component.
|
|
20
|
+
* @returns {JSX.Element} The rendered TabContent component.
|
|
21
|
+
*/
|
|
22
|
+
declare const TabsContent: import("react").ForwardRefExoticComponent<Omit<TabContentProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
23
|
+
export default TabsContent;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { Content as i } from "../../node_modules/@radix-ui/react-tabs/dist/index.js";
|
|
3
|
+
import { forwardRef as p } from "react";
|
|
4
|
+
import { getCommonProps as c } from "../../utils/index.js";
|
|
5
|
+
import f from "../../node_modules/classnames/index.js";
|
|
6
|
+
const l = p(
|
|
7
|
+
({ className: b, value: o, containerClassName: a, children: s, ...t }, e) => {
|
|
8
|
+
const { className: m, ...r } = c(t, "TabsContainer");
|
|
9
|
+
return /* @__PURE__ */ n(
|
|
10
|
+
i,
|
|
11
|
+
{
|
|
12
|
+
value: o,
|
|
13
|
+
className: f(`${m}__tabs-content`, a),
|
|
14
|
+
...r,
|
|
15
|
+
ref: e,
|
|
16
|
+
tabIndex: -1,
|
|
17
|
+
"aria-hidden": !0,
|
|
18
|
+
children: s
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
l.displayName = "TabsContent";
|
|
24
|
+
export {
|
|
25
|
+
l as default
|
|
26
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -49,4 +49,6 @@ export * from './components/Carousel';
|
|
|
49
49
|
export * from './components/Detail';
|
|
50
50
|
export * from './patterns/DetailList';
|
|
51
51
|
export * from './components/PinchZoom';
|
|
52
|
+
export * from './components/Tabs';
|
|
52
53
|
export * from './components/SeldonImage';
|
|
54
|
+
export * from './patterns/SaleHeaderBanner';
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { PaddingTokens as f, SpacingTokens as l, defaultYear as
|
|
1
|
+
import { PaddingTokens as f, SpacingTokens as l, defaultYear as s, emailValidation as m, encodeURLSearchParams as p, findChildrenExcludingTypes as d, findChildrenOfType as u, generatePaddingClassName as n, getCommonProps as x, noOp as i, px as g, useNormalizedInputProps as c } from "./utils/index.js";
|
|
2
2
|
import { default as C } from "./pages/Page.js";
|
|
3
3
|
import { default as P } from "./components/Button/Button.js";
|
|
4
|
-
import { ButtonVariants as
|
|
5
|
-
import { default as
|
|
6
|
-
import { default as
|
|
7
|
-
import { default as
|
|
8
|
-
import { Grid as
|
|
9
|
-
import { default as
|
|
10
|
-
import { default as
|
|
11
|
-
import { default as
|
|
4
|
+
import { ButtonVariants as b } from "./components/Button/types.js";
|
|
5
|
+
import { default as V } from "./components/IconButton/IconButton.js";
|
|
6
|
+
import { default as B } from "./components/ErrorBoundary/ErrorBoundary.js";
|
|
7
|
+
import { default as w } from "./site-furniture/Footer/Footer.js";
|
|
8
|
+
import { Grid as D } from "./components/Grid/Grid.js";
|
|
9
|
+
import { default as v } from "./site-furniture/Header/Header.js";
|
|
10
|
+
import { default as H } from "./components/Navigation/Navigation.js";
|
|
11
|
+
import { default as E } from "./components/Navigation/NavigationItem/NavigationItem.js";
|
|
12
12
|
import { default as O } from "./components/Navigation/NavigationItemTrigger/NavigationItemTrigger.js";
|
|
13
13
|
import { default as U } from "./components/Navigation/NavigationList/NavigationList.js";
|
|
14
14
|
import { default as F } from "./patterns/HeroBanner/HeroBanner.js";
|
|
@@ -21,21 +21,21 @@ import { default as ee } from "./components/Row/Row.js";
|
|
|
21
21
|
import { default as te } from "./components/GridItem/GridItem.js";
|
|
22
22
|
import { GridItemAlign as ae } from "./components/GridItem/types.js";
|
|
23
23
|
import { default as le } from "./components/Search/Search.js";
|
|
24
|
-
import { default as
|
|
24
|
+
import { default as me } from "./components/Select/Select.js";
|
|
25
25
|
import { default as de } from "./components/SplitPanel/SplitPanel.js";
|
|
26
|
-
import { default as
|
|
27
|
-
import { SubscriptionState as
|
|
26
|
+
import { default as ne } from "./patterns/Subscribe/Subscribe.js";
|
|
27
|
+
import { SubscriptionState as ie } from "./patterns/Subscribe/types.js";
|
|
28
28
|
import { default as ce } from "./patterns/Social/Social.js";
|
|
29
29
|
import { default as Ce } from "./patterns/ViewingsList/ViewingsList.js";
|
|
30
30
|
import { default as Pe } from "./components/Modal/Modal.js";
|
|
31
|
-
import { default as
|
|
32
|
-
import { default as
|
|
33
|
-
import { default as
|
|
34
|
-
import { TextVariants as
|
|
35
|
-
import { default as
|
|
36
|
-
import { TextSymbolVariants as
|
|
37
|
-
import { default as
|
|
38
|
-
import { default as
|
|
31
|
+
import { default as be } from "./components/Drawer/Drawer.js";
|
|
32
|
+
import { default as Ve } from "./components/Pagination/Pagination.js";
|
|
33
|
+
import { default as Be } from "./patterns/ViewingsList/StatefulViewingsList.js";
|
|
34
|
+
import { TextVariants as we } from "./components/Text/types.js";
|
|
35
|
+
import { default as De } from "./components/Text/Text.js";
|
|
36
|
+
import { TextSymbolVariants as ve } from "./components/TextSymbol/types.js";
|
|
37
|
+
import { default as He } from "./components/TextSymbol/TextSymbol.js";
|
|
38
|
+
import { default as Ee } from "./components/Accordion/Accordion.js";
|
|
39
39
|
import { default as Oe } from "./components/Accordion/AccordionItem.js";
|
|
40
40
|
import { AccordionItemVariant as Ue, AccordionVariants as ze } from "./components/Accordion/types.js";
|
|
41
41
|
import { default as We } from "./patterns/UserManagement/UserManagement.js";
|
|
@@ -50,49 +50,56 @@ import { default as $e } from "./components/Video/Video.js";
|
|
|
50
50
|
import { default as oo } from "./patterns/LanguageSelector/LanguageSelector.js";
|
|
51
51
|
import { default as ro } from "./components/ContentPeek/ContentPeek.js";
|
|
52
52
|
import { default as fo } from "./components/Collapsible/Collapsible.js";
|
|
53
|
-
import { default as
|
|
54
|
-
import { default as
|
|
55
|
-
import { SeldonProvider as
|
|
56
|
-
import { default as
|
|
53
|
+
import { default as so } from "./components/Collapsible/CollapsibleContent.js";
|
|
54
|
+
import { default as po } from "./components/Collapsible/CollapsibleTrigger.js";
|
|
55
|
+
import { SeldonProvider as no } from "./providers/SeldonProvider/SeldonProvider.js";
|
|
56
|
+
import { default as io } from "./components/PageContentWrapper/PageContentWrapper.js";
|
|
57
57
|
import { default as co } from "./components/Carousel/Carousel.js";
|
|
58
58
|
import { default as Co } from "./components/Carousel/CarouselContent.js";
|
|
59
59
|
import { default as Po } from "./components/Carousel/CarouselItem.js";
|
|
60
|
-
import { default as
|
|
61
|
-
import { default as
|
|
62
|
-
import { default as
|
|
63
|
-
import { DetailListAlignment as
|
|
64
|
-
import { default as
|
|
65
|
-
import { default as
|
|
60
|
+
import { default as bo } from "./components/Carousel/CarouselDots.js";
|
|
61
|
+
import { default as Vo } from "./components/Detail/Detail.js";
|
|
62
|
+
import { default as Bo } from "./patterns/DetailList/DetailList.js";
|
|
63
|
+
import { DetailListAlignment as wo } from "./patterns/DetailList/types.js";
|
|
64
|
+
import { default as Do } from "./components/PinchZoom/PinchZoom.js";
|
|
65
|
+
import { default as vo } from "./components/Tabs/TabsContainer.js";
|
|
66
|
+
import { default as Ho } from "./components/Tabs/TabsContent.js";
|
|
67
|
+
import { default as Eo } from "./components/SeldonImage/SeldonImage.js";
|
|
68
|
+
import { default as Oo } from "./patterns/SaleHeaderBanner/SaleHeaderBanner.js";
|
|
69
|
+
import { default as Uo } from "./patterns/SaleHeaderBanner/SaleHeaderBrowseAuctions.js";
|
|
70
|
+
import { default as Fo } from "./patterns/SaleHeaderBanner/SaleHeaderCountdown.js";
|
|
71
|
+
import { AuctionState as Yo } from "./patterns/SaleHeaderBanner/types.js";
|
|
66
72
|
export {
|
|
67
|
-
|
|
73
|
+
Ee as Accordion,
|
|
68
74
|
Oe as AccordionItem,
|
|
69
75
|
Ue as AccordionItemVariant,
|
|
70
76
|
ze as AccordionVariants,
|
|
77
|
+
Yo as AuctionState,
|
|
71
78
|
Ze as AuthState,
|
|
72
79
|
Ke as Breadcrumb,
|
|
73
80
|
P as Button,
|
|
74
|
-
|
|
81
|
+
b as ButtonVariants,
|
|
75
82
|
co as Carousel,
|
|
76
83
|
Co as CarouselContent,
|
|
77
|
-
|
|
84
|
+
bo as CarouselDots,
|
|
78
85
|
Po as CarouselItem,
|
|
79
86
|
fo as Collapsible,
|
|
80
|
-
|
|
81
|
-
|
|
87
|
+
so as CollapsibleContent,
|
|
88
|
+
po as CollapsibleTrigger,
|
|
82
89
|
ro as ContentPeek,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
90
|
+
Vo as Detail,
|
|
91
|
+
Bo as DetailList,
|
|
92
|
+
wo as DetailListAlignment,
|
|
93
|
+
be as Drawer,
|
|
87
94
|
Xe as Dropdown,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
95
|
+
B as ErrorBoundary,
|
|
96
|
+
w as Footer,
|
|
97
|
+
D as Grid,
|
|
91
98
|
te as GridItem,
|
|
92
99
|
ae as GridItemAlign,
|
|
93
|
-
|
|
100
|
+
v as Header,
|
|
94
101
|
F as HeroBanner,
|
|
95
|
-
|
|
102
|
+
V as IconButton,
|
|
96
103
|
Y as Input,
|
|
97
104
|
oo as LanguageSelector,
|
|
98
105
|
j as Link,
|
|
@@ -100,42 +107,47 @@ export {
|
|
|
100
107
|
_ as LinkList,
|
|
101
108
|
J as LinkVariants,
|
|
102
109
|
Pe as Modal,
|
|
103
|
-
|
|
104
|
-
|
|
110
|
+
H as Navigation,
|
|
111
|
+
E as NavigationItem,
|
|
105
112
|
O as NavigationItemTrigger,
|
|
106
113
|
U as NavigationList,
|
|
107
114
|
f as PaddingTokens,
|
|
108
115
|
C as Page,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
116
|
+
io as PageContentWrapper,
|
|
117
|
+
Ve as Pagination,
|
|
118
|
+
Do as PinchZoom,
|
|
112
119
|
ee as Row,
|
|
120
|
+
Oo as SaleHeaderBanner,
|
|
121
|
+
Uo as SaleHeaderBrowseAuctions,
|
|
122
|
+
Fo as SaleHeaderCountdown,
|
|
113
123
|
le as Search,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
124
|
+
Eo as SeldonImage,
|
|
125
|
+
no as SeldonProvider,
|
|
126
|
+
me as Select,
|
|
117
127
|
ce as Social,
|
|
118
128
|
l as SpacingTokens,
|
|
119
129
|
de as SplitPanel,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
130
|
+
Be as StatefulViewingsList,
|
|
131
|
+
ne as Subscribe,
|
|
132
|
+
ie as SubscriptionState,
|
|
123
133
|
qe as SupportedLanguages,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
134
|
+
vo as TabsContainer,
|
|
135
|
+
Ho as TabsContent,
|
|
136
|
+
De as Text,
|
|
137
|
+
ve as TextSymbolVariants,
|
|
138
|
+
He as TextSymbols,
|
|
139
|
+
we as TextVariants,
|
|
128
140
|
We as UserManagement,
|
|
129
141
|
$e as Video,
|
|
130
142
|
Ce as ViewingsList,
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
143
|
+
s as defaultYear,
|
|
144
|
+
m as emailValidation,
|
|
145
|
+
p as encodeURLSearchParams,
|
|
134
146
|
d as findChildrenExcludingTypes,
|
|
135
|
-
|
|
136
|
-
|
|
147
|
+
u as findChildrenOfType,
|
|
148
|
+
n as generatePaddingClassName,
|
|
137
149
|
x as getCommonProps,
|
|
138
|
-
|
|
150
|
+
i as noOp,
|
|
139
151
|
g as px,
|
|
140
152
|
c as useNormalizedInputProps
|
|
141
153
|
};
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import * as s from "react";
|
|
2
|
+
import { composeEventHandlers as p } from "../../primitive/dist/index.js";
|
|
3
|
+
import { createCollection as V } from "../../react-collection/dist/index.js";
|
|
4
|
+
import { useComposedRefs as j } from "../../react-compose-refs/dist/index.js";
|
|
5
|
+
import { createContextScope as z } from "../../react-context/dist/index.js";
|
|
6
|
+
import { useId as q } from "../../react-id/dist/index.js";
|
|
7
|
+
import { Primitive as x } from "../../react-primitive/dist/index.js";
|
|
8
|
+
import { useCallbackRef as J } from "../../react-use-callback-ref/dist/index.js";
|
|
9
|
+
import { useControllableState as Q } from "../../react-use-controllable-state/dist/index.js";
|
|
10
|
+
import { useDirection as W } from "../../react-direction/dist/index.js";
|
|
11
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
12
|
+
var h = "rovingFocusGroup.onEntryFocus", X = { bubbles: !1, cancelable: !0 }, b = "RovingFocusGroup", [y, G, Z] = V(b), [$, Fe] = z(
|
|
13
|
+
b,
|
|
14
|
+
[Z]
|
|
15
|
+
), [ee, oe] = $(b), N = s.forwardRef(
|
|
16
|
+
(e, r) => /* @__PURE__ */ d(y.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d(y.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d(te, { ...e, ref: r }) }) })
|
|
17
|
+
);
|
|
18
|
+
N.displayName = b;
|
|
19
|
+
var te = s.forwardRef((e, r) => {
|
|
20
|
+
const {
|
|
21
|
+
__scopeRovingFocusGroup: c,
|
|
22
|
+
orientation: o,
|
|
23
|
+
loop: F = !1,
|
|
24
|
+
dir: g,
|
|
25
|
+
currentTabStopId: R,
|
|
26
|
+
defaultCurrentTabStopId: E,
|
|
27
|
+
onCurrentTabStopIdChange: m,
|
|
28
|
+
onEntryFocus: u,
|
|
29
|
+
preventScrollOnEntryFocus: w = !1,
|
|
30
|
+
...C
|
|
31
|
+
} = e, v = s.useRef(null), I = j(r, v), t = W(g), [f = null, T] = Q({
|
|
32
|
+
prop: R,
|
|
33
|
+
defaultProp: E,
|
|
34
|
+
onChange: m
|
|
35
|
+
}), [a, i] = s.useState(!1), S = J(u), k = G(c), A = s.useRef(!1), [L, D] = s.useState(0);
|
|
36
|
+
return s.useEffect(() => {
|
|
37
|
+
const n = v.current;
|
|
38
|
+
if (n)
|
|
39
|
+
return n.addEventListener(h, S), () => n.removeEventListener(h, S);
|
|
40
|
+
}, [S]), /* @__PURE__ */ d(
|
|
41
|
+
ee,
|
|
42
|
+
{
|
|
43
|
+
scope: c,
|
|
44
|
+
orientation: o,
|
|
45
|
+
dir: t,
|
|
46
|
+
loop: F,
|
|
47
|
+
currentTabStopId: f,
|
|
48
|
+
onItemFocus: s.useCallback(
|
|
49
|
+
(n) => T(n),
|
|
50
|
+
[T]
|
|
51
|
+
),
|
|
52
|
+
onItemShiftTab: s.useCallback(() => i(!0), []),
|
|
53
|
+
onFocusableItemAdd: s.useCallback(
|
|
54
|
+
() => D((n) => n + 1),
|
|
55
|
+
[]
|
|
56
|
+
),
|
|
57
|
+
onFocusableItemRemove: s.useCallback(
|
|
58
|
+
() => D((n) => n - 1),
|
|
59
|
+
[]
|
|
60
|
+
),
|
|
61
|
+
children: /* @__PURE__ */ d(
|
|
62
|
+
x.div,
|
|
63
|
+
{
|
|
64
|
+
tabIndex: a || L === 0 ? -1 : 0,
|
|
65
|
+
"data-orientation": o,
|
|
66
|
+
...C,
|
|
67
|
+
ref: I,
|
|
68
|
+
style: { outline: "none", ...e.style },
|
|
69
|
+
onMouseDown: p(e.onMouseDown, () => {
|
|
70
|
+
A.current = !0;
|
|
71
|
+
}),
|
|
72
|
+
onFocus: p(e.onFocus, (n) => {
|
|
73
|
+
const U = !A.current;
|
|
74
|
+
if (n.target === n.currentTarget && U && !a) {
|
|
75
|
+
const P = new CustomEvent(h, X);
|
|
76
|
+
if (n.currentTarget.dispatchEvent(P), !P.defaultPrevented) {
|
|
77
|
+
const _ = k().filter((l) => l.focusable), B = _.find((l) => l.active), Y = _.find((l) => l.id === f), H = [B, Y, ..._].filter(
|
|
78
|
+
Boolean
|
|
79
|
+
).map((l) => l.ref.current);
|
|
80
|
+
M(H, w);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
A.current = !1;
|
|
84
|
+
}),
|
|
85
|
+
onBlur: p(e.onBlur, () => i(!1))
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}), O = "RovingFocusGroupItem", K = s.forwardRef(
|
|
91
|
+
(e, r) => {
|
|
92
|
+
const {
|
|
93
|
+
__scopeRovingFocusGroup: c,
|
|
94
|
+
focusable: o = !0,
|
|
95
|
+
active: F = !1,
|
|
96
|
+
tabStopId: g,
|
|
97
|
+
...R
|
|
98
|
+
} = e, E = q(), m = g || E, u = oe(O, c), w = u.currentTabStopId === m, C = G(c), { onFocusableItemAdd: v, onFocusableItemRemove: I } = u;
|
|
99
|
+
return s.useEffect(() => {
|
|
100
|
+
if (o)
|
|
101
|
+
return v(), () => I();
|
|
102
|
+
}, [o, v, I]), /* @__PURE__ */ d(
|
|
103
|
+
y.ItemSlot,
|
|
104
|
+
{
|
|
105
|
+
scope: c,
|
|
106
|
+
id: m,
|
|
107
|
+
focusable: o,
|
|
108
|
+
active: F,
|
|
109
|
+
children: /* @__PURE__ */ d(
|
|
110
|
+
x.span,
|
|
111
|
+
{
|
|
112
|
+
tabIndex: w ? 0 : -1,
|
|
113
|
+
"data-orientation": u.orientation,
|
|
114
|
+
...R,
|
|
115
|
+
ref: r,
|
|
116
|
+
onMouseDown: p(e.onMouseDown, (t) => {
|
|
117
|
+
o ? u.onItemFocus(m) : t.preventDefault();
|
|
118
|
+
}),
|
|
119
|
+
onFocus: p(e.onFocus, () => u.onItemFocus(m)),
|
|
120
|
+
onKeyDown: p(e.onKeyDown, (t) => {
|
|
121
|
+
if (t.key === "Tab" && t.shiftKey) {
|
|
122
|
+
u.onItemShiftTab();
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (t.target !== t.currentTarget) return;
|
|
126
|
+
const f = se(t, u.orientation, u.dir);
|
|
127
|
+
if (f !== void 0) {
|
|
128
|
+
if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey) return;
|
|
129
|
+
t.preventDefault();
|
|
130
|
+
let a = C().filter((i) => i.focusable).map((i) => i.ref.current);
|
|
131
|
+
if (f === "last") a.reverse();
|
|
132
|
+
else if (f === "prev" || f === "next") {
|
|
133
|
+
f === "prev" && a.reverse();
|
|
134
|
+
const i = a.indexOf(t.currentTarget);
|
|
135
|
+
a = u.loop ? ce(a, i + 1) : a.slice(i + 1);
|
|
136
|
+
}
|
|
137
|
+
setTimeout(() => M(a));
|
|
138
|
+
}
|
|
139
|
+
})
|
|
140
|
+
}
|
|
141
|
+
)
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
K.displayName = O;
|
|
147
|
+
var re = {
|
|
148
|
+
ArrowLeft: "prev",
|
|
149
|
+
ArrowUp: "prev",
|
|
150
|
+
ArrowRight: "next",
|
|
151
|
+
ArrowDown: "next",
|
|
152
|
+
PageUp: "first",
|
|
153
|
+
Home: "first",
|
|
154
|
+
PageDown: "last",
|
|
155
|
+
End: "last"
|
|
156
|
+
};
|
|
157
|
+
function ne(e, r) {
|
|
158
|
+
return r !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
|
|
159
|
+
}
|
|
160
|
+
function se(e, r, c) {
|
|
161
|
+
const o = ne(e.key, c);
|
|
162
|
+
if (!(r === "vertical" && ["ArrowLeft", "ArrowRight"].includes(o)) && !(r === "horizontal" && ["ArrowUp", "ArrowDown"].includes(o)))
|
|
163
|
+
return re[o];
|
|
164
|
+
}
|
|
165
|
+
function M(e, r = !1) {
|
|
166
|
+
const c = document.activeElement;
|
|
167
|
+
for (const o of e)
|
|
168
|
+
if (o === c || (o.focus({ preventScroll: r }), document.activeElement !== c)) return;
|
|
169
|
+
}
|
|
170
|
+
function ce(e, r) {
|
|
171
|
+
return e.map((c, o) => e[(r + o) % e.length]);
|
|
172
|
+
}
|
|
173
|
+
var ge = N, Re = K;
|
|
174
|
+
export {
|
|
175
|
+
Re as Item,
|
|
176
|
+
ge as Root,
|
|
177
|
+
N as RovingFocusGroup,
|
|
178
|
+
K as RovingFocusGroupItem,
|
|
179
|
+
Fe as createRovingFocusGroupScope
|
|
180
|
+
};
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import * as v from "react";
|
|
2
|
+
import { composeEventHandlers as p } from "../../primitive/dist/index.js";
|
|
3
|
+
import { createContextScope as x } from "../node_modules/@radix-ui/react-context/dist/index.js";
|
|
4
|
+
import { createRovingFocusGroupScope as C, Root as E, Item as F } from "../../react-roving-focus/dist/index.js";
|
|
5
|
+
import { Presence as w } from "../node_modules/@radix-ui/react-presence/dist/index.js";
|
|
6
|
+
import { Primitive as b } from "../../react-primitive/dist/index.js";
|
|
7
|
+
import { useDirection as D } from "../../react-direction/dist/index.js";
|
|
8
|
+
import { useControllableState as V } from "../../react-use-controllable-state/dist/index.js";
|
|
9
|
+
import { useId as G } from "../../react-id/dist/index.js";
|
|
10
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
11
|
+
var g = "Tabs", [L, Q] = x(g, [
|
|
12
|
+
C
|
|
13
|
+
]), h = C(), [$, T] = L(g), I = v.forwardRef(
|
|
14
|
+
(e, r) => {
|
|
15
|
+
const {
|
|
16
|
+
__scopeTabs: s,
|
|
17
|
+
value: t,
|
|
18
|
+
onValueChange: n,
|
|
19
|
+
defaultValue: c,
|
|
20
|
+
orientation: o = "horizontal",
|
|
21
|
+
dir: d,
|
|
22
|
+
activationMode: f = "automatic",
|
|
23
|
+
...m
|
|
24
|
+
} = e, i = D(d), [a, l] = V({
|
|
25
|
+
prop: t,
|
|
26
|
+
onChange: n,
|
|
27
|
+
defaultProp: c
|
|
28
|
+
});
|
|
29
|
+
return /* @__PURE__ */ u(
|
|
30
|
+
$,
|
|
31
|
+
{
|
|
32
|
+
scope: s,
|
|
33
|
+
baseId: G(),
|
|
34
|
+
value: a,
|
|
35
|
+
onValueChange: l,
|
|
36
|
+
orientation: o,
|
|
37
|
+
dir: i,
|
|
38
|
+
activationMode: f,
|
|
39
|
+
children: /* @__PURE__ */ u(
|
|
40
|
+
b.div,
|
|
41
|
+
{
|
|
42
|
+
dir: i,
|
|
43
|
+
"data-orientation": o,
|
|
44
|
+
...m,
|
|
45
|
+
ref: r
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
I.displayName = g;
|
|
53
|
+
var R = "TabsList", _ = v.forwardRef(
|
|
54
|
+
(e, r) => {
|
|
55
|
+
const { __scopeTabs: s, loop: t = !0, ...n } = e, c = T(R, s), o = h(s);
|
|
56
|
+
return /* @__PURE__ */ u(
|
|
57
|
+
E,
|
|
58
|
+
{
|
|
59
|
+
asChild: !0,
|
|
60
|
+
...o,
|
|
61
|
+
orientation: c.orientation,
|
|
62
|
+
dir: c.dir,
|
|
63
|
+
loop: t,
|
|
64
|
+
children: /* @__PURE__ */ u(
|
|
65
|
+
b.div,
|
|
66
|
+
{
|
|
67
|
+
role: "tablist",
|
|
68
|
+
"aria-orientation": c.orientation,
|
|
69
|
+
...n,
|
|
70
|
+
ref: r
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
_.displayName = R;
|
|
78
|
+
var y = "TabsTrigger", A = v.forwardRef(
|
|
79
|
+
(e, r) => {
|
|
80
|
+
const { __scopeTabs: s, value: t, disabled: n = !1, ...c } = e, o = T(y, s), d = h(s), f = N(o.baseId, t), m = P(o.baseId, t), i = t === o.value;
|
|
81
|
+
return /* @__PURE__ */ u(
|
|
82
|
+
F,
|
|
83
|
+
{
|
|
84
|
+
asChild: !0,
|
|
85
|
+
...d,
|
|
86
|
+
focusable: !n,
|
|
87
|
+
active: i,
|
|
88
|
+
children: /* @__PURE__ */ u(
|
|
89
|
+
b.button,
|
|
90
|
+
{
|
|
91
|
+
type: "button",
|
|
92
|
+
role: "tab",
|
|
93
|
+
"aria-selected": i,
|
|
94
|
+
"aria-controls": m,
|
|
95
|
+
"data-state": i ? "active" : "inactive",
|
|
96
|
+
"data-disabled": n ? "" : void 0,
|
|
97
|
+
disabled: n,
|
|
98
|
+
id: f,
|
|
99
|
+
...c,
|
|
100
|
+
ref: r,
|
|
101
|
+
onMouseDown: p(e.onMouseDown, (a) => {
|
|
102
|
+
!n && a.button === 0 && a.ctrlKey === !1 ? o.onValueChange(t) : a.preventDefault();
|
|
103
|
+
}),
|
|
104
|
+
onKeyDown: p(e.onKeyDown, (a) => {
|
|
105
|
+
[" ", "Enter"].includes(a.key) && o.onValueChange(t);
|
|
106
|
+
}),
|
|
107
|
+
onFocus: p(e.onFocus, () => {
|
|
108
|
+
const a = o.activationMode !== "manual";
|
|
109
|
+
!i && !n && a && o.onValueChange(t);
|
|
110
|
+
})
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
A.displayName = y;
|
|
118
|
+
var S = "TabsContent", M = v.forwardRef(
|
|
119
|
+
(e, r) => {
|
|
120
|
+
const { __scopeTabs: s, value: t, forceMount: n, children: c, ...o } = e, d = T(S, s), f = N(d.baseId, t), m = P(d.baseId, t), i = t === d.value, a = v.useRef(i);
|
|
121
|
+
return v.useEffect(() => {
|
|
122
|
+
const l = requestAnimationFrame(() => a.current = !1);
|
|
123
|
+
return () => cancelAnimationFrame(l);
|
|
124
|
+
}, []), /* @__PURE__ */ u(w, { present: n || i, children: ({ present: l }) => /* @__PURE__ */ u(
|
|
125
|
+
b.div,
|
|
126
|
+
{
|
|
127
|
+
"data-state": i ? "active" : "inactive",
|
|
128
|
+
"data-orientation": d.orientation,
|
|
129
|
+
role: "tabpanel",
|
|
130
|
+
"aria-labelledby": f,
|
|
131
|
+
hidden: !l,
|
|
132
|
+
id: m,
|
|
133
|
+
tabIndex: 0,
|
|
134
|
+
...o,
|
|
135
|
+
ref: r,
|
|
136
|
+
style: {
|
|
137
|
+
...e.style,
|
|
138
|
+
animationDuration: a.current ? "0s" : void 0
|
|
139
|
+
},
|
|
140
|
+
children: l && c
|
|
141
|
+
}
|
|
142
|
+
) });
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
M.displayName = S;
|
|
146
|
+
function N(e, r) {
|
|
147
|
+
return `${e}-trigger-${r}`;
|
|
148
|
+
}
|
|
149
|
+
function P(e, r) {
|
|
150
|
+
return `${e}-content-${r}`;
|
|
151
|
+
}
|
|
152
|
+
var U = I, W = _, X = A, Y = M;
|
|
153
|
+
export {
|
|
154
|
+
Y as Content,
|
|
155
|
+
W as List,
|
|
156
|
+
U as Root,
|
|
157
|
+
I as Tabs,
|
|
158
|
+
M as TabsContent,
|
|
159
|
+
_ as TabsList,
|
|
160
|
+
A as TabsTrigger,
|
|
161
|
+
X as Trigger,
|
|
162
|
+
Q as createTabsScope
|
|
163
|
+
};
|
package/dist/node_modules/@radix-ui/react-tabs/node_modules/@radix-ui/react-context/dist/index.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as i from "react";
|
|
2
|
+
import { jsx as h } from "react/jsx-runtime";
|
|
3
|
+
function $(t, x = []) {
|
|
4
|
+
let o = [];
|
|
5
|
+
function C(u, e) {
|
|
6
|
+
const n = i.createContext(e), r = o.length;
|
|
7
|
+
o = [...o, e];
|
|
8
|
+
const m = (a) => {
|
|
9
|
+
var v;
|
|
10
|
+
const { scope: c, children: S, ...p } = a, f = ((v = c == null ? void 0 : c[t]) == null ? void 0 : v[r]) || n, _ = i.useMemo(() => p, Object.values(p));
|
|
11
|
+
return /* @__PURE__ */ h(f.Provider, { value: _, children: S });
|
|
12
|
+
};
|
|
13
|
+
m.displayName = u + "Provider";
|
|
14
|
+
function d(a, c) {
|
|
15
|
+
var f;
|
|
16
|
+
const S = ((f = c == null ? void 0 : c[t]) == null ? void 0 : f[r]) || n, p = i.useContext(S);
|
|
17
|
+
if (p) return p;
|
|
18
|
+
if (e !== void 0) return e;
|
|
19
|
+
throw new Error(`\`${a}\` must be used within \`${u}\``);
|
|
20
|
+
}
|
|
21
|
+
return [m, d];
|
|
22
|
+
}
|
|
23
|
+
const s = () => {
|
|
24
|
+
const u = o.map((e) => i.createContext(e));
|
|
25
|
+
return function(n) {
|
|
26
|
+
const r = (n == null ? void 0 : n[t]) || u;
|
|
27
|
+
return i.useMemo(
|
|
28
|
+
() => ({ [`__scope${t}`]: { ...n, [t]: r } }),
|
|
29
|
+
[n, r]
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
return s.scopeName = t, [C, l(s, ...x)];
|
|
34
|
+
}
|
|
35
|
+
function l(...t) {
|
|
36
|
+
const x = t[0];
|
|
37
|
+
if (t.length === 1) return x;
|
|
38
|
+
const o = () => {
|
|
39
|
+
const C = t.map((s) => ({
|
|
40
|
+
useScope: s(),
|
|
41
|
+
scopeName: s.scopeName
|
|
42
|
+
}));
|
|
43
|
+
return function(u) {
|
|
44
|
+
const e = C.reduce((n, { useScope: r, scopeName: m }) => {
|
|
45
|
+
const a = r(u)[`__scope${m}`];
|
|
46
|
+
return { ...n, ...a };
|
|
47
|
+
}, {});
|
|
48
|
+
return i.useMemo(() => ({ [`__scope${x.scopeName}`]: e }), [e]);
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
return o.scopeName = x.scopeName, o;
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
$ as createContextScope
|
|
55
|
+
};
|
package/dist/node_modules/@radix-ui/react-tabs/node_modules/@radix-ui/react-presence/dist/index.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as a from "react";
|
|
2
|
+
import { useComposedRefs as E } from "../../../../../react-compose-refs/dist/index.js";
|
|
3
|
+
import { useLayoutEffect as M } from "../../../../../react-use-layout-effect/dist/index.js";
|
|
4
|
+
function T(n, e) {
|
|
5
|
+
return a.useReducer((r, t) => {
|
|
6
|
+
const o = e[r][t];
|
|
7
|
+
return o != null ? o : r;
|
|
8
|
+
}, n);
|
|
9
|
+
}
|
|
10
|
+
var R = (n) => {
|
|
11
|
+
const { present: e, children: r } = n, t = v(e), o = typeof r == "function" ? r({ present: t.isPresent }) : a.Children.only(r), c = E(t.ref, P(o));
|
|
12
|
+
return typeof r == "function" || t.isPresent ? a.cloneElement(o, { ref: c }) : null;
|
|
13
|
+
};
|
|
14
|
+
R.displayName = "Presence";
|
|
15
|
+
function v(n) {
|
|
16
|
+
const [e, r] = a.useState(), t = a.useRef({}), o = a.useRef(n), c = a.useRef("none"), A = n ? "mounted" : "unmounted", [N, s] = T(A, {
|
|
17
|
+
mounted: {
|
|
18
|
+
UNMOUNT: "unmounted",
|
|
19
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
20
|
+
},
|
|
21
|
+
unmountSuspended: {
|
|
22
|
+
MOUNT: "mounted",
|
|
23
|
+
ANIMATION_END: "unmounted"
|
|
24
|
+
},
|
|
25
|
+
unmounted: {
|
|
26
|
+
MOUNT: "mounted"
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
return a.useEffect(() => {
|
|
30
|
+
const i = l(t.current);
|
|
31
|
+
c.current = N === "mounted" ? i : "none";
|
|
32
|
+
}, [N]), M(() => {
|
|
33
|
+
const i = t.current, m = o.current;
|
|
34
|
+
if (m !== n) {
|
|
35
|
+
const u = c.current, d = l(i);
|
|
36
|
+
n ? s("MOUNT") : d === "none" || (i == null ? void 0 : i.display) === "none" ? s("UNMOUNT") : s(m && u !== d ? "ANIMATION_OUT" : "UNMOUNT"), o.current = n;
|
|
37
|
+
}
|
|
38
|
+
}, [n, s]), M(() => {
|
|
39
|
+
var i;
|
|
40
|
+
if (e) {
|
|
41
|
+
let m;
|
|
42
|
+
const p = (i = e.ownerDocument.defaultView) != null ? i : window, u = (f) => {
|
|
43
|
+
const g = l(t.current).includes(f.animationName);
|
|
44
|
+
if (f.target === e && g && (s("ANIMATION_END"), !o.current)) {
|
|
45
|
+
const O = e.style.animationFillMode;
|
|
46
|
+
e.style.animationFillMode = "forwards", m = p.setTimeout(() => {
|
|
47
|
+
e.style.animationFillMode === "forwards" && (e.style.animationFillMode = O);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}, d = (f) => {
|
|
51
|
+
f.target === e && (c.current = l(t.current));
|
|
52
|
+
};
|
|
53
|
+
return e.addEventListener("animationstart", d), e.addEventListener("animationcancel", u), e.addEventListener("animationend", u), () => {
|
|
54
|
+
p.clearTimeout(m), e.removeEventListener("animationstart", d), e.removeEventListener("animationcancel", u), e.removeEventListener("animationend", u);
|
|
55
|
+
};
|
|
56
|
+
} else
|
|
57
|
+
s("ANIMATION_END");
|
|
58
|
+
}, [e, s]), {
|
|
59
|
+
isPresent: ["mounted", "unmountSuspended"].includes(N),
|
|
60
|
+
ref: a.useCallback((i) => {
|
|
61
|
+
i && (t.current = getComputedStyle(i)), r(i);
|
|
62
|
+
}, [])
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function l(n) {
|
|
66
|
+
return (n == null ? void 0 : n.animationName) || "none";
|
|
67
|
+
}
|
|
68
|
+
function P(n) {
|
|
69
|
+
var t, o;
|
|
70
|
+
let e = (t = Object.getOwnPropertyDescriptor(n.props, "ref")) == null ? void 0 : t.get, r = e && "isReactWarning" in e && e.isReactWarning;
|
|
71
|
+
return r ? n.ref : (e = (o = Object.getOwnPropertyDescriptor(n, "ref")) == null ? void 0 : o.get, r = e && "isReactWarning" in e && e.isReactWarning, r ? n.props.ref : n.props.ref || n.ref);
|
|
72
|
+
}
|
|
73
|
+
export {
|
|
74
|
+
R as Presence
|
|
75
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { AuctionState } from './types';
|
|
3
|
+
export interface SaleHeaderBannerProps extends ComponentProps<'div'> {
|
|
4
|
+
/**
|
|
5
|
+
* What is the title of the auction?
|
|
6
|
+
*/
|
|
7
|
+
auctionTitle: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* The URL of the banner image
|
|
10
|
+
*/
|
|
11
|
+
imageSrcUrl: string;
|
|
12
|
+
/**
|
|
13
|
+
* Where is the auction taking place?
|
|
14
|
+
*/
|
|
15
|
+
location: React.ReactNode;
|
|
16
|
+
occurrenceInformation: {
|
|
17
|
+
/**
|
|
18
|
+
* Depending on auction state, when does the auction open or close
|
|
19
|
+
*/
|
|
20
|
+
date: React.ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Clarifies the date based on the auction state
|
|
23
|
+
*/
|
|
24
|
+
occurrenceLabel: React.ReactNode;
|
|
25
|
+
}[];
|
|
26
|
+
/**
|
|
27
|
+
* What is the current state of the auction?
|
|
28
|
+
*/
|
|
29
|
+
auctionState: AuctionState;
|
|
30
|
+
/**
|
|
31
|
+
* What text should the CTA button display?
|
|
32
|
+
*/
|
|
33
|
+
ctaLabel?: React.ReactNode;
|
|
34
|
+
/**
|
|
35
|
+
* What action does the CTA take?
|
|
36
|
+
*/
|
|
37
|
+
onClick?: () => void;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* ## Overview
|
|
41
|
+
*
|
|
42
|
+
* Sale header banner component, supports 3 states of the auction: pre-sale, open for bidding, and closed.
|
|
43
|
+
*
|
|
44
|
+
* [Figma Link](https://www.figma.com/design/OvBXAq48blO1r4qYbeBPjW/RW---Sale-Page-(PLP)?node-id=1-6&m=dev)
|
|
45
|
+
*
|
|
46
|
+
* [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/patterns-saleheaderbanner--overview)
|
|
47
|
+
*/
|
|
48
|
+
declare const SaleHeaderBanner: import("react").ForwardRefExoticComponent<Omit<SaleHeaderBannerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
49
|
+
export default SaleHeaderBanner;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as S } from "react";
|
|
3
|
+
import { getCommonProps as u } from "../../utils/index.js";
|
|
4
|
+
import C from "../../node_modules/classnames/index.js";
|
|
5
|
+
import j from "../../components/SeldonImage/SeldonImage.js";
|
|
6
|
+
import { AuctionState as _ } from "./types.js";
|
|
7
|
+
import { TextVariants as s } from "../../components/Text/types.js";
|
|
8
|
+
import t from "../../components/Text/Text.js";
|
|
9
|
+
import F from "../../components/PageContentWrapper/PageContentWrapper.js";
|
|
10
|
+
import H from "../../components/Button/Button.js";
|
|
11
|
+
const P = S(
|
|
12
|
+
({
|
|
13
|
+
auctionTitle: o,
|
|
14
|
+
imageSrcUrl: f,
|
|
15
|
+
location: g,
|
|
16
|
+
auctionState: n,
|
|
17
|
+
occurrenceInformation: N,
|
|
18
|
+
ctaLabel: h = "Register to Bid",
|
|
19
|
+
onClick: v,
|
|
20
|
+
children: m,
|
|
21
|
+
className: $,
|
|
22
|
+
...i
|
|
23
|
+
}, c) => {
|
|
24
|
+
const { className: a, ...l } = u(i, "SaleHeaderBanner"), B = n === _.openForBidding, d = n === _.past;
|
|
25
|
+
return /* @__PURE__ */ r("div", { ...l, className: C(a, $), ...i, ref: c, children: [
|
|
26
|
+
/* @__PURE__ */ e(
|
|
27
|
+
j,
|
|
28
|
+
{
|
|
29
|
+
aspectRatio: "16/9",
|
|
30
|
+
src: f,
|
|
31
|
+
alt: String(o),
|
|
32
|
+
objectFit: "cover",
|
|
33
|
+
className: `${a}__image`
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
/* @__PURE__ */ e(F, { className: `${a}__stack-wrapper`, ...l, ...i, ref: c, children: /* @__PURE__ */ r("div", { className: `${a}__stack`, children: [
|
|
37
|
+
B && m,
|
|
38
|
+
/* @__PURE__ */ e(t, { variant: s.title1, children: o }),
|
|
39
|
+
/* @__PURE__ */ e(t, { variant: s.string2, className: `${a}__location`, children: g }),
|
|
40
|
+
/* @__PURE__ */ r("div", { className: `${a}__occurrence-details`, children: [
|
|
41
|
+
N.map(({ date: p, occurrenceLabel: x }) => /* @__PURE__ */ r("div", { className: `${a}__occurrence-details-text`, children: [
|
|
42
|
+
/* @__PURE__ */ e(t, { variant: s.string2, children: x }),
|
|
43
|
+
/* @__PURE__ */ e(t, { variant: s.string2, className: `${a}__date`, children: p })
|
|
44
|
+
] }, String(p))),
|
|
45
|
+
d && m
|
|
46
|
+
] }),
|
|
47
|
+
!d && /* @__PURE__ */ e(H, { className: `${a}__cta`, onClick: v, children: h })
|
|
48
|
+
] }) })
|
|
49
|
+
] });
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
P.displayName = "SaleHeaderBanner";
|
|
53
|
+
export {
|
|
54
|
+
P as default
|
|
55
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
export interface SaleHeaderBrowseAuctionsProps extends ComponentProps<'div'> {
|
|
3
|
+
ctaLabel?: string;
|
|
4
|
+
ctaText?: string;
|
|
5
|
+
}
|
|
6
|
+
declare const SaleHeaderBrowseAuctions: import("react").ForwardRefExoticComponent<Omit<SaleHeaderBrowseAuctionsProps, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
7
|
+
export default SaleHeaderBrowseAuctions;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as i } from "react";
|
|
3
|
+
import { getCommonProps as m } from "../../utils/index.js";
|
|
4
|
+
import { TextVariants as n } from "../../components/Text/types.js";
|
|
5
|
+
import l from "../../components/Text/Text.js";
|
|
6
|
+
import "../../components/Link/types.js";
|
|
7
|
+
import c from "../../components/Link/Link.js";
|
|
8
|
+
const d = i(
|
|
9
|
+
({ ctaText: r = "View Calendar", ctaLabel: a = "Browse Upcoming Sale", className: f, ...o }, p) => {
|
|
10
|
+
const { className: s } = m(o, "SaleHeaderBanner");
|
|
11
|
+
return /* @__PURE__ */ t("div", { className: `${s}__occurrence-details-text`, children: [
|
|
12
|
+
/* @__PURE__ */ e(l, { variant: n.string2, children: a }),
|
|
13
|
+
/* @__PURE__ */ e(c, { href: "/calendar", children: r })
|
|
14
|
+
] });
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
d.displayName = "SaleHeaderBrowseAuctions";
|
|
18
|
+
export {
|
|
19
|
+
d as default
|
|
20
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
export interface SaleHeaderCountdownProps extends ComponentProps<'div'> {
|
|
3
|
+
label?: string;
|
|
4
|
+
daysLabel?: string;
|
|
5
|
+
hoursLabel?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const SaleHeaderCountdown: import("react").ForwardRefExoticComponent<Omit<SaleHeaderCountdownProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export default SaleHeaderCountdown;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsxs as a, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as c } from "react";
|
|
3
|
+
import { getCommonProps as f } from "../../utils/index.js";
|
|
4
|
+
import { TextVariants as e } from "../../components/Text/types.js";
|
|
5
|
+
import r from "../../components/Text/Text.js";
|
|
6
|
+
const h = c(
|
|
7
|
+
({ label: n = "Lots Close in", daysLabel: s = "Days", hoursLabel: t = "Hours", className: p, ...o }, i) => {
|
|
8
|
+
const { className: m, ...d } = f(o, "SaleHeaderBanner");
|
|
9
|
+
return /* @__PURE__ */ a(
|
|
10
|
+
"div",
|
|
11
|
+
{
|
|
12
|
+
id: "PLACEHOLDER FOR TIMER COMPONENT",
|
|
13
|
+
className: `${m}__countdown-container`,
|
|
14
|
+
...d,
|
|
15
|
+
...o,
|
|
16
|
+
ref: i,
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ l(r, { variant: e.heading5, children: n }),
|
|
19
|
+
/* @__PURE__ */ a(r, { variant: e.heading5, children: [
|
|
20
|
+
"2 ",
|
|
21
|
+
s
|
|
22
|
+
] }),
|
|
23
|
+
/* @__PURE__ */ a(r, { variant: e.heading5, children: [
|
|
24
|
+
"17 ",
|
|
25
|
+
t
|
|
26
|
+
] })
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
h.displayName = "SaleHeaderCountdown";
|
|
33
|
+
export {
|
|
34
|
+
h as default
|
|
35
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as SaleHeaderBanner, type SaleHeaderBannerProps } from './SaleHeaderBanner';
|
|
2
|
+
export { default as SaleHeaderBrowseAuctions, type SaleHeaderBrowseAuctionsProps } from './SaleHeaderBrowseAuctions';
|
|
3
|
+
export { default as SaleHeaderCountdown, type SaleHeaderCountdownProps } from './SaleHeaderCountdown';
|
|
4
|
+
export { AuctionState } from './types';
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
@use 'patterns/ViewingsList/viewingsList';
|
|
45
45
|
@use 'patterns/Subscribe/subscribe';
|
|
46
46
|
@use 'patterns/Social/social';
|
|
47
|
+
@use 'patterns/SaleHeaderBanner/saleHeaderBanner';
|
|
47
48
|
|
|
48
49
|
// Site Furniture
|
|
49
50
|
@use 'site-furniture/Header/header';
|
|
@@ -51,4 +52,5 @@
|
|
|
51
52
|
@use 'components/Detail/detail';
|
|
52
53
|
@use 'patterns/DetailList/detailList';
|
|
53
54
|
@use 'components/PinchZoom/pinchZoom';
|
|
55
|
+
@use 'components/Tabs/tabs';
|
|
54
56
|
@use 'components/SeldonImage/seldonImage';
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
@use '../../allPartials' as *;
|
|
2
|
+
|
|
3
|
+
.#{$px}-tabs-container {
|
|
4
|
+
@include text($body2);
|
|
5
|
+
|
|
6
|
+
width: 100%;
|
|
7
|
+
|
|
8
|
+
&__tabs-list {
|
|
9
|
+
display: flex;
|
|
10
|
+
gap: 1rem;
|
|
11
|
+
overflow: hidden; /* Prevent overflow */
|
|
12
|
+
padding: 0 $padding-md;
|
|
13
|
+
position: relative;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&__tabs-trigger {
|
|
17
|
+
background: none;
|
|
18
|
+
border: none;
|
|
19
|
+
border-bottom: 2px solid transparent;
|
|
20
|
+
padding: 0 0 $padding-sm;
|
|
21
|
+
transition:
|
|
22
|
+
background 0.2s ease,
|
|
23
|
+
font-weight 0.2s ease-out,
|
|
24
|
+
border-bottom 0.2s ease-out;
|
|
25
|
+
|
|
26
|
+
&:focus-visible {
|
|
27
|
+
box-shadow: rgb(11, 11, 12) 0 0 0 1px inset;
|
|
28
|
+
outline: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.#{$px}-text {
|
|
32
|
+
color: $button-hover;
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
font-size: $body-size2;
|
|
35
|
+
line-height: $body-line-height-size2;
|
|
36
|
+
|
|
37
|
+
&:hover {
|
|
38
|
+
color: $pure-black;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&__tabs-trigger[data-state='active'] {
|
|
44
|
+
border-bottom: 2px solid $pure-black;
|
|
45
|
+
color: $pure-black;
|
|
46
|
+
|
|
47
|
+
&:focus-visible {
|
|
48
|
+
box-shadow: rgb(11, 11, 12) 0 0 0 1px inset;
|
|
49
|
+
outline: none;
|
|
50
|
+
}
|
|
51
|
+
.#{$px}-text {
|
|
52
|
+
color: $pure-black;
|
|
53
|
+
font-variation-settings: 'wght' 600;
|
|
54
|
+
|
|
55
|
+
&:hover {
|
|
56
|
+
color: $button-hover;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Underline effect for active tab */
|
|
62
|
+
&__full-bleed-underline {
|
|
63
|
+
background: $light-gray;
|
|
64
|
+
bottom: 0;
|
|
65
|
+
height: 1px;
|
|
66
|
+
left: 0;
|
|
67
|
+
position: absolute;
|
|
68
|
+
right: 0;
|
|
69
|
+
transition: transform 0.2s ease; /* Underline animation */
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&__tabs-content {
|
|
73
|
+
padding: 20px 0;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
@use '../../allPartials' as *;
|
|
2
|
+
|
|
3
|
+
.#{$px}-sale-header-banner {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
margin-bottom: $spacing-md;
|
|
7
|
+
|
|
8
|
+
@include media($size-md, $type: 'min') {
|
|
9
|
+
flex-direction: row-reverse;
|
|
10
|
+
|
|
11
|
+
&__image,
|
|
12
|
+
&__stack-wrapper {
|
|
13
|
+
flex: 0 50%;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&__stack {
|
|
18
|
+
align-items: start;
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
height: 100%;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
padding: $spacing-md 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// update when adding in actual countdown timer
|
|
27
|
+
&__countdown-container {
|
|
28
|
+
align-items: center;
|
|
29
|
+
border-bottom: 1px solid $light-gray;
|
|
30
|
+
display: flex;
|
|
31
|
+
gap: $spacing-sm;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
margin-bottom: 1.5rem;
|
|
34
|
+
width: 100%;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&__location {
|
|
38
|
+
font-variation-settings: 'wght' 600;
|
|
39
|
+
margin: $margin-xsm 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&__occurrence-details {
|
|
43
|
+
display: flex;
|
|
44
|
+
margin-bottom: 1.5rem;
|
|
45
|
+
|
|
46
|
+
&-text {
|
|
47
|
+
align-items: flex-start;
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
gap: 4px;
|
|
51
|
+
|
|
52
|
+
&:first-child {
|
|
53
|
+
padding-right: $spacing-md;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&:not(:first-child) {
|
|
57
|
+
border-left: 1px solid $keyline-gray;
|
|
58
|
+
padding: 0 $spacing-md;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&__date {
|
|
64
|
+
font-variation-settings: 'wght' 600;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&__cta {
|
|
68
|
+
margin: $spacing-sm 0;
|
|
69
|
+
}
|
|
70
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phillips/seldon",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.77.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/PhillipsAuctionHouse/seldon"
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"@radix-ui/react-collapsible": "^1.1.0",
|
|
46
46
|
"@radix-ui/react-dialog": "^1.1.1",
|
|
47
47
|
"@radix-ui/react-select": "^2.1.1",
|
|
48
|
+
"@radix-ui/react-tabs": "^1.1.1",
|
|
48
49
|
"@types/dompurify": "^3.0.5",
|
|
49
50
|
"change-case": "^5.4.4",
|
|
50
51
|
"classnames": "^2.5.1",
|