@fluidattacks/design 11.1.0 → 11.3.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.
@@ -1,61 +1,62 @@
1
1
  import { jsx as u, jsxs as V } from "react/jsx-runtime";
2
2
  import C from "../../../_virtual/dayjs.min.js";
3
- import { l as Z } from "../../../_virtual/lodash.js";
4
- import { forwardRef as ee, useContext as te, useMemo as se, useCallback as S, Fragment as le } from "react";
5
- import { useTheme as oe } from "styled-components";
6
- import { IncludeExcludeMenu as ne } from "./include-exclude/index.js";
7
- import { Options as re } from "./options/index.js";
3
+ import { l as ee } from "../../../_virtual/lodash.js";
4
+ import { forwardRef as te, useContext as se, useMemo as oe, useCallback as S, Fragment as le } from "react";
5
+ import { useTheme as ne } from "styled-components";
6
+ import { IncludeExcludeMenu as re } from "./include-exclude/index.js";
7
+ import { Options as ce } from "./options/index.js";
8
8
  import { formatValue as A } from "./utils.js";
9
- import { FiltersContext as ce } from "../context/index.js";
10
- import { StyledModalContainer as ae, StyledFloatingActions as ie, StyledHeader as de, StyledContent as ue, StyledActionButton as H } from "../styles.js";
11
- import { MAX_FILTERS_LENGTH as me } from "../utils.js";
9
+ import { FiltersContext as ae } from "../context/index.js";
10
+ import { StyledModalContainer as ie, StyledFloatingActions as de, StyledHeader as ue, StyledContent as me, StyledActionButton as H } from "../styles.js";
11
+ import { MAX_FILTERS_LENGTH as fe } from "../utils.js";
12
12
  import { Container as F } from "../../container/index.js";
13
- import { Search as fe } from "../../search/index.js";
14
- import { Toggle as he } from "../../toggle/index.js";
13
+ import { Search as he } from "../../search/index.js";
14
+ import { Toggle as xe } from "../../toggle/index.js";
15
15
  import "../../typography/heading/index.js";
16
16
  import "../../typography/span/index.js";
17
17
  import { Text as Y } from "../../typography/text/index.js";
18
18
  import { parseCheckboxesFilterValue as y, formatCheckboxesFilterValue as I } from "../../../utils/filters.js";
19
- const z = (p) => p.type === "combobox" || p.type === "multiSelect", xe = (p, f) => {
19
+ const T = (p) => p.type === "combobox" || p.type === "multiSelect", ge = (p, f) => {
20
20
  const g = new Set(
21
21
  (f ?? []).filter((a) => a.type === "list" || a.type === "combobox").flatMap((a) => (a.items ?? []).map((k) => k.value))
22
22
  );
23
23
  return p.filter((a) => !g.has(a));
24
- }, Oe = ee(function({ hideTitle: f = !1, label: g, options: a }, k) {
25
- const R = oe(), {
24
+ }, ve = te(function({ hideTitle: f = !1, label: g, options: a }, k) {
25
+ const R = ne(), {
26
26
  id: t,
27
27
  searchValues: { searchFilter: x },
28
28
  setSearchValues: L,
29
- values: B,
29
+ values: z,
30
30
  setValues: h,
31
- scrollState: D
32
- } = te(ce), { ref: T } = D, b = B[t], $ = (a ?? []).some(
33
- (e) => !z(e) && (e.items ?? []).length > me
31
+ scrollState: B,
32
+ optionsSearchThreshold: D = fe
33
+ } = se(ae), { ref: W } = B, b = z[t], $ = (a ?? []).some(
34
+ (e) => !T(e) && (e.items ?? []).length > D
34
35
  ), O = a?.find(
35
36
  (e) => e.type === "includeExclude"
36
37
  ), M = a?.find(
37
38
  (e) => e.type === "checkboxes" && e.excludeLabel
38
- ), { mode: W, values: _ } = y(b ?? ""), G = W === "exclude", X = _.length > 0, v = !f || $ || M !== void 0, w = se(() => a?.map((e) => {
39
+ ), { mode: _, values: G } = y(b ?? ""), X = _ === "exclude", q = G.length > 0, v = !f || $ || M !== void 0, w = oe(() => a?.map((e) => {
39
40
  const s = e?.items ?? [];
40
- return z(e) ? s : s.filter(
41
+ return T(e) ? s : s.filter(
41
42
  (m) => m.label?.toLowerCase().includes(x.toLowerCase()) ?? !1
42
43
  );
43
- }) ?? [], [a, x]), q = S(() => {
44
+ }) ?? [], [a, x]), J = S(() => {
44
45
  h((e) => ({ ...e, [t]: "" }));
45
- }, [h, t]), J = S(() => {
46
+ }, [h, t]), K = S(() => {
46
47
  h((e) => {
47
48
  const { mode: s, values: m } = y(
48
49
  e[t] ?? ""
49
- ), l = [
50
+ ), o = [
50
51
  ...m,
51
52
  ...w.flat().map((r) => r.value)
52
53
  ];
53
54
  return {
54
55
  ...e,
55
- [t]: I({ mode: s, values: l })
56
+ [t]: I({ mode: s, values: o })
56
57
  };
57
58
  });
58
- }, [h, t, w]), K = S(() => {
59
+ }, [h, t, w]), P = S(() => {
59
60
  h((e) => {
60
61
  const { mode: s, values: m } = y(
61
62
  e[t] ?? ""
@@ -68,7 +69,7 @@ const z = (p) => p.type === "combobox" || p.type === "multiSelect", xe = (p, f)
68
69
  })
69
70
  };
70
71
  });
71
- }, [h, t]), P = S(
72
+ }, [h, t]), Q = S(
72
73
  (e) => {
73
74
  L((s) => ({
74
75
  ...s,
@@ -76,78 +77,78 @@ const z = (p) => p.type === "combobox" || p.type === "multiSelect", xe = (p, f)
76
77
  }));
77
78
  },
78
79
  [L]
79
- ), Q = S(
80
+ ), U = S(
80
81
  (e, s, m) => {
81
- h((l) => {
82
+ h((o) => {
82
83
  if (s === "checkboxes" || s === "multiSelect") {
83
84
  const { mode: r, values: c } = y(
84
- l[t] ?? ""
85
- ), n = s === "multiSelect" ? xe(c, a) : c, o = n.includes(e) ? n.filter((d) => d !== e) : [...n, e];
85
+ o[t] ?? ""
86
+ ), n = s === "multiSelect" ? ge(c, a) : c, l = n.includes(e) ? n.filter((d) => d !== e) : [...n, e];
86
87
  return {
87
- ...l,
88
- [t]: I({ mode: r, values: o })
88
+ ...o,
89
+ [t]: I({ mode: r, values: l })
89
90
  };
90
91
  }
91
92
  if (s === "dateRange") {
92
- const r = A(l[t] ?? ""), c = r.filter(
93
+ const r = A(o[t] ?? ""), c = r.filter(
93
94
  (i) => i !== "-" && !RegExp(/^\d+\-\d+\-\d+$/).test(i.trim())
94
95
  ), n = r.filter(
95
96
  (i) => C(i).isValid() && C(i).isAfter(C("1903-01-01"))
96
- ), o = C(e, "YYYY-MM-DD", !0), d = ["-", "-"];
97
- return n.length === 2 ? (d[0] = n[0], d[1] = n[1]) : n.length === 1 && (o.isAfter(C(n[0])) ? (d[0] = n[0], d[1] = e) : (d[0] = e, d[1] = n[0])), d[m ?? 0] = e, { ...l, [t]: [...c, ...d].join(",") };
97
+ ), l = C(e, "YYYY-MM-DD", !0), d = ["-", "-"];
98
+ return n.length === 2 ? (d[0] = n[0], d[1] = n[1]) : n.length === 1 && (l.isAfter(C(n[0])) ? (d[0] = n[0], d[1] = e) : (d[0] = e, d[1] = n[0])), d[m ?? 0] = e, { ...o, [t]: [...c, ...d].join(",") };
98
99
  }
99
100
  if (s === "numberRange") {
100
- const r = A(l[t] ?? ""), c = r.filter(
101
+ const r = A(o[t] ?? ""), c = r.filter(
101
102
  (i) => i !== "-" && !RegExp(/^\d+$/).test(i.trim())
102
103
  ), n = r.filter(
103
104
  (i) => i === "-" || RegExp(/^\d+$/).test(i.trim())
104
- ), o = ["-", "-"];
105
+ ), l = ["-", "-"];
105
106
  n.forEach((i, E) => {
106
107
  if (E >= 2) return;
107
108
  const j = i.trim();
108
- RegExp(/^\d+$/).test(j) ? o[E] = Number(j) : j === "-" && (o[E] = "-");
109
+ RegExp(/^\d+$/).test(j) ? l[E] = Number(j) : j === "-" && (l[E] = "-");
109
110
  });
110
111
  const d = m ?? 0;
111
112
  if (e === "" || e === void 0 || e === null)
112
- o[d] = "-";
113
+ l[d] = "-";
113
114
  else {
114
115
  const i = Number(e);
115
- o[d] = Z.isNaN(i) ? "-" : i;
116
+ l[d] = ee.isNaN(i) ? "-" : i;
116
117
  }
117
- return o[0] === "-" && o[1] === "-" ? {
118
- ...l,
118
+ return l[0] === "-" && l[1] === "-" ? {
119
+ ...o,
119
120
  [t]: c.length > 0 ? c.join(",") : ""
120
121
  } : {
121
- ...l,
122
- [t]: [...o, ...c].join(",")
122
+ ...o,
123
+ [t]: [...l, ...c].join(",")
123
124
  };
124
125
  }
125
126
  if (s === "combobox" || s === "list") {
126
- const r = A(l[t] ?? ""), c = new Set(
127
+ const r = A(o[t] ?? ""), c = new Set(
127
128
  (a ?? []).flatMap(
128
- (o) => (o.items ?? []).map((d) => d.value)
129
+ (l) => (l.items ?? []).map((d) => d.value)
129
130
  )
130
131
  ), n = r.filter(
131
- (o) => !c.has(o.trim()) && (o === "-" || RegExp(/^\d+$/).test(o) || RegExp(/^\d+\-\d+\-\d+$/).test(o.trim()))
132
+ (l) => !c.has(l.trim()) && (l === "-" || RegExp(/^\d+$/).test(l) || RegExp(/^\d+\-\d+\-\d+$/).test(l.trim()))
132
133
  );
133
- return { ...l, [t]: [...n, e].join(",") };
134
+ return { ...o, [t]: [...n, e].join(",") };
134
135
  }
135
136
  if (s === "textCheckbox") {
136
- const r = l[t] ?? "", c = r.match(/^textCheck:(true|false),(.*)$/), n = c ? c[2] : r, o = e === "true";
137
- return !o && n === "" ? { ...l, [t]: "" } : { ...l, [t]: `textCheck:${o},${n}` };
137
+ const r = o[t] ?? "", c = r.match(/^textCheck:(true|false),(.*)$/), n = c ? c[2] : r, l = e === "true";
138
+ return !l && n === "" ? { ...o, [t]: "" } : { ...o, [t]: `textCheck:${l},${n}` };
138
139
  }
139
140
  if (s === "text") {
140
- const c = (l[t] ?? "").match(/^textCheck:(true|false),/);
141
- return c ? e === "" && c[1] === "false" ? { ...l, [t]: "" } : { ...l, [t]: `textCheck:${c[1]},${e}` } : { ...l, [t]: e };
141
+ const c = (o[t] ?? "").match(/^textCheck:(true|false),/);
142
+ return c ? e === "" && c[1] === "false" ? { ...o, [t]: "" } : { ...o, [t]: `textCheck:${c[1]},${e}` } : { ...o, [t]: e };
142
143
  }
143
- return { ...l, [t]: e };
144
+ return { ...o, [t]: e };
144
145
  });
145
146
  },
146
147
  [t, a, h]
147
148
  );
148
149
  if (O)
149
150
  return /* @__PURE__ */ u(
150
- ne,
151
+ re,
151
152
  {
152
153
  id: t,
153
154
  label: g,
@@ -155,13 +156,13 @@ const z = (p) => p.type === "combobox" || p.type === "multiSelect", xe = (p, f)
155
156
  ref: k
156
157
  }
157
158
  );
158
- const U = b !== void 0 && b !== "" && x === "" || $ && x !== "", N = /* @__PURE__ */ V(le, { children: [
159
+ const Z = b !== void 0 && b !== "" && x === "" || $ && x !== "", N = /* @__PURE__ */ V(le, { children: [
159
160
  b && x === "" ? /* @__PURE__ */ u(
160
161
  H,
161
162
  {
162
163
  $variant: "lowRelevance",
163
164
  "data-testid": "reset-all-filters",
164
- onClick: q,
165
+ onClick: J,
165
166
  type: "button",
166
167
  children: "Reset all"
167
168
  }
@@ -171,21 +172,21 @@ const z = (p) => p.type === "combobox" || p.type === "multiSelect", xe = (p, f)
171
172
  {
172
173
  $variant: "lowRelevance",
173
174
  "data-testid": "select-all-filters",
174
- onClick: J,
175
+ onClick: K,
175
176
  type: "button",
176
177
  children: "Select all"
177
178
  }
178
179
  ) : void 0
179
180
  ] });
180
181
  return /* @__PURE__ */ V(
181
- ae,
182
+ ie,
182
183
  {
183
184
  $left: "346px",
184
185
  "data-testid": "options-menu",
185
186
  ref: k,
186
187
  children: [
187
- f && !v && U ? /* @__PURE__ */ u(ie, { "data-testid": "options-menu-floating-actions", children: N }) : void 0,
188
- v ? /* @__PURE__ */ V(de, { "data-testid": "options-menu-header", children: [
188
+ f && !v && Z ? /* @__PURE__ */ u(de, { "data-testid": "options-menu-floating-actions", children: N }) : void 0,
189
+ v ? /* @__PURE__ */ V(ue, { "data-testid": "options-menu-header", children: [
189
190
  /* @__PURE__ */ V(
190
191
  F,
191
192
  {
@@ -214,24 +215,24 @@ const z = (p) => p.type === "combobox" || p.type === "multiSelect", xe = (p, f)
214
215
  justify: "space-between",
215
216
  width: "100%",
216
217
  children: /* @__PURE__ */ u(
217
- he,
218
+ xe,
218
219
  {
219
- defaultChecked: G,
220
- disabled: !X,
220
+ defaultChecked: X,
221
+ disabled: !q,
221
222
  justify: "space-between",
222
223
  leftText: M.excludeLabel,
223
224
  name: `${t}-exclude`,
224
- onChange: K,
225
+ onChange: P,
225
226
  variant: "inline"
226
227
  }
227
228
  )
228
229
  }
229
230
  ) : void 0,
230
231
  $ ? /* @__PURE__ */ u(
231
- fe,
232
+ he,
232
233
  {
233
234
  name: "options-search",
234
- onChange: P,
235
+ onChange: Q,
235
236
  placeholder: `Search ${g}...`,
236
237
  value: x
237
238
  }
@@ -241,23 +242,23 @@ const z = (p) => p.type === "combobox" || p.type === "multiSelect", xe = (p, f)
241
242
  F,
242
243
  {
243
244
  "data-testid": "options-scrollable-menu",
244
- ref: T,
245
+ ref: W,
245
246
  scroll: "y",
246
247
  width: "100%",
247
248
  children: a?.map((e, s, m) => {
248
- const l = e.type === "checkboxes", r = !l || (w[s]?.length ?? 0) > 0;
249
+ const o = e.type === "checkboxes", r = !o || (w[s]?.length ?? 0) > 0;
249
250
  return /* @__PURE__ */ u(
250
251
  "div",
251
252
  {
252
253
  style: { position: "relative" },
253
254
  children: /* @__PURE__ */ V(
254
- ue,
255
+ me,
255
256
  {
256
257
  $border: m.length > 1 && s > 0,
257
- $overflow: l,
258
+ $overflow: o,
258
259
  style: { padding: r ? R.spacing[0.875] : 0 },
259
260
  children: [
260
- f || e.showLabel === !0 || m.length > 1 && !l ? /* @__PURE__ */ u(
261
+ f || e.showLabel === !0 || m.length > 1 && !o ? /* @__PURE__ */ u(
261
262
  Y,
262
263
  {
263
264
  color: R.palette.gray[f ? 800 : 400],
@@ -268,13 +269,13 @@ const z = (p) => p.type === "combobox" || p.type === "multiSelect", xe = (p, f)
268
269
  }
269
270
  ) : void 0,
270
271
  /* @__PURE__ */ u(
271
- re,
272
+ ce,
272
273
  {
273
274
  filterValue: b,
274
275
  filteredItems: w[s] ?? [],
275
276
  id: t,
276
277
  label: g,
277
- onChange: Q,
278
+ onChange: U,
278
279
  option: e
279
280
  }
280
281
  )
@@ -292,5 +293,5 @@ const z = (p) => p.type === "combobox" || p.type === "multiSelect", xe = (p, f)
292
293
  );
293
294
  });
294
295
  export {
295
- Oe as OptionsMenu
296
+ ve as OptionsMenu
296
297
  };
@@ -134,6 +134,8 @@ interface IFilterProps {
134
134
  onBodyClick?: (id: string, mode?: TIncludeExcludeMode) => void;
135
135
  /** When true, suppresses the auto-injected search bar in the filters menu. */
136
136
  hideMenuSearch?: boolean;
137
+ /** A filter shows its options search once a block has more items than this. Defaults to 7. */
138
+ optionsSearchThreshold?: number;
137
139
  }
138
140
  /** Imperative handle exposed by Filters via forwardRef. */
139
141
  interface IFiltersImperativeHandle {
@@ -194,5 +196,6 @@ interface IFiltersContentProps {
194
196
  readonly justify?: Property.JustifyContent;
195
197
  readonly imperativeRef?: React.ForwardedRef<IFiltersImperativeHandle>;
196
198
  readonly hideMenuSearch?: boolean;
199
+ readonly optionsSearchThreshold?: number;
197
200
  }
198
201
  export type { IActiveFilterProps, IFilterProps, IFiltersContentProps, IFiltersImperativeHandle, IFiltersOptions, IFilterOptionProps, IFilterItem, IFiltersMenuProps, IOptionsMenuProps, IOptionProps, TFilterType, TIncludeExcludeMode, };
@@ -1,25 +1,26 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { forwardRef as a } from "react";
3
- import { NotificationSignButton as e, NumberIndicator as c } from "./styles.js";
4
- const g = a(function({
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { forwardRef as e } from "react";
3
+ import { NotificationSignButton as c, NumberIndicator as d } from "./styles.js";
4
+ const l = e(function({
5
+ max: t = 9,
5
6
  numberIndicator: i,
6
- show: o,
7
- variant: n = "error",
8
- ...r
9
- }, f) {
10
- return /* @__PURE__ */ t(
11
- e,
7
+ show: n,
8
+ variant: r = "error",
9
+ ...f
10
+ }, a) {
11
+ return /* @__PURE__ */ o(
12
+ c,
12
13
  {
13
14
  $numberIndicator: i,
14
- $variant: n,
15
- className: o ? "flex" : "hidden",
15
+ $variant: r,
16
+ className: n ? "flex" : "hidden",
16
17
  "data-testid": "notification-sign",
17
- ref: f,
18
- ...r,
19
- children: i && /* @__PURE__ */ t(c, { children: i <= 9 ? i : 9 })
18
+ ref: a,
19
+ ...f,
20
+ children: i && /* @__PURE__ */ o(d, { children: i > t ? `${t}+` : i })
20
21
  }
21
22
  );
22
23
  });
23
24
  export {
24
- g as NotificationSign
25
+ l as NotificationSign
25
26
  };
@@ -2,6 +2,7 @@ import { Meta } from '@storybook/react-vite';
2
2
  import { INotificationSignProps } from './types';
3
3
  declare const config: Meta;
4
4
  declare const NumberedBadge: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, Readonly<INotificationSignProps>>;
5
+ declare const OverflowBadge: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, Readonly<INotificationSignProps>>;
5
6
  declare const Dot: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, Readonly<INotificationSignProps>>;
6
- export { NumberedBadge, Dot };
7
+ export { NumberedBadge, OverflowBadge, Dot };
7
8
  export default config;
@@ -0,0 +1 @@
1
+ export {};
@@ -4,11 +4,14 @@ type TVariant = "error" | "warning";
4
4
  * Notification sign component props.
5
5
  * @interface INotificationSignProps
6
6
  * @extends IPositionModifiable
7
+ * @property {number} [max] - The highest count shown as is; larger counts
8
+ * show as `{max}+`. Defaults to 9.
7
9
  * @property {number} [numberIndicator] - The number of notifications.
8
10
  * @property {boolean} [show] - The visibility of notification sign.
9
11
  * @property {TVariant} [variant] - The notification custom variant.
10
12
  */
11
13
  interface INotificationSignProps extends Pick<IPositionModifiable, "left" | "top"> {
14
+ max?: number;
12
15
  numberIndicator?: number;
13
16
  show?: boolean;
14
17
  variant?: TVariant;
@@ -0,0 +1,6 @@
1
+ import { ISkeletonProps, ISkeletonRowProps } from './types';
2
+ declare const Skeleton: (({ as, width, }: Readonly<ISkeletonProps>) => JSX.Element) & {
3
+ Row: ({ columns }: Readonly<ISkeletonRowProps>) => JSX.Element;
4
+ };
5
+ export { Skeleton };
6
+ export type { ISkeletonProps, ISkeletonRowProps };
@@ -0,0 +1,18 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { StyledSkeleton as i } from "./styles.js";
3
+ import { Container as r } from "../container/index.js";
4
+ const n = ({
5
+ as: e = "span",
6
+ width: t
7
+ }) => /* @__PURE__ */ o(
8
+ i,
9
+ {
10
+ $width: t,
11
+ "aria-hidden": "true",
12
+ as: e,
13
+ "data-testid": "skeleton"
14
+ }
15
+ ), l = ({ columns: e }) => /* @__PURE__ */ o(r, { alignItems: "center", display: "flex", gap: 0.75, children: e.map(({ width: t }, a) => /* @__PURE__ */ o(n, { width: t }, a)) }), p = Object.assign(n, { Row: l });
16
+ export {
17
+ p as Skeleton
18
+ };
@@ -0,0 +1,8 @@
1
+ import { Meta, StoryFn } from '@storybook/react-vite';
2
+ import { ISkeletonProps, ISkeletonRowProps } from './types';
3
+ declare const config: Meta;
4
+ declare const Default: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, Readonly<ISkeletonProps>>;
5
+ declare const Row: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, Readonly<ISkeletonRowProps>>;
6
+ declare const InTable: StoryFn;
7
+ export { Default, InTable, Row };
8
+ export default config;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ interface IStyledSkeletonProps {
2
+ $width?: number;
3
+ }
4
+ declare const StyledSkeleton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "$width"> & IStyledSkeletonProps, never> & Partial<Pick<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "$width"> & IStyledSkeletonProps, never>>> & string;
5
+ export { StyledSkeleton };
@@ -0,0 +1,33 @@
1
+ import { css as i, styled as o, keyframes as r } from "styled-components";
2
+ const e = r`
3
+ 0% {
4
+ background-position: 200% 0;
5
+ }
6
+ 100% {
7
+ background-position: -200% 0;
8
+ }
9
+ `, c = o.span`
10
+ ${({ theme: a, $width: n }) => i`
11
+ animation: ${e} 1.6s ease-in-out infinite;
12
+ background-color: ${a.palette.gray[200]};
13
+ background-image: linear-gradient(
14
+ 90deg,
15
+ ${a.palette.gray[200]} 25%,
16
+ ${a.palette.gray[100]} 50%,
17
+ ${a.palette.gray[200]} 75%
18
+ );
19
+ background-size: 200% 100%;
20
+ border-radius: ${a.spacing[0.25]};
21
+ display: block;
22
+ height: ${a.spacing[0.875]};
23
+ width: ${n === void 0 ? "100%" : `calc(${n} * ${a.spacing[2.25]})`};
24
+
25
+ @media (prefers-reduced-motion: reduce) {
26
+ animation: none;
27
+ background-image: none;
28
+ }
29
+ `}
30
+ `;
31
+ export {
32
+ c as StyledSkeleton
33
+ };
@@ -0,0 +1,24 @@
1
+ import { ReactHTML } from 'react';
2
+ /**
3
+ * Skeleton component props. The rectangle is as tall as a line of text, with
4
+ * rounded corners.
5
+ * @interface ISkeletonProps
6
+ * @property {number} [width] - The rectangle width as a multiple of
7
+ * `theme.spacing[2.25]`, so `2` is `4.5rem`; it fills its container by default.
8
+ * @property {keyof ReactHTML} [as] - The html tag to render, `span` by
9
+ * default.
10
+ */
11
+ interface ISkeletonProps {
12
+ as?: keyof ReactHTML;
13
+ width?: number;
14
+ }
15
+ /**
16
+ * Skeleton row component props.
17
+ * @interface ISkeletonRowProps
18
+ * @property {Array} columns - One rectangle per item, laid out left to right
19
+ * with an even gap; a width left out takes the Skeleton default.
20
+ */
21
+ interface ISkeletonRowProps {
22
+ columns: Pick<ISkeletonProps, "width">[];
23
+ }
24
+ export type { ISkeletonProps, ISkeletonRowProps };
@@ -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 };