efficient-shell 12.20.0 → 12.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -5
- package/dist/{Browser-Z7NIFAGY.js → Browser-PVENJWOP.js} +11 -11
- package/dist/{Files-KOUPCFRC.js → Files-SJVIIPJO.js} +127 -127
- package/dist/{Notepad-Y37G5PTB.js → Notepad-RULHLP22.js} +6 -6
- package/dist/{Preview-GB33WBQY.js → Preview-WP3J555J.js} +11 -11
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/chunk-63TCQAGE.js +6 -0
- package/dist/chunk-G2Y5I5OR.js +2 -0
- package/dist/chunk-LBKKKZ4M.js +3 -0
- package/dist/{chunk-P54AD2EM.js → chunk-M7RGRV2J.js} +2 -2
- package/dist/{chunk-TKUJUQK4.js → chunk-MEN4B6NP.js} +11 -11
- package/dist/chunk-MQP7E4CQ.js +1 -0
- package/dist/chunk-OM42AUMS.js +4 -0
- package/dist/chunk-TOVEZAIM.js +5 -0
- package/dist/{chunk-QTXXHKAV.js → chunk-VVT4J75X.js} +1 -1
- package/dist/chunk-WBGJ4XB7.js +4 -0
- package/dist/{chunk-MFEPLP7Y.js → chunk-XHZVUO6F.js} +5 -5
- package/dist/{chunk-NAN2IW2H.js → chunk-YW3UKSON.js} +2 -2
- package/dist/chunk-ZSEB7XW4.js +1 -0
- package/dist/format/index.d.ts +50 -8
- package/dist/format/index.js +1 -1
- package/dist/forms/BorderInput.d.ts +7 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/CornersInput.d.ts +10 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/InputNumber.d.ts +12 -0
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/PositionInput.d.ts +8 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/SidesInput.d.ts +3 -6
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.d.ts +19 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/UnitMenu.d.ts +24 -1
- package/dist/forms/UnitMenu.js +2 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +41 -41
- package/dist/motion/entrance.d.ts +4 -1
- package/dist/motion/entrance.js +1 -1
- package/dist/motion.css +49 -17
- package/dist/telemetry/index.js +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-DTSOYFQE.js +0 -4
- package/dist/chunk-FBUFB536.js +0 -6
- package/dist/chunk-FE5DH5OM.js +0 -3
- package/dist/chunk-L4QGZ26E.js +0 -1
- package/dist/chunk-Q2SCJQ5H.js +0 -1
- package/dist/chunk-QI4235JY.js +0 -2
- package/dist/chunk-S7MNRAYS.js +0 -4
- package/dist/chunk-SET3R227.js +0 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as t,COLUMN_SHARE_MIN as r,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-
|
|
2
|
-
return h("div",{role:"group","aria-label":N?void 0:C,"aria-labelledby":N,"aria-describedby":
|
|
1
|
+
import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as t,COLUMN_SHARE_MIN as r,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-LBKKKZ4M.js";import{Tooltip as i}from"./chunk-SOZCWT6I.js";import{useShellStrings as l}from"./chunk-JSHMIMAJ.js";import{useId as a,useRef as s,useState as c,useEffect as u,Fragment as d}from"react";import{jsxs as h,jsx as f}from"react/jsx-runtime";var m=(e,t,r)=>Math.min(r,Math.max(t,e)),p=e=>e.reduce((e,t)=>e+t,0),v=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]);var g,b="w-0.5",y=`${b} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var w=["text-blue-700","text-gray-600"];function x({count:x,value:$,onChange:k,label:C,"aria-labelledby":N,readOnly:P=!1,disabled:M=!1,className:j=""}){const K=l().widths,R=a(),S=m(Math.round(x)||1,1,n),z=e($,S),A=z??[...t[S]??[]],B=[...A,100-p(A)],O=P||M,T=s(null),D=s({onChange:k,shown:A,locked:O,n:S,stored:z});D.current={onChange:k,shown:A,locked:O,n:S,stored:z};const I=t=>{const{onChange:r,shown:n,locked:o,n:i}=D.current;if(o)return!1;const l=e(t,i);return!(!l||v(l,n))&&(r(l),!0)},E=(e,t,n)=>{const o=e[t]+e[t+1],i=[...e];i[t]=m(Math.round(n),r,o-r),i[t+1]=o-i[t],I(i.slice(0,-1))&&(ne.current=null)},H=e=>t=>{if(t.altKey||t.ctrlKey||t.metaKey)return;const n=t.shiftKey?10:1,o=B[e]+B[e+1],i="ArrowRight"===t.key?B[e]+n:"ArrowLeft"===t.key?B[e]-n:"PageUp"===t.key?B[e]+10:"PageDown"===t.key?B[e]-10:"Home"===t.key?r:"End"===t.key?o-r:null;null!==i&&(t.preventDefault(),E(B,e,i))},L=s(null),[J,W]=c(null),F=()=>{L.current=null,W(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};u(()=>F,[]);const G=e=>t=>{if(0!==t.button||O)return;t.preventDefault();const r=T.current?.getBoundingClientRect().width??0;r<=0||(L.current={i:e,x:t.clientX,width:r,from:B,moved:!1,pointer:t.pointerId},W(e),t.currentTarget.setPointerCapture?.(t.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},U=e=>{const t=L.current;if(!t)return;if(0===e.buttons)return void F();const r=e.clientX-t.x;if(!t.moved){if(Math.abs(r)<3)return;t.moved=!0}E(t.from,t.i,t.from[t.i]+r/t.width*100)},X=e=>{const t=L.current;t&&(e.currentTarget.hasPointerCapture?.(t.pointer)&&e.currentTarget.releasePointerCapture(t.pointer),F())},Z=(e,t)=>{const{shown:n}=D.current,o=function(e,t,n){const o=e.length,i=[...e];if(o<2)return i;const l=m(Math.round(n),r,100-(o-1)*r);let a=l-i[t];i[t]=l;const s=[...Array.from({length:o-1-t},(e,r)=>t+1+r),...Array.from({length:t},(e,r)=>t-1-r)];if(a<0)return i[s[0]]-=a,i;for(const e of s){if(a<=0)break;const t=Math.min(a,i[e]-r);i[e]-=t,a-=t}return i}([...n,100-p(n)],e,t);return I(o.slice(0,-1))?o:null},[q,V]=c(0);u(()=>{const e=T.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>V(e.getBoundingClientRect().width));return t.observe(e),()=>t.disconnect()},[]);const Q=s(null),[Y,_]=c(null),[ee,te]=c([]),re=(e,t)=>_(r=>t?e:r===e?null:r),ne=s(null),oe=(e,t)=>{const r=ne.current;if(!r||r.column!==e||r.share!==t)return!1;const{onChange:n,locked:o,stored:i}=D.current;var l,a;return o||(l=i,a=r.stored,void 0===l||void 0===a?l===a:v(l,a))||n(r.stored),!0},ie=B.join(",");u(()=>{const e=null===Y?[]:function(e,t){if(!e)return[];const r=Array.from(e.querySelectorAll("input[data-widths-label]")),n=r[t]?.getBoundingClientRect();if(!n||0===n.width)return[];if(void 0===g&&(g=document.createElement("canvas").getContext("2d")),!g)return[];const o=g;return r.flatMap((e,r)=>{if(r===t)return[];const i=e.getBoundingClientRect(),l=getComputedStyle(e);o.font=`${l.fontWeight} ${l.fontSize} ${l.fontFamily}`;const a=o.measureText(e.value).width/2,s=(i.left+i.right)/2;return s+a>n.left&&s-a<n.right?[r]:[]})}(Q.current,Y);te(t=>v(t,e)?t:e)},[Y,ie,q]);const le=K.hint(S,r),ae=B.slice(0,-1).map((e,t)=>p(B.slice(0,t+1)));/* @__PURE__ */
|
|
2
|
+
return h("div",{role:"group","aria-label":N?void 0:C,"aria-labelledby":N,"aria-describedby":S>1?R:void 0,className:`flex w-full min-w-0 flex-col gap-2 ${M?"opacity-60":""} ${j}`.trim(),children:[
|
|
3
3
|
/* @__PURE__ */h("div",{ref:Q,"data-widths-bar":"",className:"relative h-8",children:[
|
|
4
|
-
/* @__PURE__ */f("div",{ref:T,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-surface",children:B.map((e,t)=>/* @__PURE__ */f("div",{"data-widths-segment":"",style:{flexBasis:`${e}%`},className:`flex min-w-0 shrink-0 grow-0 items-center justify-center overflow-hidden whitespace-nowrap text-xs font-medium tabular-nums ${w[t%2]} ${t%2==0?"bg-accent-tint":""}`,children:1===
|
|
5
|
-
/* @__PURE__ */f("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),
|
|
6
|
-
return f("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */f(i,{content:le,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */f(o,{appearance:"bare",value:e,display:()=>(e=>
|
|
4
|
+
/* @__PURE__ */f("div",{ref:T,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-surface",children:B.map((e,t)=>/* @__PURE__ */f("div",{"data-widths-segment":"",style:{flexBasis:`${e}%`},className:`flex min-w-0 shrink-0 grow-0 items-center justify-center overflow-hidden whitespace-nowrap text-xs font-medium tabular-nums ${w[t%2]} ${t%2==0?"bg-accent-tint":""}`,children:1===S&&/* @__PURE__ */f("span",{"data-widths-label":"",children:`${e}%`})},t))}),
|
|
5
|
+
/* @__PURE__ */f("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),S>1&&B.map((e,t)=>/* @__PURE__ */h(d,{children:[(()=>{const n=Y===t,l=p(B.slice(0,t)),a=n?`max(${e}%, 40px)`:`${e}%`;/* @__PURE__ */
|
|
6
|
+
return f("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */f(i,{content:le,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */f(o,{appearance:"bare",value:e,display:()=>(e=>q>0&&q*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:r,max:100-(S-1)*r,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:P,disabled:M,"aria-label":K.column(t+1),"aria-describedby":R,"data-widths-label":"",onChange:e=>{null===e||oe(t,e)||Z(t,e)},onRevert:e=>((e,t)=>{D.current.locked||null===t||oe(e,t)||Z(e,t)})(t,e),onFocus:()=>{ne.current={column:t,share:e,stored:D.current.stored},re(t,!0)},onBlur:()=>re(t,!1),className:`absolute inset-0 text-xs font-medium ${w[t%2]} ${ee.includes(t)&&!n?"opacity-0":""}`})})})})(),t<S-1&&/* @__PURE__ */f("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${ae[t]}%`},children:/* @__PURE__ */f(i,{content:K.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */f("div",{role:"separator",tabIndex:M?-1:0,"aria-orientation":"vertical","aria-label":K.divider(t+1,t+2),"aria-valuenow":B[t],"aria-valuemin":r,"aria-valuemax":B[t]+B[t+1]-r,"aria-valuetext":K.dividerValue(t+1,B[t],t+2,B[t+1]),"aria-disabled":O||void 0,onKeyDown:O?void 0:H(t),onPointerDown:G(t),onPointerMove:U,onPointerUp:X,onPointerCancel:X,onLostPointerCapture:()=>{L.current&&F()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(O?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */f("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(O?`${b} bg-gray-300`:`bg-accent-fill transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${J===t?"w-1":y}`)})})})})]},t))]}),S>1&&/* @__PURE__ */f("span",{id:R,className:"sr-only",children:le})]})}export{x as WidthsBar};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{IconPicker as e}from"./chunk-X34ZBXIU.js";import{ColorPicker as t}from"./chunk-
|
|
2
|
-
return i("div",{role:"group","aria-label":a,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[g?c?/* @__PURE__ */i(s,{children:[
|
|
1
|
+
import{IconPicker as e}from"./chunk-X34ZBXIU.js";import{ColorPicker as t}from"./chunk-MEN4B6NP.js";import{InputNumber_default as r,stepRounding as l}from"./chunk-LBKKKZ4M.js";import{BORDER_LINE_STYLES as o}from"./chunk-NOMWJTN2.js";import{Icon as a}from"./chunk-XZXFUZIK.js";import{jsxs as i,Fragment as s,jsx as n}from"react/jsx-runtime";var d=["top","right","bottom","left"];function m(e){const t=e??{},r="number"==typeof t.width?t.width:0;return Object.fromEntries(d.map(e=>[e,"number"==typeof t[e]?t[e]:r]))}function h(e,t){const r=e??{},l=m(t),o=d.some(e=>"number"==typeof r[e]),a=d.map(e=>"number"==typeof r[e]?r[e]:"number"==typeof r.width?r.width:o?0:l[e]);return!a.every(e=>e===a[0])}var c="h-3.5 w-3.5",u={all:/* @__PURE__ */n(a,{name:"border-all","aria-hidden":"true",className:c}),top:/* @__PURE__ */n(a,{name:"border-top","aria-hidden":"true",className:c}),right:/* @__PURE__ */n(a,{name:"border-right","aria-hidden":"true",className:c}),bottom:/* @__PURE__ */n(a,{name:"border-bottom","aria-hidden":"true",className:c}),left:/* @__PURE__ */n(a,{name:"border-left","aria-hidden":"true",className:c})},p={solid:/* @__PURE__ */n(a,{name:"line-solid","aria-hidden":"true",className:c}),dashed:/* @__PURE__ */n(a,{name:"line-dashed","aria-hidden":"true",className:c}),dotted:/* @__PURE__ */n(a,{name:"line-dotted","aria-hidden":"true",className:c})};function f({label:a,value:m,onChange:h,each:c,placeholder:f,presets:b,words:w,widths:g=!0,styles:y=!0,min:N=0,max:v=20,step:x=1,readOnly:j,units:k}){const S=e=>"number"==typeof m[e]?m[e]:null,C=(e,t)=>{const r={...m};if("number"==typeof m.width)for(const e of d)null===S(e)&&(r[e]=m.width);r[e]=t,delete r.width,h(r)},K=(e,t,o,a,i,s)=>/* @__PURE__ */n("div",{"data-side":e,className:"all"===e?"col-span-2 min-w-0":"min-w-0",children:/* @__PURE__ */n(r,{value:a,onChange:s,min:N,max:v,step:x,...l(x),steppers:"compact",readOnly:j,placeholder:i,prefix:o,suffix:w.unit,units:k,"aria-label":t})}),O=d.map(S),X="number"==typeof m.width?m.width:O.every(e=>null!==e&&e===O[0])?O[0]:null,Z=null===X&&O.some(e=>null!==e),B=d.every(e=>f.sides[e]===f.sides.top)?String(f.sides.top):"–",I=e=>S(e)??("number"==typeof m.width?m.width:null),M=m.style??f.style;/* @__PURE__ */
|
|
2
|
+
return i("div",{role:"group","aria-label":a,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[g?c?/* @__PURE__ */i(s,{children:[K("left",w.sides.left,u.left,I("left"),String(f.sides.left),e=>C("left",e)),K("top",w.sides.top,u.top,I("top"),String(f.sides.top),e=>C("top",e)),K("right",w.sides.right,u.right,I("right"),String(f.sides.right),e=>C("right",e)),K("bottom",w.sides.bottom,u.bottom,I("bottom"),String(f.sides.bottom),e=>C("bottom",e))]}):K("all",w.width,u.all,X,Z?"–":B,e=>{const t={...m,width:e};for(const e of d)delete t[e];h(t)}):null,y&&/* @__PURE__ */n("div",{"data-border-style":"",className:"col-span-2 min-w-0",children:/* @__PURE__ */n(e,{label:w.style,value:M,disabled:j,onChange:e=>{j||h({...m,style:e})},options:o.map(e=>({value:e,label:w.styles[e],icon:p[e]}))})}),
|
|
3
3
|
/* @__PURE__ */n("div",{"data-border-color":"",className:"col-span-2 flex min-w-0 items-center",children:/* @__PURE__ */n(t,{value:m.color??"",onChange:e=>{j||h({...m,color:e})},label:w.color,presets:b,fallback:f.color,showHexInput:!0,size:"md",disabled:j})})]})}export{f as BorderInput,m as borderSides,h as borderStartEach};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{motionSeconds as t}from"./chunk-AIJ3G6BD.js";var e=["none","fade","rise","scale","glide","bounce","flip","reveal","spin"],n=["glide","bounce","flip","reveal"],r=["top","bottom","left","right"],o="bottom",i="data-motion-entrance",a="--motion-entrance-duration",d="--motion-entrance-delay",s="data-motion-from",u="data-motion-state";function c(i,a,d,s){const u=e.includes(i)?i:"none",c=(t=>n.includes(t))(u)?r.includes(a)?a:o:null;return{kind:u,from:c,duration:t("entrance","duration",d),delay:t("entrance","delay",s)}}function f(t){if("none"===t.kind)return{attrs:{},style:{}};const e={[i]:t.kind};t.from&&(e[s]=t.from);const n={},r=c("fade");return t.duration!==r.duration&&(n[a]=`${t.duration}s`),t.delay!==r.delay&&(n[d]=`${t.delay}s`),{attrs:e,style:n}}function l(t){const e=()=>{};if("undefined"==typeof IntersectionObserver)return e;if(!t.getAttribute(i))return e;const n=window.innerHeight||document.documentElement.clientHeight;if(t.getBoundingClientRect().top<n)return e;t.setAttribute(u,"armed");const r=new IntersectionObserver(e=>{for(const n of e)if(n.isIntersecting){r.disconnect(),m(t);break}},{threshold:0});return r.observe(t),()=>{r.disconnect(),t.removeAttribute(u)}}function m(t){if(!t.getAttribute(i))return;t.removeAttribute(u),t.offsetWidth,t.setAttribute(u,"play");const e=n=>{n.target===t&&(t.removeAttribute(u),t.removeEventListener("animationend",e))};t.addEventListener("animationend",e)}export{i as ENTRANCE_ATTR,d as ENTRANCE_DELAY_VAR,a as ENTRANCE_DURATION_VAR,r as ENTRANCE_FROM,s as ENTRANCE_FROM_ATTR,o as ENTRANCE_FROM_DEFAULT,e as ENTRANCE_KINDS,n as ENTRANCE_KINDS_WITH_FROM,u as ENTRANCE_STATE_ATTR,l as armEntrance,f as entranceAttrs,m as playEntrance,c as readEntrance};
|
package/dist/format/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export { ROOT_THEME_ATTRIBUTES, RootThemeOptions, rootIsDark, watchRootTheme } f
|
|
|
9
9
|
export { FOCAL_DEFAULT, FOCAL_NUDGE_COARSE, FOCAL_NUDGE_STEP, FocalPoint, focalFromRect, formatFocal, nudgeFocal, parseFocal } from '../forms/imageFocus.js';
|
|
10
10
|
import { MotionRange } from '../motion/values.js';
|
|
11
11
|
export { HOVER_MOTION, MOTION_EASING, MOTION_GROUPS, MOTION_TIMING, MotionEasing, MotionGroup, MotionTiming, TimedMotionGroup, motionSeconds, rotateDegrees } from '../motion/values.js';
|
|
12
|
-
export { ENTRANCE_ATTR, ENTRANCE_FROM, ENTRANCE_FROM_ATTR, ENTRANCE_FROM_DEFAULT, ENTRANCE_KINDS, ENTRANCE_KINDS_WITH_FROM, ENTRANCE_STATE_ATTR, EntranceFrom, EntranceKind, EntranceValue, armEntrance, entranceAttrs, playEntrance, readEntrance } from '../motion/entrance.js';
|
|
12
|
+
export { ENTRANCE_ATTR, ENTRANCE_DELAY_VAR, ENTRANCE_DURATION_VAR, ENTRANCE_FROM, ENTRANCE_FROM_ATTR, ENTRANCE_FROM_DEFAULT, ENTRANCE_KINDS, ENTRANCE_KINDS_WITH_FROM, ENTRANCE_STATE_ATTR, EntranceFrom, EntranceKind, EntranceValue, armEntrance, entranceAttrs, playEntrance, readEntrance } from '../motion/entrance.js';
|
|
13
13
|
export { B as BORDER_LINE_STYLES, a as BorderLineStyle } from '../borderLineStyles-C-W0uSzL.js';
|
|
14
14
|
export { RowRule, ShowWhenCheck, ShowWhenContext, ShowWhenFactData, ShowWhenFacts, ShowWhenRule, ShowWhenValue, WithShowWhen, WithShowWhenFacts, addShowWhenFacts, isShown, lazyShowWhenContext, showWhenFactReaders, showWhenFactsContext, showWhenOf, shownForOption, truthy, withRowRules, withRowsShownWhen, withShowWhen, withShowWhenFacts } from '../forms/showWhenRule.js';
|
|
15
15
|
|
|
@@ -57,6 +57,31 @@ declare const SCROLL_ATTR = "data-motion-scroll";
|
|
|
57
57
|
declare const PIN_ATTR = "data-motion-pin";
|
|
58
58
|
/** The pinned section's frame: the part of the track that sticks to the screen. */
|
|
59
59
|
declare const PIN_FRAME_ATTR = "data-motion-pin-frame";
|
|
60
|
+
/** A host's mark: this stuck box paints above the sections after it (`pinAttrs` `above`). */
|
|
61
|
+
declare const PIN_ABOVE_ATTR = "data-motion-pin-above";
|
|
62
|
+
/** A part's Zoom, as the scale it ends or starts on (`scrollAttrs`). */
|
|
63
|
+
declare const SCROLL_ZOOM_VAR = "--motion-zoom";
|
|
64
|
+
/** A Zoom part's focus point, `"x% y%"` (`scrollAttrs`). */
|
|
65
|
+
declare const SCROLL_ORIGIN_VAR = "--motion-origin";
|
|
66
|
+
/** A part's Start and End, 0-100 (`scrollAttrs`). */
|
|
67
|
+
declare const SCROLL_START_VAR = "--motion-scroll-start";
|
|
68
|
+
declare const SCROLL_END_VAR = "--motion-scroll-end";
|
|
69
|
+
/** A part's progress, 0-1, where the browser has no scroll timelines (`armScrollProgress`). */
|
|
70
|
+
declare const SCROLL_PROGRESS_VAR = "--motion-p";
|
|
71
|
+
/** A view's answer for a track: 1 = pinned (default), 0 = a plain section. */
|
|
72
|
+
declare const PIN_ON_VAR = "--motion-pin-on";
|
|
73
|
+
/** Where a pin stops, from the screen top (default 0px), both forms. */
|
|
74
|
+
declare const PIN_TOP_VAR = "--motion-pin-top";
|
|
75
|
+
/** A track's effect screens (`pinAttrs`; default `PIN_LENGTH.default`). */
|
|
76
|
+
declare const PIN_LENGTH_VAR = "--motion-pin-length";
|
|
77
|
+
/** The stick form's position in a view: sticky (default), or static where it is off. */
|
|
78
|
+
declare const PIN_POSITION_VAR = "--motion-pin-position";
|
|
79
|
+
/** A view's answer for a track: 1 = draw the stick look, 0 = the track (default). Written by `pinStickVars` only. */
|
|
80
|
+
declare const PIN_STICK_VAR = "--motion-pin-stick";
|
|
81
|
+
/** A track's position in a view: relative (default), sticky where it sticks. Written by `pinStickVars` only. */
|
|
82
|
+
declare const PIN_TRACK_POSITION_VAR = "--motion-pin-track-position";
|
|
83
|
+
/** The stack order of a box marked `PIN_ABOVE_ATTR` (default 30: over the later sections, under a host header and its page overlays). */
|
|
84
|
+
declare const PIN_ABOVE_Z_VAR = "--motion-pin-above-z";
|
|
60
85
|
interface ScrollValue {
|
|
61
86
|
readonly effect: ScrollEffect;
|
|
62
87
|
/** Percent, inside `SCROLL_ZOOM`. */
|
|
@@ -94,15 +119,32 @@ declare function scrollAttrs(value: ScrollValue, origin?: string): {
|
|
|
94
119
|
};
|
|
95
120
|
/** A stored pin, read. Only `true` pins; the length clamps to `PIN_LENGTH`. */
|
|
96
121
|
declare function readPin(on: unknown, length?: unknown): PinValue;
|
|
122
|
+
/**
|
|
123
|
+
* A view's stick answer for a track, as the values `motion.css` reads: stuck
|
|
124
|
+
* is `--motion-pin-stick: 1` AND `--motion-pin-track-position: sticky`, not
|
|
125
|
+
* stuck is `0` AND `relative` (the defaults, written out so a view rule can
|
|
126
|
+
* turn stick off where the base view has it on). CSS cannot turn a number
|
|
127
|
+
* into a position keyword, so the two always travel together. The one writer
|
|
128
|
+
* of both: a host with a different answer per view calls it once per view and
|
|
129
|
+
* puts the result in that view's rule; `pinAttrs` uses it for a track that
|
|
130
|
+
* sticks in every view.
|
|
131
|
+
*/
|
|
132
|
+
declare function pinStickVars(stick: boolean): Record<string, string>;
|
|
97
133
|
/**
|
|
98
134
|
* What the pinned element carries. Off writes nothing. The track form writes a
|
|
99
|
-
* length other than the default
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
135
|
+
* length other than the default, and the stick values (`pinStickVars`) when
|
|
136
|
+
* `stick` says the track sticks in every view; the stick form has no length
|
|
137
|
+
* (the section is its own frame) and already sticks. A host's stop and view
|
|
138
|
+
* answers go in its own stylesheet: both forms read `--motion-pin-top`; the
|
|
139
|
+
* track reads `--motion-pin-on`, `--motion-pin-length` and the stick pair; the
|
|
140
|
+
* stick form reads `--motion-pin-position` (it ignores `--motion-pin-on`).
|
|
141
|
+
* `above` marks a stuck box that stays painted above the sections after it
|
|
142
|
+
* (a bar); a track takes the mark only where a view draws it stuck.
|
|
104
143
|
*/
|
|
105
|
-
declare function pinAttrs(value: PinValue, form?: PinForm
|
|
144
|
+
declare function pinAttrs(value: PinValue, form?: PinForm, options?: {
|
|
145
|
+
readonly stick?: boolean;
|
|
146
|
+
readonly above?: boolean;
|
|
147
|
+
}): {
|
|
106
148
|
attrs: Record<string, string>;
|
|
107
149
|
style: Record<string, string>;
|
|
108
150
|
};
|
|
@@ -161,4 +203,4 @@ type HoverKind = (typeof HOVER_KINDS)[number];
|
|
|
161
203
|
/** The kinds of {@link HOVER_KINDS} in `offered`, in the list's order. */
|
|
162
204
|
declare function hoverKindsOf<K extends HoverKind>(offered: readonly K[]): readonly K[];
|
|
163
205
|
|
|
164
|
-
export { HOVER_KINDS, type HoverKind, type LayoutNode, MotionRange, PIN_ATTR, PIN_FORMS, PIN_FRAME_ATTR, PIN_LENGTH, type PinForm, type PinValue, SCROLL_ATTR, SCROLL_EFFECTS, SCROLL_EFFECTS_WITH_ZOOM, SCROLL_END, SCROLL_START, SCROLL_ZOOM, type ScrollBox, type ScrollEffect, type ScrollValue, armScrollProgress, hoverKindsOf, layoutBox, pinAttrs, readPin, readScroll, scrollAttrs, scrollProgress };
|
|
206
|
+
export { HOVER_KINDS, type HoverKind, type LayoutNode, MotionRange, PIN_ABOVE_ATTR, PIN_ABOVE_Z_VAR, PIN_ATTR, PIN_FORMS, PIN_FRAME_ATTR, PIN_LENGTH, PIN_LENGTH_VAR, PIN_ON_VAR, PIN_POSITION_VAR, PIN_STICK_VAR, PIN_TOP_VAR, PIN_TRACK_POSITION_VAR, type PinForm, type PinValue, SCROLL_ATTR, SCROLL_EFFECTS, SCROLL_EFFECTS_WITH_ZOOM, SCROLL_END, SCROLL_END_VAR, SCROLL_ORIGIN_VAR, SCROLL_PROGRESS_VAR, SCROLL_START, SCROLL_START_VAR, SCROLL_ZOOM, SCROLL_ZOOM_VAR, type ScrollBox, type ScrollEffect, type ScrollValue, armScrollProgress, hoverKindsOf, layoutBox, pinAttrs, pinStickVars, readPin, readScroll, scrollAttrs, scrollProgress };
|
package/dist/format/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{slugify}from"../chunk-24AL3CDS.js";export{ENTRANCE_ATTR,ENTRANCE_FROM,ENTRANCE_FROM_ATTR,ENTRANCE_FROM_DEFAULT,ENTRANCE_KINDS,ENTRANCE_KINDS_WITH_FROM,ENTRANCE_STATE_ATTR,armEntrance,entranceAttrs,playEntrance,readEntrance}from"../chunk-
|
|
1
|
+
export{slugify}from"../chunk-24AL3CDS.js";import{ENTRANCE_ATTR as t}from"../chunk-ZSEB7XW4.js";export{ENTRANCE_ATTR,ENTRANCE_DELAY_VAR,ENTRANCE_DURATION_VAR,ENTRANCE_FROM,ENTRANCE_FROM_ATTR,ENTRANCE_FROM_DEFAULT,ENTRANCE_KINDS,ENTRANCE_KINDS_WITH_FROM,ENTRANCE_STATE_ATTR,armEntrance,entranceAttrs,playEntrance,readEntrance}from"../chunk-ZSEB7XW4.js";export{HOVER_MOTION,MOTION_EASING,MOTION_GROUPS,MOTION_TIMING,motionSeconds,rotateDegrees}from"../chunk-AIJ3G6BD.js";export{hexWithAlpha,mixHex,rgbToHex}from"../chunk-CJSZW3OS.js";export{addShowWhenFacts,isShown,lazyShowWhenContext,showWhenFactReaders,showWhenFactsContext,showWhenOf,shownForOption,truthy,withRowRules,withRowsShownWhen,withShowWhen,withShowWhenFacts}from"../chunk-HCP7WOAL.js";export{fromDateKey,toDateKey}from"../chunk-2HMNOLKX.js";export{BORDER_LINE_STYLES}from"../chunk-NOMWJTN2.js";export{contrastRatio,hexToRgb,parseHexColor,readableInk,relativeLuminance}from"../chunk-S6OB6HJB.js";export{FOCAL_DEFAULT,FOCAL_NUDGE_COARSE,FOCAL_NUDGE_STEP,focalFromRect,formatFocal,nudgeFocal,parseFocal}from"../chunk-25RR3GQW.js";export{escapeHtml}from"../chunk-G6DKCCWH.js";export{currencyDecimals,currencySymbol,formatBytes,formatMoney,setCurrencyFormats,timeAgo}from"../chunk-GEYM4WN3.js";export{DATE_FORMAT_OPTIONS,TZ_AUTO,formatDate,formatDateTime,formatTime,getUserDateFormat,getUserTimezone,setUserDateFormat,setUserTimezone,syncTimezoneFromProfile}from"../chunk-Y3JW2GW5.js";export{EMPTY_VALUE}from"../chunk-36BRD5J3.js";import"../chunk-LF27WIN2.js";export{ROOT_THEME_ATTRIBUTES,rootIsDark,watchRootTheme}from"../chunk-LNXBTK7Q.js";var e=["none","zoom-in","zoom-out","fade-in","fade-out","move-up","move-down","reveal","parallax"],o=["zoom-in","zoom-out"],n=(t,e,o,n)=>({default:t,min:e,max:o,step:n}),r=n(30,0,100,10),i=n(0,0,100,5),s=n(100,0,100,5),a=n(2,0,4,.5),m="data-motion-scroll",u="data-motion-pin",c="data-motion-pin-frame",l="data-motion-pin-above",f="--motion-zoom",h="--motion-origin",p="--motion-scroll-start",d="--motion-scroll-end",T="--motion-p",E="--motion-pin-on",N="--motion-pin-top",A="--motion-pin-length",S="--motion-pin-position",R="--motion-pin-stick",g="--motion-pin-track-position",y="--motion-pin-above-z",w=["track","stick"],x=/^\s*-?\d+(\.\d+)?\s*$/;function F(t,e){const o="number"==typeof e?e:"string"==typeof e&&x.test(e)?Number(e):Number.NaN;if(!Number.isFinite(o))return t.default;const n=Math.min(t.max,Math.max(t.min,o)),r=Math.round(Number((n/t.step).toFixed(6)));return Number((r*t.step).toFixed(3))}function O(t,o,n,a){const m=e.includes(t)?t:"none",u=F(i,n),c=F(s,a);return{effect:m,zoom:F(r,o),start:Math.min(u,c),end:Math.max(u,c)}}function _(t,e){if("none"===t.effect)return{attrs:{},style:{}};const n={};var r;return r=t.effect,o.includes(r)&&(n[f]=String(Number((1+t.zoom/100).toFixed(3))),e&&(n[h]=e)),t.start!==i.default&&(n[p]=String(t.start)),t.end!==s.default&&(n[d]=String(t.end)),{attrs:{[m]:t.effect},style:n}}function k(t,e){return{on:!0===t,length:F(a,e)}}function C(t){return t?{[R]:"1",[g]:"sticky"}:{[R]:"0",[g]:"relative"}}function v(t,e="track",o={}){if(!t.on)return{attrs:{},style:{}};const n=!0===o.above?{[l]:""}:{};if("stick"===e)return{attrs:{[u]:"stick",...n},style:{}};const r=t.length===a.default?{}:{[A]:String(t.length)};return{attrs:{[u]:"",...n},style:!0===o.stick?{...r,...C(!0)}:r}}function D(t,e,o,n){let r;if(e){const t=e.length*e.vh;r=t>0?((e.stop??0)-e.top)/t:1}else r=(t.vh-t.top)/(t.vh+t.height);const i=o/100,s=n/100,a=s>i?(r-i)/(s-i):r>=s?1:0;return Math.min(1,Math.max(0,Number(a.toFixed(4))))}var M=(t,e)=>{const o=Number.parseFloat(t);return Number.isFinite(o)?o:e};function W(e=document){const o=()=>{};if("undefined"==typeof window||"undefined"==typeof CSS)return o;if(CSS.supports("animation-timeline: view()"))return o;let n=0;const r=()=>{n=0;const o=window.innerHeight||document.documentElement.clientHeight,r=[];for(const n of e.querySelectorAll(`[${m}]`)){if(n.hasAttribute(t))continue;const e=getComputedStyle(n),m=n.closest(`[${u}]:not([${u}="stick"])`),l=m?getComputedStyle(m):null,f=!!l&&(0===M(l.getPropertyValue(E),1)||0!==M(l.getPropertyValue(R),0)),h=I(f&&m?m:n,o),T=m?.querySelector(`[${c}]`),N=m&&!f?{...I(m,o),length:M(l.getPropertyValue(A),a.default),stop:T?M(getComputedStyle(T).top,0):0}:null;r.push({el:n,p:D({top:h.top,height:h.height,vh:o},N,M(e.getPropertyValue(p),i.default),M(e.getPropertyValue(d),s.default))})}for(const{el:t,p:e}of r)t.style.setProperty(T,String(e))},l=()=>{n||(n=requestAnimationFrame(r))};return r(),window.addEventListener("scroll",l,{passive:!0}),window.addEventListener("resize",l,{passive:!0}),()=>{n&&cancelAnimationFrame(n),window.removeEventListener("scroll",l),window.removeEventListener("resize",l)}}function I(t,e,o=("undefined"==typeof window?0:window.scrollY)){let n=0;for(let e=t;e;e=e.offsetParent)n+=e.offsetTop;return{top:n-o,height:t.offsetHeight,vh:e}}var L=["none","nextImage","rotate","zoom","lift","mono"];function b(t){return L.filter(e=>t.includes(e))}export{L as HOVER_KINDS,l as PIN_ABOVE_ATTR,y as PIN_ABOVE_Z_VAR,u as PIN_ATTR,w as PIN_FORMS,c as PIN_FRAME_ATTR,a as PIN_LENGTH,A as PIN_LENGTH_VAR,E as PIN_ON_VAR,S as PIN_POSITION_VAR,R as PIN_STICK_VAR,N as PIN_TOP_VAR,g as PIN_TRACK_POSITION_VAR,m as SCROLL_ATTR,e as SCROLL_EFFECTS,o as SCROLL_EFFECTS_WITH_ZOOM,s as SCROLL_END,d as SCROLL_END_VAR,h as SCROLL_ORIGIN_VAR,T as SCROLL_PROGRESS_VAR,i as SCROLL_START,p as SCROLL_START_VAR,r as SCROLL_ZOOM,f as SCROLL_ZOOM_VAR,W as armScrollProgress,b as hoverKindsOf,I as layoutBox,v as pinAttrs,C as pinStickVars,k as readPin,O as readScroll,_ as scrollAttrs,D as scrollProgress};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ColorPreset } from './ColorPicker.js';
|
|
3
|
+
import { UnitChoice } from './UnitMenu.js';
|
|
3
4
|
import { Side } from './SidesInput.js';
|
|
4
5
|
import { a as BorderLineStyle } from '../borderLineStyles-C-W0uSzL.js';
|
|
5
6
|
export { B as BORDER_LINE_STYLES } from '../borderLineStyles-C-W0uSzL.js';
|
|
@@ -60,7 +61,12 @@ interface BorderInputProps {
|
|
|
60
61
|
max?: number;
|
|
61
62
|
step?: number;
|
|
62
63
|
readOnly?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* The units this row offers (`UnitChoice`): the unit in the box becomes the
|
|
66
|
+
* one unit menu (`unitBox`). Left out, or one unit, it is plain text.
|
|
67
|
+
*/
|
|
68
|
+
units?: UnitChoice;
|
|
63
69
|
}
|
|
64
|
-
declare function BorderInput({ label, value, onChange, each, placeholder, presets, words, widths, styles, min, max, step, readOnly, }: BorderInputProps): react_jsx_runtime.JSX.Element;
|
|
70
|
+
declare function BorderInput({ label, value, onChange, each, placeholder, presets, words, widths, styles, min, max, step, readOnly, units, }: BorderInputProps): react_jsx_runtime.JSX.Element;
|
|
65
71
|
|
|
66
72
|
export { type BorderInputProps, BorderLineStyle, type BorderValue, borderSides, borderStartEach, BorderInput as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{borderSides,borderStartEach,BorderInput as default}from"../chunk-
|
|
2
|
+
export{borderSides,borderStartEach,BorderInput as default}from"../chunk-YW3UKSON.js";import"../chunk-X34ZBXIU.js";import"../chunk-MEN4B6NP.js";import"../chunk-64RHGJXK.js";import"../chunk-LBKKKZ4M.js";import"../chunk-TOVEZAIM.js";import"../chunk-2NMW66P5.js";export{BORDER_LINE_STYLES}from"../chunk-NOMWJTN2.js";import"../chunk-S6OB6HJB.js";import"../chunk-SFULX4E3.js";import"../chunk-FTMCNC66.js";import"../chunk-SV5RRBVA.js";import"../chunk-AYZY3YNC.js";import"../chunk-DWGYC7OD.js";import"../chunk-THLXDI76.js";import"../chunk-URHGHXDN.js";import"../chunk-5QFPTDQF.js";import"../chunk-M5K4AX4E.js";import"../chunk-XZXFUZIK.js";import"../chunk-J75ZT2JQ.js";import"../chunk-SOZCWT6I.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-UQYNPYF4.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-JSHMIMAJ.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{ColorPickerPanel,ColorSwatch,HexInput,NO_COLOR_FILL,clampOpacity,colorFill,colorSwatchClasses,ColorPicker as default,stepHue,stepOpacity,stepSquare}from"../chunk-
|
|
2
|
+
export{ColorPickerPanel,ColorSwatch,HexInput,NO_COLOR_FILL,clampOpacity,colorFill,colorSwatchClasses,ColorPicker as default,stepHue,stepOpacity,stepSquare}from"../chunk-MEN4B6NP.js";import"../chunk-64RHGJXK.js";import"../chunk-LBKKKZ4M.js";import"../chunk-TOVEZAIM.js";import"../chunk-2NMW66P5.js";import"../chunk-S6OB6HJB.js";import"../chunk-SFULX4E3.js";import"../chunk-FTMCNC66.js";import"../chunk-SV5RRBVA.js";import"../chunk-AYZY3YNC.js";import"../chunk-DWGYC7OD.js";import"../chunk-THLXDI76.js";import"../chunk-URHGHXDN.js";import"../chunk-5QFPTDQF.js";import"../chunk-M5K4AX4E.js";import"../chunk-XZXFUZIK.js";import"../chunk-J75ZT2JQ.js";import"../chunk-SOZCWT6I.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-UQYNPYF4.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-JSHMIMAJ.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { UnitChoice } from './UnitMenu.js';
|
|
3
|
+
import 'react';
|
|
2
4
|
|
|
3
5
|
/** One of the four corners {@link CornersInputProps} offers. */
|
|
4
6
|
interface CornerOption {
|
|
@@ -54,6 +56,13 @@ interface CornersInputProps {
|
|
|
54
56
|
/** What the empty radius box shows and means — the inherited number, or
|
|
55
57
|
* "Auto". A number here is where the first step starts. */
|
|
56
58
|
radiusPlaceholder?: string;
|
|
59
|
+
/** The radius's unit in force. Default: the catalogue's ("px"). */
|
|
60
|
+
radiusUnit?: string;
|
|
61
|
+
/**
|
|
62
|
+
* The units this row offers (`UnitChoice`): the radius box's unit becomes the
|
|
63
|
+
* one unit menu (`unitBox`). Left out, or one unit, it is plain text.
|
|
64
|
+
*/
|
|
65
|
+
units?: UnitChoice;
|
|
57
66
|
/**
|
|
58
67
|
* The whole row is off: the radius box is disabled and every corner is off
|
|
59
68
|
* (`aria-disabled`, so the keyboard still reaches it), the set still shown.
|
|
@@ -66,6 +75,6 @@ interface CornersInputProps {
|
|
|
66
75
|
id?: string;
|
|
67
76
|
className?: string;
|
|
68
77
|
}
|
|
69
|
-
declare function CornersInput({ label, value, corners, onChange, radius, onRadiusChange, radiusLabel, radiusMin, radiusMax, radiusStep, radiusPlaceholder, disabled, disabledReason, id, className, }: CornersInputProps): react_jsx_runtime.JSX.Element;
|
|
78
|
+
declare function CornersInput({ label, value, corners, onChange, radius, onRadiusChange, radiusLabel, radiusMin, radiusMax, radiusStep, radiusPlaceholder, radiusUnit, units, disabled, disabledReason, id, className, }: CornersInputProps): react_jsx_runtime.JSX.Element;
|
|
70
79
|
|
|
71
80
|
export { type CornerOption, type CornersInputProps, CornersInput as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{CornersInput as default}from"../chunk-
|
|
2
|
+
export{CornersInput as default}from"../chunk-WBGJ4XB7.js";import"../chunk-LBKKKZ4M.js";import"../chunk-TOVEZAIM.js";import"../chunk-2NMW66P5.js";import"../chunk-SFULX4E3.js";import"../chunk-FTMCNC66.js";import"../chunk-SV5RRBVA.js";import"../chunk-AYZY3YNC.js";import"../chunk-DWGYC7OD.js";import"../chunk-THLXDI76.js";import"../chunk-URHGHXDN.js";import"../chunk-5QFPTDQF.js";import"../chunk-M5K4AX4E.js";import"../chunk-XZXFUZIK.js";import"../chunk-J75ZT2JQ.js";import"../chunk-SOZCWT6I.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-UQYNPYF4.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-JSHMIMAJ.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { InputSize } from './styles.js';
|
|
4
|
+
import { UnitChoice } from './UnitMenu.js';
|
|
5
|
+
import 'react/jsx-runtime';
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* `box` (default): the kit's field (`inputClasses`), with its prefix, suffix
|
|
@@ -46,6 +48,16 @@ interface InputNumberProps {
|
|
|
46
48
|
* "5%" still parses; only the drawing changes.
|
|
47
49
|
*/
|
|
48
50
|
suffixControl?: ReactNode;
|
|
51
|
+
/**
|
|
52
|
+
* The units this length box offers (`UnitChoice`): the unit text in
|
|
53
|
+
* `suffix` becomes the one unit menu (`UnitMenu`, through `unitBox`). Left
|
|
54
|
+
* out, or one unit, the unit is plain text. Every length input in the kit
|
|
55
|
+
* (`Slider`, `SidesInput`, `CornersInput`, `BorderInput`, `PositionInput`)
|
|
56
|
+
* passes its own `units` here, so the menu is drawn in this one place.
|
|
57
|
+
* Needs a string `suffix` (the unit in force). An explicit `suffixControl`
|
|
58
|
+
* wins over `units`.
|
|
59
|
+
*/
|
|
60
|
+
units?: UnitChoice;
|
|
49
61
|
id?: string;
|
|
50
62
|
name?: string;
|
|
51
63
|
/** Names the field where no `<label htmlFor>` does — a value box beside a
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{InputNumber_default as default,stepRounding}from"../chunk-
|
|
2
|
+
export{InputNumber_default as default,stepRounding}from"../chunk-LBKKKZ4M.js";import"../chunk-TOVEZAIM.js";import"../chunk-2NMW66P5.js";import"../chunk-SFULX4E3.js";import"../chunk-FTMCNC66.js";import"../chunk-SV5RRBVA.js";import"../chunk-AYZY3YNC.js";import"../chunk-DWGYC7OD.js";import"../chunk-THLXDI76.js";import"../chunk-URHGHXDN.js";import"../chunk-5QFPTDQF.js";import"../chunk-M5K4AX4E.js";import"../chunk-XZXFUZIK.js";import"../chunk-J75ZT2JQ.js";import"../chunk-SOZCWT6I.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-UQYNPYF4.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-JSHMIMAJ.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { UnitChoice } from './UnitMenu.js';
|
|
3
|
+
import 'react';
|
|
2
4
|
|
|
3
5
|
type PositionAxis = 'x' | 'y';
|
|
4
6
|
type PositionValue = Record<PositionAxis, number | null>;
|
|
@@ -19,7 +21,12 @@ interface PositionInputProps {
|
|
|
19
21
|
max?: number;
|
|
20
22
|
step?: number;
|
|
21
23
|
readOnly?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* The units this row offers (`UnitChoice`): the unit in the box becomes the
|
|
26
|
+
* one unit menu (`unitBox`). Left out, or one unit, it is plain text.
|
|
27
|
+
*/
|
|
28
|
+
units?: UnitChoice;
|
|
22
29
|
}
|
|
23
|
-
declare function PositionInput({ label, value, onChange, words, placeholder, min, max, step, readOnly, }: PositionInputProps): react_jsx_runtime.JSX.Element;
|
|
30
|
+
declare function PositionInput({ label, value, onChange, words, placeholder, min, max, step, readOnly, units, }: PositionInputProps): react_jsx_runtime.JSX.Element;
|
|
24
31
|
|
|
25
32
|
export { type PositionAxis, type PositionInputProps, type PositionValue, PositionInput as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{PositionInput as default}from"../chunk-
|
|
2
|
+
export{PositionInput as default}from"../chunk-G2Y5I5OR.js";import"../chunk-LBKKKZ4M.js";import"../chunk-TOVEZAIM.js";import"../chunk-2NMW66P5.js";import"../chunk-SFULX4E3.js";import"../chunk-FTMCNC66.js";import"../chunk-SV5RRBVA.js";import"../chunk-AYZY3YNC.js";import"../chunk-DWGYC7OD.js";import"../chunk-THLXDI76.js";import"../chunk-URHGHXDN.js";import"../chunk-5QFPTDQF.js";import"../chunk-M5K4AX4E.js";import"../chunk-XZXFUZIK.js";import"../chunk-J75ZT2JQ.js";import"../chunk-SOZCWT6I.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-UQYNPYF4.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-JSHMIMAJ.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { UnitChoice } from './UnitMenu.js';
|
|
3
|
+
import 'react';
|
|
2
4
|
|
|
3
5
|
type Side = 'top' | 'right' | 'bottom' | 'left';
|
|
4
6
|
type SidesValue = Record<Side, number | null>;
|
|
@@ -36,12 +38,7 @@ interface SidesInputProps {
|
|
|
36
38
|
* out, the unit is plain text. `words.unit` stays the unit in force, and the
|
|
37
39
|
* host gives `min`, `max` and `step` for it.
|
|
38
40
|
*/
|
|
39
|
-
units?:
|
|
40
|
-
options: readonly string[];
|
|
41
|
-
onChange: (unit: string) => void;
|
|
42
|
-
/** The control's name ("Unit"). */
|
|
43
|
-
label: string;
|
|
44
|
-
};
|
|
41
|
+
units?: UnitChoice;
|
|
45
42
|
}
|
|
46
43
|
type SidesGlyphs = 'padding' | 'crop';
|
|
47
44
|
/** Where a host starts `each`: on when a pair reads as two different numbers. */
|
package/dist/forms/SidesInput.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{SidesEachToggle,SidesInput as default,sidesStartEach}from"../chunk-
|
|
2
|
+
export{SidesEachToggle,SidesInput as default,sidesStartEach}from"../chunk-OM42AUMS.js";import"../chunk-LBKKKZ4M.js";import"../chunk-TOVEZAIM.js";import"../chunk-2NMW66P5.js";import"../chunk-SFULX4E3.js";import"../chunk-FTMCNC66.js";import"../chunk-SV5RRBVA.js";import"../chunk-AYZY3YNC.js";import"../chunk-DWGYC7OD.js";import"../chunk-THLXDI76.js";import"../chunk-URHGHXDN.js";import"../chunk-5QFPTDQF.js";import"../chunk-M5K4AX4E.js";import"../chunk-XZXFUZIK.js";import"../chunk-J75ZT2JQ.js";import"../chunk-SOZCWT6I.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-UQYNPYF4.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-JSHMIMAJ.js";import"../chunk-C3QOHMR6.js";
|
package/dist/forms/Slider.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { UnitChoice } from './UnitMenu.js';
|
|
3
4
|
|
|
4
5
|
type SliderSize = 'sm' | 'md';
|
|
5
6
|
interface SliderProps {
|
|
@@ -26,6 +27,23 @@ interface SliderProps {
|
|
|
26
27
|
inputMax?: number;
|
|
27
28
|
/** A unit drawn inside the box's right edge — "px", "%". */
|
|
28
29
|
suffix?: ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* The units this row offers (`UnitChoice`): the box's unit (`suffix`, which
|
|
32
|
+
* must then be a string; a non-string `suffix` draws no menu) becomes the
|
|
33
|
+
* one unit menu. Left out, or one unit, it is plain text. The host gives
|
|
34
|
+
* `min`, `max` and `step` for the unit in force.
|
|
35
|
+
*/
|
|
36
|
+
units?: UnitChoice;
|
|
37
|
+
/**
|
|
38
|
+
* The value is final: the range's own `change` (let go after a drag, or a
|
|
39
|
+
* key that moved it), or the box left or given Enter. Called only when the
|
|
40
|
+
* value differs from the one at the last commit or at the start of the
|
|
41
|
+
* gesture, so a Tab through or a key at the end of the range commits
|
|
42
|
+
* nothing. `null` is an emptied box on a slider that may be empty
|
|
43
|
+
* (`emptyLabel`, `placeholderValue`). A host that writes on release needs no
|
|
44
|
+
* listener of its own on the range.
|
|
45
|
+
*/
|
|
46
|
+
onCommit?: (value: number | null) => void;
|
|
29
47
|
/** Show the typed box. Default true. */
|
|
30
48
|
showInput?: boolean;
|
|
31
49
|
/**
|
|
@@ -90,6 +108,6 @@ declare function settleSliderValue(value: number, lo: number, hi: number, places
|
|
|
90
108
|
declare function SliderGroup({ children }: {
|
|
91
109
|
children: ReactNode;
|
|
92
110
|
}): react_jsx_runtime.JSX.Element;
|
|
93
|
-
declare function Slider({ value, onChange, min, max, step, shiftStep, precision, inputMin, inputMax, suffix, showInput, emptyLabel, placeholderValue, stepFrom, label, 'aria-labelledby': labelledBy, valueText, id, disabled, size, boxSize, className, auto: autoProp, }: SliderProps): react_jsx_runtime.JSX.Element;
|
|
111
|
+
declare function Slider({ value, onChange: onChangeProp, min, max, step, shiftStep, precision, inputMin, inputMax, suffix, units, onCommit, showInput, emptyLabel, placeholderValue, stepFrom, label, 'aria-labelledby': labelledBy, valueText, id, disabled, size, boxSize, className, auto: autoProp, }: SliderProps): react_jsx_runtime.JSX.Element;
|
|
94
112
|
|
|
95
113
|
export { SliderGroup, type SliderProps, type SliderSize, Slider as default, settleSliderValue, sliderBoxChars, stepDecimals };
|
package/dist/forms/Slider.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{SliderGroup,Slider as default,settleSliderValue,sliderBoxChars,stepDecimals}from"../chunk-
|
|
2
|
+
export{SliderGroup,Slider as default,settleSliderValue,sliderBoxChars,stepDecimals}from"../chunk-63TCQAGE.js";import"../chunk-LBKKKZ4M.js";import"../chunk-TOVEZAIM.js";import"../chunk-2NMW66P5.js";import"../chunk-SFULX4E3.js";import"../chunk-FTMCNC66.js";import"../chunk-SV5RRBVA.js";import"../chunk-AYZY3YNC.js";import"../chunk-DWGYC7OD.js";import"../chunk-THLXDI76.js";import"../chunk-URHGHXDN.js";import"../chunk-5QFPTDQF.js";import"../chunk-M5K4AX4E.js";import"../chunk-XZXFUZIK.js";import"../chunk-J75ZT2JQ.js";import"../chunk-SOZCWT6I.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-UQYNPYF4.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-JSHMIMAJ.js";import"../chunk-C3QOHMR6.js";
|
package/dist/forms/UnitMenu.d.ts
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
2
3
|
|
|
4
|
+
/**
|
|
5
|
+
* The units a length box offers: ONE shape for every length input (`Slider`,
|
|
6
|
+
* `SidesInput`, `CornersInput`, `BorderInput`, `PositionInput`). The unit in
|
|
7
|
+
* force is the input's own unit text (its `suffix`, `words.unit` or
|
|
8
|
+
* `radiusUnit`); this names the others it may change to.
|
|
9
|
+
*/
|
|
10
|
+
interface UnitChoice {
|
|
11
|
+
/** The units this row offers, in the order the list shows them. */
|
|
12
|
+
options: readonly string[];
|
|
13
|
+
/** A different unit was chosen. */
|
|
14
|
+
onChange: (unit: string) => void;
|
|
15
|
+
/** The control's name ("Unit"). */
|
|
16
|
+
label: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* What a length box draws for its unit — THE one place `units` turns into the
|
|
20
|
+
* box's unit. `InputNumber` calls it; every length input passes `units`
|
|
21
|
+
* there. `unit` is the box's `suffix` and stays it, so a typed "5%" still parses. With
|
|
22
|
+
* two or more units it is the `UnitMenu`; with one, or none, it is plain text
|
|
23
|
+
* (a list of one entry is no choice).
|
|
24
|
+
*/
|
|
25
|
+
declare function unitBox(unit: string, units: UnitChoice | undefined, disabled?: boolean): ReactNode | undefined;
|
|
3
26
|
interface UnitMenuProps {
|
|
4
27
|
/** The unit in force, drawn as the trigger. */
|
|
5
28
|
value: string;
|
|
@@ -13,4 +36,4 @@ interface UnitMenuProps {
|
|
|
13
36
|
}
|
|
14
37
|
declare function UnitMenu({ value, options, onChange, label, disabled }: UnitMenuProps): react_jsx_runtime.JSX.Element;
|
|
15
38
|
|
|
16
|
-
export { type UnitMenuProps, UnitMenu as default };
|
|
39
|
+
export { type UnitChoice, type UnitMenuProps, UnitMenu as default, unitBox };
|
package/dist/forms/UnitMenu.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
export{UnitMenu as default,unitBox}from"../chunk-TOVEZAIM.js";import"../chunk-SFULX4E3.js";import"../chunk-FTMCNC66.js";import"../chunk-DWGYC7OD.js";import"../chunk-THLXDI76.js";import"../chunk-URHGHXDN.js";import"../chunk-5QFPTDQF.js";import"../chunk-XZXFUZIK.js";import"../chunk-J75ZT2JQ.js";import"../chunk-SOZCWT6I.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";
|
package/dist/forms/WidthsBar.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{WidthsBar as default}from"../chunk-
|
|
2
|
+
export{WidthsBar as default}from"../chunk-XHZVUO6F.js";import"../chunk-PLGJOHEG.js";import"../chunk-LBKKKZ4M.js";import"../chunk-TOVEZAIM.js";import"../chunk-2NMW66P5.js";import"../chunk-SFULX4E3.js";import"../chunk-FTMCNC66.js";import"../chunk-SV5RRBVA.js";import"../chunk-AYZY3YNC.js";import"../chunk-DWGYC7OD.js";import"../chunk-THLXDI76.js";import"../chunk-URHGHXDN.js";import"../chunk-5QFPTDQF.js";import"../chunk-M5K4AX4E.js";import"../chunk-XZXFUZIK.js";import"../chunk-J75ZT2JQ.js";import"../chunk-SOZCWT6I.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-UQYNPYF4.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-JSHMIMAJ.js";import"../chunk-C3QOHMR6.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export { default as TileButton, TileButtonProps, TileSize } from './forms/TileBu
|
|
|
42
42
|
export { default as Segmented, SegmentedOption, SegmentedProps, SegmentedSize } from './forms/Segmented.js';
|
|
43
43
|
export { default as IconPicker, IconPickerOption, IconPickerProps } from './forms/IconPicker.js';
|
|
44
44
|
export { Side, SidesEachToggle, SidesGlyphs, default as SidesInput, SidesInputProps, SidesValue, sidesStartEach } from './forms/SidesInput.js';
|
|
45
|
-
export { default as UnitMenu, UnitMenuProps } from './forms/UnitMenu.js';
|
|
45
|
+
export { UnitChoice, default as UnitMenu, UnitMenuProps } from './forms/UnitMenu.js';
|
|
46
46
|
export { PositionAxis, default as PositionInput, PositionInputProps, PositionValue } from './forms/PositionInput.js';
|
|
47
47
|
export { default as BorderInput, BorderInputProps, BorderValue, borderSides, borderStartEach } from './forms/BorderInput.js';
|
|
48
48
|
export { default as Switch, SwitchProps, SwitchSize } from './forms/Switch.js';
|