@wallarm-org/claude-design 4.9.0 → 4.10.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.
- package/README.md +6 -5
- package/dist/SETUP.md +35 -8
- package/dist/UPDATE.md +11 -9
- package/dist/project/README.md +49 -19
- package/dist/project/app-skeleton.dc.html +268 -0
- package/dist/project/components/AreaChart/README.md +0 -4
- package/dist/project/components/AreaChart/stories.js +1 -1
- package/dist/project/components/Badge/README.md +5 -31
- package/dist/project/components/BarList/README.md +0 -4
- package/dist/project/components/BarList/stories.js +1 -1
- package/dist/project/components/Chart/README.md +0 -4
- package/dist/project/components/Chart/stories.js +1 -1
- package/dist/project/components/CodeEditor/stories.js +4 -4
- package/dist/project/components/CodeEditor/stories.md +0 -4
- package/dist/project/components/CodeSnippet/README.md +0 -8
- package/dist/project/components/CodeSnippet/stories.js +2 -2
- package/dist/project/components/ColumnChart/README.md +0 -4
- package/dist/project/components/ColumnChart/stories.js +1 -1
- package/dist/project/components/HorizontalBarStack/README.md +0 -4
- package/dist/project/components/HorizontalBarStack/stories.js +1 -1
- package/dist/project/components/LineChart/README.md +0 -39
- package/dist/project/components/LineChart/stories.js +1 -1
- package/dist/project/components/List/README.md +1 -1
- package/dist/project/components/List/stories.js +1 -1
- package/dist/project/components/Metric/README.md +0 -9
- package/dist/project/components/Metric/stories.js +1 -1
- package/dist/project/components/Overview/README.md +0 -4
- package/dist/project/components/Overview/stories.js +1 -1
- package/dist/project/components/PieChart/README.md +0 -4
- package/dist/project/components/PieChart/stories.js +1 -1
- package/dist/project/components/UTILITIES.md +3 -3
- package/dist/project/components/bundle.css +15 -6
- package/dist/project/components/bundle.js +5 -5
- package/dist/project/components/index.d.ts +6 -4
- package/dist/project/design-system.json +4 -4
- package/dist/project/sampler.dc.html +5 -7
- package/dist/project/tokens.json +2 -2
- package/dist/wallarm-app.dc.html +269 -0
- package/dist/wallarm-sampler.dc.html +5 -7
- package/package.json +3 -3
|
@@ -9,4 +9,4 @@ var e={vD(e,t,r){let n,a;/**
|
|
|
9
9
|
* @nolint
|
|
10
10
|
* @preventMunge
|
|
11
11
|
* @preserve-invariant-messages
|
|
12
|
-
*/var l,o,i=Object.create,c=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyNames,f=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty,m=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of u(t))d.call(e,a)||a===r||c(e,a,{get:()=>t[a],enumerable:!(n=s(t,a))||n.enumerable});return e},p={},h={$dispatcherGuard:()=>M,$makeReadOnly:()=>k,$reset:()=>O,$structuralCheck:()=>x,c:()=>E,clearRenderCounterRegistry:()=>T,renderCounterRegistry:()=>D,useRenderCounter:()=>j};for(var y in h)c(p,y,{get:h[y],enumerable:!0});e.exports=m(c({},"__esModule",{value:!0}),p);var w=(a=null!=(n=r("C"))?i(f(n)):{},m(n&&n.__esModule?a:c(a,"default",{value:n,enumerable:!0}),n)),{useRef:g,useEffect:_,isValidElement:b}=w,S=null!=(l=w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE)?l:w.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,v=Symbol.for("react.memo_cache_sentinel"),E="function"==typeof(null==(o=w.__COMPILER_RUNTIME)?void 0:o.c)?w.__COMPILER_RUNTIME.c:function(e){return w.useMemo(()=>{let t=Array(e);for(let r=0;r<e;r++)t[r]=v;return t[v]=!0,t},[])},R={};["readContext","useCallback","useContext","useEffect","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useReducer","useRef","useState","useDebugValue","useDeferredValue","useTransition","useMutableSource","useSyncExternalStore","useId","unstable_isNewReconciler","getCacheSignal","getCacheForType","useCacheRefresh"].forEach(e=>{R[e]=()=>{throw Error(`[React] Unexpected React hook call (${e}) from a React compiled function. Check that all hooks are called directly and named according to convention ('use[A-Z]') `)}});var C=null;function $(e){return S.ReactCurrentDispatcher.current=e,S.ReactCurrentDispatcher.current}R.useMemoCache=e=>{if(null!=C)return C.useMemoCache(e);throw Error("React Compiler internal invariant violation: unexpected null dispatcher")};var N=[];function M(e){let t=S.ReactCurrentDispatcher.current;if(0===e){if(N.push(t),1===N.length&&(C=t),t===R)throw Error("[React] Unexpected call to custom hook or component from a React compiled function. Check that (1) all hooks are called directly and named according to convention ('use[A-Z]') and (2) components are returned as JSX instead of being directly invoked.");$(R)}else if(1===e){let e=N.pop();if(null==e)throw Error("React Compiler internal error: unexpected null in guard stack");0===N.length&&(C=null),$(e)}else if(2===e)N.push(t),$(C);else if(3===e){let e=N.pop();if(null==e)throw Error("React Compiler internal error: unexpected null in guard stack");$(e)}else throw Error("React Compiler internal error: unreachable block"+e)}function O(e){for(let t=0;t<e.length;t++)e[t]=v}function k(){throw Error("TODO: implement $makeReadOnly in react-compiler-runtime")}var D=new Map;function T(){for(let e of D.values())e.forEach(e=>{e.count=0})}function j(e){let t=g(null);null!=t.current&&(t.current.count+=1),_(()=>{if(null==t.current){let r,n={count:0};null==(r=D.get(e))&&(r=new Set,D.set(e,r)),r.add(n),t.current=n}return()=>{var r;let n;null!==t.current&&(r=t.current,null!=(n=D.get(e))&&n.delete(r))}})}var A=new Set;function x(e,t,r,n,a,l){function o(e,t,o,i){let c=`${n}:${l} [${a}] ${r}${o} changed from ${e} to ${t} at depth ${i}`;A.has(c)||(A.add(c),console.error(c))}!function e(t,r,n,a){if(!(a>2)){if(t!==r)if(typeof t!=typeof r)o(`type ${typeof t}`,`type ${typeof r}`,n,a);else if("object"==typeof t){let l=Array.isArray(t),i=Array.isArray(r);if(null===t&&null!==r)o("null",`type ${typeof r}`,n,a);else if(null===r)o(`type ${typeof t}`,"null",n,a);else if(t instanceof Map)if(r instanceof Map)if(t.size!==r.size)o(`Map instance with size ${t.size}`,`Map instance with size ${r.size}`,n,a);else for(let[l,i]of t)r.has(l)?e(i,r.get(l),`${n}.get(${l})`,a+1):o(`Map instance with key ${l}`,`Map instance without key ${l}`,n,a);else o("Map instance","other value",n,a);else if(r instanceof Map)o("other value","Map instance",n,a);else if(t instanceof Set)if(r instanceof Set)if(t.size!==r.size)o(`Set instance with size ${t.size}`,`Set instance with size ${r.size}`,n,a);else for(let e of r)t.has(e)||o(`Set instance without element ${e}`,`Set instance with element ${e}`,n,a);else o("Set instance","other value",n,a);else if(r instanceof Set)o("other value","Set instance",n,a);else if(l||i)if(l!==i)o(`type ${l?"array":"object"}`,`type ${i?"array":"object"}`,n,a);else if(t.length!==r.length)o(`array with length ${t.length}`,`array with length ${r.length}`,n,a);else for(let l=0;l<t.length;l++)e(t[l],r[l],`${n}[${l}]`,a+1);else if(b(t)||b(r))b(t)!==b(r)?o(`type ${b(t)?"React element":"object"}`,`type ${b(r)?"React element":"object"}`,n,a):t.type!==r.type?o(`React element of type ${t.type}`,`React element of type ${r.type}`,n,a):e(t.props,r.props,`[props of ${n}]`,a+1);else{for(let e in r)e in t||o(`object without key ${e}`,`object with key ${e}`,n,a);for(let l in t)l in r?e(t[l],r[l],`${n}.${l}`,a+1):o(`object with key ${l}`,`object without key ${l}`,n,a)}}else{if("function"==typeof t)return;isNaN(t)||isNaN(r)?isNaN(t)!==isNaN(r)&&o(`${isNaN(t)?"NaN":"non-NaN value"}`,`${isNaN(r)?"NaN":"non-NaN value"}`,n,a):t!==r&&o(t,r,n,a)}}}(e,t,"",0)}},p(e,t,r){let n=new WeakMap,a=new WeakMap;function l(e,t,r){let l=t,o=r;if("object"==typeof l&&null!==l&&"$$typeof"in l&&l.$$typeof===Symbol.for("react.context")&&"Provider"in l&&(l=l.Provider),"function"==typeof l&&null!=o.ref&&!l.prototype?.isReactComponent){let t=l,r=n.get(e);r||(r=new WeakMap,n.set(e,r));let a=r.get(t);a||((a=e.forwardRef((e,r)=>t({...e,ref:r}))).displayName=t.displayName??t.name,r.set(t,a)),l=a}if("string"==typeof l&&"boolean"==typeof o.inert&&((o={...o}).inert?o.inert="":delete o.inert),"string"==typeof l)for(let[e,t]of[["fill-rule","fillRule"],["clip-rule","clipRule"]])e in o&&(o={...o,[t]:o[e]},delete o[e]);return"string"==typeof l&&null!=o.ref&&(l=function(e,t){let r=a.get(e);r||(r=new Map,a.set(e,r));let n=r.get(t);if(n)return n;let l=e.forwardRef((r,n)=>{let a=e.useRef(null);if(!a.current||a.current.original!==n){let e;a.current={original:n,callback:t=>{if(null==t&&e){let t=e;e=void 0,t();return}if("function"==typeof n){let r=n(t);e="function"==typeof r?r:void 0}else n&&(n.current=t)}}}return e.createElement(t,{...r,ref:a.current.callback})});return l.displayName=`CanvasHost(${t})`,r.set(t,l),l}(e,l)),{type:l,props:o}}function o(e){let t=(t,r,n)=>{let a=l(e,t,r??{});return e.createElement(a.type,void 0===n?a.props:{...a.props,key:n})};return{jsx:t,jsxs:(t,r,n)=>{let a=l(e,t,r??{}),{children:o,...i}=a.props;return e.createElement(a.type,void 0===n?i:{...i,key:n},...Array.isArray(o)?o:[o])},jsxDEV:t,Fragment:e.Fragment}}function i(e){return{...e,createElement:(t,r,...n)=>{let a=l(e,t,r??{});return e.createElement(a.type,a.props,...n)},cloneElement:(t,r,...n)=>{let a=e.cloneElement(t,r??void 0,...n),o=a.ref,i=l(e,a.type,{...a.props,ref:o});return i.type===a.type&&"string"!=typeof a.type?a:e.createElement(i.type,{...i.props,key:a.key})}}}r.d(t,{MA:()=>o,YJ:()=>i})},C(e,t,r){r.r(t);let n=(0,r("p").YJ)(window.React),{Children:a,Component:l,Fragment:o,Profiler:i,PureComponent:c,StrictMode:s,Suspense:u,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:f,act:d,cloneElement:m,createContext:p,createElement:h,createFactory:y,createRef:w,forwardRef:g,isValidElement:_,lazy:b,memo:S,startTransition:v,unstable_act:E,useCallback:R,useContext:C,useDebugValue:$,useDeferredValue:N,useEffect:M,useId:O,useImperativeHandle:k,useInsertionEffect:D,useLayoutEffect:T,useMemo:j,useReducer:A,useRef:x,useState:z,useSyncExternalStore:W,useTransition:I,version:P,use:L}=n;r.d(t,{},{Children:a,Component:l,Fragment:o,Profiler:i,PureComponent:c,StrictMode:s,Suspense:u,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:f,act:d,cloneElement:m,createContext:p,createElement:h,createFactory:y,createRef:w,default:n,forwardRef:g,isValidElement:_,lazy:b,memo:S,startTransition:v,unstable_act:E,use:L,useCallback:R,useContext:C,useDebugValue:$,useDeferredValue:N,useEffect:M,useId:O,useImperativeHandle:k,useInsertionEffect:D,useLayoutEffect:T,useMemo:j,useReducer:A,useRef:x,useState:z,useSyncExternalStore:W,useTransition:I,version:P})}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var l=t[n]={exports:{}};return e[n](l,l.exports,r),l.exports}r.d=(e,t,n)=>{var a=(t,n)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,[n]:t[a]})};a(t,"get"),a(n,"value")},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{let{jsx:e,jsxs:t,jsxDEV:n,Fragment:a}=(0,r("p").MA)(window.React);var l=r("vD");let o=window.WallarmDS.Icons.FilterX,i=window.WallarmDS.Icons.Settings,c=window.WallarmDS.Button,s=window.WallarmDS.Chart,u=window.WallarmDS.ChartActions,f=window.WallarmDS.ChartEmpty,d=window.WallarmDS.ChartHeader,m=window.WallarmDS.ChartTitle,p={title:"Data Display/SimpleCharts/Chart",component:s,subcomponents:{ChartHeader:d,ChartTitle:m,ChartActions:u,ChartEmpty:f},parameters:{layout:"padded",design:{type:"figma",url:"https://www.figma.com/design/VKb5gW46uSGw0rqrhZsbXT/WADS-Components?node-id=7470-917&m=dev"},docs:{description:{component:"The card every chart in the family sits in: the surface, the 32px title bar, and actions that appear on hover — it draws no data itself, so reach for `BarList`, `PieChart`, `LineChart`, `HorizontalBarStack` or `Metric` for the chart inside it. Worth knowing before composing one: `ChartActions` takes no layout space while hidden, so the title has the full header width until you hover."}}},tags:["autodocs"]};var h=r("C");let y=[{name:"Default",story:()=>{let r,n,a,p=(0,l.c)(3);return p[0]===Symbol.for("react.memo_cache_sentinel")?(r=e(m,{children:"Top 5 Endpoints"}),p[0]=r):r=p[0],p[1]===Symbol.for("react.memo_cache_sentinel")?(n=e(c,{variant:"ghost",color:"neutral",size:"small","aria-label":"Clear filter",children:e(o,{})}),p[1]=n):n=p[1],p[2]===Symbol.for("react.memo_cache_sentinel")?(a=e("div",{className:"w-400",children:t(s,{"data-testid":"chart",children:[t(d,{children:[r,t(u,{children:[n,e(c,{variant:"ghost",color:"neutral",size:"small","aria-label":"Settings",children:e(i,{})})]})]}),e(f,{children:"chart content"})]})}),p[2]=a):a=p[2],a},meta:p},{name:"WithAlwaysVisibleActions",story:()=>{let r,n,a,p=(0,l.c)(3);return p[0]===Symbol.for("react.memo_cache_sentinel")?(r=e(m,{children:"Top 5 Endpoints"}),p[0]=r):r=p[0],p[1]===Symbol.for("react.memo_cache_sentinel")?(n=e(c,{variant:"ghost",color:"neutral",size:"small","aria-label":"Clear filter",children:e(o,{})}),p[1]=n):n=p[1],p[2]===Symbol.for("react.memo_cache_sentinel")?(a=e("div",{className:"w-400",children:t(s,{"data-testid":"chart",children:[t(d,{children:[r,t(u,{alwaysVisible:!0,children:[n,e(c,{variant:"ghost",color:"neutral",size:"small","aria-label":"Settings",children:e(i,{})})]})]}),e(f,{children:"filtered chart content"})]})}),p[2]=a):a=p[2],a},meta:p},{name:"CustomSize",story:()=>{let r,n=(0,l.c)(1);return n[0]===Symbol.for("react.memo_cache_sentinel")?(r=t(s,{className:"w-640 h-320",children:[e(d,{children:e(m,{children:"Custom 640 × 320"})}),e(f,{children:"tall chart content"})]}),n[0]=r):r=n[0],r},meta:p},{name:"LongTitle",story:()=>{let r,n,a,p=(0,l.c)(3);return p[0]===Symbol.for("react.memo_cache_sentinel")?(r=e(m,{children:"A very long chart title that needs to be truncated so actions remain visible"}),p[0]=r):r=p[0],p[1]===Symbol.for("react.memo_cache_sentinel")?(n=e(c,{variant:"ghost",color:"neutral",size:"small","aria-label":"Clear filter",children:e(o,{})}),p[1]=n):n=p[1],p[2]===Symbol.for("react.memo_cache_sentinel")?(a=e("div",{className:"w-300",children:t(s,{children:[t(d,{children:[r,t(u,{children:[n,e(c,{variant:"ghost",color:"neutral",size:"small","aria-label":"Settings",children:e(i,{})})]})]}),e(f,{children:"chart content"})]})}),p[2]=a):a=p[2],a},meta:p},{name:"Empty",story:()=>{let r,n=(0,l.c)(1);return n[0]===Symbol.for("react.memo_cache_sentinel")?(r=e("div",{className:"w-400",children:t(s,{children:[e(d,{children:e(m,{children:"Top 5 Endpoints"})}),e(f,{})]})}),n[0]=r):r=n[0],r},meta:p},{name:"EmptyWithCustomMessage",story:()=>{let r,n=(0,l.c)(1);return n[0]===Symbol.for("react.memo_cache_sentinel")?(r=e("div",{className:"w-400",children:t(s,{children:[e(d,{children:e(m,{children:"Top 5 Endpoints"})}),e(f,{children:"No endpoints match the current filter"})]})}),n[0]=r):r=n[0],r},meta:p}];function w({entry:e}){let{story:t,meta:r}=e,n={...r.args,...t.args},a="function"==typeof t||t.$$typeof?t:t.render||r.render||r.component,l=()=>h.default.createElement(a,n),o={args:n,globals:{theme:"light"},parameters:{...r.parameters,...t.parameters},viewMode:"story"};for(let e of[...r.decorators||[],...t.decorators||[]].reverse()){let t=l;l=()=>e(t,o)}return h.default.createElement("section",{"data-preview-story":e.name,className:"p-16"},h.default.createElement("h2",{className:"text-sm mb-12"},e.name),h.default.createElement(l))}window.WallarmPreview={mount(e){let t=window.ReactDOM.createRoot(e);return t.render(h.default.createElement(window.WallarmDS.Root,null,y.map((e,t)=>h.default.createElement(w,{key:t,entry:e})))),t}}})();
|
|
12
|
+
*/var l,o,i=Object.create,c=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyNames,f=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty,p=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of u(t))d.call(e,a)||a===r||c(e,a,{get:()=>t[a],enumerable:!(n=s(t,a))||n.enumerable});return e},m={},h={$dispatcherGuard:()=>M,$makeReadOnly:()=>k,$reset:()=>O,$structuralCheck:()=>x,c:()=>E,clearRenderCounterRegistry:()=>T,renderCounterRegistry:()=>D,useRenderCounter:()=>j};for(var y in h)c(m,y,{get:h[y],enumerable:!0});e.exports=p(c({},"__esModule",{value:!0}),m);var w=(a=null!=(n=r("C"))?i(f(n)):{},p(n&&n.__esModule?a:c(a,"default",{value:n,enumerable:!0}),n)),{useRef:_,useEffect:b,isValidElement:g}=w,v=null!=(l=w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE)?l:w.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,S=Symbol.for("react.memo_cache_sentinel"),E="function"==typeof(null==(o=w.__COMPILER_RUNTIME)?void 0:o.c)?w.__COMPILER_RUNTIME.c:function(e){return w.useMemo(()=>{let t=Array(e);for(let r=0;r<e;r++)t[r]=S;return t[S]=!0,t},[])},R={};["readContext","useCallback","useContext","useEffect","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useReducer","useRef","useState","useDebugValue","useDeferredValue","useTransition","useMutableSource","useSyncExternalStore","useId","unstable_isNewReconciler","getCacheSignal","getCacheForType","useCacheRefresh"].forEach(e=>{R[e]=()=>{throw Error(`[React] Unexpected React hook call (${e}) from a React compiled function. Check that all hooks are called directly and named according to convention ('use[A-Z]') `)}});var C=null;function $(e){return v.ReactCurrentDispatcher.current=e,v.ReactCurrentDispatcher.current}R.useMemoCache=e=>{if(null!=C)return C.useMemoCache(e);throw Error("React Compiler internal invariant violation: unexpected null dispatcher")};var N=[];function M(e){let t=v.ReactCurrentDispatcher.current;if(0===e){if(N.push(t),1===N.length&&(C=t),t===R)throw Error("[React] Unexpected call to custom hook or component from a React compiled function. Check that (1) all hooks are called directly and named according to convention ('use[A-Z]') and (2) components are returned as JSX instead of being directly invoked.");$(R)}else if(1===e){let e=N.pop();if(null==e)throw Error("React Compiler internal error: unexpected null in guard stack");0===N.length&&(C=null),$(e)}else if(2===e)N.push(t),$(C);else if(3===e){let e=N.pop();if(null==e)throw Error("React Compiler internal error: unexpected null in guard stack");$(e)}else throw Error("React Compiler internal error: unreachable block"+e)}function O(e){for(let t=0;t<e.length;t++)e[t]=S}function k(){throw Error("TODO: implement $makeReadOnly in react-compiler-runtime")}var D=new Map;function T(){for(let e of D.values())e.forEach(e=>{e.count=0})}function j(e){let t=_(null);null!=t.current&&(t.current.count+=1),b(()=>{if(null==t.current){let r,n={count:0};null==(r=D.get(e))&&(r=new Set,D.set(e,r)),r.add(n),t.current=n}return()=>{var r;let n;null!==t.current&&(r=t.current,null!=(n=D.get(e))&&n.delete(r))}})}var A=new Set;function x(e,t,r,n,a,l){function o(e,t,o,i){let c=`${n}:${l} [${a}] ${r}${o} changed from ${e} to ${t} at depth ${i}`;A.has(c)||(A.add(c),console.error(c))}!function e(t,r,n,a){if(!(a>2)){if(t!==r)if(typeof t!=typeof r)o(`type ${typeof t}`,`type ${typeof r}`,n,a);else if("object"==typeof t){let l=Array.isArray(t),i=Array.isArray(r);if(null===t&&null!==r)o("null",`type ${typeof r}`,n,a);else if(null===r)o(`type ${typeof t}`,"null",n,a);else if(t instanceof Map)if(r instanceof Map)if(t.size!==r.size)o(`Map instance with size ${t.size}`,`Map instance with size ${r.size}`,n,a);else for(let[l,i]of t)r.has(l)?e(i,r.get(l),`${n}.get(${l})`,a+1):o(`Map instance with key ${l}`,`Map instance without key ${l}`,n,a);else o("Map instance","other value",n,a);else if(r instanceof Map)o("other value","Map instance",n,a);else if(t instanceof Set)if(r instanceof Set)if(t.size!==r.size)o(`Set instance with size ${t.size}`,`Set instance with size ${r.size}`,n,a);else for(let e of r)t.has(e)||o(`Set instance without element ${e}`,`Set instance with element ${e}`,n,a);else o("Set instance","other value",n,a);else if(r instanceof Set)o("other value","Set instance",n,a);else if(l||i)if(l!==i)o(`type ${l?"array":"object"}`,`type ${i?"array":"object"}`,n,a);else if(t.length!==r.length)o(`array with length ${t.length}`,`array with length ${r.length}`,n,a);else for(let l=0;l<t.length;l++)e(t[l],r[l],`${n}[${l}]`,a+1);else if(g(t)||g(r))g(t)!==g(r)?o(`type ${g(t)?"React element":"object"}`,`type ${g(r)?"React element":"object"}`,n,a):t.type!==r.type?o(`React element of type ${t.type}`,`React element of type ${r.type}`,n,a):e(t.props,r.props,`[props of ${n}]`,a+1);else{for(let e in r)e in t||o(`object without key ${e}`,`object with key ${e}`,n,a);for(let l in t)l in r?e(t[l],r[l],`${n}.${l}`,a+1):o(`object with key ${l}`,`object without key ${l}`,n,a)}}else{if("function"==typeof t)return;isNaN(t)||isNaN(r)?isNaN(t)!==isNaN(r)&&o(`${isNaN(t)?"NaN":"non-NaN value"}`,`${isNaN(r)?"NaN":"non-NaN value"}`,n,a):t!==r&&o(t,r,n,a)}}}(e,t,"",0)}},p(e,t,r){let n=new WeakMap,a=new WeakMap;function l(e,t,r){let l=t,o=r;if("object"==typeof l&&null!==l&&"$$typeof"in l&&l.$$typeof===Symbol.for("react.context")&&"Provider"in l&&(l=l.Provider),"function"==typeof l&&null!=o.ref&&!l.prototype?.isReactComponent){let t=l,r=n.get(e);r||(r=new WeakMap,n.set(e,r));let a=r.get(t);a||((a=e.forwardRef((e,r)=>t({...e,ref:r}))).displayName=t.displayName??t.name,r.set(t,a)),l=a}if("string"==typeof l&&"boolean"==typeof o.inert&&((o={...o}).inert?o.inert="":delete o.inert),"string"==typeof l)for(let[e,t]of[["fill-rule","fillRule"],["clip-rule","clipRule"]])e in o&&(o={...o,[t]:o[e]},delete o[e]);return"string"==typeof l&&null!=o.ref&&(l=function(e,t){let r=a.get(e);r||(r=new Map,a.set(e,r));let n=r.get(t);if(n)return n;let l=e.forwardRef((r,n)=>{let a=e.useRef(null);if(!a.current||a.current.original!==n){let e;a.current={original:n,callback:t=>{if(null==t&&e){let t=e;e=void 0,t();return}if("function"==typeof n){let r=n(t);e="function"==typeof r?r:void 0}else n&&(n.current=t)}}}return e.createElement(t,{...r,ref:a.current.callback})});return l.displayName=`CanvasHost(${t})`,r.set(t,l),l}(e,l)),{type:l,props:o}}function o(e){let t=(t,r,n)=>{let a=l(e,t,r??{});return e.createElement(a.type,void 0===n?a.props:{...a.props,key:n})};return{jsx:t,jsxs:(t,r,n)=>{let a=l(e,t,r??{}),{children:o,...i}=a.props;return e.createElement(a.type,void 0===n?i:{...i,key:n},...Array.isArray(o)?o:[o])},jsxDEV:t,Fragment:e.Fragment}}function i(e){return{...e,createElement:(t,r,...n)=>{let a=l(e,t,r??{});return e.createElement(a.type,a.props,...n)},cloneElement:(t,r,...n)=>{let a=e.cloneElement(t,r??void 0,...n),o=a.ref,i=l(e,a.type,{...a.props,ref:o});return i.type===a.type&&"string"!=typeof a.type?a:e.createElement(i.type,{...i.props,key:a.key})}}}r.d(t,{MA:()=>o,YJ:()=>i})},C(e,t,r){r.r(t);let n=(0,r("p").YJ)(window.React),{Children:a,Component:l,Fragment:o,Profiler:i,PureComponent:c,StrictMode:s,Suspense:u,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:f,act:d,cloneElement:p,createContext:m,createElement:h,createFactory:y,createRef:w,forwardRef:_,isValidElement:b,lazy:g,memo:v,startTransition:S,unstable_act:E,useCallback:R,useContext:C,useDebugValue:$,useDeferredValue:N,useEffect:M,useId:O,useImperativeHandle:k,useInsertionEffect:D,useLayoutEffect:T,useMemo:j,useReducer:A,useRef:x,useState:z,useSyncExternalStore:I,useTransition:W,version:P,use:L}=n;r.d(t,{},{Children:a,Component:l,Fragment:o,Profiler:i,PureComponent:c,StrictMode:s,Suspense:u,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:f,act:d,cloneElement:p,createContext:m,createElement:h,createFactory:y,createRef:w,default:n,forwardRef:_,isValidElement:b,lazy:g,memo:v,startTransition:S,unstable_act:E,use:L,useCallback:R,useContext:C,useDebugValue:$,useDeferredValue:N,useEffect:M,useId:O,useImperativeHandle:k,useInsertionEffect:D,useLayoutEffect:T,useMemo:j,useReducer:A,useRef:x,useState:z,useSyncExternalStore:I,useTransition:W,version:P})}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var l=t[n]={exports:{}};return e[n](l,l.exports,r),l.exports}r.d=(e,t,n)=>{var a=(t,n)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,[n]:t[a]})};a(t,"get"),a(n,"value")},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{let{jsx:e,jsxs:t,jsxDEV:n,Fragment:a}=(0,r("p").MA)(window.React);var l=r("vD");let o=window.WallarmDS.Icons.FilterX,i=window.WallarmDS.Icons.Settings,c=window.WallarmDS.Button,s=window.WallarmDS.Chart,u=window.WallarmDS.ChartActions,f=window.WallarmDS.ChartEmpty,d=window.WallarmDS.ChartHeader,p=window.WallarmDS.ChartTitle,m={title:"Data Display/SimpleCharts/Chart",component:s,subcomponents:{ChartHeader:d,ChartTitle:p,ChartActions:u,ChartEmpty:f},parameters:{layout:"padded",docs:{description:{component:"The card every chart in the family sits in: the surface, the 32px title bar, and actions that appear on hover — it draws no data itself, so reach for `BarList`, `PieChart`, `LineChart`, `HorizontalBarStack` or `Metric` for the chart inside it. Worth knowing before composing one: `ChartActions` takes no layout space while hidden, so the title has the full header width until you hover."}}},tags:["autodocs"]};var h=r("C");let y=[{name:"Default",story:()=>{let r,n,a,m=(0,l.c)(3);return m[0]===Symbol.for("react.memo_cache_sentinel")?(r=e(p,{children:"Top 5 Endpoints"}),m[0]=r):r=m[0],m[1]===Symbol.for("react.memo_cache_sentinel")?(n=e(c,{variant:"ghost",color:"neutral",size:"small","aria-label":"Clear filter",children:e(o,{})}),m[1]=n):n=m[1],m[2]===Symbol.for("react.memo_cache_sentinel")?(a=e("div",{className:"w-400",children:t(s,{"data-testid":"chart",children:[t(d,{children:[r,t(u,{children:[n,e(c,{variant:"ghost",color:"neutral",size:"small","aria-label":"Settings",children:e(i,{})})]})]}),e(f,{children:"chart content"})]})}),m[2]=a):a=m[2],a},meta:m},{name:"WithAlwaysVisibleActions",story:()=>{let r,n,a,m=(0,l.c)(3);return m[0]===Symbol.for("react.memo_cache_sentinel")?(r=e(p,{children:"Top 5 Endpoints"}),m[0]=r):r=m[0],m[1]===Symbol.for("react.memo_cache_sentinel")?(n=e(c,{variant:"ghost",color:"neutral",size:"small","aria-label":"Clear filter",children:e(o,{})}),m[1]=n):n=m[1],m[2]===Symbol.for("react.memo_cache_sentinel")?(a=e("div",{className:"w-400",children:t(s,{"data-testid":"chart",children:[t(d,{children:[r,t(u,{alwaysVisible:!0,children:[n,e(c,{variant:"ghost",color:"neutral",size:"small","aria-label":"Settings",children:e(i,{})})]})]}),e(f,{children:"filtered chart content"})]})}),m[2]=a):a=m[2],a},meta:m},{name:"CustomSize",story:()=>{let r,n=(0,l.c)(1);return n[0]===Symbol.for("react.memo_cache_sentinel")?(r=t(s,{className:"w-640 h-320",children:[e(d,{children:e(p,{children:"Custom 640 × 320"})}),e(f,{children:"tall chart content"})]}),n[0]=r):r=n[0],r},meta:m},{name:"LongTitle",story:()=>{let r,n,a,m=(0,l.c)(3);return m[0]===Symbol.for("react.memo_cache_sentinel")?(r=e(p,{children:"A very long chart title that needs to be truncated so actions remain visible"}),m[0]=r):r=m[0],m[1]===Symbol.for("react.memo_cache_sentinel")?(n=e(c,{variant:"ghost",color:"neutral",size:"small","aria-label":"Clear filter",children:e(o,{})}),m[1]=n):n=m[1],m[2]===Symbol.for("react.memo_cache_sentinel")?(a=e("div",{className:"w-300",children:t(s,{children:[t(d,{children:[r,t(u,{children:[n,e(c,{variant:"ghost",color:"neutral",size:"small","aria-label":"Settings",children:e(i,{})})]})]}),e(f,{children:"chart content"})]})}),m[2]=a):a=m[2],a},meta:m},{name:"Empty",story:()=>{let r,n=(0,l.c)(1);return n[0]===Symbol.for("react.memo_cache_sentinel")?(r=e("div",{className:"w-400",children:t(s,{children:[e(d,{children:e(p,{children:"Top 5 Endpoints"})}),e(f,{})]})}),n[0]=r):r=n[0],r},meta:m},{name:"EmptyWithCustomMessage",story:()=>{let r,n=(0,l.c)(1);return n[0]===Symbol.for("react.memo_cache_sentinel")?(r=e("div",{className:"w-400",children:t(s,{children:[e(d,{children:e(p,{children:"Top 5 Endpoints"})}),e(f,{children:"No endpoints match the current filter"})]})}),n[0]=r):r=n[0],r},meta:m}];function w({entry:e}){let{story:t,meta:r}=e,n={...r.args,...t.args},a="function"==typeof t||t.$$typeof?t:t.render||r.render||r.component,l=()=>h.default.createElement(a,n),o={args:n,globals:{theme:"light"},parameters:{...r.parameters,...t.parameters},viewMode:"story"};for(let e of[...r.decorators||[],...t.decorators||[]].reverse()){let t=l;l=()=>e(t,o)}return h.default.createElement("section",{"data-preview-story":e.name,className:"p-16"},h.default.createElement("h2",{className:"text-sm mb-12"},e.name),h.default.createElement(l))}window.WallarmPreview={mount(e){let t=window.ReactDOM.createRoot(e);return t.render(h.default.createElement(window.WallarmDS.Root,null,y.map((e,t)=>h.default.createElement(w,{key:t,entry:e})))),t}}})();
|
|
@@ -9,7 +9,7 @@ var e={vD(e,t,a){let n,r;/**
|
|
|
9
9
|
* @nolint
|
|
10
10
|
* @preventMunge
|
|
11
11
|
* @preserve-invariant-messages
|
|
12
|
-
*/var l,o,i=Object.create,s=Object.defineProperty,c=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,m=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,p=(e,t,a,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of d(t))u.call(e,r)||r===a||s(e,r,{get:()=>t[r],enumerable:!(n=c(t,r))||n.enumerable});return e},h={},f={$dispatcherGuard:()=>R,$makeReadOnly:()=>W,$reset:()=>E,$structuralCheck:()=>I,c:()=>C,clearRenderCounterRegistry:()=>A,renderCounterRegistry:()=>O,useRenderCounter:()=>P};for(var y in f)s(h,y,{get:f[y],enumerable:!0});e.exports=p(s({},"__esModule",{value:!0}),h);var g=(r=null!=(n=a("C"))?i(m(n)):{},p(n&&n.__esModule?r:s(r,"default",{value:n,enumerable:!0}),n)),{useRef:b,useEffect:w,isValidElement:S}=g,_=null!=(l=g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE)?l:g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,v=Symbol.for("react.memo_cache_sentinel"),C="function"==typeof(null==(o=g.__COMPILER_RUNTIME)?void 0:o.c)?g.__COMPILER_RUNTIME.c:function(e){return g.useMemo(()=>{let t=Array(e);for(let a=0;a<e;a++)t[a]=v;return t[v]=!0,t},[])},N={};["readContext","useCallback","useContext","useEffect","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useReducer","useRef","useState","useDebugValue","useDeferredValue","useTransition","useMutableSource","useSyncExternalStore","useId","unstable_isNewReconciler","getCacheSignal","getCacheForType","useCacheRefresh"].forEach(e=>{N[e]=()=>{throw Error(`[React] Unexpected React hook call (${e}) from a React compiled function. Check that all hooks are called directly and named according to convention ('use[A-Z]') `)}});var T=null;function x(e){return _.ReactCurrentDispatcher.current=e,_.ReactCurrentDispatcher.current}N.useMemoCache=e=>{if(null!=T)return T.useMemoCache(e);throw Error("React Compiler internal invariant violation: unexpected null dispatcher")};var D=[];function R(e){let t=_.ReactCurrentDispatcher.current;if(0===e){if(D.push(t),1===D.length&&(T=t),t===N)throw Error("[React] Unexpected call to custom hook or component from a React compiled function. Check that (1) all hooks are called directly and named according to convention ('use[A-Z]') and (2) components are returned as JSX instead of being directly invoked.");x(N)}else if(1===e){let e=D.pop();if(null==e)throw Error("React Compiler internal error: unexpected null in guard stack");0===D.length&&(T=null),x(e)}else if(2===e)D.push(t),x(T);else if(3===e){let e=D.pop();if(null==e)throw Error("React Compiler internal error: unexpected null in guard stack");x(e)}else throw Error("React Compiler internal error: unreachable block"+e)}function E(e){for(let t=0;t<e.length;t++)e[t]=v}function W(){throw Error("TODO: implement $makeReadOnly in react-compiler-runtime")}var O=new Map;function A(){for(let e of O.values())e.forEach(e=>{e.count=0})}function P(e){let t=b(null);null!=t.current&&(t.current.count+=1),w(()=>{if(null==t.current){let a,n={count:0};null==(a=O.get(e))&&(a=new Set,O.set(e,a)),a.add(n),t.current=n}return()=>{var a;let n;null!==t.current&&(a=t.current,null!=(n=O.get(e))&&n.delete(a))}})}var L=new Set;function I(e,t,a,n,r,l){function o(e,t,o,i){let s=`${n}:${l} [${r}] ${a}${o} changed from ${e} to ${t} at depth ${i}`;L.has(s)||(L.add(s),console.error(s))}!function e(t,a,n,r){if(!(r>2)){if(t!==a)if(typeof t!=typeof a)o(`type ${typeof t}`,`type ${typeof a}`,n,r);else if("object"==typeof t){let l=Array.isArray(t),i=Array.isArray(a);if(null===t&&null!==a)o("null",`type ${typeof a}`,n,r);else if(null===a)o(`type ${typeof t}`,"null",n,r);else if(t instanceof Map)if(a instanceof Map)if(t.size!==a.size)o(`Map instance with size ${t.size}`,`Map instance with size ${a.size}`,n,r);else for(let[l,i]of t)a.has(l)?e(i,a.get(l),`${n}.get(${l})`,r+1):o(`Map instance with key ${l}`,`Map instance without key ${l}`,n,r);else o("Map instance","other value",n,r);else if(a instanceof Map)o("other value","Map instance",n,r);else if(t instanceof Set)if(a instanceof Set)if(t.size!==a.size)o(`Set instance with size ${t.size}`,`Set instance with size ${a.size}`,n,r);else for(let e of a)t.has(e)||o(`Set instance without element ${e}`,`Set instance with element ${e}`,n,r);else o("Set instance","other value",n,r);else if(a instanceof Set)o("other value","Set instance",n,r);else if(l||i)if(l!==i)o(`type ${l?"array":"object"}`,`type ${i?"array":"object"}`,n,r);else if(t.length!==a.length)o(`array with length ${t.length}`,`array with length ${a.length}`,n,r);else for(let l=0;l<t.length;l++)e(t[l],a[l],`${n}[${l}]`,r+1);else if(S(t)||S(a))S(t)!==S(a)?o(`type ${S(t)?"React element":"object"}`,`type ${S(a)?"React element":"object"}`,n,r):t.type!==a.type?o(`React element of type ${t.type}`,`React element of type ${a.type}`,n,r):e(t.props,a.props,`[props of ${n}]`,r+1);else{for(let e in a)e in t||o(`object without key ${e}`,`object with key ${e}`,n,r);for(let l in t)l in a?e(t[l],a[l],`${n}.${l}`,r+1):o(`object with key ${l}`,`object without key ${l}`,n,r)}}else{if("function"==typeof t)return;isNaN(t)||isNaN(a)?isNaN(t)!==isNaN(a)&&o(`${isNaN(t)?"NaN":"non-NaN value"}`,`${isNaN(a)?"NaN":"non-NaN value"}`,n,r):t!==a&&o(t,a,n,r)}}}(e,t,"",0)}},p(e,t,a){let n=new WeakMap,r=new WeakMap;function l(e,t,a){let l=t,o=a;if("object"==typeof l&&null!==l&&"$$typeof"in l&&l.$$typeof===Symbol.for("react.context")&&"Provider"in l&&(l=l.Provider),"function"==typeof l&&null!=o.ref&&!l.prototype?.isReactComponent){let t=l,a=n.get(e);a||(a=new WeakMap,n.set(e,a));let r=a.get(t);r||((r=e.forwardRef((e,a)=>t({...e,ref:a}))).displayName=t.displayName??t.name,a.set(t,r)),l=r}if("string"==typeof l&&"boolean"==typeof o.inert&&((o={...o}).inert?o.inert="":delete o.inert),"string"==typeof l)for(let[e,t]of[["fill-rule","fillRule"],["clip-rule","clipRule"]])e in o&&(o={...o,[t]:o[e]},delete o[e]);return"string"==typeof l&&null!=o.ref&&(l=function(e,t){let a=r.get(e);a||(a=new Map,r.set(e,a));let n=a.get(t);if(n)return n;let l=e.forwardRef((a,n)=>{let r=e.useRef(null);if(!r.current||r.current.original!==n){let e;r.current={original:n,callback:t=>{if(null==t&&e){let t=e;e=void 0,t();return}if("function"==typeof n){let a=n(t);e="function"==typeof a?a:void 0}else n&&(n.current=t)}}}return e.createElement(t,{...a,ref:r.current.callback})});return l.displayName=`CanvasHost(${t})`,a.set(t,l),l}(e,l)),{type:l,props:o}}function o(e){let t=(t,a,n)=>{let r=l(e,t,a??{});return e.createElement(r.type,void 0===n?r.props:{...r.props,key:n})};return{jsx:t,jsxs:(t,a,n)=>{let r=l(e,t,a??{}),{children:o,...i}=r.props;return e.createElement(r.type,void 0===n?i:{...i,key:n},...Array.isArray(o)?o:[o])},jsxDEV:t,Fragment:e.Fragment}}function i(e){return{...e,createElement:(t,a,...n)=>{let r=l(e,t,a??{});return e.createElement(r.type,r.props,...n)},cloneElement:(t,a,...n)=>{let r=e.cloneElement(t,a??void 0,...n),o=r.ref,i=l(e,r.type,{...r.props,ref:o});return i.type===r.type&&"string"!=typeof r.type?r:e.createElement(i.type,{...i.props,key:r.key})}}}a.d(t,{MA:()=>o,YJ:()=>i})},C(e,t,a){a.r(t);let n=(0,a("p").YJ)(window.React),{Children:r,Component:l,Fragment:o,Profiler:i,PureComponent:s,StrictMode:c,Suspense:d,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:m,act:u,cloneElement:p,createContext:h,createElement:f,createFactory:y,createRef:g,forwardRef:b,isValidElement:w,lazy:S,memo:_,startTransition:v,unstable_act:C,useCallback:N,useContext:T,useDebugValue:x,useDeferredValue:D,useEffect:R,useId:E,useImperativeHandle:W,useInsertionEffect:O,useLayoutEffect:A,useMemo:P,useReducer:L,useRef:I,useState:k,useSyncExternalStore:$,useTransition:H,version:j,use:M}=n;a.d(t,{},{Children:r,Component:l,Fragment:o,Profiler:i,PureComponent:s,StrictMode:c,Suspense:d,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:m,act:u,cloneElement:p,createContext:h,createElement:f,createFactory:y,createRef:g,default:n,forwardRef:b,isValidElement:w,lazy:S,memo:_,startTransition:v,unstable_act:C,use:M,useCallback:N,useContext:T,useDebugValue:x,useDeferredValue:D,useEffect:R,useId:E,useImperativeHandle:W,useInsertionEffect:O,useLayoutEffect:A,useMemo:P,useReducer:L,useRef:I,useState:k,useSyncExternalStore:$,useTransition:H,version:j})}},t={};function a(n){var r=t[n];if(void 0!==r)return r.exports;var l=t[n]={exports:{}};return e[n](l,l.exports,a),l.exports}a.d=(e,t,n)=>{var r=(t,n)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,[n]:t[r]})};r(t,"get"),r(n,"value")},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{let{jsx:e,jsxs:t,jsxDEV:n,Fragment:r}=(0,a("p").MA)(window.React);var l=a("vD"),o=a("C");let i=window.WallarmDS.getHttpFolds,s={type:"object",required:["name","env"],properties:{name:{type:"string",title:"Rule name"},env:{enum:["staging","production"],description:"Where the rule is deployed."},retries:{type:"integer",minimum:0,maximum:5,description:"How many times a failed check is retried."},description:{type:"string"}}},c=(e,{startingLineNumber:t})=>i(e,{startingLineNumber:t}),d={request:'{\n "action": "block",\n "path": "/login"\n}',response:'{\n "status": 403,\n "reason": "blocked"\n}'},m=["{",' "events": [',...Array.from({length:1996},(e,t)=>{let a=t+1;return` { "id": ${a}, "method": "GET", "path": "/api/v1/items/${a}", "status": ${a%7==0?403:200} }${1996===a?"":","}`})," ]","}"].join("\n"),u=window.WallarmDS.CodeSnippetActions,p=window.WallarmDS.CodeSnippetCopyButton,h=window.WallarmDS.CodeSnippetFullscreenButton,f=window.WallarmDS.CodeSnippetHeader,y=window.WallarmDS.CodeSnippetTitle,g=window.WallarmDS.CodeSnippetWrapButton,b=window.WallarmDS.CodeEditorContent,w=window.WallarmDS.CodeEditorRoot,S=window.WallarmDS.CODE_EDITOR_KEYBOARD_HINT,_="code-editor-editing-workflow-hint",v=()=>{let a,n,r,i,d,m,v=(0,l.c)(8),[C,N]=(0,o.useState)('POST /api/v1/rules HTTP/1.1\nHost: api.wallarm.example\nContent-Type: application/json\nX-Env: staging\n\n{\n "name": "Block scanners",\n "env": "staging",\n "retries": 9,\n "description": "Blocks requests from known vulnerability scanners on every public endpoint of the API gateway, including the legacy routes kept only for older mobile clients"\n}');return v[0]===Symbol.for("react.memo_cache_sentinel")?(a=e(y,{children:"Request"}),v[0]=a):a=v[0],v[1]===Symbol.for("react.memo_cache_sentinel")?(n=t(f,{children:[a,t(u,{children:[e(h,{}),e(g,{}),e(p,{})]})]}),r=e(b,{lineNumbers:!0,"aria-label":"HTTP request","aria-describedby":_}),v[1]=n,v[2]=r):(n=v[1],r=v[2]),v[3]!==C?(i=t(w,{value:C,onChange:N,language:"http",folds:c,schema:s,"data-testid":"editing",children:[n,r]}),v[3]=C,v[4]=i):i=v[4],v[5]===Symbol.for("react.memo_cache_sentinel")?(d=e("span",{id:_,className:"sr-only",children:S}),v[5]=d):d=v[5],v[6]!==i?(m=t("div",{className:"w-640",children:[i,d]}),v[6]=i,v[7]=m):m=v[7],m};v.displayName="EditingWorkflowDemo";let C=window.WallarmDS.CodeEditorContent,N=window.WallarmDS.CodeEditorRoot,T=()=>{let t,a=(0,l.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=e("div",{className:"w-640",children:e(N,{defaultValue:m,readOnly:!0,language:"json",maxLines:12,"data-testid":"long-document",children:e(C,{lineNumbers:!0,"aria-label":"Access log"})})}),a[0]=t):t=a[0],t};T.displayName="LongDocumentDemo";let x=window.WallarmDS.CodeSnippetHeader,D=window.WallarmDS.CodeSnippetTab,R=window.WallarmDS.CodeSnippetTabs,E=window.WallarmDS.CodeEditorContent,W=window.WallarmDS.CodeEditorRoot,O=()=>{let a,n,r,i,s,c,m,u=(0,l.c)(13),[p,h]=(0,o.useState)("request"),[f,y]=(0,o.useState)(d),g=f[p];return u[0]!==p?(a=e=>y(t=>({...t,[p]:e})),u[0]=p,u[1]=a):a=u[1],u[2]===Symbol.for("react.memo_cache_sentinel")?(n=e=>{("request"===e||"response"===e)&&h(e)},r=e(D,{value:"request","data-testid":"tabs-editor--tab-request",children:"Request"}),i=e(D,{value:"response","data-testid":"tabs-editor--tab-response",children:"Response"}),u[2]=n,u[3]=r,u[4]=i):(n=u[2],r=u[3],i=u[4]),u[5]!==p?(s=e(x,{children:t(R,{value:p,onValueChange:n,children:[r,i]})}),u[5]=p,u[6]=s):s=u[6],u[7]===Symbol.for("react.memo_cache_sentinel")?(c=e(E,{lineNumbers:!0,"aria-label":"Rule check payload"}),u[7]=c):c=u[7],u[8]!==g||u[9]!==a||u[10]!==s||u[11]!==p?(m=e("div",{className:"w-480",children:t(W,{documentId:p,value:g,onChange:a,language:"json","data-testid":"tabs-editor",children:[s,c]})}),u[8]=g,u[9]=a,u[10]=s,u[11]=p,u[12]=m):m=u[12],m};O.displayName="TabsKeepHistoryDemo";let A=window.WallarmDS.Icons.Info,P=window.WallarmDS.Icons.Skull,L=window.WallarmDS.Icons.TriangleAlert,I=window.WallarmDS.Button,k=window.WallarmDS.CodeSnippetActions,$=window.WallarmDS.CodeSnippetAdapterProvider,H=window.WallarmDS.CodeSnippetCode,j=window.WallarmDS.CodeSnippetContent,M=window.WallarmDS.CodeSnippetCopyButton,q=window.WallarmDS.CodeSnippetFullscreenButton,z=window.WallarmDS.CodeSnippetHeader,V=window.WallarmDS.CodeSnippetLineNumbers,F=window.WallarmDS.CodeSnippetRoot,U=window.WallarmDS.CodeSnippetShowMoreButton,B=window.WallarmDS.CodeSnippetTab,J=window.WallarmDS.CodeSnippetTabs,X=window.WallarmDS.CodeSnippetTitle,G=window.WallarmDS.CodeSnippetWrapButton,Y=window.WallarmDS.getHttpFolds,K=window.WallarmDS.loadPrismAdapter;window.WallarmDS.loadShikiAdapter;let Z=window.WallarmDS.Drawer,Q=window.WallarmDS.DrawerBody,ee=window.WallarmDS.DrawerContent,et=window.WallarmDS.DrawerHeader,ea=window.WallarmDS.DrawerTitle,en=window.WallarmDS.DrawerTrigger,er=window.WallarmDS.VStack,el=window.WallarmDS.Tooltip,eo=window.WallarmDS.TooltipContent,ei=window.WallarmDS.TooltipTrigger,es=window.WallarmDS.CodeEditorContent,ec=window.WallarmDS.CodeEditorRoot,ed={title:"Data Display/CodeEditor",component:ec,parameters:{layout:"padded",docs:{description:{component:"An editable code surface that is visually the same component as `CodeSnippet` and reuses its header, tabs, actions and show-more — reach for `CodeSnippet` whenever the code is only read, since a page that never renders `CodeEditorContent` never loads the editor engine. Colours come from the same `CodeSnippetAdapterProvider` (plain text without one), so a read-only editor matches the snippet except for a native thin scrollbar, a caret and selection drawn by the editor, and an HTTP JSON body that stays coloured when `Content-Type` has parameters or the body has blank lines. The adapter re-tokenizes the whole document after each pause in typing, which stays within a frame up to about 2 000 lines with Prism; longer documents still edit smoothly, their colours just settle a moment later. Like the snippet, the editor sits inside a `display: contents` wrapper that keeps it mounted across fullscreen, so space editors with their own `className` (for example `mt-16`) or a `gap` on the parent — not `space-*`, `divide-*` or child selectors on the parent. `lines`, `folds`, `completions` and `schema` are compared by identity, so memoise them or hoist them to module constants — a new value on every render reconfigures the editor. Autocomplete suggests language keywords and words already in the document for every language; HTTP methods and headers and JSON Schema values have their own contextual suggestions. Pass `completions` to add application-specific results. Syntax errors are best-effort: JSON reports the `JSON.parse` message, JavaScript and TypeScript use Babel, Lua uses luaparse (first error only), YAML and Python use their Lezer parsers, which still flag a few valid Python forms such as `lambda a, /, b` and parenthesised `with` items. `lines` and `folds` stay on their line numbers while typing; to keep a decoration on a piece of text, recompute it from `value` (for example `useMemo(() => linesFor(value), [value])`, or a `folds` function such as `getHttpFolds`). The editor injects `<style>` tags, so under a strict Content Security Policy pass `cspNonce`. Tab indents, so keyboard users leave with Escape, then Tab, or press Ctrl+M (Alt+Shift+M on macOS) to switch Tab between indenting and moving focus — point `aria-describedby` at text holding `CODE_EDITOR_KEYBOARD_HINT` to tell screen-reader users."}},design:{type:"figma",url:"https://www.figma.com/design/VKb5gW46uSGw0rqrhZsbXT/WADS-Components?node-id=3087-29516&m=dev"}},tags:["autodocs"]},em=`{
|
|
12
|
+
*/var l,o,i=Object.create,s=Object.defineProperty,c=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,m=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,p=(e,t,a,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of d(t))u.call(e,r)||r===a||s(e,r,{get:()=>t[r],enumerable:!(n=c(t,r))||n.enumerable});return e},h={},f={$dispatcherGuard:()=>R,$makeReadOnly:()=>W,$reset:()=>E,$structuralCheck:()=>I,c:()=>C,clearRenderCounterRegistry:()=>A,renderCounterRegistry:()=>O,useRenderCounter:()=>P};for(var y in f)s(h,y,{get:f[y],enumerable:!0});e.exports=p(s({},"__esModule",{value:!0}),h);var g=(r=null!=(n=a("C"))?i(m(n)):{},p(n&&n.__esModule?r:s(r,"default",{value:n,enumerable:!0}),n)),{useRef:b,useEffect:w,isValidElement:S}=g,_=null!=(l=g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE)?l:g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,v=Symbol.for("react.memo_cache_sentinel"),C="function"==typeof(null==(o=g.__COMPILER_RUNTIME)?void 0:o.c)?g.__COMPILER_RUNTIME.c:function(e){return g.useMemo(()=>{let t=Array(e);for(let a=0;a<e;a++)t[a]=v;return t[v]=!0,t},[])},N={};["readContext","useCallback","useContext","useEffect","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useReducer","useRef","useState","useDebugValue","useDeferredValue","useTransition","useMutableSource","useSyncExternalStore","useId","unstable_isNewReconciler","getCacheSignal","getCacheForType","useCacheRefresh"].forEach(e=>{N[e]=()=>{throw Error(`[React] Unexpected React hook call (${e}) from a React compiled function. Check that all hooks are called directly and named according to convention ('use[A-Z]') `)}});var x=null;function T(e){return _.ReactCurrentDispatcher.current=e,_.ReactCurrentDispatcher.current}N.useMemoCache=e=>{if(null!=x)return x.useMemoCache(e);throw Error("React Compiler internal invariant violation: unexpected null dispatcher")};var D=[];function R(e){let t=_.ReactCurrentDispatcher.current;if(0===e){if(D.push(t),1===D.length&&(x=t),t===N)throw Error("[React] Unexpected call to custom hook or component from a React compiled function. Check that (1) all hooks are called directly and named according to convention ('use[A-Z]') and (2) components are returned as JSX instead of being directly invoked.");T(N)}else if(1===e){let e=D.pop();if(null==e)throw Error("React Compiler internal error: unexpected null in guard stack");0===D.length&&(x=null),T(e)}else if(2===e)D.push(t),T(x);else if(3===e){let e=D.pop();if(null==e)throw Error("React Compiler internal error: unexpected null in guard stack");T(e)}else throw Error("React Compiler internal error: unreachable block"+e)}function E(e){for(let t=0;t<e.length;t++)e[t]=v}function W(){throw Error("TODO: implement $makeReadOnly in react-compiler-runtime")}var O=new Map;function A(){for(let e of O.values())e.forEach(e=>{e.count=0})}function P(e){let t=b(null);null!=t.current&&(t.current.count+=1),w(()=>{if(null==t.current){let a,n={count:0};null==(a=O.get(e))&&(a=new Set,O.set(e,a)),a.add(n),t.current=n}return()=>{var a;let n;null!==t.current&&(a=t.current,null!=(n=O.get(e))&&n.delete(a))}})}var L=new Set;function I(e,t,a,n,r,l){function o(e,t,o,i){let s=`${n}:${l} [${r}] ${a}${o} changed from ${e} to ${t} at depth ${i}`;L.has(s)||(L.add(s),console.error(s))}!function e(t,a,n,r){if(!(r>2)){if(t!==a)if(typeof t!=typeof a)o(`type ${typeof t}`,`type ${typeof a}`,n,r);else if("object"==typeof t){let l=Array.isArray(t),i=Array.isArray(a);if(null===t&&null!==a)o("null",`type ${typeof a}`,n,r);else if(null===a)o(`type ${typeof t}`,"null",n,r);else if(t instanceof Map)if(a instanceof Map)if(t.size!==a.size)o(`Map instance with size ${t.size}`,`Map instance with size ${a.size}`,n,r);else for(let[l,i]of t)a.has(l)?e(i,a.get(l),`${n}.get(${l})`,r+1):o(`Map instance with key ${l}`,`Map instance without key ${l}`,n,r);else o("Map instance","other value",n,r);else if(a instanceof Map)o("other value","Map instance",n,r);else if(t instanceof Set)if(a instanceof Set)if(t.size!==a.size)o(`Set instance with size ${t.size}`,`Set instance with size ${a.size}`,n,r);else for(let e of a)t.has(e)||o(`Set instance without element ${e}`,`Set instance with element ${e}`,n,r);else o("Set instance","other value",n,r);else if(a instanceof Set)o("other value","Set instance",n,r);else if(l||i)if(l!==i)o(`type ${l?"array":"object"}`,`type ${i?"array":"object"}`,n,r);else if(t.length!==a.length)o(`array with length ${t.length}`,`array with length ${a.length}`,n,r);else for(let l=0;l<t.length;l++)e(t[l],a[l],`${n}[${l}]`,r+1);else if(S(t)||S(a))S(t)!==S(a)?o(`type ${S(t)?"React element":"object"}`,`type ${S(a)?"React element":"object"}`,n,r):t.type!==a.type?o(`React element of type ${t.type}`,`React element of type ${a.type}`,n,r):e(t.props,a.props,`[props of ${n}]`,r+1);else{for(let e in a)e in t||o(`object without key ${e}`,`object with key ${e}`,n,r);for(let l in t)l in a?e(t[l],a[l],`${n}.${l}`,r+1):o(`object with key ${l}`,`object without key ${l}`,n,r)}}else{if("function"==typeof t)return;isNaN(t)||isNaN(a)?isNaN(t)!==isNaN(a)&&o(`${isNaN(t)?"NaN":"non-NaN value"}`,`${isNaN(a)?"NaN":"non-NaN value"}`,n,r):t!==a&&o(t,a,n,r)}}}(e,t,"",0)}},p(e,t,a){let n=new WeakMap,r=new WeakMap;function l(e,t,a){let l=t,o=a;if("object"==typeof l&&null!==l&&"$$typeof"in l&&l.$$typeof===Symbol.for("react.context")&&"Provider"in l&&(l=l.Provider),"function"==typeof l&&null!=o.ref&&!l.prototype?.isReactComponent){let t=l,a=n.get(e);a||(a=new WeakMap,n.set(e,a));let r=a.get(t);r||((r=e.forwardRef((e,a)=>t({...e,ref:a}))).displayName=t.displayName??t.name,a.set(t,r)),l=r}if("string"==typeof l&&"boolean"==typeof o.inert&&((o={...o}).inert?o.inert="":delete o.inert),"string"==typeof l)for(let[e,t]of[["fill-rule","fillRule"],["clip-rule","clipRule"]])e in o&&(o={...o,[t]:o[e]},delete o[e]);return"string"==typeof l&&null!=o.ref&&(l=function(e,t){let a=r.get(e);a||(a=new Map,r.set(e,a));let n=a.get(t);if(n)return n;let l=e.forwardRef((a,n)=>{let r=e.useRef(null);if(!r.current||r.current.original!==n){let e;r.current={original:n,callback:t=>{if(null==t&&e){let t=e;e=void 0,t();return}if("function"==typeof n){let a=n(t);e="function"==typeof a?a:void 0}else n&&(n.current=t)}}}return e.createElement(t,{...a,ref:r.current.callback})});return l.displayName=`CanvasHost(${t})`,a.set(t,l),l}(e,l)),{type:l,props:o}}function o(e){let t=(t,a,n)=>{let r=l(e,t,a??{});return e.createElement(r.type,void 0===n?r.props:{...r.props,key:n})};return{jsx:t,jsxs:(t,a,n)=>{let r=l(e,t,a??{}),{children:o,...i}=r.props;return e.createElement(r.type,void 0===n?i:{...i,key:n},...Array.isArray(o)?o:[o])},jsxDEV:t,Fragment:e.Fragment}}function i(e){return{...e,createElement:(t,a,...n)=>{let r=l(e,t,a??{});return e.createElement(r.type,r.props,...n)},cloneElement:(t,a,...n)=>{let r=e.cloneElement(t,a??void 0,...n),o=r.ref,i=l(e,r.type,{...r.props,ref:o});return i.type===r.type&&"string"!=typeof r.type?r:e.createElement(i.type,{...i.props,key:r.key})}}}a.d(t,{MA:()=>o,YJ:()=>i})},C(e,t,a){a.r(t);let n=(0,a("p").YJ)(window.React),{Children:r,Component:l,Fragment:o,Profiler:i,PureComponent:s,StrictMode:c,Suspense:d,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:m,act:u,cloneElement:p,createContext:h,createElement:f,createFactory:y,createRef:g,forwardRef:b,isValidElement:w,lazy:S,memo:_,startTransition:v,unstable_act:C,useCallback:N,useContext:x,useDebugValue:T,useDeferredValue:D,useEffect:R,useId:E,useImperativeHandle:W,useInsertionEffect:O,useLayoutEffect:A,useMemo:P,useReducer:L,useRef:I,useState:k,useSyncExternalStore:$,useTransition:H,version:j,use:M}=n;a.d(t,{},{Children:r,Component:l,Fragment:o,Profiler:i,PureComponent:s,StrictMode:c,Suspense:d,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:m,act:u,cloneElement:p,createContext:h,createElement:f,createFactory:y,createRef:g,default:n,forwardRef:b,isValidElement:w,lazy:S,memo:_,startTransition:v,unstable_act:C,use:M,useCallback:N,useContext:x,useDebugValue:T,useDeferredValue:D,useEffect:R,useId:E,useImperativeHandle:W,useInsertionEffect:O,useLayoutEffect:A,useMemo:P,useReducer:L,useRef:I,useState:k,useSyncExternalStore:$,useTransition:H,version:j})}},t={};function a(n){var r=t[n];if(void 0!==r)return r.exports;var l=t[n]={exports:{}};return e[n](l,l.exports,a),l.exports}a.d=(e,t,n)=>{var r=(t,n)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,[n]:t[r]})};r(t,"get"),r(n,"value")},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{let{jsx:e,jsxs:t,jsxDEV:n,Fragment:r}=(0,a("p").MA)(window.React);var l=a("vD"),o=a("C");let i=window.WallarmDS.getHttpFolds,s={type:"object",required:["name","env"],properties:{name:{type:"string",title:"Rule name"},env:{enum:["staging","production"],description:"Where the rule is deployed."},retries:{type:"integer",minimum:0,maximum:5,description:"How many times a failed check is retried."},description:{type:"string"}}},c=(e,{startingLineNumber:t})=>i(e,{startingLineNumber:t}),d={request:'{\n "action": "block",\n "path": "/login"\n}',response:'{\n "status": 403,\n "reason": "blocked"\n}'},m=["{",' "events": [',...Array.from({length:1996},(e,t)=>{let a=t+1;return` { "id": ${a}, "method": "GET", "path": "/api/v1/items/${a}", "status": ${a%7==0?403:200} }${1996===a?"":","}`})," ]","}"].join("\n"),u=window.WallarmDS.CodeSnippetActions,p=window.WallarmDS.CodeSnippetCopyButton,h=window.WallarmDS.CodeSnippetFullscreenButton,f=window.WallarmDS.CodeSnippetHeader,y=window.WallarmDS.CodeSnippetTitle,g=window.WallarmDS.CodeSnippetWrapButton,b=window.WallarmDS.CodeEditorContent,w=window.WallarmDS.CodeEditorRoot,S=window.WallarmDS.CODE_EDITOR_KEYBOARD_HINT,_="code-editor-editing-workflow-hint",v=()=>{let a,n,r,i,d,m,v=(0,l.c)(8),[C,N]=(0,o.useState)('POST /api/v1/rules HTTP/1.1\nHost: api.wallarm.example\nContent-Type: application/json\nX-Env: staging\n\n{\n "name": "Block scanners",\n "env": "staging",\n "retries": 9,\n "description": "Blocks requests from known vulnerability scanners on every public endpoint of the API gateway, including the legacy routes kept only for older mobile clients"\n}');return v[0]===Symbol.for("react.memo_cache_sentinel")?(a=e(y,{children:"Request"}),v[0]=a):a=v[0],v[1]===Symbol.for("react.memo_cache_sentinel")?(n=t(f,{children:[a,t(u,{children:[e(h,{}),e(g,{}),e(p,{})]})]}),r=e(b,{lineNumbers:!0,"aria-label":"HTTP request","aria-describedby":_}),v[1]=n,v[2]=r):(n=v[1],r=v[2]),v[3]!==C?(i=t(w,{value:C,onChange:N,language:"http",folds:c,schema:s,"data-testid":"editing",children:[n,r]}),v[3]=C,v[4]=i):i=v[4],v[5]===Symbol.for("react.memo_cache_sentinel")?(d=e("span",{id:_,className:"sr-only",children:S}),v[5]=d):d=v[5],v[6]!==i?(m=t("div",{className:"w-640",children:[i,d]}),v[6]=i,v[7]=m):m=v[7],m};v.displayName="EditingWorkflowDemo";let C=window.WallarmDS.CodeEditorContent,N=window.WallarmDS.CodeEditorRoot,x=()=>{let t,a=(0,l.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=e("div",{className:"w-640",children:e(N,{defaultValue:m,readOnly:!0,language:"json",maxLines:12,"data-testid":"long-document",children:e(C,{lineNumbers:!0,"aria-label":"Access log"})})}),a[0]=t):t=a[0],t};x.displayName="LongDocumentDemo";let T=window.WallarmDS.CodeSnippetHeader,D=window.WallarmDS.CodeSnippetTab,R=window.WallarmDS.CodeSnippetTabs,E=window.WallarmDS.CodeEditorContent,W=window.WallarmDS.CodeEditorRoot,O=()=>{let a,n,r,i,s,c,m,u=(0,l.c)(13),[p,h]=(0,o.useState)("request"),[f,y]=(0,o.useState)(d),g=f[p];return u[0]!==p?(a=e=>y(t=>({...t,[p]:e})),u[0]=p,u[1]=a):a=u[1],u[2]===Symbol.for("react.memo_cache_sentinel")?(n=e=>{("request"===e||"response"===e)&&h(e)},r=e(D,{value:"request","data-testid":"tabs-editor--tab-request",children:"Request"}),i=e(D,{value:"response","data-testid":"tabs-editor--tab-response",children:"Response"}),u[2]=n,u[3]=r,u[4]=i):(n=u[2],r=u[3],i=u[4]),u[5]!==p?(s=e(T,{children:t(R,{value:p,onValueChange:n,children:[r,i]})}),u[5]=p,u[6]=s):s=u[6],u[7]===Symbol.for("react.memo_cache_sentinel")?(c=e(E,{lineNumbers:!0,"aria-label":"Rule check payload"}),u[7]=c):c=u[7],u[8]!==g||u[9]!==a||u[10]!==s||u[11]!==p?(m=e("div",{className:"w-480",children:t(W,{documentId:p,value:g,onChange:a,language:"json","data-testid":"tabs-editor",children:[s,c]})}),u[8]=g,u[9]=a,u[10]=s,u[11]=p,u[12]=m):m=u[12],m};O.displayName="TabsKeepHistoryDemo";let A=window.WallarmDS.Icons.Info,P=window.WallarmDS.Icons.Skull,L=window.WallarmDS.Icons.TriangleAlert,I=window.WallarmDS.Button,k=window.WallarmDS.CodeSnippetActions,$=window.WallarmDS.CodeSnippetAdapterProvider,H=window.WallarmDS.CodeSnippetCode,j=window.WallarmDS.CodeSnippetContent,M=window.WallarmDS.CodeSnippetCopyButton,q=window.WallarmDS.CodeSnippetFullscreenButton,z=window.WallarmDS.CodeSnippetHeader,V=window.WallarmDS.CodeSnippetLineNumbers,F=window.WallarmDS.CodeSnippetRoot,U=window.WallarmDS.CodeSnippetShowMoreButton,B=window.WallarmDS.CodeSnippetTab,J=window.WallarmDS.CodeSnippetTabs,X=window.WallarmDS.CodeSnippetTitle,G=window.WallarmDS.CodeSnippetWrapButton,Y=window.WallarmDS.getHttpFolds,K=window.WallarmDS.loadPrismAdapter;window.WallarmDS.loadShikiAdapter;let Z=window.WallarmDS.Drawer,Q=window.WallarmDS.DrawerBody,ee=window.WallarmDS.DrawerContent,et=window.WallarmDS.DrawerHeader,ea=window.WallarmDS.DrawerTitle,en=window.WallarmDS.DrawerTrigger,er=window.WallarmDS.VStack,el=window.WallarmDS.Tooltip,eo=window.WallarmDS.TooltipContent,ei=window.WallarmDS.TooltipTrigger,es=window.WallarmDS.CodeEditorContent,ec=window.WallarmDS.CodeEditorRoot,ed={title:"Data Display/CodeEditor",component:ec,parameters:{layout:"padded",docs:{description:{component:"An editable code surface that is visually the same component as `CodeSnippet` and reuses its header, tabs, actions and show-more — reach for `CodeSnippet` whenever the code is only read, since a page that never renders `CodeEditorContent` never loads the editor engine. Colours come from the same `CodeSnippetAdapterProvider` (plain text without one), so a read-only editor matches the snippet except for a native thin scrollbar, a caret and selection drawn by the editor, and an HTTP JSON body that stays coloured when `Content-Type` has parameters or the body has blank lines. The adapter re-tokenizes the whole document after each pause in typing, which stays within a frame up to about 2 000 lines with Prism; longer documents still edit smoothly, their colours just settle a moment later. Like the snippet, the editor sits inside a `display: contents` wrapper that keeps it mounted across fullscreen, so space editors with their own `className` (for example `mt-16`) or a `gap` on the parent — not `space-*`, `divide-*` or child selectors on the parent. `lines`, `folds`, `completions` and `schema` are compared by identity, so memoise them or hoist them to module constants — a new value on every render reconfigures the editor. Autocomplete suggests language keywords and words already in the document for every language; HTTP methods and headers and JSON Schema values have their own contextual suggestions. Pass `completions` to add application-specific results. Syntax errors are best-effort: JSON reports the `JSON.parse` message, JavaScript and TypeScript use Babel, Lua uses luaparse (first error only), YAML and Python use their Lezer parsers, which still flag a few valid Python forms such as `lambda a, /, b` and parenthesised `with` items. `lines` and `folds` stay on their line numbers while typing; to keep a decoration on a piece of text, recompute it from `value` (for example `useMemo(() => linesFor(value), [value])`, or a `folds` function such as `getHttpFolds`). The editor injects `<style>` tags, so under a strict Content Security Policy pass `cspNonce`. Tab indents, so keyboard users leave with Escape, then Tab, or press Ctrl+M (Alt+Shift+M on macOS) to switch Tab between indenting and moving focus — point `aria-describedby` at text holding `CODE_EDITOR_KEYBOARD_HINT` to tell screen-reader users."}}},tags:["autodocs"]},em=`{
|
|
13
13
|
"name": "@wallarm-org/sdk",
|
|
14
14
|
"version": "1.0.0",
|
|
15
15
|
"dependencies": {
|
|
@@ -124,14 +124,14 @@ Authorization: Bearer token123
|
|
|
124
124
|
X-Request-ID: abc-def-ghi`,eC=`const veryLongVariableName = "This is a very long string that will demonstrate line wrapping behavior when the content exceeds the container width";
|
|
125
125
|
console.log(veryLongVariableName);`,eN=`npm install @wallarm-org/sdk
|
|
126
126
|
npm run build
|
|
127
|
-
npm run test`,
|
|
127
|
+
npm run test`,ex={request:eg,response:`HTTP/1.1 201 Created
|
|
128
128
|
Content-Type: application/json
|
|
129
129
|
Location: /api/v2/rules/42
|
|
130
130
|
|
|
131
131
|
{
|
|
132
132
|
"id": 42,
|
|
133
133
|
"action": "block"
|
|
134
|
-
}`},
|
|
134
|
+
}`},eT=(a,n)=>t(el,{children:[e(ei,{children:a}),e(eo,{children:n})]}),eD={2:{color:"danger"},3:{color:"warning"},4:{color:"info"},5:{color:"success"},6:{color:"brand"},7:{color:"ai"},8:{color:"neutral"}},eR={2:{color:"danger",prefix:"-"},3:{color:"success",prefix:"+"},4:{color:"success",prefix:"+"}},eE={3:{color:"danger",prefix:eT(e(P,{}),"Malicious user agent")},5:{color:"warning",prefix:eT(e(L,{}),"Unusual language list")},7:{color:"info",prefix:eT(e(A,{}),"Caching disabled")}},eW={4:{color:"danger",ranges:[{start:8,end:24}]},7:{color:"info",ranges:[{start:17,end:30}]}},eO={1:{color:"danger",prefix:"-"},2:{color:"success",prefix:"+"}},eA={...eD,1:{prefix:eT(e(A,{}),"Untouched line")},2:{color:"danger",prefix:"-"},5:{color:"success",prefix:"+"}},eP=(e,{startingLineNumber:t})=>Y(e,{startingLineNumber:t,headers:{defaultCollapsed:!0}}),eL=(e,{startingLineNumber:t})=>Y(e,{startingLineNumber:t}),eI=Y(ew,{headers:{defaultCollapsed:!0}}),ek=a=>{let n,r,o,i,s,c,d,m,u,p=(0,l.c)(29),{testId:h,code:f,language:y,lines:g,folds:b,wrapLines:w,size:S,maxLines:_,children:v}=a;p[0]===Symbol.for("react.memo_cache_sentinel")?(n=e("span",{className:"sb-annotation",children:"CodeSnippet"}),r={width:"600px"},p[0]=n,p[1]=r):(n=p[0],r=p[1]);let C=`${h}-snippet`;p[2]===Symbol.for("react.memo_cache_sentinel")?(o=t(j,{children:[e(V,{}),e(H,{})]}),p[2]=o):o=p[2],p[3]!==v||p[4]!==f||p[5]!==b||p[6]!==y||p[7]!==g||p[8]!==_||p[9]!==S||p[10]!==C||p[11]!==w?(i=t(er,{align:"start",gap:4,children:[n,e("div",{style:r,children:t(F,{code:f,language:y,lines:g,folds:b,wrapLines:w,size:S,maxLines:_,"data-testid":C,children:[v,o]})})]}),p[3]=v,p[4]=f,p[5]=b,p[6]=y,p[7]=g,p[8]=_,p[9]=S,p[10]=C,p[11]=w,p[12]=i):i=p[12],p[13]===Symbol.for("react.memo_cache_sentinel")?(s=e("span",{className:"sb-annotation",children:"CodeEditor (readOnly)"}),c={width:"600px"},p[13]=s,p[14]=c):(s=p[13],c=p[14]);let N=`${h}-editor`;return p[15]===Symbol.for("react.memo_cache_sentinel")?(d=e(es,{lineNumbers:!0,"aria-label":"Parity editor"}),p[15]=d):d=p[15],p[16]!==v||p[17]!==f||p[18]!==b||p[19]!==y||p[20]!==g||p[21]!==_||p[22]!==S||p[23]!==N||p[24]!==w?(m=t(er,{align:"start",gap:4,children:[s,e("div",{style:c,children:t(ec,{value:f,language:y,lines:g,folds:b,defaultWrapLines:w,size:S,maxLines:_,readOnly:!0,"data-testid":N,children:[v,d]})})]}),p[16]=v,p[17]=f,p[18]=b,p[19]=y,p[20]=g,p[21]=_,p[22]=S,p[23]=N,p[24]=w,p[25]=m):m=p[25],p[26]!==m||p[27]!==i?(u=t(er,{gap:16,children:[i,m]}),p[26]=m,p[27]=i,p[28]=u):u=p[28],u},e$=t(z,{children:[t(J,{defaultValue:"request",children:[e(B,{value:"request",children:"Request"}),e(B,{value:"response",children:"Response"})]}),t(k,{children:[e(G,{}),e(M,{}),e(q,{})]})]}),eH=t(k,{children:[e(G,{}),e(M,{})]}),ej=`POST /api/v2/users HTTP/1.1
|
|
135
135
|
Host: api.wallarm.com
|
|
136
136
|
Content-Type: application/json
|
|
137
137
|
X-Request-Id: 42
|
|
@@ -159,4 +159,4 @@ Authorization: Bearer token123
|
|
|
159
159
|
|
|
160
160
|
{
|
|
161
161
|
"action": "block"
|
|
162
|
-
}`,eF=[{id:"headers",startLine:2,endLine:4,label:"Headers",toggleProps:{"data-analytics-id":"CODE_EDITOR_FOLD_HEADERS"},summaryProps:{"data-analytics-id":"CODE_EDITOR_EXPAND_HEADERS"}}],eU=[{name:"Default",story:()=>{let t,a,n,r=(0,l.c)(4),[i,s]=(0,o.useState)(em);return r[0]===Symbol.for("react.memo_cache_sentinel")?(t={width:"600px"},r[0]=t):t=r[0],r[1]===Symbol.for("react.memo_cache_sentinel")?(a=e(es,{lineNumbers:!0,"aria-label":"Package manifest"}),r[1]=a):a=r[1],r[2]!==i?(n=e("div",{style:t,children:e(ec,{value:i,onChange:s,language:"json","data-testid":"code-editor-default",children:a})}),r[2]=i,r[3]=n):n=r[3],n},meta:ed},{name:"WithHeader",story:()=>{let a,n,r,i,s,c=(0,l.c)(6),[d,m]=(0,o.useState)(em);return c[0]===Symbol.for("react.memo_cache_sentinel")?(a={width:"600px"},c[0]=a):a=c[0],c[1]===Symbol.for("react.memo_cache_sentinel")?(n=e(X,{children:"rule.json"}),c[1]=n):n=c[1],c[2]===Symbol.for("react.memo_cache_sentinel")?(r=t(z,{children:[n,t(k,{children:[e(M,{}),e(G,{}),e(q,{})]})]}),i=e(es,{lineNumbers:!0,"aria-label":"Rule JSON"}),c[2]=r,c[3]=i):(r=c[2],i=c[3]),c[4]!==d?(s=e("div",{style:a,children:t(ec,{value:d,onChange:m,language:"json","data-testid":"code-editor-with-header",children:[r,i]})}),c[4]=d,c[5]=s):s=c[5],s},meta:ed},{name:"FloatingActions",story:()=>{let a,n,r,i,s=(0,l.c)(5),[c,d]=(0,o.useState)(eu);return s[0]===Symbol.for("react.memo_cache_sentinel")?(a={width:"320px"},s[0]=a):a=s[0],s[1]===Symbol.for("react.memo_cache_sentinel")?(n=t(k,{children:[e(G,{}),e(M,{})]}),r=e(es,{lineNumbers:!0,"aria-label":"Sample code"}),s[1]=n,s[2]=r):(n=s[1],r=s[2]),s[3]!==c?(i=e("div",{style:a,children:t(ec,{value:c,onChange:d,language:"text","data-testid":"code-editor-floating-actions",children:[n,r]})}),s[3]=c,s[4]=i):i=s[4],i},meta:ed},{name:"LineNumbersAndStartingLine",story:()=>{let a,n,r,o,i,s,c=(0,l.c)(6);return c[0]===Symbol.for("react.memo_cache_sentinel")?(a=e("span",{className:"sb-annotation",children:"lineNumbers"}),n={width:"600px"},c[0]=a,c[1]=n):(a=c[0],n=c[1]),c[2]===Symbol.for("react.memo_cache_sentinel")?(r=t(er,{align:"start",gap:4,children:[a,e("div",{style:n,children:e(ec,{defaultValue:eu,language:"text","data-testid":"code-editor-line-numbers",children:e(es,{lineNumbers:!0,"aria-label":"Sample code"})})})]}),c[2]=r):r=c[2],c[3]===Symbol.for("react.memo_cache_sentinel")?(o=e("span",{className:"sb-annotation",children:"startingLineNumber = 97"}),i={width:"600px"},c[3]=o,c[4]=i):(o=c[3],i=c[4]),c[5]===Symbol.for("react.memo_cache_sentinel")?(s=t(er,{gap:16,children:[r,t(er,{align:"start",gap:4,children:[o,e("div",{style:i,children:e(ec,{defaultValue:eu,language:"text",startingLineNumber:97,"data-testid":"code-editor-starting-line",children:e(es,{lineNumbers:!0,"aria-label":"Sample code from line 97"})})})]})]}),c[5]=s):s=c[5],s},meta:ed},{name:"LineColorsAndPrefixes",story:()=>{let a,n,r,o,i,s,c,d,m,u=(0,l.c)(9);return u[0]===Symbol.for("react.memo_cache_sentinel")?(a=e("span",{className:"sb-annotation",children:"colours"}),n={width:"600px"},u[0]=a,u[1]=n):(a=u[0],n=u[1]),u[2]===Symbol.for("react.memo_cache_sentinel")?(r=t(er,{align:"start",gap:4,children:[a,e("div",{style:n,children:e(ec,{defaultValue:ep,language:"text",lines:eD,"data-testid":"code-editor-line-colors",children:e(es,{lineNumbers:!0,"aria-label":"Line colours"})})})]}),u[2]=r):r=u[2],u[3]===Symbol.for("react.memo_cache_sentinel")?(o=e("span",{className:"sb-annotation",children:"text prefixes"}),i={width:"600px"},u[3]=o,u[4]=i):(o=u[3],i=u[4]),u[5]===Symbol.for("react.memo_cache_sentinel")?(s=t(er,{align:"start",gap:4,children:[o,e("div",{style:i,children:e(ec,{defaultValue:eh,language:"text",lines:eR,"data-testid":"code-editor-line-diff",children:e(es,{lineNumbers:!0,"aria-label":"Diff prefixes"})})})]}),u[5]=s):s=u[5],u[6]===Symbol.for("react.memo_cache_sentinel")?(c=e("span",{className:"sb-annotation",children:"ReactNode prefixes with tooltips"}),d={width:"600px"},u[6]=c,u[7]=d):(c=u[6],d=u[7]),u[8]===Symbol.for("react.memo_cache_sentinel")?(m=t(er,{gap:16,children:[r,s,t(er,{align:"start",gap:4,children:[c,e("div",{style:d,children:e(ec,{defaultValue:ef,language:"text",lines:eE,"data-testid":"code-editor-line-icons",children:e(es,{lineNumbers:!0,"aria-label":"Annotated headers"})})})]})]}),u[8]=m):m=u[8],m},meta:ed},{name:"Ranges",story:()=>{let t,a,n=(0,l.c)(2);return n[0]===Symbol.for("react.memo_cache_sentinel")?(t={width:"600px"},n[0]=t):t=n[0],n[1]===Symbol.for("react.memo_cache_sentinel")?(a=e("div",{style:t,children:e(ec,{defaultValue:ey,language:"text",lines:eW,"data-testid":"code-editor-ranges",children:e(es,{lineNumbers:!0,"aria-label":"Request with ranges"})})}),n[1]=a):a=n[1],a},meta:ed},{name:"HttpRequestWithPrism",story:()=>{let t,a,n,r=(0,l.c)(4),[i,s]=(0,o.useState)(eg);return r[0]===Symbol.for("react.memo_cache_sentinel")?(t={width:"600px"},r[0]=t):t=r[0],r[1]===Symbol.for("react.memo_cache_sentinel")?(a=e(es,{lineNumbers:!0,"aria-label":"HTTP request"}),r[1]=a):a=r[1],r[2]!==i?(n=e($,{adapter:K,children:e("div",{style:t,children:e(ec,{value:i,onChange:s,language:"http","data-testid":"code-editor-http-request",children:a})})}),r[2]=i,r[3]=n):n=r[3],n},meta:ed},{name:"HttpFolds",story:()=>{let a,n,r,i,s,c,d,m,u,p=(0,l.c)(13),[h,f]=(0,o.useState)(ew),[y,g]=(0,o.useState)(eS);return p[0]===Symbol.for("react.memo_cache_sentinel")?(a=e("span",{className:"sb-annotation",children:"headers collapsed by default"}),n={width:"600px"},p[0]=a,p[1]=n):(a=p[0],n=p[1]),p[2]===Symbol.for("react.memo_cache_sentinel")?(r=e(es,{lineNumbers:!0,"aria-label":"Foldable HTTP request"}),p[2]=r):r=p[2],p[3]!==h?(i=t(er,{align:"start",gap:4,children:[a,e("div",{style:n,children:e(ec,{value:h,onChange:f,language:"http",folds:eP,"data-testid":"code-editor-http-folds-request",children:r})})]}),p[3]=h,p[4]=i):i=p[4],p[5]===Symbol.for("react.memo_cache_sentinel")?(s=e("span",{className:"sb-annotation",children:"startingLineNumber = 100"}),c={width:"600px"},p[5]=s,p[6]=c):(s=p[5],c=p[6]),p[7]===Symbol.for("react.memo_cache_sentinel")?(d=e(es,{lineNumbers:!0,"aria-label":"Foldable HTTP response"}),p[7]=d):d=p[7],p[8]!==y?(m=t(er,{align:"start",gap:4,children:[s,e("div",{style:c,children:e(ec,{value:y,onChange:g,language:"http",startingLineNumber:100,folds:eL,"data-testid":"code-editor-http-folds-response",children:d})})]}),p[8]=y,p[9]=m):m=p[9],p[10]!==i||p[11]!==m?(u=t(er,{gap:16,children:[i,m]}),p[10]=i,p[11]=m,p[12]=u):u=p[12],u},meta:ed},{name:"ShowMore",story:()=>{let a,n,r,o,i,s,c,d=(0,l.c)(7);return d[0]===Symbol.for("react.memo_cache_sentinel")?(a={display:"flex",flexDirection:"column",gap:"24px",width:"500px"},n=e("p",{className:"sb-annotation mb-8",children:"12 lines, clamped at 7 — 5 hidden"}),d[0]=a,d[1]=n):(a=d[0],n=d[1]),d[2]===Symbol.for("react.memo_cache_sentinel")?(r=t("div",{children:[n,e(ec,{defaultValue:e_,language:"text",maxLines:7,"data-testid":"code-editor-show-more",children:e(es,{"aria-label":"Request headers"})})]}),o=e("p",{className:"sb-annotation mb-8",children:"9 lines, clamped at 7 — 2 hidden, no button"}),d[2]=r,d[3]=o):(r=d[2],o=d[3]),d[4]===Symbol.for("react.memo_cache_sentinel")?(i=t("div",{children:[o,e(ec,{defaultValue:ev,language:"text",maxLines:7,"data-testid":"code-editor-show-more-threshold",children:e(es,{"aria-label":"Request headers"})})]}),s=e("p",{className:"sb-annotation mb-8",children:"the button rendered by hand"}),d[4]=i,d[5]=s):(i=d[4],s=d[5]),d[6]===Symbol.for("react.memo_cache_sentinel")?(c=t("div",{style:a,children:[r,i,t("div",{children:[s,t(ec,{defaultValue:e_,language:"text",maxLines:7,"data-testid":"code-editor-show-more-manual",children:[e(es,{"aria-label":"Request headers"}),e(U,{"data-analytics-id":"CODE_EDITOR_SHOW_MORE"})]})]})]}),d[6]=c):c=d[6],c},meta:ed},{name:"Wrap",story:()=>{let a,n,r,i,s,c,d,m,u,p,h,f,y=(0,l.c)(16),[g,b]=(0,o.useState)(!0);y[0]===Symbol.for("react.memo_cache_sentinel")?(a=e("span",{className:"sb-annotation",children:"no wrapping"}),n={width:"600px"},y[0]=a,y[1]=n):(a=y[0],n=y[1]),y[2]===Symbol.for("react.memo_cache_sentinel")?(r=t(er,{align:"start",gap:4,children:[a,e("div",{style:n,children:e(ec,{defaultValue:eC,language:"text",lines:eO,"data-testid":"code-editor-wrap-off",children:e(es,{lineNumbers:!0,"aria-label":"Long lines"})})})]}),y[2]=r):r=y[2],y[3]===Symbol.for("react.memo_cache_sentinel")?(i=e("span",{className:"sb-annotation",children:"defaultWrapLines + wrap button"}),s={width:"600px"},y[3]=i,y[4]=s):(i=y[3],s=y[4]),y[5]===Symbol.for("react.memo_cache_sentinel")?(c=t(er,{align:"start",gap:4,children:[i,e("div",{style:s,children:t(ec,{defaultValue:eC,language:"text",defaultWrapLines:!0,lines:eO,"data-testid":"code-editor-wrap-uncontrolled",children:[e(k,{children:e(G,{})}),e(es,{lineNumbers:!0,"aria-label":"Long lines, wrapped"})]})})]}),y[5]=c):c=y[5];let w=String(g);return y[6]!==w?(d=t("span",{className:"sb-annotation",children:["controlled — wrapLines = ",w]}),y[6]=w,y[7]=d):d=y[7],y[8]===Symbol.for("react.memo_cache_sentinel")?(m={width:"600px"},y[8]=m):m=y[8],y[9]===Symbol.for("react.memo_cache_sentinel")?(p=e(k,{children:e(G,{})}),u=e(es,{lineNumbers:!0,"aria-label":"Long lines, controlled wrap"}),y[9]=u,y[10]=p):(u=y[9],p=y[10]),y[11]!==g?(h=e("div",{style:m,children:t(ec,{defaultValue:eC,language:"text",wrapLines:g,onWrapLinesChange:b,"data-testid":"code-editor-wrap-controlled",children:[p,u]})}),y[11]=g,y[12]=h):h=y[12],y[13]!==h||y[14]!==d?(f=t(er,{gap:16,children:[r,c,t(er,{align:"start",gap:4,children:[d,h]})]}),y[13]=h,y[14]=d,y[15]=f):f=y[15],f},meta:ed},{name:"Sizes",story:()=>{let a,n,r,o,i,s,c,d,m,u=(0,l.c)(9);return u[0]===Symbol.for("react.memo_cache_sentinel")?(a=e("span",{className:"sb-annotation",children:"sm (default)"}),n={width:"600px"},u[0]=a,u[1]=n):(a=u[0],n=u[1]),u[2]===Symbol.for("react.memo_cache_sentinel")?(r=t(er,{align:"start",gap:4,children:[a,e("div",{style:n,children:e(ec,{defaultValue:eN,language:"bash",size:"sm","data-testid":"code-editor-size-sm",children:e(es,{lineNumbers:!0,"aria-label":"Install commands, small"})})})]}),u[2]=r):r=u[2],u[3]===Symbol.for("react.memo_cache_sentinel")?(o=e("span",{className:"sb-annotation",children:"md"}),i={width:"600px"},u[3]=o,u[4]=i):(o=u[3],i=u[4]),u[5]===Symbol.for("react.memo_cache_sentinel")?(s=t(er,{align:"start",gap:4,children:[o,e("div",{style:i,children:e(ec,{defaultValue:eN,language:"bash",size:"md","data-testid":"code-editor-size-md",children:e(es,{lineNumbers:!0,"aria-label":"Install commands, medium"})})})]}),u[5]=s):s=u[5],u[6]===Symbol.for("react.memo_cache_sentinel")?(c=e("span",{className:"sb-annotation",children:"lg"}),d={width:"600px"},u[6]=c,u[7]=d):(c=u[6],d=u[7]),u[8]===Symbol.for("react.memo_cache_sentinel")?(m=t(er,{gap:16,children:[r,s,t(er,{align:"start",gap:4,children:[c,e("div",{style:d,children:e(ec,{defaultValue:eN,language:"bash",size:"lg","data-testid":"code-editor-size-lg",children:e(es,{lineNumbers:!0,"aria-label":"Install commands, large"})})})]})]}),u[8]=m):m=u[8],m},meta:ed},{name:"ReadOnly",story:()=>{let a,n,r,o=(0,l.c)(3);return o[0]===Symbol.for("react.memo_cache_sentinel")?(a={width:"600px"},o[0]=a):a=o[0],o[1]===Symbol.for("react.memo_cache_sentinel")?(n=e(X,{children:"Response"}),o[1]=n):n=o[1],o[2]===Symbol.for("react.memo_cache_sentinel")?(r=e("div",{style:a,children:t(ec,{value:eb,language:"http",readOnly:!0,"data-testid":"code-editor-read-only",children:[t(z,{children:[n,e(k,{children:e(M,{})})]}),e(es,{lineNumbers:!0,"aria-label":"HTTP response, read only"})]})}),o[2]=r):r=o[2],r},meta:ed},{name:"Tabs",story:()=>{let a,n,r,i,s,c,d,m,u,p,h=(0,l.c)(17),[f,y]=(0,o.useState)("request"),[g,b]=(0,o.useState)(eT);h[0]===Symbol.for("react.memo_cache_sentinel")?(a={width:"600px"},h[0]=a):a=h[0];let w=g[f];return h[1]!==f?(n=e=>b(t=>({...t,[f]:e})),h[1]=f,h[2]=n):n=h[2],h[3]===Symbol.for("react.memo_cache_sentinel")?(r=e=>{("request"===e||"response"===e)&&y(e)},i=e(B,{value:"request","data-testid":"code-editor-tabs--tab-request",children:"Request"}),s=e(B,{value:"response","data-testid":"code-editor-tabs--tab-response",children:"Response"}),h[3]=r,h[4]=i,h[5]=s):(r=h[3],i=h[4],s=h[5]),h[6]!==f?(c=t(J,{value:f,onValueChange:r,children:[i,s]}),h[6]=f,h[7]=c):c=h[7],h[8]===Symbol.for("react.memo_cache_sentinel")?(d=e(k,{children:e(M,{})}),h[8]=d):d=h[8],h[9]!==c?(m=t(z,{children:[c,d]}),h[9]=c,h[10]=m):m=h[10],h[11]===Symbol.for("react.memo_cache_sentinel")?(u=e(es,{lineNumbers:!0,"aria-label":"HTTP message"}),h[11]=u):u=h[11],h[12]!==w||h[13]!==n||h[14]!==m||h[15]!==f?(p=e("div",{style:a,children:t(ec,{documentId:f,value:w,onChange:n,language:"http","data-testid":"code-editor-tabs",children:[m,u]})}),h[12]=w,h[13]=n,h[14]=m,h[15]=f,h[16]=p):p=h[16],p},meta:ed},{name:"ParityDefault",story:()=>{let t,a=(0,l.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=e(ek,{testId:"parity-default",code:eu,language:"text"}),a[0]=t):t=a[0],t},meta:ed},{name:"ParityLineColors",story:()=>{let t,a=(0,l.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=e(ek,{testId:"parity-line-colors",code:ep,language:"text",lines:eA}),a[0]=t):t=a[0],t},meta:ed},{name:"ParityFoldsCollapsed",story:()=>{let t,a=(0,l.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=e(ek,{testId:"parity-folds-collapsed",code:ew,language:"text",folds:eI}),a[0]=t):t=a[0],t},meta:ed},{name:"ParityHttpPrism",story:()=>{let t,a=(0,l.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=e($,{adapter:K,children:e(ek,{testId:"parity-http-prism",code:eg,language:"http"})}),a[0]=t):t=a[0],t},meta:ed},{name:"ParityRanges",story:()=>{let t,a=(0,l.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=e(ek,{testId:"parity-ranges",code:ey,language:"text",lines:eW}),a[0]=t):t=a[0],t},meta:ed},{name:"ParityWrap",story:()=>{let t,a=(0,l.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=e(ek,{testId:"parity-wrap",code:eC,language:"text",wrapLines:!0}),a[0]=t):t=a[0],t},meta:ed},{name:"ParitySizes",story:()=>{let a,n=(0,l.c)(1);return n[0]===Symbol.for("react.memo_cache_sentinel")?(a=t(er,{gap:24,children:[e(ek,{testId:"parity-size-sm",code:eN,language:"bash",size:"sm"}),e(ek,{testId:"parity-size-md",code:eN,language:"bash",size:"md"}),e(ek,{testId:"parity-size-lg",code:eN,language:"bash",size:"lg"})]}),n[0]=a):a=n[0],a},meta:ed},{name:"ParityFrame",story:()=>{let a,n=(0,l.c)(1);return n[0]===Symbol.for("react.memo_cache_sentinel")?(a=t(er,{gap:24,children:[e(ek,{testId:"parity-frame-header",code:eu,language:"text",children:e$}),e(ek,{testId:"parity-frame-floating",code:eu,language:"text",children:eH})]}),n[0]=a):a=n[0],a},meta:ed},{name:"ParityShowMore",story:()=>{let t,a=(0,l.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=e(ek,{testId:"parity-show-more",code:e_,language:"text",maxLines:7}),a[0]=t):t=a[0],t},meta:ed},{name:"Diff",story:()=>{let t,a,n=(0,l.c)(3),[r,i]=(0,o.useState)(eM);return n[0]===Symbol.for("react.memo_cache_sentinel")?(t=e(es,{"aria-label":"Request draft compared with the stored request",lineNumbers:!0}),n[0]=t):t=n[0],n[1]!==r?(a=e(ec,{"data-testid":"code-editor-diff",language:"http",original:ej,value:r,onChange:i,children:t}),n[1]=r,n[2]=a):a=n[2],a},meta:ed},{name:"DiffWrapLines",story:()=>{let t,a,n=(0,l.c)(3),[r,i]=(0,o.useState)(ez);return n[0]===Symbol.for("react.memo_cache_sentinel")?(t=e(es,{"aria-label":"Request without the debug header",lineNumbers:!0}),n[0]=t):t=n[0],n[1]!==r?(a=e("div",{className:"w-480",children:e(ec,{"data-testid":"code-editor-diff-wrap",language:"http",original:eq,value:r,onChange:i,defaultWrapLines:!0,children:t})}),n[1]=r,n[2]=a):a=n[2],a},meta:ed},{name:"AnalyticsAttributes",story:()=>{let a,n,r=(0,l.c)(2);return r[0]===Symbol.for("react.memo_cache_sentinel")?(a=e(X,{children:"Request"}),r[0]=a):a=r[0],r[1]===Symbol.for("react.memo_cache_sentinel")?(n=t(ec,{"data-testid":"analytics-editor",language:"http",defaultValue:eV,folds:eF,children:[t(z,{children:[a,t(k,{children:[e(M,{"data-analytics-id":"CODE_EDITOR_COPY"}),e(G,{"data-analytics-id":"CODE_EDITOR_WRAP"}),e(q,{"data-analytics-id":"CODE_EDITOR_FULLSCREEN"})]})]}),e(es,{"aria-label":"HTTP request",lineNumbers:!0,"data-analytics-id":"CODE_EDITOR_REQUEST","data-analytics-props":'{"surface":"rule-editor"}'})]}),r[1]=n):n=r[1],n},meta:ed},{name:"EditingWorkflow",story:()=>{let t,a=(0,l.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=e(v,{}),a[0]=t):t=a[0],t},meta:ed},{name:"TabsKeepHistory",story:()=>{let t,a=(0,l.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=e(O,{}),a[0]=t):t=a[0],t},meta:ed},{name:"LongDocument",story:()=>{let t,a=(0,l.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=e(T,{}),a[0]=t):t=a[0],t},meta:ed},{name:"FullscreenInsideDrawer",story:()=>{let a,n,r,i,s,c,d=(0,l.c)(7),[m,u]=(0,o.useState)(em);return d[0]===Symbol.for("react.memo_cache_sentinel")?(a=e(en,{asChild:!0,children:e(I,{variant:"outline",color:"neutral",children:"Open Drawer"})}),d[0]=a):a=d[0],d[1]===Symbol.for("react.memo_cache_sentinel")?(n=e(et,{children:e(ea,{children:"Rule"})}),d[1]=n):n=d[1],d[2]===Symbol.for("react.memo_cache_sentinel")?(r=e(X,{children:"rule.json"}),d[2]=r):r=d[2],d[3]===Symbol.for("react.memo_cache_sentinel")?(i=t(z,{children:[r,t(k,{children:[e(q,{}),e(M,{})]})]}),s=e(es,{lineNumbers:!0,"aria-label":"Rule JSON"}),d[3]=i,d[4]=s):(i=d[3],s=d[4]),d[5]!==m?(c=t(Z,{children:[a,t(ee,{children:[n,e(Q,{children:t(ec,{value:m,onChange:u,language:"json",children:[i,s]})})]})]}),d[5]=m,d[6]=c):c=d[6],c},meta:ed}];function eB({entry:e}){let{story:t,meta:a}=e,n={...a.args,...t.args},r="function"==typeof t||t.$$typeof?t:t.render||a.render||a.component,l=()=>o.default.createElement(r,n),i={args:n,globals:{theme:"light"},parameters:{...a.parameters,...t.parameters},viewMode:"story"};for(let e of[...a.decorators||[],...t.decorators||[]].reverse()){let t=l;l=()=>e(t,i)}return o.default.createElement("section",{"data-preview-story":e.name,className:"p-16"},o.default.createElement("h2",{className:"text-sm mb-12"},e.name),o.default.createElement(l))}window.WallarmPreview={mount(e){let t=window.ReactDOM.createRoot(e);return t.render(o.default.createElement(window.WallarmDS.Root,null,eU.map((e,t)=>o.default.createElement(eB,{key:t,entry:e})))),t}}})();
|
|
162
|
+
}`,eF=[{id:"headers",startLine:2,endLine:4,label:"Headers",toggleProps:{"data-analytics-id":"CODE_EDITOR_FOLD_HEADERS"},summaryProps:{"data-analytics-id":"CODE_EDITOR_EXPAND_HEADERS"}}],eU=[{name:"Default",story:()=>{let t,a,n,r=(0,l.c)(4),[i,s]=(0,o.useState)(em);return r[0]===Symbol.for("react.memo_cache_sentinel")?(t={width:"600px"},r[0]=t):t=r[0],r[1]===Symbol.for("react.memo_cache_sentinel")?(a=e(es,{lineNumbers:!0,"aria-label":"Package manifest"}),r[1]=a):a=r[1],r[2]!==i?(n=e("div",{style:t,children:e(ec,{value:i,onChange:s,language:"json","data-testid":"code-editor-default",children:a})}),r[2]=i,r[3]=n):n=r[3],n},meta:ed},{name:"WithHeader",story:()=>{let a,n,r,i,s,c=(0,l.c)(6),[d,m]=(0,o.useState)(em);return c[0]===Symbol.for("react.memo_cache_sentinel")?(a={width:"600px"},c[0]=a):a=c[0],c[1]===Symbol.for("react.memo_cache_sentinel")?(n=e(X,{children:"rule.json"}),c[1]=n):n=c[1],c[2]===Symbol.for("react.memo_cache_sentinel")?(r=t(z,{children:[n,t(k,{children:[e(M,{}),e(G,{}),e(q,{})]})]}),i=e(es,{lineNumbers:!0,"aria-label":"Rule JSON"}),c[2]=r,c[3]=i):(r=c[2],i=c[3]),c[4]!==d?(s=e("div",{style:a,children:t(ec,{value:d,onChange:m,language:"json","data-testid":"code-editor-with-header",children:[r,i]})}),c[4]=d,c[5]=s):s=c[5],s},meta:ed},{name:"FloatingActions",story:()=>{let a,n,r,i,s=(0,l.c)(5),[c,d]=(0,o.useState)(eu);return s[0]===Symbol.for("react.memo_cache_sentinel")?(a={width:"320px"},s[0]=a):a=s[0],s[1]===Symbol.for("react.memo_cache_sentinel")?(n=t(k,{children:[e(G,{}),e(M,{})]}),r=e(es,{lineNumbers:!0,"aria-label":"Sample code"}),s[1]=n,s[2]=r):(n=s[1],r=s[2]),s[3]!==c?(i=e("div",{style:a,children:t(ec,{value:c,onChange:d,language:"text","data-testid":"code-editor-floating-actions",children:[n,r]})}),s[3]=c,s[4]=i):i=s[4],i},meta:ed},{name:"LineNumbersAndStartingLine",story:()=>{let a,n,r,o,i,s,c=(0,l.c)(6);return c[0]===Symbol.for("react.memo_cache_sentinel")?(a=e("span",{className:"sb-annotation",children:"lineNumbers"}),n={width:"600px"},c[0]=a,c[1]=n):(a=c[0],n=c[1]),c[2]===Symbol.for("react.memo_cache_sentinel")?(r=t(er,{align:"start",gap:4,children:[a,e("div",{style:n,children:e(ec,{defaultValue:eu,language:"text","data-testid":"code-editor-line-numbers",children:e(es,{lineNumbers:!0,"aria-label":"Sample code"})})})]}),c[2]=r):r=c[2],c[3]===Symbol.for("react.memo_cache_sentinel")?(o=e("span",{className:"sb-annotation",children:"startingLineNumber = 97"}),i={width:"600px"},c[3]=o,c[4]=i):(o=c[3],i=c[4]),c[5]===Symbol.for("react.memo_cache_sentinel")?(s=t(er,{gap:16,children:[r,t(er,{align:"start",gap:4,children:[o,e("div",{style:i,children:e(ec,{defaultValue:eu,language:"text",startingLineNumber:97,"data-testid":"code-editor-starting-line",children:e(es,{lineNumbers:!0,"aria-label":"Sample code from line 97"})})})]})]}),c[5]=s):s=c[5],s},meta:ed},{name:"LineColorsAndPrefixes",story:()=>{let a,n,r,o,i,s,c,d,m,u=(0,l.c)(9);return u[0]===Symbol.for("react.memo_cache_sentinel")?(a=e("span",{className:"sb-annotation",children:"colours"}),n={width:"600px"},u[0]=a,u[1]=n):(a=u[0],n=u[1]),u[2]===Symbol.for("react.memo_cache_sentinel")?(r=t(er,{align:"start",gap:4,children:[a,e("div",{style:n,children:e(ec,{defaultValue:ep,language:"text",lines:eD,"data-testid":"code-editor-line-colors",children:e(es,{lineNumbers:!0,"aria-label":"Line colours"})})})]}),u[2]=r):r=u[2],u[3]===Symbol.for("react.memo_cache_sentinel")?(o=e("span",{className:"sb-annotation",children:"text prefixes"}),i={width:"600px"},u[3]=o,u[4]=i):(o=u[3],i=u[4]),u[5]===Symbol.for("react.memo_cache_sentinel")?(s=t(er,{align:"start",gap:4,children:[o,e("div",{style:i,children:e(ec,{defaultValue:eh,language:"text",lines:eR,"data-testid":"code-editor-line-diff",children:e(es,{lineNumbers:!0,"aria-label":"Diff prefixes"})})})]}),u[5]=s):s=u[5],u[6]===Symbol.for("react.memo_cache_sentinel")?(c=e("span",{className:"sb-annotation",children:"ReactNode prefixes with tooltips"}),d={width:"600px"},u[6]=c,u[7]=d):(c=u[6],d=u[7]),u[8]===Symbol.for("react.memo_cache_sentinel")?(m=t(er,{gap:16,children:[r,s,t(er,{align:"start",gap:4,children:[c,e("div",{style:d,children:e(ec,{defaultValue:ef,language:"text",lines:eE,"data-testid":"code-editor-line-icons",children:e(es,{lineNumbers:!0,"aria-label":"Annotated headers"})})})]})]}),u[8]=m):m=u[8],m},meta:ed},{name:"Ranges",story:()=>{let t,a,n=(0,l.c)(2);return n[0]===Symbol.for("react.memo_cache_sentinel")?(t={width:"600px"},n[0]=t):t=n[0],n[1]===Symbol.for("react.memo_cache_sentinel")?(a=e("div",{style:t,children:e(ec,{defaultValue:ey,language:"text",lines:eW,"data-testid":"code-editor-ranges",children:e(es,{lineNumbers:!0,"aria-label":"Request with ranges"})})}),n[1]=a):a=n[1],a},meta:ed},{name:"HttpRequestWithPrism",story:()=>{let t,a,n,r=(0,l.c)(4),[i,s]=(0,o.useState)(eg);return r[0]===Symbol.for("react.memo_cache_sentinel")?(t={width:"600px"},r[0]=t):t=r[0],r[1]===Symbol.for("react.memo_cache_sentinel")?(a=e(es,{lineNumbers:!0,"aria-label":"HTTP request"}),r[1]=a):a=r[1],r[2]!==i?(n=e($,{adapter:K,children:e("div",{style:t,children:e(ec,{value:i,onChange:s,language:"http","data-testid":"code-editor-http-request",children:a})})}),r[2]=i,r[3]=n):n=r[3],n},meta:ed},{name:"HttpFolds",story:()=>{let a,n,r,i,s,c,d,m,u,p=(0,l.c)(13),[h,f]=(0,o.useState)(ew),[y,g]=(0,o.useState)(eS);return p[0]===Symbol.for("react.memo_cache_sentinel")?(a=e("span",{className:"sb-annotation",children:"headers collapsed by default"}),n={width:"600px"},p[0]=a,p[1]=n):(a=p[0],n=p[1]),p[2]===Symbol.for("react.memo_cache_sentinel")?(r=e(es,{lineNumbers:!0,"aria-label":"Foldable HTTP request"}),p[2]=r):r=p[2],p[3]!==h?(i=t(er,{align:"start",gap:4,children:[a,e("div",{style:n,children:e(ec,{value:h,onChange:f,language:"http",folds:eP,"data-testid":"code-editor-http-folds-request",children:r})})]}),p[3]=h,p[4]=i):i=p[4],p[5]===Symbol.for("react.memo_cache_sentinel")?(s=e("span",{className:"sb-annotation",children:"startingLineNumber = 100"}),c={width:"600px"},p[5]=s,p[6]=c):(s=p[5],c=p[6]),p[7]===Symbol.for("react.memo_cache_sentinel")?(d=e(es,{lineNumbers:!0,"aria-label":"Foldable HTTP response"}),p[7]=d):d=p[7],p[8]!==y?(m=t(er,{align:"start",gap:4,children:[s,e("div",{style:c,children:e(ec,{value:y,onChange:g,language:"http",startingLineNumber:100,folds:eL,"data-testid":"code-editor-http-folds-response",children:d})})]}),p[8]=y,p[9]=m):m=p[9],p[10]!==i||p[11]!==m?(u=t(er,{gap:16,children:[i,m]}),p[10]=i,p[11]=m,p[12]=u):u=p[12],u},meta:ed},{name:"ShowMore",story:()=>{let a,n,r,o,i,s,c,d=(0,l.c)(7);return d[0]===Symbol.for("react.memo_cache_sentinel")?(a={display:"flex",flexDirection:"column",gap:"24px",width:"500px"},n=e("p",{className:"sb-annotation mb-8",children:"12 lines, clamped at 7 — 5 hidden"}),d[0]=a,d[1]=n):(a=d[0],n=d[1]),d[2]===Symbol.for("react.memo_cache_sentinel")?(r=t("div",{children:[n,e(ec,{defaultValue:e_,language:"text",maxLines:7,"data-testid":"code-editor-show-more",children:e(es,{"aria-label":"Request headers"})})]}),o=e("p",{className:"sb-annotation mb-8",children:"9 lines, clamped at 7 — 2 hidden, no button"}),d[2]=r,d[3]=o):(r=d[2],o=d[3]),d[4]===Symbol.for("react.memo_cache_sentinel")?(i=t("div",{children:[o,e(ec,{defaultValue:ev,language:"text",maxLines:7,"data-testid":"code-editor-show-more-threshold",children:e(es,{"aria-label":"Request headers"})})]}),s=e("p",{className:"sb-annotation mb-8",children:"the button rendered by hand"}),d[4]=i,d[5]=s):(i=d[4],s=d[5]),d[6]===Symbol.for("react.memo_cache_sentinel")?(c=t("div",{style:a,children:[r,i,t("div",{children:[s,t(ec,{defaultValue:e_,language:"text",maxLines:7,"data-testid":"code-editor-show-more-manual",children:[e(es,{"aria-label":"Request headers"}),e(U,{"data-analytics-id":"CODE_EDITOR_SHOW_MORE"})]})]})]}),d[6]=c):c=d[6],c},meta:ed},{name:"Wrap",story:()=>{let a,n,r,i,s,c,d,m,u,p,h,f,y=(0,l.c)(16),[g,b]=(0,o.useState)(!0);y[0]===Symbol.for("react.memo_cache_sentinel")?(a=e("span",{className:"sb-annotation",children:"no wrapping"}),n={width:"600px"},y[0]=a,y[1]=n):(a=y[0],n=y[1]),y[2]===Symbol.for("react.memo_cache_sentinel")?(r=t(er,{align:"start",gap:4,children:[a,e("div",{style:n,children:e(ec,{defaultValue:eC,language:"text",lines:eO,"data-testid":"code-editor-wrap-off",children:e(es,{lineNumbers:!0,"aria-label":"Long lines"})})})]}),y[2]=r):r=y[2],y[3]===Symbol.for("react.memo_cache_sentinel")?(i=e("span",{className:"sb-annotation",children:"defaultWrapLines + wrap button"}),s={width:"600px"},y[3]=i,y[4]=s):(i=y[3],s=y[4]),y[5]===Symbol.for("react.memo_cache_sentinel")?(c=t(er,{align:"start",gap:4,children:[i,e("div",{style:s,children:t(ec,{defaultValue:eC,language:"text",defaultWrapLines:!0,lines:eO,"data-testid":"code-editor-wrap-uncontrolled",children:[e(k,{children:e(G,{})}),e(es,{lineNumbers:!0,"aria-label":"Long lines, wrapped"})]})})]}),y[5]=c):c=y[5];let w=String(g);return y[6]!==w?(d=t("span",{className:"sb-annotation",children:["controlled — wrapLines = ",w]}),y[6]=w,y[7]=d):d=y[7],y[8]===Symbol.for("react.memo_cache_sentinel")?(m={width:"600px"},y[8]=m):m=y[8],y[9]===Symbol.for("react.memo_cache_sentinel")?(p=e(k,{children:e(G,{})}),u=e(es,{lineNumbers:!0,"aria-label":"Long lines, controlled wrap"}),y[9]=u,y[10]=p):(u=y[9],p=y[10]),y[11]!==g?(h=e("div",{style:m,children:t(ec,{defaultValue:eC,language:"text",wrapLines:g,onWrapLinesChange:b,"data-testid":"code-editor-wrap-controlled",children:[p,u]})}),y[11]=g,y[12]=h):h=y[12],y[13]!==h||y[14]!==d?(f=t(er,{gap:16,children:[r,c,t(er,{align:"start",gap:4,children:[d,h]})]}),y[13]=h,y[14]=d,y[15]=f):f=y[15],f},meta:ed},{name:"Sizes",story:()=>{let a,n,r,o,i,s,c,d,m,u=(0,l.c)(9);return u[0]===Symbol.for("react.memo_cache_sentinel")?(a=e("span",{className:"sb-annotation",children:"sm (default)"}),n={width:"600px"},u[0]=a,u[1]=n):(a=u[0],n=u[1]),u[2]===Symbol.for("react.memo_cache_sentinel")?(r=t(er,{align:"start",gap:4,children:[a,e("div",{style:n,children:e(ec,{defaultValue:eN,language:"bash",size:"sm","data-testid":"code-editor-size-sm",children:e(es,{lineNumbers:!0,"aria-label":"Install commands, small"})})})]}),u[2]=r):r=u[2],u[3]===Symbol.for("react.memo_cache_sentinel")?(o=e("span",{className:"sb-annotation",children:"md"}),i={width:"600px"},u[3]=o,u[4]=i):(o=u[3],i=u[4]),u[5]===Symbol.for("react.memo_cache_sentinel")?(s=t(er,{align:"start",gap:4,children:[o,e("div",{style:i,children:e(ec,{defaultValue:eN,language:"bash",size:"md","data-testid":"code-editor-size-md",children:e(es,{lineNumbers:!0,"aria-label":"Install commands, medium"})})})]}),u[5]=s):s=u[5],u[6]===Symbol.for("react.memo_cache_sentinel")?(c=e("span",{className:"sb-annotation",children:"lg"}),d={width:"600px"},u[6]=c,u[7]=d):(c=u[6],d=u[7]),u[8]===Symbol.for("react.memo_cache_sentinel")?(m=t(er,{gap:16,children:[r,s,t(er,{align:"start",gap:4,children:[c,e("div",{style:d,children:e(ec,{defaultValue:eN,language:"bash",size:"lg","data-testid":"code-editor-size-lg",children:e(es,{lineNumbers:!0,"aria-label":"Install commands, large"})})})]})]}),u[8]=m):m=u[8],m},meta:ed},{name:"ReadOnly",story:()=>{let a,n,r,o=(0,l.c)(3);return o[0]===Symbol.for("react.memo_cache_sentinel")?(a={width:"600px"},o[0]=a):a=o[0],o[1]===Symbol.for("react.memo_cache_sentinel")?(n=e(X,{children:"Response"}),o[1]=n):n=o[1],o[2]===Symbol.for("react.memo_cache_sentinel")?(r=e("div",{style:a,children:t(ec,{value:eb,language:"http",readOnly:!0,"data-testid":"code-editor-read-only",children:[t(z,{children:[n,e(k,{children:e(M,{})})]}),e(es,{lineNumbers:!0,"aria-label":"HTTP response, read only"})]})}),o[2]=r):r=o[2],r},meta:ed},{name:"Tabs",story:()=>{let a,n,r,i,s,c,d,m,u,p,h=(0,l.c)(17),[f,y]=(0,o.useState)("request"),[g,b]=(0,o.useState)(ex);h[0]===Symbol.for("react.memo_cache_sentinel")?(a={width:"600px"},h[0]=a):a=h[0];let w=g[f];return h[1]!==f?(n=e=>b(t=>({...t,[f]:e})),h[1]=f,h[2]=n):n=h[2],h[3]===Symbol.for("react.memo_cache_sentinel")?(r=e=>{("request"===e||"response"===e)&&y(e)},i=e(B,{value:"request","data-testid":"code-editor-tabs--tab-request",children:"Request"}),s=e(B,{value:"response","data-testid":"code-editor-tabs--tab-response",children:"Response"}),h[3]=r,h[4]=i,h[5]=s):(r=h[3],i=h[4],s=h[5]),h[6]!==f?(c=t(J,{value:f,onValueChange:r,children:[i,s]}),h[6]=f,h[7]=c):c=h[7],h[8]===Symbol.for("react.memo_cache_sentinel")?(d=e(k,{children:e(M,{})}),h[8]=d):d=h[8],h[9]!==c?(m=t(z,{children:[c,d]}),h[9]=c,h[10]=m):m=h[10],h[11]===Symbol.for("react.memo_cache_sentinel")?(u=e(es,{lineNumbers:!0,"aria-label":"HTTP message"}),h[11]=u):u=h[11],h[12]!==w||h[13]!==n||h[14]!==m||h[15]!==f?(p=e("div",{style:a,children:t(ec,{documentId:f,value:w,onChange:n,language:"http","data-testid":"code-editor-tabs",children:[m,u]})}),h[12]=w,h[13]=n,h[14]=m,h[15]=f,h[16]=p):p=h[16],p},meta:ed},{name:"ParityDefault",story:()=>{let t,a=(0,l.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=e(ek,{testId:"parity-default",code:eu,language:"text"}),a[0]=t):t=a[0],t},meta:ed},{name:"ParityLineColors",story:()=>{let t,a=(0,l.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=e(ek,{testId:"parity-line-colors",code:ep,language:"text",lines:eA}),a[0]=t):t=a[0],t},meta:ed},{name:"ParityFoldsCollapsed",story:()=>{let t,a=(0,l.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=e(ek,{testId:"parity-folds-collapsed",code:ew,language:"text",folds:eI}),a[0]=t):t=a[0],t},meta:ed},{name:"ParityHttpPrism",story:()=>{let t,a=(0,l.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=e($,{adapter:K,children:e(ek,{testId:"parity-http-prism",code:eg,language:"http"})}),a[0]=t):t=a[0],t},meta:ed},{name:"ParityRanges",story:()=>{let t,a=(0,l.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=e(ek,{testId:"parity-ranges",code:ey,language:"text",lines:eW}),a[0]=t):t=a[0],t},meta:ed},{name:"ParityWrap",story:()=>{let t,a=(0,l.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=e(ek,{testId:"parity-wrap",code:eC,language:"text",wrapLines:!0}),a[0]=t):t=a[0],t},meta:ed},{name:"ParitySizes",story:()=>{let a,n=(0,l.c)(1);return n[0]===Symbol.for("react.memo_cache_sentinel")?(a=t(er,{gap:24,children:[e(ek,{testId:"parity-size-sm",code:eN,language:"bash",size:"sm"}),e(ek,{testId:"parity-size-md",code:eN,language:"bash",size:"md"}),e(ek,{testId:"parity-size-lg",code:eN,language:"bash",size:"lg"})]}),n[0]=a):a=n[0],a},meta:ed},{name:"ParityFrame",story:()=>{let a,n=(0,l.c)(1);return n[0]===Symbol.for("react.memo_cache_sentinel")?(a=t(er,{gap:24,children:[e(ek,{testId:"parity-frame-header",code:eu,language:"text",children:e$}),e(ek,{testId:"parity-frame-floating",code:eu,language:"text",children:eH})]}),n[0]=a):a=n[0],a},meta:ed},{name:"ParityShowMore",story:()=>{let t,a=(0,l.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=e(ek,{testId:"parity-show-more",code:e_,language:"text",maxLines:7}),a[0]=t):t=a[0],t},meta:ed},{name:"Diff",story:()=>{let t,a,n=(0,l.c)(3),[r,i]=(0,o.useState)(eM);return n[0]===Symbol.for("react.memo_cache_sentinel")?(t=e(es,{"aria-label":"Request draft compared with the stored request",lineNumbers:!0}),n[0]=t):t=n[0],n[1]!==r?(a=e(ec,{"data-testid":"code-editor-diff",language:"http",original:ej,value:r,onChange:i,children:t}),n[1]=r,n[2]=a):a=n[2],a},meta:ed},{name:"DiffWrapLines",story:()=>{let t,a,n=(0,l.c)(3),[r,i]=(0,o.useState)(ez);return n[0]===Symbol.for("react.memo_cache_sentinel")?(t=e(es,{"aria-label":"Request without the debug header",lineNumbers:!0}),n[0]=t):t=n[0],n[1]!==r?(a=e("div",{className:"w-480",children:e(ec,{"data-testid":"code-editor-diff-wrap",language:"http",original:eq,value:r,onChange:i,defaultWrapLines:!0,children:t})}),n[1]=r,n[2]=a):a=n[2],a},meta:ed},{name:"AnalyticsAttributes",story:()=>{let a,n,r=(0,l.c)(2);return r[0]===Symbol.for("react.memo_cache_sentinel")?(a=e(X,{children:"Request"}),r[0]=a):a=r[0],r[1]===Symbol.for("react.memo_cache_sentinel")?(n=t(ec,{"data-testid":"analytics-editor",language:"http",defaultValue:eV,folds:eF,children:[t(z,{children:[a,t(k,{children:[e(M,{"data-analytics-id":"CODE_EDITOR_COPY"}),e(G,{"data-analytics-id":"CODE_EDITOR_WRAP"}),e(q,{"data-analytics-id":"CODE_EDITOR_FULLSCREEN"})]})]}),e(es,{"aria-label":"HTTP request",lineNumbers:!0,"data-analytics-id":"CODE_EDITOR_REQUEST","data-analytics-props":'{"surface":"rule-editor"}'})]}),r[1]=n):n=r[1],n},meta:ed},{name:"EditingWorkflow",story:()=>{let t,a=(0,l.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=e(v,{}),a[0]=t):t=a[0],t},meta:ed},{name:"TabsKeepHistory",story:()=>{let t,a=(0,l.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=e(O,{}),a[0]=t):t=a[0],t},meta:ed},{name:"LongDocument",story:()=>{let t,a=(0,l.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=e(x,{}),a[0]=t):t=a[0],t},meta:ed},{name:"FullscreenInsideDrawer",story:()=>{let a,n,r,i,s,c,d=(0,l.c)(7),[m,u]=(0,o.useState)(em);return d[0]===Symbol.for("react.memo_cache_sentinel")?(a=e(en,{asChild:!0,children:e(I,{variant:"outline",color:"neutral",children:"Open Drawer"})}),d[0]=a):a=d[0],d[1]===Symbol.for("react.memo_cache_sentinel")?(n=e(et,{children:e(ea,{children:"Rule"})}),d[1]=n):n=d[1],d[2]===Symbol.for("react.memo_cache_sentinel")?(r=e(X,{children:"rule.json"}),d[2]=r):r=d[2],d[3]===Symbol.for("react.memo_cache_sentinel")?(i=t(z,{children:[r,t(k,{children:[e(q,{}),e(M,{})]})]}),s=e(es,{lineNumbers:!0,"aria-label":"Rule JSON"}),d[3]=i,d[4]=s):(i=d[3],s=d[4]),d[5]!==m?(c=t(Z,{children:[a,t(ee,{children:[n,e(Q,{children:t(ec,{value:m,onChange:u,language:"json",children:[i,s]})})]})]}),d[5]=m,d[6]=c):c=d[6],c},meta:ed}];function eB({entry:e}){let{story:t,meta:a}=e,n={...a.args,...t.args},r="function"==typeof t||t.$$typeof?t:t.render||a.render||a.component,l=()=>o.default.createElement(r,n),i={args:n,globals:{theme:"light"},parameters:{...a.parameters,...t.parameters},viewMode:"story"};for(let e of[...a.decorators||[],...t.decorators||[]].reverse()){let t=l;l=()=>e(t,i)}return o.default.createElement("section",{"data-preview-story":e.name,className:"p-16"},o.default.createElement("h2",{className:"text-sm mb-12"},e.name),o.default.createElement(l))}window.WallarmPreview={mount(e){let t=window.ReactDOM.createRoot(e);return t.render(o.default.createElement(window.WallarmDS.Root,null,eU.map((e,t)=>o.default.createElement(eB,{key:t,entry:e})))),t}}})();
|
|
@@ -65,10 +65,6 @@ const meta = {
|
|
|
65
65
|
parameters: {
|
|
66
66
|
layout: 'padded',
|
|
67
67
|
docs: { description: { component: DESCRIPTION } },
|
|
68
|
-
design: {
|
|
69
|
-
type: 'figma',
|
|
70
|
-
url: 'https://www.figma.com/design/VKb5gW46uSGw0rqrhZsbXT/WADS-Components?node-id=3087-29516&m=dev',
|
|
71
|
-
},
|
|
72
68
|
},
|
|
73
69
|
tags: ['autodocs'],
|
|
74
70
|
} satisfies Meta<typeof CodeEditorRoot>;
|
|
@@ -287,10 +287,6 @@ const meta = {
|
|
|
287
287
|
parameters: {
|
|
288
288
|
layout: 'padded',
|
|
289
289
|
docs: { description: { component: DESCRIPTION } },
|
|
290
|
-
design: {
|
|
291
|
-
type: 'figma',
|
|
292
|
-
url: 'https://www.figma.com/design/VKb5gW46uSGw0rqrhZsbXT/WADS-Components?node-id=3087-29516&m=dev',
|
|
293
|
-
},
|
|
294
290
|
},
|
|
295
291
|
tags: ['autodocs'],
|
|
296
292
|
} satisfies Meta<typeof CodeSnippetRoot>;
|
|
@@ -1260,10 +1256,6 @@ const meta = {
|
|
|
1260
1256
|
component: InlineCodeSnippet,
|
|
1261
1257
|
parameters: {
|
|
1262
1258
|
layout: 'centered',
|
|
1263
|
-
design: {
|
|
1264
|
-
type: 'figma',
|
|
1265
|
-
url: 'https://www.figma.com/design/VKb5gW46uSGw0rqrhZsbXT/WADS-Components?node-id=3087-29516&m=dev',
|
|
1266
|
-
},
|
|
1267
1259
|
docs: { description: { component: DESCRIPTION } },
|
|
1268
1260
|
},
|
|
1269
1261
|
tags: ['autodocs'],
|
|
@@ -9,7 +9,7 @@ var e={vD(e,t,n){let a,r;/**
|
|
|
9
9
|
* @nolint
|
|
10
10
|
* @preventMunge
|
|
11
11
|
* @preserve-invariant-messages
|
|
12
|
-
*/var o,l,i=Object.create,c=Object.defineProperty,s=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,m=Object.getPrototypeOf,p=Object.prototype.hasOwnProperty,h=(e,t,n,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of d(t))p.call(e,r)||r===n||c(e,r,{get:()=>t[r],enumerable:!(a=s(t,r))||a.enumerable});return e},u={},f={$dispatcherGuard:()=>W,$makeReadOnly:()=>I,$reset:()=>R,$structuralCheck:()=>O,c:()=>v,clearRenderCounterRegistry:()=>A,renderCounterRegistry:()=>E,useRenderCounter:()=>k};for(var y in f)c(u,y,{get:f[y],enumerable:!0});e.exports=h(c({},"__esModule",{value:!0}),u);var g=(r=null!=(a=n("C"))?i(m(a)):{},h(a&&a.__esModule?r:c(r,"default",{value:a,enumerable:!0}),a)),{useRef:w,useEffect:b,isValidElement:_}=g,S=null!=(o=g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE)?o:g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,x=Symbol.for("react.memo_cache_sentinel"),v="function"==typeof(null==(l=g.__COMPILER_RUNTIME)?void 0:l.c)?g.__COMPILER_RUNTIME.c:function(e){return g.useMemo(()=>{let t=Array(e);for(let n=0;n<e;n++)t[n]=x;return t[x]=!0,t},[])},C={};["readContext","useCallback","useContext","useEffect","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useReducer","useRef","useState","useDebugValue","useDeferredValue","useTransition","useMutableSource","useSyncExternalStore","useId","unstable_isNewReconciler","getCacheSignal","getCacheForType","useCacheRefresh"].forEach(e=>{C[e]=()=>{throw Error(`[React] Unexpected React hook call (${e}) from a React compiled function. Check that all hooks are called directly and named according to convention ('use[A-Z]') `)}});var N=null;function T(e){return S.ReactCurrentDispatcher.current=e,S.ReactCurrentDispatcher.current}C.useMemoCache=e=>{if(null!=N)return N.useMemoCache(e);throw Error("React Compiler internal invariant violation: unexpected null dispatcher")};var D=[];function W(e){let t=S.ReactCurrentDispatcher.current;if(0===e){if(D.push(t),1===D.length&&(N=t),t===C)throw Error("[React] Unexpected call to custom hook or component from a React compiled function. Check that (1) all hooks are called directly and named according to convention ('use[A-Z]') and (2) components are returned as JSX instead of being directly invoked.");T(C)}else if(1===e){let e=D.pop();if(null==e)throw Error("React Compiler internal error: unexpected null in guard stack");0===D.length&&(N=null),T(e)}else if(2===e)D.push(t),T(N);else if(3===e){let e=D.pop();if(null==e)throw Error("React Compiler internal error: unexpected null in guard stack");T(e)}else throw Error("React Compiler internal error: unreachable block"+e)}function R(e){for(let t=0;t<e.length;t++)e[t]=x}function I(){throw Error("TODO: implement $makeReadOnly in react-compiler-runtime")}var E=new Map;function A(){for(let e of E.values())e.forEach(e=>{e.count=0})}function k(e){let t=w(null);null!=t.current&&(t.current.count+=1),b(()=>{if(null==t.current){let n,a={count:0};null==(n=E.get(e))&&(n=new Set,E.set(e,n)),n.add(a),t.current=a}return()=>{var n;let a;null!==t.current&&(n=t.current,null!=(a=E.get(e))&&a.delete(n))}})}var L=new Set;function O(e,t,n,a,r,o){function l(e,t,l,i){let c=`${a}:${o} [${r}] ${n}${l} changed from ${e} to ${t} at depth ${i}`;L.has(c)||(L.add(c),console.error(c))}!function e(t,n,a,r){if(!(r>2)){if(t!==n)if(typeof t!=typeof n)l(`type ${typeof t}`,`type ${typeof n}`,a,r);else if("object"==typeof t){let o=Array.isArray(t),i=Array.isArray(n);if(null===t&&null!==n)l("null",`type ${typeof n}`,a,r);else if(null===n)l(`type ${typeof t}`,"null",a,r);else if(t instanceof Map)if(n instanceof Map)if(t.size!==n.size)l(`Map instance with size ${t.size}`,`Map instance with size ${n.size}`,a,r);else for(let[o,i]of t)n.has(o)?e(i,n.get(o),`${a}.get(${o})`,r+1):l(`Map instance with key ${o}`,`Map instance without key ${o}`,a,r);else l("Map instance","other value",a,r);else if(n instanceof Map)l("other value","Map instance",a,r);else if(t instanceof Set)if(n instanceof Set)if(t.size!==n.size)l(`Set instance with size ${t.size}`,`Set instance with size ${n.size}`,a,r);else for(let e of n)t.has(e)||l(`Set instance without element ${e}`,`Set instance with element ${e}`,a,r);else l("Set instance","other value",a,r);else if(n instanceof Set)l("other value","Set instance",a,r);else if(o||i)if(o!==i)l(`type ${o?"array":"object"}`,`type ${i?"array":"object"}`,a,r);else if(t.length!==n.length)l(`array with length ${t.length}`,`array with length ${n.length}`,a,r);else for(let o=0;o<t.length;o++)e(t[o],n[o],`${a}[${o}]`,r+1);else if(_(t)||_(n))_(t)!==_(n)?l(`type ${_(t)?"React element":"object"}`,`type ${_(n)?"React element":"object"}`,a,r):t.type!==n.type?l(`React element of type ${t.type}`,`React element of type ${n.type}`,a,r):e(t.props,n.props,`[props of ${a}]`,r+1);else{for(let e in n)e in t||l(`object without key ${e}`,`object with key ${e}`,a,r);for(let o in t)o in n?e(t[o],n[o],`${a}.${o}`,r+1):l(`object with key ${o}`,`object without key ${o}`,a,r)}}else{if("function"==typeof t)return;isNaN(t)||isNaN(n)?isNaN(t)!==isNaN(n)&&l(`${isNaN(t)?"NaN":"non-NaN value"}`,`${isNaN(n)?"NaN":"non-NaN value"}`,a,r):t!==n&&l(t,n,a,r)}}}(e,t,"",0)}},p(e,t,n){let a=new WeakMap,r=new WeakMap;function o(e,t,n){let o=t,l=n;if("object"==typeof o&&null!==o&&"$$typeof"in o&&o.$$typeof===Symbol.for("react.context")&&"Provider"in o&&(o=o.Provider),"function"==typeof o&&null!=l.ref&&!o.prototype?.isReactComponent){let t=o,n=a.get(e);n||(n=new WeakMap,a.set(e,n));let r=n.get(t);r||((r=e.forwardRef((e,n)=>t({...e,ref:n}))).displayName=t.displayName??t.name,n.set(t,r)),o=r}if("string"==typeof o&&"boolean"==typeof l.inert&&((l={...l}).inert?l.inert="":delete l.inert),"string"==typeof o)for(let[e,t]of[["fill-rule","fillRule"],["clip-rule","clipRule"]])e in l&&(l={...l,[t]:l[e]},delete l[e]);return"string"==typeof o&&null!=l.ref&&(o=function(e,t){let n=r.get(e);n||(n=new Map,r.set(e,n));let a=n.get(t);if(a)return a;let o=e.forwardRef((n,a)=>{let r=e.useRef(null);if(!r.current||r.current.original!==a){let e;r.current={original:a,callback:t=>{if(null==t&&e){let t=e;e=void 0,t();return}if("function"==typeof a){let n=a(t);e="function"==typeof n?n:void 0}else a&&(a.current=t)}}}return e.createElement(t,{...n,ref:r.current.callback})});return o.displayName=`CanvasHost(${t})`,n.set(t,o),o}(e,o)),{type:o,props:l}}function l(e){let t=(t,n,a)=>{let r=o(e,t,n??{});return e.createElement(r.type,void 0===a?r.props:{...r.props,key:a})};return{jsx:t,jsxs:(t,n,a)=>{let r=o(e,t,n??{}),{children:l,...i}=r.props;return e.createElement(r.type,void 0===a?i:{...i,key:a},...Array.isArray(l)?l:[l])},jsxDEV:t,Fragment:e.Fragment}}function i(e){return{...e,createElement:(t,n,...a)=>{let r=o(e,t,n??{});return e.createElement(r.type,r.props,...a)},cloneElement:(t,n,...a)=>{let r=e.cloneElement(t,n??void 0,...a),l=r.ref,i=o(e,r.type,{...r.props,ref:l});return i.type===r.type&&"string"!=typeof r.type?r:e.createElement(i.type,{...i.props,key:r.key})}}}n.d(t,{MA:()=>l,YJ:()=>i})},C(e,t,n){n.r(t);let a=(0,n("p").YJ)(window.React),{Children:r,Component:o,Fragment:l,Profiler:i,PureComponent:c,StrictMode:s,Suspense:d,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:m,act:p,cloneElement:h,createContext:u,createElement:f,createFactory:y,createRef:g,forwardRef:w,isValidElement:b,lazy:_,memo:S,startTransition:x,unstable_act:v,useCallback:C,useContext:N,useDebugValue:T,useDeferredValue:D,useEffect:W,useId:R,useImperativeHandle:I,useInsertionEffect:E,useLayoutEffect:A,useMemo:k,useReducer:L,useRef:O,useState:$,useSyncExternalStore:M,useTransition:j,version:z,use:P}=a;n.d(t,{},{Children:r,Component:o,Fragment:l,Profiler:i,PureComponent:c,StrictMode:s,Suspense:d,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:m,act:p,cloneElement:h,createContext:u,createElement:f,createFactory:y,createRef:g,default:a,forwardRef:w,isValidElement:b,lazy:_,memo:S,startTransition:x,unstable_act:v,use:P,useCallback:C,useContext:N,useDebugValue:T,useDeferredValue:D,useEffect:W,useId:R,useImperativeHandle:I,useInsertionEffect:E,useLayoutEffect:A,useMemo:k,useReducer:L,useRef:O,useState:$,useSyncExternalStore:M,useTransition:j,version:z})}},t={};function n(a){var r=t[a];if(void 0!==r)return r.exports;var o=t[a]={exports:{}};return e[a](o,o.exports,n),o.exports}n.d=(e,t,a)=>{var r=(t,a)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,[a]:t[r]})};r(t,"get"),r(a,"value")},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{let{jsx:e,jsxs:t,jsxDEV:a,Fragment:r}=(0,n("p").MA)(window.React);var o=n("vD"),l=n("C");let i=window.WallarmDS.Icons.Info,c=window.WallarmDS.Icons.Skull,s=window.WallarmDS.Icons.TriangleAlert,d=window.WallarmDS.Button,m=window.WallarmDS.Drawer,p=window.WallarmDS.DrawerBody,h=window.WallarmDS.DrawerContent,u=window.WallarmDS.DrawerHeader,f=window.WallarmDS.DrawerTitle,y=window.WallarmDS.DrawerTrigger,g=window.WallarmDS.VStack,w=window.WallarmDS.Tooltip,b=window.WallarmDS.TooltipContent,_=window.WallarmDS.TooltipTrigger;window.WallarmDS.loadHighlightJsAdapter;let S=window.WallarmDS.loadPrismAdapter;window.WallarmDS.loadShikiAdapter;let x=window.WallarmDS.CodeSnippetActions,v=window.WallarmDS.CodeSnippetAdapterProvider,C=window.WallarmDS.CodeSnippetCode,N=window.WallarmDS.CodeSnippetContent,T=window.WallarmDS.CodeSnippetCopyButton,D=window.WallarmDS.CodeSnippetFullscreenButton,W=window.WallarmDS.CodeSnippetHeader,R=window.WallarmDS.CodeSnippetLineNumbers,I=window.WallarmDS.CodeSnippetRoot,E=window.WallarmDS.CodeSnippetShowMoreButton,A=window.WallarmDS.CodeSnippetTab,k=window.WallarmDS.CodeSnippetTabs,L=window.WallarmDS.CodeSnippetTitle,O=window.WallarmDS.CodeSnippetWrapButton,$=window.WallarmDS.getHttpFolds,M={title:"Data Display/CodeSnippet/CodeSnippet",component:I,parameters:{layout:"padded",docs:{description:{component:"A block of code to be read and copied, never edited — reach for `InlineCodeSnippet` when the code belongs inside a sentence, and a real editor when the value is meant to change. Everything beyond the code is composed: a `CodeSnippetHeader` carrying a title or tabs, `CodeSnippetActions` for copy, wrap and fullscreen, `CodeSnippetLineNumbers`, and per-line colour, prefixes and folds — and highlighting happens only inside a `CodeSnippetAdapterProvider`. The snippet sits inside a `display: contents` wrapper that keeps it mounted across fullscreen, so space snippets with their own `className` (for example `mt-16`) or a `gap` on the parent — not `space-*`, `divide-*` or child selectors on the parent."}},design:{type:"figma",url:"https://www.figma.com/design/VKb5gW46uSGw0rqrhZsbXT/WADS-Components?node-id=3087-29516&m=dev"}},tags:["autodocs"]},j=`const greeting = "Hello, World!";
|
|
12
|
+
*/var o,l,i=Object.create,c=Object.defineProperty,s=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,m=Object.getPrototypeOf,p=Object.prototype.hasOwnProperty,h=(e,t,n,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of d(t))p.call(e,r)||r===n||c(e,r,{get:()=>t[r],enumerable:!(a=s(t,r))||a.enumerable});return e},u={},f={$dispatcherGuard:()=>W,$makeReadOnly:()=>I,$reset:()=>R,$structuralCheck:()=>O,c:()=>v,clearRenderCounterRegistry:()=>A,renderCounterRegistry:()=>E,useRenderCounter:()=>k};for(var y in f)c(u,y,{get:f[y],enumerable:!0});e.exports=h(c({},"__esModule",{value:!0}),u);var g=(r=null!=(a=n("C"))?i(m(a)):{},h(a&&a.__esModule?r:c(r,"default",{value:a,enumerable:!0}),a)),{useRef:w,useEffect:b,isValidElement:_}=g,S=null!=(o=g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE)?o:g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,x=Symbol.for("react.memo_cache_sentinel"),v="function"==typeof(null==(l=g.__COMPILER_RUNTIME)?void 0:l.c)?g.__COMPILER_RUNTIME.c:function(e){return g.useMemo(()=>{let t=Array(e);for(let n=0;n<e;n++)t[n]=x;return t[x]=!0,t},[])},C={};["readContext","useCallback","useContext","useEffect","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useReducer","useRef","useState","useDebugValue","useDeferredValue","useTransition","useMutableSource","useSyncExternalStore","useId","unstable_isNewReconciler","getCacheSignal","getCacheForType","useCacheRefresh"].forEach(e=>{C[e]=()=>{throw Error(`[React] Unexpected React hook call (${e}) from a React compiled function. Check that all hooks are called directly and named according to convention ('use[A-Z]') `)}});var N=null;function T(e){return S.ReactCurrentDispatcher.current=e,S.ReactCurrentDispatcher.current}C.useMemoCache=e=>{if(null!=N)return N.useMemoCache(e);throw Error("React Compiler internal invariant violation: unexpected null dispatcher")};var D=[];function W(e){let t=S.ReactCurrentDispatcher.current;if(0===e){if(D.push(t),1===D.length&&(N=t),t===C)throw Error("[React] Unexpected call to custom hook or component from a React compiled function. Check that (1) all hooks are called directly and named according to convention ('use[A-Z]') and (2) components are returned as JSX instead of being directly invoked.");T(C)}else if(1===e){let e=D.pop();if(null==e)throw Error("React Compiler internal error: unexpected null in guard stack");0===D.length&&(N=null),T(e)}else if(2===e)D.push(t),T(N);else if(3===e){let e=D.pop();if(null==e)throw Error("React Compiler internal error: unexpected null in guard stack");T(e)}else throw Error("React Compiler internal error: unreachable block"+e)}function R(e){for(let t=0;t<e.length;t++)e[t]=x}function I(){throw Error("TODO: implement $makeReadOnly in react-compiler-runtime")}var E=new Map;function A(){for(let e of E.values())e.forEach(e=>{e.count=0})}function k(e){let t=w(null);null!=t.current&&(t.current.count+=1),b(()=>{if(null==t.current){let n,a={count:0};null==(n=E.get(e))&&(n=new Set,E.set(e,n)),n.add(a),t.current=a}return()=>{var n;let a;null!==t.current&&(n=t.current,null!=(a=E.get(e))&&a.delete(n))}})}var L=new Set;function O(e,t,n,a,r,o){function l(e,t,l,i){let c=`${a}:${o} [${r}] ${n}${l} changed from ${e} to ${t} at depth ${i}`;L.has(c)||(L.add(c),console.error(c))}!function e(t,n,a,r){if(!(r>2)){if(t!==n)if(typeof t!=typeof n)l(`type ${typeof t}`,`type ${typeof n}`,a,r);else if("object"==typeof t){let o=Array.isArray(t),i=Array.isArray(n);if(null===t&&null!==n)l("null",`type ${typeof n}`,a,r);else if(null===n)l(`type ${typeof t}`,"null",a,r);else if(t instanceof Map)if(n instanceof Map)if(t.size!==n.size)l(`Map instance with size ${t.size}`,`Map instance with size ${n.size}`,a,r);else for(let[o,i]of t)n.has(o)?e(i,n.get(o),`${a}.get(${o})`,r+1):l(`Map instance with key ${o}`,`Map instance without key ${o}`,a,r);else l("Map instance","other value",a,r);else if(n instanceof Map)l("other value","Map instance",a,r);else if(t instanceof Set)if(n instanceof Set)if(t.size!==n.size)l(`Set instance with size ${t.size}`,`Set instance with size ${n.size}`,a,r);else for(let e of n)t.has(e)||l(`Set instance without element ${e}`,`Set instance with element ${e}`,a,r);else l("Set instance","other value",a,r);else if(n instanceof Set)l("other value","Set instance",a,r);else if(o||i)if(o!==i)l(`type ${o?"array":"object"}`,`type ${i?"array":"object"}`,a,r);else if(t.length!==n.length)l(`array with length ${t.length}`,`array with length ${n.length}`,a,r);else for(let o=0;o<t.length;o++)e(t[o],n[o],`${a}[${o}]`,r+1);else if(_(t)||_(n))_(t)!==_(n)?l(`type ${_(t)?"React element":"object"}`,`type ${_(n)?"React element":"object"}`,a,r):t.type!==n.type?l(`React element of type ${t.type}`,`React element of type ${n.type}`,a,r):e(t.props,n.props,`[props of ${a}]`,r+1);else{for(let e in n)e in t||l(`object without key ${e}`,`object with key ${e}`,a,r);for(let o in t)o in n?e(t[o],n[o],`${a}.${o}`,r+1):l(`object with key ${o}`,`object without key ${o}`,a,r)}}else{if("function"==typeof t)return;isNaN(t)||isNaN(n)?isNaN(t)!==isNaN(n)&&l(`${isNaN(t)?"NaN":"non-NaN value"}`,`${isNaN(n)?"NaN":"non-NaN value"}`,a,r):t!==n&&l(t,n,a,r)}}}(e,t,"",0)}},p(e,t,n){let a=new WeakMap,r=new WeakMap;function o(e,t,n){let o=t,l=n;if("object"==typeof o&&null!==o&&"$$typeof"in o&&o.$$typeof===Symbol.for("react.context")&&"Provider"in o&&(o=o.Provider),"function"==typeof o&&null!=l.ref&&!o.prototype?.isReactComponent){let t=o,n=a.get(e);n||(n=new WeakMap,a.set(e,n));let r=n.get(t);r||((r=e.forwardRef((e,n)=>t({...e,ref:n}))).displayName=t.displayName??t.name,n.set(t,r)),o=r}if("string"==typeof o&&"boolean"==typeof l.inert&&((l={...l}).inert?l.inert="":delete l.inert),"string"==typeof o)for(let[e,t]of[["fill-rule","fillRule"],["clip-rule","clipRule"]])e in l&&(l={...l,[t]:l[e]},delete l[e]);return"string"==typeof o&&null!=l.ref&&(o=function(e,t){let n=r.get(e);n||(n=new Map,r.set(e,n));let a=n.get(t);if(a)return a;let o=e.forwardRef((n,a)=>{let r=e.useRef(null);if(!r.current||r.current.original!==a){let e;r.current={original:a,callback:t=>{if(null==t&&e){let t=e;e=void 0,t();return}if("function"==typeof a){let n=a(t);e="function"==typeof n?n:void 0}else a&&(a.current=t)}}}return e.createElement(t,{...n,ref:r.current.callback})});return o.displayName=`CanvasHost(${t})`,n.set(t,o),o}(e,o)),{type:o,props:l}}function l(e){let t=(t,n,a)=>{let r=o(e,t,n??{});return e.createElement(r.type,void 0===a?r.props:{...r.props,key:a})};return{jsx:t,jsxs:(t,n,a)=>{let r=o(e,t,n??{}),{children:l,...i}=r.props;return e.createElement(r.type,void 0===a?i:{...i,key:a},...Array.isArray(l)?l:[l])},jsxDEV:t,Fragment:e.Fragment}}function i(e){return{...e,createElement:(t,n,...a)=>{let r=o(e,t,n??{});return e.createElement(r.type,r.props,...a)},cloneElement:(t,n,...a)=>{let r=e.cloneElement(t,n??void 0,...a),l=r.ref,i=o(e,r.type,{...r.props,ref:l});return i.type===r.type&&"string"!=typeof r.type?r:e.createElement(i.type,{...i.props,key:r.key})}}}n.d(t,{MA:()=>l,YJ:()=>i})},C(e,t,n){n.r(t);let a=(0,n("p").YJ)(window.React),{Children:r,Component:o,Fragment:l,Profiler:i,PureComponent:c,StrictMode:s,Suspense:d,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:m,act:p,cloneElement:h,createContext:u,createElement:f,createFactory:y,createRef:g,forwardRef:w,isValidElement:b,lazy:_,memo:S,startTransition:x,unstable_act:v,useCallback:C,useContext:N,useDebugValue:T,useDeferredValue:D,useEffect:W,useId:R,useImperativeHandle:I,useInsertionEffect:E,useLayoutEffect:A,useMemo:k,useReducer:L,useRef:O,useState:$,useSyncExternalStore:M,useTransition:j,version:z,use:P}=a;n.d(t,{},{Children:r,Component:o,Fragment:l,Profiler:i,PureComponent:c,StrictMode:s,Suspense:d,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:m,act:p,cloneElement:h,createContext:u,createElement:f,createFactory:y,createRef:g,default:a,forwardRef:w,isValidElement:b,lazy:_,memo:S,startTransition:x,unstable_act:v,use:P,useCallback:C,useContext:N,useDebugValue:T,useDeferredValue:D,useEffect:W,useId:R,useImperativeHandle:I,useInsertionEffect:E,useLayoutEffect:A,useMemo:k,useReducer:L,useRef:O,useState:$,useSyncExternalStore:M,useTransition:j,version:z})}},t={};function n(a){var r=t[a];if(void 0!==r)return r.exports;var o=t[a]={exports:{}};return e[a](o,o.exports,n),o.exports}n.d=(e,t,a)=>{var r=(t,a)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,[a]:t[r]})};r(t,"get"),r(a,"value")},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{let{jsx:e,jsxs:t,jsxDEV:a,Fragment:r}=(0,n("p").MA)(window.React);var o=n("vD"),l=n("C");let i=window.WallarmDS.Icons.Info,c=window.WallarmDS.Icons.Skull,s=window.WallarmDS.Icons.TriangleAlert,d=window.WallarmDS.Button,m=window.WallarmDS.Drawer,p=window.WallarmDS.DrawerBody,h=window.WallarmDS.DrawerContent,u=window.WallarmDS.DrawerHeader,f=window.WallarmDS.DrawerTitle,y=window.WallarmDS.DrawerTrigger,g=window.WallarmDS.VStack,w=window.WallarmDS.Tooltip,b=window.WallarmDS.TooltipContent,_=window.WallarmDS.TooltipTrigger;window.WallarmDS.loadHighlightJsAdapter;let S=window.WallarmDS.loadPrismAdapter;window.WallarmDS.loadShikiAdapter;let x=window.WallarmDS.CodeSnippetActions,v=window.WallarmDS.CodeSnippetAdapterProvider,C=window.WallarmDS.CodeSnippetCode,N=window.WallarmDS.CodeSnippetContent,T=window.WallarmDS.CodeSnippetCopyButton,D=window.WallarmDS.CodeSnippetFullscreenButton,W=window.WallarmDS.CodeSnippetHeader,R=window.WallarmDS.CodeSnippetLineNumbers,I=window.WallarmDS.CodeSnippetRoot,E=window.WallarmDS.CodeSnippetShowMoreButton,A=window.WallarmDS.CodeSnippetTab,k=window.WallarmDS.CodeSnippetTabs,L=window.WallarmDS.CodeSnippetTitle,O=window.WallarmDS.CodeSnippetWrapButton,$=window.WallarmDS.getHttpFolds,M={title:"Data Display/CodeSnippet/CodeSnippet",component:I,parameters:{layout:"padded",docs:{description:{component:"A block of code to be read and copied, never edited — reach for `InlineCodeSnippet` when the code belongs inside a sentence, and a real editor when the value is meant to change. Everything beyond the code is composed: a `CodeSnippetHeader` carrying a title or tabs, `CodeSnippetActions` for copy, wrap and fullscreen, `CodeSnippetLineNumbers`, and per-line colour, prefixes and folds — and highlighting happens only inside a `CodeSnippetAdapterProvider`. The snippet sits inside a `display: contents` wrapper that keeps it mounted across fullscreen, so space snippets with their own `className` (for example `mt-16`) or a `gap` on the parent — not `space-*`, `divide-*` or child selectors on the parent."}}},tags:["autodocs"]},j=`const greeting = "Hello, World!";
|
|
13
13
|
console.log(greeting);
|
|
14
14
|
|
|
15
15
|
function add(a, b) {
|
|
@@ -153,4 +153,4 @@ Cache-Control: private, max-age=0
|
|
|
153
153
|
"page": 1,
|
|
154
154
|
"limit": 50
|
|
155
155
|
}
|
|
156
|
-
}`,Y=window.WallarmDS.VStack,K=window.WallarmDS.InlineCodeSnippet,Z={title:"Data Display/CodeSnippet/InlineCodeSnippet",component:K,parameters:{layout:"centered",design:{type:"figma",url:"https://www.figma.com/design/VKb5gW46uSGw0rqrhZsbXT/WADS-Components?node-id=3087-29516&m=dev"},docs:{description:{component:"A fragment of code inside a sentence, copied by clicking it — reach for `Code` when the text only needs the mono treatment, and `CodeSnippet` when it needs syntax highlighting, a header or line numbers. It takes its size from the text around it, so a snippet in a caption stays the size of the caption; keep it to a single line so the sentence still reads."}}},tags:["autodocs"]},Q=[{name:"Default",story:()=>{let t,n=(0,o.c)(1);return n[0]===Symbol.for("react.memo_cache_sentinel")?(t=e(I,{code:z,language:"text",children:e(N,{children:e(C,{})})}),n[0]=t):t=n[0],t},meta:M},{name:"WithLineNumbers",story:()=>{let n,a=(0,o.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(n=e(I,{code:j,language:"text",children:t(N,{children:[e(R,{}),e(C,{})]})}),a[0]=n):n=a[0],n},meta:M},{name:"Sizes",story:()=>{let n,a,r,l,i,c,s=(0,o.c)(6);return s[0]===Symbol.for("react.memo_cache_sentinel")?(n=e("span",{className:"sb-annotation",children:"sm (default)"}),s[0]=n):n=s[0],s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t(g,{align:"start",gap:4,children:[n,e(I,{code:z,language:"text",size:"sm",children:e(N,{children:e(C,{})})})]}),s[1]=a):a=s[1],s[2]===Symbol.for("react.memo_cache_sentinel")?(r=e("span",{className:"sb-annotation",children:"md"}),s[2]=r):r=s[2],s[3]===Symbol.for("react.memo_cache_sentinel")?(l=t(g,{align:"start",gap:4,children:[r,e(I,{code:z,language:"text",size:"md",children:e(N,{children:e(C,{})})})]}),s[3]=l):l=s[3],s[4]===Symbol.for("react.memo_cache_sentinel")?(i=e("span",{className:"sb-annotation",children:"lg"}),s[4]=i):i=s[4],s[5]===Symbol.for("react.memo_cache_sentinel")?(c=t(g,{gap:16,children:[a,l,t(g,{align:"start",gap:4,children:[i,e(I,{code:z,language:"text",size:"lg",children:e(N,{children:e(C,{})})})]})]}),s[5]=c):c=s[5],c},meta:M},{name:"LineAnnotations",story:()=>{let n,a,r,l,d=(0,o.c)(4);return d[0]===Symbol.for("react.memo_cache_sentinel")?(n={color:"danger",prefix:t(w,{children:[e(_,{children:e(c,{})}),e(b,{children:"Tooltip"})]})},d[0]=n):n=d[0],d[1]===Symbol.for("react.memo_cache_sentinel")?(a={color:"warning",prefix:t(w,{children:[e(_,{children:e(s,{})}),e(b,{children:"Tooltip"})]})},d[1]=a):a=d[1],d[2]===Symbol.for("react.memo_cache_sentinel")?(r={3:n,5:a,7:{color:"info",prefix:t(w,{children:[e(_,{children:e(i,{})}),e(b,{children:"Tooltip"})]})}},d[2]=r):r=d[2],d[3]===Symbol.for("react.memo_cache_sentinel")?(l=e(I,{code:"Host: inventory.example.com\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)\nAppleWebKit/537.36\nAccept: application/json, text/plain, */*\nAccept-Language: en-US,en;q=0.9\nConnection: keep-alive\nCache-Control: no-cache",language:"text",lines:r,children:t(N,{children:[e(R,{}),e(C,{})]})}),d[3]=l):l=d[3],l},meta:M},{name:"LineColors",story:()=>{let n,a,r=(0,o.c)(2);return r[0]===Symbol.for("react.memo_cache_sentinel")?(n={2:{color:"danger"},3:{color:"warning"},4:{color:"info"},5:{color:"success"},6:{color:"brand"},7:{color:"ai"},8:{color:"neutral"}},r[0]=n):n=r[0],r[1]===Symbol.for("react.memo_cache_sentinel")?(a=e(I,{code:"Line 1: Default (no color)\nLine 2: Danger color\nLine 3: Warning color\nLine 4: Info color\nLine 5: Success color\nLine 6: Brand color\nLine 7: AI color\nLine 8: Neutral color",language:"text",lines:n,children:t(N,{children:[e(R,{}),e(C,{})]})}),r[1]=a):a=r[1],a},meta:M},{name:"LineRanges",story:()=>{let n,a,r,l=(0,o.c)(3);return l[0]===Symbol.for("react.memo_cache_sentinel")?(n={color:"danger",ranges:[{start:8,end:24}]},l[0]=n):n=l[0],l[1]===Symbol.for("react.memo_cache_sentinel")?(a={4:n,7:{color:"info",ranges:[{start:17,end:30}]}},l[1]=a):a=l[1],l[2]===Symbol.for("react.memo_cache_sentinel")?(r=e(I,{code:"GET /api/v2/users HTTP/1.1\nHost: inventory.example.com\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)\nAccept: application/json, text/plain, */*\nAccept-Language: en-US,en;q=0.9\nConnection: keep-alive\nX-Forwarded-For: 192.168.1.100\nCache-Control: no-cache",language:"text",lines:a,children:t(N,{children:[e(R,{}),e(C,{})]})}),l[2]=r):r=l[2],r},meta:M},{name:"TextStyles",story:()=>{let n,a,r=(0,o.c)(2);return r[0]===Symbol.for("react.memo_cache_sentinel")?(n={2:{textStyle:"medium"},3:{textStyle:"italic"},4:{color:"danger",textStyle:"italic"},5:{color:"neutral"},6:{className:"underline"},7:{style:{textDecoration:"line-through"}}},r[0]=n):n=r[0],r[1]===Symbol.for("react.memo_cache_sentinel")?(a=e(I,{code:"Line 1: Default (regular)\nLine 2: Medium weight\nLine 3: Italic style\nLine 4: Danger with italic override\nLine 5: Neutral (default italic)\nLine 6: Custom className\nLine 7: Custom inline style",language:"text",lines:n,children:t(N,{children:[e(R,{}),e(C,{})]})}),r[1]=a):a=r[1],a},meta:M},{name:"LineWithPrefix",story:()=>{let n,a,r=(0,o.c)(2);return r[0]===Symbol.for("react.memo_cache_sentinel")?(n={2:{color:"danger",prefix:"-"},3:{color:"success",prefix:"+"},4:{color:"success",prefix:"+"}},r[0]=n):n=r[0],r[1]===Symbol.for("react.memo_cache_sentinel")?(a=e(I,{code:'const greeting = "Hello";\nconsole.log("old message");\nconsole.log("new message");\nconsole.log("another new line");\n\nexport default greeting;',language:"text",lines:n,children:t(N,{children:[e(R,{}),e(C,{})]})}),r[1]=a):a=r[1],a},meta:M},{name:"LineWrapping",story:()=>{let n,a,r,l,i,c,s,d,m,p,h,u,f,y,w,b,_,S,x,v,T,D,W=(0,o.c)(22);return W[0]===Symbol.for("react.memo_cache_sentinel")?(n=e("span",{className:"sb-annotation",children:"Without wrapping"}),a={maxWidth:"600px"},W[0]=n,W[1]=a):(n=W[0],a=W[1]),W[2]===Symbol.for("react.memo_cache_sentinel")?(r=t(g,{align:"start",gap:4,children:[n,e("div",{style:a,children:e(I,{code:'const veryLongVariableName = "This is a very long string that will demonstrate line wrapping behavior when the content exceeds the container width";\nconsole.log(veryLongVariableName);',language:"text",children:t(N,{children:[e(R,{}),e(C,{})]})})})]}),W[2]=r):r=W[2],W[3]===Symbol.for("react.memo_cache_sentinel")?(l=e("span",{className:"sb-annotation",children:"With wrapping"}),i={maxWidth:"600px"},W[3]=l,W[4]=i):(l=W[3],i=W[4]),W[5]===Symbol.for("react.memo_cache_sentinel")?(c=t(g,{align:"start",gap:4,children:[l,e("div",{style:i,children:e(I,{code:'const veryLongVariableName = "This is a very long string that will demonstrate line wrapping behavior when the content exceeds the container width";\nconsole.log(veryLongVariableName);',language:"text",wrapLines:!0,children:t(N,{children:[e(R,{}),e(C,{})]})})})]}),W[5]=c):c=W[5],W[6]===Symbol.for("react.memo_cache_sentinel")?(s=e("span",{className:"sb-annotation",children:"Without wrapping, with annotations"}),d={maxWidth:"600px"},W[6]=s,W[7]=d):(s=W[6],d=W[7]),W[8]===Symbol.for("react.memo_cache_sentinel")?(m={1:{color:"danger",prefix:"-"},2:{color:"success",prefix:"+"}},W[8]=m):m=W[8],W[9]===Symbol.for("react.memo_cache_sentinel")?(p=t(g,{align:"start",gap:4,children:[s,e("div",{style:d,children:e(I,{code:'const veryLongVariableName = "This is a very long string that will demonstrate line wrapping behavior when the content exceeds the container width";\nconsole.log(veryLongVariableName);',language:"text",lines:m,children:t(N,{children:[e(R,{}),e(C,{})]})})})]}),W[9]=p):p=W[9],W[10]===Symbol.for("react.memo_cache_sentinel")?(h=e("span",{className:"sb-annotation",children:"Wrapping with annotations"}),u={maxWidth:"600px"},W[10]=h,W[11]=u):(h=W[10],u=W[11]),W[12]===Symbol.for("react.memo_cache_sentinel")?(f={1:{color:"danger",prefix:"-"},2:{color:"success",prefix:"+"}},W[12]=f):f=W[12],W[13]===Symbol.for("react.memo_cache_sentinel")?(y=t(g,{align:"start",gap:4,children:[h,e("div",{style:u,children:e(I,{code:'const veryLongVariableName = "This is a very long string that will demonstrate line wrapping behavior when the content exceeds the container width";\nconsole.log(veryLongVariableName);',language:"text",wrapLines:!0,lines:f,children:t(N,{children:[e(R,{}),e(C,{})]})})})]}),W[13]=y):y=W[13],W[14]===Symbol.for("react.memo_cache_sentinel")?(w=e("span",{className:"sb-annotation",children:"Folds without wrapping"}),b={maxWidth:"600px"},W[14]=w,W[15]=b):(w=W[14],b=W[15]),W[16]===Symbol.for("react.memo_cache_sentinel")?(_=$('GET /api/v2/users?page=1&limit=20&filter=active&sort=name&order=asc&include=profile,settings HTTP/1.1\nHost: api.wallarm.com\nAuthorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0\nContent-Type: application/json\nAccept: application/json\n\n{\n "filter": { "status": "active", "role": "admin" }\n}',{headers:{defaultCollapsed:!0}}),W[16]=_):_=W[16],W[17]===Symbol.for("react.memo_cache_sentinel")?(S=t(g,{align:"start",gap:4,children:[w,e("div",{style:b,children:e(I,{code:'GET /api/v2/users?page=1&limit=20&filter=active&sort=name&order=asc&include=profile,settings HTTP/1.1\nHost: api.wallarm.com\nAuthorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0\nContent-Type: application/json\nAccept: application/json\n\n{\n "filter": { "status": "active", "role": "admin" }\n}',language:"text",folds:_,children:t(N,{children:[e(R,{}),e(C,{})]})})})]}),W[17]=S):S=W[17],W[18]===Symbol.for("react.memo_cache_sentinel")?(x=e("span",{className:"sb-annotation",children:"Folds with wrapping"}),v={maxWidth:"600px"},W[18]=x,W[19]=v):(x=W[18],v=W[19]),W[20]===Symbol.for("react.memo_cache_sentinel")?(T=$('GET /api/v2/users?page=1&limit=20&filter=active&sort=name&order=asc&include=profile,settings HTTP/1.1\nHost: api.wallarm.com\nAuthorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0\nContent-Type: application/json\nAccept: application/json\n\n{\n "filter": { "status": "active", "role": "admin" }\n}',{headers:{defaultCollapsed:!0}}),W[20]=T):T=W[20],W[21]===Symbol.for("react.memo_cache_sentinel")?(D=t(g,{gap:16,children:[r,c,p,y,S,t(g,{align:"start",gap:4,children:[x,e("div",{style:v,children:e(I,{code:'GET /api/v2/users?page=1&limit=20&filter=active&sort=name&order=asc&include=profile,settings HTTP/1.1\nHost: api.wallarm.com\nAuthorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0\nContent-Type: application/json\nAccept: application/json\n\n{\n "filter": { "status": "active", "role": "admin" }\n}',language:"text",wrapLines:!0,folds:T,children:t(N,{children:[e(R,{}),e(C,{})]})})})]})]}),W[21]=D):D=W[21],D},meta:M},{name:"WithBothScrolls",story:()=>{let n,a,r,l,i,d,m=(0,o.c)(6);return m[0]===Symbol.for("react.memo_cache_sentinel")?(n={maxWidth:"500px",maxHeight:"300px",background:"white"},m[0]=n):n=m[0],m[1]===Symbol.for("react.memo_cache_sentinel")?(a={color:"warning",prefix:e(s,{})},r={color:"info"},m[1]=a,m[2]=r):(a=m[1],r=m[2]),m[3]===Symbol.for("react.memo_cache_sentinel")?(l={2:a,3:r,13:{color:"danger",prefix:e(c,{})},20:{color:"success",prefix:"+"}},i={height:"280px"},m[3]=l,m[4]=i):(l=m[3],i=m[4]),m[5]===Symbol.for("react.memo_cache_sentinel")?(d=e("div",{style:n,children:e(I,{code:H,language:"text",lines:l,style:i,children:t(N,{children:[e(R,{}),e(C,{})]})})}),m[5]=d):d=m[5],d},meta:M},{name:"CustomStartingLine",story:()=>{let n,a=(0,o.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(n=e(I,{code:j,language:"text",startingLineNumber:97,children:t(N,{children:[e(R,{}),e(C,{})]})}),a[0]=n):n=a[0],n},meta:M},{name:"TypescriptWithPrism",story:()=>{let n,a=(0,o.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(n=e(v,{adapter:S,children:e(I,{code:U,language:"typescript",children:t(N,{children:[e(R,{}),e(C,{})]})})}),a[0]=n):n=a[0],n},meta:M},{name:"BashWithPrism",story:()=>{let n,a=(0,o.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(n=e(v,{adapter:S,children:e(I,{code:J,language:"bash",children:t(N,{children:[e(R,{}),e(C,{})]})})}),a[0]=n):n=a[0],n},meta:M},{name:"HTTPRequestWithPrism",story:()=>{let n,a=(0,o.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(n=e(v,{adapter:S,children:e(I,{code:V,language:"http",children:t(N,{children:[e(R,{}),e(C,{})]})})}),a[0]=n):n=a[0],n},meta:M},{name:"WithHeader",story:()=>{let n,a,r=(0,o.c)(2);return r[0]===Symbol.for("react.memo_cache_sentinel")?(n=e(W,{children:e(L,{children:"install.sh"})}),r[0]=n):n=r[0],r[1]===Symbol.for("react.memo_cache_sentinel")?(a=t(I,{code:z,language:"text",children:[n,e(N,{children:e(C,{})})]}),r[1]=a):a=r[1],a},meta:M},{name:"WithTabsAndActions",story:()=>{let n,a,r,i,c,s,d,m,p,h,u=(0,o.c)(14),[f,y]=(0,l.useState)("npm"),g=B[f]??"";return u[0]===Symbol.for("react.memo_cache_sentinel")?(n={width:"320px"},u[0]=n):n=u[0],u[1]===Symbol.for("react.memo_cache_sentinel")?(a=e(A,{value:"npm",children:"npm"}),r=e(A,{value:"pnpm",children:"pnpm"}),i=e(A,{value:"yarn",children:"yarn"}),c=e(A,{value:"bun",children:"bun"}),u[1]=a,u[2]=r,u[3]=i,u[4]=c):(a=u[1],r=u[2],i=u[3],c=u[4]),u[5]!==f?(s=t(k,{value:f,onValueChange:y,children:[a,r,i,c]}),u[5]=f,u[6]=s):s=u[6],u[7]===Symbol.for("react.memo_cache_sentinel")?(d=t(x,{children:[e(D,{}),e(O,{}),e(T,{})]}),u[7]=d):d=u[7],u[8]!==s?(m=t(W,{children:[s,d]}),u[8]=s,u[9]=m):m=u[9],u[10]===Symbol.for("react.memo_cache_sentinel")?(p=e(N,{children:e(C,{})}),u[10]=p):p=u[10],u[11]!==g||u[12]!==m?(h=e("div",{style:n,children:t(I,{code:g,language:"text",children:[m,p]})}),u[11]=g,u[12]=m,u[13]=h):h=u[13],h},meta:M},{name:"WithFloatingActions",story:()=>{let n,a,r,l=(0,o.c)(3);return l[0]===Symbol.for("react.memo_cache_sentinel")?(n={width:"320px"},l[0]=n):n=l[0],l[1]===Symbol.for("react.memo_cache_sentinel")?(a=t(x,{children:[e(O,{}),e(T,{})]}),l[1]=a):a=l[1],l[2]===Symbol.for("react.memo_cache_sentinel")?(r=e("div",{style:n,children:t(I,{code:j,language:"text",children:[a,t(N,{children:[e(R,{}),e(C,{})]})]})}),l[2]=r):r=l[2],r},meta:M},{name:"ShowMore",story:()=>{let n,a,r,l,i,c,s,d=(0,o.c)(7);return d[0]===Symbol.for("react.memo_cache_sentinel")?(n={display:"flex",flexDirection:"column",gap:"24px",width:"500px"},a=e("p",{className:"sb-annotation mb-8",children:"12 lines, clipped at 7 — 5 hidden"}),d[0]=n,d[1]=a):(n=d[0],a=d[1]),d[2]===Symbol.for("react.memo_cache_sentinel")?(r=t("div",{children:[a,e(I,{code:F,language:"text",maxLines:7,"data-testid":"show-more-clipped",children:e(N,{children:e(C,{})})})]}),l=e("p",{className:"sb-annotation mb-8",children:"9 lines, clipped at 7 — 2 hidden, no button"}),d[2]=r,d[3]=l):(r=d[2],l=d[3]),d[4]===Symbol.for("react.memo_cache_sentinel")?(i=t("div",{children:[l,e(I,{code:G,language:"text",maxLines:7,"data-testid":"show-more-threshold",children:e(N,{children:e(C,{})})})]}),c=e("p",{className:"sb-annotation mb-8",children:"the button rendered by hand"}),d[4]=i,d[5]=c):(i=d[4],c=d[5]),d[6]===Symbol.for("react.memo_cache_sentinel")?(s=t("div",{style:n,children:[r,i,t("div",{children:[c,t(I,{code:F,language:"text",maxLines:7,children:[e(N,{children:e(C,{})}),e(E,{"data-analytics-id":"CODE_SHOW_MORE"})]})]})]}),d[6]=s):s=d[6],s},meta:M},{name:"HTTPRequestWithFolding",story:()=>{let n,a,r=(0,o.c)(2);return r[0]===Symbol.for("react.memo_cache_sentinel")?(n=$(X),r[0]=n):n=r[0],r[1]===Symbol.for("react.memo_cache_sentinel")?(a=e(I,{code:X,language:"text",folds:n,children:t(N,{children:[e(R,{}),e(C,{})]})}),r[1]=a):a=r[1],a},meta:M},{name:"HTTPResponseWithFolding",story:()=>{let n,a,r=(0,o.c)(2);return r[0]===Symbol.for("react.memo_cache_sentinel")?(n=$(q),r[0]=n):n=r[0],r[1]===Symbol.for("react.memo_cache_sentinel")?(a=e(I,{code:q,language:"text",folds:n,children:t(N,{children:[e(R,{}),e(C,{})]})}),r[1]=a):a=r[1],a},meta:M},{name:"WithFoldingExpanded",story:()=>{let n,a,r,l,i=(0,o.c)(4);return i[0]===Symbol.for("react.memo_cache_sentinel")?(n=$(X),a={color:"warning"},i[0]=n,i[1]=a):(n=i[0],a=i[1]),i[2]===Symbol.for("react.memo_cache_sentinel")?(r={3:a,4:{color:"danger",ranges:[{start:14,end:42,color:"danger"}]},10:{color:"info"},11:{color:"info"}},i[2]=r):r=i[2],i[3]===Symbol.for("react.memo_cache_sentinel")?(l=e(I,{code:X,language:"text",folds:n,lines:r,children:t(N,{children:[e(R,{}),e(C,{})]})}),i[3]=l):l=i[3],l},meta:M},{name:"FullscreenInsideDrawer",story:()=>{let n,a,r,l,i,c=(0,o.c)(5);return c[0]===Symbol.for("react.memo_cache_sentinel")?(n=e(y,{asChild:!0,children:e(d,{variant:"outline",color:"neutral",children:"Open Drawer"})}),c[0]=n):n=c[0],c[1]===Symbol.for("react.memo_cache_sentinel")?(a=e(u,{children:e(f,{children:"Request"})}),c[1]=a):a=c[1],c[2]===Symbol.for("react.memo_cache_sentinel")?(r=e(L,{children:"package.json"}),c[2]=r):r=c[2],c[3]===Symbol.for("react.memo_cache_sentinel")?(l=t(W,{children:[r,t(x,{children:[e(D,{}),e(T,{})]})]}),c[3]=l):l=c[3],c[4]===Symbol.for("react.memo_cache_sentinel")?(i=t(m,{children:[n,t(h,{children:[a,e(p,{children:t(I,{code:P,language:"json",children:[l,e(N,{children:e(C,{})})]})})]})]}),c[4]=i):i=c[4],i},meta:M},{name:"Default",story:()=>{let n,a,r,l=(0,o.c)(3);return l[0]===Symbol.for("react.memo_cache_sentinel")?(n=t("p",{className:"text-xs text-text-primary",children:["Small text: Run"," ",e(K,{code:"npm install @wads/ui","data-testid":"inline-code-copyable"})," to install dependencies."]}),l[0]=n):n=l[0],l[1]===Symbol.for("react.memo_cache_sentinel")?(a=t("p",{className:"text-sm text-text-primary",children:["Medium text: Run ",e(K,{code:"npm install @wads/ui"})," to install dependencies."]}),l[1]=a):a=l[1],l[2]===Symbol.for("react.memo_cache_sentinel")?(r=t(Y,{align:"start",children:[n,a,t("p",{className:"text-base text-text-primary",children:["Large text: Run ",e(K,{code:"npm install @wads/ui"})," to install dependencies."]})]}),l[2]=r):r=l[2],r},meta:Z},{name:"Sizes",story:()=>{let n,a,r,l,i,c,s=(0,o.c)(6);return s[0]===Symbol.for("react.memo_cache_sentinel")?(n=e("span",{className:"sb-annotation",children:"sm"}),s[0]=n):n=s[0],s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t(Y,{align:"start",gap:4,children:[n,t("div",{className:"text-xs text-text-primary",children:["To start creating an interface, run"," ",e(K,{code:"npm install @wads/ui",size:"sm"})," and then apply the following..."]})]}),s[1]=a):a=s[1],s[2]===Symbol.for("react.memo_cache_sentinel")?(r=e("span",{className:"sb-annotation",children:"md"}),s[2]=r):r=s[2],s[3]===Symbol.for("react.memo_cache_sentinel")?(l=t(Y,{align:"start",gap:4,children:[r,t("div",{className:"text-sm text-text-primary",children:["To start creating an interface, run"," ",e(K,{code:"npm install @wads/ui",size:"md"})," and then apply the following..."]})]}),s[3]=l):l=s[3],s[4]===Symbol.for("react.memo_cache_sentinel")?(i=e("span",{className:"sb-annotation",children:"lg"}),s[4]=i):i=s[4],s[5]===Symbol.for("react.memo_cache_sentinel")?(c=t(Y,{align:"start",gap:16,children:[a,l,t(Y,{align:"start",gap:4,children:[i,t("div",{className:"text-base text-text-primary",children:["To start creating an interface, run"," ",e(K,{code:"npm install @wads/ui",size:"lg"})," and then apply the following..."]})]})]}),s[5]=c):c=s[5],c},meta:Z},{name:"NonCopyable",story:()=>{let n,a=(0,o.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(n=t("p",{className:"text-sm text-text-primary",children:["This code is not copyable:"," ",e(K,{code:"npm install @wads/ui",copyable:!1,"data-testid":"inline-code-non-copyable"})]}),a[0]=n):n=a[0],n},meta:Z},{name:"VariousContent",story:()=>{let n,a=(0,o.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(n=t(Y,{align:"start",children:[e(K,{code:"npm install"}),e(K,{code:"curl -X POST https://api.wallarm.com"}),e(K,{code:'{"status": "ok"}'}),e(K,{code:"SELECT * FROM users WHERE id = 1"}),e(K,{code:"git commit -m 'feat: add feature'"})]}),a[0]=n):n=a[0],n},meta:Z}];function ee({entry:e}){let{story:t,meta:n}=e,a={...n.args,...t.args},r="function"==typeof t||t.$$typeof?t:t.render||n.render||n.component,o=()=>l.default.createElement(r,a),i={args:a,globals:{theme:"light"},parameters:{...n.parameters,...t.parameters},viewMode:"story"};for(let e of[...n.decorators||[],...t.decorators||[]].reverse()){let t=o;o=()=>e(t,i)}return l.default.createElement("section",{"data-preview-story":e.name,className:"p-16"},l.default.createElement("h2",{className:"text-sm mb-12"},e.name),l.default.createElement(o))}window.WallarmPreview={mount(e){let t=window.ReactDOM.createRoot(e);return t.render(l.default.createElement(window.WallarmDS.Root,null,Q.map((e,t)=>l.default.createElement(ee,{key:t,entry:e})))),t}}})();
|
|
156
|
+
}`,Y=window.WallarmDS.VStack,K=window.WallarmDS.InlineCodeSnippet,Z={title:"Data Display/CodeSnippet/InlineCodeSnippet",component:K,parameters:{layout:"centered",docs:{description:{component:"A fragment of code inside a sentence, copied by clicking it — reach for `Code` when the text only needs the mono treatment, and `CodeSnippet` when it needs syntax highlighting, a header or line numbers. It takes its size from the text around it, so a snippet in a caption stays the size of the caption; keep it to a single line so the sentence still reads."}}},tags:["autodocs"]},Q=[{name:"Default",story:()=>{let t,n=(0,o.c)(1);return n[0]===Symbol.for("react.memo_cache_sentinel")?(t=e(I,{code:z,language:"text",children:e(N,{children:e(C,{})})}),n[0]=t):t=n[0],t},meta:M},{name:"WithLineNumbers",story:()=>{let n,a=(0,o.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(n=e(I,{code:j,language:"text",children:t(N,{children:[e(R,{}),e(C,{})]})}),a[0]=n):n=a[0],n},meta:M},{name:"Sizes",story:()=>{let n,a,r,l,i,c,s=(0,o.c)(6);return s[0]===Symbol.for("react.memo_cache_sentinel")?(n=e("span",{className:"sb-annotation",children:"sm (default)"}),s[0]=n):n=s[0],s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t(g,{align:"start",gap:4,children:[n,e(I,{code:z,language:"text",size:"sm",children:e(N,{children:e(C,{})})})]}),s[1]=a):a=s[1],s[2]===Symbol.for("react.memo_cache_sentinel")?(r=e("span",{className:"sb-annotation",children:"md"}),s[2]=r):r=s[2],s[3]===Symbol.for("react.memo_cache_sentinel")?(l=t(g,{align:"start",gap:4,children:[r,e(I,{code:z,language:"text",size:"md",children:e(N,{children:e(C,{})})})]}),s[3]=l):l=s[3],s[4]===Symbol.for("react.memo_cache_sentinel")?(i=e("span",{className:"sb-annotation",children:"lg"}),s[4]=i):i=s[4],s[5]===Symbol.for("react.memo_cache_sentinel")?(c=t(g,{gap:16,children:[a,l,t(g,{align:"start",gap:4,children:[i,e(I,{code:z,language:"text",size:"lg",children:e(N,{children:e(C,{})})})]})]}),s[5]=c):c=s[5],c},meta:M},{name:"LineAnnotations",story:()=>{let n,a,r,l,d=(0,o.c)(4);return d[0]===Symbol.for("react.memo_cache_sentinel")?(n={color:"danger",prefix:t(w,{children:[e(_,{children:e(c,{})}),e(b,{children:"Tooltip"})]})},d[0]=n):n=d[0],d[1]===Symbol.for("react.memo_cache_sentinel")?(a={color:"warning",prefix:t(w,{children:[e(_,{children:e(s,{})}),e(b,{children:"Tooltip"})]})},d[1]=a):a=d[1],d[2]===Symbol.for("react.memo_cache_sentinel")?(r={3:n,5:a,7:{color:"info",prefix:t(w,{children:[e(_,{children:e(i,{})}),e(b,{children:"Tooltip"})]})}},d[2]=r):r=d[2],d[3]===Symbol.for("react.memo_cache_sentinel")?(l=e(I,{code:"Host: inventory.example.com\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)\nAppleWebKit/537.36\nAccept: application/json, text/plain, */*\nAccept-Language: en-US,en;q=0.9\nConnection: keep-alive\nCache-Control: no-cache",language:"text",lines:r,children:t(N,{children:[e(R,{}),e(C,{})]})}),d[3]=l):l=d[3],l},meta:M},{name:"LineColors",story:()=>{let n,a,r=(0,o.c)(2);return r[0]===Symbol.for("react.memo_cache_sentinel")?(n={2:{color:"danger"},3:{color:"warning"},4:{color:"info"},5:{color:"success"},6:{color:"brand"},7:{color:"ai"},8:{color:"neutral"}},r[0]=n):n=r[0],r[1]===Symbol.for("react.memo_cache_sentinel")?(a=e(I,{code:"Line 1: Default (no color)\nLine 2: Danger color\nLine 3: Warning color\nLine 4: Info color\nLine 5: Success color\nLine 6: Brand color\nLine 7: AI color\nLine 8: Neutral color",language:"text",lines:n,children:t(N,{children:[e(R,{}),e(C,{})]})}),r[1]=a):a=r[1],a},meta:M},{name:"LineRanges",story:()=>{let n,a,r,l=(0,o.c)(3);return l[0]===Symbol.for("react.memo_cache_sentinel")?(n={color:"danger",ranges:[{start:8,end:24}]},l[0]=n):n=l[0],l[1]===Symbol.for("react.memo_cache_sentinel")?(a={4:n,7:{color:"info",ranges:[{start:17,end:30}]}},l[1]=a):a=l[1],l[2]===Symbol.for("react.memo_cache_sentinel")?(r=e(I,{code:"GET /api/v2/users HTTP/1.1\nHost: inventory.example.com\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)\nAccept: application/json, text/plain, */*\nAccept-Language: en-US,en;q=0.9\nConnection: keep-alive\nX-Forwarded-For: 192.168.1.100\nCache-Control: no-cache",language:"text",lines:a,children:t(N,{children:[e(R,{}),e(C,{})]})}),l[2]=r):r=l[2],r},meta:M},{name:"TextStyles",story:()=>{let n,a,r=(0,o.c)(2);return r[0]===Symbol.for("react.memo_cache_sentinel")?(n={2:{textStyle:"medium"},3:{textStyle:"italic"},4:{color:"danger",textStyle:"italic"},5:{color:"neutral"},6:{className:"underline"},7:{style:{textDecoration:"line-through"}}},r[0]=n):n=r[0],r[1]===Symbol.for("react.memo_cache_sentinel")?(a=e(I,{code:"Line 1: Default (regular)\nLine 2: Medium weight\nLine 3: Italic style\nLine 4: Danger with italic override\nLine 5: Neutral (default italic)\nLine 6: Custom className\nLine 7: Custom inline style",language:"text",lines:n,children:t(N,{children:[e(R,{}),e(C,{})]})}),r[1]=a):a=r[1],a},meta:M},{name:"LineWithPrefix",story:()=>{let n,a,r=(0,o.c)(2);return r[0]===Symbol.for("react.memo_cache_sentinel")?(n={2:{color:"danger",prefix:"-"},3:{color:"success",prefix:"+"},4:{color:"success",prefix:"+"}},r[0]=n):n=r[0],r[1]===Symbol.for("react.memo_cache_sentinel")?(a=e(I,{code:'const greeting = "Hello";\nconsole.log("old message");\nconsole.log("new message");\nconsole.log("another new line");\n\nexport default greeting;',language:"text",lines:n,children:t(N,{children:[e(R,{}),e(C,{})]})}),r[1]=a):a=r[1],a},meta:M},{name:"LineWrapping",story:()=>{let n,a,r,l,i,c,s,d,m,p,h,u,f,y,w,b,_,S,x,v,T,D,W=(0,o.c)(22);return W[0]===Symbol.for("react.memo_cache_sentinel")?(n=e("span",{className:"sb-annotation",children:"Without wrapping"}),a={maxWidth:"600px"},W[0]=n,W[1]=a):(n=W[0],a=W[1]),W[2]===Symbol.for("react.memo_cache_sentinel")?(r=t(g,{align:"start",gap:4,children:[n,e("div",{style:a,children:e(I,{code:'const veryLongVariableName = "This is a very long string that will demonstrate line wrapping behavior when the content exceeds the container width";\nconsole.log(veryLongVariableName);',language:"text",children:t(N,{children:[e(R,{}),e(C,{})]})})})]}),W[2]=r):r=W[2],W[3]===Symbol.for("react.memo_cache_sentinel")?(l=e("span",{className:"sb-annotation",children:"With wrapping"}),i={maxWidth:"600px"},W[3]=l,W[4]=i):(l=W[3],i=W[4]),W[5]===Symbol.for("react.memo_cache_sentinel")?(c=t(g,{align:"start",gap:4,children:[l,e("div",{style:i,children:e(I,{code:'const veryLongVariableName = "This is a very long string that will demonstrate line wrapping behavior when the content exceeds the container width";\nconsole.log(veryLongVariableName);',language:"text",wrapLines:!0,children:t(N,{children:[e(R,{}),e(C,{})]})})})]}),W[5]=c):c=W[5],W[6]===Symbol.for("react.memo_cache_sentinel")?(s=e("span",{className:"sb-annotation",children:"Without wrapping, with annotations"}),d={maxWidth:"600px"},W[6]=s,W[7]=d):(s=W[6],d=W[7]),W[8]===Symbol.for("react.memo_cache_sentinel")?(m={1:{color:"danger",prefix:"-"},2:{color:"success",prefix:"+"}},W[8]=m):m=W[8],W[9]===Symbol.for("react.memo_cache_sentinel")?(p=t(g,{align:"start",gap:4,children:[s,e("div",{style:d,children:e(I,{code:'const veryLongVariableName = "This is a very long string that will demonstrate line wrapping behavior when the content exceeds the container width";\nconsole.log(veryLongVariableName);',language:"text",lines:m,children:t(N,{children:[e(R,{}),e(C,{})]})})})]}),W[9]=p):p=W[9],W[10]===Symbol.for("react.memo_cache_sentinel")?(h=e("span",{className:"sb-annotation",children:"Wrapping with annotations"}),u={maxWidth:"600px"},W[10]=h,W[11]=u):(h=W[10],u=W[11]),W[12]===Symbol.for("react.memo_cache_sentinel")?(f={1:{color:"danger",prefix:"-"},2:{color:"success",prefix:"+"}},W[12]=f):f=W[12],W[13]===Symbol.for("react.memo_cache_sentinel")?(y=t(g,{align:"start",gap:4,children:[h,e("div",{style:u,children:e(I,{code:'const veryLongVariableName = "This is a very long string that will demonstrate line wrapping behavior when the content exceeds the container width";\nconsole.log(veryLongVariableName);',language:"text",wrapLines:!0,lines:f,children:t(N,{children:[e(R,{}),e(C,{})]})})})]}),W[13]=y):y=W[13],W[14]===Symbol.for("react.memo_cache_sentinel")?(w=e("span",{className:"sb-annotation",children:"Folds without wrapping"}),b={maxWidth:"600px"},W[14]=w,W[15]=b):(w=W[14],b=W[15]),W[16]===Symbol.for("react.memo_cache_sentinel")?(_=$('GET /api/v2/users?page=1&limit=20&filter=active&sort=name&order=asc&include=profile,settings HTTP/1.1\nHost: api.wallarm.com\nAuthorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0\nContent-Type: application/json\nAccept: application/json\n\n{\n "filter": { "status": "active", "role": "admin" }\n}',{headers:{defaultCollapsed:!0}}),W[16]=_):_=W[16],W[17]===Symbol.for("react.memo_cache_sentinel")?(S=t(g,{align:"start",gap:4,children:[w,e("div",{style:b,children:e(I,{code:'GET /api/v2/users?page=1&limit=20&filter=active&sort=name&order=asc&include=profile,settings HTTP/1.1\nHost: api.wallarm.com\nAuthorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0\nContent-Type: application/json\nAccept: application/json\n\n{\n "filter": { "status": "active", "role": "admin" }\n}',language:"text",folds:_,children:t(N,{children:[e(R,{}),e(C,{})]})})})]}),W[17]=S):S=W[17],W[18]===Symbol.for("react.memo_cache_sentinel")?(x=e("span",{className:"sb-annotation",children:"Folds with wrapping"}),v={maxWidth:"600px"},W[18]=x,W[19]=v):(x=W[18],v=W[19]),W[20]===Symbol.for("react.memo_cache_sentinel")?(T=$('GET /api/v2/users?page=1&limit=20&filter=active&sort=name&order=asc&include=profile,settings HTTP/1.1\nHost: api.wallarm.com\nAuthorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0\nContent-Type: application/json\nAccept: application/json\n\n{\n "filter": { "status": "active", "role": "admin" }\n}',{headers:{defaultCollapsed:!0}}),W[20]=T):T=W[20],W[21]===Symbol.for("react.memo_cache_sentinel")?(D=t(g,{gap:16,children:[r,c,p,y,S,t(g,{align:"start",gap:4,children:[x,e("div",{style:v,children:e(I,{code:'GET /api/v2/users?page=1&limit=20&filter=active&sort=name&order=asc&include=profile,settings HTTP/1.1\nHost: api.wallarm.com\nAuthorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0\nContent-Type: application/json\nAccept: application/json\n\n{\n "filter": { "status": "active", "role": "admin" }\n}',language:"text",wrapLines:!0,folds:T,children:t(N,{children:[e(R,{}),e(C,{})]})})})]})]}),W[21]=D):D=W[21],D},meta:M},{name:"WithBothScrolls",story:()=>{let n,a,r,l,i,d,m=(0,o.c)(6);return m[0]===Symbol.for("react.memo_cache_sentinel")?(n={maxWidth:"500px",maxHeight:"300px",background:"white"},m[0]=n):n=m[0],m[1]===Symbol.for("react.memo_cache_sentinel")?(a={color:"warning",prefix:e(s,{})},r={color:"info"},m[1]=a,m[2]=r):(a=m[1],r=m[2]),m[3]===Symbol.for("react.memo_cache_sentinel")?(l={2:a,3:r,13:{color:"danger",prefix:e(c,{})},20:{color:"success",prefix:"+"}},i={height:"280px"},m[3]=l,m[4]=i):(l=m[3],i=m[4]),m[5]===Symbol.for("react.memo_cache_sentinel")?(d=e("div",{style:n,children:e(I,{code:H,language:"text",lines:l,style:i,children:t(N,{children:[e(R,{}),e(C,{})]})})}),m[5]=d):d=m[5],d},meta:M},{name:"CustomStartingLine",story:()=>{let n,a=(0,o.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(n=e(I,{code:j,language:"text",startingLineNumber:97,children:t(N,{children:[e(R,{}),e(C,{})]})}),a[0]=n):n=a[0],n},meta:M},{name:"TypescriptWithPrism",story:()=>{let n,a=(0,o.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(n=e(v,{adapter:S,children:e(I,{code:U,language:"typescript",children:t(N,{children:[e(R,{}),e(C,{})]})})}),a[0]=n):n=a[0],n},meta:M},{name:"BashWithPrism",story:()=>{let n,a=(0,o.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(n=e(v,{adapter:S,children:e(I,{code:J,language:"bash",children:t(N,{children:[e(R,{}),e(C,{})]})})}),a[0]=n):n=a[0],n},meta:M},{name:"HTTPRequestWithPrism",story:()=>{let n,a=(0,o.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(n=e(v,{adapter:S,children:e(I,{code:V,language:"http",children:t(N,{children:[e(R,{}),e(C,{})]})})}),a[0]=n):n=a[0],n},meta:M},{name:"WithHeader",story:()=>{let n,a,r=(0,o.c)(2);return r[0]===Symbol.for("react.memo_cache_sentinel")?(n=e(W,{children:e(L,{children:"install.sh"})}),r[0]=n):n=r[0],r[1]===Symbol.for("react.memo_cache_sentinel")?(a=t(I,{code:z,language:"text",children:[n,e(N,{children:e(C,{})})]}),r[1]=a):a=r[1],a},meta:M},{name:"WithTabsAndActions",story:()=>{let n,a,r,i,c,s,d,m,p,h,u=(0,o.c)(14),[f,y]=(0,l.useState)("npm"),g=B[f]??"";return u[0]===Symbol.for("react.memo_cache_sentinel")?(n={width:"320px"},u[0]=n):n=u[0],u[1]===Symbol.for("react.memo_cache_sentinel")?(a=e(A,{value:"npm",children:"npm"}),r=e(A,{value:"pnpm",children:"pnpm"}),i=e(A,{value:"yarn",children:"yarn"}),c=e(A,{value:"bun",children:"bun"}),u[1]=a,u[2]=r,u[3]=i,u[4]=c):(a=u[1],r=u[2],i=u[3],c=u[4]),u[5]!==f?(s=t(k,{value:f,onValueChange:y,children:[a,r,i,c]}),u[5]=f,u[6]=s):s=u[6],u[7]===Symbol.for("react.memo_cache_sentinel")?(d=t(x,{children:[e(D,{}),e(O,{}),e(T,{})]}),u[7]=d):d=u[7],u[8]!==s?(m=t(W,{children:[s,d]}),u[8]=s,u[9]=m):m=u[9],u[10]===Symbol.for("react.memo_cache_sentinel")?(p=e(N,{children:e(C,{})}),u[10]=p):p=u[10],u[11]!==g||u[12]!==m?(h=e("div",{style:n,children:t(I,{code:g,language:"text",children:[m,p]})}),u[11]=g,u[12]=m,u[13]=h):h=u[13],h},meta:M},{name:"WithFloatingActions",story:()=>{let n,a,r,l=(0,o.c)(3);return l[0]===Symbol.for("react.memo_cache_sentinel")?(n={width:"320px"},l[0]=n):n=l[0],l[1]===Symbol.for("react.memo_cache_sentinel")?(a=t(x,{children:[e(O,{}),e(T,{})]}),l[1]=a):a=l[1],l[2]===Symbol.for("react.memo_cache_sentinel")?(r=e("div",{style:n,children:t(I,{code:j,language:"text",children:[a,t(N,{children:[e(R,{}),e(C,{})]})]})}),l[2]=r):r=l[2],r},meta:M},{name:"ShowMore",story:()=>{let n,a,r,l,i,c,s,d=(0,o.c)(7);return d[0]===Symbol.for("react.memo_cache_sentinel")?(n={display:"flex",flexDirection:"column",gap:"24px",width:"500px"},a=e("p",{className:"sb-annotation mb-8",children:"12 lines, clipped at 7 — 5 hidden"}),d[0]=n,d[1]=a):(n=d[0],a=d[1]),d[2]===Symbol.for("react.memo_cache_sentinel")?(r=t("div",{children:[a,e(I,{code:F,language:"text",maxLines:7,"data-testid":"show-more-clipped",children:e(N,{children:e(C,{})})})]}),l=e("p",{className:"sb-annotation mb-8",children:"9 lines, clipped at 7 — 2 hidden, no button"}),d[2]=r,d[3]=l):(r=d[2],l=d[3]),d[4]===Symbol.for("react.memo_cache_sentinel")?(i=t("div",{children:[l,e(I,{code:G,language:"text",maxLines:7,"data-testid":"show-more-threshold",children:e(N,{children:e(C,{})})})]}),c=e("p",{className:"sb-annotation mb-8",children:"the button rendered by hand"}),d[4]=i,d[5]=c):(i=d[4],c=d[5]),d[6]===Symbol.for("react.memo_cache_sentinel")?(s=t("div",{style:n,children:[r,i,t("div",{children:[c,t(I,{code:F,language:"text",maxLines:7,children:[e(N,{children:e(C,{})}),e(E,{"data-analytics-id":"CODE_SHOW_MORE"})]})]})]}),d[6]=s):s=d[6],s},meta:M},{name:"HTTPRequestWithFolding",story:()=>{let n,a,r=(0,o.c)(2);return r[0]===Symbol.for("react.memo_cache_sentinel")?(n=$(X),r[0]=n):n=r[0],r[1]===Symbol.for("react.memo_cache_sentinel")?(a=e(I,{code:X,language:"text",folds:n,children:t(N,{children:[e(R,{}),e(C,{})]})}),r[1]=a):a=r[1],a},meta:M},{name:"HTTPResponseWithFolding",story:()=>{let n,a,r=(0,o.c)(2);return r[0]===Symbol.for("react.memo_cache_sentinel")?(n=$(q),r[0]=n):n=r[0],r[1]===Symbol.for("react.memo_cache_sentinel")?(a=e(I,{code:q,language:"text",folds:n,children:t(N,{children:[e(R,{}),e(C,{})]})}),r[1]=a):a=r[1],a},meta:M},{name:"WithFoldingExpanded",story:()=>{let n,a,r,l,i=(0,o.c)(4);return i[0]===Symbol.for("react.memo_cache_sentinel")?(n=$(X),a={color:"warning"},i[0]=n,i[1]=a):(n=i[0],a=i[1]),i[2]===Symbol.for("react.memo_cache_sentinel")?(r={3:a,4:{color:"danger",ranges:[{start:14,end:42,color:"danger"}]},10:{color:"info"},11:{color:"info"}},i[2]=r):r=i[2],i[3]===Symbol.for("react.memo_cache_sentinel")?(l=e(I,{code:X,language:"text",folds:n,lines:r,children:t(N,{children:[e(R,{}),e(C,{})]})}),i[3]=l):l=i[3],l},meta:M},{name:"FullscreenInsideDrawer",story:()=>{let n,a,r,l,i,c=(0,o.c)(5);return c[0]===Symbol.for("react.memo_cache_sentinel")?(n=e(y,{asChild:!0,children:e(d,{variant:"outline",color:"neutral",children:"Open Drawer"})}),c[0]=n):n=c[0],c[1]===Symbol.for("react.memo_cache_sentinel")?(a=e(u,{children:e(f,{children:"Request"})}),c[1]=a):a=c[1],c[2]===Symbol.for("react.memo_cache_sentinel")?(r=e(L,{children:"package.json"}),c[2]=r):r=c[2],c[3]===Symbol.for("react.memo_cache_sentinel")?(l=t(W,{children:[r,t(x,{children:[e(D,{}),e(T,{})]})]}),c[3]=l):l=c[3],c[4]===Symbol.for("react.memo_cache_sentinel")?(i=t(m,{children:[n,t(h,{children:[a,e(p,{children:t(I,{code:P,language:"json",children:[l,e(N,{children:e(C,{})})]})})]})]}),c[4]=i):i=c[4],i},meta:M},{name:"Default",story:()=>{let n,a,r,l=(0,o.c)(3);return l[0]===Symbol.for("react.memo_cache_sentinel")?(n=t("p",{className:"text-xs text-text-primary",children:["Small text: Run"," ",e(K,{code:"npm install @wads/ui","data-testid":"inline-code-copyable"})," to install dependencies."]}),l[0]=n):n=l[0],l[1]===Symbol.for("react.memo_cache_sentinel")?(a=t("p",{className:"text-sm text-text-primary",children:["Medium text: Run ",e(K,{code:"npm install @wads/ui"})," to install dependencies."]}),l[1]=a):a=l[1],l[2]===Symbol.for("react.memo_cache_sentinel")?(r=t(Y,{align:"start",children:[n,a,t("p",{className:"text-base text-text-primary",children:["Large text: Run ",e(K,{code:"npm install @wads/ui"})," to install dependencies."]})]}),l[2]=r):r=l[2],r},meta:Z},{name:"Sizes",story:()=>{let n,a,r,l,i,c,s=(0,o.c)(6);return s[0]===Symbol.for("react.memo_cache_sentinel")?(n=e("span",{className:"sb-annotation",children:"sm"}),s[0]=n):n=s[0],s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t(Y,{align:"start",gap:4,children:[n,t("div",{className:"text-xs text-text-primary",children:["To start creating an interface, run"," ",e(K,{code:"npm install @wads/ui",size:"sm"})," and then apply the following..."]})]}),s[1]=a):a=s[1],s[2]===Symbol.for("react.memo_cache_sentinel")?(r=e("span",{className:"sb-annotation",children:"md"}),s[2]=r):r=s[2],s[3]===Symbol.for("react.memo_cache_sentinel")?(l=t(Y,{align:"start",gap:4,children:[r,t("div",{className:"text-sm text-text-primary",children:["To start creating an interface, run"," ",e(K,{code:"npm install @wads/ui",size:"md"})," and then apply the following..."]})]}),s[3]=l):l=s[3],s[4]===Symbol.for("react.memo_cache_sentinel")?(i=e("span",{className:"sb-annotation",children:"lg"}),s[4]=i):i=s[4],s[5]===Symbol.for("react.memo_cache_sentinel")?(c=t(Y,{align:"start",gap:16,children:[a,l,t(Y,{align:"start",gap:4,children:[i,t("div",{className:"text-base text-text-primary",children:["To start creating an interface, run"," ",e(K,{code:"npm install @wads/ui",size:"lg"})," and then apply the following..."]})]})]}),s[5]=c):c=s[5],c},meta:Z},{name:"NonCopyable",story:()=>{let n,a=(0,o.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(n=t("p",{className:"text-sm text-text-primary",children:["This code is not copyable:"," ",e(K,{code:"npm install @wads/ui",copyable:!1,"data-testid":"inline-code-non-copyable"})]}),a[0]=n):n=a[0],n},meta:Z},{name:"VariousContent",story:()=>{let n,a=(0,o.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(n=t(Y,{align:"start",children:[e(K,{code:"npm install"}),e(K,{code:"curl -X POST https://api.wallarm.com"}),e(K,{code:'{"status": "ok"}'}),e(K,{code:"SELECT * FROM users WHERE id = 1"}),e(K,{code:"git commit -m 'feat: add feature'"})]}),a[0]=n):n=a[0],n},meta:Z}];function ee({entry:e}){let{story:t,meta:n}=e,a={...n.args,...t.args},r="function"==typeof t||t.$$typeof?t:t.render||n.render||n.component,o=()=>l.default.createElement(r,a),i={args:a,globals:{theme:"light"},parameters:{...n.parameters,...t.parameters},viewMode:"story"};for(let e of[...n.decorators||[],...t.decorators||[]].reverse()){let t=o;o=()=>e(t,i)}return l.default.createElement("section",{"data-preview-story":e.name,className:"p-16"},l.default.createElement("h2",{className:"text-sm mb-12"},e.name),l.default.createElement(o))}window.WallarmPreview={mount(e){let t=window.ReactDOM.createRoot(e);return t.render(l.default.createElement(window.WallarmDS.Root,null,Q.map((e,t)=>l.default.createElement(ee,{key:t,entry:e})))),t}}})();
|
|
@@ -109,10 +109,6 @@ const meta = {
|
|
|
109
109
|
subcomponents: { ColumnChartBody, ColumnChartStack, ColumnChartXAxis },
|
|
110
110
|
parameters: {
|
|
111
111
|
layout: 'centered',
|
|
112
|
-
design: {
|
|
113
|
-
type: 'figma',
|
|
114
|
-
url: 'https://www.figma.com/design/VKb5gW46uSGw0rqrhZsbXT/WADS-Components?node-id=12612-31838',
|
|
115
|
-
},
|
|
116
112
|
docs: { description: { component: DESCRIPTION } },
|
|
117
113
|
},
|
|
118
114
|
tags: ['autodocs'],
|