A design system in a box. hip-ui.tngl.io/docs/introduction
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at docs 1 lines 1.6 kB view raw
1import{i as e,t}from"./jsx-runtime-D-oznMWL.js";import{t as n}from"./react-DNjXG-IQ.js";import{Ft as r,lt as i}from"./button-B3FtKFjE.js";import{_ as a}from"./typography.stylex-ZkAqsnF0.js";import{W as o}from"./SelectionIndicator-D6_3UuYP.js";import{n as s}from"./Input-BzKLqfLq.js";import{t as c}from"./TextField-C3kwgWtw.js";var l=e(n(),1),u=t(),d=()=>{let e=document.activeElement?.parentElement?.closest(`button, input, textarea, select, a, [tabindex]:not([tabindex='-1'])`);e&&e.focus()};function f({children:e,onChange:t,isReadOnly:n,defaultEditing:f,isEditing:p,onEditingChange:m,style:h,...g}){let[_,v]=i(p,f??!1,m),[y,b]=(0,l.useState)(e),x=(0,l.useRef)(null),S=p===void 0?_:p,C=e=>{p===void 0&&v(e),m?.(e)},w=()=>{n||(b(e),C(!0),setTimeout(()=>{x.current?.focus(),x.current?.select()},0))},T=n=>{d(),C(!1),n!==e&&t?.(n)},E=()=>{d(),C(!1),b(e)},D=(0,l.useEffectEvent)(e=>{let t=e;t.key===`Enter`?(e.preventDefault(),T(y)):t.key===`Escape`&&(e.preventDefault(),E()),e.stopPropagation()}),O=()=>{T(y)},{longPressProps:k}=o({onLongPress:w});return(0,l.useEffect)(()=>{if(S)return globalThis.addEventListener(`keydown`,D,{capture:!0}),()=>{globalThis.removeEventListener(`keydown`,D,{capture:!0})}},[S]),S?(0,u.jsx)(c,{value:y,onChange:b,onKeyDown:e=>e.stopPropagation(),onKeyUp:e=>e.stopPropagation(),isReadOnly:n,...a(h),children:(0,u.jsx)(s,{className:`x124xa5j xc342km x1r8a4m5 xjbqb8w x1rg5ohu xjb2p0i x1qlqyl8 x1pd3egz x4gjf66 x15bjb6t x16tdsg8 x5ftkge xeuugli x1vjhitx xaatb59 x1k57tk5 xat8dtc x12py4f0 x3oq134 xzfqydg x14j35zl xv5w2ka xe7n5k2 x15zyuyl xgewa70`,ref:x,onBlur:O})}):(0,u.jsx)(`span`,{...r(g,k),children:e})}export{f as t};