@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 @@
|
|
|
1
|
+
export declare const RANGE_TICKS_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const RANGE_TICKS_SCHEMA = defineSchema()({
|
|
3
|
+
id: "rangeTicks",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "rangeTicks",
|
|
6
|
+
fields: {
|
|
7
|
+
count: {
|
|
8
|
+
kind: "number",
|
|
9
|
+
label: "Gaps",
|
|
10
|
+
min: 1,
|
|
11
|
+
max: 40,
|
|
12
|
+
step: 1,
|
|
13
|
+
autoNote: "Every step up to 20 steps, else the most up to 20 that land on steps.",
|
|
14
|
+
autoValue: 10,
|
|
15
|
+
},
|
|
16
|
+
color: { kind: "color", label: "Colour", default: "var(--color-sx-muted)" },
|
|
17
|
+
},
|
|
18
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// The rule an effect that marks the focus carries, so the field's own outline steps aside for it. Imported only by those
|
|
2
|
+
// effects, so a page without one downloads none of it.
|
|
3
|
+
import { at, fieldOf } from "./kit.js";
|
|
4
|
+
/**
|
|
5
|
+
* Drops the field's focus outline (`focusRing="always"` keeps it), except under reduced motion, where the effect's layers
|
|
6
|
+
* step aside, and under forced colours.
|
|
7
|
+
*/
|
|
8
|
+
export const ringOff = (id) => ` @media (prefers-reduced-motion: no-preference) and (forced-colors: none) {
|
|
9
|
+
${at(`${fieldOf(id)}:not([data-sx-ring="always"])`)} {
|
|
10
|
+
--sx-field-ring-style: none;
|
|
11
|
+
}
|
|
12
|
+
}`;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface StepProgressOptions {
|
|
3
|
+
/** The progress's colour. Default `var(--color-sx-primary)`. */
|
|
4
|
+
readonly color?: string;
|
|
5
|
+
/** Seconds the rail takes to fill to the next step. Default `0.4`. */
|
|
6
|
+
readonly duration?: number;
|
|
7
|
+
}
|
|
8
|
+
/** The progress rail fills smoothly, finished steps' checks draw themselves, the new current step pops. */
|
|
9
|
+
export declare function stepProgress(options?: StepProgressOptions): FormEffect;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { EASE, SPRING, STEP_MARK, at, defineForm, stepsOf, v, varName } from "../kit.js";
|
|
2
|
+
const ID = "stepProgress";
|
|
3
|
+
const ROOT = stepsOf(ID);
|
|
4
|
+
const DOT = "[data-sx-step-dot]";
|
|
5
|
+
// The progress (FormSteps.Progress) shows where you are as a state: marks, a rail filled to the current one, a check on
|
|
6
|
+
// each step done. This makes the rail fill smoothly, a finished step's number give way to a check that draws itself,
|
|
7
|
+
// and the new current mark pop, once the user has moved.
|
|
8
|
+
const STATE = ` ${at(ROOT)} {
|
|
9
|
+
--sx-steps-color: ${v(ID, "color")};
|
|
10
|
+
}`;
|
|
11
|
+
const CSS = ` ${at(`${ROOT} [data-sx-steps-fill]`)} {
|
|
12
|
+
transition: scale ${v(ID, "time")} ${EASE};
|
|
13
|
+
}
|
|
14
|
+
${at(`${ROOT} ${DOT} path`)} {
|
|
15
|
+
transition: stroke-dashoffset 0.3s ${EASE} calc(${v(ID, "time")} * 0.6);
|
|
16
|
+
}
|
|
17
|
+
${at(`${ROOT} [data-sx-step-number]`)} {
|
|
18
|
+
transition: opacity 0.15s ${EASE} calc(${v(ID, "time")} * 0.5);
|
|
19
|
+
}
|
|
20
|
+
${at(`${ROOT}[data-sx-moved] ${STEP_MARK}[aria-current="step"] ${DOT}`)} {
|
|
21
|
+
animation: sx-form-stepProgress-pop 0.4s ${SPRING} calc(${v(ID, "time")} * 0.6) both;
|
|
22
|
+
}
|
|
23
|
+
@keyframes sx-form-stepProgress-pop {
|
|
24
|
+
from {
|
|
25
|
+
scale: 0.8;
|
|
26
|
+
}
|
|
27
|
+
}`;
|
|
28
|
+
/** The progress rail fills smoothly, finished steps' checks draw themselves, the new current step pops. */
|
|
29
|
+
export function stepProgress(options = {}) {
|
|
30
|
+
return defineForm(ID, CSS, {
|
|
31
|
+
fits: ["steps"],
|
|
32
|
+
state: STATE,
|
|
33
|
+
vars: { [varName(ID, "color")]: options.color ?? "var(--color-sx-primary)", [varName(ID, "time")]: `${options.duration ?? 0.4}s` },
|
|
34
|
+
});
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const STEP_PROGRESS_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const STEP_PROGRESS_SCHEMA = defineSchema()({
|
|
3
|
+
id: "stepProgress",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "stepProgress",
|
|
6
|
+
fields: {
|
|
7
|
+
color: { kind: "color", label: "Colour", default: "var(--color-sx-primary)" },
|
|
8
|
+
duration: { kind: "number", label: "Duration", min: 0.15, max: 0.8, step: 0.05, unit: "s", default: 0.4 },
|
|
9
|
+
},
|
|
10
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface StepSlideOptions {
|
|
3
|
+
/** How far a step slides, in rem. Default `3`. */
|
|
4
|
+
readonly distance?: number;
|
|
5
|
+
/** Seconds it takes. Default `0.35`. */
|
|
6
|
+
readonly duration?: number;
|
|
7
|
+
}
|
|
8
|
+
/** Steps slide in from the end and out toward the start (back the other way), or rise and fall one question at a time. */
|
|
9
|
+
export declare function stepSlide(options?: StepSlideOptions): FormEffect;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { DIR, EASE, STEP, at, defineForm, stepsOf, v, varName } from "../kit.js";
|
|
2
|
+
const ID = "stepSlide";
|
|
3
|
+
const ROOT = stepsOf(ID);
|
|
4
|
+
const WAY = "var(--sx-steps-way)";
|
|
5
|
+
// Next: the step leaves toward the start and the new one comes in from the end; Back: the other way round. Forward
|
|
6
|
+
// always feels forward, in either reading direction (--sx-form-dir). In the one-question mode the steps rise and fall
|
|
7
|
+
// instead. Only once the user has moved (data-sx-moved): nothing plays on load.
|
|
8
|
+
const CSS = ` ${at(`${ROOT}[data-sx-moved] ${STEP}[data-sx-active]`)} {
|
|
9
|
+
animation: sx-form-stepSlide-in ${v(ID, "time")} ${EASE} both;
|
|
10
|
+
}
|
|
11
|
+
${at(`${ROOT} ${STEP}[data-sx-leaving]`)} {
|
|
12
|
+
animation: sx-form-stepSlide-out ${v(ID, "time")} ${EASE} both;
|
|
13
|
+
}
|
|
14
|
+
${at(`${ROOT}[data-sx-mode="focus"][data-sx-moved] ${STEP}[data-sx-active]`)} {
|
|
15
|
+
animation-name: sx-form-stepSlide-rise;
|
|
16
|
+
}
|
|
17
|
+
${at(`${ROOT}[data-sx-mode="focus"] ${STEP}[data-sx-leaving]`)} {
|
|
18
|
+
animation-name: sx-form-stepSlide-sink;
|
|
19
|
+
}
|
|
20
|
+
@keyframes sx-form-stepSlide-in {
|
|
21
|
+
from {
|
|
22
|
+
translate: calc(${v(ID, "distance")} * ${DIR} * ${WAY}) 0;
|
|
23
|
+
opacity: 0;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
@keyframes sx-form-stepSlide-out {
|
|
27
|
+
to {
|
|
28
|
+
translate: calc(${v(ID, "distance")} * ${DIR} * ${WAY} * -1) 0;
|
|
29
|
+
opacity: 0;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
@keyframes sx-form-stepSlide-rise {
|
|
33
|
+
from {
|
|
34
|
+
translate: 0 calc(${v(ID, "distance")} * ${WAY});
|
|
35
|
+
opacity: 0;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
@keyframes sx-form-stepSlide-sink {
|
|
39
|
+
to {
|
|
40
|
+
translate: 0 calc(${v(ID, "distance")} * ${WAY} * -1);
|
|
41
|
+
opacity: 0;
|
|
42
|
+
}
|
|
43
|
+
}`;
|
|
44
|
+
/** Steps slide in from the end and out toward the start (back the other way), or rise and fall one question at a time. */
|
|
45
|
+
export function stepSlide(options = {}) {
|
|
46
|
+
return defineForm(ID, CSS, {
|
|
47
|
+
fits: ["steps"],
|
|
48
|
+
vars: { [varName(ID, "distance")]: `${options.distance ?? 3}rem`, [varName(ID, "time")]: `${options.duration ?? 0.35}s` },
|
|
49
|
+
});
|
|
50
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const STEP_SLIDE_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const STEP_SLIDE_SCHEMA = defineSchema()({
|
|
3
|
+
id: "stepSlide",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "stepSlide",
|
|
6
|
+
fields: {
|
|
7
|
+
distance: { kind: "number", label: "Distance", min: 1, max: 8, step: 0.5, unit: "rem", default: 3 },
|
|
8
|
+
duration: { kind: "number", label: "Duration", min: 0.15, max: 0.8, step: 0.05, unit: "s", default: 0.35 },
|
|
9
|
+
},
|
|
10
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface SwitchBulbOptions {
|
|
3
|
+
/** The light's colour. Default a warm yellow. */
|
|
4
|
+
readonly light?: string;
|
|
5
|
+
/** Seconds it takes. Default `0.3`. */
|
|
6
|
+
readonly duration?: number;
|
|
7
|
+
}
|
|
8
|
+
/** The thumb is a bulb: on, it lights up and a warm glow spreads over the track, catching with a stutter. */
|
|
9
|
+
export declare function switchBulb(options?: SwitchBulbOptions): FormEffect;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { CHANGED, CHECKED, at, choiceLayer, defineForm, inItem, switchOf, v, varName } from "../kit.js";
|
|
2
|
+
const ID = "switchBulb";
|
|
3
|
+
const ROOT = switchOf(ID);
|
|
4
|
+
const BULB = `${choiceLayer(ID, "bulb")} [data-sx-choice-svg]`;
|
|
5
|
+
const GLASS = `${choiceLayer(ID, "bulb")} [data-sx-choice-svg="glass"]`;
|
|
6
|
+
const GLOW = choiceLayer(ID, "glow");
|
|
7
|
+
// A lamp: the thumb carries a bulb drawn in lines. On, the glass fills with light and a warm glow spreads over the
|
|
8
|
+
// track around it (a radial gradient that fades in: no blur filter). Switched on by hand, the light stutters once,
|
|
9
|
+
// like a real bulb catching. Lit or not is the state.
|
|
10
|
+
const STATE = ` ${at(BULB)} {
|
|
11
|
+
fill: none;
|
|
12
|
+
stroke: currentColor;
|
|
13
|
+
stroke-width: 1.6;
|
|
14
|
+
stroke-linecap: round;
|
|
15
|
+
stroke-linejoin: round;
|
|
16
|
+
}
|
|
17
|
+
${at(`${choiceLayer(ID, "bulb")}`)} {
|
|
18
|
+
inset: 14%;
|
|
19
|
+
}
|
|
20
|
+
${at(inItem(ROOT, CHECKED, GLASS))} {
|
|
21
|
+
fill: ${v(ID, "light")};
|
|
22
|
+
}
|
|
23
|
+
${at(GLOW)} {
|
|
24
|
+
inset-inline: auto 0;
|
|
25
|
+
inline-size: calc(var(--sx-switch-h) * 1.6);
|
|
26
|
+
border-radius: 999px;
|
|
27
|
+
background: radial-gradient(closest-side, ${v(ID, "light")}, transparent);
|
|
28
|
+
opacity: 0;
|
|
29
|
+
}
|
|
30
|
+
${at(inItem(ROOT, CHECKED, GLOW))} {
|
|
31
|
+
opacity: 0.75;
|
|
32
|
+
}`;
|
|
33
|
+
const CSS = ` ${at(GLOW)} {
|
|
34
|
+
transition: opacity ${v(ID, "time")} ease-out;
|
|
35
|
+
}
|
|
36
|
+
${at(inItem(ROOT, `${CHECKED}${CHANGED}`, GLOW))} {
|
|
37
|
+
animation: sx-form-switchBulb calc(${v(ID, "time")} * 2) linear;
|
|
38
|
+
}
|
|
39
|
+
@keyframes sx-form-switchBulb {
|
|
40
|
+
0% { opacity: 0; }
|
|
41
|
+
20% { opacity: 0.75; }
|
|
42
|
+
30% { opacity: 0.2; }
|
|
43
|
+
45% { opacity: 0.75; }
|
|
44
|
+
55% { opacity: 0.45; }
|
|
45
|
+
100% { opacity: 0.75; }
|
|
46
|
+
}`;
|
|
47
|
+
/** The thumb is a bulb: on, it lights up and a warm glow spreads over the track, catching with a stutter. */
|
|
48
|
+
export function switchBulb(options = {}) {
|
|
49
|
+
return defineForm(ID, CSS, {
|
|
50
|
+
fits: ["switch"],
|
|
51
|
+
state: STATE,
|
|
52
|
+
vars: { [varName(ID, "light")]: options.light ?? "#ffd25c", [varName(ID, "time")]: `${options.duration ?? 0.3}s` },
|
|
53
|
+
layers: [
|
|
54
|
+
{ slot: "box", part: "glow", keep: true },
|
|
55
|
+
{
|
|
56
|
+
slot: "thumb",
|
|
57
|
+
part: "bulb",
|
|
58
|
+
keep: true,
|
|
59
|
+
svg: {
|
|
60
|
+
viewBox: "0 0 24 24",
|
|
61
|
+
children: [
|
|
62
|
+
{ tag: "path", part: "glass", attrs: { d: "M9 17.5v-1.6c0-1.4-.8-2.4-1.7-3.5A6 6 0 1 1 18 8.4c0 1.6-.7 2.9-1.3 4-.9 1.1-1.7 2.1-1.7 3.5v1.6Z" } },
|
|
63
|
+
{ tag: "path", part: "base", attrs: { d: "M9.5 20.5h5" } },
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
claims: ["mark"],
|
|
69
|
+
});
|
|
70
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SWITCH_BULB_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const SWITCH_BULB_SCHEMA = defineSchema()({
|
|
3
|
+
id: "switchBulb",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "switchBulb",
|
|
6
|
+
fields: {
|
|
7
|
+
light: { kind: "color", label: "Light", default: "#ffd25c" },
|
|
8
|
+
duration: { kind: "number", label: "Duration", min: 0.1, max: 0.8, step: 0.05, unit: "s", default: 0.3 },
|
|
9
|
+
},
|
|
10
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface SwitchDayNightOptions {
|
|
3
|
+
/** The sky by day (off). Default a pale sky blue. */
|
|
4
|
+
readonly day?: string;
|
|
5
|
+
/** The sky by night (on). Default a deep blue. */
|
|
6
|
+
readonly night?: string;
|
|
7
|
+
/** The sun. Default a warm yellow. */
|
|
8
|
+
readonly sun?: string;
|
|
9
|
+
/** The moon. Default a pale cream. */
|
|
10
|
+
readonly moon?: string;
|
|
11
|
+
/** Seconds it takes. Default `0.45`. */
|
|
12
|
+
readonly duration?: number;
|
|
13
|
+
}
|
|
14
|
+
/** A day-to-night toggle: the sun turns into a moon, clouds drift off and stars come out. */
|
|
15
|
+
export declare function switchDayNight(options?: SwitchDayNightOptions): FormEffect;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { CHECKED, THUMB, at, choiceChild, choiceLayer, defineForm, inItem, switchOf, v, varName } from "../kit.js";
|
|
2
|
+
const ID = "switchDayNight";
|
|
3
|
+
const ROOT = switchOf(ID);
|
|
4
|
+
const SKY = choiceLayer(ID, "sky");
|
|
5
|
+
const STAR = `${SKY} > [data-sx-choice-part^="star"]`;
|
|
6
|
+
const CLOUD = `${SKY} > [data-sx-choice-part^="cloud"]`;
|
|
7
|
+
const SHADE = choiceLayer(ID, "shade");
|
|
8
|
+
const SPOTS = {
|
|
9
|
+
// the stars sit on the start half, which the thumb leaves when on
|
|
10
|
+
star1: ["24%", "14%", "0.12em"],
|
|
11
|
+
star2: ["60%", "28%", "0.08em"],
|
|
12
|
+
star3: ["30%", "40%", "0.1em"],
|
|
13
|
+
cloud1: ["8%", "55%", "0.7em"],
|
|
14
|
+
cloud2: ["30%", "35%", "0.5em"],
|
|
15
|
+
};
|
|
16
|
+
// For a dark-mode toggle: off is day (a sun on a blue sky with clouds at the free end), on is night (the sun has become
|
|
17
|
+
// a moon by a shadow sliding over it, stars come out where the clouds were). The colours are options, so a theme can
|
|
18
|
+
// bring its own. Which sky shows is the state; the drift and the fades are motion.
|
|
19
|
+
const STATE = ` ${at(ROOT)} {
|
|
20
|
+
--sx-choice-edge: transparent;
|
|
21
|
+
--sx-choice-bg: ${v(ID, "day")};
|
|
22
|
+
--sx-choice-fill: ${v(ID, "night")};
|
|
23
|
+
--sx-switch-thumb: ${v(ID, "sun")};
|
|
24
|
+
--sx-switch-thumb-on: ${v(ID, "moon")};
|
|
25
|
+
}
|
|
26
|
+
${at(`${ROOT} ${THUMB}`)} {
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
}
|
|
29
|
+
${at(SKY)} {
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
}
|
|
32
|
+
${at(`${STAR}, ${CLOUD}`)} {
|
|
33
|
+
position: absolute;
|
|
34
|
+
border-radius: 50%;
|
|
35
|
+
}
|
|
36
|
+
${Object.entries(SPOTS).map(([part, [block, inline, size]]) => ` ${at(choiceChild(ID, part, "sky"))} { inset-block-start: ${block}; inset-inline-start: ${inline}; inline-size: ${size}; block-size: ${size}; }`).join("\n")}
|
|
37
|
+
${at(STAR)} {
|
|
38
|
+
background: ${v(ID, "moon")};
|
|
39
|
+
opacity: 0;
|
|
40
|
+
scale: 0.3;
|
|
41
|
+
}
|
|
42
|
+
${at(CLOUD)} {
|
|
43
|
+
inline-size: calc(var(--sx-switch-h) * 0.9);
|
|
44
|
+
block-size: calc(var(--sx-switch-h) * 0.45);
|
|
45
|
+
inset-inline-start: auto;
|
|
46
|
+
inset-inline-end: 0.3em;
|
|
47
|
+
border-radius: 999px;
|
|
48
|
+
background: var(--color-sx-secondary, Canvas);
|
|
49
|
+
opacity: 0.9;
|
|
50
|
+
}
|
|
51
|
+
${at(`${SKY} > [data-sx-choice-part="cloud2"]`)} {
|
|
52
|
+
inset-inline-end: 0.75em;
|
|
53
|
+
inset-block-start: 22%;
|
|
54
|
+
opacity: 0.6;
|
|
55
|
+
}
|
|
56
|
+
${at(inItem(ROOT, CHECKED, STAR))} {
|
|
57
|
+
opacity: 1;
|
|
58
|
+
scale: 1;
|
|
59
|
+
}
|
|
60
|
+
${at(inItem(ROOT, CHECKED, CLOUD))} {
|
|
61
|
+
opacity: 0;
|
|
62
|
+
translate: 0 120%;
|
|
63
|
+
}
|
|
64
|
+
${at(SHADE)} {
|
|
65
|
+
background: ${v(ID, "night")};
|
|
66
|
+
border-radius: 50%;
|
|
67
|
+
translate: 110% -110%;
|
|
68
|
+
}
|
|
69
|
+
${at(inItem(ROOT, CHECKED, SHADE))} {
|
|
70
|
+
translate: 32% -22%;
|
|
71
|
+
}`;
|
|
72
|
+
const CSS = ` ${at(`${STAR}, ${CLOUD}`)} {
|
|
73
|
+
transition: opacity ${v(ID, "time")} ease-out, scale ${v(ID, "time")} ease-out, translate ${v(ID, "time")} ease-out;
|
|
74
|
+
}
|
|
75
|
+
${at(SHADE)} {
|
|
76
|
+
transition: translate ${v(ID, "time")} ease-in-out;
|
|
77
|
+
}`;
|
|
78
|
+
/** A day-to-night toggle: the sun turns into a moon, clouds drift off and stars come out. */
|
|
79
|
+
export function switchDayNight(options = {}) {
|
|
80
|
+
return defineForm(ID, CSS, {
|
|
81
|
+
fits: ["switch"],
|
|
82
|
+
state: STATE,
|
|
83
|
+
vars: {
|
|
84
|
+
[varName(ID, "day")]: options.day ?? "#8ecdf0",
|
|
85
|
+
[varName(ID, "night")]: options.night ?? "#1d2a4d",
|
|
86
|
+
[varName(ID, "sun")]: options.sun ?? "#ffd25c",
|
|
87
|
+
[varName(ID, "moon")]: options.moon ?? "#f4efd8",
|
|
88
|
+
[varName(ID, "time")]: `${options.duration ?? 0.45}s`,
|
|
89
|
+
},
|
|
90
|
+
layers: [
|
|
91
|
+
{ slot: "box", part: "sky", children: Object.keys(SPOTS), keep: true },
|
|
92
|
+
{ slot: "thumb", part: "shade", keep: true },
|
|
93
|
+
],
|
|
94
|
+
claims: ["mark"],
|
|
95
|
+
});
|
|
96
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SWITCH_DAY_NIGHT_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const SWITCH_DAY_NIGHT_SCHEMA = defineSchema()({
|
|
3
|
+
id: "switchDayNight",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "switchDayNight",
|
|
6
|
+
fields: {
|
|
7
|
+
day: { kind: "color", label: "Day sky", default: "#8ecdf0" },
|
|
8
|
+
night: { kind: "color", label: "Night sky", default: "#1d2a4d" },
|
|
9
|
+
sun: { kind: "color", label: "Sun", default: "#ffd25c" },
|
|
10
|
+
moon: { kind: "color", label: "Moon", default: "#f4efd8" },
|
|
11
|
+
duration: { kind: "number", label: "Duration", min: 0.2, max: 1, step: 0.05, unit: "s", default: 0.45 },
|
|
12
|
+
},
|
|
13
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface SwitchFaceOptions {
|
|
3
|
+
/** Seconds the wake-up takes. Default `0.4`. */
|
|
4
|
+
readonly duration?: number;
|
|
5
|
+
}
|
|
6
|
+
/** A sleeping face wakes up when switched on: eyes open, a smile, a blink. */
|
|
7
|
+
export declare function switchFace(options?: SwitchFaceOptions): FormEffect;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { CHANGED, CHECKED, at, choiceLayer, defineForm, inItem, switchOf, v, varName } from "../kit.js";
|
|
2
|
+
const ID = "switchFace";
|
|
3
|
+
const ROOT = switchOf(ID);
|
|
4
|
+
const FACE = choiceLayer(ID, "face");
|
|
5
|
+
const part = (name) => `${FACE} [data-sx-choice-svg="${name}"]`;
|
|
6
|
+
// Our own little creature, drawn in a few strokes on the thumb. Off, it sleeps: eyes shut, a small round mouth. On, it
|
|
7
|
+
// wakes: eyes open, a smile; woken by hand, it blinks once. Asleep or awake is the state (it holds under reduced
|
|
8
|
+
// motion); the blink and the swaps are motion.
|
|
9
|
+
const STATE = ` ${at(FACE)} {
|
|
10
|
+
inset: 12%;
|
|
11
|
+
}
|
|
12
|
+
${at(`${FACE} [data-sx-choice-svg]`)} {
|
|
13
|
+
fill: none;
|
|
14
|
+
stroke: currentColor;
|
|
15
|
+
stroke-width: 2;
|
|
16
|
+
stroke-linecap: round;
|
|
17
|
+
stroke-linejoin: round;
|
|
18
|
+
}
|
|
19
|
+
${at(part("open"))} {
|
|
20
|
+
fill: currentColor;
|
|
21
|
+
stroke: none;
|
|
22
|
+
opacity: 0;
|
|
23
|
+
transform-box: fill-box;
|
|
24
|
+
transform-origin: center;
|
|
25
|
+
}
|
|
26
|
+
${at(part("smile"))} {
|
|
27
|
+
opacity: 0;
|
|
28
|
+
}
|
|
29
|
+
${at(inItem(ROOT, CHECKED, part("shut")))} {
|
|
30
|
+
opacity: 0;
|
|
31
|
+
}
|
|
32
|
+
${at(inItem(ROOT, CHECKED, part("open")))} {
|
|
33
|
+
opacity: 1;
|
|
34
|
+
}
|
|
35
|
+
${at(inItem(ROOT, CHECKED, part("snore")))} {
|
|
36
|
+
opacity: 0;
|
|
37
|
+
}
|
|
38
|
+
${at(inItem(ROOT, CHECKED, part("smile")))} {
|
|
39
|
+
opacity: 1;
|
|
40
|
+
}`;
|
|
41
|
+
const CSS = ` ${at(`${FACE} [data-sx-choice-svg]`)} {
|
|
42
|
+
transition: opacity ${v(ID, "time")} ease-out;
|
|
43
|
+
}
|
|
44
|
+
${at(inItem(ROOT, `${CHECKED}${CHANGED}`, part("open")))} {
|
|
45
|
+
animation: sx-form-switchFace calc(${v(ID, "time")} * 2) ease-in-out;
|
|
46
|
+
}
|
|
47
|
+
@keyframes sx-form-switchFace {
|
|
48
|
+
0%, 40%, 70%, 100% { scale: 1 1; }
|
|
49
|
+
55% { scale: 1 0.1; }
|
|
50
|
+
}`;
|
|
51
|
+
/** A sleeping face wakes up when switched on: eyes open, a smile, a blink. */
|
|
52
|
+
export function switchFace(options = {}) {
|
|
53
|
+
return defineForm(ID, CSS, {
|
|
54
|
+
fits: ["switch"],
|
|
55
|
+
state: STATE,
|
|
56
|
+
vars: { [varName(ID, "time")]: `${options.duration ?? 0.4}s` },
|
|
57
|
+
layers: [
|
|
58
|
+
{
|
|
59
|
+
slot: "thumb",
|
|
60
|
+
part: "face",
|
|
61
|
+
keep: true,
|
|
62
|
+
svg: {
|
|
63
|
+
viewBox: "0 0 24 24",
|
|
64
|
+
children: [
|
|
65
|
+
{ tag: "path", part: "shut", attrs: { d: "M6.5 10q1.5 1.6 3 0M14.5 10q1.5 1.6 3 0" } },
|
|
66
|
+
{ tag: "path", part: "open", attrs: { d: "M8 10.2a1.5 1.5 0 1 0 0-.01zM16 10.2a1.5 1.5 0 1 0 0-.01z" } },
|
|
67
|
+
{ tag: "circle", part: "snore", attrs: { cx: 12, cy: 16, r: 1.4 } },
|
|
68
|
+
{ tag: "path", part: "smile", attrs: { d: "M8.5 14.5q3.5 3.4 7 0" } },
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
claims: ["mark"],
|
|
74
|
+
});
|
|
75
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SWITCH_FACE_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const SWITCH_FACE_SCHEMA = defineSchema()({
|
|
3
|
+
id: "switchFace",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "switchFace",
|
|
6
|
+
fields: {
|
|
7
|
+
duration: { kind: "number", label: "Duration", min: 0.1, max: 1, step: 0.05, unit: "s", default: 0.4 },
|
|
8
|
+
},
|
|
9
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface SwitchFlipOptions {
|
|
3
|
+
/** Seconds the coin takes to turn over. Default `0.45`. */
|
|
4
|
+
readonly duration?: number;
|
|
5
|
+
}
|
|
6
|
+
/** The thumb is a coin that turns over as it crosses: a cross on one face, a tick on the other. */
|
|
7
|
+
export declare function switchFlip(options?: SwitchFlipOptions): FormEffect;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { CHECKED, THUMB, at, choiceChild, choiceLayer, defineForm, inItem, switchOf, v, varName } from "../kit.js";
|
|
2
|
+
const ID = "switchFlip";
|
|
3
|
+
const ROOT = switchOf(ID);
|
|
4
|
+
const COIN = choiceLayer(ID, "coin");
|
|
5
|
+
const FACE = `${COIN} > [data-sx-choice-part]`;
|
|
6
|
+
const BACK = choiceChild(ID, "back", "coin");
|
|
7
|
+
// The thumb is a coin with a cross on one face and a tick on the other. It turns over in 3D as it crosses the track
|
|
8
|
+
// (a perspective on the thumb, the coin's two faces back to back, each hidden when turned away). Which face shows is the
|
|
9
|
+
// state, so reduced motion still shows the tick; the turn is motion.
|
|
10
|
+
const STATE = ` ${at(`${ROOT} ${THUMB}`)} {
|
|
11
|
+
perspective: 6em;
|
|
12
|
+
}
|
|
13
|
+
${at(COIN)} {
|
|
14
|
+
transform-style: preserve-3d;
|
|
15
|
+
border-radius: 50%;
|
|
16
|
+
}
|
|
17
|
+
${at(inItem(ROOT, CHECKED, COIN))} {
|
|
18
|
+
rotate: y 180deg;
|
|
19
|
+
}
|
|
20
|
+
${at(FACE)} {
|
|
21
|
+
position: absolute;
|
|
22
|
+
inset: 22%;
|
|
23
|
+
backface-visibility: hidden;
|
|
24
|
+
background: currentColor;
|
|
25
|
+
}
|
|
26
|
+
${at(choiceChild(ID, "front", "coin"))} {
|
|
27
|
+
clip-path: polygon(20% 8%, 50% 38%, 80% 8%, 92% 20%, 62% 50%, 92% 80%, 80% 92%, 50% 62%, 20% 92%, 8% 80%, 38% 50%, 8% 20%);
|
|
28
|
+
}
|
|
29
|
+
${at(BACK)} {
|
|
30
|
+
rotate: y 180deg;
|
|
31
|
+
clip-path: polygon(8% 52%, 20% 40%, 40% 60%, 80% 18%, 92% 30%, 40% 84%);
|
|
32
|
+
}`;
|
|
33
|
+
const CSS = ` ${at(COIN)} {
|
|
34
|
+
transition: rotate ${v(ID, "time")} ease-in-out;
|
|
35
|
+
}`;
|
|
36
|
+
/** The thumb is a coin that turns over as it crosses: a cross on one face, a tick on the other. */
|
|
37
|
+
export function switchFlip(options = {}) {
|
|
38
|
+
return defineForm(ID, CSS, {
|
|
39
|
+
fits: ["switch"],
|
|
40
|
+
state: STATE,
|
|
41
|
+
vars: { [varName(ID, "time")]: `${options.duration ?? 0.45}s` },
|
|
42
|
+
layers: [{ slot: "thumb", part: "coin", children: ["front", "back"], keep: true }],
|
|
43
|
+
claims: ["mark"],
|
|
44
|
+
});
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SWITCH_FLIP_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const SWITCH_FLIP_SCHEMA = defineSchema()({
|
|
3
|
+
id: "switchFlip",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "switchFlip",
|
|
6
|
+
fields: {
|
|
7
|
+
duration: { kind: "number", label: "Duration", min: 0.2, max: 1, step: 0.05, unit: "s", default: 0.45 },
|
|
8
|
+
},
|
|
9
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface SwitchGooOptions {
|
|
3
|
+
/** Seconds the drop takes to cross. Default `0.5`. */
|
|
4
|
+
readonly duration?: number;
|
|
5
|
+
}
|
|
6
|
+
/** The thumb is a drop of liquid: it stretches into a bridge as it crosses and snaps round on the other side. */
|
|
7
|
+
export declare function switchGoo(options?: SwitchGooOptions): FormEffect;
|