@sharedex/ui 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -2
- package/dist/backgrounds/hosts/CssHost.d.ts +2 -6
- package/dist/backgrounds/hosts/CssHost.js +3 -17
- package/dist/backgrounds/hosts/styleHref.d.ts +6 -0
- package/dist/backgrounds/hosts/styleHref.js +20 -0
- package/dist/buttons/pick.d.ts +9 -3
- package/dist/buttons/pick.js +4 -1
- package/dist/forms/base.d.ts +1 -0
- package/dist/forms/base.js +224 -0
- package/dist/forms/buddy.d.ts +6 -0
- package/dist/forms/buddy.js +150 -0
- package/dist/forms/chips.d.ts +1 -0
- package/dist/forms/chips.js +140 -0
- package/dist/forms/choice.d.ts +1 -0
- package/dist/forms/choice.js +208 -0
- package/dist/forms/controls/CheckGroup.d.ts +65 -0
- package/dist/forms/controls/CheckGroup.js +99 -0
- package/dist/forms/controls/Checkbox.d.ts +43 -0
- package/dist/forms/controls/Checkbox.js +67 -0
- package/dist/forms/controls/ChipGroup.d.ts +50 -0
- package/dist/forms/controls/ChipGroup.js +56 -0
- package/dist/forms/controls/Combobox.d.ts +75 -0
- package/dist/forms/controls/Combobox.js +249 -0
- package/dist/forms/controls/ErrorSummary.d.ts +29 -0
- package/dist/forms/controls/ErrorSummary.js +79 -0
- package/dist/forms/controls/Field.d.ts +92 -0
- package/dist/forms/controls/Field.js +219 -0
- package/dist/forms/controls/FileDrop.d.ts +81 -0
- package/dist/forms/controls/FileDrop.js +328 -0
- package/dist/forms/controls/FormBuddy.d.ts +22 -0
- package/dist/forms/controls/FormBuddy.js +143 -0
- package/dist/forms/controls/FormReveal.d.ts +21 -0
- package/dist/forms/controls/FormReveal.js +19 -0
- package/dist/forms/controls/FormSteps.d.ts +75 -0
- package/dist/forms/controls/FormSteps.js +205 -0
- package/dist/forms/controls/FormSwap.d.ts +27 -0
- package/dist/forms/controls/FormSwap.js +38 -0
- package/dist/forms/controls/InlineEdit.d.ts +50 -0
- package/dist/forms/controls/InlineEdit.js +136 -0
- package/dist/forms/controls/NumberField.d.ts +43 -0
- package/dist/forms/controls/NumberField.js +205 -0
- package/dist/forms/controls/OtpField.d.ts +46 -0
- package/dist/forms/controls/OtpField.js +195 -0
- package/dist/forms/controls/PasswordRules.d.ts +31 -0
- package/dist/forms/controls/PasswordRules.js +85 -0
- package/dist/forms/controls/RadioGroup.d.ts +69 -0
- package/dist/forms/controls/RadioGroup.js +95 -0
- package/dist/forms/controls/Range.d.ts +60 -0
- package/dist/forms/controls/Range.js +169 -0
- package/dist/forms/controls/SaveStatus.d.ts +25 -0
- package/dist/forms/controls/SaveStatus.js +88 -0
- package/dist/forms/controls/Select.d.ts +46 -0
- package/dist/forms/controls/Select.js +35 -0
- package/dist/forms/controls/Switch.d.ts +54 -0
- package/dist/forms/controls/Switch.js +91 -0
- package/dist/forms/controls/TagsField.d.ts +68 -0
- package/dist/forms/controls/TagsField.js +0 -0
- package/dist/forms/controls/choiceChecks.d.ts +11 -0
- package/dist/forms/controls/choiceChecks.js +19 -0
- package/dist/forms/controls/choiceParts.d.ts +40 -0
- package/dist/forms/controls/choiceParts.js +49 -0
- package/dist/forms/controls/fieldChecks.d.ts +17 -0
- package/dist/forms/controls/fieldChecks.js +34 -0
- package/dist/forms/controls/fieldTools.d.ts +62 -0
- package/dist/forms/controls/fieldTools.js +54 -0
- package/dist/forms/controls/pickerChecks.d.ts +10 -0
- package/dist/forms/controls/pickerChecks.js +27 -0
- package/dist/forms/controls/rangeChecks.d.ts +11 -0
- package/dist/forms/controls/rangeChecks.js +23 -0
- package/dist/forms/controls/shared.d.ts +8 -0
- package/dist/forms/controls/shared.js +18 -0
- package/dist/forms/effects/cards.d.ts +11 -0
- package/dist/forms/effects/cards.js +52 -0
- package/dist/forms/effects/check/checkCard.d.ts +10 -0
- package/dist/forms/effects/check/checkCard.js +15 -0
- package/dist/forms/effects/check/checkCard.schema.d.ts +1 -0
- package/dist/forms/effects/check/checkCard.schema.js +9 -0
- package/dist/forms/effects/check/checkConfetti.d.ts +18 -0
- package/dist/forms/effects/check/checkConfetti.js +38 -0
- package/dist/forms/effects/check/checkConfetti.schema.d.ts +1 -0
- package/dist/forms/effects/check/checkConfetti.schema.js +13 -0
- package/dist/forms/effects/check/checkDraw.d.ts +7 -0
- package/dist/forms/effects/check/checkDraw.js +12 -0
- package/dist/forms/effects/check/checkDraw.schema.d.ts +1 -0
- package/dist/forms/effects/check/checkDraw.schema.js +9 -0
- package/dist/forms/effects/check/checkHeart.d.ts +9 -0
- package/dist/forms/effects/check/checkHeart.js +84 -0
- package/dist/forms/effects/check/checkHeart.schema.d.ts +1 -0
- package/dist/forms/effects/check/checkHeart.schema.js +10 -0
- package/dist/forms/effects/check/checkJelly.d.ts +9 -0
- package/dist/forms/effects/check/checkJelly.js +23 -0
- package/dist/forms/effects/check/checkJelly.schema.d.ts +1 -0
- package/dist/forms/effects/check/checkJelly.schema.js +10 -0
- package/dist/forms/effects/check/checkMerge.d.ts +9 -0
- package/dist/forms/effects/check/checkMerge.js +37 -0
- package/dist/forms/effects/check/checkMerge.schema.d.ts +1 -0
- package/dist/forms/effects/check/checkMerge.schema.js +10 -0
- package/dist/forms/effects/check/checkMixed.d.ts +7 -0
- package/dist/forms/effects/check/checkMixed.js +25 -0
- package/dist/forms/effects/check/checkMixed.schema.d.ts +1 -0
- package/dist/forms/effects/check/checkMixed.schema.js +9 -0
- package/dist/forms/effects/check/checkMorph.d.ts +9 -0
- package/dist/forms/effects/check/checkMorph.js +53 -0
- package/dist/forms/effects/check/checkMorph.schema.d.ts +1 -0
- package/dist/forms/effects/check/checkMorph.schema.js +10 -0
- package/dist/forms/effects/check/checkPop.d.ts +9 -0
- package/dist/forms/effects/check/checkPop.js +27 -0
- package/dist/forms/effects/check/checkPop.schema.d.ts +1 -0
- package/dist/forms/effects/check/checkPop.schema.js +10 -0
- package/dist/forms/effects/check/checkRipple.d.ts +7 -0
- package/dist/forms/effects/check/checkRipple.js +33 -0
- package/dist/forms/effects/check/checkRipple.schema.d.ts +1 -0
- package/dist/forms/effects/check/checkRipple.schema.js +9 -0
- package/dist/forms/effects/check/checkScribble.d.ts +11 -0
- package/dist/forms/effects/check/checkScribble.js +42 -0
- package/dist/forms/effects/check/checkScribble.schema.d.ts +1 -0
- package/dist/forms/effects/check/checkScribble.schema.js +11 -0
- package/dist/forms/effects/check/checkStrike.d.ts +9 -0
- package/dist/forms/effects/check/checkStrike.js +54 -0
- package/dist/forms/effects/check/checkStrike.schema.d.ts +1 -0
- package/dist/forms/effects/check/checkStrike.schema.js +10 -0
- package/dist/forms/effects/chip/chipCheck.d.ts +7 -0
- package/dist/forms/effects/chip/chipCheck.js +26 -0
- package/dist/forms/effects/chip/chipCheck.schema.d.ts +1 -0
- package/dist/forms/effects/chip/chipCheck.schema.js +9 -0
- package/dist/forms/effects/chip/chipMerge.d.ts +9 -0
- package/dist/forms/effects/chip/chipMerge.js +63 -0
- package/dist/forms/effects/chip/chipMerge.schema.d.ts +1 -0
- package/dist/forms/effects/chip/chipMerge.schema.js +10 -0
- package/dist/forms/effects/file/fileButton.d.ts +7 -0
- package/dist/forms/effects/file/fileButton.js +28 -0
- package/dist/forms/effects/file/fileButton.schema.d.ts +1 -0
- package/dist/forms/effects/file/fileButton.schema.js +9 -0
- package/dist/forms/effects/file/fileCards.d.ts +7 -0
- package/dist/forms/effects/file/fileCards.js +38 -0
- package/dist/forms/effects/file/fileCards.schema.d.ts +1 -0
- package/dist/forms/effects/file/fileCards.schema.js +9 -0
- package/dist/forms/effects/file/fileDrag.d.ts +9 -0
- package/dist/forms/effects/file/fileDrag.js +45 -0
- package/dist/forms/effects/file/fileDrag.schema.d.ts +1 -0
- package/dist/forms/effects/file/fileDrag.schema.js +10 -0
- package/dist/forms/effects/file/filePage.d.ts +7 -0
- package/dist/forms/effects/file/filePage.js +46 -0
- package/dist/forms/effects/file/filePage.schema.d.ts +1 -0
- package/dist/forms/effects/file/filePage.schema.js +9 -0
- package/dist/forms/effects/file/filePreview.d.ts +7 -0
- package/dist/forms/effects/file/filePreview.js +17 -0
- package/dist/forms/effects/file/filePreview.schema.d.ts +1 -0
- package/dist/forms/effects/file/filePreview.schema.js +9 -0
- package/dist/forms/effects/file/fileProgress.d.ts +9 -0
- package/dist/forms/effects/file/fileProgress.js +92 -0
- package/dist/forms/effects/file/fileProgress.schema.d.ts +1 -0
- package/dist/forms/effects/file/fileProgress.schema.js +10 -0
- package/dist/forms/effects/file/fileReject.d.ts +7 -0
- package/dist/forms/effects/file/fileReject.js +24 -0
- package/dist/forms/effects/file/fileReject.schema.d.ts +1 -0
- package/dist/forms/effects/file/fileReject.schema.js +9 -0
- package/dist/forms/effects/input/inputAside.d.ts +11 -0
- package/dist/forms/effects/input/inputAside.js +42 -0
- package/dist/forms/effects/input/inputAside.schema.d.ts +1 -0
- package/dist/forms/effects/input/inputAside.schema.js +11 -0
- package/dist/forms/effects/input/inputBeam.d.ts +14 -0
- package/dist/forms/effects/input/inputBeam.js +51 -0
- package/dist/forms/effects/input/inputBeam.schema.d.ts +1 -0
- package/dist/forms/effects/input/inputBeam.schema.js +18 -0
- package/dist/forms/effects/input/inputCaret.d.ts +13 -0
- package/dist/forms/effects/input/inputCaret.js +33 -0
- package/dist/forms/effects/input/inputCaret.schema.d.ts +1 -0
- package/dist/forms/effects/input/inputCaret.schema.js +26 -0
- package/dist/forms/effects/input/inputCounter.d.ts +16 -0
- package/dist/forms/effects/input/inputCounter.js +84 -0
- package/dist/forms/effects/input/inputCounter.schema.d.ts +1 -0
- package/dist/forms/effects/input/inputCounter.schema.js +12 -0
- package/dist/forms/effects/input/inputCycle.d.ts +19 -0
- package/dist/forms/effects/input/inputCycle.js +93 -0
- package/dist/forms/effects/input/inputCycle.schema.d.ts +1 -0
- package/dist/forms/effects/input/inputCycle.schema.js +11 -0
- package/dist/forms/effects/input/inputDepth.d.ts +11 -0
- package/dist/forms/effects/input/inputDepth.js +31 -0
- package/dist/forms/effects/input/inputDepth.schema.d.ts +1 -0
- package/dist/forms/effects/input/inputDepth.schema.js +11 -0
- package/dist/forms/effects/input/inputDraw.d.ts +13 -0
- package/dist/forms/effects/input/inputDraw.js +27 -0
- package/dist/forms/effects/input/inputDraw.schema.d.ts +1 -0
- package/dist/forms/effects/input/inputDraw.schema.js +12 -0
- package/dist/forms/effects/input/inputFlap.d.ts +9 -0
- package/dist/forms/effects/input/inputFlap.js +24 -0
- package/dist/forms/effects/input/inputFlap.schema.d.ts +1 -0
- package/dist/forms/effects/input/inputFlap.schema.js +10 -0
- package/dist/forms/effects/input/inputFloat.d.ts +12 -0
- package/dist/forms/effects/input/inputFloat.js +46 -0
- package/dist/forms/effects/input/inputFloat.schema.d.ts +1 -0
- package/dist/forms/effects/input/inputFloat.schema.js +10 -0
- package/dist/forms/effects/input/inputFlood.d.ts +11 -0
- package/dist/forms/effects/input/inputFlood.js +30 -0
- package/dist/forms/effects/input/inputFlood.schema.d.ts +1 -0
- package/dist/forms/effects/input/inputFlood.schema.js +11 -0
- package/dist/forms/effects/input/inputFrame.d.ts +18 -0
- package/dist/forms/effects/input/inputFrame.js +77 -0
- package/dist/forms/effects/input/inputFrame.schema.d.ts +1 -0
- package/dist/forms/effects/input/inputFrame.schema.js +13 -0
- package/dist/forms/effects/input/inputIcon.d.ts +11 -0
- package/dist/forms/effects/input/inputIcon.js +18 -0
- package/dist/forms/effects/input/inputIcon.schema.d.ts +1 -0
- package/dist/forms/effects/input/inputIcon.schema.js +11 -0
- package/dist/forms/effects/input/inputNotch.d.ts +9 -0
- package/dist/forms/effects/input/inputNotch.js +70 -0
- package/dist/forms/effects/input/inputNotch.schema.d.ts +1 -0
- package/dist/forms/effects/input/inputNotch.schema.js +10 -0
- package/dist/forms/effects/input/inputReveal.d.ts +15 -0
- package/dist/forms/effects/input/inputReveal.js +56 -0
- package/dist/forms/effects/input/inputReveal.schema.d.ts +1 -0
- package/dist/forms/effects/input/inputReveal.schema.js +16 -0
- package/dist/forms/effects/input/inputRing.d.ts +13 -0
- package/dist/forms/effects/input/inputRing.js +27 -0
- package/dist/forms/effects/input/inputRing.schema.d.ts +1 -0
- package/dist/forms/effects/input/inputRing.schema.js +12 -0
- package/dist/forms/effects/input/inputRise.d.ts +9 -0
- package/dist/forms/effects/input/inputRise.js +22 -0
- package/dist/forms/effects/input/inputRise.schema.d.ts +1 -0
- package/dist/forms/effects/input/inputRise.schema.js +10 -0
- package/dist/forms/effects/input/inputSearch.d.ts +9 -0
- package/dist/forms/effects/input/inputSearch.js +37 -0
- package/dist/forms/effects/input/inputSearch.schema.d.ts +1 -0
- package/dist/forms/effects/input/inputSearch.schema.js +10 -0
- package/dist/forms/effects/input/inputSkeleton.d.ts +7 -0
- package/dist/forms/effects/input/inputSkeleton.js +41 -0
- package/dist/forms/effects/input/inputSkeleton.schema.d.ts +1 -0
- package/dist/forms/effects/input/inputSkeleton.schema.js +9 -0
- package/dist/forms/effects/input/inputSpotlight.d.ts +9 -0
- package/dist/forms/effects/input/inputSpotlight.js +20 -0
- package/dist/forms/effects/input/inputSpotlight.schema.d.ts +1 -0
- package/dist/forms/effects/input/inputSpotlight.schema.js +10 -0
- package/dist/forms/effects/input/inputStrength.d.ts +9 -0
- package/dist/forms/effects/input/inputStrength.js +29 -0
- package/dist/forms/effects/input/inputStrength.schema.d.ts +1 -0
- package/dist/forms/effects/input/inputStrength.schema.js +10 -0
- package/dist/forms/effects/input/inputSwap.d.ts +11 -0
- package/dist/forms/effects/input/inputSwap.js +39 -0
- package/dist/forms/effects/input/inputSwap.schema.d.ts +1 -0
- package/dist/forms/effects/input/inputSwap.schema.js +11 -0
- package/dist/forms/effects/input/inputUnderline.d.ts +13 -0
- package/dist/forms/effects/input/inputUnderline.js +36 -0
- package/dist/forms/effects/input/inputUnderline.schema.d.ts +1 -0
- package/dist/forms/effects/input/inputUnderline.schema.js +18 -0
- package/dist/forms/effects/input/inputWave.d.ts +11 -0
- package/dist/forms/effects/input/inputWave.js +23 -0
- package/dist/forms/effects/input/inputWave.schema.d.ts +1 -0
- package/dist/forms/effects/input/inputWave.schema.js +11 -0
- package/dist/forms/effects/input/inputWavy.d.ts +11 -0
- package/dist/forms/effects/input/inputWavy.js +53 -0
- package/dist/forms/effects/input/inputWavy.schema.d.ts +1 -0
- package/dist/forms/effects/input/inputWavy.schema.js +11 -0
- package/dist/forms/effects/kit.d.ts +213 -0
- package/dist/forms/effects/kit.js +226 -0
- package/dist/forms/effects/picker/chipPop.d.ts +7 -0
- package/dist/forms/effects/picker/chipPop.js +28 -0
- package/dist/forms/effects/picker/chipPop.schema.d.ts +1 -0
- package/dist/forms/effects/picker/chipPop.schema.js +9 -0
- package/dist/forms/effects/picker/listHighlight.d.ts +9 -0
- package/dist/forms/effects/picker/listHighlight.js +42 -0
- package/dist/forms/effects/picker/listHighlight.schema.d.ts +1 -0
- package/dist/forms/effects/picker/listHighlight.schema.js +10 -0
- package/dist/forms/effects/picker/listMatch.d.ts +7 -0
- package/dist/forms/effects/picker/listMatch.js +21 -0
- package/dist/forms/effects/picker/listMatch.schema.d.ts +1 -0
- package/dist/forms/effects/picker/listMatch.schema.js +9 -0
- package/dist/forms/effects/picker/pickerArrow.d.ts +9 -0
- package/dist/forms/effects/picker/pickerArrow.js +17 -0
- package/dist/forms/effects/picker/pickerArrow.schema.d.ts +1 -0
- package/dist/forms/effects/picker/pickerArrow.schema.js +10 -0
- package/dist/forms/effects/picker/pickerCheck.d.ts +7 -0
- package/dist/forms/effects/picker/pickerCheck.js +31 -0
- package/dist/forms/effects/picker/pickerCheck.schema.d.ts +1 -0
- package/dist/forms/effects/picker/pickerCheck.schema.js +9 -0
- package/dist/forms/effects/picker/pickerOpen.d.ts +12 -0
- package/dist/forms/effects/picker/pickerOpen.js +34 -0
- package/dist/forms/effects/picker/pickerOpen.schema.d.ts +1 -0
- package/dist/forms/effects/picker/pickerOpen.schema.js +16 -0
- package/dist/forms/effects/picker/pickerSheet.d.ts +9 -0
- package/dist/forms/effects/picker/pickerSheet.js +47 -0
- package/dist/forms/effects/picker/pickerSheet.schema.d.ts +1 -0
- package/dist/forms/effects/picker/pickerSheet.schema.js +10 -0
- package/dist/forms/effects/picker/pickerStagger.d.ts +9 -0
- package/dist/forms/effects/picker/pickerStagger.js +31 -0
- package/dist/forms/effects/picker/pickerStagger.schema.d.ts +1 -0
- package/dist/forms/effects/picker/pickerStagger.schema.js +10 -0
- package/dist/forms/effects/radio/radioCard.d.ts +10 -0
- package/dist/forms/effects/radio/radioCard.js +15 -0
- package/dist/forms/effects/radio/radioCard.schema.d.ts +1 -0
- package/dist/forms/effects/radio/radioCard.schema.js +9 -0
- package/dist/forms/effects/radio/radioCircle.d.ts +9 -0
- package/dist/forms/effects/radio/radioCircle.js +49 -0
- package/dist/forms/effects/radio/radioCircle.schema.d.ts +1 -0
- package/dist/forms/effects/radio/radioCircle.schema.js +10 -0
- package/dist/forms/effects/radio/radioDot.d.ts +7 -0
- package/dist/forms/effects/radio/radioDot.js +10 -0
- package/dist/forms/effects/radio/radioDot.schema.d.ts +1 -0
- package/dist/forms/effects/radio/radioDot.schema.js +9 -0
- package/dist/forms/effects/radio/radioEmoji.d.ts +9 -0
- package/dist/forms/effects/radio/radioEmoji.js +94 -0
- package/dist/forms/effects/radio/radioEmoji.schema.d.ts +1 -0
- package/dist/forms/effects/radio/radioEmoji.schema.js +10 -0
- package/dist/forms/effects/radio/radioPulse.d.ts +9 -0
- package/dist/forms/effects/radio/radioPulse.js +24 -0
- package/dist/forms/effects/radio/radioPulse.schema.d.ts +1 -0
- package/dist/forms/effects/radio/radioPulse.schema.js +10 -0
- package/dist/forms/effects/radio/radioScale.d.ts +9 -0
- package/dist/forms/effects/radio/radioScale.js +73 -0
- package/dist/forms/effects/radio/radioScale.schema.d.ts +1 -0
- package/dist/forms/effects/radio/radioScale.schema.js +10 -0
- package/dist/forms/effects/radio/radioSegment.d.ts +7 -0
- package/dist/forms/effects/radio/radioSegment.js +52 -0
- package/dist/forms/effects/radio/radioSegment.schema.d.ts +1 -0
- package/dist/forms/effects/radio/radioSegment.schema.js +9 -0
- package/dist/forms/effects/radio/radioStars.d.ts +15 -0
- package/dist/forms/effects/radio/radioStars.js +125 -0
- package/dist/forms/effects/radio/radioStars.schema.d.ts +1 -0
- package/dist/forms/effects/radio/radioStars.schema.js +13 -0
- package/dist/forms/effects/radio/radioTravel.d.ts +9 -0
- package/dist/forms/effects/radio/radioTravel.js +49 -0
- package/dist/forms/effects/radio/radioTravel.schema.d.ts +1 -0
- package/dist/forms/effects/radio/radioTravel.schema.js +10 -0
- package/dist/forms/effects/radio/radioUnderline.d.ts +9 -0
- package/dist/forms/effects/radio/radioUnderline.js +61 -0
- package/dist/forms/effects/radio/radioUnderline.schema.d.ts +1 -0
- package/dist/forms/effects/radio/radioUnderline.schema.js +10 -0
- package/dist/forms/effects/radio/shape.d.ts +13 -0
- package/dist/forms/effects/radio/shape.js +61 -0
- package/dist/forms/effects/range/rangeBubble.d.ts +9 -0
- package/dist/forms/effects/range/rangeBubble.js +54 -0
- package/dist/forms/effects/range/rangeBubble.schema.d.ts +1 -0
- package/dist/forms/effects/range/rangeBubble.schema.js +10 -0
- package/dist/forms/effects/range/rangeElastic.d.ts +9 -0
- package/dist/forms/effects/range/rangeElastic.js +101 -0
- package/dist/forms/effects/range/rangeElastic.schema.d.ts +1 -0
- package/dist/forms/effects/range/rangeElastic.schema.js +10 -0
- package/dist/forms/effects/range/rangeFace.d.ts +11 -0
- package/dist/forms/effects/range/rangeFace.js +68 -0
- package/dist/forms/effects/range/rangeFace.schema.d.ts +1 -0
- package/dist/forms/effects/range/rangeFace.schema.js +11 -0
- package/dist/forms/effects/range/rangeFill.d.ts +7 -0
- package/dist/forms/effects/range/rangeFill.js +29 -0
- package/dist/forms/effects/range/rangeFill.schema.d.ts +1 -0
- package/dist/forms/effects/range/rangeFill.schema.js +9 -0
- package/dist/forms/effects/range/rangeHistogram.d.ts +14 -0
- package/dist/forms/effects/range/rangeHistogram.js +65 -0
- package/dist/forms/effects/range/rangeHistogram.schema.d.ts +1 -0
- package/dist/forms/effects/range/rangeHistogram.schema.js +11 -0
- package/dist/forms/effects/range/rangeThumb.d.ts +9 -0
- package/dist/forms/effects/range/rangeThumb.js +39 -0
- package/dist/forms/effects/range/rangeThumb.schema.d.ts +1 -0
- package/dist/forms/effects/range/rangeThumb.schema.js +10 -0
- package/dist/forms/effects/range/rangeTicks.d.ts +9 -0
- package/dist/forms/effects/range/rangeTicks.js +44 -0
- package/dist/forms/effects/range/rangeTicks.schema.d.ts +1 -0
- package/dist/forms/effects/range/rangeTicks.schema.js +18 -0
- package/dist/forms/effects/ring.d.ts +5 -0
- package/dist/forms/effects/ring.js +12 -0
- package/dist/forms/effects/step/stepProgress.d.ts +9 -0
- package/dist/forms/effects/step/stepProgress.js +35 -0
- package/dist/forms/effects/step/stepProgress.schema.d.ts +1 -0
- package/dist/forms/effects/step/stepProgress.schema.js +10 -0
- package/dist/forms/effects/step/stepSlide.d.ts +9 -0
- package/dist/forms/effects/step/stepSlide.js +50 -0
- package/dist/forms/effects/step/stepSlide.schema.d.ts +1 -0
- package/dist/forms/effects/step/stepSlide.schema.js +10 -0
- package/dist/forms/effects/switch/switchBulb.d.ts +9 -0
- package/dist/forms/effects/switch/switchBulb.js +70 -0
- package/dist/forms/effects/switch/switchBulb.schema.d.ts +1 -0
- package/dist/forms/effects/switch/switchBulb.schema.js +10 -0
- package/dist/forms/effects/switch/switchDayNight.d.ts +15 -0
- package/dist/forms/effects/switch/switchDayNight.js +96 -0
- package/dist/forms/effects/switch/switchDayNight.schema.d.ts +1 -0
- package/dist/forms/effects/switch/switchDayNight.schema.js +13 -0
- package/dist/forms/effects/switch/switchFace.d.ts +7 -0
- package/dist/forms/effects/switch/switchFace.js +75 -0
- package/dist/forms/effects/switch/switchFace.schema.d.ts +1 -0
- package/dist/forms/effects/switch/switchFace.schema.js +9 -0
- package/dist/forms/effects/switch/switchFlip.d.ts +7 -0
- package/dist/forms/effects/switch/switchFlip.js +45 -0
- package/dist/forms/effects/switch/switchFlip.schema.d.ts +1 -0
- package/dist/forms/effects/switch/switchFlip.schema.js +9 -0
- package/dist/forms/effects/switch/switchGoo.d.ts +7 -0
- package/dist/forms/effects/switch/switchGoo.js +95 -0
- package/dist/forms/effects/switch/switchGoo.schema.d.ts +1 -0
- package/dist/forms/effects/switch/switchGoo.schema.js +9 -0
- package/dist/forms/effects/switch/switchIcon.d.ts +9 -0
- package/dist/forms/effects/switch/switchIcon.js +63 -0
- package/dist/forms/effects/switch/switchIcon.schema.d.ts +1 -0
- package/dist/forms/effects/switch/switchIcon.schema.js +10 -0
- package/dist/forms/effects/switch/switchLabels.d.ts +11 -0
- package/dist/forms/effects/switch/switchLabels.js +55 -0
- package/dist/forms/effects/switch/switchLabels.schema.d.ts +1 -0
- package/dist/forms/effects/switch/switchLabels.schema.js +11 -0
- package/dist/forms/effects/switch/switchMorph.d.ts +9 -0
- package/dist/forms/effects/switch/switchMorph.js +22 -0
- package/dist/forms/effects/switch/switchMorph.schema.d.ts +1 -0
- package/dist/forms/effects/switch/switchMorph.schema.js +10 -0
- package/dist/forms/effects/switch/switchNeon.d.ts +11 -0
- package/dist/forms/effects/switch/switchNeon.js +53 -0
- package/dist/forms/effects/switch/switchNeon.schema.d.ts +1 -0
- package/dist/forms/effects/switch/switchNeon.schema.js +11 -0
- package/dist/forms/effects/switch/switchSlide.d.ts +7 -0
- package/dist/forms/effects/switch/switchSlide.js +11 -0
- package/dist/forms/effects/switch/switchSlide.schema.d.ts +1 -0
- package/dist/forms/effects/switch/switchSlide.schema.js +9 -0
- package/dist/forms/effects/switch/switchStretch.d.ts +9 -0
- package/dist/forms/effects/switch/switchStretch.js +21 -0
- package/dist/forms/effects/switch/switchStretch.schema.d.ts +1 -0
- package/dist/forms/effects/switch/switchStretch.schema.js +10 -0
- package/dist/forms/effects/valid/validAsync.d.ts +7 -0
- package/dist/forms/effects/valid/validAsync.js +36 -0
- package/dist/forms/effects/valid/validAsync.schema.d.ts +1 -0
- package/dist/forms/effects/valid/validAsync.schema.js +9 -0
- package/dist/forms/effects/valid/validBubble.d.ts +7 -0
- package/dist/forms/effects/valid/validBubble.js +61 -0
- package/dist/forms/effects/valid/validBubble.schema.d.ts +1 -0
- package/dist/forms/effects/valid/validBubble.schema.js +9 -0
- package/dist/forms/effects/valid/validCheck.d.ts +9 -0
- package/dist/forms/effects/valid/validCheck.js +50 -0
- package/dist/forms/effects/valid/validCheck.schema.d.ts +1 -0
- package/dist/forms/effects/valid/validCheck.schema.js +10 -0
- package/dist/forms/effects/valid/validColor.d.ts +11 -0
- package/dist/forms/effects/valid/validColor.js +28 -0
- package/dist/forms/effects/valid/validColor.schema.d.ts +1 -0
- package/dist/forms/effects/valid/validColor.schema.js +11 -0
- package/dist/forms/effects/valid/validFlash.d.ts +9 -0
- package/dist/forms/effects/valid/validFlash.js +36 -0
- package/dist/forms/effects/valid/validFlash.schema.d.ts +1 -0
- package/dist/forms/effects/valid/validFlash.schema.js +10 -0
- package/dist/forms/effects/valid/validMessage.d.ts +7 -0
- package/dist/forms/effects/valid/validMessage.js +24 -0
- package/dist/forms/effects/valid/validMessage.schema.d.ts +1 -0
- package/dist/forms/effects/valid/validMessage.schema.js +9 -0
- package/dist/forms/effects/valid/validShake.d.ts +9 -0
- package/dist/forms/effects/valid/validShake.js +37 -0
- package/dist/forms/effects/valid/validShake.schema.d.ts +1 -0
- package/dist/forms/effects/valid/validShake.schema.js +10 -0
- package/dist/forms/effects/valid/validSwap.d.ts +7 -0
- package/dist/forms/effects/valid/validSwap.js +33 -0
- package/dist/forms/effects/valid/validSwap.schema.d.ts +1 -0
- package/dist/forms/effects/valid/validSwap.schema.js +9 -0
- package/dist/forms/errors.d.ts +12 -0
- package/dist/forms/errors.js +20 -0
- package/dist/forms/file.d.ts +1 -0
- package/dist/forms/file.js +268 -0
- package/dist/forms/files.d.ts +7 -0
- package/dist/forms/files.js +29 -0
- package/dist/forms/formSteps.d.ts +9 -0
- package/dist/forms/formSteps.js +6 -0
- package/dist/forms/ids.d.ts +17 -0
- package/dist/forms/ids.js +13 -0
- package/dist/forms/inline.d.ts +3 -0
- package/dist/forms/inline.js +128 -0
- package/dist/forms/number.d.ts +1 -0
- package/dist/forms/number.js +67 -0
- package/dist/forms/otp.d.ts +4 -0
- package/dist/forms/otp.js +171 -0
- package/dist/forms/picker.d.ts +1 -0
- package/dist/forms/picker.js +303 -0
- package/dist/forms/range.d.ts +3 -0
- package/dist/forms/range.js +223 -0
- package/dist/forms/registry.d.ts +4 -0
- package/dist/forms/registry.js +133 -0
- package/dist/forms/reveal.d.ts +6 -0
- package/dist/forms/reveal.js +51 -0
- package/dist/forms/runtime/focus.d.ts +16 -0
- package/dist/forms/runtime/focus.js +55 -0
- package/dist/forms/runtime/listMatch.d.ts +2 -0
- package/dist/forms/runtime/listMatch.js +33 -0
- package/dist/forms/runtime/origin.d.ts +10 -0
- package/dist/forms/runtime/origin.js +25 -0
- package/dist/forms/runtime/placePopup.d.ts +10 -0
- package/dist/forms/runtime/placePopup.js +55 -0
- package/dist/forms/runtime/useFlip.d.ts +7 -0
- package/dist/forms/runtime/useFlip.js +38 -0
- package/dist/forms/runtime/useMorph.d.ts +8 -0
- package/dist/forms/runtime/useMorph.js +56 -0
- package/dist/forms/runtime/useOffScreen.d.ts +3 -0
- package/dist/forms/runtime/useOffScreen.js +16 -0
- package/dist/forms/runtime/useSwitchDrag.d.ts +8 -0
- package/dist/forms/runtime/useSwitchDrag.js +83 -0
- package/dist/forms/runtime/vanish.d.ts +6 -0
- package/dist/forms/runtime/vanish.js +185 -0
- package/dist/forms/steps.d.ts +1 -0
- package/dist/forms/steps.js +149 -0
- package/dist/forms/swap.d.ts +7 -0
- package/dist/forms/swap.js +149 -0
- package/dist/forms/switch.d.ts +1 -0
- package/dist/forms/switch.js +99 -0
- package/dist/forms/tools.d.ts +3 -0
- package/dist/forms/tools.js +248 -0
- package/dist/forms/types.d.ts +161 -0
- package/dist/forms/types.js +5 -0
- package/dist/index.d.ts +234 -0
- package/dist/index.js +119 -0
- package/dist/schema/forms.d.ts +3 -0
- package/dist/schema/forms.js +194 -0
- package/dist/schema/index.d.ts +2 -1
- package/dist/schema/index.js +3 -1
- package/dist/schema/types.d.ts +2 -2
- package/dist/schema/types.js +1 -0
- package/guides/README.md +62 -61
- package/guides/contact.md +100 -77
- package/guides/forms.md +105 -0
- package/package.json +1 -1
- package/styles/form.css +594 -0
- package/theme.css +6 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface ValidCheckOptions {
|
|
3
|
+
/** The check's colour. Default `var(--color-sx-success)`. */
|
|
4
|
+
readonly color?: string;
|
|
5
|
+
/** Seconds it takes to draw. Default `0.35`. */
|
|
6
|
+
readonly duration?: number;
|
|
7
|
+
}
|
|
8
|
+
/** A check mark draws itself at the end of the field once it is filled in right. */
|
|
9
|
+
export declare function validCheck(options?: ValidCheckOptions): FormEffect;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { SPRING, VALID, at, defineForm, inField, layerOf, v, varName } from "../kit.js";
|
|
2
|
+
const ID = "validCheck";
|
|
3
|
+
const LAYER = layerOf(ID);
|
|
4
|
+
const LINE = `${LAYER} [data-sx-field-svg="check"]`;
|
|
5
|
+
// The check is the field's state, so it shows under reduced motion too (the layer is kept). Drawn: its dash runs from
|
|
6
|
+
// 1 to 0 and the mark pops a little. It sits in the end row and keeps its room, so nothing moves when it appears.
|
|
7
|
+
const STATE = ` ${at(LINE)} {
|
|
8
|
+
fill: none;
|
|
9
|
+
stroke: ${v(ID, "color")};
|
|
10
|
+
stroke-width: 2.5;
|
|
11
|
+
stroke-linecap: round;
|
|
12
|
+
stroke-linejoin: round;
|
|
13
|
+
stroke-dasharray: 1 2;
|
|
14
|
+
stroke-dashoffset: 1.01;
|
|
15
|
+
}
|
|
16
|
+
${at(inField(ID, VALID, LINE))} {
|
|
17
|
+
stroke-dashoffset: 0;
|
|
18
|
+
}
|
|
19
|
+
@media (forced-colors: active) {
|
|
20
|
+
${at(LINE)} {
|
|
21
|
+
stroke: CanvasText;
|
|
22
|
+
}
|
|
23
|
+
}`;
|
|
24
|
+
const CSS = ` ${at(LINE)} {
|
|
25
|
+
transition: stroke-dashoffset ${v(ID, "time")} ease-out;
|
|
26
|
+
}
|
|
27
|
+
${at(LAYER)} {
|
|
28
|
+
transition: scale ${v(ID, "time")} ${SPRING};
|
|
29
|
+
scale: 0.6;
|
|
30
|
+
}
|
|
31
|
+
${at(inField(ID, VALID, LAYER))} {
|
|
32
|
+
scale: 1;
|
|
33
|
+
}`;
|
|
34
|
+
/** A check mark draws itself at the end of the field once it is filled in right. */
|
|
35
|
+
export function validCheck(options = {}) {
|
|
36
|
+
return defineForm(ID, CSS, {
|
|
37
|
+
state: STATE,
|
|
38
|
+
vars: {
|
|
39
|
+
[varName(ID, "color")]: options.color ?? "var(--color-sx-success)",
|
|
40
|
+
[varName(ID, "time")]: `${options.duration ?? 0.35}s`,
|
|
41
|
+
},
|
|
42
|
+
layers: [
|
|
43
|
+
{
|
|
44
|
+
slot: "end",
|
|
45
|
+
keep: true,
|
|
46
|
+
svg: { viewBox: "0 0 24 24", children: [{ tag: "path", part: "check", attrs: { d: "m5 12.5 4.5 4.5L19 7.5", pathLength: 1 } }] },
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
});
|
|
50
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const VALID_CHECK_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const VALID_CHECK_SCHEMA = defineSchema()({
|
|
3
|
+
id: "validCheck",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "validCheck",
|
|
6
|
+
fields: {
|
|
7
|
+
color: { kind: "color", label: "Colour", default: "var(--color-sx-success)" },
|
|
8
|
+
duration: { kind: "number", label: "Duration", min: 0.1, max: 0.8, step: 0.05, unit: "s", default: 0.35 },
|
|
9
|
+
},
|
|
10
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface ValidColorOptions {
|
|
3
|
+
/** A wrong field's border and label. Default `var(--color-sx-danger)`. */
|
|
4
|
+
readonly invalid?: string;
|
|
5
|
+
/** A right field's border. Default `var(--color-sx-success)`. */
|
|
6
|
+
readonly valid?: string;
|
|
7
|
+
/** Seconds the colour takes. Default `0.2`. */
|
|
8
|
+
readonly duration?: number;
|
|
9
|
+
}
|
|
10
|
+
/** The border turns red when the field is wrong and green when it is right, once the user has left it. */
|
|
11
|
+
export declare function validColor(options?: ValidColorOptions): FormEffect;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { INVALID, VALID, at, defineForm, fieldOf, inField, labelOf, timed, v, varName } from "../kit.js";
|
|
2
|
+
const ID = "validColor";
|
|
3
|
+
const FIELD = fieldOf(ID);
|
|
4
|
+
const LABEL = labelOf(ID);
|
|
5
|
+
// Colours are states: they hold under reduced motion. They go through the look's hooks (the look loads after
|
|
6
|
+
// effects): `--sx-field-edge` for the border, `--sx-field-label-color` for the label. A field turns only once the
|
|
7
|
+
// user has left it or the app has checked it, never while typing.
|
|
8
|
+
const STATE = ` ${at(inField(ID, INVALID, FIELD))} {
|
|
9
|
+
--sx-field-edge: ${v(ID, "invalid")};
|
|
10
|
+
--sx-field-label-color: ${v(ID, "invalid")};
|
|
11
|
+
}
|
|
12
|
+
${at(inField(ID, VALID, FIELD))} {
|
|
13
|
+
--sx-field-edge: ${v(ID, "valid")};
|
|
14
|
+
}`;
|
|
15
|
+
const CSS = ` ${at(LABEL)} {
|
|
16
|
+
${timed(ID, "color")}
|
|
17
|
+
}`;
|
|
18
|
+
/** The border turns red when the field is wrong and green when it is right, once the user has left it. */
|
|
19
|
+
export function validColor(options = {}) {
|
|
20
|
+
return defineForm(ID, CSS, {
|
|
21
|
+
state: STATE,
|
|
22
|
+
vars: {
|
|
23
|
+
[varName(ID, "invalid")]: options.invalid ?? "var(--color-sx-danger)",
|
|
24
|
+
[varName(ID, "valid")]: options.valid ?? "var(--color-sx-success)",
|
|
25
|
+
[varName(ID, "time")]: `${options.duration ?? 0.2}s`,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const VALID_COLOR_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const VALID_COLOR_SCHEMA = defineSchema()({
|
|
3
|
+
id: "validColor",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "validColor",
|
|
6
|
+
fields: {
|
|
7
|
+
invalid: { kind: "color", label: "Wrong", default: "var(--color-sx-danger)" },
|
|
8
|
+
valid: { kind: "color", label: "Right", default: "var(--color-sx-success)" },
|
|
9
|
+
duration: { kind: "number", label: "Duration", min: 0.05, max: 0.6, step: 0.05, unit: "s", default: 0.2 },
|
|
10
|
+
},
|
|
11
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface ValidFlashOptions {
|
|
3
|
+
/** The flash's colour. Default `var(--color-sx-danger)`. */
|
|
4
|
+
readonly color?: string;
|
|
5
|
+
/** Seconds the two blinks take. Default `0.9`. */
|
|
6
|
+
readonly duration?: number;
|
|
7
|
+
}
|
|
8
|
+
/** The field blinks twice when the user is sent to it after a failed submit (`focusFirstError`, `ErrorSummary`). */
|
|
9
|
+
export declare function validFlash(options?: ValidFlashOptions): FormEffect;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { FLASH, at, defineForm, inField, layerOf, v, varName } from "../kit.js";
|
|
2
|
+
const ID = "validFlash";
|
|
3
|
+
const RING = layerOf(ID, "ring");
|
|
4
|
+
const TINT = layerOf(ID, "tint");
|
|
5
|
+
// `focusFirstError` and an error summary's links mark the field they send the user to (`data-sx-flash`, for about a
|
|
6
|
+
// second). A ring around the box and a tint inside it blink twice: only their opacity moves. Under reduced motion the
|
|
7
|
+
// layers go and the focus ring alone shows where the user landed.
|
|
8
|
+
const CSS = ` ${at(RING)} {
|
|
9
|
+
outline: 2px solid ${v(ID, "color")};
|
|
10
|
+
outline-offset: 3px;
|
|
11
|
+
opacity: 0;
|
|
12
|
+
}
|
|
13
|
+
${at(TINT)} {
|
|
14
|
+
background: color-mix(in oklab, ${v(ID, "color")} 12%, transparent);
|
|
15
|
+
opacity: 0;
|
|
16
|
+
}
|
|
17
|
+
${at(`${inField(ID, FLASH, RING)}, ${inField(ID, FLASH, TINT)}`)} {
|
|
18
|
+
animation: sx-form-validFlash ${v(ID, "time")} ease-in-out;
|
|
19
|
+
}
|
|
20
|
+
@keyframes sx-form-validFlash {
|
|
21
|
+
0%, 50%, 100% { opacity: 0; }
|
|
22
|
+
25%, 75% { opacity: 1; }
|
|
23
|
+
}`;
|
|
24
|
+
/** The field blinks twice when the user is sent to it after a failed submit (`focusFirstError`, `ErrorSummary`). */
|
|
25
|
+
export function validFlash(options = {}) {
|
|
26
|
+
return defineForm(ID, CSS, {
|
|
27
|
+
vars: {
|
|
28
|
+
[varName(ID, "color")]: options.color ?? "var(--color-sx-danger)",
|
|
29
|
+
[varName(ID, "time")]: `${options.duration ?? 0.9}s`,
|
|
30
|
+
},
|
|
31
|
+
layers: [
|
|
32
|
+
{ slot: "under", part: "tint" },
|
|
33
|
+
{ slot: "edge", part: "ring" },
|
|
34
|
+
],
|
|
35
|
+
});
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const VALID_FLASH_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const VALID_FLASH_SCHEMA = defineSchema()({
|
|
3
|
+
id: "validFlash",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "validFlash",
|
|
6
|
+
fields: {
|
|
7
|
+
color: { kind: "color", label: "Colour", default: "var(--color-sx-danger)" },
|
|
8
|
+
duration: { kind: "number", label: "Two blinks", min: 0.4, max: 1.6, step: 0.05, unit: "s", default: 0.9 },
|
|
9
|
+
},
|
|
10
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface ValidMessageOptions {
|
|
3
|
+
/** Seconds it takes. Default `0.25`. */
|
|
4
|
+
readonly duration?: number;
|
|
5
|
+
}
|
|
6
|
+
/** The error message slides down under the field, and its row opens smoothly, pushing what is below gently. */
|
|
7
|
+
export declare function validMessage(options?: ValidMessageOptions): FormEffect;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { EASE, at, defineForm, fieldOf, v, varName } from "../kit.js";
|
|
2
|
+
const ID = "validMessage";
|
|
3
|
+
const FIELD = fieldOf(ID);
|
|
4
|
+
const ROW = `${FIELD} [data-sx-field-message]`;
|
|
5
|
+
const SAYS = `${FIELD} [data-sx-field-says]`;
|
|
6
|
+
// The base sheet already gives the message its own row, 0fr while empty and 1fr with words, so nothing below jumps
|
|
7
|
+
// at once. This eases the row open (an allowed repaint, one row of one field) and slides the words down into it. A new
|
|
8
|
+
// message is a new element (the field keys it by its words), so it slides in again.
|
|
9
|
+
const CSS = ` ${at(ROW)} {
|
|
10
|
+
transition: grid-template-rows ${v(ID, "time")} ${EASE};
|
|
11
|
+
}
|
|
12
|
+
${at(SAYS)} {
|
|
13
|
+
transition: opacity ${v(ID, "time")} ${EASE}, translate ${v(ID, "time")} ${EASE};
|
|
14
|
+
}
|
|
15
|
+
@starting-style {
|
|
16
|
+
${at(SAYS)} {
|
|
17
|
+
opacity: 0;
|
|
18
|
+
translate: 0 -0.75em;
|
|
19
|
+
}
|
|
20
|
+
}`;
|
|
21
|
+
/** The error message slides down under the field, and its row opens smoothly, pushing what is below gently. */
|
|
22
|
+
export function validMessage(options = {}) {
|
|
23
|
+
return defineForm(ID, CSS, { vars: { [varName(ID, "time")]: `${options.duration ?? 0.25}s` } });
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const VALID_MESSAGE_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const VALID_MESSAGE_SCHEMA = defineSchema()({
|
|
3
|
+
id: "validMessage",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "validMessage",
|
|
6
|
+
fields: {
|
|
7
|
+
duration: { kind: "number", label: "Duration", min: 0.1, max: 0.6, step: 0.05, unit: "s", default: 0.25 },
|
|
8
|
+
},
|
|
9
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface ValidShakeOptions {
|
|
3
|
+
/** How far it swings, px. Default `6`. */
|
|
4
|
+
readonly distance?: number;
|
|
5
|
+
/** Seconds the shake lasts. Default `0.4`. */
|
|
6
|
+
readonly duration?: number;
|
|
7
|
+
}
|
|
8
|
+
/** The field shakes side to side when it turns wrong, and again when the user is sent back to it. */
|
|
9
|
+
export declare function validShake(options?: ValidShakeOptions): FormEffect;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { FLASH, INVALID, at, boxOf, defineForm, inField, v, varName } from "../kit.js";
|
|
2
|
+
const ID = "validShake";
|
|
3
|
+
const BOX = boxOf(ID);
|
|
4
|
+
const SWING = (n) => `calc(${v(ID, "distance")} * ${n}px) 0`;
|
|
5
|
+
// The box shakes when the field turns wrong, and again each time the user is sent to it (`focusFirstError`, an error
|
|
6
|
+
// summary's link: `data-sx-flash`). The second shake is a second animation in the list, so it starts afresh while the
|
|
7
|
+
// first one, long over, keeps its place. A shake is never the only sign: the error has words (atlas rule 3).
|
|
8
|
+
const CSS = ` ${at(inField(ID, INVALID, BOX))} {
|
|
9
|
+
animation: sx-form-validShake ${v(ID, "time")} ease-out;
|
|
10
|
+
}
|
|
11
|
+
${at(inField(ID, `${INVALID}${FLASH}`, BOX))} {
|
|
12
|
+
animation: sx-form-validShake ${v(ID, "time")} ease-out, sx-form-validShake-again ${v(ID, "time")} ease-out;
|
|
13
|
+
}
|
|
14
|
+
@keyframes sx-form-validShake {
|
|
15
|
+
0%, 100% { translate: 0 0; }
|
|
16
|
+
15% { translate: ${SWING(-1)}; }
|
|
17
|
+
35% { translate: ${SWING(1)}; }
|
|
18
|
+
55% { translate: ${SWING(-0.6)}; }
|
|
19
|
+
75% { translate: ${SWING(0.3)}; }
|
|
20
|
+
}
|
|
21
|
+
@keyframes sx-form-validShake-again {
|
|
22
|
+
0%, 100% { translate: 0 0; }
|
|
23
|
+
15% { translate: ${SWING(-1)}; }
|
|
24
|
+
35% { translate: ${SWING(1)}; }
|
|
25
|
+
55% { translate: ${SWING(-0.6)}; }
|
|
26
|
+
75% { translate: ${SWING(0.3)}; }
|
|
27
|
+
}`;
|
|
28
|
+
/** The field shakes side to side when it turns wrong, and again when the user is sent back to it. */
|
|
29
|
+
export function validShake(options = {}) {
|
|
30
|
+
return defineForm(ID, CSS, {
|
|
31
|
+
vars: {
|
|
32
|
+
[varName(ID, "distance")]: options.distance ?? 6,
|
|
33
|
+
[varName(ID, "time")]: `${options.duration ?? 0.4}s`,
|
|
34
|
+
},
|
|
35
|
+
claims: ["box"],
|
|
36
|
+
});
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const VALID_SHAKE_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const VALID_SHAKE_SCHEMA = defineSchema()({
|
|
3
|
+
id: "validShake",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "validShake",
|
|
6
|
+
fields: {
|
|
7
|
+
distance: { kind: "number", label: "Swing", min: 2, max: 16, step: 1, unit: "px", default: 6 },
|
|
8
|
+
duration: { kind: "number", label: "Duration", min: 0.2, max: 0.8, step: 0.05, unit: "s", default: 0.4 },
|
|
9
|
+
},
|
|
10
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface ValidSwapOptions {
|
|
3
|
+
/** Seconds it takes. Default `0.25`. */
|
|
4
|
+
readonly duration?: number;
|
|
5
|
+
}
|
|
6
|
+
/** The help text under the field rolls up and away, and the error rolls in from below in its place. */
|
|
7
|
+
export declare function validSwap(options?: ValidSwapOptions): FormEffect;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { EASE, at, defineForm, fieldOf, inField, v, varName } from "../kit.js";
|
|
2
|
+
const ID = "validSwap";
|
|
3
|
+
const FIELD = fieldOf(ID);
|
|
4
|
+
const HELP = `${FIELD} > [data-sx-field-description]`;
|
|
5
|
+
const MESSAGE = `${FIELD} > [data-sx-field-message]`;
|
|
6
|
+
const SAYS = `${FIELD} [data-sx-field-says]`;
|
|
7
|
+
const SAYING = ":has([data-sx-field-error]:not(:empty))";
|
|
8
|
+
// The help text and the error share one cell, so the error takes the help's place instead of adding a row: the
|
|
9
|
+
// field's height barely changes. Which one shows is a state (it holds under reduced motion); the roll is the motion.
|
|
10
|
+
// Screen readers already hear the error in place of the help (`aria-describedby`).
|
|
11
|
+
const STATE = ` ${at(MESSAGE)} {
|
|
12
|
+
grid-area: description;
|
|
13
|
+
}
|
|
14
|
+
${at(inField(ID, SAYING, HELP))} {
|
|
15
|
+
opacity: 0;
|
|
16
|
+
translate: 0 -0.75em;
|
|
17
|
+
}`;
|
|
18
|
+
const CSS = ` ${at(HELP)} {
|
|
19
|
+
transition: opacity ${v(ID, "time")} ${EASE}, translate ${v(ID, "time")} ${EASE};
|
|
20
|
+
}
|
|
21
|
+
${at(SAYS)} {
|
|
22
|
+
transition: opacity ${v(ID, "time")} ${EASE}, translate ${v(ID, "time")} ${EASE};
|
|
23
|
+
}
|
|
24
|
+
@starting-style {
|
|
25
|
+
${at(SAYS)} {
|
|
26
|
+
opacity: 0;
|
|
27
|
+
translate: 0 0.75em;
|
|
28
|
+
}
|
|
29
|
+
}`;
|
|
30
|
+
/** The help text under the field rolls up and away, and the error rolls in from below in its place. */
|
|
31
|
+
export function validSwap(options = {}) {
|
|
32
|
+
return defineForm(ID, CSS, { state: STATE, vars: { [varName(ID, "time")]: `${options.duration ?? 0.25}s` } });
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const VALID_SWAP_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const VALID_SWAP_SCHEMA = defineSchema()({
|
|
3
|
+
id: "validSwap",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "validSwap",
|
|
6
|
+
fields: {
|
|
7
|
+
duration: { kind: "number", label: "Duration", min: 0.1, max: 0.6, step: 0.05, unit: "s", default: 0.25 },
|
|
8
|
+
},
|
|
9
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
/** One problem: the id (or `name`) of the field it is about, and what is wrong. */
|
|
3
|
+
export interface ErrorSummaryItem {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly message: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/** A React Hook Form `formState.errors` object, nested objects and arrays included, or a plain `{ name: message }`. */
|
|
8
|
+
export type ErrorTree = {
|
|
9
|
+
readonly [name: string]: unknown;
|
|
10
|
+
};
|
|
11
|
+
/** The problems as a flat list, in the object's order. A nested name joins with dots, as React Hook Form names it (`address.city`). */
|
|
12
|
+
export declare function errorItems(errors: readonly ErrorSummaryItem[] | ErrorTree, prefix?: string): ErrorSummaryItem[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Turns the errors a form library holds into the flat list an error summary shows. Plain module: a Server Component
|
|
2
|
+
// can call it too.
|
|
3
|
+
import { isValidElement } from "react";
|
|
4
|
+
/** The problems as a flat list, in the object's order. A nested name joins with dots, as React Hook Form names it (`address.city`). */
|
|
5
|
+
export function errorItems(errors, prefix = "") {
|
|
6
|
+
// a list of problems as given; deeper down, an array is a field array (`items.1.name`)
|
|
7
|
+
if (Array.isArray(errors) && !prefix)
|
|
8
|
+
return errors;
|
|
9
|
+
return Object.entries(errors).flatMap(([key, value]) => {
|
|
10
|
+
if (value === undefined || value === null || value === false || value === "")
|
|
11
|
+
return [];
|
|
12
|
+
const id = prefix ? `${prefix}.${key}` : key;
|
|
13
|
+
if (typeof value !== "object" || isValidElement(value))
|
|
14
|
+
return [{ id, message: value }];
|
|
15
|
+
const message = value.message;
|
|
16
|
+
if (message !== undefined && message !== null && message !== "")
|
|
17
|
+
return [{ id, message: message }];
|
|
18
|
+
return errorItems(value, id);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FILE_CSS = "@layer theme, base, components, utilities;\n@layer components {\n :where([data-sx-file]) {\n --sx-form-dir: 1;\n --sx-file-thumb: 2.5rem;\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n grid-template-areas: \"label\" \"zone\" \"description\" \"list\" \"message\";\n align-content: start;\n min-inline-size: 0;\n position: relative;\n }\n :where([data-sx-file]:dir(rtl)) {\n --sx-form-dir: -1;\n }\n :where([data-sx-file-label]) {\n grid-area: label;\n justify-self: start;\n margin-block-end: 0.375rem;\n }\n :where([data-sx-file-zone]) {\n grid-area: zone;\n position: relative;\n isolation: isolate;\n display: grid;\n justify-items: center;\n gap: 0.5rem;\n padding: 1.5rem 1rem;\n box-sizing: border-box;\n text-align: center;\n cursor: pointer;\n }\n :where([data-sx-file-zone] > [data-sx-file-layer]) {\n position: absolute;\n inset: 0;\n z-index: -1;\n border-radius: inherit;\n pointer-events: none;\n }\n :where([data-sx-file-icon]) {\n display: grid;\n place-items: center;\n }\n :where([data-sx-file-icon] svg, [data-sx-file-card] svg) {\n display: block;\n inline-size: 1.5rem;\n block-size: 1.5rem;\n overflow: visible;\n fill: none;\n stroke: currentColor;\n stroke-width: 1.75;\n stroke-linecap: round;\n stroke-linejoin: round;\n }\n :where([data-sx-file-control]) {\n max-inline-size: 100%;\n color: transparent;\n font: inherit;\n font-size: max(16px, 0.875rem);\n cursor: pointer;\n }\n :where([data-sx-file-control])::file-selector-button {\n margin-inline-end: 0;\n padding: 0.5rem 1rem;\n font: inherit;\n cursor: pointer;\n }\n :where([data-sx-file-control]:focus-visible) {\n outline: 2px solid var(--color-sx-primary, currentColor);\n outline-offset: 2px;\n }\n :where([data-sx-file][data-sx-over] [data-sx-file-zone]) {\n outline: 2px solid var(--color-sx-primary, currentColor);\n outline-offset: -2px;\n }\n :where([data-sx-file][data-sx-over=\"reject\"] [data-sx-file-zone]) {\n outline-color: var(--color-sx-danger, currentColor);\n cursor: no-drop;\n }\n :where([data-sx-file]:has([data-sx-file-control]:disabled) [data-sx-file-zone]) {\n opacity: 0.55;\n cursor: not-allowed;\n }\n :where([data-sx-file-description]) {\n grid-area: description;\n margin: 0.375rem 0 0;\n }\n :where([data-sx-file-list]) {\n grid-area: list;\n display: grid;\n gap: 0.5rem;\n margin: 0.75rem 0 0;\n padding: 0;\n list-style: none;\n }\n :where([data-sx-file-card]) {\n position: relative;\n isolation: isolate;\n display: grid;\n grid-template-columns: var(--sx-file-thumb) minmax(0, 1fr) auto auto;\n grid-template-areas: \"thumb info status actions\";\n align-items: center;\n column-gap: 0.75rem;\n padding: 0.5rem;\n box-sizing: border-box;\n }\n :where([data-sx-file-card] > [data-sx-file-layer]) {\n grid-area: status;\n pointer-events: none;\n }\n :where([data-sx-file-thumb]) {\n grid-area: thumb;\n display: grid;\n place-items: center;\n inline-size: var(--sx-file-thumb);\n block-size: var(--sx-file-thumb);\n overflow: hidden;\n border-radius: calc(var(--radius-sx-control, 0.5rem) * 0.75);\n }\n :where([data-sx-file-thumb] > img) {\n display: block;\n inline-size: 100%;\n block-size: 100%;\n object-fit: cover;\n }\n :where([data-sx-file-info]) {\n grid-area: info;\n display: grid;\n min-inline-size: 0;\n gap: 0.125rem;\n }\n :where([data-sx-file-name]) {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n :where([data-sx-file-bar]) {\n display: block;\n block-size: 0.25rem;\n margin-block-start: 0.25rem;\n overflow: hidden;\n border-radius: 999px;\n }\n :where([data-sx-file-fill]) {\n display: block;\n block-size: 100%;\n transform-origin: calc(50% - 50% * var(--sx-form-dir)) 50%;\n scale: var(--sx-file-progress, 0) 1;\n background: currentColor;\n }\n :where([data-sx-file-done]) {\n grid-area: status;\n display: none;\n }\n :where([data-sx-file-card][data-sx-done] [data-sx-file-done]) {\n display: grid;\n }\n :where([data-sx-file-card][data-sx-done] [data-sx-file-bar]) {\n opacity: 0;\n }\n :where([data-sx-file-actions]) {\n grid-area: actions;\n display: flex;\n gap: 0.125rem;\n }\n :where([data-sx-file-actions] > button) {\n display: grid;\n place-items: center;\n inline-size: 2rem;\n block-size: 2rem;\n margin: 0;\n padding: 0;\n border: 0;\n border-radius: 50%;\n background: transparent;\n color: inherit;\n cursor: pointer;\n }\n :where([data-sx-file-actions] > button svg) {\n inline-size: 1.125rem;\n block-size: 1.125rem;\n }\n :where([data-sx-file-actions] > button:focus-visible) {\n outline: 2px solid var(--color-sx-primary, currentColor);\n outline-offset: 1px;\n }\n :where([data-sx-file-actions] > button:disabled) {\n opacity: 0.35;\n cursor: default;\n }\n :where([data-sx-file-card][data-sx-leaving]) {\n pointer-events: none;\n }\n :where([data-sx-file-page]) {\n position: fixed;\n inset: 0;\n z-index: 2147483000;\n display: none;\n place-items: center;\n isolation: isolate;\n padding: 1.5rem;\n box-sizing: border-box;\n font-size: 1.5rem;\n }\n :where([data-sx-file][data-sx-page-over] [data-sx-file-page]) {\n display: grid;\n }\n :where([data-sx-file-page] > [data-sx-file-layer]) {\n position: absolute;\n inset: 1rem;\n z-index: -1;\n pointer-events: none;\n }\n :where([data-sx-file-message]) {\n grid-area: message;\n display: grid;\n grid-template-rows: 0fr;\n }\n :where([data-sx-file-message]:has([data-sx-file-says])) {\n grid-template-rows: 1fr;\n }\n :where([data-sx-file-error]) {\n min-block-size: 0;\n margin: 0;\n overflow: hidden;\n }\n :where([data-sx-file-says]) {\n display: block;\n padding-block-start: 0.375rem;\n }\n :where([data-sx-file-sr]) {\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n }\n @media (prefers-reduced-motion: reduce) {\n :where([data-sx-file] [data-sx-file-layer]:not([data-sx-file-keep])) {\n display: none;\n }\n }\n @media (forced-colors: active) {\n :where([data-sx-file-zone]) {\n border: 2px dashed CanvasText;\n }\n :where([data-sx-file-control]) {\n color: CanvasText;\n }\n :where([data-sx-file-card]) {\n border: 1px solid CanvasText;\n }\n :where([data-sx-file-fill]) {\n forced-color-adjust: none;\n background: Highlight;\n }\n }\n}";
|