@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,27 @@
|
|
|
1
|
+
import { BOX, CHECKED, MARK, SPRING, at, choiceOf, defineForm, inItem, v, varName } from "../kit.js";
|
|
2
|
+
const ID = "checkPop";
|
|
3
|
+
const ROOT = choiceOf(ID);
|
|
4
|
+
// A transition, not a keyframe animation, so nothing plays for a box that loads checked: the box shrinks while
|
|
5
|
+
// pressed (pointer or Space) and springs back past its size, and the tick grows into place.
|
|
6
|
+
const CSS = ` ${at(`${ROOT} ${BOX}`)} {
|
|
7
|
+
transition: scale ${v(ID, "time")} ${SPRING};
|
|
8
|
+
}
|
|
9
|
+
${at(`${ROOT}:active ${BOX}`)} {
|
|
10
|
+
scale: ${v(ID, "press")};
|
|
11
|
+
transition-duration: 80ms;
|
|
12
|
+
}
|
|
13
|
+
${at(`${ROOT} ${MARK}`)} {
|
|
14
|
+
scale: 0.5;
|
|
15
|
+
transition: scale ${v(ID, "time")} ${SPRING};
|
|
16
|
+
}
|
|
17
|
+
${at(inItem(ROOT, CHECKED, MARK))} {
|
|
18
|
+
scale: 1;
|
|
19
|
+
}`;
|
|
20
|
+
/** The box squeezes while pressed and springs back past its size; the tick grows in. */
|
|
21
|
+
export function checkPop(options = {}) {
|
|
22
|
+
return defineForm(ID, CSS, {
|
|
23
|
+
fits: ["checkbox"],
|
|
24
|
+
vars: { [varName(ID, "press")]: options.press ?? 0.85, [varName(ID, "time")]: `${options.duration ?? 0.3}s` },
|
|
25
|
+
claims: ["box"],
|
|
26
|
+
});
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CHECK_POP_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const CHECK_POP_SCHEMA = defineSchema()({
|
|
3
|
+
id: "checkPop",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "checkPop",
|
|
6
|
+
fields: {
|
|
7
|
+
press: { kind: "number", label: "Pressed size", min: 0.7, max: 1, step: 0.01, default: 0.85 },
|
|
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,7 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface CheckRippleOptions {
|
|
3
|
+
/** Seconds it takes to grow or fade. Default `0.2`. */
|
|
4
|
+
readonly duration?: number;
|
|
5
|
+
}
|
|
6
|
+
/** A soft disc behind the box answers the mouse, the keyboard's focus and a press (Material's state layer). */
|
|
7
|
+
export declare function checkRipple(options?: CheckRippleOptions): FormEffect;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { CHECKED, KEYED, at, choiceLayer, choiceOf, defineForm, inItem, v, varName, whenItemHover } from "../kit.js";
|
|
2
|
+
const ID = "checkRipple";
|
|
3
|
+
const ROOT = choiceOf(ID);
|
|
4
|
+
const DISC = choiceLayer(ID);
|
|
5
|
+
// Material's state layer: a disc behind the box, in the text's colour (the primary once checked), faint under the
|
|
6
|
+
// mouse, stronger with the keyboard's focus, and a quick swell while pressed. Only opacity and scale move.
|
|
7
|
+
const CSS = ` ${at(DISC)} {
|
|
8
|
+
background: var(--color-sx-ink, currentColor);
|
|
9
|
+
opacity: 0;
|
|
10
|
+
scale: 0.5;
|
|
11
|
+
transition: opacity ${v(ID, "time")} ease-out, scale ${v(ID, "time")} ease-out;
|
|
12
|
+
}
|
|
13
|
+
${at(inItem(ROOT, CHECKED, DISC))} {
|
|
14
|
+
background: var(--color-sx-primary, currentColor);
|
|
15
|
+
}
|
|
16
|
+
${whenItemHover(ROOT, DISC, "opacity: 0.08; scale: 1;")}
|
|
17
|
+
${at(inItem(ROOT, KEYED, DISC))} {
|
|
18
|
+
opacity: 0.14;
|
|
19
|
+
scale: 1;
|
|
20
|
+
}
|
|
21
|
+
${at(`${ROOT}:active ${DISC}`)} {
|
|
22
|
+
opacity: 0.2;
|
|
23
|
+
scale: 1.15;
|
|
24
|
+
transition-duration: 60ms;
|
|
25
|
+
}`;
|
|
26
|
+
/** A soft disc behind the box answers the mouse, the keyboard's focus and a press (Material's state layer). */
|
|
27
|
+
export function checkRipple(options = {}) {
|
|
28
|
+
return defineForm(ID, CSS, {
|
|
29
|
+
fits: ["checkbox"],
|
|
30
|
+
vars: { [varName(ID, "time")]: `${options.duration ?? 0.2}s` },
|
|
31
|
+
layers: [{ slot: "halo" }],
|
|
32
|
+
});
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CHECK_RIPPLE_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const CHECK_RIPPLE_SCHEMA = defineSchema()({
|
|
3
|
+
id: "checkRipple",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "checkRipple",
|
|
6
|
+
fields: {
|
|
7
|
+
duration: { kind: "number", label: "Duration", min: 0.05, max: 0.5, step: 0.05, unit: "s", default: 0.2 },
|
|
8
|
+
},
|
|
9
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface CheckScribbleOptions {
|
|
3
|
+
/** A loose hand-drawn tick, or a cross. Default `"check"`. */
|
|
4
|
+
readonly kind?: "check" | "cross";
|
|
5
|
+
/** The ink. Default `var(--color-sx-primary)`. */
|
|
6
|
+
readonly color?: string;
|
|
7
|
+
/** Seconds to draw it. Default `0.4`. */
|
|
8
|
+
readonly duration?: number;
|
|
9
|
+
}
|
|
10
|
+
/** A loose hand-drawn tick, or a cross, scribbles itself over the box. */
|
|
11
|
+
export declare function checkScribble(options?: CheckScribbleOptions): FormEffect;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CHECKED, MARK, at, choiceLayer, choiceOf, defineForm, inItem, v, varName } from "../kit.js";
|
|
2
|
+
const ID = "checkScribble";
|
|
3
|
+
const ROOT = choiceOf(ID);
|
|
4
|
+
const PEN = `${choiceLayer(ID)} [data-sx-choice-svg="pen"]`;
|
|
5
|
+
/** Our own strokes, a little loose, running past the box's edges like a pen would. */
|
|
6
|
+
const PATHS = {
|
|
7
|
+
check: "M3.5 13.2c1.7.4 3.6 2.4 5.3 5.5C11.4 13.4 15.4 7.7 21 3.7",
|
|
8
|
+
cross: "M4.8 5.2c3.8 4.3 9.4 10 14.4 14.2M19.6 4.6c-4.7 4.4-9.7 9.7-14.8 14.8",
|
|
9
|
+
};
|
|
10
|
+
// The box stays an outline (no fill) and the stroke draws over it. The drawn stroke is the state: it holds under
|
|
11
|
+
// reduced motion, where it just appears.
|
|
12
|
+
const STATE = ` ${at(ROOT)} {
|
|
13
|
+
--sx-choice-fill: transparent;
|
|
14
|
+
}
|
|
15
|
+
${at(`${ROOT} ${MARK}`)} {
|
|
16
|
+
display: none;
|
|
17
|
+
}
|
|
18
|
+
${at(PEN)} {
|
|
19
|
+
fill: none;
|
|
20
|
+
stroke: ${v(ID, "color")};
|
|
21
|
+
stroke-width: 2.5;
|
|
22
|
+
stroke-linecap: round;
|
|
23
|
+
stroke-linejoin: round;
|
|
24
|
+
stroke-dasharray: 1 2;
|
|
25
|
+
stroke-dashoffset: 1.01;
|
|
26
|
+
}
|
|
27
|
+
${at(inItem(ROOT, CHECKED, PEN))} {
|
|
28
|
+
stroke-dashoffset: 0;
|
|
29
|
+
}`;
|
|
30
|
+
const CSS = ` ${at(PEN)} {
|
|
31
|
+
transition: stroke-dashoffset ${v(ID, "time")} ease-in-out;
|
|
32
|
+
}`;
|
|
33
|
+
/** A loose hand-drawn tick, or a cross, scribbles itself over the box. */
|
|
34
|
+
export function checkScribble(options = {}) {
|
|
35
|
+
return defineForm(ID, CSS, {
|
|
36
|
+
fits: ["checkbox"],
|
|
37
|
+
state: STATE,
|
|
38
|
+
vars: { [varName(ID, "color")]: options.color ?? "var(--color-sx-primary)", [varName(ID, "time")]: `${options.duration ?? 0.4}s` },
|
|
39
|
+
layers: [{ slot: "box", keep: true, svg: { viewBox: "0 0 24 24", children: [{ tag: "path", part: "pen", attrs: { pathLength: 1, d: PATHS[options.kind ?? "check"] } }] } }],
|
|
40
|
+
claims: ["mark"],
|
|
41
|
+
});
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CHECK_SCRIBBLE_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const CHECK_SCRIBBLE_SCHEMA = defineSchema()({
|
|
3
|
+
id: "checkScribble",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "checkScribble",
|
|
6
|
+
fields: {
|
|
7
|
+
kind: { kind: "choice", label: "Mark", values: ["check", "cross"], labels: { check: "Tick", cross: "Cross" }, default: "check" },
|
|
8
|
+
color: { kind: "color", label: "Ink", default: "var(--color-sx-primary)" },
|
|
9
|
+
duration: { kind: "number", label: "Duration", min: 0.1, max: 1, step: 0.05, unit: "s", default: 0.4 },
|
|
10
|
+
},
|
|
11
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface CheckStrikeOptions {
|
|
3
|
+
/** `"line"`: a line strikes the words through. `"box"`: the box flattens into a bar first. Default `"line"`. */
|
|
4
|
+
readonly kind?: "line" | "box";
|
|
5
|
+
/** Seconds the line takes. Default `0.3`. */
|
|
6
|
+
readonly duration?: number;
|
|
7
|
+
}
|
|
8
|
+
/** A line strikes the words through, the words go quiet; or the box itself flattens into the line. */
|
|
9
|
+
export declare function checkStrike(options?: CheckStrikeOptions): FormEffect;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { BOX, CHECKED, DIR, MARK, TEXT, at, choiceLayer, choiceOf, defineForm, inItem, v, varName } from "../kit.js";
|
|
2
|
+
const ID = "checkStrike";
|
|
3
|
+
const ROOT = choiceOf(ID);
|
|
4
|
+
const LINE = choiceLayer(ID, "line");
|
|
5
|
+
// A to-do list's "done": a line through the words, the words muted. The line sits on the first line of words, as
|
|
6
|
+
// wide as they are (the words stop at their own width). With `kind: "box"` the box squashes into a bar and loses its
|
|
7
|
+
// tick before the line runs (the factors are 1 for "line", so the same sheet serves both). Done is a state: the line
|
|
8
|
+
// and the bar hold under reduced motion.
|
|
9
|
+
const STATE = ` ${at(`${ROOT} ${TEXT}`)} {
|
|
10
|
+
justify-self: start;
|
|
11
|
+
}
|
|
12
|
+
${at(inItem(ROOT, CHECKED))} {
|
|
13
|
+
--sx-choice-text: var(--color-sx-muted);
|
|
14
|
+
}
|
|
15
|
+
${at(LINE)} {
|
|
16
|
+
inset: calc(0.75em - 1px) 0 auto;
|
|
17
|
+
block-size: 2px;
|
|
18
|
+
border-radius: 1px;
|
|
19
|
+
background: currentColor;
|
|
20
|
+
scale: 0 1;
|
|
21
|
+
transform-origin: calc(50% - 50% * ${DIR}) 50%;
|
|
22
|
+
}
|
|
23
|
+
${at(inItem(ROOT, CHECKED, LINE))} {
|
|
24
|
+
scale: 1 1;
|
|
25
|
+
}
|
|
26
|
+
${at(inItem(ROOT, CHECKED, BOX))} {
|
|
27
|
+
scale: 1 ${v(ID, "squash")};
|
|
28
|
+
}
|
|
29
|
+
${at(inItem(ROOT, CHECKED, MARK))} {
|
|
30
|
+
opacity: ${v(ID, "mark")};
|
|
31
|
+
}`;
|
|
32
|
+
const CSS = ` ${at(LINE)} {
|
|
33
|
+
transition: scale ${v(ID, "time")} ease-out ${v(ID, "delay")};
|
|
34
|
+
}
|
|
35
|
+
${at(`${ROOT} ${BOX}`)} {
|
|
36
|
+
transition: scale calc(${v(ID, "time")} * 0.6) ease-out;
|
|
37
|
+
}`;
|
|
38
|
+
/** A line strikes the words through, the words go quiet; or the box itself flattens into the line. */
|
|
39
|
+
export function checkStrike(options = {}) {
|
|
40
|
+
const box = options.kind === "box";
|
|
41
|
+
const time = options.duration ?? 0.3;
|
|
42
|
+
return defineForm(ID, CSS, {
|
|
43
|
+
fits: ["checkbox"],
|
|
44
|
+
state: STATE,
|
|
45
|
+
vars: {
|
|
46
|
+
[varName(ID, "time")]: `${time}s`,
|
|
47
|
+
[varName(ID, "squash")]: box ? 0.2 : 1,
|
|
48
|
+
[varName(ID, "mark")]: box ? 0 : 1,
|
|
49
|
+
[varName(ID, "delay")]: box ? `${time * 0.5}s` : "0s",
|
|
50
|
+
},
|
|
51
|
+
layers: [{ slot: "text", part: "line", keep: true }],
|
|
52
|
+
claims: box ? ["box", "mark"] : [],
|
|
53
|
+
});
|
|
54
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CHECK_STRIKE_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const CHECK_STRIKE_SCHEMA = defineSchema()({
|
|
3
|
+
id: "checkStrike",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "checkStrike",
|
|
6
|
+
fields: {
|
|
7
|
+
kind: { kind: "choice", label: "Kind", values: ["line", "box"], labels: { line: "A line through the words", box: "The box flattens into the line" }, default: "line" },
|
|
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,7 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface ChipCheckOptions {
|
|
3
|
+
/** Seconds the check takes to slide in. Default `0.2`. */
|
|
4
|
+
readonly duration?: number;
|
|
5
|
+
}
|
|
6
|
+
/** A chip's check slides in from its start as it turns on, the words making room, and its tick draws. */
|
|
7
|
+
export declare function chipCheck(options?: ChipCheckOptions): FormEffect;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CHIP_CHECK, CHIP_ON, CHIP_OPTION, DIR, EASE, SPRING, at, chipsOf, defineForm, v, varName } from "../kit.js";
|
|
2
|
+
const ID = "chipCheck";
|
|
3
|
+
const ROOT = chipsOf(ID);
|
|
4
|
+
// A chip that is on opens a column for its check (the base sheet's state: a grid column from 0fr to 1fr). This is the
|
|
5
|
+
// motion: the column opens smoothly, pushing the words aside, the check slides in from the chip's start and its tick
|
|
6
|
+
// draws, a moment later. Transitions only, so nothing plays on load.
|
|
7
|
+
const CSS = ` ${at(`${ROOT} ${CHIP_OPTION}`)} {
|
|
8
|
+
transition: grid-template-columns ${v(ID, "time")} ${EASE};
|
|
9
|
+
}
|
|
10
|
+
${at(`${ROOT} ${CHIP_CHECK} > svg`)} {
|
|
11
|
+
transition: translate ${v(ID, "time")} ${SPRING}, opacity ${v(ID, "time")} ${EASE};
|
|
12
|
+
}
|
|
13
|
+
${at(`${ROOT} ${CHIP_OPTION}:not(${CHIP_ON}) ${CHIP_CHECK} > svg`)} {
|
|
14
|
+
translate: calc(-100% * ${DIR}) 0;
|
|
15
|
+
opacity: 0;
|
|
16
|
+
}
|
|
17
|
+
${at(`${ROOT} ${CHIP_CHECK} path`)} {
|
|
18
|
+
transition: stroke-dashoffset ${v(ID, "time")} ${EASE} calc(${v(ID, "time")} * 0.5);
|
|
19
|
+
}
|
|
20
|
+
${at(`${ROOT} ${CHIP_OPTION}:not(${CHIP_ON}) ${CHIP_CHECK} path`)} {
|
|
21
|
+
transition-delay: 0s;
|
|
22
|
+
}`;
|
|
23
|
+
/** A chip's check slides in from its start as it turns on, the words making room, and its tick draws. */
|
|
24
|
+
export function chipCheck(options = {}) {
|
|
25
|
+
return defineForm(ID, CSS, { fits: ["chip"], vars: { [varName(ID, "time")]: `${options.duration ?? 0.2}s` } });
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CHIP_CHECK_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const CHIP_CHECK_SCHEMA = defineSchema()({
|
|
3
|
+
id: "chipCheck",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "chipCheck",
|
|
6
|
+
fields: {
|
|
7
|
+
duration: { kind: "number", label: "Duration", min: 0.1, max: 0.4, step: 0.05, unit: "s", default: 0.2 },
|
|
8
|
+
},
|
|
9
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface ChipMergeOptions {
|
|
3
|
+
/** The colour of the chips that are on. Default a light tint of `var(--color-sx-primary)`. */
|
|
4
|
+
readonly color?: string;
|
|
5
|
+
/** Seconds it takes. Default `0.2`. */
|
|
6
|
+
readonly duration?: number;
|
|
7
|
+
}
|
|
8
|
+
/** Chips that are on next to each other merge into one block: a bridge fills the gap and the corners that meet square off. */
|
|
9
|
+
export declare function chipMerge(options?: ChipMergeOptions): FormEffect;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { CHIP_CONTROL, CHIP_ON, CHIP_OPTION, DIR, at, chipLayer, chipsOf, defineForm, v, varName } from "../kit.js";
|
|
2
|
+
const ID = "chipMerge";
|
|
3
|
+
const ROOT = chipsOf(ID);
|
|
4
|
+
const PILL = chipLayer(ID, "pill");
|
|
5
|
+
const BRIDGE = chipLayer(ID, "bridge");
|
|
6
|
+
const NEXT_ON = `:has(+ ${CHIP_OPTION} ${CHIP_CONTROL}:checked)`;
|
|
7
|
+
/** The look's border width (a hook it sets), so the pill covers the chip's border too. */
|
|
8
|
+
const BW = "var(--sx-chip-bw, 0px)";
|
|
9
|
+
// Each chip that is on sits on a pill, its own border made invisible. Between two chips that are on, a bridge the size of
|
|
10
|
+
// the gap fills in, and the corners that meet square off: a run of chips reads as one block. The pills and bridges are
|
|
11
|
+
// the state; only how they come and go moves. A run that wraps carries on past the line's end by one gap.
|
|
12
|
+
const STATE = ` ${at(`${ROOT} ${CHIP_OPTION}${CHIP_ON}`)} {
|
|
13
|
+
--sx-chip-edge: transparent;
|
|
14
|
+
}
|
|
15
|
+
${at(PILL)} {
|
|
16
|
+
inset: calc(${BW} * -1);
|
|
17
|
+
border-radius: inherit;
|
|
18
|
+
background: ${v(ID, "color")};
|
|
19
|
+
opacity: 0;
|
|
20
|
+
}
|
|
21
|
+
${at(`${ROOT} ${CHIP_OPTION}${CHIP_ON} ${PILL}`)} {
|
|
22
|
+
opacity: 1;
|
|
23
|
+
}
|
|
24
|
+
${at(`${ROOT} ${CHIP_OPTION}${CHIP_ON}${NEXT_ON} ${PILL}`)} {
|
|
25
|
+
border-start-end-radius: 0;
|
|
26
|
+
border-end-end-radius: 0;
|
|
27
|
+
}
|
|
28
|
+
${at(`${ROOT} ${CHIP_OPTION}${CHIP_ON} + ${CHIP_OPTION}${CHIP_ON} ${PILL}`)} {
|
|
29
|
+
border-start-start-radius: 0;
|
|
30
|
+
border-end-start-radius: 0;
|
|
31
|
+
}
|
|
32
|
+
${at(BRIDGE)} {
|
|
33
|
+
inset-block: calc(${BW} * -1);
|
|
34
|
+
inset-inline-start: calc(100% + ${BW});
|
|
35
|
+
inline-size: var(--sx-chips-gap);
|
|
36
|
+
background: ${v(ID, "color")};
|
|
37
|
+
scale: 0 1;
|
|
38
|
+
transform-origin: calc(50% - 50% * ${DIR}) 50%;
|
|
39
|
+
}
|
|
40
|
+
${at(`${ROOT} ${CHIP_OPTION}${CHIP_ON}${NEXT_ON} ${BRIDGE}`)} {
|
|
41
|
+
scale: 1 1;
|
|
42
|
+
}`;
|
|
43
|
+
const CSS = ` ${at(PILL)} {
|
|
44
|
+
transition: opacity ${v(ID, "time")} ease-out, border-radius ${v(ID, "time")} ease-out;
|
|
45
|
+
}
|
|
46
|
+
${at(BRIDGE)} {
|
|
47
|
+
transition: scale ${v(ID, "time")} ease-out;
|
|
48
|
+
}`;
|
|
49
|
+
/** Chips that are on next to each other merge into one block: a bridge fills the gap and the corners that meet square off. */
|
|
50
|
+
export function chipMerge(options = {}) {
|
|
51
|
+
return defineForm(ID, CSS, {
|
|
52
|
+
fits: ["chip"],
|
|
53
|
+
state: STATE,
|
|
54
|
+
vars: {
|
|
55
|
+
[varName(ID, "color")]: options.color ?? "color-mix(in oklab, var(--color-sx-primary) 22%, var(--color-sx-secondary))",
|
|
56
|
+
[varName(ID, "time")]: `${options.duration ?? 0.2}s`,
|
|
57
|
+
},
|
|
58
|
+
layers: [
|
|
59
|
+
{ slot: "row", part: "pill", keep: true },
|
|
60
|
+
{ slot: "row", part: "bridge", keep: true },
|
|
61
|
+
],
|
|
62
|
+
});
|
|
63
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CHIP_MERGE_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const CHIP_MERGE_SCHEMA = defineSchema()({
|
|
3
|
+
id: "chipMerge",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "chipMerge",
|
|
6
|
+
fields: {
|
|
7
|
+
color: { kind: "color", label: "Colour", autoNote: "a light tint of the primary colour" },
|
|
8
|
+
duration: { kind: "number", label: "Duration", min: 0.05, max: 0.5, step: 0.05, unit: "s", default: 0.2 },
|
|
9
|
+
},
|
|
10
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface FileButtonOptions {
|
|
3
|
+
/** The button's colour. Default `var(--color-sx-primary)`. */
|
|
4
|
+
readonly color?: string;
|
|
5
|
+
}
|
|
6
|
+
/** The browser's own file button, dressed as a solid pill that lifts on hover and dips on a press. */
|
|
7
|
+
export declare function fileButton(options?: FileButtonOptions): FormEffect;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { at, defineForm, fileOf, v, varName } from "../kit.js";
|
|
2
|
+
const ID = "fileButton";
|
|
3
|
+
const ROOT = fileOf(ID);
|
|
4
|
+
const CONTROL = "[data-sx-file-control]";
|
|
5
|
+
// The browser's own file button (::file-selector-button), kept: it opens the picker from the keyboard and reads the
|
|
6
|
+
// browser's own words. This dresses it as a solid pill through the look's hooks; it lifts on hover and dips on a press.
|
|
7
|
+
// One rule per selector with the pseudo-element (a browser without it would drop a list that names it).
|
|
8
|
+
const STATE = ` ${at(ROOT)} {
|
|
9
|
+
--sx-file-button-bg: ${v(ID, "color")};
|
|
10
|
+
--sx-file-button-ink: var(--color-sx-on-primary);
|
|
11
|
+
--sx-file-button-line: transparent;
|
|
12
|
+
--sx-file-button-radius: 999px;
|
|
13
|
+
}`;
|
|
14
|
+
const CSS = ` ${at(`${ROOT} ${CONTROL}`)}::file-selector-button {
|
|
15
|
+
transition: translate 0.15s ease-out, scale 0.1s ease-out;
|
|
16
|
+
}
|
|
17
|
+
@media (hover: hover) and (pointer: fine) {
|
|
18
|
+
${at(`${ROOT} ${CONTROL}:not(:disabled):hover`)}::file-selector-button {
|
|
19
|
+
translate: 0 -1px;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
${at(`${ROOT} ${CONTROL}:active`)}::file-selector-button {
|
|
23
|
+
scale: 0.97;
|
|
24
|
+
}`;
|
|
25
|
+
/** The browser's own file button, dressed as a solid pill that lifts on hover and dips on a press. */
|
|
26
|
+
export function fileButton(options = {}) {
|
|
27
|
+
return defineForm(ID, CSS, { fits: ["file"], state: STATE, vars: { [varName(ID, "color")]: options.color ?? "var(--color-sx-primary)" } });
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FILE_BUTTON_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const FILE_BUTTON_SCHEMA = defineSchema()({
|
|
3
|
+
id: "fileButton",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "fileButton",
|
|
6
|
+
fields: {
|
|
7
|
+
color: { kind: "color", label: "Colour", default: "var(--color-sx-primary)" },
|
|
8
|
+
},
|
|
9
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface FileCardsOptions {
|
|
3
|
+
/** Seconds a card takes to come in or go. Default `0.25`. */
|
|
4
|
+
readonly duration?: number;
|
|
5
|
+
}
|
|
6
|
+
/** Cards rise in as files are added, slide out when removed, and the others glide into place (moves too). */
|
|
7
|
+
export declare function fileCards(options?: FileCardsOptions): FormEffect;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CARD, DIR, EASE, SPRING, at, defineForm, fileOf, v, varName } from "../kit.js";
|
|
2
|
+
const ID = "fileCards";
|
|
3
|
+
const ROOT = fileOf(ID);
|
|
4
|
+
// A file's card rises in when it is added (only once the user has added or removed one: never on load), slides out
|
|
5
|
+
// toward the end when removed (the FileDrop keeps it, marked data-sx-leaving, until this animation ends: needs.flip),
|
|
6
|
+
// and the others glide into the gap or the new order (the FileDrop's FLIP: an inline translate taken back to nothing).
|
|
7
|
+
const CSS = ` ${at(`${ROOT} ${CARD}`)} {
|
|
8
|
+
transition: translate ${v(ID, "time")} ${SPRING}, scale ${v(ID, "time")} ${SPRING}, opacity ${v(ID, "time")} ${EASE};
|
|
9
|
+
}
|
|
10
|
+
@starting-style {
|
|
11
|
+
${at(`${ROOT}[data-sx-live] ${CARD}`)} {
|
|
12
|
+
translate: 0 0.5rem;
|
|
13
|
+
scale: 0.96;
|
|
14
|
+
opacity: 0;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
${at(`${ROOT} ${CARD}[data-sx-leaving]`)} {
|
|
18
|
+
animation: sx-form-fileCards-out ${v(ID, "time")} ${EASE} forwards;
|
|
19
|
+
}
|
|
20
|
+
${at(`${ROOT} [data-sx-file-remove] svg`)} {
|
|
21
|
+
transition: rotate 0.2s ${EASE};
|
|
22
|
+
}
|
|
23
|
+
@media (hover: hover) and (pointer: fine) {
|
|
24
|
+
${at(`${ROOT} [data-sx-file-remove]:hover svg`)} {
|
|
25
|
+
rotate: 90deg;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
@keyframes sx-form-fileCards-out {
|
|
29
|
+
to {
|
|
30
|
+
translate: calc(1.5rem * ${DIR}) 0;
|
|
31
|
+
scale: 0.94;
|
|
32
|
+
opacity: 0;
|
|
33
|
+
}
|
|
34
|
+
}`;
|
|
35
|
+
/** Cards rise in as files are added, slide out when removed, and the others glide into place (moves too). */
|
|
36
|
+
export function fileCards(options = {}) {
|
|
37
|
+
return defineForm(ID, CSS, { fits: ["file"], needs: { flip: true }, vars: { [varName(ID, "time")]: `${options.duration ?? 0.25}s` } });
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FILE_CARDS_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const FILE_CARDS_SCHEMA = defineSchema()({
|
|
3
|
+
id: "fileCards",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "fileCards",
|
|
6
|
+
fields: {
|
|
7
|
+
duration: { kind: "number", label: "Duration", min: 0.1, max: 0.5, step: 0.05, unit: "s", default: 0.25 },
|
|
8
|
+
},
|
|
9
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface FileDragOptions {
|
|
3
|
+
/** The tint the zone takes while files are over it. Default `var(--color-sx-primary)`. */
|
|
4
|
+
readonly color?: string;
|
|
5
|
+
/** Seconds it takes. Default `0.2`. */
|
|
6
|
+
readonly duration?: number;
|
|
7
|
+
}
|
|
8
|
+
/** While files are dragged over the zone it takes a tint, grows a little and its icon hops; red for files it won't take. */
|
|
9
|
+
export declare function fileDrag(options?: FileDragOptions): FormEffect;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { EASE, OVER, OVER_REJECT, SPRING, ZONE, at, defineForm, fileLayer, fileOf, loopPaused, v, varName } from "../kit.js";
|
|
2
|
+
const ID = "fileDrag";
|
|
3
|
+
const ROOT = fileOf(ID);
|
|
4
|
+
const GLOW = fileLayer(ID, "glow");
|
|
5
|
+
const ICON = "[data-sx-file-icon]";
|
|
6
|
+
// While files are dragged over the zone it takes a tint (red when the browser can tell they are of a kind it won't
|
|
7
|
+
// take), grows a little, and its icon hops, inviting the drop. The tint is the state: it holds under reduced motion.
|
|
8
|
+
const STATE = ` ${at(GLOW)} {
|
|
9
|
+
background: color-mix(in oklab, ${v(ID, "color")} 10%, transparent);
|
|
10
|
+
opacity: 0;
|
|
11
|
+
}
|
|
12
|
+
${at(`${ROOT}${OVER} ${GLOW}`)} {
|
|
13
|
+
opacity: 1;
|
|
14
|
+
}
|
|
15
|
+
${at(`${ROOT}${OVER_REJECT} ${GLOW}`)} {
|
|
16
|
+
background: color-mix(in oklab, var(--color-sx-danger) 10%, transparent);
|
|
17
|
+
opacity: 1;
|
|
18
|
+
}`;
|
|
19
|
+
const CSS = ` ${at(GLOW)} {
|
|
20
|
+
transition: opacity ${v(ID, "time")} ${EASE};
|
|
21
|
+
}
|
|
22
|
+
${at(`${ROOT} ${ZONE}`)} {
|
|
23
|
+
transition: scale ${v(ID, "time")} ${SPRING};
|
|
24
|
+
}
|
|
25
|
+
${at(`${ROOT}${OVER} ${ZONE}`)} {
|
|
26
|
+
scale: 1.01;
|
|
27
|
+
}
|
|
28
|
+
${at(`${ROOT}${OVER} ${ICON}`)} {
|
|
29
|
+
animation: sx-form-fileDrag-hop 0.9s ease-in-out infinite;
|
|
30
|
+
}
|
|
31
|
+
${loopPaused(`${ROOT} ${ICON}`)}
|
|
32
|
+
@keyframes sx-form-fileDrag-hop {
|
|
33
|
+
50% {
|
|
34
|
+
translate: 0 -0.3rem;
|
|
35
|
+
}
|
|
36
|
+
}`;
|
|
37
|
+
/** While files are dragged over the zone it takes a tint, grows a little and its icon hops; red for files it won't take. */
|
|
38
|
+
export function fileDrag(options = {}) {
|
|
39
|
+
return defineForm(ID, CSS, {
|
|
40
|
+
fits: ["file"],
|
|
41
|
+
state: STATE,
|
|
42
|
+
vars: { [varName(ID, "color")]: options.color ?? "var(--color-sx-primary)", [varName(ID, "time")]: `${options.duration ?? 0.2}s` },
|
|
43
|
+
layers: [{ slot: "zone", part: "glow", keep: true }],
|
|
44
|
+
});
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FILE_DRAG_SCHEMA: import("../../../schema/types.js").Schema;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineSchema } from "../../../schema/define.js";
|
|
2
|
+
export const FILE_DRAG_SCHEMA = defineSchema()({
|
|
3
|
+
id: "fileDrag",
|
|
4
|
+
family: "form",
|
|
5
|
+
factory: "fileDrag",
|
|
6
|
+
fields: {
|
|
7
|
+
color: { kind: "color", label: "Tint", default: "var(--color-sx-primary)" },
|
|
8
|
+
duration: { kind: "number", label: "Duration", min: 0.1, max: 0.5, step: 0.05, unit: "s", default: 0.2 },
|
|
9
|
+
},
|
|
10
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FormEffect } from "../../types.js";
|
|
2
|
+
export interface FilePageOptions {
|
|
3
|
+
/** The frame's colour. Default `var(--color-sx-primary)`. */
|
|
4
|
+
readonly color?: string;
|
|
5
|
+
}
|
|
6
|
+
/** The page-wide drop overlay (`page`) fades in, its dashed frame settling and its words rising. */
|
|
7
|
+
export declare function filePage(options?: FilePageOptions): FormEffect;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { EASE, SPRING, at, defineForm, fileLayer, fileOf, v, varName } from "../kit.js";
|
|
2
|
+
const ID = "filePage";
|
|
3
|
+
const ROOT = fileOf(ID);
|
|
4
|
+
const FRAME = fileLayer(ID, "frame");
|
|
5
|
+
const PAGE = "[data-sx-file-page]";
|
|
6
|
+
// With `page`, a FileDrop covers the window while files are dragged over it. This draws a dashed frame round the
|
|
7
|
+
// overlay (the state, kept under reduced motion) and brings it in: the overlay fades, the frame settles from a little
|
|
8
|
+
// smaller, the words rise.
|
|
9
|
+
const STATE = ` ${at(FRAME)} {
|
|
10
|
+
border: 3px dashed ${v(ID, "color")};
|
|
11
|
+
border-radius: var(--radius-sx-card, 1rem);
|
|
12
|
+
}`;
|
|
13
|
+
const CSS = ` ${at(`${ROOT}[data-sx-page-over] ${PAGE}`)} {
|
|
14
|
+
animation: sx-form-filePage-fade 0.2s ${EASE};
|
|
15
|
+
}
|
|
16
|
+
${at(`${ROOT}[data-sx-page-over] ${FRAME}`)} {
|
|
17
|
+
animation: sx-form-filePage-frame 0.35s ${SPRING};
|
|
18
|
+
}
|
|
19
|
+
${at(`${ROOT}[data-sx-page-over] [data-sx-file-page-words]`)} {
|
|
20
|
+
animation: sx-form-filePage-words 0.35s ${EASE};
|
|
21
|
+
}
|
|
22
|
+
@keyframes sx-form-filePage-fade {
|
|
23
|
+
from {
|
|
24
|
+
opacity: 0;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
@keyframes sx-form-filePage-frame {
|
|
28
|
+
from {
|
|
29
|
+
scale: 0.96;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
@keyframes sx-form-filePage-words {
|
|
33
|
+
from {
|
|
34
|
+
translate: 0 0.75rem;
|
|
35
|
+
opacity: 0;
|
|
36
|
+
}
|
|
37
|
+
}`;
|
|
38
|
+
/** The page-wide drop overlay (`page`) fades in, its dashed frame settling and its words rising. */
|
|
39
|
+
export function filePage(options = {}) {
|
|
40
|
+
return defineForm(ID, CSS, {
|
|
41
|
+
fits: ["file"],
|
|
42
|
+
state: STATE,
|
|
43
|
+
vars: { [varName(ID, "color")]: options.color ?? "var(--color-sx-primary)" },
|
|
44
|
+
layers: [{ slot: "page", part: "frame", keep: true }],
|
|
45
|
+
});
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FILE_PAGE_SCHEMA: import("../../../schema/types.js").Schema;
|