@a-type/ui 5.0.7 → 5.0.8
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/dist/css/main.css +1 -1
- package/dist/esm/components/provider/Provider.js +2 -1
- package/dist/esm/components/provider/Provider.js.map +1 -1
- package/dist/esm/hooks/useVisualViewportOffset.js +8 -2
- package/dist/esm/hooks/useVisualViewportOffset.js.map +1 -1
- package/dist/esm/keyboard.stories.js +3 -3
- package/dist/esm/keyboard.stories.js.map +1 -1
- package/dist/esm/uno/preflights/index.d.ts +2 -1
- package/dist/esm/uno/preflights/index.js +1 -1
- package/dist/esm/uno/preflights/index.js.map +1 -1
- package/dist/esm/uno/preflights/keyboard.d.ts +4 -1
- package/dist/esm/uno/preflights/keyboard.js +3 -3
- package/dist/esm/uno/preflights/keyboard.js.map +1 -1
- package/package.json +1 -1
- package/src/components/provider/Provider.tsx +6 -1
- package/src/hooks/useVisualViewportOffset.ts +8 -2
- package/src/keyboard.stories.tsx +21 -10
- package/src/uno/preflights/index.ts +4 -3
- package/src/uno/preflights/keyboard.ts +15 -8
package/dist/css/main.css
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
@font-face { font-family: "Inter"; src: url("https://resources.biscuits.club/fonts/Inter-VariableFont_slnt,wght.ttf") format("truetype-variations"); font-weight: 1 999; font-style: oblique 0deg 5deg; font-display: block; }
|
|
7
7
|
@property --l-corner-scale { syntax: "*"; inherits: false; } @property --t-shadow-y-mult { syntax: "*"; inherits: false; }
|
|
8
8
|
@layer preflightBase { :root { --u-saturation: 0.5; --u-corner-scale: 1; --u-spacing-scale: 1; --u-border-scale: 1; --u-shadow-spread: 1; --u-c-primary-hue: 90.8; --u-c-accent-hue: 165.88; --u-c-lemon-hue: 90.8; --u-c-lemon-accent-hue: 165.88; --u-c-leek-hue: 165.88; --u-c-leek-accent-hue: 90.8; --u-c-tomato-hue: 10.51; --u-c-tomato-accent-hue: 165.88; --u-c-blueberry-hue: 248.14; --u-c-blueberry-accent-hue: 165.88; --u-c-eggplant-hue: 280.21; --u-c-eggplant-accent-hue: 165.88; --u-c-attention-hue: 30; --u-c-attention-accent-hue: 165.88; --u-c-success-hue: 140; --u-c-success-accent-hue: 165.88; } body, :host { font-size: 16px; } }
|
|
9
|
-
|
|
9
|
+
#root,#main { transform: translateY(calc(-1 * env(keyboard-inset-height,0px))); }
|
|
10
10
|
.outline-off{outline:none;}.unset{all:unset;}.container{width:100%;}.hidden-input{pointer-events:none;position:absolute;z-index:-1;opacity:0;}.bottom-keyboard{bottom:var(--mock-virtual-keyboard-height,env(keyboard-inset-height,0px));}.center{left:50%;top:50%;--un-translate-x:-50%;transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));--un-translate-y:-50%;}.center-x{left:50%;--un-translate-x:-50%;transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}.center-y{top:50%;--un-translate-y:-50%;transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}.hidden-input::webkit-file-upload-button{display:none;}.body{min-height:100vh;color:var(--v-c,var(--v-c-i));--v-c-i:var(--p-high-contrast-shade-ink);--v-c-op:100%;background-color:var(--v-bg,var(--v-bg-l));--v-bg-l:var(--p-gray-shade-wash);--v-bg-op:100%;}.flex-0-0-auto{flex-shrink:0;flex-grow:0;flex-basis:auto;}.flex-1-0-0{flex-shrink:0;flex-grow:1;flex-basis:0px;}.border{border-width:calc(1px * var(--u-border-scale,1));border-style:solid;}.border-default{border-width:calc(1px * var(--u-border-scale,1));border-style:solid;--v-bd-c-i:var(--p-high-contrast-shade-ink);--v-bd-c-op:100%;}.border-light{border-width:calc(1px * var(--u-border-scale,1));border-style:solid;--v-bd-c-i:var(--p-gray-shade-mid);--v-bd-c-op:100%;--v-bd-c:oklch(from var(--v-bd-c-i,currentColor) calc(l * (1 + 3 / 30 * -1 * var(--m-mult, 1))) calc(c * (1 - (3 * 0.1 * -1 * (1 + (1 - var(--u-saturation, 0)))))) h);}:where(.border-default),:where(.border-light){--v-bd-r-c-i:var(--v-bd-r-c,var(--v-bd-r-c-i,var(--v-bd-c,var(--v-bd-c-i))));border-right-color:var(--v-bd-r-c,var(--v-bd-r-c-i,var(--v-bd-c,var(--v-bd-c-i))));--v-bd-l-c-i:var(--v-bd-l-c,var(--v-bd-l-c-i,var(--v-bd-c,var(--v-bd-c-i))));border-left-color:var(--v-bd-l-c,var(--v-bd-l-c-i,var(--v-bd-c,var(--v-bd-c-i))));--v-bd-t-c-i:var(--v-bd-t-c,var(--v-bd-t-c-i,var(--v-bd-c,var(--v-bd-c-i))));border-top-color:var(--v-bd-t-c,var(--v-bd-t-c-i,var(--v-bd-c,var(--v-bd-c-i))));--v-bd-b-c-i:var(--v-bd-b-c,var(--v-bd-b-c-i,var(--v-bd-c,var(--v-bd-c-i))));border-bottom-color:var(--v-bd-b-c,var(--v-bd-b-c-i,var(--v-bd-c,var(--v-bd-c-i))));}@layer components{.layer-components\:\[\&\[data-focus\=true\]\]\:outline-off[data-focus=true]{outline:none;}.layer-components\:unset{all:unset;}.layer-components\:focus\:outline-off:focus{outline:none;}.layer-components\:focus-visible\:outline-off:focus-visible{outline:none;}.col{display:flex;flex-direction:column;align-items:center;gap:calc(0.5rem * var(--l-spacing-scale,1) * var(--u-spacing-scale,1));}.row{display:flex;flex-direction:row;align-items:center;gap:calc(0.5rem * var(--l-spacing-scale,1) * var(--u-spacing-scale,1));}.layer-components\:border{border-width:calc(1px * var(--u-border-scale,1));border-style:solid;}.layer-components\:border-default,.layer-components\:data-\[pressed\]\:border-default[data-pressed]{border-width:calc(1px * var(--u-border-scale,1));border-style:solid;--v-bd-c-i:var(--p-high-contrast-shade-ink);--v-bd-c-op:100%;}.layer-components\:data-\[pressed\]\:hover\:border-default:hover[data-pressed]{border-width:calc(1px * var(--u-border-scale,1));border-style:solid;--v-bd-c-i:var(--p-high-contrast-shade-ink);--v-bd-c-op:100%;}.layer-components\:focus-visible\:border:focus-visible{border-width:calc(1px * var(--u-border-scale,1));border-style:solid;}:where(.layer-components\:border-default),:where(.layer-components\:data-\[pressed\]\:border-default)[data-pressed]{--v-bd-r-c-i:var(--v-bd-r-c,var(--v-bd-r-c-i,var(--v-bd-c,var(--v-bd-c-i))));border-right-color:var(--v-bd-r-c,var(--v-bd-r-c-i,var(--v-bd-c,var(--v-bd-c-i))));--v-bd-l-c-i:var(--v-bd-l-c,var(--v-bd-l-c-i,var(--v-bd-c,var(--v-bd-c-i))));border-left-color:var(--v-bd-l-c,var(--v-bd-l-c-i,var(--v-bd-c,var(--v-bd-c-i))));--v-bd-t-c-i:var(--v-bd-t-c,var(--v-bd-t-c-i,var(--v-bd-c,var(--v-bd-c-i))));border-top-color:var(--v-bd-t-c,var(--v-bd-t-c-i,var(--v-bd-c,var(--v-bd-c-i))));--v-bd-b-c-i:var(--v-bd-b-c,var(--v-bd-b-c-i,var(--v-bd-c,var(--v-bd-c-i))));border-bottom-color:var(--v-bd-b-c,var(--v-bd-b-c-i,var(--v-bd-c,var(--v-bd-c-i))));}:where(.layer-components\:data-\[pressed\]\:hover\:border-default):hover[data-pressed]{--v-bd-r-c-i:var(--v-bd-r-c,var(--v-bd-r-c-i,var(--v-bd-c,var(--v-bd-c-i))));border-right-color:var(--v-bd-r-c,var(--v-bd-r-c-i,var(--v-bd-c,var(--v-bd-c-i))));--v-bd-l-c-i:var(--v-bd-l-c,var(--v-bd-l-c-i,var(--v-bd-c,var(--v-bd-c-i))));border-left-color:var(--v-bd-l-c,var(--v-bd-l-c-i,var(--v-bd-c,var(--v-bd-c-i))));--v-bd-t-c-i:var(--v-bd-t-c,var(--v-bd-t-c-i,var(--v-bd-c,var(--v-bd-c-i))));border-top-color:var(--v-bd-t-c,var(--v-bd-t-c-i,var(--v-bd-c,var(--v-bd-c-i))));--v-bd-b-c-i:var(--v-bd-b-c,var(--v-bd-b-c-i,var(--v-bd-c,var(--v-bd-c-i))));border-bottom-color:var(--v-bd-b-c,var(--v-bd-b-c-i,var(--v-bd-c,var(--v-bd-c-i))));}}@layer composed{.layer-composed\:border{border-width:calc(1px * var(--u-border-scale,1));border-style:solid;}.layer-composed\:border-light{border-width:calc(1px * var(--u-border-scale,1));border-style:solid;--v-bd-c-i:var(--p-gray-shade-mid);--v-bd-c-op:100%;--v-bd-c:oklch(from var(--v-bd-c-i,currentColor) calc(l * (1 + 3 / 30 * -1 * var(--m-mult, 1))) calc(c * (1 - (3 * 0.1 * -1 * (1 + (1 - var(--u-saturation, 0)))))) h);}:where(.layer-composed\:border-light){--v-bd-r-c-i:var(--v-bd-r-c,var(--v-bd-r-c-i,var(--v-bd-c,var(--v-bd-c-i))));border-right-color:var(--v-bd-r-c,var(--v-bd-r-c-i,var(--v-bd-c,var(--v-bd-c-i))));--v-bd-l-c-i:var(--v-bd-l-c,var(--v-bd-l-c-i,var(--v-bd-c,var(--v-bd-c-i))));border-left-color:var(--v-bd-l-c,var(--v-bd-l-c-i,var(--v-bd-c,var(--v-bd-c-i))));--v-bd-t-c-i:var(--v-bd-t-c,var(--v-bd-t-c-i,var(--v-bd-c,var(--v-bd-c-i))));border-top-color:var(--v-bd-t-c,var(--v-bd-t-c-i,var(--v-bd-c,var(--v-bd-c-i))));--v-bd-b-c-i:var(--v-bd-b-c,var(--v-bd-b-c-i,var(--v-bd-c,var(--v-bd-c-i))));border-bottom-color:var(--v-bd-b-c,var(--v-bd-b-c-i,var(--v-bd-c,var(--v-bd-c-i))));}}@layer primitives{.layer-primitives\:border{border-width:calc(1px * var(--u-border-scale,1));border-style:solid;}}@layer variants{.layer-variants\:border{border-width:calc(1px * var(--u-border-scale,1));border-style:solid;}}@media (min-width: 640px){.container{max-width:640px;}}@media (min-width: 768px){.container{max-width:768px;}}@media (min-width: 1024px){.container{max-width:1024px;}}@media (min-width: 1280px){.container{max-width:1280px;}}@media (min-width: 1536px){.container{max-width:1536px;}}.\[--gap\:0\.75rem\]{--gap:0.75rem;}.\[--height\:var\(--toast-frontmost-height\,var\(--toast-height\)\)\]{--height:var(--toast-frontmost-height,var(--toast-height));}.\[--offset-y\:calc\(var\(--toast-offset-y\)\+calc\(var\(--toast-index\)\*var\(--gap\)\)\+var\(--toast-swipe-movement-y\)\)\]{--offset-y:calc(var(--toast-offset-y) + calc(var(--toast-index) * var(--gap)) + var(--toast-swipe-movement-y));}.\[--peek\:0\.75rem\]{--peek:0.75rem;}.\[--scale\:calc\(max\(0\,1-\(var\(--toast-index\)\*0\.1\)\)\)\]{--scale:calc(max(0,1 - (var(--toast-index) * 0.1)));}.\[--shrink\:calc\(1-var\(--scale\)\)\]{--shrink:calc(1 - var(--scale));}.\[all\:unset\]{all:unset;}.\[background-size\:400\%_400\%\]{background-size:400% 400%;}.\[grid-area\:content\]{grid-area:content;}.\[grid-area\:leftGrid\]{grid-area:leftGrid;}.\[grid-area\:leftMonth\]{grid-area:leftMonth;}.\[grid-area\:nextMonth\]{grid-area:nextMonth;}.\[grid-area\:prevMonth\]{grid-area:prevMonth;}.\[grid-area\:rightGrid\]{grid-area:rightGrid;}.\[grid-area\:rightMonth\]{grid-area:rightMonth;}.\[justify-self\:anchor-center\]{justify-self:anchor-center;}.\[outline\:none\]{outline:none;}.\[stroke-dasharray\:80_200\]{stroke-dasharray:80 200;}.\[stroke-dashoffset\:0\]{stroke-dashoffset:0;}.\[transition-duration\:250ms\]{transition-duration:250ms;}.\[transition\:transform_0\.5s_cubic-bezier\(0\.22\,1\,0\.36\,1\)\,opacity_0\.5s\,height_0\.15s\]{transition:transform 0.5s cubic-bezier(0.22,1,0.36,1),opacity 0.5s,height 0.15s;}.contain-strict{contain:strict;}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;}.pointer-events-auto{pointer-events:auto;}.\!pointer-events-none{pointer-events:none !important;}.\[\&\[data-behind\]\:not\(\[data-expanded\]\)\]\:pointer-events-none[data-behind]:not([data-expanded]),.pointer-events-none{pointer-events:none;}.\!visible{visibility:visible !important;}.visible{visibility:visible;}[data-behind]:not([data-expanded]) .\[\[data-behind\]\:not\(\[data-expanded\]\)_\&\]\:invisible{visibility:hidden;}.absolute{position:absolute;}.fixed{position:fixed;}.relative{position:relative;}.sticky{position:sticky;}.after\:absolute::after{position:absolute;}.static{position:static;}.inset-0{inset:0px;}.after\:inset-0::after{inset:0px;}.bottom-\[anchor\(bottom\)\]{bottom:anchor(bottom);}.bottom-\[var\(--mock-virtual-keyboard-height\,env\(keyboard-inset-height\,0px\)\)\]{bottom:var(--mock-virtual-keyboard-height,env(keyboard-inset-height,0px));}.bottom-0{bottom:0px;}.bottom-0px{bottom:0;}.bottom-2{bottom:0.5rem;}.bottom-3{bottom:0.75rem;}.left-\[anchor\(left\)\]{left:anchor(left);}.left-\[anchor\(right\)\]{left:anchor(right);}.left-0{left:0px;}.left-1\/2{left:50%;}.left-2{left:0.5rem;}.left-auto{left:auto;}.right-\[anchor\(right\)\]{right:anchor(right);}.right-0{right:0px;}.right-2{right:0.5rem;}.right-md{right:calc(1rem * var(--l-spacing-scale,1) * var(--u-spacing-scale,1));}.right-sm{right:calc(0.5rem * var(--l-spacing-scale,1) * var(--u-spacing-scale,1));}.top-\[anchor\(bottom\)\]{top:anchor(bottom);}.top-0{top:0px;}.top-1\/2{top:50%;}.top-1px{top:1px;}.top-2{top:0.5rem;}.top-2px{top:2px;}.top-auto{top:auto;}.top-md{top:calc(1rem * var(--l-spacing-scale,1) * var(--u-spacing-scale,1));}.top-sm{top:calc(0.5rem * var(--l-spacing-scale,1) * var(--u-spacing-scale,1));}.top-xs{top:calc(0.25rem * var(--l-spacing-scale,1) * var(--u-spacing-scale,1));}.after\:left-0::after{left:0px;}.after\:top-auto::after{top:auto;}.after\:top-full::after{top:100%;}.isolate{isolation:isolate;}.z--1{z-index:-1;}.z-\[1000000\]{z-index:1000000;}.z-\[calc\(100000-var\(--toast-index\)\)\]{z-index:calc(100000 - var(--toast-index));}.z-1{z-index:1;}.z-1000{z-index:1000;}.z-10000{z-index:10000;}.z-10001{z-index:10001;}.z-101{z-index:101;}.grid{display:grid;}.col-span-2,.grid-col-span-2{grid-column:span 2/span 2;}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr));}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr));}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr));}.m-0{margin:0px;}.m-1{margin:0.25rem;}.m-auto{margin:auto;}.m5\.87{margin:1.4675rem;}.my-4{margin-top:1rem;margin-bottom:1rem;}.my-auto{margin-top:auto;margin-bottom:auto;}.mb-1{margin-bottom:0.25rem;}.mb-auto{margin-bottom:auto;}.mb-sm{margin-bottom:calc(0.5rem * var(--l-spacing-scale,1) * var(--u-spacing-scale,1));}.me{margin-inline-end:1rem;}.ml-auto{margin-left:auto;}.ml-md{margin-left:calc(1rem * var(--l-spacing-scale,1) * var(--u-spacing-scale,1));}.ml-sm{margin-left:calc(0.5rem * var(--l-spacing-scale,1) * var(--u-spacing-scale,1));}.mr-0{margin-right:0px;}.mr-1{margin-right:0.25rem;}.mr-auto{margin-right:auto;}.mt-200px{margin-top:200px;}.mt-auto{margin-top:auto;}.inline{display:inline;}.block{display:block;}.inline-block{display:inline-block;}.\!hidden{display:none !important;}.\[\&\:\:webkit-file-upload-button\]\:hidden::webkit-file-upload-button,.hidden,[data-has-icon=true] .\[\[data-has-icon\=true\]_\&\]\:hidden{display:none;}.aspect-\[9\/16\]{aspect-ratio:9/16;}.aspect-1{aspect-ratio:1;}.\[\&\[data-state\=closed\]\]\:max-h-\[var\(--peek-height\,120px\)\][data-state=closed]{max-height:var(--peek-height,120px);}.data-\[both\]\:h-\[--collapsible-panel-height\][data-both],.data-\[vertical\]\:h-\[--collapsible-panel-height\][data-vertical]{height:var(--collapsible-panel-height);}.data-\[both\]\:w-\[--collapsible-panel-width\][data-both],.data-\[horizontal\]\:w-\[--collapsible-panel-width\][data-horizontal]{width:var(--collapsible-panel-width);}.data-\[expanded\]\:h-\[--toast-height\][data-expanded]{height:var(--toast-height);}.h-\[--height\]{height:var(--height);}.h-\[100vh\],.h-screen{height:100vh;}.h-\[12px\]{height:12px;}.h-\[var\(--mock-virtual-keyboard-height\,0\)\]{height:var(--mock-virtual-keyboard-height,0);}.h-100px{height:100px;}.h-16{height:4rem;}.h-16px{height:16px;}.h-1em{height:1em;}.h-1px{height:1px;}.h-200px{height:200px;}.h-240px{height:240px;}.h-24px{height:24px;}.h-300px{height:300px;}.h-32{height:8rem;}.h-600px{height:600px;}.h-64{height:16rem;}.h-80px{height:80px;}.h-full{height:100%;}.h-touch{height:30px;}.h1{height:0.25rem;}.h2{height:0.5rem;}.h3{height:0.75rem;}.h4{height:1rem;}.h5{height:1.25rem;}.max-h-200px{max-height:200px;}.max-h-20vh{max-height:20vh;}.max-h-full{max-height:100%;}.max-w-300px{max-width:300px;}.max-w-full{max-width:100%;}.max-w-sm{max-width:24rem;}.min-h-0{min-height:0;}.min-h-18px{min-height:18px;}.min-h-200px{min-height:200px;}.min-h-20vh{min-height:20vh;}.min-h-32px{min-height:32px;}.min-h-80px{min-height:80px;}.min-h-80vh{min-height:80vh;}.min-h-screen{min-height:100vh;}.min-w-0{min-width:0;}.min-w-32px{min-width:32px;}.min-w-80px{min-width:80px;}.start-end\:data-\[both\]\:h-0[data-both][data-starting-style], .start-end\:data-\[both\]\:h-0[data-both][data-ending-style],.start-end\:data-\[vertical\]\:h-0[data-vertical][data-starting-style], .start-end\:data-\[vertical\]\:h-0[data-vertical][data-ending-style]{height:0;}.start-end\:data-\[both\]\:w-0[data-both][data-starting-style], .start-end\:data-\[both\]\:w-0[data-both][data-ending-style],.start-end\:data-\[horizontal\]\:w-0[data-horizontal][data-starting-style], .start-end\:data-\[horizontal\]\:w-0[data-horizontal][data-ending-style],.w-0{width:0;}.w-\[12px\]{width:12px;}.w-\[200px\]{width:200px;}.w-10000px{width:10000px;}.w-16{width:4rem;}.w-16px{width:16px;}.w-1em{width:1em;}.w-24px{width:24px;}.w-300px{width:300px;}.w-400px{width:400px;}.w-64{width:16rem;}.w-800px{width:800px;}.w-80px{width:80px;}.w-95vw{width:95vw;}.w-full{width:100%;}.w-max-content{width:max-content;}.w-touch{width:30px;}[data-behind]:not([data-expanded]) .\[\[data-behind\]\:not\(\[data-expanded\]\)_\&\]\:max-h-\[--height\]{max-height:var(--height);}.after\:h-\[calc\(var\(--gap\)\+1px\)\]::after{height:calc(var(--gap) + 1px);}.after\:h-80px::after{height:80px;}.after\:w-full::after{width:100%;}.flex{display:flex;}.after\:flex::after{display:flex;}.inline-flex{display:inline-flex;}.flex-1{flex:1 1 0%;}.flex-shrink-0,.shrink-0{flex-shrink:0;}.flex-grow,.flex-grow-1,.grow{flex-grow:1;}.flex-grow-0{flex-grow:0;}.flex-basis-0{flex-basis:0px;}.flex-basis-auto{flex-basis:auto;}.flex-row{flex-direction:row;}.flex-col{flex-direction:column;}.after\:flex-col::after{flex-direction:column;}.flex-wrap{flex-wrap:wrap;}.table{display:table;}.origin-top{transform-origin:top;}.transform-origin-\[--transform-origin\]{transform-origin:var(--transform-origin);}.transform-origin-\[50\%_50\%\]{transform-origin:50% 50%;}.-translate-x-1\/2,.translate-x--1\/2{--un-translate-x:-50%;transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}.\[\&\[data-ending-style\]\:not\(\[data-limited\]\)\:not\(\[data-swipe-direction\]\)\]\:-translate-y-150\%[data-ending-style]:not([data-limited]):not([data-swipe-direction]),.data-\[starting-style\]\:-translate-y-150\%[data-starting-style]{--un-translate-y:-150%;transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}.data-\[ending-style\]\:data-\[swipe-direction\=down\]\:translate-y-\[calc\(var\(--toast-swipe-movement-y\)\+150\%\)\][data-swipe-direction=down][data-ending-style],.data-\[expanded\]\:data-\[ending-style\]\:data-\[swipe-direction\=down\]\:translate-y-\[calc\(var\(--toast-swipe-movement-y\)\+150\%\)\][data-swipe-direction=down][data-ending-style][data-expanded]{--un-translate-y:calc(var(--toast-swipe-movement-y) + 150%);transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}.data-\[ending-style\]\:data-\[swipe-direction\=left\]\:translate-x-\[calc\(var\(--toast-swipe-movement-x\)-150\%\)\][data-swipe-direction=left][data-ending-style],.data-\[expanded\]\:data-\[ending-style\]\:data-\[swipe-direction\=left\]\:translate-x-\[calc\(var\(--toast-swipe-movement-x\)-150\%\)\][data-swipe-direction=left][data-ending-style][data-expanded]{--un-translate-x:calc(var(--toast-swipe-movement-x) - 150%);transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}.data-\[ending-style\]\:data-\[swipe-direction\=left\]\:translate-y-\[var\(--offset-y\)\][data-swipe-direction=left][data-ending-style],.data-\[ending-style\]\:data-\[swipe-direction\=right\]\:translate-y-\[var\(--offset-y\)\][data-swipe-direction=right][data-ending-style],.data-\[expanded\]\:data-\[ending-style\]\:data-\[swipe-direction\=left\]\:translate-y-\[var\(--offset-y\)\][data-swipe-direction=left][data-ending-style][data-expanded],.data-\[expanded\]\:data-\[ending-style\]\:data-\[swipe-direction\=right\]\:translate-y-\[var\(--offset-y\)\][data-swipe-direction=right][data-ending-style][data-expanded],.data-\[expanded\]\:translate-y-\[--offset-y\][data-expanded]{--un-translate-y:var(--offset-y);transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}.data-\[ending-style\]\:data-\[swipe-direction\=right\]\:translate-x-\[calc\(var\(--toast-swipe-movement-x\)\+150\%\)\][data-swipe-direction=right][data-ending-style],.data-\[expanded\]\:data-\[ending-style\]\:data-\[swipe-direction\=right\]\:translate-x-\[calc\(var\(--toast-swipe-movement-x\)\+150\%\)\][data-swipe-direction=right][data-ending-style][data-expanded]{--un-translate-x:calc(var(--toast-swipe-movement-x) + 150%);transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}.data-\[ending-style\]\:data-\[swipe-direction\=up\]\:translate-y-\[calc\(var\(--toast-swipe-movement-y\)-150\%\)\][data-swipe-direction=up][data-ending-style],.data-\[expanded\]\:data-\[ending-style\]\:data-\[swipe-direction\=up\]\:translate-y-\[calc\(var\(--toast-swipe-movement-y\)-150\%\)\][data-swipe-direction=up][data-ending-style][data-expanded]{--un-translate-y:calc(var(--toast-swipe-movement-y) - 150%);transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}.data-\[expanded\]\:translate-x-\[--toast-swipe-movement-x\][data-expanded],.translate-x-\[--toast-swipe-movement-x\]{--un-translate-x:var(--toast-swipe-movement-x);transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}.translate-y--1\/2{--un-translate-y:-50%;transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}.translate-y-\[calc\(var\(--toast-swipe-movement-y\)\+\(var\(--toast-index\)\*var\(--peek\)\)\+\(var\(--shrink\)\*var\(--height\)\)\)\]{--un-translate-y:calc(var(--toast-swipe-movement-y) + (var(--toast-index) * var(--peek)) + (var(--shrink) * var(--height)));transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}.rotate-180{--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-rotate:180deg;transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}.rotate-90{--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-rotate:90deg;transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}.\[\&\[data-ending-style\]\:not\(\[data-limited\]\)\:not\(\[data-swipe-direction\]\)\]\:scale-90[data-ending-style]:not([data-limited]):not([data-swipe-direction]){--un-scale-x:0.9;--un-scale-y:0.9;transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}.data-\[expanded\]\:scale-100[data-expanded]{--un-scale-x:1;--un-scale-y:1;transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}.scale-\[var\(--scale\)\]{--un-scale-x:var(--scale);--un-scale-y:var(--scale);transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}.transform{transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}.transform-gpu{transform:translate3d(var(--un-translate-x), var(--un-translate-y), var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}@keyframes peek-close{
|
|
11
11
|
from { height: calc(var(--collapsible-height) + 80px); max-height: none; }
|
|
12
12
|
to { height: min(var(--peek-height, 120px), var(--collapsible-height)); max-height: var(--peek-height, 120px); }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @unocss-include
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, useContext } from 'react';
|
|
4
|
-
import { useThemedTitleBar, useVisualViewportOffset } from '../../hooks.js';
|
|
4
|
+
import { useThemedTitleBar, useVirtualKeyboardFocusBehavior, useVisualViewportOffset, } from '../../hooks.js';
|
|
5
5
|
import { useVirtualKeyboardBehavior } from '../../hooks/useVirtualKeyboardBehavior.js';
|
|
6
6
|
import { IconSpritesheet } from '../icon/index.js';
|
|
7
7
|
import { ParticleLayer } from '../particles/index.js';
|
|
@@ -13,6 +13,7 @@ import { TooltipProvider } from '../tooltip/index.js';
|
|
|
13
13
|
*/
|
|
14
14
|
export function Provider({ children, disableParticles, disableViewportOffset, virtualKeyboardBehavior = 'displace', disableTitleBarColor, manifestPath, }) {
|
|
15
15
|
useVisualViewportOffset(disableViewportOffset);
|
|
16
|
+
useVirtualKeyboardFocusBehavior();
|
|
16
17
|
const supportedVirtualKeyboardBehavior = typeof navigator !== 'undefined' && 'virtualKeyboard' in navigator
|
|
17
18
|
? virtualKeyboardBehavior
|
|
18
19
|
: 'displace';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Provider.js","sourceRoot":"","sources":["../../../../src/components/provider/Provider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAa,UAAU,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,
|
|
1
|
+
{"version":3,"file":"Provider.js","sourceRoot":"","sources":["../../../../src/components/provider/Provider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAa,UAAU,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EACN,iBAAiB,EACjB,+BAA+B,EAC/B,uBAAuB,GACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAWtD;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,EACxB,QAAQ,EACR,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,GAAG,UAAU,EACpC,oBAAoB,EACpB,YAAY,GACG;IACf,uBAAuB,CAAC,qBAAqB,CAAC,CAAC;IAC/C,+BAA+B,EAAE,CAAC;IAClC,MAAM,gCAAgC,GACrC,OAAO,SAAS,KAAK,WAAW,IAAI,iBAAiB,IAAI,SAAS;QACjE,CAAC,CAAC,uBAAuB;QACzB,CAAC,CAAC,UAAU,CAAC;IACf,0BAA0B,CAAC,gCAAgC,CAAC,CAAC;IAC7D,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,oBAAoB,CAAC,CAAC;IACnE,MAAM,UAAU,GAAG,CAClB,8BACC,KAAC,eAAe,KAAG,EACnB,KAAC,OAAO,KAAG,EACX,KAAC,UAAU,IAAC,YAAY,EAAE,YAAY,GAAI,IACxC,CACH,CAAC;IAEF,IAAI,gBAAgB;QACnB,OAAO,CACN,KAAC,aAAa,CAAC,QAAQ,IACtB,KAAK,EAAE,EAAE,uBAAuB,EAAE,gCAAgC,EAAE,YAEpE,KAAC,oBAAoB,cACpB,MAAC,eAAe,eACd,QAAQ,EACR,UAAU,IACM,GACI,GACC,CACzB,CAAC;IAEH,OAAO,CACN,KAAC,aAAa,CAAC,QAAQ,IACtB,KAAK,EAAE,EAAE,uBAAuB,EAAE,gCAAgC,EAAE,YAEpE,KAAC,oBAAoB,cACpB,KAAC,eAAe,cACf,MAAC,aAAa,eACZ,QAAQ,EACR,UAAU,IACI,GACC,GACI,GACC,CACzB,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAEvC;IACF,uBAAuB,EAAE,UAAU;CACnC,CAAC,CAAC;AAEH,MAAM,UAAU,SAAS;IACxB,OAAO,UAAU,CAAC,aAAa,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -149,11 +149,17 @@ export function useVirtualKeyboardFocusBehavior({ focusElementTypes = ['input',
|
|
|
149
149
|
const virtualKeyboard = navigator.virtualKeyboard;
|
|
150
150
|
const matchElements = stableFocusElementTypes.split(',');
|
|
151
151
|
function update() {
|
|
152
|
-
|
|
152
|
+
const open = virtualKeyboard.boundingRect.height > 0;
|
|
153
|
+
if (open) {
|
|
154
|
+
console.log('keyboard opened');
|
|
155
|
+
}
|
|
153
156
|
const activeElement = document.activeElement;
|
|
154
157
|
if (activeElement &&
|
|
155
158
|
matchElements.includes(activeElement.tagName.toLowerCase())) {
|
|
156
|
-
|
|
159
|
+
setTimeout(() => {
|
|
160
|
+
console.log('scroll focused element');
|
|
161
|
+
activeElement.scrollIntoView(true);
|
|
162
|
+
}, 10);
|
|
157
163
|
}
|
|
158
164
|
}
|
|
159
165
|
virtualKeyboard.addEventListener('geometrychange', update);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useVisualViewportOffset.js","sourceRoot":"","sources":["../../../src/hooks/useVisualViewportOffset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ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,CAAC,CAAC;QAEzD,SAAS,MAAM;YACd,MAAM,IAAI,GAAG,eAAe,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC;YACrD,IAAI,IAAI,EAAE,CAAC;gBACV,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;YAChC,CAAC;YACD,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC;YAC7C,IACC,aAAa;gBACb,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,EAC1D,CAAC;gBACF,UAAU,CAAC,GAAG,EAAE;oBACf,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;oBACtC,aAAa,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;gBACpC,CAAC,EAAE,EAAE,CAAC,CAAC;YACR,CAAC;QACF,CAAC;QAED,eAAe,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;QAC3D,OAAO,GAAG,EAAE;YACX,eAAe,CAAC,mBAAmB,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;QAC/D,CAAC,CAAC;IACH,CAAC,EAAE,CAAC,uBAAuB,CAAC,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @unocss-include
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
3
|
-
import { Input, TextArea } from './components/index.js';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Input, PageContent, PageNowPlaying, PageRoot, TextArea, } from './components/index.js';
|
|
4
4
|
import { useVirtualKeyboardBehavior } from './hooks/useVirtualKeyboardBehavior.js';
|
|
5
5
|
const meta = {
|
|
6
6
|
title: 'Virtual Keyboard Test',
|
|
@@ -14,7 +14,7 @@ export default meta;
|
|
|
14
14
|
export const Default = {
|
|
15
15
|
render(args) {
|
|
16
16
|
useVirtualKeyboardBehavior('overlay');
|
|
17
|
-
return (_jsx(
|
|
17
|
+
return (_jsx(PageRoot, { id: "root", children: _jsxs(PageContent, { children: [_jsxs("div", { className: "h-screen flex flex-col", children: [_jsx("div", { className: "flex flex-grow flex-col items-center justify-center p-lg", children: "Focus the inputs below to see how the virtual keyboard behavior works." }), _jsx(Input, { className: "w-full" }), _jsx(TextArea, { className: "w-full" })] }), _jsx(PageNowPlaying, { keepAboveKeyboard: true, children: _jsx(Input, { placeholder: "now playing" }) })] }) }));
|
|
18
18
|
},
|
|
19
19
|
};
|
|
20
20
|
//# sourceMappingURL=keyboard.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard.stories.js","sourceRoot":"","sources":["../../src/keyboard.stories.tsx"],"names":[],"mappings":";AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"keyboard.stories.js","sourceRoot":"","sources":["../../src/keyboard.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EACN,KAAK,EACL,WAAW,EACX,cAAc,EACd,QAAQ,EACR,QAAQ,GACR,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AAEnF,MAAM,IAAI,GAAG;IACZ,KAAK,EAAE,uBAAuB;IAC9B,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE;QACX,QAAQ,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE;QAC7B,MAAM,EAAE,YAAY;KACpB;CACc,CAAC;AAEjB,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC7B,MAAM,CAAC,IAAI;QACV,0BAA0B,CAAC,SAAS,CAAC,CAAC;QACtC,OAAO,CACN,KAAC,QAAQ,IAAC,EAAE,EAAC,MAAM,YAClB,MAAC,WAAW,eACX,eAAK,SAAS,EAAC,wBAAwB,aACtC,cAAK,SAAS,EAAC,0DAA0D,uFAGnE,EACN,KAAC,KAAK,IAAC,SAAS,EAAC,QAAQ,GAAG,EAC5B,KAAC,QAAQ,IAAC,SAAS,EAAC,QAAQ,GAAG,IAC1B,EACN,KAAC,cAAc,IAAC,iBAAiB,kBAChC,KAAC,KAAK,IAAC,WAAW,EAAC,aAAa,GAAG,GACnB,IACJ,GACJ,CACX,CAAC;IACH,CAAC;CACD,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { Preflight } from 'unocss';
|
|
|
2
2
|
import { ColorPreflightOptions } from './colors.js';
|
|
3
3
|
import { FontsPreflightOptions } from './fonts.js';
|
|
4
4
|
import { GlobalsPreflightConfig } from './globals.js';
|
|
5
|
+
import { KeyboardPreflightOptions } from './keyboard.js';
|
|
5
6
|
import { UserPreflightOptions } from './user.js';
|
|
6
|
-
export type PreflightConfig = FontsPreflightOptions & GlobalsPreflightConfig & UserPreflightOptions & ColorPreflightOptions;
|
|
7
|
+
export type PreflightConfig = FontsPreflightOptions & GlobalsPreflightConfig & UserPreflightOptions & ColorPreflightOptions & KeyboardPreflightOptions;
|
|
7
8
|
export declare const preflights: (config: PreflightConfig) => Preflight<any>[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/uno/preflights/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAyB,MAAM,aAAa,CAAC;AACpE,OAAO,EAAE,cAAc,EAAyB,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,eAAe,EAA0B,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/uno/preflights/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAyB,MAAM,aAAa,CAAC;AACpE,OAAO,EAAE,cAAc,EAAyB,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,eAAe,EAA0B,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAA4B,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAwB,MAAM,WAAW,CAAC;AAQhE,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAAuB,EAAoB,EAAE,CAAC;IACxE,cAAc;IACd,aAAa;IACb,eAAe,CAAC,MAAM,CAAC;IACvB,cAAc,CAAC,MAAM,CAAC;IACtB,aAAa,CAAC,MAAM,CAAC;IACrB,cAAc,CAAC,MAAM,CAAC;IACtB,mBAAmB;IACnB,aAAa,CAAC,MAAM,CAAC;IACrB,iBAAiB,CAAC,MAAM,CAAC;CACzB,CAAC"}
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface KeyboardPreflightOptions {
|
|
2
|
+
rootSelector?: string;
|
|
3
|
+
}
|
|
4
|
+
export declare const keyboardPreflight: ({ rootSelector, }: KeyboardPreflightOptions) => import("unocss").Preflight<object>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @unocss-include
|
|
2
2
|
import { preflight } from './_util.js';
|
|
3
|
-
export const keyboardPreflight = preflight({
|
|
3
|
+
export const keyboardPreflight = ({ rootSelector = '#root,#main', }) => preflight({
|
|
4
4
|
getCSS: () =>
|
|
5
5
|
// add space to bottom of body equal to virtual keyboard inset so that
|
|
6
6
|
// content is not hidden behind the keyboard
|
|
7
7
|
`
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
${rootSelector} {
|
|
9
|
+
transform: translateY(calc(-1 * env(keyboard-inset-height,0px)));
|
|
10
10
|
}
|
|
11
11
|
`,
|
|
12
12
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard.js","sourceRoot":"","sources":["../../../../src/uno/preflights/keyboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"keyboard.js","sourceRoot":"","sources":["../../../../src/uno/preflights/keyboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAMvC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EACjC,YAAY,GAAG,aAAa,GACF,EAAE,EAAE,CAC9B,SAAS,CAAC;IACT,MAAM,EAAE,GAAG,EAAE;IACZ,sEAAsE;IACtE,4CAA4C;IAC5C;GACA,YAAY;;;CAGd;CACC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { createContext, ReactNode, useContext } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
useThemedTitleBar,
|
|
4
|
+
useVirtualKeyboardFocusBehavior,
|
|
5
|
+
useVisualViewportOffset,
|
|
6
|
+
} from '../../hooks.js';
|
|
3
7
|
import { useVirtualKeyboardBehavior } from '../../hooks/useVirtualKeyboardBehavior.js';
|
|
4
8
|
import { IconSpritesheet } from '../icon/index.js';
|
|
5
9
|
import { ParticleLayer } from '../particles/index.js';
|
|
@@ -28,6 +32,7 @@ export function Provider({
|
|
|
28
32
|
manifestPath,
|
|
29
33
|
}: ProviderProps) {
|
|
30
34
|
useVisualViewportOffset(disableViewportOffset);
|
|
35
|
+
useVirtualKeyboardFocusBehavior();
|
|
31
36
|
const supportedVirtualKeyboardBehavior =
|
|
32
37
|
typeof navigator !== 'undefined' && 'virtualKeyboard' in navigator
|
|
33
38
|
? virtualKeyboardBehavior
|
|
@@ -207,13 +207,19 @@ export function useVirtualKeyboardFocusBehavior({
|
|
|
207
207
|
const matchElements = stableFocusElementTypes.split(',');
|
|
208
208
|
|
|
209
209
|
function update() {
|
|
210
|
-
|
|
210
|
+
const open = virtualKeyboard.boundingRect.height > 0;
|
|
211
|
+
if (open) {
|
|
212
|
+
console.log('keyboard opened');
|
|
213
|
+
}
|
|
211
214
|
const activeElement = document.activeElement;
|
|
212
215
|
if (
|
|
213
216
|
activeElement &&
|
|
214
217
|
matchElements.includes(activeElement.tagName.toLowerCase())
|
|
215
218
|
) {
|
|
216
|
-
|
|
219
|
+
setTimeout(() => {
|
|
220
|
+
console.log('scroll focused element');
|
|
221
|
+
activeElement.scrollIntoView(true);
|
|
222
|
+
}, 10);
|
|
217
223
|
}
|
|
218
224
|
}
|
|
219
225
|
|
package/src/keyboard.stories.tsx
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Input,
|
|
4
|
+
PageContent,
|
|
5
|
+
PageNowPlaying,
|
|
6
|
+
PageRoot,
|
|
7
|
+
TextArea,
|
|
8
|
+
} from './components/index.js';
|
|
3
9
|
import { useVirtualKeyboardBehavior } from './hooks/useVirtualKeyboardBehavior.js';
|
|
4
10
|
|
|
5
11
|
const meta = {
|
|
@@ -19,16 +25,21 @@ export const Default: Story = {
|
|
|
19
25
|
render(args) {
|
|
20
26
|
useVirtualKeyboardBehavior('overlay');
|
|
21
27
|
return (
|
|
22
|
-
|
|
23
|
-
<
|
|
24
|
-
<div className="
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
<PageRoot id="root">
|
|
29
|
+
<PageContent>
|
|
30
|
+
<div className="h-screen flex flex-col">
|
|
31
|
+
<div className="flex flex-grow flex-col items-center justify-center p-lg">
|
|
32
|
+
Focus the inputs below to see how the virtual keyboard behavior
|
|
33
|
+
works.
|
|
34
|
+
</div>
|
|
35
|
+
<Input className="w-full" />
|
|
36
|
+
<TextArea className="w-full" />
|
|
27
37
|
</div>
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
38
|
+
<PageNowPlaying keepAboveKeyboard>
|
|
39
|
+
<Input placeholder="now playing" />
|
|
40
|
+
</PageNowPlaying>
|
|
41
|
+
</PageContent>
|
|
42
|
+
</PageRoot>
|
|
32
43
|
);
|
|
33
44
|
},
|
|
34
45
|
};
|
|
@@ -3,7 +3,7 @@ import { basePreflight } from './base.js';
|
|
|
3
3
|
import { colorPreflight, ColorPreflightOptions } from './colors.js';
|
|
4
4
|
import { fontsPreflight, FontsPreflightOptions } from './fonts.js';
|
|
5
5
|
import { globalPreflight, GlobalsPreflightConfig } from './globals.js';
|
|
6
|
-
import { keyboardPreflight } from './keyboard.js';
|
|
6
|
+
import { keyboardPreflight, KeyboardPreflightOptions } from './keyboard.js';
|
|
7
7
|
import { layerPreflight } from './layers.js';
|
|
8
8
|
import { modePreflight } from './mode.js';
|
|
9
9
|
import { propertiesPreflight } from './properties.js';
|
|
@@ -12,7 +12,8 @@ import { userPreflight, UserPreflightOptions } from './user.js';
|
|
|
12
12
|
export type PreflightConfig = FontsPreflightOptions &
|
|
13
13
|
GlobalsPreflightConfig &
|
|
14
14
|
UserPreflightOptions &
|
|
15
|
-
ColorPreflightOptions
|
|
15
|
+
ColorPreflightOptions &
|
|
16
|
+
KeyboardPreflightOptions;
|
|
16
17
|
|
|
17
18
|
export const preflights = (config: PreflightConfig): Preflight<any>[] => [
|
|
18
19
|
layerPreflight,
|
|
@@ -23,5 +24,5 @@ export const preflights = (config: PreflightConfig): Preflight<any>[] => [
|
|
|
23
24
|
fontsPreflight(config),
|
|
24
25
|
propertiesPreflight,
|
|
25
26
|
userPreflight(config),
|
|
26
|
-
keyboardPreflight,
|
|
27
|
+
keyboardPreflight(config),
|
|
27
28
|
];
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { preflight } from './_util.js';
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
export interface KeyboardPreflightOptions {
|
|
4
|
+
rootSelector?: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const keyboardPreflight = ({
|
|
8
|
+
rootSelector = '#root,#main',
|
|
9
|
+
}: KeyboardPreflightOptions) =>
|
|
10
|
+
preflight({
|
|
11
|
+
getCSS: () =>
|
|
12
|
+
// add space to bottom of body equal to virtual keyboard inset so that
|
|
13
|
+
// content is not hidden behind the keyboard
|
|
14
|
+
`
|
|
15
|
+
${rootSelector} {
|
|
16
|
+
transform: translateY(calc(-1 * env(keyboard-inset-height,0px)));
|
|
10
17
|
}
|
|
11
18
|
`,
|
|
12
|
-
});
|
|
19
|
+
});
|