@3gs/ui 0.1.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.
Files changed (59) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +43 -0
  3. package/dist/components/ActionSheet/ActionSheet.d.ts +40 -0
  4. package/dist/components/ActionSheet/index.d.ts +2 -0
  5. package/dist/components/Alert/Alert.d.ts +36 -0
  6. package/dist/components/Alert/index.d.ts +2 -0
  7. package/dist/components/Badge/Badge.d.ts +13 -0
  8. package/dist/components/Badge/index.d.ts +2 -0
  9. package/dist/components/Button/Button.d.ts +32 -0
  10. package/dist/components/Button/index.d.ts +2 -0
  11. package/dist/components/DatePicker/DatePicker.d.ts +57 -0
  12. package/dist/components/DatePicker/index.d.ts +2 -0
  13. package/dist/components/HUD/HUD.d.ts +56 -0
  14. package/dist/components/HUD/index.d.ts +2 -0
  15. package/dist/components/Icon/Icon.d.ts +27 -0
  16. package/dist/components/Icon/index.d.ts +2 -0
  17. package/dist/components/Keyboard/Keyboard.d.ts +38 -0
  18. package/dist/components/Keyboard/index.d.ts +2 -0
  19. package/dist/components/List/List.d.ts +55 -0
  20. package/dist/components/List/index.d.ts +2 -0
  21. package/dist/components/ModalSheet/ModalSheet.d.ts +36 -0
  22. package/dist/components/ModalSheet/index.d.ts +2 -0
  23. package/dist/components/NavigationBar/NavigationBar.d.ts +41 -0
  24. package/dist/components/NavigationBar/index.d.ts +2 -0
  25. package/dist/components/NotificationBanner/NotificationBanner.d.ts +50 -0
  26. package/dist/components/NotificationBanner/index.d.ts +2 -0
  27. package/dist/components/PageControl/PageControl.d.ts +32 -0
  28. package/dist/components/PageControl/index.d.ts +2 -0
  29. package/dist/components/Picker/Picker.d.ts +45 -0
  30. package/dist/components/Picker/index.d.ts +2 -0
  31. package/dist/components/Popover/Popover.d.ts +40 -0
  32. package/dist/components/Popover/index.d.ts +2 -0
  33. package/dist/components/Progress/Progress.d.ts +37 -0
  34. package/dist/components/Progress/index.d.ts +2 -0
  35. package/dist/components/SearchBar/SearchBar.d.ts +61 -0
  36. package/dist/components/SearchBar/index.d.ts +2 -0
  37. package/dist/components/SegmentedControl/SegmentedControl.d.ts +50 -0
  38. package/dist/components/SegmentedControl/index.d.ts +2 -0
  39. package/dist/components/Slider/Slider.d.ts +39 -0
  40. package/dist/components/Slider/index.d.ts +2 -0
  41. package/dist/components/StatusBar/StatusBar.d.ts +24 -0
  42. package/dist/components/StatusBar/index.d.ts +2 -0
  43. package/dist/components/Stepper/Stepper.d.ts +55 -0
  44. package/dist/components/Stepper/index.d.ts +2 -0
  45. package/dist/components/Switch/Switch.d.ts +26 -0
  46. package/dist/components/Switch/index.d.ts +2 -0
  47. package/dist/components/TabBar/TabBar.d.ts +33 -0
  48. package/dist/components/TabBar/index.d.ts +2 -0
  49. package/dist/components/TextField/TextField.d.ts +38 -0
  50. package/dist/components/TextField/index.d.ts +2 -0
  51. package/dist/components/Toolbar/Toolbar.d.ts +58 -0
  52. package/dist/components/Toolbar/index.d.ts +2 -0
  53. package/dist/index.cjs +73 -0
  54. package/dist/index.d.ts +27 -0
  55. package/dist/index.js +2803 -0
  56. package/dist/lib/cn.d.ts +2 -0
  57. package/dist/lib/i18n.d.ts +89 -0
  58. package/dist/ui.css +1 -0
  59. package/package.json +73 -0
package/dist/index.cjs ADDED
@@ -0,0 +1,73 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),a=require("react"),ue=require("react-dom");function R(...r){return r.filter(Boolean).join(" ")}const ft={gloss:"gs-icon-grad-gloss",active:"gs-icon-grad-active"},ee=a.forwardRef(function({icon:e,variant:t="gloss",embossed:n,size:o=24,label:c,className:i,strokeWidth:l=2.25,...g},p){const h=t!=="flat",v=n??h,w=h?ft[t]:void 0,x=c?{role:"img","aria-label":c}:{"aria-hidden":!0};return s.jsx(e,{ref:p,size:o,strokeWidth:l,className:R("gs-icon",`gs-icon--${t}`,v&&"gs-icon--embossed",i),stroke:w?`url(#${w})`:"currentColor",...x,...g,children:w&&s.jsx("defs",{children:s.jsxs("linearGradient",{id:w,x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"0%",className:"gs-icon__stop-top"}),s.jsx("stop",{offset:"50%",className:"gs-icon__stop-mid-top"}),s.jsx("stop",{offset:"50.5%",className:"gs-icon__stop-mid-bottom"}),s.jsx("stop",{offset:"100%",className:"gs-icon__stop-bottom"})]})})})}),Re=a.forwardRef(function({value:e,max:t=99,tone:n="red",className:o,...c},i){if(e===void 0||e===""||e===0)return null;const l=typeof e=="number"&&e>t?`${t}+`:String(e);return s.jsx("span",{ref:i,className:R("gs-badge",`gs-badge--${n}`,o),...c,children:l})}),gt={sm:14,md:18,lg:20},ht=a.forwardRef(function({variant:e="default",size:t="md",block:n=!1,icon:o,iconPosition:c="leading",type:i="button",className:l,children:g,...p},h){const v=o?s.jsx(ee,{icon:o,variant:"flat",size:gt[t],className:"gs-button__icon"}):null,w=g!=null&&g!==!1;return s.jsxs("button",{ref:h,type:i,className:R("gs-button",`gs-button--${e}`,`gs-button--${t}`,n&&"gs-button--block",l),...p,children:[c==="leading"&&v,w&&s.jsx("span",{className:"gs-button__label",children:g}),c==="trailing"&&v]})}),Ve={cancel:"Cancel",done:"Done",ok:"OK",close:"Close",clear:"Clear",search:"Search",go:"Go",send:"Send",next:"Next",loading:"Loading",progress:"Progress",actions:"Actions",dialog:"Dialog",tabs:"Tabs",segments:"Segments",pages:"Pages",pageOf:(r,e)=>`Page ${r} of ${e}`,toolbar:"Toolbar",keyboard:"Keyboard",shift:"shift",delete:"delete",numbers:"numbers",symbols:"symbols",letters:"letters",space:"space",return:"return",on:"ON",off:"OFF",date:"Date",time:"Time",dateTime:"Date and time",month:"Month",day:"Day",year:"Year",hour:"Hour",minute:"Minute",dayPeriod:"AM/PM",today:"Today",am:"AM",pm:"PM"},ye=a.createContext({locale:void 0,strings:Ve});function mt(r,e){const t={...r};for(const n of Object.keys(e)){const o=e[n];o!==void 0&&(t[n]=o)}return t}function bt({locale:r,strings:e,children:t}){const n=a.useContext(ye),o=a.useMemo(()=>({locale:r??n.locale,strings:e?mt(n.strings,e):n.strings}),[n,r,e]);return s.jsx(ye.Provider,{value:o,children:t})}function se(){return a.useContext(ye).strings}function Ge(){return a.useContext(ye).locale}const pt=a.forwardRef(function({checked:e,defaultChecked:t=!1,onChange:n,disabled:o=!1,onLabel:c,offLabel:i,label:l,name:g,className:p,onClick:h,...v},w){const x=se(),T=e!==void 0,[M,N]=a.useState(t),y=T?e:M,E=j=>{if(h==null||h(j),j.defaultPrevented||o)return;const d=!y;T||N(d),n==null||n(d)};return s.jsxs(s.Fragment,{children:[s.jsxs("button",{ref:w,type:"button",role:"switch","aria-checked":y,"aria-label":l,disabled:o,className:R("gs-switch",y&&"gs-switch--on",o&&"gs-switch--disabled",p),onClick:E,...v,children:[s.jsx("span",{className:"gs-switch__track","aria-hidden":"true",children:s.jsxs("span",{className:"gs-switch__strip",children:[s.jsx("span",{className:"gs-switch__on",children:c??x.on}),s.jsx("span",{className:"gs-switch__off",children:i??x.off})]})}),s.jsx("span",{className:"gs-switch__knob","aria-hidden":"true"})]}),g&&s.jsx("input",{type:"checkbox",name:g,checked:y,disabled:o,readOnly:!0,hidden:!0,tabIndex:-1,"aria-hidden":"true"})]})});/**
2
+ * @license lucide-react v0.460.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const _t=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ze=(...r)=>r.filter((e,t,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===t).join(" ").trim();/**
7
+ * @license lucide-react v0.460.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */var vt={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
12
+ * @license lucide-react v0.460.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const yt=a.forwardRef(({color:r="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:n,className:o="",children:c,iconNode:i,...l},g)=>a.createElement("svg",{ref:g,...vt,width:e,height:e,stroke:r,strokeWidth:n?Number(t)*24/Number(e):t,className:Ze("lucide",o),...l},[...i.map(([p,h])=>a.createElement(p,h)),...Array.isArray(c)?c:[c]]));/**
17
+ * @license lucide-react v0.460.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const ae=(r,e)=>{const t=a.forwardRef(({className:n,...o},c)=>a.createElement(yt,{ref:c,iconNode:e,className:Ze(`lucide-${_t(r)}`,n),...o}));return t.displayName=`${r}`,t};/**
22
+ * @license lucide-react v0.460.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const xt=ae("ArrowBigUp",[["path",{d:"M9 18v-6H5l7-7 7 7h-4v6H9z",key:"1x06kx"}]]);/**
27
+ * @license lucide-react v0.460.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const Xe=ae("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
32
+ * @license lucide-react v0.460.0 - ISC
33
+ *
34
+ * This source code is licensed under the ISC license.
35
+ * See the LICENSE file in the root directory of this source tree.
36
+ */const kt=ae("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
37
+ * @license lucide-react v0.460.0 - ISC
38
+ *
39
+ * This source code is licensed under the ISC license.
40
+ * See the LICENSE file in the root directory of this source tree.
41
+ */const wt=ae("CircleChevronRight",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]);/**
42
+ * @license lucide-react v0.460.0 - ISC
43
+ *
44
+ * This source code is licensed under the ISC license.
45
+ * See the LICENSE file in the root directory of this source tree.
46
+ */const Nt=ae("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
47
+ * @license lucide-react v0.460.0 - ISC
48
+ *
49
+ * This source code is licensed under the ISC license.
50
+ * See the LICENSE file in the root directory of this source tree.
51
+ */const jt=ae("Delete",[["path",{d:"M10 5a2 2 0 0 0-1.344.519l-6.328 5.74a1 1 0 0 0 0 1.481l6.328 5.741A2 2 0 0 0 10 19h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2z",key:"1yo7s0"}],["path",{d:"m12 9 6 6",key:"anjzzh"}],["path",{d:"m18 9-6 6",key:"1fp51s"}]]);/**
52
+ * @license lucide-react v0.460.0 - ISC
53
+ *
54
+ * This source code is licensed under the ISC license.
55
+ * See the LICENSE file in the root directory of this source tree.
56
+ */const St=ae("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
57
+ * @license lucide-react v0.460.0 - ISC
58
+ *
59
+ * This source code is licensed under the ISC license.
60
+ * See the LICENSE file in the root directory of this source tree.
61
+ */const Tt=ae("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
62
+ * @license lucide-react v0.460.0 - ISC
63
+ *
64
+ * This source code is licensed under the ISC license.
65
+ * See the LICENSE file in the root directory of this source tree.
66
+ */const Et=ae("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
67
+ * @license lucide-react v0.460.0 - ISC
68
+ *
69
+ * This source code is licensed under the ISC license.
70
+ * See the LICENSE file in the root directory of this source tree.
71
+ */const Rt=ae("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Le=18,Qe=a.forwardRef(function({label:e,helper:t,error:n,clearable:o=!1,onClear:c,leadingIcon:i,size:l="md",wrapperClassName:g,className:p,id:h,value:v,defaultValue:w,onChange:x,disabled:T,readOnly:M,type:N="text","aria-describedby":y,...E},j){const d=se(),u=a.useId(),b=h??u,_=`${b}-helper`,D=`${b}-error`,m=a.useRef(null);a.useImperativeHandle(j,()=>m.current,[]);const S=v!==void 0,[k,f]=a.useState(()=>String(w??"")),I=S?v:k,P=I!=null&&String(I).length>0,O=o&&P&&!T&&!M,Y=L=>{S||f(L.target.value),x==null||x(L)},V=()=>{var K;const L=m.current;if(!L)return;const G=(K=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"))==null?void 0:K.set;G?G.call(L,""):L.value="",L.dispatchEvent(new Event("input",{bubbles:!0})),S||f(""),c==null||c(),L.focus()},q=L=>{var G;L.target===L.currentTarget&&((G=m.current)==null||G.focus())},H=[y,t?_:null,n?D:null].filter(Boolean).join(" ")||void 0;return s.jsxs("div",{className:R("gs-textfield",`gs-textfield--${l}`,!!n&&"gs-textfield--error",T&&"gs-textfield--disabled",g),children:[s.jsxs("div",{className:"gs-textfield__field",onClick:q,children:[e&&s.jsx("label",{htmlFor:b,className:"gs-textfield__label",children:e}),i&&s.jsx(ee,{icon:i,variant:"flat",size:Le,className:"gs-textfield__icon"}),s.jsx("input",{ref:m,id:b,type:N,className:R("gs-textfield__input",p),value:v,defaultValue:w,onChange:Y,disabled:T,readOnly:M,"aria-invalid":n?!0:void 0,"aria-describedby":H,...E}),O&&s.jsx("button",{type:"button",className:"gs-textfield__clear","aria-label":d.clear,onMouseDown:L=>L.preventDefault(),onClick:V,children:s.jsx(ee,{icon:Nt,variant:"flat",size:Le,strokeWidth:2.5})})]}),t&&s.jsx("div",{id:_,className:"gs-textfield__helper",children:t}),n&&s.jsx("div",{id:D,className:"gs-textfield__error",role:"alert",children:n})]})}),Je=a.forwardRef(function({showCancel:e=!1,cancelLabel:t,onCancel:n,wrapperClassName:o,placeholder:c,clearable:i=!0,type:l="search",...g},p){const h=se(),v=a.useRef(null);a.useImperativeHandle(p,()=>v.current,[]);const w=()=>{var x;n==null||n(),(x=v.current)==null||x.blur()};return s.jsxs("div",{className:R("gs-searchfield",o),children:[s.jsx(Qe,{ref:v,wrapperClassName:"gs-searchfield__field",leadingIcon:Et,placeholder:c??h.search,clearable:i,type:l,enterKeyHint:"search",...g}),e&&s.jsx("button",{type:"button",className:"gs-searchfield__cancel",onMouseDown:x=>x.preventDefault(),onClick:w,children:t??h.cancel})]})}),Ke=a.forwardRef(function({title:e,left:t,right:n,tint:o="black",className:c,...i},l){const g=e!=null&&e!==!1;return s.jsxs("div",{ref:l,role:"toolbar","aria-label":typeof e=="string"?e:void 0,className:R("gs-navbar",`gs-navbar--${o}`,c),...i,children:[s.jsx("div",{className:"gs-navbar__left",children:t}),g&&s.jsx("div",{className:"gs-navbar__title",children:e}),s.jsx("div",{className:"gs-navbar__right",children:n})]})}),Te=a.forwardRef(function({variant:e="default",icon:t,type:n="button",className:o,children:c,...i},l){const g=c!=null&&c!==!1;return s.jsxs("button",{ref:l,type:n,className:R("gs-barbutton",`gs-barbutton--${e}`,!g&&"gs-barbutton--icon-only",o),...i,children:[t&&s.jsx(ee,{icon:t,variant:"flat",size:16,className:"gs-barbutton__icon"}),g&&s.jsx("span",{className:"gs-barbutton__label",children:c})]})}),Ce=a.createContext(null);function Mt(r){const e=[];return a.Children.forEach(r,t=>{a.isValidElement(t)&&typeof t.props.value=="string"&&e.push(t.props.value)}),e}const It=a.forwardRef(function({value:e,defaultValue:t,onChange:n,label:o,className:c,children:i,onKeyDown:l,...g},p){const h=se(),v=Mt(i),w=e!==void 0,[x,T]=a.useState(()=>t??v[0]),M=w?e:x,N=M!==void 0&&v.includes(M)?M:v[0],y=a.useCallback(d=>{w||T(d),n==null||n(d)},[w,n]),E=a.useMemo(()=>({selected:M,focusable:N,select:y}),[M,N,y]),j=d=>{if(l==null||l(d),d.defaultPrevented)return;const u=Array.from(d.currentTarget.querySelectorAll('[role="tab"]')).filter(m=>!m.disabled);if(u.length===0)return;const b=u.findIndex(m=>m.contains(d.target));if(b===-1)return;let _;switch(d.key){case"ArrowRight":_=(b+1)%u.length;break;case"ArrowLeft":_=(b-1+u.length)%u.length;break;case"Home":_=0;break;case"End":_=u.length-1;break;default:return}d.preventDefault();const D=u[_];D.focus(),D.click()};return s.jsx(Ce.Provider,{value:E,children:s.jsx("div",{ref:p,role:"tablist","aria-label":o??h.tabs,"aria-orientation":"horizontal",className:R("gs-tabbar",c),onKeyDown:j,...g,children:i})})}),Dt=a.forwardRef(function({value:e,icon:t,label:n,badge:o,className:c,onClick:i,...l},g){const p=a.useContext(Ce);if(!p)throw new Error("<TabBarItem> must be rendered inside a <TabBar>.");const h=p.selected===e,v=p.focusable===void 0||p.focusable===e?0:-1,w=x=>{i==null||i(x),!(x.defaultPrevented||h)&&p.select(e)};return s.jsxs("button",{ref:g,type:"button",role:"tab","aria-selected":h,tabIndex:v,className:R("gs-tabbar-item",h&&"gs-tabbar-item--selected",c),onClick:w,...l,children:[s.jsxs("span",{className:"gs-tabbar-item__icon",children:[s.jsx(ee,{icon:t,variant:h?"active":"gloss",size:26}),s.jsx(Re,{value:o,className:"gs-tabbar-item__badge"})]}),s.jsx("span",{className:"gs-tabbar-item__label",children:n})]})}),Pt=a.forwardRef(function({variant:e="grouped",header:t,footer:n,className:o,children:c,...i},l){return s.jsxs("div",{ref:l,className:R("gs-list",`gs-list--${e}`,o),...i,children:[t!=null&&s.jsx("div",{className:"gs-list__header",children:t}),s.jsx("div",{className:"gs-list__group",role:"list",children:c}),n!=null&&s.jsx("div",{className:"gs-list__footer",children:n})]})});function At(r){return r==="chevron"||r==="checkmark"||r==="detail"||r==="none"}function Lt(r){if(r==null||r==="none")return null;if(!At(r))return r;switch(r){case"chevron":return s.jsx(ee,{icon:kt,variant:"flat",size:20,strokeWidth:3,className:"gs-list-item__accessory-icon gs-list-item__accessory-icon--chevron"});case"checkmark":return s.jsx(ee,{icon:Xe,variant:"flat",size:20,strokeWidth:3,className:"gs-list-item__accessory-icon gs-list-item__accessory-icon--checkmark"});case"detail":return s.jsx(ee,{icon:wt,variant:"flat",size:22,strokeWidth:2.25,className:"gs-list-item__accessory-icon gs-list-item__accessory-icon--detail"});default:return null}}const $t=a.forwardRef(function({icon:e,iconTile:t=!1,iconTint:n="gray",title:o,subtitle:c,detail:i,accessory:l,selected:g=!1,disabled:p=!1,href:h,onClick:v,className:w,...x},T){const M=!!h||!!v,N=c!=null&&c!==!1,y=i!=null&&i!==!1,E=Lt(l),j=R("gs-list-item",M&&"gs-list-item--interactive",g&&"gs-list-item--selected",p&&"gs-list-item--disabled",w),d=s.jsxs(s.Fragment,{children:[e!=null&&s.jsx("span",{className:R("gs-list-item__icon",t&&"gs-list-item__icon--tile",t&&`gs-list-item__icon--${n}`),children:e}),s.jsxs("span",{className:"gs-list-item__body",children:[s.jsx("span",{className:"gs-list-item__title",children:o}),N&&s.jsx("span",{className:"gs-list-item__subtitle",children:c})]}),y&&s.jsx("span",{className:"gs-list-item__detail",children:i}),E&&s.jsx("span",{className:"gs-list-item__accessory",children:E})]}),u=b=>{if(p){b.preventDefault();return}v==null||v(b)};return h?s.jsx("a",{ref:T,className:j,href:p?void 0:h,"aria-disabled":p||void 0,"aria-current":g||void 0,tabIndex:p?-1:void 0,onClick:u,...x,children:d}):v?s.jsx("button",{ref:T,type:"button",className:j,disabled:p,"aria-current":g||void 0,onClick:u,...x,children:d}):s.jsx("div",{ref:T,role:"listitem",className:j,"aria-disabled":p||void 0,"aria-current":g||void 0,...x,children:d})}),$e="button.gs-alert__action:not(:disabled)",Bt=a.forwardRef(function({open:e,title:t,message:n,actions:o,onClose:c,dismissOnBackdrop:i=!1,contained:l=!1,className:g,...p},h){const v=a.useId(),w=`${v}-title`,x=`${v}-message`,T=a.useRef(null),M=a.useCallback(d=>{T.current=d,typeof h=="function"?h(d):h&&(h.current=d)},[h]),N=a.useRef(c);if(N.current=c,a.useEffect(()=>{if(!e)return;const d=document.activeElement,u=T.current,b=(u==null?void 0:u.querySelector(".gs-alert__action--primary"))??(u==null?void 0:u.querySelector($e));return b==null||b.focus(),()=>{d&&d.isConnected&&typeof d.focus=="function"&&d.focus()}},[e]),a.useEffect(()=>{if(!e)return;const d=u=>{var k;if(u.key==="Escape"){u.preventDefault(),(k=N.current)==null||k.call(N);return}if(u.key!=="Tab")return;const b=T.current;if(!b)return;const _=Array.from(b.querySelectorAll($e));if(_.length===0)return;u.preventDefault();const D=_.indexOf(document.activeElement),m=_.length-1,S=u.shiftKey?D<=0?m:D-1:D<0||D===m?0:D+1;_[S].focus()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[e]),!e)return null;const y=d=>{i&&d.target===d.currentTarget&&(c==null||c())},E=o.length!==2,j=s.jsx("div",{className:R("gs-alert-backdrop",l&&"gs-alert-backdrop--contained"),onClick:y,children:s.jsxs("div",{ref:M,className:R("gs-alert",g),role:"alertdialog","aria-modal":"true","aria-labelledby":w,"aria-describedby":n!=null?x:void 0,...p,children:[s.jsx("div",{id:w,className:"gs-alert__title",children:t}),n!=null&&s.jsx("div",{id:x,className:"gs-alert__message",children:n}),s.jsx("div",{className:R("gs-alert__actions",E&&"gs-alert__actions--stacked"),children:o.map((d,u)=>s.jsx("button",{type:"button",className:R("gs-alert__action",`gs-alert__action--${d.variant??"default"}`),onClick:()=>{var b;(b=d.onClick)==null||b.call(d),d.keepOpen||c==null||c()},children:d.label},u))})]})});return l?j:typeof document>"u"?null:ue.createPortal(j,document.body)}),et=a.createContext(null);function Ot(r){const e=[];return a.Children.forEach(r,t=>{a.isValidElement(t)&&typeof t.props.value=="string"&&e.push({value:t.props.value,disabled:t.props.disabled===!0})}),e}const tt=a.forwardRef(function({value:e,defaultValue:t,onChange:n,size:o="md",tint:c="dark",label:i,block:l=!1,className:g,children:p,onKeyDown:h,...v},w){var D;const x=se(),T=Ot(p),M=e!==void 0,[N,y]=a.useState(()=>{var m;return t??((m=T[0])==null?void 0:m.value)}),E=M?e:N,j=T.find(m=>m.value===E),d=j&&!j.disabled?j.value:(D=T.find(m=>!m.disabled))==null?void 0:D.value,u=a.useCallback(m=>{M||y(m),n==null||n(m)},[M,n]),b=a.useMemo(()=>({selected:E,focusable:d,select:u}),[E,d,u]),_=m=>{if(h==null||h(m),m.defaultPrevented)return;const S=Array.from(m.currentTarget.querySelectorAll('[role="radio"]')).filter(P=>!P.disabled);if(S.length===0)return;const k=S.findIndex(P=>P.contains(m.target));if(k===-1)return;let f;switch(m.key){case"ArrowRight":f=(k+1)%S.length;break;case"ArrowLeft":f=(k-1+S.length)%S.length;break;case"Home":f=0;break;case"End":f=S.length-1;break;default:return}m.preventDefault();const I=S[f];I.focus(),I.click()};return s.jsx(et.Provider,{value:b,children:s.jsx("div",{ref:w,role:"radiogroup","aria-label":i??x.segments,className:R("gs-segmented",`gs-segmented--${o}`,`gs-segmented--${c}`,l&&"gs-segmented--block",g),onKeyDown:_,...v,children:p})})}),st=a.forwardRef(function({value:e,icon:t,label:n,disabled:o=!1,className:c,children:i,onClick:l,...g},p){const h=a.useContext(et);if(!h)throw new Error("<Segment> must be rendered inside a <SegmentedControl>.");const v=h.selected===e,w=h.focusable===void 0||h.focusable===e?0:-1,x=i??(t?void 0:n),T=x!=null&&x!==!1,M=N=>{l==null||l(N),!(N.defaultPrevented||v)&&h.select(e)};return s.jsxs("button",{ref:p,type:"button",role:"radio","aria-checked":v,"aria-label":T?void 0:n,tabIndex:w,disabled:o,className:R("gs-segment",v&&"gs-segment--selected",o&&"gs-segment--disabled",c),onClick:M,...g,children:[t&&s.jsx(ee,{icon:t,variant:"flat",size:16,className:"gs-segment__icon"}),T&&s.jsx("span",{className:"gs-segment__label",children:x})]})}),Ft=16,Ht=20;function Be(r,e,t){return Math.min(Math.max(r,e),t)}const Wt=a.forwardRef(function({value:e,defaultValue:t,onChange:n,onChangeEnd:o,min:c=0,max:i=100,step:l=1,disabled:g=!1,label:p,minIcon:h,maxIcon:v,showValue:w=!1,wrapperClassName:x,className:T,...M},N){const y=a.useRef(null);a.useImperativeHandle(N,()=>y.current,[]);const E=e!==void 0,[j,d]=a.useState(()=>Be(t??c,c,i)),u=E?e:j,b=i-c,_=b>0?Be((u-c)/b*100,0,100):0,D=S=>{const k=Number(S.target.value);E||d(k),n==null||n(k)},m=a.useRef(o);return m.current=o,a.useEffect(()=>{const S=y.current;if(!S)return;const k=()=>{var f;(f=m.current)==null||f.call(m,Number(S.value))};return S.addEventListener("change",k),()=>S.removeEventListener("change",k)},[]),s.jsxs("div",{className:R("gs-slider",g&&"gs-slider--disabled",x),style:{"--gs-slider-pct":_},children:[h&&s.jsx(ee,{icon:h,variant:"flat",size:Ft,className:"gs-slider__icon gs-slider__icon--min"}),s.jsx("input",{ref:y,type:"range",className:R("gs-slider__input",T),value:E?e:void 0,defaultValue:E?void 0:j,onChange:D,min:c,max:i,step:l,disabled:g,"aria-label":p,...M}),v&&s.jsx(ee,{icon:v,variant:"flat",size:Ht,className:"gs-slider__icon gs-slider__icon--max"}),w&&s.jsx("span",{className:"gs-slider__value",children:u})]})}),Oe="button.gs-actionsheet__action:not(:disabled)",zt=a.forwardRef(function({open:e,title:t,actions:n,cancelLabel:o,onClose:c,dismissOnBackdrop:i=!0,contained:l=!1,className:g,...p},h){const v=se(),w=o===void 0?v.cancel:o,T=`${a.useId()}-title`,M=t!=null&&t!==!1,N=a.useRef(null),y=a.useCallback(u=>{N.current=u,typeof h=="function"?h(u):h&&(h.current=u)},[h]),E=a.useRef(c);if(E.current=c,a.useEffect(()=>{var b,_;if(!e)return;const u=document.activeElement;return(_=(b=N.current)==null?void 0:b.querySelector(Oe))==null||_.focus(),()=>{u&&u.isConnected&&typeof u.focus=="function"&&u.focus()}},[e]),a.useEffect(()=>{if(!e)return;const u=b=>{var f;if(b.key==="Escape"){b.preventDefault(),(f=E.current)==null||f.call(E);return}if(b.key!=="Tab")return;const _=N.current;if(!_)return;const D=Array.from(_.querySelectorAll(Oe));if(D.length===0)return;b.preventDefault();const m=D.indexOf(document.activeElement),S=D.length-1,k=b.shiftKey?m<=0?S:m-1:m<0||m===S?0:m+1;D[k].focus()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[e]),!e)return null;const j=u=>{i&&u.target===u.currentTarget&&(c==null||c())},d=s.jsx("div",{className:R("gs-actionsheet-backdrop",l&&"gs-actionsheet-backdrop--contained"),onClick:j,children:s.jsxs("div",{ref:y,className:R("gs-actionsheet",g),role:"dialog","aria-modal":"true","aria-labelledby":M?T:void 0,"aria-label":M?void 0:v.actions,...p,children:[M&&s.jsx("div",{id:T,className:"gs-actionsheet__title",children:t}),s.jsxs("div",{className:"gs-actionsheet__actions",children:[n.map((u,b)=>s.jsx("button",{type:"button",className:R("gs-actionsheet__action",`gs-actionsheet__action--${u.variant??"default"}`),disabled:u.disabled,onClick:()=>{var _;(_=u.onClick)==null||_.call(u),u.keepOpen||c==null||c()},children:u.label},b)),w!==null&&s.jsx("button",{type:"button",className:"gs-actionsheet__action gs-actionsheet__action--cancel",onClick:()=>c==null?void 0:c(),children:w})]})]})});return l?d:typeof document>"u"?null:ue.createPortal(d,document.body)}),ke=44,Ut=100,Yt=150,rt=(r,e,t)=>Math.min(Math.max(r,e),t);function nt(r){const e=r.findIndex(t=>!t.disabled);return e===-1?0:e}function qt(r){for(let e=r.length-1;e>=0;e--)if(!r[e].disabled)return e;return r.length-1}function Vt(r,e){if(r.length===0)return-1;const t=e===void 0?-1:r.findIndex(n=>n.value===e);return t===-1?nt(r):t}function Gt(r,e,t){var n;if(!((n=r[e])!=null&&n.disabled))return e;for(let o=1;o<r.length;o++){const c=r[e+o*t];if(c&&!c.disabled)return e+o*t;const i=r[e-o*t];if(i&&!i.disabled)return e-o*t}return e}function be(r,e,t){const n=r.length-1,o=t<0?-1:1,c=rt(e+t,0,n);for(let i=c;i>=0&&i<=n;i+=o)if(!r[i].disabled)return i;for(let i=c-o;i!==e&&i>=0&&i<=n;i-=o)if(!r[i].disabled)return i;return e}function Zt(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function Xt({column:r,selectedIndex:e,idPrefix:t,rows:n,disabled:o,onSelect:c}){const{key:i,options:l,label:g,width:p,align:h="center"}=r,v=a.useRef(null),w=a.useRef(!1),x=a.useRef(!1),T=a.useRef(void 0),M=a.useRef(0),[N,y]=a.useReducer(f=>f+1,0),E=a.useRef({key:i,options:l,selectedIndex:e,onSelect:c});a.useLayoutEffect(()=>{E.current={key:i,options:l,selectedIndex:e,onSelect:c}}),a.useLayoutEffect(()=>{const f=v.current;if(!f||e<0)return;const I=e*ke;if(Math.abs(f.scrollTop-I)<1)return;window.clearTimeout(T.current),M.current=performance.now()+Yt;const P=!w.current||Zt();f.scrollTo({top:I,behavior:P?"auto":"smooth"})},[e,n,N]);const j=a.useCallback(()=>{const f=v.current,{key:I,options:P,selectedIndex:O,onSelect:Y}=E.current;if(!f||P.length===0)return;const V=rt(Math.round(f.scrollTop/ke),0,P.length-1),q=Gt(P,V,V>=O?1:-1);q!==O&&Y(I,q),(q!==O||q!==V||Math.abs(f.scrollTop-q*ke)>=1)&&y()},[]),d=a.useCallback(()=>{window.clearTimeout(T.current),T.current=window.setTimeout(j,Ut)},[j]);a.useEffect(()=>{w.current=!0;const f=v.current,I=()=>{x.current||(window.clearTimeout(T.current),j())};return f==null||f.addEventListener("scrollend",I),()=>{w.current=!1,window.clearTimeout(T.current),f==null||f.removeEventListener("scrollend",I)}},[j]);const u=()=>{x.current||performance.now()<M.current||d()},b=()=>{x.current=!0,window.clearTimeout(T.current)},_=()=>{x.current=!1,d()},D=f=>{window.clearTimeout(T.current),c(i,f)},m=f=>{if(o||l.length===0)return;const I=n-1;let P;switch(f.key){case"ArrowDown":P=be(l,e,1);break;case"ArrowUp":P=be(l,e,-1);break;case"PageDown":P=be(l,e,I);break;case"PageUp":P=be(l,e,-I);break;case"Home":P=nt(l);break;case"End":P=qt(l);break;default:return}f.preventDefault(),P!==e&&D(P)},S=typeof p=="number"?`${p}px`:p,k=S===void 0?void 0:{flex:`0 1 ${S}`};return s.jsxs("div",{className:R("gs-picker__column",`gs-picker__column--${h}`),style:k,children:[s.jsxs("div",{ref:v,role:"listbox",tabIndex:o?-1:0,"aria-label":g??i,"aria-disabled":o||void 0,"aria-activedescendant":e>=0?`${t}-o${e}`:void 0,className:"gs-picker__drum",onScroll:u,onTouchStart:b,onTouchEnd:_,onTouchCancel:_,onKeyDown:m,children:[s.jsx("div",{className:"gs-picker__spacer","aria-hidden":"true"}),l.map((f,I)=>{const P=I===e;return s.jsx("div",{id:`${t}-o${I}`,role:"option","aria-selected":P,"aria-disabled":f.disabled||void 0,className:R("gs-picker__row",P&&"gs-picker__row--selected",f.disabled&&"gs-picker__row--disabled"),onClick:()=>{!o&&!f.disabled&&!P&&D(I)},children:f.label},f.value)}),s.jsx("div",{className:"gs-picker__spacer","aria-hidden":"true"})]}),s.jsx("div",{className:"gs-picker__shade-top","aria-hidden":"true"}),s.jsx("div",{className:"gs-picker__shade-bottom","aria-hidden":"true"}),s.jsx("div",{className:"gs-picker__selection","aria-hidden":"true"})]})}const at=a.forwardRef(function({columns:e,value:t,defaultValue:n,onChange:o,rows:c=5,label:i,disabled:l=!1,className:g,...p},h){const v=a.useId(),w=t!==void 0,[x,T]=a.useState(()=>n??{}),M=w?t:x,N=e.map(j=>Vt(j.options,M[j.key])),y={};e.forEach((j,d)=>{const u=j.options[N[d]];u&&(y[j.key]=u.value)});const E=(j,d)=>{var _;const u=(_=e.find(D=>D.key===j))==null?void 0:_.options[d];if(!u||u.disabled||y[j]===u.value)return;const b={...y,[j]:u.value};w||T(b),o==null||o(b,{key:j,value:u.value})};return s.jsx("div",{ref:h,role:"group","aria-label":i,"aria-disabled":l||void 0,className:R("gs-picker",`gs-picker--rows-${c}`,l&&"gs-picker--disabled",g),...p,children:s.jsx("div",{className:"gs-picker__frame",children:e.map((j,d)=>s.jsxs(a.Fragment,{children:[d>0&&s.jsx("div",{className:"gs-picker__divider","aria-hidden":"true"}),s.jsx(Xt,{column:j,selectedIndex:N[d],idPrefix:`${v}-c${d}`,rows:c,disabled:l,onSelect:E})]},j.key))})})});function Qt(r,e,t){return Math.min(t,Math.max(e,r))}const ct=a.forwardRef(function({value:e,max:t=100,size:n="sm",showValue:o=!1,label:c,tint:i="blue",className:l,...g},p){const h=e===void 0||Number.isNaN(e),v=h?void 0:Qt(e,0,t),w=v===void 0||t<=0?0:v/t*100;return s.jsxs("div",{ref:p,role:"progressbar","aria-label":c,"aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":v,"aria-busy":h||void 0,className:R("gs-progress",`gs-progress--${n}`,`gs-progress--${i}`,h&&"gs-progress--indeterminate",l),...g,children:[s.jsx("span",{className:"gs-progress__track",children:s.jsx("span",{className:"gs-progress__fill",style:h?void 0:{width:`${w}%`,minWidth:w>0?6:0}})}),o&&s.jsx("span",{className:"gs-progress__value",children:h?"":`${Math.round(w)} %`})]})}),Jt=Array.from({length:12},(r,e)=>({angle:e*30,opacity:1-(12-e)%12*.065})),ot=a.forwardRef(function({size:e=20,tone:t="white",label:n,animating:o=!0,className:c,...i},l){const g=se();return o?s.jsx("span",{ref:l,role:"status","aria-label":n??g.loading,className:R("gs-spinner",`gs-spinner--${t}`,c),...i,children:s.jsx("svg",{className:"gs-spinner__svg",viewBox:"0 0 40 40",width:e,height:e,"aria-hidden":"true",focusable:"false",children:Jt.map(({angle:p,opacity:h})=>s.jsx("rect",{className:"gs-spinner__spoke",x:18,y:3,width:4,height:10,rx:2,transform:`rotate(${p} 20 20)`,opacity:h},p))})}):null}),Kt=(r,e,t)=>Math.min(t,Math.max(e,r)),Ct=a.forwardRef(function({time:e="3:53 PM",signal:t=5,network:n="3G",carrier:o,battery:c=100,charging:i=!1,bluetooth:l=!0,tint:g="black",className:p,...h},v){const w=Kt(c,0,100),x=w<=20&&!i;return s.jsxs("div",{ref:v,"aria-hidden":"true",className:R("gs-statusbar",`gs-statusbar--${g}`,p),...h,children:[s.jsxs("div",{className:"gs-statusbar__left",children:[s.jsxs("span",{className:"gs-statusbar__signal","data-bars":t,children:[s.jsx("i",{}),s.jsx("i",{}),s.jsx("i",{}),s.jsx("i",{}),s.jsx("i",{})]}),o&&s.jsx("span",{className:"gs-statusbar__carrier",children:o}),n==="wifi"?s.jsx("svg",{className:"gs-statusbar__wifi",width:"15",height:"11",viewBox:"0 0 15 11",fill:"currentColor",children:s.jsx("path",{d:"M7.5 9.2a1.4 1.4 0 1 1 0 2.8 1.4 1.4 0 0 1 0-2.8Zm0-3.4c1.5 0 2.9.6 3.9 1.6l-1.3 1.3a3.7 3.7 0 0 0-5.2 0L3.6 7.4a5.5 5.5 0 0 1 3.9-1.6Zm0-3.4c2.5 0 4.7 1 6.3 2.6l-1.3 1.3A7.1 7.1 0 0 0 7.5 4.2c-2 0-3.7.8-5 2.1L1.2 5A8.9 8.9 0 0 1 7.5 2.4Z"})}):n!=="none"?s.jsx("span",{className:"gs-statusbar__net",children:n}):null]}),s.jsx("div",{className:"gs-statusbar__time",children:e}),s.jsxs("div",{className:"gs-statusbar__right",children:[l&&s.jsx("svg",{className:"gs-statusbar__bt",width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round",children:s.jsx("path",{d:"M1 3l6 6-3 2.5V0.5l3 2.5-6 6"})}),s.jsxs("span",{className:R("gs-statusbar__battery",x&&"gs-statusbar__battery--low",i&&"gs-statusbar__battery--charging"),style:{"--gs-battery":`${w}%`},children:[s.jsx("i",{}),i&&s.jsx("svg",{className:"gs-statusbar__bolt",width:"7",height:"10",viewBox:"0 0 7 10",fill:"#fff",stroke:"rgba(0,0,0,.6)",strokeWidth:".6",children:s.jsx("path",{d:"M4.2 0.5 0.8 5.6h2.3L2.6 9.5 6.2 4.2H3.9z"})})]})]})]})}),es=a.forwardRef(function({tint:e="black",position:t="bottom",label:n,className:o,children:c,...i},l){const g=se();return s.jsx("div",{ref:l,role:"toolbar","aria-label":n??g.toolbar,className:R("gs-toolbar",`gs-toolbar--${e}`,`gs-toolbar--${t}`,o),...i,children:c})});function ts(){return s.jsx("span",{"aria-hidden":!0,className:"gs-toolbar__spacer"})}const ss=a.forwardRef(function({icon:e,label:t,active:n=!1,badge:o,type:c="button",disabled:i,className:l,...g},p){return s.jsx("button",{ref:p,type:c,"aria-label":t,title:t,disabled:i,className:R("gs-toolbar-button",n&&"gs-toolbar-button--active",i&&"gs-toolbar-button--disabled",l),...g,children:s.jsxs("span",{className:"gs-toolbar-button__icon",children:[s.jsx(ee,{icon:e,size:24,variant:n?"active":"gloss"}),s.jsx(Re,{value:o,className:"gs-toolbar-button__badge"})]})})}),rs=a.forwardRef(function({children:e,subtitle:t,className:n,...o},c){const i=t!=null&&t!==!1;return s.jsxs("div",{ref:c,className:R("gs-toolbar__title",i&&"gs-toolbar__title--stacked",n),...o,children:[s.jsx("span",{className:"gs-toolbar__title-main",children:e}),i&&s.jsx("span",{className:"gs-toolbar__title-sub",children:t})]})});function Fe(r,e){return!Number.isFinite(r)||e<=0?0:Math.min(Math.max(Math.trunc(r),0),e-1)}const ns=a.forwardRef(function({count:e,value:t,defaultValue:n=0,onChange:o,label:c,hideForSinglePage:i=!0,size:l="sm",className:g,onClick:p,onKeyDown:h,...v},w){const x=se(),T=t!==void 0,[M,N]=a.useState(n),y=Fe(T?t:M,e),E=a.useCallback(b=>{const _=Fe(b,e);_!==y&&(T||N(_),o==null||o(_))},[e,y,T,o]),j=b=>{if(p==null||p(b),b.defaultPrevented||b.target.closest(".gs-pagecontrol__page"))return;const{left:_,width:D}=b.currentTarget.getBoundingClientRect(),m=b.clientX>=_+D/2;E(y+(m?1:-1))},d=b=>{var m;if(h==null||h(b),b.defaultPrevented||e<=0)return;let _;switch(b.key){case"ArrowRight":_=(y+1)%e;break;case"ArrowLeft":_=(y-1+e)%e;break;case"Home":_=0;break;case"End":_=e-1;break;default:return}b.preventDefault(),(m=b.currentTarget.querySelectorAll('[role="tab"]')[_])==null||m.focus(),E(_)};if(i&&e<=1)return null;const u=Array.from({length:Math.max(0,Math.trunc(e))},(b,_)=>_);return s.jsx("div",{ref:w,role:"tablist","aria-label":c??x.pages,"aria-orientation":"horizontal",className:R("gs-pagecontrol",`gs-pagecontrol--${l}`,g),onClick:j,onKeyDown:d,...v,children:u.map(b=>{const _=b===y;return s.jsx("button",{type:"button",role:"tab","aria-selected":_,"aria-label":x.pageOf(b+1,u.length),tabIndex:_?0:-1,className:R("gs-pagecontrol__page",_&&"gs-pagecontrol__page--current"),onClick:()=>E(b),children:s.jsx("span",{className:"gs-pagecontrol__dot"})},b)})})}),as=8,it=8,cs=12,os=8,ne=os+it,pe=20,He={top:"bottom",bottom:"top",left:"right",right:"left"};function is(){return{top:0,left:0,width:window.innerWidth,height:window.innerHeight}}function _e(r,e,t){return Math.min(Math.max(r,e),Math.max(e,t))}function ls(r,e){return r.side===e.side&&r.top===e.top&&r.left===e.left&&r.arrowOffset===e.arrowOffset&&r.maxWidth===e.maxWidth&&r.maxHeight===e.maxHeight}const us=a.forwardRef(function({open:e,anchor:t,onClose:n,placement:o="bottom",width:c=240,contained:i=!1,dismissOnOutside:l=!0,label:g,className:p,style:h,children:v,...w},x){const T=se(),M=a.useRef(null),N=a.useCallback(k=>{M.current=k,typeof x=="function"?x(k):x&&(x.current=k)},[x]),[y,E]=a.useState(null),j=a.useRef(n);j.current=n;const d=a.useCallback(()=>{const k=M.current;if(!k)return;let f=is();if(i){const H=k.offsetParent;if(H){const L=H.getBoundingClientRect();f={top:L.top,left:L.left,width:L.width,height:L.height}}}const I=parseFloat(getComputedStyle(k).getPropertyValue("--gs-popover-gap")),O=(Number.isFinite(I)?I:as)+it+cs,Y=k.offsetWidth,V=k.offsetHeight;let q;if(t){const H=t.getBoundingClientRect(),L=H.top-f.top,G=H.left-f.left,K=L+H.height,U=G+H.width,C=G+H.width/2,Z=L+H.height/2,X={top:L,bottom:f.height-K,left:G,right:f.width-U};let Q=o;const re=Q==="top"||Q==="bottom",A=O+(re?V:Y)+ne;X[Q]<A&&X[He[Q]]>X[Q]&&(Q=He[Q]);const B=Math.max(0,re?f.width-2*ne:X[Q]-O-ne),W=Math.max(0,re?X[Q]-O-ne:f.height-2*ne),z=Math.min(Y,B),J=Math.min(V,W);let ie,ce,F;re?(ie=Q==="top"?L-O-J:K+O,ce=_e(C-z/2,ne,f.width-ne-z),F=_e(C-ce,pe,z-pe)):(ce=Q==="left"?G-O-z:U+O,ie=_e(Z-J/2,ne,f.height-ne-J),F=_e(Z-ie,pe,J-pe)),q={side:Q,top:Math.round(ie),left:Math.round(ce),arrowOffset:Math.round(F),maxWidth:B,maxHeight:W}}else{const H=Math.max(0,f.width-2*ne),L=Math.max(0,f.height-2*ne),G=Math.min(Y,H),K=Math.min(V,L);q={side:o,top:Math.round((f.height-K)/2),left:Math.round((f.width-G)/2),arrowOffset:null,maxWidth:H,maxHeight:L}}E(H=>H&&ls(H,q)?H:q)},[t,o,i]);a.useLayoutEffect(()=>{if(!e){E(null);return}d(),window.addEventListener("resize",d),window.addEventListener("scroll",d,!0);const k=M.current,f=k&&typeof ResizeObserver<"u"?new ResizeObserver(()=>d()):null;return k&&(f==null||f.observe(k)),()=>{window.removeEventListener("resize",d),window.removeEventListener("scroll",d,!0),f==null||f.disconnect()}},[e,d]);const u=y!==null;if(a.useEffect(()=>{var f;if(!e||!u)return;const k=document.activeElement;return(f=M.current)==null||f.focus({preventScroll:!0}),()=>{k&&k.isConnected&&typeof k.focus=="function"&&k.focus({preventScroll:!0})}},[e,u]),a.useEffect(()=>{if(!e)return;const k=f=>{var I;f.key==="Escape"&&(f.preventDefault(),(I=j.current)==null||I.call(j))};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[e]),!e)return null;const b=k=>{l&&k.target===k.currentTarget&&(n==null||n())},_=(y==null?void 0:y.side)??o,D=y===null||y.arrowOffset!==null,m={...h,width:c,top:y==null?void 0:y.top,left:y==null?void 0:y.left,maxWidth:y==null?void 0:y.maxWidth,maxHeight:y==null?void 0:y.maxHeight,"--gs-popover-arrow-offset":y&&y.arrowOffset!==null?`${y.arrowOffset}px`:void 0},S=s.jsx("div",{className:R("gs-popover-backdrop",i&&"gs-popover-backdrop--contained",!l&&"gs-popover-backdrop--passthrough"),onClick:b,children:s.jsxs("div",{ref:N,className:R("gs-popover",`gs-popover--${_}`,u&&"gs-popover--ready",p),role:"dialog","aria-modal":"false","aria-label":g??T.dialog,tabIndex:-1,style:m,...w,children:[D&&s.jsx("div",{className:"gs-popover__arrow","aria-hidden":"true"}),s.jsx("div",{className:"gs-popover__content",children:v})]})});return i?S:typeof document>"u"?null:ue.createPortal(S,document.body)});function we(r){return r!=null&&r!==!1&&r!==""}const ds=a.forwardRef(function({open:e,kind:t="loading",title:n,message:o,progress:c,icon:i,duration:l,onClose:g,position:p="center",blocking:h=!1,contained:v=!1,className:w,...x},T){const M=se(),N=a.useRef(g);if(N.current=g,a.useEffect(()=>{if(!e||l===void 0)return;const b=window.setTimeout(()=>{var _;return(_=N.current)==null?void 0:_.call(N)},l);return()=>window.clearTimeout(b)},[e,l,n,t]),!e)return null;const y=we(n),E=we(o),j=t==="loading"||t==="progress"||h;let d=null;switch(t){case"loading":d=s.jsx(ot,{size:37,tone:"white","aria-hidden":y||void 0});break;case"progress":d=s.jsx("div",{className:"gs-hud__progress",children:s.jsx(ct,{value:c,size:"md",tint:"gray",label:typeof n=="string"?n:M.progress})});break;case"success":d=s.jsx(ee,{icon:Xe,variant:"flat",size:56,strokeWidth:3});break;case"error":d=s.jsx(ee,{icon:Rt,variant:"flat",size:56,strokeWidth:3});break;case"custom":d=we(i)?i:null;break}const u=s.jsx("div",{className:R("gs-hud-backdrop",`gs-hud-backdrop--${p}`,v&&"gs-hud-backdrop--contained",h&&"gs-hud-backdrop--blocking"),children:s.jsxs("div",{ref:T,className:R("gs-hud",`gs-hud--${t}`,w),role:t==="error"?"alert":"status","aria-live":t==="error"?"assertive":"polite","aria-busy":j||void 0,...x,children:[d!==null&&s.jsx("div",{className:"gs-hud__graphic",children:d}),y&&s.jsx("div",{className:"gs-hud__title",children:n}),E&&s.jsx("div",{className:"gs-hud__message",children:o})]})});return v?u:typeof document>"u"?null:ue.createPortal(u,document.body)}),oe=r=>r.split("").map(e=>({kind:"char",value:e})),fs={kind:"shift"},Ne={kind:"delete"},je={kind:"space"},Se={kind:"return"},gs={kind:"layer",to:"numbers",text:"123"},hs={kind:"layer",to:"symbols",text:"#+="},We={kind:"layer",to:"letters",text:"ABC",wide:!0},ms={kind:"layer",to:"numbers",text:"123",wide:!0},bs={letters:[oe("qwertyuiop"),oe("asdfghjkl"),[fs,...oe("zxcvbnm"),Ne],[ms,je,Se]],numbers:[oe("1234567890"),oe('-/:;()$&@"'),[hs,...oe(".,?!'"),Ne],[We,je,Se]],symbols:[oe("[]{}#%^*+="),oe("_\\|~<>€£¥•"),[gs,...oe(".,?!'"),Ne],[We,je,Se]]},ps={letters:"letters",numbers:"numbers",symbols:"symbols"},_s={return:"return",Go:"go",Search:"search",Done:"done",Send:"send",Next:"next"},vs=46,ys=300,xs=500,ks=100,ze=r=>r.length===0||/[.!?]\s+$/.test(r)||/\n\s*$/.test(r),ws=a.forwardRef(function({value:e,onChange:t,onKey:n,onBackspace:o,onReturn:c,returnKey:i="return",layer:l,onLayerChange:g,defaultShift:p=!1,autoCapitalize:h=!1,disabled:v=!1,label:w,className:x,...T},M){const N=se(),y=a.useRef(null);a.useImperativeHandle(M,()=>y.current,[]);const[E,j]=a.useState("letters"),d=l??E,[u,b]=a.useState(()=>p||h&&t&&ze(e??"")?"on":"off"),[_,D]=a.useState(null),m=a.useRef({value:e,onChange:t,onBackspace:o,autoCapitalize:h});m.current={value:e,onChange:t,onBackspace:o,autoCapitalize:h};const S=a.useRef(0),k=a.useRef(null),f=a.useRef(null),I=a.useRef(!1),P=()=>{k.current&&clearTimeout(k.current),f.current&&clearInterval(f.current),k.current=null,f.current=null};a.useEffect(()=>P,[]);const O=(A,B)=>{const{autoCapitalize:W,onChange:z}=m.current;b(J=>J==="caps"?J:W&&z?ze(A)?"on":"off":B?"off":J)},Y=A=>{A!==d&&(l===void 0&&j(A),g==null||g(A),O(e??"",!0))},V=A=>{const B=d==="letters",W=B&&u!=="off"?A.toUpperCase():A,z=(e??"")+W;n==null||n(W),t==null||t(z),O(z,B)},q=()=>{const A=(e??"")+" ";n==null||n(" "),t==null||t(A),O(A,!1)},H=()=>{const A=i==="return",B=A?(e??"")+`
72
+ `:e??"";n==null||n(`
73
+ `),c==null||c(),A&&(t==null||t(B)),O(B,!1)},L=()=>{const{value:A,onChange:B,onBackspace:W}=m.current,z=(A??"").slice(0,-1);W==null||W(),B==null||B(z),O(z,!1)},G=()=>{const A=Date.now(),B=A-S.current<ys;S.current=A,b(W=>W==="caps"?"off":W==="on"?B?"caps":"off":"on")},K=A=>{const B=y.current;if(!B)return;const W=A.getBoundingClientRect(),z=B.getBoundingClientRect(),J=(vs-W.width)/2;if(W.left-J<z.left)return"left";if(W.right+J>z.right)return"right"},U=(A,B)=>W=>{W.preventDefault(),!(W.button!==0&&W.pointerType==="mouse")&&(D({id:A,edge:B.kind==="char"?K(W.currentTarget):void 0}),B.kind==="delete"&&(P(),I.current=!1,k.current=setTimeout(()=>{I.current=!0,L(),f.current=setInterval(L,ks)},xs)))},C=()=>{D(null),P()},Z=A=>A.preventDefault(),X=A=>B=>{switch(A.kind){case"char":V(A.value);break;case"space":q();break;case"return":H();break;case"shift":G();break;case"layer":Y(A.to);break;case"delete":I.current&&B.detail!==0?I.current=!1:L();break}},Q=d==="letters"&&u!=="off",re=(A,B)=>{const W=(_==null?void 0:_.id)===B,z={type:"button",disabled:v,onPointerDown:U(B,A),onPointerUp:C,onPointerLeave:C,onPointerCancel:C,onMouseDown:Z,onClick:X(A)};switch(A.kind){case"char":{const J=Q?A.value.toUpperCase():A.value;return s.jsxs("button",{...z,className:R("gs-keyboard__key","gs-keyboard__key--letter",d!=="letters"&&"gs-keyboard__key--symbol",W&&"gs-keyboard__key--pressed"),children:[J,W&&s.jsx("span",{"aria-hidden":"true",className:R("gs-keyboard__popup",(_==null?void 0:_.edge)==="left"&&"gs-keyboard__popup--left",(_==null?void 0:_.edge)==="right"&&"gs-keyboard__popup--right"),children:J})]},B)}case"shift":return s.jsx("button",{...z,"aria-label":N.shift,"aria-pressed":u!=="off",className:R("gs-keyboard__key","gs-keyboard__key--fn","gs-keyboard__key--shift",u==="on"&&"gs-keyboard__key--shift-on",u==="caps"&&"gs-keyboard__key--caps",W&&"gs-keyboard__key--pressed"),children:s.jsx(ee,{icon:xt,variant:"flat",size:22,strokeWidth:2,fill:u!=="off"?"currentColor":"none",className:"gs-keyboard__icon"})},B);case"delete":return s.jsx("button",{...z,"aria-label":N.delete,className:R("gs-keyboard__key","gs-keyboard__key--fn","gs-keyboard__key--delete",W&&"gs-keyboard__key--pressed"),children:s.jsx(ee,{icon:jt,variant:"flat",size:22,strokeWidth:2,className:"gs-keyboard__icon"})},B);case"layer":return s.jsx("button",{...z,"aria-label":N[ps[A.to]],className:R("gs-keyboard__key","gs-keyboard__key--fn",A.wide&&"gs-keyboard__key--wide",W&&"gs-keyboard__key--pressed"),children:A.text},B);case"space":return s.jsx("button",{...z,"aria-label":N.space,className:R("gs-keyboard__key","gs-keyboard__key--space",W&&"gs-keyboard__key--pressed"),children:N.space},B);case"return":{const J=N[_s[i]];return s.jsx("button",{...z,"aria-label":J,className:R("gs-keyboard__key","gs-keyboard__key--return",i!=="return"&&"gs-keyboard__key--return-blue",W&&"gs-keyboard__key--pressed"),children:J},B)}}};return s.jsx("div",{ref:y,role:"group","aria-label":w??N.keyboard,"aria-disabled":v||void 0,className:R("gs-keyboard",v&&"gs-keyboard--disabled",x),...T,children:bs[d].map((A,B)=>s.jsx("div",{className:R("gs-keyboard__row",B===1&&"gs-keyboard__row--inset",B===3&&"gs-keyboard__row--bottom"),children:A.map((W,z)=>re(W,`${B}-${z}`))},B))})}),Ee=r=>String(r).padStart(2,"0");function lt(r,e){return new Date(e,r,0).getDate()}function Me(r){return`${r.getFullYear()}-${Ee(r.getMonth()+1)}-${Ee(r.getDate())}`}function Ns(r){const[e,t,n]=r.split("-").map(Number);return[e,t,n]}function Ue(r,e){const t=new Date(r.getTime());t.setSeconds(0,0);const n=Math.round(t.getMinutes()/e)*e;return n!==t.getMinutes()&&t.setMinutes(n),t}function Ye(r,e){const t=r.getHours(),n={minute:String(r.getMinutes())};return e==="h12"?(n.hour=String(t%12||12),n.period=t<12?"am":"pm"):n.hour=String(t),n}function js(r,e,t){switch(e){case"date":return{month:String(r.getMonth()+1),day:String(r.getDate()),year:String(r.getFullYear())};case"time":return Ye(r,t);case"dateTime":return{day:Me(r),...Ye(r,t)}}}function Ss(r,e,t,n){let o=e.getFullYear(),c=e.getMonth()+1,i=e.getDate(),l=e.getHours(),g=e.getMinutes();t==="date"?(o=Number(r.year),c=Number(r.month),i=Number(r.day)):t==="dateTime"&&([o,c,i]=Ns(r.day)),t!=="date"&&(g=Number(r.minute),l=n==="h12"?Number(r.hour)%12+(r.period==="pm"?12:0):Number(r.hour)),i=Math.min(i,lt(c,o));const p=new Date(e.getTime());return p.setFullYear(o,c-1,i),p.setHours(l,g,0,0),p}function Ts(r){const e=new Intl.DateTimeFormat(r,{month:"long"});return Array.from({length:12},(t,n)=>({value:String(n+1),label:e.format(new Date(2e3,n,1))}))}function fe(r,e,t=1,n=!1){const o=[];for(let c=r;c<=e;c+=t)o.push({value:String(c),label:n?Ee(c):String(c)});return o}function Es(r,e,t){const n=(o,c)=>{var i;try{return((i=new Intl.DateTimeFormat(r,{hour:"numeric",hour12:!0}).formatToParts(new Date(2e3,0,1,o)).find(g=>g.type==="dayPeriod"))==null?void 0:i.value)??c}catch{return c}};return[{value:"am",label:n(9,e)},{value:"pm",label:n(21,t)}]}function Rs(r,e,t,n,o){const c=new Intl.DateTimeFormat(t,{weekday:"short",month:"short",day:"numeric"}),i=[];for(let l=-e;l<=e;l++){const g=new Date(r.getFullYear(),r.getMonth(),r.getDate()+l,12),p=Me(g);i.push({value:p,label:p===n?o:c.format(g)})}return i}const Ms=a.forwardRef(function({mode:e="date",value:t,defaultValue:n,onChange:o,minuteInterval:c=1,hourCycle:i="h12",yearRange:l=[1970,2037],dayRange:g=365,locale:p,rows:h,disabled:v,label:w,className:x,...T},M){const N=se(),y=Ge(),E=p??y??"en-US",j=t!==void 0,[d,u]=a.useState(()=>Ue(n??new Date,c)),b=j?t:d,_=e==="date"?b:Ue(b,c),D=js(_,e,i),[m,S]=a.useState(()=>b),k=Math.round((new Date(_.getFullYear(),_.getMonth(),_.getDate(),12).getTime()-new Date(m.getFullYear(),m.getMonth(),m.getDate(),12).getTime())/864e5);e==="dateTime"&&Math.abs(k)>g&&S(_);const f=Number(D.month),I=Number(D.year),[P,O]=l,Y=Me(new Date),V=a.useMemo(()=>Ts(E),[E]),q=a.useMemo(()=>e==="date"?fe(1,lt(f,I)):[],[e,f,I]),H=a.useMemo(()=>fe(P,O),[P,O]),L=a.useMemo(()=>i==="h12"?fe(1,12):fe(0,23),[i]),G=a.useMemo(()=>fe(0,59,c,!0),[c]),K=a.useMemo(()=>Es(E,N.am,N.pm),[E,N.am,N.pm]),U=a.useMemo(()=>e==="dateTime"?Rs(m,g,E,Y,N.today):[],[e,m,g,E,Y,N.today]),{month:C,day:Z,year:X,hour:Q,minute:re,dayPeriod:A}=N,B=a.useMemo(()=>{const z=i==="h12";switch(e){case"date":return[{key:"month",label:C,align:"left",width:"46%",options:V},{key:"day",label:Z,align:"right",width:"20%",options:q},{key:"year",label:X,width:"34%",options:H}];case"time":return[{key:"hour",label:Q,align:"right",width:z?"34%":"50%",options:L},{key:"minute",label:re,width:z?"33%":"50%",options:G},...z?[{key:"period",label:A,width:"33%",options:K}]:[]];case"dateTime":return[{key:"day",label:Z,align:"left",width:z?"44%":"56%",options:U},{key:"hour",label:Q,align:"right",width:z?"18%":"22%",options:L},{key:"minute",label:re,width:z?"18%":"22%",options:G},...z?[{key:"period",label:A,width:"20%",options:K}]:[]]}},[e,i,V,q,H,L,G,K,U,C,Z,X,Q,re,A]),W=z=>{const J=Ss(z,b,e,i);j||u(J),o==null||o(J)};return s.jsx(at,{ref:M,columns:B,value:D,onChange:W,rows:h,disabled:v,label:w??N[e],className:R("gs-datepicker",`gs-datepicker--${e.toLowerCase()}`,x),...T})}),Is='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';function ve(r){return Array.from(r.querySelectorAll(Is)).filter(e=>e.tabIndex>=0&&!e.disabled&&e.getClientRects().length>0)}const Ds=a.forwardRef(function({open:e,onClose:t,title:n,left:o,right:c,tint:i="black",background:l="pinstripe",bodyClassName:g,contained:p=!1,label:h,className:v,children:w,...x},T){const M=se(),y=`${a.useId()}-title`,E=typeof n=="string",j=a.useRef(null),d=a.useCallback(m=>{j.current=m,typeof T=="function"?T(m):T&&(T.current=m)},[T]),u=a.useRef(t);if(u.current=t,a.useEffect(()=>{if(!e)return;const m=document.activeElement,S=j.current;if(S){const k=S.querySelector(".gs-modalsheet__body"),f=S.querySelector(".gs-navbar__right");((k&&ve(k)[0])??(f&&ve(f)[0])??ve(S)[0]??S).focus({preventScroll:!0})}return()=>{m&&m.isConnected&&typeof m.focus=="function"&&m.focus()}},[e]),a.useEffect(()=>{if(!e)return;const m=S=>{var V;if(S.key==="Escape"){S.preventDefault(),(V=u.current)==null||V.call(u);return}if(S.key!=="Tab")return;const k=j.current;if(!k)return;const f=ve(k);if(f.length===0){S.preventDefault(),k.focus();return}const I=f[0],P=f[f.length-1],O=document.activeElement,Y=O!==null&&k.contains(O);S.shiftKey?(!Y||O===I||O===k)&&(S.preventDefault(),P.focus()):(!Y||O===P)&&(S.preventDefault(),I.focus())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[e]),!e)return null;const b=o===void 0?s.jsx(Te,{onClick:()=>t==null?void 0:t(),children:M.cancel}):o,_=c===void 0?s.jsx(Te,{variant:"done",onClick:()=>t==null?void 0:t(),children:M.done}):c,D=s.jsx("div",{className:R("gs-modalsheet-backdrop",p&&"gs-modalsheet-backdrop--contained"),children:s.jsxs("div",{ref:d,className:R("gs-modalsheet",v),role:"dialog","aria-modal":"true","aria-labelledby":E?y:void 0,"aria-label":E?void 0:h??M.dialog,tabIndex:-1,...x,children:[s.jsx(Ke,{className:"gs-modalsheet__bar",tint:i,title:E?s.jsx("span",{id:y,children:n}):n,"aria-label":E?n:void 0,left:b,right:_}),s.jsx("div",{className:R("gs-modalsheet__body",`gs-modalsheet__body--${l}`,g),children:w})]})});return p?D:typeof document>"u"?null:ue.createPortal(D,document.body)}),Ps=500,As=100,Ls=50,$s=2e3;function qe(r){var t;const e=/(?:\.(\d+))?(?:e-(\d+))?$/.exec(String(r));return(((t=e==null?void 0:e[1])==null?void 0:t.length)??0)+Number((e==null?void 0:e[2])??0)}function ut(r,{min:e,max:t}){return Math.min(t,Math.max(e,r))}function Bs(r,e,t){const{min:n,max:o,step:c,wraps:i}=t,l=Math.min(20,Math.max(qe(c),qe(n))),g=Number((r+e*c).toFixed(l));return i?g>o?n:g<n?o:g:ut(g,t)}const Os=a.forwardRef(function({value:e,defaultValue:t,onChange:n,min:o=0,max:c=100,step:i=1,wraps:l=!1,autoRepeat:g=!0,showValue:p=!1,formatValue:h,size:v="sm",tint:w="dark",disabled:x=!1,label:T,decrementLabel:M="Decrease",incrementLabel:N="Increase",className:y,...E},j){const d={min:o,max:c,step:i,wraps:l},u=e!==void 0,[b,_]=a.useState(()=>ut(t??o,d)),D=u?e:b,m=a.useRef({current:D,config:d,onChange:n,isControlled:u});m.current={current:D,config:d,onChange:n,isControlled:u};const S=a.useRef(null),k=a.useRef(!1),f=()=>{S.current&&clearTimeout(S.current),S.current=null};a.useEffect(()=>f,[]);const I=U=>{const{current:C,onChange:Z,isControlled:X}=m.current;return U===C?!1:(X||(m.current.current=U,_(U)),Z==null||Z(U),!0)},P=U=>I(Bs(m.current.current,U,m.current.config)),O=U=>C=>{if(!g||x||C.button!==0)return;f(),k.current=!1;const Z=Date.now(),X=()=>{if(k.current=!0,!P(U)){f();return}const Q=Date.now()-Z>=$s;S.current=setTimeout(X,Q?Ls:As)};S.current=setTimeout(X,Ps)},Y=U=>C=>{if(k.current&&C.detail!==0){k.current=!1;return}P(U)},V=U=>{if(!x){switch(U.key){case"ArrowUp":case"ArrowRight":P(1);break;case"ArrowDown":case"ArrowLeft":P(-1);break;case"Home":I(o);break;case"End":I(c);break;default:return}U.preventDefault()}},q=D<=o,H=D>=c,L=x||!l&&q,G=x||!l&&H,K=(U,{text:C,icon:Z,isDisabled:X})=>s.jsx("button",{type:"button","aria-label":C,"aria-disabled":X||void 0,disabled:X,className:R("gs-stepper__button",U===1?"gs-stepper__button--increment":"gs-stepper__button--decrement"),onPointerDown:O(U),onPointerUp:f,onPointerLeave:f,onPointerCancel:f,onClick:Y(U),onKeyDown:V,children:s.jsx(ee,{icon:Z,variant:"flat",size:16,strokeWidth:3,className:"gs-stepper__icon"})});return s.jsxs("div",{ref:j,role:"group","aria-label":T,"aria-disabled":x||void 0,className:R("gs-stepper",`gs-stepper--${v}`,`gs-stepper--${w}`,x&&"gs-stepper--disabled",y),...E,children:[p&&s.jsx("span",{className:"gs-stepper__value","aria-live":"polite","aria-atomic":"true",children:h?h(D):String(D)}),s.jsxs("span",{className:"gs-stepper__buttons",children:[K(-1,{text:M,icon:St,isDisabled:L}),K(1,{text:N,icon:Tt,isDisabled:G})]})]})}),Fs=a.forwardRef(function({value:e,defaultValue:t,onChange:n,onSearch:o,onCancel:c,placeholder:i,scopes:l,scope:g,defaultScope:p,onScopeChange:h,showsScopeBar:v="always",showsCancel:w="whileEditing",cancelLabel:x,tint:T="black",autoFocus:M,disabled:N=!1,label:y,inputProps:E,className:j,onFocus:d,onBlur:u,...b},_){const D=se(),m=a.useRef(null),S=e!==void 0,[k,f]=a.useState(t??""),I=S?e:k,P=g!==void 0,[O,Y]=a.useState(()=>{var F;return p??((F=l==null?void 0:l[0])==null?void 0:F.value)}),V=P?g:O,[q,H]=a.useState(!1);a.useEffect(()=>{const F=m.current;F&&F.contains(document.activeElement)&&H(!0)},[]);const L=q||I.length>0,G=!!l&&l.length>0,K=w==="always"||w==="whileEditing"&&L&&!N,U=G&&(v==="always"||L),C=F=>{S||f(F),n==null||n(F)},{onChange:Z,onKeyDown:X,...Q}=E??{},re=F=>{Z==null||Z(F),C(F.target.value)},A=F=>{X==null||X(F),!F.defaultPrevented&&F.key==="Enter"&&(o==null||o(I))},B=()=>{var ge;C("");const F=document.activeElement;F instanceof HTMLElement&&((ge=m.current)!=null&&ge.contains(F))&&F.blur(),c==null||c()},W=F=>{d==null||d(F),H(!0)},z=F=>{u==null||u(F),F.currentTarget.contains(F.relatedTarget)||H(!1)},J=F=>{P||Y(F),h==null||h(F)},ie=F=>F.preventDefault(),ce=y??D.search;return s.jsxs("div",{ref:m,role:"search","aria-label":ce,className:R("gs-searchbar",`gs-searchbar--${T}`,L&&"gs-searchbar--editing",N&&"gs-searchbar--disabled",G&&"gs-searchbar--has-scopes",K&&"gs-searchbar--show-cancel",U&&"gs-searchbar--show-scopes",j),onFocus:W,onBlur:z,...b,children:[s.jsx("div",{className:"gs-searchbar__row",children:s.jsx(Je,{"aria-label":ce,...Q,ref:_,wrapperClassName:"gs-searchbar__field",value:I,onChange:re,onKeyDown:A,placeholder:i,disabled:N,autoFocus:M,showCancel:w!=="never",cancelLabel:x,onCancel:B})}),G&&s.jsx("div",{className:"gs-searchbar__scopes",onMouseDown:ie,children:s.jsx("div",{className:"gs-searchbar__scopes-clip",children:s.jsx(tt,{className:"gs-searchbar__segments",size:"sm",block:!0,tint:T==="blue"?"blue":"dark",value:V,onChange:J,children:l.map(F=>s.jsx(st,{value:F.value,disabled:N||F.disabled,children:F.label},F.value))})})})]})});function Hs(r){return r!=null&&r!==!1&&r!==""}function Ws(r){if(!(r instanceof Element))return!1;try{return r.matches(":focus-visible")}catch{return!0}}const zs=.4,Us=4,Ys=160,qs=a.forwardRef(function({open:e,title:t,message:n,icon:o,iconTint:c="gray",actionLabel:i,onAction:l,onClick:g,duration:p=4e3,onClose:h,dismissOnAction:v=!0,contained:w=!1,label:x="Notification",className:T,style:M,onKeyDown:N,onPointerDown:y,onPointerEnter:E,onPointerLeave:j,onFocus:d,onBlur:u,onTransitionEnd:b,..._},D){const m=a.useRef(h);m.current=h;const S=a.useRef(null),k=a.useRef(0),f=a.useRef(0),I=a.useRef(!1),P=a.useRef({hover:!1,focus:!1,press:!1}),O=a.useCallback(()=>{S.current!==null&&(window.clearTimeout(S.current),S.current=null)},[]),Y=a.useCallback(()=>{if(!I.current)return;const $=P.current;if($.hover||$.focus||$.press){if(S.current===null)return;f.current=Math.max(0,k.current-Date.now()),O()}else S.current===null&&(k.current=Date.now()+f.current,S.current=window.setTimeout(()=>{var de;S.current=null,I.current=!1,(de=m.current)==null||de.call(m)},f.current))},[O]),V=a.useCallback(()=>{var $;I.current=!1,O(),($=m.current)==null||$.call(m)},[O]),q=a.useRef(null),H=a.useRef(null),L=a.useRef(null),[G,K]=a.useState(null),[U,C]=a.useState(!1),Z=a.useCallback(()=>{L.current!==null&&(window.clearTimeout(L.current),L.current=null,V())},[V]),X=a.useCallback(()=>{I.current=!1,O(),K(null),C(!0),L.current=window.setTimeout(Z,Ys)},[O,Z]);a.useEffect(()=>(P.current={hover:!1,focus:!1,press:!1},q.current=null,K(null),C(!1),()=>{var $;($=H.current)==null||$.call(H),L.current!==null&&(window.clearTimeout(L.current),L.current=null)}),[e]),a.useEffect(()=>{if(!(!e||p<=0))return I.current=!0,f.current=p,Y(),()=>{I.current=!1,O()}},[e,p,t,Y,O]);const Q=$=>{var Ae;if(y==null||y($),$.defaultPrevented||!$.isPrimary||$.button!==0||U)return;(Ae=H.current)==null||Ae.call(H);const te={pointerId:$.pointerId,startY:$.clientY,height:$.currentTarget.offsetHeight||60,moved:!1};q.current=te,P.current.press=!0,Y();const de=le=>{if(le.pointerId!==te.pointerId)return;const me=le.clientY-te.startY;!te.moved&&Math.abs(me)>Us&&(te.moved=!0),te.moved&&K(Math.max(-te.height,Math.min(0,me)))},he=le=>{if(le.pointerId!==te.pointerId)return;xe(),P.current.press=!1;const me=le.type==="pointercancel"?0:le.clientY-te.startY;te.moved&&-me>te.height*zs?X():(K(null),Y()),te.moved?window.setTimeout(()=>{q.current===te&&(q.current=null)},0):q.current=null},xe=()=>{window.removeEventListener("pointermove",de),window.removeEventListener("pointerup",he),window.removeEventListener("pointercancel",he),H.current===xe&&(H.current=null)};H.current=xe,window.addEventListener("pointermove",de),window.addEventListener("pointerup",he),window.addEventListener("pointercancel",he)},re=$=>{var te;(te=q.current)!=null&&te.moved&&($.stopPropagation(),$.preventDefault())},A=()=>{U||(g==null||g(),v&&V())},B=$=>{$.stopPropagation(),!U&&(l==null||l(),v&&V())},W=$=>{N==null||N($),!$.defaultPrevented&&($.key==="Escape"?($.preventDefault(),V()):$.key==="Enter"&&$.target===$.currentTarget&&($.preventDefault(),A()))},z=$=>{E==null||E($),P.current.hover=!0,Y()},J=$=>{j==null||j($),P.current.hover=!1,Y()},ie=$=>{d==null||d($),P.current.focus=Ws($.target),Y()},ce=$=>{u==null||u($),!$.currentTarget.contains($.relatedTarget)&&(P.current.focus=!1,Y())},F=$=>{b==null||b($),U&&$.target===$.currentTarget&&$.propertyName==="transform"&&Z()};if(!e)return null;const ge=Hs(n),Ie=typeof i=="string"&&i!=="",De=G!==null,dt=De?{...M,transform:`translateY(${G}px)`}:M,Pe=s.jsxs("div",{ref:D,className:R("gs-banner",w&&"gs-banner--contained",Ie&&"gs-banner--has-action",De&&"gs-banner--dragging",U&&"gs-banner--leaving",T),style:dt,role:"status","aria-live":"polite","aria-atomic":"true","aria-label":x,tabIndex:0,onClick:A,onClickCapture:re,onKeyDown:W,onPointerDown:Q,onPointerEnter:z,onPointerLeave:J,onFocus:ie,onBlur:ce,onTransitionEnd:F,..._,children:[s.jsx("span",{className:R("gs-banner__tile",`gs-banner__tile--${c}`),"aria-hidden":"true",children:o}),s.jsxs("div",{className:"gs-banner__body",children:[s.jsx("div",{className:"gs-banner__title",children:t}),ge&&s.jsx("div",{className:"gs-banner__message",children:n})]}),Ie&&s.jsx("button",{type:"button",className:"gs-banner__action",onClick:B,children:i}),s.jsx("span",{className:"gs-banner__grip","aria-hidden":"true"})]});return w?Pe:typeof document>"u"?null:ue.createPortal(Pe,document.body)});exports.ActionSheet=zt;exports.ActivityIndicator=ot;exports.Alert=Bt;exports.Badge=Re;exports.BarButton=Te;exports.Button=ht;exports.DatePicker=Ms;exports.GsProvider=bt;exports.HUD=ds;exports.Icon=ee;exports.Keyboard=ws;exports.List=Pt;exports.ListItem=$t;exports.ModalSheet=Ds;exports.NavigationBar=Ke;exports.NotificationBanner=qs;exports.PageControl=ns;exports.Picker=at;exports.Popover=us;exports.ProgressBar=ct;exports.SearchBar=Fs;exports.SearchField=Je;exports.Segment=st;exports.SegmentedControl=tt;exports.Slider=Wt;exports.StatusBar=Ct;exports.Stepper=Os;exports.Switch=pt;exports.TabBar=It;exports.TabBarItem=Dt;exports.TextField=Qe;exports.Toolbar=es;exports.ToolbarButton=ss;exports.ToolbarSpacer=ts;exports.ToolbarTitle=rs;exports.cn=R;exports.defaultStrings=Ve;exports.useGsLocale=Ge;exports.useGsStrings=se;
@@ -0,0 +1,27 @@
1
+ export { cn } from './lib/cn';
2
+ export * from './components/Icon';
3
+ export * from './components/Badge';
4
+ export * from './components/Button';
5
+ export * from './components/Switch';
6
+ export * from './components/TextField';
7
+ export * from './components/NavigationBar';
8
+ export * from './components/TabBar';
9
+ export * from './components/List';
10
+ export * from './components/Alert';
11
+ export * from './components/SegmentedControl';
12
+ export * from './components/Slider';
13
+ export * from './components/ActionSheet';
14
+ export * from './components/Picker';
15
+ export * from './components/Progress';
16
+ export * from './components/StatusBar';
17
+ export * from './components/Toolbar';
18
+ export * from './components/PageControl';
19
+ export * from './components/Popover';
20
+ export * from './components/HUD';
21
+ export * from './components/Keyboard';
22
+ export * from './components/DatePicker';
23
+ export * from './components/ModalSheet';
24
+ export * from './lib/i18n';
25
+ export * from './components/Stepper';
26
+ export * from './components/SearchBar';
27
+ export * from './components/NotificationBanner';