@protonradio/proton-ui 0.11.11 → 0.11.13-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ActionMenu/ActionMenu.cjs.js +1 -1
- package/dist/components/Banner/Banner.cjs.js +1 -1
- package/dist/components/Button/Button.cjs.js +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.cjs.js +1 -1
- package/dist/components/ButtonWithSelect/ButtonWithSelect.es.js +13 -13
- package/dist/components/DataTable/DataTable.cjs.js +1 -1
- package/dist/components/Dialog/Dialog.cjs.js +1 -1
- package/dist/components/Input/BaseInput/Input.cjs.js +1 -1
- package/dist/components/Input/SearchInput/SearchInput.cjs.js +1 -1
- package/dist/components/Input/SearchInput/SearchInput.cjs.js.map +1 -1
- package/dist/components/Input/SearchInput/SearchInput.es.js +1 -1
- package/dist/components/Input/SearchInput/SearchInput.es.js.map +1 -1
- package/dist/components/Menu/MenuTrigger.cjs.js +1 -1
- package/dist/components/Modal/Modal.cjs.js +1 -1
- package/dist/components/Switch/Switch.cjs.js +1 -1
- package/dist/components/Table/Collection/collectionParser.cjs.js +1 -1
- package/dist/components/Table/Collection/useTableCollection.cjs.js +1 -1
- package/dist/components/Text/TextEmphasis/TextEmphasis.cjs.js +1 -1
- package/dist/components/Text/TextEmphasis/TextEmphasis.cjs.js.map +1 -1
- package/dist/components/Text/TextEmphasis/TextEmphasis.es.js +15 -15
- package/dist/components/Text/TextEmphasis/TextEmphasis.es.js.map +1 -1
- package/dist/components/ThemeProvider.cjs.js +1 -1
- package/dist/components/Tooltip/Tooltip.cjs.js +1 -1
- package/dist/components/Tooltip/Tooltip.cjs.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.es.js +71 -56
- package/dist/components/Tooltip/Tooltip.es.js.map +1 -1
- package/dist/components/Waveform/Waveform.cjs.js +1 -1
- package/dist/hooks/useBreakpoint.cjs.js +1 -1
- package/dist/hooks/useIsClosing.cjs.js +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +52 -25
- package/dist/index.es.js +6 -6
- package/dist/node_modules/@react-aria/focus/dist/FocusScope.cjs.js +1 -1
- package/dist/node_modules/@react-aria/form/dist/useFormValidation.cjs.js +1 -1
- package/dist/node_modules/@react-aria/i18n/dist/context.cjs.js +1 -1
- package/dist/node_modules/@react-aria/i18n/dist/context.es.js +3 -3
- package/dist/node_modules/@react-aria/interactions/dist/useFocusWithin.cjs.js +1 -1
- package/dist/node_modules/@react-aria/interactions/dist/useFocusable.cjs.js +1 -1
- package/dist/node_modules/@react-aria/interactions/dist/useFocusable.cjs.js.map +1 -1
- package/dist/node_modules/@react-aria/interactions/dist/useFocusable.es.js +20 -30
- package/dist/node_modules/@react-aria/interactions/dist/useFocusable.es.js.map +1 -1
- package/dist/node_modules/@react-aria/interactions/dist/usePress.cjs.js +2 -2
- package/dist/node_modules/@react-aria/overlays/dist/Overlay.cjs.js +1 -1
- package/dist/node_modules/@react-aria/ssr/dist/SSRProvider.es.js.map +1 -1
- package/dist/node_modules/@react-stately/form/dist/useFormValidationState.cjs.js +1 -1
- package/dist/node_modules/@react-stately/radio/dist/useRadioGroupState.cjs.js +1 -1
- package/dist/node_modules/@react-stately/utils/dist/useControlledState.cjs.js +1 -1
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.cjs.js +5 -5
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.es.js +14 -14
- package/dist/node_modules/react/cjs/react-jsx-runtime.production.min.es.js +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/node_modules/react-aria-components/dist/OverlayArrow.cjs.js +0 -2
- package/dist/node_modules/react-aria-components/dist/OverlayArrow.cjs.js.map +0 -1
- package/dist/node_modules/react-aria-components/dist/OverlayArrow.es.js +0 -37
- package/dist/node_modules/react-aria-components/dist/OverlayArrow.es.js.map +0 -1
- package/dist/node_modules/react-aria-components/dist/Tooltip.cjs.js +0 -2
- package/dist/node_modules/react-aria-components/dist/Tooltip.cjs.js.map +0 -1
- package/dist/node_modules/react-aria-components/dist/Tooltip.es.js +0 -98
- package/dist/node_modules/react-aria-components/dist/Tooltip.es.js.map +0 -1
- package/dist/node_modules/react-aria-components/dist/utils.cjs.js +0 -2
- package/dist/node_modules/react-aria-components/dist/utils.cjs.js.map +0 -1
- package/dist/node_modules/react-aria-components/dist/utils.es.js +0 -89
- package/dist/node_modules/react-aria-components/dist/utils.es.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../node_modules/react/jsx-runtime.cjs.js"),s=require("react"),H=require("../../hooks/useIsClosing.cjs.js"),P=require("../../hooks/useLockBodyScroll.cjs.js"),G=require("../Button/Button.cjs.js"),L=require("../ScreenOverlay/ScreenOverlay.cjs.js"),i=require("radix-ui"),N=require("../Icon/Icon.cjs.js");;/* empty css */const D=require("../../utils/navigation.cjs.js"),T=({isOpen:e,actions:a=[],children:o,showCancel:l=!0,cancelButtonText:m="Cancel",selectionMode:E="single",selectedKeys:x,disabledKeys:h=[],onSelectionChange:p,onClose:f,title:j,"data-testid":r})=>{var $;P.useLockBodyScroll(e);const[u,c]=s.useState(0),[t,d]=s.useState([]),[A,_]=s.useState({title:j,actions:a,key:null,previousKey:null}),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../node_modules/react/jsx-runtime.cjs.js"),s=require("react"),H=require("../../hooks/useIsClosing.cjs.js"),P=require("../../hooks/useLockBodyScroll.cjs.js"),G=require("../Button/Button.cjs.js"),L=require("../ScreenOverlay/ScreenOverlay.cjs.js"),i=require("radix-ui"),N=require("../Icon/Icon.cjs.js");;/* empty css */const D=require("../../utils/navigation.cjs.js"),T=({isOpen:e,actions:a=[],children:o,showCancel:l=!0,cancelButtonText:m="Cancel",selectionMode:E="single",selectedKeys:x,disabledKeys:h=[],onSelectionChange:p,onClose:f,title:j,"data-testid":r})=>{var $;P.useLockBodyScroll(e);const[u,c]=s.useState(0),[t,d]=s.useState([]),[A,_]=s.useState({title:j,actions:a,key:null,previousKey:null}),g=s.useRef(null),C=s.useRef(null),S=s.useRef(null),{isClosing:M,handleClose:b}=H.useIsClosing({onClose:f,overlayRef:S}),v=A.actions||[],w=v&&v.length>0,I=o||w||l,q=t.length>0;function B(R){const y=v.find(k=>k.key===R);if(!y){console.error(`Action with key ${R} not found`);return}d(k=>[...k,A]),_(k=>({title:y.label,actions:y.children,key:y.key,previousKey:k.key}))}function F(){if(t.length>0){const R=t[t.length-1];_(R),d(t.slice(0,-1))}}return s.useEffect(()=>{e&&requestAnimationFrame(()=>{g.current&&c(g.current.scrollHeight+12)})},[e,t,I]),s.useEffect(()=>{(!e||M)&&c(0)},[e,M]),!e&&!M?null:n.jsxRuntimeExports.jsx(L.ScreenOverlay,{fadeIn:!0,ref:S,children:n.jsxRuntimeExports.jsxs(i.DropdownMenu.Root,{modal:!0,open:e,onOpenChange:R=>{R||b()},children:[n.jsxRuntimeExports.jsx(i.DropdownMenu.Trigger,{asChild:!0,children:n.jsxRuntimeExports.jsx("div",{children:""})}),n.jsxRuntimeExports.jsx("div",{className:"proton-ActionMenu__background-wrapper",style:{opacity:M?0:1},children:n.jsxRuntimeExports.jsx("div",{"data-testid":r||"ActionMenu-wrapper",className:"proton-ActionMenu__wrapper",children:n.jsxRuntimeExports.jsx("div",{className:"proton-ActionMenu__card","data-testid":"ActionMenu-content",style:{height:`${u}px`},children:n.jsxRuntimeExports.jsx("div",{ref:C,className:"proton-ActionMenu__menu",children:n.jsxRuntimeExports.jsx(i.DropdownMenu.Content,{loop:!0,sideOffset:8,ref:g,children:I&&n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[o&&n.jsxRuntimeExports.jsx("div",{className:"proton-ActionMenu__content",children:typeof o=="function"?o({close:b}):o}),w&&n.jsxRuntimeExports.jsx(z,{actions:v,selectionMode:E,selectedKeys:x,onSelectionChange:p,disabledKeys:h,handleSubmenuOpen:B,title:A.title,isInSubmenu:q,handleBack:F,previousMenuTitle:($=t[t.length-1])==null?void 0:$.title}),l&&n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(i.DropdownMenu.Separator,{}),n.jsxRuntimeExports.jsx(i.DropdownMenu.Item,{className:"proton-ActionMenu__cancel-button",children:n.jsxRuntimeExports.jsx(G.Button,{"data-testid":"ActionMenuItem-cancel",onPress:b,fullWidth:!0,variant:"secondary",children:m})})]})]})})})})})})]})})},z=({actions:e,selectionMode:a,selectedKeys:o=[],onSelectionChange:l,disabledKeys:m=[],handleSubmenuOpen:E,title:x,isInSubmenu:h=!1,handleBack:p,previousMenuTitle:f})=>{const j=()=>n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[h&&p&&n.jsxRuntimeExports.jsxs("div",{className:"proton-ActionMenu__back-button-container",children:[n.jsxRuntimeExports.jsx(i.DropdownMenu.Item,{className:"proton-ActionMenu__back-button",onSelect:r=>{r.preventDefault(),p()},"aria-label":`Go back to ${f||"previous menu"}`,children:n.jsxRuntimeExports.jsx(N.Icon,{id:"chevron-left",size:16,"aria-hidden":"true"})}),n.jsxRuntimeExports.jsx("div",{className:"proton-ActionMenu__title",role:"banner","aria-label":h?`Submenu: ${x}`:`Menu: ${x}`,children:n.jsxRuntimeExports.jsx("span",{children:x})}),n.jsxRuntimeExports.jsx(i.DropdownMenu.Separator,{})]}),e.map((r,u)=>{var t;const c=e[u];return n.jsxRuntimeExports.jsx(U,{item:r,isSubmenu:!!((t=c.children)!=null&&t.length),selectionMode:a,onSelectionChange:l,selectedKeys:o,disabledKeys:m,handleSubmenuOpen:E},r.key)})]});return n.jsxRuntimeExports.jsx("div",{"aria-disabled":a==="none",className:"proton-ActionMenu__list",role:"menu","aria-label":x?`${h?"Submenu":"Menu"}: ${x}`:"Action menu","aria-orientation":"vertical",children:a==="single"?n.jsxRuntimeExports.jsx(i.DropdownMenu.RadioGroup,{value:(o==null?void 0:o[0])||"",onValueChange:r=>{var c;const u=e.find(t=>t.key===r);(c=u==null?void 0:u.children)!=null&&c.length||l&&l(new Set([r]))},children:n.jsxRuntimeExports.jsx(j,{})}):n.jsxRuntimeExports.jsx(i.DropdownMenu.Group,{children:n.jsxRuntimeExports.jsx(j,{})})})},U=({item:e,isSubmenu:a,selectionMode:o,onSelectionChange:l,selectedKeys:m=[],disabledKeys:E=[],handleSubmenuOpen:x})=>{const h=s.useRef(null),p=e.to&&D.isUrlExternal(e.to),f=E.includes(e.key),j=m.includes(e.key),r={className:"proton-ActionMenu__item","aria-label":e.label?`${e.label}${e.description?`, ${e.description}`:""}`:`ActionMenu-Item-${e.key}`,role:"menuitem",disabled:f,ref:h},u=t=>{var d;if((d=e==null?void 0:e.children)!=null&&d.length){t.preventDefault(),x(e.key);return}e.onAction&&e.onAction(e.key)},c=n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsxs("div",{className:"proton-ActionMenu__item-content",children:[n.jsxRuntimeExports.jsx("div",{className:"proton-ActionMenu__item-label",children:e.label}),e.description&&n.jsxRuntimeExports.jsx("div",{className:"proton-ActionMenu__description",children:e.description})]}),a&&n.jsxRuntimeExports.jsx(N.Icon,{id:"chevron-right",size:16,"aria-hidden":"true"})]});return e.to?s.createElement(i.DropdownMenu.Item,{...r,key:e.key,asChild:!0},n.jsxRuntimeExports.jsx("a",{"aria-label":e.label?`${e.label}${e.description?`, ${e.description}`:""}`:`ActionMenu-Item-${e.key}`,"aria-disabled":f,"aria-checked":j,"aria-expanded":a?!1:void 0,href:e.to,target:p?"_blank":void 0,rel:p?"noopener noreferrer":void 0,onClick:t=>{p||!e.to||D.handleInternalNavigation(t,e.to)},children:c})):o==="multiple"?s.createElement(i.DropdownMenu.CheckboxItem,{...r,key:e.key,checked:j,onSelect:u,onCheckedChange:t=>{if(!l)return;const d=new Set(m);t?d.add(e.key):d.delete(e.key),l(d)}},c):s.createElement(i.DropdownMenu.RadioItem,{...r,value:e.key,key:e.key,"aria-checked":j,"aria-expanded":a?!1:void 0,onSelect:u},c)};exports.ActionMenu=T;
|
|
2
2
|
//# sourceMappingURL=ActionMenu.cjs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../node_modules/react/jsx-runtime.cjs.js"),o=require("react"),h=require("../Button/Button.cjs.js");;/* empty css */const a=require("../../utils/string.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../node_modules/react/jsx-runtime.cjs.js"),o=require("react"),h=require("../Button/Button.cjs.js");;/* empty css */const a=require("../../utils/string.cjs.js"),x={success:n.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 20 20",height:"18",width:"18",children:n.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z"})}),warning:n.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 56 56",height:"17",width:"17",children:n.jsxRuntimeExports.jsx("path",{d:"M9.59 50.207h36.82c3.516 0 5.719-2.531 5.719-5.719a5.56 5.56 0 0 0-.75-2.812l-18.445-33c-1.055-1.899-2.977-2.883-4.922-2.883c-1.922 0-3.89.984-4.946 2.883L4.645 41.699c-.516.89-.774 1.828-.774 2.79c0 3.187 2.227 5.718 5.719 5.718m18.422-16.055c-1.242 0-1.922-.703-1.969-1.968l-.328-11.578c-.047-1.266.937-2.204 2.273-2.204c1.313 0 2.344.961 2.297 2.227l-.351 11.555c-.047 1.289-.727 1.968-1.922 1.968m0 8.649c-1.36 0-2.625-1.078-2.625-2.532s1.242-2.53 2.625-2.53s2.625 1.054 2.625 2.53c0 1.477-1.266 2.532-2.625 2.532"})}),danger:n.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 20 20",height:"18",width:"18",children:n.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z"})})},N={default:"default",success:"success",warning:"warning",danger:"danger"},c=o.createContext(void 0),s=({variant:t="default",rounded:e=!0,icon:r=!1,compact:i=!0,children:m,"data-testid":j})=>n.jsxRuntimeExports.jsx(c.Provider,{value:t,children:n.jsxRuntimeExports.jsx("div",{role:"status","aria-live":"polite",className:a.csx("proton-Banner",`proton-Banner--${t}`,e&&"proton-Banner--rounded"),"data-testid":j,children:n.jsxRuntimeExports.jsxs("div",{className:a.csx("proton-Banner__wrapper",i&&"proton-Banner__wrapper--compact"),children:[n.jsxRuntimeExports.jsx(s.Icon,{icon:r}),n.jsxRuntimeExports.jsx("div",{className:"proton-Banner__content-wrapper",children:n.jsxRuntimeExports.jsx("div",{className:"proton-Banner__container",children:m})})]})})});s.displayName="Banner";const d=({children:t,"data-testid":e})=>{const r=o.useContext(c);if(!r)throw new Error("BannerTitle must be used within a Banner");return n.jsxRuntimeExports.jsx("h3",{className:a.csx("proton-Banner__title",`proton-Banner--${r}__title`),"data-testid":e,children:t})};d.displayName="Banner.Title";const u=({children:t,"data-testid":e})=>{const r=o.useContext(c);if(!r)throw new Error("BannerContent must be used within a Banner");return n.jsxRuntimeExports.jsx("p",{className:a.csx("proton-Banner__content",`proton-Banner--${r}__content`),"data-testid":e,children:t})};u.displayName="Banner.Content";function R(t,e){return o.isValidElement(t)?t:t?x[e]:null}const l=({icon:t,"data-testid":e})=>{const r=o.useContext(c);if(!r)throw new Error("BannerIcon must be used within a Banner");const i=R(t,r);return i?n.jsxRuntimeExports.jsx("div",{"aria-hidden":"true","data-testid":e,className:a.csx("proton-Banner__icon",`proton-Banner--${r}__icon`),children:i}):null};l.displayName="Banner.Icon";const p=({children:t,...e})=>n.jsxRuntimeExports.jsx(h.Button,{...e,children:t});p.displayName="Banner.Action";const B=({children:t})=>n.jsxRuntimeExports.jsx("div",{className:"proton-Banner__actions",children:t});B.displayName="Banner.Actions";s.Title=d;s.Content=u;s.Icon=l;s.Action=p;s.Actions=B;exports.BANNER_ICONS=x;exports.BANNER_VARIANTS=N;exports.Banner=s;
|
|
2
2
|
//# sourceMappingURL=Banner.cjs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../node_modules/react/jsx-runtime.cjs.js"),i=require("react"),f=require("../../utils/string.cjs.js"),g=require("../../utils/navigation.cjs.js");;/* empty css */const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../node_modules/react/jsx-runtime.cjs.js"),i=require("react"),f=require("../../utils/string.cjs.js"),g=require("../../utils/navigation.cjs.js");;/* empty css */const v={primary:"primary",secondary:"secondary",success:"success",danger:"danger",translucent:"translucent"},_={small:"small",medium:"medium",large:"large",xlarge:"xlarge","2xlarge":"2xlarge"},j=i.forwardRef(({variant:y="primary",size:c="medium",fullWidth:l=!1,icon:d,to:n,target:u,onPress:o,type:R="button",isDisabled:r,"data-testid":E,children:x},t)=>{const s=n&&g.isUrlExternal(n),m=i.useRef(null);i.useLayoutEffect(()=>{typeof t=="function"?t(m.current):t&&(t.current=m.current)},[t]);const p={className:f.csx("proton-Button",`proton-Button--${y}`,l&&"proton-Button--fullWidth",r&&"proton-Button--disabled",c&&`proton-Button--${c}`),"data-testid":E,...n&&{"aria-disabled":r},...r&&{tabIndex:-1}},B=e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[d&&e.jsxRuntimeExports.jsx("div",{className:f.csx("proton-Button__icon-decorator",l&&"proton-Button__icon-decorator--fullWidth"),children:d}),x&&e.jsxRuntimeExports.jsx("div",{className:"proton-Button__text",children:x})]});return n?e.jsxRuntimeExports.jsx("a",{...p,href:n,target:u||(s?"_blank":void 0),rel:s||u==="_blank"?"noopener noreferrer":void 0,ref:t,onClick:a=>{if(r){a.preventDefault();return}!s&&!u&&g.handleInternalNavigation(a,n),o==null||o(a)},role:"button",children:B}):e.jsxRuntimeExports.jsx("button",{...p,type:R,disabled:r,ref:t,onClick:a=>{!r&&o&&o(a)},children:B})});j.displayName="ProtonUIButton";exports.Button=j;exports.ButtonSizes=_;exports.ButtonVariants=v;
|
|
2
2
|
//# sourceMappingURL=Button.cjs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../node_modules/react/jsx-runtime.cjs.js"),u=require("react"),c=require("../../node_modules/@react-aria/radio/dist/useRadio.cjs.js"),p=require("../../node_modules/@react-aria/radio/dist/useRadioGroup.cjs.js"),x=require("../../node_modules/@react-aria/visually-hidden/dist/VisuallyHidden.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../node_modules/react/jsx-runtime.cjs.js"),u=require("react"),c=require("../../node_modules/@react-aria/radio/dist/useRadio.cjs.js"),p=require("../../node_modules/@react-aria/radio/dist/useRadioGroup.cjs.js"),x=require("../../node_modules/@react-aria/visually-hidden/dist/VisuallyHidden.cjs.js"),G=require("../../node_modules/@react-stately/radio/dist/useRadioGroupState.cjs.js");;/* empty css */const R=require("../../utils/string.cjs.js");let a=u.createContext(null);function s(i){let t={...i,"data-testid":void 0},e=G.useRadioGroupState(t),{radioGroupProps:r}=p.useRadioGroup(t,e);return o.jsxRuntimeExports.jsx("div",{...r,className:"proton-ButtonGroup","data-value":e.selectedValue,"data-testid":i["data-testid"]||void 0,children:o.jsxRuntimeExports.jsx(a.Provider,{value:e,children:i.children})})}s.displayName="ProtonUIButtonGroup";s.Option=function(t){let e={...t,"data-testid":void 0},r=u.useContext(a),n=u.useRef(null),{inputProps:l,isSelected:d}=c.useRadio(e,r,n);return o.jsxRuntimeExports.jsxs("label",{className:R.csx("proton-ButtonGroup__option",d&&"proton-ButtonGroup__option--selected"),"data-selected":d||void 0,"data-testid":t["data-testid"]||void 0,children:[o.jsxRuntimeExports.jsx(x.VisuallyHidden,{children:o.jsxRuntimeExports.jsx("input",{...l,ref:n})}),t.children]})};exports.ButtonGroup=s;
|
|
2
2
|
//# sourceMappingURL=ButtonGroup.cjs.js.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { j as t } from "../../node_modules/react/jsx-runtime.es.js";
|
|
2
2
|
import j from "react";
|
|
3
3
|
import { Button as s } from "../Button/Button.es.js";
|
|
4
|
-
import { Icon as
|
|
5
|
-
import { MenuTrigger as
|
|
4
|
+
import { Icon as f } from "../Icon/Icon.es.js";
|
|
5
|
+
import { MenuTrigger as S } from "../Menu/MenuTrigger.es.js";
|
|
6
6
|
/* empty css */
|
|
7
7
|
const c = 44;
|
|
8
8
|
function W({
|
|
9
9
|
items: e,
|
|
10
10
|
defaultValue: i,
|
|
11
|
-
children:
|
|
11
|
+
children: d,
|
|
12
12
|
onSelectionChange: a,
|
|
13
13
|
disabledKeys: m,
|
|
14
14
|
selectedKey: u,
|
|
15
|
-
icon:
|
|
15
|
+
icon: g,
|
|
16
16
|
variant: n,
|
|
17
17
|
fullWidth: r,
|
|
18
|
-
onPress:
|
|
18
|
+
onPress: x,
|
|
19
19
|
...o
|
|
20
20
|
}) {
|
|
21
21
|
const h = r ? c / 2 : 0;
|
|
@@ -32,18 +32,18 @@ function W({
|
|
|
32
32
|
s,
|
|
33
33
|
{
|
|
34
34
|
...o,
|
|
35
|
-
onPress:
|
|
36
|
-
icon:
|
|
35
|
+
onPress: x,
|
|
36
|
+
icon: g,
|
|
37
37
|
fullWidth: r,
|
|
38
38
|
variant: n,
|
|
39
39
|
"data-testid": "ButtonWithSelect-Button",
|
|
40
|
-
children:
|
|
40
|
+
children: d
|
|
41
41
|
}
|
|
42
42
|
)
|
|
43
43
|
}
|
|
44
44
|
),
|
|
45
45
|
/* @__PURE__ */ t.jsx(
|
|
46
|
-
|
|
46
|
+
S,
|
|
47
47
|
{
|
|
48
48
|
items: e,
|
|
49
49
|
disabled: o.isDisabled,
|
|
@@ -51,7 +51,7 @@ function W({
|
|
|
51
51
|
onSelectionChange: a,
|
|
52
52
|
selectedKey: u,
|
|
53
53
|
renderTrigger: ({ isOpen: p, setIsOpen: B }) => /* @__PURE__ */ t.jsx(
|
|
54
|
-
|
|
54
|
+
l,
|
|
55
55
|
{
|
|
56
56
|
...o,
|
|
57
57
|
variant: n,
|
|
@@ -63,17 +63,17 @@ function W({
|
|
|
63
63
|
] });
|
|
64
64
|
}
|
|
65
65
|
W.displayName = "ProtonUIButtonWithSelect";
|
|
66
|
-
const
|
|
66
|
+
const l = j.forwardRef((e, i) => /* @__PURE__ */ t.jsx(
|
|
67
67
|
"div",
|
|
68
68
|
{
|
|
69
69
|
className: "proton-ButtonWithSelect__trigger",
|
|
70
70
|
style: {
|
|
71
71
|
"--trigger-width": `${c}px`
|
|
72
72
|
},
|
|
73
|
-
children: /* @__PURE__ */ t.jsx(s, { ...e, "data-testid": "ButtonWithSelect-Trigger", ref: i, children: /* @__PURE__ */ t.jsx("div", { className: "proton-ButtonWithSelect__trigger-content", children: /* @__PURE__ */ t.jsx(
|
|
73
|
+
children: /* @__PURE__ */ t.jsx(s, { ...e, "data-testid": "ButtonWithSelect-Trigger", ref: i, children: /* @__PURE__ */ t.jsx("div", { className: "proton-ButtonWithSelect__trigger-content", children: /* @__PURE__ */ t.jsx(f, { id: "chevron-down", size: 16 }) }) })
|
|
74
74
|
}
|
|
75
75
|
));
|
|
76
|
-
|
|
76
|
+
l.displayName = "ProtonUIButtonWithSelectTrigger";
|
|
77
77
|
export {
|
|
78
78
|
W as ButtonWithSelect
|
|
79
79
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../node_modules/react/jsx-runtime.cjs.js"),D=require("react"),s=require("../Table/Table.cjs.js"),f=require("../Elevation/Elevation.cjs.js"),_=require("../Tombstone/Tombstone.cjs.js"),q=require("../Icon/Icon.cjs.js");;/* empty css */function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../node_modules/react/jsx-runtime.cjs.js"),D=require("react"),s=require("../Table/Table.cjs.js"),f=require("../Elevation/Elevation.cjs.js"),_=require("../Tombstone/Tombstone.cjs.js"),q=require("../Icon/Icon.cjs.js");;/* empty css */function B(r){const{columns:x,data:l=[],loading:j=!1,tombstoneComponent:u,error:a=!1,name:d,onRowClick:m,emptyMessage:T="Data Unavailable",errorMessage:C,loadingRows:g=5,"data-testid":c}=r,y="sortableColumns"in r?r.sortableColumns:[],b="sortedBy"in r?r.sortedBy:void 0,p="sortDirection"in r?r.sortDirection:void 0,h="onSort"in r?r.onSort:void 0,o=D.useMemo(()=>x.filter(e=>!e.hidden),[x]),S=e=>{if(!h)return;const n=b===e.id&&p==="ASC"?"DESC":"ASC";h(e.id,n)},v=e=>b!==e?"none":p==="ASC"?"ascending":"descending";if(a){const e=typeof a=="string"?a:C||"An error occurred";return t.jsxRuntimeExports.jsx(E,{columns:o,message:e,name:d,testId:c,isError:!0})}return j?t.jsxRuntimeExports.jsx("div",{className:"proton-DataTable","data-testid":c,"aria-busy":"true","aria-label":`Loading ${d}...`,children:t.jsxRuntimeExports.jsxs(s.Table,{name:d,children:[t.jsxRuntimeExports.jsx(s.Table.Header,{children:o.map(e=>t.jsxRuntimeExports.jsx(s.Table.Column,{id:e.id,children:e.header},e.id))}),t.jsxRuntimeExports.jsx(s.Table.Body,{children:Array.from({length:g}).map((e,i)=>t.jsxRuntimeExports.jsx(s.Table.Row,{children:o.map(n=>t.jsxRuntimeExports.jsx(s.Table.Cell,{children:u||t.jsxRuntimeExports.jsx(_.Tombstone,{height:"1rem",width:i%3===0?"80%":i%3===1?"60%":"90%"})},n.id))},`loading-${i}`))})]})}):!l||l.length===0?t.jsxRuntimeExports.jsx(E,{columns:o,message:T,name:d,testId:c}):t.jsxRuntimeExports.jsx("div",{className:"proton-DataTable","data-testid":c,children:t.jsxRuntimeExports.jsxs(s.Table,{name:d,children:[t.jsxRuntimeExports.jsx(s.Table.Header,{children:o.map(e=>{const i=y.includes(e.id),n=v(e.id);return t.jsxRuntimeExports.jsx(s.Table.Column,{id:e.id,...i&&{"aria-sort":n},children:t.jsxRuntimeExports.jsxs("span",{className:"proton-DataTable__header-content",children:[e.header,i&&t.jsxRuntimeExports.jsx("button",{className:"proton-DataTable__sort-button",onClick:()=>S(e),"aria-label":`Sort by ${e.header}: ${n}`,type:"button",children:t.jsxRuntimeExports.jsx(q.Icon,{id:"chevron-up",size:12,color:n==="ascending"?"var(--proton-color__primary)":"currentColor"})})]})},e.id)})}),t.jsxRuntimeExports.jsx(s.Table.Body,{children:l.map((e,i)=>{const n=((e==null?void 0:e.id)||(e==null?void 0:e.key))??i;return t.jsxRuntimeExports.jsx(s.Table.Row,{onClick:m?()=>m(e):void 0,children:o.map(R=>t.jsxRuntimeExports.jsx(s.Table.Cell,{children:R.cell(e)},R.id))},n)})})]})})}const E=({columns:r,message:x,name:l,testId:j,isError:u=!1})=>t.jsxRuntimeExports.jsx("div",{className:"proton-DataTable","data-testid":j,children:t.jsxRuntimeExports.jsxs(s.Table,{name:l,children:[t.jsxRuntimeExports.jsx(s.Table.Header,{children:r==null?void 0:r.map(a=>t.jsxRuntimeExports.jsx(s.Table.Column,{id:a.id,children:a.header},a.id))}),t.jsxRuntimeExports.jsx(s.Table.Body,{children:t.jsxRuntimeExports.jsx(s.Table.Row,{children:t.jsxRuntimeExports.jsx(s.Table.Cell,{colSpan:(r==null?void 0:r.length)||1,children:t.jsxRuntimeExports.jsx("div",{className:"proton-DataTable__message-cell",role:u?"alert":"status","aria-live":"polite",children:t.jsxRuntimeExports.jsx(f.Elevation,{children:t.jsxRuntimeExports.jsx("div",{className:"proton-DataTable__empty-cell",children:x})})})})})})]})});exports.DataTable=B;
|
|
2
2
|
//# sourceMappingURL=DataTable.cjs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../node_modules/react/jsx-runtime.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../node_modules/react/jsx-runtime.cjs.js"),n=require("react"),u=require("../../node_modules/@react-aria/dialog/dist/useDialog.cjs.js");;/* empty css */function a({title:e,children:s,...i}){let r=n.useRef(null),{dialogProps:t,titleProps:l}=u.useDialog(i,r);return o.jsxRuntimeExports.jsxs("div",{...t,ref:r,className:"proton-Dialog",children:[e&&o.jsxRuntimeExports.jsx("h3",{...l,className:"proton-Dialog__header",children:e}),s]})}exports.Dialog=a;
|
|
2
2
|
//# sourceMappingURL=Dialog.cjs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../node_modules/react/jsx-runtime.cjs.js"),s=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../node_modules/react/jsx-runtime.cjs.js"),s=require("react"),S=require("../../ThemeProvider.cjs.js");;/* empty css */const F=require("../../../utils/copy.cjs.js"),o=require("../../../utils/string.cjs.js"),W=s.forwardRef(({prefix:l,suffix:d,description:i,descriptionPosition:j="top",isDisabled:v,error:n,onChange:_,label:x,name:u,placeholder:P,type:T="text",value:y,autoFocus:g,autoComplete:k,isRequired:h=!1,isReadOnly:R=!1,onSubmit:b,onClear:E,"data-testid":z},O)=>{const N=s.useRef(null),c=s.useRef(null),p=s.useRef(null),r=s.useRef(null),{className:B}=S.useTheme(),D=O||N;s.useEffect(()=>{if(!r.current)return;const t=()=>{var $,q;if(r.current){const a=r.current.offsetWidth||200;r.current.style.setProperty("--container-width",`${a}px`)}if(c.current){const a=c.current.offsetWidth||32;($=r.current)==null||$.style.setProperty("--prefix-width",`${a}px`)}if(p.current){const a=p.current.offsetWidth||32;(q=r.current)==null||q.style.setProperty("--suffix-width",`${a}px`)}};t();const f=new ResizeObserver(t);return r.current&&f.observe(r.current),c.current&&f.observe(c.current),p.current&&f.observe(p.current),()=>{f.disconnect()}},[l,d]);const w=`${u}-input`,m=`${u}-error`,I=`${u}-description`;return e.jsxRuntimeExports.jsxs("div",{ref:r,children:[i&&j==="top"&&e.jsxRuntimeExports.jsx("div",{id:I,className:"proton-Input__text","aria-live":"polite",children:i}),e.jsxRuntimeExports.jsxs("div",{className:o.csx("proton-Input__container-inner",l&&"proton-Input__has-prefix",d&&"proton-Input__has-suffix"),children:[l&&e.jsxRuntimeExports.jsx("div",{ref:c,className:o.csx("proton-Input__descriptor","proton-Input__prefix"),children:l}),e.jsxRuntimeExports.jsx("input",{id:w,name:u,type:T,value:y,onChange:t=>{_==null||_(t.target.value)},onKeyDown:t=>{switch(t.key){case"Enter":b&&(t.preventDefault(),b(t));break;case"Escape":E&&(t.preventDefault(),E());break}},onCopy:async()=>{var t;return await F.copyTextToClipboard((t=N.current)==null?void 0:t.value)},disabled:v,readOnly:R,required:h,autoFocus:g,autoComplete:k?"on":"off",placeholder:x?void 0:P,"aria-label":x||u,"aria-invalid":!!n,"aria-errormessage":typeof n=="string"?n:m,"aria-required":h,"aria-readonly":R,"aria-describedby":n?m:i?I:void 0,"aria-disabled":v,"data-testid":z,ref:D,className:o.csx("proton-Input",n&&"proton-Input--error",x&&"proton-Input__label-top",B)}),e.jsxRuntimeExports.jsxs("label",{htmlFor:w,className:o.csx("proton-Input__label",y&&"proton-Input__label--filled"),children:[x,h&&e.jsxRuntimeExports.jsx("span",{"aria-hidden":"true",children:" *"})]}),d&&e.jsxRuntimeExports.jsx("div",{ref:p,className:o.csx("proton-Input__descriptor","proton-Input__suffix"),children:d})]}),n?e.jsxRuntimeExports.jsx("div",{role:"alert",className:o.csx("proton-Input__error","proton-Input__text"),id:m,children:n}):i&&j==="bottom"?e.jsxRuntimeExports.jsx("div",{id:I,className:"proton-Input__text","aria-live":"polite",children:i}):null]})});W.displayName="ProtonUIInput";exports.Input=W;
|
|
2
2
|
//# sourceMappingURL=Input.cjs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../node_modules/react/jsx-runtime.cjs.js"),c=require("react");;/* empty css */const E=require("../BaseInput/Input.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../node_modules/react/jsx-runtime.cjs.js"),c=require("react");;/* empty css */const E=require("../BaseInput/Input.cjs.js"),v=require("../../../utils/string.cjs.js"),S=({name:p="search",placeholder:a="Search...",autoComplete:o,isClearable:d=!0,isDisabled:h=!1,error:j,defaultValue:m,value:s,"data-testid":x="proton-SearchInput",onChange:r,onClear:i})=>{const u=c.useRef(null),[l,n]=c.useState(s??m??"");c.useEffect(()=>{s!==void 0&&n(s)},[s]);const f=e=>{n(e),r==null||r(e)},R=()=>{var e;n(""),r==null||r(""),i==null||i(),(e=u.current)==null||e.focus()};return t.jsxRuntimeExports.jsx("div",{className:"proton-SearchInput__wrapper","data-testid":x,role:"search",children:t.jsxRuntimeExports.jsx(E.Input,{type:"search",onChange:f,value:l,name:p,placeholder:a,autoComplete:o,error:j,ref:u,isDisabled:h,prefix:t.jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"2.8em",height:"1.6em",viewBox:"0 0 24 24",onClick:()=>{var e;return(e=u.current)==null?void 0:e.focus()},children:[t.jsxRuntimeExports.jsx("title",{children:"Magnifying Glass"}),t.jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M10.5 18.5a8 8 0 1 1 0-16 8 8 0 0 1 0 16Zm0-1a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm5.25-.75 4.5 4.5-1.25 1.25-4.5-4.5 1.25-1.25Z"})]}),suffix:d&&l.length>0?t.jsxRuntimeExports.jsx("button",{type:"button",className:v.csx("proton-SearchInput__button","proton-Input__descriptor","proton-Input__suffix"),"data-testid":`${x}-clear`,onClick:R,"aria-label":"Clear search",children:t.jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 50 50",width:"2.2em",height:"1.2em",children:[t.jsxRuntimeExports.jsx("title",{children:"Clear"}),t.jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"m37.304 11.282l1.414 1.414l-26.022 26.02l-1.414-1.413z"}),t.jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"m12.696 11.282l26.022 26.02l-1.414 1.415l-26.022-26.02z"})]})}):null})})};exports.SearchInput=S;
|
|
2
2
|
//# sourceMappingURL=SearchInput.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchInput.cjs.js","sources":["../../../../src/components/Input/SearchInput/SearchInput.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { useEffect, useRef, useState } from \"react\";\r\nimport \"./SearchInput.css\";\r\nimport { csx } from \"../../../utils\";\r\nimport { Input, type BaseInputProps } from \"../BaseInput/Input\";\r\n\r\nexport interface SearchInputProps\r\n extends Omit<\r\n BaseInputProps,\r\n | \"prefix\"\r\n | \"suffix\"\r\n | \"value\"\r\n | \"onChange\"\r\n | \"description\"\r\n | \"descriptionPosition\"\r\n | \"label\"\r\n > {\r\n /** The initial value of the input. */\r\n defaultValue?: string;\r\n\r\n /** Should the clear button be shown when there is text? */\r\n isClearable?: boolean;\r\n\r\n /** Called when the input value changes. */\r\n onChange?: (value: string) => void;\r\n\r\n /** Called when the clear button is clicked. */\r\n onClear?: () => void;\r\n\r\n /** The current value of the input (for controlled usage) */\r\n value?: string;\r\n}\r\n\r\n/**\r\n * A search input component with optional clear functionality and URL parameter sync.\r\n *\r\n * API:\r\n * - {@link SearchInputProps}\r\n * - extends {@link BaseInputProps}\r\n */\r\nexport const SearchInput = ({\r\n name = \"search\",\r\n placeholder = \"Search...\",\r\n autoComplete,\r\n isClearable = true,\r\n isDisabled = false,\r\n error,\r\n defaultValue,\r\n value: controlledValue,\r\n \"data-testid\": testId = \"proton-SearchInput\",\r\n onChange,\r\n onClear,\r\n}: SearchInputProps) => {\r\n const inputRef = useRef<HTMLInputElement>(null);\r\n const [value, setValue] = useState(controlledValue ?? defaultValue ?? \"\");\r\n\r\n // Sync with controlled value if provided\r\n useEffect(() => {\r\n if (controlledValue !== undefined) {\r\n setValue(controlledValue);\r\n }\r\n }, [controlledValue]);\r\n\r\n const handleChange = (newValue: string) => {\r\n setValue(newValue);\r\n onChange?.(newValue);\r\n };\r\n\r\n const handleClear = () => {\r\n setValue(\"\");\r\n onChange?.(\"\");\r\n onClear?.();\r\n inputRef.current?.focus();\r\n };\r\n\r\n return (\r\n <div\r\n className=\"proton-SearchInput__wrapper\"\r\n data-testid={testId}\r\n role=\"search\"\r\n >\r\n <Input\r\n type=\"search\"\r\n onChange={handleChange}\r\n value={value}\r\n name={name}\r\n placeholder={placeholder}\r\n autoComplete={autoComplete}\r\n error={error}\r\n ref={inputRef}\r\n isDisabled={isDisabled}\r\n prefix={\r\n <svg\r\n aria-hidden=\"true\"\r\n width=\"2.8em\"\r\n height=\"1.6em\"\r\n viewBox=\"0 0 24 24\"\r\n onClick={() => inputRef.current?.focus()}\r\n >\r\n <title>Magnifying Glass</title>\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M10.5 18.5a8 8 0 1 1 0-16 8 8 0 0 1 0 16Zm0-1a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm5.25-.75 4.5 4.5-1.25 1.25-4.5-4.5 1.25-1.25Z\"\r\n />\r\n </svg>\r\n }\r\n suffix={\r\n isClearable && value.length > 0 ? (\r\n <button\r\n type=\"button\"\r\n className={csx(\r\n \"proton-SearchInput__button\",\r\n \"proton-Input__descriptor\",\r\n \"proton-Input__suffix\"\r\n )}\r\n data-testid={`${testId}-clear`}\r\n onClick={handleClear}\r\n aria-label=\"Clear search\"\r\n >\r\n <svg\r\n aria-hidden=\"true\"\r\n viewBox=\"0 0 50 50\"\r\n width=\"
|
|
1
|
+
{"version":3,"file":"SearchInput.cjs.js","sources":["../../../../src/components/Input/SearchInput/SearchInput.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { useEffect, useRef, useState } from \"react\";\r\nimport \"./SearchInput.css\";\r\nimport { csx } from \"../../../utils\";\r\nimport { Input, type BaseInputProps } from \"../BaseInput/Input\";\r\n\r\nexport interface SearchInputProps\r\n extends Omit<\r\n BaseInputProps,\r\n | \"prefix\"\r\n | \"suffix\"\r\n | \"value\"\r\n | \"onChange\"\r\n | \"description\"\r\n | \"descriptionPosition\"\r\n | \"label\"\r\n > {\r\n /** The initial value of the input. */\r\n defaultValue?: string;\r\n\r\n /** Should the clear button be shown when there is text? */\r\n isClearable?: boolean;\r\n\r\n /** Called when the input value changes. */\r\n onChange?: (value: string) => void;\r\n\r\n /** Called when the clear button is clicked. */\r\n onClear?: () => void;\r\n\r\n /** The current value of the input (for controlled usage) */\r\n value?: string;\r\n}\r\n\r\n/**\r\n * A search input component with optional clear functionality and URL parameter sync.\r\n *\r\n * API:\r\n * - {@link SearchInputProps}\r\n * - extends {@link BaseInputProps}\r\n */\r\nexport const SearchInput = ({\r\n name = \"search\",\r\n placeholder = \"Search...\",\r\n autoComplete,\r\n isClearable = true,\r\n isDisabled = false,\r\n error,\r\n defaultValue,\r\n value: controlledValue,\r\n \"data-testid\": testId = \"proton-SearchInput\",\r\n onChange,\r\n onClear,\r\n}: SearchInputProps) => {\r\n const inputRef = useRef<HTMLInputElement>(null);\r\n const [value, setValue] = useState(controlledValue ?? defaultValue ?? \"\");\r\n\r\n // Sync with controlled value if provided\r\n useEffect(() => {\r\n if (controlledValue !== undefined) {\r\n setValue(controlledValue);\r\n }\r\n }, [controlledValue]);\r\n\r\n const handleChange = (newValue: string) => {\r\n setValue(newValue);\r\n onChange?.(newValue);\r\n };\r\n\r\n const handleClear = () => {\r\n setValue(\"\");\r\n onChange?.(\"\");\r\n onClear?.();\r\n inputRef.current?.focus();\r\n };\r\n\r\n return (\r\n <div\r\n className=\"proton-SearchInput__wrapper\"\r\n data-testid={testId}\r\n role=\"search\"\r\n >\r\n <Input\r\n type=\"search\"\r\n onChange={handleChange}\r\n value={value}\r\n name={name}\r\n placeholder={placeholder}\r\n autoComplete={autoComplete}\r\n error={error}\r\n ref={inputRef}\r\n isDisabled={isDisabled}\r\n prefix={\r\n <svg\r\n aria-hidden=\"true\"\r\n width=\"2.8em\"\r\n height=\"1.6em\"\r\n viewBox=\"0 0 24 24\"\r\n onClick={() => inputRef.current?.focus()}\r\n >\r\n <title>Magnifying Glass</title>\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M10.5 18.5a8 8 0 1 1 0-16 8 8 0 0 1 0 16Zm0-1a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm5.25-.75 4.5 4.5-1.25 1.25-4.5-4.5 1.25-1.25Z\"\r\n />\r\n </svg>\r\n }\r\n suffix={\r\n isClearable && value.length > 0 ? (\r\n <button\r\n type=\"button\"\r\n className={csx(\r\n \"proton-SearchInput__button\",\r\n \"proton-Input__descriptor\",\r\n \"proton-Input__suffix\"\r\n )}\r\n data-testid={`${testId}-clear`}\r\n onClick={handleClear}\r\n aria-label=\"Clear search\"\r\n >\r\n <svg\r\n aria-hidden=\"true\"\r\n viewBox=\"0 0 50 50\"\r\n width=\"2.2em\"\r\n height=\"1.2em\"\r\n >\r\n <title>Clear</title>\r\n <path\r\n fill=\"currentColor\"\r\n d=\"m37.304 11.282l1.414 1.414l-26.022 26.02l-1.414-1.413z\"\r\n />\r\n <path\r\n fill=\"currentColor\"\r\n d=\"m12.696 11.282l26.022 26.02l-1.414 1.415l-26.022-26.02z\"\r\n />\r\n </svg>\r\n </button>\r\n ) : null\r\n }\r\n />\r\n </div>\r\n );\r\n};\r\n"],"names":["SearchInput","name","placeholder","autoComplete","isClearable","isDisabled","error","defaultValue","controlledValue","testId","onChange","onClear","inputRef","useRef","value","setValue","useState","useEffect","handleChange","newValue","handleClear","_a","jsx","Input","jsxs","csx"],"mappings":"gSAyCaA,EAAc,CAAC,CAC1B,KAAAC,EAAO,SACP,YAAAC,EAAc,YACd,aAAAC,EACA,YAAAC,EAAc,GACd,WAAAC,EAAa,GACb,MAAAC,EACA,aAAAC,EACA,MAAOC,EACP,cAAeC,EAAS,qBACxB,SAAAC,EACA,QAAAC,CACF,IAAwB,CAChB,MAAAC,EAAWC,SAAyB,IAAI,EACxC,CAACC,EAAOC,CAAQ,EAAIC,EAAS,SAAAR,GAAmBD,GAAgB,EAAE,EAGxEU,EAAAA,UAAU,IAAM,CACVT,IAAoB,QACtBO,EAASP,CAAe,CAC1B,EACC,CAACA,CAAe,CAAC,EAEd,MAAAU,EAAgBC,GAAqB,CACzCJ,EAASI,CAAQ,EACjBT,GAAA,MAAAA,EAAWS,EAAQ,EAGfC,EAAc,IAAM,OACxBL,EAAS,EAAE,EACXL,GAAA,MAAAA,EAAW,IACDC,GAAA,MAAAA,KACVU,EAAAT,EAAS,UAAT,MAAAS,EAAkB,OAAM,EAIxB,OAAAC,EAAA,kBAAA,IAAC,MAAA,CACC,UAAU,8BACV,cAAab,EACb,KAAK,SAEL,SAAAa,EAAA,kBAAA,IAACC,EAAA,MAAA,CACC,KAAK,SACL,SAAUL,EACV,MAAAJ,EACA,KAAAb,EACA,YAAAC,EACA,aAAAC,EACA,MAAAG,EACA,IAAKM,EACL,WAAAP,EACA,OACEmB,EAAA,kBAAA,KAAC,MAAA,CACC,cAAY,OACZ,MAAM,QACN,OAAO,QACP,QAAQ,YACR,QAAS,IAAM,OAAA,OAAAH,EAAAT,EAAS,UAAT,YAAAS,EAAkB,SAEjC,SAAA,CAAAC,EAAAA,kBAAAA,IAAC,SAAM,SAAgB,kBAAA,CAAA,EACvBA,EAAA,kBAAA,IAAC,OAAA,CACC,KAAK,eACL,EAAE,4HAAA,CACJ,CAAA,CAAA,CACF,EAEF,OACElB,GAAeU,EAAM,OAAS,EAC5BQ,EAAA,kBAAA,IAAC,SAAA,CACC,KAAK,SACL,UAAWG,EAAA,IACT,6BACA,2BACA,sBACF,EACA,cAAa,GAAGhB,CAAM,SACtB,QAASW,EACT,aAAW,eAEX,SAAAI,EAAA,kBAAA,KAAC,MAAA,CACC,cAAY,OACZ,QAAQ,YACR,MAAM,QACN,OAAO,QAEP,SAAA,CAAAF,EAAAA,kBAAAA,IAAC,SAAM,SAAK,OAAA,CAAA,EACZA,EAAA,kBAAA,IAAC,OAAA,CACC,KAAK,eACL,EAAE,wDAAA,CACJ,EACAA,EAAA,kBAAA,IAAC,OAAA,CACC,KAAK,eACL,EAAE,yDAAA,CACJ,CAAA,CAAA,CACF,CAAA,CAAA,EAEA,IAAA,CAER,CAAA,CAAA,CAGN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchInput.es.js","sources":["../../../../src/components/Input/SearchInput/SearchInput.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { useEffect, useRef, useState } from \"react\";\r\nimport \"./SearchInput.css\";\r\nimport { csx } from \"../../../utils\";\r\nimport { Input, type BaseInputProps } from \"../BaseInput/Input\";\r\n\r\nexport interface SearchInputProps\r\n extends Omit<\r\n BaseInputProps,\r\n | \"prefix\"\r\n | \"suffix\"\r\n | \"value\"\r\n | \"onChange\"\r\n | \"description\"\r\n | \"descriptionPosition\"\r\n | \"label\"\r\n > {\r\n /** The initial value of the input. */\r\n defaultValue?: string;\r\n\r\n /** Should the clear button be shown when there is text? */\r\n isClearable?: boolean;\r\n\r\n /** Called when the input value changes. */\r\n onChange?: (value: string) => void;\r\n\r\n /** Called when the clear button is clicked. */\r\n onClear?: () => void;\r\n\r\n /** The current value of the input (for controlled usage) */\r\n value?: string;\r\n}\r\n\r\n/**\r\n * A search input component with optional clear functionality and URL parameter sync.\r\n *\r\n * API:\r\n * - {@link SearchInputProps}\r\n * - extends {@link BaseInputProps}\r\n */\r\nexport const SearchInput = ({\r\n name = \"search\",\r\n placeholder = \"Search...\",\r\n autoComplete,\r\n isClearable = true,\r\n isDisabled = false,\r\n error,\r\n defaultValue,\r\n value: controlledValue,\r\n \"data-testid\": testId = \"proton-SearchInput\",\r\n onChange,\r\n onClear,\r\n}: SearchInputProps) => {\r\n const inputRef = useRef<HTMLInputElement>(null);\r\n const [value, setValue] = useState(controlledValue ?? defaultValue ?? \"\");\r\n\r\n // Sync with controlled value if provided\r\n useEffect(() => {\r\n if (controlledValue !== undefined) {\r\n setValue(controlledValue);\r\n }\r\n }, [controlledValue]);\r\n\r\n const handleChange = (newValue: string) => {\r\n setValue(newValue);\r\n onChange?.(newValue);\r\n };\r\n\r\n const handleClear = () => {\r\n setValue(\"\");\r\n onChange?.(\"\");\r\n onClear?.();\r\n inputRef.current?.focus();\r\n };\r\n\r\n return (\r\n <div\r\n className=\"proton-SearchInput__wrapper\"\r\n data-testid={testId}\r\n role=\"search\"\r\n >\r\n <Input\r\n type=\"search\"\r\n onChange={handleChange}\r\n value={value}\r\n name={name}\r\n placeholder={placeholder}\r\n autoComplete={autoComplete}\r\n error={error}\r\n ref={inputRef}\r\n isDisabled={isDisabled}\r\n prefix={\r\n <svg\r\n aria-hidden=\"true\"\r\n width=\"2.8em\"\r\n height=\"1.6em\"\r\n viewBox=\"0 0 24 24\"\r\n onClick={() => inputRef.current?.focus()}\r\n >\r\n <title>Magnifying Glass</title>\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M10.5 18.5a8 8 0 1 1 0-16 8 8 0 0 1 0 16Zm0-1a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm5.25-.75 4.5 4.5-1.25 1.25-4.5-4.5 1.25-1.25Z\"\r\n />\r\n </svg>\r\n }\r\n suffix={\r\n isClearable && value.length > 0 ? (\r\n <button\r\n type=\"button\"\r\n className={csx(\r\n \"proton-SearchInput__button\",\r\n \"proton-Input__descriptor\",\r\n \"proton-Input__suffix\"\r\n )}\r\n data-testid={`${testId}-clear`}\r\n onClick={handleClear}\r\n aria-label=\"Clear search\"\r\n >\r\n <svg\r\n aria-hidden=\"true\"\r\n viewBox=\"0 0 50 50\"\r\n width=\"
|
|
1
|
+
{"version":3,"file":"SearchInput.es.js","sources":["../../../../src/components/Input/SearchInput/SearchInput.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { useEffect, useRef, useState } from \"react\";\r\nimport \"./SearchInput.css\";\r\nimport { csx } from \"../../../utils\";\r\nimport { Input, type BaseInputProps } from \"../BaseInput/Input\";\r\n\r\nexport interface SearchInputProps\r\n extends Omit<\r\n BaseInputProps,\r\n | \"prefix\"\r\n | \"suffix\"\r\n | \"value\"\r\n | \"onChange\"\r\n | \"description\"\r\n | \"descriptionPosition\"\r\n | \"label\"\r\n > {\r\n /** The initial value of the input. */\r\n defaultValue?: string;\r\n\r\n /** Should the clear button be shown when there is text? */\r\n isClearable?: boolean;\r\n\r\n /** Called when the input value changes. */\r\n onChange?: (value: string) => void;\r\n\r\n /** Called when the clear button is clicked. */\r\n onClear?: () => void;\r\n\r\n /** The current value of the input (for controlled usage) */\r\n value?: string;\r\n}\r\n\r\n/**\r\n * A search input component with optional clear functionality and URL parameter sync.\r\n *\r\n * API:\r\n * - {@link SearchInputProps}\r\n * - extends {@link BaseInputProps}\r\n */\r\nexport const SearchInput = ({\r\n name = \"search\",\r\n placeholder = \"Search...\",\r\n autoComplete,\r\n isClearable = true,\r\n isDisabled = false,\r\n error,\r\n defaultValue,\r\n value: controlledValue,\r\n \"data-testid\": testId = \"proton-SearchInput\",\r\n onChange,\r\n onClear,\r\n}: SearchInputProps) => {\r\n const inputRef = useRef<HTMLInputElement>(null);\r\n const [value, setValue] = useState(controlledValue ?? defaultValue ?? \"\");\r\n\r\n // Sync with controlled value if provided\r\n useEffect(() => {\r\n if (controlledValue !== undefined) {\r\n setValue(controlledValue);\r\n }\r\n }, [controlledValue]);\r\n\r\n const handleChange = (newValue: string) => {\r\n setValue(newValue);\r\n onChange?.(newValue);\r\n };\r\n\r\n const handleClear = () => {\r\n setValue(\"\");\r\n onChange?.(\"\");\r\n onClear?.();\r\n inputRef.current?.focus();\r\n };\r\n\r\n return (\r\n <div\r\n className=\"proton-SearchInput__wrapper\"\r\n data-testid={testId}\r\n role=\"search\"\r\n >\r\n <Input\r\n type=\"search\"\r\n onChange={handleChange}\r\n value={value}\r\n name={name}\r\n placeholder={placeholder}\r\n autoComplete={autoComplete}\r\n error={error}\r\n ref={inputRef}\r\n isDisabled={isDisabled}\r\n prefix={\r\n <svg\r\n aria-hidden=\"true\"\r\n width=\"2.8em\"\r\n height=\"1.6em\"\r\n viewBox=\"0 0 24 24\"\r\n onClick={() => inputRef.current?.focus()}\r\n >\r\n <title>Magnifying Glass</title>\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M10.5 18.5a8 8 0 1 1 0-16 8 8 0 0 1 0 16Zm0-1a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm5.25-.75 4.5 4.5-1.25 1.25-4.5-4.5 1.25-1.25Z\"\r\n />\r\n </svg>\r\n }\r\n suffix={\r\n isClearable && value.length > 0 ? (\r\n <button\r\n type=\"button\"\r\n className={csx(\r\n \"proton-SearchInput__button\",\r\n \"proton-Input__descriptor\",\r\n \"proton-Input__suffix\"\r\n )}\r\n data-testid={`${testId}-clear`}\r\n onClick={handleClear}\r\n aria-label=\"Clear search\"\r\n >\r\n <svg\r\n aria-hidden=\"true\"\r\n viewBox=\"0 0 50 50\"\r\n width=\"2.2em\"\r\n height=\"1.2em\"\r\n >\r\n <title>Clear</title>\r\n <path\r\n fill=\"currentColor\"\r\n d=\"m37.304 11.282l1.414 1.414l-26.022 26.02l-1.414-1.413z\"\r\n />\r\n <path\r\n fill=\"currentColor\"\r\n d=\"m12.696 11.282l26.022 26.02l-1.414 1.415l-26.022-26.02z\"\r\n />\r\n </svg>\r\n </button>\r\n ) : null\r\n }\r\n />\r\n </div>\r\n );\r\n};\r\n"],"names":["SearchInput","name","placeholder","autoComplete","isClearable","isDisabled","error","defaultValue","controlledValue","testId","onChange","onClear","inputRef","useRef","value","setValue","useState","useEffect","handleChange","newValue","handleClear","_a","jsx","Input","jsxs","csx"],"mappings":";;;;;AAyCO,MAAMA,IAAc,CAAC;AAAA,EAC1B,MAAAC,IAAO;AAAA,EACP,aAAAC,IAAc;AAAA,EACd,cAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,YAAAC,IAAa;AAAA,EACb,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,OAAOC;AAAA,EACP,eAAeC,IAAS;AAAA,EACxB,UAAAC;AAAA,EACA,SAAAC;AACF,MAAwB;AAChB,QAAAC,IAAWC,EAAyB,IAAI,GACxC,CAACC,GAAOC,CAAQ,IAAIC,EAASR,KAAmBD,KAAgB,EAAE;AAGxE,EAAAU,EAAU,MAAM;AACd,IAAIT,MAAoB,UACtBO,EAASP,CAAe;AAAA,EAC1B,GACC,CAACA,CAAe,CAAC;AAEd,QAAAU,IAAe,CAACC,MAAqB;AACzC,IAAAJ,EAASI,CAAQ,GACjBT,KAAA,QAAAA,EAAWS;AAAA,EAAQ,GAGfC,IAAc,MAAM;;AACxB,IAAAL,EAAS,EAAE,GACXL,KAAA,QAAAA,EAAW,KACDC,KAAA,QAAAA,MACVU,IAAAT,EAAS,YAAT,QAAAS,EAAkB;AAAA,EAAM;AAIxB,SAAAC,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,eAAab;AAAA,MACb,MAAK;AAAA,MAEL,UAAAa,gBAAAA,EAAA;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,UAAUL;AAAA,UACV,OAAAJ;AAAA,UACA,MAAAb;AAAA,UACA,aAAAC;AAAA,UACA,cAAAC;AAAA,UACA,OAAAG;AAAA,UACA,KAAKM;AAAA,UACL,YAAAP;AAAA,UACA,QACEmB,gBAAAA,EAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,eAAY;AAAA,cACZ,OAAM;AAAA,cACN,QAAO;AAAA,cACP,SAAQ;AAAA,cACR,SAAS,MAAM;;AAAA,wBAAAH,IAAAT,EAAS,YAAT,gBAAAS,EAAkB;AAAA;AAAA,cAEjC,UAAA;AAAA,gBAAAC,gBAAAA,EAAAA,IAAC,WAAM,UAAgB,mBAAA,CAAA;AAAA,gBACvBA,gBAAAA,EAAA;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,MAAK;AAAA,oBACL,GAAE;AAAA,kBAAA;AAAA,gBACJ;AAAA,cAAA;AAAA,YAAA;AAAA,UACF;AAAA,UAEF,QACElB,KAAeU,EAAM,SAAS,IAC5BQ,gBAAAA,EAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,WAAWG;AAAA,gBACT;AAAA,gBACA;AAAA,gBACA;AAAA,cACF;AAAA,cACA,eAAa,GAAGhB,CAAM;AAAA,cACtB,SAASW;AAAA,cACT,cAAW;AAAA,cAEX,UAAAI,gBAAAA,EAAA;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,eAAY;AAAA,kBACZ,SAAQ;AAAA,kBACR,OAAM;AAAA,kBACN,QAAO;AAAA,kBAEP,UAAA;AAAA,oBAAAF,gBAAAA,EAAAA,IAAC,WAAM,UAAK,QAAA,CAAA;AAAA,oBACZA,gBAAAA,EAAA;AAAA,sBAAC;AAAA,sBAAA;AAAA,wBACC,MAAK;AAAA,wBACL,GAAE;AAAA,sBAAA;AAAA,oBACJ;AAAA,oBACAA,gBAAAA,EAAA;AAAA,sBAAC;AAAA,sBAAA;AAAA,wBACC,MAAK;AAAA,wBACL,GAAE;AAAA,sBAAA;AAAA,oBACJ;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,UAAA,IAEA;AAAA,QAAA;AAAA,MAER;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../node_modules/react/jsx-runtime.cjs.js"),c=require("react"),q=require("../../hooks/useBreakpoint.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../node_modules/react/jsx-runtime.cjs.js"),c=require("react"),q=require("../../hooks/useBreakpoint.cjs.js"),v=require("../ActionMenu/ActionMenu.cjs.js"),B=require("./PopoverMenu.cjs.js");;/* empty css */;/* empty css */const T=require("../../constants/breakpoint.cjs.js");function b({renderTrigger:r,size:f=24,title:x,items:p,disabled:a,onClose:i,triggerTestId:R="MenuTrigger-Trigger",menuTestId:E,onSelectionChange:o,selectedKey:u,disabledKeys:g}){const d=q.useBreakpoint(T.BREAKPOINTS.SMALL),[s,n]=c.useState(!1),h=c.useRef(null),m=c.useMemo(()=>p.map(t=>({...t,id:t.key})),[p]),j=t=>{o==null||o(t),n(!1)},l=r?r({isOpen:s,disabled:a,setIsOpen:n}):e.jsxRuntimeExports.jsx("button",{"data-testid":R,disabled:a,className:"proton-MenuTrigger__button",ref:h,onClick:()=>n(!s),type:"button",children:e.jsxRuntimeExports.jsx(k,{size:f})});return d?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[l,s&&e.jsxRuntimeExports.jsx(v.ActionMenu,{actions:m,title:x,isOpen:s,onClose:()=>{n(!1),i==null||i()},showCancel:!0,"data-testid":E,selectionMode:"single",onSelectionChange:t=>{const M=Array.from(t)[0];M&&j(M)},selectedKeys:u?[u]:void 0,disabledKeys:g})]}):e.jsxRuntimeExports.jsx(B.PopoverMenu,{trigger:l,items:m,isOpen:s,onOpenChange:n,selectedKey:u,onSelectionChange:j,disabledKeys:g,title:x})}const k=({size:r})=>e.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",width:r,height:r,children:e.jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M4 14c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm8 0c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm8 0c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"})});exports.MenuTrigger=b;
|
|
2
2
|
//# sourceMappingURL=MenuTrigger.cjs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../node_modules/react/jsx-runtime.cjs.js"),E=require("../../node_modules/@react-aria/button/dist/useButton.cjs.js"),q=require("../../node_modules/@react-aria/dialog/dist/useDialog.cjs.js"),m=require("../../node_modules/@react-aria/focus/dist/FocusScope.cjs.js"),v=require("@react-aria/utils"),S=require("../../node_modules/@react-aria/overlays/dist/usePreventScroll.cjs.js"),_=require("../../node_modules/@react-aria/overlays/dist/useModalOverlay.cjs.js"),j=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../node_modules/react/jsx-runtime.cjs.js"),E=require("../../node_modules/@react-aria/button/dist/useButton.cjs.js"),q=require("../../node_modules/@react-aria/dialog/dist/useDialog.cjs.js"),m=require("../../node_modules/@react-aria/focus/dist/FocusScope.cjs.js"),v=require("@react-aria/utils"),S=require("../../node_modules/@react-aria/overlays/dist/usePreventScroll.cjs.js"),_=require("../../node_modules/@react-aria/overlays/dist/useModalOverlay.cjs.js"),j=require("react"),h=require("../../node_modules/@react-stately/overlays/dist/useOverlayTriggerState.cjs.js"),b=require("../../hooks/useIsClosing.cjs.js"),f=require("../Button/Button.cjs.js");;/* empty css */const B=require("../ScreenOverlay/ScreenOverlay.cjs.js"),y=require("../../hooks/useBreakpoint.cjs.js"),C=require("../../constants/breakpoint.cjs.js"),O=require("../../utils/string.cjs.js"),M=({children:s})=>e.jsxRuntimeExports.jsx("h2",{className:"proton-Modal__title",children:s}),R=({children:s})=>e.jsxRuntimeExports.jsx("h3",{className:"proton-Modal__subtitle",children:s}),g=({children:s})=>e.jsxRuntimeExports.jsx("div",{className:"proton-Modal__body",children:s}),P=s=>e.jsxRuntimeExports.jsx("div",{className:"proton-Modal__action",children:e.jsxRuntimeExports.jsx(f.Button,{...s})}),N=({children:s})=>e.jsxRuntimeExports.jsx(m.FocusScope,{autoFocus:!0,children:e.jsxRuntimeExports.jsx("div",{className:"proton-Modal__actions",children:s})}),F=({title:s,subtitle:o,body:r,onClose:n,children:c,isClosing:d,"data-testid":x})=>{const t=j.useRef(null),u=h.useOverlayTriggerState({isOpen:!0,onOpenChange:n}),{modalProps:p}=_.useModalOverlay({isDismissable:!1},u,t),{dialogProps:i}=q.useDialog({role:"dialog"},t);S.usePreventScroll();const l=j.useRef(null),{buttonProps:a}=E.useButton({onPress:n,"aria-label":"Close"},l);return e.jsxRuntimeExports.jsx(m.FocusScope,{contain:!0,restoreFocus:!0,autoFocus:!0,children:e.jsxRuntimeExports.jsxs("div",{"data-testid":x,className:O.csx("proton-Modal",d&&"proton-Modal--closing"),...v.mergeProps(p,i),ref:t,children:[e.jsxRuntimeExports.jsx("button",{name:"Close",className:"proton-Modal__close-button",...a,ref:l,children:"×"}),s&&e.jsxRuntimeExports.jsx(M,{children:s}),o&&e.jsxRuntimeExports.jsx(R,{children:o}),r&&e.jsxRuntimeExports.jsx(g,{children:r}),e.jsxRuntimeExports.jsx("div",{className:"proton-Modal__content",children:c})]})})},T=({isOpen:s,onClose:o,title:r,subtitle:n,body:c,children:d,isOverlay:x=!0,"data-testid":t})=>{const u=j.useRef(null),{isClosing:p,handleClose:i}=b.useIsClosing({onClose:o,overlayRef:u}),l=y.useBreakpoint(C.BREAKPOINTS.MEDIUM);if(!s)return null;const a=e.jsxRuntimeExports.jsx(F,{isOpen:s,title:r,subtitle:n,body:c,onClose:i,isClosing:p,"data-testid":t,children:d});return x||l?e.jsxRuntimeExports.jsx(B.ScreenOverlay,{fadeIn:!0,ref:u,onClose:i,children:a}):a},A=Object.assign(T,{Title:M,Subtitle:R,Body:g,Action:P,Actions:N});exports.Modal=A;
|
|
2
2
|
//# sourceMappingURL=Modal.cjs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../node_modules/react/jsx-runtime.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../node_modules/react/jsx-runtime.cjs.js"),r=require("react"),a=require("../../node_modules/@react-aria/switch/dist/useSwitch.cjs.js"),d=require("../../node_modules/@react-aria/visually-hidden/dist/VisuallyHidden.cjs.js"),c=require("../../node_modules/@react-stately/toggle/dist/useToggleState.cjs.js");;/* empty css */const o=require("../../utils/string.cjs.js");function u(e){let s={...e,isSelected:e.isOn,"data-testid":void 0},l=r.useRef(null),i=c.useToggleState(s),{inputProps:n}=a.useSwitch(s,i,l);return t.jsxRuntimeExports.jsxs("label",{className:o.csx("proton-Switch",e.isDisabled&&"proton-Switch--disabled",i.isSelected&&"proton-Switch--on"),"data-on":i.isSelected||void 0,"data-disabled":e.isDisabled||void 0,"data-testid":e["data-testid"]||void 0,"aria-label":e.label||void 0,children:[t.jsxRuntimeExports.jsx(d.VisuallyHidden,{children:t.jsxRuntimeExports.jsx("input",{...n,ref:l})}),e.label&&t.jsxRuntimeExports.jsx("div",{className:"proton-Switch__label",children:e.label}),t.jsxRuntimeExports.jsxs("div",{className:"proton-Switch__wrapper",children:[t.jsxRuntimeExports.jsx("div",{className:"proton-Switch__toggle",children:t.jsxRuntimeExports.jsx("div",{className:"proton-Switch__slider"})}),e.children&&t.jsxRuntimeExports.jsx("div",{className:"proton-Switch__description",children:e.children})]})]})}exports.Switch=u;
|
|
2
2
|
//# sourceMappingURL=Switch.cjs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),t=require("./CompoundComponents.cjs.js");function i(a,o){return a.type===o}function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),t=require("./CompoundComponents.cjs.js");function i(a,o){return a.type===o}function b(a){const o=[],c=[];return n.Children.forEach(a,s=>{if(n.isValidElement(s)){if(i(s,t.TableHeader)){const l=s.props;n.Children.forEach(l.children,e=>{if(n.isValidElement(e)&&i(e,t.TableColumn)){const r=e.props;o.push({key:r.id,header:r.children,isHidden:l.isHidden||!1,ariaSort:r["aria-sort"]})}})}if(i(s,t.TableBody)){const l=s.props;n.Children.forEach(l.children,e=>{if(n.isValidElement(e)&&i(e,t.TableRow)){const r=e.props,u=[];let f=0;n.Children.forEach(r.children,p=>{var y;if(n.isValidElement(p)&&i(p,t.TableCell)){const d=p.props,m=d.columnKey||((y=o[f])==null?void 0:y.key);m&&u.push({columnKey:m,value:d.children,colSpan:d.colSpan}),f++}}),c.push({key:e.key||r.key||String(c.length),cells:u,onClick:r.onClick})}})}}}),{columns:o,rows:c}}exports.parseTableChildren=b;
|
|
2
2
|
//# sourceMappingURL=collectionParser.cjs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react");function b(e){var c;const r=n.useMemo(()=>{const o=new Map;return e.rows.forEach((s,y)=>{o.set(s.key,y)}),o},[e.rows]),i=n.useMemo(()=>o=>{const s=r.get(o);return s===void 0?null:e.rows[s]},[e.rows,r]),m=n.useMemo(()=>o=>{const s=r.get(o);return s===void 0||s>=e.rows.length-1?null:e.rows[s+1]},[e.rows,r]),w=n.useMemo(()=>o=>{const s=r.get(o);return s===void 0||s<=0?null:e.rows[s-1]},[e.rows,r]),g=n.useMemo(()=>o=>r.get(o)??-1,[r]),M=n.useMemo(()=>e.rows[0]||null,[e.rows]),f=n.useMemo(()=>e.rows[e.rows.length-1]||null,[e.rows]),u=e.rows.length,l=((c=e.columns[0])==null?void 0:c.isHidden)||!1,t=!l,I=n.useMemo(()=>u+(t?1:0),[u,t]),x=n.useMemo(()=>o=>o+(t?2:1),[t]);return{columns:e.columns,rows:e.rows,size:u,firstItem:M,lastItem:f,isHeaderHidden:l,hasVisibleHeader:t,getTotalRowCount:I,getRowAriaIndex:x,getItemByKey:i,getItemAfter:m,getItemBefore:w,getItemIndex:g}}exports.useTableCollection=b;
|
|
2
2
|
//# sourceMappingURL=useTableCollection.cjs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../node_modules/react/jsx-runtime.cjs.js");;/* empty css */const m=require("../../ThemeProvider.cjs.js"),u=require("../../Tooltip/Tooltip.cjs.js"),x=require("../../../utils/navigation.cjs.js"),c=require("../../../utils/string.cjs.js"),p=({to:e,children:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../node_modules/react/jsx-runtime.cjs.js");;/* empty css */const m=require("../../ThemeProvider.cjs.js"),u=require("../../Tooltip/Tooltip.cjs.js"),x=require("../../../utils/navigation.cjs.js"),c=require("../../../utils/string.cjs.js"),p=({to:e,children:r,tooltipProps:s,"data-testid":i})=>{const{className:a}=m.useTheme(),o=s?t.jsxRuntimeExports.jsx(u.Tooltip,{delay:50,...s,children:r}):r;if(e){const n=x.isUrlExternal(e);return t.jsxRuntimeExports.jsx("span",{className:c.csx("proton-TextEmphasis",s&&"proton-TextEmphasis--tooltip",a),children:t.jsxRuntimeExports.jsx("a",{"data-testid":i,href:e,target:n?"_blank":void 0,rel:n?"noopener noreferrer":void 0,onClick:n?void 0:l=>x.handleInternalNavigation(l,e),children:o})})}return t.jsxRuntimeExports.jsx("span",{className:c.csx("proton-TextEmphasis",s&&"proton-TextEmphasis--tooltip",a),"data-testid":i,children:o})};exports.TextEmphasis=p;
|
|
2
2
|
//# sourceMappingURL=TextEmphasis.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextEmphasis.cjs.js","sources":["../../../../src/components/Text/TextEmphasis/TextEmphasis.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { ReactNode } from \"react\";\r\nimport \"./TextEmphasis.css\";\r\n\r\nimport { csx } from \"../../../utils\";\r\nimport { useTheme } from \"../../ThemeProvider\";\r\nimport {
|
|
1
|
+
{"version":3,"file":"TextEmphasis.cjs.js","sources":["../../../../src/components/Text/TextEmphasis/TextEmphasis.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { ReactNode } from \"react\";\r\nimport \"./TextEmphasis.css\";\r\n\r\nimport { csx } from \"../../../utils\";\r\nimport { useTheme } from \"../../ThemeProvider\";\r\nimport { Tooltip, TooltipProps } from \"../../Tooltip/Tooltip\";\r\nimport {\r\n handleInternalNavigation,\r\n isUrlExternal,\r\n} from \"../../../utils/navigation\";\r\n\r\ninterface TextEmphasisProps {\r\n /**\r\n * The URL that the text emphasis should link to. Turns the element into an `a` tag.\r\n */\r\n to?: string;\r\n /**\r\n * The content to display within the text emphasis.\r\n */\r\n children: ReactNode;\r\n /**\r\n * Props to pass to the tooltip trigger. When provided, the text emphasis will be wrapped in a tooltip trigger.\r\n */\r\n tooltipProps?: Omit<TooltipProps, \"children\">;\r\n /**\r\n * A test ID.\r\n */\r\n \"data-testid\"?: string;\r\n}\r\n\r\n/**\r\n * A component that displays text with emphasis. Provide tooltipProps to wrap the text in a tooltip trigger.\r\n *\r\n * API:\r\n * - {@link TextEmphasisProps}\r\n */\r\nexport const TextEmphasis = ({\r\n to,\r\n children,\r\n tooltipProps,\r\n \"data-testid\": testId,\r\n}: TextEmphasisProps) => {\r\n const { className: themeClassName } = useTheme();\r\n\r\n const content = tooltipProps ? (\r\n <Tooltip delay={50} {...tooltipProps}>\r\n {children}\r\n </Tooltip>\r\n ) : (\r\n children\r\n );\r\n\r\n if (to) {\r\n const isExternal = isUrlExternal(to);\r\n return (\r\n <span\r\n className={csx(\r\n \"proton-TextEmphasis\",\r\n tooltipProps && \"proton-TextEmphasis--tooltip\",\r\n themeClassName\r\n )}\r\n >\r\n <a\r\n data-testid={testId}\r\n href={to}\r\n target={isExternal ? \"_blank\" : undefined}\r\n rel={isExternal ? \"noopener noreferrer\" : undefined}\r\n onClick={\r\n !isExternal ? (e) => handleInternalNavigation(e, to) : undefined\r\n }\r\n >\r\n {content}\r\n </a>\r\n </span>\r\n );\r\n }\r\n\r\n return (\r\n <span\r\n className={csx(\r\n \"proton-TextEmphasis\",\r\n tooltipProps && \"proton-TextEmphasis--tooltip\",\r\n themeClassName\r\n )}\r\n data-testid={testId}\r\n >\r\n {content}\r\n </span>\r\n );\r\n};\r\n"],"names":["TextEmphasis","to","children","tooltipProps","testId","themeClassName","useTheme","content","jsx","Tooltip","isExternal","isUrlExternal","csx","e","handleInternalNavigation"],"mappings":"uWAsCaA,EAAe,CAAC,CAC3B,GAAAC,EACA,SAAAC,EACA,aAAAC,EACA,cAAeC,CACjB,IAAyB,CACvB,KAAM,CAAE,UAAWC,CAAe,EAAIC,EAAS,SAAA,EAEzCC,EAAUJ,EACbK,EAAA,kBAAA,IAAAC,EAAA,QAAA,CAAQ,MAAO,GAAK,GAAGN,EACrB,SAAAD,CACH,CAAA,EAEAA,EAGF,GAAID,EAAI,CACA,MAAAS,EAAaC,gBAAcV,CAAE,EAEjC,OAAAO,EAAA,kBAAA,IAAC,OAAA,CACC,UAAWI,EAAA,IACT,sBACAT,GAAgB,+BAChBE,CACF,EAEA,SAAAG,EAAA,kBAAA,IAAC,IAAA,CACC,cAAaJ,EACb,KAAMH,EACN,OAAQS,EAAa,SAAW,OAChC,IAAKA,EAAa,sBAAwB,OAC1C,QACGA,EAAsD,OAAxCG,GAAMC,EAAyB,yBAAAD,EAAGZ,CAAE,EAGpD,SAAAM,CAAA,CACH,CAAA,CAAA,CAGN,CAGE,OAAAC,EAAA,kBAAA,IAAC,OAAA,CACC,UAAWI,EAAA,IACT,sBACAT,GAAgB,+BAChBE,CACF,EACA,cAAaD,EAEZ,SAAAG,CAAA,CAAA,CAGP"}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { j as s } from "../../../node_modules/react/jsx-runtime.es.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import { useTheme as
|
|
4
|
-
import {
|
|
3
|
+
import { useTheme as l } from "../../ThemeProvider.es.js";
|
|
4
|
+
import { Tooltip as x } from "../../Tooltip/Tooltip.es.js";
|
|
5
5
|
import { isUrlExternal as c, handleInternalNavigation as d } from "../../../utils/navigation.es.js";
|
|
6
6
|
import { csx as m } from "../../../utils/string.es.js";
|
|
7
|
-
const
|
|
7
|
+
const u = ({
|
|
8
8
|
to: e,
|
|
9
|
-
children:
|
|
9
|
+
children: r,
|
|
10
10
|
tooltipProps: t,
|
|
11
|
-
"data-testid":
|
|
11
|
+
"data-testid": n
|
|
12
12
|
}) => {
|
|
13
|
-
const { className:
|
|
13
|
+
const { className: o } = l(), i = t ? /* @__PURE__ */ s.jsx(x, { delay: 50, ...t, children: r }) : r;
|
|
14
14
|
if (e) {
|
|
15
|
-
const
|
|
15
|
+
const a = c(e);
|
|
16
16
|
return /* @__PURE__ */ s.jsx(
|
|
17
17
|
"span",
|
|
18
18
|
{
|
|
19
19
|
className: m(
|
|
20
20
|
"proton-TextEmphasis",
|
|
21
21
|
t && "proton-TextEmphasis--tooltip",
|
|
22
|
-
|
|
22
|
+
o
|
|
23
23
|
),
|
|
24
24
|
children: /* @__PURE__ */ s.jsx(
|
|
25
25
|
"a",
|
|
26
26
|
{
|
|
27
|
-
"data-testid":
|
|
27
|
+
"data-testid": n,
|
|
28
28
|
href: e,
|
|
29
|
-
target:
|
|
30
|
-
rel:
|
|
31
|
-
onClick:
|
|
29
|
+
target: a ? "_blank" : void 0,
|
|
30
|
+
rel: a ? "noopener noreferrer" : void 0,
|
|
31
|
+
onClick: a ? void 0 : (p) => d(p, e),
|
|
32
32
|
children: i
|
|
33
33
|
}
|
|
34
34
|
)
|
|
@@ -41,14 +41,14 @@ const g = ({
|
|
|
41
41
|
className: m(
|
|
42
42
|
"proton-TextEmphasis",
|
|
43
43
|
t && "proton-TextEmphasis--tooltip",
|
|
44
|
-
|
|
44
|
+
o
|
|
45
45
|
),
|
|
46
|
-
"data-testid":
|
|
46
|
+
"data-testid": n,
|
|
47
47
|
children: i
|
|
48
48
|
}
|
|
49
49
|
);
|
|
50
50
|
};
|
|
51
51
|
export {
|
|
52
|
-
|
|
52
|
+
u as TextEmphasis
|
|
53
53
|
};
|
|
54
54
|
//# sourceMappingURL=TextEmphasis.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextEmphasis.es.js","sources":["../../../../src/components/Text/TextEmphasis/TextEmphasis.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { ReactNode } from \"react\";\r\nimport \"./TextEmphasis.css\";\r\n\r\nimport { csx } from \"../../../utils\";\r\nimport { useTheme } from \"../../ThemeProvider\";\r\nimport {
|
|
1
|
+
{"version":3,"file":"TextEmphasis.es.js","sources":["../../../../src/components/Text/TextEmphasis/TextEmphasis.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { ReactNode } from \"react\";\r\nimport \"./TextEmphasis.css\";\r\n\r\nimport { csx } from \"../../../utils\";\r\nimport { useTheme } from \"../../ThemeProvider\";\r\nimport { Tooltip, TooltipProps } from \"../../Tooltip/Tooltip\";\r\nimport {\r\n handleInternalNavigation,\r\n isUrlExternal,\r\n} from \"../../../utils/navigation\";\r\n\r\ninterface TextEmphasisProps {\r\n /**\r\n * The URL that the text emphasis should link to. Turns the element into an `a` tag.\r\n */\r\n to?: string;\r\n /**\r\n * The content to display within the text emphasis.\r\n */\r\n children: ReactNode;\r\n /**\r\n * Props to pass to the tooltip trigger. When provided, the text emphasis will be wrapped in a tooltip trigger.\r\n */\r\n tooltipProps?: Omit<TooltipProps, \"children\">;\r\n /**\r\n * A test ID.\r\n */\r\n \"data-testid\"?: string;\r\n}\r\n\r\n/**\r\n * A component that displays text with emphasis. Provide tooltipProps to wrap the text in a tooltip trigger.\r\n *\r\n * API:\r\n * - {@link TextEmphasisProps}\r\n */\r\nexport const TextEmphasis = ({\r\n to,\r\n children,\r\n tooltipProps,\r\n \"data-testid\": testId,\r\n}: TextEmphasisProps) => {\r\n const { className: themeClassName } = useTheme();\r\n\r\n const content = tooltipProps ? (\r\n <Tooltip delay={50} {...tooltipProps}>\r\n {children}\r\n </Tooltip>\r\n ) : (\r\n children\r\n );\r\n\r\n if (to) {\r\n const isExternal = isUrlExternal(to);\r\n return (\r\n <span\r\n className={csx(\r\n \"proton-TextEmphasis\",\r\n tooltipProps && \"proton-TextEmphasis--tooltip\",\r\n themeClassName\r\n )}\r\n >\r\n <a\r\n data-testid={testId}\r\n href={to}\r\n target={isExternal ? \"_blank\" : undefined}\r\n rel={isExternal ? \"noopener noreferrer\" : undefined}\r\n onClick={\r\n !isExternal ? (e) => handleInternalNavigation(e, to) : undefined\r\n }\r\n >\r\n {content}\r\n </a>\r\n </span>\r\n );\r\n }\r\n\r\n return (\r\n <span\r\n className={csx(\r\n \"proton-TextEmphasis\",\r\n tooltipProps && \"proton-TextEmphasis--tooltip\",\r\n themeClassName\r\n )}\r\n data-testid={testId}\r\n >\r\n {content}\r\n </span>\r\n );\r\n};\r\n"],"names":["TextEmphasis","to","children","tooltipProps","testId","themeClassName","useTheme","content","jsx","Tooltip","isExternal","isUrlExternal","csx","e","handleInternalNavigation"],"mappings":";;;;;;AAsCO,MAAMA,IAAe,CAAC;AAAA,EAC3B,IAAAC;AAAA,EACA,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,eAAeC;AACjB,MAAyB;AACvB,QAAM,EAAE,WAAWC,EAAe,IAAIC,EAAS,GAEzCC,IAAUJ,IACbK,gBAAAA,EAAA,IAAAC,GAAA,EAAQ,OAAO,IAAK,GAAGN,GACrB,UAAAD,EACH,CAAA,IAEAA;AAGF,MAAID,GAAI;AACA,UAAAS,IAAaC,EAAcV,CAAE;AAEjC,WAAAO,gBAAAA,EAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWI;AAAA,UACT;AAAA,UACAT,KAAgB;AAAA,UAChBE;AAAA,QACF;AAAA,QAEA,UAAAG,gBAAAA,EAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,eAAaJ;AAAA,YACb,MAAMH;AAAA,YACN,QAAQS,IAAa,WAAW;AAAA,YAChC,KAAKA,IAAa,wBAAwB;AAAA,YAC1C,SACGA,IAAsD,SAAzC,CAACG,MAAMC,EAAyBD,GAAGZ,CAAE;AAAA,YAGpD,UAAAM;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AAGE,SAAAC,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWI;AAAA,QACT;AAAA,QACAT,KAAgB;AAAA,QAChBE;AAAA,MACF;AAAA,MACA,eAAaD;AAAA,MAEZ,UAAAG;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../node_modules/react/jsx-runtime.cjs.js"),t=require("react"),h=require("../design/lightTheme/colors.cjs.js"),l=require("../design/generateStylesheet.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../node_modules/react/jsx-runtime.cjs.js"),t=require("react"),h=require("../design/lightTheme/colors.cjs.js"),l=require("../design/generateStylesheet.cjs.js"),T=require("../design/theme.cjs.js"),u=t.createContext(void 0),d=()=>{const e=t.useContext(u);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},x=({theme:e,children:i,palette:r=h.LIGHT_PALETTE})=>{const s=t.useRef(null),o=T.THEME_CLASSES[e],n=t.useMemo(()=>l.generateStylesheet(r,e),[r,e]);return t.useEffect(()=>{s.current&&(s.current.className=o,Object.entries(n).forEach(([a,m])=>{s.current.style.setProperty(a,m)}))},[e,o,r,n]),c.jsxRuntimeExports.jsx(u.Provider,{value:{theme:e,style:n,palette:r,className:o,hasPalette:!!r},children:c.jsxRuntimeExports.jsx("div",{ref:s,children:i})})};exports.ThemeProvider=x;exports.useTheme=d;
|
|
2
2
|
//# sourceMappingURL=ThemeProvider.cjs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../node_modules/react/jsx-runtime.cjs.js"),l=require("react"),e=require("radix-ui"),v=require("../ThemeProvider.cjs.js");;/* empty css */;/* empty css */const T=require("../../utils/string.cjs.js"),f=l.forwardRef(({content:a,children:r,arrow:s,placement:u="top","data-testid":p},x)=>{const{style:i,className:o}=v.useTheme();return t.jsxRuntimeExports.jsxs(e.Tooltip.Content,{ref:x,side:u,className:T.csx("proton__Tooltip","proton-Dialog",o),style:i,sideOffset:8,"data-testid":p,children:[a,s&&t.jsxRuntimeExports.jsx(e.Tooltip.Arrow,{className:T.csx("proton__Tooltip-arrow",o),width:8,height:8,children:t.jsxRuntimeExports.jsx("svg",{width:8,height:8,viewBox:"0 0 8 8",children:t.jsxRuntimeExports.jsx("path",{d:"M0 0 L4 4 L8 0"})})})]})});f.displayName="TooltipContent";function R({arrow:a=!0,children:r,content:s,delay:u=100,placement:p="bottom",isDisabled:x,defaultOpen:i=!1,onOpenChange:o,disableTriggerClick:j,"data-testid":g}){const[c,m]=l.useState(i),n=l.useRef(!1),h=l.useRef(!1);if(s==="")return null;const E=d=>{d&&!n.current&&(h.current=!0),o&&o(d),n.current||m(d),n.current=!1};return t.jsxRuntimeExports.jsx(e.Tooltip.Provider,{children:t.jsxRuntimeExports.jsxs(e.Tooltip.Root,{open:c,defaultOpen:i,onOpenChange:E,delayDuration:u,children:[t.jsxRuntimeExports.jsx(e.Tooltip.Trigger,{asChild:!0,children:j?t.jsxRuntimeExports.jsx("span",{className:"proton__TooltipTrigger","aria-label":"Show tooltip",children:r}):t.jsxRuntimeExports.jsx("div",{role:"button","aria-label":"Show tooltip",className:"proton__TooltipTrigger","data-hovered":c,onClick:()=>{j||x||h.current||(n.current=!0,m(!c))},children:r})}),t.jsxRuntimeExports.jsx(e.Tooltip.Portal,{children:t.jsxRuntimeExports.jsx(f,{content:s,placement:p,arrow:a,"data-testid":g,children:r})})]})})}R.displayName="Tooltip";exports.Tooltip=R;
|
|
2
2
|
//# sourceMappingURL=Tooltip.cjs.js.map
|