@wallarm-org/design-system 0.32.1 → 0.33.0-rc-feature-WDS-107-parametr-path.2
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/ParameterPath/ParameterPath.d.ts +3 -0
- package/dist/components/ParameterPath/ParameterPath.js +123 -0
- package/dist/components/ParameterPath/ParameterPathEllipsis.d.ts +4 -0
- package/dist/components/ParameterPath/ParameterPathEllipsis.js +20 -0
- package/dist/components/ParameterPath/ParameterPathEncoding.d.ts +6 -0
- package/dist/components/ParameterPath/ParameterPathEncoding.js +16 -0
- package/dist/components/ParameterPath/ParameterPathJoint.d.ts +4 -0
- package/dist/components/ParameterPath/ParameterPathJoint.js +15 -0
- package/dist/components/ParameterPath/ParameterPathMethod.d.ts +7 -0
- package/dist/components/ParameterPath/ParameterPathMethod.js +23 -0
- package/dist/components/ParameterPath/ParameterPathSegment.d.ts +11 -0
- package/dist/components/ParameterPath/ParameterPathSegment.js +27 -0
- package/dist/components/ParameterPath/buildFullPathLabel.d.ts +2 -0
- package/dist/components/ParameterPath/buildFullPathLabel.js +8 -0
- package/dist/components/ParameterPath/classes.d.ts +6 -0
- package/dist/components/ParameterPath/classes.js +25 -0
- package/dist/components/ParameterPath/constants.d.ts +3 -0
- package/dist/components/ParameterPath/constants.js +10 -0
- package/dist/components/ParameterPath/formatAsFilter.d.ts +2 -0
- package/dist/components/ParameterPath/formatAsFilter.js +13 -0
- package/dist/components/ParameterPath/index.d.ts +3 -0
- package/dist/components/ParameterPath/index.js +3 -0
- package/dist/components/ParameterPath/types.d.ts +16 -0
- package/dist/components/ParameterPath/types.js +0 -0
- package/dist/components/ParameterPath/useParameterPathTruncation.d.ts +22 -0
- package/dist/components/ParameterPath/useParameterPathTruncation.js +62 -0
- package/dist/components/Select/SelectInput/SelectInput.js +3 -1
- package/dist/components/Select/SelectInput/SelectInputItemRenderer.d.ts +6 -1
- package/dist/components/Select/SelectInput/SelectInputItemRenderer.js +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/metadata/components.json +354 -2
- package/package.json +1 -1
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useRef } from "react";
|
|
3
|
+
import { cn } from "../../utils/cn.js";
|
|
4
|
+
import { TestIdProvider } from "../../utils/testId.js";
|
|
5
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "../Tooltip/index.js";
|
|
6
|
+
import { buildFullPathLabel } from "./buildFullPathLabel.js";
|
|
7
|
+
import { formatAsFilter } from "./formatAsFilter.js";
|
|
8
|
+
import { ParameterPathEllipsis } from "./ParameterPathEllipsis.js";
|
|
9
|
+
import { ParameterPathEncoding } from "./ParameterPathEncoding.js";
|
|
10
|
+
import { ParameterPathJoint } from "./ParameterPathJoint.js";
|
|
11
|
+
import { ParameterPathMethod } from "./ParameterPathMethod.js";
|
|
12
|
+
import { ParameterPathSegment } from "./ParameterPathSegment.js";
|
|
13
|
+
import { useParameterPathTruncation } from "./useParameterPathTruncation.js";
|
|
14
|
+
const ParameterPath = ({ ref, method, segments, encoding, attack = false, copyFormat = formatAsFilter, className, 'data-testid': testId, ...rest })=>{
|
|
15
|
+
const handleCopy = useCallback((event)=>{
|
|
16
|
+
const text = copyFormat({
|
|
17
|
+
method,
|
|
18
|
+
segments,
|
|
19
|
+
encoding
|
|
20
|
+
});
|
|
21
|
+
if (!text) return;
|
|
22
|
+
event.preventDefault();
|
|
23
|
+
event.clipboardData.setData('text/plain', text);
|
|
24
|
+
}, [
|
|
25
|
+
copyFormat,
|
|
26
|
+
method,
|
|
27
|
+
segments,
|
|
28
|
+
encoding
|
|
29
|
+
]);
|
|
30
|
+
const containerRef = useRef(null);
|
|
31
|
+
const measurementRef = useRef(null);
|
|
32
|
+
const { isTruncated, visibleSegmentIndices } = useParameterPathTruncation({
|
|
33
|
+
containerRef,
|
|
34
|
+
measurementRef,
|
|
35
|
+
segmentCount: segments.length,
|
|
36
|
+
hasMethod: Boolean(method),
|
|
37
|
+
hasEncoding: Boolean(encoding)
|
|
38
|
+
});
|
|
39
|
+
const lastIndex = segments.length - 1;
|
|
40
|
+
const indices = isTruncated && segments.length > 2 ? visibleSegmentIndices : null;
|
|
41
|
+
const renderRow = (forMeasurement)=>{
|
|
42
|
+
const visibleIdx = forMeasurement || null === indices ? Array.from({
|
|
43
|
+
length: segments.length
|
|
44
|
+
}, (_, i)=>i) : indices;
|
|
45
|
+
const items = [];
|
|
46
|
+
const measure = (slot)=>forMeasurement ? slot : void 0;
|
|
47
|
+
if (method) items.push(/*#__PURE__*/ jsx(ParameterPathMethod, {
|
|
48
|
+
method: method,
|
|
49
|
+
"data-measure": measure('method')
|
|
50
|
+
}, "method"));
|
|
51
|
+
visibleIdx.forEach((segIndex, position)=>{
|
|
52
|
+
const value = segments[segIndex];
|
|
53
|
+
if (void 0 === value) return;
|
|
54
|
+
const isLast = segIndex === lastIndex;
|
|
55
|
+
const isFirstShown = 0 === position;
|
|
56
|
+
const showJointBefore = !(isFirstShown && !method);
|
|
57
|
+
if (showJointBefore) items.push(/*#__PURE__*/ jsx(ParameterPathJoint, {
|
|
58
|
+
"data-measure": measure('joint')
|
|
59
|
+
}, `j-${segIndex}-pre`));
|
|
60
|
+
const isCollapsedBoundary = !forMeasurement && null !== indices && 0 === position && 2 === visibleIdx.length;
|
|
61
|
+
items.push(/*#__PURE__*/ jsx(ParameterPathSegment, {
|
|
62
|
+
index: segIndex,
|
|
63
|
+
variant: isLast ? 'highlighted' : 'default',
|
|
64
|
+
withZap: isLast && attack,
|
|
65
|
+
"data-measure": measure('segment'),
|
|
66
|
+
children: value
|
|
67
|
+
}, `s-${segIndex}`));
|
|
68
|
+
if (isCollapsedBoundary) items.push(/*#__PURE__*/ jsx(ParameterPathJoint, {}, "ellipsis-joint-pre"), /*#__PURE__*/ jsx(ParameterPathEllipsis, {}, "ellipsis"));
|
|
69
|
+
});
|
|
70
|
+
if (encoding) items.push(/*#__PURE__*/ jsx(ParameterPathJoint, {
|
|
71
|
+
"data-measure": measure('joint')
|
|
72
|
+
}, "enc-joint"), /*#__PURE__*/ jsx(ParameterPathEncoding, {
|
|
73
|
+
"data-measure": measure('encoding'),
|
|
74
|
+
children: encoding
|
|
75
|
+
}, "enc"));
|
|
76
|
+
return items;
|
|
77
|
+
};
|
|
78
|
+
const visibleRow = /*#__PURE__*/ jsx("div", {
|
|
79
|
+
ref: containerRef,
|
|
80
|
+
"data-row": "visible",
|
|
81
|
+
className: "flex items-center gap-0 min-w-0 overflow-hidden",
|
|
82
|
+
children: renderRow(false)
|
|
83
|
+
});
|
|
84
|
+
const measurementRow = /*#__PURE__*/ jsx("div", {
|
|
85
|
+
ref: measurementRef,
|
|
86
|
+
"data-row": "measure",
|
|
87
|
+
"aria-hidden": "true",
|
|
88
|
+
className: "flex items-center gap-0 absolute left-[-9999px] top-0 invisible pointer-events-none",
|
|
89
|
+
children: /*#__PURE__*/ jsx(TestIdProvider, {
|
|
90
|
+
value: void 0,
|
|
91
|
+
children: renderRow(true)
|
|
92
|
+
})
|
|
93
|
+
});
|
|
94
|
+
return /*#__PURE__*/ jsxs(Tooltip, {
|
|
95
|
+
disabled: !isTruncated,
|
|
96
|
+
children: [
|
|
97
|
+
/*#__PURE__*/ jsx(TooltipTrigger, {
|
|
98
|
+
asChild: true,
|
|
99
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
100
|
+
...rest,
|
|
101
|
+
"data-testid": testId,
|
|
102
|
+
"data-slot": "parameter-path",
|
|
103
|
+
"data-truncated": isTruncated || void 0,
|
|
104
|
+
ref: ref,
|
|
105
|
+
onCopy: handleCopy,
|
|
106
|
+
className: cn('relative flex items-center min-w-0', className),
|
|
107
|
+
children: /*#__PURE__*/ jsxs(TestIdProvider, {
|
|
108
|
+
value: testId,
|
|
109
|
+
children: [
|
|
110
|
+
visibleRow,
|
|
111
|
+
measurementRow
|
|
112
|
+
]
|
|
113
|
+
})
|
|
114
|
+
})
|
|
115
|
+
}),
|
|
116
|
+
/*#__PURE__*/ jsx(TooltipContent, {
|
|
117
|
+
children: buildFullPathLabel(method, segments, encoding)
|
|
118
|
+
})
|
|
119
|
+
]
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
ParameterPath.displayName = 'ParameterPath';
|
|
123
|
+
export { ParameterPath };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Ellipsis } from "../../icons/index.js";
|
|
3
|
+
import { cn } from "../../utils/cn.js";
|
|
4
|
+
import { useTestId } from "../../utils/testId.js";
|
|
5
|
+
import { ellipsisVariants } from "./classes.js";
|
|
6
|
+
const ParameterPathEllipsis = ({ className, ...rest })=>{
|
|
7
|
+
const testId = useTestId('ellipsis');
|
|
8
|
+
return /*#__PURE__*/ jsx("span", {
|
|
9
|
+
...rest,
|
|
10
|
+
"data-slot": "parameter-path-ellipsis",
|
|
11
|
+
"data-testid": testId,
|
|
12
|
+
"aria-label": "Collapsed segments",
|
|
13
|
+
className: cn(ellipsisVariants(), className),
|
|
14
|
+
children: /*#__PURE__*/ jsx(Ellipsis, {
|
|
15
|
+
size: "sm"
|
|
16
|
+
})
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
ParameterPathEllipsis.displayName = 'ParameterPathEllipsis';
|
|
20
|
+
export { ParameterPathEllipsis };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../utils/cn.js";
|
|
3
|
+
import { useTestId } from "../../utils/testId.js";
|
|
4
|
+
import { encodingVariants } from "./classes.js";
|
|
5
|
+
const ParameterPathEncoding = ({ children, className, ...rest })=>{
|
|
6
|
+
const testId = useTestId('encoding');
|
|
7
|
+
return /*#__PURE__*/ jsx("span", {
|
|
8
|
+
...rest,
|
|
9
|
+
"data-slot": "parameter-path-encoding",
|
|
10
|
+
"data-testid": testId,
|
|
11
|
+
className: cn(encodingVariants(), className),
|
|
12
|
+
children: children
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
ParameterPathEncoding.displayName = 'ParameterPathEncoding';
|
|
16
|
+
export { ParameterPathEncoding };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronRight } from "../../icons/index.js";
|
|
3
|
+
import { cn } from "../../utils/cn.js";
|
|
4
|
+
import { jointVariants } from "./classes.js";
|
|
5
|
+
const ParameterPathJoint = ({ className, ...rest })=>/*#__PURE__*/ jsx("span", {
|
|
6
|
+
...rest,
|
|
7
|
+
"aria-hidden": "true",
|
|
8
|
+
"data-slot": "parameter-path-joint",
|
|
9
|
+
className: cn(jointVariants(), className),
|
|
10
|
+
children: /*#__PURE__*/ jsx(ChevronRight, {
|
|
11
|
+
size: "sm"
|
|
12
|
+
})
|
|
13
|
+
});
|
|
14
|
+
ParameterPathJoint.displayName = 'ParameterPathJoint';
|
|
15
|
+
export { ParameterPathJoint };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import type { HttpMethod } from './types';
|
|
3
|
+
interface ParameterPathMethodProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4
|
+
method: HttpMethod;
|
|
5
|
+
}
|
|
6
|
+
export declare const ParameterPathMethod: FC<ParameterPathMethodProps>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../utils/cn.js";
|
|
3
|
+
import { useTestId } from "../../utils/testId.js";
|
|
4
|
+
import { Badge } from "../Badge/index.js";
|
|
5
|
+
import { HTTP_METHOD_COLOR } from "./constants.js";
|
|
6
|
+
const ParameterPathMethod = ({ method, className, ...rest })=>{
|
|
7
|
+
const testId = useTestId('method');
|
|
8
|
+
return /*#__PURE__*/ jsx("span", {
|
|
9
|
+
...rest,
|
|
10
|
+
"data-slot": "parameter-path-method",
|
|
11
|
+
"data-testid": testId,
|
|
12
|
+
className: cn('flex items-center', className),
|
|
13
|
+
children: /*#__PURE__*/ jsx(Badge, {
|
|
14
|
+
type: "secondary",
|
|
15
|
+
color: HTTP_METHOD_COLOR[method],
|
|
16
|
+
size: "medium",
|
|
17
|
+
textVariant: "code",
|
|
18
|
+
children: method
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
ParameterPathMethod.displayName = 'ParameterPathMethod';
|
|
23
|
+
export { ParameterPathMethod };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes } from 'react';
|
|
2
|
+
interface ParameterPathSegmentProps extends HTMLAttributes<HTMLSpanElement> {
|
|
3
|
+
children: string;
|
|
4
|
+
variant?: 'default' | 'highlighted';
|
|
5
|
+
/** Show the Zap icon — only honored when `variant='highlighted'`. */
|
|
6
|
+
withZap?: boolean;
|
|
7
|
+
/** Segment index in the path; used to derive a `segment-N` test id. */
|
|
8
|
+
index?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const ParameterPathSegment: FC<ParameterPathSegmentProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Zap } from "../../icons/index.js";
|
|
3
|
+
import { cn } from "../../utils/cn.js";
|
|
4
|
+
import { useTestId } from "../../utils/testId.js";
|
|
5
|
+
import { segmentVariants } from "./classes.js";
|
|
6
|
+
const ParameterPathSegment = ({ children, variant = 'default', withZap = false, index, className, ...rest })=>{
|
|
7
|
+
const testId = useTestId(void 0 !== index ? `segment-${index}` : 'segment');
|
|
8
|
+
return /*#__PURE__*/ jsxs("span", {
|
|
9
|
+
...rest,
|
|
10
|
+
"data-slot": "parameter-path-segment",
|
|
11
|
+
"data-variant": variant,
|
|
12
|
+
"data-testid": testId,
|
|
13
|
+
className: cn(segmentVariants({
|
|
14
|
+
variant
|
|
15
|
+
}), className),
|
|
16
|
+
children: [
|
|
17
|
+
children,
|
|
18
|
+
withZap && 'highlighted' === variant ? /*#__PURE__*/ jsx(Zap, {
|
|
19
|
+
size: "sm",
|
|
20
|
+
className: "text-icon-danger",
|
|
21
|
+
"aria-hidden": "true"
|
|
22
|
+
}) : null
|
|
23
|
+
]
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
ParameterPathSegment.displayName = 'ParameterPathSegment';
|
|
27
|
+
export { ParameterPathSegment };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const segmentVariants: (props?: ({
|
|
2
|
+
variant?: "default" | "highlighted" | null | undefined;
|
|
3
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
4
|
+
export declare const encodingVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
5
|
+
export declare const jointVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
6
|
+
export declare const ellipsisVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
const segmentVariants = cva('flex items-center justify-center gap-2 shrink-0 text-sm leading-5 whitespace-nowrap font-sans', {
|
|
3
|
+
variants: {
|
|
4
|
+
variant: {
|
|
5
|
+
default: 'text-text-secondary font-normal',
|
|
6
|
+
highlighted: 'text-text-primary font-medium'
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
defaultVariants: {
|
|
10
|
+
variant: 'default'
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
const encodingVariants = cva([
|
|
14
|
+
'flex items-center justify-center shrink-0 gap-2',
|
|
15
|
+
'h-20 rounded-8 border-1 border-dashed border-border-primary',
|
|
16
|
+
'px-4',
|
|
17
|
+
'font-mono text-xs leading-4 text-text-secondary'
|
|
18
|
+
]);
|
|
19
|
+
const jointVariants = cva('flex items-center shrink-0 p-2 text-icon-secondary');
|
|
20
|
+
const ellipsisVariants = cva([
|
|
21
|
+
'flex items-center justify-center shrink-0',
|
|
22
|
+
'h-20 px-2 gap-2',
|
|
23
|
+
'text-text-secondary'
|
|
24
|
+
]);
|
|
25
|
+
export { ellipsisVariants, encodingVariants, jointVariants, segmentVariants };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const quoteValue = (raw)=>{
|
|
2
|
+
if (!raw.includes('"')) return `"${raw}"`;
|
|
3
|
+
if (!raw.includes("'")) return `'${raw}'`;
|
|
4
|
+
return `"${raw.replace(/"/g, '')}"`;
|
|
5
|
+
};
|
|
6
|
+
const formatAsFilter = ({ method, segments, encoding })=>{
|
|
7
|
+
const parts = [];
|
|
8
|
+
if (method) parts.push(`method = ${quoteValue(method)}`);
|
|
9
|
+
if (segments.length > 0) parts.push(`parameter = ${quoteValue(segments.join('.'))}`);
|
|
10
|
+
if (encoding) parts.push(`encoding = ${quoteValue(encoding)}`);
|
|
11
|
+
return parts.join(' AND ');
|
|
12
|
+
};
|
|
13
|
+
export { formatAsFilter };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { HTMLAttributes, Ref } from 'react';
|
|
2
|
+
import type { TestableProps } from '../../utils/testId';
|
|
3
|
+
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
|
|
4
|
+
export interface CopyFormatData {
|
|
5
|
+
method?: HttpMethod;
|
|
6
|
+
segments: string[];
|
|
7
|
+
encoding?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ParameterPathProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onCopy'>, TestableProps {
|
|
10
|
+
ref?: Ref<HTMLDivElement>;
|
|
11
|
+
method?: HttpMethod;
|
|
12
|
+
segments: string[];
|
|
13
|
+
encoding?: string;
|
|
14
|
+
attack?: boolean;
|
|
15
|
+
copyFormat?: (data: CopyFormatData) => string;
|
|
16
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
interface ComputeArgs {
|
|
3
|
+
containerWidth: number;
|
|
4
|
+
methodWidth: number;
|
|
5
|
+
encodingWidth: number;
|
|
6
|
+
segmentWidths: number[];
|
|
7
|
+
jointsWidth: number;
|
|
8
|
+
}
|
|
9
|
+
interface TruncationResult {
|
|
10
|
+
isTruncated: boolean;
|
|
11
|
+
visibleSegmentIndices: number[];
|
|
12
|
+
}
|
|
13
|
+
export declare const computeTruncation: ({ containerWidth, methodWidth, encodingWidth, segmentWidths, jointsWidth, }: ComputeArgs) => TruncationResult;
|
|
14
|
+
interface UseTruncationArgs {
|
|
15
|
+
containerRef: RefObject<HTMLElement | null>;
|
|
16
|
+
measurementRef: RefObject<HTMLElement | null>;
|
|
17
|
+
segmentCount: number;
|
|
18
|
+
hasMethod: boolean;
|
|
19
|
+
hasEncoding: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare const useParameterPathTruncation: ({ containerRef, measurementRef, segmentCount, hasMethod, hasEncoding, }: UseTruncationArgs) => TruncationResult;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { useLayoutEffect, useState } from "react";
|
|
2
|
+
import { useContainerWidth } from "../Table/lib/useContainerWidth.js";
|
|
3
|
+
const computeTruncation = ({ containerWidth, methodWidth, encodingWidth, segmentWidths, jointsWidth })=>{
|
|
4
|
+
const segCount = segmentWidths.length;
|
|
5
|
+
const allIndices = Array.from({
|
|
6
|
+
length: segCount
|
|
7
|
+
}, (_, i)=>i);
|
|
8
|
+
if (segCount <= 2 || containerWidth <= 0) return {
|
|
9
|
+
isTruncated: false,
|
|
10
|
+
visibleSegmentIndices: allIndices
|
|
11
|
+
};
|
|
12
|
+
const totalWidth = methodWidth + encodingWidth + segmentWidths.reduce((acc, w)=>acc + w, 0) + jointsWidth;
|
|
13
|
+
if (totalWidth <= containerWidth) return {
|
|
14
|
+
isTruncated: false,
|
|
15
|
+
visibleSegmentIndices: allIndices
|
|
16
|
+
};
|
|
17
|
+
return {
|
|
18
|
+
isTruncated: true,
|
|
19
|
+
visibleSegmentIndices: [
|
|
20
|
+
0,
|
|
21
|
+
segCount - 1
|
|
22
|
+
]
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
const indicesEqual = (a, b)=>a.length === b.length && a.every((v, i)=>v === b[i]);
|
|
26
|
+
const useParameterPathTruncation = ({ containerRef, measurementRef, segmentCount, hasMethod, hasEncoding })=>{
|
|
27
|
+
const containerWidth = useContainerWidth(containerRef);
|
|
28
|
+
const [result, setResult] = useState({
|
|
29
|
+
isTruncated: false,
|
|
30
|
+
visibleSegmentIndices: Array.from({
|
|
31
|
+
length: segmentCount
|
|
32
|
+
}, (_, i)=>i)
|
|
33
|
+
});
|
|
34
|
+
useLayoutEffect(()=>{
|
|
35
|
+
const root = measurementRef.current;
|
|
36
|
+
if (!root) return;
|
|
37
|
+
const methodEl = root.querySelector('[data-measure="method"]');
|
|
38
|
+
const encodingEl = root.querySelector('[data-measure="encoding"]');
|
|
39
|
+
const jointEls = Array.from(root.querySelectorAll('[data-measure="joint"]'));
|
|
40
|
+
const segmentEls = Array.from(root.querySelectorAll('[data-measure="segment"]'));
|
|
41
|
+
const segmentWidths = segmentEls.map((el)=>el.getBoundingClientRect().width);
|
|
42
|
+
const methodWidth = hasMethod && methodEl ? methodEl.getBoundingClientRect().width : 0;
|
|
43
|
+
const encodingWidth = hasEncoding && encodingEl ? encodingEl.getBoundingClientRect().width : 0;
|
|
44
|
+
const jointsWidth = jointEls.reduce((acc, el)=>acc + el.getBoundingClientRect().width, 0);
|
|
45
|
+
const next = computeTruncation({
|
|
46
|
+
containerWidth,
|
|
47
|
+
methodWidth,
|
|
48
|
+
encodingWidth,
|
|
49
|
+
segmentWidths,
|
|
50
|
+
jointsWidth
|
|
51
|
+
});
|
|
52
|
+
setResult((prev)=>prev.isTruncated === next.isTruncated && indicesEqual(prev.visibleSegmentIndices, next.visibleSegmentIndices) ? prev : next);
|
|
53
|
+
}, [
|
|
54
|
+
containerWidth,
|
|
55
|
+
segmentCount,
|
|
56
|
+
hasMethod,
|
|
57
|
+
hasEncoding,
|
|
58
|
+
measurementRef
|
|
59
|
+
]);
|
|
60
|
+
return result;
|
|
61
|
+
};
|
|
62
|
+
export { computeTruncation, useParameterPathTruncation };
|
|
@@ -67,7 +67,9 @@ const SelectInput = ({ placeholder = 'Choose...' })=>{
|
|
|
67
67
|
multiple && !isEmpty ? /*#__PURE__*/ jsx(OverflowList, {
|
|
68
68
|
className: "flex items-center gap-4 flex-1 h-full pl-6 overflow-hidden",
|
|
69
69
|
items: selectedItems,
|
|
70
|
-
itemRenderer: SelectInputItemRenderer,
|
|
70
|
+
itemRenderer: (item)=>/*#__PURE__*/ jsx(SelectInputItemRenderer, {
|
|
71
|
+
item: item
|
|
72
|
+
}, item.value),
|
|
71
73
|
overflowRenderer: SelectInputOverflowRenderer
|
|
72
74
|
}) : /*#__PURE__*/ jsx(SelectValueText, {
|
|
73
75
|
placeholder: placeholder
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
1
2
|
import type { SelectDataItem } from '../types';
|
|
2
|
-
|
|
3
|
+
type SelectInputItemRendererProps = {
|
|
4
|
+
item: SelectDataItem;
|
|
5
|
+
};
|
|
6
|
+
export declare const SelectInputItemRenderer: FC<SelectInputItemRendererProps>;
|
|
7
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useSelectContext } from "@ark-ui/react/select";
|
|
3
3
|
import { Tag, TagClose } from "../../Tag/index.js";
|
|
4
|
-
const SelectInputItemRenderer = (item)=>{
|
|
4
|
+
const SelectInputItemRenderer = ({ item })=>{
|
|
5
5
|
const { value, setValue } = useSelectContext();
|
|
6
6
|
const handleRemove = ()=>{
|
|
7
7
|
const nextValue = value.filter((v)=>v !== item.value);
|
|
@@ -17,6 +17,6 @@ const SelectInputItemRenderer = (item)=>{
|
|
|
17
17
|
onClick: handleRemove
|
|
18
18
|
})
|
|
19
19
|
]
|
|
20
|
-
}
|
|
20
|
+
});
|
|
21
21
|
};
|
|
22
22
|
export { SelectInputItemRenderer };
|
package/dist/index.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ export { Loader, type LoaderProps } from './components/Loader';
|
|
|
38
38
|
export { NumberInput, type NumberInputProps } from './components/NumberInput';
|
|
39
39
|
export { NumericBadge, type NumericBadgeProps, } from './components/NumericBadge';
|
|
40
40
|
export { OverflowTooltip, OverflowTooltipContent, type OverflowTooltipContentProps, type OverflowTooltipProps, } from './components/OverflowTooltip';
|
|
41
|
+
export { type CopyFormatData, formatAsFilter, type HttpMethod, ParameterPath, type ParameterPathProps, } from './components/ParameterPath';
|
|
41
42
|
export { Popover, PopoverContent, PopoverTrigger } from './components/Popover';
|
|
42
43
|
export { Radio, RadioDescription, type RadioDescriptionProps, RadioGroup, type RadioGroupProps, RadioIndicator, RadioLabel, type RadioLabelProps, type RadioProps, } from './components/Radio';
|
|
43
44
|
export { ScrollArea, ScrollAreaContent, type ScrollAreaContentProps, ScrollAreaCorner, type ScrollAreaProps, ScrollAreaScrollbar, type ScrollAreaScrollbarProps, ScrollAreaViewport, type ScrollAreaViewportProps, } from './components/ScrollArea';
|
package/dist/index.js
CHANGED
|
@@ -27,6 +27,7 @@ import { Loader } from "./components/Loader/index.js";
|
|
|
27
27
|
import { NumberInput } from "./components/NumberInput/index.js";
|
|
28
28
|
import { NumericBadge } from "./components/NumericBadge/index.js";
|
|
29
29
|
import { OverflowTooltip, OverflowTooltipContent } from "./components/OverflowTooltip/index.js";
|
|
30
|
+
import { ParameterPath, formatAsFilter } from "./components/ParameterPath/index.js";
|
|
30
31
|
import { Popover, PopoverContent, PopoverTrigger } from "./components/Popover/index.js";
|
|
31
32
|
import { Radio, RadioDescription, RadioGroup, RadioIndicator, RadioLabel } from "./components/Radio/index.js";
|
|
32
33
|
import { ScrollArea, ScrollAreaContent, ScrollAreaCorner, ScrollAreaScrollbar, ScrollAreaViewport } from "./components/ScrollArea/index.js";
|
|
@@ -51,4 +52,4 @@ import { ToggleButton } from "./components/ToggleButton/index.js";
|
|
|
51
52
|
import { Tooltip, TooltipContent, TooltipTrigger } from "./components/Tooltip/index.js";
|
|
52
53
|
import { Tour, beaconStepEffect, useTour, waitForStepEvent } from "./components/Tour/index.js";
|
|
53
54
|
import { TestIdProvider, useTestId } from "./utils/testId.js";
|
|
54
|
-
export { Alert, AlertClose, AlertContent, AlertControls, AlertDescription, AlertIcon, AlertTitle, Attribute, AttributeActions, AttributeActionsContent, AttributeActionsItem, AttributeActionsTarget, AttributeLabel, AttributeLabelDescription, AttributeLabelInfo, AttributeValue, Badge, Button, Calendar, CalendarApplyButton, CalendarBody, CalendarContent, CalendarDate, CalendarDateTime, CalendarDayName, CalendarFooter, CalendarFooterControls, CalendarGrid, CalendarGrids, CalendarHeader, CalendarInputHeader, CalendarKeyboardHints, CalendarPresetItem, CalendarPresets, CalendarProvider, CalendarResetButton, CalendarTrigger, Card, CardContent, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxDescription, CheckboxGroup, CheckboxIndicator, CheckboxLabel, Code, Country, CountryFlag, CountryName, DAY_NAMES, DEFAULT_RANGE_PRESETS, DEFAULT_SINGLE_PRESETS, DateFormatProvider, DateInput, DateRangeEndValue, DateRangeInput, DateRangeProvider, DateRangeSeparator, DateRangeStartValue, Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerFooter, DrawerFooterControls, DrawerHeader, DrawerPositioner, DrawerResizeHandle, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuContextTrigger, DropdownMenuFooter, DropdownMenuGroup, DropdownMenuInput, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemDescription, DropdownMenuItemIcon, DropdownMenuItemText, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, DropdownMenuTriggerItem, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, FilterInput, FilterInputChip, FilterInputFieldMenu, FilterInputOperatorMenu, Flex, FormatDateTime, HStack, Heading, Input, InputGroup, InputGroupAddon, InputGroupText, Ip, IpAddress, IpCountry, IpList, IpPort, IpProvider, Kbd, KbdGroup, Link, Loader, MONTH_NAMES, NumberInput, NumericBadge, OverflowTooltip, OverflowTooltipContent, Popover, PopoverContent, PopoverTrigger, Radio, RadioDescription, RadioGroup, RadioIndicator, RadioLabel, ScrollArea, ScrollAreaContent, ScrollAreaCorner, ScrollAreaScrollbar, ScrollAreaViewport, SegmentedControl, SegmentedControlButton, SegmentedControlItem, SegmentedControlSeparator, SegmentedTabs, SegmentedTabsButton, SegmentedTabsContent, SegmentedTabsList, SegmentedTabsSeparator, SegmentedTabsTrigger, SegmentedTabsTriggerButton, Select, SelectButton, SelectClearTrigger, SelectContent, SelectFooter, SelectGroup, SelectGroupLabel, SelectHeader, SelectInput, SelectOption, SelectOptionDescription, SelectOptionIndicator, SelectOptionText, SelectPositioner, SelectSearchInput, SelectSeparator, Selection, SelectionAll, SelectionBulkBar, SelectionItem, Separator, Skeleton, SplitButton, Stack, Switch, SwitchControl, SwitchDescription, SwitchLabel, Table, TableActionBar, TableEmptyState, TableSettingsMenu, Tabs, TabsButton, TabsContent, TabsLineActions, TabsList, TabsSeparator, TabsTrigger, Tag, TagClose, TestIdProvider, Text, Textarea, ThemeProvider, Time, TimeInput, Toast, ToastActions, Toaster, ToggleButton, Tooltip, TooltipContent, TooltipTrigger, Tour, VStack, ZonedDateTime, beaconStepEffect, cardVariants, createTableColumnHelper, datacenters, drawerContentVariants, drawerPositionerVariants, getLocalTimeZone, parseDate, parseDateTime, parseTime, parseZonedDateTime, proxyTypes, sourceLabels, toaster, today, useCalendarContext, useDateFormat, useDateRangeContext, useDrawerContext, useTestId, useTheme, useTour, waitForStepEvent };
|
|
55
|
+
export { Alert, AlertClose, AlertContent, AlertControls, AlertDescription, AlertIcon, AlertTitle, Attribute, AttributeActions, AttributeActionsContent, AttributeActionsItem, AttributeActionsTarget, AttributeLabel, AttributeLabelDescription, AttributeLabelInfo, AttributeValue, Badge, Button, Calendar, CalendarApplyButton, CalendarBody, CalendarContent, CalendarDate, CalendarDateTime, CalendarDayName, CalendarFooter, CalendarFooterControls, CalendarGrid, CalendarGrids, CalendarHeader, CalendarInputHeader, CalendarKeyboardHints, CalendarPresetItem, CalendarPresets, CalendarProvider, CalendarResetButton, CalendarTrigger, Card, CardContent, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxDescription, CheckboxGroup, CheckboxIndicator, CheckboxLabel, Code, Country, CountryFlag, CountryName, DAY_NAMES, DEFAULT_RANGE_PRESETS, DEFAULT_SINGLE_PRESETS, DateFormatProvider, DateInput, DateRangeEndValue, DateRangeInput, DateRangeProvider, DateRangeSeparator, DateRangeStartValue, Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerFooter, DrawerFooterControls, DrawerHeader, DrawerPositioner, DrawerResizeHandle, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuContextTrigger, DropdownMenuFooter, DropdownMenuGroup, DropdownMenuInput, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemDescription, DropdownMenuItemIcon, DropdownMenuItemText, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, DropdownMenuTriggerItem, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, FilterInput, FilterInputChip, FilterInputFieldMenu, FilterInputOperatorMenu, Flex, FormatDateTime, HStack, Heading, Input, InputGroup, InputGroupAddon, InputGroupText, Ip, IpAddress, IpCountry, IpList, IpPort, IpProvider, Kbd, KbdGroup, Link, Loader, MONTH_NAMES, NumberInput, NumericBadge, OverflowTooltip, OverflowTooltipContent, ParameterPath, Popover, PopoverContent, PopoverTrigger, Radio, RadioDescription, RadioGroup, RadioIndicator, RadioLabel, ScrollArea, ScrollAreaContent, ScrollAreaCorner, ScrollAreaScrollbar, ScrollAreaViewport, SegmentedControl, SegmentedControlButton, SegmentedControlItem, SegmentedControlSeparator, SegmentedTabs, SegmentedTabsButton, SegmentedTabsContent, SegmentedTabsList, SegmentedTabsSeparator, SegmentedTabsTrigger, SegmentedTabsTriggerButton, Select, SelectButton, SelectClearTrigger, SelectContent, SelectFooter, SelectGroup, SelectGroupLabel, SelectHeader, SelectInput, SelectOption, SelectOptionDescription, SelectOptionIndicator, SelectOptionText, SelectPositioner, SelectSearchInput, SelectSeparator, Selection, SelectionAll, SelectionBulkBar, SelectionItem, Separator, Skeleton, SplitButton, Stack, Switch, SwitchControl, SwitchDescription, SwitchLabel, Table, TableActionBar, TableEmptyState, TableSettingsMenu, Tabs, TabsButton, TabsContent, TabsLineActions, TabsList, TabsSeparator, TabsTrigger, Tag, TagClose, TestIdProvider, Text, Textarea, ThemeProvider, Time, TimeInput, Toast, ToastActions, Toaster, ToggleButton, Tooltip, TooltipContent, TooltipTrigger, Tour, VStack, ZonedDateTime, beaconStepEffect, cardVariants, createTableColumnHelper, datacenters, drawerContentVariants, drawerPositionerVariants, formatAsFilter, getLocalTimeZone, parseDate, parseDateTime, parseTime, parseZonedDateTime, proxyTypes, sourceLabels, toaster, today, useCalendarContext, useDateFormat, useDateRangeContext, useDrawerContext, useTestId, useTheme, useTour, waitForStepEvent };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.32.
|
|
3
|
-
"generatedAt": "2026-05-
|
|
2
|
+
"version": "0.32.1",
|
|
3
|
+
"generatedAt": "2026-05-05T07:07:16.597Z",
|
|
4
4
|
"components": [
|
|
5
5
|
{
|
|
6
6
|
"name": "Alert",
|
|
@@ -20714,6 +20714,358 @@
|
|
|
20714
20714
|
}
|
|
20715
20715
|
]
|
|
20716
20716
|
},
|
|
20717
|
+
{
|
|
20718
|
+
"name": "ParameterPath",
|
|
20719
|
+
"importPath": "@wallarm-org/design-system/ParameterPath",
|
|
20720
|
+
"props": [
|
|
20721
|
+
{
|
|
20722
|
+
"name": "method",
|
|
20723
|
+
"type": "HttpMethod | undefined",
|
|
20724
|
+
"required": false
|
|
20725
|
+
},
|
|
20726
|
+
{
|
|
20727
|
+
"name": "segments",
|
|
20728
|
+
"type": "string[]",
|
|
20729
|
+
"required": true
|
|
20730
|
+
},
|
|
20731
|
+
{
|
|
20732
|
+
"name": "encoding",
|
|
20733
|
+
"type": "string | undefined",
|
|
20734
|
+
"required": false
|
|
20735
|
+
},
|
|
20736
|
+
{
|
|
20737
|
+
"name": "attack",
|
|
20738
|
+
"type": "boolean | undefined",
|
|
20739
|
+
"required": false,
|
|
20740
|
+
"defaultValue": "false"
|
|
20741
|
+
},
|
|
20742
|
+
{
|
|
20743
|
+
"name": "copyFormat",
|
|
20744
|
+
"type": "((data: CopyFormatData) => string) | undefined",
|
|
20745
|
+
"required": false,
|
|
20746
|
+
"defaultValue": "formatAsFilter"
|
|
20747
|
+
},
|
|
20748
|
+
{
|
|
20749
|
+
"name": "defaultChecked",
|
|
20750
|
+
"type": "boolean | undefined",
|
|
20751
|
+
"required": false
|
|
20752
|
+
},
|
|
20753
|
+
{
|
|
20754
|
+
"name": "defaultValue",
|
|
20755
|
+
"type": "string | number | readonly string[] | undefined",
|
|
20756
|
+
"required": false
|
|
20757
|
+
},
|
|
20758
|
+
{
|
|
20759
|
+
"name": "suppressContentEditableWarning",
|
|
20760
|
+
"type": "boolean | undefined",
|
|
20761
|
+
"required": false
|
|
20762
|
+
},
|
|
20763
|
+
{
|
|
20764
|
+
"name": "suppressHydrationWarning",
|
|
20765
|
+
"type": "boolean | undefined",
|
|
20766
|
+
"required": false
|
|
20767
|
+
},
|
|
20768
|
+
{
|
|
20769
|
+
"name": "accessKey",
|
|
20770
|
+
"type": "string | undefined",
|
|
20771
|
+
"required": false
|
|
20772
|
+
},
|
|
20773
|
+
{
|
|
20774
|
+
"name": "autoCapitalize",
|
|
20775
|
+
"type": "\"off\" | \"none\" | \"on\" | \"sentences\" | \"words\" | \"characters\" | (string & {}) | undefined",
|
|
20776
|
+
"required": false
|
|
20777
|
+
},
|
|
20778
|
+
{
|
|
20779
|
+
"name": "autoFocus",
|
|
20780
|
+
"type": "boolean | undefined",
|
|
20781
|
+
"required": false
|
|
20782
|
+
},
|
|
20783
|
+
{
|
|
20784
|
+
"name": "contentEditable",
|
|
20785
|
+
"type": "Booleanish | \"inherit\" | \"plaintext-only\" | undefined",
|
|
20786
|
+
"required": false
|
|
20787
|
+
},
|
|
20788
|
+
{
|
|
20789
|
+
"name": "contextMenu",
|
|
20790
|
+
"type": "string | undefined",
|
|
20791
|
+
"required": false
|
|
20792
|
+
},
|
|
20793
|
+
{
|
|
20794
|
+
"name": "dir",
|
|
20795
|
+
"type": "string | undefined",
|
|
20796
|
+
"required": false
|
|
20797
|
+
},
|
|
20798
|
+
{
|
|
20799
|
+
"name": "draggable",
|
|
20800
|
+
"type": "Booleanish | undefined",
|
|
20801
|
+
"required": false
|
|
20802
|
+
},
|
|
20803
|
+
{
|
|
20804
|
+
"name": "enterKeyHint",
|
|
20805
|
+
"type": "\"enter\" | \"done\" | \"go\" | \"next\" | \"previous\" | \"search\" | \"send\" | undefined",
|
|
20806
|
+
"required": false
|
|
20807
|
+
},
|
|
20808
|
+
{
|
|
20809
|
+
"name": "hidden",
|
|
20810
|
+
"type": "boolean | undefined",
|
|
20811
|
+
"required": false
|
|
20812
|
+
},
|
|
20813
|
+
{
|
|
20814
|
+
"name": "id",
|
|
20815
|
+
"type": "string | undefined",
|
|
20816
|
+
"required": false
|
|
20817
|
+
},
|
|
20818
|
+
{
|
|
20819
|
+
"name": "lang",
|
|
20820
|
+
"type": "string | undefined",
|
|
20821
|
+
"required": false
|
|
20822
|
+
},
|
|
20823
|
+
{
|
|
20824
|
+
"name": "nonce",
|
|
20825
|
+
"type": "string | undefined",
|
|
20826
|
+
"required": false
|
|
20827
|
+
},
|
|
20828
|
+
{
|
|
20829
|
+
"name": "slot",
|
|
20830
|
+
"type": "string | undefined",
|
|
20831
|
+
"required": false
|
|
20832
|
+
},
|
|
20833
|
+
{
|
|
20834
|
+
"name": "spellCheck",
|
|
20835
|
+
"type": "Booleanish | undefined",
|
|
20836
|
+
"required": false
|
|
20837
|
+
},
|
|
20838
|
+
{
|
|
20839
|
+
"name": "tabIndex",
|
|
20840
|
+
"type": "number | undefined",
|
|
20841
|
+
"required": false
|
|
20842
|
+
},
|
|
20843
|
+
{
|
|
20844
|
+
"name": "title",
|
|
20845
|
+
"type": "string | undefined",
|
|
20846
|
+
"required": false
|
|
20847
|
+
},
|
|
20848
|
+
{
|
|
20849
|
+
"name": "translate",
|
|
20850
|
+
"type": "\"yes\" | \"no\" | undefined",
|
|
20851
|
+
"required": false
|
|
20852
|
+
},
|
|
20853
|
+
{
|
|
20854
|
+
"name": "radioGroup",
|
|
20855
|
+
"type": "string | undefined",
|
|
20856
|
+
"required": false
|
|
20857
|
+
},
|
|
20858
|
+
{
|
|
20859
|
+
"name": "role",
|
|
20860
|
+
"type": "AriaRole | undefined",
|
|
20861
|
+
"required": false
|
|
20862
|
+
},
|
|
20863
|
+
{
|
|
20864
|
+
"name": "about",
|
|
20865
|
+
"type": "string | undefined",
|
|
20866
|
+
"required": false
|
|
20867
|
+
},
|
|
20868
|
+
{
|
|
20869
|
+
"name": "content",
|
|
20870
|
+
"type": "string | undefined",
|
|
20871
|
+
"required": false
|
|
20872
|
+
},
|
|
20873
|
+
{
|
|
20874
|
+
"name": "datatype",
|
|
20875
|
+
"type": "string | undefined",
|
|
20876
|
+
"required": false
|
|
20877
|
+
},
|
|
20878
|
+
{
|
|
20879
|
+
"name": "inlist",
|
|
20880
|
+
"type": "any",
|
|
20881
|
+
"required": false
|
|
20882
|
+
},
|
|
20883
|
+
{
|
|
20884
|
+
"name": "prefix",
|
|
20885
|
+
"type": "string | undefined",
|
|
20886
|
+
"required": false
|
|
20887
|
+
},
|
|
20888
|
+
{
|
|
20889
|
+
"name": "property",
|
|
20890
|
+
"type": "string | undefined",
|
|
20891
|
+
"required": false
|
|
20892
|
+
},
|
|
20893
|
+
{
|
|
20894
|
+
"name": "rel",
|
|
20895
|
+
"type": "string | undefined",
|
|
20896
|
+
"required": false
|
|
20897
|
+
},
|
|
20898
|
+
{
|
|
20899
|
+
"name": "resource",
|
|
20900
|
+
"type": "string | undefined",
|
|
20901
|
+
"required": false
|
|
20902
|
+
},
|
|
20903
|
+
{
|
|
20904
|
+
"name": "rev",
|
|
20905
|
+
"type": "string | undefined",
|
|
20906
|
+
"required": false
|
|
20907
|
+
},
|
|
20908
|
+
{
|
|
20909
|
+
"name": "typeof",
|
|
20910
|
+
"type": "string | undefined",
|
|
20911
|
+
"required": false
|
|
20912
|
+
},
|
|
20913
|
+
{
|
|
20914
|
+
"name": "vocab",
|
|
20915
|
+
"type": "string | undefined",
|
|
20916
|
+
"required": false
|
|
20917
|
+
},
|
|
20918
|
+
{
|
|
20919
|
+
"name": "autoCorrect",
|
|
20920
|
+
"type": "string | undefined",
|
|
20921
|
+
"required": false
|
|
20922
|
+
},
|
|
20923
|
+
{
|
|
20924
|
+
"name": "autoSave",
|
|
20925
|
+
"type": "string | undefined",
|
|
20926
|
+
"required": false
|
|
20927
|
+
},
|
|
20928
|
+
{
|
|
20929
|
+
"name": "color",
|
|
20930
|
+
"type": "string | undefined",
|
|
20931
|
+
"required": false
|
|
20932
|
+
},
|
|
20933
|
+
{
|
|
20934
|
+
"name": "itemProp",
|
|
20935
|
+
"type": "string | undefined",
|
|
20936
|
+
"required": false
|
|
20937
|
+
},
|
|
20938
|
+
{
|
|
20939
|
+
"name": "itemScope",
|
|
20940
|
+
"type": "boolean | undefined",
|
|
20941
|
+
"required": false
|
|
20942
|
+
},
|
|
20943
|
+
{
|
|
20944
|
+
"name": "itemType",
|
|
20945
|
+
"type": "string | undefined",
|
|
20946
|
+
"required": false
|
|
20947
|
+
},
|
|
20948
|
+
{
|
|
20949
|
+
"name": "itemID",
|
|
20950
|
+
"type": "string | undefined",
|
|
20951
|
+
"required": false
|
|
20952
|
+
},
|
|
20953
|
+
{
|
|
20954
|
+
"name": "itemRef",
|
|
20955
|
+
"type": "string | undefined",
|
|
20956
|
+
"required": false
|
|
20957
|
+
},
|
|
20958
|
+
{
|
|
20959
|
+
"name": "results",
|
|
20960
|
+
"type": "number | undefined",
|
|
20961
|
+
"required": false
|
|
20962
|
+
},
|
|
20963
|
+
{
|
|
20964
|
+
"name": "security",
|
|
20965
|
+
"type": "string | undefined",
|
|
20966
|
+
"required": false
|
|
20967
|
+
},
|
|
20968
|
+
{
|
|
20969
|
+
"name": "unselectable",
|
|
20970
|
+
"type": "\"off\" | \"on\" | undefined",
|
|
20971
|
+
"required": false
|
|
20972
|
+
},
|
|
20973
|
+
{
|
|
20974
|
+
"name": "popover",
|
|
20975
|
+
"type": "\"\" | \"auto\" | \"manual\" | \"hint\" | undefined",
|
|
20976
|
+
"required": false
|
|
20977
|
+
},
|
|
20978
|
+
{
|
|
20979
|
+
"name": "popoverTargetAction",
|
|
20980
|
+
"type": "\"toggle\" | \"show\" | \"hide\" | undefined",
|
|
20981
|
+
"required": false
|
|
20982
|
+
},
|
|
20983
|
+
{
|
|
20984
|
+
"name": "popoverTarget",
|
|
20985
|
+
"type": "string | undefined",
|
|
20986
|
+
"required": false
|
|
20987
|
+
},
|
|
20988
|
+
{
|
|
20989
|
+
"name": "inert",
|
|
20990
|
+
"type": "boolean | undefined",
|
|
20991
|
+
"required": false,
|
|
20992
|
+
"description": "@see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert"
|
|
20993
|
+
},
|
|
20994
|
+
{
|
|
20995
|
+
"name": "inputMode",
|
|
20996
|
+
"type": "\"none\" | \"search\" | \"text\" | \"tel\" | \"url\" | \"email\" | \"numeric\" | \"decimal\" | undefined",
|
|
20997
|
+
"required": false,
|
|
20998
|
+
"description": "Hints at the type of data that might be entered by the user while editing the element or its contents"
|
|
20999
|
+
},
|
|
21000
|
+
{
|
|
21001
|
+
"name": "is",
|
|
21002
|
+
"type": "string | undefined",
|
|
21003
|
+
"required": false,
|
|
21004
|
+
"description": "Specify that a standard HTML element should behave like a defined custom built-in element"
|
|
21005
|
+
},
|
|
21006
|
+
{
|
|
21007
|
+
"name": "exportparts",
|
|
21008
|
+
"type": "string | undefined",
|
|
21009
|
+
"required": false,
|
|
21010
|
+
"description": "@see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/exportparts}"
|
|
21011
|
+
},
|
|
21012
|
+
{
|
|
21013
|
+
"name": "part",
|
|
21014
|
+
"type": "string | undefined",
|
|
21015
|
+
"required": false,
|
|
21016
|
+
"description": "@see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/part}"
|
|
21017
|
+
}
|
|
21018
|
+
],
|
|
21019
|
+
"variants": [
|
|
21020
|
+
{
|
|
21021
|
+
"name": "variant",
|
|
21022
|
+
"options": [
|
|
21023
|
+
"default",
|
|
21024
|
+
"highlighted"
|
|
21025
|
+
],
|
|
21026
|
+
"defaultValue": "default"
|
|
21027
|
+
}
|
|
21028
|
+
],
|
|
21029
|
+
"subComponents": [],
|
|
21030
|
+
"examples": [
|
|
21031
|
+
{
|
|
21032
|
+
"name": "FullPath",
|
|
21033
|
+
"code": "() => (\n <ParameterPath method='POST' segments={['JSON', 'nginx_config']} encoding='BASE64' attack />\n)"
|
|
21034
|
+
},
|
|
21035
|
+
{
|
|
21036
|
+
"name": "NoEncoding",
|
|
21037
|
+
"code": "() => (\n <ParameterPath method='GET' segments={['query', 'filter']} attack />\n)"
|
|
21038
|
+
},
|
|
21039
|
+
{
|
|
21040
|
+
"name": "PathIndexBola",
|
|
21041
|
+
"code": "() => (\n <ParameterPath method='GET' segments={['path', '2']} attack />\n)"
|
|
21042
|
+
},
|
|
21043
|
+
{
|
|
21044
|
+
"name": "Header",
|
|
21045
|
+
"code": "() => (\n <ParameterPath method='GET' segments={['header', 'X-Forwarded-For']} attack />\n)"
|
|
21046
|
+
},
|
|
21047
|
+
{
|
|
21048
|
+
"name": "Cookie",
|
|
21049
|
+
"code": "() => (\n <ParameterPath method='POST' segments={['cookie', 'session_id']} attack />\n)"
|
|
21050
|
+
},
|
|
21051
|
+
{
|
|
21052
|
+
"name": "DeepNestedTruncated",
|
|
21053
|
+
"code": "() => (\n <div style={{ width: 280 }}>\n <ParameterPath\n method='POST'\n segments={['multipart', 'json_abc', 'json_doc', 'qwerty_doc', 'hash', 'formData', 'get']}\n attack\n />\n </div>\n)"
|
|
21054
|
+
},
|
|
21055
|
+
{
|
|
21056
|
+
"name": "NoMethod",
|
|
21057
|
+
"code": "() => (\n <ParameterPath segments={['cookie', 'session_id']} attack />\n)"
|
|
21058
|
+
},
|
|
21059
|
+
{
|
|
21060
|
+
"name": "Playground",
|
|
21061
|
+
"code": "args => <ParameterPath {...args} />"
|
|
21062
|
+
},
|
|
21063
|
+
{
|
|
21064
|
+
"name": "Gallery",
|
|
21065
|
+
"code": "() => (\n <VStack gap={16}>\n <ParameterPath method='POST' segments={['JSON', 'nginx_config']} encoding='BASE64' attack />\n <ParameterPath method='GET' segments={['query', 'filter']} attack />\n <ParameterPath method='GET' segments={['path', '2']} attack />\n <ParameterPath method='GET' segments={['header', 'X-Forwarded-For']} attack />\n <ParameterPath method='POST' segments={['cookie', 'session_id']} attack />\n <div style={{ width: 280 }}>\n <ParameterPath method='POST' segments={['multipart', 'a', 'b', 'c', 'd', 'get']} attack />\n </div>\n </VStack>\n)"
|
|
21066
|
+
}
|
|
21067
|
+
]
|
|
21068
|
+
},
|
|
20717
21069
|
{
|
|
20718
21070
|
"name": "Polymorphic",
|
|
20719
21071
|
"importPath": "@wallarm-org/design-system/Polymorphic",
|
package/package.json
CHANGED