tintora 0.25.0 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,18 @@
1
+ import { type ButtonHTMLAttributes, type ReactNode } from 'react';
2
+ import { type DrawerProps } from '../Drawer/Drawer';
3
+ import './BottomSheet.css';
4
+ export interface BottomSheetProps extends Omit<DrawerProps, 'from' | 'width' | 'height' | 'title'> {
5
+ /** Names the dialog and shows as its heading. */
6
+ title: ReactNode;
7
+ }
8
+ /**
9
+ * A Drawer that slides up from the bottom: the mobile version of a popover or
10
+ * menu. A scrim click or Esc closes it. Put `BottomSheetOption`s in it.
11
+ */
12
+ export declare function BottomSheet({ title, children, className, ...props }: BottomSheetProps): import("react").JSX.Element;
13
+ export interface BottomSheetOptionProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'aria-pressed'> {
14
+ /** Tints the row and shows a check. @default false */
15
+ selected?: boolean;
16
+ }
17
+ /** A 48px row for a choice in a `BottomSheet`. */
18
+ export declare function BottomSheetOption({ selected, className, children, ...props }: BottomSheetOptionProps): import("react").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import type { HTMLAttributes, ReactNode } from 'react';
2
+ import './SettingsRow.css';
3
+ export interface SettingsRowProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
4
+ /** The setting's name. */
5
+ title: ReactNode;
6
+ /** A line under the title, e.g. the current value. */
7
+ description?: ReactNode;
8
+ /** The control: a `Switch`, a `RadioGroup`, a `Select`. */
9
+ children?: ReactNode;
10
+ /**
11
+ * `end` pushes the control to the right edge; `start` puts it right after
12
+ * the title, for a group of options. @default 'end'
13
+ */
14
+ controlPosition?: 'end' | 'start';
15
+ }
16
+ /**
17
+ * A row for one setting. It is layout only: the control inside still needs its
18
+ * own accessible name (e.g. `aria-label` on a `Switch`).
19
+ */
20
+ export declare function SettingsRow({ title, description, children, controlPosition, className, ...props }: SettingsRowProps): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { ButtonHTMLAttributes } from 'react';
2
+ export interface TabProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type' | 'value' | 'role'> {
3
+ /** Identifies the tab; matched against the `Tabs` value. */
4
+ value: string;
5
+ }
6
+ export declare function Tab({ value, className, onClick, children, ...props }: TabProps): import("react").JSX.Element;
@@ -0,0 +1,31 @@
1
+ import { type HTMLAttributes, type ReactNode } from 'react';
2
+ import './Tabs.css';
3
+ interface TabsBaseProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'defaultValue' | 'onChange'> {
4
+ /** Names the tab list for assistive tech, e.g. "Range". Required. */
5
+ 'aria-label': string;
6
+ /** `segmented` is a pill on a tray, `underline` a bar under the row. @default 'segmented' */
7
+ variant?: 'segmented' | 'underline';
8
+ /** `Tab`s. One must match the selected value. */
9
+ children: ReactNode;
10
+ }
11
+ /** The parent owns the value: it passes `value` and updates it in `onValueChange`. */
12
+ interface ControlledProps<T extends string> {
13
+ value: T;
14
+ onValueChange: (value: T) => void;
15
+ defaultValue?: never;
16
+ }
17
+ /** Tabs owns the value, starting from `defaultValue`. */
18
+ interface UncontrolledProps<T extends string> {
19
+ value?: never;
20
+ defaultValue: T;
21
+ onValueChange?: (value: T) => void;
22
+ }
23
+ /** Exactly one of controlled (`value`) or uncontrolled (`defaultValue`). */
24
+ export type TabsProps<T extends string = string> = TabsBaseProps & (ControlledProps<T> | UncontrolledProps<T>);
25
+ /**
26
+ * A row of tabs. One is tabbable at a time; the arrow keys, Home and End move
27
+ * focus and select, skipping disabled tabs. Rendering the panel is up to the
28
+ * parent, from the same value.
29
+ */
30
+ export declare function Tabs<T extends string>({ value, defaultValue, onValueChange, variant, className, children, onKeyDown, ...props }: TabsProps<T>): import("react").JSX.Element;
31
+ export {};
@@ -0,0 +1,8 @@
1
+ interface TabsContextValue {
2
+ /** The selected tab's value. */
3
+ value: string;
4
+ select: (value: string) => void;
5
+ }
6
+ export declare const TabsContext: import("react").Context<TabsContextValue | null>;
7
+ export declare function useTabsContext(): TabsContextValue;
8
+ export {};
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react/jsx-runtime"),t=require("react");function n(e){var t,r,i=``;if(typeof e==`string`||typeof e==`number`)i+=e;else if(typeof e==`object`){if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=n(e[t]))&&(i&&(i+=` `),i+=r)}else for(r in e)e[r]&&(i&&(i+=` `),i+=r)}return i}function r(){for(var e,t,r=0,i=``,a=arguments.length;r<a;r++)(e=arguments[r])&&(t=n(e))&&(i&&(i+=` `),i+=t);return i}var i={info:(0,e.jsx)(`path`,{d:`M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20zM12 16v-4M12 8h.01`}),success:(0,e.jsx)(`path`,{d:`M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20zM8 12.5l2.7 2.7L16 9.8`}),warning:(0,e.jsx)(`path`,{d:`M10.3 3.9L1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0zM12 9v4M12 17h.01`}),error:(0,e.jsx)(`path`,{d:`M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20zM15 9l-6 6M9 9l6 6`})},a=({status:t})=>(0,e.jsx)(`svg`,{width:`22`,height:`22`,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--tintora-status-${t}-fg)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{flex:`0 0 auto`,marginTop:1},children:i[t]});function o({status:t=`info`,variant:n=`alert`,title:i,children:o,action:s,onDismiss:c,className:l,...u}){return(0,e.jsxs)(`div`,{...u,role:n===`alert`&&t===`error`?`alert`:`status`,className:r(`tintora-alert`,n===`announcement`?`tintora-alert--announcement`:`tintora-alert--${t}`,l),children:[n===`alert`&&(0,e.jsx)(a,{status:t}),(0,e.jsxs)(`div`,{className:r(`tintora-alert__content`,n===`announcement`&&`tintora-alert__content--announcement`),children:[i&&(0,e.jsx)(`span`,{className:`tintora-alert__content__title`,children:i}),o&&(0,e.jsx)(`span`,{className:`tintora-alert__content__sub-title`,children:o}),s&&(0,e.jsx)(`button`,{type:`button`,onClick:s.onClick,className:r(`tintora-alert__content__action`,n===`alert`&&`tintora-alert__content__action--${t}`),children:s.label})]}),n===`alert`&&c&&(0,e.jsx)(`button`,{type:`button`,"aria-label":`Dismiss`,className:`tintora-alert__close`,onClick:c,children:(0,e.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,e.jsx)(`path`,{d:`M18 6L6 18M6 6l12 12`})})})]})}function s(e){if(!e.length)return``;let t=e.trim().split(/\s+/).map(e=>e.match(/\p{L}\p{M}*/u)?.[0]).filter(e=>!!e);return`${t[0]??``}${t.length>1?t.at(-1)??``:``}`.toLocaleUpperCase()}function c({name:n,src:i,size:a=`medium`,className:o,...c}){let[l,u]=(0,t.useState)(),d=!!i&&i!==l;return(0,e.jsx)(`span`,{role:`img`,"aria-label":n,...c,className:r(`tintora-avatar`,`tintora-avatar--${a}`,o),children:d?(0,e.jsx)(`img`,{src:i,alt:``,onError:()=>u(i)}):s(n)})}var l={small:{width:16,height:16,strokeWidth:3.5},medium:{width:24,height:24,strokeWidth:3},large:{width:40,height:40,strokeWidth:2.4}};function u({size:t=`medium`,color:n=`accent`}){let{width:r,height:i,strokeWidth:a}=l[t];return(0,e.jsxs)(`svg`,{className:`tintora-spinner`,width:r,height:i,viewBox:`0 0 24 24`,fill:`none`,role:`img`,"aria-label":`Loading`,children:[(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,stroke:`currentColor`,strokeOpacity:n===`accent`?.25:.35,strokeWidth:a}),(0,e.jsx)(`path`,{d:`M21 12a9 9 0 0 0-9-9`,stroke:n===`accent`?`var(--tintora-control-fill)`:`currentColor`,strokeWidth:a,strokeLinecap:`round`})]})}function d({children:t,className:n,variant:i,size:a=`medium`,leadingIcon:o,trailingIcon:s,type:c=`button`,loading:l=!1,disabled:d,...f}){return(0,e.jsxs)(`button`,{type:c,className:r(`tintora-button`,`tintora-button--${i}`,`tintora-button--${a}`,{"tintora-button--leading-icon":!!o||l,"tintora-button--loading":l,"tintora-button--trailing-icon":!!s},n),disabled:d||l,"aria-busy":l||void 0,...f,children:[l&&(0,e.jsx)(`span`,{className:`tintora-button__icon`,"aria-hidden":`true`,children:(0,e.jsx)(u,{size:`small`,color:`current`})}),!l&&o&&(0,e.jsx)(`span`,{className:`tintora-button__icon`,"aria-hidden":`true`,children:o}),t,s&&(0,e.jsx)(`span`,{className:`tintora-button__icon`,"aria-hidden":`true`,children:s})]})}function f({as:t=`article`,variant:n=`surface`,className:i,...a}){return(0,e.jsx)(t,{...a,className:r(`tintora-card`,`tintora-card--${n}`,i)})}function p({selected:t=!1,className:n,...i}){return(0,e.jsx)(`button`,{...i,type:`button`,"aria-pressed":t,className:r(`tintora-card`,`tintora-card--surface`,`tintora-card--selectable`,t&&`tintora-card--selected`,n)})}function m({checked:e,defaultChecked:n=!1,onCheckedChange:r}){let[i,a]=(0,t.useState)(n),o=e!==void 0;return{checked:o?e:i,onChange:e=>{o||a(e.target.checked),r?.(e.target.checked)}}}function h({checked:n,defaultChecked:i,onCheckedChange:a,indeterminate:o=!1,className:s,...c}){let l=(0,t.useRef)(null),u=m({checked:n,defaultChecked:i,onCheckedChange:a});return(0,t.useLayoutEffect)(()=>{l.current&&(l.current.indeterminate=o)}),(0,e.jsxs)(`span`,{className:r(`tintora-checkbox`,s),children:[(0,e.jsx)(`input`,{...c,ref:l,type:`checkbox`,className:`tintora-checkbox__input`,checked:u.checked,onChange:u.onChange}),(0,e.jsxs)(`span`,{className:`tintora-checkbox__box`,"aria-hidden":`true`,children:[(0,e.jsx)(`svg`,{className:`tintora-checkbox__check`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,strokeWidth:`3.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,e.jsx)(`path`,{d:`M5 12.5l4.5 4.5L19 7.5`})}),(0,e.jsx)(`svg`,{className:`tintora-checkbox__dash`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,strokeWidth:`3.2`,strokeLinecap:`round`,children:(0,e.jsx)(`path`,{d:`M6 12h12`})})]})]})}function g({children:t,selected:n,className:i,"aria-pressed":a,...o}){return(0,e.jsx)(`button`,{...o,type:`button`,className:r(`tintora-chip`,i),"aria-pressed":n??a,children:t})}function _({variant:t=`unread`,label:n,className:i,...a}){return(0,e.jsx)(`span`,{...a,className:r(`tintora-dot`,`tintora-dot--${t}`,i),role:n?`img`:void 0,"aria-label":n,"aria-hidden":!n||void 0})}function v(e,t){if(e.target!==e.currentTarget)return;let{left:n,right:r,top:i,bottom:a}=e.currentTarget.getBoundingClientRect();(e.clientX<n||e.clientX>r||e.clientY<i||e.clientY>a)&&t()}var y=e=>typeof e==`number`?`${e}px`:e;function b({open:n,from:i=`right`,width:a,height:o,children:s,onClose:c,className:l,...u}){let d=(0,t.useRef)(null);(0,t.useEffect)(()=>{let e=d.current;e&&(n&&!e.open?(e.showModal(),e.querySelector(`[data-autofocus]`)?.focus()):!n&&e.open&&e.close())},[n]);let f={...u.style,...a!==void 0&&{"--tintora-drawer-width":y(a)},...o!==void 0&&{"--tintora-drawer-height":y(o)}};return(0,e.jsx)(`dialog`,{...u,ref:d,className:r(`tintora-drawer`,`tintora-drawer--from-${i}`,l),onCancel:e=>{e.preventDefault(),c()},onClick:e=>v(e,c),style:f,children:s})}var x={round:`secondary`,field:`secondary`,nav:`ghost`};function S({icon:t,variant:n=`round`,size:i,selected:a,className:o,...s}){let c=n===`round`?i??`large`:void 0;return(0,e.jsx)(d,{...s,variant:x[n],"aria-current":a?`page`:void 0,className:r(`tintora-icon-button`,`tintora-icon-button--${n}`,c&&`tintora-icon-button--${c}`,o),...c&&{size:c},children:(0,e.jsx)(`span`,{className:`tintora-icon-button__icon`,"aria-hidden":`true`,children:t})})}var C=()=>(0,e.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:(0,e.jsx)(`path`,{d:`M18 6L6 18M6 6l12 12`})});function w({open:n,onClose:i,title:a,description:o,icon:s,status:c=`info`,actions:l,size:u=`md`,align:d=`start`,role:f=`dialog`,closeButton:p=!0,className:m,children:h,...g}){let _=(0,t.useRef)(null),y=(0,t.useId)(),b=(0,t.useId)();return(0,t.useEffect)(()=>{let e=_.current;e&&(n&&!e.open?(e.showModal(),e.querySelector(`[data-autofocus]`)?.focus()):!n&&e.open&&e.close())},[n]),(0,e.jsxs)(`dialog`,{...g,ref:_,role:f,"aria-labelledby":y,"aria-describedby":o?b:void 0,className:r(`tintora-modal`,`tintora-modal--${u}`,d===`center`&&`tintora-modal--center`,m),onCancel:e=>{e.preventDefault(),i()},onClick:e=>{f===`dialog`&&v(e,i)},children:[s&&(0,e.jsx)(`span`,{className:r(`tintora-modal__icon`,`tintora-modal__icon--${c}`),"aria-hidden":`true`,children:s}),(0,e.jsxs)(`div`,{className:`tintora-modal__text`,children:[(0,e.jsx)(`h2`,{id:y,className:`tintora-modal__title`,children:a}),o&&(0,e.jsx)(`p`,{id:b,className:`tintora-modal__description`,children:o})]}),p&&(0,e.jsx)(S,{className:`tintora-modal__close`,size:`medium`,"aria-label":`Close`,icon:(0,e.jsx)(C,{}),onClick:i}),h,l&&(0,e.jsx)(`div`,{className:`tintora-modal__actions`,children:l})]})}function T(e){let n=(0,t.useRef)(e);return(0,t.useEffect)(()=>{n.current=e},[e]),n}function E(e,n){let r=T(n);(0,t.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&r.current()};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e,r])}function D(e,n,r){let i=T(r);(0,t.useEffect)(()=>{if(!e)return;let t=e=>{n.current?.contains(e.target)||i.current()};return document.addEventListener(`pointerdown`,t),()=>document.removeEventListener(`pointerdown`,t)},[e,n,i])}function O(e,n,r,i){let[a,o]=(0,t.useState)(null);return(0,t.useLayoutEffect)(()=>{let t=n.current;if(!e||!t){o(null);return}t.showPopover();let i=()=>o(r()),a=e=>{t.contains(e.target)||i()};return i(),window.addEventListener(`scroll`,a,!0),window.addEventListener(`resize`,i),()=>{window.removeEventListener(`scroll`,a,!0),window.removeEventListener(`resize`,i)}},[e,n,...i]),a}var k={gap:10,margin:8,arrowInset:12},A={top:`bottom`,bottom:`top`,left:`right`,right:`left`},j=(e,t,n)=>Math.min(Math.max(e,t),Math.max(t,n));function M(e,t,n,r,{gap:i,margin:a}){let o=t=>{switch(t){case`top`:return e.top;case`bottom`:return r.height-e.bottom;case`left`:return e.left;case`right`:return r.width-e.right}},s=(n===`top`||n===`bottom`?t.height:t.width)+i+a,c=o(n);return c>=s||o(A[n])<=c?n:A[n]}function N(e,t,n,r={width:window.innerWidth,height:window.innerHeight},i={}){let a={...k,...i},{gap:o,margin:s,arrowInset:c}=a,l=M(e,t,n,r,a),u=l===`top`||l===`bottom`,d,f;switch(l){case`top`:d=e.y-t.height-o,f=e.x+e.width/2-t.width/2;break;case`bottom`:d=e.y+e.height+o,f=e.x+e.width/2-t.width/2;break;case`left`:d=e.y+e.height/2-t.height/2,f=e.x-t.width-o;break;case`right`:d=e.y+e.height/2-t.height/2,f=e.x+e.width+o}u?f=j(f,s,r.width-t.width-s):d=j(d,s,r.height-t.height-s);let p=u?e.x+e.width/2-f:e.y+e.height/2-d,m=u?t.width:t.height;return{top:d,left:f,placement:l,arrowOffset:j(p,c,m-c)}}var P=[`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `);function F({open:n,onOpenChange:i,trigger:a,title:o,children:s,role:c=`dialog`,size:l=`md`,placement:u=`bottom`,className:d}){let f=(0,t.useId)(),p=(0,t.useRef)(null),m=(0,t.useRef)(null),h=(0,t.useRef)(!1),g=()=>i(!1);E(n,g),D(n,p,g);let _=e=>{a.props.onClick?.(e),e.defaultPrevented||i(!n)},v=O(n,m,()=>{let e=m.current,t=p.current?.firstElementChild;return!e||!t?null:N(t.getBoundingClientRect(),{width:e.offsetWidth,height:e.offsetHeight},u,void 0,{gap:12})},[u,o,s]),y=v?{top:v.top,left:v.left,"--tintora-popover-arrow-offset":`${v.arrowOffset}px`}:{visibility:`hidden`},b=v!==null;return(0,t.useLayoutEffect)(()=>{let e=m.current;n&&b&&e&&(e.querySelector(`[data-autofocus]`)??e.querySelector(P)??e).focus()},[n,b]),(0,t.useEffect)(()=>{if(h.current&&!n){let e=document.activeElement;(!e||e===document.body)&&p.current?.querySelector(`*`)?.focus()}h.current=n},[n]),(0,e.jsxs)(`span`,{ref:p,className:`tintora-popover-root`,children:[(0,t.cloneElement)(a,{"aria-haspopup":`dialog`,"aria-expanded":n,"aria-controls":n?f:void 0,onClick:_}),n&&(0,e.jsx)(`div`,{id:f,ref:m,role:c,"aria-label":o,popover:`manual`,tabIndex:-1,className:r(`tintora-popover`,`tintora-popover--${l}`,`tintora-popover--${v?.placement??u}`,d),style:y,children:s})]})}function I({title:n,progress:i,indeterminate:a,valueLabel:o,className:s,"aria-label":c}){let l=(0,t.useId)(),u=a?void 0:Math.min(100,Math.max(0,Number.isFinite(i)?i:0)),d=u===100,f=o??(a?`Indeterminate`:`${u}%`);return(0,e.jsxs)(`div`,{className:r(`tintora-progress-bar`,s),children:[n&&(0,e.jsxs)(`div`,{className:`tintora-progress-bar__header`,children:[(0,e.jsx)(`span`,{id:l,children:n}),(0,e.jsx)(`span`,{className:`tintora-progress-bar__value`,children:f})]}),(0,e.jsx)(`div`,{role:`progressbar`,"aria-label":c,"aria-labelledby":n?l:void 0,"aria-valuemin":a?void 0:0,"aria-valuemax":a?void 0:100,"aria-valuenow":u,"aria-valuetext":o,className:`tintora-progress-bar__track`,children:(0,e.jsx)(`div`,{className:r(`tintora-progress-bar__fill`,{"tintora-progress-bar__fill--indeterminate":a,"tintora-progress-bar__fill--complete":d}),style:u===void 0?void 0:{width:`${u}%`}})})]})}var L=(0,t.createContext)(null);function R(){let e=(0,t.useContext)(L);if(!e)throw Error(`Radio must be rendered inside a RadioGroup`);return e}function z({value:t,className:n,disabled:i,...a}){let o=R();return(0,e.jsxs)(`span`,{className:r(`tintora-radio`,n),children:[(0,e.jsx)(`input`,{...a,type:`radio`,className:`tintora-radio__input`,name:o.name,value:t,checked:o.value===t,disabled:i||o.disabled,onChange:()=>o.select(t)}),(0,e.jsx)(`span`,{className:`tintora-radio__circle`,"aria-hidden":`true`})]})}function B({value:n,defaultValue:i,onValueChange:a,disabled:o=!1,name:s,className:c,...l}){let u=(0,t.useId)(),[d,f]=(0,t.useState)(i??null),p=n!==void 0,m=p?n:d;return(0,e.jsx)(L.Provider,{value:{name:s??u,value:m,select:e=>{e!==m&&(p||f(e),a?.(e))},disabled:o},children:(0,e.jsx)(`div`,{...l,role:`radiogroup`,className:r(`tintora-radio-group`,c)})})}function V({className:t,disabled:n,...i}){return(0,e.jsxs)(`label`,{className:r(`tintora-search-input`,n&&`tintora-search-input--disabled`,t),children:[(0,e.jsxs)(`svg`,{className:`tintora-search-input__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,children:[(0,e.jsx)(`circle`,{cx:`11`,cy:`11`,r:`7`}),(0,e.jsx)(`path`,{d:`M20 20l-3.5-3.5`})]}),(0,e.jsx)(`input`,{...i,type:`search`,disabled:n,className:`tintora-search-input__input`})]})}var H=(0,t.createContext)(null),U=()=>{let e=(0,t.useContext)(H);if(!e)throw Error(`SelectOption must be rendered inside a Select`);return e};function W({label:t,value:n,disabled:i}){let{select:a,activate:o,optionId:s,value:c,activeValue:l}=U();return(0,e.jsx)(`div`,{id:s(n),role:`option`,"aria-selected":c===n,"aria-disabled":i||void 0,className:r(`tintora-select__option`,l===n&&`tintora-select__option--active`),onClick:()=>a(n),onMouseMove:()=>!i&&o(n),children:t})}var G=4;function K({defaultValue:n,options:i,disabled:a,value:o,placeholder:s,onValueChange:c,name:l,className:u,onClick:d,onKeyDown:f,onKeyUp:p,"aria-label":m,...h}){let g=(0,t.useId)(),_=(0,t.useRef)(null),v=(0,t.useRef)(null),y=(0,t.useRef)(null),[b,x]=(0,t.useState)(n??null),[S,C]=(0,t.useState)(!1),[w,T]=(0,t.useState)(-1),E=o!==void 0,k=E?o:b,A=i.findIndex(e=>e.value===k),j=e=>i[e]?.disabled!==!0,M=()=>i.findIndex((e,t)=>j(t)),N=(e,t)=>{for(let n=e+t;n>=0&&n<i.length;n+=t)if(j(n))return n;return e},P=()=>{let e=N(i.length,-1);return e===i.length?-1:e},F=e=>i.findIndex(t=>t.value===e),I=()=>{T(A>=0&&j(A)?A:M()),C(!0)},L=()=>C(!1),R=e=>{let t=F(e);t<0||!j(t)||(L(),e!==k&&(E||x(e),c?.(e)))},z=e=>{if(f?.(e),e.defaultPrevented)return;let{key:t}=e;if(t===`Tab`)return L();if(!S){[`Enter`,` `,`ArrowDown`,`ArrowUp`].includes(t)&&(e.preventDefault(),I());return}let n={ArrowDown:()=>w<0?M():N(w,1),ArrowUp:()=>w<0?M():N(w,-1),Home:M,End:P};t in n?(e.preventDefault(),T(n[t]())):t===`Enter`||t===` `?(e.preventDefault(),w>=0?R(i[w].value):L()):t===`Escape`&&(e.preventDefault(),L())},B=e=>{p?.(e),e.key===` `&&e.preventDefault()},V=O(S,y,()=>{let e=y.current,t=v.current;if(!e||!t)return null;let n=t.getBoundingClientRect(),r=e.offsetHeight,i=n.bottom+G+r<=window.innerHeight,a=n.top-G-r>=0;return{top:i||!a?n.bottom+G:n.top-G-r,left:n.left,minWidth:n.width}},[]),U=e=>{d?.(e),!e.defaultPrevented&&(S?L():I())};D(S,_,L),(0,t.useEffect)(()=>{S&&w>=0&&y.current?.children.item(w)?.scrollIntoView?.({block:`nearest`})},[S,w]);let K=e=>`${g}-option-${F(e)}`,q=S?i[w]?.value??null:null,J=i[A]?.label;return(0,e.jsx)(H.Provider,{value:{value:k,activeValue:q,select:R,optionId:K,activate:e=>T(F(e))},children:(0,e.jsxs)(`div`,{ref:_,className:`tintora-select`,children:[(0,e.jsxs)(`button`,{...h,ref:v,type:`button`,role:`combobox`,"aria-label":m,"aria-haspopup":`listbox`,"aria-expanded":S,"aria-controls":S?g:void 0,"aria-activedescendant":q===null?void 0:K(q),disabled:a,className:r(`tintora-select__trigger`,u),onClick:U,onKeyDown:z,onKeyUp:B,children:[(0,e.jsx)(`span`,{className:r(`tintora-select__value`,J===void 0&&`tintora-select__value--placeholder`),children:J??s}),(0,e.jsx)(`svg`,{className:`tintora-select__chevron`,width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,e.jsx)(`path`,{d:`M6 9l6 6 6-6`})})]}),S&&(0,e.jsx)(`div`,{ref:y,id:g,role:`listbox`,"aria-label":m,popover:`manual`,className:`tintora-select__menu`,style:V??{},onMouseDown:e=>e.preventDefault(),children:i.map(t=>(0,e.jsx)(W,{...t},t.value))}),l&&(0,e.jsx)(`input`,{type:`hidden`,name:l,value:k??``,disabled:a})]})})}function q({width:t,height:n,className:i,style:a,...o}){let s={...t!==void 0&&{width:t},...n!==void 0&&{height:n}};return(0,e.jsx)(`span`,{...o,"aria-hidden":`true`,className:r(`tintora-skeleton`,i),style:{...s,...a}})}function J({checked:t,defaultChecked:n,onCheckedChange:i,className:a,...o}){let s=m({checked:t,defaultChecked:n,onCheckedChange:i});return(0,e.jsxs)(`span`,{className:r(`tintora-switch`,a),children:[(0,e.jsx)(`input`,{...o,type:`checkbox`,role:`switch`,className:`tintora-switch__input`,checked:s.checked,onChange:s.onChange}),(0,e.jsx)(`span`,{className:`tintora-switch__track`,"aria-hidden":`true`})]})}function Y({children:t,className:n,variant:i=`neutral`,size:a=`medium`,...o}){return(0,e.jsx)(`span`,{...o,className:r(`tintora-tag`,`tintora-tag--${i}`,`tintora-tag--${a}`,n),children:t})}function X({label:n,hint:i,error:a,id:o,className:s,disabled:c,"aria-describedby":l,"aria-invalid":u,...d}){let f=(0,t.useId)(),p=o??f,m=`${p}-message`,h=a??i;return(0,e.jsxs)(`div`,{className:r(`tintora-textfield`,c&&`tintora-textfield--disabled`,s),children:[(0,e.jsx)(`label`,{htmlFor:p,className:`tintora-textfield__label`,children:n}),(0,e.jsx)(`input`,{...d,id:p,disabled:c,className:`tintora-textfield__input`,"aria-invalid":a?!0:u,"aria-describedby":r(h&&m,l)||void 0}),h&&(0,e.jsx)(`span`,{id:m,className:r(`tintora-textfield__hint`,a&&`tintora-textfield__hint--error`),children:h})]})}function Z(){return(0,e.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--tintora-toast-icon-success)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{flex:`0 0 auto`},children:(0,e.jsx)(`path`,{d:`M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20zM8 12.5l2.7 2.7L16 9.8`})})}function Q(){return(0,e.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--tintora-toast-icon-error)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{flex:`0 0 auto`},children:(0,e.jsx)(`path`,{d:`M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20zM15 9l-6 6M9 9l6 6`})})}function ee(){return(0,e.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--tintora-toast-icon-info)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{flex:`0 0 auto`},children:(0,e.jsx)(`path`,{d:`M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20zM12 16v-4M12 8h.01`})})}function te(){return(0,e.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--tintora-toast-icon-warning)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{flex:`0 0 auto`},children:(0,e.jsx)(`path`,{d:`M10.3 3.9L1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0zM12 9v4M12 17h.01`})})}function ne(){return(0,e.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,e.jsx)(`path`,{d:`M18 6L6 18M6 6l12 12`})})}var re={success:(0,e.jsx)(Z,{}),error:(0,e.jsx)(Q,{}),info:(0,e.jsx)(ee,{}),warning:(0,e.jsx)(te,{})};function ie({status:n,children:i,action:a,onDismiss:o,duration:s=5e3,timerBar:c=!1,className:l,...u}){let[d,f]=(0,t.useState)(!1),[p,m]=(0,t.useState)(!1),h=d||p,g=T(o),_=(0,t.useRef)(s);(0,t.useEffect)(()=>{_.current=s},[s]),(0,t.useEffect)(()=>{if(s<=0||h)return;let e=Date.now(),t=setTimeout(()=>g.current(),_.current);return()=>{clearTimeout(t),_.current-=Date.now()-e}},[s,h,g]);let v=c&&s>0,y={"--tintora-toast-animation-duration":`${s}ms`};return(0,e.jsxs)(`div`,{...u,role:`status`,className:r(`tintora-toast`,v&&`tintora-toast--timer`,h&&`tintora-toast--paused`,l),onMouseEnter:e=>{u.onMouseEnter?.(e),f(!0)},onMouseLeave:e=>{u.onMouseLeave?.(e),f(!1)},onFocus:e=>{u.onFocus?.(e),m(!0)},onBlur:e=>{u.onBlur?.(e),e.currentTarget.contains(e.relatedTarget)||m(!1)},children:[n&&re[n],(0,e.jsx)(`span`,{className:`tintora-toast__message`,children:i}),a&&(0,e.jsx)(`button`,{type:`button`,className:`tintora-toast__action`,onClick:a.onClick,children:a.label}),(0,e.jsx)(`button`,{type:`button`,className:`tintora-toast__close`,"aria-label":`Dismiss`,onClick:o,children:(0,e.jsx)(ne,{})}),v&&(0,e.jsx)(`span`,{className:`tintora-toast__progress`,style:y})]})}var $=(0,t.createContext)(null);function ae(){let e=(0,t.useContext)($);if(!e)throw Error(`ToggleItem must be rendered inside a Toggle`);return e}function oe({children:n,value:i,defaultValue:a,onValueChange:o,disabled:s=!1,className:c,...l}){let[u,d]=(0,t.useState)(a),f=i!==void 0,p=f?i:u,m=n.findIndex(e=>e.props.value===p),h=(0,t.useRef)(null),[g,_]=(0,t.useState)({x:0,width:0});(0,t.useLayoutEffect)(()=>{let e=h.current;if(!e)return;let t=()=>{let t=e.children.item(m);if(!t)return;let n={x:t.offsetLeft,width:t.offsetWidth};_(e=>e.x===n.x&&e.width===n.width?e:n)};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[m]);let v={"--tintora-toggle-thumb-x":`${g.x}px`,"--tintora-toggle-thumb-width":`${g.width}px`};return(0,e.jsx)($.Provider,{value:{value:p,select:e=>{e!==p&&(f||d(e),o?.(e))},disabled:s},children:(0,e.jsxs)(`div`,{...l,role:`group`,ref:h,className:r(`tintora-toggle`,s&&`tintora-toggle--disabled`,c),children:[n,(0,e.jsx)(`span`,{"aria-hidden":`true`,className:`tintora-toggle__thumb`,style:v})]})})}function se({value:t,children:n,className:i,disabled:a,onClick:o,...s}){let c=ae(),l=e=>{o?.(e),e.defaultPrevented||c.select(t)};return(0,e.jsx)(`button`,{...s,type:`button`,className:r(`tintora-toggle__item`,i),"aria-pressed":c.value===t,disabled:a||c.disabled,onClick:l,children:n})}var ce=100;function le({title:n,content:i,shortcut:a,children:o,className:s,placement:c=`top`}){let l=(0,t.useId)(),[u,d]=(0,t.useState)(!1),f=(0,t.useRef)(null),p=(0,t.useRef)(null),m=(0,t.useRef)(void 0),h=()=>{window.clearTimeout(m.current),d(!0)},g=()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>d(!1),ce)},_=O(u,p,()=>{let e=p.current,t=f.current?.firstElementChild;return!e||!t?null:N(t.getBoundingClientRect(),{width:e.offsetWidth,height:e.offsetHeight},c)},[c,n,i,a]);E(u,()=>d(!1)),(0,t.useEffect)(()=>()=>window.clearTimeout(m.current),[]);let v=_?{top:_.top,left:_.left,"--tintora-tooltip-arrow-offset":`${_.arrowOffset}px`}:{visibility:`hidden`};return(0,e.jsxs)(`span`,{ref:f,className:`tintora-tooltip`,onMouseEnter:h,onMouseLeave:g,onFocus:h,onBlur:g,children:[(0,t.cloneElement)(o,{"aria-describedby":r(o.props[`aria-describedby`],u&&l)||void 0}),u&&(0,e.jsxs)(`div`,{id:l,ref:p,role:`tooltip`,popover:`manual`,style:v,className:r(`tintora-tooltip__content`,`tintora-tooltip__content--${_?.placement??c}`,n&&`tintora-tooltip__content--rich`,s),children:[n&&(0,e.jsx)(`span`,{className:`tintora-tooltip__title`,children:n}),(0,e.jsx)(`span`,{className:`tintora-tooltip__text`,children:i}),a&&(0,e.jsx)(`kbd`,{className:`tintora-tooltip__shortcut`,children:a})]})]})}exports.Alert=o,exports.Avatar=c,exports.Button=d,exports.Card=f,exports.Checkbox=h,exports.Chip=g,exports.Dot=_,exports.Drawer=b,exports.IconButton=S,exports.Modal=w,exports.Popover=F,exports.ProgressBar=I,exports.Radio=z,exports.RadioGroup=B,exports.SearchInput=V,exports.Select=K,exports.SelectableCard=p,exports.Skeleton=q,exports.Spinner=u,exports.Switch=J,exports.Tag=Y,exports.TextField=X,exports.Toast=ie,exports.Toggle=oe,exports.ToggleItem=se,exports.Tooltip=le;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react/jsx-runtime"),t=require("react");function n(e){var t,r,i=``;if(typeof e==`string`||typeof e==`number`)i+=e;else if(typeof e==`object`){if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=n(e[t]))&&(i&&(i+=` `),i+=r)}else for(r in e)e[r]&&(i&&(i+=` `),i+=r)}return i}function r(){for(var e,t,r=0,i=``,a=arguments.length;r<a;r++)(e=arguments[r])&&(t=n(e))&&(i&&(i+=` `),i+=t);return i}var i={info:(0,e.jsx)(`path`,{d:`M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20zM12 16v-4M12 8h.01`}),success:(0,e.jsx)(`path`,{d:`M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20zM8 12.5l2.7 2.7L16 9.8`}),warning:(0,e.jsx)(`path`,{d:`M10.3 3.9L1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0zM12 9v4M12 17h.01`}),error:(0,e.jsx)(`path`,{d:`M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20zM15 9l-6 6M9 9l6 6`})},a=({status:t})=>(0,e.jsx)(`svg`,{width:`22`,height:`22`,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--tintora-status-${t}-fg)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{flex:`0 0 auto`,marginTop:1},children:i[t]});function o({status:t=`info`,variant:n=`alert`,title:i,children:o,action:s,onDismiss:c,className:l,...u}){return(0,e.jsxs)(`div`,{...u,role:n===`alert`&&t===`error`?`alert`:`status`,className:r(`tintora-alert`,n===`announcement`?`tintora-alert--announcement`:`tintora-alert--${t}`,l),children:[n===`alert`&&(0,e.jsx)(a,{status:t}),(0,e.jsxs)(`div`,{className:r(`tintora-alert__content`,n===`announcement`&&`tintora-alert__content--announcement`),children:[i&&(0,e.jsx)(`span`,{className:`tintora-alert__content__title`,children:i}),o&&(0,e.jsx)(`span`,{className:`tintora-alert__content__sub-title`,children:o}),s&&(0,e.jsx)(`button`,{type:`button`,onClick:s.onClick,className:r(`tintora-alert__content__action`,n===`alert`&&`tintora-alert__content__action--${t}`),children:s.label})]}),n===`alert`&&c&&(0,e.jsx)(`button`,{type:`button`,"aria-label":`Dismiss`,className:`tintora-alert__close`,onClick:c,children:(0,e.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,e.jsx)(`path`,{d:`M18 6L6 18M6 6l12 12`})})})]})}function s(e){if(!e.length)return``;let t=e.trim().split(/\s+/).map(e=>e.match(/\p{L}\p{M}*/u)?.[0]).filter(e=>!!e);return`${t[0]??``}${t.length>1?t.at(-1)??``:``}`.toLocaleUpperCase()}function c({name:n,src:i,size:a=`medium`,className:o,...c}){let[l,u]=(0,t.useState)(),d=!!i&&i!==l;return(0,e.jsx)(`span`,{role:`img`,"aria-label":n,...c,className:r(`tintora-avatar`,`tintora-avatar--${a}`,o),children:d?(0,e.jsx)(`img`,{src:i,alt:``,onError:()=>u(i)}):s(n)})}function l(e,t){if(e.target!==e.currentTarget)return;let{left:n,right:r,top:i,bottom:a}=e.currentTarget.getBoundingClientRect();(e.clientX<n||e.clientX>r||e.clientY<i||e.clientY>a)&&t()}var u=e=>typeof e==`number`?`${e}px`:e;function d({open:n,from:i=`right`,width:a,height:o,children:s,onClose:c,className:d,...f}){let p=(0,t.useRef)(null);(0,t.useEffect)(()=>{let e=p.current;e&&(n&&!e.open?(e.showModal(),e.querySelector(`[data-autofocus]`)?.focus()):!n&&e.open&&e.close())},[n]);let m={...f.style,...a!==void 0&&{"--tintora-drawer-width":u(a)},...o!==void 0&&{"--tintora-drawer-height":u(o)}};return(0,e.jsx)(`dialog`,{...f,ref:p,className:r(`tintora-drawer`,`tintora-drawer--from-${i}`,d),onCancel:e=>{e.preventDefault(),c()},onClick:e=>l(e,c),style:m,children:s})}function f({title:n,children:i,className:a,...o}){let s=(0,t.useId)();return(0,e.jsxs)(d,{...o,from:`bottom`,"aria-labelledby":s,className:r(`tintora-bottom-sheet`,a),children:[(0,e.jsx)(`span`,{className:`tintora-bottom-sheet__grabber`,"aria-hidden":`true`}),(0,e.jsx)(`div`,{id:s,className:`tintora-bottom-sheet__title`,children:n}),i]})}function p({selected:t=!1,className:n,children:i,...a}){return(0,e.jsxs)(`button`,{type:`button`,...a,"aria-pressed":t,className:r(`tintora-bottom-sheet__option`,n),children:[(0,e.jsx)(`span`,{children:i}),(0,e.jsx)(`svg`,{className:`tintora-bottom-sheet__check`,width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.4`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,e.jsx)(`path`,{d:`M5 12.5l4.5 4.5L19 7.5`})})]})}var m={small:{width:16,height:16,strokeWidth:3.5},medium:{width:24,height:24,strokeWidth:3},large:{width:40,height:40,strokeWidth:2.4}};function h({size:t=`medium`,color:n=`accent`}){let{width:r,height:i,strokeWidth:a}=m[t];return(0,e.jsxs)(`svg`,{className:`tintora-spinner`,width:r,height:i,viewBox:`0 0 24 24`,fill:`none`,role:`img`,"aria-label":`Loading`,children:[(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,stroke:`currentColor`,strokeOpacity:n===`accent`?.25:.35,strokeWidth:a}),(0,e.jsx)(`path`,{d:`M21 12a9 9 0 0 0-9-9`,stroke:n===`accent`?`var(--tintora-control-fill)`:`currentColor`,strokeWidth:a,strokeLinecap:`round`})]})}function g({children:t,className:n,variant:i,size:a=`medium`,leadingIcon:o,trailingIcon:s,type:c=`button`,loading:l=!1,disabled:u,...d}){return(0,e.jsxs)(`button`,{type:c,className:r(`tintora-button`,`tintora-button--${i}`,`tintora-button--${a}`,{"tintora-button--leading-icon":!!o||l,"tintora-button--loading":l,"tintora-button--trailing-icon":!!s},n),disabled:u||l,"aria-busy":l||void 0,...d,children:[l&&(0,e.jsx)(`span`,{className:`tintora-button__icon`,"aria-hidden":`true`,children:(0,e.jsx)(h,{size:`small`,color:`current`})}),!l&&o&&(0,e.jsx)(`span`,{className:`tintora-button__icon`,"aria-hidden":`true`,children:o}),t,s&&(0,e.jsx)(`span`,{className:`tintora-button__icon`,"aria-hidden":`true`,children:s})]})}function _({as:t=`article`,variant:n=`surface`,className:i,...a}){return(0,e.jsx)(t,{...a,className:r(`tintora-card`,`tintora-card--${n}`,i)})}function v({selected:t=!1,className:n,...i}){return(0,e.jsx)(`button`,{...i,type:`button`,"aria-pressed":t,className:r(`tintora-card`,`tintora-card--surface`,`tintora-card--selectable`,t&&`tintora-card--selected`,n)})}function y({checked:e,defaultChecked:n=!1,onCheckedChange:r}){let[i,a]=(0,t.useState)(n),o=e!==void 0;return{checked:o?e:i,onChange:e=>{o||a(e.target.checked),r?.(e.target.checked)}}}function b({checked:n,defaultChecked:i,onCheckedChange:a,indeterminate:o=!1,className:s,...c}){let l=(0,t.useRef)(null),u=y({checked:n,defaultChecked:i,onCheckedChange:a});return(0,t.useLayoutEffect)(()=>{l.current&&(l.current.indeterminate=o)}),(0,e.jsxs)(`span`,{className:r(`tintora-checkbox`,s),children:[(0,e.jsx)(`input`,{...c,ref:l,type:`checkbox`,className:`tintora-checkbox__input`,checked:u.checked,onChange:u.onChange}),(0,e.jsxs)(`span`,{className:`tintora-checkbox__box`,"aria-hidden":`true`,children:[(0,e.jsx)(`svg`,{className:`tintora-checkbox__check`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,strokeWidth:`3.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,e.jsx)(`path`,{d:`M5 12.5l4.5 4.5L19 7.5`})}),(0,e.jsx)(`svg`,{className:`tintora-checkbox__dash`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,strokeWidth:`3.2`,strokeLinecap:`round`,children:(0,e.jsx)(`path`,{d:`M6 12h12`})})]})]})}function x({children:t,selected:n,className:i,"aria-pressed":a,...o}){return(0,e.jsx)(`button`,{...o,type:`button`,className:r(`tintora-chip`,i),"aria-pressed":n??a,children:t})}function S({variant:t=`unread`,label:n,className:i,...a}){return(0,e.jsx)(`span`,{...a,className:r(`tintora-dot`,`tintora-dot--${t}`,i),role:n?`img`:void 0,"aria-label":n,"aria-hidden":!n||void 0})}var C={round:`secondary`,field:`secondary`,nav:`ghost`};function w({icon:t,variant:n=`round`,size:i,selected:a,className:o,...s}){let c=n===`round`?i??`large`:void 0;return(0,e.jsx)(g,{...s,variant:C[n],"aria-current":a?`page`:void 0,className:r(`tintora-icon-button`,`tintora-icon-button--${n}`,c&&`tintora-icon-button--${c}`,o),...c&&{size:c},children:(0,e.jsx)(`span`,{className:`tintora-icon-button__icon`,"aria-hidden":`true`,children:t})})}var T=()=>(0,e.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:(0,e.jsx)(`path`,{d:`M18 6L6 18M6 6l12 12`})});function E({open:n,onClose:i,title:a,description:o,icon:s,status:c=`info`,actions:u,size:d=`md`,align:f=`start`,role:p=`dialog`,closeButton:m=!0,className:h,children:g,..._}){let v=(0,t.useRef)(null),y=(0,t.useId)(),b=(0,t.useId)();return(0,t.useEffect)(()=>{let e=v.current;e&&(n&&!e.open?(e.showModal(),e.querySelector(`[data-autofocus]`)?.focus()):!n&&e.open&&e.close())},[n]),(0,e.jsxs)(`dialog`,{..._,ref:v,role:p,"aria-labelledby":y,"aria-describedby":o?b:void 0,className:r(`tintora-modal`,`tintora-modal--${d}`,f===`center`&&`tintora-modal--center`,h),onCancel:e=>{e.preventDefault(),i()},onClick:e=>{p===`dialog`&&l(e,i)},children:[s&&(0,e.jsx)(`span`,{className:r(`tintora-modal__icon`,`tintora-modal__icon--${c}`),"aria-hidden":`true`,children:s}),(0,e.jsxs)(`div`,{className:`tintora-modal__text`,children:[(0,e.jsx)(`h2`,{id:y,className:`tintora-modal__title`,children:a}),o&&(0,e.jsx)(`p`,{id:b,className:`tintora-modal__description`,children:o})]}),m&&(0,e.jsx)(w,{className:`tintora-modal__close`,size:`medium`,"aria-label":`Close`,icon:(0,e.jsx)(T,{}),onClick:i}),g,u&&(0,e.jsx)(`div`,{className:`tintora-modal__actions`,children:u})]})}function D(e){let n=(0,t.useRef)(e);return(0,t.useEffect)(()=>{n.current=e},[e]),n}function O(e,n){let r=D(n);(0,t.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&r.current()};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e,r])}function k(e,n,r){let i=D(r);(0,t.useEffect)(()=>{if(!e)return;let t=e=>{n.current?.contains(e.target)||i.current()};return document.addEventListener(`pointerdown`,t),()=>document.removeEventListener(`pointerdown`,t)},[e,n,i])}function A(e,n,r,i){let[a,o]=(0,t.useState)(null);return(0,t.useLayoutEffect)(()=>{let t=n.current;if(!e||!t){o(null);return}t.showPopover();let i=()=>o(r()),a=e=>{t.contains(e.target)||i()};return i(),window.addEventListener(`scroll`,a,!0),window.addEventListener(`resize`,i),()=>{window.removeEventListener(`scroll`,a,!0),window.removeEventListener(`resize`,i)}},[e,n,...i]),a}var j={gap:10,margin:8,arrowInset:12},M={top:`bottom`,bottom:`top`,left:`right`,right:`left`},N=(e,t,n)=>Math.min(Math.max(e,t),Math.max(t,n));function P(e,t,n,r,{gap:i,margin:a}){let o=t=>{switch(t){case`top`:return e.top;case`bottom`:return r.height-e.bottom;case`left`:return e.left;case`right`:return r.width-e.right}},s=(n===`top`||n===`bottom`?t.height:t.width)+i+a,c=o(n);return c>=s||o(M[n])<=c?n:M[n]}function F(e,t,n,r={width:window.innerWidth,height:window.innerHeight},i={}){let a={...j,...i},{gap:o,margin:s,arrowInset:c}=a,l=P(e,t,n,r,a),u=l===`top`||l===`bottom`,d,f;switch(l){case`top`:d=e.y-t.height-o,f=e.x+e.width/2-t.width/2;break;case`bottom`:d=e.y+e.height+o,f=e.x+e.width/2-t.width/2;break;case`left`:d=e.y+e.height/2-t.height/2,f=e.x-t.width-o;break;case`right`:d=e.y+e.height/2-t.height/2,f=e.x+e.width+o}u?f=N(f,s,r.width-t.width-s):d=N(d,s,r.height-t.height-s);let p=u?e.x+e.width/2-f:e.y+e.height/2-d,m=u?t.width:t.height;return{top:d,left:f,placement:l,arrowOffset:N(p,c,m-c)}}var I=[`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `);function L({open:n,onOpenChange:i,trigger:a,title:o,children:s,role:c=`dialog`,size:l=`md`,placement:u=`bottom`,className:d}){let f=(0,t.useId)(),p=(0,t.useRef)(null),m=(0,t.useRef)(null),h=(0,t.useRef)(!1),g=()=>i(!1);O(n,g),k(n,p,g);let _=e=>{a.props.onClick?.(e),e.defaultPrevented||i(!n)},v=A(n,m,()=>{let e=m.current,t=p.current?.firstElementChild;return!e||!t?null:F(t.getBoundingClientRect(),{width:e.offsetWidth,height:e.offsetHeight},u,void 0,{gap:12})},[u,o,s]),y=v?{top:v.top,left:v.left,"--tintora-popover-arrow-offset":`${v.arrowOffset}px`}:{visibility:`hidden`},b=v!==null;return(0,t.useLayoutEffect)(()=>{let e=m.current;n&&b&&e&&(e.querySelector(`[data-autofocus]`)??e.querySelector(I)??e).focus()},[n,b]),(0,t.useEffect)(()=>{if(h.current&&!n){let e=document.activeElement;(!e||e===document.body)&&p.current?.querySelector(`*`)?.focus()}h.current=n},[n]),(0,e.jsxs)(`span`,{ref:p,className:`tintora-popover-root`,children:[(0,t.cloneElement)(a,{"aria-haspopup":`dialog`,"aria-expanded":n,"aria-controls":n?f:void 0,onClick:_}),n&&(0,e.jsx)(`div`,{id:f,ref:m,role:c,"aria-label":o,popover:`manual`,tabIndex:-1,className:r(`tintora-popover`,`tintora-popover--${l}`,`tintora-popover--${v?.placement??u}`,d),style:y,children:s})]})}function R({title:n,progress:i,indeterminate:a,valueLabel:o,className:s,"aria-label":c}){let l=(0,t.useId)(),u=a?void 0:Math.min(100,Math.max(0,Number.isFinite(i)?i:0)),d=u===100,f=o??(a?`Indeterminate`:`${u}%`);return(0,e.jsxs)(`div`,{className:r(`tintora-progress-bar`,s),children:[n&&(0,e.jsxs)(`div`,{className:`tintora-progress-bar__header`,children:[(0,e.jsx)(`span`,{id:l,children:n}),(0,e.jsx)(`span`,{className:`tintora-progress-bar__value`,children:f})]}),(0,e.jsx)(`div`,{role:`progressbar`,"aria-label":c,"aria-labelledby":n?l:void 0,"aria-valuemin":a?void 0:0,"aria-valuemax":a?void 0:100,"aria-valuenow":u,"aria-valuetext":o,className:`tintora-progress-bar__track`,children:(0,e.jsx)(`div`,{className:r(`tintora-progress-bar__fill`,{"tintora-progress-bar__fill--indeterminate":a,"tintora-progress-bar__fill--complete":d}),style:u===void 0?void 0:{width:`${u}%`}})})]})}var z=(0,t.createContext)(null);function B(){let e=(0,t.useContext)(z);if(!e)throw Error(`Radio must be rendered inside a RadioGroup`);return e}function V({value:t,className:n,disabled:i,...a}){let o=B();return(0,e.jsxs)(`span`,{className:r(`tintora-radio`,n),children:[(0,e.jsx)(`input`,{...a,type:`radio`,className:`tintora-radio__input`,name:o.name,value:t,checked:o.value===t,disabled:i||o.disabled,onChange:()=>o.select(t)}),(0,e.jsx)(`span`,{className:`tintora-radio__circle`,"aria-hidden":`true`})]})}function H({value:n,defaultValue:i,onValueChange:a,disabled:o=!1,name:s,className:c,...l}){let u=(0,t.useId)(),[d,f]=(0,t.useState)(i??null),p=n!==void 0,m=p?n:d;return(0,e.jsx)(z.Provider,{value:{name:s??u,value:m,select:e=>{e!==m&&(p||f(e),a?.(e))},disabled:o},children:(0,e.jsx)(`div`,{...l,role:`radiogroup`,className:r(`tintora-radio-group`,c)})})}function U({className:t,disabled:n,...i}){return(0,e.jsxs)(`label`,{className:r(`tintora-search-input`,n&&`tintora-search-input--disabled`,t),children:[(0,e.jsxs)(`svg`,{className:`tintora-search-input__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,children:[(0,e.jsx)(`circle`,{cx:`11`,cy:`11`,r:`7`}),(0,e.jsx)(`path`,{d:`M20 20l-3.5-3.5`})]}),(0,e.jsx)(`input`,{...i,type:`search`,disabled:n,className:`tintora-search-input__input`})]})}var W=(0,t.createContext)(null),G=()=>{let e=(0,t.useContext)(W);if(!e)throw Error(`SelectOption must be rendered inside a Select`);return e};function K({label:t,value:n,disabled:i}){let{select:a,activate:o,optionId:s,value:c,activeValue:l}=G();return(0,e.jsx)(`div`,{id:s(n),role:`option`,"aria-selected":c===n,"aria-disabled":i||void 0,className:r(`tintora-select__option`,l===n&&`tintora-select__option--active`),onClick:()=>a(n),onMouseMove:()=>!i&&o(n),children:t})}var q=4;function J({defaultValue:n,options:i,disabled:a,value:o,placeholder:s,onValueChange:c,name:l,className:u,onClick:d,onKeyDown:f,onKeyUp:p,"aria-label":m,...h}){let g=(0,t.useId)(),_=(0,t.useRef)(null),v=(0,t.useRef)(null),y=(0,t.useRef)(null),[b,x]=(0,t.useState)(n??null),[S,C]=(0,t.useState)(!1),[w,T]=(0,t.useState)(-1),E=o!==void 0,D=E?o:b,O=i.findIndex(e=>e.value===D),j=e=>i[e]?.disabled!==!0,M=()=>i.findIndex((e,t)=>j(t)),N=(e,t)=>{for(let n=e+t;n>=0&&n<i.length;n+=t)if(j(n))return n;return e},P=()=>{let e=N(i.length,-1);return e===i.length?-1:e},F=e=>i.findIndex(t=>t.value===e),I=()=>{T(O>=0&&j(O)?O:M()),C(!0)},L=()=>C(!1),R=e=>{let t=F(e);t<0||!j(t)||(L(),e!==D&&(E||x(e),c?.(e)))},z=e=>{if(f?.(e),e.defaultPrevented)return;let{key:t}=e;if(t===`Tab`)return L();if(!S){[`Enter`,` `,`ArrowDown`,`ArrowUp`].includes(t)&&(e.preventDefault(),I());return}let n={ArrowDown:()=>w<0?M():N(w,1),ArrowUp:()=>w<0?M():N(w,-1),Home:M,End:P};t in n?(e.preventDefault(),T(n[t]())):t===`Enter`||t===` `?(e.preventDefault(),w>=0?R(i[w].value):L()):t===`Escape`&&(e.preventDefault(),L())},B=e=>{p?.(e),e.key===` `&&e.preventDefault()},V=A(S,y,()=>{let e=y.current,t=v.current;if(!e||!t)return null;let n=t.getBoundingClientRect(),r=e.offsetHeight,i=n.bottom+q+r<=window.innerHeight,a=n.top-q-r>=0;return{top:i||!a?n.bottom+q:n.top-q-r,left:n.left,minWidth:n.width}},[]),H=e=>{d?.(e),!e.defaultPrevented&&(S?L():I())};k(S,_,L),(0,t.useEffect)(()=>{S&&w>=0&&y.current?.children.item(w)?.scrollIntoView?.({block:`nearest`})},[S,w]);let U=e=>`${g}-option-${F(e)}`,G=S?i[w]?.value??null:null,J=i[O]?.label;return(0,e.jsx)(W.Provider,{value:{value:D,activeValue:G,select:R,optionId:U,activate:e=>T(F(e))},children:(0,e.jsxs)(`div`,{ref:_,className:`tintora-select`,children:[(0,e.jsxs)(`button`,{...h,ref:v,type:`button`,role:`combobox`,"aria-label":m,"aria-haspopup":`listbox`,"aria-expanded":S,"aria-controls":S?g:void 0,"aria-activedescendant":G===null?void 0:U(G),disabled:a,className:r(`tintora-select__trigger`,u),onClick:H,onKeyDown:z,onKeyUp:B,children:[(0,e.jsx)(`span`,{className:r(`tintora-select__value`,J===void 0&&`tintora-select__value--placeholder`),children:J??s}),(0,e.jsx)(`svg`,{className:`tintora-select__chevron`,width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,e.jsx)(`path`,{d:`M6 9l6 6 6-6`})})]}),S&&(0,e.jsx)(`div`,{ref:y,id:g,role:`listbox`,"aria-label":m,popover:`manual`,className:`tintora-select__menu`,style:V??{},onMouseDown:e=>e.preventDefault(),children:i.map(t=>(0,e.jsx)(K,{...t},t.value))}),l&&(0,e.jsx)(`input`,{type:`hidden`,name:l,value:D??``,disabled:a})]})})}function ee({title:t,description:n,children:i,controlPosition:a=`end`,className:o,...s}){return(0,e.jsxs)(`div`,{...s,className:r(`tintora-settings-row`,`tintora-settings-row--control-${a}`,n&&`tintora-settings-row--described`,o),children:[(0,e.jsxs)(`div`,{className:`tintora-settings-row__text`,children:[(0,e.jsx)(`div`,{className:`tintora-settings-row__title`,children:t}),n&&(0,e.jsx)(`div`,{className:`tintora-settings-row__description`,children:n})]}),i]})}function te({width:t,height:n,className:i,style:a,...o}){let s={...t!==void 0&&{width:t},...n!==void 0&&{height:n}};return(0,e.jsx)(`span`,{...o,"aria-hidden":`true`,className:r(`tintora-skeleton`,i),style:{...s,...a}})}function Y({checked:t,defaultChecked:n,onCheckedChange:i,className:a,...o}){let s=y({checked:t,defaultChecked:n,onCheckedChange:i});return(0,e.jsxs)(`span`,{className:r(`tintora-switch`,a),children:[(0,e.jsx)(`input`,{...o,type:`checkbox`,role:`switch`,className:`tintora-switch__input`,checked:s.checked,onChange:s.onChange}),(0,e.jsx)(`span`,{className:`tintora-switch__track`,"aria-hidden":`true`})]})}var X=(0,t.createContext)(null);function Z(){let e=(0,t.useContext)(X);if(!e)throw Error(`Tab must be rendered inside Tabs`);return e}function ne({value:t,className:n,onClick:i,children:a,...o}){let s=Z(),c=s.value===t,l=e=>{i?.(e),e.defaultPrevented||s.select(t)};return(0,e.jsx)(`button`,{...o,type:`button`,role:`tab`,"aria-selected":c,tabIndex:c?0:-1,className:r(`tintora-tab`,n),onClick:l,children:a})}var re=[`ArrowLeft`,`ArrowRight`,`Home`,`End`];function ie({value:n,defaultValue:i,onValueChange:a,variant:o=`segmented`,className:s,children:c,onKeyDown:l,...u}){let[d,f]=(0,t.useState)(i),p=n!==void 0,m=p?n:d,h=e=>{e!==m&&(p||f(e),a?.(e))},g=e=>{if(l?.(e),e.defaultPrevented||!re.includes(e.key))return;let t=Array.from(e.currentTarget.querySelectorAll(`[role="tab"]:not(:disabled)`)),n=t.indexOf(e.target);if(n<0)return;e.preventDefault();let r=t.length-1,i=e.key===`Home`?0:e.key===`End`?r:(n+(e.key===`ArrowRight`?1:-1)+t.length)%t.length;t[i].focus(),t[i].click()};return(0,e.jsx)(X.Provider,{value:{value:m,select:h},children:(0,e.jsx)(`div`,{...u,role:`tablist`,className:r(`tintora-tabs`,`tintora-tabs--${o}`,s),onKeyDown:g,children:c})})}function ae({children:t,className:n,variant:i=`neutral`,size:a=`medium`,...o}){return(0,e.jsx)(`span`,{...o,className:r(`tintora-tag`,`tintora-tag--${i}`,`tintora-tag--${a}`,n),children:t})}function oe({label:n,hint:i,error:a,id:o,className:s,disabled:c,"aria-describedby":l,"aria-invalid":u,...d}){let f=(0,t.useId)(),p=o??f,m=`${p}-message`,h=a??i;return(0,e.jsxs)(`div`,{className:r(`tintora-textfield`,c&&`tintora-textfield--disabled`,s),children:[(0,e.jsx)(`label`,{htmlFor:p,className:`tintora-textfield__label`,children:n}),(0,e.jsx)(`input`,{...d,id:p,disabled:c,className:`tintora-textfield__input`,"aria-invalid":a?!0:u,"aria-describedby":r(h&&m,l)||void 0}),h&&(0,e.jsx)(`span`,{id:m,className:r(`tintora-textfield__hint`,a&&`tintora-textfield__hint--error`),children:h})]})}function se(){return(0,e.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--tintora-toast-icon-success)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{flex:`0 0 auto`},children:(0,e.jsx)(`path`,{d:`M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20zM8 12.5l2.7 2.7L16 9.8`})})}function ce(){return(0,e.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--tintora-toast-icon-error)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{flex:`0 0 auto`},children:(0,e.jsx)(`path`,{d:`M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20zM15 9l-6 6M9 9l6 6`})})}function le(){return(0,e.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--tintora-toast-icon-info)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{flex:`0 0 auto`},children:(0,e.jsx)(`path`,{d:`M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20zM12 16v-4M12 8h.01`})})}function Q(){return(0,e.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--tintora-toast-icon-warning)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{flex:`0 0 auto`},children:(0,e.jsx)(`path`,{d:`M10.3 3.9L1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0zM12 9v4M12 17h.01`})})}function ue(){return(0,e.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,e.jsx)(`path`,{d:`M18 6L6 18M6 6l12 12`})})}var de={success:(0,e.jsx)(se,{}),error:(0,e.jsx)(ce,{}),info:(0,e.jsx)(le,{}),warning:(0,e.jsx)(Q,{})};function fe({status:n,children:i,action:a,onDismiss:o,duration:s=5e3,timerBar:c=!1,className:l,...u}){let[d,f]=(0,t.useState)(!1),[p,m]=(0,t.useState)(!1),h=d||p,g=D(o),_=(0,t.useRef)(s);(0,t.useEffect)(()=>{_.current=s},[s]),(0,t.useEffect)(()=>{if(s<=0||h)return;let e=Date.now(),t=setTimeout(()=>g.current(),_.current);return()=>{clearTimeout(t),_.current-=Date.now()-e}},[s,h,g]);let v=c&&s>0,y={"--tintora-toast-animation-duration":`${s}ms`};return(0,e.jsxs)(`div`,{...u,role:`status`,className:r(`tintora-toast`,v&&`tintora-toast--timer`,h&&`tintora-toast--paused`,l),onMouseEnter:e=>{u.onMouseEnter?.(e),f(!0)},onMouseLeave:e=>{u.onMouseLeave?.(e),f(!1)},onFocus:e=>{u.onFocus?.(e),m(!0)},onBlur:e=>{u.onBlur?.(e),e.currentTarget.contains(e.relatedTarget)||m(!1)},children:[n&&de[n],(0,e.jsx)(`span`,{className:`tintora-toast__message`,children:i}),a&&(0,e.jsx)(`button`,{type:`button`,className:`tintora-toast__action`,onClick:a.onClick,children:a.label}),(0,e.jsx)(`button`,{type:`button`,className:`tintora-toast__close`,"aria-label":`Dismiss`,onClick:o,children:(0,e.jsx)(ue,{})}),v&&(0,e.jsx)(`span`,{className:`tintora-toast__progress`,style:y})]})}var $=(0,t.createContext)(null);function pe(){let e=(0,t.useContext)($);if(!e)throw Error(`ToggleItem must be rendered inside a Toggle`);return e}function me({children:n,value:i,defaultValue:a,onValueChange:o,disabled:s=!1,className:c,...l}){let[u,d]=(0,t.useState)(a),f=i!==void 0,p=f?i:u,m=n.findIndex(e=>e.props.value===p),h=(0,t.useRef)(null),[g,_]=(0,t.useState)({x:0,width:0});(0,t.useLayoutEffect)(()=>{let e=h.current;if(!e)return;let t=()=>{let t=e.children.item(m);if(!t)return;let n={x:t.offsetLeft,width:t.offsetWidth};_(e=>e.x===n.x&&e.width===n.width?e:n)};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[m]);let v={"--tintora-toggle-thumb-x":`${g.x}px`,"--tintora-toggle-thumb-width":`${g.width}px`};return(0,e.jsx)($.Provider,{value:{value:p,select:e=>{e!==p&&(f||d(e),o?.(e))},disabled:s},children:(0,e.jsxs)(`div`,{...l,role:`group`,ref:h,className:r(`tintora-toggle`,s&&`tintora-toggle--disabled`,c),children:[n,(0,e.jsx)(`span`,{"aria-hidden":`true`,className:`tintora-toggle__thumb`,style:v})]})})}function he({value:t,children:n,className:i,disabled:a,onClick:o,...s}){let c=pe(),l=e=>{o?.(e),e.defaultPrevented||c.select(t)};return(0,e.jsx)(`button`,{...s,type:`button`,className:r(`tintora-toggle__item`,i),"aria-pressed":c.value===t,disabled:a||c.disabled,onClick:l,children:n})}var ge=100;function _e({title:n,content:i,shortcut:a,children:o,className:s,placement:c=`top`}){let l=(0,t.useId)(),[u,d]=(0,t.useState)(!1),f=(0,t.useRef)(null),p=(0,t.useRef)(null),m=(0,t.useRef)(void 0),h=()=>{window.clearTimeout(m.current),d(!0)},g=()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>d(!1),ge)},_=A(u,p,()=>{let e=p.current,t=f.current?.firstElementChild;return!e||!t?null:F(t.getBoundingClientRect(),{width:e.offsetWidth,height:e.offsetHeight},c)},[c,n,i,a]);O(u,()=>d(!1)),(0,t.useEffect)(()=>()=>window.clearTimeout(m.current),[]);let v=_?{top:_.top,left:_.left,"--tintora-tooltip-arrow-offset":`${_.arrowOffset}px`}:{visibility:`hidden`};return(0,e.jsxs)(`span`,{ref:f,className:`tintora-tooltip`,onMouseEnter:h,onMouseLeave:g,onFocus:h,onBlur:g,children:[(0,t.cloneElement)(o,{"aria-describedby":r(o.props[`aria-describedby`],u&&l)||void 0}),u&&(0,e.jsxs)(`div`,{id:l,ref:p,role:`tooltip`,popover:`manual`,style:v,className:r(`tintora-tooltip__content`,`tintora-tooltip__content--${_?.placement??c}`,n&&`tintora-tooltip__content--rich`,s),children:[n&&(0,e.jsx)(`span`,{className:`tintora-tooltip__title`,children:n}),(0,e.jsx)(`span`,{className:`tintora-tooltip__text`,children:i}),a&&(0,e.jsx)(`kbd`,{className:`tintora-tooltip__shortcut`,children:a})]})]})}exports.Alert=o,exports.Avatar=c,exports.BottomSheet=f,exports.BottomSheetOption=p,exports.Button=g,exports.Card=_,exports.Checkbox=b,exports.Chip=x,exports.Dot=S,exports.Drawer=d,exports.IconButton=w,exports.Modal=E,exports.Popover=L,exports.ProgressBar=R,exports.Radio=V,exports.RadioGroup=H,exports.SearchInput=U,exports.Select=J,exports.SelectableCard=v,exports.SettingsRow=ee,exports.Skeleton=te,exports.Spinner=h,exports.Switch=Y,exports.Tab=ne,exports.Tabs=ie,exports.Tag=ae,exports.TextField=oe,exports.Toast=fe,exports.Toggle=me,exports.ToggleItem=he,exports.Tooltip=_e;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import './tokens.css';
2
2
  export { Alert, type AlertProps } from './Alert/Alert';
3
3
  export { Avatar } from './Avatar/Avatar';
4
+ export { BottomSheet, BottomSheetOption, type BottomSheetOptionProps, type BottomSheetProps, } from './BottomSheet/BottomSheet';
4
5
  export { Button } from './Button/Button';
5
6
  export { Card, SelectableCard, type CardProps, type SelectableCardProps, } from './Card/Card';
6
7
  export { Checkbox, type CheckboxProps } from './Checkbox/Checkbox';
@@ -15,9 +16,12 @@ export { Radio, type RadioProps } from './Radio/Radio';
15
16
  export { RadioGroup, type RadioGroupProps } from './Radio/RadioGroup';
16
17
  export { SearchInput } from './SearchInput/SearchInput';
17
18
  export { Select } from './Select/Select';
19
+ export { SettingsRow, type SettingsRowProps } from './SettingsRow/SettingsRow';
18
20
  export { Skeleton, type SkeletonProps } from './Skeleton/Skeleton';
19
21
  export { Spinner } from './Spinner/Spinner';
20
22
  export { Switch, type SwitchProps } from './Switch/Switch';
23
+ export { Tab, type TabProps } from './Tabs/Tab';
24
+ export { Tabs, type TabsProps } from './Tabs/Tabs';
21
25
  export { Tag } from './Tag/Tag';
22
26
  export { TextField } from './TextField/TextField';
23
27
  export { Toast, type ToastProps } from './Toast/Toast';