@fluidattacks/design 9.6.0 → 9.7.1

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.
@@ -11,7 +11,7 @@ import C from "../../node_modules/react-syntax-highlighter/dist/esm/prism-light.
11
11
  const Y = ({
12
12
  expanded: u = !1,
13
13
  language: y = "none",
14
- minWidth: L = "565px",
14
+ minWidth: L = "min(565px, 100%)",
15
15
  noCodeMessage: d = "Code snippet not available",
16
16
  showLineNumbers: k = !1,
17
17
  snippet: o,
@@ -12,6 +12,7 @@ interface ISnippet {
12
12
  }
13
13
  /**
14
14
  * Code snippet component props.
15
+ * @property {string} [minWidth] - Minimum width; defaults to 565px capped at the container width.
15
16
  * @property {string} [noCodeMessage] - Message to display when no code snippet is provided.
16
17
  * @property {ISnippet | string} snippet - The code snippet object.
17
18
  * @property {string} [specific] - Additional information related to the code snippet.
@@ -0,0 +1,4 @@
1
+ import { ITruncatedValuesProps } from './types';
2
+ declare const TruncatedValues: ({ maxVisible, separator, showLessLabel, showMoreLabel, values, }: Readonly<ITruncatedValuesProps>) => JSX.Element;
3
+ export { TruncatedValues };
4
+ export type { ITruncatedValuesProps };
@@ -0,0 +1,36 @@
1
+ import { jsx as i, jsxs as f } from "react/jsx-runtime";
2
+ import { useState as g, useCallback as k } from "react";
3
+ import { useTheme as x } from "styled-components";
4
+ import { StyledToggle as u } from "./styles.js";
5
+ import "../typography/heading/index.js";
6
+ import "../typography/span/index.js";
7
+ import { Text as c } from "../typography/text/index.js";
8
+ const C = ({
9
+ maxVisible: r = 5,
10
+ separator: t = ", ",
11
+ showLessLabel: m,
12
+ showMoreLabel: s,
13
+ values: e
14
+ }) => {
15
+ const n = x(), [o, a] = g(!1), d = e.length - r, l = k(() => {
16
+ a((h) => !h);
17
+ }, []);
18
+ if (d <= 0)
19
+ return /* @__PURE__ */ i(
20
+ c,
21
+ {
22
+ color: n.palette.gray[800],
23
+ size: "md",
24
+ wordBreak: "break-word",
25
+ children: e.join(t)
26
+ }
27
+ );
28
+ const p = o ? e : e.slice(0, r);
29
+ return /* @__PURE__ */ f(c, { color: n.palette.gray[800], size: "md", wordBreak: "break-word", children: [
30
+ `${p.join(t)} `,
31
+ /* @__PURE__ */ i(u, { "aria-expanded": o, onClick: l, type: "button", children: o ? m : s(d) })
32
+ ] });
33
+ };
34
+ export {
35
+ C as TruncatedValues
36
+ };
@@ -0,0 +1,7 @@
1
+ import { Meta } from '@storybook/react-vite';
2
+ import { ITruncatedValuesProps } from './types';
3
+ declare const config: Meta;
4
+ declare const Default: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, Readonly<ITruncatedValuesProps>>;
5
+ declare const FitsTheLimit: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, Readonly<ITruncatedValuesProps>>;
6
+ export { Default, FitsTheLimit };
7
+ export default config;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ declare const StyledToggle: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>>> & string;
2
+ export { StyledToggle };
@@ -0,0 +1,19 @@
1
+ import { styled as r } from "styled-components";
2
+ const t = r.button`
3
+ ${({ theme: o }) => `
4
+ background: none;
5
+ border: none;
6
+ color: ${o.palette.gray[400]};
7
+ cursor: pointer;
8
+ font: inherit;
9
+ padding: 0;
10
+ text-decoration: underline;
11
+
12
+ &:hover {
13
+ color: ${o.palette.gray[600]};
14
+ }
15
+ `}
16
+ `;
17
+ export {
18
+ t as StyledToggle
19
+ };
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Truncated values component props.
3
+ * @interface ITruncatedValuesProps
4
+ * @property { number } [maxVisible] - How many values to show before
5
+ * truncating.
6
+ * @property { string } [separator] - The text placed between values.
7
+ * @property { string } showLessLabel - The text for the control that hides the
8
+ * values beyond the limit again.
9
+ * @property { Function } showMoreLabel - Receives how many values remain hidden
10
+ * and returns the text for the control that reveals them.
11
+ * @property { string[] } values - The values to list on one line of text.
12
+ */
13
+ interface ITruncatedValuesProps {
14
+ maxVisible?: number;
15
+ separator?: string;
16
+ showLessLabel: string;
17
+ showMoreLabel: (remaining: number) => string;
18
+ values: string[];
19
+ }
20
+ export type { ITruncatedValuesProps };
package/dist/index.d.ts CHANGED
@@ -87,6 +87,7 @@ export * from './components/tooltip';
87
87
  export * from './components/tour';
88
88
  export * from './components/tree';
89
89
  export * from './components/truncated-list';
90
+ export * from './components/truncated-values';
90
91
  export * from './components/typography';
91
92
  export * from './components/weaknesses-card';
92
93
  export * from './context';
package/dist/index.js CHANGED
@@ -115,45 +115,46 @@ import { Tooltip as Pt } from "./components/tooltip/index.js";
115
115
  import { Tour as yt, baseStep as Lt, defaultOptions as At } from "./components/tour/index.js";
116
116
  import { Tree as kt } from "./components/tree/index.js";
117
117
  import { TruncatedList as Ot } from "./components/truncated-list/index.js";
118
- import { Heading as Et } from "./components/typography/heading/index.js";
119
- import { Span as Wt } from "./components/typography/span/index.js";
120
- import { Text as Ut } from "./components/typography/text/index.js";
121
- import { WeaknessesCard as Gt } from "./components/weaknesses-card/index.js";
122
- import { DesignsContext as Kt } from "./context/react/index.js";
123
- import { DesignsProvider as _t } from "./globals/designs-provider/index.js";
124
- import { GlobalTypography as qt } from "./globals/global-typography/index.js";
125
- import { DesignTokensCss as Qt } from "./globals/design-tokens-css/index.js";
126
- import { useActiveSection as Zt } from "./hooks/use-active-section.js";
127
- import { useCarousel as rp } from "./hooks/use-carousel.js";
128
- import { useClickOutside as ep } from "./hooks/use-click-outside.js";
129
- import { useCloudinaryImage as pp } from "./hooks/use-cloudinary-image.js";
130
- import { useColumnsModal as fp } from "./hooks/use-columns-modal.js";
131
- import { useDebouncedCallback as ap } from "./hooks/use-debounced-callback.js";
132
- import { useFiltersValues as ip } from "./hooks/use-filters.js";
133
- import { useModal as lp } from "./hooks/use-modal.js";
134
- import { useMountEffect as dp } from "./hooks/use-mount-effect.js";
135
- import { useSearch as cp } from "./hooks/use-search.js";
136
- import { formatDate as Sp, formatDateTime as Tp, formatDateTimeInInput as Ip } from "./utils/date.js";
137
- import { EXCLUDE_TOKEN as Bp, analyzeFilterValue as hp, formatCheckboxesFilterValue as Fp, formatIncludeExcludeFilterValue as Dp, formatTextFilterValue as Pp, getPreservedValues as vp, normalizeCheckboxesFilterValue as yp, parseCheckboxesFilterValue as Lp, parseIncludeExcludeFilterValue as Ap, parseTextFilterValue as Mp } from "./utils/filters.js";
138
- import { normalizeDate as wp, normalizeNumber as Op } from "./utils/normalizers.js";
139
- import { openUrl as Ep } from "./utils/open-url.js";
140
- import { clearStorage as Wp, getPathname as Np, getStorageItem as Up } from "./utils/storage.js";
141
- import { safeUrl as Gp } from "./utils/url.js";
142
- import { ActiveFilters as Kp } from "./components/filters/active-filters/index.js";
143
- import { ColumnsModal as _p } from "./components/modal/columns-modal/index.js";
144
- import { Controller as qp, useController as Jp, useFieldArray as Qp, useFormContext as Yp, useWatch as Zp } from "./node_modules/react-hook-form/dist/index.esm.js";
145
- import { InnerForm as rm } from "./components/form/inner-form/index.js";
146
- import { ItemContent as em } from "./components/table-content/item-content/index.js";
147
- import { ListItemsWrapper as pm } from "./components/list-item/styles.js";
148
- import { ModalConfirm as fm } from "./components/modal/modal-confirm/index.js";
149
- import { ModalFooter as am } from "./components/modal/footer/index.js";
150
- import { ProgressStep as im } from "./components/progress-indicator/step/index.js";
151
- import { TimeLineCard as lm } from "./components/timeline/card/index.js";
152
- import { partitionFilters as dm } from "./components/filters/utils.js";
153
- import { useNumberFormatter as cm } from "./node_modules/react-aria/dist/private/i18n/useNumberFormatter.js";
118
+ import { TruncatedValues as Et } from "./components/truncated-values/index.js";
119
+ import { Heading as Wt } from "./components/typography/heading/index.js";
120
+ import { Span as Ut } from "./components/typography/span/index.js";
121
+ import { Text as Gt } from "./components/typography/text/index.js";
122
+ import { WeaknessesCard as Kt } from "./components/weaknesses-card/index.js";
123
+ import { DesignsContext as _t } from "./context/react/index.js";
124
+ import { DesignsProvider as qt } from "./globals/designs-provider/index.js";
125
+ import { GlobalTypography as Qt } from "./globals/global-typography/index.js";
126
+ import { DesignTokensCss as Zt } from "./globals/design-tokens-css/index.js";
127
+ import { useActiveSection as rp } from "./hooks/use-active-section.js";
128
+ import { useCarousel as ep } from "./hooks/use-carousel.js";
129
+ import { useClickOutside as pp } from "./hooks/use-click-outside.js";
130
+ import { useCloudinaryImage as fp } from "./hooks/use-cloudinary-image.js";
131
+ import { useColumnsModal as ap } from "./hooks/use-columns-modal.js";
132
+ import { useDebouncedCallback as ip } from "./hooks/use-debounced-callback.js";
133
+ import { useFiltersValues as lp } from "./hooks/use-filters.js";
134
+ import { useModal as dp } from "./hooks/use-modal.js";
135
+ import { useMountEffect as cp } from "./hooks/use-mount-effect.js";
136
+ import { useSearch as Sp } from "./hooks/use-search.js";
137
+ import { formatDate as Ip, formatDateTime as bp, formatDateTimeInInput as Bp } from "./utils/date.js";
138
+ import { EXCLUDE_TOKEN as Fp, analyzeFilterValue as Dp, formatCheckboxesFilterValue as Pp, formatIncludeExcludeFilterValue as vp, formatTextFilterValue as yp, getPreservedValues as Lp, normalizeCheckboxesFilterValue as Ap, parseCheckboxesFilterValue as Mp, parseIncludeExcludeFilterValue as kp, parseTextFilterValue as wp } from "./utils/filters.js";
139
+ import { normalizeDate as Vp, normalizeNumber as Ep } from "./utils/normalizers.js";
140
+ import { openUrl as Wp } from "./utils/open-url.js";
141
+ import { clearStorage as Up, getPathname as zp, getStorageItem as Gp } from "./utils/storage.js";
142
+ import { safeUrl as Kp } from "./utils/url.js";
143
+ import { ActiveFilters as _p } from "./components/filters/active-filters/index.js";
144
+ import { ColumnsModal as qp } from "./components/modal/columns-modal/index.js";
145
+ import { Controller as Qp, useController as Yp, useFieldArray as Zp, useFormContext as $p, useWatch as rm } from "./node_modules/react-hook-form/dist/index.esm.js";
146
+ import { InnerForm as em } from "./components/form/inner-form/index.js";
147
+ import { ItemContent as pm } from "./components/table-content/item-content/index.js";
148
+ import { ListItemsWrapper as fm } from "./components/list-item/styles.js";
149
+ import { ModalConfirm as am } from "./components/modal/modal-confirm/index.js";
150
+ import { ModalFooter as im } from "./components/modal/footer/index.js";
151
+ import { ProgressStep as lm } from "./components/progress-indicator/step/index.js";
152
+ import { TimeLineCard as dm } from "./components/timeline/card/index.js";
153
+ import { partitionFilters as cm } from "./components/filters/utils.js";
154
+ import { useNumberFormatter as Sm } from "./node_modules/react-aria/dist/private/i18n/useNumberFormatter.js";
154
155
  export {
155
156
  b as Accordion,
156
- Kp as ActiveFilters,
157
+ _p as ActiveFilters,
157
158
  h as AdvancedBadge,
158
159
  D as AdvisoriesCard,
159
160
  v as Alert,
@@ -180,20 +181,20 @@ export {
180
181
  tr as CodeSnippet,
181
182
  Oo as Col,
182
183
  mr as CollapsibleCard,
183
- _p as ColumnsModal,
184
+ qp as ColumnsModal,
184
185
  jr as ComboBox,
185
186
  sr as ComparisonTable,
186
187
  gr as Container,
187
- qp as Controller,
188
+ Qp as Controller,
188
189
  Tr as CopyButton,
189
190
  xr as CustomThemeProvider,
190
- Qt as DesignTokensCss,
191
- Kt as DesignsContext,
192
- _t as DesignsProvider,
191
+ Zt as DesignTokensCss,
192
+ _t as DesignsContext,
193
+ qt as DesignsProvider,
193
194
  br as Divider,
194
195
  hr as Drawer,
195
196
  Dr as Dropdown,
196
- Bp as EXCLUDE_TOKEN,
197
+ Fp as EXCLUDE_TOKEN,
197
198
  oo as Editable,
198
199
  vr as EmptyState,
199
200
  Fo as ErrorMessage,
@@ -202,15 +203,15 @@ export {
202
203
  wr as Filters,
203
204
  Vr as Form,
204
205
  Eo as Gap,
205
- qt as GlobalTypography,
206
+ Qt as GlobalTypography,
206
207
  Rr as GridContainer,
207
208
  Nr as GroupSelector,
208
- Et as Heading,
209
+ Wt as Heading,
209
210
  zr as Icon,
210
211
  Hr as IconButton,
211
212
  X as IndicatorCard,
212
213
  Xr as IndicatorCardDB,
213
- rm as InnerForm,
214
+ em as InnerForm,
214
215
  to as InputArray,
215
216
  Jr as InputDate,
216
217
  Yr as InputDateRange,
@@ -221,11 +222,11 @@ export {
221
222
  xo as InputSection,
222
223
  no as InputTags,
223
224
  Po as ItemCardDB,
224
- em as ItemContent,
225
+ pm as ItemContent,
225
226
  yo as LanguageSwitcher,
226
227
  Uo as Link,
227
228
  Go as ListItem,
228
- pm as ListItemsWrapper,
229
+ fm as ListItemsWrapper,
229
230
  Ko as LittleFlag,
230
231
  _o as Loading,
231
232
  qo as Logo,
@@ -233,8 +234,8 @@ export {
233
234
  Zo as Menu,
234
235
  re as MessageBanner,
235
236
  ee as Modal,
236
- fm as ModalConfirm,
237
- am as ModalFooter,
237
+ am as ModalConfirm,
238
+ im as ModalFooter,
238
239
  pe as Notification,
239
240
  fe as NotificationSign,
240
241
  ae as OAuthSelector,
@@ -249,7 +250,7 @@ export {
249
250
  Ie as PriorityScore,
250
251
  Be as ProgressBar,
251
252
  Fe as ProgressIndicator,
252
- im as ProgressStep,
253
+ lm as ProgressStep,
253
254
  ye as RadioButton,
254
255
  Ae as RankPosition,
255
256
  Wo as Row,
@@ -266,7 +267,7 @@ export {
266
267
  Ze as ShowOnHover,
267
268
  rt as SlideOutMenu,
268
269
  et as Slider,
269
- Wt as Span,
270
+ Ut as Span,
270
271
  pt as StepLapse,
271
272
  ft as Stepper,
272
273
  at as SummaryCard,
@@ -276,42 +277,43 @@ export {
276
277
  ct as TableOfContents,
277
278
  St as Tabs,
278
279
  It as Tag,
279
- Ut as Text,
280
+ Gt as Text,
280
281
  So as TextArea,
281
282
  Io as TextInput,
282
283
  Bt as TimeLine,
283
- lm as TimeLineCard,
284
+ dm as TimeLineCard,
284
285
  Ft as Toggle,
285
286
  Pt as Tooltip,
286
287
  yt as Tour,
287
288
  kt as Tree,
288
289
  Ot as TruncatedList,
289
- Gt as WeaknessesCard,
290
- hp as analyzeFilterValue,
290
+ Et as TruncatedValues,
291
+ Kt as WeaknessesCard,
292
+ Dp as analyzeFilterValue,
291
293
  Lt as baseStep,
292
- Wp as clearStorage,
294
+ Up as clearStorage,
293
295
  At as defaultOptions,
294
- Fp as formatCheckboxesFilterValue,
295
- Sp as formatDate,
296
- Tp as formatDateTime,
297
- Ip as formatDateTimeInInput,
298
- Dp as formatIncludeExcludeFilterValue,
299
- Pp as formatTextFilterValue,
300
- Np as getPathname,
301
- vp as getPreservedValues,
302
- Up as getStorageItem,
296
+ Pp as formatCheckboxesFilterValue,
297
+ Ip as formatDate,
298
+ bp as formatDateTime,
299
+ Bp as formatDateTimeInInput,
300
+ vp as formatIncludeExcludeFilterValue,
301
+ yp as formatTextFilterValue,
302
+ zp as getPathname,
303
+ Lp as getPreservedValues,
304
+ Gp as getStorageItem,
303
305
  l as getStyledConfig,
304
306
  m as hiddenProps,
305
307
  ar as icons,
306
- yp as normalizeCheckboxesFilterValue,
307
- wp as normalizeDate,
308
- Op as normalizeNumber,
309
- Ep as openUrl,
310
- Lp as parseCheckboxesFilterValue,
311
- Ap as parseIncludeExcludeFilterValue,
312
- Mp as parseTextFilterValue,
313
- dm as partitionFilters,
314
- Gp as safeUrl,
308
+ Ap as normalizeCheckboxesFilterValue,
309
+ Vp as normalizeDate,
310
+ Ep as normalizeNumber,
311
+ Wp as openUrl,
312
+ Mp as parseCheckboxesFilterValue,
313
+ kp as parseIncludeExcludeFilterValue,
314
+ wp as parseTextFilterValue,
315
+ cm as partitionFilters,
316
+ Kp as safeUrl,
315
317
  u as setBorder,
316
318
  d as setDisplay,
317
319
  C as setInteraction,
@@ -320,22 +322,22 @@ export {
320
322
  S as setPosition,
321
323
  T as setText,
322
324
  nr as theme,
323
- Zt as useActiveSection,
324
- rp as useCarousel,
325
- ep as useClickOutside,
326
- pp as useCloudinaryImage,
327
- fp as useColumnsModal,
325
+ rp as useActiveSection,
326
+ ep as useCarousel,
327
+ pp as useClickOutside,
328
+ fp as useCloudinaryImage,
329
+ ap as useColumnsModal,
328
330
  ur as useConditionsDialog,
329
331
  Cr as useConfirmDialog,
330
- Jp as useController,
331
- ap as useDebouncedCallback,
332
- Qp as useFieldArray,
333
- ip as useFiltersValues,
334
- Yp as useFormContext,
335
- lp as useModal,
336
- dp as useMountEffect,
337
- cm as useNumberFormatter,
338
- cp as useSearch,
339
- Zp as useWatch,
332
+ Yp as useController,
333
+ ip as useDebouncedCallback,
334
+ Zp as useFieldArray,
335
+ lp as useFiltersValues,
336
+ $p as useFormContext,
337
+ dp as useModal,
338
+ cp as useMountEffect,
339
+ Sm as useNumberFormatter,
340
+ Sp as useSearch,
341
+ rm as useWatch,
340
342
  t as variantBuilder
341
343
  };
package/package.json CHANGED
@@ -135,5 +135,5 @@
135
135
  "./dist/index.js"
136
136
  ],
137
137
  "typings": "./dist/index.d.ts",
138
- "version": "9.6.0"
138
+ "version": "9.7.1"
139
139
  }