@zonos/amino 6.0.0-alpha.8 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/amino.css +29 -7
- package/components/avatar/AvatarBase.js +1 -1
- package/components/banner/Banner.js +1 -1
- package/components/button/Button.js +1 -1
- package/components/button/ButtonIcon.js +1 -1
- package/components/button/MenuButton.js +1 -1
- package/components/button/RippleGroup.js +1 -1
- package/components/button/button-group/ButtonGroup.js +1 -1
- package/components/card/Card.js +1 -1
- package/components/checkbox/Checkbox.js +1 -1
- package/components/collapse/Collapse.js +1 -1
- package/components/connection-map/ConnectionMap.js +1 -1
- package/components/country-multi-select/CountryMultiSelectExpanded.js +1 -1
- package/components/country-multi-select/CountryMultiSelectExpandedOption.js +1 -1
- package/components/cover-sheet/CoverSheet.js +1 -1
- package/components/currency/Currency.js +1 -1
- package/components/currency/DualCurrency.js +1 -1
- package/components/dialog/BaseDialog.js +1 -1
- package/components/dialog/Dialog.js +1 -1
- package/components/dialog/DismissableDialog.js +1 -1
- package/components/dialog/announcement/AnnouncementDialog.js +1 -1
- package/components/divider/Divider.js +1 -1
- package/components/drop-zone/DropZone.js +1 -1
- package/components/file-upload/FileUpload.js +1 -1
- package/components/filter/FilterWrapper.js +1 -1
- package/components/filter/filter-date/DateControlsWrapper.js +1 -1
- package/components/glow/GlowWrapper.js +1 -1
- package/components/input/Input.js +1 -1
- package/components/input/MultiInput.js +1 -1
- package/components/input/input-simple/InputSimple.js +1 -1
- package/components/input/input-simple/input-type/_DateInput.d.ts +1 -1
- package/components/input/input-simple/input-type/_DateInput.js +1 -1
- package/components/input/input-simple/input-type/_InputBase.d.ts +1 -1
- package/components/input/input-simple/input-type/_InputBase.js +1 -1
- package/components/input/input-simple/input-type/_NumberInput.d.ts +1 -1
- package/components/input/input-simple/input-type/_NumberInput.js +1 -1
- package/components/input/input-simple/input-type/_PasswordInput.d.ts +1 -1
- package/components/input/input-simple/input-type/_PasswordInput.js +1 -1
- package/components/input/input-simple/input-type/_TimeInput.d.ts +1 -1
- package/components/input/input-simple/input-type/_TimeInput.js +1 -1
- package/components/input/input-type/_DateInput.d.ts +1 -1
- package/components/input/input-type/_DateInput.js +1 -1
- package/components/input/input-type/_FloatLabelInput.d.ts +1 -1
- package/components/input/input-type/_FloatLabelInput.js +1 -1
- package/components/input/input-type/_NumberInput.d.ts +1 -1
- package/components/input/input-type/_NumberInput.js +1 -1
- package/components/input/input-type/_PasswordInput.d.ts +1 -1
- package/components/input/input-type/_PasswordInput.js +1 -1
- package/components/input/input-type/_TimeInput.d.ts +1 -1
- package/components/input/input-type/_TimeInput.js +1 -1
- package/components/json-vision-viewer/JsonVisionViewer.js +1 -1
- package/components/language-picker/LanguageItem.js +1 -1
- package/components/language-picker/LanguagePicker.js +1 -1
- package/components/layout/Layout.js +1 -1
- package/components/layout/NavigationGroup.js +1 -1
- package/components/list/CollapsibleList.js +1 -1
- package/components/list/List.js +1 -1
- package/components/list-item/ListItem.js +1 -1
- package/components/menu/Menu.js +1 -1
- package/components/menu/MenuItem.js +1 -1
- package/components/nested-data-table/NestedDataTable.js +1 -1
- package/components/nested-data-table/_Filter.js +1 -1
- package/components/nested-data-table/_TableData.js +1 -1
- package/components/pivot-table/PivotTable.js +1 -1
- package/components/progress-bar/ProgressBar.js +1 -1
- package/components/radio/Radio.js +1 -1
- package/components/rest-state/RestState.js +1 -1
- package/components/rich-card-select/RichCardStateSelect.js +1 -1
- package/components/rich-checkbox/RichCheckbox.js +1 -1
- package/components/rich-radio/RichRadio.d.ts +5 -5
- package/components/rich-radio/RichRadio.js +1 -1
- package/components/section/HSection.js +1 -1
- package/components/section/VSection.js +1 -1
- package/components/section/_SectionHeader.js +1 -1
- package/components/section/_SectionInnerWrapper.js +1 -1
- package/components/select/LanguageSelect.js +1 -1
- package/components/select/_StyledReactSelect.js +1 -1
- package/components/simple-table/SimpleTable.js +1 -1
- package/components/simple-table/SimpleTableRow.js +1 -1
- package/components/skeleton/Skeleton.js +1 -1
- package/components/slide-over/SlideOver.js +1 -1
- package/components/spinner/Spinner.js +1 -1
- package/components/stack/Stack.js +1 -1
- package/components/switch/Switch.d.ts +3 -3
- package/components/switch/Switch.js +1 -1
- package/components/table/TableRow.js +1 -1
- package/components/table/TableRowCollapse.js +1 -1
- package/components/tabs/Tabs.js +1 -1
- package/components/tag/Tag.js +1 -1
- package/components/text/Text.js +1 -1
- package/components/text-avatar/TextAvatar.js +1 -1
- package/components/textarea/Textarea.js +1 -1
- package/components/theme-select/ThemeSelect.js +1 -1
- package/components/thumbnail/Thumbnail.js +1 -1
- package/components/toast/Toast.js +1 -1
- package/components/toast/ToastContext.js +1 -1
- package/components/toggle/Toggle.js +1 -1
- package/components/tooltip/Tooltip.js +1 -1
- package/components/ui/alert-dialog.js +1 -1
- package/components/ui/avatar.js +1 -1
- package/components/ui/card.js +1 -1
- package/components/ui/checkbox.js +1 -1
- package/components/ui/dialog.js +1 -1
- package/components/ui/dropdown-menu.js +1 -1
- package/components/ui/input.js +1 -1
- package/components/ui/popover.js +1 -1
- package/components/ui/progress.js +1 -1
- package/components/ui/radio-group.js +1 -1
- package/components/ui/select.js +1 -1
- package/components/ui/separator.js +1 -1
- package/components/ui/sheet.d.ts +1 -1
- package/components/ui/sheet.js +1 -1
- package/components/ui/skeleton.js +1 -1
- package/components/ui/switch.js +1 -1
- package/components/ui/tabs.js +1 -1
- package/components/ui/textarea.js +1 -1
- package/components/ui/tooltip.js +1 -1
- package/package.json +1 -1
- package/pivot-table.css +13 -0
- package/reset.css +459 -457
- package/table-theme-overrides.css +3 -0
- package/tailwind.css +19 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/utils/cn.d.ts +2 -6
- package/utils/cn.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../tslib.es6-cdc5f922.js"),r=require("react"),t=require("clsx"),a=require("../button/Button.js"),n=require("../flex/Flex.js"),o=require("../input/Input.js"),s=require("../text/Text.js"),l=require("../../icons/CheckmarkIcon.js"),i=require("../../icons/ChevronDownIcon.js"),c=require("../../icons/ChevronRightIcon.js"),d=require("../../icons/CopyIcon.js"),u=require("../../icons/HelpIcon.js"),x=require("../../icons/LinkIcon.js"),b=require("../../icons/SearchIcon.js"),g=require("../../utils/jsonParse.js"),h=require("react/jsx-runtime");function p(e){return e&&e.__esModule?e:{default:e}}require("../../_rollupPluginBabelHelpers-4522587c.js"),require("class-variance-authority"),require("../button/RippleGroup.js"),require("framer-motion"),require("uuid"),require("../button/_Ripple.js"),require("../../utils/getAminoColor.js"),require("../../styles/constants/theme.js"),require("../button/useRipple.js"),require("../spinner/Spinner.js"),require("../../utils/cn.js"),require("tailwind-merge"),require("../../utils/getTestId.js"),require("../help-text/HelpText.js"),require("../input/input-type/_DateInput.js"),require("@floating-ui/react"),require("../input/input-type/_FloatLabelInput.js"),require("../../icons/CalendarIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../input/input-type/_NumberInput.js"),require("../../icons/CaretDownIcon.js"),require("../../icons/CaretUpIcon.js"),require("../input/input-type/_PasswordInput.js"),require("../../icons/EyeIcon.js"),require("../../icons/EyeOffIcon.js"),require("../input/input-type/_TimeInput.js"),require("../../icons/ClockIcon.js");var y=p(t),f=function(e){return null===e?"null":Array.isArray(e)?"array":typeof e},v=function(r,t){var a,n,o=r;try{for(var s=e.__values(t),l=s.next();!l.done;l=s.next()){var i=l.value;if(null===o||"object"!=typeof o)return;if(Array.isArray(o)){var c=parseInt(i,10);if(Number.isNaN(c)||c<0||c>=o.length)return;o=o[c]}else{if(!(i in o))return;o=o[i]}}}catch(e){a={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(a)throw a.error}}return o},k=function(e){switch(e){case"object":return"{}";case"array":return"[]";case"string":return'""';case"number":return"#";case"boolean":return"◯";case"null":return"∅";default:return"?"}},m=function(r,t){var a,n;if(null===r||"object"!=typeof r)return r;if(Array.isArray(r))return r.map(function(e){return m(e,t)});var o=r,s=Object.keys(o).sort(function(e,r){var a=e.localeCompare(r,void 0,{sensitivity:"base"});return"asc"===t?a:-a}),l={};try{for(var i=e.__values(s),c=i.next();!c.done;c=i.next()){var d=c.value,u=o[d];void 0!==u&&(l[d]=m(u,t))}}catch(e){a={error:e}}finally{try{c&&!c.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return l},j=function(e){return"undefined"!=typeof CSS&&CSS.escape?CSS.escape(e):e.replace(/["\\]/g,"\\$&")},w=function(e,r){switch(r){case"array":var t=e;return"".concat(t.length," ").concat(1===t.length?"item":"items");case"object":var a=e,n=Object.keys(a);return"".concat(n.length," ").concat(1===n.length?"field":"fields");case"string":case"number":return String(e);case"boolean":return e?"true":"false";case"null":return"null";default:return""}},N=function(e,r){if("string"===r){var t=String(e);return t.length>30?t:void 0}},_=function(r,t,a,n,o){var s;if(void 0===a&&(a=[]),void 0===n&&(n=[]),void 0===o&&(o=50),n.length>=o)return n;var l=t.toLowerCase();if(null===r||"object"!=typeof r){var i=String(r);return i.toLowerCase().includes(l)&&n.push({key:null!==(s=a[a.length-1])&&void 0!==s?s:"root",matchType:"value",path:a,preview:i.length>50?"".concat(i.slice(0,50),"..."):i}),n}return Array.isArray(r)?r.forEach(function(r,s){n.length<o&&_(r,t,e.__spreadArray(e.__spreadArray([],e.__read(a),!1),[String(s)],!1),n,o)}):Object.entries(r).forEach(function(r){var s=e.__read(r,2),i=s[0],c=s[1];if(!(n.length>=o)){if(i.toLowerCase().includes(l)){var d=f(c);n.push({key:i,matchType:"key",path:e.__spreadArray(e.__spreadArray([],e.__read(a),!1),[i],!1),preview:w(c,d)})}_(c,t,e.__spreadArray(e.__spreadArray([],e.__read(a),!1),[i],!1),n,o)}}),n},C=function(e){var r=e.name,t=e.value,a=f(t),n="boolean"===a?t?"true":"false":String(t);return h.jsx("div",{className:"min-w-[260px] max-w-[320px] shrink-0 overflow-y-auto border-r border-border-color bg-surface dark:bg-gray-800 dark:border-gray-700",children:h.jsxs("div",{className:"flex items-center gap-2 bg-blue-600 px-3 py-2.5",children:[h.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center rounded bg-blue-500 text-[10px] font-semibold text-white",children:k(a)}),h.jsx("span",{className:"whitespace-nowrap text-[13px] font-medium text-white",children:r}),h.jsx("span",{className:y.default("ml-auto max-w-[180px] overflow-hidden text-ellipsis whitespace-nowrap font-mono text-[13px]",function(){switch(a){case"string":return"text-orange-200";case"number":return"text-blue-200";case"boolean":return"text-purple-200";case"null":return"text-blue-200 italic";default:return""}}()),children:n})]})})},S=function(t){var a=t.columnIndex,n=t.data,o=t.isActiveColumn,s=t.onFocusColumn,l=t.onSelect,i=t.selectedKey,d=r.useRef(null),u=r.useMemo(function(){return null===n||"object"!=typeof n?[]:Array.isArray(n)?n.map(function(e,r){return{key:r.toString(),type:f(e),value:e}}):Object.entries(n).map(function(r){var t=e.__read(r,2),a=t[0],n=t[1];return{key:a,type:f(n),value:n}})},[n]);return r.useEffect(function(){if(o&&i&&d.current){var e=j(i),r=d.current.querySelector('[data-key="'.concat(e,'"]'));r&&(r.focus(),r.scrollIntoView({behavior:"smooth",block:"nearest"}))}},[o,i]),r.useEffect(function(){if(i&&d.current){var e=j(i),r=d.current.querySelector('[data-key="'.concat(e,'"]'));r&&r.scrollIntoView({behavior:"smooth",block:"nearest"})}},[i]),0===u.length?h.jsx("div",{className:"w-[280px] min-w-[280px] max-w-[280px] shrink-0 grow-0 overflow-y-auto border-r border-border-color bg-surface dark:border-gray-700 dark:bg-gray-800 [&::-webkit-scrollbar-thumb]:rounded [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar]:w-1.5",children:h.jsx("div",{className:"p-6 text-center italic text-gray-500",children:"Empty"})}):h.jsx("div",{ref:d,className:"w-[280px] min-w-[280px] max-w-[280px] shrink-0 grow-0 overflow-y-auto border-r border-border-color bg-surface dark:border-gray-700 dark:bg-gray-800 [&::-webkit-scrollbar-thumb]:rounded [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar]:w-1.5",children:u.map(function(e){var r="object"===e.type||"array"===e.type,t=i===e.key;return h.jsxs("button",{className:y.default("flex w-full cursor-pointer items-center gap-2 border-none bg-transparent px-3 py-2.5 text-left transition-colors duration-100 hover:bg-gray-50 dark:hover:bg-gray-700",t&&"bg-blue-600 hover:bg-blue-600 dark:bg-blue-600 dark:hover:bg-blue-600"),"data-key":e.key,onClick:function(){s(a),l(e.key)},onFocus:function(){return s(a)},type:"button",children:[h.jsx("span",{className:y.default("flex size-5 shrink-0 items-center justify-center rounded bg-gray-100 text-[10px] font-semibold text-gray-500 dark:bg-gray-700 dark:text-gray-400",t&&"bg-blue-500 text-white dark:bg-blue-500 dark:text-white"),children:k(e.type)}),h.jsx("span",{className:y.default("flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-[13px] font-medium text-gray-800 dark:text-gray-200",t&&"text-white dark:text-white"),title:e.key,children:e.key}),h.jsx("span",{className:y.default("max-w-[100px] shrink-0 overflow-hidden text-ellipsis whitespace-nowrap text-xs text-gray-500 dark:text-gray-500",t&&"text-blue-200 dark:text-blue-200"),title:N(e.value,e.type),children:w(e.value,e.type)}),r&&h.jsx(c.ChevronRightIcon,{className:y.default("shrink-0 text-gray-400",t&&"text-blue-200 dark:text-blue-200"),size:14})]},e.key)})})},A=function(t){var a=t.depth,n=t.expandedPaths,o=t.nodeKey,s=t.onCopy,l=t.onSelect,u=t.onToggle,x=t.path,b=t.selectedPath,g=t.value,p=f(g),v="object"===p||"array"===p,m=n.has(x),j=e.__read(r.useState(!1),2),_=j[0],C=j[1],S=x.split("::").slice(1),I=null!==b&&S.length===b.length&&S.every(function(e,r){return e===b[r]}),z=r.useMemo(function(){return v&&m?Array.isArray(g)?g.map(function(e,r){return{key:r.toString(),value:e}}):Object.entries(g).map(function(r){var t=e.__read(r,2);return{key:t[0],value:t[1]}}):[]},[g,v,m]);return h.jsxs("div",{className:"block",children:[h.jsxs("div",{className:y.default("relative mx-2 flex cursor-pointer items-center gap-1 rounded px-2 py-1 hover:bg-gray-50 dark:hover:bg-gray-800",I&&"bg-blue-50 hover:bg-blue-100 dark:bg-gray-700 dark:hover:bg-gray-600"),"data-path":JSON.stringify(S),onClick:function(e){e.stopPropagation(),l(S,g),v&&u(x)},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),l(S,g),v&&u(x))},onMouseEnter:function(){return C(!0)},onMouseLeave:function(){return C(!1)},role:"button",style:{paddingLeft:"".concat(20*a+8,"px")},tabIndex:0,children:[v&&h.jsx("span",{className:"flex size-[18px] items-center justify-center text-gray-500",children:m?h.jsx(i.ChevronDownIcon,{size:14}):h.jsx(c.ChevronRightIcon,{size:14})}),!v&&h.jsx("span",{className:"w-[18px]"}),h.jsx("span",{className:"mr-1 flex size-[18px] shrink-0 items-center justify-center rounded-[3px] bg-gray-100 text-[9px] font-semibold text-gray-500 dark:bg-gray-700 dark:text-gray-400",children:k(p)}),h.jsx("span",{className:"font-medium text-gray-800 dark:text-gray-200",title:o,children:o}),!v&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"mx-1 text-gray-500 dark:text-gray-600",children:":"}),function(){switch(p){case"string":return h.jsxs("span",{className:"text-orange-600 dark:text-orange-400",children:['"',String(g),'"']});case"number":return h.jsx("span",{className:"text-blue-600 dark:text-blue-400",children:String(g)});case"boolean":return h.jsx("span",{className:"text-purple-600 dark:text-purple-400",children:g?"true":"false"});case"null":return h.jsx("span",{className:"italic text-gray-500 dark:text-gray-500",children:"null"});default:return null}}()]}),v&&!m&&h.jsx("span",{className:"ml-2 text-xs text-gray-400 dark:text-gray-600",title:N(g,p),children:w(g,p)}),_&&h.jsx("button",{className:"absolute right-2 top-1/2 flex size-[22px] -translate-y-1/2 cursor-pointer items-center justify-center rounded border-none bg-gray-100 text-gray-600 hover:bg-gray-200 hover:text-gray-800 dark:bg-gray-700 dark:text-gray-400 dark:hover:bg-gray-600 dark:hover:text-gray-200",onClick:function(e){e.stopPropagation(),s(g)},type:"button",children:h.jsx(d.CopyIcon,{size:12})})]}),m&&z.length>0&&h.jsx("div",{className:"block",children:z.map(function(e){return h.jsx(A,{depth:a+1,expandedPaths:n,nodeKey:e.key,onCopy:s,onSelect:l,onToggle:u,path:"".concat(x,"::").concat(e.key),selectedPath:b,value:e.value},e.key)})})]})},I=function(t){var n=t.data,o=t.onCopy,s=r.useMemo(function(){return JSON.stringify(n,null,2)},[n]),l=r.useMemo(function(){return s.split("\n")},[s]),i=r.useRef(null),c=e.__read(r.useState(0),2),u=c[0],x=c[1],b=e.__read(r.useState(!1),2),g=b[0],p=b[1],y=e.__read(r.useState(1),2),f=y[0],v=y[1];r.useEffect(function(){var e=i.current;if(e){var r=function(){var r=e.clientHeight,t=e.scrollHeight,a=e.scrollTop,n=t-r;x(n>0?a/n:0);var o=Math.floor(a/19.5)+1;v(Math.min(o,l.length)),p(n>100)};return e.addEventListener("scroll",r),r(),function(){return e.removeEventListener("scroll",r)}}},[l.length]);var k=function(){var e;null===(e=i.current)||void 0===e||e.scrollTo({behavior:"smooth",top:0})},m=function(){i.current&&i.current.scrollTo({behavior:"smooth",top:i.current.scrollHeight})},j=function(){i.current&&i.current.scrollBy({behavior:"smooth",top:.8*-i.current.clientHeight})},w=function(){i.current&&i.current.scrollBy({behavior:"smooth",top:.8*i.current.clientHeight})};return r.useEffect(function(){var e=function(e){e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement||("PageUp"===e.key?(e.preventDefault(),j()):"PageDown"===e.key?(e.preventDefault(),w()):"Home"===e.key&&(e.metaKey||e.ctrlKey)?(e.preventDefault(),k()):"End"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),m()))};return window.addEventListener("keydown",e),function(){return window.removeEventListener("keydown",e)}},[]),h.jsxs("div",{className:"relative flex h-full flex-col",children:[h.jsxs("div",{className:"flex items-center gap-4 border-b border-border-color bg-surface px-4 py-2 dark:border-gray-700 dark:bg-gray-900",children:[h.jsx(a.Button,{icon:h.jsx(d.CopyIcon,{size:16}),onClick:o,size:"sm",variant:"subtle",children:"Copy JSON"}),h.jsxs("span",{className:"text-xs text-gray-500",children:[l.length.toLocaleString()," lines"]})]}),h.jsxs("div",{ref:i,className:"flex flex-1 overflow-auto scroll-smooth bg-gray-900 dark:bg-[#1a1a2e] [&::-webkit-scrollbar-thumb]:rounded-[7px] [&::-webkit-scrollbar-thumb]:border-[3px] [&::-webkit-scrollbar-thumb]:border-transparent [&::-webkit-scrollbar-thumb]:bg-clip-content [&::-webkit-scrollbar-thumb]:bg-white/20 [&::-webkit-scrollbar-thumb:hover]:bg-white/30 [&::-webkit-scrollbar-thumb:hover]:bg-clip-content [&::-webkit-scrollbar-track]:bg-black/20 [&::-webkit-scrollbar]:size-3.5",children:[h.jsx("div",{className:"sticky left-0 z-[1] shrink-0 select-none bg-black/20 py-4 dark:bg-black/30",children:l.map(function(e,r){return h.jsx("div",{className:"px-4 text-right font-mono text-[13px] leading-[1.5] text-gray-600",children:r+1},r)})}),h.jsx("pre",{className:"m-0 min-w-0 flex-1 p-4 font-mono text-[13px] leading-[1.5] text-gray-200 dark:text-gray-100",children:h.jsx("code",{className:"block whitespace-pre",children:s})})]}),g&&h.jsxs("div",{className:"absolute bottom-4 right-4 z-10 flex flex-col items-end gap-2",children:[h.jsxs("div",{className:"rounded bg-[rgba(30,30,46,0.95)] px-2 py-1 font-mono text-[11px] text-white/70 backdrop-blur",children:["Line ",f.toLocaleString()," /"," ",l.length.toLocaleString()]}),h.jsx("div",{className:"h-[60px] w-1 overflow-hidden rounded-sm bg-white/10",children:h.jsx("div",{className:"w-full rounded-sm bg-blue-500 transition-[height] duration-100",style:{height:"".concat(100*u,"%")}})}),h.jsxs("div",{className:"flex flex-col gap-1 rounded-lg border border-white/10 bg-[rgba(30,30,46,0.95)] p-1.5 backdrop-blur",children:[h.jsx("button",{className:"flex size-7 items-center justify-center rounded border-none bg-transparent text-white/60 transition-all duration-150 hover:bg-white/10 hover:text-white active:bg-white/15 disabled:cursor-not-allowed disabled:opacity-30",disabled:u<.01,onClick:k,title:"Scroll to top (Cmd/Ctrl+Home)",type:"button",children:h.jsx("svg",{fill:"currentColor",height:"14",viewBox:"0 0 24 24",width:"14",children:h.jsx("path",{d:"M12 4L4 12h5v8h6v-8h5L12 4z"})})}),h.jsx("button",{className:"flex size-7 items-center justify-center rounded border-none bg-transparent text-white/60 transition-all duration-150 hover:bg-white/10 hover:text-white active:bg-white/15 disabled:cursor-not-allowed disabled:opacity-30",disabled:u<.01,onClick:j,title:"Page up (PageUp)",type:"button",children:h.jsx("svg",{fill:"currentColor",height:"12",viewBox:"0 0 24 24",width:"12",children:h.jsx("path",{d:"M7 14l5-5 5 5H7z"})})}),h.jsx("button",{className:"flex size-7 items-center justify-center rounded border-none bg-transparent text-white/60 transition-all duration-150 hover:bg-white/10 hover:text-white active:bg-white/15 disabled:cursor-not-allowed disabled:opacity-30",disabled:u>.99,onClick:w,title:"Page down (PageDown)",type:"button",children:h.jsx("svg",{fill:"currentColor",height:"12",viewBox:"0 0 24 24",width:"12",children:h.jsx("path",{d:"M7 10l5 5 5-5H7z"})})}),h.jsx("button",{className:"flex size-7 items-center justify-center rounded border-none bg-transparent text-white/60 transition-all duration-150 hover:bg-white/10 hover:text-white active:bg-white/15 disabled:cursor-not-allowed disabled:opacity-30",disabled:u>.99,onClick:m,title:"Scroll to bottom (Cmd/Ctrl+End)",type:"button",children:h.jsx("svg",{fill:"currentColor",height:"14",viewBox:"0 0 24 24",width:"14",children:h.jsx("path",{d:"M12 20l8-8h-5V4H9v8H4l8 8z"})})})]})]})]})},z=function(r){var t=r.data,a=r.indent,n=void 0===a?0:a,o=" ".repeat(n),s=" ".repeat(n+1);if(null===t)return h.jsx("span",{className:"italic text-gray-500 dark:text-gray-500",children:"null"});if("boolean"==typeof t)return h.jsx("span",{className:"text-cyan-600 dark:text-cyan-400",children:t?"true":"false"});if("number"==typeof t)return h.jsx("span",{className:"text-purple-600 dark:text-purple-400",children:t});if("string"==typeof t)return h.jsxs("span",{className:"text-orange-600 dark:text-orange-400",children:['"',t,'"']});if(Array.isArray(t))return 0===t.length?h.jsx("span",{className:"text-gray-600 dark:text-gray-500",children:"[]"}):h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-gray-600 dark:text-gray-500",children:"["}),"\n",t.map(function(e,r){return h.jsxs("span",{children:[s,h.jsx(z,{data:e,indent:n+1}),r<t.length-1&&h.jsx("span",{className:"text-gray-500 dark:text-gray-600",children:","}),"\n"]},"array-".concat(n,"-").concat(r))}),o,h.jsx("span",{className:"text-gray-600 dark:text-gray-500",children:"]"})]});if("object"==typeof t){var l=Object.entries(t);return 0===l.length?h.jsx("span",{className:"text-gray-600 dark:text-gray-500",children:"{}"}):h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-gray-600 dark:text-gray-500",children:"{"}),"\n",l.map(function(r,t){var a=e.__read(r,2),o=a[0],i=a[1];return h.jsxs("span",{children:[s,h.jsxs("span",{className:"text-blue-600 dark:text-blue-400",children:['"',o,'"']}),h.jsx("span",{className:"text-gray-500 dark:text-gray-600",children:": "}),h.jsx(z,{data:i,indent:n+1}),t<l.length-1&&h.jsx("span",{className:"text-gray-500 dark:text-gray-600",children:","}),"\n"]},o)}),o,h.jsx("span",{className:"text-gray-600 dark:text-gray-500",children:"}"})]})}return null},q=function(t){var n=t.path,o=t.value,s=f(o),i=e.__read(r.useState(!1),2),c=i[0],u=i[1],x=e.__read(r.useState(!1),2),b=x[0],g=x[1],p="object"!==s&&"array"!==s,y=r.useRef(null),v=r.useRef(null);r.useEffect(function(){return function(){y.current&&clearTimeout(y.current),v.current&&clearTimeout(v.current)}},[]);return h.jsxs("div",{className:"p-0",children:[h.jsxs("div",{className:"mb-4 flex flex-col gap-3 border-b border-gray-100 bg-gradient-to-b from-gray-50 to-transparent px-4 pb-4 pt-4 dark:border-gray-700 dark:from-gray-800",children:[h.jsxs("div",{className:"flex items-center gap-2.5",children:[h.jsx("div",{className:"break-all font-mono text-base font-semibold text-blue-600 dark:text-blue-400",children:0===n.length?h.jsx("span",{className:"font-medium text-gray-500 dark:text-gray-500",children:"root"}):n[n.length-1]}),h.jsx("span",{className:"inline-flex shrink-0 rounded px-2.5 py-[3px] text-[10px] font-bold uppercase tracking-wide bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300",children:s.toUpperCase()})]}),n.length>1&&h.jsx("div",{className:"break-all font-mono text-[11px] text-gray-500 dark:text-gray-500",children:n.join(".")}),h.jsx("div",{className:"flex flex-wrap items-center gap-2",children:p?h.jsx(a.Button,{icon:b?h.jsx(l.CheckmarkIcon,{size:14}):h.jsx(d.CopyIcon,{size:14}),onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var r,t;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),r=null===o?"null":String(o),[4,navigator.clipboard.writeText(r)];case 1:return e.sent(),g(!0),v.current&&clearTimeout(v.current),v.current=setTimeout(function(){return g(!1)},2e3),[3,3];case 2:return t=e.sent(),console.error("Failed to copy:",t),[3,3];case 3:return[2]}})})},size:"sm",variant:"standard",children:b?"Copied!":"Copy Value"}):h.jsx(a.Button,{icon:c?h.jsx(l.CheckmarkIcon,{size:14}):h.jsx(d.CopyIcon,{size:14}),onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var r,t;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),r="object"==typeof o?JSON.stringify(o,null,2):String(o),[4,navigator.clipboard.writeText(r)];case 1:return e.sent(),u(!0),y.current&&clearTimeout(y.current),y.current=setTimeout(function(){return u(!1)},2e3),[3,3];case 2:return t=e.sent(),console.error("Failed to copy:",t),[3,3];case 3:return[2]}})})},size:"sm",variant:"standard",children:c?"Copied!":"Copy JSON"})})]}),h.jsxs("div",{className:"px-4 pb-4",children:[h.jsx("span",{className:"mb-2 block text-[11px] font-semibold uppercase tracking-wide text-gray-500",children:p?"Value":"Preview"}),h.jsx("pre",{className:"m-0 break-words whitespace-pre-wrap rounded-md bg-gray-50 px-3 py-2 font-mono text-[13px] leading-relaxed dark:bg-gray-800",children:h.jsx(z,{data:o})})]})]})};exports.JsonVisionViewer=function(t){var i,c=t.data,d=t.defaultViewMode,p=void 0===d?"tree":d,k=t.onClose,j=t.onShare,w=t.title,N=e.__read(r.useState(p),2),z=N[0],T=N[1],E=e.__read(r.useState("original"),2),L=E[0],D=E[1],M=e.__read(r.useState([]),2),H=M[0],P=M[1],O=e.__read(r.useState(0),2),R=O[0],B=O[1],K=e.__read(r.useState(""),2),F=K[0],V=K[1],U=e.__read(r.useState(!1),2),J=U[0],Z=U[1],G=e.__read(r.useState(-1),2),W=G[0],$=G[1],Q=e.__read(r.useState(new Set(["root"])),2),X=Q[0],Y=Q[1],ee=e.__read(r.useState("idle"),2),re=ee[0],te=ee[1],ae=r.useRef(null),ne=e.__read(r.useState(!1),2),oe=ne[0],se=ne[1];r.useEffect(function(){return function(){ae.current&&clearTimeout(ae.current)}},[]);var le=r.useMemo(function(){var e;if("undefined"==typeof navigator)return!1;var r=null===(e=navigator.userAgentData)||void 0===e?void 0:e.platform;return/Mac|iPod|iPhone|iPad/i.test(null!=r?r:navigator.userAgent)},[]),ie=le?"⌘":"Ctrl",ce=r.useRef(null),de=r.useRef(null),ue=r.useRef(null),xe=r.useRef(null),be=r.useRef(null);r.useEffect(function(){var e=function(e){var r;be.current&&!be.current.contains(e.target)&&Z(!1),de.current&&!(null===(r=de.current.parentElement)||void 0===r?void 0:r.contains(e.target))&&se(!1)};return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[]);var ge=r.useMemo(function(){return c&&"original"!==L?m(c,"keys-asc"===L?"asc":"desc"):c},[c,L]),he=r.useMemo(function(){return!ge||F.length<2?[]:_(ge,F)},[ge,F]);r.useEffect(function(){$(-1)},[he]);var pe=r.useCallback(function(r){var t,a;if(J&&0!==he.length)if("ArrowDown"===r.key)r.preventDefault(),$(function(e){return e<he.length-1?e+1:e});else if("ArrowUp"===r.key)r.preventDefault(),$(function(e){return e>0?e-1:e});else if("Enter"===r.key&&W>=0){r.preventDefault();var n=he[W];if(n&&(P(n.path),B(n.path.length-1),Z(!1),V(""),"tree"===z)){var o=new Set(X),s="root";try{for(var l=e.__values(n.path),i=l.next();!i.done;i=l.next()){var c=i.value;s="".concat(s,"::").concat(c),o.add(s)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(a=l.return)&&a.call(l)}finally{if(t)throw t.error}}Y(o)}}else"Escape"===r.key&&(Z(!1),$(-1))},[J,he,W,z,X]),ye=r.useCallback(function(r){var t,a;if(P(r.path),B(r.path.length-1),Z(!1),V(""),"tree"===z){var n=new Set(X),o="root";try{for(var s=e.__values(r.path),l=s.next();!l.done;l=s.next()){var i=l.value;o="".concat(o,"::").concat(i),n.add(o)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(a=s.return)&&a.call(s)}finally{if(t)throw t.error}}Y(n)}},[z,X]),fe=r.useCallback(function(){return e.__awaiter(void 0,void 0,void 0,function(){var r;return e.__generator(this,function(e){switch(e.label){case 0:if(!j)return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,j()];case 2:return e.sent(),te("copied"),ae.current&&clearTimeout(ae.current),ae.current=setTimeout(function(){return te("idle")},2e3),[3,4];case 3:return r=e.sent(),console.error("Failed to share:",r),[3,4];case 4:return[2]}})})},[j]),ve=r.useMemo(function(){if(ge)return 0===H.length?ge:v(ge,H)},[ge,H]),ke=r.useMemo(function(){var e,r;if(!ge)return[];var t=[];t.push({data:ge,selectedKey:null!==(e=H[0])&&void 0!==e?e:null});for(var a=ge,n=0;n<H.length;n+=1){var o=H[n];if(!o||null===a||"object"!=typeof a)break;if(Array.isArray(a)){var s=parseInt(o,10);if(!(!Number.isNaN(s)&&s>=0&&s<a.length))break;a=a[s]}else{if(!(o in a))break;a=a[o]}null!==a&&"object"==typeof a&&t.push({data:a,selectedKey:null!==(r=H[n+1])&&void 0!==r?r:null})}return t},[ge,H]),me=r.useCallback(function(e,r){P(function(t){var a=t.slice(0,e);return a.push(r),a})},[]),je=r.useCallback(function(e){Y(function(r){var t=new Set(r);return t.has(e)?t.delete(e):t.add(e),t})},[]),we=r.useCallback(function(e,r){P(e)},[]),Ne=r.useCallback(function(r){return e.__awaiter(void 0,void 0,void 0,function(){var t,a;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t="object"==typeof r?JSON.stringify(r,null,2):String(r),[4,navigator.clipboard.writeText(t)];case 1:return e.sent(),[3,3];case 2:return a=e.sent(),console.error("Failed to copy:",a),[3,3];case 3:return[2]}})})},[]),_e=r.useCallback(function(){return e.__awaiter(void 0,void 0,void 0,function(){var r;return e.__generator(this,function(e){switch(e.label){case 0:if(!ge)return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,navigator.clipboard.writeText(JSON.stringify(ge,null,2))];case 2:return e.sent(),[3,4];case 3:return r=e.sent(),console.error("Failed to copy:",r),[3,4];case 4:return[2]}})})},[ge]),Ce=r.useCallback(function(){if(c){var r=new Set,t=function(a,n){r.add(n),Array.isArray(a)?a.forEach(function(e,r){"object"==typeof e&&null!==e&&t(e,"".concat(n,"::").concat(r))}):"object"==typeof a&&null!==a&&Object.entries(a).forEach(function(r){var a=e.__read(r,2),o=a[0],s=a[1];"object"==typeof s&&null!==s&&t(s,"".concat(n,"::").concat(o))})};t(c,"root"),Y(r)}},[c]),Se=r.useCallback(function(){Y(new Set(["root"]))},[]),Ae=r.useCallback(function(r){var t=ke[r];return null==(null==t?void 0:t.data)||"object"!=typeof t.data?[]:Array.isArray(t.data)?t.data.map(function(e,r){return{key:r.toString(),type:f(e),value:e}}):Object.entries(t.data).map(function(r){var t=e.__read(r,2),a=t[0],n=t[1];return{key:a,type:f(n),value:n}})},[ke]);return r.useEffect(function(){var e=function(e){var r,t,a;if(!(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement))if(!e.metaKey&&!e.ctrlKey||"f"!==e.key)if(!e.metaKey&&!e.ctrlKey||"c"!==e.key){if("tree"!==z){if("column"===z){var n=Ae(R),o=H[R],s=n.findIndex(function(e){return e.key===o});if("ArrowDown"===e.key){if(e.preventDefault(),0===n.length)return;if(-1===s){var l=n[0];return void(l&&me(R,l.key))}if(s<n.length-1){var i=n[s+1];i&&me(R,i.key)}}else if("ArrowUp"===e.key){if(e.preventDefault(),0===n.length)return;if(-1===s){var c=n[n.length-1];return void(c&&me(R,c.key))}if(s>0){var d=n[s-1];d&&me(R,d.key)}}else if("ArrowLeft"===e.key)e.preventDefault(),R>0&&(B(R-1),P(function(e){return e.slice(0,R)}));else if("ArrowRight"===e.key){e.preventDefault();var u=n[s];if(u&&("object"===u.type||"array"===u.type)&&R<ke.length-1){B(R+1);var x=Ae(R+1);x.length>0&&x[0]&&me(R+1,x[0].key)}}}}else if("ArrowDown"===e.key||"ArrowUp"===e.key||"ArrowLeft"===e.key||"ArrowRight"===e.key){e.preventDefault();var b=null===(t=ue.current)||void 0===t?void 0:t.querySelectorAll('[role="button"][data-path]');if(!b||0===b.length)return;var h=null===(a=ue.current)||void 0===a?void 0:a.querySelector('[role="button"][data-path].bg-blue-50'),p=Array.from(b),y=h?p.indexOf(h):-1,f=function(e){var r=p[e];if(r){var t=r.getAttribute("data-path");if(null!==t){var a=g.jsonParse(t);Array.isArray(a)&&we(a)}r.scrollIntoView({behavior:"smooth",block:"nearest"})}};if("ArrowDown"===e.key)f(-1===y?0:Math.min(y+1,p.length-1));else if("ArrowUp"===e.key){f(-1===y?p.length-1:Math.max(y-1,0))}else if("ArrowRight"===e.key&&h){var k=H.length>0?"root::".concat(H.join("::")):"",m=v(ge,H);k&&("object"==typeof m&&null!==m)&&!X.has(k)?je(k):y>=0&&y<p.length-1&&f(y+1)}else if("ArrowLeft"===e.key&&h){(k=H.length>0?"root::".concat(H.join("::")):"")&&X.has(k)?je(k):H.length>1&&P(function(e){return e.slice(0,-1)})}}}else{var j=window.getSelection();void 0!==ve&&H.length>0&&(!j||0===j.toString().length)&&(e.preventDefault(),Ne(ve))}else"column"!==z&&"tree"!==z||(e.preventDefault(),null===(r=xe.current)||void 0===r||r.focus())};return window.addEventListener("keydown",e),function(){return window.removeEventListener("keydown",e)}},[z,R,H,ke,Ae,me,ve,Ne,X,je,we]),c?h.jsxs("div",{ref:ce,className:"flex h-full flex-col overflow-hidden rounded-lg bg-surface dark:bg-gray-900",children:[h.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4 border-b border-border-color bg-surface px-4 py-3 dark:border-gray-700 dark:bg-gray-900",children:[h.jsxs(n.Flex,{alignItems:"center",gap:16,children:[w&&h.jsx(s.Text,{fontWeight:600,children:w}),h.jsxs("div",{className:"flex items-center gap-1 rounded-lg bg-gray-100 p-1 dark:bg-gray-800",children:[h.jsxs("button",{className:y.default("flex items-center gap-1.5 whitespace-nowrap rounded-md border-none px-3 py-1.5 text-[13px] font-medium text-gray-600 transition-all duration-150 hover:bg-gray-200 hover:text-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-gray-200 [&>svg]:shrink-0","tree"===z&&"bg-surface text-blue-600 shadow-[0_1px_3px_rgba(0,0,0,0.1)] hover:bg-surface hover:text-blue-600 dark:bg-gray-700 dark:text-blue-400 dark:shadow-[0_1px_3px_rgba(0,0,0,0.3)] dark:hover:bg-gray-700 dark:hover:text-blue-400 [&>svg]:text-blue-600 dark:[&>svg]:text-blue-400"),onClick:function(){return T("tree")},type:"button",children:[h.jsx("svg",{fill:"currentColor",height:"14",viewBox:"0 0 24 24",width:"14",children:h.jsx("path",{d:"M3 5h18v2H3V5zm4 4h14v2H7V9zm4 4h10v2H11v-2zm4 4h6v2h-6v-2z"})}),h.jsx("span",{children:"Tree"})]}),h.jsxs("button",{className:y.default("flex items-center gap-1.5 whitespace-nowrap rounded-md border-none px-3 py-1.5 text-[13px] font-medium text-gray-600 transition-all duration-150 hover:bg-gray-200 hover:text-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-gray-200 [&>svg]:shrink-0","column"===z&&"bg-surface text-blue-600 shadow-[0_1px_3px_rgba(0,0,0,0.1)] hover:bg-surface hover:text-blue-600 dark:bg-gray-700 dark:text-blue-400 dark:shadow-[0_1px_3px_rgba(0,0,0,0.3)] dark:hover:bg-gray-700 dark:hover:text-blue-400 [&>svg]:text-blue-600 dark:[&>svg]:text-blue-400"),onClick:function(){return T("column")},type:"button",children:[h.jsxs("svg",{fill:"currentColor",height:"14",viewBox:"0 0 24 24",width:"14",children:[h.jsx("rect",{height:"18",rx:"1",width:"6",x:"2",y:"3"}),h.jsx("rect",{height:"18",rx:"1",width:"6",x:"9",y:"3"}),h.jsx("rect",{height:"18",rx:"1",width:"6",x:"16",y:"3"})]}),h.jsx("span",{children:"Columns"})]}),h.jsxs("button",{className:y.default("flex items-center gap-1.5 whitespace-nowrap rounded-md border-none px-3 py-1.5 text-[13px] font-medium text-gray-600 transition-all duration-150 hover:bg-gray-200 hover:text-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-gray-200 [&>svg]:shrink-0","editor"===z&&"bg-surface text-blue-600 shadow-[0_1px_3px_rgba(0,0,0,0.1)] hover:bg-surface hover:text-blue-600 dark:bg-gray-700 dark:text-blue-400 dark:shadow-[0_1px_3px_rgba(0,0,0,0.3)] dark:hover:bg-gray-700 dark:hover:text-blue-400 [&>svg]:text-blue-600 dark:[&>svg]:text-blue-400"),onClick:function(){return T("editor")},type:"button",children:[h.jsx("svg",{fill:"currentColor",height:"14",viewBox:"0 0 24 24",width:"14",children:h.jsx("path",{d:"M8 3l-6 9 6 9h2l-6-9 6-9H8zm8 0l6 9-6 9h-2l6-9-6-9h2z"})}),h.jsx("span",{children:"Code"})]})]}),h.jsxs("div",{className:"ml-2 flex items-center gap-1 border-l border-gray-200 pl-3 dark:border-gray-700",children:[h.jsx("span",{className:"mr-1 text-xs text-gray-500 dark:text-gray-500",children:"Sort:"}),h.jsx("button",{className:y.default("rounded border-none bg-transparent px-2 py-1 text-xs font-medium text-gray-500 transition-all duration-150 hover:bg-gray-100 hover:text-gray-700 dark:text-gray-500 dark:hover:bg-gray-700 dark:hover:text-gray-300","original"===L&&"bg-blue-100 text-blue-700 hover:bg-blue-100 hover:text-blue-700 dark:bg-blue-900 dark:text-blue-300 dark:hover:bg-blue-900 dark:hover:text-blue-300"),onClick:function(){return D("original")},title:"Original order from API",type:"button",children:"Original"}),h.jsx("button",{className:y.default("rounded border-none bg-transparent px-2 py-1 text-xs font-medium text-gray-500 transition-all duration-150 hover:bg-gray-100 hover:text-gray-700 dark:text-gray-500 dark:hover:bg-gray-700 dark:hover:text-gray-300","keys-asc"===L&&"bg-blue-100 text-blue-700 hover:bg-blue-100 hover:text-blue-700 dark:bg-blue-900 dark:text-blue-300 dark:hover:bg-blue-900 dark:hover:text-blue-300"),onClick:function(){return D("keys-asc")},title:"Sort keys A to Z",type:"button",children:"A-Z"}),h.jsx("button",{className:y.default("rounded border-none bg-transparent px-2 py-1 text-xs font-medium text-gray-500 transition-all duration-150 hover:bg-gray-100 hover:text-gray-700 dark:text-gray-500 dark:hover:bg-gray-700 dark:hover:text-gray-300","keys-desc"===L&&"bg-blue-100 text-blue-700 hover:bg-blue-100 hover:text-blue-700 dark:bg-blue-900 dark:text-blue-300 dark:hover:bg-blue-900 dark:hover:text-blue-300"),onClick:function(){return D("keys-desc")},title:"Sort keys Z to A",type:"button",children:"Z-A"})]})]}),h.jsxs(n.Flex,{alignItems:"center",gap:8,children:[("column"===z||"tree"===z)&&h.jsxs("div",{ref:be,className:"relative flex items-center",children:[h.jsx(b.SearchIcon,{className:"pointer-events-none absolute left-2.5 z-[1] text-gray-500",size:16}),h.jsx(o.Input,{className:"[&>input]:pl-8",inputRef:xe,onChange:function(e){V(e.target.value),Z(e.target.value.length>=2)},onFocus:function(){return Z(F.length>=2)},onKeyDown:pe,placeholder:"Search keys & values...",size:"sm",style:{width:358},value:F}),J&&he.length>0&&h.jsxs("div",{className:"absolute left-0 right-0 top-full z-[100] mt-1 min-w-[280px] max-h-[300px] overflow-y-auto rounded-lg border border-border-color bg-surface shadow-[0_4px_12px_rgba(0,0,0,0.15)] dark:border-gray-700 dark:bg-gray-800",children:[he.map(function(e,r){return h.jsxs("button",{className:y.default("flex w-full flex-col items-start gap-0.5 border-b border-gray-100 bg-transparent px-3 py-2 text-left transition-colors duration-100 last:border-b-0 hover:bg-blue-50 dark:border-gray-700 dark:hover:bg-gray-700",r===W&&"bg-blue-50 dark:bg-gray-700"),onClick:function(){return ye(e)},type:"button",children:[h.jsx("span",{className:"break-all font-mono text-xs text-blue-600 dark:text-blue-400",children:e.path.join(".")}),h.jsx("span",{className:"max-w-full overflow-hidden text-ellipsis whitespace-nowrap text-[11px] text-gray-500 dark:text-gray-500",children:"key"===e.matchType?"(key)":e.preview})]},"".concat(e.path.join("."),"-").concat(e.matchType,"-").concat(r))}),50===he.length&&h.jsx("div",{className:"border-t border-gray-100 px-3 py-2 text-center text-[11px] text-gray-500 dark:border-gray-700",children:"Showing first 50 results..."})]}),J&&F.length>=2&&0===he.length&&h.jsx("div",{className:"absolute left-0 right-0 top-full z-[100] mt-1 min-w-[280px] max-h-[300px] overflow-y-auto rounded-lg border border-border-color bg-surface shadow-[0_4px_12px_rgba(0,0,0,0.15)] dark:border-gray-700 dark:bg-gray-800",children:h.jsx("div",{className:"px-3 py-4 text-center text-[13px] text-gray-500",children:"No matches found"})})]}),"tree"===z&&h.jsxs(n.Flex,{gap:4,children:[h.jsx(a.Button,{onClick:Ce,size:"sm",variant:"subtle",children:"Expand all"}),h.jsx(a.Button,{onClick:Se,size:"sm",variant:"subtle",children:"Collapse all"})]}),h.jsxs("div",{className:"relative",children:[h.jsx("button",{ref:de,className:"flex size-8 items-center justify-center rounded-md border-none bg-transparent text-gray-500 transition-all duration-150 hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-gray-200",onClick:function(){return se(!oe)},title:"Tips & shortcuts",type:"button",children:h.jsx(u.HelpIcon,{size:16})}),oe&&h.jsxs("div",{className:"absolute right-0 top-full z-[100] mt-2 w-[260px] overflow-hidden rounded-lg border border-gray-200 bg-white shadow-[0_4px_16px_rgba(0,0,0,0.12)] dark:border-gray-700 dark:bg-gray-800",children:[h.jsx("div",{className:"px-4 pb-2 pt-3 text-[11px] font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400",children:"Keyboard shortcuts"}),h.jsxs("div",{className:"px-4 pb-3",children:[h.jsxs("div",{className:"flex items-center justify-between py-1.5 text-[13px] text-gray-700 dark:text-gray-300",children:[h.jsxs("span",{className:"flex items-center gap-1 font-mono [&>kbd]:inline-flex [&>kbd]:min-w-[22px] [&>kbd]:h-[22px] [&>kbd]:items-center [&>kbd]:justify-center [&>kbd]:rounded [&>kbd]:border [&>kbd]:border-gray-200 [&>kbd]:bg-gray-100 [&>kbd]:px-1.5 [&>kbd]:text-[11px] [&>kbd]:text-gray-600 dark:[&>kbd]:border-gray-600 dark:[&>kbd]:bg-gray-700 dark:[&>kbd]:text-gray-300",children:[h.jsx("kbd",{children:"↑"})," ",h.jsx("kbd",{children:"↓"})]}),h.jsx("span",{children:"Navigate items"})]}),h.jsxs("div",{className:"flex items-center justify-between py-1.5 text-[13px] text-gray-700 dark:text-gray-300",children:[h.jsxs("span",{className:"flex items-center gap-1 font-mono [&>kbd]:inline-flex [&>kbd]:min-w-[22px] [&>kbd]:h-[22px] [&>kbd]:items-center [&>kbd]:justify-center [&>kbd]:rounded [&>kbd]:border [&>kbd]:border-gray-200 [&>kbd]:bg-gray-100 [&>kbd]:px-1.5 [&>kbd]:text-[11px] [&>kbd]:text-gray-600 dark:[&>kbd]:border-gray-600 dark:[&>kbd]:bg-gray-700 dark:[&>kbd]:text-gray-300",children:[h.jsx("kbd",{children:"←"})," ",h.jsx("kbd",{children:"→"})]}),h.jsx("span",{children:"Collapse/expand"})]}),h.jsxs("div",{className:"flex items-center justify-between py-1.5 text-[13px] text-gray-700 dark:text-gray-300",children:[h.jsxs("span",{className:"flex items-center gap-1 font-mono [&>kbd]:inline-flex [&>kbd]:min-w-[22px] [&>kbd]:h-[22px] [&>kbd]:items-center [&>kbd]:justify-center [&>kbd]:rounded [&>kbd]:border [&>kbd]:border-gray-200 [&>kbd]:bg-gray-100 [&>kbd]:px-1.5 [&>kbd]:text-[11px] [&>kbd]:text-gray-600 dark:[&>kbd]:border-gray-600 dark:[&>kbd]:bg-gray-700 dark:[&>kbd]:text-gray-300",children:[h.jsx("kbd",{children:ie}),"+",h.jsx("kbd",{children:"C"})]}),h.jsx("span",{children:"Copy selection"})]}),h.jsxs("div",{className:"flex items-center justify-between py-1.5 text-[13px] text-gray-700 dark:text-gray-300",children:[h.jsxs("span",{className:"flex items-center gap-1 font-mono [&>kbd]:inline-flex [&>kbd]:min-w-[22px] [&>kbd]:h-[22px] [&>kbd]:items-center [&>kbd]:justify-center [&>kbd]:rounded [&>kbd]:border [&>kbd]:border-gray-200 [&>kbd]:bg-gray-100 [&>kbd]:px-1.5 [&>kbd]:text-[11px] [&>kbd]:text-gray-600 dark:[&>kbd]:border-gray-600 dark:[&>kbd]:bg-gray-700 dark:[&>kbd]:text-gray-300",children:[h.jsx("kbd",{children:ie}),"+",h.jsx("kbd",{children:"F"})]}),h.jsx("span",{children:"Search"})]})]}),h.jsx("div",{className:"px-4 pb-2 pt-3 text-[11px] font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400",children:"Tips"}),h.jsxs("div",{className:"px-4 pb-3",children:[h.jsx("div",{className:"py-1 text-xs leading-snug text-gray-600 dark:text-gray-400",children:"Click any item to see details and copy options"}),h.jsx("div",{className:"py-1 text-xs leading-snug text-gray-600 dark:text-gray-400",children:"Use Share to copy a link to your current view"}),h.jsx("div",{className:"py-1 text-xs leading-snug text-gray-600 dark:text-gray-400",children:"Search finds both keys and values"})]})]})]}),j&&h.jsx(a.Button,{icon:"copied"===re?h.jsx(l.CheckmarkIcon,{size:16}):h.jsx(x.LinkIcon,{size:16}),onClick:fe,size:"sm",variant:"subtle",children:"copied"===re?"Copied!":"Share"}),k&&h.jsx(a.Button,{onClick:k,size:"sm",variant:"subtle",children:"Close"})]})]}),"editor"!==z&&h.jsxs("div",{className:"flex items-center overflow-x-auto border-b border-border-color bg-gray-50 px-4 py-2 text-[13px] dark:border-gray-700 dark:bg-gray-800 [&::-webkit-scrollbar]:h-1",children:[h.jsx("button",{className:"cursor-pointer whitespace-nowrap rounded border-none bg-none px-2 py-1 text-[13px] text-blue-600 hover:bg-blue-50 dark:text-blue-400 dark:hover:bg-gray-700",onClick:function(){return P([])},type:"button",children:"root"}),H.map(function(e,r){return h.jsxs("span",{children:[h.jsx("span",{className:"mx-0.5 text-gray-400 dark:text-gray-600",children:"/"}),h.jsx("button",{className:"cursor-pointer whitespace-nowrap rounded border-none bg-none px-2 py-1 text-[13px] text-blue-600 hover:bg-blue-50 dark:text-blue-400 dark:hover:bg-gray-700",onClick:function(){return P(H.slice(0,r+1))},type:"button",children:e})]},"breadcrumb-".concat(r,"-").concat(e))})]}),h.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:["column"===z&&h.jsxs("div",{className:"flex h-full overflow-hidden",children:[h.jsxs("div",{className:"flex flex-1 overflow-x-auto bg-page dark:bg-gray-900 [&::-webkit-scrollbar-thumb]:rounded [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar]:h-2",children:[ke.map(function(e,r){return h.jsx(S,{columnIndex:r,data:e.data,isActiveColumn:R===r,onFocusColumn:B,onSelect:function(e){return me(r,e)},selectedKey:e.selectedKey},"column-".concat(r))}),void 0!==ve&&(null===ve||"object"!=typeof ve)&&H.length>0&&h.jsx(C,{name:null!==(i=H[H.length-1])&&void 0!==i?i:"",value:ve})]}),void 0!==ve&&h.jsx("div",{className:"w-[400px] shrink-0 grow-0 overflow-y-auto border-l border-border-color bg-surface dark:border-gray-700 dark:bg-gray-800",children:h.jsx(q,{path:H,value:ve})})]}),"tree"===z&&ge&&h.jsxs("div",{className:"flex h-full flex-1 overflow-hidden",children:[h.jsx("div",{ref:ue,className:"flex-1 overflow-auto py-2 font-mono text-[13px] leading-normal",children:Object.entries(ge).map(function(r){var t=e.__read(r,2),a=t[0],n=t[1];return h.jsx(A,{depth:0,expandedPaths:X,nodeKey:a,onCopy:Ne,onSelect:we,onToggle:je,path:"root::".concat(a),selectedPath:H,value:n},a)})}),void 0!==ve&&H.length>0&&h.jsx("div",{className:"w-[400px] shrink-0 grow-0 overflow-y-auto border-l border-border-color bg-surface dark:border-gray-700 dark:bg-gray-800",children:h.jsx(q,{path:H,value:ve})})]}),"editor"===z&&ge&&h.jsx(I,{data:ge,onCopy:_e})]})]}):h.jsx("div",{className:"flex h-full flex-col overflow-hidden rounded-lg bg-surface dark:bg-gray-900",children:h.jsx("div",{className:"flex h-full items-center justify-center p-10",children:h.jsx(s.Text,{color:"gray600",children:"No data available"})})})};
|
|
1
|
+
"use strict";var e=require("../../tslib.es6-cdc5f922.js"),r=require("react"),t=require("clsx"),n=require("../button/Button.js"),a=require("../flex/Flex.js"),o=require("../input/Input.js"),s=require("../text/Text.js"),l=require("../../icons/CheckmarkIcon.js"),i=require("../../icons/ChevronDownIcon.js"),c=require("../../icons/ChevronRightIcon.js"),d=require("../../icons/CopyIcon.js"),u=require("../../icons/HelpIcon.js"),x=require("../../icons/LinkIcon.js"),b=require("../../icons/SearchIcon.js"),g=require("../../utils/jsonParse.js"),h=require("react/jsx-runtime");function p(e){return e&&e.__esModule?e:{default:e}}require("../../_rollupPluginBabelHelpers-4522587c.js"),require("class-variance-authority"),require("../button/RippleGroup.js"),require("framer-motion"),require("uuid"),require("../button/_Ripple.js"),require("../../utils/getAminoColor.js"),require("../../styles/constants/theme.js"),require("../button/useRipple.js"),require("../spinner/Spinner.js"),require("../../utils/cn.js"),require("tailwind-merge"),require("../../utils/getTestId.js"),require("../help-text/HelpText.js"),require("../input/input-type/_DateInput.js"),require("@floating-ui/react"),require("../input/input-type/_FloatLabelInput.js"),require("../../icons/CalendarIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../input/input-type/_NumberInput.js"),require("../../icons/CaretDownIcon.js"),require("../../icons/CaretUpIcon.js"),require("../input/input-type/_PasswordInput.js"),require("../../icons/EyeIcon.js"),require("../../icons/EyeOffIcon.js"),require("../input/input-type/_TimeInput.js"),require("../../icons/ClockIcon.js");var f=p(t),y=function(e){return null===e?"null":Array.isArray(e)?"array":typeof e},v=function(r,t){var n,a,o=r;try{for(var s=e.__values(t),l=s.next();!l.done;l=s.next()){var i=l.value;if(null===o||"object"!=typeof o)return;if(Array.isArray(o)){var c=parseInt(i,10);if(Number.isNaN(c)||c<0||c>=o.length)return;o=o[c]}else{if(!(i in o))return;o=o[i]}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(a=s.return)&&a.call(s)}finally{if(n)throw n.error}}return o},k=function(e){switch(e){case"object":return"{}";case"array":return"[]";case"string":return'""';case"number":return"#";case"boolean":return"◯";case"null":return"∅";default:return"?"}},m=function(r,t){var n,a;if(null===r||"object"!=typeof r)return r;if(Array.isArray(r))return r.map(function(e){return m(e,t)});var o=r,s=Object.keys(o).sort(function(e,r){var n=e.localeCompare(r,void 0,{sensitivity:"base"});return"asc"===t?n:-n}),l={};try{for(var i=e.__values(s),c=i.next();!c.done;c=i.next()){var d=c.value,u=o[d];void 0!==u&&(l[d]=m(u,t))}}catch(e){n={error:e}}finally{try{c&&!c.done&&(a=i.return)&&a.call(i)}finally{if(n)throw n.error}}return l},j=function(e){return"undefined"!=typeof CSS&&CSS.escape?CSS.escape(e):e.replace(/["\\]/g,"\\$&")},w=function(e,r){switch(r){case"array":var t=e;return"".concat(t.length," ").concat(1===t.length?"item":"items");case"object":var n=e,a=Object.keys(n);return"".concat(a.length," ").concat(1===a.length?"field":"fields");case"string":case"number":return String(e);case"boolean":return e?"true":"false";case"null":return"null";default:return""}},N=function(e,r){if("string"===r){var t=String(e);return t.length>30?t:void 0}},_=function(r,t,n,a,o){var s;if(void 0===n&&(n=[]),void 0===a&&(a=[]),void 0===o&&(o=50),a.length>=o)return a;var l=t.toLowerCase();if(null===r||"object"!=typeof r){var i=String(r);return i.toLowerCase().includes(l)&&a.push({key:null!==(s=n[n.length-1])&&void 0!==s?s:"root",matchType:"value",path:n,preview:i.length>50?"".concat(i.slice(0,50),"..."):i}),a}return Array.isArray(r)?r.forEach(function(r,s){a.length<o&&_(r,t,e.__spreadArray(e.__spreadArray([],e.__read(n),!1),[String(s)],!1),a,o)}):Object.entries(r).forEach(function(r){var s=e.__read(r,2),i=s[0],c=s[1];if(!(a.length>=o)){if(i.toLowerCase().includes(l)){var d=y(c);a.push({key:i,matchType:"key",path:e.__spreadArray(e.__spreadArray([],e.__read(n),!1),[i],!1),preview:w(c,d)})}_(c,t,e.__spreadArray(e.__spreadArray([],e.__read(n),!1),[i],!1),a,o)}}),a},C=function(e){var r=e.name,t=e.value,n=y(t),a="boolean"===n?t?"true":"false":String(t);return h.jsx("div",{className:"border-border-color bg-surface max-w-[320px] min-w-[260px] shrink-0 overflow-y-auto border-r dark:border-gray-300",children:h.jsxs("div",{className:"flex items-center gap-2 bg-blue-600 px-3 py-2.5",children:[h.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center rounded bg-blue-500 text-[10px] font-semibold text-white",children:k(n)}),h.jsx("span",{className:"text-[13px] font-medium whitespace-nowrap text-white",children:r}),h.jsx("span",{className:f.default("ml-auto max-w-[180px] overflow-hidden font-mono text-[13px]\n text-ellipsis whitespace-nowrap",function(){switch(n){case"string":return"text-orange-200";case"number":return"text-blue-200";case"boolean":return"text-purple-200";case"null":return"text-blue-200 italic";default:return""}}()),children:a})]})})},S=function(t){var n=t.columnIndex,a=t.data,o=t.isActiveColumn,s=t.onFocusColumn,l=t.onSelect,i=t.selectedKey,d=r.useRef(null),u=r.useMemo(function(){return null===a||"object"!=typeof a?[]:Array.isArray(a)?a.map(function(e,r){return{key:r.toString(),type:y(e),value:e}}):Object.entries(a).map(function(r){var t=e.__read(r,2),n=t[0],a=t[1];return{key:n,type:y(a),value:a}})},[a]);return r.useEffect(function(){if(o&&i&&d.current){var e=j(i),r=d.current.querySelector('[data-key="'.concat(e,'"]'));r&&(r.focus(),r.scrollIntoView({behavior:"smooth",block:"nearest"}))}},[o,i]),r.useEffect(function(){if(i&&d.current){var e=j(i),r=d.current.querySelector('[data-key="'.concat(e,'"]'));r&&r.scrollIntoView({behavior:"smooth",block:"nearest"})}},[i]),0===u.length?h.jsx("div",{className:"border-border-color bg-surface w-[280px] max-w-[280px] min-w-[280px] shrink-0 grow-0 overflow-y-auto border-r dark:border-gray-300 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded [&::-webkit-scrollbar-thumb]:bg-gray-300",children:h.jsx("div",{className:"p-6 text-center text-gray-500 italic",children:"Empty"})}):h.jsx("div",{ref:d,className:"border-border-color bg-surface w-[280px] max-w-[280px] min-w-[280px] shrink-0 grow-0 overflow-y-auto border-r dark:border-gray-300 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded [&::-webkit-scrollbar-thumb]:bg-gray-300",children:u.map(function(e){var r="object"===e.type||"array"===e.type,t=i===e.key;return h.jsxs("button",{className:f.default("flex w-full cursor-pointer items-center gap-2 border-none\n bg-transparent px-3 py-2.5 text-left transition-colors\n duration-100 hover:bg-gray-50 dark:hover:bg-gray-300",t&&"bg-blue-600 hover:bg-blue-600 dark:bg-blue-600\n dark:hover:bg-blue-600"),"data-key":e.key,onClick:function(){s(n),l(e.key)},onFocus:function(){return s(n)},type:"button",children:[h.jsx("span",{className:f.default("flex size-5 shrink-0 items-center justify-center rounded\n bg-gray-100 text-[10px] font-semibold text-gray-500\n dark:bg-gray-300 dark:text-gray-600",t&&"bg-blue-500 text-white dark:bg-blue-500 dark:text-white"),children:k(e.type)}),h.jsx("span",{className:f.default("flex-1 overflow-hidden text-[13px] font-medium text-ellipsis\n whitespace-nowrap text-gray-800 dark:text-gray-800",t&&"text-white dark:text-white"),title:e.key,children:e.key}),h.jsx("span",{className:f.default("max-w-[100px] shrink-0 overflow-hidden text-xs text-ellipsis\n whitespace-nowrap text-gray-500 dark:text-gray-500",t&&"text-blue-200 dark:text-blue-200"),title:N(e.value,e.type),children:w(e.value,e.type)}),r&&h.jsx(c.ChevronRightIcon,{className:f.default("shrink-0 text-gray-400",t&&"text-blue-200 dark:text-blue-200"),size:14})]},e.key)})})},A=function(t){var n=t.depth,a=t.expandedPaths,o=t.nodeKey,s=t.onCopy,l=t.onSelect,u=t.onToggle,x=t.path,b=t.selectedPath,g=t.value,p=y(g),v="object"===p||"array"===p,m=a.has(x),j=e.__read(r.useState(!1),2),_=j[0],C=j[1],S=x.split("::").slice(1),I=null!==b&&S.length===b.length&&S.every(function(e,r){return e===b[r]}),z=r.useMemo(function(){return v&&m?Array.isArray(g)?g.map(function(e,r){return{key:r.toString(),value:e}}):Object.entries(g).map(function(r){var t=e.__read(r,2);return{key:t[0],value:t[1]}}):[]},[g,v,m]);return h.jsxs("div",{className:"block",children:[h.jsxs("div",{className:f.default("relative mx-2 flex cursor-pointer items-center gap-1 rounded px-2\n py-1 hover:bg-gray-50 dark:hover:bg-gray-200",I&&"bg-blue-50 hover:bg-blue-100 dark:bg-gray-300\n dark:hover:bg-gray-400"),"data-path":JSON.stringify(S),onClick:function(e){e.stopPropagation(),l(S,g),v&&u(x)},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),l(S,g),v&&u(x))},onMouseEnter:function(){return C(!0)},onMouseLeave:function(){return C(!1)},role:"button",style:{paddingLeft:"".concat(20*n+8,"px")},tabIndex:0,children:[v&&h.jsx("span",{className:"flex size-[18px] items-center justify-center text-gray-500",children:m?h.jsx(i.ChevronDownIcon,{size:14}):h.jsx(c.ChevronRightIcon,{size:14})}),!v&&h.jsx("span",{className:"w-[18px]"}),h.jsx("span",{className:"mr-1 flex size-[18px] shrink-0 items-center justify-center rounded-[3px] bg-gray-100 text-[9px] font-semibold text-gray-500 dark:bg-gray-300 dark:text-gray-600",children:k(p)}),h.jsx("span",{className:"font-medium text-gray-800 dark:text-gray-800",title:o,children:o}),!v&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"mx-1 text-gray-500 dark:text-gray-600",children:":"}),function(){switch(p){case"string":return h.jsxs("span",{className:"text-orange-600 dark:text-orange-400",children:['"',String(g),'"']});case"number":return h.jsx("span",{className:"text-blue-600 dark:text-blue-400",children:String(g)});case"boolean":return h.jsx("span",{className:"text-purple-600 dark:text-purple-400",children:g?"true":"false"});case"null":return h.jsx("span",{className:"text-gray-500 italic dark:text-gray-500",children:"null"});default:return null}}()]}),v&&!m&&h.jsx("span",{className:"ml-2 text-xs text-gray-400 dark:text-gray-600",title:N(g,p),children:w(g,p)}),_&&h.jsx("button",{className:"absolute top-1/2 right-2 flex size-[22px] -translate-y-1/2 cursor-pointer items-center justify-center rounded border-none bg-gray-100 text-gray-600 hover:bg-gray-200 hover:text-gray-800 dark:bg-gray-300 dark:text-gray-600 dark:hover:bg-gray-400 dark:hover:text-gray-200",onClick:function(e){e.stopPropagation(),s(g)},type:"button",children:h.jsx(d.CopyIcon,{size:12})})]}),m&&z.length>0&&h.jsx("div",{className:"block",children:z.map(function(e){return h.jsx(A,{depth:n+1,expandedPaths:a,nodeKey:e.key,onCopy:s,onSelect:l,onToggle:u,path:"".concat(x,"::").concat(e.key),selectedPath:b,value:e.value},e.key)})})]})},I=function(t){var a=t.data,o=t.onCopy,s=r.useMemo(function(){return JSON.stringify(a,null,2)},[a]),l=r.useMemo(function(){return s.split("\n")},[s]),i=r.useRef(null),c=e.__read(r.useState(0),2),u=c[0],x=c[1],b=e.__read(r.useState(!1),2),g=b[0],p=b[1],f=e.__read(r.useState(1),2),y=f[0],v=f[1];r.useEffect(function(){var e=i.current;if(e){var r=function(){var r=e.clientHeight,t=e.scrollHeight,n=e.scrollTop,a=t-r;x(a>0?n/a:0);var o=Math.floor(n/19.5)+1;v(Math.min(o,l.length)),p(a>100)};return e.addEventListener("scroll",r),r(),function(){return e.removeEventListener("scroll",r)}}},[l.length]);var k=function(){var e;null===(e=i.current)||void 0===e||e.scrollTo({behavior:"smooth",top:0})},m=function(){i.current&&i.current.scrollTo({behavior:"smooth",top:i.current.scrollHeight})},j=function(){i.current&&i.current.scrollBy({behavior:"smooth",top:.8*-i.current.clientHeight})},w=function(){i.current&&i.current.scrollBy({behavior:"smooth",top:.8*i.current.clientHeight})};return r.useEffect(function(){var e=function(e){e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement||("PageUp"===e.key?(e.preventDefault(),j()):"PageDown"===e.key?(e.preventDefault(),w()):"Home"===e.key&&(e.metaKey||e.ctrlKey)?(e.preventDefault(),k()):"End"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),m()))};return window.addEventListener("keydown",e),function(){return window.removeEventListener("keydown",e)}},[]),h.jsxs("div",{className:"relative flex h-full flex-col",children:[h.jsxs("div",{className:"border-border-color bg-surface flex items-center gap-4 border-b px-4 py-2 dark:border-gray-300",children:[h.jsx(n.Button,{icon:h.jsx(d.CopyIcon,{size:16}),onClick:o,size:"sm",variant:"subtle",children:"Copy JSON"}),h.jsxs("span",{className:"text-xs text-gray-500",children:[l.length.toLocaleString()," lines"]})]}),h.jsxs("div",{ref:i,className:"flex flex-1 overflow-auto scroll-smooth bg-gray-900 dark:bg-[#1a1a2e] [&::-webkit-scrollbar]:size-3.5 [&::-webkit-scrollbar-thumb]:rounded-[7px] [&::-webkit-scrollbar-thumb]:border-[3px] [&::-webkit-scrollbar-thumb]:border-transparent [&::-webkit-scrollbar-thumb]:bg-white/20 [&::-webkit-scrollbar-thumb]:bg-clip-content [&::-webkit-scrollbar-thumb:hover]:bg-white/30 [&::-webkit-scrollbar-thumb:hover]:bg-clip-content [&::-webkit-scrollbar-track]:bg-black/20",children:[h.jsx("div",{className:"sticky left-0 z-1 shrink-0 bg-black/20 py-4 select-none dark:bg-black/30",children:l.map(function(e,r){return h.jsx("div",{className:"px-4 text-right font-mono text-[13px] leading-normal text-gray-600",children:r+1},r)})}),h.jsx("pre",{className:"m-0 min-w-0 flex-1 p-4 font-mono text-[13px] leading-normal text-gray-200 dark:text-gray-100",children:h.jsx("code",{className:"block whitespace-pre",children:s})})]}),g&&h.jsxs("div",{className:"absolute right-4 bottom-4 z-10 flex flex-col items-end gap-2",children:[h.jsxs("div",{className:"rounded bg-[rgba(30,30,46,0.95)] px-2 py-1 font-mono text-[11px] text-white/70 backdrop-blur",children:["Line ",y.toLocaleString()," /"," ",l.length.toLocaleString()]}),h.jsx("div",{className:"h-[60px] w-1 overflow-hidden rounded-sm bg-white/10",children:h.jsx("div",{className:"w-full rounded-sm bg-blue-500 transition-[height] duration-100",style:{height:"".concat(100*u,"%")}})}),h.jsxs("div",{className:"flex flex-col gap-1 rounded-lg border border-white/10 bg-[rgba(30,30,46,0.95)] p-1.5 backdrop-blur",children:[h.jsx("button",{className:"flex size-7 items-center justify-center rounded border-none bg-transparent text-white/60 transition-all duration-150 hover:bg-white/10 hover:text-white active:bg-white/15 disabled:cursor-not-allowed disabled:opacity-30",disabled:u<.01,onClick:k,title:"Scroll to top (Cmd/Ctrl+Home)",type:"button",children:h.jsx("svg",{fill:"currentColor",height:"14",viewBox:"0 0 24 24",width:"14",children:h.jsx("path",{d:"M12 4L4 12h5v8h6v-8h5L12 4z"})})}),h.jsx("button",{className:"flex size-7 items-center justify-center rounded border-none bg-transparent text-white/60 transition-all duration-150 hover:bg-white/10 hover:text-white active:bg-white/15 disabled:cursor-not-allowed disabled:opacity-30",disabled:u<.01,onClick:j,title:"Page up (PageUp)",type:"button",children:h.jsx("svg",{fill:"currentColor",height:"12",viewBox:"0 0 24 24",width:"12",children:h.jsx("path",{d:"M7 14l5-5 5 5H7z"})})}),h.jsx("button",{className:"flex size-7 items-center justify-center rounded border-none bg-transparent text-white/60 transition-all duration-150 hover:bg-white/10 hover:text-white active:bg-white/15 disabled:cursor-not-allowed disabled:opacity-30",disabled:u>.99,onClick:w,title:"Page down (PageDown)",type:"button",children:h.jsx("svg",{fill:"currentColor",height:"12",viewBox:"0 0 24 24",width:"12",children:h.jsx("path",{d:"M7 10l5 5 5-5H7z"})})}),h.jsx("button",{className:"flex size-7 items-center justify-center rounded border-none bg-transparent text-white/60 transition-all duration-150 hover:bg-white/10 hover:text-white active:bg-white/15 disabled:cursor-not-allowed disabled:opacity-30",disabled:u>.99,onClick:m,title:"Scroll to bottom (Cmd/Ctrl+End)",type:"button",children:h.jsx("svg",{fill:"currentColor",height:"14",viewBox:"0 0 24 24",width:"14",children:h.jsx("path",{d:"M12 20l8-8h-5V4H9v8H4l8 8z"})})})]})]})]})},z=function(r){var t=r.data,n=r.indent,a=void 0===n?0:n,o=" ".repeat(a),s=" ".repeat(a+1);if(null===t)return h.jsx("span",{className:"text-gray-500 italic dark:text-gray-500",children:"null"});if("boolean"==typeof t)return h.jsx("span",{className:"text-cyan-600 dark:text-cyan-400",children:t?"true":"false"});if("number"==typeof t)return h.jsx("span",{className:"text-purple-600 dark:text-purple-400",children:t});if("string"==typeof t)return h.jsxs("span",{className:"text-orange-600 dark:text-orange-400",children:['"',t,'"']});if(Array.isArray(t))return 0===t.length?h.jsx("span",{className:"text-gray-600 dark:text-gray-500",children:"[]"}):h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-gray-600 dark:text-gray-500",children:"["}),"\n",t.map(function(e,r){return h.jsxs("span",{children:[s,h.jsx(z,{data:e,indent:a+1}),r<t.length-1&&h.jsx("span",{className:"text-gray-500 dark:text-gray-600",children:","}),"\n"]},"array-".concat(a,"-").concat(r))}),o,h.jsx("span",{className:"text-gray-600 dark:text-gray-500",children:"]"})]});if("object"==typeof t){var l=Object.entries(t);return 0===l.length?h.jsx("span",{className:"text-gray-600 dark:text-gray-500",children:"{}"}):h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-gray-600 dark:text-gray-500",children:"{"}),"\n",l.map(function(r,t){var n=e.__read(r,2),o=n[0],i=n[1];return h.jsxs("span",{children:[s,h.jsxs("span",{className:"text-blue-600 dark:text-blue-400",children:['"',o,'"']}),h.jsx("span",{className:"text-gray-500 dark:text-gray-600",children:": "}),h.jsx(z,{data:i,indent:a+1}),t<l.length-1&&h.jsx("span",{className:"text-gray-500 dark:text-gray-600",children:","}),"\n"]},o)}),o,h.jsx("span",{className:"text-gray-600 dark:text-gray-500",children:"}"})]})}return null},q=function(t){var a=t.path,o=t.value,s=y(o),i=e.__read(r.useState(!1),2),c=i[0],u=i[1],x=e.__read(r.useState(!1),2),b=x[0],g=x[1],p="object"!==s&&"array"!==s,f=r.useRef(null),v=r.useRef(null);r.useEffect(function(){return function(){f.current&&clearTimeout(f.current),v.current&&clearTimeout(v.current)}},[]);return h.jsxs("div",{className:"p-0",children:[h.jsxs("div",{className:"mb-4 flex flex-col gap-3 border-b border-gray-100 bg-linear-to-b from-gray-50 to-transparent px-4 pt-4 pb-4 dark:border-gray-300 dark:from-gray-200",children:[h.jsxs("div",{className:"flex items-center gap-2.5",children:[h.jsx("div",{className:"font-mono text-base font-semibold break-all text-blue-600 dark:text-blue-400",children:0===a.length?h.jsx("span",{className:"font-medium text-gray-500 dark:text-gray-500",children:"root"}):a[a.length-1]}),h.jsx("span",{className:"inline-flex shrink-0 rounded bg-gray-100 px-2.5 py-[3px] text-[10px] font-bold tracking-wide text-gray-600 uppercase dark:bg-gray-300 dark:text-gray-300",children:s.toUpperCase()})]}),a.length>1&&h.jsx("div",{className:"font-mono text-[11px] break-all text-gray-500 dark:text-gray-500",children:a.join(".")}),h.jsx("div",{className:"flex flex-wrap items-center gap-2",children:p?h.jsx(n.Button,{icon:b?h.jsx(l.CheckmarkIcon,{size:14}):h.jsx(d.CopyIcon,{size:14}),onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var r,t;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),r=null===o?"null":String(o),[4,navigator.clipboard.writeText(r)];case 1:return e.sent(),g(!0),v.current&&clearTimeout(v.current),v.current=setTimeout(function(){return g(!1)},2e3),[3,3];case 2:return t=e.sent(),console.error("Failed to copy:",t),[3,3];case 3:return[2]}})})},size:"sm",variant:"standard",children:b?"Copied!":"Copy Value"}):h.jsx(n.Button,{icon:c?h.jsx(l.CheckmarkIcon,{size:14}):h.jsx(d.CopyIcon,{size:14}),onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var r,t;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),r="object"==typeof o?JSON.stringify(o,null,2):String(o),[4,navigator.clipboard.writeText(r)];case 1:return e.sent(),u(!0),f.current&&clearTimeout(f.current),f.current=setTimeout(function(){return u(!1)},2e3),[3,3];case 2:return t=e.sent(),console.error("Failed to copy:",t),[3,3];case 3:return[2]}})})},size:"sm",variant:"standard",children:c?"Copied!":"Copy JSON"})})]}),h.jsxs("div",{className:"px-4 pb-4",children:[h.jsx("span",{className:"mb-2 block text-[11px] font-semibold tracking-wide text-gray-500 uppercase",children:p?"Value":"Preview"}),h.jsx("pre",{className:"m-0 rounded-md bg-gray-50 px-3 py-2 font-mono text-[13px] leading-relaxed wrap-break-word whitespace-pre-wrap dark:bg-gray-100",children:h.jsx(z,{data:o})})]})]})};exports.JsonVisionViewer=function(t){var i,c=t.data,d=t.defaultViewMode,p=void 0===d?"tree":d,k=t.onClose,j=t.onShare,w=t.title,N=e.__read(r.useState(p),2),z=N[0],T=N[1],E=e.__read(r.useState("original"),2),L=E[0],D=E[1],M=e.__read(r.useState([]),2),H=M[0],P=M[1],O=e.__read(r.useState(0),2),R=O[0],B=O[1],K=e.__read(r.useState(""),2),F=K[0],V=K[1],U=e.__read(r.useState(!1),2),J=U[0],Z=U[1],G=e.__read(r.useState(-1),2),W=G[0],$=G[1],Q=e.__read(r.useState(new Set(["root"])),2),X=Q[0],Y=Q[1],ee=e.__read(r.useState("idle"),2),re=ee[0],te=ee[1],ne=r.useRef(null),ae=e.__read(r.useState(!1),2),oe=ae[0],se=ae[1];r.useEffect(function(){return function(){ne.current&&clearTimeout(ne.current)}},[]);var le=r.useMemo(function(){var e;if("undefined"==typeof navigator)return!1;var r=null===(e=navigator.userAgentData)||void 0===e?void 0:e.platform;return/Mac|iPod|iPhone|iPad/i.test(null!=r?r:navigator.userAgent)},[]),ie=le?"⌘":"Ctrl",ce=r.useRef(null),de=r.useRef(null),ue=r.useRef(null),xe=r.useRef(null),be=r.useRef(null);r.useEffect(function(){var e=function(e){var r;be.current&&!be.current.contains(e.target)&&Z(!1),de.current&&!(null===(r=de.current.parentElement)||void 0===r?void 0:r.contains(e.target))&&se(!1)};return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[]);var ge=r.useMemo(function(){return c&&"original"!==L?m(c,"keys-asc"===L?"asc":"desc"):c},[c,L]),he=r.useMemo(function(){return!ge||F.length<2?[]:_(ge,F)},[ge,F]);r.useEffect(function(){$(-1)},[he]);var pe=r.useCallback(function(r){var t,n;if(J&&0!==he.length)if("ArrowDown"===r.key)r.preventDefault(),$(function(e){return e<he.length-1?e+1:e});else if("ArrowUp"===r.key)r.preventDefault(),$(function(e){return e>0?e-1:e});else if("Enter"===r.key&&W>=0){r.preventDefault();var a=he[W];if(a&&(P(a.path),B(a.path.length-1),Z(!1),V(""),"tree"===z)){var o=new Set(X),s="root";try{for(var l=e.__values(a.path),i=l.next();!i.done;i=l.next()){var c=i.value;s="".concat(s,"::").concat(c),o.add(s)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}Y(o)}}else"Escape"===r.key&&(Z(!1),$(-1))},[J,he,W,z,X]),fe=r.useCallback(function(r){var t,n;if(P(r.path),B(r.path.length-1),Z(!1),V(""),"tree"===z){var a=new Set(X),o="root";try{for(var s=e.__values(r.path),l=s.next();!l.done;l=s.next()){var i=l.value;o="".concat(o,"::").concat(i),a.add(o)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}Y(a)}},[z,X]),ye=r.useCallback(function(){return e.__awaiter(void 0,void 0,void 0,function(){var r;return e.__generator(this,function(e){switch(e.label){case 0:if(!j)return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,j()];case 2:return e.sent(),te("copied"),ne.current&&clearTimeout(ne.current),ne.current=setTimeout(function(){return te("idle")},2e3),[3,4];case 3:return r=e.sent(),console.error("Failed to share:",r),[3,4];case 4:return[2]}})})},[j]),ve=r.useMemo(function(){if(ge)return 0===H.length?ge:v(ge,H)},[ge,H]),ke=r.useMemo(function(){var e,r;if(!ge)return[];var t=[];t.push({data:ge,selectedKey:null!==(e=H[0])&&void 0!==e?e:null});for(var n=ge,a=0;a<H.length;a+=1){var o=H[a];if(!o||null===n||"object"!=typeof n)break;if(Array.isArray(n)){var s=parseInt(o,10);if(!(!Number.isNaN(s)&&s>=0&&s<n.length))break;n=n[s]}else{if(!(o in n))break;n=n[o]}null!==n&&"object"==typeof n&&t.push({data:n,selectedKey:null!==(r=H[a+1])&&void 0!==r?r:null})}return t},[ge,H]),me=r.useCallback(function(e,r){P(function(t){var n=t.slice(0,e);return n.push(r),n})},[]),je=r.useCallback(function(e){Y(function(r){var t=new Set(r);return t.has(e)?t.delete(e):t.add(e),t})},[]),we=r.useCallback(function(e,r){P(e)},[]),Ne=r.useCallback(function(r){return e.__awaiter(void 0,void 0,void 0,function(){var t,n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t="object"==typeof r?JSON.stringify(r,null,2):String(r),[4,navigator.clipboard.writeText(t)];case 1:return e.sent(),[3,3];case 2:return n=e.sent(),console.error("Failed to copy:",n),[3,3];case 3:return[2]}})})},[]),_e=r.useCallback(function(){return e.__awaiter(void 0,void 0,void 0,function(){var r;return e.__generator(this,function(e){switch(e.label){case 0:if(!ge)return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,navigator.clipboard.writeText(JSON.stringify(ge,null,2))];case 2:return e.sent(),[3,4];case 3:return r=e.sent(),console.error("Failed to copy:",r),[3,4];case 4:return[2]}})})},[ge]),Ce=r.useCallback(function(){if(c){var r=new Set,t=function(n,a){r.add(a),Array.isArray(n)?n.forEach(function(e,r){"object"==typeof e&&null!==e&&t(e,"".concat(a,"::").concat(r))}):"object"==typeof n&&null!==n&&Object.entries(n).forEach(function(r){var n=e.__read(r,2),o=n[0],s=n[1];"object"==typeof s&&null!==s&&t(s,"".concat(a,"::").concat(o))})};t(c,"root"),Y(r)}},[c]),Se=r.useCallback(function(){Y(new Set(["root"]))},[]),Ae=r.useCallback(function(r){var t=ke[r];return null==(null==t?void 0:t.data)||"object"!=typeof t.data?[]:Array.isArray(t.data)?t.data.map(function(e,r){return{key:r.toString(),type:y(e),value:e}}):Object.entries(t.data).map(function(r){var t=e.__read(r,2),n=t[0],a=t[1];return{key:n,type:y(a),value:a}})},[ke]);return r.useEffect(function(){var e=function(e){var r,t,n;if(!(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement))if(!e.metaKey&&!e.ctrlKey||"f"!==e.key)if(!e.metaKey&&!e.ctrlKey||"c"!==e.key){if("tree"!==z){if("column"===z){var a=Ae(R),o=H[R],s=a.findIndex(function(e){return e.key===o});if("ArrowDown"===e.key){if(e.preventDefault(),0===a.length)return;if(-1===s){var l=a[0];return void(l&&me(R,l.key))}if(s<a.length-1){var i=a[s+1];i&&me(R,i.key)}}else if("ArrowUp"===e.key){if(e.preventDefault(),0===a.length)return;if(-1===s){var c=a[a.length-1];return void(c&&me(R,c.key))}if(s>0){var d=a[s-1];d&&me(R,d.key)}}else if("ArrowLeft"===e.key)e.preventDefault(),R>0&&(B(R-1),P(function(e){return e.slice(0,R)}));else if("ArrowRight"===e.key){e.preventDefault();var u=a[s];if(u&&("object"===u.type||"array"===u.type)&&R<ke.length-1){B(R+1);var x=Ae(R+1);x.length>0&&x[0]&&me(R+1,x[0].key)}}}}else if("ArrowDown"===e.key||"ArrowUp"===e.key||"ArrowLeft"===e.key||"ArrowRight"===e.key){e.preventDefault();var b=null===(t=ue.current)||void 0===t?void 0:t.querySelectorAll('[role="button"][data-path]');if(!b||0===b.length)return;var h=null===(n=ue.current)||void 0===n?void 0:n.querySelector('[role="button"][data-path].bg-blue-50'),p=Array.from(b),f=h?p.indexOf(h):-1,y=function(e){var r=p[e];if(r){var t=r.getAttribute("data-path");if(null!==t){var n=g.jsonParse(t);Array.isArray(n)&&we(n)}r.scrollIntoView({behavior:"smooth",block:"nearest"})}};if("ArrowDown"===e.key)y(-1===f?0:Math.min(f+1,p.length-1));else if("ArrowUp"===e.key){y(-1===f?p.length-1:Math.max(f-1,0))}else if("ArrowRight"===e.key&&h){var k=H.length>0?"root::".concat(H.join("::")):"",m=v(ge,H);k&&("object"==typeof m&&null!==m)&&!X.has(k)?je(k):f>=0&&f<p.length-1&&y(f+1)}else if("ArrowLeft"===e.key&&h){(k=H.length>0?"root::".concat(H.join("::")):"")&&X.has(k)?je(k):H.length>1&&P(function(e){return e.slice(0,-1)})}}}else{var j=window.getSelection();void 0!==ve&&H.length>0&&(!j||0===j.toString().length)&&(e.preventDefault(),Ne(ve))}else"column"!==z&&"tree"!==z||(e.preventDefault(),null===(r=xe.current)||void 0===r||r.focus())};return window.addEventListener("keydown",e),function(){return window.removeEventListener("keydown",e)}},[z,R,H,ke,Ae,me,ve,Ne,X,je,we]),c?h.jsxs("div",{ref:ce,className:"bg-surface flex h-full flex-col overflow-hidden rounded-lg",children:[h.jsxs("div",{className:"border-border-color bg-surface flex flex-wrap items-center justify-between gap-4 border-b px-4 py-3 dark:border-gray-300",children:[h.jsxs(a.Flex,{alignItems:"center",gap:16,children:[w&&h.jsx(s.Text,{fontWeight:600,children:w}),h.jsxs("div",{className:"flex items-center gap-1 rounded-lg bg-gray-100 p-1 dark:bg-gray-100",children:[h.jsxs("button",{className:f.default("flex items-center gap-1.5 rounded-md border-none px-3 py-1.5\n text-[13px] font-medium whitespace-nowrap transition-all\n duration-150 [&>svg]:shrink-0","tree"!==z&&"text-gray-600 hover:bg-gray-200 hover:text-gray-800\n dark:text-gray-600 dark:hover:bg-gray-300\n dark:hover:text-gray-200","tree"===z&&"bg-surface hover:bg-surface text-blue-600\n shadow-[0_1px_3px_rgba(0,0,0,0.1)] hover:text-blue-600\n dark:bg-gray-50 dark:text-blue-400\n dark:shadow-[0_1px_3px_rgba(0,0,0,0.3)] dark:hover:bg-gray-50\n dark:hover:text-blue-400 [&>svg]:text-blue-600\n dark:[&>svg]:text-blue-400"),onClick:function(){return T("tree")},type:"button",children:[h.jsx("svg",{fill:"currentColor",height:"14",viewBox:"0 0 24 24",width:"14",children:h.jsx("path",{d:"M3 5h18v2H3V5zm4 4h14v2H7V9zm4 4h10v2H11v-2zm4 4h6v2h-6v-2z"})}),h.jsx("span",{children:"Tree"})]}),h.jsxs("button",{className:f.default("flex items-center gap-1.5 rounded-md border-none px-3 py-1.5\n text-[13px] font-medium whitespace-nowrap transition-all\n duration-150 [&>svg]:shrink-0","column"!==z&&"text-gray-600 hover:bg-gray-200 hover:text-gray-800\n dark:text-gray-600 dark:hover:bg-gray-300\n dark:hover:text-gray-200","column"===z&&"bg-surface hover:bg-surface text-blue-600\n shadow-[0_1px_3px_rgba(0,0,0,0.1)] hover:text-blue-600\n dark:bg-gray-50 dark:text-blue-400\n dark:shadow-[0_1px_3px_rgba(0,0,0,0.3)] dark:hover:bg-gray-50\n dark:hover:text-blue-400 [&>svg]:text-blue-600\n dark:[&>svg]:text-blue-400"),onClick:function(){return T("column")},type:"button",children:[h.jsxs("svg",{fill:"currentColor",height:"14",viewBox:"0 0 24 24",width:"14",children:[h.jsx("rect",{height:"18",rx:"1",width:"6",x:"2",y:"3"}),h.jsx("rect",{height:"18",rx:"1",width:"6",x:"9",y:"3"}),h.jsx("rect",{height:"18",rx:"1",width:"6",x:"16",y:"3"})]}),h.jsx("span",{children:"Columns"})]}),h.jsxs("button",{className:f.default("flex items-center gap-1.5 rounded-md border-none px-3 py-1.5\n text-[13px] font-medium whitespace-nowrap transition-all\n duration-150 [&>svg]:shrink-0","editor"!==z&&"text-gray-600 hover:bg-gray-200 hover:text-gray-800\n dark:text-gray-600 dark:hover:bg-gray-300\n dark:hover:text-gray-200","editor"===z&&"bg-surface hover:bg-surface text-blue-600\n shadow-[0_1px_3px_rgba(0,0,0,0.1)] hover:text-blue-600\n dark:bg-gray-50 dark:text-blue-400\n dark:shadow-[0_1px_3px_rgba(0,0,0,0.3)] dark:hover:bg-gray-50\n dark:hover:text-blue-400 [&>svg]:text-blue-600\n dark:[&>svg]:text-blue-400"),onClick:function(){return T("editor")},type:"button",children:[h.jsx("svg",{fill:"currentColor",height:"14",viewBox:"0 0 24 24",width:"14",children:h.jsx("path",{d:"M8 3l-6 9 6 9h2l-6-9 6-9H8zm8 0l6 9-6 9h-2l6-9-6-9h2z"})}),h.jsx("span",{children:"Code"})]})]}),h.jsxs("div",{className:"ml-2 flex items-center gap-1 border-l border-gray-200 pl-3 dark:border-gray-300",children:[h.jsx("span",{className:"mr-1 text-xs text-gray-500 dark:text-gray-500",children:"Sort:"}),h.jsx("button",{className:f.default("rounded border-none px-2 py-1 text-xs font-medium text-gray-500\n transition-all duration-150 hover:bg-gray-100\n hover:text-gray-700 dark:text-gray-500 dark:hover:bg-gray-300\n dark:hover:text-gray-300","original"===L&&"bg-blue-100 text-blue-700 hover:bg-blue-100\n hover:text-blue-700 dark:bg-blue-900 dark:text-blue-300\n dark:hover:bg-blue-900 dark:hover:text-blue-300"),onClick:function(){return D("original")},title:"Original order from API",type:"button",children:"Original"}),h.jsx("button",{className:f.default("rounded border-none px-2 py-1 text-xs font-medium text-gray-500\n transition-all duration-150 hover:bg-gray-100\n hover:text-gray-700 dark:text-gray-500 dark:hover:bg-gray-300\n dark:hover:text-gray-300","keys-asc"===L&&"bg-blue-100 text-blue-700 hover:bg-blue-100\n hover:text-blue-700 dark:bg-blue-900 dark:text-blue-300\n dark:hover:bg-blue-900 dark:hover:text-blue-300"),onClick:function(){return D("keys-asc")},title:"Sort keys A to Z",type:"button",children:"A-Z"}),h.jsx("button",{className:f.default("rounded border-none px-2 py-1 text-xs font-medium text-gray-500\n transition-all duration-150 hover:bg-gray-100\n hover:text-gray-700 dark:text-gray-500 dark:hover:bg-gray-300\n dark:hover:text-gray-300","keys-desc"===L&&"bg-blue-100 text-blue-700 hover:bg-blue-100\n hover:text-blue-700 dark:bg-blue-900 dark:text-blue-300\n dark:hover:bg-blue-900 dark:hover:text-blue-300"),onClick:function(){return D("keys-desc")},title:"Sort keys Z to A",type:"button",children:"Z-A"})]})]}),h.jsxs(a.Flex,{alignItems:"center",gap:8,children:[("column"===z||"tree"===z)&&h.jsxs("div",{ref:be,className:"relative flex items-center",children:[h.jsx(b.SearchIcon,{className:"pointer-events-none absolute left-2.5 z-[1] text-gray-500",size:16}),h.jsx(o.Input,{className:"[&>input]:pl-8",inputRef:xe,onChange:function(e){V(e.target.value),Z(e.target.value.length>=2)},onFocus:function(){return Z(F.length>=2)},onKeyDown:pe,placeholder:"Search keys & values...",size:"sm",style:{width:358},value:F}),J&&he.length>0&&h.jsxs("div",{className:"border-border-color bg-surface absolute top-full right-0 left-0 z-100 mt-1 max-h-[300px] min-w-[280px] overflow-y-auto rounded-lg border shadow-[0_4px_12px_rgba(0,0,0,0.15)] dark:border-gray-300",children:[he.map(function(e,r){return h.jsxs("button",{className:f.default("flex w-full flex-col items-start gap-0.5 border-b\n border-gray-100 bg-transparent px-3 py-2 text-left\n transition-colors duration-100 last:border-b-0\n hover:bg-blue-50 dark:border-gray-300\n dark:hover:bg-gray-300",r===W&&"bg-blue-50 dark:bg-gray-300"),onClick:function(){return fe(e)},type:"button",children:[h.jsx("span",{className:"font-mono text-xs break-all text-blue-600 dark:text-blue-400",children:e.path.join(".")}),h.jsx("span",{className:"max-w-full overflow-hidden text-[11px] text-ellipsis whitespace-nowrap text-gray-500 dark:text-gray-500",children:"key"===e.matchType?"(key)":e.preview})]},"".concat(e.path.join("."),"-").concat(e.matchType,"-").concat(r))}),50===he.length&&h.jsx("div",{className:"border-t border-gray-100 px-3 py-2 text-center text-[11px] text-gray-500 dark:border-gray-300",children:"Showing first 50 results..."})]}),J&&F.length>=2&&0===he.length&&h.jsx("div",{className:"border-border-color bg-surface absolute top-full right-0 left-0 z-[100] mt-1 max-h-[300px] min-w-[280px] overflow-y-auto rounded-lg border shadow-[0_4px_12px_rgba(0,0,0,0.15)] dark:border-gray-300",children:h.jsx("div",{className:"px-3 py-4 text-center text-[13px] text-gray-500",children:"No matches found"})})]}),"tree"===z&&h.jsxs(a.Flex,{gap:4,children:[h.jsx(n.Button,{onClick:Ce,size:"sm",variant:"subtle",children:"Expand all"}),h.jsx(n.Button,{onClick:Se,size:"sm",variant:"subtle",children:"Collapse all"})]}),h.jsxs("div",{className:"relative",children:[h.jsx("button",{ref:de,className:"flex size-8 items-center justify-center rounded-md border-none bg-transparent text-gray-500 transition-all duration-150 hover:bg-gray-100 hover:text-gray-700 dark:text-gray-600 dark:hover:bg-gray-300 dark:hover:text-gray-200",onClick:function(){return se(!oe)},title:"Tips & shortcuts",type:"button",children:h.jsx(u.HelpIcon,{size:16})}),oe&&h.jsxs("div",{className:"bg-surface absolute top-full right-0 z-[100] mt-2 w-[260px] overflow-hidden rounded-lg border border-gray-200 shadow-[0_4px_16px_rgba(0,0,0,0.12)] dark:border-gray-300",children:[h.jsx("div",{className:"px-4 pt-3 pb-2 text-[11px] font-semibold tracking-wide text-gray-500 uppercase dark:text-gray-600",children:"Keyboard shortcuts"}),h.jsxs("div",{className:"px-4 pb-3",children:[h.jsxs("div",{className:"flex items-center justify-between py-1.5 text-[13px] text-gray-700 dark:text-gray-300",children:[h.jsxs("span",{className:"flex items-center gap-1 font-mono [&>kbd]:inline-flex [&>kbd]:h-[22px] [&>kbd]:min-w-[22px] [&>kbd]:items-center [&>kbd]:justify-center [&>kbd]:rounded [&>kbd]:border [&>kbd]:border-gray-200 [&>kbd]:bg-gray-100 [&>kbd]:px-1.5 [&>kbd]:text-[11px] [&>kbd]:text-gray-600 dark:[&>kbd]:border-gray-600 dark:[&>kbd]:bg-gray-700 dark:[&>kbd]:text-gray-300",children:[h.jsx("kbd",{children:"↑"})," ",h.jsx("kbd",{children:"↓"})]}),h.jsx("span",{children:"Navigate items"})]}),h.jsxs("div",{className:"flex items-center justify-between py-1.5 text-[13px] text-gray-700 dark:text-gray-300",children:[h.jsxs("span",{className:"flex items-center gap-1 font-mono [&>kbd]:inline-flex [&>kbd]:h-[22px] [&>kbd]:min-w-[22px] [&>kbd]:items-center [&>kbd]:justify-center [&>kbd]:rounded [&>kbd]:border [&>kbd]:border-gray-200 [&>kbd]:bg-gray-100 [&>kbd]:px-1.5 [&>kbd]:text-[11px] [&>kbd]:text-gray-600 dark:[&>kbd]:border-gray-600 dark:[&>kbd]:bg-gray-700 dark:[&>kbd]:text-gray-300",children:[h.jsx("kbd",{children:"←"})," ",h.jsx("kbd",{children:"→"})]}),h.jsx("span",{children:"Collapse/expand"})]}),h.jsxs("div",{className:"flex items-center justify-between py-1.5 text-[13px] text-gray-700 dark:text-gray-300",children:[h.jsxs("span",{className:"flex items-center gap-1 font-mono [&>kbd]:inline-flex [&>kbd]:h-[22px] [&>kbd]:min-w-[22px] [&>kbd]:items-center [&>kbd]:justify-center [&>kbd]:rounded [&>kbd]:border [&>kbd]:border-gray-200 [&>kbd]:bg-gray-100 [&>kbd]:px-1.5 [&>kbd]:text-[11px] [&>kbd]:text-gray-600 dark:[&>kbd]:border-gray-600 dark:[&>kbd]:bg-gray-700 dark:[&>kbd]:text-gray-300",children:[h.jsx("kbd",{children:ie}),"+",h.jsx("kbd",{children:"C"})]}),h.jsx("span",{children:"Copy selection"})]}),h.jsxs("div",{className:"flex items-center justify-between py-1.5 text-[13px] text-gray-700 dark:text-gray-300",children:[h.jsxs("span",{className:"flex items-center gap-1 font-mono [&>kbd]:inline-flex [&>kbd]:h-[22px] [&>kbd]:min-w-[22px] [&>kbd]:items-center [&>kbd]:justify-center [&>kbd]:rounded [&>kbd]:border [&>kbd]:border-gray-200 [&>kbd]:bg-gray-100 [&>kbd]:px-1.5 [&>kbd]:text-[11px] [&>kbd]:text-gray-600 dark:[&>kbd]:border-gray-600 dark:[&>kbd]:bg-gray-700 dark:[&>kbd]:text-gray-300",children:[h.jsx("kbd",{children:ie}),"+",h.jsx("kbd",{children:"F"})]}),h.jsx("span",{children:"Search"})]})]}),h.jsx("div",{className:"px-4 pt-3 pb-2 text-[11px] font-semibold tracking-wide text-gray-500 uppercase dark:text-gray-600",children:"Tips"}),h.jsxs("div",{className:"px-4 pb-3",children:[h.jsx("div",{className:"py-1 text-xs leading-snug text-gray-600 dark:text-gray-600",children:"Click any item to see details and copy options"}),h.jsx("div",{className:"py-1 text-xs leading-snug text-gray-600 dark:text-gray-600",children:"Use Share to copy a link to your current view"}),h.jsx("div",{className:"py-1 text-xs leading-snug text-gray-600 dark:text-gray-600",children:"Search finds both keys and values"})]})]})]}),j&&h.jsx(n.Button,{icon:"copied"===re?h.jsx(l.CheckmarkIcon,{size:16}):h.jsx(x.LinkIcon,{size:16}),onClick:ye,size:"sm",variant:"subtle",children:"copied"===re?"Copied!":"Share"}),k&&h.jsx(n.Button,{onClick:k,size:"sm",variant:"subtle",children:"Close"})]})]}),"editor"!==z&&h.jsxs("div",{className:"border-border-color flex items-center overflow-x-auto border-b bg-gray-50 px-4 py-2 text-[13px] dark:border-gray-300 dark:bg-gray-100 [&::-webkit-scrollbar]:h-1",children:[h.jsx("button",{className:"cursor-pointer rounded border-none bg-none px-2 py-1 text-[13px] whitespace-nowrap text-blue-600 hover:bg-blue-50 dark:text-blue-400 dark:hover:bg-gray-300",onClick:function(){return P([])},type:"button",children:"root"}),H.map(function(e,r){return h.jsxs("span",{children:[h.jsx("span",{className:"mx-0.5 text-gray-400 dark:text-gray-600",children:"/"}),h.jsx("button",{className:"cursor-pointer rounded border-none bg-none px-2 py-1 text-[13px] whitespace-nowrap text-blue-600 hover:bg-blue-50 dark:text-blue-400 dark:hover:bg-gray-300",onClick:function(){return P(H.slice(0,r+1))},type:"button",children:e})]},"breadcrumb-".concat(r,"-").concat(e))})]}),h.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:["column"===z&&h.jsxs("div",{className:"flex h-full overflow-hidden",children:[h.jsxs("div",{className:"bg-surface flex flex-1 overflow-x-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar-thumb]:rounded [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-gray-100",children:[ke.map(function(e,r){return h.jsx(S,{columnIndex:r,data:e.data,isActiveColumn:R===r,onFocusColumn:B,onSelect:function(e){return me(r,e)},selectedKey:e.selectedKey},"column-".concat(r))}),void 0!==ve&&(null===ve||"object"!=typeof ve)&&H.length>0&&h.jsx(C,{name:null!==(i=H[H.length-1])&&void 0!==i?i:"",value:ve})]}),void 0!==ve&&h.jsx("div",{className:"border-border-color bg-surface w-[400px] shrink-0 grow-0 overflow-y-auto border-l dark:border-gray-300",children:h.jsx(q,{path:H,value:ve})})]}),"tree"===z&&ge&&h.jsxs("div",{className:"flex h-full flex-1 overflow-hidden",children:[h.jsx("div",{ref:ue,className:"flex-1 overflow-auto py-2 font-mono text-[13px] leading-normal",children:Object.entries(ge).map(function(r){var t=e.__read(r,2),n=t[0],a=t[1];return h.jsx(A,{depth:0,expandedPaths:X,nodeKey:n,onCopy:Ne,onSelect:we,onToggle:je,path:"root::".concat(n),selectedPath:H,value:a},n)})}),void 0!==ve&&H.length>0&&h.jsx("div",{className:"border-border-color bg-surface w-[400px] shrink-0 grow-0 overflow-y-auto border-l dark:border-gray-300",children:h.jsx(q,{path:H,value:ve})})]}),"editor"===z&&ge&&h.jsx(I,{data:ge,onCopy:_e})]})]}):h.jsx("div",{className:"bg-surface flex h-full flex-col overflow-hidden rounded-lg",children:h.jsx("div",{className:"flex h-full items-center justify-center p-10",children:h.jsx(s.Text,{color:"gray600",children:"No data available"})})})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../tslib.es6-cdc5f922.js"),t=require("react"),n=require("../../icons/CheckmarkIcon.js"),r=require("../../icons/ChevronRightIcon.js"),a=require("../../utils/cn.js"),s=require("react/jsx-runtime");require("../../icons/icon-base/_IconBase.js"),require("../../styles/constants/theme.js"),require("clsx"),require("tailwind-merge");exports.LanguageItem=function(i){var o=i.code,c=i.englishName,l=i.flag,u=i.index,m=i.isSelected,x=i.nativeName,h=i.onSelect,g=i.showEnglishName,d=e.__read(t.useState(!1),2),f=d[0],v=d[1];return t.useEffect(function(){var e=setTimeout(function(){return v(!0)},40*u);return function(){return clearTimeout(e)}},[u]),s.jsxs("button",{className:a.cn("
|
|
1
|
+
"use strict";var e=require("../../tslib.es6-cdc5f922.js"),t=require("react"),n=require("../../icons/CheckmarkIcon.js"),r=require("../../icons/ChevronRightIcon.js"),a=require("../../utils/cn.js"),s=require("react/jsx-runtime");require("../../icons/icon-base/_IconBase.js"),require("../../styles/constants/theme.js"),require("clsx"),require("tailwind-merge");exports.LanguageItem=function(i){var o=i.code,c=i.englishName,l=i.flag,u=i.index,m=i.isSelected,x=i.nativeName,h=i.onSelect,g=i.showEnglishName,d=e.__read(t.useState(!1),2),f=d[0],v=d[1];return t.useEffect(function(){var e=setTimeout(function(){return v(!0)},40*u);return function(){return clearTimeout(e)}},[u]),s.jsxs("button",{className:a.cn("gap-amino-12 rounded-amino-8 px-amino-12 [&:hover_.flag]:animate-wiggle\n flex translate-y-2 cursor-pointer items-center border-none\n bg-transparent py-2.5 text-left opacity-0 transition-all duration-200\n ease-in-out hover:bg-gray-100 [&:hover_.chevron]:translate-x-0.5\n [&:hover_.chevron]:opacity-100",m&&"bg-[rgba(37,99,235,0.05)]\n shadow-[inset_0_0_0_1px_rgba(37,99,235,0.2)]\n hover:bg-[rgba(37,99,235,0.08)] [&_.nativeName]:text-blue-700",f&&"translate-y-0 opacity-100"),onClick:function(){return h(o)},style:{transitionDelay:"".concat(40*u,"ms")},type:"button",children:[s.jsx("span",{"aria-label":"".concat(c," flag"),className:"flag text-[20px] leading-none transition-transform duration-200 ease-in-out",role:"img",children:l}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[s.jsx("span",{className:"nativeName text-text-color text-sm font-medium",children:x}),g&&s.jsx("span",{className:"mt-px text-xs text-gray-500",children:c})]}),m?s.jsx("div",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-blue-600 [&_svg]:text-white",children:s.jsx(n.CheckmarkIcon,{size:12})}):s.jsx(r.ChevronRightIcon,{className:"chevron shrink-0 text-gray-300 opacity-0 transition-all duration-200 ease-in-out",size:16})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../tslib.es6-cdc5f922.js"),a=require("react"),t=require("../../icons/RemoveIcon.js"),n=require("../../icons/SearchIcon.js"),r=require("../../utils/cn.js"),i=require("./AnimatedGlobe.js"),o=require("./LanguageItem.js"),s=require("react/jsx-runtime");require("../../icons/icon-base/_IconBase.js"),require("../../styles/constants/theme.js"),require("clsx"),require("tailwind-merge"),require("../../icons/CheckmarkIcon.js"),require("../../icons/ChevronRightIcon.js");var l=Array.from({length:20}).map(function(e,a){return{delay:5*Math.random(),duration:6+8*Math.random(),id:"particle-".concat(a),left:100*Math.random(),opacity:.05+.1*Math.random(),size:2+3*Math.random(),top:100*Math.random()}});exports.LanguagePicker=function(c){var d=c.className,u=c.currentLanguage,m=c.description,x=void 0===m?"Select your preferred language for the best experience. Content will be displayed in your chosen language across the platform.":m,p=c.languages,g=c.onLanguageSelect,f=c.style,h=c.title,b=void 0===h?"Choose your language":h,y=c.trigger,v=e.__read(a.useState(!1),2),j=v[0],N=v[1],w=e.__read(a.useState(u),2),k=w[0],C=w[1],_=e.__read(a.useState(""),2),q=_[0],z=_[1],S=a.useMemo(function(){return p.find(function(e){return e.code===u})},[p,u]),I=function(e){C(e)},L=function(){N(!1)},E=a.useCallback(function(e){"Escape"===e.key&&j&&N(!1)},[j]);a.useEffect(function(){if("undefined"!=typeof document)return document.addEventListener("keydown",E),function(){return document.removeEventListener("keydown",E)}},[E]),a.useEffect(function(){if("undefined"!=typeof document)return document.body.style.overflow=j?"hidden":"",function(){document.body.style.overflow=""}},[j]),a.useEffect(function(){j||(z(""),C(u))},[j,u]);var M=a.useMemo(function(){return p.filter(function(e){return!q||(e.englishName.toLowerCase().includes(q.toLowerCase())||e.nativeName.toLowerCase().includes(q.toLowerCase()))})},[q,p]);return s.jsxs(s.Fragment,{children:[y?s.jsx("div",{"aria-label":"Open language picker",className:d,onClick:function(){return N(!0)},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),N(!0))},role:"button",style:f,tabIndex:0,children:y}):s.jsxs("button",{"aria-label":"Select language",className:r.cn("flex h-8 items-center gap-[6px]
|
|
1
|
+
"use strict";var e=require("../../tslib.es6-cdc5f922.js"),a=require("react"),t=require("../../icons/RemoveIcon.js"),n=require("../../icons/SearchIcon.js"),r=require("../../utils/cn.js"),i=require("./AnimatedGlobe.js"),o=require("./LanguageItem.js"),s=require("react/jsx-runtime");require("../../icons/icon-base/_IconBase.js"),require("../../styles/constants/theme.js"),require("clsx"),require("tailwind-merge"),require("../../icons/CheckmarkIcon.js"),require("../../icons/ChevronRightIcon.js");var l=Array.from({length:20}).map(function(e,a){return{delay:5*Math.random(),duration:6+8*Math.random(),id:"particle-".concat(a),left:100*Math.random(),opacity:.05+.1*Math.random(),size:2+3*Math.random(),top:100*Math.random()}});exports.LanguagePicker=function(c){var d=c.className,u=c.currentLanguage,m=c.description,x=void 0===m?"Select your preferred language for the best experience. Content will be displayed in your chosen language across the platform.":m,p=c.languages,g=c.onLanguageSelect,f=c.style,h=c.title,b=void 0===h?"Choose your language":h,y=c.trigger,v=e.__read(a.useState(!1),2),j=v[0],N=v[1],w=e.__read(a.useState(u),2),k=w[0],C=w[1],_=e.__read(a.useState(""),2),q=_[0],z=_[1],S=a.useMemo(function(){return p.find(function(e){return e.code===u})},[p,u]),I=function(e){C(e)},L=function(){N(!1)},E=a.useCallback(function(e){"Escape"===e.key&&j&&N(!1)},[j]);a.useEffect(function(){if("undefined"!=typeof document)return document.addEventListener("keydown",E),function(){return document.removeEventListener("keydown",E)}},[E]),a.useEffect(function(){if("undefined"!=typeof document)return document.body.style.overflow=j?"hidden":"",function(){document.body.style.overflow=""}},[j]),a.useEffect(function(){j||(z(""),C(u))},[j,u]);var M=a.useMemo(function(){return p.filter(function(e){return!q||(e.englishName.toLowerCase().includes(q.toLowerCase())||e.nativeName.toLowerCase().includes(q.toLowerCase()))})},[q,p]);return s.jsxs(s.Fragment,{children:[y?s.jsx("div",{"aria-label":"Open language picker",className:d,onClick:function(){return N(!0)},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),N(!0))},role:"button",style:f,tabIndex:0,children:y}):s.jsxs("button",{"aria-label":"Select language",className:r.cn("rounded-amino-6 px-amino-12 flex h-8 items-center gap-[6px] border\n border-gray-200 bg-transparent py-[6px] text-sm font-medium\n text-gray-800 transition-all duration-150\n ease-[cubic-bezier(0.4,0,0.2,1)] hover:border-gray-300\n hover:bg-gray-100",d),onClick:function(){return N(!0)},style:f,type:"button",children:[s.jsx("span",{className:"text-base leading-none",children:(null==S?void 0:S.flag)||"🌐"}),s.jsx("span",{className:"text-sm uppercase",children:u})]}),j&&s.jsx("div",{className:"animate-fade-in fixed inset-0 z-[1000] flex items-center justify-center bg-black/50 backdrop-blur-[4px]",onClick:L,children:s.jsxs("div",{"aria-label":"Select language","aria-modal":"true",className:"rounded-amino-12 bg-surface shadow-amino-medium animate-slide-up flex max-h-[calc(100vh-64px)] w-[calc(100%-32px)] max-w-[680px] flex-col overflow-hidden",onClick:function(e){return e.stopPropagation()},role:"dialog",children:[s.jsxs("div",{className:"to-surface relative overflow-hidden bg-gradient-to-b from-gray-100",children:[s.jsx("div",{className:"pointer-events-none absolute inset-0 overflow-hidden",children:l.map(function(e){return s.jsx("div",{className:"animate-float absolute rounded-full",style:{"--particle-delay":"".concat(e.delay,"s"),"--particle-duration":"".concat(e.duration,"s"),"--particle-left":"".concat(e.left,"%"),"--particle-opacity":e.opacity,"--particle-size":"".concat(e.size,"px"),"--particle-top":"".concat(e.top,"%"),backgroundColor:"rgba(37, 99, 235, ".concat(e.opacity,")"),height:"".concat(e.size,"px"),left:"".concat(e.left,"%"),top:"".concat(e.top,"%"),width:"".concat(e.size,"px")}},e.id)})}),s.jsxs("div",{className:"gap-amino-24 pb-amino-24 max-[525px]:pt-amino-24 relative flex items-center px-8 pt-8 max-[525px]:flex-col max-[525px]:px-5 max-[525px]:pb-5 max-[525px]:text-center",children:[s.jsxs("div",{className:"relative flex-shrink-0",children:[s.jsx("div",{className:"absolute inset-0 rounded-full",style:{background:"radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, transparent 70%)",transform:"scale(1.5)"}}),s.jsx(i.AnimatedGlobe,{size:140})]}),s.jsxs("div",{className:"relative flex-1",children:[s.jsx("h2",{className:"mb-amino-8 text-text-color mt-0 text-[20px] leading-tight font-semibold tracking-[-0.01em]",children:b}),s.jsx("p",{className:"m-0 text-sm leading-[1.5] text-gray-600",children:x}),s.jsx("button",{"aria-label":"Close",className:"-right-amino-8 -top-amino-8 absolute flex h-[28px] w-[28px] items-center justify-center rounded-full border-none bg-transparent text-gray-400 transition-all duration-150 ease-[cubic-bezier(0.4,0,0.2,1)] hover:bg-black/5 hover:text-gray-600",onClick:L,type:"button",children:s.jsx(t.RemoveIcon,{size:20})})]})]}),s.jsxs("div",{className:"mb-amino-16 max-[525px]:mb-amino-12 relative mx-8 max-[525px]:mx-5",children:[s.jsx(n.SearchIcon,{className:"left-amino-12 pointer-events-none absolute top-1/2 -translate-y-1/2 text-gray-500",size:16}),s.jsx("input",{"aria-label":"Search languages",className:"rounded-amino-8 bg-surface px-amino-12 text-text-color w-full border border-gray-200 py-[10px] pl-10 text-sm transition-all duration-150 ease-[cubic-bezier(0.4,0,0.2,1)] outline-none placeholder:text-gray-400 focus:border-blue-500 focus:shadow-[0_0_0_3px_rgba(37,99,235,0.1)]",onChange:function(e){return z(e.target.value)},placeholder:"Search languages...",type:"text",value:q})]})]}),s.jsx("div",{className:"h-px",style:{background:"linear-gradient(to right, transparent, var(--amino-gray-200), transparent)"}}),s.jsx("div",{className:"py-amino-12 max-[525px]:px-amino-16 max-h-80 flex-1 overflow-y-auto px-5 max-[525px]:max-h-[280px]",children:0===M.length?s.jsxs("div",{className:"px-amino-24 py-amino-48 flex flex-col items-center justify-center text-center",children:[s.jsx("div",{className:"mb-amino-12 flex h-12 w-12 items-center justify-center rounded-full bg-gray-100 text-gray-500",children:s.jsx(n.SearchIcon,{size:20})}),s.jsx("p",{className:"text-text-color m-0 text-sm font-medium",children:"No languages found"}),s.jsx("p",{className:"mt-amino-4 mb-0 text-[13px] text-gray-500",children:"Try a different search term"})]}):s.jsx("div",{className:"gap-amino-4 grid grid-cols-2 max-[525px]:grid-cols-1",children:M.map(function(e,a){return s.jsx(o.LanguageItem,{code:e.code,englishName:e.englishName,flag:e.flag,index:a,isSelected:k===e.code,nativeName:e.nativeName,onSelect:I,showEnglishName:e.code!==u},e.code)})})}),s.jsxs("div",{className:"py-amino-16 max-[525px]:gap-amino-12 flex items-center justify-between border-t border-gray-200 bg-gray-50 px-8 max-[525px]:flex-col max-[525px]:px-5",children:[s.jsxs("div",{className:"gap-amino-8 flex items-center text-xs text-gray-600",children:[s.jsx("div",{className:"h-amino-8 w-amino-8 animate-amino-pulse rounded-full bg-blue-500"}),s.jsxs("span",{children:[p.length," languages available"]})]}),s.jsx("button",{className:"rounded-amino-8 border-none bg-blue-600 px-5 py-[10px] text-sm font-medium text-white shadow-[0_1px_2px_rgba(0,0,0,0.1)] transition-all duration-150 ease-[cubic-bezier(0.4,0,0.2,1)] hover:bg-blue-700 hover:shadow-[0_2px_4px_rgba(0,0,0,0.15)] active:scale-[0.98] max-[525px]:w-full",onClick:function(){k!==u?(g(k),N(!1)):N(!1)},type:"button",children:"Confirm selection"})]})]})})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../tslib.es6-cdc5f922.js"),r=require("../../styles/constants/theme.js"),a=require("../../utils/cn.js"),s=require("react/jsx-runtime");require("clsx"),require("tailwind-merge");exports.Layout=function(i){var o=i.className,n=i.content,
|
|
1
|
+
"use strict";var e=require("../../tslib.es6-cdc5f922.js"),r=require("../../styles/constants/theme.js"),a=require("../../utils/cn.js"),s=require("react/jsx-runtime");require("clsx"),require("tailwind-merge");exports.Layout=function(i){var o=i.className,n=i.content,t=i.footer,d=i.headerContent,l=i.logoSidebar,c=i.noPaddingContent,h=i.sidebar,m=i.style;return s.jsxs("main",{className:a.cn("h-screen overflow-hidden",o),style:e.__assign(e.__assign({},m),{"--amino-layout-height":d?"calc(100vh - ".concat(r.theme.appbarHeight,")"):"100vh"}),children:[!!d&&s.jsx("header",{className:"border-amino shadow-amino-base sticky top-0 z-(--amino-appbar-elevation) box-border flex h-(--amino-appbar-height) border-b",children:d}),s.jsxs("div",{className:"grid h-(--amino-layout-height)",style:{gridTemplateColumns:"var(--amino-sidebar-width) 1fr"},children:[s.jsxs("nav",{className:"border-amino-subtle bg-sidebar box-border grid h-screen w-(--amino-sidebar-width) grid-rows-[1fr_auto] border-r",children:[s.jsxs("div",{className:"p-amino-16 box-border h-full w-full overflow-y-auto",children:[!!l&&s.jsx("div",{className:"mb-amino-24",children:l}),h]}),s.jsx("div",{className:"box-border w-(--amino-sidebar-width)",children:t})]}),s.jsx("div",{className:a.cn("box-border h-full overflow-y-auto",c?"p-0":"p-amino-32"),children:n})]})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../collapse/Collapse.js"),r=require("../../utils/cn.js"),a=require("react/jsx-runtime");require("../../_rollupPluginBabelHelpers-4522587c.js"),require("../../tslib.es6-cdc5f922.js"),require("clsx"),require("tailwind-merge");exports.NavigationGroup=function(
|
|
1
|
+
"use strict";var e=require("../collapse/Collapse.js"),r=require("../../utils/cn.js"),a=require("react/jsx-runtime");require("../../_rollupPluginBabelHelpers-4522587c.js"),require("../../tslib.es6-cdc5f922.js"),require("clsx"),require("tailwind-merge");exports.NavigationGroup=function(i){var s=i.children,t=i.className,n=i.collapsed,l=void 0!==n&&n,o=i.content,c=i.style;return a.jsxs("div",{className:r.cn("flex flex-col",t),style:c,children:[a.jsx("div",{className:r.cn(!l&&"[&_.navigation-item_*]:text-gray-1000\n [&_.navigation-item_svg]:text-gray-1000\n [&_.navigation-item]:hover:bg-transparent"),children:a.jsx("div",{className:"navigation-item",children:o})}),a.jsx(e.Collapse,{className:"pl-amino-12 border-border-color ml-[15px] border-l",collapsed:l,children:s})]})},exports.NavigationItem=function(e){var i=e.className,s=e.content,t=e.icon,n=e.isActive,l=void 0!==n&&n,o=e.style;return a.jsxs("div",{className:r.cn("gap-amino-8 px-amino-8 py-amino-4 text-amino-base rounded-amino-6\n mb-[2px] flex h-[28px] items-center font-medium text-gray-800","hover:bg-hover hover:text-gray-1000","[&_svg]:h-amino-24 [&_svg]:w-amino-24 [&_svg]:ml-amino-n4\n [&_svg]:text-gray-600","hover:[&_svg]:text-gray-800",l&&"text-gray-1000 [&_svg]:text-gray-1000 bg-gray-100",i),style:o,children:[t&&a.jsx("div",{className:"shrink-0 grow-0",children:t}),s]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../tslib.es6-cdc5f922.js"),r=require("react"),i=require("../collapse/Collapse.js"),s=require("./List.js"),t=require("../list-item/ListItem.js"),l=require("../../icons/ChevronUpIcon.js"),a=require("../../utils/cn.js"),n=require("react/jsx-runtime");require("../../_rollupPluginBabelHelpers-4522587c.js"),require("clsx"),require("tailwind-merge"),require("../text/Text.js"),require("../../styles/constants/theme.js"),require("../../icons/icon-base/_IconBase.js");exports.CollapsibleList=function(o){var c=o.children,u=o.className,j=o.icon,p=o.startExpanded,q=o.style,m=o.title,d=o.withBorder,h=o.withNegativeMargin,x=e.__read(r.useState(!p),2),w=x[0],g=x[1];return n.jsxs(s.List,{className:u,style:q,withBorder:d,withNegativeMargin:h,children:[n.jsx(t.ListItem,{decorator:j,label:m,onClick:function(){return g(!w)},rightDecorator:n.jsx(l.ChevronUpIcon,{className:a.cn("transition-all",w&&"opacity-100
|
|
1
|
+
"use strict";var e=require("../../tslib.es6-cdc5f922.js"),r=require("react"),i=require("../collapse/Collapse.js"),s=require("./List.js"),t=require("../list-item/ListItem.js"),l=require("../../icons/ChevronUpIcon.js"),a=require("../../utils/cn.js"),n=require("react/jsx-runtime");require("../../_rollupPluginBabelHelpers-4522587c.js"),require("clsx"),require("tailwind-merge"),require("../text/Text.js"),require("../../styles/constants/theme.js"),require("../../icons/icon-base/_IconBase.js");exports.CollapsibleList=function(o){var c=o.children,u=o.className,j=o.icon,p=o.startExpanded,q=o.style,m=o.title,d=o.withBorder,h=o.withNegativeMargin,x=e.__read(r.useState(!p),2),w=x[0],g=x[1];return n.jsxs(s.List,{className:u,style:q,withBorder:d,withNegativeMargin:h,children:[n.jsx(t.ListItem,{decorator:j,label:m,onClick:function(){return g(!w)},rightDecorator:n.jsx(l.ChevronUpIcon,{className:a.cn("transition-all",w&&"rotate-180 opacity-100")})}),n.jsx(i.Collapse,{className:"[&_.list-item-icon-wrap]:w-amino-32 [&_.list-item-icon-wrap]:inline-block",collapsed:w,children:c})]})};
|
package/components/list/List.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var r=require("../../utils/cn.js"),e=require("react/jsx-runtime");require("clsx"),require("tailwind-merge");exports.List=function(i){var a=i.children,n=i.className,s=i.style,t=i.withBorder,c=i.withNegativeMargin;return e.jsx("section",{className:r.cn("flex flex-col gap-0.5",t&&"p-amino-8 border border-gray-200 dark:border-gray-800
|
|
1
|
+
"use strict";var r=require("../../utils/cn.js"),e=require("react/jsx-runtime");require("clsx"),require("tailwind-merge");exports.List=function(i){var a=i.children,n=i.className,s=i.style,t=i.withBorder,c=i.withNegativeMargin;return e.jsx("section",{className:r.cn("flex flex-col gap-0.5",t&&"p-amino-8 rounded-amino-12 border border-gray-200 dark:border-gray-800",c&&"m-amino-n24",n),style:s,children:a})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../text/Text.js"),r=require("../../utils/cn.js"),t=require("react/jsx-runtime");require("../../_rollupPluginBabelHelpers-4522587c.js"),require("../../tslib.es6-cdc5f922.js"),require("../../styles/constants/theme.js"),require("clsx"),require("tailwind-merge");var l=function(e){var r=e.icon,l=e.iconComponent,n=e.label;return r?t.jsx("img",{alt:n,className:"mr-4
|
|
1
|
+
"use strict";var e=require("../text/Text.js"),r=require("../../utils/cn.js"),t=require("react/jsx-runtime");require("../../_rollupPluginBabelHelpers-4522587c.js"),require("../../tslib.es6-cdc5f922.js"),require("../../styles/constants/theme.js"),require("clsx"),require("tailwind-merge");var l=function(e){var r=e.icon,l=e.iconComponent,n=e.label;return r?t.jsx("img",{alt:n,className:"mr-4 h-8 w-8 rounded-md",src:r}):l?t.jsx(t.Fragment,{children:l}):null};exports.ListItem=function(n){var i=n.className,s=n.decorator,o=n.disabled,c=n.label,a=n.onClick,u=n.rightDecorator,d=n.selected,x=n.style,m=n.subtitle;return t.jsxs("button",{className:r.cn("flex min-h-(--amino-size-xl) flex-row items-center gap-4 rounded-lg p-2\n px-4 leading-4",!o&&d&&"bg-blue-50 **:text-blue-800","focus:outline-none active:outline-none",!d&&"active:bg-hover focus:bg-hover hover:bg-hover hover:outline-none",o&&"cursor-not-allowed text-gray-600",!o&&!d&&a&&"cursor-pointer",i),onClick:function(e){return!o&&(null==a?void 0:a(e))},style:x,type:"button",children:[t.jsxs("div",{className:r.cn("list-item-icon-wrap",!s&&"hidden",s&&"inline-block"),children:[s,t.jsx(l,{label:"string"==typeof c?c:""})]}),t.jsxs("div",{className:"flex grow flex-col items-start gap-0.5",children:[t.jsx(e.Text,{type:"label",children:c}),m&&t.jsx(e.Text,{type:"caption",children:m})]}),u]})};
|
package/components/menu/Menu.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var r=require("../../utils/cn.js"),e=require("react/jsx-runtime");require("clsx"),require("tailwind-merge");exports.Menu=function(i){var
|
|
1
|
+
"use strict";var r=require("../../utils/cn.js"),e=require("react/jsx-runtime");require("clsx"),require("tailwind-merge");exports.Menu=function(i){var n=i.children,s=i.className,t=i.style;return e.jsx("ul",{className:r.cn("[&_hr]:border-b-amino-subtle [&_hr]:mt-amino-6 [&_hr]:mb-amino-6 m-0\n list-none p-0 [&_hr]:border-0 [&_hr]:border-b",s),style:t,children:n})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../utils/cn.js"),n=require("react/jsx-runtime");require("clsx"),require("tailwind-merge");exports.MenuItem=function(r){var t=r.children,i=r.className,o=r.disabled,l=r.icon,u=r.onClick,a=r.style;return n.jsx("li",{className:e.cn(o&&"[&_.menu-button]:
|
|
1
|
+
"use strict";var e=require("../../utils/cn.js"),n=require("react/jsx-runtime");require("clsx"),require("tailwind-merge");exports.MenuItem=function(r){var t=r.children,i=r.className,o=r.disabled,l=r.icon,u=r.onClick,a=r.style;return n.jsx("li",{className:e.cn(o&&"[&_.menu-button]:opacity-amino-disabled\n [&_.menu-button]:cursor-not-allowed",i),style:a,children:n.jsxs("button",{className:"menu-button p-amino-8 rounded-amino-6 text-amino-base hover:bg-hover [&_svg]:mr-amino-8 flex w-full cursor-pointer items-center leading-6 select-none active:outline-none dark:hover:bg-gray-100 [&_a]:block [&_a]:w-full",onClick:function(e){return!o&&(null==u?void 0:u(e))},type:"button",children:[l,t]})})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react"),r=require("../__amino__/TranslateAminoText.js"),t=require("../button/Button.js"),s=require("./_TableData.js"),i=require("../rest-state/RestState.js"),n=require("../text/Text.js"),a=require("../../utils/cn.js"),u=require("../../utils/translations/__amino__/translateAminoText.js"),l=require("../../utils/translations/AminoTranslationStore.js"),o=require("react/jsx-runtime");require("../../_rollupPluginBabelHelpers-4522587c.js"),require("../translations/Translate.js"),require("../../utils/translations/_handleTranslateComponentText.js"),require("../../tslib.es6-cdc5f922.js"),require("zod"),require("zustand"),require("../../utils/storage.js"),require("dayjs"),require("../../utils/translations/supportedLanguages.js"),require("class-variance-authority"),require("../button/RippleGroup.js"),require("framer-motion"),require("uuid"),require("../button/_Ripple.js"),require("../../utils/getAminoColor.js"),require("../../styles/constants/theme.js"),require("../button/useRipple.js"),require("../spinner/Spinner.js"),require("clsx"),require("tailwind-merge"),require("../../utils/getTestId.js"),require("./_Filter.js"),require("../select/MultiSelect.js"),require("../checkbox/Checkbox.js"),require("../help-text/HelpText.js"),require("../../icons/CheckmarkIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../select/_StyledReactSelect.js"),require("react-intersection-observer"),require("react-select"),require("../../icons/DoubleChevronIcon.js"),require("../../icons/RemoveCircleIcon.js"),require("../../icons/RemoveIcon.js"),require("../../icons/FilterIcon.js"),require("../../utils/hooks/useDropdown.js"),require("@floating-ui/react"),require("../../utils/translations/translate.js"),require("../../utils/translations/_handleTranslationVariables.js"),require("../pivot-table/PivotTable.js"),require("react-data-grid"),require("../../icons/ChevronDownIcon.js"),require("../../icons/ChevronUpIcon.js"),require("../../utils/addIndex.js"),require("../tooltip/Tooltip.js"),require("../flex/Flex.js"),require("../ui/tooltip.js"),require("@radix-ui/react-tooltip"),require("../../icons/ChevronRightCircleIcon.js"),require("../../utils/flattenRow.js"),require("../../utils/setupNestedData.js"),require("../../utils/truncateText.js");exports.NestedDataTable=function(c){var j=c.currentPage,q=c.customColumnCells,x=c.customFlattenRow,d=c.handlePagination,m=c.hasNextPage,p=c.hasPreviousPage,g=c.isFetching,h=c.loadingComponent,b=c.restState,T=c.style,C=c.tableData,v=c.title,_=l.useCurrentLanguage(),f=e.useMemo(function(){return Array.isArray(C)?C:[C]},[C]),R=!!d&&!!j&&C.length;return o.jsxs("div",{className:a.cn("h-full"),style:T,children:[o.jsxs("div",{className:a.cn("flex items-center
|
|
1
|
+
"use strict";var e=require("react"),r=require("../__amino__/TranslateAminoText.js"),t=require("../button/Button.js"),s=require("./_TableData.js"),i=require("../rest-state/RestState.js"),n=require("../text/Text.js"),a=require("../../utils/cn.js"),u=require("../../utils/translations/__amino__/translateAminoText.js"),l=require("../../utils/translations/AminoTranslationStore.js"),o=require("react/jsx-runtime");require("../../_rollupPluginBabelHelpers-4522587c.js"),require("../translations/Translate.js"),require("../../utils/translations/_handleTranslateComponentText.js"),require("../../tslib.es6-cdc5f922.js"),require("zod"),require("zustand"),require("../../utils/storage.js"),require("dayjs"),require("../../utils/translations/supportedLanguages.js"),require("class-variance-authority"),require("../button/RippleGroup.js"),require("framer-motion"),require("uuid"),require("../button/_Ripple.js"),require("../../utils/getAminoColor.js"),require("../../styles/constants/theme.js"),require("../button/useRipple.js"),require("../spinner/Spinner.js"),require("clsx"),require("tailwind-merge"),require("../../utils/getTestId.js"),require("./_Filter.js"),require("../select/MultiSelect.js"),require("../checkbox/Checkbox.js"),require("../help-text/HelpText.js"),require("../../icons/CheckmarkIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../select/_StyledReactSelect.js"),require("react-intersection-observer"),require("react-select"),require("../../icons/DoubleChevronIcon.js"),require("../../icons/RemoveCircleIcon.js"),require("../../icons/RemoveIcon.js"),require("../../icons/FilterIcon.js"),require("../../utils/hooks/useDropdown.js"),require("@floating-ui/react"),require("../../utils/translations/translate.js"),require("../../utils/translations/_handleTranslationVariables.js"),require("../pivot-table/PivotTable.js"),require("react-data-grid"),require("../../icons/ChevronDownIcon.js"),require("../../icons/ChevronUpIcon.js"),require("../../utils/addIndex.js"),require("../tooltip/Tooltip.js"),require("../flex/Flex.js"),require("../ui/tooltip.js"),require("@radix-ui/react-tooltip"),require("../../icons/ChevronRightCircleIcon.js"),require("../../utils/flattenRow.js"),require("../../utils/setupNestedData.js"),require("../../utils/truncateText.js");exports.NestedDataTable=function(c){var j=c.currentPage,q=c.customColumnCells,x=c.customFlattenRow,d=c.handlePagination,m=c.hasNextPage,p=c.hasPreviousPage,g=c.isFetching,h=c.loadingComponent,b=c.restState,T=c.style,C=c.tableData,v=c.title,_=l.useCurrentLanguage(),f=e.useMemo(function(){return Array.isArray(C)?C:[C]},[C]),R=!!d&&!!j&&C.length;return o.jsxs("div",{className:a.cn("h-full"),style:T,children:[o.jsxs("div",{className:a.cn("p-amino-8 flex items-center"),children:[!!v&&o.jsx(n.Text,{type:"header",children:v}),!!R&&o.jsxs("div",{className:a.cn("gap-amino-8 flex flex-1 items-center justify-end"),children:[o.jsx(t.Button,{disabled:1===j||!p,onClick:function(){p&&d(j-1)},outline:!0,children:o.jsx(r.TranslateAminoText,{text:"Previous page"})}),j,o.jsx(t.Button,{disabled:!m,onClick:function(){m&&d(j+1)},outline:!0,children:o.jsx(r.TranslateAminoText,{text:"Next page"})})]})]}),g?h?o.jsx(o.Fragment,{children:h}):o.jsx(i.RestState,{label:u.translateAminoText({languageCode:_,text:"Loading..."})}):0===f.length?b?o.jsx(o.Fragment,{children:b}):o.jsx(i.RestState,{label:u.translateAminoText({languageCode:_,text:"No data available."})}):o.jsx(s.TableData,{customColumnCells:q,customFlattenRow:x,tableDataArr:f})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../tslib.es6-cdc5f922.js"),r=require("react"),t=require("../__amino__/TranslateAminoText.js"),i=require("../select/MultiSelect.js"),
|
|
1
|
+
"use strict";var e=require("../../tslib.es6-cdc5f922.js"),r=require("react"),t=require("../__amino__/TranslateAminoText.js"),i=require("../select/MultiSelect.js"),n=require("../../icons/FilterIcon.js"),s=require("../../utils/cn.js"),l=require("../../utils/hooks/useDropdown.js"),u=require("../../utils/translations/__amino__/translateAminoText.js"),a=require("../../utils/translations/AminoTranslationStore.js"),o=require("react/jsx-runtime");require("../../_rollupPluginBabelHelpers-4522587c.js"),require("../translations/Translate.js"),require("../../utils/translations/_handleTranslateComponentText.js"),require("zod"),require("zustand"),require("../../utils/storage.js"),require("dayjs"),require("../../utils/translations/supportedLanguages.js"),require("../checkbox/Checkbox.js"),require("framer-motion"),require("../help-text/HelpText.js"),require("../text/Text.js"),require("../../styles/constants/theme.js"),require("clsx"),require("tailwind-merge"),require("../../icons/CheckmarkIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../utils/getTestId.js"),require("../select/_StyledReactSelect.js"),require("react-intersection-observer"),require("react-select"),require("../../icons/DoubleChevronIcon.js"),require("../../icons/RemoveCircleIcon.js"),require("../../icons/RemoveIcon.js"),require("@floating-ui/react"),require("../../utils/translations/translate.js"),require("../../utils/translations/_handleTranslationVariables.js");exports.Filter=function(c){var m=c.columns,d=c.hiddenColumns,q=c.setHiddenColumns,j=l.useDropdown(),x=j.floatingStyles,_=j.refs,f=j.setVisible,v=j.visibility,b=j.visible,p=j.wrapperRef,g=a.useCurrentLanguage(),h=r.useMemo(function(){return m.map(function(e){return{label:e.key,value:e.key}})},[m]);return o.jsxs("div",{ref:p,className:s.cn("relative"),children:[o.jsxs("button",{ref:_.setReference,className:s.cn("h-amino-size-sm px-amino-12 flex items-center justify-center","border-amino rounded-amino-6 border"),onClick:function(){return f(!b)},type:"button",children:[o.jsx(n.FilterIcon,{size:16})," ",o.jsx(t.TranslateAminoText,{text:"Filter --context: button text referencing filtering data"})]}),o.jsx("div",{ref:_.setFloating,className:s.cn("p-amino-16 bg-gray-0 rounded-amino-8 flex w-[300px] border\n border-gray-200","shadow-[0_0_1px_var(--amino-gray-400)]","[&>div]:w-full","[&_.value-container]:overflow-x-auto","[&_.multi-value]:flex [&_.multi-value]:h-[22px]\n [&_.multi-value]:items-center","[&_.multi-value_[role=button]]:flex\n [&_.multi-value_[role=button]]:items-center\n [&_.multi-value_[role=button]]:justify-center"),style:e.__assign(e.__assign({},x),{opacity:"visible"===v?1:0,zIndex:"visible"===v?1:-1}),children:o.jsx(i.MultiSelect,{hideSelectedOptions:!1,label:u.translateAminoText({languageCode:g,text:"Hide column"}),onChange:function(e){q(e.flatMap(function(e){return[e.value]}))},options:h,value:h.filter(function(e){return d.includes(e.value)})})})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../tslib.es6-cdc5f922.js"),r=require("react"),t=require("../button/Button.js"),n=require("./_Filter.js"),i=require("../pivot-table/PivotTable.js"),s=require("../tooltip/Tooltip.js"),a=require("../../icons/ChevronRightCircleIcon.js"),u=require("../../utils/cn.js"),o=require("../../utils/flattenRow.js"),l=require("../../utils/setupNestedData.js"),c=require("../../utils/truncateText.js"),d=require("react/jsx-runtime");require("../../_rollupPluginBabelHelpers-4522587c.js"),require("class-variance-authority"),require("../button/RippleGroup.js"),require("framer-motion"),require("uuid"),require("../button/_Ripple.js"),require("../../utils/getAminoColor.js"),require("../../styles/constants/theme.js"),require("../button/useRipple.js"),require("../spinner/Spinner.js"),require("clsx"),require("tailwind-merge"),require("../../utils/getTestId.js"),require("../__amino__/TranslateAminoText.js"),require("../translations/Translate.js"),require("../../utils/translations/_handleTranslateComponentText.js"),require("../../utils/translations/AminoTranslationStore.js"),require("zod"),require("zustand"),require("../../utils/storage.js"),require("dayjs"),require("../../utils/translations/supportedLanguages.js"),require("../select/MultiSelect.js"),require("../checkbox/Checkbox.js"),require("../help-text/HelpText.js"),require("../text/Text.js"),require("../../icons/CheckmarkIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../select/_StyledReactSelect.js"),require("react-intersection-observer"),require("react-select"),require("../../icons/DoubleChevronIcon.js"),require("../../icons/RemoveCircleIcon.js"),require("../../icons/RemoveIcon.js"),require("../../icons/FilterIcon.js"),require("../../utils/hooks/useDropdown.js"),require("@floating-ui/react"),require("../../utils/translations/__amino__/translateAminoText.js"),require("../../utils/translations/translate.js"),require("../../utils/translations/_handleTranslationVariables.js"),require("react-data-grid"),require("../../icons/ChevronDownIcon.js"),require("../../icons/ChevronUpIcon.js"),require("../../utils/addIndex.js"),require("../flex/Flex.js"),require("../ui/tooltip.js"),require("@radix-ui/react-tooltip");var p=function(j){var q=j.customColumnCells,_=j.customFlattenRow,x=j.noFilter,m=j.tableDataArr,v=_||o.flattenRow,f=e.__read(r.useState([]),2),h=f[0],g=f[1],b=r.useCallback(function(){return m.map(function(e){var r=Object.entries(e).reduce(function(e,r){return v({currentVal:r,prev:e})},{});return l.setupNestedData(r)})},[v,m]),y=e.__read(r.useState(b()),2),C=y[0],T=y[1];r.useEffect(function(){m&&T(b())},[b,m]);var k=r.useCallback(function(r){var n=r.column,i=r.onRowChange,o=r.row,l=o[n.key];if(Array.isArray(l)){var j=0===l.length,x=o._expandedKey===n.key;return d.jsx("div",{className:u.cn("flex items-center
|
|
1
|
+
"use strict";var e=require("../../tslib.es6-cdc5f922.js"),r=require("react"),t=require("../button/Button.js"),n=require("./_Filter.js"),i=require("../pivot-table/PivotTable.js"),s=require("../tooltip/Tooltip.js"),a=require("../../icons/ChevronRightCircleIcon.js"),u=require("../../utils/cn.js"),o=require("../../utils/flattenRow.js"),l=require("../../utils/setupNestedData.js"),c=require("../../utils/truncateText.js"),d=require("react/jsx-runtime");require("../../_rollupPluginBabelHelpers-4522587c.js"),require("class-variance-authority"),require("../button/RippleGroup.js"),require("framer-motion"),require("uuid"),require("../button/_Ripple.js"),require("../../utils/getAminoColor.js"),require("../../styles/constants/theme.js"),require("../button/useRipple.js"),require("../spinner/Spinner.js"),require("clsx"),require("tailwind-merge"),require("../../utils/getTestId.js"),require("../__amino__/TranslateAminoText.js"),require("../translations/Translate.js"),require("../../utils/translations/_handleTranslateComponentText.js"),require("../../utils/translations/AminoTranslationStore.js"),require("zod"),require("zustand"),require("../../utils/storage.js"),require("dayjs"),require("../../utils/translations/supportedLanguages.js"),require("../select/MultiSelect.js"),require("../checkbox/Checkbox.js"),require("../help-text/HelpText.js"),require("../text/Text.js"),require("../../icons/CheckmarkIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../select/_StyledReactSelect.js"),require("react-intersection-observer"),require("react-select"),require("../../icons/DoubleChevronIcon.js"),require("../../icons/RemoveCircleIcon.js"),require("../../icons/RemoveIcon.js"),require("../../icons/FilterIcon.js"),require("../../utils/hooks/useDropdown.js"),require("@floating-ui/react"),require("../../utils/translations/__amino__/translateAminoText.js"),require("../../utils/translations/translate.js"),require("../../utils/translations/_handleTranslationVariables.js"),require("react-data-grid"),require("../../icons/ChevronDownIcon.js"),require("../../icons/ChevronUpIcon.js"),require("../../utils/addIndex.js"),require("../flex/Flex.js"),require("../ui/tooltip.js"),require("@radix-ui/react-tooltip");var p=function(j){var q=j.customColumnCells,_=j.customFlattenRow,x=j.noFilter,m=j.tableDataArr,v=_||o.flattenRow,f=e.__read(r.useState([]),2),h=f[0],g=f[1],b=r.useCallback(function(){return m.map(function(e){var r=Object.entries(e).reduce(function(e,r){return v({currentVal:r,prev:e})},{});return l.setupNestedData(r)})},[v,m]),y=e.__read(r.useState(b()),2),C=y[0],T=y[1];r.useEffect(function(){m&&T(b())},[b,m]);var k=r.useCallback(function(r){var n=r.column,i=r.onRowChange,o=r.row,l=o[n.key];if(Array.isArray(l)){var j=0===l.length,x=o._expandedKey===n.key;return d.jsx("div",{className:u.cn("flex h-full items-center"),children:d.jsx(s.Tooltip,{disabled:!j,title:"This list has no items.",children:d.jsx(t.Button,{className:u.cn(x&&"[&_svg]:rotate-90","[&_svg]:transition-all [&_svg]:duration-300\n [&_svg]:ease-[ease]"),disabled:j,icon:d.jsx(a.ChevronRightCircleIcon,{}),onClick:function(){return i(e.__assign(e.__assign({},o),{_expandedKey:x?"":n.key}))},variant:"subtle"})})})}return o._expandedData&&o._expandedData.length>0?d.jsx(p,{customColumnCells:q,customFlattenRow:_,noFilter:!0,tableDataArr:o._expandedData}):"string"==typeof l?c.truncateText({addEllipsis:!0,length:40,text:l}):l},[q,_]),D=r.useMemo(function(){return Object.entries(C.find(Boolean)||{}).filter(function(r){var t=e.__read(r,1)[0];return"key"!==t&&!t.startsWith("_")}).flatMap(function(r){var t=e.__read(r,1)[0];return[{key:t,name:t,renderCell:(null==q?void 0:q[t])||k}]})},[q,k,C]),R=r.useMemo(function(){var r=D.filter(function(e){return!h.includes(e.key)});return r.map(function(t){return e.__assign(e.__assign({},t),{cellClass:function(e){return e._expandedKey===t.key||e._expandedData.length>0?"expanding":""},colSpan:function(e){return"ROW"===e.type&&e.row._expandedData.length>0?r.filter(function(e){return!e.key.startsWith("_")}).length:void 0}})})},[D,h]);return d.jsxs("div",{className:u.cn("[&_.expanding]:bg-gray-50","[&_&]:pt-amino-4 [&_&]:px-amino-12 [&_&]:pb-amino-24"),children:[d.jsx("div",{className:u.cn("mb-amino-12 flex items-center justify-end"),children:!x&&d.jsx(n.Filter,{columns:D,hiddenColumns:h,setHiddenColumns:g})}),d.jsx(i.PivotTable,{columns:R,defaultColumnOptions:{resizable:!0,sortable:!1},headerRowHeight:40,onRowsChange:function(e,r){var t=r.indexes[0],n=void 0!==t?e[t]:null;if(n&&void 0!==t){var i=n[n._expandedKey];if(i&&Array.isArray(i)){var s=e[t+1],a=(null==s?void 0:s._expandedData)&&s._expandedData.length>0,u=i[0],o="object"==typeof u&&u?i:i.map(function(e){return{item:e}});e.splice(t+1,a?1:0,{_expandedData:o,_expandedKey:""})}else e.splice(t+1,1);T(e)}},rowHeight:function(e){var r,t;return"ROW"===e.type&&(null===(t=null===(r=e.row)||void 0===r?void 0:r._expandedData)||void 0===t?void 0:t.length)>0?300:45},rows:C,tableHeight:"100%"})]})};exports.TableData=p;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var e=require("../../_rollupPluginBabelHelpers-4522587c.js"),r=require("../../tslib.es6-cdc5f922.js"),t=require("react"),n=require("react-data-grid"),o=require("../../icons/ChevronDownIcon.js"),a=require("../../icons/ChevronUpIcon.js"),s=require("../../utils/addIndex.js"),i=require("../../utils/cn.js"),l=require("react/jsx-runtime");function u(e){return e&&e.__esModule?e:{default:e}}require("../../icons/icon-base/_IconBase.js"),require("../../styles/constants/theme.js"),require("clsx"),require("tailwind-merge");var d=u(n);exports.PivotTable=function(n){var u=n.columns,c=n.onSortColumnsChange,g=n.renderers,m=n.rows,_=n.sortColumns,h=void 0===_?[]:_,b=n.style,f=n.tableHeight,p=r.__rest(n,["columns","onSortColumnsChange","renderers","rows","sortColumns","style","tableHeight"]),v=t.useRef(null),y=r.__read(t.useState(h||[]),2),x=y[0],j=y[1],C=t.useCallback(function(e){var r=e.priority,t=e.sortDirection;return t?l.jsxs("span",{className:i.cn("flex h-full items-center justify-center"),children:["ASC"===t?l.jsx(a.ChevronUpIcon,{color:"gray900"}):l.jsx(o.ChevronDownIcon,{color:"gray900"}),l.jsx("span",{children:r})]}):null},[]),w=r.__assign({renderSortStatus:C},g),q=r.__spreadArray([{frozen:!0,key:"_itemIndex",name:"",sortable:!1,width:60}],r.__read(u),!1),I=t.useMemo(function(){if(0===x.length)return m.map(s.addIndex);return r.__spreadArray([],r.__read(m),!1).sort(function(e,r){var t=0;return x.some(function(n){var o,a=(o=n.columnKey,function(e,r){var t=e[o],n=r[o];switch(typeof t){case"boolean":return t===n?0:t?1:-1;case"string":return"string"==typeof n?t.localeCompare(n):0;case"number":return"number"==typeof n?t-n:0;default:return 0}}),s=a(e,r);return 0!==s?(t="ASC"===n.direction?s:-s,1):0}),t}).map(s.addIndex)},[m,x]);return l.jsx("div",{className:i.cn("amino-pivot-table relative","[&_.data-grid]:rounded-amino-8 [&_.data-grid]:h-full\n [&_.data-grid]:bg-inherit","[&_.rdg-row]:bg-gray-0 [&_.rdg-row]:text-text-color","[&_.rdg-header-row]:text-text-color [&_.rdg-header-row]:bg-gray-100\n [&_.rdg-header-row]:font-bold","[&_.rdg-summary-row]:text-text-color [&_.rdg-summary-row]:bg-gray-100\n [&_.rdg-summary-row]:font-bold","[&_.rdg-cell]:border [&_.rdg-cell]:border-gray-200"),style:r.__assign({"--amino-pivot-table-height":f||"calc(100vh - 145px)","--amino-pivot-table-min-height":f||"",height:"var(--amino-pivot-table-height)",minHeight:"var(--amino-pivot-table-min-height)"},b),children:l.jsx(d.default,e._objectSpread2({ref:v,className:"data-grid",columns:q,onSortColumnsChange:c||j,renderers:w,rows:I,sortColumns:x},p))})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../styles/constants/theme.js"),r=require("../../utils/cn.js"),t=require("../../utils/getAminoColor.js"),s=require("react/jsx-runtime");require("clsx"),require("tailwind-merge");exports.ProgressBar=function(n){var o=n.className,i=n.colorStyle,l=void 0===i?"blue600":i,u=n.progress,a=void 0===u?0:u,c=n.style,d=a<0?0:a>100?100:a;return s.jsx("div",{className:r.cn("w-56
|
|
1
|
+
"use strict";var e=require("../../styles/constants/theme.js"),r=require("../../utils/cn.js"),t=require("../../utils/getAminoColor.js"),s=require("react/jsx-runtime");require("clsx"),require("tailwind-merge");exports.ProgressBar=function(n){var o=n.className,i=n.colorStyle,l=void 0===i?"blue600":i,u=n.progress,a=void 0===u?0:u,c=n.style,d=a<0?0:a>100?100:a;return s.jsx("div",{className:r.cn("h-2 w-56 rounded-lg bg-gray-100",o),style:c,children:s.jsx("div",{className:"h-2 rounded-lg",style:{backgroundColor:function(){switch(l){case"greenToRed":return d<=20?e.theme.green600:d>=80?e.theme.red600:e.theme.orange600;case"redToGreen":return d<=20?e.theme.red600:d>=80?e.theme.green600:e.theme.orange600;default:return t.getAminoColor(l)}}()||"",width:"".concat(d,"%")}})})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../tslib.es6-cdc5f922.js"),r=require("react"),
|
|
1
|
+
"use strict";var e=require("../../tslib.es6-cdc5f922.js"),r=require("react"),n=require("framer-motion"),a=require("../text/Text.js"),i=require("../../styles/constants/theme.js"),o=require("../../utils/cn.js"),t=require("react/jsx-runtime");require("../../_rollupPluginBabelHelpers-4522587c.js"),require("clsx"),require("tailwind-merge");exports.Radio=function(s){var l=s.checked,c=s.className,u=s.disabled,d=s.label,m=s.onChange,h=s.style,x=s.value,b=r.useId();return t.jsxs("label",{className:o.cn("flex flex-row items-center select-none","focus-within:outline-none\n [&:has(input:focus-visible)]:shadow-[var(--amino-glow-blue)]",u?"cursor-not-allowed":"cursor-pointer",u&&"disabled",c),htmlFor:b,style:e.__assign(e.__assign({},h),{"--amino-radio-background":l?i.theme.primary:i.theme.inputBackground,"--amino-radio-border":l?"none":"1.5px solid ".concat(i.theme.gray400),"--amino-radio-box-shadow":l?i.theme.shadowButtonPrimary:"none","--amino-radio-container-background":l?i.theme.blue300:""}),children:[t.jsx("input",{checked:l,id:b,onChange:function(){return!u&&m(!l)},onKeyDown:function(e){return"Enter"===e.key&&!u&&m(!l)},style:{width:"0px"},tabIndex:0,type:"radio",value:x}),t.jsx("div",{className:o.cn("mr-2 flex h-4 w-4 cursor-pointer items-center justify-center\n rounded-full transition-all select-none","bg-[var(--amino-radio-background)]\n shadow-[var(--amino-radio-box-shadow)]\n [border:var(--amino-radio-border)]",u&&"cursor-not-allowed bg-[var(--amino-radio-container-background)]"),children:t.jsx(n.AnimatePresence,{children:l&&t.jsx(n.motion.svg,{animate:{opacity:1,scale:1},className:"text-gray-0 h-2 w-2",exit:{opacity:0,scale:1.5},fill:"currentColor",initial:{opacity:0,scale:1.5},transition:{duration:.35,ease:[.4,0,.2,1]},viewBox:"0 0 10 10",children:t.jsx("circle",{cx:"5",cy:"5",r:"5"})},"radio")})}),d&&t.jsx(a.Text,{className:"mb-0",type:"input-label",children:d})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../text/Text.js"),s=require("../../utils/cn.js"),t=require("react/jsx-runtime");require("../../_rollupPluginBabelHelpers-4522587c.js"),require("../../tslib.es6-cdc5f922.js"),require("../../styles/constants/theme.js"),require("clsx"),require("tailwind-merge");exports.RestState=function(l){var i=l.action,r=l.className,
|
|
1
|
+
"use strict";var e=require("../text/Text.js"),s=require("../../utils/cn.js"),t=require("react/jsx-runtime");require("../../_rollupPluginBabelHelpers-4522587c.js"),require("../../tslib.es6-cdc5f922.js"),require("../../styles/constants/theme.js"),require("clsx"),require("tailwind-merge");exports.RestState=function(l){var i=l.action,r=l.className,n=l.icon,a=l.label,c=l.style,u=l.subtitle;return t.jsxs("div",{className:s.cn("flex flex-col items-center justify-center [&>*]:max-w-[500px]\n [&>*]:text-center",r),style:c,children:[n?t.jsx("img",{alt:a,className:"mb-amino-16 h-auto w-[100px]",src:n}):null,t.jsxs("div",{className:"gap-amino-8 flex flex-col items-center",children:[t.jsx(e.Text,{type:"title",children:a}),u&&t.jsx(e.Text,{type:"subtitle",children:u}),i?t.jsx("div",{className:"mt-amino-24 mb-amino-8",children:i}):null]})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../card/Card.js"),t=require("../stack/VStack.js"),r=require("../../utils/cn.js"),n=require("../../utils/translations/__amino__/translateAminoText.js"),a=require("../../utils/translations/AminoTranslationStore.js"),s=require("react/jsx-runtime");require("../../tslib.es6-cdc5f922.js"),require("../stack/HStack.js"),require("../../_rollupPluginBabelHelpers-4522587c.js"),require("../stack/Stack.js"),require("clsx"),require("tailwind-merge"),require("../text/Text.js"),require("../../styles/constants/theme.js"),require("../../utils/translations/translate.js"),require("../../utils/translations/_handleTranslationVariables.js"),require("zod"),require("zustand"),require("../../utils/storage.js"),require("dayjs"),require("../../utils/translations/supportedLanguages.js");exports.RichCardStateSelect=function(i){var l=i.className,o=i.onClick,u=i.states,c=i.style,d=a.useCurrentLanguage(),
|
|
1
|
+
"use strict";var e=require("../card/Card.js"),t=require("../stack/VStack.js"),r=require("../../utils/cn.js"),n=require("../../utils/translations/__amino__/translateAminoText.js"),a=require("../../utils/translations/AminoTranslationStore.js"),s=require("react/jsx-runtime");require("../../tslib.es6-cdc5f922.js"),require("../stack/HStack.js"),require("../../_rollupPluginBabelHelpers-4522587c.js"),require("../stack/Stack.js"),require("clsx"),require("tailwind-merge"),require("../text/Text.js"),require("../../styles/constants/theme.js"),require("../../utils/translations/translate.js"),require("../../utils/translations/_handleTranslationVariables.js"),require("zod"),require("zustand"),require("../../utils/storage.js"),require("dayjs"),require("../../utils/translations/supportedLanguages.js");exports.RichCardStateSelect=function(i){var l=i.className,o=i.onClick,u=i.states,c=i.style,d=a.useCurrentLanguage(),g=[{key:"West",label:n.translateAminoText({languageCode:d,text:"West --context: region name for the United States"})},{key:"Midwest",label:n.translateAminoText({languageCode:d,text:"Midwest --context: region name for the United States"})},{key:"South",label:n.translateAminoText({languageCode:d,text:"South --context: region name for the United States"})},{key:"Northeast",label:n.translateAminoText({languageCode:d,text:"Northeast --context: region name for the United States"})},{key:"Territories",label:n.translateAminoText({languageCode:d,text:"Territories --context: region name for the United States"})}].filter(function(e){return u.some(function(t){return t.region===e.key})});return s.jsx(t.VStack,{className:l,spacing:24,style:c,children:g.map(function(n){return s.jsx("div",{children:s.jsxs(t.VStack,{spacing:16,children:[s.jsx("div",{className:"font-bold",children:n.label}),s.jsx("div",{className:"flex flex-wrap gap-2",children:u.filter(function(e){return e.region===n.key}).map(function(t){return s.jsx("button",{onClick:function(){return o(t)},type:"button",children:s.jsxs(e.Card,{className:r.cn("flex h-fit w-[180px] cursor-pointer items-center gap-6\n font-medium","text-amino-s flex-[0_0_180px]","dark:bg-page","hover:bg-gray-50",t.highlighted&&r.cn("border-2 border-blue-400 bg-blue-50 text-blue-600\n dark:bg-blue-500/10","[&_svg>path]:fill-blue-200\n [&_svg>path]:stroke-blue-600")),spacing:"10px",children:[t.icon,t.name]})},t.code)})})]})},n.key)})})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../stack/VStack.js"),t=require("../text/Text.js"),r=require("../../icons/CheckmarkIcon.js"),s=require("../../utils/cn.js"),a=require("react/jsx-runtime");require("../../_rollupPluginBabelHelpers-4522587c.js"),require("../../tslib.es6-cdc5f922.js"),require("../stack/Stack.js"),require("clsx"),require("tailwind-merge"),require("../../styles/constants/theme.js"),require("react"),require("../../icons/icon-base/_IconBase.js");exports.RichCheckbox=function(c){var n=c.className,i=c.items,l=c.onClick,u=c.style;return a.jsx(e.VStack,{className:s.cn('[&_button[data-state="checked"]]:
|
|
1
|
+
"use strict";var e=require("../stack/VStack.js"),t=require("../text/Text.js"),r=require("../../icons/CheckmarkIcon.js"),s=require("../../utils/cn.js"),a=require("react/jsx-runtime");require("../../_rollupPluginBabelHelpers-4522587c.js"),require("../../tslib.es6-cdc5f922.js"),require("../stack/Stack.js"),require("clsx"),require("tailwind-merge"),require("../../styles/constants/theme.js"),require("react"),require("../../icons/icon-base/_IconBase.js");exports.RichCheckbox=function(c){var n=c.className,i=c.items,l=c.onClick,u=c.style;return a.jsx(e.VStack,{className:s.cn('[&_button[data-state="checked"]]:border-blue-300\n [&_button[data-state="checked"]]:bg-blue-100','[&_button[data-state="checked"]]:text-blue-600',"[&_svg]:text-gray-0 [&_svg]:h-3 [&_svg]:w-3",n),spacing:16,style:u,children:i.map(function(c){var n=c.checked,i=c.icon,u=c.label,o=c.subtitle,d=c.value;return a.jsxs("button",{className:s.cn("bg-raised border-amino rounded-amino-6 relative appearance-none\n border p-4 pr-10","flex flex-row items-center text-left transition-all duration-150\n ease-in-out","hover:bg-hover hover:border-gray-200","focus:border-blue-300 focus:outline-none"),"data-state":n?"checked":"",onClick:function(e){return l(e.currentTarget.value)},type:"button",value:d,children:[a.jsxs("div",{className:s.cn("grid items-center",i&&"grid-cols-[30px_1fr] gap-6"),children:[i&&i,a.jsxs(e.VStack,{spacing:0,children:[a.jsx(t.Text,{className:s.cn("leading-6",'[data-state="checked"]_&:text-blue-600'),color:"gray1000",type:"label",children:u}),o&&a.jsx(t.Text,{className:s.cn('[data-state="checked"]_&:text-blue-600'),color:"gray700",children:o})]})]}),n&&a.jsx("div",{className:"absolute right-4 flex items-center justify-center rounded-full bg-blue-600 p-1.25",children:a.jsx(r.CheckmarkIcon,{})})]},d)})})};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import { type TooltipProps } from
|
|
2
|
+
import { type TooltipProps } from "../tooltip/Tooltip";
|
|
3
3
|
import type { BaseProps } from "../../types/BaseProps";
|
|
4
4
|
export type RichRadioItemType<T extends string> = {
|
|
5
5
|
/**
|
|
@@ -12,9 +12,9 @@ export type RichRadioItemType<T extends string> = {
|
|
|
12
12
|
*/
|
|
13
13
|
label: ReactNode;
|
|
14
14
|
/**
|
|
15
|
-
* Optional secondary text to display below the label
|
|
15
|
+
* Optional secondary text or React node to display below the label
|
|
16
16
|
*/
|
|
17
|
-
subtitle?:
|
|
17
|
+
subtitle?: ReactNode;
|
|
18
18
|
/**
|
|
19
19
|
* Text to display when hovering over the option
|
|
20
20
|
*/
|
|
@@ -22,7 +22,7 @@ export type RichRadioItemType<T extends string> = {
|
|
|
22
22
|
/**
|
|
23
23
|
* Custom settings for the tooltip component
|
|
24
24
|
*/
|
|
25
|
-
tooltipSetting?: Omit<TooltipProps, '
|
|
25
|
+
tooltipSetting?: Omit<TooltipProps, 'children' | 'title'>;
|
|
26
26
|
/**
|
|
27
27
|
* Unique identifier for this option
|
|
28
28
|
*/
|
|
@@ -88,7 +88,7 @@ export type RichRadioProps<T extends string = string> = BaseProps & {
|
|
|
88
88
|
* label: 'Option with tooltip',
|
|
89
89
|
* subtitle: 'Hover to see more information',
|
|
90
90
|
* tooltip: 'This is additional information about this option',
|
|
91
|
-
* tooltipSetting: {
|
|
91
|
+
* tooltipSetting: { enterDelay: 400 },
|
|
92
92
|
* value: 'option1'
|
|
93
93
|
* },
|
|
94
94
|
* {
|