@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,87 +1,87 @@
|
|
|
1
1
|
import { jsxs as R, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as S, useCallback as U } from "react";
|
|
3
3
|
import { StyledButton as q } from "./styles.js";
|
|
4
|
-
import { Icon as
|
|
5
|
-
import { NotificationSign as
|
|
4
|
+
import { Icon as h } from "../icon/index.js";
|
|
5
|
+
import { NotificationSign as k } from "../notification-sign/index.js";
|
|
6
6
|
import { Tag as A } from "../tag/index.js";
|
|
7
7
|
import { Tooltip as D } from "../tooltip/index.js";
|
|
8
8
|
import { openUrl as E } from "../../utils/open-url.js";
|
|
9
|
-
const
|
|
10
|
-
children:
|
|
9
|
+
const W = S(function({
|
|
10
|
+
children: T,
|
|
11
11
|
disabled: t = !1,
|
|
12
12
|
external: a = !1,
|
|
13
|
-
href:
|
|
14
|
-
id:
|
|
15
|
-
icon:
|
|
16
|
-
iconColor:
|
|
13
|
+
href: r,
|
|
14
|
+
id: e,
|
|
15
|
+
icon: n,
|
|
16
|
+
iconColor: b,
|
|
17
17
|
iconSize: p = "lg",
|
|
18
|
-
iconType:
|
|
19
|
-
name:
|
|
18
|
+
iconType: y,
|
|
19
|
+
name: B,
|
|
20
20
|
dotNotification: C,
|
|
21
|
-
notification:
|
|
21
|
+
notification: m,
|
|
22
22
|
onClick: w,
|
|
23
|
-
rightIcon:
|
|
24
|
-
tag:
|
|
25
|
-
type:
|
|
26
|
-
tooltip:
|
|
27
|
-
tooltipPlace:
|
|
28
|
-
underline:
|
|
29
|
-
value:
|
|
30
|
-
variant:
|
|
31
|
-
width:
|
|
32
|
-
...
|
|
33
|
-
},
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
}, [a,
|
|
23
|
+
rightIcon: s,
|
|
24
|
+
tag: f,
|
|
25
|
+
type: j = "button",
|
|
26
|
+
tooltip: c,
|
|
27
|
+
tooltipPlace: x = "bottom",
|
|
28
|
+
underline: I = !1,
|
|
29
|
+
value: L,
|
|
30
|
+
variant: i = "primary",
|
|
31
|
+
width: d,
|
|
32
|
+
...N
|
|
33
|
+
}, $) {
|
|
34
|
+
const l = c !== void 0, u = `${e}-tooltip`, v = i === "link" && !!r, H = U(() => {
|
|
35
|
+
r && E(r, a);
|
|
36
|
+
}, [a, r]), g = /* @__PURE__ */ R(
|
|
37
37
|
q,
|
|
38
38
|
{
|
|
39
|
-
$variant:
|
|
39
|
+
$variant: i,
|
|
40
40
|
"aria-disabled": t,
|
|
41
|
-
className:
|
|
41
|
+
className: I ? "underline" : void 0,
|
|
42
42
|
disabled: t,
|
|
43
|
-
id:
|
|
44
|
-
name:
|
|
45
|
-
onClick:
|
|
46
|
-
ref:
|
|
47
|
-
type:
|
|
48
|
-
value:
|
|
49
|
-
width:
|
|
50
|
-
...
|
|
51
|
-
...
|
|
43
|
+
id: e,
|
|
44
|
+
name: B,
|
|
45
|
+
onClick: v ? H : w,
|
|
46
|
+
ref: $,
|
|
47
|
+
type: j,
|
|
48
|
+
value: L,
|
|
49
|
+
width: d,
|
|
50
|
+
...l ? { "data-tooltip-id": u } : {},
|
|
51
|
+
...N,
|
|
52
52
|
children: [
|
|
53
|
-
C &&
|
|
54
|
-
|
|
53
|
+
C && i === "ghost" && !t ? /* @__PURE__ */ o(
|
|
54
|
+
k,
|
|
55
55
|
{
|
|
56
|
-
left:
|
|
56
|
+
left: n !== void 0 ? "13%" : "1%",
|
|
57
57
|
show: !0,
|
|
58
58
|
top: "20%",
|
|
59
59
|
variant: "error"
|
|
60
60
|
}
|
|
61
61
|
) : void 0,
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
n !== void 0 && /* @__PURE__ */ o(
|
|
63
|
+
h,
|
|
64
64
|
{
|
|
65
|
-
icon:
|
|
66
|
-
iconColor:
|
|
65
|
+
icon: n,
|
|
66
|
+
iconColor: b ?? void 0,
|
|
67
67
|
iconSize: p,
|
|
68
|
-
iconType:
|
|
68
|
+
iconType: y ?? "fa-light"
|
|
69
69
|
}
|
|
70
70
|
),
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
T,
|
|
72
|
+
s || v ? /* @__PURE__ */ o(
|
|
73
|
+
h,
|
|
74
74
|
{
|
|
75
|
-
icon:
|
|
75
|
+
icon: s ?? "arrow-right",
|
|
76
76
|
iconSize: p,
|
|
77
77
|
iconType: "fa-light"
|
|
78
78
|
}
|
|
79
79
|
) : void 0,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
f === void 0 || t ? null : /* @__PURE__ */ o(A, { tagLabel: f, variant: "default" }),
|
|
81
|
+
m !== void 0 && i === "ghost" && !t ? /* @__PURE__ */ o(
|
|
82
|
+
k,
|
|
83
83
|
{
|
|
84
|
-
numberIndicator:
|
|
84
|
+
numberIndicator: m,
|
|
85
85
|
show: !0,
|
|
86
86
|
variant: "error"
|
|
87
87
|
}
|
|
@@ -89,18 +89,18 @@ const V = S(function({
|
|
|
89
89
|
]
|
|
90
90
|
}
|
|
91
91
|
);
|
|
92
|
-
return
|
|
92
|
+
return l ? /* @__PURE__ */ o(
|
|
93
93
|
D,
|
|
94
94
|
{
|
|
95
|
-
disabled: !
|
|
95
|
+
disabled: !l,
|
|
96
96
|
id: u,
|
|
97
|
-
place:
|
|
98
|
-
tip:
|
|
99
|
-
width:
|
|
100
|
-
children:
|
|
97
|
+
place: x,
|
|
98
|
+
tip: c,
|
|
99
|
+
width: d,
|
|
100
|
+
children: g
|
|
101
101
|
}
|
|
102
|
-
) :
|
|
102
|
+
) : g;
|
|
103
103
|
});
|
|
104
104
|
export {
|
|
105
|
-
|
|
105
|
+
W as Button
|
|
106
106
|
};
|
|
@@ -13,5 +13,6 @@ declare const Secondary: import('storybook/internal/csf').AnnotatedStoryFn<impor
|
|
|
13
13
|
declare const Tertiary: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, PropsWithChildren<IButtonStoryProps>>;
|
|
14
14
|
declare const Ghost: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, PropsWithChildren<IButtonStoryProps>>;
|
|
15
15
|
declare const TextLink: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, PropsWithChildren<IButtonStoryProps>>;
|
|
16
|
-
|
|
16
|
+
declare const Link: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, PropsWithChildren<IButtonStoryProps>>;
|
|
17
|
+
export { Default, Secondary, Tertiary, Ghost, Link, TextLink };
|
|
17
18
|
export default config;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IDataNumberProps, TDataNumberLayout } from './types';
|
|
2
|
+
declare const DataNumber: ({ href, isLink, label, layout, linkLabel, showTooltip, tooltip, value, valueColor, }: Readonly<IDataNumberProps>) => JSX.Element;
|
|
3
|
+
export type { IDataNumberProps, TDataNumberLayout };
|
|
4
|
+
export { DataNumber };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { l as g } from "../../../_virtual/lodash.js";
|
|
3
|
+
import { useId as b } from "react";
|
|
4
|
+
import { useNumberFormatter as y } from "../../../node_modules/react-aria/dist/private/i18n/useNumberFormatter.js";
|
|
5
|
+
import { useTheme as u } from "styled-components";
|
|
6
|
+
import { isSingleCssColor as w } from "./utils.js";
|
|
7
|
+
import { Container as p } from "../../container/index.js";
|
|
8
|
+
import { Link as k } from "../../link/index.js";
|
|
9
|
+
import { Tooltip as E } from "../../tooltip/index.js";
|
|
10
|
+
import { Heading as I } from "../../typography/heading/index.js";
|
|
11
|
+
import "../../typography/span/index.js";
|
|
12
|
+
import { Text as T } from "../../typography/text/index.js";
|
|
13
|
+
import { safeUrl as v } from "../../../utils/url.js";
|
|
14
|
+
const $ = "—", M = ({
|
|
15
|
+
href: e,
|
|
16
|
+
isLink: d = !1,
|
|
17
|
+
label: l,
|
|
18
|
+
layout: f = "inline",
|
|
19
|
+
linkLabel: t,
|
|
20
|
+
showTooltip: c = !1,
|
|
21
|
+
tooltip: m,
|
|
22
|
+
value: s,
|
|
23
|
+
valueColor: o
|
|
24
|
+
}) => {
|
|
25
|
+
const n = u(), h = b(), x = y(), i = f === "stacked";
|
|
26
|
+
return /* @__PURE__ */ a(
|
|
27
|
+
p,
|
|
28
|
+
{
|
|
29
|
+
alignItems: i ? "start" : "center",
|
|
30
|
+
display: "flex",
|
|
31
|
+
flexDirection: i ? "column" : "row",
|
|
32
|
+
gap: i ? 0.125 : 0.5,
|
|
33
|
+
minWidth: "0",
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ r(
|
|
36
|
+
I,
|
|
37
|
+
{
|
|
38
|
+
color: o !== void 0 && w(o) ? o : n.palette.gray[700],
|
|
39
|
+
display: "inline",
|
|
40
|
+
fontWeight: "bold",
|
|
41
|
+
size: "sm",
|
|
42
|
+
wordBreak: "break-word",
|
|
43
|
+
children: s === void 0 ? $ : x.format(s)
|
|
44
|
+
}
|
|
45
|
+
),
|
|
46
|
+
/* @__PURE__ */ a(
|
|
47
|
+
p,
|
|
48
|
+
{
|
|
49
|
+
alignItems: "center",
|
|
50
|
+
display: "flex",
|
|
51
|
+
gap: 0.25,
|
|
52
|
+
wrap: "wrap",
|
|
53
|
+
children: [
|
|
54
|
+
/* @__PURE__ */ r(T, { color: n.palette.gray[700], display: "inline", size: "md", children: l }),
|
|
55
|
+
d && e !== void 0 && t !== void 0 ? /* @__PURE__ */ r(k, { href: v(e), children: t }) : void 0,
|
|
56
|
+
c && !g.isEmpty(m) ? /* @__PURE__ */ r(
|
|
57
|
+
E,
|
|
58
|
+
{
|
|
59
|
+
display: "flex",
|
|
60
|
+
icon: "circle-info",
|
|
61
|
+
id: h,
|
|
62
|
+
place: "top",
|
|
63
|
+
tip: m
|
|
64
|
+
}
|
|
65
|
+
) : void 0
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
};
|
|
73
|
+
export {
|
|
74
|
+
M as DataNumber
|
|
75
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react-vite';
|
|
2
|
+
import { IDataNumberProps } from './types';
|
|
3
|
+
declare const config: Meta<IDataNumberProps>;
|
|
4
|
+
declare const Default: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IDataNumberProps>;
|
|
5
|
+
declare const WithoutLink: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IDataNumberProps>;
|
|
6
|
+
declare const WithoutTooltip: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IDataNumberProps>;
|
|
7
|
+
declare const Stacked: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IDataNumberProps>;
|
|
8
|
+
declare const Empty: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IDataNumberProps>;
|
|
9
|
+
export { Default, Empty, Stacked, WithoutLink, WithoutTooltip };
|
|
10
|
+
export default config;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
type TDataNumberLayout = "inline" | "stacked";
|
|
2
|
+
/**
|
|
3
|
+
* Data number component props.
|
|
4
|
+
* @interface IDataNumberProps
|
|
5
|
+
* @property { string } [href] - Destination of the link. Only internal paths
|
|
6
|
+
* and http(s) URLs are kept; anything else becomes "#".
|
|
7
|
+
* @property { boolean } [isLink] - Show the link after the label. It shows
|
|
8
|
+
* only when `href` and `linkLabel` are also given.
|
|
9
|
+
* @property { string } label - Text that describes the value.
|
|
10
|
+
* @property { TDataNumberLayout } [layout] - "inline" puts the value and the
|
|
11
|
+
* label on one line; "stacked" puts the value above the label.
|
|
12
|
+
* @property { string } [linkLabel] - Text of the link.
|
|
13
|
+
* @property { boolean } [showTooltip] - Show the info icon. It shows only when
|
|
14
|
+
* `tooltip` has text.
|
|
15
|
+
* @property { string } [tooltip] - Text of the info tooltip.
|
|
16
|
+
* @property { number } [value] - Number shown in the locale format. Without it,
|
|
17
|
+
* an em dash shows that there is no data.
|
|
18
|
+
* @property { string } [valueColor] - Color of the value: a hex code, a color
|
|
19
|
+
* name, or an rgb()/hsl() value. Anything else falls back to gray 700.
|
|
20
|
+
*/
|
|
21
|
+
interface IDataNumberProps {
|
|
22
|
+
href?: string;
|
|
23
|
+
isLink?: boolean;
|
|
24
|
+
label: string;
|
|
25
|
+
layout?: TDataNumberLayout;
|
|
26
|
+
linkLabel?: string;
|
|
27
|
+
showTooltip?: boolean;
|
|
28
|
+
tooltip?: string;
|
|
29
|
+
value?: number;
|
|
30
|
+
valueColor?: string;
|
|
31
|
+
}
|
|
32
|
+
export type { IDataNumberProps, TDataNumberLayout };
|
|
@@ -55,5 +55,7 @@ interface IFiltersContext {
|
|
|
55
55
|
updateSearch: (updates: Readonly<Partial<ISearchState>>) => void;
|
|
56
56
|
/** Side requested by chip navigation; auto-opens that includeExclude dropdown. */
|
|
57
57
|
navMode: TIncludeExcludeMode | null;
|
|
58
|
+
/** Item count above which a filter shows its options search. */
|
|
59
|
+
optionsSearchThreshold?: number;
|
|
58
60
|
}
|
|
59
61
|
export type { IFiltersContext, ISearchState, IScrollState, ICalendarState, TSearchValues, TSetSearchValues, };
|