@owodesign/owoui 0.1.3 → 0.1.5
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 +22 -6
- package/dist/index.min.js +1 -1
- package/dist/preset-default.css +143 -0
- package/dist/preset-elevated.css +164 -0
- package/dist/preset-flat.css +144 -0
- package/dist/preset-glass.css +173 -0
- package/dist/storybook/index.min.js +9 -9
- package/dist/storybook-static/app.css +1832 -1974
- package/dist/storybook-static/assets/main.css +2 -2
- package/dist/storybook-static/assets/main.js +16 -16
- package/dist/style.css +2988 -0
- package/dist/theme-dark.css +230 -0
- package/dist/theme-light.css +231 -0
- package/dist/tokens.css +118 -0
- package/dist/tokens.d.ts +16 -9
- package/dist/tokens.min.js +1 -1
- package/package.json +25 -30
- package/src/preset-default.css +0 -27
- package/src/preset-elevated.css +0 -27
- package/src/preset-flat.css +0 -27
- package/src/preset-glass.css +0 -27
- package/src/style.css +0 -22
- package/src/styles/tokens.css +0 -253
- package/src/styles/ui/avatar.css +0 -13
- package/src/styles/ui/badge.css +0 -52
- package/src/styles/ui/button.css +0 -49
- package/src/styles/ui/collapsible.css +0 -13
- package/src/styles/ui/dialog.css +0 -37
- package/src/styles/ui/drawer.css +0 -15
- package/src/styles/ui/dropdown-menu.css +0 -132
- package/src/styles/ui/field.css +0 -12
- package/src/styles/ui/icon-button.css +0 -29
- package/src/styles/ui/input.css +0 -16
- package/src/styles/ui/panel.css +0 -23
- package/src/styles/ui/segmented-control.css +0 -28
- package/src/styles/ui/select.css +0 -52
- package/src/styles/ui/skeleton.css +0 -99
- package/src/styles/ui/status-notice.css +0 -49
- package/src/styles/ui/switch.css +0 -17
- package/src/styles/ui/tabs.css +0 -33
- package/src/styles/ui/textarea.css +0 -8
- package/src/styles/ui/toast.css +0 -57
- package/src/styles/ui/tooltip.css +0 -31
- package/src/theme-dark.css +0 -87
- package/src/theme-light.css +0 -102
- package/src/tokens.css +0 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ import '@owodesign/owoui/style.css';
|
|
|
9
9
|
import { Button, Dialog, Select } from '@owodesign/owoui';
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
`style.css`
|
|
12
|
+
`style.css` is a compiled, publish-ready CSS asset. Consumers do not need Tailwind or a Tailwind PostCSS plugin to resolve it. It ships the component bundle together with `theme-light + preset-default`, so the full `ref -> sys -> cmp` token chain is present even when consumers only import one file.
|
|
13
13
|
|
|
14
14
|
To opt into another combination:
|
|
15
15
|
|
|
@@ -19,6 +19,12 @@ import '@owodesign/owoui/theme-dark.css';
|
|
|
19
19
|
import '@owodesign/owoui/preset-glass.css';
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
+
Override order is intentional:
|
|
23
|
+
|
|
24
|
+
- `style.css` establishes the default baseline (`theme-light + preset-default`)
|
|
25
|
+
- later theme imports replace the theme layer
|
|
26
|
+
- later preset imports replace the preset layer
|
|
27
|
+
|
|
22
28
|
This package ships:
|
|
23
29
|
|
|
24
30
|
- reusable React UI primitives
|
|
@@ -49,6 +55,8 @@ import { tokenGroups, semanticTokenKeys, themeNames, presetNames } from '@owodes
|
|
|
49
55
|
- `@owodesign/owoui/theme-light.css`
|
|
50
56
|
- `@owodesign/owoui/theme-dark.css`
|
|
51
57
|
|
|
58
|
+
If you import `theme-light.css` after `style.css`, it is effectively a no-op because `style.css` already includes the same theme baseline.
|
|
59
|
+
|
|
52
60
|
## Presets
|
|
53
61
|
|
|
54
62
|
- `@owodesign/owoui/preset-default.css`: Signature Look based on qblog's current default preset qualities
|
|
@@ -56,6 +64,8 @@ import { tokenGroups, semanticTokenKeys, themeNames, presetNames } from '@owodes
|
|
|
56
64
|
- `@owodesign/owoui/preset-elevated.css`: stronger depth and larger radii
|
|
57
65
|
- `@owodesign/owoui/preset-glass.css`: translucent surfaces with blur
|
|
58
66
|
|
|
67
|
+
If you import `preset-default.css` after `style.css`, it is effectively a no-op because `style.css` already includes the default preset baseline.
|
|
68
|
+
|
|
59
69
|
There is no backward-compat alias layer for the previous `dark.css` / `flat.css` / `elevated.css` / `glass.css` entrypoints.
|
|
60
70
|
|
|
61
71
|
## Storybook Artifact
|
|
@@ -79,19 +89,25 @@ It also builds a standalone static storybook site into `dist/storybook-static/`,
|
|
|
79
89
|
For package-local development with HMR, run:
|
|
80
90
|
|
|
81
91
|
```bash
|
|
82
|
-
npm
|
|
92
|
+
npm run dev:storybook
|
|
83
93
|
```
|
|
84
94
|
|
|
85
|
-
The dev host lives inside
|
|
95
|
+
The dev host lives inside this package itself (`vite.config.ts`, `postcss.config.mjs`, `index.html`) and does not depend on qblog's app shell.
|
|
96
|
+
|
|
97
|
+
## Specs
|
|
98
|
+
|
|
99
|
+
- [form-control-boundaries.md](./docs/spec/form-control-boundaries.md): design and architecture boundaries for `Field`, `Input`, `Textarea`, and `Select`
|
|
100
|
+
- [token-layering-and-naming.md](./docs/spec/token-layering-and-naming.md): raw / alias / semantic token layering and naming rules
|
|
101
|
+
- [token-naming-upgrade-plan.md](./docs/spec/token-naming-upgrade-plan.md): `--owo-ref-*` / `--owo-sys-*` / `--owo-cmp-*` naming migration plan
|
|
86
102
|
|
|
87
103
|
## Release Checks
|
|
88
104
|
|
|
89
|
-
From the
|
|
105
|
+
From the package root:
|
|
90
106
|
|
|
91
107
|
```bash
|
|
92
|
-
npm run release:
|
|
108
|
+
npm run release:check
|
|
93
109
|
```
|
|
94
110
|
|
|
95
111
|
Publishing notes live in:
|
|
96
112
|
|
|
97
|
-
- [PUBLISHING.md](
|
|
113
|
+
- [PUBLISHING.md](./PUBLISHING.md)
|
package/dist/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{clsx as Yt}from"clsx";import{useState as Qt}from"react";import{jsx as Le}from"react/jsx-runtime";var jt={xs:"h-6 w-6 text-[10px]",sm:"h-8 w-8 text-xs",md:"h-10 w-10 text-sm",lg:"h-14 w-14 text-lg"};function en(e){let t=e.trim().split(/\s+/);return t.length>=2?(t[0][0]+t[t.length-1][0]).toUpperCase():e.slice(0,2).toUpperCase()}function Ke({src:e,alt:t,name:n,size:o="md",tone:a="neutral",className:s}){let[r,l]=Qt(!1),u=e&&!r,i=n?en(n):"?";return Le("span",{"data-tone":a,className:Yt("ui-avatar inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full font-medium select-none",jt[o],s),children:u?Le("img",{src:e,alt:t??n??"",className:"h-full w-full object-cover",onError:()=>l(!0)}):Le("span",{"aria-label":t??n,children:i})})}import{clsx as tn}from"clsx";import{jsx as nn}from"react/jsx-runtime";function Ue({tone:e="neutral",variant:t="soft",size:n="xs",className:o,children:a,...s}){return nn("span",{"data-tone":e,"data-variant":t,"data-size":n,className:tn("ui-badge inline-flex items-center rounded-full border text-[var(--badge-text)]",n==="xs"?"px-2.5 py-1 text-[11px]":"px-3 py-1 text-xs font-medium",o),...s,children:a})}import{clsx as bn}from"clsx";import{clsx as on}from"clsx";import{jsx as M,jsxs as Y}from"react/jsx-runtime";var rn={xs:12,sm:14,md:16,lg:24};function sn({px:e}){let n=Math.PI*2*9;return Y("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[M("circle",{cx:"12",cy:"12",r:9,stroke:"currentColor",strokeWidth:"3",opacity:"0.2"}),M("circle",{cx:"12",cy:"12",r:9,stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:`${n*.28} ${n*.72}`})]})}function an({px:e}){return Y("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[M("path",{d:"M12 2a10 10 0 0 1 10 10",opacity:"0.9"}),M("path",{d:"M12 2a10 10 0 0 0-7.07 2.93",opacity:"0.2"}),M("path",{d:"M4.93 4.93A10 10 0 0 0 2 12",opacity:"0.2"}),M("path",{d:"M2 12a10 10 0 0 0 2.93 7.07",opacity:"0.2"}),M("path",{d:"M4.93 19.07A10 10 0 0 0 12 22",opacity:"0.2"}),M("path",{d:"M12 22a10 10 0 0 0 7.07-2.93",opacity:"0.2"}),M("path",{d:"M19.07 19.07A10 10 0 0 0 22 12",opacity:"0.2"})]})}function ln({px:e}){return M("svg",{width:e,height:e,viewBox:"0 0 24 24",children:[0,1,2,3,4,5,6,7].map(n=>{let o=n/8*360,a=.15+n/8*.85;return M("circle",{cx:"12",cy:"3.5",r:"1.8",fill:"currentColor",opacity:a,transform:`rotate(${o} 12 12)`},n)})})}function un({px:e}){return M("svg",{width:e,height:e,viewBox:"0 0 24 24",children:[0,1,2,3].map(t=>Y("rect",{x:3+t*5.5,y:"4",width:"3",height:"16",rx:"1.5",fill:"currentColor",opacity:"0.3",children:[M("animate",{attributeName:"opacity",values:"0.3;1;0.3",dur:"1s",begin:`${t*.15}s`,repeatCount:"indefinite"}),M("animate",{attributeName:"height",values:"16;8;16",dur:"1s",begin:`${t*.15}s`,repeatCount:"indefinite"}),M("animate",{attributeName:"y",values:"4;8;4",dur:"1s",begin:`${t*.15}s`,repeatCount:"indefinite"})]},t))})}function cn({px:e}){let t=e*.14,n=e*.33,o=e/2-n,a=e/2,s=e/2+n,r=e/2;return M("svg",{width:e,height:e,viewBox:`0 0 ${e} ${e}`,children:[o,a,s].map((l,u)=>Y("circle",{cx:l,cy:r,r:t,fill:"currentColor",opacity:"0.4",children:[M("animate",{attributeName:"cy",values:`${r};${r-e*.25};${r}`,dur:"0.6s",begin:`${u*.12}s`,repeatCount:"indefinite",calcMode:"spline",keySplines:"0.4 0 0.2 1;0.4 0 0.2 1"}),M("animate",{attributeName:"opacity",values:"0.4;1;0.4",dur:"0.6s",begin:`${u*.12}s`,repeatCount:"indefinite"})]},u))})}function dn({px:e}){return Y("svg",{width:e,height:e,viewBox:"0 0 24 24",children:[Y("circle",{cx:"12",cy:"12",r:"0",fill:"currentColor",opacity:"0",children:[M("animate",{attributeName:"r",values:"4;10;4",dur:"1.2s",repeatCount:"indefinite"}),M("animate",{attributeName:"opacity",values:"0.8;0.1;0.8",dur:"1.2s",repeatCount:"indefinite"})]}),M("circle",{cx:"12",cy:"12",r:"3.5",fill:"currentColor",opacity:"0.7"})]})}function pn({px:e}){return Y("svg",{width:e,height:e,viewBox:"0 0 24 24",children:[M("circle",{cx:"12",cy:"12",r:"8",stroke:"currentColor",strokeWidth:"1.5",fill:"none",opacity:"0.15"}),M("circle",{cx:"12",cy:"4",r:"2.2",fill:"currentColor",children:M("animateTransform",{attributeName:"transform",type:"rotate",from:"0 12 12",to:"360 12 12",dur:"0.9s",repeatCount:"indefinite"})}),M("circle",{cx:"12",cy:"20",r:"1.5",fill:"currentColor",opacity:"0.5",children:M("animateTransform",{attributeName:"transform",type:"rotate",from:"0 12 12",to:"-360 12 12",dur:"0.9s",repeatCount:"indefinite"})})]})}function fn({px:e}){let t=e*.14,n=e*.33,o=e/2-n,a=e/2,s=e/2+n,r=e/2;return M("svg",{width:e,height:e,viewBox:`0 0 ${e} ${e}`,children:[o,a,s].map((l,u)=>M("circle",{cx:l,cy:r,r:t,fill:"currentColor",opacity:"0.25",children:M("animate",{attributeName:"opacity",values:"0.25;1;0.25",dur:"0.9s",begin:`${u*.2}s`,repeatCount:"indefinite"})},u))})}var mn={ring:sn,arc:an,dots:ln,bars:un,bounce:cn,pulse:dn,orbit:pn,flow:fn},gn=new Set(["ring","arc","dots"]);function be({variant:e="ring",size:t="md",className:n,label:o}){let a=typeof t=="number"?t:rn[t],s=mn[e];return M("span",{"aria-hidden":!o,"aria-label":o,role:o?"img":void 0,className:on("ui-spinner inline-flex",gn.has(e)&&"animate-spin",n),children:M(s,{px:a})})}import{Fragment as vn,jsx as Q,jsxs as xn}from"react/jsx-runtime";function We({variant:e="secondary",size:t="md",loading:n=!1,className:o}){return bn("ui-button","inline-flex items-center justify-center gap-2 rounded-md border font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-inset disabled:cursor-not-allowed disabled:opacity-[var(--button-disabled-opacity)]",t==="sm"?"min-h-8 px-3 text-xs":"min-h-9 px-4 text-sm",n&&"pointer-events-none cursor-wait",o)}function se(e){let{variant:t="secondary",size:n="md",loading:o=!1,leadingIcon:a,trailingIcon:s,className:r,children:l,...u}=e,i=xn(vn,{children:[o?Q("span",{className:"shrink-0",children:Q(be,{size:n==="sm"?"sm":"md"})}):a?Q("span",{className:"shrink-0",children:a}):null,Q("span",{children:l}),!o&&s?Q("span",{className:"shrink-0",children:s}):null]}),d=We({variant:t,size:n,loading:o,className:r});if("href"in e&&e.href){let{href:g,...p}=u;return Q("a",{href:g,"data-variant":t,"data-size":n,"data-loading":o?"true":void 0,"aria-disabled":o||void 0,tabIndex:o?-1:void 0,className:d,onClick:o?f=>f.preventDefault():void 0,...p,children:i})}let c=u;return Q("button",{type:c.type??"button","data-variant":t,"data-size":n,"data-loading":o?"true":void 0,disabled:c.disabled||o,className:d,...c,children:i})}import{clsx as Ee}from"clsx";import{createContext as hn,useContext as Tn,useEffect as yn,useId as wn,useMemo as Mn,useRef as qe,useState as Ge}from"react";import{jsx as ie}from"react/jsx-runtime";var Xe=hn(null);function Ze(e){let t=Tn(Xe);if(!t)throw new Error(`${e} must be used within Collapsible.Root`);return t}function Pn({open:e,defaultOpen:t,onOpenChange:n}){let[o,a]=Ge(t??!1),s=e!==void 0,r=s?e:o;function l(u){s||a(u),n?.(u)}return[r,l]}function Ie({children:e,open:t,defaultOpen:n,onOpenChange:o,className:a,...s}){let[r,l]=Pn({open:t,defaultOpen:n,onOpenChange:o}),u=wn(),i=Mn(()=>({open:r,setOpen:l,contentId:u}),[u,r,l]);return ie(Xe.Provider,{value:i,children:ie("div",{"data-state":r?"open":"closed",className:Ee("ui-collapsible",a),...s,children:e})})}function Je({children:e,className:t,onClick:n,...o}){let{open:a,setOpen:s,contentId:r}=Ze("Collapsible.Trigger");return ie("button",{type:"button","aria-expanded":a,"aria-controls":r,"data-state":a?"open":"closed",className:Ee("ui-collapsible__trigger",t),onClick:l=>{n?.(l),l.defaultPrevented||s(!a)},...o,children:e})}function Ye({children:e,className:t,...n}){let{open:o,contentId:a}=Ze("Collapsible.Content"),[s,r]=Ge(o),l=qe(null),u=qe(null);return yn(()=>{let i=l.current,d=u.current;if(!i||!d)return;let c=0,g=0,p=()=>{i.style.height="auto",i.style.overflow="visible"};if(o&&r(!0),!s&&!o)return;let f=x=>{x.target!==i||x.propertyName!=="height"||(i.removeEventListener("transitionend",f),o?p():r(!1))};return(()=>{let x=d.scrollHeight;if(i.style.overflow="hidden",o){i.style.height="0px",c=window.requestAnimationFrame(()=>{i.addEventListener("transitionend",f),i.style.height=`${x}px`}),g=window.setTimeout(p,240);return}i.style.height=`${x}px`,c=window.requestAnimationFrame(()=>{i.addEventListener("transitionend",f),i.style.height="0px"}),g=window.setTimeout(()=>r(!1),240)})(),()=>{window.cancelAnimationFrame(c),window.clearTimeout(g),i.removeEventListener("transitionend",f)}},[o,s]),!s&&!o?null:ie("div",{id:a,ref:l,"data-state":o?"open":"closed","aria-hidden":!o,className:Ee("ui-collapsible__content",t),...n,children:ie("div",{ref:u,className:"ui-collapsible__content-inner",children:e})})}var Cn=Object.assign(Ie,{Root:Ie,Trigger:Je,Content:Ye}),Sn=Cn;import{createContext as kn,useCallback as je,useContext as Hn,useRef as An,useState as _n}from"react";import{clsx as ae}from"clsx";import{useEffect as Nn,useRef as Qe,useCallback as Rn}from"react";import{jsx as le,jsxs as Dn}from"react/jsx-runtime";function Ln({className:e,children:t,...n}){return le("div",{className:ae("ui-dialog__header px-5 pt-5 pb-1 text-base font-semibold",e),...n,children:t})}function In({className:e,children:t,...n}){return le("div",{className:ae("ui-dialog__body px-5 py-3 text-sm",e),...n,children:t})}function En({className:e,children:t,...n}){return le("div",{className:ae("ui-dialog__footer flex items-center justify-end gap-2 px-5 pt-3 pb-5",e),...n,children:t})}function $({open:e,onClose:t,size:n="sm",children:o,className:a,overlayClassName:s,panelClassName:r,...l}){let u=Qe(null),i=Qe(null),d=Rn(c=>{c.key==="Escape"&&(c.stopPropagation(),t())},[t]);return Nn(()=>(e?(i.current=document.activeElement,document.body.style.overflow="hidden",requestAnimationFrame(()=>{let c=u.current;if(!c)return;let g=c.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');g?g.focus():c.focus()}),document.addEventListener("keydown",d)):(document.body.style.overflow="",i.current?.focus()),()=>{document.removeEventListener("keydown",d),document.body.style.overflow=""}),[e,d]),e?Dn("div",{"data-state":"open",className:"ui-dialog-overlay fixed inset-0 z-50 flex items-center justify-center",children:[le("button",{type:"button","aria-label":"Close dialog","data-state":"open",className:ae("ui-dialog-backdrop absolute inset-0 bg-black/30",s),onClick:t}),le("div",{ref:u,role:"dialog","aria-modal":"true",tabIndex:-1,"data-state":"open","data-size":n,className:ae("ui-dialog relative z-10 w-full rounded-xl shadow-xl","animate-[dialog-in_0.2s_var(--ease-standard)]",n==="sm"?"max-w-[26rem]":"max-w-[32rem]",r,a),...l,children:o})]}):null}$.Header=Ln;$.Body=In;$.Footer=En;import{Fragment as Vn,jsx as te,jsxs as De}from"react/jsx-runtime";var et=kn(null);function Bn(){let e=Hn(et);if(!e)throw new Error("useConfirm must be used within <ConfirmProvider>");return e}function On({children:e}){let[t,n]=_n(null),o=An(null),a=je(r=>(o.current&&o.current.resolve(!1),new Promise(l=>{let u={options:r,resolve:l};o.current=u,n(u)})),[]),s=je(r=>{o.current&&(o.current.resolve(r),o.current=null),n(null)},[]);return De(et.Provider,{value:a,children:[e,te($,{open:t!==null,onClose:()=>s(!1),children:t&&De(Vn,{children:[te($.Header,{children:t.options.title}),te($.Body,{children:typeof t.options.description=="string"?te("p",{className:"whitespace-pre-wrap",children:t.options.description}):t.options.description}),De($.Footer,{children:[te(se,{variant:"ghost",size:"sm",onClick:()=>s(!1),children:t.options.cancelLabel??"\u53D6\u6D88"}),te(se,{variant:t.options.variant??"primary",size:"sm",onClick:()=>s(!0),children:t.options.confirmLabel??"\u786E\u8BA4"})]})]})})]})}import{clsx as J}from"clsx";import{autoUpdate as Fn,computePosition as zn,flip as $n,offset as Kn,shift as Un}from"@floating-ui/dom";import{Children as Wn,cloneElement as qn,createContext as tt,isValidElement as Gn,useCallback as A,useContext as ke,useEffect as j,useId as ve,useLayoutEffect as Xn,useMemo as he,useRef as Z,useState as ue}from"react";import{createPortal as Zn}from"react-dom";import{jsx as _,jsxs as it}from"react/jsx-runtime";var nt=tt(null),He=tt(null);function Ae(e){let t=ke(nt);if(!t)throw new Error(`${e} must be used within DropdownMenu.`);return t}function ot(e){let t=ke(He);if(!t)throw new Error(`${e} must be used within DropdownMenu.Content.`);return t}function ne(e,t){return n=>{e?.(n),t(n)}}function rt(...e){return t=>{for(let n of e)n&&(typeof n=="function"?n(t):n.current=t)}}function xe(e){return typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(xe).join(" "):!e||typeof e=="boolean"?"":Gn(e)?xe(e.props.children):""}function Jn(e){return[...e].sort((t,n)=>{let o=t.ref.current,a=n.ref.current;if(!o||!a)return 0;let s=o.compareDocumentPosition(a);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Yn(e,t){return t==="center"?e:`${e}-${t}`}function Qn(e){let t=e.split("-");return{side:t[0],align:t[1]??"center"}}function st({open:e,defaultOpen:t=!1,onOpenChange:n,side:o="bottom",align:a="start",sideOffset:s=8,alignOffset:r=0,collisionPadding:l=8,portal:u=!0,contentRole:i="menu",children:d}){let c=ke(He),[g,p]=ue(t),f=e!==void 0,y=f?e:g,x=Z(null),b=Z(null),C=Z("selected"),h=ve(),R=ve(),T=A(P=>{f||p(P),n?.(P)},[f,n]),L=A(()=>{T(!1)},[T]),S=A(()=>{T(!1),c?.closeTree()},[c,T]),I=A(()=>{T(!y)},[y,T]),H=A(()=>{x.current?.focus()},[]),m=he(()=>({open:y,setOpen:T,toggleOpen:I,triggerRef:x,contentRef:b,side:o,align:a,sideOffset:s,alignOffset:r,collisionPadding:l,portal:u,contentRole:i,triggerId:h,contentId:R,focusIntentRef:C,parentList:c,isSubmenu:!!c,closeSelf:L,closeTree:S,focusTrigger:H}),[y,a,r,L,S,l,i,c,u,T,o,s,I,h,R,H]);return _(nt.Provider,{value:m,children:d})}function jn({asChild:e=!1,disabled:t=!1,className:n,children:o}){let{open:a,setOpen:s,toggleOpen:r,triggerRef:l,contentRole:u,triggerId:i,contentId:d,focusIntentRef:c,isSubmenu:g}=Ae("DropdownMenu.Trigger"),p=Wn.only(o),f=p.props??{},y=typeof f.className=="string"?f.className:void 0,x={id:i,"data-state":a?"open":"closed","aria-expanded":a,"aria-haspopup":u,"aria-controls":a?d:void 0,onClick:ne(f.onClick,b=>{if(t){b.preventDefault();return}c.current="selected",r()}),onKeyDown:ne(f.onKeyDown,b=>{t||(b.key==="ArrowDown"?(b.preventDefault(),c.current="first",s(!0)):b.key==="ArrowUp"?(b.preventDefault(),c.current="last",s(!0)):!g&&(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),c.current="selected",r()))})};return e?qn(p,{...x,ref:rt(l,f.ref),className:J(n,y),type:p.type==="button"?f.type??"button":f.type}):_("button",{ref:l,disabled:t,type:"button",className:J("ui-dropdown-menu__trigger",n),...x,children:p})}function eo({className:e,children:t,style:n,matchTriggerWidth:o=!1,maxHeight:a=320,...s}){let{open:r,setOpen:l,triggerRef:u,contentRef:i,side:d,align:c,sideOffset:g,alignOffset:p,collisionPadding:f,portal:y,contentRole:x,triggerId:b,contentId:C,focusIntentRef:h,parentList:R,isSubmenu:T,closeSelf:L,closeTree:S,focusTrigger:I}=Ae("DropdownMenu.Content"),H=Z([]),[m,P]=ue(null),[B,W]=ue(null),[O,q]=ue(null),[V,Ve]=ue(!1),re=Z(""),G=Z(null),ge=A(v=>(H.current=[...H.current.filter(N=>N.id!==v.id),v],()=>{H.current=H.current.filter(N=>N.id!==v.id)}),[]),k=A(()=>Jn(H.current),[]),Fe=A(v=>{h.current=v},[h]);j(()=>{Ve(!0)},[]);let Zt=he(()=>({role:x,highlightedId:m,setHighlightedId:P,registerItem:ge,getItems:k,requestFocusIntent:Fe,closeTree:S,closeSelf:L,focusTrigger:I,activeSubmenuId:B,setActiveSubmenuId:W,contentRef:i}),[B,L,S,i,x,I,k,m,ge,Fe]);Xn(()=>!r||!V||!u.current||!i.current?void 0:Fn(u.current,i.current,()=>{!u.current||!i.current||zn(u.current,i.current,{placement:Yn(d,c),strategy:"fixed",middleware:[Kn({mainAxis:g,crossAxis:p}),$n({padding:f}),Un({padding:f})]}).then(({x:N,y:w,placement:E})=>{let F=Qn(E);q({top:w,left:N,side:F.side,align:F.align})})}),[c,p,f,i,V,r,d,g,u]),j(()=>{if(!r){P(null),W(null);return}let v=k().filter(w=>!w.disabled);if(v.length===0)return;let N=v[0];h.current==="last"?N=v[v.length-1]:h.current==="selected"&&(N=v.find(w=>w.selected)??v[0]),P(N.id),requestAnimationFrame(()=>{i.current?.focus(),N.ref.current?.scrollIntoView({block:"nearest"})})},[i,h,k,r]),j(()=>{if(!r)return;function v(N){let w=N.target,E=u.current?.contains(w),F=i.current?.contains(w);if(!E&&!F){let z=R?.contentRef.current?.contains(w);if(T&&z){L(),R?.setActiveSubmenuId(null);return}S()}}return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[L,S,i,T,r,R,u]),j(()=>{if(r)return()=>{G.current&&clearTimeout(G.current)}},[r]);let X=A(v=>{if(P(v),!v){W(null);return}k().find(w=>w.id===v)?.submenu||W(null)},[k]),Re=A((v,N="first")=>{let w=k().filter(K=>!K.disabled);if(w.length===0)return;let E=w.findIndex(K=>K.id===m);if(E===-1){X(N==="last"?w[w.length-1].id:w[0].id);return}let F=(E+v+w.length)%w.length,z=w[F];X(z.id),z.ref.current?.scrollIntoView({block:"nearest"})},[k,m,X]),ze=A(v=>{let N=v.length===1?v.toLowerCase():"";if(!N)return;G.current&&clearTimeout(G.current),re.current+=N,G.current=setTimeout(()=>{re.current="",G.current=null},350);let w=k().filter(K=>!K.disabled);if(w.length===0)return;let E=w.findIndex(K=>K.id===m),z=(E>=0?[...w.slice(E+1),...w.slice(0,E+1)]:w).find(K=>K.textValue.toLowerCase().startsWith(re.current));z&&(X(z.id),z.ref.current?.scrollIntoView({block:"nearest"}))},[k,m,X]),Jt=A(v=>{let N=k(),w=N.find(E=>E.id===m)??null;switch(v.key){case"ArrowDown":v.preventDefault(),Re(1);break;case"ArrowUp":v.preventDefault(),Re(-1,"last");break;case"Home":v.preventDefault();{let E=N.find(F=>!F.disabled);E&&X(E.id)}break;case"End":v.preventDefault();{let E=N.filter(z=>!z.disabled),F=E[E.length-1];F&&X(F.id)}break;case"Enter":case" ":w&&!w.disabled&&(v.preventDefault(),w.click());break;case"ArrowRight":w?.submenu&&(v.preventDefault(),w.openSubmenu?.());break;case"ArrowLeft":T&&(v.preventDefault(),L(),I(),R?.setActiveSubmenuId(null));break;case"Tab":S();break;case"Escape":v.preventDefault(),L(),I(),T&&R?.setActiveSubmenuId(null);break;default:ze(v.key)}},[L,S,I,k,ze,m,X,T,Re,R]);if(!r||!V)return null;let $e=_(He.Provider,{value:Zt,children:_("div",{ref:i,id:C,role:x,tabIndex:-1,"aria-labelledby":x==="menu"?b:void 0,"data-state":"open","data-side":O?.side??d,"data-align":O?.align??c,className:J("ui-dropdown-menu__content",T&&"ui-dropdown-menu__content--submenu",e),style:{...n,position:"fixed",top:O?.top??0,left:O?.left??0,maxHeight:a,minWidth:o?u.current?.getBoundingClientRect().width:void 0},onKeyDown:Jt,...s,children:t})});return y?Zn($e,document.body):$e}function to({className:e,children:t,...n}){return _("div",{className:J("ui-dropdown-menu__group",e),...n,children:t})}function no({className:e,children:t,...n}){return _("div",{className:J("ui-dropdown-menu__label",e),...n,children:t})}function oo({className:e,...t}){return _("div",{role:"separator",className:J("ui-dropdown-menu__separator",e),...t})}function ro({className:e,children:t,inset:n=!1,disabled:o=!1,selected:a=!1,destructive:s=!1,closeOnSelect:r=!0,shortcut:l,indicator:u,onSelect:i,onMouseEnter:d,onClick:c,...g}){let p=ve(),f=Z(null),{role:y,highlightedId:x,setHighlightedId:b,registerItem:C,closeTree:h,setActiveSubmenuId:R}=ot("DropdownMenu.Item"),T=he(()=>xe(t),[t]),L=x===p,S=A(()=>{o||(i?.(),r&&h())},[r,h,o,i]);return j(()=>C({id:p,ref:f,disabled:o,submenu:!1,selected:a,textValue:T,closeOnSelect:r,click:S}),[r,o,S,p,C,a,T]),it("button",{ref:f,id:p,type:"button",role:y==="listbox"?"option":"menuitem",tabIndex:-1,disabled:o,"aria-selected":y==="listbox"?a:void 0,"data-highlighted":L||void 0,"data-selected":a||void 0,"data-disabled":o||void 0,"data-destructive":s||void 0,className:J("ui-dropdown-menu__item",n&&"ui-dropdown-menu__item--inset",e),onMouseEnter:ne(d,()=>{o||(b(p),R(null))}),onClick:ne(c,I=>{I.preventDefault(),S()}),...g,children:[_("span",{className:"ui-dropdown-menu__item-main",children:t}),l?_("span",{className:"ui-dropdown-menu__shortcut",children:l}):null,a?_("span",{className:"ui-dropdown-menu__indicator",children:u??"\u2713"}):null]})}function so(e){return _(st,{side:"right",align:"start",sideOffset:6,...e,contentRole:"menu"})}function io({className:e,children:t,inset:n=!1,disabled:o=!1,destructive:a=!1,shortcut:s,onSelect:r,onMouseEnter:l,onClick:u,...i}){let d=ve(),c=Z(null),g=Ae("DropdownMenu.SubTrigger"),{highlightedId:p,setHighlightedId:f,registerItem:y,setActiveSubmenuId:x,activeSubmenuId:b}=ot("DropdownMenu.SubTrigger"),C=he(()=>xe(t),[t]),h=p===d,R=g.open&&b===d,T=A(()=>{o||(g.focusIntentRef.current="first",f(d),x(d),g.setOpen(!0))},[o,d,x,f,g]);return j(()=>y({id:d,ref:c,disabled:o,submenu:!0,selected:!1,textValue:C,closeOnSelect:!1,click:T,openSubmenu:T}),[o,d,T,y,C]),j(()=>{b!==d&&g.open&&g.setOpen(!1)},[b,d,g]),it("button",{ref:rt(c,g.triggerRef),id:g.triggerId,type:"button",role:"menuitem",tabIndex:-1,"aria-haspopup":"menu","aria-expanded":g.open,"aria-controls":g.open?g.contentId:void 0,"data-highlighted":h||void 0,"data-state":R?"open":"closed","data-disabled":o||void 0,"data-destructive":a||void 0,className:J("ui-dropdown-menu__item ui-dropdown-menu__sub-trigger",n&&"ui-dropdown-menu__item--inset",e),onMouseEnter:ne(l,()=>{T()}),onClick:ne(u,L=>{L.preventDefault(),T(),r?.()}),...i,children:[_("span",{className:"ui-dropdown-menu__item-main",children:t}),s?_("span",{className:"ui-dropdown-menu__shortcut",children:s}):null,_("span",{className:"ui-dropdown-menu__submenu-indicator","aria-hidden":"true",children:"\u203A"})]})}var ao=Object.assign(st,{Trigger:jn,Content:eo,Group:to,Label:no,Item:ro,Separator:oo,Submenu:so,SubTrigger:io}),lo=ao;import{clsx as at}from"clsx";import{Fragment as uo,jsx as lt,jsxs as co}from"react/jsx-runtime";function ut({as:e="aside",open:t,children:n,side:o="right",position:a="fixed",showBackdrop:s=!0,onClose:r,closeLabel:l="\u5173\u95ED\u62BD\u5C49",backdropClassName:u,className:i,...d}){let c=o==="left"?"-translate-x-full":"translate-x-full",g=o==="left"?"left-0 top-0":"right-0 top-0",p=a==="fixed"?"fixed":"absolute";return co(uo,{children:[s&&t&&r&<("button",{type:"button","aria-label":l,"data-state":"open",className:at("ui-drawer-backdrop inset-0 z-10",p,u),onClick:r}),lt(e,{"aria-hidden":!t,"data-state":t?"open":"closed","data-side":o,className:at("ui-drawer",p,g,"z-20 flex max-w-full transform flex-col transition-transform duration-200 ease-in-out",t?"pointer-events-auto visible translate-x-0":`pointer-events-none invisible ${c}`,i),...d,children:n})]})}import{clsx as po}from"clsx";import{jsx as ct,jsxs as fo}from"react/jsx-runtime";function dt({label:e,help:t,htmlFor:n,children:o,className:a,...s}){return fo("div",{className:po("ui-field block",a),...s,children:[ct("label",{htmlFor:n,className:"ui-field__label mb-1 block text-xs",children:e}),o,t?ct("span",{className:"ui-field__help mt-1 block text-xs",children:t}):null]})}import{clsx as mo}from"clsx";import{jsx as pt}from"react/jsx-runtime";function ft({variant:e="ghost",size:t="md",label:n,icon:o,className:a,...s}){let r=mo("ui-icon-button","inline-flex items-center justify-center rounded-md transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-inset disabled:cursor-not-allowed disabled:opacity-50",t==="sm"?"h-7 w-7":"h-8 w-8",a);if("href"in s&&s.href){let{href:u,...i}=s;return pt("a",{href:u,"aria-label":n,title:i.title??n,"data-variant":e,"data-size":t,className:r,...i,children:o})}let l=s;return pt("button",{type:l.type??"button","aria-label":n,title:l.title??n,"data-variant":e,"data-size":t,className:r,...l,children:o})}import{clsx as go}from"clsx";import{jsx as mt}from"react/jsx-runtime";function Te(e){return go("ui-input w-full rounded-lg px-3 py-2 text-sm placeholder:text-[var(--field-placeholder)] focus:outline-none focus:ring-1",e)}function gt(e){let{className:t,tone:n="default",...o}=e;return e.as==="textarea"?mt("textarea",{"data-tone":n,className:Te(t),...o}):mt("input",{"data-tone":n,className:Te(t),...o})}import{clsx as ye}from"clsx";import{jsx as we}from"react/jsx-runtime";function bo(e){switch(e){case"none":return"";case"sm":return"p-4";case"lg":return"p-6";default:return"p-5"}}function bt({as:e="section",variant:t="default",padding:n="none",className:o,children:a,...s}){return we(e,{"data-variant":t,className:ye("ui-panel rounded-lg border",bo(n),o),...s,children:a})}function vo({className:e,children:t,...n}){return we("div",{className:ye("ui-panel-header border-b px-6 py-5",e),...n,children:t})}function xo({className:e,children:t,...n}){return we("div",{className:ye("px-6 py-5",e),...n,children:t})}function ho({className:e,children:t,...n}){return we("div",{className:ye("ui-panel-footer border-t px-6 py-4",e),...n,children:t})}import{clsx as vt}from"clsx";import{jsx as xt}from"react/jsx-runtime";function ht({value:e,onChange:t,options:n,size:o="sm",className:a,ariaLabel:s}){return xt("div",{role:"tablist","aria-label":s,className:vt("ui-segmented-control inline-flex rounded-md p-0.5 ring-1",o==="sm"?"text-xs":"text-sm",a),children:n.map(r=>{let l=r.value===e;return xt("button",{type:"button",role:"tab","aria-selected":l,disabled:r.disabled,"data-active":l?"true":void 0,className:vt("ui-segmented-control__item rounded font-medium transition-colors focus:outline-none focus-visible:ring-1 focus-visible:ring-inset disabled:cursor-not-allowed disabled:opacity-50",o==="sm"?"px-2.5 py-1":"px-3 py-1.5"),onClick:()=>t(r.value),children:r.label},r.value)})})}import{clsx as oe}from"clsx";import{useCallback as _e,useEffect as Tt,useId as To,useMemo as yo,useRef as yt,useState as wt}from"react";import{jsx as ce,jsxs as Mt}from"react/jsx-runtime";function Pt({value:e,onChange:t,options:n,placeholder:o="Select\u2026",size:a="md",tone:s="default",disabled:r=!1,className:l,ariaLabel:u,renderValue:i,renderOption:d}){let[c,g]=wt(!1),[p,f]=wt(-1),y=yt(null),x=yt(null),b=To(),C=n.find(m=>m.value===e),h=yo(()=>n.reduce((m,P,B)=>(P.disabled||m.push(B),m),[]),[n]),R=_e(()=>{if(r||n.length===0)return;g(!0);let m=n.findIndex(P=>P.value===e);f(m>=0?m:h[0]??-1)},[r,n,e,h]),T=_e(()=>{g(!1),f(-1)},[]),L=_e(m=>{m.disabled||(t(m.value),T())},[t,T]);Tt(()=>{if(!c)return;function m(P){y.current&&!y.current.contains(P.target)&&T()}return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[c,T]),Tt(()=>{if(!c||p<0)return;x.current?.children[p]?.scrollIntoView({block:"nearest"})},[c,p]);function S(m){if(!r)switch(m.key){case"Enter":case" ":{m.preventDefault(),c?p>=0&&n[p]&&!n[p].disabled&&L(n[p]):R();break}case"ArrowDown":{if(m.preventDefault(),!c)R();else{let P=h.indexOf(p),B=h[P+1];B!==void 0&&f(B)}break}case"ArrowUp":{if(m.preventDefault(),!c)R();else{let P=h.indexOf(p),B=h[P-1];B!==void 0&&f(B)}break}case"Escape":{c&&(m.preventDefault(),T());break}case"Tab":{c&&T();break}}}let I=e!==""&&C,H=i?i({open:c,placeholder:o,selectedOption:C}):ce("span",{className:oe("truncate",!I&&"ui-select__placeholder"),children:I?C.label:o});return Mt("div",{ref:y,"data-state":c?"open":"closed","data-disabled":r||void 0,"data-size":a,"data-tone":s,className:oe("ui-select relative inline-block",l),children:[Mt("button",{type:"button",role:"combobox","aria-expanded":c,"aria-haspopup":"listbox","aria-controls":b,"aria-label":u,"aria-activedescendant":c&&p>=0?`${b}-opt-${p}`:void 0,"data-state":c?"open":"closed","data-disabled":r||void 0,"data-tone":s,"data-size":a,"data-open":c||void 0,"data-has-value":I||void 0,disabled:r,className:oe("ui-select__trigger flex w-full items-center justify-between gap-2 rounded-lg text-left transition-colors focus:outline-none",a==="sm"?"min-h-7 px-2 py-1 text-xs":"min-h-9 px-3 py-2 text-sm"),onClick:()=>c?T():R(),onKeyDown:S,children:[H,ce("svg",{"aria-hidden":"true",className:oe("ui-select__chevron h-3.5 w-3.5 shrink-0 transition-transform",c&&"rotate-180"),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:ce("path",{d:"M4 6l4 4 4-4"})})]}),c&&ce("ul",{ref:x,id:b,role:"listbox","aria-label":u,"data-state":"open",className:oe("ui-select__dropdown absolute z-50 mt-1 max-h-60 w-full overflow-auto rounded-lg py-1 ring-1",a==="sm"?"text-xs":"text-sm"),children:n.map((m,P)=>ce("li",{id:`${b}-opt-${P}`,role:"option","aria-selected":m.value===e,"aria-disabled":m.disabled||void 0,"data-state":m.value===e?"selected":P===p?"highlighted":"idle","data-focused":P===p||void 0,"data-selected":m.value===e||void 0,"data-disabled":m.disabled||void 0,"data-highlighted":P===p||void 0,className:oe("ui-select__option cursor-default select-none px-3 py-1.5 transition-colors",m.disabled&&"cursor-not-allowed opacity-50"),onClick:()=>L(m),onMouseEnter:()=>!m.disabled&&f(P),children:d?d({option:m,index:P,selected:m.value===e,highlighted:P===p}):m.label},m.value))})]})}import{clsx as wo}from"clsx";import{jsx as Po}from"react/jsx-runtime";var Mo={slow:"4s",default:"3s",fast:"2s"};function Ct({className:e,animation:t="scan",tone:n="default",speed:o="default",style:a,...s}){let r=n==="warm"?"emphasis":n,l={...a,"--ui-skeleton-scan-duration":Mo[o]};return Po("div",{className:wo("ui-skeleton rounded",e),"data-animation":t,"data-tone":r,"aria-hidden":"true",style:l,...s})}import{clsx as St}from"clsx";import{Fragment as Nt,jsx as U,jsxs as Me}from"react/jsx-runtime";function Rt({tone:e="neutral",layout:t="horizontal",icon:n,title:o,description:a,action:s,className:r,children:l,...u}){if(t==="vertical"){let i=n||o||a||s;return U("div",{"data-tone":e,"data-layout":"vertical",className:St("ui-status-notice rounded-lg border px-4 py-3 text-sm",r),...u,children:i?Me("div",{className:"flex flex-col items-center gap-2 py-4 text-center",children:[n&&U("div",{className:"ui-status-notice__icon text-lg",children:n}),o&&U("div",{className:"ui-status-notice__title font-medium",children:o}),a&&U("div",{className:"ui-status-notice__description",children:a}),s&&U("div",{className:"mt-2",children:s})]}):l})}return U("div",{"data-tone":e,className:St("ui-status-notice rounded-md border px-4 py-3 text-sm",n&&"ui-status-notice--with-icon grid grid-cols-[auto_minmax(0,1fr)] gap-3",r),...u,children:n?Me(Nt,{children:[U("span",{className:"ui-status-notice__icon mt-0.5 shrink-0","aria-hidden":"true",children:n}),Me("div",{className:"min-w-0",children:[o&&U("div",{className:"ui-status-notice__title font-medium",children:o}),l]})]}):Me(Nt,{children:[o&&U("div",{className:"ui-status-notice__title font-medium",children:o}),l]})})}import{clsx as Lt}from"clsx";import{jsx as It}from"react/jsx-runtime";var Co={sm:"h-5 w-9",md:"h-6 w-11"},So={sm:"h-3.5 w-3.5",md:"h-4.5 w-4.5"},No={sm:"translate-x-4",md:"translate-x-5"};function Et({checked:e,onChange:t,size:n="md",disabled:o=!1,className:a,ariaLabel:s}){return It("button",{type:"button",role:"switch","aria-checked":e,"aria-label":s,disabled:o,"data-size":n,className:Lt("ui-switch relative inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",Co[n],o&&"cursor-not-allowed opacity-50",a),onClick:()=>t(!e),children:It("span",{"aria-hidden":"true",className:Lt("ui-switch__thumb pointer-events-none inline-block rounded-full bg-white shadow transition-transform",So[n],e?No[n]:"translate-x-0.5")})})}import{clsx as Ce}from"clsx";import{createContext as Ro,useContext as Lo,useId as Io,useMemo as Eo,useState as Do}from"react";import{jsx as de}from"react/jsx-runtime";var Dt=Ro(null);function kt(e){let t=Lo(Dt);if(!t)throw new Error(`${e} must be used within Tabs.Root`);return t}function Pe(e){return e.replace(/[^a-zA-Z0-9_-]+/g,"-")}function ko({value:e,defaultValue:t,onValueChange:n}){let[o,a]=Do(t??""),s=e!==void 0,r=s?e:o;function l(u){s||a(u),n?.(u)}return[r,l]}function Be({children:e,value:t,defaultValue:n,onValueChange:o,className:a,...s}){let[r,l]=ko({value:t,defaultValue:n,onValueChange:o}),u=Io(),i=Eo(()=>({value:r,setValue:l,baseId:u}),[u,r,l]);return de(Dt.Provider,{value:i,children:de("div",{className:Ce("ui-tabs",a),...s,children:e})})}function Ht({children:e,className:t,ariaLabel:n,...o}){return de("div",{role:"tablist","aria-label":n,className:Ce("ui-tabs__list flex items-end gap-1 border-b",t),...o,children:e})}function At({children:e,className:t,value:n,disabled:o,onClick:a,onKeyDown:s,...r}){let{value:l,setValue:u,baseId:i}=kt("Tabs.Trigger"),d=l===n,c=`${i}-trigger-${Pe(n)}`,g=`${i}-panel-${Pe(n)}`;function p(f,y){let x=f.closest('[role="tablist"]');if(!x)return;let b=Array.from(x.querySelectorAll('[role="tab"]:not([disabled])')),C=b.indexOf(f);if(C<0)return;let h;y==="first"&&(h=b[0]),y==="last"&&(h=b[b.length-1]),y==="next"&&(h=b[(C+1)%b.length]),y==="prev"&&(h=b[(C-1+b.length)%b.length]),h&&(h.focus(),h.click())}return de("button",{type:"button",id:c,role:"tab","aria-selected":d,"aria-controls":g,tabIndex:d?0:-1,"data-state":d?"active":"inactive",disabled:o,className:Ce("ui-tabs__trigger relative -mb-px inline-flex min-h-9 items-center justify-center rounded-t-md border-b-2 px-3 py-2 text-sm font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-inset disabled:cursor-not-allowed disabled:opacity-50",t),onClick:f=>{a?.(f),!f.defaultPrevented&&!o&&u(n)},onKeyDown:f=>{if(s?.(f),f.defaultPrevented||o)return;let y=f.currentTarget;switch(f.key){case"ArrowRight":f.preventDefault(),p(y,"next");break;case"ArrowLeft":f.preventDefault(),p(y,"prev");break;case"Home":f.preventDefault(),p(y,"first");break;case"End":f.preventDefault(),p(y,"last");break}},...r,children:e})}function _t({children:e,className:t,value:n,...o}){let{value:a,baseId:s}=kt("Tabs.Content"),r=a===n,l=`${s}-trigger-${Pe(n)}`,u=`${s}-panel-${Pe(n)}`;return r?de("div",{id:u,role:"tabpanel","aria-labelledby":l,"data-state":"active",className:Ce("ui-tabs__content pt-4",t),...o,children:e}):null}var Ho=Object.assign(Be,{Root:Be,List:Ht,Trigger:At,Content:_t}),Ao=Ho;import{useCallback as _o,useEffect as Bo,useRef as Oo}from"react";import{jsx as Vo}from"react/jsx-runtime";function Bt({className:e,tone:t="default",resize:n="vertical",autoResize:o=!1,style:a,onInput:s,rows:r=3,...l}){let u=Oo(null),i=s,d=_o(()=>{if(!o||!u.current)return;let p=u.current;p.style.height="auto",p.style.height=`${p.scrollHeight}px`},[o]);Bo(()=>{d()},[d,l.value,l.defaultValue,r]);function c(p){d(),i?.(p)}let g={...a,resize:o?"none":n};return Vo("textarea",{...l,ref:u,rows:r,"data-tone":t,"data-auto-resize":o||void 0,className:Te(`ui-textarea ${e??""}`),style:g,onInput:c})}import{clsx as Ot}from"clsx";import{createContext as Fo,useCallback as Vt,useContext as zo,useMemo as $o,useRef as Ft,useState as Ko}from"react";import{jsx as D,jsxs as pe}from"react/jsx-runtime";var $t=Fo(null),Oe=5,zt=4e3;function Uo(){let e=zo($t);if(!e)throw new Error("useToast must be used within <ToastProvider>");return e}function Wo({tone:e}){let t={width:16,height:16,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};switch(e){case"success":return D("svg",{...t,children:D("path",{d:"M3.5 8.5l3 3 6-7"})});case"warning":return pe("svg",{...t,children:[D("path",{d:"M8 5v4"}),D("circle",{cx:"8",cy:"11.5",r:"0.5",fill:"currentColor",stroke:"none"})]});case"danger":return D("svg",{...t,children:D("path",{d:"M4.5 4.5l7 7M11.5 4.5l-7 7"})});case"info":return pe("svg",{...t,children:[D("circle",{cx:"8",cy:"3.5",r:"1.2",fill:"currentColor",stroke:"none"}),D("path",{d:"M8 7v5.5"})]})}}function qo(e,t){return typeof e=="string"?{message:e,duration:t??zt}:{title:e.title,message:e.message,duration:e.duration??t??zt}}function Go({item:e,onDismiss:t,renderToast:n}){let o=()=>t(e.id),a=D(Wo,{tone:e.tone});return n?D("div",{role:"status","aria-live":"polite","data-state":"open","data-tone":e.tone,className:Ot("ui-toast pointer-events-auto rounded-lg border text-sm backdrop-blur-sm","animate-[toast-in_0.25s_var(--ease-standard)]"),children:n({item:e,dismiss:o,icon:a})}):pe("div",{role:"status","aria-live":"polite","data-state":"open","data-tone":e.tone,className:Ot("ui-toast pointer-events-auto flex items-start gap-2 rounded-lg border px-4 py-3 text-sm backdrop-blur-sm","animate-[toast-in_0.25s_var(--ease-standard)]"),children:[D("span",{className:"ui-toast__icon mt-0.5 shrink-0","aria-hidden":"true",children:a}),pe("span",{className:"min-w-0 flex-1",children:[e.title?D("span",{className:"ui-toast__title block font-medium",children:e.title}):null,D("span",{className:"block",children:e.message})]}),D("button",{type:"button",onClick:o,className:"ui-toast__close -mr-1 -mt-0.5 shrink-0 rounded p-0.5 text-current opacity-50 transition-opacity hover:opacity-100","aria-label":"Dismiss",children:D("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:D("path",{d:"M4 4l8 8M12 4l-8 8"})})})]})}function Xo({children:e,renderToast:t}){let[n,o]=Ko([]),a=Ft(0),s=Ft(new Map),r=Vt(i=>{let d=s.current.get(i);d&&clearTimeout(d),s.current.delete(i),o(c=>c.filter(g=>g.id!==i))},[]),l=Vt((i,d,c)=>{let g=a.current++,p=qo(d,c),f={id:g,tone:i,...p};o(y=>{let x=[...y,f];if(x.length>Oe){let b=x.slice(0,x.length-Oe);for(let C of b){let h=s.current.get(C.id);h&&clearTimeout(h),s.current.delete(C.id)}return x.slice(-Oe)}return x}),f.duration>0&&s.current.set(g,setTimeout(()=>r(g),f.duration))},[r]),u=$o(()=>({success:(i,d)=>l("success",i,d),warning:(i,d)=>l("warning",i,d),danger:(i,d)=>l("danger",i,d),info:(i,d)=>l("info",i,d)}),[l]);return pe($t.Provider,{value:u,children:[e,D("div",{"aria-label":"Notifications","data-state":n.length>0?"open":"closed",className:"pointer-events-none fixed bottom-4 right-4 z-[9999] flex flex-col-reverse gap-2",children:n.map(i=>D(Go,{item:i,onDismiss:r,renderToast:t},i.id))})]})}import{clsx as Zo}from"clsx";import{autoUpdate as Jo,computePosition as Yo,flip as Qo,offset as jo,shift as er,arrow as tr}from"@floating-ui/dom";import{useCallback as ee,useEffect as Kt,useId as nr,useLayoutEffect as or,useRef as fe,useState as Se}from"react";import{createPortal as rr}from"react-dom";import{Fragment as ar,jsx as Ne,jsxs as Gt}from"react/jsx-runtime";var me=6,Ut=8,Wt=4,sr={compact:"px-2 py-1 text-[11px] max-w-[200px]",default:"px-3 py-2 text-xs max-w-xs"};function ir(e){return e.split("-")[0]}var qt={top:"",bottom:"rotate(180deg)",left:"rotate(-90deg)",right:"rotate(90deg)"};function Xt({content:e,placement:t="top",density:n="default",showDelay:o=300,hideDelay:a=150,arrow:s=!0,renderArrow:r,className:l,children:u}){let[i,d]=Se(!1),[c,g]=Se(null),[p,f]=Se(t),[y,x]=Se({}),b=fe(null),C=fe(null),h=fe(null),R=fe(void 0),T=fe(void 0),L=nr(),S=ee(()=>{clearTimeout(R.current),clearTimeout(T.current)},[]),I=ee(()=>{S(),R.current=setTimeout(()=>d(!0),o)},[S,o]),H=ee(()=>{S(),d(!0)},[S]),m=ee(()=>{S(),T.current=setTimeout(()=>d(!1),a)},[S,a]),P=ee(V=>{if(V.target===b.current){I();return}H()},[I,H]),B=ee(V=>{V.pointerType!=="mouse"&&H()},[H]),W=ee(V=>{V.key==="Escape"&&i&&d(!1)},[i]);or(()=>{if(!i||!b.current||!C.current)return;let V=[jo(s?Ut+me:Ut),Qo({padding:Wt}),er({padding:Wt})];return s&&h.current&&V.push(tr({element:h.current})),Jo(b.current,C.current,()=>{!b.current||!C.current||Yo(b.current,C.current,{placement:t,strategy:"fixed",middleware:V}).then(({x:re,y:G,placement:ge,middlewareData:k})=>{g({top:G,left:re}),f(ir(ge)),k.arrow&&x({x:k.arrow.x,y:k.arrow.y})})})},[i,t,s]),Kt(()=>{if(i)return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[i,W]),Kt(()=>S,[S]);let O={position:"absolute"},q=p;return q==="top"||q==="bottom"?(O.left=y.x??0,O[q==="top"?"bottom":"top"]=-me,O.transform=qt[q]||void 0):(O.top=y.y??0,O[q==="left"?"right":"left"]=-me,O.transform=qt[q]),Gt(ar,{children:[Ne("span",{ref:b,"data-state":i?"open":"closed",className:"ui-tooltip-trigger inline-flex",onMouseEnter:I,onMouseLeave:m,onFocus:P,onBlur:m,onPointerDown:B,"aria-describedby":i?L:void 0,children:u}),i&&rr(Gt("div",{ref:C,id:L,role:"tooltip","data-state":i?"open":"closed","data-placement":p,"data-density":n,className:Zo("ui-tooltip fixed z-[9999] rounded-lg leading-relaxed",sr[n],"animate-[tooltip-in_0.15s_var(--ease-standard)]",l),style:c?{top:c.top,left:c.left}:{visibility:"hidden"},onMouseEnter:I,onMouseLeave:m,children:[e,s&&Ne("span",{ref:h,className:"ui-tooltip__arrow absolute",style:O,children:r?r({placement:p}):Ne("svg",{width:me*2,height:me,viewBox:"0 0 12 6",children:Ne("path",{d:"M0 0l6 6 6-6z",fill:"currentColor"})})})]}),document.body)]})}export{Ke as Avatar,Ue as Badge,se as Button,Sn as Collapsible,Ye as CollapsibleContent,Ie as CollapsibleRoot,Je as CollapsibleTrigger,On as ConfirmProvider,$ as Dialog,ut as Drawer,lo as DropdownMenu,dt as Field,ft as IconButton,gt as Input,bt as Panel,xo as PanelBody,ho as PanelFooter,vo as PanelHeader,ht as SegmentedControl,Pt as Select,Ct as Skeleton,be as Spinner,Rt as StatusNotice,Et as Switch,Ao as Tabs,_t as TabsContent,Ht as TabsList,Be as TabsRoot,At as TabsTrigger,Bt as Textarea,Xo as ToastProvider,Xt as Tooltip,We as buttonClassName,Bn as useConfirm,Uo as useToast};
|
|
1
|
+
import{clsx as Yt}from"clsx";import{useState as Qt}from"react";import{jsx as Le}from"react/jsx-runtime";var jt={xs:"h-6 w-6 text-[10px]",sm:"h-8 w-8 text-xs",md:"h-10 w-10 text-sm",lg:"h-14 w-14 text-lg"};function en(e){let t=e.trim().split(/\s+/);return t.length>=2?(t[0][0]+t[t.length-1][0]).toUpperCase():e.slice(0,2).toUpperCase()}function Ke({src:e,alt:t,name:n,size:o="md",tone:i="neutral",className:a}){let[r,l]=Qt(!1),u=e&&!r,s=n?en(n):"?";return Le("span",{"data-tone":i,className:Yt("owo-avatar inline-flex shrink-0 items-center justify-center overflow-hidden rounded-[var(--owo-cmp-control-radius-full)] font-medium select-none",jt[o],a),children:u?Le("img",{src:e,alt:t??n??"",className:"h-full w-full object-cover",onError:()=>l(!0)}):Le("span",{"aria-label":t??n,children:s})})}import{clsx as tn}from"clsx";import{jsx as nn}from"react/jsx-runtime";function Ue({tone:e="neutral",variant:t="soft",size:n="xs",className:o,children:i,...a}){return nn("span",{"data-tone":e,"data-variant":t,"data-size":n,className:tn("owo-badge inline-flex items-center rounded-[var(--owo-cmp-control-radius-full)] border text-[var(--badge-text)]",n==="xs"?"px-2.5 py-1 text-[11px]":"px-3 py-1 text-xs font-medium",o),...a,children:i})}import{clsx as bn}from"clsx";import{clsx as on}from"clsx";import{jsx as M,jsxs as Y}from"react/jsx-runtime";var rn={xs:12,sm:14,md:16,lg:24};function an({px:e}){let n=Math.PI*2*9;return Y("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[M("circle",{cx:"12",cy:"12",r:9,stroke:"currentColor",strokeWidth:"3",opacity:"0.2"}),M("circle",{cx:"12",cy:"12",r:9,stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:`${n*.28} ${n*.72}`})]})}function sn({px:e}){return Y("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[M("path",{d:"M12 2a10 10 0 0 1 10 10",opacity:"0.9"}),M("path",{d:"M12 2a10 10 0 0 0-7.07 2.93",opacity:"0.2"}),M("path",{d:"M4.93 4.93A10 10 0 0 0 2 12",opacity:"0.2"}),M("path",{d:"M2 12a10 10 0 0 0 2.93 7.07",opacity:"0.2"}),M("path",{d:"M4.93 19.07A10 10 0 0 0 12 22",opacity:"0.2"}),M("path",{d:"M12 22a10 10 0 0 0 7.07-2.93",opacity:"0.2"}),M("path",{d:"M19.07 19.07A10 10 0 0 0 22 12",opacity:"0.2"})]})}function ln({px:e}){return M("svg",{width:e,height:e,viewBox:"0 0 24 24",children:[0,1,2,3,4,5,6,7].map(n=>{let o=n/8*360,i=.15+n/8*.85;return M("circle",{cx:"12",cy:"3.5",r:"1.8",fill:"currentColor",opacity:i,transform:`rotate(${o} 12 12)`},n)})})}function un({px:e}){return M("svg",{width:e,height:e,viewBox:"0 0 24 24",children:[0,1,2,3].map(t=>Y("rect",{x:3+t*5.5,y:"4",width:"3",height:"16",rx:"1.5",fill:"currentColor",opacity:"0.3",children:[M("animate",{attributeName:"opacity",values:"0.3;1;0.3",dur:"1s",begin:`${t*.15}s`,repeatCount:"indefinite"}),M("animate",{attributeName:"height",values:"16;8;16",dur:"1s",begin:`${t*.15}s`,repeatCount:"indefinite"}),M("animate",{attributeName:"y",values:"4;8;4",dur:"1s",begin:`${t*.15}s`,repeatCount:"indefinite"})]},t))})}function cn({px:e}){let t=e*.14,n=e*.33,o=e/2-n,i=e/2,a=e/2+n,r=e/2;return M("svg",{width:e,height:e,viewBox:`0 0 ${e} ${e}`,children:[o,i,a].map((l,u)=>Y("circle",{cx:l,cy:r,r:t,fill:"currentColor",opacity:"0.4",children:[M("animate",{attributeName:"cy",values:`${r};${r-e*.25};${r}`,dur:"0.6s",begin:`${u*.12}s`,repeatCount:"indefinite",calcMode:"spline",keySplines:"0.4 0 0.2 1;0.4 0 0.2 1"}),M("animate",{attributeName:"opacity",values:"0.4;1;0.4",dur:"0.6s",begin:`${u*.12}s`,repeatCount:"indefinite"})]},u))})}function dn({px:e}){return Y("svg",{width:e,height:e,viewBox:"0 0 24 24",children:[Y("circle",{cx:"12",cy:"12",r:"0",fill:"currentColor",opacity:"0",children:[M("animate",{attributeName:"r",values:"4;10;4",dur:"1.2s",repeatCount:"indefinite"}),M("animate",{attributeName:"opacity",values:"0.8;0.1;0.8",dur:"1.2s",repeatCount:"indefinite"})]}),M("circle",{cx:"12",cy:"12",r:"3.5",fill:"currentColor",opacity:"0.7"})]})}function pn({px:e}){return Y("svg",{width:e,height:e,viewBox:"0 0 24 24",children:[M("circle",{cx:"12",cy:"12",r:"8",stroke:"currentColor",strokeWidth:"1.5",fill:"none",opacity:"0.15"}),M("circle",{cx:"12",cy:"4",r:"2.2",fill:"currentColor",children:M("animateTransform",{attributeName:"transform",type:"rotate",from:"0 12 12",to:"360 12 12",dur:"0.9s",repeatCount:"indefinite"})}),M("circle",{cx:"12",cy:"20",r:"1.5",fill:"currentColor",opacity:"0.5",children:M("animateTransform",{attributeName:"transform",type:"rotate",from:"0 12 12",to:"-360 12 12",dur:"0.9s",repeatCount:"indefinite"})})]})}function mn({px:e}){let t=e*.14,n=e*.33,o=e/2-n,i=e/2,a=e/2+n,r=e/2;return M("svg",{width:e,height:e,viewBox:`0 0 ${e} ${e}`,children:[o,i,a].map((l,u)=>M("circle",{cx:l,cy:r,r:t,fill:"currentColor",opacity:"0.25",children:M("animate",{attributeName:"opacity",values:"0.25;1;0.25",dur:"0.9s",begin:`${u*.2}s`,repeatCount:"indefinite"})},u))})}var fn={ring:an,arc:sn,dots:ln,bars:un,bounce:cn,pulse:dn,orbit:pn,flow:mn},gn=new Set(["ring","arc","dots"]);function be({variant:e="ring",size:t="md",className:n,label:o}){let i=typeof t=="number"?t:rn[t],a=fn[e];return M("span",{"aria-hidden":!o,"aria-label":o,role:o?"img":void 0,className:on("owo-spinner inline-flex",gn.has(e)&&"animate-spin",n),children:M(a,{px:i})})}import{Fragment as vn,jsx as Q,jsxs as wn}from"react/jsx-runtime";function We({variant:e="secondary",size:t="md",loading:n=!1,className:o}){return bn("owo-button","inline-flex items-center justify-center gap-2 rounded-[var(--owo-cmp-control-radius-md)] border font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-inset disabled:cursor-not-allowed disabled:opacity-[var(--button-disabled-opacity)]",t==="sm"?"min-h-8 px-3 text-xs":"min-h-9 px-4 text-sm",n&&"pointer-events-none cursor-wait",o)}function ae(e){let{variant:t="secondary",size:n="md",loading:o=!1,leadingIcon:i,trailingIcon:a,className:r,children:l,...u}=e,s=wn(vn,{children:[o?Q("span",{className:"shrink-0",children:Q(be,{size:n==="sm"?"sm":"md"})}):i?Q("span",{className:"shrink-0",children:i}):null,Q("span",{children:l}),!o&&a?Q("span",{className:"shrink-0",children:a}):null]}),d=We({variant:t,size:n,loading:o,className:r});if("href"in e&&e.href){let{href:g,...p}=u;return Q("a",{href:g,"data-variant":t,"data-size":n,"data-loading":o?"true":void 0,"aria-disabled":o||void 0,tabIndex:o?-1:void 0,className:d,onClick:o?m=>m.preventDefault():void 0,...p,children:s})}let c=u;return Q("button",{type:c.type??"button","data-variant":t,"data-size":n,"data-loading":o?"true":void 0,disabled:c.disabled||o,className:d,...c,children:s})}import{clsx as Ee}from"clsx";import{createContext as xn,useContext as hn,useEffect as Tn,useId as yn,useMemo as Mn,useRef as qe,useState as Ge}from"react";import{jsx as se}from"react/jsx-runtime";var Xe=xn(null);function Ze(e){let t=hn(Xe);if(!t)throw new Error(`${e} must be used within Collapsible.Root`);return t}function Pn({open:e,defaultOpen:t,onOpenChange:n}){let[o,i]=Ge(t??!1),a=e!==void 0,r=a?e:o;function l(u){a||i(u),n?.(u)}return[r,l]}function Ie({children:e,open:t,defaultOpen:n,onOpenChange:o,className:i,...a}){let[r,l]=Pn({open:t,defaultOpen:n,onOpenChange:o}),u=yn(),s=Mn(()=>({open:r,setOpen:l,contentId:u}),[u,r,l]);return se(Xe.Provider,{value:s,children:se("div",{"data-state":r?"open":"closed",className:Ee("owo-collapsible",i),...a,children:e})})}function Je({children:e,className:t,onClick:n,...o}){let{open:i,setOpen:a,contentId:r}=Ze("Collapsible.Trigger");return se("button",{type:"button","aria-expanded":i,"aria-controls":r,"data-state":i?"open":"closed",className:Ee("owo-collapsible__trigger",t),onClick:l=>{n?.(l),l.defaultPrevented||a(!i)},...o,children:e})}function Ye({children:e,className:t,...n}){let{open:o,contentId:i}=Ze("Collapsible.Content"),[a,r]=Ge(o),l=qe(null),u=qe(null);return Tn(()=>{let s=l.current,d=u.current;if(!s||!d)return;let c=0,g=0,p=()=>{s.style.height="auto",s.style.overflow="visible"};if(o&&r(!0),!a&&!o)return;let m=w=>{w.target!==s||w.propertyName!=="height"||(s.removeEventListener("transitionend",m),o?p():r(!1))};return(()=>{let w=d.scrollHeight;if(s.style.overflow="hidden",o){s.style.height="0px",c=window.requestAnimationFrame(()=>{s.addEventListener("transitionend",m),s.style.height=`${w}px`}),g=window.setTimeout(p,240);return}s.style.height=`${w}px`,c=window.requestAnimationFrame(()=>{s.addEventListener("transitionend",m),s.style.height="0px"}),g=window.setTimeout(()=>r(!1),240)})(),()=>{window.cancelAnimationFrame(c),window.clearTimeout(g),s.removeEventListener("transitionend",m)}},[o,a]),!a&&!o?null:se("div",{id:i,ref:l,"data-state":o?"open":"closed","aria-hidden":!o,className:Ee("owo-collapsible__content",t),...n,children:se("div",{ref:u,className:"owo-collapsible__content-inner",children:e})})}var Cn=Object.assign(Ie,{Root:Ie,Trigger:Je,Content:Ye}),Sn=Cn;import{createContext as kn,useCallback as je,useContext as Hn,useRef as An,useState as _n}from"react";import{clsx as ie}from"clsx";import{useEffect as Nn,useRef as Qe,useCallback as Rn}from"react";import{jsx as le,jsxs as Dn}from"react/jsx-runtime";function Ln({className:e,children:t,...n}){return le("div",{className:ie("owo-dialog__header px-5 pt-5 pb-1 text-base font-semibold",e),...n,children:t})}function In({className:e,children:t,...n}){return le("div",{className:ie("owo-dialog__body px-5 py-3 text-sm",e),...n,children:t})}function En({className:e,children:t,...n}){return le("div",{className:ie("owo-dialog__footer flex items-center justify-end gap-2 px-5 pt-3 pb-5",e),...n,children:t})}function $({open:e,onClose:t,size:n="sm",children:o,className:i,overlayClassName:a,panelClassName:r,...l}){let u=Qe(null),s=Qe(null),d=Rn(c=>{c.key==="Escape"&&(c.stopPropagation(),t())},[t]);return Nn(()=>(e?(s.current=document.activeElement,document.body.style.overflow="hidden",requestAnimationFrame(()=>{let c=u.current;if(!c)return;let g=c.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');g?g.focus():c.focus()}),document.addEventListener("keydown",d)):(document.body.style.overflow="",s.current?.focus()),()=>{document.removeEventListener("keydown",d),document.body.style.overflow=""}),[e,d]),e?Dn("div",{"data-state":"open",className:"owo-dialog-overlay fixed inset-0 z-[var(--owo-cmp-z-modal)] flex items-center justify-center",children:[le("button",{type:"button","aria-label":"Close dialog","data-state":"open",className:ie("owo-dialog-backdrop absolute inset-0 bg-[var(--owo-cmp-overlay-bg)]",a),onClick:t}),le("div",{ref:u,role:"dialog","aria-modal":"true",tabIndex:-1,"data-state":"open","data-size":n,className:ie("owo-dialog relative z-10 w-full rounded-[var(--owo-cmp-control-radius-xl)] shadow-xl","animate-[dialog-in_0.2s_var(--owo-cmp-motion-ease-standard)]",n==="sm"?"max-w-[26rem]":"max-w-[32rem]",r,i),...l,children:o})]}):null}$.Header=Ln;$.Body=In;$.Footer=En;import{Fragment as Vn,jsx as te,jsxs as De}from"react/jsx-runtime";var et=kn(null);function Bn(){let e=Hn(et);if(!e)throw new Error("useConfirm must be used within <ConfirmProvider>");return e}function On({children:e}){let[t,n]=_n(null),o=An(null),i=je(r=>(o.current&&o.current.resolve(!1),new Promise(l=>{let u={options:r,resolve:l};o.current=u,n(u)})),[]),a=je(r=>{o.current&&(o.current.resolve(r),o.current=null),n(null)},[]);return De(et.Provider,{value:i,children:[e,te($,{open:t!==null,onClose:()=>a(!1),children:t&&De(Vn,{children:[te($.Header,{children:t.options.title}),te($.Body,{children:typeof t.options.description=="string"?te("p",{className:"whitespace-pre-wrap",children:t.options.description}):t.options.description}),De($.Footer,{children:[te(ae,{variant:"ghost",size:"sm",onClick:()=>a(!1),children:t.options.cancelLabel??"\u53D6\u6D88"}),te(ae,{variant:t.options.variant??"primary",size:"sm",onClick:()=>a(!0),children:t.options.confirmLabel??"\u786E\u8BA4"})]})]})})]})}import{clsx as J}from"clsx";import{autoUpdate as zn,computePosition as Fn,flip as $n,offset as Kn,shift as Un}from"@floating-ui/dom";import{Children as Wn,cloneElement as qn,createContext as tt,isValidElement as Gn,useCallback as A,useContext as ke,useEffect as j,useId as ve,useLayoutEffect as Xn,useMemo as xe,useRef as Z,useState as ue}from"react";import{createPortal as Zn}from"react-dom";import{jsx as _,jsxs as st}from"react/jsx-runtime";var nt=tt(null),He=tt(null);function Ae(e){let t=ke(nt);if(!t)throw new Error(`${e} must be used within DropdownMenu.`);return t}function ot(e){let t=ke(He);if(!t)throw new Error(`${e} must be used within DropdownMenu.Content.`);return t}function ne(e,t){return n=>{e?.(n),t(n)}}function rt(...e){return t=>{for(let n of e)n&&(typeof n=="function"?n(t):n.current=t)}}function we(e){return typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(we).join(" "):!e||typeof e=="boolean"?"":Gn(e)?we(e.props.children):""}function Jn(e){return[...e].sort((t,n)=>{let o=t.ref.current,i=n.ref.current;if(!o||!i)return 0;let a=o.compareDocumentPosition(i);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Yn(e,t){return t==="center"?e:`${e}-${t}`}function Qn(e){let t=e.split("-");return{side:t[0],align:t[1]??"center"}}function at({open:e,defaultOpen:t=!1,onOpenChange:n,side:o="bottom",align:i="start",sideOffset:a=8,alignOffset:r=0,collisionPadding:l=8,portal:u=!0,contentRole:s="menu",children:d}){let c=ke(He),[g,p]=ue(t),m=e!==void 0,T=m?e:g,w=Z(null),b=Z(null),C=Z("selected"),x=ve(),R=ve(),h=A(P=>{m||p(P),n?.(P)},[m,n]),L=A(()=>{h(!1)},[h]),S=A(()=>{h(!1),c?.closeTree()},[c,h]),I=A(()=>{h(!T)},[T,h]),H=A(()=>{w.current?.focus()},[]),f=xe(()=>({open:T,setOpen:h,toggleOpen:I,triggerRef:w,contentRef:b,side:o,align:i,sideOffset:a,alignOffset:r,collisionPadding:l,portal:u,contentRole:s,triggerId:x,contentId:R,focusIntentRef:C,parentList:c,isSubmenu:!!c,closeSelf:L,closeTree:S,focusTrigger:H}),[T,i,r,L,S,l,s,c,u,h,o,a,I,x,R,H]);return _(nt.Provider,{value:f,children:d})}function jn({asChild:e=!1,disabled:t=!1,className:n,children:o}){let{open:i,setOpen:a,toggleOpen:r,triggerRef:l,contentRole:u,triggerId:s,contentId:d,focusIntentRef:c,isSubmenu:g}=Ae("DropdownMenu.Trigger"),p=Wn.only(o),m=p.props??{},T=typeof m.className=="string"?m.className:void 0,w={id:s,"data-state":i?"open":"closed","aria-expanded":i,"aria-haspopup":u,"aria-controls":i?d:void 0,onClick:ne(m.onClick,b=>{if(t){b.preventDefault();return}c.current="selected",r()}),onKeyDown:ne(m.onKeyDown,b=>{t||(b.key==="ArrowDown"?(b.preventDefault(),c.current="first",a(!0)):b.key==="ArrowUp"?(b.preventDefault(),c.current="last",a(!0)):!g&&(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),c.current="selected",r()))})};return e?qn(p,{...w,ref:rt(l,m.ref),className:J(n,T),type:p.type==="button"?m.type??"button":m.type}):_("button",{ref:l,disabled:t,type:"button",className:J("owo-dropdown-menu__trigger",n),...w,children:p})}function eo({className:e,children:t,style:n,matchTriggerWidth:o=!1,maxHeight:i=320,...a}){let{open:r,setOpen:l,triggerRef:u,contentRef:s,side:d,align:c,sideOffset:g,alignOffset:p,collisionPadding:m,portal:T,contentRole:w,triggerId:b,contentId:C,focusIntentRef:x,parentList:R,isSubmenu:h,closeSelf:L,closeTree:S,focusTrigger:I}=Ae("DropdownMenu.Content"),H=Z([]),[f,P]=ue(null),[B,W]=ue(null),[O,q]=ue(null),[V,Ve]=ue(!1),re=Z(""),G=Z(null),ge=A(v=>(H.current=[...H.current.filter(N=>N.id!==v.id),v],()=>{H.current=H.current.filter(N=>N.id!==v.id)}),[]),k=A(()=>Jn(H.current),[]),ze=A(v=>{x.current=v},[x]);j(()=>{Ve(!0)},[]);let Zt=xe(()=>({role:w,highlightedId:f,setHighlightedId:P,registerItem:ge,getItems:k,requestFocusIntent:ze,closeTree:S,closeSelf:L,focusTrigger:I,activeSubmenuId:B,setActiveSubmenuId:W,contentRef:s}),[B,L,S,s,w,I,k,f,ge,ze]);Xn(()=>!r||!V||!u.current||!s.current?void 0:zn(u.current,s.current,()=>{!u.current||!s.current||Fn(u.current,s.current,{placement:Yn(d,c),strategy:"fixed",middleware:[Kn({mainAxis:g,crossAxis:p}),$n({padding:m}),Un({padding:m})]}).then(({x:N,y,placement:E})=>{let z=Qn(E);q({top:y,left:N,side:z.side,align:z.align})})}),[c,p,m,s,V,r,d,g,u]),j(()=>{if(!r){P(null),W(null);return}let v=k().filter(y=>!y.disabled);if(v.length===0)return;let N=v[0];x.current==="last"?N=v[v.length-1]:x.current==="selected"&&(N=v.find(y=>y.selected)??v[0]),P(N.id),requestAnimationFrame(()=>{s.current?.focus(),N.ref.current?.scrollIntoView({block:"nearest"})})},[s,x,k,r]),j(()=>{if(!r)return;function v(N){let y=N.target,E=u.current?.contains(y),z=s.current?.contains(y);if(!E&&!z){let F=R?.contentRef.current?.contains(y);if(h&&F){L(),R?.setActiveSubmenuId(null);return}S()}}return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[L,S,s,h,r,R,u]),j(()=>{if(r)return()=>{G.current&&clearTimeout(G.current)}},[r]);let X=A(v=>{if(P(v),!v){W(null);return}k().find(y=>y.id===v)?.submenu||W(null)},[k]),Re=A((v,N="first")=>{let y=k().filter(K=>!K.disabled);if(y.length===0)return;let E=y.findIndex(K=>K.id===f);if(E===-1){X(N==="last"?y[y.length-1].id:y[0].id);return}let z=(E+v+y.length)%y.length,F=y[z];X(F.id),F.ref.current?.scrollIntoView({block:"nearest"})},[k,f,X]),Fe=A(v=>{let N=v.length===1?v.toLowerCase():"";if(!N)return;G.current&&clearTimeout(G.current),re.current+=N,G.current=setTimeout(()=>{re.current="",G.current=null},350);let y=k().filter(K=>!K.disabled);if(y.length===0)return;let E=y.findIndex(K=>K.id===f),F=(E>=0?[...y.slice(E+1),...y.slice(0,E+1)]:y).find(K=>K.textValue.toLowerCase().startsWith(re.current));F&&(X(F.id),F.ref.current?.scrollIntoView({block:"nearest"}))},[k,f,X]),Jt=A(v=>{let N=k(),y=N.find(E=>E.id===f)??null;switch(v.key){case"ArrowDown":v.preventDefault(),Re(1);break;case"ArrowUp":v.preventDefault(),Re(-1,"last");break;case"Home":v.preventDefault();{let E=N.find(z=>!z.disabled);E&&X(E.id)}break;case"End":v.preventDefault();{let E=N.filter(F=>!F.disabled),z=E[E.length-1];z&&X(z.id)}break;case"Enter":case" ":y&&!y.disabled&&(v.preventDefault(),y.click());break;case"ArrowRight":y?.submenu&&(v.preventDefault(),y.openSubmenu?.());break;case"ArrowLeft":h&&(v.preventDefault(),L(),I(),R?.setActiveSubmenuId(null));break;case"Tab":S();break;case"Escape":v.preventDefault(),L(),I(),h&&R?.setActiveSubmenuId(null);break;default:Fe(v.key)}},[L,S,I,k,Fe,f,X,h,Re,R]);if(!r||!V)return null;let $e=_(He.Provider,{value:Zt,children:_("div",{ref:s,id:C,role:w,tabIndex:-1,"aria-labelledby":w==="menu"?b:void 0,"data-state":"open","data-side":O?.side??d,"data-align":O?.align??c,className:J("owo-dropdown-menu__content",h&&"owo-dropdown-menu__content--submenu",e),style:{...n,position:"fixed",top:O?.top??0,left:O?.left??0,maxHeight:i,minWidth:o?u.current?.getBoundingClientRect().width:void 0},onKeyDown:Jt,...a,children:t})});return T?Zn($e,document.body):$e}function to({className:e,children:t,...n}){return _("div",{className:J("owo-dropdown-menu__group",e),...n,children:t})}function no({className:e,children:t,...n}){return _("div",{className:J("owo-dropdown-menu__label",e),...n,children:t})}function oo({className:e,...t}){return _("div",{role:"separator",className:J("owo-dropdown-menu__separator",e),...t})}function ro({className:e,children:t,inset:n=!1,disabled:o=!1,selected:i=!1,destructive:a=!1,closeOnSelect:r=!0,shortcut:l,indicator:u,onSelect:s,onMouseEnter:d,onClick:c,...g}){let p=ve(),m=Z(null),{role:T,highlightedId:w,setHighlightedId:b,registerItem:C,closeTree:x,setActiveSubmenuId:R}=ot("DropdownMenu.Item"),h=xe(()=>we(t),[t]),L=w===p,S=A(()=>{o||(s?.(),r&&x())},[r,x,o,s]);return j(()=>C({id:p,ref:m,disabled:o,submenu:!1,selected:i,textValue:h,closeOnSelect:r,click:S}),[r,o,S,p,C,i,h]),st("button",{ref:m,id:p,type:"button",role:T==="listbox"?"option":"menuitem",tabIndex:-1,disabled:o,"aria-selected":T==="listbox"?i:void 0,"data-highlighted":L||void 0,"data-selected":i||void 0,"data-disabled":o||void 0,"data-destructive":a||void 0,className:J("owo-dropdown-menu__item",n&&"owo-dropdown-menu__item--inset",e),onMouseEnter:ne(d,()=>{o||(b(p),R(null))}),onClick:ne(c,I=>{I.preventDefault(),S()}),...g,children:[_("span",{className:"owo-dropdown-menu__item-main",children:t}),l?_("span",{className:"owo-dropdown-menu__shortcut",children:l}):null,i?_("span",{className:"owo-dropdown-menu__indicator",children:u??"\u2713"}):null]})}function ao(e){return _(at,{side:"right",align:"start",sideOffset:6,...e,contentRole:"menu"})}function so({className:e,children:t,inset:n=!1,disabled:o=!1,destructive:i=!1,shortcut:a,onSelect:r,onMouseEnter:l,onClick:u,...s}){let d=ve(),c=Z(null),g=Ae("DropdownMenu.SubTrigger"),{highlightedId:p,setHighlightedId:m,registerItem:T,setActiveSubmenuId:w,activeSubmenuId:b}=ot("DropdownMenu.SubTrigger"),C=xe(()=>we(t),[t]),x=p===d,R=g.open&&b===d,h=A(()=>{o||(g.focusIntentRef.current="first",m(d),w(d),g.setOpen(!0))},[o,d,w,m,g]);return j(()=>T({id:d,ref:c,disabled:o,submenu:!0,selected:!1,textValue:C,closeOnSelect:!1,click:h,openSubmenu:h}),[o,d,h,T,C]),j(()=>{b!==d&&g.open&&g.setOpen(!1)},[b,d,g]),st("button",{ref:rt(c,g.triggerRef),id:g.triggerId,type:"button",role:"menuitem",tabIndex:-1,"aria-haspopup":"menu","aria-expanded":g.open,"aria-controls":g.open?g.contentId:void 0,"data-highlighted":x||void 0,"data-state":R?"open":"closed","data-disabled":o||void 0,"data-destructive":i||void 0,className:J("owo-dropdown-menu__item owo-dropdown-menu__sub-trigger",n&&"owo-dropdown-menu__item--inset",e),onMouseEnter:ne(l,()=>{h()}),onClick:ne(u,L=>{L.preventDefault(),h(),r?.()}),...s,children:[_("span",{className:"owo-dropdown-menu__item-main",children:t}),a?_("span",{className:"owo-dropdown-menu__shortcut",children:a}):null,_("span",{className:"owo-dropdown-menu__submenu-indicator","aria-hidden":"true",children:"\u203A"})]})}var io=Object.assign(at,{Trigger:jn,Content:eo,Group:to,Label:no,Item:ro,Separator:oo,Submenu:ao,SubTrigger:so}),lo=io;import{clsx as it}from"clsx";import{Fragment as uo,jsx as lt,jsxs as co}from"react/jsx-runtime";function ut({as:e="aside",open:t,children:n,side:o="right",position:i="fixed",showBackdrop:a=!0,onClose:r,closeLabel:l="\u5173\u95ED\u62BD\u5C49",backdropClassName:u,className:s,...d}){let c=o==="left"?"-translate-x-full":"translate-x-full",g=o==="left"?"left-0 top-0":"right-0 top-0",p=i==="fixed"?"fixed":"absolute";return co(uo,{children:[a&&t&&r&<("button",{type:"button","aria-label":l,"data-state":"open",className:it("owo-drawer-backdrop inset-0 z-[var(--owo-cmp-z-modal)]",p,u),onClick:r}),lt(e,{"aria-hidden":!t,"data-state":t?"open":"closed","data-side":o,className:it("owo-drawer",p,g,"z-[calc(var(--owo-cmp-z-modal)+1)] flex max-w-full transform flex-col transition-transform duration-[var(--owo-cmp-motion-duration-default)] ease-[var(--owo-cmp-motion-ease-standard)]",t?"pointer-events-auto visible translate-x-0":`pointer-events-none invisible ${c}`,s),...d,children:n})]})}import{clsx as po}from"clsx";import{jsx as ct,jsxs as mo}from"react/jsx-runtime";function dt({label:e,help:t,htmlFor:n,children:o,className:i,...a}){return mo("div",{className:po("owo-field block",i),...a,children:[ct("label",{htmlFor:n,className:"owo-field__label mb-1 block text-xs",children:e}),o,t?ct("span",{className:"owo-field__help mt-1 block text-xs",children:t}):null]})}import{clsx as fo}from"clsx";import{jsx as pt}from"react/jsx-runtime";function mt({variant:e="ghost",size:t="md",label:n,icon:o,className:i,...a}){let r=fo("owo-icon-button","inline-flex items-center justify-center rounded-[var(--owo-cmp-control-radius-md)] transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-inset disabled:cursor-not-allowed disabled:opacity-50",t==="sm"?"h-7 w-7":"h-8 w-8",i);if("href"in a&&a.href){let{href:u,...s}=a;return pt("a",{href:u,"aria-label":n,title:s.title??n,"data-variant":e,"data-size":t,className:r,...s,children:o})}let l=a;return pt("button",{type:l.type??"button","aria-label":n,title:l.title??n,"data-variant":e,"data-size":t,className:r,...l,children:o})}import{clsx as go}from"clsx";import{jsx as ft}from"react/jsx-runtime";function he(e){return go("owo-input w-full rounded-[var(--owo-cmp-control-radius-lg)] px-3 py-2 text-sm placeholder:text-[var(--field-placeholder)] focus:outline-none focus:ring-1",e)}function gt(e){let{className:t,tone:n="default",...o}=e;return e.as==="textarea"?ft("textarea",{"data-tone":n,className:he(t),...o}):ft("input",{"data-tone":n,className:he(t),...o})}import{clsx as Te}from"clsx";import{jsx as ye}from"react/jsx-runtime";function bo(e){switch(e){case"none":return"";case"sm":return"p-4";case"lg":return"p-6";default:return"p-5"}}function bt({as:e="section",variant:t="default",padding:n="none",className:o,children:i,...a}){return ye(e,{"data-variant":t,className:Te("owo-panel rounded-[var(--owo-cmp-control-radius-lg)] border",bo(n),o),...a,children:i})}function vo({className:e,children:t,...n}){return ye("div",{className:Te("owo-panel-header border-b px-6 py-5",e),...n,children:t})}function wo({className:e,children:t,...n}){return ye("div",{className:Te("px-6 py-5",e),...n,children:t})}function xo({className:e,children:t,...n}){return ye("div",{className:Te("owo-panel-footer border-t px-6 py-4",e),...n,children:t})}import{clsx as vt}from"clsx";import{jsx as wt}from"react/jsx-runtime";function xt({value:e,onChange:t,options:n,size:o="sm",className:i,ariaLabel:a}){return wt("div",{role:"tablist","aria-label":a,className:vt("owo-segmented-control inline-flex rounded-[var(--owo-cmp-control-radius-md)] p-0.5 ring-1",o==="sm"?"text-xs":"text-sm",i),children:n.map(r=>{let l=r.value===e;return wt("button",{type:"button",role:"tab","aria-selected":l,disabled:r.disabled,"data-active":l?"true":void 0,className:vt("owo-segmented-control__item rounded-[var(--owo-cmp-control-radius-sm)] font-medium transition-colors focus:outline-none focus-visible:ring-1 focus-visible:ring-inset disabled:cursor-not-allowed disabled:opacity-50",o==="sm"?"px-2.5 py-1":"px-3 py-1.5"),onClick:()=>t(r.value),children:r.label},r.value)})})}import{clsx as oe}from"clsx";import{useCallback as _e,useEffect as ht,useId as ho,useMemo as To,useRef as Tt,useState as yt}from"react";import{jsx as ce,jsxs as Mt}from"react/jsx-runtime";function Pt({value:e,onChange:t,options:n,placeholder:o="Select\u2026",size:i="md",tone:a="default",disabled:r=!1,className:l,ariaLabel:u,renderValue:s,renderOption:d}){let[c,g]=yt(!1),[p,m]=yt(-1),T=Tt(null),w=Tt(null),b=ho(),C=n.find(f=>f.value===e),x=To(()=>n.reduce((f,P,B)=>(P.disabled||f.push(B),f),[]),[n]),R=_e(()=>{if(r||n.length===0)return;g(!0);let f=n.findIndex(P=>P.value===e);m(f>=0?f:x[0]??-1)},[r,n,e,x]),h=_e(()=>{g(!1),m(-1)},[]),L=_e(f=>{f.disabled||(t(f.value),h())},[t,h]);ht(()=>{if(!c)return;function f(P){T.current&&!T.current.contains(P.target)&&h()}return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[c,h]),ht(()=>{if(!c||p<0)return;w.current?.children[p]?.scrollIntoView({block:"nearest"})},[c,p]);function S(f){if(!r)switch(f.key){case"Enter":case" ":{f.preventDefault(),c?p>=0&&n[p]&&!n[p].disabled&&L(n[p]):R();break}case"ArrowDown":{if(f.preventDefault(),!c)R();else{let P=x.indexOf(p),B=x[P+1];B!==void 0&&m(B)}break}case"ArrowUp":{if(f.preventDefault(),!c)R();else{let P=x.indexOf(p),B=x[P-1];B!==void 0&&m(B)}break}case"Escape":{c&&(f.preventDefault(),h());break}case"Tab":{c&&h();break}}}let I=e!==""&&C,H=s?s({open:c,placeholder:o,selectedOption:C}):ce("span",{className:oe("truncate",!I&&"owo-select__placeholder"),children:I?C.label:o});return Mt("div",{ref:T,"data-state":c?"open":"closed","data-disabled":r||void 0,"data-size":i,"data-tone":a,className:oe("owo-select relative inline-block",l),children:[Mt("button",{type:"button",role:"combobox","aria-expanded":c,"aria-haspopup":"listbox","aria-controls":b,"aria-label":u,"aria-activedescendant":c&&p>=0?`${b}-opt-${p}`:void 0,"data-state":c?"open":"closed","data-disabled":r||void 0,"data-tone":a,"data-size":i,"data-open":c||void 0,"data-has-value":I||void 0,disabled:r,className:oe("owo-select__trigger flex w-full items-center justify-between gap-2 rounded-[var(--owo-cmp-control-radius-lg)] text-left transition-colors focus:outline-none",i==="sm"?"min-h-7 px-2 py-1 text-xs":"min-h-9 px-3 py-2 text-sm"),onClick:()=>c?h():R(),onKeyDown:S,children:[H,ce("svg",{"aria-hidden":"true",className:oe("owo-select__chevron h-3.5 w-3.5 shrink-0 transition-transform",c&&"rotate-180"),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:ce("path",{d:"M4 6l4 4 4-4"})})]}),c&&ce("ul",{ref:w,id:b,role:"listbox","aria-label":u,"data-state":"open",className:oe("owo-select__dropdown absolute z-[var(--owo-cmp-z-dropdown)] mt-1 max-h-60 w-full overflow-auto rounded-[var(--owo-cmp-control-radius-lg)] py-1 ring-1",i==="sm"?"text-xs":"text-sm"),children:n.map((f,P)=>ce("li",{id:`${b}-opt-${P}`,role:"option","aria-selected":f.value===e,"aria-disabled":f.disabled||void 0,"data-state":f.value===e?"selected":P===p?"highlighted":"idle","data-focused":P===p||void 0,"data-selected":f.value===e||void 0,"data-disabled":f.disabled||void 0,"data-highlighted":P===p||void 0,className:oe("owo-select__option cursor-default select-none px-3 py-1.5 transition-colors",f.disabled&&"cursor-not-allowed opacity-50"),onClick:()=>L(f),onMouseEnter:()=>!f.disabled&&m(P),children:d?d({option:f,index:P,selected:f.value===e,highlighted:P===p}):f.label},f.value))})]})}import{clsx as yo}from"clsx";import{jsx as Po}from"react/jsx-runtime";var Mo={slow:"4s",default:"3s",fast:"2s"};function Ct({className:e,animation:t="scan",tone:n="default",speed:o="default",style:i,...a}){let r=n==="warm"?"emphasis":n,l={...i,"--_owo-skeleton-scan-duration":Mo[o]};return Po("div",{className:yo("owo-skeleton rounded-[var(--owo-cmp-control-radius-sm)]",e),"data-animation":t,"data-tone":r,"aria-hidden":"true",style:l,...a})}import{clsx as St}from"clsx";import{Fragment as Nt,jsx as U,jsxs as Me}from"react/jsx-runtime";function Rt({tone:e="neutral",layout:t="horizontal",icon:n,title:o,description:i,action:a,className:r,children:l,...u}){if(t==="vertical"){let s=n||o||i||a;return U("div",{"data-tone":e,"data-layout":"vertical",className:St("owo-status-notice rounded-[var(--owo-cmp-control-radius-lg)] border px-4 py-3 text-sm",r),...u,children:s?Me("div",{className:"flex flex-col items-center gap-2 py-4 text-center",children:[n&&U("div",{className:"owo-status-notice__icon text-lg",children:n}),o&&U("div",{className:"owo-status-notice__title font-medium",children:o}),i&&U("div",{className:"owo-status-notice__description",children:i}),a&&U("div",{className:"mt-2",children:a})]}):l})}return U("div",{"data-tone":e,className:St("owo-status-notice rounded-[var(--owo-cmp-control-radius-md)] border px-4 py-3 text-sm",n&&"owo-status-notice--with-icon grid grid-cols-[auto_minmax(0,1fr)] gap-3",r),...u,children:n?Me(Nt,{children:[U("span",{className:"owo-status-notice__icon mt-0.5 shrink-0","aria-hidden":"true",children:n}),Me("div",{className:"min-w-0",children:[o&&U("div",{className:"owo-status-notice__title font-medium",children:o}),l]})]}):Me(Nt,{children:[o&&U("div",{className:"owo-status-notice__title font-medium",children:o}),l]})})}import{clsx as Lt}from"clsx";import{jsx as It}from"react/jsx-runtime";var Co={sm:"h-5 w-9",md:"h-6 w-11"},So={sm:"h-3.5 w-3.5",md:"h-4.5 w-4.5"},No={sm:"translate-x-4",md:"translate-x-5"};function Et({checked:e,onChange:t,size:n="md",disabled:o=!1,className:i,ariaLabel:a}){return It("button",{type:"button",role:"switch","aria-checked":e,"aria-label":a,disabled:o,"data-size":n,className:Lt("owo-switch relative inline-flex shrink-0 cursor-pointer items-center rounded-[var(--owo-cmp-control-radius-full)] border-2 border-transparent transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",Co[n],o&&"cursor-not-allowed opacity-50",i),onClick:()=>t(!e),children:It("span",{"aria-hidden":"true",className:Lt("owo-switch__thumb pointer-events-none inline-block rounded-[var(--owo-cmp-control-radius-full)] bg-white shadow transition-transform",So[n],e?No[n]:"translate-x-0.5")})})}import{clsx as Ce}from"clsx";import{createContext as Ro,useContext as Lo,useId as Io,useMemo as Eo,useState as Do}from"react";import{jsx as de}from"react/jsx-runtime";var Dt=Ro(null);function kt(e){let t=Lo(Dt);if(!t)throw new Error(`${e} must be used within Tabs.Root`);return t}function Pe(e){return e.replace(/[^a-zA-Z0-9_-]+/g,"-")}function ko({value:e,defaultValue:t,onValueChange:n}){let[o,i]=Do(t??""),a=e!==void 0,r=a?e:o;function l(u){a||i(u),n?.(u)}return[r,l]}function Be({children:e,value:t,defaultValue:n,onValueChange:o,className:i,...a}){let[r,l]=ko({value:t,defaultValue:n,onValueChange:o}),u=Io(),s=Eo(()=>({value:r,setValue:l,baseId:u}),[u,r,l]);return de(Dt.Provider,{value:s,children:de("div",{className:Ce("owo-tabs",i),...a,children:e})})}function Ht({children:e,className:t,ariaLabel:n,...o}){return de("div",{role:"tablist","aria-label":n,className:Ce("owo-tabs__list flex items-end gap-1 border-b",t),...o,children:e})}function At({children:e,className:t,value:n,disabled:o,onClick:i,onKeyDown:a,...r}){let{value:l,setValue:u,baseId:s}=kt("Tabs.Trigger"),d=l===n,c=`${s}-trigger-${Pe(n)}`,g=`${s}-panel-${Pe(n)}`;function p(m,T){let w=m.closest('[role="tablist"]');if(!w)return;let b=Array.from(w.querySelectorAll('[role="tab"]:not([disabled])')),C=b.indexOf(m);if(C<0)return;let x;T==="first"&&(x=b[0]),T==="last"&&(x=b[b.length-1]),T==="next"&&(x=b[(C+1)%b.length]),T==="prev"&&(x=b[(C-1+b.length)%b.length]),x&&(x.focus(),x.click())}return de("button",{type:"button",id:c,role:"tab","aria-selected":d,"aria-controls":g,tabIndex:d?0:-1,"data-state":d?"active":"inactive",disabled:o,className:Ce("owo-tabs__trigger relative -mb-px inline-flex min-h-9 items-center justify-center rounded-t-[var(--owo-cmp-control-radius-md)] border-b-2 px-3 py-2 text-sm font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-inset disabled:cursor-not-allowed disabled:opacity-50",t),onClick:m=>{i?.(m),!m.defaultPrevented&&!o&&u(n)},onKeyDown:m=>{if(a?.(m),m.defaultPrevented||o)return;let T=m.currentTarget;switch(m.key){case"ArrowRight":m.preventDefault(),p(T,"next");break;case"ArrowLeft":m.preventDefault(),p(T,"prev");break;case"Home":m.preventDefault(),p(T,"first");break;case"End":m.preventDefault(),p(T,"last");break}},...r,children:e})}function _t({children:e,className:t,value:n,...o}){let{value:i,baseId:a}=kt("Tabs.Content"),r=i===n,l=`${a}-trigger-${Pe(n)}`,u=`${a}-panel-${Pe(n)}`;return r?de("div",{id:u,role:"tabpanel","aria-labelledby":l,"data-state":"active",className:Ce("owo-tabs__content pt-4",t),...o,children:e}):null}var Ho=Object.assign(Be,{Root:Be,List:Ht,Trigger:At,Content:_t}),Ao=Ho;import{useCallback as _o,useEffect as Bo,useRef as Oo}from"react";import{jsx as Vo}from"react/jsx-runtime";function Bt({className:e,tone:t="default",resize:n="vertical",autoResize:o=!1,style:i,onInput:a,rows:r=3,...l}){let u=Oo(null),s=a,d=_o(()=>{if(!o||!u.current)return;let p=u.current;p.style.height="auto",p.style.height=`${p.scrollHeight}px`},[o]);Bo(()=>{d()},[d,l.value,l.defaultValue,r]);function c(p){d(),s?.(p)}let g={...i,resize:o?"none":n};return Vo("textarea",{...l,ref:u,rows:r,"data-tone":t,"data-auto-resize":o||void 0,className:he(`owo-textarea ${e??""}`),style:g,onInput:c})}import{clsx as Ot}from"clsx";import{createContext as zo,useCallback as Vt,useContext as Fo,useMemo as $o,useRef as zt,useState as Ko}from"react";import{jsx as D,jsxs as pe}from"react/jsx-runtime";var $t=zo(null),Oe=5,Ft=4e3;function Uo(){let e=Fo($t);if(!e)throw new Error("useToast must be used within <ToastProvider>");return e}function Wo({tone:e}){let t={width:16,height:16,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};switch(e){case"success":return D("svg",{...t,children:D("path",{d:"M3.5 8.5l3 3 6-7"})});case"warning":return pe("svg",{...t,children:[D("path",{d:"M8 5v4"}),D("circle",{cx:"8",cy:"11.5",r:"0.5",fill:"currentColor",stroke:"none"})]});case"danger":return D("svg",{...t,children:D("path",{d:"M4.5 4.5l7 7M11.5 4.5l-7 7"})});case"info":return pe("svg",{...t,children:[D("circle",{cx:"8",cy:"3.5",r:"1.2",fill:"currentColor",stroke:"none"}),D("path",{d:"M8 7v5.5"})]})}}function qo(e,t){return typeof e=="string"?{message:e,duration:t??Ft}:{title:e.title,message:e.message,duration:e.duration??t??Ft}}function Go({item:e,onDismiss:t,renderToast:n}){let o=()=>t(e.id),i=D(Wo,{tone:e.tone});return n?D("div",{role:"status","aria-live":"polite","data-state":"open","data-tone":e.tone,className:Ot("owo-toast pointer-events-auto rounded-[var(--owo-cmp-control-radius-lg)] border text-sm backdrop-blur-sm","animate-[toast-in_0.25s_var(--owo-cmp-motion-ease-standard)]"),children:n({item:e,dismiss:o,icon:i})}):pe("div",{role:"status","aria-live":"polite","data-state":"open","data-tone":e.tone,className:Ot("owo-toast pointer-events-auto flex items-start gap-2 rounded-[var(--owo-cmp-control-radius-lg)] border px-4 py-3 text-sm backdrop-blur-sm","animate-[toast-in_0.25s_var(--owo-cmp-motion-ease-standard)]"),children:[D("span",{className:"owo-toast__icon mt-0.5 shrink-0","aria-hidden":"true",children:i}),pe("span",{className:"min-w-0 flex-1",children:[e.title?D("span",{className:"owo-toast__title block font-medium",children:e.title}):null,D("span",{className:"block",children:e.message})]}),D("button",{type:"button",onClick:o,className:"owo-toast__close -mr-1 -mt-0.5 shrink-0 rounded-[var(--owo-cmp-control-radius-sm)] p-0.5 text-current opacity-50 transition-opacity hover:opacity-100","aria-label":"Dismiss",children:D("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:D("path",{d:"M4 4l8 8M12 4l-8 8"})})})]})}function Xo({children:e,renderToast:t}){let[n,o]=Ko([]),i=zt(0),a=zt(new Map),r=Vt(s=>{let d=a.current.get(s);d&&clearTimeout(d),a.current.delete(s),o(c=>c.filter(g=>g.id!==s))},[]),l=Vt((s,d,c)=>{let g=i.current++,p=qo(d,c),m={id:g,tone:s,...p};o(T=>{let w=[...T,m];if(w.length>Oe){let b=w.slice(0,w.length-Oe);for(let C of b){let x=a.current.get(C.id);x&&clearTimeout(x),a.current.delete(C.id)}return w.slice(-Oe)}return w}),m.duration>0&&a.current.set(g,setTimeout(()=>r(g),m.duration))},[r]),u=$o(()=>({success:(s,d)=>l("success",s,d),warning:(s,d)=>l("warning",s,d),danger:(s,d)=>l("danger",s,d),info:(s,d)=>l("info",s,d)}),[l]);return pe($t.Provider,{value:u,children:[e,D("div",{"aria-label":"Notifications","data-state":n.length>0?"open":"closed",className:"pointer-events-none fixed bottom-4 right-4 z-[var(--owo-cmp-z-toast)] flex flex-col-reverse gap-2",children:n.map(s=>D(Go,{item:s,onDismiss:r,renderToast:t},s.id))})]})}import{clsx as Zo}from"clsx";import{autoUpdate as Jo,computePosition as Yo,flip as Qo,offset as jo,shift as er,arrow as tr}from"@floating-ui/dom";import{useCallback as ee,useEffect as Kt,useId as nr,useLayoutEffect as or,useRef as me,useState as Se}from"react";import{createPortal as rr}from"react-dom";import{Fragment as ir,jsx as Ne,jsxs as Gt}from"react/jsx-runtime";var fe=6,Ut=8,Wt=4,ar={compact:"px-2 py-1 text-[11px] max-w-[200px]",default:"px-3 py-2 text-xs max-w-xs"};function sr(e){return e.split("-")[0]}var qt={top:"",bottom:"rotate(180deg)",left:"rotate(-90deg)",right:"rotate(90deg)"};function Xt({content:e,placement:t="top",density:n="default",showDelay:o=300,hideDelay:i=150,arrow:a=!0,renderArrow:r,className:l,children:u}){let[s,d]=Se(!1),[c,g]=Se(null),[p,m]=Se(t),[T,w]=Se({}),b=me(null),C=me(null),x=me(null),R=me(void 0),h=me(void 0),L=nr(),S=ee(()=>{clearTimeout(R.current),clearTimeout(h.current)},[]),I=ee(()=>{S(),R.current=setTimeout(()=>d(!0),o)},[S,o]),H=ee(()=>{S(),d(!0)},[S]),f=ee(()=>{S(),h.current=setTimeout(()=>d(!1),i)},[S,i]),P=ee(V=>{if(V.target===b.current){I();return}H()},[I,H]),B=ee(V=>{V.pointerType!=="mouse"&&H()},[H]),W=ee(V=>{V.key==="Escape"&&s&&d(!1)},[s]);or(()=>{if(!s||!b.current||!C.current)return;let V=[jo(a?Ut+fe:Ut),Qo({padding:Wt}),er({padding:Wt})];return a&&x.current&&V.push(tr({element:x.current})),Jo(b.current,C.current,()=>{!b.current||!C.current||Yo(b.current,C.current,{placement:t,strategy:"fixed",middleware:V}).then(({x:re,y:G,placement:ge,middlewareData:k})=>{g({top:G,left:re}),m(sr(ge)),k.arrow&&w({x:k.arrow.x,y:k.arrow.y})})})},[s,t,a]),Kt(()=>{if(s)return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[s,W]),Kt(()=>S,[S]);let O={position:"absolute"},q=p;return q==="top"||q==="bottom"?(O.left=T.x??0,O[q==="top"?"bottom":"top"]=-fe,O.transform=qt[q]||void 0):(O.top=T.y??0,O[q==="left"?"right":"left"]=-fe,O.transform=qt[q]),Gt(ir,{children:[Ne("span",{ref:b,"data-state":s?"open":"closed",className:"owo-tooltip-trigger inline-flex",onMouseEnter:I,onMouseLeave:f,onFocus:P,onBlur:f,onPointerDown:B,"aria-describedby":s?L:void 0,children:u}),s&&rr(Gt("div",{ref:C,id:L,role:"tooltip","data-state":s?"open":"closed","data-placement":p,"data-density":n,className:Zo("owo-tooltip fixed z-[var(--owo-cmp-z-toast)] rounded-[var(--owo-cmp-control-radius-lg)] leading-relaxed",ar[n],"animate-[tooltip-in_0.15s_var(--owo-cmp-motion-ease-standard)]",l),style:c?{top:c.top,left:c.left}:{visibility:"hidden"},onMouseEnter:I,onMouseLeave:f,children:[e,a&&Ne("span",{ref:x,className:"owo-tooltip__arrow absolute",style:O,children:r?r({placement:p}):Ne("svg",{width:fe*2,height:fe,viewBox:"0 0 12 6",children:Ne("path",{d:"M0 0l6 6 6-6z",fill:"currentColor"})})})]}),document.body)]})}export{Ke as Avatar,Ue as Badge,ae as Button,Sn as Collapsible,Ye as CollapsibleContent,Ie as CollapsibleRoot,Je as CollapsibleTrigger,On as ConfirmProvider,$ as Dialog,ut as Drawer,lo as DropdownMenu,dt as Field,mt as IconButton,gt as Input,bt as Panel,wo as PanelBody,xo as PanelFooter,vo as PanelHeader,xt as SegmentedControl,Pt as Select,Ct as Skeleton,be as Spinner,Rt as StatusNotice,Et as Switch,Ao as Tabs,_t as TabsContent,Ht as TabsList,Be as TabsRoot,At as TabsTrigger,Bt as Textarea,Xo as ToastProvider,Xt as Tooltip,We as buttonClassName,Bn as useConfirm,Uo as useToast};
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
|
|
2
|
+
:root, :host {
|
|
3
|
+
--owo-ref-shadow-raised: 0 10px 20px rgba(15, 23, 42, 0.08);
|
|
4
|
+
--owo-ref-shadow-popover: 0 18px 40px rgba(15, 23, 42, 0.10);
|
|
5
|
+
--owo-ref-font-heading: var(--font-source-serif-pro), var(--font-noto-serif-sc), "Source Serif 4", Georgia, "Times New Roman", serif;
|
|
6
|
+
--owo-ref-radius-sm: 0.5rem;
|
|
7
|
+
--owo-ref-radius-md: 0.75rem;
|
|
8
|
+
--owo-ref-radius-lg: 1rem;
|
|
9
|
+
--owo-ref-radius-xl: 1.5rem;
|
|
10
|
+
--owo-ref-radius-2xl: 2rem;
|
|
11
|
+
--owo-ref-radius-full: 9999px;
|
|
12
|
+
--owo-ref-motion-ease-standard: cubic-bezier(0.2, 0, 0, 1);
|
|
13
|
+
--owo-ref-motion-ease-decelerate: cubic-bezier(0, 0, 0, 1);
|
|
14
|
+
--owo-ref-motion-ease-accelerate: cubic-bezier(0.4, 0, 1, 1);
|
|
15
|
+
}
|
|
16
|
+
:root {
|
|
17
|
+
--owo-sys-preset-surface-bg: var(--owo-sys-theme-surface-base);
|
|
18
|
+
--owo-sys-preset-surface-bg-subtle: var(--owo-sys-theme-surface-subtle);
|
|
19
|
+
--owo-sys-preset-surface-bg-raised: var(--owo-sys-theme-surface-raised);
|
|
20
|
+
--owo-sys-preset-surface-bg-inset: var(--owo-sys-theme-surface-inset);
|
|
21
|
+
--owo-sys-preset-surface-border: var(--owo-sys-theme-surface-border);
|
|
22
|
+
--owo-sys-preset-surface-border-muted: var(--owo-sys-theme-surface-border-muted);
|
|
23
|
+
--owo-sys-preset-surface-border-strong: var(--owo-sys-theme-surface-border-strong);
|
|
24
|
+
--owo-sys-preset-surface-shadow: var(--owo-ref-shadow-raised);
|
|
25
|
+
--owo-sys-preset-surface-shadow-strong: var(--owo-ref-shadow-popover);
|
|
26
|
+
--owo-sys-preset-surface-blur: 0px;
|
|
27
|
+
--owo-sys-preset-canvas-bg: var(--owo-sys-theme-surface-canvas);
|
|
28
|
+
--owo-sys-preset-canvas-bg-subtle: var(--owo-sys-theme-canvas-bg-subtle);
|
|
29
|
+
--owo-sys-preset-surface-container: var(--owo-sys-theme-surface-container);
|
|
30
|
+
--owo-sys-preset-surface-container-high: var(--owo-sys-theme-surface-container-high);
|
|
31
|
+
--owo-sys-preset-surface-container-highest: var(--owo-sys-theme-surface-container-highest);
|
|
32
|
+
--owo-sys-preset-control-radius-sm: var(--owo-ref-radius-sm);
|
|
33
|
+
--owo-sys-preset-control-radius-md: var(--owo-ref-radius-md);
|
|
34
|
+
--owo-sys-preset-control-radius-lg: var(--owo-ref-radius-lg);
|
|
35
|
+
--owo-sys-preset-control-radius-xl: var(--owo-ref-radius-xl);
|
|
36
|
+
--owo-sys-preset-control-radius-2xl: var(--owo-ref-radius-2xl);
|
|
37
|
+
--owo-sys-preset-control-radius-full: var(--owo-ref-radius-full);
|
|
38
|
+
--owo-sys-preset-control-border-width: 1px;
|
|
39
|
+
--owo-cmp-surface-bg: var(--owo-sys-preset-surface-bg);
|
|
40
|
+
--owo-cmp-surface-bg-subtle: var(--owo-sys-preset-surface-bg-subtle);
|
|
41
|
+
--owo-cmp-surface-bg-raised: var(--owo-sys-preset-surface-bg-raised);
|
|
42
|
+
--owo-cmp-surface-bg-inset: var(--owo-sys-preset-surface-bg-inset);
|
|
43
|
+
--owo-cmp-surface-border: var(--owo-sys-preset-surface-border);
|
|
44
|
+
--owo-cmp-surface-border-muted: var(--owo-sys-preset-surface-border-muted);
|
|
45
|
+
--owo-cmp-surface-border-strong: var(--owo-sys-preset-surface-border-strong);
|
|
46
|
+
--owo-cmp-surface-shadow: var(--owo-sys-preset-surface-shadow);
|
|
47
|
+
--owo-cmp-surface-shadow-strong: var(--owo-sys-preset-surface-shadow-strong);
|
|
48
|
+
--owo-cmp-surface-blur: var(--owo-sys-preset-surface-blur);
|
|
49
|
+
--owo-cmp-canvas-bg: var(--owo-sys-preset-canvas-bg);
|
|
50
|
+
--owo-cmp-canvas-bg-subtle: var(--owo-sys-preset-canvas-bg-subtle);
|
|
51
|
+
--owo-cmp-surface-container: var(--owo-sys-preset-surface-container);
|
|
52
|
+
--owo-cmp-surface-container-high: var(--owo-sys-preset-surface-container-high);
|
|
53
|
+
--owo-cmp-surface-container-highest: var(--owo-sys-preset-surface-container-highest);
|
|
54
|
+
--owo-cmp-text-primary: var(--owo-sys-theme-text-primary);
|
|
55
|
+
--owo-cmp-text-secondary: var(--owo-sys-theme-text-secondary);
|
|
56
|
+
--owo-cmp-text-muted: var(--owo-sys-theme-text-muted);
|
|
57
|
+
--owo-cmp-text-on-accent: var(--owo-sys-theme-text-on-accent);
|
|
58
|
+
--owo-cmp-accent-bg: var(--owo-sys-theme-accent-bg);
|
|
59
|
+
--owo-cmp-accent-bg-hover: var(--owo-sys-theme-accent-bg-hover);
|
|
60
|
+
--owo-cmp-accent-bg-muted: var(--owo-sys-theme-accent-bg-muted);
|
|
61
|
+
--owo-cmp-accent-text: var(--owo-sys-theme-text-on-accent);
|
|
62
|
+
--owo-cmp-accent-border: var(--owo-sys-theme-accent-border);
|
|
63
|
+
--owo-cmp-success-bg: var(--owo-sys-theme-success-bg);
|
|
64
|
+
--owo-cmp-success-border: var(--owo-sys-theme-success-border);
|
|
65
|
+
--owo-cmp-success-text: var(--owo-sys-theme-success-text);
|
|
66
|
+
--owo-cmp-warning-bg: var(--owo-sys-theme-warning-bg);
|
|
67
|
+
--owo-cmp-warning-border: var(--owo-sys-theme-warning-border);
|
|
68
|
+
--owo-cmp-warning-text: var(--owo-sys-theme-warning-text);
|
|
69
|
+
--owo-cmp-danger-bg: var(--owo-sys-theme-danger-bg);
|
|
70
|
+
--owo-cmp-danger-bg-emphasis: var(--owo-sys-theme-danger-bg-emphasis);
|
|
71
|
+
--owo-cmp-danger-border: var(--owo-sys-theme-danger-border);
|
|
72
|
+
--owo-cmp-danger-text: var(--owo-sys-theme-danger-text);
|
|
73
|
+
--owo-cmp-info-bg: var(--owo-sys-theme-info-bg);
|
|
74
|
+
--owo-cmp-info-border: var(--owo-sys-theme-info-border);
|
|
75
|
+
--owo-cmp-info-text: var(--owo-sys-theme-info-text);
|
|
76
|
+
--owo-cmp-control-radius-sm: var(--owo-sys-preset-control-radius-sm);
|
|
77
|
+
--owo-cmp-control-radius-md: var(--owo-sys-preset-control-radius-md);
|
|
78
|
+
--owo-cmp-control-radius-lg: var(--owo-sys-preset-control-radius-lg);
|
|
79
|
+
--owo-cmp-control-radius-xl: var(--owo-sys-preset-control-radius-xl);
|
|
80
|
+
--owo-cmp-control-radius-2xl: var(--owo-sys-preset-control-radius-2xl);
|
|
81
|
+
--owo-cmp-control-radius-full: var(--owo-sys-preset-control-radius-full);
|
|
82
|
+
--owo-cmp-control-border-width: var(--owo-sys-preset-control-border-width);
|
|
83
|
+
--owo-cmp-control-focus-ring: var(--owo-sys-theme-control-focus-ring);
|
|
84
|
+
--owo-cmp-control-focus-ring-offset: var(--owo-sys-theme-control-focus-ring-offset);
|
|
85
|
+
--owo-cmp-font-heading: var(--owo-ref-font-heading);
|
|
86
|
+
--owo-cmp-motion-duration-fast: 0.15s;
|
|
87
|
+
--owo-cmp-motion-duration-default: 0.2s;
|
|
88
|
+
--owo-cmp-motion-ease-standard: var(--owo-ref-motion-ease-standard);
|
|
89
|
+
--owo-cmp-motion-ease-decelerate: var(--owo-ref-motion-ease-decelerate);
|
|
90
|
+
--owo-cmp-motion-ease-accelerate: var(--owo-ref-motion-ease-accelerate);
|
|
91
|
+
--owo-cmp-density-compact: 0.875;
|
|
92
|
+
--owo-cmp-density-default: 1;
|
|
93
|
+
--owo-cmp-density-comfortable: 1.125;
|
|
94
|
+
--owo-cmp-overlay-bg: var(--owo-sys-theme-overlay-bg);
|
|
95
|
+
--owo-cmp-z-dropdown: 1000;
|
|
96
|
+
--owo-cmp-z-modal: 1100;
|
|
97
|
+
--owo-cmp-z-toast: 1200;
|
|
98
|
+
--owo-feedback-neutral-bg: var(--owo-cmp-surface-bg-raised);
|
|
99
|
+
--owo-feedback-neutral-border: var(--owo-cmp-surface-border);
|
|
100
|
+
--owo-feedback-neutral-text: var(--owo-cmp-text-primary);
|
|
101
|
+
--owo-feedback-neutral-icon: var(--owo-cmp-text-secondary);
|
|
102
|
+
--owo-feedback-info-bg: var(--owo-cmp-info-bg);
|
|
103
|
+
--owo-feedback-info-border: var(--owo-cmp-info-border);
|
|
104
|
+
--owo-feedback-info-text: var(--owo-cmp-info-text);
|
|
105
|
+
--owo-feedback-info-icon: var(--owo-cmp-info-text);
|
|
106
|
+
--owo-feedback-success-bg: var(--owo-cmp-success-bg);
|
|
107
|
+
--owo-feedback-success-border: var(--owo-cmp-success-border);
|
|
108
|
+
--owo-feedback-success-text: var(--owo-cmp-success-text);
|
|
109
|
+
--owo-feedback-success-icon: var(--owo-cmp-success-text);
|
|
110
|
+
--owo-feedback-warning-bg: var(--owo-cmp-warning-bg);
|
|
111
|
+
--owo-feedback-warning-border: var(--owo-cmp-warning-border);
|
|
112
|
+
--owo-feedback-warning-text: var(--owo-cmp-warning-text);
|
|
113
|
+
--owo-feedback-warning-icon: var(--owo-cmp-warning-text);
|
|
114
|
+
--owo-feedback-danger-bg: var(--owo-cmp-danger-bg);
|
|
115
|
+
--owo-feedback-danger-border: var(--owo-cmp-danger-border);
|
|
116
|
+
--owo-feedback-danger-text: var(--owo-cmp-danger-text);
|
|
117
|
+
--owo-feedback-danger-icon: var(--owo-cmp-danger-text);
|
|
118
|
+
}
|
|
119
|
+
:root[data-preset="default"],
|
|
120
|
+
.owoui-preset-default {
|
|
121
|
+
--owo-sys-preset-surface-bg: var(--owo-sys-theme-surface-base);
|
|
122
|
+
--owo-sys-preset-surface-bg-subtle: var(--owo-sys-theme-surface-subtle);
|
|
123
|
+
--owo-sys-preset-surface-bg-raised: var(--owo-sys-theme-surface-raised);
|
|
124
|
+
--owo-sys-preset-surface-bg-inset: var(--owo-sys-theme-surface-inset);
|
|
125
|
+
--owo-sys-preset-surface-border: var(--owo-sys-theme-surface-border);
|
|
126
|
+
--owo-sys-preset-surface-border-muted: var(--owo-sys-theme-surface-border-muted);
|
|
127
|
+
--owo-sys-preset-surface-border-strong: var(--owo-sys-theme-surface-border-strong);
|
|
128
|
+
--owo-sys-preset-surface-shadow: var(--owo-ref-shadow-raised);
|
|
129
|
+
--owo-sys-preset-surface-shadow-strong: var(--owo-ref-shadow-popover);
|
|
130
|
+
--owo-sys-preset-surface-blur: 0px;
|
|
131
|
+
--owo-sys-preset-canvas-bg: var(--owo-sys-theme-surface-canvas);
|
|
132
|
+
--owo-sys-preset-canvas-bg-subtle: var(--owo-sys-theme-canvas-bg-subtle);
|
|
133
|
+
--owo-sys-preset-surface-container: var(--owo-sys-theme-surface-container);
|
|
134
|
+
--owo-sys-preset-surface-container-high: var(--owo-sys-theme-surface-container-high);
|
|
135
|
+
--owo-sys-preset-surface-container-highest: var(--owo-sys-theme-surface-container-highest);
|
|
136
|
+
--owo-sys-preset-control-radius-sm: var(--owo-ref-radius-sm);
|
|
137
|
+
--owo-sys-preset-control-radius-md: var(--owo-ref-radius-md);
|
|
138
|
+
--owo-sys-preset-control-radius-lg: var(--owo-ref-radius-lg);
|
|
139
|
+
--owo-sys-preset-control-radius-xl: var(--owo-ref-radius-xl);
|
|
140
|
+
--owo-sys-preset-control-radius-2xl: var(--owo-ref-radius-2xl);
|
|
141
|
+
--owo-sys-preset-control-radius-full: var(--owo-ref-radius-full);
|
|
142
|
+
--owo-sys-preset-control-border-width: 1px;
|
|
143
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
|
|
2
|
+
:root, :host {
|
|
3
|
+
--owo-ref-shadow-raised: 0 10px 20px rgba(15, 23, 42, 0.08);
|
|
4
|
+
--owo-ref-shadow-popover: 0 18px 40px rgba(15, 23, 42, 0.10);
|
|
5
|
+
--owo-ref-font-heading: var(--font-source-serif-pro), var(--font-noto-serif-sc), "Source Serif 4", Georgia, "Times New Roman", serif;
|
|
6
|
+
--owo-ref-radius-sm: 0.5rem;
|
|
7
|
+
--owo-ref-radius-md: 0.75rem;
|
|
8
|
+
--owo-ref-radius-lg: 1rem;
|
|
9
|
+
--owo-ref-radius-xl: 1.5rem;
|
|
10
|
+
--owo-ref-radius-2xl: 2rem;
|
|
11
|
+
--owo-ref-radius-full: 9999px;
|
|
12
|
+
--owo-ref-motion-ease-standard: cubic-bezier(0.2, 0, 0, 1);
|
|
13
|
+
--owo-ref-motion-ease-decelerate: cubic-bezier(0, 0, 0, 1);
|
|
14
|
+
--owo-ref-motion-ease-accelerate: cubic-bezier(0.4, 0, 1, 1);
|
|
15
|
+
}
|
|
16
|
+
:root {
|
|
17
|
+
--owo-sys-preset-surface-bg: var(--owo-sys-theme-surface-base);
|
|
18
|
+
--owo-sys-preset-surface-bg-subtle: var(--owo-sys-theme-surface-subtle);
|
|
19
|
+
--owo-sys-preset-surface-bg-raised: var(--owo-sys-theme-surface-raised);
|
|
20
|
+
--owo-sys-preset-surface-bg-inset: var(--owo-sys-theme-surface-inset);
|
|
21
|
+
--owo-sys-preset-surface-border: var(--owo-sys-theme-surface-border);
|
|
22
|
+
--owo-sys-preset-surface-border-muted: var(--owo-sys-theme-surface-border-muted);
|
|
23
|
+
--owo-sys-preset-surface-border-strong: var(--owo-sys-theme-surface-border-strong);
|
|
24
|
+
--owo-sys-preset-surface-shadow: var(--owo-ref-shadow-raised);
|
|
25
|
+
--owo-sys-preset-surface-shadow-strong: var(--owo-ref-shadow-popover);
|
|
26
|
+
--owo-sys-preset-surface-blur: 0px;
|
|
27
|
+
--owo-sys-preset-canvas-bg: var(--owo-sys-theme-surface-canvas);
|
|
28
|
+
--owo-sys-preset-canvas-bg-subtle: var(--owo-sys-theme-canvas-bg-subtle);
|
|
29
|
+
--owo-sys-preset-surface-container: var(--owo-sys-theme-surface-container);
|
|
30
|
+
--owo-sys-preset-surface-container-high: var(--owo-sys-theme-surface-container-high);
|
|
31
|
+
--owo-sys-preset-surface-container-highest: var(--owo-sys-theme-surface-container-highest);
|
|
32
|
+
--owo-sys-preset-control-radius-sm: var(--owo-ref-radius-sm);
|
|
33
|
+
--owo-sys-preset-control-radius-md: var(--owo-ref-radius-md);
|
|
34
|
+
--owo-sys-preset-control-radius-lg: var(--owo-ref-radius-lg);
|
|
35
|
+
--owo-sys-preset-control-radius-xl: var(--owo-ref-radius-xl);
|
|
36
|
+
--owo-sys-preset-control-radius-2xl: var(--owo-ref-radius-2xl);
|
|
37
|
+
--owo-sys-preset-control-radius-full: var(--owo-ref-radius-full);
|
|
38
|
+
--owo-sys-preset-control-border-width: 1px;
|
|
39
|
+
--owo-cmp-surface-bg: var(--owo-sys-preset-surface-bg);
|
|
40
|
+
--owo-cmp-surface-bg-subtle: var(--owo-sys-preset-surface-bg-subtle);
|
|
41
|
+
--owo-cmp-surface-bg-raised: var(--owo-sys-preset-surface-bg-raised);
|
|
42
|
+
--owo-cmp-surface-bg-inset: var(--owo-sys-preset-surface-bg-inset);
|
|
43
|
+
--owo-cmp-surface-border: var(--owo-sys-preset-surface-border);
|
|
44
|
+
--owo-cmp-surface-border-muted: var(--owo-sys-preset-surface-border-muted);
|
|
45
|
+
--owo-cmp-surface-border-strong: var(--owo-sys-preset-surface-border-strong);
|
|
46
|
+
--owo-cmp-surface-shadow: var(--owo-sys-preset-surface-shadow);
|
|
47
|
+
--owo-cmp-surface-shadow-strong: var(--owo-sys-preset-surface-shadow-strong);
|
|
48
|
+
--owo-cmp-surface-blur: var(--owo-sys-preset-surface-blur);
|
|
49
|
+
--owo-cmp-canvas-bg: var(--owo-sys-preset-canvas-bg);
|
|
50
|
+
--owo-cmp-canvas-bg-subtle: var(--owo-sys-preset-canvas-bg-subtle);
|
|
51
|
+
--owo-cmp-surface-container: var(--owo-sys-preset-surface-container);
|
|
52
|
+
--owo-cmp-surface-container-high: var(--owo-sys-preset-surface-container-high);
|
|
53
|
+
--owo-cmp-surface-container-highest: var(--owo-sys-preset-surface-container-highest);
|
|
54
|
+
--owo-cmp-text-primary: var(--owo-sys-theme-text-primary);
|
|
55
|
+
--owo-cmp-text-secondary: var(--owo-sys-theme-text-secondary);
|
|
56
|
+
--owo-cmp-text-muted: var(--owo-sys-theme-text-muted);
|
|
57
|
+
--owo-cmp-text-on-accent: var(--owo-sys-theme-text-on-accent);
|
|
58
|
+
--owo-cmp-accent-bg: var(--owo-sys-theme-accent-bg);
|
|
59
|
+
--owo-cmp-accent-bg-hover: var(--owo-sys-theme-accent-bg-hover);
|
|
60
|
+
--owo-cmp-accent-bg-muted: var(--owo-sys-theme-accent-bg-muted);
|
|
61
|
+
--owo-cmp-accent-text: var(--owo-sys-theme-text-on-accent);
|
|
62
|
+
--owo-cmp-accent-border: var(--owo-sys-theme-accent-border);
|
|
63
|
+
--owo-cmp-success-bg: var(--owo-sys-theme-success-bg);
|
|
64
|
+
--owo-cmp-success-border: var(--owo-sys-theme-success-border);
|
|
65
|
+
--owo-cmp-success-text: var(--owo-sys-theme-success-text);
|
|
66
|
+
--owo-cmp-warning-bg: var(--owo-sys-theme-warning-bg);
|
|
67
|
+
--owo-cmp-warning-border: var(--owo-sys-theme-warning-border);
|
|
68
|
+
--owo-cmp-warning-text: var(--owo-sys-theme-warning-text);
|
|
69
|
+
--owo-cmp-danger-bg: var(--owo-sys-theme-danger-bg);
|
|
70
|
+
--owo-cmp-danger-bg-emphasis: var(--owo-sys-theme-danger-bg-emphasis);
|
|
71
|
+
--owo-cmp-danger-border: var(--owo-sys-theme-danger-border);
|
|
72
|
+
--owo-cmp-danger-text: var(--owo-sys-theme-danger-text);
|
|
73
|
+
--owo-cmp-info-bg: var(--owo-sys-theme-info-bg);
|
|
74
|
+
--owo-cmp-info-border: var(--owo-sys-theme-info-border);
|
|
75
|
+
--owo-cmp-info-text: var(--owo-sys-theme-info-text);
|
|
76
|
+
--owo-cmp-control-radius-sm: var(--owo-sys-preset-control-radius-sm);
|
|
77
|
+
--owo-cmp-control-radius-md: var(--owo-sys-preset-control-radius-md);
|
|
78
|
+
--owo-cmp-control-radius-lg: var(--owo-sys-preset-control-radius-lg);
|
|
79
|
+
--owo-cmp-control-radius-xl: var(--owo-sys-preset-control-radius-xl);
|
|
80
|
+
--owo-cmp-control-radius-2xl: var(--owo-sys-preset-control-radius-2xl);
|
|
81
|
+
--owo-cmp-control-radius-full: var(--owo-sys-preset-control-radius-full);
|
|
82
|
+
--owo-cmp-control-border-width: var(--owo-sys-preset-control-border-width);
|
|
83
|
+
--owo-cmp-control-focus-ring: var(--owo-sys-theme-control-focus-ring);
|
|
84
|
+
--owo-cmp-control-focus-ring-offset: var(--owo-sys-theme-control-focus-ring-offset);
|
|
85
|
+
--owo-cmp-font-heading: var(--owo-ref-font-heading);
|
|
86
|
+
--owo-cmp-motion-duration-fast: 0.15s;
|
|
87
|
+
--owo-cmp-motion-duration-default: 0.2s;
|
|
88
|
+
--owo-cmp-motion-ease-standard: var(--owo-ref-motion-ease-standard);
|
|
89
|
+
--owo-cmp-motion-ease-decelerate: var(--owo-ref-motion-ease-decelerate);
|
|
90
|
+
--owo-cmp-motion-ease-accelerate: var(--owo-ref-motion-ease-accelerate);
|
|
91
|
+
--owo-cmp-density-compact: 0.875;
|
|
92
|
+
--owo-cmp-density-default: 1;
|
|
93
|
+
--owo-cmp-density-comfortable: 1.125;
|
|
94
|
+
--owo-cmp-overlay-bg: var(--owo-sys-theme-overlay-bg);
|
|
95
|
+
--owo-cmp-z-dropdown: 1000;
|
|
96
|
+
--owo-cmp-z-modal: 1100;
|
|
97
|
+
--owo-cmp-z-toast: 1200;
|
|
98
|
+
--owo-feedback-neutral-bg: var(--owo-cmp-surface-bg-raised);
|
|
99
|
+
--owo-feedback-neutral-border: var(--owo-cmp-surface-border);
|
|
100
|
+
--owo-feedback-neutral-text: var(--owo-cmp-text-primary);
|
|
101
|
+
--owo-feedback-neutral-icon: var(--owo-cmp-text-secondary);
|
|
102
|
+
--owo-feedback-info-bg: var(--owo-cmp-info-bg);
|
|
103
|
+
--owo-feedback-info-border: var(--owo-cmp-info-border);
|
|
104
|
+
--owo-feedback-info-text: var(--owo-cmp-info-text);
|
|
105
|
+
--owo-feedback-info-icon: var(--owo-cmp-info-text);
|
|
106
|
+
--owo-feedback-success-bg: var(--owo-cmp-success-bg);
|
|
107
|
+
--owo-feedback-success-border: var(--owo-cmp-success-border);
|
|
108
|
+
--owo-feedback-success-text: var(--owo-cmp-success-text);
|
|
109
|
+
--owo-feedback-success-icon: var(--owo-cmp-success-text);
|
|
110
|
+
--owo-feedback-warning-bg: var(--owo-cmp-warning-bg);
|
|
111
|
+
--owo-feedback-warning-border: var(--owo-cmp-warning-border);
|
|
112
|
+
--owo-feedback-warning-text: var(--owo-cmp-warning-text);
|
|
113
|
+
--owo-feedback-warning-icon: var(--owo-cmp-warning-text);
|
|
114
|
+
--owo-feedback-danger-bg: var(--owo-cmp-danger-bg);
|
|
115
|
+
--owo-feedback-danger-border: var(--owo-cmp-danger-border);
|
|
116
|
+
--owo-feedback-danger-text: var(--owo-cmp-danger-text);
|
|
117
|
+
--owo-feedback-danger-icon: var(--owo-cmp-danger-text);
|
|
118
|
+
}
|
|
119
|
+
:root[data-preset="elevated"],
|
|
120
|
+
.owoui-preset-elevated {
|
|
121
|
+
--owo-sys-preset-surface-bg: var(--owo-sys-theme-surface-base);
|
|
122
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
123
|
+
--owo-sys-preset-surface-bg: color-mix(in srgb, var(--owo-sys-theme-surface-base) 96%, var(--owo-sys-theme-surface-border-strong));
|
|
124
|
+
}
|
|
125
|
+
--owo-sys-preset-surface-bg-subtle: var(--owo-sys-theme-surface-subtle);
|
|
126
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
127
|
+
--owo-sys-preset-surface-bg-subtle: color-mix(in srgb, var(--owo-sys-theme-surface-subtle) 96%, var(--owo-sys-theme-surface-border-strong));
|
|
128
|
+
}
|
|
129
|
+
--owo-sys-preset-surface-bg-raised: var(--owo-sys-theme-surface-raised);
|
|
130
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
131
|
+
--owo-sys-preset-surface-bg-raised: color-mix(in srgb, var(--owo-sys-theme-surface-raised) 94%, var(--owo-sys-theme-surface-border-strong));
|
|
132
|
+
}
|
|
133
|
+
--owo-sys-preset-surface-bg-inset: var(--owo-sys-theme-surface-inset);
|
|
134
|
+
--owo-sys-preset-surface-border: var(--owo-sys-theme-surface-border);
|
|
135
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
136
|
+
--owo-sys-preset-surface-border: color-mix(in srgb, var(--owo-sys-theme-surface-border) 88%, var(--owo-sys-theme-surface-border-strong));
|
|
137
|
+
}
|
|
138
|
+
--owo-sys-preset-surface-border-muted: var(--owo-sys-theme-surface-border-muted);
|
|
139
|
+
--owo-sys-preset-surface-border-strong: var(--owo-sys-theme-surface-border-strong);
|
|
140
|
+
--owo-sys-preset-surface-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
|
|
141
|
+
--owo-sys-preset-surface-shadow-strong: 0 28px 60px rgba(15, 23, 42, 0.18);
|
|
142
|
+
--owo-sys-preset-surface-blur: 0px;
|
|
143
|
+
--owo-sys-preset-canvas-bg: var(--owo-sys-theme-surface-canvas);
|
|
144
|
+
--owo-sys-preset-canvas-bg-subtle: var(--owo-sys-theme-canvas-bg-subtle);
|
|
145
|
+
--owo-sys-preset-surface-container: var(--owo-sys-theme-surface-container);
|
|
146
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
147
|
+
--owo-sys-preset-surface-container: color-mix(in srgb, var(--owo-sys-theme-surface-container) 94%, var(--owo-sys-theme-surface-border-strong));
|
|
148
|
+
}
|
|
149
|
+
--owo-sys-preset-surface-container-high: var(--owo-sys-theme-surface-container-high);
|
|
150
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
151
|
+
--owo-sys-preset-surface-container-high: color-mix(in srgb, var(--owo-sys-theme-surface-container-high) 94%, var(--owo-sys-theme-surface-border-strong));
|
|
152
|
+
}
|
|
153
|
+
--owo-sys-preset-surface-container-highest: var(--owo-sys-theme-surface-container-highest);
|
|
154
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
155
|
+
--owo-sys-preset-surface-container-highest: color-mix(in srgb, var(--owo-sys-theme-surface-container-highest) 92%, var(--owo-sys-theme-surface-border-strong));
|
|
156
|
+
}
|
|
157
|
+
--owo-sys-preset-control-radius-sm: calc(var(--owo-ref-radius-sm) + 0.125rem);
|
|
158
|
+
--owo-sys-preset-control-radius-md: calc(var(--owo-ref-radius-md) + 0.125rem);
|
|
159
|
+
--owo-sys-preset-control-radius-lg: calc(var(--owo-ref-radius-lg) + 0.125rem);
|
|
160
|
+
--owo-sys-preset-control-radius-xl: calc(var(--owo-ref-radius-xl) + 0.125rem);
|
|
161
|
+
--owo-sys-preset-control-radius-2xl: calc(var(--owo-ref-radius-2xl) + 0.125rem);
|
|
162
|
+
--owo-sys-preset-control-radius-full: var(--owo-ref-radius-full);
|
|
163
|
+
--owo-sys-preset-control-border-width: 1px;
|
|
164
|
+
}
|