@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.
Files changed (37) hide show
  1. package/dist/components/button/index.js +60 -60
  2. package/dist/components/button/index.stories.d.ts +2 -1
  3. package/dist/components/button/index.test.d.ts +1 -0
  4. package/dist/components/charts/data-number/index.d.ts +4 -0
  5. package/dist/components/charts/data-number/index.js +75 -0
  6. package/dist/components/charts/data-number/index.stories.d.ts +10 -0
  7. package/dist/components/charts/data-number/index.test.d.ts +1 -0
  8. package/dist/components/charts/data-number/types.d.ts +32 -0
  9. package/dist/components/charts/data-number/utils.d.ts +2 -0
  10. package/dist/components/charts/data-number/utils.js +4 -0
  11. package/dist/components/charts/index.d.ts +3 -0
  12. package/dist/components/charts/index.js +4 -0
  13. package/dist/components/filters/context/types.d.ts +2 -0
  14. package/dist/components/filters/index.js +120 -116
  15. package/dist/components/filters/index.stories.d.ts +2 -1
  16. package/dist/components/filters/options-menu/index.js +74 -73
  17. package/dist/components/filters/types.d.ts +3 -0
  18. package/dist/components/skeleton/index.d.ts +6 -0
  19. package/dist/components/skeleton/index.js +18 -0
  20. package/dist/components/skeleton/index.stories.d.ts +8 -0
  21. package/dist/components/skeleton/index.test.d.ts +1 -0
  22. package/dist/components/skeleton/styles.d.ts +5 -0
  23. package/dist/components/skeleton/styles.js +33 -0
  24. package/dist/components/skeleton/types.d.ts +24 -0
  25. package/dist/components/stepper/index.d.ts +1 -1
  26. package/dist/components/stepper/index.js +16 -15
  27. package/dist/components/stepper/styles.d.ts +5 -1
  28. package/dist/components/stepper/styles.js +6 -0
  29. package/dist/components/stepper/types.d.ts +2 -0
  30. package/dist/components/tabs/index.js +27 -25
  31. package/dist/components/tabs/index.stories.d.ts +1 -2
  32. package/dist/components/tabs/tab/index.d.ts +1 -1
  33. package/dist/components/tabs/tab/index.js +25 -28
  34. package/dist/components/tabs/types.d.ts +7 -2
  35. package/dist/index.d.ts +2 -0
  36. package/dist/index.js +304 -300
  37. package/package.json +1 -1
@@ -1,55 +1,57 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import { useTheme as y } from "styled-components";
3
- import { Tab as h } from "./tab/index.js";
4
- import { Container as u } from "../container/index.js";
5
- const C = (o, e) => o ? [0, 0, 0, 0] : e ? [0.5, 1, 0.5, 1] : void 0, N = ({
6
- items: o,
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 r = y(), i = a === "secondaryNav";
11
+ const i = u(), o = a === "secondaryNav";
12
12
  return /* @__PURE__ */ n(
13
- u,
13
+ C,
14
14
  {
15
15
  alignItems: "center",
16
- bgColor: i ? r.palette.gray[50] : r.palette.white,
16
+ bgColor: i.palette.white,
17
17
  border: t ? "1px solid" : void 0,
18
- borderBottom: e ? `1px solid ${r.palette.gray[300]}` : void 0,
19
- borderColor: t ? r.palette.gray[200] : void 0,
20
- borderRadius: t ? r.spacing[0.25] : void 0,
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: i ? 0.75 : 0.25,
22
+ gap: o ? 0.75 : 0.25,
23
23
  id: "tablist",
24
- minHeight: i && !t ? "54px" : void 0,
25
- padding: C(t, i),
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: o.map(
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: g,
38
- onClick: c,
39
- tag: v,
40
- tooltip: f
37
+ notificationSign: c,
38
+ onClick: g,
39
+ recommended: v,
40
+ count: f,
41
+ tooltip: h
41
42
  }) => /* @__PURE__ */ n(
42
- h,
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: g,
50
- onClick: c,
51
- tag: v,
52
- tooltip: f,
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
- N as Tabs
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
- declare const WithTag: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, React.PropsWithChildren<ITabsProps>>;
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, tag, }: Readonly<ITabProps>) => JSX.Element | null;
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 o, jsxs as u } from "react/jsx-runtime";
2
- import { useLocation as b, NavLink as h } from "react-router";
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 y } from "../../notification-sign/index.js";
5
- import { Tag as x } from "../../tag/index.js";
6
- import { Tooltip as N } from "../../tooltip/index.js";
7
- const I = ({
8
- end: l = !1,
9
- label: d,
10
- id: a,
11
- isActive: i = !1,
12
- link: t,
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: n,
14
+ onClick: d,
15
15
  tooltip: f = "",
16
- variant: e = "primary",
17
- tag: m
16
+ variant: a = "primary",
17
+ recommended: u = !1,
18
+ count: m
18
19
  }) => {
19
- const { pathname: p } = b(), s = e === "secondaryNav", c = i || (e === "primary" ? p.includes(t) : p.endsWith(t));
20
- return /* @__PURE__ */ o(N, { display: "flex", id: `${a}-tooltip`, tip: f, children: /* @__PURE__ */ u(v, { $borderButton: c, $variant: e, children: [
21
- /* @__PURE__ */ o(h, { end: l, id: a, onClick: n, to: t, children: d }),
22
- /* @__PURE__ */ o(
23
- y,
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
- m === void 0 ? null : /* @__PURE__ */ o(
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
- I as Tab
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 {number | string} [tag] - The content of the tag to display on tab.
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
- tag?: number | string;
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';