@fluidattacks/design 11.1.1 → 11.5.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/button/index.js +60 -60
- package/dist/components/button/index.stories.d.ts +2 -1
- package/dist/components/button/index.test.d.ts +1 -0
- package/dist/components/charts/data-number/index.d.ts +4 -0
- package/dist/components/charts/data-number/index.js +75 -0
- package/dist/components/charts/data-number/index.stories.d.ts +10 -0
- package/dist/components/charts/data-number/index.test.d.ts +1 -0
- package/dist/components/charts/data-number/types.d.ts +32 -0
- package/dist/components/charts/data-number/utils.d.ts +2 -0
- package/dist/components/charts/data-number/utils.js +4 -0
- package/dist/components/charts/index.d.ts +3 -0
- package/dist/components/charts/index.js +4 -0
- package/dist/components/filters/context/types.d.ts +2 -0
- package/dist/components/filters/index.js +120 -116
- package/dist/components/filters/index.stories.d.ts +2 -1
- package/dist/components/filters/options-menu/index.js +74 -73
- package/dist/components/filters/types.d.ts +3 -0
- package/dist/components/skeleton/index.d.ts +6 -0
- package/dist/components/skeleton/index.js +18 -0
- package/dist/components/skeleton/index.stories.d.ts +8 -0
- package/dist/components/skeleton/index.test.d.ts +1 -0
- package/dist/components/skeleton/styles.d.ts +5 -0
- package/dist/components/skeleton/styles.js +33 -0
- package/dist/components/skeleton/types.d.ts +24 -0
- package/dist/components/stepper/index.d.ts +1 -1
- package/dist/components/stepper/index.js +16 -15
- package/dist/components/stepper/styles.d.ts +5 -1
- package/dist/components/stepper/styles.js +6 -0
- package/dist/components/stepper/types.d.ts +2 -0
- package/dist/components/tabs/index.js +27 -25
- package/dist/components/tabs/index.stories.d.ts +1 -2
- package/dist/components/tabs/tab/index.d.ts +1 -1
- package/dist/components/tabs/tab/index.js +25 -28
- package/dist/components/tabs/types.d.ts +7 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +304 -300
- package/package.json +1 -1
|
@@ -1,55 +1,57 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { useTheme as
|
|
3
|
-
import { Tab as
|
|
4
|
-
import { Container as
|
|
5
|
-
const
|
|
6
|
-
items:
|
|
2
|
+
import { useTheme as u } from "styled-components";
|
|
3
|
+
import { Tab as y } from "./tab/index.js";
|
|
4
|
+
import { Container as C } from "../container/index.js";
|
|
5
|
+
const T = (r, e) => r ? [0, 0, 0, 0] : e ? [0.75, 1, 0.75, 1] : void 0, j = ({
|
|
6
|
+
items: r,
|
|
7
7
|
borders: e = !0,
|
|
8
8
|
box: t = !1,
|
|
9
9
|
variant: a = "primary"
|
|
10
10
|
}) => {
|
|
11
|
-
const
|
|
11
|
+
const i = u(), o = a === "secondaryNav";
|
|
12
12
|
return /* @__PURE__ */ n(
|
|
13
|
-
|
|
13
|
+
C,
|
|
14
14
|
{
|
|
15
15
|
alignItems: "center",
|
|
16
|
-
bgColor: i
|
|
16
|
+
bgColor: i.palette.white,
|
|
17
17
|
border: t ? "1px solid" : void 0,
|
|
18
|
-
borderBottom: e ? `1px solid ${
|
|
19
|
-
borderColor: t ?
|
|
20
|
-
borderRadius: t ?
|
|
18
|
+
borderBottom: e ? `1px solid ${i.palette.gray[300]}` : void 0,
|
|
19
|
+
borderColor: t ? i.palette.gray[200] : void 0,
|
|
20
|
+
borderRadius: t ? i.spacing[0.25] : void 0,
|
|
21
21
|
display: "inline-flex",
|
|
22
|
-
gap:
|
|
22
|
+
gap: o ? 0.75 : 0.25,
|
|
23
23
|
id: "tablist",
|
|
24
|
-
minHeight:
|
|
25
|
-
padding:
|
|
24
|
+
minHeight: o && !t ? "54px" : void 0,
|
|
25
|
+
padding: T(t, o),
|
|
26
26
|
pl: e ? 1.25 : void 0,
|
|
27
27
|
pr: e ? 1.25 : void 0,
|
|
28
28
|
role: "tablist",
|
|
29
29
|
width: t ? "max-content" : "100%",
|
|
30
|
-
children:
|
|
30
|
+
children: r.map(
|
|
31
31
|
({
|
|
32
32
|
end: p,
|
|
33
33
|
id: d,
|
|
34
34
|
isActive: l,
|
|
35
35
|
link: m,
|
|
36
36
|
label: s,
|
|
37
|
-
notificationSign:
|
|
38
|
-
onClick:
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
notificationSign: c,
|
|
38
|
+
onClick: g,
|
|
39
|
+
recommended: v,
|
|
40
|
+
count: f,
|
|
41
|
+
tooltip: h
|
|
41
42
|
}) => /* @__PURE__ */ n(
|
|
42
|
-
|
|
43
|
+
y,
|
|
43
44
|
{
|
|
45
|
+
count: f,
|
|
44
46
|
end: p,
|
|
45
47
|
id: d,
|
|
46
48
|
isActive: l,
|
|
47
49
|
label: s,
|
|
48
50
|
link: m,
|
|
49
|
-
notificationSign:
|
|
50
|
-
onClick:
|
|
51
|
-
|
|
52
|
-
tooltip:
|
|
51
|
+
notificationSign: c,
|
|
52
|
+
onClick: g,
|
|
53
|
+
recommended: v,
|
|
54
|
+
tooltip: h,
|
|
53
55
|
variant: a
|
|
54
56
|
},
|
|
55
57
|
d
|
|
@@ -59,5 +61,5 @@ const C = (o, e) => o ? [0, 0, 0, 0] : e ? [0.5, 1, 0.5, 1] : void 0, N = ({
|
|
|
59
61
|
);
|
|
60
62
|
};
|
|
61
63
|
export {
|
|
62
|
-
|
|
64
|
+
j as Tabs
|
|
63
65
|
};
|
|
@@ -5,6 +5,5 @@ declare const config: Meta;
|
|
|
5
5
|
declare const Default: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, React.PropsWithChildren<ITabsProps>>;
|
|
6
6
|
declare const WithTooltips: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, React.PropsWithChildren<ITabsProps>>;
|
|
7
7
|
declare const SecondaryNav: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, React.PropsWithChildren<ITabsProps>>;
|
|
8
|
-
|
|
9
|
-
export { Default, WithTooltips, SecondaryNav, WithTag };
|
|
8
|
+
export { Default, WithTooltips, SecondaryNav };
|
|
10
9
|
export default config;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ITabProps } from '../types';
|
|
2
|
-
declare const Tab: ({ end, label, id, isActive, link, notificationSign, onClick, tooltip, variant,
|
|
2
|
+
declare const Tab: ({ end, label, id, isActive, link, notificationSign, onClick, tooltip, variant, recommended, count, }: Readonly<ITabProps>) => JSX.Element | null;
|
|
3
3
|
export type { ITabProps };
|
|
4
4
|
export { Tab };
|
|
@@ -1,26 +1,30 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useLocation as
|
|
1
|
+
import { jsx as t, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { useLocation as c, NavLink as h } from "react-router";
|
|
3
3
|
import { TabContainer as v } from "../styles.js";
|
|
4
|
-
import { NotificationSign as
|
|
5
|
-
import { Tag as
|
|
6
|
-
import { Tooltip as
|
|
7
|
-
const
|
|
8
|
-
end:
|
|
9
|
-
label:
|
|
10
|
-
id:
|
|
11
|
-
isActive:
|
|
12
|
-
link:
|
|
4
|
+
import { NotificationSign as x } from "../../notification-sign/index.js";
|
|
5
|
+
import { Tag as y } from "../../tag/index.js";
|
|
6
|
+
import { Tooltip as T } from "../../tooltip/index.js";
|
|
7
|
+
const N = ({
|
|
8
|
+
end: i = !1,
|
|
9
|
+
label: s,
|
|
10
|
+
id: e,
|
|
11
|
+
isActive: n = !1,
|
|
12
|
+
link: o,
|
|
13
13
|
notificationSign: r,
|
|
14
|
-
onClick:
|
|
14
|
+
onClick: d,
|
|
15
15
|
tooltip: f = "",
|
|
16
|
-
variant:
|
|
17
|
-
|
|
16
|
+
variant: a = "primary",
|
|
17
|
+
recommended: u = !1,
|
|
18
|
+
count: m
|
|
18
19
|
}) => {
|
|
19
|
-
const { pathname:
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
const { pathname: l } = c(), b = n || (a === "primary" ? l.includes(o) : l.endsWith(o));
|
|
21
|
+
return /* @__PURE__ */ t(T, { display: "flex", id: `${e}-tooltip`, tip: f, children: /* @__PURE__ */ p(v, { $borderButton: b, $variant: a, children: [
|
|
22
|
+
/* @__PURE__ */ p(h, { end: i, id: e, onClick: d, to: o, children: [
|
|
23
|
+
s,
|
|
24
|
+
m === void 0 ? null : ` (${m})`
|
|
25
|
+
] }),
|
|
26
|
+
/* @__PURE__ */ t(
|
|
27
|
+
x,
|
|
24
28
|
{
|
|
25
29
|
left: r?.left,
|
|
26
30
|
numberIndicator: r?.numberIndicator,
|
|
@@ -29,16 +33,9 @@ const I = ({
|
|
|
29
33
|
variant: r?.variant
|
|
30
34
|
}
|
|
31
35
|
),
|
|
32
|
-
|
|
33
|
-
x,
|
|
34
|
-
{
|
|
35
|
-
priority: s ? "low" : "default",
|
|
36
|
-
tagLabel: `${m}`,
|
|
37
|
-
variant: s ? "info" : "default"
|
|
38
|
-
}
|
|
39
|
-
)
|
|
36
|
+
u ? /* @__PURE__ */ t(y, { priority: "low", tagLabel: "Recommended", variant: "info" }) : null
|
|
40
37
|
] }) });
|
|
41
38
|
};
|
|
42
39
|
export {
|
|
43
|
-
|
|
40
|
+
N as Tab
|
|
44
41
|
};
|
|
@@ -29,7 +29,11 @@ interface IFixedTabsProps {
|
|
|
29
29
|
* @property {INotificationSignProps} [notificationSign] - Notification tab details.
|
|
30
30
|
* @property {string} [tooltip] - The tooltip text to add.
|
|
31
31
|
* @property {TVariant} [variant] - The tab variant.
|
|
32
|
-
* @property {
|
|
32
|
+
* @property {boolean} [recommended] - Whether to mark the tab with the
|
|
33
|
+
* predefined "Recommended" tag. Not a free-text tag: Product uses this
|
|
34
|
+
* exclusively to flag the option it recommends.
|
|
35
|
+
* @property {string} [count] - A formatted count shown as complementary
|
|
36
|
+
* text next to the tab label, e.g. "Packages (12)".
|
|
33
37
|
*/
|
|
34
38
|
interface ITabProps extends IFixedTabProps {
|
|
35
39
|
end?: boolean;
|
|
@@ -38,7 +42,8 @@ interface ITabProps extends IFixedTabProps {
|
|
|
38
42
|
notificationSign?: INotificationSignProps;
|
|
39
43
|
tooltip?: string;
|
|
40
44
|
variant?: TVariant;
|
|
41
|
-
|
|
45
|
+
recommended?: boolean;
|
|
46
|
+
count?: string;
|
|
42
47
|
}
|
|
43
48
|
/**
|
|
44
49
|
* Tabs component props.
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from './components/button';
|
|
|
8
8
|
export * from './components/card';
|
|
9
9
|
export * from './components/card-container';
|
|
10
10
|
export * from './components/carousel';
|
|
11
|
+
export * from './components/charts';
|
|
11
12
|
export * from './components/checkbox';
|
|
12
13
|
export * from './components/circular-progress';
|
|
13
14
|
export * from './components/cloud-image';
|
|
@@ -70,6 +71,7 @@ export * from './components/severity-badge';
|
|
|
70
71
|
export * from './components/severity-indicator';
|
|
71
72
|
export * from './components/severity-overview';
|
|
72
73
|
export * from './components/show-on-hover';
|
|
74
|
+
export * from './components/skeleton';
|
|
73
75
|
export * from './components/slide-out-menu';
|
|
74
76
|
export * from './components/slider';
|
|
75
77
|
export * from './components/step-lapse';
|