diff --git a/next-docs/public/examples/combobox/__tests__/__snapshots__/index.test.tsx.snap b/next-docs/public/examples/combobox/__tests__/__snapshots__/index.test.tsx.snap index b46d1af74d..675bc98288 100644 --- a/next-docs/public/examples/combobox/__tests__/__snapshots__/index.test.tsx.snap +++ b/next-docs/public/examples/combobox/__tests__/__snapshots__/index.test.tsx.snap @@ -21,7 +21,7 @@ Object { @@ -378,7 +378,7 @@ Object { @@ -506,7 +506,7 @@ Object { @@ -577,7 +577,7 @@ Object { @@ -705,7 +705,7 @@ Object { @@ -765,7 +765,7 @@ Object { @@ -828,7 +828,7 @@ Object { aria-autocomplete="list" aria-expanded="false" aria-label="Without placeholder" - class="block w-full max-w-full py-0 m-0 appearance-none text-bulma transition-shadow box-border relative z-[2] shadow-input hover:shadow-input-hov focus:shadow-input-focus focus:outline-none focus-visible::shadow-input-focus focus-visible::outline-none rounded-moon-i-sm rtl:[&:not([disabled])]:[&:not([readonly])]:[&:not([readonly])]:hover:rounded-moon-i-sm rtl:[&:not([disabled])]:[&:not([readonly])]:focus:rounded-moon-i-sm rtl:invalid:rounded-moon-i-sm ltr:[&:not([disabled])]:[&:not([readonly])]:hover:rounded-moon-i-sm ltr:[&:not([disabled])]:[&:not([readonly])]:focus:rounded-moon-i-sm ltr:invalid:rounded-moon-i-sm before:box-border after:box-border placeholder:text-trunks placeholder:opacity-100 placeholder:transition-opacity placeholder:delay-75 read-only:outline-0 read-only:border-none read-only:cursor-not-allowed read-only:hover:shadow-input read-only:focus:shadow-input read-only:focus-visible:shadow-input input-dt-shared invalid:shadow-input-err invalid:hover:shadow-input-err invalid:focus:shadow-input-err invalid:focus-visible:shadow-input-err flex-grow h-full border-0 !rounded-none bg-transparent px-0 !shadow-none hover:shadow-none focus:shadow-none focus-visible:shadow-none input-xl pt-3 input-xl-dt-label text-moon-16 leading-5" + class="block w-full max-w-full py-0 m-0 appearance-none text-bulma transition-shadow box-border relative z-[2] shadow-input hover:shadow-input-hov focus:shadow-input-focus focus:outline-none focus-visible::shadow-input-focus focus-visible::outline-none before:box-border after:box-border placeholder:delay-75 placeholder:text-trunks placeholder:opacity-100 placeholder:transition-opacity read-only:outline-0 read-only:border-none read-only:cursor-not-allowed read-only:hover:shadow-input read-only:focus:shadow-input read-only:focus-visible:shadow-input invalid:focus-visible:shadow-input-err invalid:shadow-input-err invalid:hover:shadow-input-err invalid:focus:shadow-input-err rounded-moon-i-sm input-dt-shared flex-grow h-full border-0 !rounded-none bg-transparent px-0 !shadow-none hover:shadow-none focus:shadow-none focus-visible:shadow-none input-xl pt-3 input-xl-dt-label text-moon-16 leading-5" data-headlessui-state="" id="headlessui-combobox-input-:r2l:" placeholder="" @@ -837,7 +837,7 @@ Object { value="" /> @@ -888,7 +888,7 @@ Object { @@ -959,7 +959,7 @@ Object { @@ -1019,7 +1019,7 @@ Object { @@ -1082,7 +1082,7 @@ Object { aria-autocomplete="list" aria-expanded="false" aria-label="Without placeholder" - class="block w-full max-w-full py-0 m-0 appearance-none text-bulma transition-shadow box-border relative z-[2] shadow-input hover:shadow-input-hov focus:shadow-input-focus focus:outline-none focus-visible::shadow-input-focus focus-visible::outline-none rounded-moon-i-sm rtl:[&:not([disabled])]:[&:not([readonly])]:[&:not([readonly])]:hover:rounded-moon-i-sm rtl:[&:not([disabled])]:[&:not([readonly])]:focus:rounded-moon-i-sm rtl:invalid:rounded-moon-i-sm ltr:[&:not([disabled])]:[&:not([readonly])]:hover:rounded-moon-i-sm ltr:[&:not([disabled])]:[&:not([readonly])]:focus:rounded-moon-i-sm ltr:invalid:rounded-moon-i-sm before:box-border after:box-border placeholder:text-trunks placeholder:opacity-100 placeholder:transition-opacity placeholder:delay-75 read-only:outline-0 read-only:border-none read-only:cursor-not-allowed read-only:hover:shadow-input read-only:focus:shadow-input read-only:focus-visible:shadow-input input-dt-shared invalid:shadow-input-err invalid:hover:shadow-input-err invalid:focus:shadow-input-err invalid:focus-visible:shadow-input-err flex-grow h-full border-0 !rounded-none bg-transparent px-0 !shadow-none hover:shadow-none focus:shadow-none focus-visible:shadow-none input-xl pt-3 input-xl-dt-label text-moon-16 leading-5" + class="block w-full max-w-full py-0 m-0 appearance-none text-bulma transition-shadow box-border relative z-[2] shadow-input hover:shadow-input-hov focus:shadow-input-focus focus:outline-none focus-visible::shadow-input-focus focus-visible::outline-none before:box-border after:box-border placeholder:delay-75 placeholder:text-trunks placeholder:opacity-100 placeholder:transition-opacity read-only:outline-0 read-only:border-none read-only:cursor-not-allowed read-only:hover:shadow-input read-only:focus:shadow-input read-only:focus-visible:shadow-input invalid:focus-visible:shadow-input-err invalid:shadow-input-err invalid:hover:shadow-input-err invalid:focus:shadow-input-err rounded-moon-i-sm input-dt-shared flex-grow h-full border-0 !rounded-none bg-transparent px-0 !shadow-none hover:shadow-none focus:shadow-none focus-visible:shadow-none input-xl pt-3 input-xl-dt-label text-moon-16 leading-5" data-headlessui-state="" id="headlessui-combobox-input-:r2l:" placeholder="" @@ -1091,7 +1091,7 @@ Object { value="" /> @@ -1142,7 +1142,7 @@ Object { @@ -1267,7 +1267,7 @@ Object { @@ -3382,7 +3382,7 @@ Object { @@ -3506,7 +3506,7 @@ Object { @@ -3573,7 +3573,7 @@ Object { @@ -3697,7 +3697,7 @@ Object { @@ -3757,7 +3757,7 @@ Object { @@ -3820,7 +3820,7 @@ Object { aria-autocomplete="list" aria-expanded="false" aria-label="Without placeholder" - class="block w-full max-w-full py-0 m-0 appearance-none text-bulma transition-shadow box-border relative z-[2] shadow-input hover:shadow-input-hov focus:shadow-input-focus focus:outline-none focus-visible::shadow-input-focus focus-visible::outline-none rounded-moon-i-sm rtl:[&:not([disabled])]:[&:not([readonly])]:[&:not([readonly])]:hover:rounded-moon-i-sm rtl:[&:not([disabled])]:[&:not([readonly])]:focus:rounded-moon-i-sm rtl:invalid:rounded-moon-i-sm ltr:[&:not([disabled])]:[&:not([readonly])]:hover:rounded-moon-i-sm ltr:[&:not([disabled])]:[&:not([readonly])]:focus:rounded-moon-i-sm ltr:invalid:rounded-moon-i-sm before:box-border after:box-border placeholder:text-trunks placeholder:opacity-100 placeholder:transition-opacity placeholder:delay-75 read-only:outline-0 read-only:border-none read-only:cursor-not-allowed read-only:hover:shadow-input read-only:focus:shadow-input read-only:focus-visible:shadow-input input-dt-shared invalid:shadow-input-err invalid:hover:shadow-input-err invalid:focus:shadow-input-err invalid:focus-visible:shadow-input-err flex-grow h-full border-0 !rounded-none bg-transparent px-0 !shadow-none hover:shadow-none focus:shadow-none focus-visible:shadow-none input-xl pt-3 input-xl-dt-label text-moon-16 leading-5" + class="block w-full max-w-full py-0 m-0 appearance-none text-bulma transition-shadow box-border relative z-[2] shadow-input hover:shadow-input-hov focus:shadow-input-focus focus:outline-none focus-visible::shadow-input-focus focus-visible::outline-none before:box-border after:box-border placeholder:delay-75 placeholder:text-trunks placeholder:opacity-100 placeholder:transition-opacity read-only:outline-0 read-only:border-none read-only:cursor-not-allowed read-only:hover:shadow-input read-only:focus:shadow-input read-only:focus-visible:shadow-input invalid:focus-visible:shadow-input-err invalid:shadow-input-err invalid:hover:shadow-input-err invalid:focus:shadow-input-err rounded-moon-i-sm input-dt-shared flex-grow h-full border-0 !rounded-none bg-transparent px-0 !shadow-none hover:shadow-none focus:shadow-none focus-visible:shadow-none input-xl pt-3 input-xl-dt-label text-moon-16 leading-5" data-headlessui-state="" id="headlessui-combobox-input-:rh:" placeholder="" @@ -3829,7 +3829,7 @@ Object { value="" /> @@ -3880,7 +3880,7 @@ Object { @@ -3947,7 +3947,7 @@ Object { @@ -4007,7 +4007,7 @@ Object { @@ -4070,7 +4070,7 @@ Object { aria-autocomplete="list" aria-expanded="false" aria-label="Without placeholder" - class="block w-full max-w-full py-0 m-0 appearance-none text-bulma transition-shadow box-border relative z-[2] shadow-input hover:shadow-input-hov focus:shadow-input-focus focus:outline-none focus-visible::shadow-input-focus focus-visible::outline-none rounded-moon-i-sm rtl:[&:not([disabled])]:[&:not([readonly])]:[&:not([readonly])]:hover:rounded-moon-i-sm rtl:[&:not([disabled])]:[&:not([readonly])]:focus:rounded-moon-i-sm rtl:invalid:rounded-moon-i-sm ltr:[&:not([disabled])]:[&:not([readonly])]:hover:rounded-moon-i-sm ltr:[&:not([disabled])]:[&:not([readonly])]:focus:rounded-moon-i-sm ltr:invalid:rounded-moon-i-sm before:box-border after:box-border placeholder:text-trunks placeholder:opacity-100 placeholder:transition-opacity placeholder:delay-75 read-only:outline-0 read-only:border-none read-only:cursor-not-allowed read-only:hover:shadow-input read-only:focus:shadow-input read-only:focus-visible:shadow-input input-dt-shared invalid:shadow-input-err invalid:hover:shadow-input-err invalid:focus:shadow-input-err invalid:focus-visible:shadow-input-err flex-grow h-full border-0 !rounded-none bg-transparent px-0 !shadow-none hover:shadow-none focus:shadow-none focus-visible:shadow-none input-xl pt-3 input-xl-dt-label text-moon-16 leading-5" + class="block w-full max-w-full py-0 m-0 appearance-none text-bulma transition-shadow box-border relative z-[2] shadow-input hover:shadow-input-hov focus:shadow-input-focus focus:outline-none focus-visible::shadow-input-focus focus-visible::outline-none before:box-border after:box-border placeholder:delay-75 placeholder:text-trunks placeholder:opacity-100 placeholder:transition-opacity read-only:outline-0 read-only:border-none read-only:cursor-not-allowed read-only:hover:shadow-input read-only:focus:shadow-input read-only:focus-visible:shadow-input invalid:focus-visible:shadow-input-err invalid:shadow-input-err invalid:hover:shadow-input-err invalid:focus:shadow-input-err rounded-moon-i-sm input-dt-shared flex-grow h-full border-0 !rounded-none bg-transparent px-0 !shadow-none hover:shadow-none focus:shadow-none focus-visible:shadow-none input-xl pt-3 input-xl-dt-label text-moon-16 leading-5" data-headlessui-state="" id="headlessui-combobox-input-:rh:" placeholder="" @@ -4079,7 +4079,7 @@ Object { value="" /> @@ -4130,7 +4130,7 @@ Object { @@ -4251,7 +4251,7 @@ Object { @@ -44,7 +44,7 @@ Object { Email @@ -213,7 +213,7 @@ Object { Password @@ -268,7 +268,7 @@ Object { Username @@ -289,7 +289,7 @@ Object { Email @@ -458,7 +458,7 @@ Object { Password @@ -567,11 +567,11 @@ Object { class="w-full max-w-full relative bg-goku rounded-moon-s-xs [&_input]:rounded-moon-s-xs [&_input:focus]:rounded-moon-s-xs [&_input:hover]:rounded-moon-s-xs" > @@ -590,11 +590,11 @@ Object { class="w-full max-w-full relative bg-goku rounded-moon-s-xs [&_input]:rounded-moon-s-xs [&_input:focus]:rounded-moon-s-xs [&_input:hover]:rounded-moon-s-xs" > @@ -607,11 +607,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -624,11 +624,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -674,11 +674,11 @@ Object { class="w-full max-w-full relative bg-goku rounded-moon-s-xs [&_input]:rounded-moon-s-xs [&_input:focus]:rounded-moon-s-xs [&_input:hover]:rounded-moon-s-xs" > @@ -697,11 +697,11 @@ Object { class="w-full max-w-full relative bg-goku rounded-moon-s-xs [&_input]:rounded-moon-s-xs [&_input:focus]:rounded-moon-s-xs [&_input:hover]:rounded-moon-s-xs" > @@ -714,11 +714,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -731,11 +731,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -838,7 +838,7 @@ Object { Username @@ -859,7 +859,7 @@ Object { Email @@ -1028,7 +1028,7 @@ Object { Password @@ -1079,7 +1079,7 @@ Object { Username @@ -1100,7 +1100,7 @@ Object { Email @@ -1269,7 +1269,7 @@ Object { Password @@ -1374,11 +1374,11 @@ Object { class="w-full max-w-full relative bg-goku rounded-moon-s-xs [&_input]:rounded-moon-s-xs [&_input:focus]:rounded-moon-s-xs [&_input:hover]:rounded-moon-s-xs" > @@ -1397,11 +1397,11 @@ Object { class="w-full max-w-full relative bg-goku rounded-moon-s-xs [&_input]:rounded-moon-s-xs [&_input:focus]:rounded-moon-s-xs [&_input:hover]:rounded-moon-s-xs" > @@ -1414,11 +1414,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -1431,11 +1431,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -1477,11 +1477,11 @@ Object { class="w-full max-w-full relative bg-goku rounded-moon-s-xs [&_input]:rounded-moon-s-xs [&_input:focus]:rounded-moon-s-xs [&_input:hover]:rounded-moon-s-xs" > @@ -1500,11 +1500,11 @@ Object { class="w-full max-w-full relative bg-goku rounded-moon-s-xs [&_input]:rounded-moon-s-xs [&_input:focus]:rounded-moon-s-xs [&_input:hover]:rounded-moon-s-xs" > @@ -1517,11 +1517,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -1534,11 +1534,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > diff --git a/next-docs/public/examples/group/__tests__/__snapshots__/index.test.tsx.snap b/next-docs/public/examples/group/__tests__/__snapshots__/index.test.tsx.snap index 2181838eae..3aeb31f66f 100644 --- a/next-docs/public/examples/group/__tests__/__snapshots__/index.test.tsx.snap +++ b/next-docs/public/examples/group/__tests__/__snapshots__/index.test.tsx.snap @@ -12,14 +12,14 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-col rounded-moon-i-sm" >
@@ -36,14 +36,14 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-col rounded-moon-i-sm" >
@@ -120,14 +120,14 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-col rounded-moon-i-sm" >
@@ -137,14 +137,14 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-row rounded-moon-i-sm" >
@@ -164,14 +164,14 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-col rounded-moon-i-sm" >
@@ -181,14 +181,14 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-row rounded-moon-i-sm" >
@@ -265,14 +265,14 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-col rounded-moon-i-xs" >
@@ -282,14 +282,14 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-col rounded-moon-i-sm" >
@@ -299,14 +299,14 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-col rounded-moon-i-sm" >
@@ -327,14 +327,14 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-col rounded-moon-i-xs" >
@@ -344,14 +344,14 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-col rounded-moon-i-sm" >
@@ -361,14 +361,14 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-col rounded-moon-i-sm" >
@@ -446,14 +446,14 @@ Object { class="flex border-none relative h-fit bg-goku flex-col rounded-moon-i-sm shadow-input-err hover:shadow-input-err focus:shadow-input-err focus-visible:shadow-input-error" >
@@ -463,14 +463,14 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-col rounded-moon-i-sm" >
@@ -480,7 +480,7 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-col rounded-moon-i-sm" > @@ -488,7 +488,7 @@ Object { class="relative last-element before:absolute before:block before:bg-beerus hover:before:hidden before:transition-opacity before:h-px before:top-0 before:inset-x-0" > @@ -507,7 +507,7 @@ Object { class="relative last-element before:absolute before:block before:bg-beerus hover:before:hidden before:transition-opacity before:h-px before:top-0 before:inset-x-0" >
@@ -546,14 +546,14 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-col rounded-moon-i-sm" >
@@ -563,7 +563,7 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-col rounded-moon-i-sm" > @@ -571,7 +571,7 @@ Object { class="relative last-element before:absolute before:block before:bg-beerus hover:before:hidden before:transition-opacity before:h-px before:top-0 before:inset-x-0" > @@ -590,7 +590,7 @@ Object { class="relative last-element before:absolute before:block before:bg-beerus hover:before:hidden before:transition-opacity before:h-px before:top-0 before:inset-x-0" > @@ -685,11 +685,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku last-element before:absolute before:block before:bg-beerus hover:before:hidden before:transition-opacity [&_input]:rounded-t-none [&_input]:input-tbb-hidden before:h-px before:top-0 before:inset-x-0" > @@ -702,11 +702,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku [&_+_.last-element:before]:hover:opacity-0 [&_input]:rounded-e-none rtl:[&_input]:input-lsb-hidden ltr:[&_input]:input-rsb-hidden flex-1 basis-1/2" > @@ -715,11 +715,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku last-element before:absolute before:block before:bg-beerus hover:before:hidden before:transition-opacity [&_input]:rounded-s-none rtl:[&_input]:input-rsb-hidden ltr:[&_input]:input-lsb-hidden flex-1 basis-1/2 before:w-px before:start-0 before:inset-y-0" > @@ -776,7 +776,7 @@ Object { class="relative last-element before:absolute before:block before:bg-beerus hover:before:hidden before:transition-opacity before:h-px before:top-0 before:inset-x-0" >
@@ -785,7 +785,7 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-row rounded-moon-i-sm" > @@ -905,11 +905,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku [&_+_.last-element:before]:hover:opacity-0 [&_input]:rounded-e-none rtl:[&_input]:input-lsb-hidden ltr:[&_input]:input-rsb-hidden flex-1 basis-1/2" > @@ -981,11 +981,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku [&_+_.last-element:before]:hover:opacity-0 [&_input]:rounded-b-none [&_input]:input-bbb-hidden" > @@ -994,11 +994,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku last-element before:absolute before:block before:bg-beerus hover:before:hidden before:transition-opacity [&_input]:rounded-t-none [&_input]:input-tbb-hidden before:h-px before:top-0 before:inset-x-0" > @@ -1011,11 +1011,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku [&_+_.last-element:before]:hover:opacity-0 [&_input]:rounded-e-none rtl:[&_input]:input-lsb-hidden ltr:[&_input]:input-rsb-hidden flex-1 basis-1/2" > @@ -1024,11 +1024,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku last-element before:absolute before:block before:bg-beerus hover:before:hidden before:transition-opacity [&_input]:rounded-s-none rtl:[&_input]:input-rsb-hidden ltr:[&_input]:input-lsb-hidden flex-1 basis-1/2 before:w-px before:start-0 before:inset-y-0" > @@ -1085,7 +1085,7 @@ Object { class="relative last-element before:absolute before:block before:bg-beerus hover:before:hidden before:transition-opacity before:h-px before:top-0 before:inset-x-0" >
@@ -1094,7 +1094,7 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-row rounded-moon-i-sm" > @@ -1214,11 +1214,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku [&_+_.last-element:before]:hover:opacity-0 [&_input]:rounded-e-none rtl:[&_input]:input-lsb-hidden ltr:[&_input]:input-rsb-hidden flex-1 basis-1/2" > @@ -1338,14 +1338,14 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-col rounded-moon-i-sm" >
@@ -1358,14 +1358,14 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-col rounded-moon-i-sm" >
@@ -1438,14 +1438,14 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-col rounded-moon-i-sm" >
@@ -1455,14 +1455,14 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-row rounded-moon-i-sm" >
@@ -1478,14 +1478,14 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-col rounded-moon-i-sm" >
@@ -1495,14 +1495,14 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-row rounded-moon-i-sm" >
@@ -1575,14 +1575,14 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-col rounded-moon-i-xs" >
@@ -1592,14 +1592,14 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-col rounded-moon-i-sm" >
@@ -1609,14 +1609,14 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-col rounded-moon-i-sm" >
@@ -1633,14 +1633,14 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-col rounded-moon-i-xs" >
@@ -1650,14 +1650,14 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-col rounded-moon-i-sm" >
@@ -1667,14 +1667,14 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-col rounded-moon-i-sm" >
@@ -1748,14 +1748,14 @@ Object { class="flex border-none relative h-fit bg-goku flex-col rounded-moon-i-sm shadow-input-err hover:shadow-input-err focus:shadow-input-err focus-visible:shadow-input-error" >
@@ -1765,14 +1765,14 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-col rounded-moon-i-sm" >
@@ -1782,7 +1782,7 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-col rounded-moon-i-sm" > @@ -1790,7 +1790,7 @@ Object { class="relative last-element before:absolute before:block before:bg-beerus hover:before:hidden before:transition-opacity before:h-px before:top-0 before:inset-x-0" > @@ -1809,7 +1809,7 @@ Object { class="relative last-element before:absolute before:block before:bg-beerus hover:before:hidden before:transition-opacity before:h-px before:top-0 before:inset-x-0" >
@@ -1844,14 +1844,14 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-col rounded-moon-i-sm" >
@@ -1861,7 +1861,7 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-col rounded-moon-i-sm" > @@ -1869,7 +1869,7 @@ Object { class="relative last-element before:absolute before:block before:bg-beerus hover:before:hidden before:transition-opacity before:h-px before:top-0 before:inset-x-0" > @@ -1888,7 +1888,7 @@ Object { class="relative last-element before:absolute before:block before:bg-beerus hover:before:hidden before:transition-opacity before:h-px before:top-0 before:inset-x-0" > @@ -1979,11 +1979,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku last-element before:absolute before:block before:bg-beerus hover:before:hidden before:transition-opacity [&_input]:rounded-t-none [&_input]:input-tbb-hidden before:h-px before:top-0 before:inset-x-0" > @@ -1996,11 +1996,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku [&_+_.last-element:before]:hover:opacity-0 [&_input]:rounded-e-none rtl:[&_input]:input-lsb-hidden ltr:[&_input]:input-rsb-hidden flex-1 basis-1/2" > @@ -2009,11 +2009,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku last-element before:absolute before:block before:bg-beerus hover:before:hidden before:transition-opacity [&_input]:rounded-s-none rtl:[&_input]:input-rsb-hidden ltr:[&_input]:input-lsb-hidden flex-1 basis-1/2 before:w-px before:start-0 before:inset-y-0" > @@ -2070,7 +2070,7 @@ Object { class="relative last-element before:absolute before:block before:bg-beerus hover:before:hidden before:transition-opacity before:h-px before:top-0 before:inset-x-0" >
@@ -2079,7 +2079,7 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-row rounded-moon-i-sm" > @@ -2199,11 +2199,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku [&_+_.last-element:before]:hover:opacity-0 [&_input]:rounded-e-none rtl:[&_input]:input-lsb-hidden ltr:[&_input]:input-rsb-hidden flex-1 basis-1/2" > @@ -2271,11 +2271,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku [&_+_.last-element:before]:hover:opacity-0 [&_input]:rounded-b-none [&_input]:input-bbb-hidden" > @@ -2284,11 +2284,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku last-element before:absolute before:block before:bg-beerus hover:before:hidden before:transition-opacity [&_input]:rounded-t-none [&_input]:input-tbb-hidden before:h-px before:top-0 before:inset-x-0" > @@ -2301,11 +2301,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku [&_+_.last-element:before]:hover:opacity-0 [&_input]:rounded-e-none rtl:[&_input]:input-lsb-hidden ltr:[&_input]:input-rsb-hidden flex-1 basis-1/2" > @@ -2314,11 +2314,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku last-element before:absolute before:block before:bg-beerus hover:before:hidden before:transition-opacity [&_input]:rounded-s-none rtl:[&_input]:input-rsb-hidden ltr:[&_input]:input-lsb-hidden flex-1 basis-1/2 before:w-px before:start-0 before:inset-y-0" > @@ -2375,7 +2375,7 @@ Object { class="relative last-element before:absolute before:block before:bg-beerus hover:before:hidden before:transition-opacity before:h-px before:top-0 before:inset-x-0" >
@@ -2384,7 +2384,7 @@ Object { class="flex border-none shadow-input relative h-fit bg-goku flex-row rounded-moon-i-sm" > @@ -2504,11 +2504,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku [&_+_.last-element:before]:hover:opacity-0 [&_input]:rounded-e-none rtl:[&_input]:input-lsb-hidden ltr:[&_input]:input-rsb-hidden flex-1 basis-1/2" > diff --git a/next-docs/public/examples/input/__tests__/__snapshots__/index.test.tsx.snap b/next-docs/public/examples/input/__tests__/__snapshots__/index.test.tsx.snap index 25323f6234..ea0f0a3c02 100644 --- a/next-docs/public/examples/input/__tests__/__snapshots__/index.test.tsx.snap +++ b/next-docs/public/examples/input/__tests__/__snapshots__/index.test.tsx.snap @@ -21,7 +21,7 @@ Object { Medium (Default: md)
@@ -144,7 +144,7 @@ Object { >
, @@ -223,7 +223,7 @@ Object { Small (sm) @@ -629,7 +629,7 @@ Object { @@ -644,7 +644,7 @@ Object { Time @@ -663,7 +663,7 @@ Object { Datetime local @@ -692,7 +692,7 @@ Object { Password @@ -710,7 +710,7 @@ Object { Search @@ -724,7 +724,7 @@ Object { Tel @@ -738,7 +738,7 @@ Object { Url @@ -763,7 +763,7 @@ Object { Number @@ -778,7 +778,7 @@ Object { @@ -793,7 +793,7 @@ Object { Time @@ -812,7 +812,7 @@ Object { Datetime local @@ -841,7 +841,7 @@ Object { Password @@ -859,7 +859,7 @@ Object { Search @@ -873,7 +873,7 @@ Object { Tel @@ -887,7 +887,7 @@ Object { Url @@ -967,7 +967,7 @@ Object { Medium (Default: md)
, "container":
, "debug": [Function], @@ -1153,7 +1153,7 @@ Object { Small (sm) @@ -1543,7 +1543,7 @@ Object { @@ -1558,7 +1558,7 @@ Object { Time @@ -1577,7 +1577,7 @@ Object { Datetime local @@ -1606,7 +1606,7 @@ Object { Password @@ -1624,7 +1624,7 @@ Object { Search @@ -1638,7 +1638,7 @@ Object { Tel @@ -1652,7 +1652,7 @@ Object { Url @@ -1673,7 +1673,7 @@ Object { Number @@ -1688,7 +1688,7 @@ Object { @@ -1703,7 +1703,7 @@ Object { Time @@ -1722,7 +1722,7 @@ Object { Datetime local @@ -1751,7 +1751,7 @@ Object { Password @@ -1769,7 +1769,7 @@ Object { Search @@ -1783,7 +1783,7 @@ Object { Tel @@ -1797,7 +1797,7 @@ Object { Url diff --git a/next-docs/public/examples/insetInput/Default.tsx b/next-docs/public/examples/insetInput/Default.tsx index 575e382f55..6b07ce9378 100644 --- a/next-docs/public/examples/insetInput/Default.tsx +++ b/next-docs/public/examples/insetInput/Default.tsx @@ -1,7 +1,7 @@ import { InsetInput } from '@heathmont/moon-core-tw'; const Example = () => ( - + Label ); diff --git a/next-docs/public/examples/insetInput/__tests__/__snapshots__/index.test.tsx.snap b/next-docs/public/examples/insetInput/__tests__/__snapshots__/index.test.tsx.snap index c6ff6e2f9b..f7801eecc4 100644 --- a/next-docs/public/examples/insetInput/__tests__/__snapshots__/index.test.tsx.snap +++ b/next-docs/public/examples/insetInput/__tests__/__snapshots__/index.test.tsx.snap @@ -18,11 +18,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-beerus [&_input]:text-piccolo" > @@ -52,11 +52,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-beerus [&_input]:text-piccolo" > @@ -137,11 +137,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -157,11 +158,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -240,12 +242,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku opacity-60 cursor-not-allowed" > @@ -264,11 +266,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -287,13 +289,13 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -323,12 +325,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku opacity-60 cursor-not-allowed" > @@ -347,11 +349,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -370,13 +372,13 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -460,12 +462,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -475,12 +477,12 @@ Object { > @@ -490,11 +492,11 @@ Object { > @@ -508,12 +510,12 @@ Object { > @@ -522,12 +524,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -536,12 +538,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -554,12 +556,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -568,12 +570,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -582,12 +584,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -607,12 +609,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -622,12 +624,12 @@ Object { > @@ -637,11 +639,11 @@ Object { > @@ -655,12 +657,12 @@ Object { > @@ -669,12 +671,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -683,12 +685,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -701,12 +703,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -715,12 +717,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -729,12 +731,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -811,11 +813,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-beerus [&_input]:text-piccolo" > @@ -841,11 +843,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-beerus [&_input]:text-piccolo" > @@ -922,11 +924,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -938,11 +941,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -1017,12 +1021,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku opacity-60 cursor-not-allowed" > @@ -1041,11 +1045,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -1064,13 +1068,13 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -1096,12 +1100,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku opacity-60 cursor-not-allowed" > @@ -1120,11 +1124,11 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -1143,13 +1147,13 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -1229,12 +1233,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -1244,12 +1248,12 @@ Object { > @@ -1259,11 +1263,11 @@ Object { > @@ -1277,12 +1281,12 @@ Object { > @@ -1291,12 +1295,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -1305,12 +1309,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -1323,12 +1327,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -1337,12 +1341,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -1351,12 +1355,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -1372,12 +1376,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -1387,12 +1391,12 @@ Object { > @@ -1402,11 +1406,11 @@ Object { > @@ -1420,12 +1424,12 @@ Object { > @@ -1434,12 +1438,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -1448,12 +1452,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -1466,12 +1470,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -1480,12 +1484,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > @@ -1494,12 +1498,12 @@ Object { class="w-full max-w-full relative rounded-moon-i-sm bg-goku" > diff --git a/next-docs/public/examples/tagsInput/__tests__/__snapshots__/index.test.tsx.snap b/next-docs/public/examples/tagsInput/__tests__/__snapshots__/index.test.tsx.snap index 99fdf1da34..744db0a046 100644 --- a/next-docs/public/examples/tagsInput/__tests__/__snapshots__/index.test.tsx.snap +++ b/next-docs/public/examples/tagsInput/__tests__/__snapshots__/index.test.tsx.snap @@ -19,7 +19,7 @@ Object { class="flex flex-wrap justify-start items-start gap-1" /> @@ -42,7 +42,7 @@ Object { class="flex flex-wrap justify-start items-start gap-1" /> @@ -135,7 +135,7 @@ Object { class="flex flex-wrap justify-start items-start gap-1" /> @@ -158,7 +158,7 @@ Object { class="flex flex-wrap justify-start items-start gap-1" /> @@ -181,7 +181,7 @@ Object { class="flex flex-wrap justify-start items-start gap-1" /> @@ -219,7 +219,7 @@ Object { class="flex flex-wrap justify-start items-start gap-1" /> @@ -242,7 +242,7 @@ Object { class="flex flex-wrap justify-start items-start gap-1" /> @@ -265,7 +265,7 @@ Object { class="flex flex-wrap justify-start items-start gap-1" /> @@ -401,7 +401,7 @@ Object {
@@ -465,7 +465,7 @@ Object {
@@ -530,7 +530,7 @@ Object {
@@ -610,7 +610,7 @@ Object {
@@ -674,7 +674,7 @@ Object {
@@ -739,7 +739,7 @@ Object {
@@ -876,7 +876,7 @@ Object {
@@ -940,7 +940,7 @@ Object {
@@ -1019,7 +1019,7 @@ Object {
@@ -1083,7 +1083,7 @@ Object {
@@ -1162,7 +1162,7 @@ Object { class="flex flex-wrap justify-start items-start gap-1" /> @@ -1181,7 +1181,7 @@ Object { class="flex flex-wrap justify-start items-start gap-1" /> @@ -1270,7 +1270,7 @@ Object { class="flex flex-wrap justify-start items-start gap-1" /> @@ -1293,7 +1293,7 @@ Object { class="flex flex-wrap justify-start items-start gap-1" /> @@ -1316,7 +1316,7 @@ Object { class="flex flex-wrap justify-start items-start gap-1" /> @@ -1350,7 +1350,7 @@ Object { class="flex flex-wrap justify-start items-start gap-1" /> @@ -1373,7 +1373,7 @@ Object { class="flex flex-wrap justify-start items-start gap-1" /> @@ -1396,7 +1396,7 @@ Object { class="flex flex-wrap justify-start items-start gap-1" /> @@ -1528,7 +1528,7 @@ Object { @@ -1592,7 +1592,7 @@ Object { @@ -1657,7 +1657,7 @@ Object { @@ -1733,7 +1733,7 @@ Object { @@ -1797,7 +1797,7 @@ Object { @@ -1862,7 +1862,7 @@ Object { @@ -1995,7 +1995,7 @@ Object { @@ -2059,7 +2059,7 @@ Object { @@ -2134,7 +2134,7 @@ Object { @@ -2198,7 +2198,7 @@ Object { diff --git a/workspaces/core/src/input/Input.tsx b/workspaces/core/src/input/Input.tsx index 7a8bd9f091..09d9d09963 100644 --- a/workspaces/core/src/input/Input.tsx +++ b/workspaces/core/src/input/Input.tsx @@ -2,6 +2,7 @@ import React, { forwardRef } from 'react'; import type InputProps from './private/types/InputProps'; import getMaxDate from './private/utils/getMaxDate'; import getSizeStyles from './private/utils/getSizeStyles'; +import getTypeStyles from './private/utils/getTypeStyles'; import useFormContext from '../form/private/utils/useFormContext'; import useFormItemContext from '../form/private/utils/useFormItemContext'; import mergeClassnames from '../mergeClassnames/mergeClassnames'; @@ -14,7 +15,6 @@ const Input = forwardRef( size: inputSize, error: inputError, disabled: inputDisabled, - isRtl, id, ...rest }, @@ -37,26 +37,19 @@ const Input = forwardRef( disabled={disabled} max={getMaxDate(type)} className={mergeClassnames( - 'block w-full max-w-full py-0 px-4 m-0 appearance-none text-moon-16 text-bulma transition-shadow box-border relative z-[2]', - 'bg-goku shadow-input hover:shadow-input-hov', - 'focus:shadow-input-focus focus:outline-none', - 'focus-visible::shadow-input-focus focus-visible::outline-none', + 'block w-full max-w-full py-0 px-4 m-0 appearance-none text-moon-16 text-bulma', + 'transition-shadow box-border relative z-[2] bg-goku shadow-input hover:shadow-input-hov', + 'focus:shadow-input-focus focus:outline-none focus-visible::shadow-input-focus', + 'focus-visible::outline-none before:box-border after:box-border placeholder:delay-75', + 'placeholder:text-trunks placeholder:opacity-100 placeholder:transition-opacity', + 'read-only:outline-0 read-only:border-none read-only:cursor-not-allowed', + 'read-only:hover:shadow-input read-only:focus:shadow-input', + 'read-only:focus-visible:shadow-input invalid:focus-visible:shadow-input-err', + 'invalid:shadow-input-err invalid:hover:shadow-input-err invalid:focus:shadow-input-err', + getSizeStyles(size), + getTypeStyles(type), error && 'shadow-input-err hover:shadow-input-err focus:shadow-input-err focus-visible:shadow-input-err', - getSizeStyles(size), - 'before:box-border after:box-border', - 'placeholder:text-trunks placeholder:opacity-100 placeholder:transition-opacity placeholder:delay-75', - 'read-only:outline-0 read-only:border-none read-only:cursor-not-allowed read-only:hover:shadow-input read-only:focus:shadow-input read-only:focus-visible:shadow-input', - type === 'number' && 'input-number-clear', - type === 'date' && 'input-d', - type === 'date' && isRtl && 'input-d-rtl', - type === 'time' && 'input-t', - type === 'time' && isRtl && 'input-t-rtl', - type === 'datetime-local' && 'input-d', - type === 'datetime-local' && isRtl && 'input-dt-local-rtl', - size === 'lg' && 'input-lg-dt-shared', - 'input-dt-shared', - 'invalid:shadow-input-err invalid:hover:shadow-input-err invalid:focus:shadow-input-err invalid:focus-visible:shadow-input-err', disabled && 'opacity-60 cursor-not-allowed', className && className )} diff --git a/workspaces/core/src/input/private/utils/getBorderRadius.ts b/workspaces/core/src/input/private/utils/getBorderRadius.ts deleted file mode 100644 index 337a8d15be..0000000000 --- a/workspaces/core/src/input/private/utils/getBorderRadius.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type InputProps from '../types/InputProps'; - -const getBorderRadius = (size?: InputProps['size'] | 'xl'): string => { - switch (size) { - case 'xl': - case 'lg': - return 'rounded-moon-i-sm'; - default: - return 'rounded-moon-i-xs'; - } -}; - -export default getBorderRadius; diff --git a/workspaces/core/src/input/private/utils/getSizeStyles.ts b/workspaces/core/src/input/private/utils/getSizeStyles.ts index f66552e8f1..ab4f29f84e 100644 --- a/workspaces/core/src/input/private/utils/getSizeStyles.ts +++ b/workspaces/core/src/input/private/utils/getSizeStyles.ts @@ -1,15 +1,13 @@ import type InputProps from '../types/InputProps'; -const getSizeStyles = (size?: InputProps['size'] | 'xl'): string => { +const getSizeStyles = (size?: InputProps['size']): string => { switch (size) { - case 'xl': - return 'h-14 leading-[3.5rem] rounded-moon-i-sm rtl:[&:not([disabled])]:[&:not([readonly])]:hover:rounded-moon-i-sm rtl:[&:not([disabled])]:[&:not([readonly])]:focus:rounded-moon-i-sm rtl:invalid:rounded-moon-i-sm ltr:[&:not([disabled])]:[&:not([readonly])]:hover:rounded-moon-i-sm ltr:[&:not([disabled])]:[&:not([readonly])]:focus:rounded-moon-i-sm ltr:invalid:rounded-moon-i-sm'; case 'lg': - return 'h-12 leading-[3rem] rounded-moon-i-sm rtl:[&:not([disabled])]:[&:not([readonly])]:hover:rounded-moon-i-sm rtl:[&:not([disabled])]:[&:not([readonly])]:focus:rounded-moon-i-sm rtl:invalid:rounded-moon-i-sm ltr:[&:not([disabled])]:[&:not([readonly])]:hover:rounded-moon-i-sm ltr:[&:not([disabled])]:[&:not([readonly])]:focus:rounded-moon-i-sm ltr:invalid:rounded-moon-i-sm'; + return 'h-12 leading-[3rem] rounded-moon-i-sm input-lg-dt-shared'; case 'sm': - return 'h-8 leading-8 rounded-moon-i-xs rtl:[&:not([disabled])]:[&:not([readonly])]:hover:rounded-moon-i-xs rtl:[&:not([disabled])]:[&:not([readonly])]:focus:rounded-moon-i-xs rtl:invalid:rounded-moon-i-xs ltr:[&:not([disabled])]:[&:not([readonly])]:hover:rounded-moon-i-xs ltr:[&:not([disabled])]:[&:not([readonly])]:focus:rounded-moon-i-xs ltr:invalid:rounded-moon-i-xs'; + return 'h-8 leading-8 rounded-moon-i-xs input-dt-shared'; default: - return 'h-10 leading-10 rounded-moon-i-sm rtl:[&:not([disabled])]:[&:not([readonly])]:[&:not([readonly])]:hover:rounded-moon-i-sm rtl:[&:not([disabled])]:[&:not([readonly])]:focus:rounded-moon-i-sm rtl:invalid:rounded-moon-i-sm ltr:[&:not([disabled])]:[&:not([readonly])]:hover:rounded-moon-i-sm ltr:[&:not([disabled])]:[&:not([readonly])]:focus:rounded-moon-i-sm ltr:invalid:rounded-moon-i-sm'; + return 'h-10 leading-10 rounded-moon-i-sm input-dt-shared'; } }; diff --git a/workspaces/core/src/input/private/utils/getTypeStyles.ts b/workspaces/core/src/input/private/utils/getTypeStyles.ts new file mode 100644 index 0000000000..6f6529702b --- /dev/null +++ b/workspaces/core/src/input/private/utils/getTypeStyles.ts @@ -0,0 +1,18 @@ +import type InputProps from '../types/InputProps'; + +const getTypeStyles = (type?: InputProps['type']): string | undefined => { + switch (type) { + case 'number': + return 'input-number-clear'; + case 'date': + return 'ltr:input-d rtl:input-d-rtl'; + case 'time': + return 'ltr:input-t rtl:input-t-rtl'; + case 'datetime-local': + return 'ltr:input-d rtl:input-dt-local-rtl'; + default: + return; + } +}; + +export default getTypeStyles; diff --git a/workspaces/core/src/insetInput/InsetInput.tsx b/workspaces/core/src/insetInput/InsetInput.tsx index 81078ff902..58cfb18210 100644 --- a/workspaces/core/src/insetInput/InsetInput.tsx +++ b/workspaces/core/src/insetInput/InsetInput.tsx @@ -5,6 +5,7 @@ import InsetInputContext from './private/utils/InsetInputContext'; import useInsetInputContext from './private/utils/useInsetInputContext'; import useFormItemContext from '../form/private/utils/useFormItemContext'; import getMaxDate from '../input/private/utils/getMaxDate'; +import getTypeStyles from '../input/private/utils/getTypeStyles'; import mergeClassnames from '../mergeClassnames/mergeClassnames'; import useRegisterChild from '../private/utils/useRegisterChild'; @@ -32,26 +33,21 @@ const InsetInputRoot = forwardRef( disabled={disabled} max={getMaxDate(rest.type)} className={mergeClassnames( - 'block w-full max-w-full py-0 px-4 m-0 appearance-none text-moon-16 text-bulma transition-shadow box-border relative z-[2]', - 'bg-transparent shadow-input hover:shadow-input-hov', - 'focus:shadow-input-focus focus:outline-none', + 'block w-full max-w-full py-0 px-4 m-0 appearance-none text-moon-16 text-bulma', + 'transition-shadow box-border relative z-[2] bg-transparent shadow-input', + 'hover:shadow-input-hov focus:shadow-input-focus focus:outline-none', 'focus-visible:shadow-input-focus focus-visible::outline-none', error && 'shadow-input-err hover:shadow-input-err focus:shadow-input-err focus-visible:shadow-input-err', - 'h-14 leading-[3.5rem] rounded-moon-i-sm', - 'rtl:[&:not([disabled])]:[&:not([readonly])]:hover:rounded-moon-i-sm rtl:[&:not([disabled])]:[&:not([readonly])]:focus:rounded-moon-i-sm rtl:[&:not([disabled])]:[&:not([readonly])]:focus-visible:rounded-moon-i-sm rtl:invalid:rounded-moon-i-sm', - 'ltr:[&:not([disabled])]:[&:not([readonly])]:hover:rounded-moon-i-sm ltr:[&:not([disabled])]:[&:not([readonly])]:focus:rounded-moon-i-sm ltr:[&:not([disabled])]:[&:not([readonly])]:focus-visible:rounded-moon-i-sm ltr:invalid:rounded-moon-i-sm', - 'before:box-border after:box-border', - 'placeholder:text-trunks placeholder:opacity-100 placeholder:transition-opacity placeholder:delay-75', - 'read-only:outline-0 read-only:border-none read-only:cursor-not-allowed read-only:hover:shadow-input read-only:focus:shadow-input read-only:focus-visible:shadow-input', - rest.type === 'number' && 'input-number-clear', - rest.type === 'date' && 'ltr:input-d rtl:input-d-rtl', - rest.type === 'time' && 'ltr:input-t rtl:input-t-rtl', - rest.type === 'datetime-local' && - 'ltr:input-d rtl:input-dt-local-rtl', - 'input-xl-dt-shared', + 'h-14 leading-[3.5rem] rounded-moon-i-sm before:box-border after:box-border', + 'placeholder:text-trunks placeholder:opacity-100 placeholder:transition-opacity', + 'placeholder:delay-75 read-only:outline-0 read-only:border-none', + 'read-only:cursor-not-allowed read-only:hover:shadow-input', + 'read-only:focus:shadow-input read-only:focus-visible:shadow-input', + 'invalid:shadow-input-err invalid:hover:shadow-input-err input-xl-dt-shared', + 'invalid:focus:shadow-input-err invalid:focus-visible:shadow-input-err', + getTypeStyles(rest.type), isLabel && 'input-xl pt-[1.125rem] input-xl-dt-label', - 'invalid:shadow-input-err invalid:hover:shadow-input-err invalid:focus:shadow-input-err invalid:focus-visible:shadow-input-err', disabled && 'opacity-60 cursor-not-allowed' )} {...rest} @@ -71,7 +67,7 @@ const Label = ({ children, className }: LabelProps) => { return (