@eschoolbase/client-ui 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +211 -2
- package/dist/components/AccountPanel/AccountPanel.d.ts +8 -0
- package/dist/components/AccountPanel/AccountPanel.types.d.ts +65 -0
- package/dist/components/AccountPanel/index.d.ts +2 -0
- package/dist/components/Avatar/Avatar.d.ts +4 -0
- package/dist/components/Avatar/Avatar.types.d.ts +14 -0
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/Badge/Badge.d.ts +3 -0
- package/dist/components/Badge/Badge.types.d.ts +8 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Button/Button.d.ts +2 -0
- package/dist/components/Button/Button.types.d.ts +14 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.d.ts +3 -0
- package/dist/components/Checkbox/Checkbox.types.d.ts +10 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/FormField/FormField.d.ts +2 -0
- package/dist/components/FormField/FormField.types.d.ts +43 -0
- package/dist/components/FormField/FormFieldContext.d.ts +8 -0
- package/dist/components/FormField/index.d.ts +3 -0
- package/dist/components/FormSection/FormSection.d.ts +6 -0
- package/dist/components/FormSection/FormSection.types.d.ts +15 -0
- package/dist/components/FormSection/index.d.ts +2 -0
- package/dist/components/Input/Input.d.ts +2 -0
- package/dist/components/Input/Input.types.d.ts +15 -0
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Select/Select.d.ts +7 -0
- package/dist/components/Select/Select.types.d.ts +57 -0
- package/dist/components/Select/SelectControl.d.ts +2 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Skeleton/Skeleton.d.ts +3 -0
- package/dist/components/Skeleton/Skeleton.types.d.ts +10 -0
- package/dist/components/Skeleton/index.d.ts +2 -0
- package/dist/components/Switch/Switch.d.ts +3 -0
- package/dist/components/Switch/Switch.types.d.ts +8 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Tabs/Tabs.d.ts +6 -0
- package/dist/components/Tabs/Tabs.types.d.ts +20 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Textarea/Textarea.d.ts +3 -0
- package/dist/components/Textarea/Textarea.types.d.ts +12 -0
- package/dist/components/Textarea/index.d.ts +2 -0
- package/dist/components/ThemeToggle/ThemeToggle.d.ts +6 -0
- package/dist/components/ThemeToggle/ThemeToggle.types.d.ts +13 -0
- package/dist/components/ThemeToggle/index.d.ts +2 -0
- package/dist/components/Typography/Typography.d.ts +3 -0
- package/dist/components/Typography/Typography.types.d.ts +22 -0
- package/dist/components/Typography/index.d.ts +2 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +1405 -0
- package/dist/index.js.map +1 -0
- package/dist/license/UnlicensedNotice.d.ts +2 -0
- package/dist/license/hash.d.ts +1 -0
- package/dist/license/index.d.ts +2 -0
- package/dist/license/keys.d.ts +6 -0
- package/dist/license/license.d.ts +7 -0
- package/dist/styles.css +2 -0
- package/dist/theme/ThemeProvider.d.ts +4 -0
- package/dist/theme/ThemeProvider.types.d.ts +30 -0
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/themeStore.d.ts +5 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/utils/cn.d.ts +3 -0
- package/package.json +75 -4
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface TabItem<T extends string = string> {
|
|
3
|
+
value: T;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
/** Icon element shown before the label. */
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
/** Panel content, rendered when the tab is active. Omit to manage content yourself. */
|
|
9
|
+
content?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export interface TabsProps<T extends string = string> extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
12
|
+
items: TabItem<T>[];
|
|
13
|
+
/** Active tab (controlled). */
|
|
14
|
+
value?: T;
|
|
15
|
+
/** Initially active tab (uncontrolled). Defaults to the first enabled tab. */
|
|
16
|
+
defaultValue?: T;
|
|
17
|
+
onValueChange?: (value: T) => void;
|
|
18
|
+
/** Accessible name of the tab list, e.g. "Lead sections". */
|
|
19
|
+
'aria-label'?: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { TextareaProps } from './Textarea.types';
|
|
2
|
+
/** Multi-line text input with the same label, helper and error handling as `Input`. */
|
|
3
|
+
export declare const Textarea: import("react").ForwardRefExoticComponent<TextareaProps & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode, TextareaHTMLAttributes } from 'react';
|
|
2
|
+
export type TextareaResize = 'none' | 'vertical' | 'horizontal' | 'both';
|
|
3
|
+
export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
4
|
+
label?: ReactNode;
|
|
5
|
+
helperText?: ReactNode;
|
|
6
|
+
/** Error message. When set, the textarea is marked invalid. */
|
|
7
|
+
error?: ReactNode;
|
|
8
|
+
/** Visible rows. Defaults to 3. */
|
|
9
|
+
rows?: number;
|
|
10
|
+
/** Which directions the user can resize. Defaults to `vertical`. */
|
|
11
|
+
resize?: TextareaResize;
|
|
12
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ThemeToggleProps } from './ThemeToggle.types';
|
|
2
|
+
/**
|
|
3
|
+
* Switch between themes (light / dark / system by default). Must be inside a
|
|
4
|
+
* `ThemeProvider`. Built on radio inputs, so arrow keys and screen readers work natively.
|
|
5
|
+
*/
|
|
6
|
+
export declare function ThemeToggle({ modes, compact, className, 'aria-label': ariaLabel, ...rest }: ThemeToggleProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
import type { Theme } from '../../theme';
|
|
3
|
+
export interface ThemeToggleProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
4
|
+
/**
|
|
5
|
+
* The choices to offer, in order. Defaults to `['light', 'dark', 'system']`.
|
|
6
|
+
* Custom theme names are shown with their name as the label.
|
|
7
|
+
*/
|
|
8
|
+
modes?: Theme[];
|
|
9
|
+
/** Show only the icons, with the names as tooltips. */
|
|
10
|
+
compact?: boolean;
|
|
11
|
+
/** Accessible name of the group. Defaults to "Theme". */
|
|
12
|
+
'aria-label'?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { TypographyProps } from './Typography.types';
|
|
2
|
+
/** Themed text. Pick the look with `variant` and the HTML element with `as`. */
|
|
3
|
+
export declare function Typography({ variant, as, color, weight, align, truncate, className, ...rest }: TypographyProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type TypographyVariant = 'h1' | 'h2' | 'h3' | 'h4' | 'body' | 'body-sm' | 'caption' | 'label';
|
|
3
|
+
export type TypographyColor = 'default' | 'secondary' | 'muted' | 'disabled' | 'primary' | 'success' | 'warning' | 'danger' | 'info';
|
|
4
|
+
export type TypographyWeight = 'normal' | 'medium' | 'semibold' | 'bold';
|
|
5
|
+
export type TypographyAlign = 'start' | 'center' | 'end';
|
|
6
|
+
export type TypographyElement = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div' | 'label' | 'small' | 'strong' | 'em';
|
|
7
|
+
export interface TypographyProps extends HTMLAttributes<HTMLElement> {
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
/** Visual style. Defaults to `body`. */
|
|
10
|
+
variant?: TypographyVariant;
|
|
11
|
+
/** Rendered element. Defaults to the semantic element for the variant (e.g. `h1` for `h1`, `p` for `body`). */
|
|
12
|
+
as?: TypographyElement;
|
|
13
|
+
/** Text color token. Defaults to `default`. */
|
|
14
|
+
color?: TypographyColor;
|
|
15
|
+
/** Overrides the weight of the variant. */
|
|
16
|
+
weight?: TypographyWeight;
|
|
17
|
+
align?: TypographyAlign;
|
|
18
|
+
/** Single line with an ellipsis. */
|
|
19
|
+
truncate?: boolean;
|
|
20
|
+
/** Only for `as="label"`. */
|
|
21
|
+
htmlFor?: string;
|
|
22
|
+
}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react"),t=require("react/jsx-runtime"),n=require("react-dom");function r(...e){return e.filter(Boolean).join(` `)}var i=`client-ui:`;function a(e){let t=i+e.trim(),n=3735928559,r=1103547991;for(let e=0;e<t.length;e++){let i=t.charCodeAt(e);n=Math.imul(n^i,2654435761),r=Math.imul(r^i,1597334677)}return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(16).padStart(14,`0`)}var o=[`1cd9d9bd20471f`],s=``,c=new Set,l=!1,u=(0,e.createContext)(null);function d(e){s=e,l=!1,c.forEach(e=>e())}function f(e){return!e||!e.trim()?!1:o.includes(a(e))}var p=e=>(c.add(e),()=>{c.delete(e)}),m=()=>s;function h(){let t=(0,e.useContext)(u),n=(0,e.useSyncExternalStore)(p,m,m),r=f(t??n);return(0,e.useEffect)(()=>{r||l||(l=!0,console.error(`[client-ui] Missing or invalid license key. Components are disabled. Pass licenseKey to <ThemeProvider> or call setLicenseKey() once at app start.`))},[r]),r}var g={root:`cui-UnlicensedNotice-module__root--FdnRG`};function _(){return(0,t.jsx)(`span`,{role:`alert`,className:g.root,children:`client-ui: missing or invalid license key`})}var v={button:`cui-Button-module__button--2ZuB7`,sm:`cui-Button-module__sm--NhG0g`,md:`cui-Button-module__md--hH4h3`,lg:`cui-Button-module__lg--2plQf`,fullWidth:`cui-Button-module__fullWidth--36oJT`,primary:`cui-Button-module__primary--s1sM6`,secondary:`cui-Button-module__secondary--R0waJ`,outline:`cui-Button-module__outline--F5jq-`,ghost:`cui-Button-module__ghost--1KINV`,danger:`cui-Button-module__danger--V4fX8`,link:`cui-Button-module__link--Zt5hw`,spinner:`cui-Button-module__spinner--ZExvW`,spin:`cui-Button-module__spin--JvkZu`},y=(0,e.forwardRef)(function({variant:e=`primary`,size:n=`md`,loading:i=!1,fullWidth:a=!1,type:o=`button`,disabled:s,className:c,children:l,...u},d){return h()?(0,t.jsxs)(`button`,{...u,ref:d,type:o,disabled:s||i,"aria-busy":i||void 0,"data-variant":e,"data-size":n,className:r(v.button,v[e],v[n],a&&v.fullWidth,c),children:[i?(0,t.jsx)(`span`,{className:v.spinner,"aria-hidden":`true`}):null,l]}):(0,t.jsx)(_,{})}),b=(0,e.createContext)(null);function x(t){let n=(0,e.useContext)(b),r=(0,e.useId)(),i=n?.id??t.id??r,a=!!(t.required??n?.required),o=!!(t.disabled??n?.disabled),s=!!t.error||!!n?.invalid,c=[t[`aria-describedby`],n?.describedById].filter(Boolean).join(` `)||void 0;return{id:i,required:a,disabled:o,invalid:s,labelId:n?.labelId,"aria-invalid":s?!0:void 0,"aria-describedby":c}}var S={root:`cui-FormField-module__root--QkVj-`,label:`cui-FormField-module__label--98wVM`,labelDisabled:`cui-FormField-module__labelDisabled--I5V6c`,required:`cui-FormField-module__required--Erm4t`,message:`cui-FormField-module__message--FUq3k`,helper:`cui-FormField-module__helper--JuBZ6`,error:`cui-FormField-module__error--4SHKr`};function C({children:n,label:i,required:a=!1,helperText:o,error:s,disabled:c=!1,id:l,className:u,...d}){let f=(0,e.useId)(),p=l??f,m=!!s,g=m?`${p}-error`:o?`${p}-helper`:void 0,v=(0,e.useMemo)(()=>({id:p,describedById:g,labelId:i?`${p}-label`:void 0,required:a,disabled:c,invalid:m}),[p,g,i,a,c,m]);return h()?(0,t.jsx)(b.Provider,{value:v,children:(0,t.jsxs)(`div`,{...d,className:r(S.root,u),children:[i?(0,t.jsxs)(`label`,{id:`${p}-label`,htmlFor:p,className:r(S.label,c&&S.labelDisabled),children:[i,a?(0,t.jsx)(`span`,{className:S.required,"aria-hidden":`true`,children:`*`}):null]}):null,n,m?(0,t.jsx)(`p`,{id:g,className:r(S.message,S.error),role:`alert`,children:s}):o?(0,t.jsx)(`p`,{id:g,className:r(S.message,S.helper),children:o}):null]})}):(0,t.jsx)(_,{})}var w={control:`cui-Input-module__control--e3jPo`,disabled:`cui-Input-module__disabled--nzcnQ`,invalid:`cui-Input-module__invalid--VyrnA`,sm:`cui-Input-module__sm--SCPkT`,md:`cui-Input-module__md--weRbk`,lg:`cui-Input-module__lg--ic8a4`,input:`cui-Input-module__input--WjT81`,affix:`cui-Input-module__affix--zz0Xe`,readOnly:`cui-Input-module__readOnly--0ag-W`},T=(0,e.forwardRef)(function({id:e,required:n,disabled:i,error:a,"aria-describedby":o,prefix:s,suffix:c,size:l=`md`,readOnly:u,className:d,...f},p){let m=x({id:e,required:n,disabled:i,error:a,"aria-describedby":o});return(0,t.jsxs)(`div`,{className:r(w.control,w[l],m.invalid&&w.invalid,m.disabled&&w.disabled,u&&w.readOnly,d),children:[s?(0,t.jsx)(`span`,{className:w.affix,children:s}):null,(0,t.jsx)(`input`,{...f,ref:p,id:m.id,required:m.required,disabled:m.disabled,readOnly:u,"aria-invalid":m[`aria-invalid`],"aria-describedby":m[`aria-describedby`],className:w.input}),c?(0,t.jsx)(`span`,{className:w.affix,children:c}):null]})}),E=(0,e.forwardRef)(function({label:e,helperText:n,...r},i){return h()?!e&&!n&&!r.error?(0,t.jsx)(T,{...r,ref:i}):(0,t.jsx)(C,{id:r.id,label:e,helperText:n,error:r.error,required:r.required,disabled:r.disabled,children:(0,t.jsx)(T,{...r,ref:i})}):(0,t.jsx)(_,{})}),D={control:`cui-Select-module__control--OqOfI`,trigger:`cui-Select-module__trigger--ECKfC`,open:`cui-Select-module__open--PADOK`,value:`cui-Select-module__value--7CDNo`,placeholder:`cui-Select-module__placeholder--yUgBU`,sm:`cui-Select-module__sm--TPJwf`,md:`cui-Select-module__md--nOV6u`,lg:`cui-Select-module__lg--NGPOa`,chevron:`cui-Select-module__chevron--PLUsh`,clear:`cui-Select-module__clear--2OgzI`,invalid:`cui-Select-module__invalid--opDrx`,disabled:`cui-Select-module__disabled--8YgjS`,popover:`cui-Select-module__popover--VnWAu`,"cui-select-in":`cui-Select-module__cui-select-in--VGYFd`,top:`cui-Select-module__top--v5FSw`,"cui-select-in-top":`cui-Select-module__cui-select-in-top--fwYA4`,searchWrap:`cui-Select-module__searchWrap--YBOFZ`,search:`cui-Select-module__search--FrUXx`,list:`cui-Select-module__list--CI08p`,option:`cui-Select-module__option--Hvo8n`,optionLabel:`cui-Select-module__optionLabel--FGiUZ`,selected:`cui-Select-module__selected--8A13A`,highlighted:`cui-Select-module__highlighted--YIVPT`,optionDisabled:`cui-Select-module__optionDisabled--FhDw-`,check:`cui-Select-module__check--RxZrV`,empty:`cui-Select-module__empty--KmYrm`,spinner:`cui-Select-module__spinner--OxCAP`,"cui-select-spin":`cui-Select-module__cui-select-spin--MQqaM`},O=4,ee=280,te=500,ne=e=>Array.isArray(e)?e:e?[e]:[],k=(0,e.forwardRef)(function({options:i,placeholder:a=`Select an option`,size:o=`md`,multiple:s=!1,clearable:c=!0,onSearch:l,loading:u=!1,emptyMessage:d=`No options found.`,listClassName:f,name:p,value:m,defaultValue:h,onChange:g,id:_,required:v,disabled:y,error:b,"aria-describedby":S,className:C,onKeyDown:w,onClick:T,...E},k){let A=x({id:_,required:v,disabled:y,error:b,"aria-describedby":S}),j=(0,e.useId)(),M=`${j}-list`,re=`${j}-value`,N=e=>`${j}-option-${e}`,P=(0,e.useRef)(null),F=(0,e.useRef)(null),ie=(0,e.useRef)(null),I=(0,e.useRef)(null),ae=(0,e.useRef)(null),[L,R]=(0,e.useState)(!1),[z,oe]=(0,e.useState)(null),[B,V]=(0,e.useState)(``),[H,U]=(0,e.useState)(!1),[W,G]=(0,e.useState)(0),K=m!==void 0,[q,se]=(0,e.useState)(()=>ne(h)),J=K?ne(m):q,ce=(0,e.useCallback)(e=>{F.current=e,typeof k==`function`?k(e):k&&(k.current=e)},[k]),Y=(0,e.useMemo)(()=>{if(l||!B)return i;let e=B.toLowerCase();return i.filter(t=>t.label.toLowerCase().includes(e))},[i,B,l]),le=e=>{K||se(e),g?.(s?e:e[0]??``)},ue=e=>{let t=e.findIndex(e=>!e.disabled);return t===-1?0:t},X=(0,e.useCallback)(()=>{let e=P.current;if(!e)return;let t=e.getBoundingClientRect(),n=window.innerHeight-t.bottom,r=n<ee&&t.top>n?`top`:`bottom`,i={left:t.left,width:t.width};r===`bottom`?i.top=t.bottom+O:i.bottom=window.innerHeight-t.top+O,oe({style:i,placement:r})},[]),de=()=>{if(A.disabled)return;X(),V(``),U(!1);let e=i.findIndex(e=>J.includes(e.value));G(e===-1?ue(i):e),R(!0)},Z=(e=!0)=>{R(!1),e&&F.current?.focus({preventScroll:!0})},fe=e=>{e.disabled||(s?le(J.includes(e.value)?J.filter(t=>t!==e.value):[...J,e.value]):(le([e.value]),Z()),V(``),U(!1))},pe=e=>{if(!Y.length)return;let t=W;for(let n=0;n<Y.length&&(t=(t+e+Y.length)%Y.length,Y[t]?.disabled);n++);G(t)};(0,e.useEffect)(()=>{L&&I.current?.focus({preventScroll:!0})},[L]),(0,e.useEffect)(()=>{H&&ae.current?.focus({preventScroll:!0})},[H]);let me=(0,e.useRef)(l);(0,e.useEffect)(()=>{me.current=l},[l]),(0,e.useEffect)(()=>{if(!L||!me.current)return;let e=setTimeout(()=>me.current?.(B),te);return()=>clearTimeout(e)},[B,L]),(0,e.useEffect)(()=>{if(!L)return;let e=()=>requestAnimationFrame(X);return window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[L,X]),(0,e.useEffect)(()=>{if(!L)return;let e=e=>{let t=e.target;!P.current?.contains(t)&&!ie.current?.contains(t)&&R(!1)};return document.addEventListener(`mousedown`,e,!0),()=>document.removeEventListener(`mousedown`,e,!0)},[L]),(0,e.useEffect)(()=>{if(!L)return;let e=I.current,t=e?.children[W];e&&t&&(t.offsetTop<e.scrollTop?e.scrollTop=t.offsetTop:t.offsetTop+t.offsetHeight>e.scrollTop+e.clientHeight&&(e.scrollTop=t.offsetTop+t.offsetHeight-e.clientHeight))},[W,L]);let he=e=>{w?.(e),!e.defaultPrevented&&!L&&(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),de())},ge=e=>{switch(e.key){case`Escape`:e.preventDefault(),e.stopPropagation(),Z();return;case`ArrowDown`:e.preventDefault(),pe(1);return;case`ArrowUp`:e.preventDefault(),pe(-1);return;case`Home`:if(H)return;e.preventDefault(),G(ue(Y));return;case`End`:if(H)return;e.preventDefault(),G(Math.max(Y.length-1,0));return;case`Enter`:e.preventDefault(),e.stopPropagation(),Y[W]&&fe(Y[W]);return;case`Tab`:R(!1),F.current?.focus({preventScroll:!0});return;case` `:if(H)return;e.preventDefault(),Y[W]&&fe(Y[W]);return}let t=e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey;!H&&t&&(e.preventDefault(),V(e.key),G(0),U(!0))},Q=i.filter(e=>J.includes(e.value)),_e=J.length>0,ve=J.length>1?`${J.length} selected`:Q[0]?.label??a,ye=c&&_e&&!A.disabled,be=L?P.current?.closest(`[data-theme]`)?.getAttribute(`data-theme`):void 0,xe=L&&Y[W]?N(W):void 0,Se=A.labelId?`${A.labelId} ${re}`:void 0;return(0,t.jsxs)(`div`,{ref:P,className:r(D.control,D[o],A.invalid&&D.invalid,A.disabled&&D.disabled,L&&D.open,C),children:[(0,t.jsx)(`button`,{...E,ref:ce,id:A.id,type:`button`,role:`combobox`,"aria-haspopup":`listbox`,"aria-expanded":L,"aria-controls":L?M:void 0,"aria-labelledby":Se,"aria-invalid":A[`aria-invalid`],"aria-describedby":A[`aria-describedby`],"aria-required":A.required||void 0,disabled:A.disabled,className:r(D.trigger,!Q.length&&D.placeholder),onClick:e=>{T?.(e),!e.defaultPrevented&&(L?Z(!1):de())},onKeyDown:he,children:(0,t.jsx)(`span`,{id:re,className:D.value,children:ve})}),ye?(0,t.jsx)(`button`,{type:`button`,className:D.clear,"aria-label":`Clear selection`,onClick:()=>{le([]),F.current?.focus({preventScroll:!0})},children:(0,t.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M6 6l8 8M14 6l-8 8`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`})})}):null,(0,t.jsx)(`svg`,{className:D.chevron,viewBox:`0 0 20 20`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M5 7.5l5 5 5-5`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})}),p?J.length>0?J.map(e=>(0,t.jsx)(`input`,{type:`hidden`,name:p,value:e},e)):!s&&(0,t.jsx)(`input`,{type:`hidden`,name:p,value:``}):null,L&&z?(0,n.createPortal)((0,t.jsxs)(`div`,{ref:ie,className:r(D.popover,D[z.placement]),style:z.style,"data-theme":be??void 0,onKeyDown:ge,children:[H?(0,t.jsx)(`div`,{className:D.searchWrap,children:(0,t.jsx)(`input`,{ref:ae,type:`text`,className:D.search,placeholder:`Search options...`,"aria-label":`Search options`,"aria-controls":M,"aria-activedescendant":xe,autoComplete:`off`,value:B,onChange:e=>{let t=e.target.value;V(t),G(0),t===``&&(U(!1),I.current?.focus({preventScroll:!0}))}})}):null,(0,t.jsx)(`ul`,{ref:I,id:M,role:`listbox`,tabIndex:-1,"aria-labelledby":Se,"aria-multiselectable":s||void 0,"aria-activedescendant":H?void 0:xe,className:r(D.list,f),children:Y.length>0?Y.map((e,n)=>{let i=J.includes(e.value);return(0,t.jsxs)(`li`,{id:N(n),role:`option`,"aria-selected":i,"aria-disabled":e.disabled||void 0,className:r(D.option,i&&D.selected,n===W&&D.highlighted,e.disabled&&D.optionDisabled),onMouseEnter:()=>!e.disabled&&G(n),onClick:()=>fe(e),children:[(0,t.jsx)(`span`,{className:D.optionLabel,children:e.label}),i?(0,t.jsx)(`svg`,{className:D.check,viewBox:`0 0 20 20`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M4.5 10.5l3.5 3.5 7.5-8`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})}):null]},e.value)}):(0,t.jsx)(`li`,{className:D.empty,role:`presentation`,children:u?(0,t.jsx)(`span`,{className:D.spinner,role:`status`,"aria-label":`Loading`}):d})})]}),document.body):null]})}),A=(0,e.forwardRef)(function({label:e,helperText:n,...r},i){if(!h())return(0,t.jsx)(_,{});let a=r;return!e&&!n&&!r.error?(0,t.jsx)(k,{...a,ref:i}):(0,t.jsx)(C,{id:r.id,label:e,helperText:n,error:r.error,required:r.required,disabled:r.disabled,children:(0,t.jsx)(k,{...a,ref:i})})}),j={textarea:`cui-Textarea-module__textarea--Z-y6g`,invalid:`cui-Textarea-module__invalid--E88X-`,"resize-none":`cui-Textarea-module__resize-none---T499`,"resize-vertical":`cui-Textarea-module__resize-vertical--P4hRY`,"resize-horizontal":`cui-Textarea-module__resize-horizontal--htj2f`,"resize-both":`cui-Textarea-module__resize-both--wR4os`,readOnly:`cui-Textarea-module__readOnly--mI513`},M=(0,e.forwardRef)(function({id:e,required:n,disabled:i,error:a,"aria-describedby":o,rows:s=3,resize:c=`vertical`,readOnly:l,className:u,...d},f){let p=x({id:e,required:n,disabled:i,error:a,"aria-describedby":o});return(0,t.jsx)(`textarea`,{...d,ref:f,id:p.id,rows:s,required:p.required,disabled:p.disabled,readOnly:l,"aria-invalid":p[`aria-invalid`],"aria-describedby":p[`aria-describedby`],className:r(j.textarea,j[`resize-${c}`],p.invalid&&j.invalid,l&&j.readOnly,u)})}),re=(0,e.forwardRef)(function({label:e,helperText:n,...r},i){return h()?!e&&!n&&!r.error?(0,t.jsx)(M,{...r,ref:i}):(0,t.jsx)(C,{id:r.id,label:e,helperText:n,error:r.error,required:r.required,disabled:r.disabled,children:(0,t.jsx)(M,{...r,ref:i})}):(0,t.jsx)(_,{})}),N={root:`cui-Checkbox-module__root--mY3qk`,label:`cui-Checkbox-module__label--cwRtI`,disabled:`cui-Checkbox-module__disabled--x7-eg`,input:`cui-Checkbox-module__input--2kt-h`,box:`cui-Checkbox-module__box--OCPee`,check:`cui-Checkbox-module__check--4HYWn`,dash:`cui-Checkbox-module__dash--5Dkdl`,invalid:`cui-Checkbox-module__invalid---Cs7q`,text:`cui-Checkbox-module__text--EmtRj`,required:`cui-Checkbox-module__required--t9DLN`,message:`cui-Checkbox-module__message--ZPKsV`,helper:`cui-Checkbox-module__helper--16DrX`,error:`cui-Checkbox-module__error--E-bmD`},P=(0,e.forwardRef)(function({label:n,helperText:i,error:a,indeterminate:o=!1,id:s,required:c,disabled:l,"aria-describedby":u,className:d,...f},p){let m=(0,e.useRef)(null),g=(0,e.useCallback)(e=>{m.current=e,typeof p==`function`?p(e):p&&(p.current=e)},[p]);(0,e.useEffect)(()=>{m.current&&(m.current.indeterminate=o)},[o]);let v=x({id:s,required:c,disabled:l,error:a,"aria-describedby":u});if(!h())return(0,t.jsx)(_,{});let y=`${v.id}-message`,b=!!(a||i),S=[v[`aria-describedby`],b?y:void 0].filter(Boolean).join(` `)||void 0;return(0,t.jsxs)(`div`,{className:r(N.root,d),children:[(0,t.jsxs)(`label`,{className:r(N.label,v.disabled&&N.disabled),children:[(0,t.jsx)(`input`,{...f,ref:g,id:v.id,type:`checkbox`,required:v.required,disabled:v.disabled,"aria-invalid":v[`aria-invalid`],"aria-describedby":S,className:r(N.input,v.invalid&&N.invalid)}),(0,t.jsxs)(`span`,{className:N.box,"aria-hidden":`true`,children:[(0,t.jsx)(`svg`,{className:N.check,viewBox:`0 0 20 20`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M4.5 10.5l3.5 3.5 7.5-8`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`})}),(0,t.jsx)(`svg`,{className:N.dash,viewBox:`0 0 20 20`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M5 10h10`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`})})]}),n?(0,t.jsxs)(`span`,{className:N.text,children:[n,v.required?(0,t.jsx)(`span`,{className:N.required,"aria-hidden":`true`,children:`*`}):null]}):null]}),b?(0,t.jsx)(`p`,{id:y,className:r(N.message,a?N.error:N.helper),role:a?`alert`:void 0,children:a||i}):null]})}),F={root:`cui-Switch-module__root--Y5Ydi`,label:`cui-Switch-module__label--LrH7V`,disabled:`cui-Switch-module__disabled--2aZ0V`,input:`cui-Switch-module__input--5BPNu`,track:`cui-Switch-module__track--7ObdZ`,thumb:`cui-Switch-module__thumb---FTeK`,invalid:`cui-Switch-module__invalid--4QBSq`,required:`cui-Switch-module__required--cVb-Z`,message:`cui-Switch-module__message--fA-a5`,helper:`cui-Switch-module__helper--gZCYS`,error:`cui-Switch-module__error--OSPrU`},ie=(0,e.forwardRef)(function({label:e,helperText:n,error:i,id:a,required:o,disabled:s,"aria-describedby":c,className:l,...u},d){let f=x({id:a,required:o,disabled:s,error:i,"aria-describedby":c});if(!h())return(0,t.jsx)(_,{});let p=`${f.id}-message`,m=!!(i||n),g=[f[`aria-describedby`],m?p:void 0].filter(Boolean).join(` `)||void 0;return(0,t.jsxs)(`div`,{className:r(F.root,l),children:[(0,t.jsxs)(`label`,{className:r(F.label,f.disabled&&F.disabled),children:[(0,t.jsx)(`input`,{...u,ref:d,id:f.id,type:`checkbox`,role:`switch`,required:f.required,disabled:f.disabled,"aria-invalid":f[`aria-invalid`],"aria-describedby":g,className:r(F.input,f.invalid&&F.invalid)}),(0,t.jsx)(`span`,{className:F.track,"aria-hidden":`true`,children:(0,t.jsx)(`span`,{className:F.thumb})}),e?(0,t.jsxs)(`span`,{className:F.text,children:[e,f.required?(0,t.jsx)(`span`,{className:F.required,"aria-hidden":`true`,children:`*`}):null]}):null]}),m?(0,t.jsx)(`p`,{id:p,className:r(F.message,i?F.error:F.helper),role:i?`alert`:void 0,children:i||n}):null]})}),I={root:`cui-Badge-module__root--5osNT`,dot:`cui-Badge-module__dot--i0c-G`,neutral:`cui-Badge-module__neutral--lulSm`,primary:`cui-Badge-module__primary--S0WCS`,success:`cui-Badge-module__success--u9JiS`,warning:`cui-Badge-module__warning--nsGp-`,danger:`cui-Badge-module__danger--PD2hz`,info:`cui-Badge-module__info--na6DQ`};function ae({color:e=`neutral`,dot:n=!1,className:i,children:a,...o}){return h()?(0,t.jsxs)(`span`,{...o,className:r(I.root,I[e],i),children:[n?(0,t.jsx)(`span`,{className:I.dot,"aria-hidden":`true`}):null,a]}):(0,t.jsx)(_,{})}var L={root:`cui-Skeleton-module__root--qaX19`,"cui-skeleton-pulse":`cui-Skeleton-module__cui-skeleton-pulse--HzSoY`,rect:`cui-Skeleton-module__rect--do1uR`,text:`cui-Skeleton-module__text---A8IF`,circle:`cui-Skeleton-module__circle--DYcl8`};function R({variant:e=`rect`,width:n,height:i,className:a,style:o,...s}){if(!h())return(0,t.jsx)(_,{});let c={width:n,height:i??(e===`circle`?n:void 0)};return(0,t.jsx)(`span`,{"aria-hidden":`true`,...s,className:r(L.root,L[e],a),style:{...c,...o}})}var z={root:`cui-Tabs-module__root---VKVI`,list:`cui-Tabs-module__list--qRVME`,tab:`cui-Tabs-module__tab--IdDYc`,selected:`cui-Tabs-module__selected--TxfYv`,icon:`cui-Tabs-module__icon--LYFix`,panel:`cui-Tabs-module__panel--08i9c`};function oe({items:n,value:i,defaultValue:a,onValueChange:o,className:s,"aria-label":c,...l}){let u=(0,e.useId)(),d=(0,e.useRef)([]),f=n.find(e=>!e.disabled)?.value,[p,m]=(0,e.useState)(a??f);if(!h())return(0,t.jsx)(_,{});let g=i??p,v=n.findIndex(e=>e.value===g),y=n[v],b=e=>{i===void 0&&m(e),o?.(e)},x=(e,t)=>{let r=n.length,i=t===`first`?-1:t===`last`?r:e,a=t===`first`?1:t===`last`?-1:t;for(let e=0;e<r;e++){i=(i+a+r)%r;let e=n[i];if(e&&!e.disabled){b(e.value),d.current[i]?.focus();return}}},S=(e,t)=>{let n=getComputedStyle(e.currentTarget).direction===`rtl`,r=n?`ArrowLeft`:`ArrowRight`,i=n?`ArrowRight`:`ArrowLeft`;if(e.key===r)x(t,1);else if(e.key===i)x(t,-1);else if(e.key===`Home`)x(t,`first`);else if(e.key===`End`)x(t,`last`);else return;e.preventDefault()},C=e=>`${u}-tab-${e}`,w=e=>`${u}-panel-${e}`;return(0,t.jsxs)(`div`,{...l,className:r(z.root,s),children:[(0,t.jsx)(`div`,{role:`tablist`,"aria-label":c,className:z.list,children:n.map((e,n)=>{let i=n===v;return(0,t.jsxs)(`button`,{ref:e=>{d.current[n]=e},id:C(n),type:`button`,role:`tab`,"aria-selected":i,"aria-controls":i&&e.content!==void 0?w(n):void 0,tabIndex:i?0:-1,disabled:e.disabled,className:r(z.tab,i&&z.selected),onClick:()=>b(e.value),onKeyDown:e=>S(e,n),children:[e.icon?(0,t.jsx)(`span`,{className:z.icon,"aria-hidden":`true`,children:e.icon}):null,e.label]},e.value)})}),y&&y.content!==void 0?(0,t.jsx)(`div`,{role:`tabpanel`,id:w(v),"aria-labelledby":C(v),tabIndex:0,className:z.panel,children:y.content}):null]})}var B={root:`cui-FormSection-module__root--M70AE`,header:`cui-FormSection-module__header--xTDAF`,heading:`cui-FormSection-module__heading--QU0-u`,title:`cui-FormSection-module__title--cw5qX`,subtitle:`cui-FormSection-module__subtitle--cIB53`,divider:`cui-FormSection-module__divider--954nY`,fields:`cui-FormSection-module__fields--ALVzc`,columns2:`cui-FormSection-module__columns2--IgG6n`,columns3:`cui-FormSection-module__columns3--q-4XF`};function V({title:n,subtitle:i,children:a,columns:o=1,headingLevel:s=3,className:c,...l}){let u=(0,e.useId)(),d=!!(n||i);return h()?(0,t.jsxs)(`section`,{...l,"aria-labelledby":n?u:l[`aria-labelledby`],className:r(B.root,c),children:[d?(0,t.jsxs)(`div`,{className:B.header,children:[(0,t.jsxs)(`div`,{className:B.heading,children:[n?(0,e.createElement)(`h${s}`,{id:u,className:B.title},n):null,i?(0,t.jsx)(`p`,{className:B.subtitle,children:i}):null]}),(0,t.jsx)(`span`,{className:B.divider,"aria-hidden":`true`})]}):null,(0,t.jsx)(`div`,{className:r(B.fields,B[`columns${o}`]),children:a})]}):(0,t.jsx)(_,{})}var H={root:`cui-Avatar-module__root--fXu-J`,xs:`cui-Avatar-module__xs--oSaLL`,sm:`cui-Avatar-module__sm--sZ2bk`,md:`cui-Avatar-module__md--Fdkbz`,lg:`cui-Avatar-module__lg--pTTUA`,xl:`cui-Avatar-module__xl--mW58F`,image:`cui-Avatar-module__image--ieqGp`,fallback:`cui-Avatar-module__fallback--BWBXY`,tone0:`cui-Avatar-module__tone0--NoD23`,tone1:`cui-Avatar-module__tone1--xFqRb`,tone2:`cui-Avatar-module__tone2--nxsRe`,tone3:`cui-Avatar-module__tone3--goa6z`,tone4:`cui-Avatar-module__tone4--g6kRy`,primary:`cui-Avatar-module__primary--HKPgn`},U=[H.tone0,H.tone1,H.tone2,H.tone3,H.tone4];function W(e){let t=(e??``).trim().split(/\s+/).filter(Boolean);return t.length===0?``:((t[0]?.[0]??``)+(t.length>1?t[t.length-1]?.[0]??``:``)).toUpperCase()}function G(e){let t=e??``,n=0;for(let e=0;e<t.length;e++)n=n*31+t.charCodeAt(e)>>>0;return U[n%U.length]}function K({name:n,src:i,size:a=`md`,tone:o=`auto`,className:s,...c}){let[l,u]=(0,e.useState)(null),d=!!i&&i!==l,f=W(n);return h()?(0,t.jsx)(`span`,{role:c[`aria-hidden`]?void 0:`img`,"aria-label":c[`aria-hidden`]||!n?void 0:n,...c,className:r(H.root,H[a],!d&&(o===`primary`?H.primary:G(n)),s),children:d?(0,t.jsx)(`img`,{className:H.image,src:i??void 0,alt:``,onError:()=>u(i??null)}):f?(0,t.jsx)(`span`,{"aria-hidden":`true`,children:f}):(0,t.jsxs)(`svg`,{className:H.fallback,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:[(0,t.jsx)(`circle`,{cx:`12`,cy:`8`,r:`4`,fill:`currentColor`}),(0,t.jsx)(`path`,{d:`M4 21c0-4.4 3.6-7 8-7s8 2.6 8 7z`,fill:`currentColor`})]})}):(0,t.jsx)(_,{})}var q={root:`cui-AccountPanel-module__root--Twbp0`,rootSidebar:`cui-AccountPanel-module__rootSidebar--OMB7L`,contents:`cui-AccountPanel-module__contents--OFL-r`,triggerHeader:`cui-AccountPanel-module__triggerHeader--ib8Bi`,triggerOpen:`cui-AccountPanel-module__triggerOpen--NbT3m`,triggerSidebar:`cui-AccountPanel-module__triggerSidebar--FeaXc`,collapsed:`cui-AccountPanel-module__collapsed--c8z-m`,identityText:`cui-AccountPanel-module__identityText--eziAT`,triggerName:`cui-AccountPanel-module__triggerName--f56mY`,triggerRole:`cui-AccountPanel-module__triggerRole--KpeeO`,panel:`cui-AccountPanel-module__panel--PinlA`,"cui-account-in":`cui-AccountPanel-module__cui-account-in--QVNEb`,panelSidebar:`cui-AccountPanel-module__panelSidebar--EuGZh`,identity:`cui-AccountPanel-module__identity--lZRA7`,email:`cui-AccountPanel-module__email--Ze3OW`,avatarRing:`cui-AccountPanel-module__avatarRing--FQrz4`,avatarInner:`cui-AccountPanel-module__avatarInner--5ZfEz`,greeting:`cui-AccountPanel-module__greeting--am-j3`,role:`cui-AccountPanel-module__role--E9lrf`,pills:`cui-AccountPanel-module__pills--5gSce`,pill:`cui-AccountPanel-module__pill--vK7aC`,actionIcon:`cui-AccountPanel-module__actionIcon--oReIE`,externalIcon:`cui-AccountPanel-module__externalIcon--dJc16`,details:`cui-AccountPanel-module__details--MGxxd`,detailRow:`cui-AccountPanel-module__detailRow--VzvVD`,apps:`cui-AccountPanel-module__apps--KRMBA`,appsTitle:`cui-AccountPanel-module__appsTitle--mcvnH`,grid:`cui-AccountPanel-module__grid--KYmem`,app:`cui-AccountPanel-module__app--Dj--X`,tile:`cui-AccountPanel-module__tile--YKNda`,tonePrimary:`cui-AccountPanel-module__tonePrimary--lAexZ`,toneInfo:`cui-AccountPanel-module__toneInfo--yb-xj`,toneSuccess:`cui-AccountPanel-module__toneSuccess--XIJic`,toneWarning:`cui-AccountPanel-module__toneWarning--oz2d6`,toneDanger:`cui-AccountPanel-module__toneDanger--MP2rJ`,toneNeutral:`cui-AccountPanel-module__toneNeutral--diEHz`,appName:`cui-AccountPanel-module__appName--MJc25`,danger:`cui-AccountPanel-module__danger--t0t-L`,dangerAction:`cui-AccountPanel-module__dangerAction--jvJ7-`},se=8,J=12,ce=352,Y=`a[href], button:not([disabled])`,le=({href:e,className:n,title:r,onClick:i,children:a})=>(0,t.jsx)(`a`,{href:e,className:n,title:r,onClick:i,children:a}),ue={primary:q.tonePrimary,info:q.toneInfo,success:q.toneSuccess,warning:q.toneWarning,danger:q.toneDanger,neutral:q.toneNeutral};function X(){return(0,t.jsx)(`svg`,{className:q.externalIcon,viewBox:`0 0 20 20`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M8 5H5v10h10v-3M11 5h4v4M15 5l-7 7`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function de({user:i,apps:a=[],actions:o=[],placement:s=`header`,collapsed:c=!1,appsTitle:l=`All Apps`,greeting:u=`Hi`,renderLink:d=le,className:f}){let p=s===`sidebar`,m=(0,e.useId)(),g=(0,e.useRef)(null),v=(0,e.useRef)(null),y=(0,e.useRef)(null),[b,x]=(0,e.useState)(!1),[S,C]=(0,e.useState)(null),[w,T]=(0,e.useState)(),E=()=>{let e=v.current;if(!e)return;let t=e.getBoundingClientRect();if(p){let e=Math.min(ce,window.innerWidth-24);C({left:Math.max(J,Math.min(t.right+se,window.innerWidth-e-J)),bottom:Math.max(J,window.innerHeight-t.bottom)})}else C({top:t.bottom+se,right:Math.max(J,window.innerWidth-t.right)})},D=()=>{E(),T(g.current?.closest(`[data-theme]`)?.getAttribute(`data-theme`)??void 0),x(!0)},O=()=>x(!1);(0,e.useEffect)(()=>{b&&y.current?.focus({preventScroll:!0})},[b]),(0,e.useEffect)(()=>{if(!b)return;let e=()=>requestAnimationFrame(E),t=e=>{let t=e.target;!g.current?.contains(t)&&!y.current?.contains(t)&&O()};return window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),document.addEventListener(`mousedown`,t,!0),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e),document.removeEventListener(`mousedown`,t,!0)}},[b,p]);let ee=e=>{if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),O(),v.current?.focus({preventScroll:!0});return}if(e.key!==`Tab`)return;let t=Array.from(y.current?.querySelectorAll(Y)??[]),n=t[0],r=t[t.length-1];n&&r&&(e.shiftKey&&(document.activeElement===n||document.activeElement===y.current)?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus()))};if(!h())return(0,t.jsx)(_,{});let te=i.name.trim().split(/\s+/)[0]??i.name,ne=o.filter(e=>e.tone!==`danger`),k=o.filter(e=>e.tone===`danger`),A=e=>{e.onClick?.(),O()},j=(0,t.jsxs)(`div`,{ref:y,id:m,role:`dialog`,"aria-label":`Account`,tabIndex:-1,className:r(q.panel,p&&q.panelSidebar),style:S??void 0,"data-theme":w,onKeyDown:ee,children:[(0,t.jsxs)(`div`,{className:q.identity,children:[i.email?(0,t.jsx)(`p`,{className:q.email,children:i.email}):null,(0,t.jsx)(`span`,{className:q.avatarRing,children:(0,t.jsx)(`span`,{className:q.avatarInner,children:(0,t.jsx)(K,{name:i.name,src:i.avatarUrl,size:`xl`,tone:`primary`,"aria-hidden":`true`})})}),(0,t.jsxs)(`p`,{className:q.greeting,children:[u,`, `,te,`!`]}),i.role?(0,t.jsx)(`span`,{className:q.role,children:i.role}):null,ne.length>0?(0,t.jsx)(`div`,{className:q.pills,children:ne.map(e=>{let n=(0,t.jsxs)(t.Fragment,{children:[e.icon?(0,t.jsx)(`span`,{className:q.actionIcon,"aria-hidden":`true`,children:e.icon}):null,(0,t.jsx)(`span`,{children:e.label}),e.external?(0,t.jsx)(X,{}):null]});return e.href&&!e.disabled?e.external?(0,t.jsx)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,title:e.title,className:q.pill,onClick:()=>O(),children:n},e.id):(0,t.jsx)(`span`,{className:q.contents,children:d({href:e.href,className:q.pill??``,title:e.title,onClick:()=>O(),children:n})},e.id):(0,t.jsx)(`button`,{type:`button`,disabled:e.disabled,title:e.title,className:q.pill,onClick:()=>A(e),children:n},e.id)})}):null]}),i.details?.length?(0,t.jsx)(`dl`,{className:q.details,children:i.details.map(e=>(0,t.jsxs)(`div`,{className:q.detailRow,children:[(0,t.jsx)(`dt`,{children:e.label}),(0,t.jsx)(`dd`,{children:e.value})]},e.label))}):null,a.length>0?(0,t.jsxs)(`section`,{className:q.apps,"aria-label":l,children:[(0,t.jsx)(`p`,{className:q.appsTitle,children:l}),(0,t.jsx)(`div`,{className:q.grid,children:a.map(e=>{let n=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`span`,{className:r(q.tile,ue[e.tone??`primary`]),"aria-hidden":`true`,children:e.icon}),(0,t.jsx)(`span`,{className:q.appName,children:e.name})]});return e.current?(0,t.jsx)(`span`,{className:q.contents,children:d({href:e.url,className:q.app??``,title:e.description,onClick:()=>O(),children:n})},e.id):(0,t.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,title:e.description,className:q.app,children:n},e.id)})})]}):null,k.length>0?(0,t.jsx)(`div`,{className:q.danger,children:k.map(e=>(0,t.jsxs)(`button`,{type:`button`,disabled:e.disabled,title:e.title,className:q.dangerAction,onClick:()=>A(e),children:[e.icon?(0,t.jsx)(`span`,{className:q.actionIcon,"aria-hidden":`true`,children:e.icon}):null,e.label]},e.id))}):null]});return(0,t.jsxs)(`div`,{ref:g,className:r(q.root,p&&q.rootSidebar,f),children:[(0,t.jsxs)(`button`,{ref:v,type:`button`,"aria-label":`Account: ${i.name}`,"aria-haspopup":`dialog`,"aria-expanded":b,"aria-controls":b?m:void 0,className:r(p?q.triggerSidebar:q.triggerHeader,p&&c&&q.collapsed,b&&q.triggerOpen),onClick:()=>b?O():D(),children:[(0,t.jsx)(K,{name:i.name,src:i.avatarUrl,size:`sm`,tone:`primary`,"aria-hidden":`true`}),p&&!c?(0,t.jsxs)(`span`,{className:q.identityText,children:[(0,t.jsx)(`span`,{className:q.triggerName,children:i.name}),i.role?(0,t.jsx)(`span`,{className:q.triggerRole,children:i.role}):null]}):null]}),b&&S?(0,n.createPortal)(j,document.body):null]})}var Z={root:`cui-Typography-module__root--PebSf`,h1:`cui-Typography-module__h1--pJqnF`,h2:`cui-Typography-module__h2--8YqGv`,h3:`cui-Typography-module__h3--DT-DL`,h4:`cui-Typography-module__h4--UsocF`,body:`cui-Typography-module__body--s-YlR`,bodySm:`cui-Typography-module__bodySm--RPpZ5`,caption:`cui-Typography-module__caption--K-n4O`,label:`cui-Typography-module__label---CGg4`,"color-default":`cui-Typography-module__color-default--U4Xg0`,"color-secondary":`cui-Typography-module__color-secondary--5wnuV`,"color-muted":`cui-Typography-module__color-muted--GLLRl`,"color-disabled":`cui-Typography-module__color-disabled--bBBVc`,"color-primary":`cui-Typography-module__color-primary--B-bVH`,"color-success":`cui-Typography-module__color-success--hXHcS`,"color-warning":`cui-Typography-module__color-warning---oLwA`,"color-danger":`cui-Typography-module__color-danger--sStkk`,"color-info":`cui-Typography-module__color-info--4uSt5`,"weight-normal":`cui-Typography-module__weight-normal--fFcMp`,"weight-medium":`cui-Typography-module__weight-medium--5RtTe`,"weight-semibold":`cui-Typography-module__weight-semibold--TDOgV`,"weight-bold":`cui-Typography-module__weight-bold--YahG3`,"align-start":`cui-Typography-module__align-start--mX51I`,"align-center":`cui-Typography-module__align-center--2Ng2u`,"align-end":`cui-Typography-module__align-end--6LwA3`,truncate:`cui-Typography-module__truncate--3B0O4`},fe={h1:`h1`,h2:`h2`,h3:`h3`,h4:`h4`,body:`p`,"body-sm":`p`,caption:`span`,label:`span`},pe={h1:Z.h1,h2:Z.h2,h3:Z.h3,h4:Z.h4,body:Z.body,"body-sm":Z.bodySm,caption:Z.caption,label:Z.label};function me({variant:n=`body`,as:i,color:a=`default`,weight:o,align:s,truncate:c=!1,className:l,...u}){return h()?(0,e.createElement)(i??fe[n],{...u,className:r(Z.root,pe[n],Z[`color-${a}`],o&&Z[`weight-${o}`],s&&Z[`align-${s}`],c&&Z.truncate,l)}):(0,t.jsx)(_,{})}var he=`(prefers-color-scheme: dark)`;function ge(){return(0,e.useSyncExternalStore)(e=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return()=>{};let t=window.matchMedia(he);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)},()=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(he).matches,()=>!1)}var Q=new Set;function _e(e){try{return window.localStorage.getItem(e)}catch{return null}}function ve(e,t){try{window.localStorage.setItem(e,t)}catch{}Q.forEach(e=>e())}function ye(t){return(0,e.useSyncExternalStore)(e=>(Q.add(e),window.addEventListener(`storage`,e),()=>{Q.delete(e),window.removeEventListener(`storage`,e)}),()=>t?_e(t):null,()=>null)}var be={root:`cui-ThemeProvider-module__root--2DEGi`},xe=(0,e.createContext)(null);function Se({children:n,theme:i,defaultTheme:a=`light`,onThemeChange:o,storageKey:s,licenseKey:c,className:l,...d}){let[f,p]=(0,e.useState)(a),m=ye(i===void 0?s:void 0),h=ge(),g=i??m??f,_=g===`system`?h?`dark`:`light`:g,v=(0,e.useCallback)(e=>{i===void 0&&(p(e),s&&ve(s,e)),o?.(e)},[i,o,s]),y=(0,e.useMemo)(()=>({theme:g,resolvedTheme:_,setTheme:v}),[g,_,v]),b=(0,e.useContext)(u);return(0,t.jsx)(xe.Provider,{value:y,children:(0,t.jsx)(u.Provider,{value:c??b,children:(0,t.jsx)(`div`,{...d,"data-theme":_,className:r(be.root,l),children:n})})})}function Ce(){let t=(0,e.useContext)(xe);if(!t)throw Error(`useTheme must be used within a <ThemeProvider>.`);return t}var $={root:`cui-ThemeToggle-module__root--k2-Go`,option:`cui-ThemeToggle-module__option--CngnC`,input:`cui-ThemeToggle-module__input--0nC-Q`,face:`cui-ThemeToggle-module__face--jX0TD`,icon:`cui-ThemeToggle-module__icon--N0Uj1`},we={light:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`}),(0,t.jsx)(`path`,{d:`M12 3v2M12 19v2M3 12h2M19 12h2M5.6 5.6l1.4 1.4M17 17l1.4 1.4M5.6 18.4L7 17M17 7l1.4-1.4`})]}),dark:(0,t.jsx)(`path`,{d:`M20 14.5A8 8 0 019.5 4a8 8 0 1010.5 10.5z`}),system:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`12`,rx:`2`}),(0,t.jsx)(`path`,{d:`M8 20h8M12 16v4`})]})},Te={light:`Light`,dark:`Dark`,system:`System`};function Ee({modes:n=[`light`,`dark`,`system`],compact:i=!1,className:a,"aria-label":o=`Theme`,...s}){let{theme:c,setTheme:l}=Ce(),u=(0,e.useId)();return h()?(0,t.jsx)(`div`,{...s,role:`radiogroup`,"aria-label":o,className:r($.root,a),children:n.map(e=>{let n=Te[e]??e;return(0,t.jsxs)(`label`,{className:$.option,title:i?n:void 0,children:[(0,t.jsx)(`input`,{type:`radio`,name:u,value:e,checked:c===e,onChange:()=>l(e),className:$.input,"aria-label":i?n:void 0}),(0,t.jsxs)(`span`,{className:$.face,children:[we[e]?(0,t.jsx)(`svg`,{className:$.icon,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:we[e]}):null,i?null:n]})]},e)})}):(0,t.jsx)(_,{})}exports.AccountPanel=de,exports.Avatar=K,exports.Badge=ae,exports.Button=y,exports.Checkbox=P,exports.FormField=C,exports.FormSection=V,exports.Input=E,exports.Select=A,exports.Skeleton=R,exports.Switch=ie,exports.Tabs=oe,exports.Textarea=re,exports.ThemeProvider=Se,exports.ThemeToggle=Ee,exports.Typography=me,exports.cn=r,exports.getInitials=W,exports.setLicenseKey=d,exports.useFormFieldControl=x,exports.useTheme=Ce;
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["createContext","useContext","useSyncExternalStore","root","styles","sm","md","lg","primary","danger","spinner","forwardRef","styles","createContext","useContext","useId","root","label","required","message","helper","error","useId","useMemo","styles","control","disabled","invalid","sm","md","lg","input","readOnly","forwardRef","styles","sm","md","lg","invalid","disabled","list","option","selected","check","forwardRef","useId","useRef","useState","useCallback","useMemo","styles","createPortal","forwardRef","invalid","forwardRef","styles","root","label","disabled","input","invalid","text","required","message","helper","error","forwardRef","useRef","useCallback","styles","root","label","input","forwardRef","styles","root","primary","danger","styles","root","styles","root","icon","panel","useId","useRef","useState","styles","root","useId","styles","createElement","root","styles","useState","root","styles","useId","useRef","useState","_Fragment","createPortal","root","styles","createElement","useSyncExternalStore","root","createContext","useState","useCallback","useMemo","useContext","styles","_Fragment","useId","styles","react","react_jsx_runtime","react_dom","cn","values","SALT","hashKey","text","key","h1","h2","i","ch","VALID_KEY_HASHES","globalKey","listeners","warned","LicenseContext","setLicenseKey","listener","isValidLicenseKey","subscribe","getSnapshot","useLicensed","providedKey","licensed","UnlicensedNotice_module_default","UnlicensedNotice","Button_module_default","Button","rest","disabled","loading","variant","size","fullWidth","className","children","FormFieldContext","useFormFieldControl","context","generatedId","id","options","required","invalid","describedBy","FormField_module_default","FormField","idProp","hasError","error","messageId","helperText","label","Input_module_default","InputControl","ariaDescribedBy","control","readOnly","prefix","suffix","Input","props","Select_module_default","MENU_GAP","MENU_ESTIMATED_HEIGHT","SEARCH_DEBOUNCE_MS","toArray","value","SelectControl","baseId","listId","valueId","optionId","index","containerRef","triggerRef","popoverRef","listRef","searchRef","open","setOpen","position","setPosition","search","setSearch","showSearch","setShowSearch","highlighted","setHighlighted","isControlled","internal","setInternal","defaultValue","selected","setTriggerRef","node","ref","filtered","onSearch","query","option","commit","next","onChange","multiple","firstEnabled","list","updatePosition","container","rect","spaceBelow","placement","style","openMenu","firstSelected","o","closeMenu","restoreFocus","selectOption","v","moveHighlight","step","direction","onSearchRef","timer","reposition","handler","target","event","el","handleTriggerKeyDown","onKeyDown","handleMenuKeyDown","isPrintable","selectedOptions","hasValue","displayText","placeholder","showClear","clearable","themeName","activeDescendant","labelledBy","onClick","name","listClassName","isSelected","emptyMessage","Select","controlProps","Textarea_module_default","TextareaControl","resize","Textarea","Checkbox_module_default","Checkbox","innerRef","setRef","indeterminate","hasMessage","Switch_module_default","Switch","Badge_module_default","Badge","color","dot","Skeleton_module_default","Skeleton","height","width","Tabs_module_default","Tabs","ariaLabel","tabRefs","items","item","active","activeIndex","activeItem","select","onValueChange","move","count","from","handleKeyDown","rtl","previous","tabId","panelId","FormSection_module_default","FormSection","headingId","hasHeader","title","subtitle","headingLevel","columns","Avatar_module_default","TONES","getInitials","words","toneFor","hash","Avatar","failedSrc","setFailedSrc","showImage","src","initials","tone","AccountPanel_module_default","GAP","EDGE","PANEL_WIDTH","FOCUSABLE","defaultRenderLink","tileTone","ExternalIcon","AccountPanel","sidebar","rootRef","panelRef","setThemeName","computePosition","trigger","openPanel","close","onPointerDown","nodes","first","last","firstName","user","quickActions","actions","a","dangerActions","runAction","action","panel","greeting","content","renderLink","detail","apps","appsTitle","tile","app","collapsed","Typography_module_default","defaultElement","variantClass","Typography","as","weight","align","truncate","DARK_QUERY","useSystemPrefersDark","storageListeners","readStorage","writeStoredTheme","theme","useStoredTheme","ThemeProvider_module_default","ThemeContext","ThemeProvider","controlledTheme","internalTheme","setInternalTheme","defaultTheme","storedTheme","storageKey","systemPrefersDark","resolvedTheme","setTheme","onThemeChange","inheritedKey","licenseKey","useTheme","ThemeToggle_module_default","icons","labels","ThemeToggle","modes","mode","compact"],"sources":["../src/utils/cn.ts","../src/license/hash.ts","../src/license/keys.ts","../src/license/license.ts","../src/license/UnlicensedNotice.module.css","../src/license/UnlicensedNotice.tsx","../src/components/Button/Button.module.css","../src/components/Button/Button.tsx","../src/components/FormField/FormFieldContext.ts","../src/components/FormField/FormField.module.css","../src/components/FormField/FormField.tsx","../src/components/Input/Input.module.css","../src/components/Input/Input.tsx","../src/components/Select/Select.module.css","../src/components/Select/SelectControl.tsx","../src/components/Select/Select.tsx","../src/components/Textarea/Textarea.module.css","../src/components/Textarea/Textarea.tsx","../src/components/Checkbox/Checkbox.module.css","../src/components/Checkbox/Checkbox.tsx","../src/components/Switch/Switch.module.css","../src/components/Switch/Switch.tsx","../src/components/Badge/Badge.module.css","../src/components/Badge/Badge.tsx","../src/components/Skeleton/Skeleton.module.css","../src/components/Skeleton/Skeleton.tsx","../src/components/Tabs/Tabs.module.css","../src/components/Tabs/Tabs.tsx","../src/components/FormSection/FormSection.module.css","../src/components/FormSection/FormSection.tsx","../src/components/Avatar/Avatar.module.css","../src/components/Avatar/Avatar.tsx","../src/components/AccountPanel/AccountPanel.module.css","../src/components/AccountPanel/AccountPanel.tsx","../src/components/Typography/Typography.module.css","../src/components/Typography/Typography.tsx","../src/theme/themeStore.ts","../src/theme/ThemeProvider.module.css","../src/theme/ThemeProvider.tsx","../src/components/ThemeToggle/ThemeToggle.module.css","../src/components/ThemeToggle/ThemeToggle.tsx"],"sourcesContent":["export type ClassValue = string | false | null | undefined;\n\n/** Join truthy class names into a single string. */\nexport function cn(...values: ClassValue[]): string {\n return values.filter(Boolean).join(' ');\n}\n","/**\n * Non-cryptographic 53-bit hash (cyrb53). Keys are stored as hashes so the\n * plain keys are not sitting in the bundle. This is a deterrent, not security:\n * anything shipped to the browser can be extracted. `scripts/license.mjs`\n * must use the same algorithm (a test keeps them in sync).\n */\nconst SALT = 'client-ui:';\n\nexport function hashKey(key: string): string {\n const text = SALT + key.trim();\n let h1 = 0xdeadbeef;\n let h2 = 0x41c6ce57;\n for (let i = 0; i < text.length; i++) {\n const ch = text.charCodeAt(i);\n h1 = Math.imul(h1 ^ ch, 2654435761);\n h2 = Math.imul(h2 ^ ch, 1597334677);\n }\n h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507);\n h1 ^= Math.imul(h2 ^ (h2 >>> 13), 3266489909);\n h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507);\n h2 ^= Math.imul(h1 ^ (h1 >>> 13), 3266489909);\n const value = 4294967296 * (2097151 & h2) + (h1 >>> 0);\n return value.toString(16).padStart(14, '0');\n}\n","/**\n * Hashes of the license keys this release accepts. Generate entries with\n * `node scripts/license.mjs generate <label>`; remove an entry to revoke a key\n * in the next release.\n */\nexport const VALID_KEY_HASHES: readonly string[] = [\n '1cd9d9bd20471f', // dev (Storybook / playground)\n];\n","import { createContext, useContext, useEffect, useSyncExternalStore } from 'react';\nimport { hashKey } from './hash';\nimport { VALID_KEY_HASHES } from './keys';\n\nlet globalKey = '';\nconst listeners = new Set<() => void>();\nlet warned = false;\n\n/** Context carrying the key given to `<ThemeProvider licenseKey>`. Takes priority over `setLicenseKey`. */\nexport const LicenseContext = createContext<string | null>(null);\n\n/** Set the license key once at app start. A `licenseKey` on `ThemeProvider` takes priority. */\nexport function setLicenseKey(key: string): void {\n globalKey = key;\n warned = false;\n listeners.forEach((listener) => listener());\n}\n\nexport function isValidLicenseKey(key: string | null | undefined): boolean {\n if (!key || !key.trim()) return false;\n return VALID_KEY_HASHES.includes(hashKey(key));\n}\n\nconst subscribe = (listener: () => void) => {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n};\nconst getSnapshot = () => globalKey;\n\n/** True when a valid license key is configured. Every component calls this. */\nexport function useLicensed(): boolean {\n const providedKey = useContext(LicenseContext);\n const key = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);\n const licensed = isValidLicenseKey(providedKey ?? key);\n\n useEffect(() => {\n if (licensed || warned) return;\n warned = true;\n console.error(\n '[client-ui] Missing or invalid license key. Components are disabled. ' +\n 'Pass licenseKey to <ThemeProvider> or call setLicenseKey() once at app start.',\n );\n }, [licensed]);\n\n return licensed;\n}\n",".root {\n display: inline-block;\n padding: var(--cui-space-1) var(--cui-space-2);\n border: 1px dashed var(--cui-color-danger);\n border-radius: var(--cui-radius-md);\n color: var(--cui-color-danger);\n font-family: var(--cui-font-family);\n font-size: var(--cui-font-size-xs);\n line-height: var(--cui-line-height);\n}\n","import styles from './UnlicensedNotice.module.css';\n\n/** Rendered in place of a component when no valid license key is configured. */\nexport function UnlicensedNotice() {\n return (\n <span role=\"alert\" className={styles.root}>\n client-ui: missing or invalid license key\n </span>\n );\n}\n",".button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--cui-space-2);\n box-sizing: border-box;\n border: 1px solid transparent;\n border-radius: var(--cui-radius-md);\n font-family: var(--cui-font-family);\n font-weight: var(--cui-font-weight-medium);\n line-height: var(--cui-line-height);\n white-space: nowrap;\n cursor: pointer;\n user-select: none;\n transition:\n background-color var(--cui-transition-fast),\n border-color var(--cui-transition-fast),\n color var(--cui-transition-fast);\n}\n\n.button:focus-visible {\n outline: var(--cui-focus-ring-width) solid var(--cui-color-border-focus);\n outline-offset: var(--cui-focus-ring-offset);\n}\n\n.button:disabled {\n cursor: not-allowed;\n}\n\n.button[aria-busy='true'] {\n cursor: progress;\n}\n\n/* Sizes */\n.sm {\n height: var(--cui-control-height-sm);\n padding: 0 var(--cui-space-3);\n font-size: var(--cui-font-size-sm);\n}\n\n.md {\n height: var(--cui-control-height-md);\n padding: 0 var(--cui-space-4);\n font-size: var(--cui-font-size-md);\n}\n\n.lg {\n height: var(--cui-control-height-lg);\n padding: 0 var(--cui-space-6);\n font-size: var(--cui-font-size-lg);\n}\n\n.fullWidth {\n display: flex;\n width: 100%;\n}\n\n/* Variants */\n.primary {\n background-color: var(--cui-color-primary);\n color: var(--cui-color-on-primary);\n}\n.primary:hover:not(:disabled) {\n background-color: var(--cui-color-primary-hover);\n}\n.primary:active:not(:disabled) {\n background-color: var(--cui-color-primary-active);\n}\n\n.secondary {\n background-color: var(--cui-color-secondary);\n color: var(--cui-color-on-secondary);\n}\n.secondary:hover:not(:disabled) {\n background-color: var(--cui-color-secondary-hover);\n}\n\n.outline {\n background-color: transparent;\n border-color: var(--cui-color-border);\n color: var(--cui-color-text);\n}\n.outline:hover:not(:disabled) {\n background-color: var(--cui-color-surface-secondary);\n}\n\n.ghost {\n background-color: transparent;\n color: var(--cui-color-primary);\n}\n.ghost:hover:not(:disabled) {\n background-color: var(--cui-color-primary-subtle);\n}\n\n.danger {\n background-color: var(--cui-color-danger);\n color: var(--cui-color-on-danger);\n}\n.danger:hover:not(:disabled) {\n background-color: var(--cui-color-danger-hover);\n}\n.danger:active:not(:disabled) {\n background-color: var(--cui-color-danger-active);\n}\n\n.link {\n height: auto;\n padding: 0;\n background-color: transparent;\n color: var(--cui-color-primary);\n text-decoration: underline;\n text-underline-offset: 0.2em;\n}\n.link:hover:not(:disabled) {\n color: var(--cui-color-primary-hover);\n}\n\n/* Disabled (and loading, which is disabled) */\n.button:disabled:not([aria-busy='true']) {\n color: var(--cui-color-text-disabled);\n}\n.primary:disabled:not([aria-busy='true']),\n.secondary:disabled:not([aria-busy='true']),\n.danger:disabled:not([aria-busy='true']) {\n background-color: var(--cui-color-surface-secondary);\n}\n.outline:disabled {\n border-color: var(--cui-color-border);\n}\n.button[aria-busy='true'] {\n opacity: 0.85;\n}\n\n/* Spinner */\n.spinner {\n width: 1em;\n height: 1em;\n box-sizing: border-box;\n border: 2px solid currentColor;\n border-inline-end-color: transparent;\n border-radius: var(--cui-radius-full);\n animation: spin 0.7s linear infinite;\n}\n\n@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .spinner {\n animation-duration: 2s;\n }\n}\n","import { forwardRef } from 'react';\nimport { cn } from '../../utils/cn';\nimport { UnlicensedNotice, useLicensed } from '../../license';\nimport type { ButtonProps } from './Button.types';\nimport styles from './Button.module.css';\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n variant = 'primary',\n size = 'md',\n loading = false,\n fullWidth = false,\n type = 'button',\n disabled,\n className,\n children,\n ...rest\n },\n ref,\n) {\n const licensed = useLicensed();\n if (!licensed) return <UnlicensedNotice />;\n\n return (\n <button\n {...rest}\n ref={ref}\n type={type}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n data-variant={variant}\n data-size={size}\n className={cn(\n styles.button,\n styles[variant],\n styles[size],\n fullWidth && styles.fullWidth,\n className,\n )}\n >\n {loading ? <span className={styles.spinner} aria-hidden=\"true\" /> : null}\n {children}\n </button>\n );\n});\n","import { createContext, useContext, useId } from 'react';\nimport type {\n FormFieldContextValue,\n FormFieldControlProps,\n UseFormFieldControlOptions,\n} from './FormField.types';\n\nexport const FormFieldContext = createContext<FormFieldContextValue | null>(null);\n\n/**\n * Connects a form control to the surrounding FormField (if any) and returns\n * the id / required / disabled / aria props it should apply to its native element.\n * Form controls (Input, Select, future Textarea...) should all use this hook.\n */\nexport function useFormFieldControl(options: UseFormFieldControlOptions): FormFieldControlProps {\n const context = useContext(FormFieldContext);\n const generatedId = useId();\n\n const id = context?.id ?? options.id ?? generatedId;\n const required = Boolean(options.required ?? context?.required);\n const disabled = Boolean(options.disabled ?? context?.disabled);\n const invalid = Boolean(options.error) || Boolean(context?.invalid);\n const describedBy =\n [options['aria-describedby'], context?.describedById].filter(Boolean).join(' ') || undefined;\n\n return {\n id,\n required,\n disabled,\n invalid,\n labelId: context?.labelId,\n 'aria-invalid': invalid ? true : undefined,\n 'aria-describedby': describedBy,\n };\n}\n",".root {\n display: flex;\n flex-direction: column;\n gap: var(--cui-space-1);\n min-width: 0;\n}\n\n.label {\n font-size: var(--cui-font-size-sm);\n font-weight: var(--cui-font-weight-semibold);\n color: var(--cui-color-text-secondary);\n margin-bottom: var(--cui-space-1);\n}\n\n.labelDisabled {\n color: var(--cui-color-text-disabled);\n}\n\n.required {\n margin-inline-start: var(--cui-space-1);\n color: var(--cui-color-danger);\n}\n\n.message {\n margin: 0;\n font-size: var(--cui-font-size-sm);\n}\n\n.helper {\n color: var(--cui-color-text-muted);\n}\n\n.error {\n color: var(--cui-color-danger);\n}\n","import { useId, useMemo } from 'react';\nimport { cn } from '../../utils/cn';\nimport { UnlicensedNotice, useLicensed } from '../../license';\nimport { FormFieldContext } from './FormFieldContext';\nimport type { FormFieldContextValue, FormFieldProps } from './FormField.types';\nimport styles from './FormField.module.css';\n\nexport function FormField({\n children,\n label,\n required = false,\n helperText,\n error,\n disabled = false,\n id: idProp,\n className,\n ...rest\n}: FormFieldProps) {\n const generatedId = useId();\n const id = idProp ?? generatedId;\n const hasError = Boolean(error);\n const messageId = hasError ? `${id}-error` : helperText ? `${id}-helper` : undefined;\n\n const context = useMemo<FormFieldContextValue>(\n () => ({\n id,\n describedById: messageId,\n labelId: label ? `${id}-label` : undefined,\n required,\n disabled,\n invalid: hasError,\n }),\n [id, messageId, label, required, disabled, hasError],\n );\n\n const licensed = useLicensed();\n if (!licensed) return <UnlicensedNotice />;\n\n return (\n <FormFieldContext.Provider value={context}>\n <div {...rest} className={cn(styles.root, className)}>\n {label ? (\n <label\n id={`${id}-label`}\n htmlFor={id}\n className={cn(styles.label, disabled && styles.labelDisabled)}\n >\n {label}\n {required ? (\n <span className={styles.required} aria-hidden=\"true\">\n *\n </span>\n ) : null}\n </label>\n ) : null}\n {children}\n {hasError ? (\n <p id={messageId} className={cn(styles.message, styles.error)} role=\"alert\">\n {error}\n </p>\n ) : helperText ? (\n <p id={messageId} className={cn(styles.message, styles.helper)}>\n {helperText}\n </p>\n ) : null}\n </div>\n </FormFieldContext.Provider>\n );\n}\n",".control {\n display: flex;\n align-items: center;\n gap: var(--cui-space-2);\n box-sizing: border-box;\n width: 100%;\n padding: 0 var(--cui-space-4);\n background-color: var(--cui-color-surface);\n border: var(--cui-control-border-width) solid var(--cui-color-border);\n border-radius: var(--cui-radius-lg);\n color: var(--cui-color-text);\n font-family: var(--cui-font-family);\n transition:\n border-color var(--cui-transition-fast),\n box-shadow var(--cui-transition-fast);\n}\n\n.control:hover:not(.disabled):not(.invalid) {\n border-color: var(--cui-color-border-hover);\n}\n\n.control:focus-within {\n border-color: var(--cui-color-border-focus);\n outline: none;\n box-shadow: var(--cui-focus-ring);\n}\n\n.sm {\n min-height: var(--cui-control-height-sm);\n font-size: var(--cui-font-size-sm);\n}\n.md {\n min-height: var(--cui-control-height-md);\n font-size: var(--cui-font-size-sm);\n}\n.lg {\n min-height: var(--cui-control-height-lg);\n font-size: var(--cui-font-size-lg);\n}\n\n.input {\n flex: 1;\n min-width: 0;\n align-self: stretch;\n padding: 0;\n border: 0;\n outline: 0;\n background: transparent;\n color: inherit;\n font: inherit;\n}\n\n.input[type='number'] {\n appearance: textfield;\n -moz-appearance: textfield;\n}\n.input[type='number']::-webkit-inner-spin-button,\n.input[type='number']::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\n.input::placeholder {\n color: var(--cui-color-placeholder);\n}\n\n.affix {\n display: inline-flex;\n align-items: center;\n flex-shrink: 0;\n color: var(--cui-color-text-secondary);\n}\n\n.invalid {\n border-color: var(--cui-color-danger-border);\n}\n.control.invalid:hover:not(.disabled) {\n border-color: var(--cui-color-danger-border-hover);\n}\n.invalid:focus-within {\n border-color: var(--cui-color-danger-border-hover);\n box-shadow: var(--cui-focus-ring-danger);\n}\n\n.readOnly {\n background-color: var(--cui-color-surface-secondary);\n}\n\n.disabled {\n background-color: var(--cui-color-surface-secondary);\n color: var(--cui-color-text-disabled);\n cursor: not-allowed;\n}\n.disabled .input,\n.disabled .affix {\n color: var(--cui-color-text-disabled);\n cursor: not-allowed;\n}\n","import { forwardRef } from 'react';\nimport { cn } from '../../utils/cn';\nimport { UnlicensedNotice, useLicensed } from '../../license';\nimport { FormField, useFormFieldControl } from '../FormField';\nimport type { InputProps } from './Input.types';\nimport styles from './Input.module.css';\n\nconst InputControl = forwardRef<HTMLInputElement, Omit<InputProps, 'label' | 'helperText'>>(\n function InputControl(\n {\n id,\n required,\n disabled,\n error,\n 'aria-describedby': ariaDescribedBy,\n prefix,\n suffix,\n size = 'md',\n readOnly,\n className,\n ...rest\n },\n ref,\n ) {\n const control = useFormFieldControl({\n id,\n required,\n disabled,\n error,\n 'aria-describedby': ariaDescribedBy,\n });\n\n return (\n <div\n className={cn(\n styles.control,\n styles[size],\n control.invalid && styles.invalid,\n control.disabled && styles.disabled,\n readOnly && styles.readOnly,\n className,\n )}\n >\n {prefix ? <span className={styles.affix}>{prefix}</span> : null}\n <input\n {...rest}\n ref={ref}\n id={control.id}\n required={control.required}\n disabled={control.disabled}\n readOnly={readOnly}\n aria-invalid={control['aria-invalid']}\n aria-describedby={control['aria-describedby']}\n className={styles.input}\n />\n {suffix ? <span className={styles.affix}>{suffix}</span> : null}\n </div>\n );\n },\n);\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n { label, helperText, ...props },\n ref,\n) {\n const licensed = useLicensed();\n if (!licensed) return <UnlicensedNotice />;\n\n // Without its own label/helper/error, Input defers to an enclosing <FormField>.\n if (!label && !helperText && !props.error) {\n return <InputControl {...props} ref={ref} />;\n }\n\n return (\n <FormField\n id={props.id}\n label={label}\n helperText={helperText}\n error={props.error}\n required={props.required}\n disabled={props.disabled}\n >\n <InputControl {...props} ref={ref} />\n </FormField>\n );\n});\n",".control {\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n color: var(--cui-color-text);\n}\n\n.trigger {\n appearance: none;\n display: flex;\n align-items: center;\n box-sizing: border-box;\n width: 100%;\n padding: 0 var(--cui-space-10) 0 var(--cui-space-4);\n background-color: var(--cui-color-surface);\n border: var(--cui-control-border-width) solid var(--cui-color-border);\n border-radius: var(--cui-radius-lg);\n color: inherit;\n font-family: var(--cui-font-family);\n font-size: inherit;\n text-align: start;\n cursor: pointer;\n transition:\n border-color var(--cui-transition-fast),\n box-shadow var(--cui-transition-fast);\n}\n\n.trigger:hover:not(:disabled) {\n border-color: var(--cui-color-border-hover);\n}\n\n.trigger:focus-visible,\n.open .trigger {\n border-color: var(--cui-color-border-focus);\n outline: none;\n box-shadow: var(--cui-focus-ring);\n}\n\n.value {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.placeholder .value {\n color: var(--cui-color-placeholder);\n}\n\n.sm {\n font-size: var(--cui-font-size-sm);\n}\n.sm .trigger {\n height: var(--cui-control-height-sm);\n}\n.md {\n font-size: var(--cui-font-size-sm);\n}\n.md .trigger {\n height: var(--cui-control-height-md);\n}\n.lg {\n font-size: var(--cui-font-size-lg);\n}\n.lg .trigger {\n height: var(--cui-control-height-lg);\n}\n\n.chevron {\n position: absolute;\n inset-inline-end: var(--cui-space-3);\n width: 1.25rem;\n height: 1.25rem;\n color: var(--cui-color-text-muted);\n pointer-events: none;\n transition: transform 0.2s ease;\n}\n.open .chevron {\n transform: rotate(180deg);\n}\n\n.clear {\n position: absolute;\n inset-inline-end: calc(var(--cui-space-3) + 1.5rem);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 1.25rem;\n height: 1.25rem;\n padding: 0;\n border: 0;\n border-radius: var(--cui-radius-full);\n background: transparent;\n color: var(--cui-color-text-muted);\n cursor: pointer;\n}\n.clear:hover {\n background-color: var(--cui-color-surface-secondary);\n color: var(--cui-color-text);\n}\n.clear:focus-visible {\n outline: var(--cui-focus-ring-width) solid var(--cui-color-border-focus);\n}\n.clear svg {\n width: 0.875rem;\n height: 0.875rem;\n}\n\n.invalid .trigger {\n border-color: var(--cui-color-danger-border);\n}\n.invalid .trigger:hover:not(:disabled) {\n border-color: var(--cui-color-danger-border-hover);\n}\n.invalid .trigger:focus-visible,\n.invalid.open .trigger {\n border-color: var(--cui-color-danger-border-hover);\n box-shadow: var(--cui-focus-ring-danger);\n}\n\n.disabled {\n color: var(--cui-color-text-disabled);\n}\n.disabled .trigger {\n background-color: var(--cui-color-surface-secondary);\n cursor: not-allowed;\n}\n.disabled .chevron {\n color: var(--cui-color-text-disabled);\n}\n\n/* Popover (rendered in a portal, inside the nearest [data-theme] element) */\n.popover {\n position: fixed;\n z-index: var(--cui-z-popover);\n box-sizing: border-box;\n overflow: hidden;\n background-color: var(--cui-color-surface);\n color: var(--cui-color-text);\n border: 1px solid var(--cui-color-border);\n border-radius: var(--cui-radius-lg);\n box-shadow: var(--cui-shadow-lg);\n font-family: var(--cui-font-family);\n font-size: var(--cui-font-size-sm);\n line-height: var(--cui-line-height);\n animation: cui-select-in 0.15s ease-out;\n}\n\n@keyframes cui-select-in {\n from {\n opacity: 0;\n transform: translateY(-8px) scale(0.98);\n }\n}\n\n.top {\n animation-name: cui-select-in-top;\n}\n\n@keyframes cui-select-in-top {\n from {\n opacity: 0;\n transform: translateY(8px) scale(0.98);\n }\n}\n\n.searchWrap {\n padding: var(--cui-space-2);\n border-bottom: 1px solid var(--cui-color-border);\n background-color: var(--cui-color-surface-secondary);\n}\n\n.search {\n box-sizing: border-box;\n width: 100%;\n height: var(--cui-control-height-sm);\n padding: 0 var(--cui-space-3);\n background-color: var(--cui-color-surface);\n border: var(--cui-control-border-width) solid var(--cui-color-border);\n border-radius: var(--cui-radius-md);\n color: inherit;\n font: inherit;\n outline: none;\n}\n.search::placeholder {\n color: var(--cui-color-placeholder);\n}\n.search:focus {\n border-color: var(--cui-color-border-focus);\n box-shadow: var(--cui-focus-ring);\n}\n\n.list {\n margin: 0;\n padding: var(--cui-space-2);\n max-height: 15rem;\n overflow-y: auto;\n list-style: none;\n outline: none;\n}\n\n.option {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 2px;\n padding: var(--cui-space-2) var(--cui-space-3);\n border-radius: var(--cui-radius-lg);\n color: var(--cui-color-text-secondary);\n cursor: pointer;\n user-select: none;\n}\n\n.optionLabel {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.selected {\n background-color: var(--cui-color-primary-subtle);\n color: var(--cui-color-primary);\n font-weight: var(--cui-font-weight-semibold);\n}\n\n.highlighted {\n background-color: var(--cui-color-primary);\n color: var(--cui-color-on-primary);\n}\n\n.optionDisabled {\n color: var(--cui-color-text-disabled);\n cursor: not-allowed;\n}\n\n.check {\n flex-shrink: 0;\n width: 1rem;\n height: 1rem;\n margin-inline-start: var(--cui-space-2);\n}\n\n.empty {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: var(--cui-space-4);\n color: var(--cui-color-text-muted);\n}\n\n.spinner {\n width: 1.25rem;\n height: 1.25rem;\n box-sizing: border-box;\n border: 2px solid currentColor;\n border-inline-end-color: transparent;\n border-radius: var(--cui-radius-full);\n animation: cui-select-spin 0.7s linear infinite;\n}\n\n@keyframes cui-select-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .popover,\n .chevron {\n animation: none;\n transition: none;\n }\n .spinner {\n animation-duration: 2s;\n }\n}\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n type KeyboardEvent,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { cn } from '../../utils/cn';\nimport { useFormFieldControl } from '../FormField';\nimport type { SelectControlProps, SelectOption } from './Select.types';\nimport styles from './Select.module.css';\n\nconst MENU_GAP = 4;\nconst MENU_ESTIMATED_HEIGHT = 280;\nconst SEARCH_DEBOUNCE_MS = 500;\n\ninterface MenuPosition {\n style: CSSProperties;\n placement: 'top' | 'bottom';\n}\n\nconst toArray = (value: string | string[] | undefined): string[] =>\n Array.isArray(value) ? value : value ? [value] : [];\n\nexport const SelectControl = forwardRef<HTMLButtonElement, SelectControlProps>(\n function SelectControl(\n {\n options,\n placeholder = 'Select an option',\n size = 'md',\n multiple = false,\n clearable = true,\n onSearch,\n loading = false,\n emptyMessage = 'No options found.',\n listClassName,\n name,\n value,\n defaultValue,\n onChange,\n id,\n required,\n disabled,\n error,\n 'aria-describedby': ariaDescribedBy,\n className,\n onKeyDown,\n onClick,\n ...rest\n },\n ref,\n ) {\n const control = useFormFieldControl({\n id,\n required,\n disabled,\n error,\n 'aria-describedby': ariaDescribedBy,\n });\n\n const baseId = useId();\n const listId = `${baseId}-list`;\n const valueId = `${baseId}-value`;\n const optionId = (index: number) => `${baseId}-option-${index}`;\n\n const containerRef = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLButtonElement | null>(null);\n const popoverRef = useRef<HTMLDivElement>(null);\n const listRef = useRef<HTMLUListElement>(null);\n const searchRef = useRef<HTMLInputElement>(null);\n\n const [open, setOpen] = useState(false);\n const [position, setPosition] = useState<MenuPosition | null>(null);\n const [search, setSearch] = useState('');\n // The search box stays hidden until the user starts typing.\n const [showSearch, setShowSearch] = useState(false);\n const [highlighted, setHighlighted] = useState(0);\n\n const isControlled = value !== undefined;\n const [internal, setInternal] = useState<string[]>(() => toArray(defaultValue));\n const selected = isControlled ? toArray(value) : internal;\n\n const setTriggerRef = useCallback(\n (node: HTMLButtonElement | null) => {\n triggerRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n },\n [ref],\n );\n\n const filtered = useMemo(() => {\n if (onSearch || !search) return options;\n const query = search.toLowerCase();\n return options.filter((option) => option.label.toLowerCase().includes(query));\n }, [options, search, onSearch]);\n\n const commit = (next: string[]) => {\n if (!isControlled) setInternal(next);\n onChange?.(multiple ? next : (next[0] ?? ''));\n };\n\n const firstEnabled = (list: SelectOption[]) => {\n const index = list.findIndex((option) => !option.disabled);\n return index === -1 ? 0 : index;\n };\n\n const updatePosition = useCallback(() => {\n const container = containerRef.current;\n if (!container) return;\n const rect = container.getBoundingClientRect();\n const spaceBelow = window.innerHeight - rect.bottom;\n const placement =\n spaceBelow < MENU_ESTIMATED_HEIGHT && rect.top > spaceBelow ? 'top' : 'bottom';\n const style: CSSProperties = { left: rect.left, width: rect.width };\n if (placement === 'bottom') style.top = rect.bottom + MENU_GAP;\n else style.bottom = window.innerHeight - rect.top + MENU_GAP;\n setPosition({ style, placement });\n }, []);\n\n const openMenu = () => {\n if (control.disabled) return;\n updatePosition();\n setSearch('');\n setShowSearch(false);\n const firstSelected = options.findIndex((o) => selected.includes(o.value));\n setHighlighted(firstSelected === -1 ? firstEnabled(options) : firstSelected);\n setOpen(true);\n };\n\n const closeMenu = (restoreFocus = true) => {\n setOpen(false);\n if (restoreFocus) triggerRef.current?.focus({ preventScroll: true });\n };\n\n const selectOption = (option: SelectOption) => {\n if (option.disabled) return;\n if (multiple) {\n commit(\n selected.includes(option.value)\n ? selected.filter((v) => v !== option.value)\n : [...selected, option.value],\n );\n } else {\n commit([option.value]);\n closeMenu();\n }\n setSearch('');\n setShowSearch(false);\n };\n\n const moveHighlight = (direction: 1 | -1) => {\n if (!filtered.length) return;\n let next = highlighted;\n for (let step = 0; step < filtered.length; step++) {\n next = (next + direction + filtered.length) % filtered.length;\n if (!filtered[next]?.disabled) break;\n }\n setHighlighted(next);\n };\n\n // Move focus into the list on open so arrow keys work immediately.\n useEffect(() => {\n if (open) listRef.current?.focus({ preventScroll: true });\n }, [open]);\n\n useEffect(() => {\n if (showSearch) searchRef.current?.focus({ preventScroll: true });\n }, [showSearch]);\n\n // Debounced server-side search.\n const onSearchRef = useRef(onSearch);\n useEffect(() => {\n onSearchRef.current = onSearch;\n }, [onSearch]);\n useEffect(() => {\n if (!open || !onSearchRef.current) return;\n const timer = setTimeout(() => onSearchRef.current?.(search), SEARCH_DEBOUNCE_MS);\n return () => clearTimeout(timer);\n }, [search, open]);\n\n // Keep the menu attached to the trigger.\n useEffect(() => {\n if (!open) return;\n const reposition = () => requestAnimationFrame(updatePosition);\n window.addEventListener('scroll', reposition, true);\n window.addEventListener('resize', reposition);\n return () => {\n window.removeEventListener('scroll', reposition, true);\n window.removeEventListener('resize', reposition);\n };\n }, [open, updatePosition]);\n\n // Close on outside press (capture, so ancestors that stop propagation can't block it).\n useEffect(() => {\n if (!open) return;\n const handler = (event: MouseEvent) => {\n const target = event.target as Node;\n if (!containerRef.current?.contains(target) && !popoverRef.current?.contains(target)) {\n setOpen(false);\n }\n };\n document.addEventListener('mousedown', handler, true);\n return () => document.removeEventListener('mousedown', handler, true);\n }, [open]);\n\n // Scroll the highlighted option into view without scrolling the page.\n useEffect(() => {\n if (!open) return;\n const list = listRef.current;\n const el = list?.children[highlighted] as HTMLElement | undefined;\n if (!list || !el) return;\n if (el.offsetTop < list.scrollTop) list.scrollTop = el.offsetTop;\n else if (el.offsetTop + el.offsetHeight > list.scrollTop + list.clientHeight)\n list.scrollTop = el.offsetTop + el.offsetHeight - list.clientHeight;\n }, [highlighted, open]);\n\n const handleTriggerKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n onKeyDown?.(event);\n if (event.defaultPrevented) return;\n if (!open && (event.key === 'ArrowDown' || event.key === 'ArrowUp')) {\n event.preventDefault();\n openMenu();\n }\n };\n\n const handleMenuKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n switch (event.key) {\n case 'Escape':\n event.preventDefault();\n event.stopPropagation();\n closeMenu();\n return;\n case 'ArrowDown':\n event.preventDefault();\n moveHighlight(1);\n return;\n case 'ArrowUp':\n event.preventDefault();\n moveHighlight(-1);\n return;\n case 'Home':\n if (showSearch) return;\n event.preventDefault();\n setHighlighted(firstEnabled(filtered));\n return;\n case 'End':\n if (showSearch) return;\n event.preventDefault();\n setHighlighted(Math.max(filtered.length - 1, 0));\n return;\n case 'Enter':\n // Never submit a surrounding form from inside the menu.\n event.preventDefault();\n event.stopPropagation();\n if (filtered[highlighted]) selectOption(filtered[highlighted]);\n return;\n case 'Tab':\n // Hand focus back to the trigger so Tab continues from there.\n setOpen(false);\n triggerRef.current?.focus({ preventScroll: true });\n return;\n case ' ':\n if (showSearch) return;\n event.preventDefault();\n if (filtered[highlighted]) selectOption(filtered[highlighted]);\n return;\n default:\n break;\n }\n // The first printable key reveals the search box and seeds it.\n const isPrintable =\n event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey;\n if (!showSearch && isPrintable) {\n event.preventDefault();\n setSearch(event.key);\n setHighlighted(0);\n setShowSearch(true);\n }\n };\n\n const selectedOptions = options.filter((option) => selected.includes(option.value));\n const hasValue = selected.length > 0;\n const displayText =\n selected.length > 1\n ? `${selected.length} selected`\n : (selectedOptions[0]?.label ?? placeholder);\n const showClear = clearable && hasValue && !control.disabled;\n\n // Render in <body> so no ancestor (transform, overflow, filter) can detach or clip the\n // fixed-position menu; re-apply the active theme on the menu itself.\n const themeName = open\n ? containerRef.current?.closest('[data-theme]')?.getAttribute('data-theme')\n : undefined;\n const activeDescendant = open && filtered[highlighted] ? optionId(highlighted) : undefined;\n const labelledBy = control.labelId ? `${control.labelId} ${valueId}` : undefined;\n\n return (\n <div\n ref={containerRef}\n className={cn(\n styles.control,\n styles[size],\n control.invalid && styles.invalid,\n control.disabled && styles.disabled,\n open && styles.open,\n className,\n )}\n >\n <button\n {...rest}\n ref={setTriggerRef}\n id={control.id}\n type=\"button\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n aria-expanded={open}\n aria-controls={open ? listId : undefined}\n aria-labelledby={labelledBy}\n aria-invalid={control['aria-invalid']}\n aria-describedby={control['aria-describedby']}\n aria-required={control.required || undefined}\n disabled={control.disabled}\n className={cn(styles.trigger, !selectedOptions.length && styles.placeholder)}\n onClick={(event) => {\n onClick?.(event);\n if (event.defaultPrevented) return;\n if (open) closeMenu(false);\n else openMenu();\n }}\n onKeyDown={handleTriggerKeyDown}\n >\n <span id={valueId} className={styles.value}>\n {displayText}\n </span>\n </button>\n\n {showClear ? (\n <button\n type=\"button\"\n className={styles.clear}\n aria-label=\"Clear selection\"\n onClick={() => {\n commit([]);\n triggerRef.current?.focus({ preventScroll: true });\n }}\n >\n <svg viewBox=\"0 0 20 20\" aria-hidden=\"true\" focusable=\"false\">\n <path\n d=\"M6 6l8 8M14 6l-8 8\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n />\n </svg>\n </button>\n ) : null}\n\n <svg className={styles.chevron} viewBox=\"0 0 20 20\" aria-hidden=\"true\" focusable=\"false\">\n <path\n d=\"M5 7.5l5 5 5-5\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n\n {name\n ? selected.length > 0\n ? selected.map((v) => <input key={v} type=\"hidden\" name={name} value={v} />)\n : !multiple && <input type=\"hidden\" name={name} value=\"\" />\n : null}\n\n {open && position\n ? createPortal(\n <div\n ref={popoverRef}\n className={cn(styles.popover, styles[position.placement])}\n style={position.style}\n data-theme={themeName ?? undefined}\n onKeyDown={handleMenuKeyDown}\n >\n {showSearch ? (\n <div className={styles.searchWrap}>\n <input\n ref={searchRef}\n type=\"text\"\n className={styles.search}\n placeholder=\"Search options...\"\n aria-label=\"Search options\"\n aria-controls={listId}\n aria-activedescendant={activeDescendant}\n autoComplete=\"off\"\n value={search}\n onChange={(event) => {\n const next = event.target.value;\n setSearch(next);\n setHighlighted(0);\n if (next === '') {\n setShowSearch(false);\n listRef.current?.focus({ preventScroll: true });\n }\n }}\n />\n </div>\n ) : null}\n <ul\n ref={listRef}\n id={listId}\n role=\"listbox\"\n tabIndex={-1}\n aria-labelledby={labelledBy}\n aria-multiselectable={multiple || undefined}\n aria-activedescendant={showSearch ? undefined : activeDescendant}\n className={cn(styles.list, listClassName)}\n >\n {filtered.length > 0 ? (\n filtered.map((option, index) => {\n const isSelected = selected.includes(option.value);\n return (\n <li\n key={option.value}\n id={optionId(index)}\n role=\"option\"\n aria-selected={isSelected}\n aria-disabled={option.disabled || undefined}\n className={cn(\n styles.option,\n isSelected && styles.selected,\n index === highlighted && styles.highlighted,\n option.disabled && styles.optionDisabled,\n )}\n onMouseEnter={() => !option.disabled && setHighlighted(index)}\n onClick={() => selectOption(option)}\n >\n <span className={styles.optionLabel}>{option.label}</span>\n {isSelected ? (\n <svg\n className={styles.check}\n viewBox=\"0 0 20 20\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path\n d=\"M4.5 10.5l3.5 3.5 7.5-8\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n ) : null}\n </li>\n );\n })\n ) : (\n <li className={styles.empty} role=\"presentation\">\n {loading ? (\n <span className={styles.spinner} role=\"status\" aria-label=\"Loading\" />\n ) : (\n emptyMessage\n )}\n </li>\n )}\n </ul>\n </div>,\n document.body,\n )\n : null}\n </div>\n );\n },\n);\n","import { forwardRef } from 'react';\nimport { UnlicensedNotice, useLicensed } from '../../license';\nimport { FormField } from '../FormField';\nimport { SelectControl } from './SelectControl';\nimport type { SelectControlProps, SelectProps } from './Select.types';\n\n/**\n * Select with a popover list, type-to-search, optional multi-select, a clear\n * button and server-side search. Controlled (`value`) or uncontrolled\n * (`defaultValue`). The ref points at the trigger button.\n */\nexport const Select = forwardRef<HTMLButtonElement, SelectProps>(function Select(\n { label, helperText, ...props },\n ref,\n) {\n const licensed = useLicensed();\n if (!licensed) return <UnlicensedNotice />;\n\n // The single/multiple union is resolved inside SelectControl via `multiple`.\n const controlProps = props as SelectControlProps;\n\n // Without its own label/helper/error, Select defers to an enclosing <FormField>.\n if (!label && !helperText && !props.error) {\n return <SelectControl {...controlProps} ref={ref} />;\n }\n\n return (\n <FormField\n id={props.id}\n label={label}\n helperText={helperText}\n error={props.error}\n required={props.required}\n disabled={props.disabled}\n >\n <SelectControl {...controlProps} ref={ref} />\n </FormField>\n );\n});\n",".textarea {\n display: block;\n box-sizing: border-box;\n width: 100%;\n min-height: var(--cui-control-height-md);\n padding: var(--cui-space-2) var(--cui-space-4);\n background-color: var(--cui-color-surface);\n border: var(--cui-control-border-width) solid var(--cui-color-border);\n border-radius: var(--cui-radius-lg);\n color: var(--cui-color-text);\n font-family: var(--cui-font-family);\n font-size: var(--cui-font-size-sm);\n line-height: var(--cui-line-height);\n transition:\n border-color var(--cui-transition-fast),\n box-shadow var(--cui-transition-fast);\n}\n\n.textarea::placeholder {\n color: var(--cui-color-placeholder);\n}\n\n.textarea:hover:not(:disabled):not(.invalid) {\n border-color: var(--cui-color-border-hover);\n}\n\n.textarea:focus {\n border-color: var(--cui-color-border-focus);\n outline: none;\n box-shadow: var(--cui-focus-ring);\n}\n\n.resize-none {\n resize: none;\n}\n.resize-vertical {\n resize: vertical;\n}\n.resize-horizontal {\n resize: horizontal;\n}\n.resize-both {\n resize: both;\n}\n\n.invalid {\n border-color: var(--cui-color-danger-border);\n}\n.invalid:hover:not(:disabled) {\n border-color: var(--cui-color-danger-border-hover);\n}\n.invalid:focus {\n border-color: var(--cui-color-danger-border-hover);\n box-shadow: var(--cui-focus-ring-danger);\n}\n\n.readOnly {\n background-color: var(--cui-color-surface-secondary);\n}\n\n.textarea:disabled {\n background-color: var(--cui-color-surface-secondary);\n color: var(--cui-color-text-disabled);\n cursor: not-allowed;\n resize: none;\n}\n","import { forwardRef } from 'react';\nimport { cn } from '../../utils/cn';\nimport { UnlicensedNotice, useLicensed } from '../../license';\nimport { FormField, useFormFieldControl } from '../FormField';\nimport type { TextareaProps } from './Textarea.types';\nimport styles from './Textarea.module.css';\n\nconst TextareaControl = forwardRef<\n HTMLTextAreaElement,\n Omit<TextareaProps, 'label' | 'helperText'>\n>(function TextareaControl(\n {\n id,\n required,\n disabled,\n error,\n 'aria-describedby': ariaDescribedBy,\n rows = 3,\n resize = 'vertical',\n readOnly,\n className,\n ...rest\n },\n ref,\n) {\n const control = useFormFieldControl({\n id,\n required,\n disabled,\n error,\n 'aria-describedby': ariaDescribedBy,\n });\n\n return (\n <textarea\n {...rest}\n ref={ref}\n id={control.id}\n rows={rows}\n required={control.required}\n disabled={control.disabled}\n readOnly={readOnly}\n aria-invalid={control['aria-invalid']}\n aria-describedby={control['aria-describedby']}\n className={cn(\n styles.textarea,\n styles[`resize-${resize}`],\n control.invalid && styles.invalid,\n readOnly && styles.readOnly,\n className,\n )}\n />\n );\n});\n\n/** Multi-line text input with the same label, helper and error handling as `Input`. */\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(function Textarea(\n { label, helperText, ...props },\n ref,\n) {\n const licensed = useLicensed();\n if (!licensed) return <UnlicensedNotice />;\n\n // Without its own label/helper/error, Textarea defers to an enclosing <FormField>.\n if (!label && !helperText && !props.error) {\n return <TextareaControl {...props} ref={ref} />;\n }\n\n return (\n <FormField\n id={props.id}\n label={label}\n helperText={helperText}\n error={props.error}\n required={props.required}\n disabled={props.disabled}\n >\n <TextareaControl {...props} ref={ref} />\n </FormField>\n );\n});\n",".root {\n display: flex;\n flex-direction: column;\n gap: var(--cui-space-1);\n}\n\n.label {\n position: relative;\n display: inline-flex;\n align-items: flex-start;\n gap: var(--cui-space-3);\n font-family: var(--cui-font-family);\n font-size: var(--cui-font-size-sm);\n line-height: var(--cui-line-height);\n color: var(--cui-color-text);\n cursor: pointer;\n}\n\n.disabled {\n color: var(--cui-color-text-disabled);\n cursor: not-allowed;\n}\n\n/* The real input sits on top of the box so it stays focusable and clickable. */\n.input {\n position: absolute;\n top: 0;\n left: 0;\n width: 1.25rem;\n height: 1.25rem;\n margin: 0;\n opacity: 0;\n cursor: inherit;\n}\n\n.box {\n display: inline-flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n width: 1.25rem;\n height: 1.25rem;\n background-color: var(--cui-color-surface);\n border: var(--cui-control-border-width) solid var(--cui-color-border-hover);\n border-radius: var(--cui-radius-sm);\n color: var(--cui-color-on-primary);\n transition:\n background-color var(--cui-transition-fast),\n border-color var(--cui-transition-fast),\n box-shadow var(--cui-transition-fast);\n}\n\n.check,\n.dash {\n width: 0.875rem;\n height: 0.875rem;\n opacity: 0;\n transform: scale(0.5);\n transition:\n opacity var(--cui-transition-fast),\n transform var(--cui-transition-fast);\n}\n\n.label:hover .input:not(:disabled) + .box {\n border-color: var(--cui-color-primary);\n}\n\n.input:checked + .box,\n.input:indeterminate + .box {\n background-color: var(--cui-color-primary);\n border-color: var(--cui-color-primary);\n}\n\n.input:checked + .box .check,\n.input:indeterminate + .box .dash {\n opacity: 1;\n transform: scale(1);\n}\n\n.input:indeterminate + .box .check {\n opacity: 0;\n}\n\n.input:focus-visible + .box {\n box-shadow: var(--cui-focus-ring);\n}\n\n.input.invalid + .box {\n border-color: var(--cui-color-danger-border);\n}\n.input.invalid:checked + .box {\n background-color: var(--cui-color-danger);\n border-color: var(--cui-color-danger);\n color: var(--cui-color-on-danger);\n}\n.input.invalid:focus-visible + .box {\n box-shadow: var(--cui-focus-ring-danger);\n}\n\n.input:disabled + .box {\n background-color: var(--cui-color-surface-secondary);\n border-color: var(--cui-color-border);\n color: var(--cui-color-text-disabled);\n}\n.input:disabled:checked + .box,\n.input:disabled:indeterminate + .box {\n background-color: var(--cui-color-text-disabled);\n border-color: var(--cui-color-text-disabled);\n color: var(--cui-color-surface);\n}\n\n.text {\n padding-top: 1px;\n}\n\n.required {\n margin-inline-start: var(--cui-space-1);\n color: var(--cui-color-danger);\n}\n\n.message {\n margin: 0;\n padding-inline-start: calc(1.25rem + var(--cui-space-3));\n font-size: var(--cui-font-size-sm);\n}\n.helper {\n color: var(--cui-color-text-muted);\n}\n.error {\n color: var(--cui-color-danger);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .box,\n .check,\n .dash {\n transition: none;\n }\n}\n","import { forwardRef, useCallback, useEffect, useRef } from 'react';\nimport { cn } from '../../utils/cn';\nimport { UnlicensedNotice, useLicensed } from '../../license';\nimport { useFormFieldControl } from '../FormField';\nimport type { CheckboxProps } from './Checkbox.types';\nimport styles from './Checkbox.module.css';\n\n/** Native checkbox with a themed box, optional label, helper text and error. */\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n {\n label,\n helperText,\n error,\n indeterminate = false,\n id,\n required,\n disabled,\n 'aria-describedby': ariaDescribedBy,\n className,\n ...rest\n },\n ref,\n) {\n const innerRef = useRef<HTMLInputElement | null>(null);\n const setRef = useCallback(\n (node: HTMLInputElement | null) => {\n innerRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n },\n [ref],\n );\n\n useEffect(() => {\n if (innerRef.current) innerRef.current.indeterminate = indeterminate;\n }, [indeterminate]);\n\n const control = useFormFieldControl({\n id,\n required,\n disabled,\n error,\n 'aria-describedby': ariaDescribedBy,\n });\n const licensed = useLicensed();\n if (!licensed) return <UnlicensedNotice />;\n\n const messageId = `${control.id}-message`;\n const hasMessage = Boolean(error || helperText);\n const describedBy =\n [control['aria-describedby'], hasMessage ? messageId : undefined].filter(Boolean).join(' ') ||\n undefined;\n\n return (\n <div className={cn(styles.root, className)}>\n <label className={cn(styles.label, control.disabled && styles.disabled)}>\n <input\n {...rest}\n ref={setRef}\n id={control.id}\n type=\"checkbox\"\n required={control.required}\n disabled={control.disabled}\n aria-invalid={control['aria-invalid']}\n aria-describedby={describedBy}\n className={cn(styles.input, control.invalid && styles.invalid)}\n />\n <span className={styles.box} aria-hidden=\"true\">\n <svg className={styles.check} viewBox=\"0 0 20 20\" focusable=\"false\">\n <path\n d=\"M4.5 10.5l3.5 3.5 7.5-8\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n <svg className={styles.dash} viewBox=\"0 0 20 20\" focusable=\"false\">\n <path\n d=\"M5 10h10\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2.5\"\n strokeLinecap=\"round\"\n />\n </svg>\n </span>\n {label ? (\n <span className={styles.text}>\n {label}\n {control.required ? (\n <span className={styles.required} aria-hidden=\"true\">\n *\n </span>\n ) : null}\n </span>\n ) : null}\n </label>\n {hasMessage ? (\n <p\n id={messageId}\n className={cn(styles.message, error ? styles.error : styles.helper)}\n role={error ? 'alert' : undefined}\n >\n {error || helperText}\n </p>\n ) : null}\n </div>\n );\n});\n",".root {\n display: flex;\n flex-direction: column;\n gap: var(--cui-space-1);\n}\n\n.label {\n position: relative;\n display: inline-flex;\n align-items: center;\n gap: var(--cui-space-3);\n font-family: var(--cui-font-family);\n font-size: var(--cui-font-size-sm);\n line-height: var(--cui-line-height);\n color: var(--cui-color-text);\n cursor: pointer;\n}\n\n.disabled {\n color: var(--cui-color-text-disabled);\n cursor: not-allowed;\n}\n\n.input {\n position: absolute;\n top: 0;\n left: 0;\n width: 2.75rem;\n height: 1.5rem;\n margin: 0;\n opacity: 0;\n cursor: inherit;\n}\n\n.track {\n position: relative;\n flex-shrink: 0;\n box-sizing: border-box;\n width: 2.75rem;\n height: 1.5rem;\n background-color: var(--cui-color-text-disabled);\n border-radius: var(--cui-radius-full);\n transition:\n background-color var(--cui-transition-fast),\n box-shadow var(--cui-transition-fast);\n}\n\n.thumb {\n position: absolute;\n top: 2px;\n inset-inline-start: 2px;\n width: 1.25rem;\n height: 1.25rem;\n background-color: var(--cui-color-white);\n border-radius: var(--cui-radius-full);\n box-shadow: var(--cui-shadow-sm);\n transition: transform var(--cui-transition-fast);\n}\n\n.input:checked + .track {\n background-color: var(--cui-color-primary);\n}\n.input:checked + .track .thumb {\n transform: translateX(1.25rem);\n}\n.input:checked + .track .thumb:dir(rtl) {\n transform: translateX(-1.25rem);\n}\n\n.input:focus-visible + .track {\n box-shadow: var(--cui-focus-ring);\n}\n\n.input.invalid + .track {\n box-shadow: 0 0 0 2px var(--cui-color-danger-border);\n}\n.input.invalid:focus-visible + .track {\n box-shadow: var(--cui-focus-ring-danger);\n}\n\n.input:disabled + .track {\n opacity: 0.5;\n}\n\n.required {\n margin-inline-start: var(--cui-space-1);\n color: var(--cui-color-danger);\n}\n\n.message {\n margin: 0;\n padding-inline-start: calc(2.75rem + var(--cui-space-3));\n font-size: var(--cui-font-size-sm);\n}\n.helper {\n color: var(--cui-color-text-muted);\n}\n.error {\n color: var(--cui-color-danger);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .track,\n .thumb {\n transition: none;\n }\n}\n","import { forwardRef } from 'react';\nimport { cn } from '../../utils/cn';\nimport { UnlicensedNotice, useLicensed } from '../../license';\nimport { useFormFieldControl } from '../FormField';\nimport type { SwitchProps } from './Switch.types';\nimport styles from './Switch.module.css';\n\n/** On/off toggle. A native checkbox with `role=\"switch\"`, so it works in forms and with keyboards. */\nexport const Switch = forwardRef<HTMLInputElement, SwitchProps>(function Switch(\n {\n label,\n helperText,\n error,\n id,\n required,\n disabled,\n 'aria-describedby': ariaDescribedBy,\n className,\n ...rest\n },\n ref,\n) {\n const control = useFormFieldControl({\n id,\n required,\n disabled,\n error,\n 'aria-describedby': ariaDescribedBy,\n });\n const licensed = useLicensed();\n if (!licensed) return <UnlicensedNotice />;\n\n const messageId = `${control.id}-message`;\n const hasMessage = Boolean(error || helperText);\n const describedBy =\n [control['aria-describedby'], hasMessage ? messageId : undefined].filter(Boolean).join(' ') ||\n undefined;\n\n return (\n <div className={cn(styles.root, className)}>\n <label className={cn(styles.label, control.disabled && styles.disabled)}>\n <input\n {...rest}\n ref={ref}\n id={control.id}\n type=\"checkbox\"\n role=\"switch\"\n required={control.required}\n disabled={control.disabled}\n aria-invalid={control['aria-invalid']}\n aria-describedby={describedBy}\n className={cn(styles.input, control.invalid && styles.invalid)}\n />\n <span className={styles.track} aria-hidden=\"true\">\n <span className={styles.thumb} />\n </span>\n {label ? (\n <span className={styles.text}>\n {label}\n {control.required ? (\n <span className={styles.required} aria-hidden=\"true\">\n *\n </span>\n ) : null}\n </span>\n ) : null}\n </label>\n {hasMessage ? (\n <p\n id={messageId}\n className={cn(styles.message, error ? styles.error : styles.helper)}\n role={error ? 'alert' : undefined}\n >\n {error || helperText}\n </p>\n ) : null}\n </div>\n );\n});\n",".root {\n --badge-color: var(--cui-color-text-secondary);\n display: inline-flex;\n align-items: center;\n gap: 0.375rem;\n box-sizing: border-box;\n padding: 2px 10px;\n border: 1px solid color-mix(in srgb, var(--badge-color) 25%, transparent);\n border-radius: var(--cui-radius-full);\n background-color: color-mix(in srgb, var(--badge-color) 10%, transparent);\n color: var(--badge-color);\n font-family: var(--cui-font-family);\n font-size: var(--cui-font-size-xs);\n font-weight: var(--cui-font-weight-semibold);\n line-height: var(--cui-line-height);\n white-space: nowrap;\n}\n\n.dot {\n width: 0.375rem;\n height: 0.375rem;\n border-radius: var(--cui-radius-full);\n background-color: var(--badge-color);\n}\n\n.neutral {\n --badge-color: var(--cui-color-text-secondary);\n}\n.primary {\n --badge-color: var(--cui-color-primary);\n}\n.success {\n --badge-color: var(--cui-color-success);\n}\n.warning {\n --badge-color: var(--cui-color-warning);\n}\n.danger {\n --badge-color: var(--cui-color-danger);\n}\n.info {\n --badge-color: var(--cui-color-info);\n}\n","import { cn } from '../../utils/cn';\nimport { UnlicensedNotice, useLicensed } from '../../license';\nimport type { BadgeProps } from './Badge.types';\nimport styles from './Badge.module.css';\n\n/** Small pill for statuses and counts. */\nexport function Badge({\n color = 'neutral',\n dot = false,\n className,\n children,\n ...rest\n}: BadgeProps) {\n const licensed = useLicensed();\n if (!licensed) return <UnlicensedNotice />;\n\n return (\n <span {...rest} className={cn(styles.root, styles[color], className)}>\n {dot ? <span className={styles.dot} aria-hidden=\"true\" /> : null}\n {children}\n </span>\n );\n}\n",".root {\n display: block;\n background-color: var(--cui-color-surface-secondary);\n animation: cui-skeleton-pulse 1.5s ease-in-out infinite;\n}\n\n.rect {\n width: 100%;\n height: 1rem;\n border-radius: var(--cui-radius-md);\n}\n\n.text {\n width: 100%;\n height: 0.875rem;\n border-radius: var(--cui-radius-full);\n}\n\n.circle {\n width: 2.5rem;\n height: 2.5rem;\n border-radius: var(--cui-radius-full);\n}\n\n@keyframes cui-skeleton-pulse {\n 50% {\n opacity: 0.5;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .root {\n animation: none;\n }\n}\n","import { cn } from '../../utils/cn';\nimport { UnlicensedNotice, useLicensed } from '../../license';\nimport type { SkeletonProps } from './Skeleton.types';\nimport styles from './Skeleton.module.css';\n\n/** Pulsing placeholder shown while content loads. Hidden from assistive tech. */\nexport function Skeleton({\n variant = 'rect',\n width,\n height,\n className,\n style,\n ...rest\n}: SkeletonProps) {\n const licensed = useLicensed();\n if (!licensed) return <UnlicensedNotice />;\n\n // Dimensions are caller-supplied values, so they have to be inline styles.\n const size = { width, height: height ?? (variant === 'circle' ? width : undefined) };\n\n return (\n <span\n aria-hidden=\"true\"\n {...rest}\n className={cn(styles.root, styles[variant], className)}\n style={{ ...size, ...style }}\n />\n );\n}\n",".root {\n min-width: 0;\n}\n\n.list {\n display: flex;\n align-items: center;\n gap: var(--cui-space-6);\n overflow-x: auto;\n border-bottom: 1px solid var(--cui-color-border);\n}\n\n.tab {\n position: relative;\n display: inline-flex;\n align-items: center;\n gap: var(--cui-space-2);\n padding: 0 0 var(--cui-space-3);\n background: transparent;\n border: 0;\n color: var(--cui-color-text-muted);\n font-family: var(--cui-font-family);\n font-size: var(--cui-font-size-sm);\n font-weight: var(--cui-font-weight-medium);\n white-space: nowrap;\n cursor: pointer;\n transition: color var(--cui-transition-fast);\n}\n\n.tab::after {\n content: '';\n position: absolute;\n inset-inline: 0;\n bottom: -1px;\n height: 2px;\n background-color: transparent;\n transition: background-color var(--cui-transition-fast);\n}\n\n.tab:hover:not(:disabled) {\n color: var(--cui-color-text-secondary);\n}\n\n.selected,\n.selected:hover:not(:disabled) {\n color: var(--cui-color-primary);\n}\n.selected::after {\n background-color: var(--cui-color-primary);\n}\n\n.tab:focus-visible {\n outline: var(--cui-focus-ring-width) solid var(--cui-color-border-focus);\n outline-offset: 2px;\n border-radius: var(--cui-radius-sm);\n}\n\n.tab:disabled {\n color: var(--cui-color-text-disabled);\n cursor: not-allowed;\n}\n\n.icon {\n display: inline-flex;\n width: 1rem;\n height: 1rem;\n}\n.icon > svg {\n width: 100%;\n height: 100%;\n}\n\n.panel {\n padding-top: var(--cui-space-4);\n outline: none;\n}\n.panel:focus-visible {\n outline: var(--cui-focus-ring-width) solid var(--cui-color-border-focus);\n outline-offset: 2px;\n border-radius: var(--cui-radius-sm);\n}\n","import { useId, useRef, useState, type KeyboardEvent } from 'react';\nimport { cn } from '../../utils/cn';\nimport { UnlicensedNotice, useLicensed } from '../../license';\nimport type { TabsProps } from './Tabs.types';\nimport styles from './Tabs.module.css';\n\n/**\n * Underlined tabs following the WAI-ARIA tabs pattern: arrow keys, Home and End\n * move between tabs; the active tab's panel is shown below the list.\n */\nexport function Tabs<T extends string = string>({\n items,\n value,\n defaultValue,\n onValueChange,\n className,\n 'aria-label': ariaLabel,\n ...rest\n}: TabsProps<T>) {\n const baseId = useId();\n const tabRefs = useRef<(HTMLButtonElement | null)[]>([]);\n const firstEnabled = items.find((item) => !item.disabled)?.value;\n const [internal, setInternal] = useState<T | undefined>(defaultValue ?? firstEnabled);\n const licensed = useLicensed();\n if (!licensed) return <UnlicensedNotice />;\n\n const active = value ?? internal;\n const activeIndex = items.findIndex((item) => item.value === active);\n const activeItem = items[activeIndex];\n\n const select = (next: T) => {\n if (value === undefined) setInternal(next);\n onValueChange?.(next);\n };\n\n const move = (from: number, direction: 1 | -1 | 'first' | 'last') => {\n const count = items.length;\n let index = direction === 'first' ? -1 : direction === 'last' ? count : from;\n const step = direction === 'first' ? 1 : direction === 'last' ? -1 : direction;\n for (let i = 0; i < count; i++) {\n index = (index + step + count) % count;\n const item = items[index];\n if (item && !item.disabled) {\n select(item.value);\n tabRefs.current[index]?.focus();\n return;\n }\n }\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLButtonElement>, index: number) => {\n const rtl = getComputedStyle(event.currentTarget).direction === 'rtl';\n const next = rtl ? 'ArrowLeft' : 'ArrowRight';\n const previous = rtl ? 'ArrowRight' : 'ArrowLeft';\n if (event.key === next) move(index, 1);\n else if (event.key === previous) move(index, -1);\n else if (event.key === 'Home') move(index, 'first');\n else if (event.key === 'End') move(index, 'last');\n else return;\n event.preventDefault();\n };\n\n const tabId = (index: number) => `${baseId}-tab-${index}`;\n const panelId = (index: number) => `${baseId}-panel-${index}`;\n\n return (\n <div {...rest} className={cn(styles.root, className)}>\n <div role=\"tablist\" aria-label={ariaLabel} className={styles.list}>\n {items.map((item, index) => {\n const selected = index === activeIndex;\n return (\n <button\n key={item.value}\n ref={(node) => {\n tabRefs.current[index] = node;\n }}\n id={tabId(index)}\n type=\"button\"\n role=\"tab\"\n aria-selected={selected}\n aria-controls={selected && item.content !== undefined ? panelId(index) : undefined}\n tabIndex={selected ? 0 : -1}\n disabled={item.disabled}\n className={cn(styles.tab, selected && styles.selected)}\n onClick={() => select(item.value)}\n onKeyDown={(event) => handleKeyDown(event, index)}\n >\n {item.icon ? (\n <span className={styles.icon} aria-hidden=\"true\">\n {item.icon}\n </span>\n ) : null}\n {item.label}\n </button>\n );\n })}\n </div>\n {activeItem && activeItem.content !== undefined ? (\n <div\n role=\"tabpanel\"\n id={panelId(activeIndex)}\n aria-labelledby={tabId(activeIndex)}\n tabIndex={0}\n className={styles.panel}\n >\n {activeItem.content}\n </div>\n ) : null}\n </div>\n );\n}\n",".root {\n min-width: 0;\n}\n\n.header {\n display: flex;\n align-items: center;\n gap: var(--cui-space-4);\n margin-bottom: var(--cui-space-4);\n}\n\n.heading {\n flex-shrink: 0;\n}\n\n.title {\n margin: 0;\n font-size: var(--cui-font-size-sm);\n font-weight: var(--cui-font-weight-semibold);\n line-height: var(--cui-line-height);\n color: var(--cui-color-text);\n}\n\n.subtitle {\n margin: 2px 0 0;\n font-size: var(--cui-font-size-xs);\n color: var(--cui-color-text-muted);\n}\n\n.divider {\n flex: 1;\n height: 1px;\n background: linear-gradient(to right, var(--cui-color-border), transparent);\n}\n\n.fields {\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n gap: var(--cui-space-6);\n}\n\n@media (min-width: 768px) {\n .columns2 {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n }\n .columns3 {\n grid-template-columns: repeat(3, minmax(0, 1fr));\n }\n}\n","import { createElement, useId } from 'react';\nimport { cn } from '../../utils/cn';\nimport { UnlicensedNotice, useLicensed } from '../../license';\nimport type { FormSectionProps } from './FormSection.types';\nimport styles from './FormSection.module.css';\n\n/**\n * A titled group of form fields: heading + optional subtitle, a divider line,\n * then the fields in a grid. Use it to split long forms into readable sections.\n */\nexport function FormSection({\n title,\n subtitle,\n children,\n columns = 1,\n headingLevel = 3,\n className,\n ...rest\n}: FormSectionProps) {\n const headingId = useId();\n const hasHeader = Boolean(title || subtitle);\n\n const licensed = useLicensed();\n if (!licensed) return <UnlicensedNotice />;\n\n return (\n <section\n {...rest}\n aria-labelledby={title ? headingId : rest['aria-labelledby']}\n className={cn(styles.root, className)}\n >\n {hasHeader ? (\n <div className={styles.header}>\n <div className={styles.heading}>\n {title\n ? createElement(`h${headingLevel}`, { id: headingId, className: styles.title }, title)\n : null}\n {subtitle ? <p className={styles.subtitle}>{subtitle}</p> : null}\n </div>\n <span className={styles.divider} aria-hidden=\"true\" />\n </div>\n ) : null}\n <div className={cn(styles.fields, styles[`columns${columns}`])}>{children}</div>\n </section>\n );\n}\n",".root {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n overflow: hidden;\n box-sizing: border-box;\n border-radius: var(--cui-radius-full);\n background-color: var(--cui-color-surface-secondary);\n color: var(--cui-color-text-secondary);\n font-family: var(--cui-font-family);\n font-weight: var(--cui-font-weight-semibold);\n line-height: 1;\n user-select: none;\n}\n\n.xs {\n width: 1.75rem;\n height: 1.75rem;\n font-size: 0.6875rem;\n}\n.sm {\n width: 2rem;\n height: 2rem;\n font-size: var(--cui-font-size-xs);\n}\n.md {\n width: 2.5rem;\n height: 2.5rem;\n font-size: var(--cui-font-size-sm);\n}\n.lg {\n width: 3rem;\n height: 3rem;\n font-size: var(--cui-font-size-md);\n}\n.xl {\n width: 4rem;\n height: 4rem;\n font-size: var(--cui-font-size-xl);\n}\n\n.image {\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n\n.fallback {\n width: 60%;\n height: 60%;\n}\n\n/* Name-derived tones (translucent token colors work in light and dark) */\n.tone0 {\n background-color: color-mix(in srgb, var(--cui-color-primary) 16%, transparent);\n color: var(--cui-color-primary);\n}\n.tone1 {\n background-color: color-mix(in srgb, var(--cui-color-info) 16%, transparent);\n color: var(--cui-color-info);\n}\n.tone2 {\n background-color: color-mix(in srgb, var(--cui-color-success) 16%, transparent);\n color: var(--cui-color-success);\n}\n.tone3 {\n background-color: color-mix(in srgb, var(--cui-color-warning) 16%, transparent);\n color: var(--cui-color-warning);\n}\n.tone4 {\n background-color: color-mix(in srgb, var(--cui-color-danger) 16%, transparent);\n color: var(--cui-color-danger);\n}\n\n.primary {\n background: linear-gradient(\n to bottom right,\n var(--cui-color-primary),\n color-mix(in srgb, var(--cui-color-primary) 70%, transparent)\n );\n color: var(--cui-color-on-primary);\n}\n","import { useState } from 'react';\nimport { cn } from '../../utils/cn';\nimport { UnlicensedNotice, useLicensed } from '../../license';\nimport type { AvatarProps } from './Avatar.types';\nimport styles from './Avatar.module.css';\n\nconst TONES = [styles.tone0, styles.tone1, styles.tone2, styles.tone3, styles.tone4];\n\nexport function getInitials(name?: string | null): string {\n const words = (name ?? '').trim().split(/\\s+/).filter(Boolean);\n if (words.length === 0) return '';\n const first = words[0]?.[0] ?? '';\n const last = words.length > 1 ? (words[words.length - 1]?.[0] ?? '') : '';\n return (first + last).toUpperCase();\n}\n\n/** Stable pick of a tone from the name, so a person always gets the same color. */\nfunction toneFor(name?: string | null): string | undefined {\n const text = name ?? '';\n let hash = 0;\n for (let i = 0; i < text.length; i++) hash = (hash * 31 + text.charCodeAt(i)) >>> 0;\n return TONES[hash % TONES.length];\n}\n\n/** A photo when available, otherwise initials on a color derived from the name. */\nexport function Avatar({ name, src, size = 'md', tone = 'auto', className, ...rest }: AvatarProps) {\n const [failedSrc, setFailedSrc] = useState<string | null>(null);\n const showImage = Boolean(src) && src !== failedSrc;\n const initials = getInitials(name);\n\n const licensed = useLicensed();\n if (!licensed) return <UnlicensedNotice />;\n\n return (\n <span\n role={rest['aria-hidden'] ? undefined : 'img'}\n aria-label={rest['aria-hidden'] || !name ? undefined : name}\n {...rest}\n className={cn(\n styles.root,\n styles[size],\n !showImage && (tone === 'primary' ? styles.primary : toneFor(name)),\n className,\n )}\n >\n {showImage ? (\n <img\n className={styles.image}\n src={src ?? undefined}\n alt=\"\"\n onError={() => setFailedSrc(src ?? null)}\n />\n ) : initials ? (\n <span aria-hidden=\"true\">{initials}</span>\n ) : (\n <svg className={styles.fallback} viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\">\n <circle cx=\"12\" cy=\"8\" r=\"4\" fill=\"currentColor\" />\n <path d=\"M4 21c0-4.4 3.6-7 8-7s8 2.6 8 7z\" fill=\"currentColor\" />\n </svg>\n )}\n </span>\n );\n}\n",".root {\n position: relative;\n display: inline-block;\n}\n\n.rootSidebar {\n display: block;\n width: 100%;\n}\n\n.contents {\n display: contents;\n}\n\n/* Trigger: header (round avatar) */\n.triggerHeader {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 2.5rem;\n height: 2.5rem;\n padding: 0;\n background: transparent;\n border: 0;\n border-radius: var(--cui-radius-full);\n box-shadow: 0 0 0 2px transparent;\n cursor: pointer;\n transition: box-shadow var(--cui-transition-fast);\n}\n.triggerHeader:hover {\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--cui-color-primary) 20%, transparent);\n}\n.triggerHeader.triggerOpen {\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--cui-color-primary) 30%, transparent);\n}\n\n/* Trigger: sidebar row */\n.triggerSidebar {\n display: flex;\n align-items: center;\n gap: var(--cui-space-2);\n box-sizing: border-box;\n width: 100%;\n padding: var(--cui-space-1);\n background: transparent;\n border: 0;\n border-radius: var(--cui-radius-md);\n color: var(--cui-color-text);\n font-family: var(--cui-font-family);\n text-align: start;\n cursor: pointer;\n transition: background-color var(--cui-transition-fast);\n}\n.triggerSidebar:hover,\n.triggerSidebar.triggerOpen {\n background-color: var(--cui-color-surface-secondary);\n}\n.collapsed {\n justify-content: center;\n}\n\n.triggerHeader:focus-visible,\n.triggerSidebar:focus-visible {\n outline: var(--cui-focus-ring-width) solid var(--cui-color-border-focus);\n outline-offset: var(--cui-focus-ring-offset);\n}\n\n.identityText {\n display: flex;\n flex: 1;\n flex-direction: column;\n min-width: 0;\n line-height: 1.25;\n}\n.triggerName {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: var(--cui-font-size-sm);\n font-weight: var(--cui-font-weight-medium);\n}\n.triggerRole {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: var(--cui-font-size-xs);\n color: var(--cui-color-text-muted);\n}\n\n/* Panel (rendered in <body>) */\n.panel {\n position: fixed;\n z-index: var(--cui-z-popover);\n box-sizing: border-box;\n width: 22rem;\n max-width: calc(100vw - 1.5rem);\n max-height: calc(100vh - 1.5rem);\n overflow-y: auto;\n padding: var(--cui-space-2);\n background-color: var(--cui-color-surface);\n color: var(--cui-color-text);\n border: 1px solid var(--cui-color-border);\n border-radius: var(--cui-radius-xl);\n box-shadow: var(--cui-shadow-lg);\n font-family: var(--cui-font-family);\n font-size: var(--cui-font-size-sm);\n line-height: var(--cui-line-height);\n outline: none;\n transform-origin: top right;\n animation: cui-account-in 0.2s ease-out;\n}\n.panelSidebar {\n transform-origin: bottom left;\n}\n\n@keyframes cui-account-in {\n from {\n opacity: 0;\n transform: scale(0.95);\n }\n}\n\n.identity {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: var(--cui-space-3) var(--cui-space-4) var(--cui-space-2);\n text-align: center;\n}\n\n.email {\n max-width: 100%;\n margin: 0 0 var(--cui-space-2);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: var(--cui-font-size-xs);\n font-weight: var(--cui-font-weight-medium);\n color: var(--cui-color-text-secondary);\n}\n\n.avatarRing {\n display: inline-flex;\n padding: 3px;\n border-radius: var(--cui-radius-full);\n background-color: color-mix(in srgb, var(--cui-color-primary) 15%, transparent);\n}\n.avatarInner {\n display: inline-flex;\n padding: 2px;\n border-radius: var(--cui-radius-full);\n background-color: var(--cui-color-surface);\n}\n\n.greeting {\n margin: var(--cui-space-2) 0 0;\n font-size: var(--cui-font-size-lg);\n font-weight: var(--cui-font-weight-normal);\n line-height: 1.25;\n color: var(--cui-color-text);\n}\n\n.role {\n margin-top: 6px;\n padding: 2px 10px;\n border: 1px solid color-mix(in srgb, var(--cui-color-primary) 20%, transparent);\n border-radius: var(--cui-radius-md);\n background-color: color-mix(in srgb, var(--cui-color-primary) 7%, transparent);\n font-size: 0.6875rem;\n font-weight: var(--cui-font-weight-semibold);\n color: var(--cui-color-primary);\n}\n\n.pills {\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n gap: var(--cui-space-2);\n margin-top: var(--cui-space-3);\n}\n\n.pill {\n display: inline-flex;\n align-items: center;\n gap: var(--cui-space-2);\n padding: 6px var(--cui-space-4);\n background-color: var(--cui-color-surface);\n border: 1px solid var(--cui-color-border);\n border-radius: var(--cui-radius-md);\n color: var(--cui-color-text-secondary);\n font: inherit;\n font-weight: var(--cui-font-weight-medium);\n text-decoration: none;\n cursor: pointer;\n transition:\n background-color var(--cui-transition-fast),\n border-color var(--cui-transition-fast),\n color var(--cui-transition-fast);\n}\n.pill:hover:not(:disabled) {\n background-color: color-mix(in srgb, var(--cui-color-primary) 4%, var(--cui-color-surface));\n border-color: color-mix(in srgb, var(--cui-color-primary) 30%, transparent);\n color: var(--cui-color-primary);\n}\n.pill:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.actionIcon {\n display: inline-flex;\n flex-shrink: 0;\n width: 1.125rem;\n height: 1.125rem;\n}\n.actionIcon > svg {\n width: 100%;\n height: 100%;\n}\n.externalIcon {\n width: 0.8125rem;\n height: 0.8125rem;\n color: var(--cui-color-text-disabled);\n}\n\n.details {\n margin: 0 0 var(--cui-space-2);\n padding: var(--cui-space-2) var(--cui-space-3);\n background-color: var(--cui-color-surface-secondary);\n border-radius: var(--cui-radius-lg);\n font-size: var(--cui-font-size-xs);\n}\n.detailRow {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: var(--cui-space-3);\n}\n.detailRow + .detailRow {\n margin-top: var(--cui-space-1);\n padding-top: var(--cui-space-1);\n border-top: 1px solid var(--cui-color-border);\n}\n.detailRow dt {\n color: var(--cui-color-text-muted);\n}\n.detailRow dd {\n margin: 0;\n text-align: end;\n font-weight: var(--cui-font-weight-medium);\n}\n\n/* App launcher */\n.apps {\n margin-bottom: var(--cui-space-2);\n padding: 10px 6px 6px;\n background-color: var(--cui-color-surface-secondary);\n border: 1px solid var(--cui-color-border);\n border-radius: var(--cui-radius-lg);\n}\n.appsTitle {\n margin: 0;\n padding: 0 var(--cui-space-3) var(--cui-space-1);\n font-size: var(--cui-font-size-xs);\n font-weight: var(--cui-font-weight-medium);\n color: var(--cui-color-text-muted);\n}\n.grid {\n display: grid;\n grid-template-columns: repeat(3, minmax(0, 1fr));\n}\n\n.app {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: var(--cui-space-2) var(--cui-space-1) 6px;\n border: 1px solid transparent;\n border-radius: var(--cui-radius-lg);\n color: var(--cui-color-text-secondary);\n text-decoration: none;\n transition:\n background-color var(--cui-transition-fast),\n border-color var(--cui-transition-fast),\n color var(--cui-transition-fast);\n}\n.app:hover {\n background-color: var(--cui-color-surface);\n border-color: color-mix(in srgb, var(--cui-color-primary) 25%, transparent);\n color: var(--cui-color-primary);\n}\n.app:focus-visible {\n outline: var(--cui-focus-ring-width) solid var(--cui-color-border-focus);\n outline-offset: -2px;\n}\n\n.tile {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 2.75rem;\n height: 2.75rem;\n border-radius: var(--cui-radius-lg);\n box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.05);\n}\n.tile > svg {\n width: 1.375rem;\n height: 1.375rem;\n transition: transform 0.2s ease-out;\n}\n.app:hover .tile > svg {\n transform: scale(1.18);\n}\n\n.tonePrimary {\n background-color: color-mix(in srgb, var(--cui-color-primary) 12%, transparent);\n color: var(--cui-color-primary);\n}\n.toneInfo {\n background-color: color-mix(in srgb, var(--cui-color-info) 14%, transparent);\n color: var(--cui-color-info);\n}\n.toneSuccess {\n background-color: color-mix(in srgb, var(--cui-color-success) 14%, transparent);\n color: var(--cui-color-success);\n}\n.toneWarning {\n background-color: color-mix(in srgb, var(--cui-color-warning) 14%, transparent);\n color: var(--cui-color-warning);\n}\n.toneDanger {\n background-color: color-mix(in srgb, var(--cui-color-danger) 14%, transparent);\n color: var(--cui-color-danger);\n}\n.toneNeutral {\n background-color: var(--cui-color-surface-secondary);\n color: var(--cui-color-text-secondary);\n}\n\n.appName {\n margin-top: 6px;\n text-align: center;\n font-size: var(--cui-font-size-xs);\n font-weight: var(--cui-font-weight-medium);\n line-height: 1.25;\n}\n\n/* Danger actions (log out) */\n.danger {\n padding-top: var(--cui-space-2);\n border-top: 1px solid var(--cui-color-border);\n}\n.dangerAction {\n display: flex;\n align-items: center;\n gap: var(--cui-space-3);\n box-sizing: border-box;\n width: 100%;\n padding: var(--cui-space-2) var(--cui-space-3);\n background: transparent;\n border: 0;\n border-radius: var(--cui-radius-md);\n color: var(--cui-color-danger);\n font: inherit;\n font-weight: var(--cui-font-weight-medium);\n text-align: start;\n cursor: pointer;\n transition: background-color var(--cui-transition-fast);\n}\n.dangerAction:hover:not(:disabled) {\n background-color: color-mix(in srgb, var(--cui-color-danger) 10%, transparent);\n}\n.dangerAction:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n.dangerAction:focus-visible,\n.pill:focus-visible {\n outline: var(--cui-focus-ring-width) solid var(--cui-color-border-focus);\n outline-offset: 1px;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .panel {\n animation: none;\n }\n .tile > svg {\n transition: none;\n }\n}\n","import {\n useEffect,\n useId,\n useRef,\n useState,\n type CSSProperties,\n type KeyboardEvent,\n type ReactNode,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { cn } from '../../utils/cn';\nimport { UnlicensedNotice, useLicensed } from '../../license';\nimport { Avatar } from '../Avatar';\nimport type {\n AccountPanelAction,\n AccountPanelApp,\n AccountPanelProps,\n RenderLinkArgs,\n} from './AccountPanel.types';\nimport styles from './AccountPanel.module.css';\n\nconst GAP = 8;\nconst EDGE = 12;\nconst PANEL_WIDTH = 352;\nconst FOCUSABLE = 'a[href], button:not([disabled])';\n\nconst defaultRenderLink = ({ href, className, title, onClick, children }: RenderLinkArgs) => (\n <a href={href} className={className} title={title} onClick={onClick}>\n {children}\n </a>\n);\n\nconst tileTone: Record<NonNullable<AccountPanelApp['tone']>, string | undefined> = {\n primary: styles.tonePrimary,\n info: styles.toneInfo,\n success: styles.toneSuccess,\n warning: styles.toneWarning,\n danger: styles.toneDanger,\n neutral: styles.toneNeutral,\n};\n\nfunction ExternalIcon() {\n return (\n <svg className={styles.externalIcon} viewBox=\"0 0 20 20\" aria-hidden=\"true\" focusable=\"false\">\n <path\n d=\"M8 5H5v10h10v-3M11 5h4v4M15 5l-7 7\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.8\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\n/**\n * The logged-in user's button and account panel: greeting, role, detail rows,\n * quick actions, an app launcher and a log out action. It holds no auth or\n * routing logic; the app passes the user, the actions and (optionally) a\n * `renderLink` for its router.\n */\nexport function AccountPanel({\n user,\n apps = [],\n actions = [],\n placement = 'header',\n collapsed = false,\n appsTitle = 'All Apps',\n greeting = 'Hi',\n renderLink = defaultRenderLink,\n className,\n}: AccountPanelProps) {\n const sidebar = placement === 'sidebar';\n const panelId = useId();\n const rootRef = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLButtonElement>(null);\n const panelRef = useRef<HTMLDivElement>(null);\n const [open, setOpen] = useState(false);\n const [position, setPosition] = useState<CSSProperties | null>(null);\n const [themeName, setThemeName] = useState<string | undefined>();\n\n const computePosition = () => {\n const trigger = triggerRef.current;\n if (!trigger) return;\n const rect = trigger.getBoundingClientRect();\n if (sidebar) {\n const width = Math.min(PANEL_WIDTH, window.innerWidth - 2 * EDGE);\n setPosition({\n left: Math.max(EDGE, Math.min(rect.right + GAP, window.innerWidth - width - EDGE)),\n bottom: Math.max(EDGE, window.innerHeight - rect.bottom),\n });\n } else {\n setPosition({\n top: rect.bottom + GAP,\n right: Math.max(EDGE, window.innerWidth - rect.right),\n });\n }\n };\n\n const openPanel = () => {\n computePosition();\n // The panel is rendered in <body> (so no ancestor can clip or offset it); carry the theme over.\n setThemeName(rootRef.current?.closest('[data-theme]')?.getAttribute('data-theme') ?? undefined);\n setOpen(true);\n };\n\n const close = () => setOpen(false);\n\n useEffect(() => {\n if (open) panelRef.current?.focus({ preventScroll: true });\n }, [open]);\n\n useEffect(() => {\n if (!open) return;\n const reposition = () => requestAnimationFrame(computePosition);\n const onPointerDown = (event: MouseEvent) => {\n const target = event.target as Node;\n if (!rootRef.current?.contains(target) && !panelRef.current?.contains(target)) close();\n };\n window.addEventListener('scroll', reposition, true);\n window.addEventListener('resize', reposition);\n document.addEventListener('mousedown', onPointerDown, true);\n return () => {\n window.removeEventListener('scroll', reposition, true);\n window.removeEventListener('resize', reposition);\n document.removeEventListener('mousedown', onPointerDown, true);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open, sidebar]);\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n close();\n triggerRef.current?.focus({ preventScroll: true });\n return;\n }\n if (event.key !== 'Tab') return;\n // The panel is portalled to <body>, so keep Tab cycling inside it.\n const nodes = Array.from(panelRef.current?.querySelectorAll<HTMLElement>(FOCUSABLE) ?? []);\n const first = nodes[0];\n const last = nodes[nodes.length - 1];\n if (!first || !last) return;\n if (\n event.shiftKey &&\n (document.activeElement === first || document.activeElement === panelRef.current)\n ) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && document.activeElement === last) {\n event.preventDefault();\n first.focus();\n }\n };\n\n const licensed = useLicensed();\n if (!licensed) return <UnlicensedNotice />;\n\n const firstName = user.name.trim().split(/\\s+/)[0] ?? user.name;\n const quickActions = actions.filter((a) => a.tone !== 'danger');\n const dangerActions = actions.filter((a) => a.tone === 'danger');\n\n const runAction = (action: AccountPanelAction) => {\n action.onClick?.();\n close();\n };\n\n const renderQuickAction = (action: AccountPanelAction): ReactNode => {\n const content = (\n <>\n {action.icon ? (\n <span className={styles.actionIcon} aria-hidden=\"true\">\n {action.icon}\n </span>\n ) : null}\n <span>{action.label}</span>\n {action.external ? <ExternalIcon /> : null}\n </>\n );\n if (action.href && !action.disabled) {\n if (action.external) {\n return (\n <a\n key={action.id}\n href={action.href}\n target=\"_blank\"\n rel=\"noreferrer\"\n title={action.title}\n className={styles.pill}\n onClick={() => close()}\n >\n {content}\n </a>\n );\n }\n return (\n <span key={action.id} className={styles.contents}>\n {renderLink({\n href: action.href,\n className: styles.pill ?? '',\n title: action.title,\n onClick: () => close(),\n children: content,\n })}\n </span>\n );\n }\n return (\n <button\n key={action.id}\n type=\"button\"\n disabled={action.disabled}\n title={action.title}\n className={styles.pill}\n onClick={() => runAction(action)}\n >\n {content}\n </button>\n );\n };\n\n const panel = (\n <div\n ref={panelRef}\n id={panelId}\n role=\"dialog\"\n aria-label=\"Account\"\n tabIndex={-1}\n className={cn(styles.panel, sidebar && styles.panelSidebar)}\n style={position ?? undefined}\n data-theme={themeName}\n onKeyDown={handleKeyDown}\n >\n <div className={styles.identity}>\n {user.email ? <p className={styles.email}>{user.email}</p> : null}\n <span className={styles.avatarRing}>\n <span className={styles.avatarInner}>\n <Avatar\n name={user.name}\n src={user.avatarUrl}\n size=\"xl\"\n tone=\"primary\"\n aria-hidden=\"true\"\n />\n </span>\n </span>\n <p className={styles.greeting}>\n {greeting}, {firstName}!\n </p>\n {user.role ? <span className={styles.role}>{user.role}</span> : null}\n {quickActions.length > 0 ? (\n <div className={styles.pills}>{quickActions.map(renderQuickAction)}</div>\n ) : null}\n </div>\n\n {user.details?.length ? (\n <dl className={styles.details}>\n {user.details.map((detail) => (\n <div key={detail.label} className={styles.detailRow}>\n <dt>{detail.label}</dt>\n <dd>{detail.value}</dd>\n </div>\n ))}\n </dl>\n ) : null}\n\n {apps.length > 0 ? (\n <section className={styles.apps} aria-label={appsTitle}>\n <p className={styles.appsTitle}>{appsTitle}</p>\n <div className={styles.grid}>\n {apps.map((app) => {\n const tile = (\n <>\n <span\n className={cn(styles.tile, tileTone[app.tone ?? 'primary'])}\n aria-hidden=\"true\"\n >\n {app.icon}\n </span>\n <span className={styles.appName}>{app.name}</span>\n </>\n );\n return app.current ? (\n <span key={app.id} className={styles.contents}>\n {renderLink({\n href: app.url,\n className: styles.app ?? '',\n title: app.description,\n onClick: () => close(),\n children: tile,\n })}\n </span>\n ) : (\n <a\n key={app.id}\n href={app.url}\n target=\"_blank\"\n rel=\"noreferrer\"\n title={app.description}\n className={styles.app}\n >\n {tile}\n </a>\n );\n })}\n </div>\n </section>\n ) : null}\n\n {dangerActions.length > 0 ? (\n <div className={styles.danger}>\n {dangerActions.map((action) => (\n <button\n key={action.id}\n type=\"button\"\n disabled={action.disabled}\n title={action.title}\n className={styles.dangerAction}\n onClick={() => runAction(action)}\n >\n {action.icon ? (\n <span className={styles.actionIcon} aria-hidden=\"true\">\n {action.icon}\n </span>\n ) : null}\n {action.label}\n </button>\n ))}\n </div>\n ) : null}\n </div>\n );\n\n return (\n <div ref={rootRef} className={cn(styles.root, sidebar && styles.rootSidebar, className)}>\n <button\n ref={triggerRef}\n type=\"button\"\n aria-label={`Account: ${user.name}`}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n aria-controls={open ? panelId : undefined}\n className={cn(\n sidebar ? styles.triggerSidebar : styles.triggerHeader,\n sidebar && collapsed && styles.collapsed,\n open && styles.triggerOpen,\n )}\n onClick={() => (open ? close() : openPanel())}\n >\n <Avatar name={user.name} src={user.avatarUrl} size=\"sm\" tone=\"primary\" aria-hidden=\"true\" />\n {sidebar && !collapsed ? (\n <span className={styles.identityText}>\n <span className={styles.triggerName}>{user.name}</span>\n {user.role ? <span className={styles.triggerRole}>{user.role}</span> : null}\n </span>\n ) : null}\n </button>\n {open && position ? createPortal(panel, document.body) : null}\n </div>\n );\n}\n",".root {\n margin: 0;\n font-family: var(--cui-font-family);\n line-height: var(--cui-line-height);\n}\n\n/* Variants */\n.h1 {\n font-size: var(--cui-font-size-2xl);\n font-weight: var(--cui-font-weight-bold);\n line-height: 1.3;\n}\n.h2 {\n font-size: var(--cui-font-size-xl);\n font-weight: var(--cui-font-weight-semibold);\n line-height: 1.35;\n}\n.h3 {\n font-size: var(--cui-font-size-lg);\n font-weight: var(--cui-font-weight-semibold);\n line-height: 1.4;\n}\n.h4 {\n font-size: var(--cui-font-size-md);\n font-weight: var(--cui-font-weight-semibold);\n}\n.body {\n font-size: var(--cui-font-size-md);\n font-weight: var(--cui-font-weight-normal);\n}\n.bodySm {\n font-size: var(--cui-font-size-sm);\n font-weight: var(--cui-font-weight-normal);\n}\n.caption {\n font-size: var(--cui-font-size-xs);\n font-weight: var(--cui-font-weight-normal);\n}\n.label {\n font-size: var(--cui-font-size-sm);\n font-weight: var(--cui-font-weight-semibold);\n}\n\n/* Colors */\n.color-default {\n color: var(--cui-color-text);\n}\n.color-secondary {\n color: var(--cui-color-text-secondary);\n}\n.color-muted {\n color: var(--cui-color-text-muted);\n}\n.color-disabled {\n color: var(--cui-color-text-disabled);\n}\n.color-primary {\n color: var(--cui-color-primary);\n}\n.color-success {\n color: var(--cui-color-success);\n}\n.color-warning {\n color: var(--cui-color-warning);\n}\n.color-danger {\n color: var(--cui-color-danger);\n}\n.color-info {\n color: var(--cui-color-info);\n}\n\n/* Weight overrides (declared after variants so they win) */\n.weight-normal {\n font-weight: var(--cui-font-weight-normal);\n}\n.weight-medium {\n font-weight: var(--cui-font-weight-medium);\n}\n.weight-semibold {\n font-weight: var(--cui-font-weight-semibold);\n}\n.weight-bold {\n font-weight: var(--cui-font-weight-bold);\n}\n\n.align-start {\n text-align: start;\n}\n.align-center {\n text-align: center;\n}\n.align-end {\n text-align: end;\n}\n\n.truncate {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n","import { createElement } from 'react';\nimport { cn } from '../../utils/cn';\nimport { UnlicensedNotice, useLicensed } from '../../license';\nimport type { TypographyElement, TypographyProps, TypographyVariant } from './Typography.types';\nimport styles from './Typography.module.css';\n\nconst defaultElement: Record<TypographyVariant, TypographyElement> = {\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n h4: 'h4',\n body: 'p',\n 'body-sm': 'p',\n caption: 'span',\n label: 'span',\n};\n\nconst variantClass: Record<TypographyVariant, string | undefined> = {\n h1: styles.h1,\n h2: styles.h2,\n h3: styles.h3,\n h4: styles.h4,\n body: styles.body,\n 'body-sm': styles.bodySm,\n caption: styles.caption,\n label: styles.label,\n};\n\n/** Themed text. Pick the look with `variant` and the HTML element with `as`. */\nexport function Typography({\n variant = 'body',\n as,\n color = 'default',\n weight,\n align,\n truncate = false,\n className,\n ...rest\n}: TypographyProps) {\n const licensed = useLicensed();\n if (!licensed) return <UnlicensedNotice />;\n\n return createElement(as ?? defaultElement[variant], {\n ...rest,\n className: cn(\n styles.root,\n variantClass[variant],\n styles[`color-${color}`],\n weight && styles[`weight-${weight}`],\n align && styles[`align-${align}`],\n truncate && styles.truncate,\n className,\n ),\n });\n}\n","import { useSyncExternalStore } from 'react';\n\nconst DARK_QUERY = '(prefers-color-scheme: dark)';\n\n/** True when the OS prefers dark. Always false on the server and where matchMedia is missing. */\nexport function useSystemPrefersDark(): boolean {\n return useSyncExternalStore(\n (onChange) => {\n if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') {\n return () => {};\n }\n const query = window.matchMedia(DARK_QUERY);\n query.addEventListener('change', onChange);\n return () => query.removeEventListener('change', onChange);\n },\n () =>\n typeof window !== 'undefined' &&\n typeof window.matchMedia === 'function' &&\n window.matchMedia(DARK_QUERY).matches,\n () => false,\n );\n}\n\nconst storageListeners = new Set<() => void>();\n\nfunction readStorage(key: string): string | null {\n try {\n return window.localStorage.getItem(key);\n } catch {\n return null;\n }\n}\n\nexport function writeStoredTheme(key: string, theme: string): void {\n try {\n window.localStorage.setItem(key, theme);\n } catch {\n // Storage can be blocked (private mode); the choice then lasts for the session only.\n }\n storageListeners.forEach((listener) => listener());\n}\n\n/** The theme saved under `key`, or null. Null on the server and on the first client render. */\nexport function useStoredTheme(key: string | undefined): string | null {\n return useSyncExternalStore(\n (onChange) => {\n storageListeners.add(onChange);\n window.addEventListener('storage', onChange);\n return () => {\n storageListeners.delete(onChange);\n window.removeEventListener('storage', onChange);\n };\n },\n () => (key ? readStorage(key) : null),\n () => null,\n );\n}\n",".root {\n background-color: var(--cui-color-background);\n color: var(--cui-color-text);\n font-family: var(--cui-font-family);\n line-height: var(--cui-line-height);\n}\n","import { createContext, useCallback, useContext, useMemo, useState } from 'react';\nimport { LicenseContext } from '../license';\nimport { cn } from '../utils/cn';\nimport { useStoredTheme, useSystemPrefersDark, writeStoredTheme } from './themeStore';\nimport type { Theme, ThemeContextValue, ThemeProviderProps } from './ThemeProvider.types';\nimport styles from './ThemeProvider.module.css';\n\nconst ThemeContext = createContext<ThemeContextValue | null>(null);\n\nexport function ThemeProvider({\n children,\n theme: controlledTheme,\n defaultTheme = 'light',\n onThemeChange,\n storageKey,\n licenseKey,\n className,\n ...rest\n}: ThemeProviderProps) {\n const [internalTheme, setInternalTheme] = useState<Theme>(defaultTheme);\n const storedTheme = useStoredTheme(controlledTheme === undefined ? storageKey : undefined);\n const systemPrefersDark = useSystemPrefersDark();\n\n const theme = controlledTheme ?? storedTheme ?? internalTheme;\n const resolvedTheme = theme === 'system' ? (systemPrefersDark ? 'dark' : 'light') : theme;\n\n const setTheme = useCallback(\n (next: Theme) => {\n if (controlledTheme === undefined) {\n setInternalTheme(next);\n if (storageKey) writeStoredTheme(storageKey, next);\n }\n onThemeChange?.(next);\n },\n [controlledTheme, onThemeChange, storageKey],\n );\n\n const value = useMemo(\n () => ({ theme, resolvedTheme, setTheme }),\n [theme, resolvedTheme, setTheme],\n );\n // A nested provider without its own key inherits the outer one.\n const inheritedKey = useContext(LicenseContext);\n\n return (\n <ThemeContext.Provider value={value}>\n <LicenseContext.Provider value={licenseKey ?? inheritedKey}>\n <div {...rest} data-theme={resolvedTheme} className={cn(styles.root, className)}>\n {children}\n </div>\n </LicenseContext.Provider>\n </ThemeContext.Provider>\n );\n}\n\n/** Read or change the active theme. Must be used inside a `ThemeProvider`. */\nexport function useTheme(): ThemeContextValue {\n const context = useContext(ThemeContext);\n if (!context) throw new Error('useTheme must be used within a <ThemeProvider>.');\n return context;\n}\n",".root {\n display: inline-flex;\n padding: 2px;\n gap: 2px;\n background-color: var(--cui-color-surface-secondary);\n border: 1px solid var(--cui-color-border);\n border-radius: var(--cui-radius-lg);\n}\n\n.option {\n position: relative;\n display: inline-flex;\n}\n\n.input {\n position: absolute;\n inset: 0;\n margin: 0;\n opacity: 0;\n cursor: pointer;\n}\n\n.face {\n display: inline-flex;\n align-items: center;\n gap: var(--cui-space-2);\n padding: 6px var(--cui-space-3);\n border-radius: var(--cui-radius-md);\n color: var(--cui-color-text-muted);\n font-family: var(--cui-font-family);\n font-size: var(--cui-font-size-sm);\n font-weight: var(--cui-font-weight-medium);\n line-height: 1.25;\n white-space: nowrap;\n transition:\n background-color var(--cui-transition-fast),\n color var(--cui-transition-fast);\n}\n\n.option:hover .input:not(:checked) + .face {\n color: var(--cui-color-text);\n}\n\n.input:checked + .face {\n background-color: var(--cui-color-surface);\n color: var(--cui-color-primary);\n box-shadow: var(--cui-shadow-sm);\n}\n\n.input:focus-visible + .face {\n outline: var(--cui-focus-ring-width) solid var(--cui-color-border-focus);\n outline-offset: 1px;\n}\n\n.icon {\n width: 1rem;\n height: 1rem;\n flex-shrink: 0;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .face {\n transition: none;\n }\n}\n","import { useId, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { UnlicensedNotice, useLicensed } from '../../license';\nimport { useTheme } from '../../theme';\nimport type { ThemeToggleProps } from './ThemeToggle.types';\nimport styles from './ThemeToggle.module.css';\n\nconst icons: Record<string, ReactNode> = {\n light: (\n <>\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d=\"M12 3v2M12 19v2M3 12h2M19 12h2M5.6 5.6l1.4 1.4M17 17l1.4 1.4M5.6 18.4L7 17M17 7l1.4-1.4\" />\n </>\n ),\n dark: <path d=\"M20 14.5A8 8 0 019.5 4a8 8 0 1010.5 10.5z\" />,\n system: (\n <>\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"12\" rx=\"2\" />\n <path d=\"M8 20h8M12 16v4\" />\n </>\n ),\n};\n\nconst labels: Record<string, string> = { light: 'Light', dark: 'Dark', system: 'System' };\n\n/**\n * Switch between themes (light / dark / system by default). Must be inside a\n * `ThemeProvider`. Built on radio inputs, so arrow keys and screen readers work natively.\n */\nexport function ThemeToggle({\n modes = ['light', 'dark', 'system'],\n compact = false,\n className,\n 'aria-label': ariaLabel = 'Theme',\n ...rest\n}: ThemeToggleProps) {\n const { theme, setTheme } = useTheme();\n const name = useId();\n const licensed = useLicensed();\n if (!licensed) return <UnlicensedNotice />;\n\n return (\n <div {...rest} role=\"radiogroup\" aria-label={ariaLabel} className={cn(styles.root, className)}>\n {modes.map((mode) => {\n const label = labels[mode] ?? mode;\n return (\n <label key={mode} className={styles.option} title={compact ? label : undefined}>\n <input\n type=\"radio\"\n name={name}\n value={mode}\n checked={theme === mode}\n onChange={() => setTheme(mode)}\n className={styles.input}\n aria-label={compact ? label : undefined}\n />\n <span className={styles.face}>\n {icons[mode] ? (\n <svg\n className={styles.icon}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.8\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n {icons[mode]}\n </svg>\n ) : null}\n {compact ? null : label}\n </span>\n </label>\n );\n })}\n </div>\n );\n}\n"],"mappings":"6JAGA,SAAgBuH,EAAG,GAAGC,EAA8B,CAClD,OAAOA,EAAO,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,CACxC,CCCA,IAAMC,EAAO,aAEb,SAAgBC,EAAQ,EAAqB,CAC3C,IAAMC,EAAOF,EAAOG,EAAI,KAAK,EACzBC,EAAK,WACLC,EAAK,WACT,IAAK,IAAIC,EAAI,EAAGA,EAAIJ,EAAK,OAAQ,IAAK,CACpC,IAAMK,EAAKL,EAAK,WAAWI,CAAC,EAC5B,EAAK,KAAK,KAAKF,EAAKG,EAAI,UAAU,EAClC,EAAK,KAAK,KAAKF,EAAKE,EAAI,UAAU,CACpC,CAMA,MALA,GAAK,KAAK,KAAKH,EAAMA,IAAO,GAAK,UAAU,EAC3C,GAAM,KAAK,KAAKC,EAAMA,IAAO,GAAK,UAAU,EAC5C,EAAK,KAAK,KAAKA,EAAMA,IAAO,GAAK,UAAU,EAC3C,GAAM,KAAK,KAAKD,EAAMA,IAAO,GAAK,UAAU,GAC9B,YAAc,QAAUC,IAAOD,IAAO,GAAA,CACvC,SAAS,EAAE,CAAC,CAAC,SAAS,GAAI,GAAG,CAC5C,CClBA,IAAaI,EAAsC,CACjD,gBACF,ECHIC,EAAY,GACVC,EAAY,IAAI,IAClBC,EAAS,GAGAC,GAAA,EAAiBrI,EAAAA,cAAAA,CAA6B,IAAI,EAG/D,SAAgBsI,EAAc,EAAmB,CAC/C,EAAYV,EACZ,EAAS,GACTO,EAAU,QAAS,GAAaI,EAAS,CAAC,CAC5C,CAEA,SAAgBC,EAAkB,EAAyC,CAEzE,MADI,CAACZ,GAAO,CAACA,EAAI,KAAK,EAAU,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