@4alldigital/foundation-ui--gamma 1.23.0 → 1.26.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/dist/foundation-ui.css +1 -1
- package/dist/index.esm.js +215 -7
- package/dist/index.js +216 -6
- package/dist/types/fui/components/Button/Button.types.d.ts +2 -2
- package/dist/types/fui/components/Checkbox/Checkbox.d.ts +5 -0
- package/dist/types/fui/components/Checkbox/Checkbox.stories.d.ts +6 -0
- package/dist/types/fui/components/Checkbox/Checkbox.test.d.ts +1 -0
- package/dist/types/fui/components/Checkbox/Checkbox.types.d.ts +12 -0
- package/dist/types/fui/components/Checkbox/index.d.ts +1 -0
- package/dist/types/fui/components/Copy/Copy.types.d.ts +1 -1
- package/dist/types/fui/components/FileUpload/FileUpload.d.ts +5 -0
- package/dist/types/fui/components/FileUpload/FileUpload.stories.d.ts +6 -0
- package/dist/types/fui/components/FileUpload/FileUpload.test.d.ts +1 -0
- package/dist/types/fui/components/FileUpload/FileUpload.types.d.ts +7 -0
- package/dist/types/fui/components/FileUpload/index.d.ts +1 -0
- package/dist/types/fui/components/Form/Form.d.ts +1 -1
- package/dist/types/fui/components/Form/Form.stories.d.ts +1 -0
- package/dist/types/fui/components/Form/Form.types.d.ts +10 -4
- package/dist/types/fui/components/FormField/FormField.d.ts +1 -1
- package/dist/types/fui/components/FormField/FormField.types.d.ts +8 -0
- package/dist/types/fui/components/FormSelect/FormSelect.d.ts +2 -1
- package/dist/types/fui/components/FormSelect/FormSelect.types.d.ts +8 -7
- package/dist/types/fui/components/Icon/Icon.d.ts +1 -1
- package/dist/types/fui/components/Icon/Icon.types.d.ts +2 -1
- package/dist/types/fui/components/Label/Label.d.ts +8 -0
- package/dist/types/fui/components/Label/Label.stories.d.ts +6 -0
- package/dist/types/fui/components/Label/Label.test.d.ts +1 -0
- package/dist/types/fui/components/Label/Label.types.d.ts +4 -0
- package/dist/types/fui/components/Label/index.d.ts +1 -0
- package/dist/types/fui/components/Loader/Loader.d.ts +1 -1
- package/dist/types/fui/components/Loader/Loader.types.d.ts +1 -0
- package/dist/types/fui/components/Radio/Radio.d.ts +5 -0
- package/dist/types/fui/components/Radio/Radio.stories.d.ts +6 -0
- package/dist/types/fui/components/Radio/Radio.test.d.ts +1 -0
- package/dist/types/fui/components/Radio/Radio.types.d.ts +13 -0
- package/dist/types/fui/components/Radio/index.d.ts +1 -0
- package/dist/types/fui/components/Switch/Switch.d.ts +5 -0
- package/dist/types/fui/components/Switch/Switch.stories.d.ts +6 -0
- package/dist/types/fui/components/Switch/Switch.test.d.ts +1 -0
- package/dist/types/fui/components/Switch/Switch.types.d.ts +7 -0
- package/dist/types/fui/components/Switch/index.d.ts +1 -0
- package/dist/types/fui/components/TextInput/TextInput.types.d.ts +6 -2
- package/dist/types/fui/components/index.d.ts +2 -0
- package/dist/types/fui/hooks/useTheme.d.ts +1 -0
- package/package.json +2 -2
package/dist/foundation-ui.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
[multiple],[type=date],[type=datetime-local],[type=email],[type=month],[type=number],[type=password],[type=search],[type=tel],[type=text],[type=time],[type=url],[type=week],input:where(:not([type])),select,textarea{--tw-shadow:0 0 #0000;-webkit-appearance:none;appearance:none;background-color:#fff;border-color:#6b7280;border-radius:0;border-width:1px;font-size:1rem;line-height:1.5rem;padding:.5rem .75rem}[multiple]:focus,[type=date]:focus,[type=datetime-local]:focus,[type=email]:focus,[type=month]:focus,[type=number]:focus,[type=password]:focus,[type=search]:focus,[type=tel]:focus,[type=text]:focus,[type=time]:focus,[type=url]:focus,[type=week]:focus,input:where(:not([type])):focus,select:focus,textarea:focus{--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#2563eb;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);border-color:#2563eb;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid #0000;outline-offset:2px}input::placeholder,textarea::placeholder{color:#6b7280;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-year-field{padding-bottom:0;padding-top:0}select{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem;-webkit-print-color-adjust:exact;print-color-adjust:exact}[multiple],[size]:where(select:not([size="1"])){background-image:none;background-position:0 0;background-repeat:unset;background-size:initial;padding-right:.75rem;-webkit-print-color-adjust:unset;print-color-adjust:unset}[type=checkbox],[type=radio]{--tw-shadow:0 0 #0000;-webkit-appearance:none;appearance:none;background-color:#fff;background-origin:border-box;border-color:#6b7280;border-width:1px;color:#2563eb;display:inline-block;flex-shrink:0;height:1rem;padding:0;-webkit-print-color-adjust:exact;print-color-adjust:exact;-webkit-user-select:none;user-select:none;vertical-align:middle;width:1rem}[type=checkbox]{border-radius:0}[type=radio]{border-radius:100%}[type=checkbox]:focus,[type=radio]:focus{--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:2px;--tw-ring-offset-color:#fff;--tw-ring-color:#2563eb;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid #0000;outline-offset:2px}[type=checkbox]:checked,[type=radio]:checked{background-color:currentColor;background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:#0000}[type=checkbox]:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L6.5 9.086l4.293-4.293a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E")}@media (forced-colors:active) {[type=checkbox]:checked{-webkit-appearance:auto;appearance:auto}}[type=radio]:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='8' cy='8' r='3'/%3E%3C/svg%3E")}@media (forced-colors:active) {[type=radio]:checked{-webkit-appearance:auto;appearance:auto}}[type=checkbox]:checked:focus,[type=checkbox]:checked:hover,[type=checkbox]:indeterminate,[type=radio]:checked:focus,[type=radio]:checked:hover{background-color:currentColor;border-color:#0000}[type=checkbox]:indeterminate{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3E%3C/svg%3E");background-position:50%;background-repeat:no-repeat;background-size:100% 100%}@media (forced-colors:active) {[type=checkbox]:indeterminate{-webkit-appearance:auto;appearance:auto}}[type=checkbox]:indeterminate:focus,[type=checkbox]:indeterminate:hover{background-color:currentColor;border-color:#0000}[type=file]{background:unset;border-color:inherit;border-radius:0;border-width:0;font-size:unset;line-height:inherit;padding:0}[type=file]:focus{outline:1px solid ButtonText;outline:1px auto -webkit-focus-ring-color}body{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(16 35 59/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));font-family:ProximaNova-Regular,serif}:is(.dark body){--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(16 35 59/var(--tw-bg-opacity));color:rgb(238 238 238/var(--tw-text-opacity))}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width:480px){.container{max-width:480px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:976px){.container{max-width:976px}}@media (min-width:1440px){.container{max-width:1440px}}.sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.left-2{left:.5rem}.m-0{margin:0}.mx-auto{margin-left:auto;margin-right:auto}.my-0{margin-bottom:0;margin-top:0}.-ml-1{margin-left:-.25rem}.mb-0{margin-bottom:0}.mb-1{margin-bottom:.25rem}.mb-16{margin-bottom:4rem}.mb-2{margin-bottom:.5rem}.mb-24{margin-bottom:6rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-40{margin-bottom:10rem}.mb-8{margin-bottom:2rem}.ml-2{margin-left:.5rem}.mr-3{margin-right:.75rem}.mt-6{margin-top:1.5rem}.box-border{box-sizing:border-box}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.list-item{display:list-item}.hidden{display:none}.h-10{height:2.5rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-auto{height:auto}.w-10{width:2.5rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-full{width:100%}.max-w-5xl{max-width:64rem}.flex-1{flex:1 1 0%}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.select-none{-webkit-user-select:none;user-select:none}.resize-none{resize:none}.auto-cols-auto{grid-auto-columns:auto}.auto-rows-min{grid-auto-rows:-webkit-min-content;grid-auto-rows:min-content}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-around{justify-content:space-around}.gap-2{gap:.5rem}.gap-x-4{column-gap:1rem}.gap-y-0{row-gap:0}.gap-y-16{row-gap:4rem}.gap-y-2{row-gap:.5rem}.gap-y-24{row-gap:6rem}.gap-y-4{row-gap:1rem}.gap-y-40{row-gap:10rem}.gap-y-8{row-gap:2rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.75rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.75rem*var(--tw-space-x-reverse))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1rem*var(--tw-space-x-reverse))}.divide-x-2>:not([hidden])~:not([hidden]){--tw-divide-x-reverse:0;border-left-width:calc(2px*(1 - var(--tw-divide-x-reverse)));border-right-width:calc(2px*var(--tw-divide-x-reverse))}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.border{border-width:1px}.border-0{border-width:0}.border-b{border-bottom-width:1px}.border-solid{border-style:solid}.border-dark-body-text{--tw-border-opacity:1;border-color:rgb(238 238 238/var(--tw-border-opacity))}.border-primary{--tw-border-opacity:1;border-color:rgb(0 47 108/var(--tw-border-opacity))}.border-primary-darker{--tw-border-opacity:1;border-color:rgb(0 42 97/var(--tw-border-opacity))}.border-secondary{--tw-border-opacity:1;border-color:rgb(252 183 0/var(--tw-border-opacity))}.border-secondary-darker{--tw-border-opacity:1;border-color:rgb(227 165 0/var(--tw-border-opacity))}.border-tertiary{--tw-border-opacity:1;border-color:rgb(42 61 130/var(--tw-border-opacity))}.border-tertiary-darker{--tw-border-opacity:1;border-color:rgb(38 55 117/var(--tw-border-opacity))}.bg-primary{--tw-bg-opacity:1;background-color:rgb(0 47 108/var(--tw-bg-opacity))}.bg-secondary{--tw-bg-opacity:1;background-color:rgb(252 183 0/var(--tw-bg-opacity))}.bg-tertiary{--tw-bg-opacity:1;background-color:rgb(42 61 130/var(--tw-bg-opacity))}.bg-transparent{background-color:initial}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.p-0{padding:0}.p-2{padding:.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-bottom:0;padding-top:0}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-10{padding-bottom:2.5rem;padding-top:2.5rem}.py-16{padding-bottom:4rem;padding-top:4rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-24{padding-bottom:6rem;padding-top:6rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.py-4{padding-bottom:1rem;padding-top:1rem}.py-40{padding-bottom:10rem;padding-top:10rem}.py-8{padding-bottom:2rem;padding-top:2rem}.pb-2{padding-bottom:.5rem}.pb-8{padding-bottom:2rem}.pl-3{padding-left:.75rem}.pr-3{padding-right:.75rem}.pt-6{padding-top:1.5rem}.font-heading{font-family:ProximaNova-Bold,serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-5xl{font-size:3rem;line-height:1}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.capitalize{text-transform:capitalize}.normal-case{text-transform:none}.italic{font-style:italic}.leading-5{line-height:1.25rem}.text-black{color:rgb(0 0 0/var(--tw-text-opacity))}.text-black,.text-white{--tw-text-opacity:1}.text-white{color:rgb(255 255 255/var(--tw-text-opacity))}.opacity-25{opacity:.25}.opacity-75{opacity:.75}.shadow{--tw-shadow:0 1px 3px 0 #0000001a,0 1px 2px -1px #0000001a;--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.shadow,.shadow-md{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a;--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.\!outline{outline-style:solid!important}.outline{outline-style:solid}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.hover\:border-primary-darker:hover{--tw-border-opacity:1;border-color:rgb(0 42 97/var(--tw-border-opacity))}.hover\:border-secondary-darker:hover{--tw-border-opacity:1;border-color:rgb(227 165 0/var(--tw-border-opacity))}.hover\:border-tertiary-darker:hover{--tw-border-opacity:1;border-color:rgb(38 55 117/var(--tw-border-opacity))}.hover\:bg-primary-darker:hover{--tw-bg-opacity:1;background-color:rgb(0 42 97/var(--tw-bg-opacity))}.hover\:bg-secondary-darker:hover{--tw-bg-opacity:1;background-color:rgb(227 165 0/var(--tw-bg-opacity))}.hover\:bg-tertiary-darker:hover{--tw-bg-opacity:1;background-color:rgb(38 55 117/var(--tw-bg-opacity))}.focus\:outline-none:focus{outline:2px solid #0000;outline-offset:2px}.active\:scale-95:active{--tw-scale-x:.95;--tw-scale-y:.95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[invalid\=true\]\:bg-error[data-invalid=true]{--tw-bg-opacity:1;background-color:rgb(248 114 114/var(--tw-bg-opacity))}.data-\[valid\]\:bg-success[data-valid]{--tw-bg-opacity:1;background-color:rgb(54 211 153/var(--tw-bg-opacity))}.radix-disabled\:opacity-50[data-disabled]{opacity:.5}:is(.dark .dark\:border-dark-body-text){--tw-border-opacity:1;border-color:rgb(238 238 238/var(--tw-border-opacity))}
|
|
1
|
+
body{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(0 30 90/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));font-family:ProximaNova-Regular,serif}:is(.dark body){--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(0 30 90/var(--tw-bg-opacity));color:rgb(238 238 238/var(--tw-text-opacity))}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width:480px){.container{max-width:480px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:976px){.container{max-width:976px}}@media (min-width:1440px){.container{max-width:1440px}}.sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.inset-y-0{bottom:0;top:0}.left-0{left:0}.left-auto{left:auto}.right-0{right:0}.start-3{inset-inline-start:.75rem}.top-0{top:0}.z-10{z-index:10}.m-0{margin:0}.mx-auto{margin-left:auto;margin-right:auto}.my-0{margin-bottom:0;margin-top:0}.-ml-1{margin-left:-.25rem}.mb-0{margin-bottom:0}.mb-1{margin-bottom:.25rem}.mb-16{margin-bottom:4rem}.mb-2{margin-bottom:.5rem}.mb-24{margin-bottom:6rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-40{margin-bottom:10rem}.mb-8{margin-bottom:2rem}.mr-3{margin-right:.75rem}.mt-6{margin-top:1.5rem}.box-border{box-sizing:border-box}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.list-item{display:list-item}.hidden{display:none}.h-10{height:2.5rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-auto{height:auto}.h-full{height:100%}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-full{width:100%}.min-w-0{min-width:0}.max-w-5xl{max-width:64rem}.flex-1{flex:1 1 0%}.flex-auto{flex:1 1 auto}.shrink-0{flex-shrink:0}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.appearance-none{-webkit-appearance:none;appearance:none}.auto-cols-auto{grid-auto-columns:auto}.auto-rows-min{grid-auto-rows:-webkit-min-content;grid-auto-rows:min-content}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-around{justify-content:space-around}.gap-2{gap:.5rem}.gap-x-4{column-gap:1rem}.gap-y-0{row-gap:0}.gap-y-16{row-gap:4rem}.gap-y-2{row-gap:.5rem}.gap-y-24{row-gap:6rem}.gap-y-4{row-gap:1rem}.gap-y-40{row-gap:10rem}.gap-y-8{row-gap:2rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.75rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.75rem*var(--tw-space-x-reverse))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1rem*var(--tw-space-x-reverse))}.divide-x-2>:not([hidden])~:not([hidden]){--tw-divide-x-reverse:0;border-left-width:calc(2px*(1 - var(--tw-divide-x-reverse)));border-right-width:calc(2px*var(--tw-divide-x-reverse))}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.border{border-width:1px}.border-0{border-width:0}.border-b{border-bottom-width:1px}.border-solid{border-style:solid}.border-none{border-style:none}.border-dark-body-text{--tw-border-opacity:1;border-color:rgb(238 238 238/var(--tw-border-opacity))}.border-primary{--tw-border-opacity:1;border-color:rgb(0 30 90/var(--tw-border-opacity))}.border-primary-darker{--tw-border-opacity:1;border-color:rgb(0 27 81/var(--tw-border-opacity))}.border-secondary{--tw-border-opacity:1;border-color:rgb(252 183 0/var(--tw-border-opacity))}.border-secondary-darker{--tw-border-opacity:1;border-color:rgb(227 165 0/var(--tw-border-opacity))}.border-tertiary{--tw-border-opacity:1;border-color:rgb(163 176 202/var(--tw-border-opacity))}.border-tertiary-darker{--tw-border-opacity:1;border-color:rgb(140 156 189/var(--tw-border-opacity))}.bg-primary{--tw-bg-opacity:1;background-color:rgb(0 30 90/var(--tw-bg-opacity))}.bg-secondary{--tw-bg-opacity:1;background-color:rgb(252 183 0/var(--tw-bg-opacity))}.bg-tertiary{--tw-bg-opacity:1;background-color:rgb(163 176 202/var(--tw-bg-opacity))}.bg-transparent{background-color:initial}.bg-none{background-image:none}.bg-clip-padding{background-clip:padding-box}.p-0{padding:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-11{padding-left:2.75rem;padding-right:2.75rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-bottom:0;padding-top:0}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-10{padding-bottom:2.5rem;padding-top:2.5rem}.py-16{padding-bottom:4rem;padding-top:4rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-24{padding-bottom:6rem;padding-top:6rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.py-4{padding-bottom:1rem;padding-top:1rem}.py-40{padding-bottom:10rem;padding-top:10rem}.py-8{padding-bottom:2rem;padding-top:2rem}.pb-2{padding-bottom:.5rem}.pb-8{padding-bottom:2rem}.pl-12{padding-left:3rem}.pl-2{padding-left:.5rem}.pl-3{padding-left:.75rem}.pr-2{padding-right:.5rem}.pr-3{padding-right:.75rem}.ps-3{padding-inline-start:.75rem}.pt-6{padding-top:1.5rem}.font-heading{font-family:ProximaNova-Bold,serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-5xl{font-size:3rem;line-height:1}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.capitalize{text-transform:capitalize}.normal-case{text-transform:none}.italic{font-style:italic}.leading-5{line-height:1.25rem}.leading-none{line-height:1}.text-black{color:rgb(0 0 0/var(--tw-text-opacity))}.text-black,.text-white{--tw-text-opacity:1}.text-white{color:rgb(255 255 255/var(--tw-text-opacity))}.opacity-0{opacity:0}.opacity-25{opacity:.25}.opacity-75{opacity:.75}.shadow{--tw-shadow:0 1px 3px 0 #0000001a,0 1px 2px -1px #0000001a;--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.\!outline{outline-style:solid!important}.outline{outline-style:solid}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}@layer component{.form{--tw-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a;--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);background-color:#0000001a;border-radius:.25rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);display:flex;flex-direction:column}:is(.dark .form){background-color:#0003}.form-item{--tw-border-opacity:1;-webkit-appearance:none;appearance:none;background-color:#ffffff1a;border-color:rgb(84 104 144/var(--tw-border-opacity));border-style:solid;border-width:1px;box-sizing:border-box;outline:2px solid #0000;outline-offset:2px}:is(.dark .form-item){--tw-border-opacity:1;background-color:#0000001a;border-color:rgb(51 75 123/var(--tw-border-opacity))}.form-item{color:rgb(84 104 144/var(--tw-text-opacity))}.form-item,.form-item:focus{--tw-text-opacity:1}.form-item:focus{color:rgb(255 255 255/var(--tw-text-opacity))}:is(.dark .form-item){--tw-text-opacity:1;color:rgb(84 104 144/var(--tw-text-opacity))}:is(.dark .form-item:focus){--tw-text-opacity:1;color:rgb(238 238 238/var(--tw-text-opacity))}.form-item:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)!important;--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)!important;--tw-ring-opacity:1!important;--tw-ring-color:rgb(58 191 248/var(--tw-ring-opacity))!important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)!important}:is(.dark .form-item:focus){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)!important;--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)!important;--tw-ring-opacity:1!important;--tw-ring-color:rgb(58 191 248/var(--tw-ring-opacity))!important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)!important}.form-item:invalid{--tw-border-opacity:1;border-color:rgb(248 114 114/var(--tw-border-opacity));border-width:2px}:is(.dark .form-item:invalid){--tw-border-opacity:1;border-color:rgb(248 114 114/var(--tw-border-opacity))}.form-item:disabled{--tw-bg-opacity:1;background-color:rgb(0 30 90/var(--tw-bg-opacity))}:is(.dark .form-item:disabled){--tw-bg-opacity:1;background-color:rgb(0 30 90/var(--tw-bg-opacity))}.label{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}:is(.dark .label){--tw-text-opacity:1;color:rgb(138 152 179/var(--tw-text-opacity))}.text-input{border-radius:.25rem;padding:.75rem;width:100%}.text-input:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(58 191 248/var(--tw-ring-opacity))}:is(.dark .text-input:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(58 191 248/var(--tw-ring-opacity))}.checkbox{border-radius:.25rem}.checkbox:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(58 191 248/var(--tw-ring-opacity))}:is(.dark .checkbox:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(58 191 248/var(--tw-ring-opacity))}.radio{border-radius:9999px}.radio:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(58 191 248/var(--tw-ring-opacity))}:is(.dark .radio:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(58 191 248/var(--tw-ring-opacity))}.form-icon{--tw-text-opacity:1;color:rgb(138 152 179/var(--tw-text-opacity))}:is(.dark .form-icon){--tw-text-opacity:1;color:rgb(138 152 179/var(--tw-text-opacity))}.switch{border-radius:9999px}.peer:checked~.switch{--tw-bg-opacity:1;background-color:rgb(84 104 144/var(--tw-bg-opacity))}.peer:focus~.switch{--tw-ring-opacity:1;--tw-ring-color:rgb(58 191 248/var(--tw-ring-opacity))}:is(.dark .switch){--tw-border-opacity:1;border-color:rgb(0 30 90/var(--tw-border-opacity))}:is(.dark .peer:checked~.switch){--tw-bg-opacity:1;background-color:rgb(51 75 123/var(--tw-bg-opacity))}.file-upload::-webkit-file-upload-button{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(84 104 144/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity))}.file-upload::file-selector-button{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(84 104 144/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity))}:is(.dark .file-upload)::-webkit-file-upload-button{--tw-bg-opacity:1;background-color:rgb(51 75 123/var(--tw-bg-opacity))}:is(.dark .file-upload)::file-selector-button{--tw-bg-opacity:1;background-color:rgb(51 75 123/var(--tw-bg-opacity))}}.file\:mr-3::-webkit-file-upload-button{margin-right:.75rem}.file\:mr-3::file-selector-button{margin-right:.75rem}.file\:cursor-pointer::-webkit-file-upload-button{cursor:pointer}.file\:cursor-pointer::file-selector-button{cursor:pointer}.file\:overflow-hidden::-webkit-file-upload-button{overflow:hidden}.file\:overflow-hidden::file-selector-button{overflow:hidden}.file\:rounded-none::-webkit-file-upload-button{border-radius:0}.file\:rounded-none::file-selector-button{border-radius:0}.file\:border-0::-webkit-file-upload-button{border-width:0}.file\:border-0::file-selector-button{border-width:0}.file\:border-solid::-webkit-file-upload-button{border-style:solid}.file\:border-solid::file-selector-button{border-style:solid}.file\:border-inherit::-webkit-file-upload-button{border-color:inherit}.file\:border-inherit::file-selector-button{border-color:inherit}.file\:p-3::-webkit-file-upload-button{padding:.75rem}.file\:p-3::file-selector-button{padding:.75rem}.file\:transition::-webkit-file-upload-button{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;-webkit-transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.file\:transition::file-selector-button{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.file\:duration-150::-webkit-file-upload-button{transition-duration:.15s}.file\:duration-150::file-selector-button{transition-duration:.15s}.file\:ease-in-out::-webkit-file-upload-button{transition-timing-function:cubic-bezier(.4,0,.2,1)}.file\:ease-in-out::file-selector-button{transition-timing-function:cubic-bezier(.4,0,.2,1)}.file\:\[border-inline-end-width\:1px\]::-webkit-file-upload-button{border-inline-end-width:1px}.file\:\[border-inline-end-width\:1px\]::file-selector-button{border-inline-end-width:1px}.file\:\[margin-inline-end\:0\.75rem\]::-webkit-file-upload-button{margin-inline-end:.75rem}.file\:\[margin-inline-end\:0\.75rem\]::file-selector-button{margin-inline-end:.75rem}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:start-\[1px\]:after{content:var(--tw-content);inset-inline-start:1px}.after\:top-\[1px\]:after{content:var(--tw-content);top:1px}.after\:h-5:after{content:var(--tw-content);height:1.25rem}.after\:w-5:after{content:var(--tw-content);width:1.25rem}.after\:rounded-full:after{border-radius:9999px;content:var(--tw-content)}.after\:border:after{border-width:1px;content:var(--tw-content)}.after\:bg-white:after{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity));content:var(--tw-content)}.after\:transition-all:after{content:var(--tw-content);transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.after\:content-\[\'\'\]:after{--tw-content:"";content:var(--tw-content)}.hover\:border-primary-darker:hover{--tw-border-opacity:1;border-color:rgb(0 27 81/var(--tw-border-opacity))}.hover\:border-secondary-darker:hover{--tw-border-opacity:1;border-color:rgb(227 165 0/var(--tw-border-opacity))}.hover\:border-tertiary-darker:hover{--tw-border-opacity:1;border-color:rgb(140 156 189/var(--tw-border-opacity))}.hover\:bg-primary-darker:hover{--tw-bg-opacity:1;background-color:rgb(0 27 81/var(--tw-bg-opacity))}.hover\:bg-secondary-darker:hover{--tw-bg-opacity:1;background-color:rgb(227 165 0/var(--tw-bg-opacity))}.hover\:bg-tertiary-darker:hover{--tw-bg-opacity:1;background-color:rgb(140 156 189/var(--tw-bg-opacity))}.focus\:outline-none:focus{outline:2px solid #0000;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.active\:scale-95:active{--tw-scale-x:.95;--tw-scale-y:.95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:checked~.peer-checked\:opacity-100{opacity:1}.peer:checked~.peer-checked\:after\:translate-x-full:after{--tw-translate-x:100%;content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:checked~.peer-checked\:after\:border-white:after{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity));content:var(--tw-content)}.peer:focus~.peer-focus\:ring-info{--tw-ring-opacity:1;--tw-ring-color:rgb(58 191 248/var(--tw-ring-opacity))}.data-\[invalid\=true\]\:bg-error[data-invalid=true]{--tw-bg-opacity:1;background-color:rgb(248 114 114/var(--tw-bg-opacity))}.data-\[valid\]\:bg-success[data-valid]{--tw-bg-opacity:1;background-color:rgb(54 211 153/var(--tw-bg-opacity))}:is(.dark .dark\:border-dark-body-text){--tw-border-opacity:1;border-color:rgb(238 238 238/var(--tw-border-opacity))}:is(.dark .peer:focus~.dark\:peer-focus\:ring-info){--tw-ring-opacity:1;--tw-ring-color:rgb(58 191 248/var(--tw-ring-opacity))}.peer:checked~.rtl\:peer-checked\:after\:-translate-x-full:where([dir=rtl],[dir=rtl] *):after{--tw-translate-x:-100%;content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}
|
|
2
2
|
@font-face{font-display:swap;font-family:ProximaNova-Regular;font-style:normal;font-weight:400;src:url(https://cdn.tools.4alldigital.io/fonts/ProximaNovaReg.woff2) format("woff2"),url(https://cdn.tools.4alldigital.io/fonts/ProximaNovaReg.woff) format("woff")}@font-face{font-display:swap;font-family:ProximaNova-Bold;font-style:normal;font-weight:700;src:url(https://cdn.tools.4alldigital.io/fonts/ProximaNovaBold.woff2) format("woff2"),url(https://cdn.tools.4alldigital.io/fonts/ProximaNovaBold.woff) format("woff")}
|
package/dist/index.esm.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import cx from 'classnames';
|
|
3
3
|
import { Icon as Icon$1 } from '@iconify/react';
|
|
4
|
+
import React, { useEffect } from 'react';
|
|
5
|
+
import { useForm, FormProvider, useFormContext, Controller } from 'react-hook-form';
|
|
4
6
|
|
|
5
7
|
var Blockquote = function (_a) {
|
|
6
8
|
var text = _a.text, citation = _a.citation, className = _a.className, citationAttribute = _a.citationAttribute, _b = _a.showIcon, showIcon = _b === void 0 ? true : _b;
|
|
@@ -56,7 +58,7 @@ var Button = function (_a) {
|
|
|
56
58
|
icon: 'w-6 h-6',
|
|
57
59
|
},
|
|
58
60
|
};
|
|
59
|
-
var classes = cx('font-bold flex items-center transition-all duration-200 transform active:scale-95 justify-around border-solid border rounded', { 'text-white border-primary hover:bg-primary-darker hover:border-primary-darker': variant === 'primary' }, { 'text-white border-secondary hover:bg-secondary-darker hover:border-secondary-darker': variant === 'secondary' }, { 'text-black border-tertiary hover:bg-tertiary-darker hover:border-tertiary-darker': variant === 'tertiary' }, { 'bg-primary': variant === 'primary' && !outline }, { 'bg-secondary': variant === 'secondary' && !outline }, { 'bg-tertiary': variant === 'tertiary' && !outline }, { 'bg-transparent': outline }, { shadow: raised }, { uppercase: uppercase }, { 'auto-cols-auto grid-cols-2 gap-2': icon || external }, { 'rounded-full': rounded }, { 'flex-row-reverse': iconFirst }, "".concat(sizes[size].y, " ").concat(sizes[size].x, " ").concat(sizes[size].text), className);
|
|
61
|
+
var classes = cx('font-bold flex items-center transition-all duration-200 transform active:scale-95 justify-around border-solid border rounded cursor-pointer focus:outline-none', { 'text-white border-primary hover:bg-primary-darker hover:border-primary-darker': variant === 'primary' }, { 'text-white border-secondary hover:bg-secondary-darker hover:border-secondary-darker': variant === 'secondary' }, { 'text-black border-tertiary hover:bg-tertiary-darker hover:border-tertiary-darker': variant === 'tertiary' }, { 'bg-primary': variant === 'primary' && !outline }, { 'bg-secondary': variant === 'secondary' && !outline }, { 'bg-tertiary': variant === 'tertiary' && !outline }, { 'bg-transparent': outline }, { shadow: raised }, { uppercase: uppercase }, { 'auto-cols-auto grid-cols-2 gap-2': icon || external }, { 'rounded-full': rounded }, { 'flex-row-reverse': iconFirst }, "".concat(sizes[size].y, " ").concat(sizes[size].x, " ").concat(sizes[size].text), className);
|
|
60
62
|
var iconClasses = cx(sizes[size].icon);
|
|
61
63
|
return (jsx("button", { id: id, "data-testid": testID || id || 'Button', onClick: onClick, className: classes, type: type, disabled: disabled, "aria-label": ariaLabel, role: "button", children: jsxs(Fragment, { children: [children, icon && !external && (jsx("span", { className: "flex items-center", children: jsx(Icon$1, { icon: icon, className: iconClasses }) })), external && (jsx("span", { className: "flex items-center", children: jsx(Icon$1, { icon: "carbon:launch", className: iconClasses }) }))] }) }));
|
|
62
64
|
};
|
|
@@ -162,11 +164,11 @@ Heading.displayName = 'Heading';
|
|
|
162
164
|
* List of supported icons can be found at https://icon-sets.iconify.design.
|
|
163
165
|
*/
|
|
164
166
|
var Icon = function (_a) {
|
|
165
|
-
var name = _a.name, _b = _a.size, size = _b === void 0 ? 24 : _b, color = _a.color, id = _a.id, testID = _a.testID;
|
|
167
|
+
var name = _a.name, _b = _a.size, size = _b === void 0 ? 24 : _b, color = _a.color, id = _a.id, className = _a.className, testID = _a.testID;
|
|
166
168
|
if (color) {
|
|
167
|
-
return jsx(Icon$1, { "data-testid": testID || id ||
|
|
169
|
+
return (jsx(Icon$1, { "data-testid": testID || id || 'Icon', icon: name, width: size, height: size, color: color, className: className, fill: color || 'currentColor' }));
|
|
168
170
|
}
|
|
169
|
-
return jsx(Icon$1, { "data-testid": testID || id ||
|
|
171
|
+
return (jsx(Icon$1, { "data-testid": testID || id || 'Icon', icon: name, width: size, height: size }));
|
|
170
172
|
};
|
|
171
173
|
Icon.displayName = 'Icon';
|
|
172
174
|
|
|
@@ -246,9 +248,9 @@ var Notice = function (_a) {
|
|
|
246
248
|
Notice.displayName = 'Notice';
|
|
247
249
|
|
|
248
250
|
var Loader = function (_a) {
|
|
249
|
-
var _b = _a.size, size = _b === void 0 ? 8 : _b;
|
|
251
|
+
var color = _a.color, _b = _a.size, size = _b === void 0 ? 8 : _b, _c = _a.thickness, thickness = _c === void 0 ? 4 : _c;
|
|
250
252
|
var sizeClass = size ? "w-".concat(size, " h-").concat(size) : 'w-8 h-8';
|
|
251
|
-
return (jsx("div", { "data-testid": "Loader", children: jsxs("div", { role: "status", children: [jsxs("svg", { className: "animate-spin -ml-1 mr-3 ".concat(sizeClass, " text-white"), xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke:
|
|
253
|
+
return (jsx("div", { "data-testid": "Loader", children: jsxs("div", { role: "status", children: [jsxs("svg", { className: "animate-spin -ml-1 mr-3 ".concat(sizeClass, " text-white"), xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: color || 'currentColor', strokeWidth: thickness }), jsx("path", { className: "opacity-75", fill: color || 'currentColor', d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })] }), jsx("span", { className: "sr-only", children: "Loading..." })] }) }));
|
|
252
254
|
};
|
|
253
255
|
Loader.displayName = 'Loader';
|
|
254
256
|
|
|
@@ -295,4 +297,210 @@ var ContentRowsLayout = function (_a) {
|
|
|
295
297
|
};
|
|
296
298
|
ContentRowsLayout.displayName = 'ContentRowsLayout';
|
|
297
299
|
|
|
298
|
-
|
|
300
|
+
/******************************************************************************
|
|
301
|
+
Copyright (c) Microsoft Corporation.
|
|
302
|
+
|
|
303
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
304
|
+
purpose with or without fee is hereby granted.
|
|
305
|
+
|
|
306
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
307
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
308
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
309
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
310
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
311
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
312
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
313
|
+
***************************************************************************** */
|
|
314
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
var __assign = function() {
|
|
318
|
+
__assign = Object.assign || function __assign(t) {
|
|
319
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
320
|
+
s = arguments[i];
|
|
321
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
322
|
+
}
|
|
323
|
+
return t;
|
|
324
|
+
};
|
|
325
|
+
return __assign.apply(this, arguments);
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
function __rest(s, e) {
|
|
329
|
+
var t = {};
|
|
330
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
331
|
+
t[p] = s[p];
|
|
332
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
333
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
334
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
335
|
+
t[p[i]] = s[p[i]];
|
|
336
|
+
}
|
|
337
|
+
return t;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
341
|
+
var e = new Error(message);
|
|
342
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
var Form = function (_a) {
|
|
346
|
+
var children = _a.children, className = _a.className, submit = _a.submit, _b = _a.onSubmit, onSubmit = _b === void 0 ? function () { } : _b, onChange = _a.onChange, hideSubmit = _a.hideSubmit, ariaSubmitLabel = _a.ariaSubmitLabel, submitID = _a.submitID, _c = _a.submitVariant, submitVariant = _c === void 0 ? BTN_VARIANTS.PRIMARY : _c, _d = _a.initialValues, initialValues = _d === void 0 ? {} : _d;
|
|
347
|
+
var methods = useForm({
|
|
348
|
+
defaultValues: initialValues,
|
|
349
|
+
});
|
|
350
|
+
useEffect(function () {
|
|
351
|
+
if (onChange && typeof onChange === 'function') {
|
|
352
|
+
var subscription_1 = methods.watch(function (value) { return onChange(value); });
|
|
353
|
+
return function () { return subscription_1.unsubscribe(); };
|
|
354
|
+
}
|
|
355
|
+
}, []);
|
|
356
|
+
var submitClasses = cx({ 'sr-only': hideSubmit });
|
|
357
|
+
return (jsx(FormProvider, __assign({}, methods, { children: jsx("div", { "data-testid": "Form", className: "w-full max-w-s @form @containers", children: jsxs("form", { onSubmit: methods.handleSubmit(onSubmit), className: cx('form px-8 pt-6 pb-8 mb-4 w-2xs', className), children: [children, submit && (jsx("div", { className: "flex items-center justify-end py-2", children: jsx(Button, { id: submitID || submit, className: submitClasses, ariaLabel: ariaSubmitLabel || submit || 'Submit', type: BTN_TYPES.SUBMIT, variant: submitVariant, children: submit }) }))] }) }) })));
|
|
358
|
+
};
|
|
359
|
+
Form.displayName = 'Form';
|
|
360
|
+
|
|
361
|
+
var FieldTypes;
|
|
362
|
+
(function (FieldTypes) {
|
|
363
|
+
FieldTypes["TEXT"] = "text";
|
|
364
|
+
FieldTypes["TEXTAREA"] = "textarea";
|
|
365
|
+
FieldTypes["SELECT"] = "select";
|
|
366
|
+
FieldTypes["CHECKBOX"] = "checkbox";
|
|
367
|
+
FieldTypes["RADIO"] = "radio";
|
|
368
|
+
FieldTypes["SWITCH"] = "switch";
|
|
369
|
+
FieldTypes["DATE"] = "date";
|
|
370
|
+
FieldTypes["TIME"] = "time";
|
|
371
|
+
FieldTypes["DATETIME"] = "datetime";
|
|
372
|
+
FieldTypes["FILE"] = "file";
|
|
373
|
+
FieldTypes["PASSWORD"] = "password";
|
|
374
|
+
FieldTypes["EMAIL"] = "email";
|
|
375
|
+
FieldTypes["NUMBER"] = "number";
|
|
376
|
+
FieldTypes["TEL"] = "tel";
|
|
377
|
+
FieldTypes["URL"] = "url";
|
|
378
|
+
FieldTypes["SEARCH"] = "search";
|
|
379
|
+
// MONTH = 'month',
|
|
380
|
+
// WEEK = 'week',
|
|
381
|
+
// HIDDEN = 'hidden',
|
|
382
|
+
// COLOR = 'color',
|
|
383
|
+
// RANGE = 'range',
|
|
384
|
+
// CURRENCY = 'currency',
|
|
385
|
+
// PERCENT = 'percent',
|
|
386
|
+
})(FieldTypes || (FieldTypes = {}));
|
|
387
|
+
|
|
388
|
+
var InputType;
|
|
389
|
+
(function (InputType) {
|
|
390
|
+
InputType["TEXT"] = "text";
|
|
391
|
+
InputType["PASSWORD"] = "password";
|
|
392
|
+
InputType["EMAIL"] = "email";
|
|
393
|
+
InputType["NUMBER"] = "number";
|
|
394
|
+
InputType["TEL"] = "tel";
|
|
395
|
+
InputType["URL"] = "url";
|
|
396
|
+
InputType["SEARCH"] = "search";
|
|
397
|
+
InputType["DATE"] = "date";
|
|
398
|
+
InputType["TIME"] = "time";
|
|
399
|
+
InputType["DATETIME"] = "datetime-local";
|
|
400
|
+
InputType["MONTH"] = "month";
|
|
401
|
+
InputType["WEEK"] = "week";
|
|
402
|
+
InputType["FILE"] = "file";
|
|
403
|
+
InputType["TEXTAREA"] = "textarea";
|
|
404
|
+
})(InputType || (InputType = {}));
|
|
405
|
+
|
|
406
|
+
var TextInput = React.forwardRef(function MyInput(_a, ref) {
|
|
407
|
+
var _b = _a.type, type = _b === void 0 ? InputType.TEXT : _b, _c = _a.required, required = _c === void 0 ? false : _c, className = _a.className, onChange = _a.onChange, placeholder = _a.placeholder, icon = _a.icon, _d = _a.disabled, disabled = _d === void 0 ? false : _d, rest = __rest(_a, ["type", "required", "className", "onChange", "placeholder", "icon", "disabled"]);
|
|
408
|
+
React.useEffect(function () {
|
|
409
|
+
if (typeof window !== 'undefined') {
|
|
410
|
+
// eslint-disable-next-line global-require
|
|
411
|
+
require('date-input-polyfill');
|
|
412
|
+
}
|
|
413
|
+
}, []);
|
|
414
|
+
var format = 'dd/mm/yyyy';
|
|
415
|
+
var placeholderSet = type === 'date' ? format.toUpperCase() : placeholder;
|
|
416
|
+
// console.log('TextInput', rest);
|
|
417
|
+
if (type === InputType.TEXTAREA) {
|
|
418
|
+
return (jsx("div", { "data-testid": "TextInput", className: "relative", children: jsx("textarea", __assign({ ref: ref, required: required, "aria-required": required, disabled: disabled, placeholder: placeholderSet, onChange: onChange, rows: 4, className: cx('form-item text-input resize-none', className) }, rest)) }));
|
|
419
|
+
}
|
|
420
|
+
return (jsxs("div", { "data-testid": "TextInput", className: "relative", children: [icon && (jsx("div", { className: "form-icon absolute inset-y-0 start-3 flex items-center ps-3.5 pointer-events-none", children: jsx(Icon, { name: icon }) })), jsx("input", __assign({ ref: ref, type: type, required: required, "aria-required": required, disabled: disabled, placeholder: placeholderSet, onChange: onChange, className: cx('form-item text-input', { 'pl-12': icon }, className) }, rest))] }));
|
|
421
|
+
});
|
|
422
|
+
TextInput.displayName = 'TextInput';
|
|
423
|
+
|
|
424
|
+
var Checkbox = React.forwardRef(function MyInput(_a, ref) {
|
|
425
|
+
var id = _a.id, label = _a.label, required = _a.required, className = _a.className, disabled = _a.disabled, rest = __rest(_a, ["id", "label", "required", "className", "disabled"]);
|
|
426
|
+
return (jsxs("div", { "data-testid": "Checkbox", className: cx('flex items-center', className), children: [jsxs("div", { className: "relative bg-none w-5 h-5 flex justify-center items-center", "aria-label": label, children: [jsx("input", __assign({ id: id, ref: ref, disabled: disabled, type: "checkbox", className: "form-item checkbox m-0 appearance-none peer h-full w-full shrink-0 focus:ring-2", required: required }, rest)), jsx("span", { className: "absolute transition-opacity opacity-0 pointer-events-none peer-checked:opacity-100 w-full h-full flex items-center justify-center top-0 left-0", children: jsx(Icon, { name: "mdi:check-bold", size: 12 }) })] }), label && (jsx("label", { className: "label pl-2 leading-none", htmlFor: id, children: label }))] }));
|
|
427
|
+
});
|
|
428
|
+
Checkbox.displayName = 'Checkbox';
|
|
429
|
+
|
|
430
|
+
var Label = function (_a) {
|
|
431
|
+
var label = _a.label, id = _a.id;
|
|
432
|
+
return (jsx("label", { "data-testid": "Label", className: "label mb-1", htmlFor: id, children: label }));
|
|
433
|
+
};
|
|
434
|
+
Label.displayName = 'Label';
|
|
435
|
+
|
|
436
|
+
var FormSelect = React.forwardRef(function MyInput(_a, ref) {
|
|
437
|
+
var id = _a.id, name = _a.name, options = _a.options, required = _a.required, className = _a.className, disabled = _a.disabled, rest = __rest(_a, ["id", "name", "options", "required", "className", "disabled"]);
|
|
438
|
+
if (!options) {
|
|
439
|
+
throw new Error('FormSelect requires options prop');
|
|
440
|
+
}
|
|
441
|
+
return (jsx("div", { id: id, className: cx('pb-2', className), children: jsxs("div", { className: "relative", children: [jsx("select", __assign({ ref: ref, id: id, name: name, disabled: disabled, required: required, className: "form-item text-input" }, rest, { children: options.map(function (option) { return (jsx("option", { value: option.value, disabled: option.disabled, children: option.label }, option.value)); }) })), jsx("div", { className: "form-icon absolute inset-0 z-10 pointer-events-none h-full w-12 items-center justify-center top-0 right-0 left-auto flex", children: jsx(Icon, { name: "mdi:chevron-down", size: 24, className: "pointer-events-none" }) })] }) }));
|
|
442
|
+
});
|
|
443
|
+
FormSelect.displayName = 'FormSelect';
|
|
444
|
+
|
|
445
|
+
var Radio = React.forwardRef(function MyInput(_a, ref) {
|
|
446
|
+
var id = _a.id, name = _a.name, label = _a.label, required = _a.required, className = _a.className, options = _a.options, rest = __rest(_a, ["id", "name", "label", "required", "className", "options"]);
|
|
447
|
+
return (jsx("div", { "data-testid": "Radio", className: cx('flex items-center', className), children: jsx("div", { className: cx('flex flex-col gap-2', className), "aria-label": label, id: id, children: options === null || options === void 0 ? void 0 : options.map(function (option) { return (jsxs("div", { className: "flex items-center relative", children: [jsxs("div", { className: "relative flex items-center", children: [jsx("input", __assign({ id: option.value, ref: ref, name: name, type: "radio", value: option.value, required: required, className: "form-item radio peer appearance-none m-0 p-0 w-4 h-4" }, rest)), jsx("div", { className: "form-icon opacity-0 peer-checked:opacity-100 absolute w-4 h-4 flex items-center justify-center top-0 left-0 pointer-events-none", children: jsx(Icon, { name: "mdi:circle", size: 12 }) })] }), jsx("label", { className: "label pl-2 leading-none", htmlFor: option.value, children: option.label })] }, option.value)); }) }) }));
|
|
448
|
+
});
|
|
449
|
+
Radio.displayName = 'Radio';
|
|
450
|
+
|
|
451
|
+
var Switch = React.forwardRef(function MyInput(_a, ref) {
|
|
452
|
+
var id = _a.id, name = _a.name, required = _a.required, disabled = _a.disabled, className = _a.className, rest = __rest(_a, ["id", "name", "required", "disabled", "className"]);
|
|
453
|
+
return (jsxs("label", { "data-testid": "Switch", className: cx('inline-flex items-center cursor-pointer', className), children: [jsx("input", __assign({ ref: ref, id: id, name: name, type: "checkbox", value: "", className: "sr-only peer", disabled: disabled, required: required }, rest)), jsx("div", { className: "form-item switch peer-focus:ring-info dark:peer-focus:ring-info relative w-11 h-6 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[1px] after:start-[1px] after:bg-white after:border after:rounded-full after:h-5 after:w-5 after:transition-all transition-all" })] }));
|
|
454
|
+
});
|
|
455
|
+
Switch.displayName = 'Switch';
|
|
456
|
+
|
|
457
|
+
var FileUpload = React.forwardRef(function MyInput(_a, ref) {
|
|
458
|
+
var id = _a.id, name = _a.name, required = _a.required, disabled = _a.disabled, className = _a.className, rest = __rest(_a, ["id", "name", "required", "disabled", "className"]);
|
|
459
|
+
return (jsx("div", { "data-testid": "FileUpload", className: className, children: jsx("input", __assign({ ref: ref, className: cx('form-item text-input file-upload p-0 relative m-0 min-w-0 flex-auto appearance-none block box-border bg-clip-padding file:p-3 file:cursor-pointer file:mr-3 file:overflow-hidden cursor-pointer file:border-0 file:rounded-none file:border-solid file:border-inherit file:transition file:duration-150 file:ease-in-out file:[border-inline-end-width:1px] file:[margin-inline-end:0.75rem] '), "aria-describedby": "file_input_help", type: "file", disabled: disabled, required: required, name: name, id: id }, rest)) }));
|
|
460
|
+
});
|
|
461
|
+
FileUpload.displayName = 'FileUpload';
|
|
462
|
+
|
|
463
|
+
var FormField = function (_a) {
|
|
464
|
+
var name = _a.name, type = _a.type, label = _a.label, required = _a.required, className = _a.className, icon = _a.icon, options = _a.options, disabled = _a.disabled, description = _a.description, showPasswordLabel = _a.showPasswordLabel, hidePasswordLabel = _a.hidePasswordLabel;
|
|
465
|
+
var _b = React.useState(false), passwordShowStatus = _b[0], setPasswordShow = _b[1];
|
|
466
|
+
var _c = useFormContext(), control = _c.control, register = _c.register;
|
|
467
|
+
var renderType = function (type) {
|
|
468
|
+
switch (type) {
|
|
469
|
+
case FieldTypes.TEXT:
|
|
470
|
+
return (jsx(TextInput, __assign({ type: InputType.TEXT, required: required, icon: icon, className: className, disabled: disabled }, register(name))));
|
|
471
|
+
case FieldTypes.PASSWORD: {
|
|
472
|
+
var toggleType = passwordShowStatus ? InputType.TEXT : InputType.PASSWORD;
|
|
473
|
+
var btnClass = 'appearance-none border-none bg-transparent flex items-center';
|
|
474
|
+
return (jsxs("div", { className: "relative", children: [jsx("span", { className: "absolute right-0 top-0 flex items-center justify-center h-full z-10 pr-2", onClick: function () { return setPasswordShow(function (pS) { return !pS; }); }, role: "button", tabIndex: 0, children: passwordShowStatus ? (jsx("button", { type: "button", "aria-label": hidePasswordLabel, className: cx(btnClass, 'form-icon'), children: jsx(Icon, { name: "mdi:eye-off", size: 24 }) })) : (jsx("button", { type: "button", "aria-label": showPasswordLabel, className: cx(btnClass, 'form-icon'), children: jsx(Icon, { name: "mdi:eye", size: 24 }) })) }), jsx(TextInput, __assign({ type: toggleType, required: required, icon: icon, className: className, disabled: disabled }, register(name)))] }));
|
|
475
|
+
}
|
|
476
|
+
case FieldTypes.TEXTAREA:
|
|
477
|
+
return (jsx(TextInput, __assign({ type: InputType.TEXTAREA, required: required, icon: icon, className: className, disabled: disabled }, register(name))));
|
|
478
|
+
case FieldTypes.EMAIL:
|
|
479
|
+
return (jsx(TextInput, __assign({ type: InputType.EMAIL, required: required, icon: icon, className: className, disabled: disabled }, register(name))));
|
|
480
|
+
case FieldTypes.DATE:
|
|
481
|
+
return (jsx(TextInput, __assign({ type: InputType.DATE, required: required, icon: icon, className: className, disabled: disabled }, register(name))));
|
|
482
|
+
case FieldTypes.DATETIME:
|
|
483
|
+
return (jsx(TextInput, __assign({ type: InputType.DATETIME, required: required, icon: icon, className: className, disabled: disabled }, register(name))));
|
|
484
|
+
case FieldTypes.NUMBER:
|
|
485
|
+
return (jsx(TextInput, __assign({ type: InputType.NUMBER, required: required, icon: icon, className: className, disabled: disabled }, register(name))));
|
|
486
|
+
case FieldTypes.CHECKBOX:
|
|
487
|
+
return (jsx(Checkbox, __assign({ required: required, id: name, className: className, label: label, disabled: disabled }, register(name))));
|
|
488
|
+
case FieldTypes.RADIO:
|
|
489
|
+
return (jsx(Radio, __assign({ required: required, id: name, className: className, label: label, options: options, disabled: disabled }, register(name))));
|
|
490
|
+
case FieldTypes.SWITCH:
|
|
491
|
+
return jsx(Switch, __assign({ id: name, required: required, className: className, disabled: disabled }, register(name)));
|
|
492
|
+
case FieldTypes.SELECT:
|
|
493
|
+
return (jsx(FormSelect, __assign({ required: required, id: name, className: className, disabled: disabled, label: label, options: options }, register(name))));
|
|
494
|
+
case FieldTypes.FILE:
|
|
495
|
+
return (jsx(FileUpload, __assign({ required: required, id: name, className: className, disabled: disabled }, register(name))));
|
|
496
|
+
default:
|
|
497
|
+
return (jsx(TextInput, __assign({ type: InputType.TEXT, required: required, disabled: disabled, icon: icon, className: className }, register(name))));
|
|
498
|
+
}
|
|
499
|
+
};
|
|
500
|
+
// TODO: HELPER CLASSES : data-[invalid=true]:bg-error data-[valid]:bg-success
|
|
501
|
+
var showLabel = label && type !== FieldTypes.CHECKBOX;
|
|
502
|
+
return (jsx("div", { className: "relative", children: jsxs("div", { "data-testid": "FormField", className: "mb-4", children: [showLabel && (jsx("div", { className: "flex items-baseline justify-between", children: jsx(Label, { label: label, id: name }) })), jsx(Controller, { name: name, control: control, rules: { required: required }, render: function () { return renderType(type); } }), description && jsx(Copy, { size: SIZE$1.SMALL, children: description })] }) }));
|
|
503
|
+
};
|
|
504
|
+
FormField.displayName = 'FormField';
|
|
505
|
+
|
|
506
|
+
export { Blockquote, Button, Container, ContentPageLayout, ContentRowsLayout, Copy, Form, FormField, Heading, Hr, Icon, Image, Link, List, ListItem, Loader, Notice };
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var cx = require('classnames');
|
|
5
5
|
var react = require('@iconify/react');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var reactHookForm = require('react-hook-form');
|
|
6
8
|
|
|
7
9
|
var Blockquote = function (_a) {
|
|
8
10
|
var text = _a.text, citation = _a.citation, className = _a.className, citationAttribute = _a.citationAttribute, _b = _a.showIcon, showIcon = _b === void 0 ? true : _b;
|
|
@@ -58,7 +60,7 @@ var Button = function (_a) {
|
|
|
58
60
|
icon: 'w-6 h-6',
|
|
59
61
|
},
|
|
60
62
|
};
|
|
61
|
-
var classes = cx('font-bold flex items-center transition-all duration-200 transform active:scale-95 justify-around border-solid border rounded', { 'text-white border-primary hover:bg-primary-darker hover:border-primary-darker': variant === 'primary' }, { 'text-white border-secondary hover:bg-secondary-darker hover:border-secondary-darker': variant === 'secondary' }, { 'text-black border-tertiary hover:bg-tertiary-darker hover:border-tertiary-darker': variant === 'tertiary' }, { 'bg-primary': variant === 'primary' && !outline }, { 'bg-secondary': variant === 'secondary' && !outline }, { 'bg-tertiary': variant === 'tertiary' && !outline }, { 'bg-transparent': outline }, { shadow: raised }, { uppercase: uppercase }, { 'auto-cols-auto grid-cols-2 gap-2': icon || external }, { 'rounded-full': rounded }, { 'flex-row-reverse': iconFirst }, "".concat(sizes[size].y, " ").concat(sizes[size].x, " ").concat(sizes[size].text), className);
|
|
63
|
+
var classes = cx('font-bold flex items-center transition-all duration-200 transform active:scale-95 justify-around border-solid border rounded cursor-pointer focus:outline-none', { 'text-white border-primary hover:bg-primary-darker hover:border-primary-darker': variant === 'primary' }, { 'text-white border-secondary hover:bg-secondary-darker hover:border-secondary-darker': variant === 'secondary' }, { 'text-black border-tertiary hover:bg-tertiary-darker hover:border-tertiary-darker': variant === 'tertiary' }, { 'bg-primary': variant === 'primary' && !outline }, { 'bg-secondary': variant === 'secondary' && !outline }, { 'bg-tertiary': variant === 'tertiary' && !outline }, { 'bg-transparent': outline }, { shadow: raised }, { uppercase: uppercase }, { 'auto-cols-auto grid-cols-2 gap-2': icon || external }, { 'rounded-full': rounded }, { 'flex-row-reverse': iconFirst }, "".concat(sizes[size].y, " ").concat(sizes[size].x, " ").concat(sizes[size].text), className);
|
|
62
64
|
var iconClasses = cx(sizes[size].icon);
|
|
63
65
|
return (jsxRuntime.jsx("button", { id: id, "data-testid": testID || id || 'Button', onClick: onClick, className: classes, type: type, disabled: disabled, "aria-label": ariaLabel, role: "button", children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [children, icon && !external && (jsxRuntime.jsx("span", { className: "flex items-center", children: jsxRuntime.jsx(react.Icon, { icon: icon, className: iconClasses }) })), external && (jsxRuntime.jsx("span", { className: "flex items-center", children: jsxRuntime.jsx(react.Icon, { icon: "carbon:launch", className: iconClasses }) }))] }) }));
|
|
64
66
|
};
|
|
@@ -164,11 +166,11 @@ Heading.displayName = 'Heading';
|
|
|
164
166
|
* List of supported icons can be found at https://icon-sets.iconify.design.
|
|
165
167
|
*/
|
|
166
168
|
var Icon = function (_a) {
|
|
167
|
-
var name = _a.name, _b = _a.size, size = _b === void 0 ? 24 : _b, color = _a.color, id = _a.id, testID = _a.testID;
|
|
169
|
+
var name = _a.name, _b = _a.size, size = _b === void 0 ? 24 : _b, color = _a.color, id = _a.id, className = _a.className, testID = _a.testID;
|
|
168
170
|
if (color) {
|
|
169
|
-
return jsxRuntime.jsx(react.Icon, { "data-testid": testID || id ||
|
|
171
|
+
return (jsxRuntime.jsx(react.Icon, { "data-testid": testID || id || 'Icon', icon: name, width: size, height: size, color: color, className: className, fill: color || 'currentColor' }));
|
|
170
172
|
}
|
|
171
|
-
return jsxRuntime.jsx(react.Icon, { "data-testid": testID || id ||
|
|
173
|
+
return (jsxRuntime.jsx(react.Icon, { "data-testid": testID || id || 'Icon', icon: name, width: size, height: size }));
|
|
172
174
|
};
|
|
173
175
|
Icon.displayName = 'Icon';
|
|
174
176
|
|
|
@@ -248,9 +250,9 @@ var Notice = function (_a) {
|
|
|
248
250
|
Notice.displayName = 'Notice';
|
|
249
251
|
|
|
250
252
|
var Loader = function (_a) {
|
|
251
|
-
var _b = _a.size, size = _b === void 0 ? 8 : _b;
|
|
253
|
+
var color = _a.color, _b = _a.size, size = _b === void 0 ? 8 : _b, _c = _a.thickness, thickness = _c === void 0 ? 4 : _c;
|
|
252
254
|
var sizeClass = size ? "w-".concat(size, " h-").concat(size) : 'w-8 h-8';
|
|
253
|
-
return (jsxRuntime.jsx("div", { "data-testid": "Loader", children: jsxRuntime.jsxs("div", { role: "status", children: [jsxRuntime.jsxs("svg", { className: "animate-spin -ml-1 mr-3 ".concat(sizeClass, " text-white"), xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [jsxRuntime.jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke:
|
|
255
|
+
return (jsxRuntime.jsx("div", { "data-testid": "Loader", children: jsxRuntime.jsxs("div", { role: "status", children: [jsxRuntime.jsxs("svg", { className: "animate-spin -ml-1 mr-3 ".concat(sizeClass, " text-white"), xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [jsxRuntime.jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: color || 'currentColor', strokeWidth: thickness }), jsxRuntime.jsx("path", { className: "opacity-75", fill: color || 'currentColor', d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })] }), jsxRuntime.jsx("span", { className: "sr-only", children: "Loading..." })] }) }));
|
|
254
256
|
};
|
|
255
257
|
Loader.displayName = 'Loader';
|
|
256
258
|
|
|
@@ -297,12 +299,220 @@ var ContentRowsLayout = function (_a) {
|
|
|
297
299
|
};
|
|
298
300
|
ContentRowsLayout.displayName = 'ContentRowsLayout';
|
|
299
301
|
|
|
302
|
+
/******************************************************************************
|
|
303
|
+
Copyright (c) Microsoft Corporation.
|
|
304
|
+
|
|
305
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
306
|
+
purpose with or without fee is hereby granted.
|
|
307
|
+
|
|
308
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
309
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
310
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
311
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
312
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
313
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
314
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
315
|
+
***************************************************************************** */
|
|
316
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
var __assign = function() {
|
|
320
|
+
__assign = Object.assign || function __assign(t) {
|
|
321
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
322
|
+
s = arguments[i];
|
|
323
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
324
|
+
}
|
|
325
|
+
return t;
|
|
326
|
+
};
|
|
327
|
+
return __assign.apply(this, arguments);
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
function __rest(s, e) {
|
|
331
|
+
var t = {};
|
|
332
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
333
|
+
t[p] = s[p];
|
|
334
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
335
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
336
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
337
|
+
t[p[i]] = s[p[i]];
|
|
338
|
+
}
|
|
339
|
+
return t;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
343
|
+
var e = new Error(message);
|
|
344
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
var Form = function (_a) {
|
|
348
|
+
var children = _a.children, className = _a.className, submit = _a.submit, _b = _a.onSubmit, onSubmit = _b === void 0 ? function () { } : _b, onChange = _a.onChange, hideSubmit = _a.hideSubmit, ariaSubmitLabel = _a.ariaSubmitLabel, submitID = _a.submitID, _c = _a.submitVariant, submitVariant = _c === void 0 ? BTN_VARIANTS.PRIMARY : _c, _d = _a.initialValues, initialValues = _d === void 0 ? {} : _d;
|
|
349
|
+
var methods = reactHookForm.useForm({
|
|
350
|
+
defaultValues: initialValues,
|
|
351
|
+
});
|
|
352
|
+
React.useEffect(function () {
|
|
353
|
+
if (onChange && typeof onChange === 'function') {
|
|
354
|
+
var subscription_1 = methods.watch(function (value) { return onChange(value); });
|
|
355
|
+
return function () { return subscription_1.unsubscribe(); };
|
|
356
|
+
}
|
|
357
|
+
}, []);
|
|
358
|
+
var submitClasses = cx({ 'sr-only': hideSubmit });
|
|
359
|
+
return (jsxRuntime.jsx(reactHookForm.FormProvider, __assign({}, methods, { children: jsxRuntime.jsx("div", { "data-testid": "Form", className: "w-full max-w-s @form @containers", children: jsxRuntime.jsxs("form", { onSubmit: methods.handleSubmit(onSubmit), className: cx('form px-8 pt-6 pb-8 mb-4 w-2xs', className), children: [children, submit && (jsxRuntime.jsx("div", { className: "flex items-center justify-end py-2", children: jsxRuntime.jsx(Button, { id: submitID || submit, className: submitClasses, ariaLabel: ariaSubmitLabel || submit || 'Submit', type: BTN_TYPES.SUBMIT, variant: submitVariant, children: submit }) }))] }) }) })));
|
|
360
|
+
};
|
|
361
|
+
Form.displayName = 'Form';
|
|
362
|
+
|
|
363
|
+
var FieldTypes;
|
|
364
|
+
(function (FieldTypes) {
|
|
365
|
+
FieldTypes["TEXT"] = "text";
|
|
366
|
+
FieldTypes["TEXTAREA"] = "textarea";
|
|
367
|
+
FieldTypes["SELECT"] = "select";
|
|
368
|
+
FieldTypes["CHECKBOX"] = "checkbox";
|
|
369
|
+
FieldTypes["RADIO"] = "radio";
|
|
370
|
+
FieldTypes["SWITCH"] = "switch";
|
|
371
|
+
FieldTypes["DATE"] = "date";
|
|
372
|
+
FieldTypes["TIME"] = "time";
|
|
373
|
+
FieldTypes["DATETIME"] = "datetime";
|
|
374
|
+
FieldTypes["FILE"] = "file";
|
|
375
|
+
FieldTypes["PASSWORD"] = "password";
|
|
376
|
+
FieldTypes["EMAIL"] = "email";
|
|
377
|
+
FieldTypes["NUMBER"] = "number";
|
|
378
|
+
FieldTypes["TEL"] = "tel";
|
|
379
|
+
FieldTypes["URL"] = "url";
|
|
380
|
+
FieldTypes["SEARCH"] = "search";
|
|
381
|
+
// MONTH = 'month',
|
|
382
|
+
// WEEK = 'week',
|
|
383
|
+
// HIDDEN = 'hidden',
|
|
384
|
+
// COLOR = 'color',
|
|
385
|
+
// RANGE = 'range',
|
|
386
|
+
// CURRENCY = 'currency',
|
|
387
|
+
// PERCENT = 'percent',
|
|
388
|
+
})(FieldTypes || (FieldTypes = {}));
|
|
389
|
+
|
|
390
|
+
var InputType;
|
|
391
|
+
(function (InputType) {
|
|
392
|
+
InputType["TEXT"] = "text";
|
|
393
|
+
InputType["PASSWORD"] = "password";
|
|
394
|
+
InputType["EMAIL"] = "email";
|
|
395
|
+
InputType["NUMBER"] = "number";
|
|
396
|
+
InputType["TEL"] = "tel";
|
|
397
|
+
InputType["URL"] = "url";
|
|
398
|
+
InputType["SEARCH"] = "search";
|
|
399
|
+
InputType["DATE"] = "date";
|
|
400
|
+
InputType["TIME"] = "time";
|
|
401
|
+
InputType["DATETIME"] = "datetime-local";
|
|
402
|
+
InputType["MONTH"] = "month";
|
|
403
|
+
InputType["WEEK"] = "week";
|
|
404
|
+
InputType["FILE"] = "file";
|
|
405
|
+
InputType["TEXTAREA"] = "textarea";
|
|
406
|
+
})(InputType || (InputType = {}));
|
|
407
|
+
|
|
408
|
+
var TextInput = React.forwardRef(function MyInput(_a, ref) {
|
|
409
|
+
var _b = _a.type, type = _b === void 0 ? InputType.TEXT : _b, _c = _a.required, required = _c === void 0 ? false : _c, className = _a.className, onChange = _a.onChange, placeholder = _a.placeholder, icon = _a.icon, _d = _a.disabled, disabled = _d === void 0 ? false : _d, rest = __rest(_a, ["type", "required", "className", "onChange", "placeholder", "icon", "disabled"]);
|
|
410
|
+
React.useEffect(function () {
|
|
411
|
+
if (typeof window !== 'undefined') {
|
|
412
|
+
// eslint-disable-next-line global-require
|
|
413
|
+
require('date-input-polyfill');
|
|
414
|
+
}
|
|
415
|
+
}, []);
|
|
416
|
+
var format = 'dd/mm/yyyy';
|
|
417
|
+
var placeholderSet = type === 'date' ? format.toUpperCase() : placeholder;
|
|
418
|
+
// console.log('TextInput', rest);
|
|
419
|
+
if (type === InputType.TEXTAREA) {
|
|
420
|
+
return (jsxRuntime.jsx("div", { "data-testid": "TextInput", className: "relative", children: jsxRuntime.jsx("textarea", __assign({ ref: ref, required: required, "aria-required": required, disabled: disabled, placeholder: placeholderSet, onChange: onChange, rows: 4, className: cx('form-item text-input resize-none', className) }, rest)) }));
|
|
421
|
+
}
|
|
422
|
+
return (jsxRuntime.jsxs("div", { "data-testid": "TextInput", className: "relative", children: [icon && (jsxRuntime.jsx("div", { className: "form-icon absolute inset-y-0 start-3 flex items-center ps-3.5 pointer-events-none", children: jsxRuntime.jsx(Icon, { name: icon }) })), jsxRuntime.jsx("input", __assign({ ref: ref, type: type, required: required, "aria-required": required, disabled: disabled, placeholder: placeholderSet, onChange: onChange, className: cx('form-item text-input', { 'pl-12': icon }, className) }, rest))] }));
|
|
423
|
+
});
|
|
424
|
+
TextInput.displayName = 'TextInput';
|
|
425
|
+
|
|
426
|
+
var Checkbox = React.forwardRef(function MyInput(_a, ref) {
|
|
427
|
+
var id = _a.id, label = _a.label, required = _a.required, className = _a.className, disabled = _a.disabled, rest = __rest(_a, ["id", "label", "required", "className", "disabled"]);
|
|
428
|
+
return (jsxRuntime.jsxs("div", { "data-testid": "Checkbox", className: cx('flex items-center', className), children: [jsxRuntime.jsxs("div", { className: "relative bg-none w-5 h-5 flex justify-center items-center", "aria-label": label, children: [jsxRuntime.jsx("input", __assign({ id: id, ref: ref, disabled: disabled, type: "checkbox", className: "form-item checkbox m-0 appearance-none peer h-full w-full shrink-0 focus:ring-2", required: required }, rest)), jsxRuntime.jsx("span", { className: "absolute transition-opacity opacity-0 pointer-events-none peer-checked:opacity-100 w-full h-full flex items-center justify-center top-0 left-0", children: jsxRuntime.jsx(Icon, { name: "mdi:check-bold", size: 12 }) })] }), label && (jsxRuntime.jsx("label", { className: "label pl-2 leading-none", htmlFor: id, children: label }))] }));
|
|
429
|
+
});
|
|
430
|
+
Checkbox.displayName = 'Checkbox';
|
|
431
|
+
|
|
432
|
+
var Label = function (_a) {
|
|
433
|
+
var label = _a.label, id = _a.id;
|
|
434
|
+
return (jsxRuntime.jsx("label", { "data-testid": "Label", className: "label mb-1", htmlFor: id, children: label }));
|
|
435
|
+
};
|
|
436
|
+
Label.displayName = 'Label';
|
|
437
|
+
|
|
438
|
+
var FormSelect = React.forwardRef(function MyInput(_a, ref) {
|
|
439
|
+
var id = _a.id, name = _a.name, options = _a.options, required = _a.required, className = _a.className, disabled = _a.disabled, rest = __rest(_a, ["id", "name", "options", "required", "className", "disabled"]);
|
|
440
|
+
if (!options) {
|
|
441
|
+
throw new Error('FormSelect requires options prop');
|
|
442
|
+
}
|
|
443
|
+
return (jsxRuntime.jsx("div", { id: id, className: cx('pb-2', className), children: jsxRuntime.jsxs("div", { className: "relative", children: [jsxRuntime.jsx("select", __assign({ ref: ref, id: id, name: name, disabled: disabled, required: required, className: "form-item text-input" }, rest, { children: options.map(function (option) { return (jsxRuntime.jsx("option", { value: option.value, disabled: option.disabled, children: option.label }, option.value)); }) })), jsxRuntime.jsx("div", { className: "form-icon absolute inset-0 z-10 pointer-events-none h-full w-12 items-center justify-center top-0 right-0 left-auto flex", children: jsxRuntime.jsx(Icon, { name: "mdi:chevron-down", size: 24, className: "pointer-events-none" }) })] }) }));
|
|
444
|
+
});
|
|
445
|
+
FormSelect.displayName = 'FormSelect';
|
|
446
|
+
|
|
447
|
+
var Radio = React.forwardRef(function MyInput(_a, ref) {
|
|
448
|
+
var id = _a.id, name = _a.name, label = _a.label, required = _a.required, className = _a.className, options = _a.options, rest = __rest(_a, ["id", "name", "label", "required", "className", "options"]);
|
|
449
|
+
return (jsxRuntime.jsx("div", { "data-testid": "Radio", className: cx('flex items-center', className), children: jsxRuntime.jsx("div", { className: cx('flex flex-col gap-2', className), "aria-label": label, id: id, children: options === null || options === void 0 ? void 0 : options.map(function (option) { return (jsxRuntime.jsxs("div", { className: "flex items-center relative", children: [jsxRuntime.jsxs("div", { className: "relative flex items-center", children: [jsxRuntime.jsx("input", __assign({ id: option.value, ref: ref, name: name, type: "radio", value: option.value, required: required, className: "form-item radio peer appearance-none m-0 p-0 w-4 h-4" }, rest)), jsxRuntime.jsx("div", { className: "form-icon opacity-0 peer-checked:opacity-100 absolute w-4 h-4 flex items-center justify-center top-0 left-0 pointer-events-none", children: jsxRuntime.jsx(Icon, { name: "mdi:circle", size: 12 }) })] }), jsxRuntime.jsx("label", { className: "label pl-2 leading-none", htmlFor: option.value, children: option.label })] }, option.value)); }) }) }));
|
|
450
|
+
});
|
|
451
|
+
Radio.displayName = 'Radio';
|
|
452
|
+
|
|
453
|
+
var Switch = React.forwardRef(function MyInput(_a, ref) {
|
|
454
|
+
var id = _a.id, name = _a.name, required = _a.required, disabled = _a.disabled, className = _a.className, rest = __rest(_a, ["id", "name", "required", "disabled", "className"]);
|
|
455
|
+
return (jsxRuntime.jsxs("label", { "data-testid": "Switch", className: cx('inline-flex items-center cursor-pointer', className), children: [jsxRuntime.jsx("input", __assign({ ref: ref, id: id, name: name, type: "checkbox", value: "", className: "sr-only peer", disabled: disabled, required: required }, rest)), jsxRuntime.jsx("div", { className: "form-item switch peer-focus:ring-info dark:peer-focus:ring-info relative w-11 h-6 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[1px] after:start-[1px] after:bg-white after:border after:rounded-full after:h-5 after:w-5 after:transition-all transition-all" })] }));
|
|
456
|
+
});
|
|
457
|
+
Switch.displayName = 'Switch';
|
|
458
|
+
|
|
459
|
+
var FileUpload = React.forwardRef(function MyInput(_a, ref) {
|
|
460
|
+
var id = _a.id, name = _a.name, required = _a.required, disabled = _a.disabled, className = _a.className, rest = __rest(_a, ["id", "name", "required", "disabled", "className"]);
|
|
461
|
+
return (jsxRuntime.jsx("div", { "data-testid": "FileUpload", className: className, children: jsxRuntime.jsx("input", __assign({ ref: ref, className: cx('form-item text-input file-upload p-0 relative m-0 min-w-0 flex-auto appearance-none block box-border bg-clip-padding file:p-3 file:cursor-pointer file:mr-3 file:overflow-hidden cursor-pointer file:border-0 file:rounded-none file:border-solid file:border-inherit file:transition file:duration-150 file:ease-in-out file:[border-inline-end-width:1px] file:[margin-inline-end:0.75rem] '), "aria-describedby": "file_input_help", type: "file", disabled: disabled, required: required, name: name, id: id }, rest)) }));
|
|
462
|
+
});
|
|
463
|
+
FileUpload.displayName = 'FileUpload';
|
|
464
|
+
|
|
465
|
+
var FormField = function (_a) {
|
|
466
|
+
var name = _a.name, type = _a.type, label = _a.label, required = _a.required, className = _a.className, icon = _a.icon, options = _a.options, disabled = _a.disabled, description = _a.description, showPasswordLabel = _a.showPasswordLabel, hidePasswordLabel = _a.hidePasswordLabel;
|
|
467
|
+
var _b = React.useState(false), passwordShowStatus = _b[0], setPasswordShow = _b[1];
|
|
468
|
+
var _c = reactHookForm.useFormContext(), control = _c.control, register = _c.register;
|
|
469
|
+
var renderType = function (type) {
|
|
470
|
+
switch (type) {
|
|
471
|
+
case FieldTypes.TEXT:
|
|
472
|
+
return (jsxRuntime.jsx(TextInput, __assign({ type: InputType.TEXT, required: required, icon: icon, className: className, disabled: disabled }, register(name))));
|
|
473
|
+
case FieldTypes.PASSWORD: {
|
|
474
|
+
var toggleType = passwordShowStatus ? InputType.TEXT : InputType.PASSWORD;
|
|
475
|
+
var btnClass = 'appearance-none border-none bg-transparent flex items-center';
|
|
476
|
+
return (jsxRuntime.jsxs("div", { className: "relative", children: [jsxRuntime.jsx("span", { className: "absolute right-0 top-0 flex items-center justify-center h-full z-10 pr-2", onClick: function () { return setPasswordShow(function (pS) { return !pS; }); }, role: "button", tabIndex: 0, children: passwordShowStatus ? (jsxRuntime.jsx("button", { type: "button", "aria-label": hidePasswordLabel, className: cx(btnClass, 'form-icon'), children: jsxRuntime.jsx(Icon, { name: "mdi:eye-off", size: 24 }) })) : (jsxRuntime.jsx("button", { type: "button", "aria-label": showPasswordLabel, className: cx(btnClass, 'form-icon'), children: jsxRuntime.jsx(Icon, { name: "mdi:eye", size: 24 }) })) }), jsxRuntime.jsx(TextInput, __assign({ type: toggleType, required: required, icon: icon, className: className, disabled: disabled }, register(name)))] }));
|
|
477
|
+
}
|
|
478
|
+
case FieldTypes.TEXTAREA:
|
|
479
|
+
return (jsxRuntime.jsx(TextInput, __assign({ type: InputType.TEXTAREA, required: required, icon: icon, className: className, disabled: disabled }, register(name))));
|
|
480
|
+
case FieldTypes.EMAIL:
|
|
481
|
+
return (jsxRuntime.jsx(TextInput, __assign({ type: InputType.EMAIL, required: required, icon: icon, className: className, disabled: disabled }, register(name))));
|
|
482
|
+
case FieldTypes.DATE:
|
|
483
|
+
return (jsxRuntime.jsx(TextInput, __assign({ type: InputType.DATE, required: required, icon: icon, className: className, disabled: disabled }, register(name))));
|
|
484
|
+
case FieldTypes.DATETIME:
|
|
485
|
+
return (jsxRuntime.jsx(TextInput, __assign({ type: InputType.DATETIME, required: required, icon: icon, className: className, disabled: disabled }, register(name))));
|
|
486
|
+
case FieldTypes.NUMBER:
|
|
487
|
+
return (jsxRuntime.jsx(TextInput, __assign({ type: InputType.NUMBER, required: required, icon: icon, className: className, disabled: disabled }, register(name))));
|
|
488
|
+
case FieldTypes.CHECKBOX:
|
|
489
|
+
return (jsxRuntime.jsx(Checkbox, __assign({ required: required, id: name, className: className, label: label, disabled: disabled }, register(name))));
|
|
490
|
+
case FieldTypes.RADIO:
|
|
491
|
+
return (jsxRuntime.jsx(Radio, __assign({ required: required, id: name, className: className, label: label, options: options, disabled: disabled }, register(name))));
|
|
492
|
+
case FieldTypes.SWITCH:
|
|
493
|
+
return jsxRuntime.jsx(Switch, __assign({ id: name, required: required, className: className, disabled: disabled }, register(name)));
|
|
494
|
+
case FieldTypes.SELECT:
|
|
495
|
+
return (jsxRuntime.jsx(FormSelect, __assign({ required: required, id: name, className: className, disabled: disabled, label: label, options: options }, register(name))));
|
|
496
|
+
case FieldTypes.FILE:
|
|
497
|
+
return (jsxRuntime.jsx(FileUpload, __assign({ required: required, id: name, className: className, disabled: disabled }, register(name))));
|
|
498
|
+
default:
|
|
499
|
+
return (jsxRuntime.jsx(TextInput, __assign({ type: InputType.TEXT, required: required, disabled: disabled, icon: icon, className: className }, register(name))));
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
// TODO: HELPER CLASSES : data-[invalid=true]:bg-error data-[valid]:bg-success
|
|
503
|
+
var showLabel = label && type !== FieldTypes.CHECKBOX;
|
|
504
|
+
return (jsxRuntime.jsx("div", { className: "relative", children: jsxRuntime.jsxs("div", { "data-testid": "FormField", className: "mb-4", children: [showLabel && (jsxRuntime.jsx("div", { className: "flex items-baseline justify-between", children: jsxRuntime.jsx(Label, { label: label, id: name }) })), jsxRuntime.jsx(reactHookForm.Controller, { name: name, control: control, rules: { required: required }, render: function () { return renderType(type); } }), description && jsxRuntime.jsx(Copy, { size: SIZE$1.SMALL, children: description })] }) }));
|
|
505
|
+
};
|
|
506
|
+
FormField.displayName = 'FormField';
|
|
507
|
+
|
|
300
508
|
exports.Blockquote = Blockquote;
|
|
301
509
|
exports.Button = Button;
|
|
302
510
|
exports.Container = Container;
|
|
303
511
|
exports.ContentPageLayout = ContentPageLayout;
|
|
304
512
|
exports.ContentRowsLayout = ContentRowsLayout;
|
|
305
513
|
exports.Copy = Copy;
|
|
514
|
+
exports.Form = Form;
|
|
515
|
+
exports.FormField = FormField;
|
|
306
516
|
exports.Heading = Heading;
|
|
307
517
|
exports.Hr = Hr;
|
|
308
518
|
exports.Icon = Icon;
|
|
@@ -16,12 +16,12 @@ export declare enum BTN_SIZES {
|
|
|
16
16
|
}
|
|
17
17
|
export interface Props {
|
|
18
18
|
variant?: BTN_VARIANTS;
|
|
19
|
-
size
|
|
19
|
+
size?: BTN_SIZES;
|
|
20
20
|
uppercase?: boolean;
|
|
21
21
|
children: React.ReactNode;
|
|
22
22
|
type?: BTN_TYPES;
|
|
23
23
|
disabled?: boolean;
|
|
24
|
-
ariaLabel
|
|
24
|
+
ariaLabel?: string;
|
|
25
25
|
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
26
26
|
icon?: string;
|
|
27
27
|
external?: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Checkbox';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './FileUpload';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Props } from './Form.types';
|
|
3
3
|
declare const Form: {
|
|
4
|
-
({ children, className,
|
|
4
|
+
({ children, className, submit, onSubmit, onChange, hideSubmit, ariaSubmitLabel, submitID, submitVariant, initialValues, }: Props): React.ReactElement;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
7
7
|
export default Form;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { BTN_VARIANTS } from '../Button/Button.types';
|
|
2
3
|
export interface Props {
|
|
3
4
|
/** The form inputs and content. */
|
|
4
5
|
children: React.ReactNode;
|
|
@@ -7,15 +8,20 @@ export interface Props {
|
|
|
7
8
|
/** Disable form inputs validation. */
|
|
8
9
|
noValidate?: boolean;
|
|
9
10
|
/** The submit handler that will fire once the form is submitted. */
|
|
10
|
-
onSubmit
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
onSubmit?: (values: any) => void;
|
|
12
|
+
/** The on change handler that will fire once the form is updated. */
|
|
13
|
+
onChange?: (values: any) => void;
|
|
13
14
|
/** The label for the submit button. */
|
|
14
|
-
submit
|
|
15
|
+
submit?: string;
|
|
15
16
|
/** Hide submit button. */
|
|
16
17
|
hideSubmit?: boolean;
|
|
17
18
|
/** The aria-label attribute value for the submit button. */
|
|
18
19
|
ariaSubmitLabel?: string;
|
|
19
20
|
/** Unique form submit button id. */
|
|
20
21
|
submitID?: string;
|
|
22
|
+
/** Initial form values. */
|
|
23
|
+
initialValues?: {
|
|
24
|
+
[k: string]: any;
|
|
25
|
+
};
|
|
26
|
+
submitVariant?: BTN_VARIANTS;
|
|
21
27
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Props } from './FormField.types';
|
|
3
3
|
declare const FormField: {
|
|
4
|
-
({ name, type, className,
|
|
4
|
+
({ name, type, label, required, className, icon, options, disabled, description, showPasswordLabel, hidePasswordLabel, }: Props): React.ReactElement;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
7
7
|
export default FormField;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { OptionsType } from "../FormSelect/FormSelect.types";
|
|
1
2
|
export declare enum FieldTypes {
|
|
2
3
|
TEXT = "text",
|
|
3
4
|
TEXTAREA = "textarea",
|
|
@@ -22,4 +23,11 @@ export interface Props {
|
|
|
22
23
|
className?: string;
|
|
23
24
|
label?: string;
|
|
24
25
|
required?: boolean;
|
|
26
|
+
icon?: string;
|
|
27
|
+
options?: Array<OptionsType>;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
description?: string;
|
|
30
|
+
showPasswordLabel?: string;
|
|
31
|
+
hidePasswordLabel?: string;
|
|
32
|
+
onChange?: (e: any) => void;
|
|
25
33
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Props } from './FormSelect.types';
|
|
3
|
-
declare const FormSelect:
|
|
3
|
+
declare const FormSelect: React.ForwardRefExoticComponent<Props & React.RefAttributes<unknown>>;
|
|
4
4
|
export default FormSelect;
|
|
5
|
+
export type { Props };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
type OptionsType = {
|
|
2
|
+
export type OptionsType = {
|
|
3
3
|
value: string;
|
|
4
4
|
label: string;
|
|
5
5
|
/** The selected option's value. */
|
|
@@ -7,12 +7,12 @@ type OptionsType = {
|
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
};
|
|
9
9
|
export interface Props {
|
|
10
|
-
/** The select visible default label value. */
|
|
11
|
-
label?: string;
|
|
12
10
|
/** The selected option's value. */
|
|
13
|
-
options
|
|
11
|
+
options?: Array<OptionsType>;
|
|
14
12
|
/** Unique id for the field, required for a11y. */
|
|
15
13
|
id: string;
|
|
14
|
+
/** The select visible default label value. */
|
|
15
|
+
label?: string;
|
|
16
16
|
/** Is field required. */
|
|
17
17
|
required?: boolean;
|
|
18
18
|
/** Additional classes. */
|
|
@@ -24,11 +24,13 @@ export interface Props {
|
|
|
24
24
|
/** Additional wrapper CSS classes. */
|
|
25
25
|
wrapperStyles?: string;
|
|
26
26
|
/** Select Up Icon. */
|
|
27
|
-
selectIconUp
|
|
27
|
+
selectIconUp?: string;
|
|
28
28
|
/** Select Down Icon. */
|
|
29
|
-
selectIconDown
|
|
29
|
+
selectIconDown?: string;
|
|
30
30
|
/** Select Form Item Name. */
|
|
31
31
|
name?: string;
|
|
32
|
+
/** Is field disabled. */
|
|
33
|
+
disabled?: boolean;
|
|
32
34
|
}
|
|
33
35
|
export interface ItemProps {
|
|
34
36
|
children: React.ReactNode;
|
|
@@ -36,4 +38,3 @@ export interface ItemProps {
|
|
|
36
38
|
itemIcon: string;
|
|
37
39
|
iconColor?: string;
|
|
38
40
|
}
|
|
39
|
-
export {};
|
|
@@ -4,7 +4,7 @@ import { Props } from './Icon.types';
|
|
|
4
4
|
* List of supported icons can be found at https://icon-sets.iconify.design.
|
|
5
5
|
*/
|
|
6
6
|
declare const Icon: {
|
|
7
|
-
({ name, size, color, id, testID }: Props): React.ReactElement;
|
|
7
|
+
({ name, size, color, id, className, testID }: Props): React.ReactElement;
|
|
8
8
|
displayName: string;
|
|
9
9
|
};
|
|
10
10
|
export default Icon;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Label';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Radio';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Switch';
|
|
@@ -9,7 +9,7 @@ export declare enum InputType {
|
|
|
9
9
|
SEARCH = "search",
|
|
10
10
|
DATE = "date",
|
|
11
11
|
TIME = "time",
|
|
12
|
-
|
|
12
|
+
DATETIME = "datetime-local",
|
|
13
13
|
MONTH = "month",
|
|
14
14
|
WEEK = "week",
|
|
15
15
|
FILE = "file",
|
|
@@ -17,7 +17,7 @@ export declare enum InputType {
|
|
|
17
17
|
}
|
|
18
18
|
export interface Props {
|
|
19
19
|
/** Input type. */
|
|
20
|
-
type
|
|
20
|
+
type?: InputType;
|
|
21
21
|
/** Specify if input is required. */
|
|
22
22
|
required?: boolean;
|
|
23
23
|
/** Custom style attributes. */
|
|
@@ -28,4 +28,8 @@ export interface Props {
|
|
|
28
28
|
placeholder?: string;
|
|
29
29
|
/** Input name attribute. */
|
|
30
30
|
name?: string;
|
|
31
|
+
/** Input icon value. */
|
|
32
|
+
icon?: string;
|
|
33
|
+
/** Input status. */
|
|
34
|
+
disabled?: boolean;
|
|
31
35
|
}
|
|
@@ -13,3 +13,5 @@ export { default as Loader } from './Loader';
|
|
|
13
13
|
export { default as Container } from './Container';
|
|
14
14
|
export { default as ContentPageLayout } from './ContentPageLayout';
|
|
15
15
|
export { default as ContentRowsLayout } from './ContentRowsLayout';
|
|
16
|
+
export { default as Form } from './Form';
|
|
17
|
+
export { default as FormField } from './FormField';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function useTheme(): any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@4alldigital/foundation-ui--gamma",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.26.0",
|
|
4
4
|
"description": "Foundation UI Component library with GAMMA theme. ",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"publishConfig": {
|
|
25
25
|
"access": "public"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "4af02638666f2cbee201e3f1b2c4cf412fd84e86",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@headlessui/react": "^1.7.8",
|
|
30
30
|
"@heroicons/react": "^2.0.14",
|