@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,70 @@
|
|
|
1
|
+
import { DIR, PAD_Y, RAISED, START, at, controlOf, defineForm, fieldOf, inField, labelOf, layerOf, timed, v, varName } from "../kit.js";
|
|
2
|
+
const ID = "inputNotch";
|
|
3
|
+
const LABEL = labelOf(ID);
|
|
4
|
+
const LINE = layerOf(ID);
|
|
5
|
+
const GAP = `${LINE} > legend`;
|
|
6
|
+
// The outline is a <fieldset> drawn over the box: its <legend> holds a hidden copy of the label at the raised size,
|
|
7
|
+
// and the browser cuts the border open exactly that wide. No measuring. The box's own border steps aside (the look
|
|
8
|
+
// reads --sx-field-edge), and the fieldset takes the look's colour for each state (--sx-field-line).
|
|
9
|
+
const STATE = ` ${at(fieldOf(ID))} {
|
|
10
|
+
--sx-field-edge: transparent;
|
|
11
|
+
--sx-field-label-size: 1em;
|
|
12
|
+
}
|
|
13
|
+
${at(LINE)} {
|
|
14
|
+
inset-block-start: calc(-0.5em * ${v(ID, "scale")} - var(--sx-field-bw) / 2);
|
|
15
|
+
padding-inline: calc(${START} - var(--sx-field-bw) - 0.25em * ${v(ID, "scale")});
|
|
16
|
+
border: max(var(--sx-field-bw), 1px) solid var(--sx-field-line, var(--color-sx-border));
|
|
17
|
+
}
|
|
18
|
+
${at(GAP)} {
|
|
19
|
+
float: none;
|
|
20
|
+
padding: 0;
|
|
21
|
+
font-size: calc(${v(ID, "scale")} * 1em);
|
|
22
|
+
font-weight: var(--sx-field-label-weight, 500);
|
|
23
|
+
line-height: 1;
|
|
24
|
+
white-space: nowrap;
|
|
25
|
+
visibility: hidden;
|
|
26
|
+
max-inline-size: 0.01px;
|
|
27
|
+
}
|
|
28
|
+
${at(`${GAP} > span`)} {
|
|
29
|
+
display: inline-block;
|
|
30
|
+
padding-inline: 0.25em;
|
|
31
|
+
}
|
|
32
|
+
${at(inField(ID, RAISED, GAP))} {
|
|
33
|
+
max-inline-size: 100%;
|
|
34
|
+
}
|
|
35
|
+
${at(LABEL)} {
|
|
36
|
+
grid-area: box;
|
|
37
|
+
align-self: start;
|
|
38
|
+
z-index: 1;
|
|
39
|
+
margin: ${PAD_Y} 0 0;
|
|
40
|
+
margin-inline-start: ${START};
|
|
41
|
+
line-height: 1.5;
|
|
42
|
+
pointer-events: none;
|
|
43
|
+
transform-origin: calc(50% - 50% * ${DIR}) 0;
|
|
44
|
+
}
|
|
45
|
+
${at(inField(ID, ":not(:focus-within)", controlOf(ID)))} {
|
|
46
|
+
--sx-field-placeholder: transparent;
|
|
47
|
+
}
|
|
48
|
+
${at(inField(ID, RAISED, LABEL))} {
|
|
49
|
+
translate: 0 calc(-1 * (${PAD_Y} + ${v(ID, "scale")} * 0.75em));
|
|
50
|
+
scale: ${v(ID, "scale")};
|
|
51
|
+
}`;
|
|
52
|
+
// The gap's width is the one thing that re-lays out (a legend can only open by its own size): one small element.
|
|
53
|
+
const CSS = ` ${at(LABEL)} {
|
|
54
|
+
${timed(ID, "translate, scale")}
|
|
55
|
+
}
|
|
56
|
+
${at(GAP)} {
|
|
57
|
+
transition: max-inline-size ${v(ID, "time")} ease-out;
|
|
58
|
+
}`;
|
|
59
|
+
/** The label floats onto the border, which opens a gap exactly its width (Material's outlined field). */
|
|
60
|
+
export function inputNotch(options = {}) {
|
|
61
|
+
return defineForm(ID, CSS, {
|
|
62
|
+
state: STATE,
|
|
63
|
+
vars: {
|
|
64
|
+
[varName(ID, "scale")]: options.scale ?? 0.75,
|
|
65
|
+
[varName(ID, "time")]: `${options.duration ?? 0.2}s`,
|
|
66
|
+
},
|
|
67
|
+
layers: [{ slot: "edge", legend: true, keep: true }],
|
|
68
|
+
claims: ["label"],
|
|
69
|
+
});
|
|
70
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const INPUT_NOTCH_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const INPUT_NOTCH_SCHEMA = defineSchema()({
|
|
3
|
+
id: "inputNotch",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "inputNotch",
|
|
6
|
+
fields: {
|
|
7
|
+
scale: { kind: "number", label: "Label size on the border", min: 0.6, max: 0.9, step: 0.05, default: 0.75 },
|
|
8
|
+
duration: { kind: "number", label: "Duration", min: 0.1, max: 0.6, step: 0.05, unit: "s", default: 0.2 },
|
|
9
|
+
},
|
|
10
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface InputRevealOptions {
|
|
3
|
+
/**
|
|
4
|
+
* `"eye"`: the eye blinks open and a stroke crosses it out. `"flashlight"`: the field goes dark and the eye shines a
|
|
5
|
+
* beam across the password (Ryan Mulligan's idea). Default `"eye"`.
|
|
6
|
+
*/
|
|
7
|
+
readonly kind?: "eye" | "flashlight";
|
|
8
|
+
/** Seconds it takes. Default `0.3`. */
|
|
9
|
+
readonly duration?: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The show-password button comes alive (`reveal` on the field): the eye blinks and a stroke crosses it out, or the
|
|
13
|
+
* field goes dark and the eye lights the password like a torch. Under reduced motion it just swaps.
|
|
14
|
+
*/
|
|
15
|
+
export declare function inputReveal(options?: InputRevealOptions): FormEffect;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { DIR, at, childOf, defineForm, fieldOf, inField, layerOf, timed, v, varName } from "../kit.js";
|
|
2
|
+
const ID = "inputReveal";
|
|
3
|
+
const FIELD = fieldOf(ID);
|
|
4
|
+
const SHOWN = "[data-sx-revealed]";
|
|
5
|
+
const SLASH = `${FIELD} [data-sx-field-reveal] [data-sx-tool-part="slash"]`;
|
|
6
|
+
const EYE = `${FIELD} [data-sx-field-reveal] [data-sx-tool-eye]`;
|
|
7
|
+
const DARK = layerOf(ID);
|
|
8
|
+
const BEAM = childOf(ID, "beam");
|
|
9
|
+
/** The beam comes from the end of the field, where the button is. */
|
|
10
|
+
const END = `calc(50% + 50% * ${DIR})`;
|
|
11
|
+
// Both kinds share one sheet: the beam's layer exists only on a flashlight, and the eye is the field's own button.
|
|
12
|
+
const CSS = ` ${at(SLASH)} {
|
|
13
|
+
${timed(ID, "stroke-dashoffset")}
|
|
14
|
+
}
|
|
15
|
+
${at(EYE)} {
|
|
16
|
+
transform-box: fill-box;
|
|
17
|
+
transform-origin: center;
|
|
18
|
+
}
|
|
19
|
+
${at(inField(ID, SHOWN, EYE))} {
|
|
20
|
+
animation: sx-form-inputReveal-blink ${v(ID, "time")} ease-in-out;
|
|
21
|
+
}
|
|
22
|
+
${at(DARK)} {
|
|
23
|
+
background: var(--color-sx-ink);
|
|
24
|
+
opacity: 0;
|
|
25
|
+
${timed(ID, "opacity")}
|
|
26
|
+
}
|
|
27
|
+
${at(BEAM)} {
|
|
28
|
+
position: absolute;
|
|
29
|
+
inset: 0;
|
|
30
|
+
background: radial-gradient(ellipse 125% 170% at ${END} 50%, var(--color-sx-secondary) 58%, transparent 61%);
|
|
31
|
+
scale: 0;
|
|
32
|
+
transform-origin: ${END} 50%;
|
|
33
|
+
${timed(ID, "scale")}
|
|
34
|
+
}
|
|
35
|
+
${at(inField(ID, SHOWN, DARK))} {
|
|
36
|
+
opacity: 1;
|
|
37
|
+
}
|
|
38
|
+
${at(inField(ID, SHOWN, BEAM))} {
|
|
39
|
+
scale: 1;
|
|
40
|
+
}
|
|
41
|
+
@keyframes sx-form-inputReveal-blink {
|
|
42
|
+
0%, 100% { scale: 1 1; }
|
|
43
|
+
45% { scale: 1 0.1; }
|
|
44
|
+
}`;
|
|
45
|
+
/**
|
|
46
|
+
* The show-password button comes alive (`reveal` on the field): the eye blinks and a stroke crosses it out, or the
|
|
47
|
+
* field goes dark and the eye lights the password like a torch. Under reduced motion it just swaps.
|
|
48
|
+
*/
|
|
49
|
+
export function inputReveal(options = {}) {
|
|
50
|
+
const kind = options.kind ?? "eye";
|
|
51
|
+
return defineForm(ID, CSS, {
|
|
52
|
+
vars: { [varName(ID, "time")]: `${options.duration ?? 0.3}s` },
|
|
53
|
+
layers: kind === "flashlight" ? [{ slot: "fill", children: ["beam"] }] : [],
|
|
54
|
+
needs: { tool: "reveal" },
|
|
55
|
+
});
|
|
56
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const INPUT_REVEAL_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const INPUT_REVEAL_SCHEMA = defineSchema()({
|
|
3
|
+
id: "inputReveal",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "inputReveal",
|
|
6
|
+
fields: {
|
|
7
|
+
kind: {
|
|
8
|
+
kind: "choice",
|
|
9
|
+
label: "Look",
|
|
10
|
+
values: ["eye", "flashlight"],
|
|
11
|
+
labels: { eye: "Eye blinks, crossed out", flashlight: "Flashlight beam" },
|
|
12
|
+
default: "eye",
|
|
13
|
+
},
|
|
14
|
+
duration: { kind: "number", label: "Duration", min: 0.1, max: 0.8, step: 0.05, unit: "s", default: 0.3 },
|
|
15
|
+
},
|
|
16
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface InputRingOptions {
|
|
3
|
+
/** The ring's colour. Default the accent at 80%. */
|
|
4
|
+
readonly color?: string;
|
|
5
|
+
/** Its width, px. Default `4`. */
|
|
6
|
+
readonly width?: number;
|
|
7
|
+
/** `"grow"`: it grows out from the field. `"shrink"`: it starts wide and shrinks onto it (macOS). Default `"grow"`. */
|
|
8
|
+
readonly kind?: "grow" | "shrink";
|
|
9
|
+
/** Seconds it takes. Default `0.25`. */
|
|
10
|
+
readonly duration?: number;
|
|
11
|
+
}
|
|
12
|
+
/** A soft ring grows out from the field, or shrinks onto it, on focus. */
|
|
13
|
+
export declare function inputRing(options?: InputRingOptions): FormEffect;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { at, defineForm, layerOf, timed, v, varName, whenFocused } from "../kit.js";
|
|
2
|
+
import { ringOff } from "../ring.js";
|
|
3
|
+
const ID = "inputRing";
|
|
4
|
+
const LAYER = layerOf(ID);
|
|
5
|
+
// A soft ring outside the box, beside the base focus outline (never in place of it). It moves with `scale` and fades
|
|
6
|
+
// with `opacity`: the ring's width itself never animates (atlas: no animated box-shadow).
|
|
7
|
+
const CSS = ` ${at(LAYER)} {
|
|
8
|
+
inset: calc(-1 * (var(--sx-field-bw) + ${v(ID, "width")} * 1px));
|
|
9
|
+
border: calc(${v(ID, "width")} * 1px) solid ${v(ID, "color")};
|
|
10
|
+
opacity: 0;
|
|
11
|
+
scale: ${v(ID, "from")};
|
|
12
|
+
${timed(ID, "opacity, scale")}
|
|
13
|
+
}
|
|
14
|
+
${whenFocused(ID, LAYER, "opacity: 1; scale: 1;")}`;
|
|
15
|
+
/** A soft ring grows out from the field, or shrinks onto it, on focus. */
|
|
16
|
+
export function inputRing(options = {}) {
|
|
17
|
+
return defineForm(ID, CSS, {
|
|
18
|
+
marksFocus: ringOff(ID),
|
|
19
|
+
vars: {
|
|
20
|
+
[varName(ID, "color")]: options.color ?? "color-mix(in oklab, var(--color-sx-accent) 80%, transparent)",
|
|
21
|
+
[varName(ID, "width")]: options.width ?? 4,
|
|
22
|
+
[varName(ID, "from")]: (options.kind ?? "grow") === "grow" ? 0.97 : 1.06,
|
|
23
|
+
[varName(ID, "time")]: `${options.duration ?? 0.25}s`,
|
|
24
|
+
},
|
|
25
|
+
layers: [{ slot: "edge" }],
|
|
26
|
+
});
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const INPUT_RING_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const INPUT_RING_SCHEMA = defineSchema()({
|
|
3
|
+
id: "inputRing",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "inputRing",
|
|
6
|
+
fields: {
|
|
7
|
+
kind: { kind: "choice", label: "Motion", values: ["grow", "shrink"], labels: { grow: "Grows out", shrink: "Shrinks on" }, default: "grow" },
|
|
8
|
+
color: { kind: "color", label: "Colour", default: "color-mix(in oklab, var(--color-sx-accent) 80%, transparent)" },
|
|
9
|
+
width: { kind: "number", label: "Width", min: 2, max: 8, step: 1, unit: "px", default: 4 },
|
|
10
|
+
duration: { kind: "number", label: "Duration", min: 0.1, max: 0.6, step: 0.05, unit: "s", default: 0.25 },
|
|
11
|
+
},
|
|
12
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface InputRiseOptions {
|
|
3
|
+
/** The colour that rises. Keep it light: the text sits on it. Default the accent at 45%. */
|
|
4
|
+
readonly color?: string;
|
|
5
|
+
/** Seconds it takes. Default `0.35`. */
|
|
6
|
+
readonly duration?: number;
|
|
7
|
+
}
|
|
8
|
+
/** A colour rises from the bottom and fills the field on focus (Codrops' Jiro). */
|
|
9
|
+
export declare function inputRise(options?: InputRiseOptions): FormEffect;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { at, defineForm, layerOf, timed, v, varName, whenFocused } from "../kit.js";
|
|
2
|
+
import { ringOff } from "../ring.js";
|
|
3
|
+
const ID = "inputRise";
|
|
4
|
+
const LAYER = layerOf(ID);
|
|
5
|
+
const CSS = ` ${at(LAYER)} {
|
|
6
|
+
background: ${v(ID, "color")};
|
|
7
|
+
scale: 1 0;
|
|
8
|
+
transform-origin: 50% 100%;
|
|
9
|
+
${timed(ID, "scale")}
|
|
10
|
+
}
|
|
11
|
+
${whenFocused(ID, LAYER, "scale: 1 1;")}`;
|
|
12
|
+
/** A colour rises from the bottom and fills the field on focus (Codrops' Jiro). */
|
|
13
|
+
export function inputRise(options = {}) {
|
|
14
|
+
return defineForm(ID, CSS, {
|
|
15
|
+
marksFocus: ringOff(ID),
|
|
16
|
+
vars: {
|
|
17
|
+
[varName(ID, "color")]: options.color ?? "color-mix(in oklab, var(--color-sx-accent) 45%, transparent)",
|
|
18
|
+
[varName(ID, "time")]: `${options.duration ?? 0.35}s`,
|
|
19
|
+
},
|
|
20
|
+
layers: [{ slot: "fill" }],
|
|
21
|
+
});
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const INPUT_RISE_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const INPUT_RISE_SCHEMA = defineSchema()({
|
|
3
|
+
id: "inputRise",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "inputRise",
|
|
6
|
+
fields: {
|
|
7
|
+
color: { kind: "color", label: "Colour", default: "color-mix(in oklab, var(--color-sx-accent) 45%, transparent)" },
|
|
8
|
+
duration: { kind: "number", label: "Duration", min: 0.1, max: 1, step: 0.05, unit: "s", default: 0.35 },
|
|
9
|
+
},
|
|
10
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface InputSearchOptions {
|
|
3
|
+
/** The closed field's width, rem: about its icon and padding. Default `2.75`. */
|
|
4
|
+
readonly closed?: number;
|
|
5
|
+
/** Seconds it takes to open. Default `0.35`. */
|
|
6
|
+
readonly duration?: number;
|
|
7
|
+
}
|
|
8
|
+
/** A search icon opens into a full field on focus, and closes again when left empty. Give the field an `icon`. */
|
|
9
|
+
export declare function inputSearch(options?: InputSearchOptions): FormEffect;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { RAISED, at, boxOf, defineForm, inField, labelOf, timed, v, varName } from "../kit.js";
|
|
2
|
+
const ID = "inputSearch";
|
|
3
|
+
const BOX = boxOf(ID);
|
|
4
|
+
// The box is as wide as its icon until the field has the focus or text, inside the field's own width (so a width you
|
|
5
|
+
// set on the field still holds the room). The label is only for screen readers: the icon says "search". The width
|
|
6
|
+
// changes, which re-lays out one box: the atlas accepts it.
|
|
7
|
+
const STATE = ` ${at(BOX)} {
|
|
8
|
+
justify-self: start;
|
|
9
|
+
inline-size: calc(${v(ID, "closed")} * 1rem);
|
|
10
|
+
max-inline-size: 100%;
|
|
11
|
+
}
|
|
12
|
+
${at(inField(ID, RAISED, BOX))} {
|
|
13
|
+
inline-size: 100%;
|
|
14
|
+
}
|
|
15
|
+
${at(labelOf(ID))} {
|
|
16
|
+
position: absolute;
|
|
17
|
+
inline-size: 1px;
|
|
18
|
+
block-size: 1px;
|
|
19
|
+
margin: 0;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
clip-path: inset(50%);
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
}`;
|
|
24
|
+
const CSS = ` ${at(BOX)} {
|
|
25
|
+
${timed(ID, "inline-size")}
|
|
26
|
+
}`;
|
|
27
|
+
/** A search icon opens into a full field on focus, and closes again when left empty. Give the field an `icon`. */
|
|
28
|
+
export function inputSearch(options = {}) {
|
|
29
|
+
return defineForm(ID, CSS, {
|
|
30
|
+
state: STATE,
|
|
31
|
+
vars: {
|
|
32
|
+
[varName(ID, "closed")]: options.closed ?? 2.75,
|
|
33
|
+
[varName(ID, "time")]: `${options.duration ?? 0.35}s`,
|
|
34
|
+
},
|
|
35
|
+
claims: ["label"],
|
|
36
|
+
});
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const INPUT_SEARCH_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const INPUT_SEARCH_SCHEMA = defineSchema()({
|
|
3
|
+
id: "inputSearch",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "inputSearch",
|
|
6
|
+
fields: {
|
|
7
|
+
closed: { kind: "number", label: "Closed width", min: 2, max: 6, step: 0.25, unit: "rem", default: 2.75 },
|
|
8
|
+
duration: { kind: "number", label: "Duration", min: 0.1, max: 1, step: 0.05, unit: "s", default: 0.35 },
|
|
9
|
+
},
|
|
10
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface InputSkeletonOptions {
|
|
3
|
+
/** Seconds for one sweep of the shine. Default `1.4`. */
|
|
4
|
+
readonly duration?: number;
|
|
5
|
+
}
|
|
6
|
+
/** A shimmering placeholder covers the field while its value loads: set `busy` on the field. */
|
|
7
|
+
export declare function inputSkeleton(options?: InputSkeletonOptions): FormEffect;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { BUSY, DIR, at, childOf, defineForm, inField, layerOf, loopPaused, v, varName } from "../kit.js";
|
|
2
|
+
const ID = "inputSkeleton";
|
|
3
|
+
const LAYER = layerOf(ID);
|
|
4
|
+
const SHINE = childOf(ID, "shine");
|
|
5
|
+
// The grey placeholder is a state: while `busy`, it covers the field even under reduced motion. Only the shine moves:
|
|
6
|
+
// a band half the field wide crosses it in reading direction with `translate`.
|
|
7
|
+
const STATE = ` ${at(LAYER)} {
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
background: color-mix(in oklab, var(--color-sx-ink) 8%, var(--color-sx-secondary));
|
|
10
|
+
opacity: 0;
|
|
11
|
+
visibility: hidden;
|
|
12
|
+
}
|
|
13
|
+
${at(inField(ID, BUSY, LAYER))} {
|
|
14
|
+
opacity: 1;
|
|
15
|
+
visibility: visible;
|
|
16
|
+
}
|
|
17
|
+
${at(SHINE)} {
|
|
18
|
+
position: absolute;
|
|
19
|
+
inset-block: 0;
|
|
20
|
+
inset-inline-start: 0;
|
|
21
|
+
inline-size: 50%;
|
|
22
|
+
background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--color-sx-secondary) 75%, transparent), transparent);
|
|
23
|
+
translate: calc(-100% * ${DIR}) 0;
|
|
24
|
+
}`;
|
|
25
|
+
const CSS = ` ${at(inField(ID, BUSY, SHINE))} {
|
|
26
|
+
animation: sx-form-inputSkeleton ${v(ID, "time")} linear infinite;
|
|
27
|
+
}
|
|
28
|
+
${loopPaused(SHINE)}
|
|
29
|
+
@keyframes sx-form-inputSkeleton {
|
|
30
|
+
from { translate: calc(-100% * ${DIR}) 0; }
|
|
31
|
+
to { translate: calc(200% * ${DIR}) 0; }
|
|
32
|
+
}`;
|
|
33
|
+
/** A shimmering placeholder covers the field while its value loads: set `busy` on the field. */
|
|
34
|
+
export function inputSkeleton(options = {}) {
|
|
35
|
+
return defineForm(ID, CSS, {
|
|
36
|
+
state: STATE,
|
|
37
|
+
vars: { [varName(ID, "time")]: `${options.duration ?? 1.4}s` },
|
|
38
|
+
layers: [{ slot: "edge", children: ["shine"], keep: true }],
|
|
39
|
+
needs: { inView: true },
|
|
40
|
+
});
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const INPUT_SKELETON_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const INPUT_SKELETON_SCHEMA = defineSchema()({
|
|
3
|
+
id: "inputSkeleton",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "inputSkeleton",
|
|
6
|
+
fields: {
|
|
7
|
+
duration: { kind: "number", label: "One sweep", min: 0.6, max: 3, step: 0.1, unit: "s", default: 1.4 },
|
|
8
|
+
},
|
|
9
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface InputSpotlightOptions {
|
|
3
|
+
/** How visible the other fields stay, 0.2 to 0.8. Default `0.4`. */
|
|
4
|
+
readonly dim?: number;
|
|
5
|
+
/** Seconds it takes. Default `0.3`. */
|
|
6
|
+
readonly duration?: number;
|
|
7
|
+
}
|
|
8
|
+
/** The other fields of the form dim while one has the focus (Codrops' Kyo). Put it on every field of the form. */
|
|
9
|
+
export declare function inputSpotlight(options?: InputSpotlightOptions): FormEffect;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { at, defineForm, fieldOf, timed, v, varName } from "../kit.js";
|
|
2
|
+
const ID = "inputSpotlight";
|
|
3
|
+
const SELF = fieldOf(ID);
|
|
4
|
+
// The fields that wear it dim while another one in the same form (or fieldset, or `data-sx-spotlight` box) has the
|
|
5
|
+
// focus. Opacity only.
|
|
6
|
+
const CSS = ` ${at(SELF)} {
|
|
7
|
+
${timed(ID, "opacity")}
|
|
8
|
+
}
|
|
9
|
+
:where(:is(form, fieldset, [data-sx-spotlight]):has(${SELF}:focus-within) ${SELF}:not(:focus-within)) {
|
|
10
|
+
opacity: ${v(ID, "dim")};
|
|
11
|
+
}`;
|
|
12
|
+
/** The other fields of the form dim while one has the focus (Codrops' Kyo). Put it on every field of the form. */
|
|
13
|
+
export function inputSpotlight(options = {}) {
|
|
14
|
+
return defineForm(ID, CSS, {
|
|
15
|
+
vars: {
|
|
16
|
+
[varName(ID, "dim")]: options.dim ?? 0.4,
|
|
17
|
+
[varName(ID, "time")]: `${options.duration ?? 0.3}s`,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const INPUT_SPOTLIGHT_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const INPUT_SPOTLIGHT_SCHEMA = defineSchema()({
|
|
3
|
+
id: "inputSpotlight",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "inputSpotlight",
|
|
6
|
+
fields: {
|
|
7
|
+
dim: { kind: "number", label: "Others stay at", min: 0.2, max: 0.8, step: 0.05, default: 0.4 },
|
|
8
|
+
duration: { kind: "number", label: "Duration", min: 0.1, max: 1, step: 0.05, unit: "s", default: 0.3 },
|
|
9
|
+
},
|
|
10
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface InputStrengthOptions {
|
|
3
|
+
/** Seconds each bar takes to fill. Default `0.35`. */
|
|
4
|
+
readonly duration?: number;
|
|
5
|
+
/** Seconds between one bar and the next. Default `0.06`. */
|
|
6
|
+
readonly stagger?: number;
|
|
7
|
+
}
|
|
8
|
+
/** The strength meter's bars fill one after another, with a little overshoot, and the new word drops in (`strength`). */
|
|
9
|
+
export declare function inputStrength(options?: InputStrengthOptions): FormEffect;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { SPRING, at, defineForm, fieldOf, timed, v, varName } from "../kit.js";
|
|
2
|
+
const ID = "inputStrength";
|
|
3
|
+
const FIELD = fieldOf(ID);
|
|
4
|
+
const FILL = `${FIELD} [data-sx-field-bar] > span`;
|
|
5
|
+
const WORD = `${FIELD} [data-sx-field-level] > span`;
|
|
6
|
+
// The bars and their colours are the field's (`strength`), so the meter reads the same under reduced motion. This
|
|
7
|
+
// effect only moves them: each bar fills one after another with a little overshoot, and a new word drops in.
|
|
8
|
+
const CSS = ` ${at(FILL)} {
|
|
9
|
+
${timed(ID, "scale", SPRING)}
|
|
10
|
+
transition-delay: calc(var(--sx-field-i, 0) * ${v(ID, "stagger")});
|
|
11
|
+
}
|
|
12
|
+
${at(WORD)} {
|
|
13
|
+
transition: opacity ${v(ID, "time")} ease-out, translate ${v(ID, "time")} ease-out;
|
|
14
|
+
}
|
|
15
|
+
@starting-style {
|
|
16
|
+
${at(WORD)} {
|
|
17
|
+
opacity: 0;
|
|
18
|
+
translate: 0 0.5em;
|
|
19
|
+
}
|
|
20
|
+
}`;
|
|
21
|
+
/** The strength meter's bars fill one after another, with a little overshoot, and the new word drops in (`strength`). */
|
|
22
|
+
export function inputStrength(options = {}) {
|
|
23
|
+
return defineForm(ID, CSS, {
|
|
24
|
+
vars: {
|
|
25
|
+
[varName(ID, "time")]: `${options.duration ?? 0.35}s`,
|
|
26
|
+
[varName(ID, "stagger")]: `${options.stagger ?? 0.06}s`,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const INPUT_STRENGTH_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const INPUT_STRENGTH_SCHEMA = defineSchema()({
|
|
3
|
+
id: "inputStrength",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "inputStrength",
|
|
6
|
+
fields: {
|
|
7
|
+
duration: { kind: "number", label: "Each bar", min: 0.1, max: 0.8, step: 0.05, unit: "s", default: 0.35 },
|
|
8
|
+
stagger: { kind: "number", label: "Between bars", min: 0, max: 0.2, step: 0.01, unit: "s", default: 0.06 },
|
|
9
|
+
},
|
|
10
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface InputSwapOptions {
|
|
3
|
+
/** The words that roll in. Default the label again, in the new colour. */
|
|
4
|
+
readonly text?: string;
|
|
5
|
+
/** Their colour. Default `var(--color-sx-primary)`. */
|
|
6
|
+
readonly color?: string;
|
|
7
|
+
/** Seconds it takes. Default `0.3`. */
|
|
8
|
+
readonly duration?: number;
|
|
9
|
+
}
|
|
10
|
+
/** The label's words roll up, and other words (or a coloured copy) roll in, on focus (Codrops' Isao, Yoshiko, Chisato). */
|
|
11
|
+
export declare function inputSwap(options?: InputSwapOptions): FormEffect;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { at, defineForm, labelOf, layerOf, textOf, timed, v, varName, whenFocused } from "../kit.js";
|
|
2
|
+
const ID = "inputSwap";
|
|
3
|
+
const LABEL = labelOf(ID);
|
|
4
|
+
const TEXT = textOf(ID);
|
|
5
|
+
const ALT = layerOf(ID);
|
|
6
|
+
// The label's words and the second copy share one grid cell, clipped: the words roll up out of it while the copy rolls
|
|
7
|
+
// up into it. The copy is hidden from screen readers, so the field's name never changes. Its resting place is in the
|
|
8
|
+
// motion sheet, not the state sheet: the state sheet loads after it and would beat the focus rule. Under reduced motion
|
|
9
|
+
// the copy is hidden anyway.
|
|
10
|
+
const STATE = ` ${at(LABEL)} {
|
|
11
|
+
display: inline-grid;
|
|
12
|
+
overflow: clip;
|
|
13
|
+
}
|
|
14
|
+
${at(`${TEXT}, ${ALT}`)} {
|
|
15
|
+
grid-area: 1 / 1;
|
|
16
|
+
}
|
|
17
|
+
${at(ALT)} {
|
|
18
|
+
color: ${v(ID, "color")};
|
|
19
|
+
}`;
|
|
20
|
+
const CSS = ` ${at(ALT)} {
|
|
21
|
+
translate: 0 110%;
|
|
22
|
+
}
|
|
23
|
+
${at(`${TEXT}, ${ALT}`)} {
|
|
24
|
+
${timed(ID, "translate")}
|
|
25
|
+
}
|
|
26
|
+
${whenFocused(ID, TEXT, "translate: 0 -110%;")}
|
|
27
|
+
${whenFocused(ID, ALT, "translate: 0 0;")}`;
|
|
28
|
+
/** The label's words roll up, and other words (or a coloured copy) roll in, on focus (Codrops' Isao, Yoshiko, Chisato). */
|
|
29
|
+
export function inputSwap(options = {}) {
|
|
30
|
+
return defineForm(ID, CSS, {
|
|
31
|
+
state: STATE,
|
|
32
|
+
vars: {
|
|
33
|
+
[varName(ID, "color")]: options.color ?? "var(--color-sx-primary)",
|
|
34
|
+
[varName(ID, "time")]: `${options.duration ?? 0.3}s`,
|
|
35
|
+
},
|
|
36
|
+
layers: [options.text === undefined ? { slot: "label", copy: true } : { slot: "label", text: options.text }],
|
|
37
|
+
label: { wrap: true },
|
|
38
|
+
});
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const INPUT_SWAP_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const INPUT_SWAP_SCHEMA = defineSchema()({
|
|
3
|
+
id: "inputSwap",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "inputSwap",
|
|
6
|
+
fields: {
|
|
7
|
+
text: { kind: "text", label: "Words that roll in", autoNote: "the label again, in the new colour" },
|
|
8
|
+
color: { kind: "color", label: "Their colour", default: "var(--color-sx-primary)" },
|
|
9
|
+
duration: { kind: "number", label: "Duration", min: 0.1, max: 0.8, step: 0.05, unit: "s", default: 0.3 },
|
|
10
|
+
},
|
|
11
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface InputUnderlineOptions {
|
|
3
|
+
/** The line's colour. Default `var(--color-sx-primary)`. */
|
|
4
|
+
readonly color?: string;
|
|
5
|
+
/** Its thickness, px. Default `2`. */
|
|
6
|
+
readonly thickness?: number;
|
|
7
|
+
/** Where it grows from, in reading direction, or from where the field was clicked (`"pointer"`). Default `"start"`. */
|
|
8
|
+
readonly from?: "start" | "center" | "end" | "pointer";
|
|
9
|
+
/** Seconds it takes. Default `0.3`. */
|
|
10
|
+
readonly duration?: number;
|
|
11
|
+
}
|
|
12
|
+
/** A line grows along the bottom edge on focus (Codrops' Hoshi; Material's line ripple with `from: "pointer"`). */
|
|
13
|
+
export declare function inputUnderline(options?: InputUnderlineOptions): FormEffect;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { DIR, at, defineForm, layerOf, timed, v, varName, whenFocused } from "../kit.js";
|
|
2
|
+
import { ringOff } from "../ring.js";
|
|
3
|
+
const ID = "inputUnderline";
|
|
4
|
+
const LAYER = layerOf(ID);
|
|
5
|
+
const CSS = ` ${at(LAYER)} {
|
|
6
|
+
inset-block-start: auto;
|
|
7
|
+
block-size: calc(${v(ID, "thickness")} * 1px);
|
|
8
|
+
border-radius: 0;
|
|
9
|
+
background: ${v(ID, "color")};
|
|
10
|
+
scale: 0 1;
|
|
11
|
+
transform-origin: ${v(ID, "origin")} 50%;
|
|
12
|
+
${timed(ID, "scale")}
|
|
13
|
+
}
|
|
14
|
+
${whenFocused(ID, LAYER, "scale: 1 1;")}`;
|
|
15
|
+
/** Where the line grows from: a side in reading direction, the centre, or the press (keyboard focus: the centre). */
|
|
16
|
+
function originOf(from) {
|
|
17
|
+
if (from === "pointer")
|
|
18
|
+
return "calc(var(--sx-field-ox, 0.5) * 100%)";
|
|
19
|
+
const at = from === "start" ? 0 : from === "end" ? 1 : 0.5;
|
|
20
|
+
return `calc(50% + ${DIR} * ${at - 0.5} * 100%)`;
|
|
21
|
+
}
|
|
22
|
+
/** A line grows along the bottom edge on focus (Codrops' Hoshi; Material's line ripple with `from: "pointer"`). */
|
|
23
|
+
export function inputUnderline(options = {}) {
|
|
24
|
+
const from = options.from ?? "start";
|
|
25
|
+
return defineForm(ID, CSS, {
|
|
26
|
+
marksFocus: ringOff(ID),
|
|
27
|
+
vars: {
|
|
28
|
+
[varName(ID, "color")]: options.color ?? "var(--color-sx-primary)",
|
|
29
|
+
[varName(ID, "thickness")]: options.thickness ?? 2,
|
|
30
|
+
[varName(ID, "origin")]: originOf(from),
|
|
31
|
+
[varName(ID, "time")]: `${options.duration ?? 0.3}s`,
|
|
32
|
+
},
|
|
33
|
+
layers: [{ slot: "edge" }],
|
|
34
|
+
needs: from === "pointer" ? { origin: true } : {},
|
|
35
|
+
});
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const INPUT_UNDERLINE_SCHEMA: import("../../../schema/types.js").Schema;
|