@fluidattacks/design 9.6.0 → 9.7.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/truncated-values/index.d.ts +4 -0
- package/dist/components/truncated-values/index.js +36 -0
- package/dist/components/truncated-values/index.stories.d.ts +7 -0
- package/dist/components/truncated-values/index.test.d.ts +1 -0
- package/dist/components/truncated-values/styles.d.ts +2 -0
- package/dist/components/truncated-values/styles.js +19 -0
- package/dist/components/truncated-values/types.d.ts +20 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +92 -90
- package/package.json +1 -1
|
@@ -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 {
|
|
119
|
-
import {
|
|
120
|
-
import {
|
|
121
|
-
import {
|
|
122
|
-
import {
|
|
123
|
-
import {
|
|
124
|
-
import {
|
|
125
|
-
import {
|
|
126
|
-
import {
|
|
127
|
-
import {
|
|
128
|
-
import {
|
|
129
|
-
import {
|
|
130
|
-
import {
|
|
131
|
-
import {
|
|
132
|
-
import {
|
|
133
|
-
import {
|
|
134
|
-
import {
|
|
135
|
-
import {
|
|
136
|
-
import {
|
|
137
|
-
import {
|
|
138
|
-
import {
|
|
139
|
-
import {
|
|
140
|
-
import {
|
|
141
|
-
import {
|
|
142
|
-
import {
|
|
143
|
-
import {
|
|
144
|
-
import {
|
|
145
|
-
import {
|
|
146
|
-
import {
|
|
147
|
-
import {
|
|
148
|
-
import {
|
|
149
|
-
import {
|
|
150
|
-
import {
|
|
151
|
-
import {
|
|
152
|
-
import {
|
|
153
|
-
import {
|
|
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
|
-
|
|
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
|
-
|
|
184
|
+
qp as ColumnsModal,
|
|
184
185
|
jr as ComboBox,
|
|
185
186
|
sr as ComparisonTable,
|
|
186
187
|
gr as Container,
|
|
187
|
-
|
|
188
|
+
Qp as Controller,
|
|
188
189
|
Tr as CopyButton,
|
|
189
190
|
xr as CustomThemeProvider,
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
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
|
-
|
|
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
|
-
|
|
206
|
+
Qt as GlobalTypography,
|
|
206
207
|
Rr as GridContainer,
|
|
207
208
|
Nr as GroupSelector,
|
|
208
|
-
|
|
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
|
-
|
|
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
|
-
|
|
225
|
+
pm as ItemContent,
|
|
225
226
|
yo as LanguageSwitcher,
|
|
226
227
|
Uo as Link,
|
|
227
228
|
Go as ListItem,
|
|
228
|
-
|
|
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
|
-
|
|
237
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
280
|
+
Gt as Text,
|
|
280
281
|
So as TextArea,
|
|
281
282
|
Io as TextInput,
|
|
282
283
|
Bt as TimeLine,
|
|
283
|
-
|
|
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
|
-
|
|
290
|
-
|
|
290
|
+
Et as TruncatedValues,
|
|
291
|
+
Kt as WeaknessesCard,
|
|
292
|
+
Dp as analyzeFilterValue,
|
|
291
293
|
Lt as baseStep,
|
|
292
|
-
|
|
294
|
+
Up as clearStorage,
|
|
293
295
|
At as defaultOptions,
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
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
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
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
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
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
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
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