@phillips/seldon 1.86.0 → 1.88.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/Search/Search.js +7 -7
- package/dist/components/Tabs/TabTrigger.d.ts +2 -2
- package/dist/components/Tabs/TabTrigger.js +16 -9
- package/dist/components/Tabs/Tabs.stories.d.ts +1 -0
- package/dist/components/Tabs/TabsContainer.d.ts +6 -1
- package/dist/components/Tabs/TabsContainer.js +22 -20
- package/dist/node_modules/exenv/index.js +1 -1
- package/dist/node_modules/prop-types/node_modules/react-is/index.js +1 -1
- package/package.json +1 -1
|
@@ -27,7 +27,7 @@ const ne = ({
|
|
|
27
27
|
...x
|
|
28
28
|
}) => {
|
|
29
29
|
var N;
|
|
30
|
-
const { className: r, "data-testid": m, ...L } = j(x, "Search"),
|
|
30
|
+
const { className: r, "data-testid": m, ...L } = j(x, "Search"), f = c.useContext(U), p = c.useRef(null), h = c.useRef(null), g = c.useRef(null), a = f.isSearchExpanded, s = (N = p.current) == null ? void 0 : N.value, T = S ? (e) => {
|
|
31
31
|
S(e.target.value);
|
|
32
32
|
} : void 0;
|
|
33
33
|
M(g, (e) => {
|
|
@@ -38,22 +38,22 @@ const ne = ({
|
|
|
38
38
|
if (e.stopPropagation(), e.key === "Enter") {
|
|
39
39
|
if (e.preventDefault(), s && s.length > 2) {
|
|
40
40
|
const y = I(v(s));
|
|
41
|
-
window.location.href = y;
|
|
41
|
+
n(!1), window.location.href = y;
|
|
42
42
|
}
|
|
43
|
-
e.currentTarget instanceof HTMLAnchorElement && e.currentTarget.click();
|
|
43
|
+
e.currentTarget instanceof HTMLAnchorElement && (n(!1), e.currentTarget.click());
|
|
44
44
|
}
|
|
45
|
-
e.key === "Escape" && ((o = h.current) == null || o.reset(),
|
|
45
|
+
e.key === "Escape" && ((o = h.current) == null || o.reset(), f.setIsSearchExpanded(!1));
|
|
46
46
|
};
|
|
47
47
|
V(() => {
|
|
48
48
|
var e;
|
|
49
49
|
if (a) {
|
|
50
|
-
(e =
|
|
50
|
+
(e = p.current) == null || e.focus();
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
53
|
}, [a]);
|
|
54
54
|
const n = (e) => {
|
|
55
55
|
var o;
|
|
56
|
-
(o = h.current) == null || o.reset(),
|
|
56
|
+
(o = h.current) == null || o.reset(), f.setIsSearchExpanded(e);
|
|
57
57
|
};
|
|
58
58
|
return /* @__PURE__ */ t("div", { className: `${r}__container`, children: /* @__PURE__ */ u(
|
|
59
59
|
"div",
|
|
@@ -113,7 +113,7 @@ const ne = ({
|
|
|
113
113
|
invalidText: k,
|
|
114
114
|
onKeyDown: $,
|
|
115
115
|
onChange: T,
|
|
116
|
-
ref:
|
|
116
|
+
ref: p
|
|
117
117
|
}
|
|
118
118
|
)
|
|
119
119
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
|
-
export interface TabTriggerProps extends ComponentProps<'div'> {
|
|
2
|
+
export interface TabTriggerProps extends Omit<ComponentProps<'div'>, 'onClick'> {
|
|
3
3
|
/**
|
|
4
4
|
* Value corresponding to the tab
|
|
5
5
|
*/
|
|
@@ -9,7 +9,7 @@ export interface TabTriggerProps extends ComponentProps<'div'> {
|
|
|
9
9
|
* @param value
|
|
10
10
|
* @returns
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
onClick?: (value: string) => void;
|
|
13
13
|
/**
|
|
14
14
|
* Tab label
|
|
15
15
|
*/
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
const p =
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Trigger as g } from "../../node_modules/@radix-ui/react-tabs/dist/index.js";
|
|
3
|
+
import { forwardRef as f } from "react";
|
|
4
|
+
import { getCommonProps as i } from "../../utils/index.js";
|
|
5
|
+
const p = f(({ value: a, onClick: r, children: s, ...e }, m) => {
|
|
6
|
+
const { className: o } = i(e, "TabsContainer");
|
|
7
|
+
return /* @__PURE__ */ t(
|
|
8
|
+
g,
|
|
9
|
+
{
|
|
10
|
+
value: a,
|
|
11
|
+
className: `${o}__tabs-trigger`,
|
|
12
|
+
onClick: () => r == null ? void 0 : r(a),
|
|
13
|
+
ref: m,
|
|
14
|
+
children: s
|
|
15
|
+
}
|
|
16
|
+
);
|
|
10
17
|
});
|
|
11
18
|
p.displayName = "TabTrigger";
|
|
12
19
|
export {
|
|
@@ -16,4 +16,5 @@ export declare const Playground: {
|
|
|
16
16
|
argTypes: {};
|
|
17
17
|
};
|
|
18
18
|
export declare const BrowseTabSelected: () => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const ControlledTabs: () => import("react/jsx-runtime").JSX.Element;
|
|
19
20
|
export declare const ComponentLabels: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
2
3
|
export interface Tab {
|
|
3
4
|
/**
|
|
4
5
|
* button label
|
|
@@ -15,7 +16,7 @@ export interface Tab {
|
|
|
15
16
|
* @param {TabsContainerProps} props - The component props containing an array of tabs.
|
|
16
17
|
* @returns {JSX.Element} The rendered tab component.
|
|
17
18
|
*/
|
|
18
|
-
export interface TabsContainerProps extends ComponentProps<'div'> {
|
|
19
|
+
export interface TabsContainerProps extends TabsPrimitive.TabsProps, Omit<ComponentProps<'div'>, 'dir'> {
|
|
19
20
|
tabs: Tab[];
|
|
20
21
|
/**
|
|
21
22
|
* Specify the default tab
|
|
@@ -25,6 +26,10 @@ export interface TabsContainerProps extends ComponentProps<'div'> {
|
|
|
25
26
|
* Aria-label for specific tab list view
|
|
26
27
|
*/
|
|
27
28
|
tabListLabel?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Optional value for controlled tabs
|
|
31
|
+
*/
|
|
32
|
+
value?: string;
|
|
28
33
|
/**
|
|
29
34
|
* Optional handler when a tab is clicked
|
|
30
35
|
*/
|
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import g from "./TabTrigger.js";
|
|
1
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Root as u, List as b } from "../../node_modules/@radix-ui/react-tabs/dist/index.js";
|
|
3
|
+
import T from "../../node_modules/classnames/index.js";
|
|
4
|
+
import { forwardRef as N } from "react";
|
|
5
|
+
import { getCommonProps as g } from "../../utils/index.js";
|
|
7
6
|
import { TextVariants as v } from "../Text/types.js";
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
import C from "../Text/Text.js";
|
|
8
|
+
import _ from "./TabTrigger.js";
|
|
9
|
+
const x = N(
|
|
10
|
+
({ className: m, tabs: o = [], tabListLabel: i = "Sale Page Tabs", children: t, defaultValue: n, value: c, onTabClick: f, ...s }, d) => {
|
|
11
|
+
const { className: a, ...p } = g(s, "TabsContainer");
|
|
12
|
+
return /* @__PURE__ */ l(
|
|
13
|
+
u,
|
|
14
14
|
{
|
|
15
|
-
|
|
15
|
+
...s,
|
|
16
|
+
defaultValue: n || o[0].value,
|
|
17
|
+
value: c,
|
|
16
18
|
...p,
|
|
17
|
-
className:
|
|
18
|
-
ref:
|
|
19
|
+
className: T(`${a}`, m),
|
|
20
|
+
ref: d,
|
|
19
21
|
children: [
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
/* @__PURE__ */ l(b, { "aria-label": i, className: `${a}__tabs-list`, children: [
|
|
23
|
+
o.map((e) => /* @__PURE__ */ r(
|
|
24
|
+
_,
|
|
23
25
|
{
|
|
24
26
|
value: e.value,
|
|
25
27
|
className: `${a}__tabs-trigger`,
|
|
26
|
-
|
|
27
|
-
children: /* @__PURE__ */ r(
|
|
28
|
+
onClick: f,
|
|
29
|
+
children: /* @__PURE__ */ r(C, { variant: v.label, children: e.label })
|
|
28
30
|
},
|
|
29
31
|
e.value
|
|
30
32
|
)),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as e } from "../../../../_virtual/
|
|
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;
|