@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,268 @@
|
|
|
1
|
+
// The structural sheet of FileDrop: the drop zone round the real file input (visible: its own button opens the picker,
|
|
2
|
+
// from the keyboard too), the list of file cards (a picture or an icon, the name and size, a progress bar, a check when
|
|
3
|
+
// uploaded, the move and remove buttons) and the page-wide overlay of `page`. Positioning and states only; the look is
|
|
4
|
+
// styles/form.css. Pure strings. See ./CLAUDE.md.
|
|
5
|
+
//
|
|
6
|
+
// The real input's own words ("No file chosen") are see-through: the zone's words say it, and the list shows the files.
|
|
7
|
+
// Its button stays, styled by the look through hooks (--sx-file-button-*), which fileButton sets.
|
|
8
|
+
import { LAYER_ORDER } from "../backgrounds/runtime/rootCss.js";
|
|
9
|
+
const CONTROL = "[data-sx-file-control]";
|
|
10
|
+
export const FILE_CSS = `${LAYER_ORDER}
|
|
11
|
+
@layer components {
|
|
12
|
+
:where([data-sx-file]) {
|
|
13
|
+
--sx-form-dir: 1;
|
|
14
|
+
--sx-file-thumb: 2.5rem;
|
|
15
|
+
display: grid;
|
|
16
|
+
grid-template-columns: minmax(0, 1fr);
|
|
17
|
+
grid-template-areas: "label" "zone" "description" "list" "message";
|
|
18
|
+
align-content: start;
|
|
19
|
+
min-inline-size: 0;
|
|
20
|
+
position: relative;
|
|
21
|
+
}
|
|
22
|
+
:where([data-sx-file]:dir(rtl)) {
|
|
23
|
+
--sx-form-dir: -1;
|
|
24
|
+
}
|
|
25
|
+
:where([data-sx-file-label]) {
|
|
26
|
+
grid-area: label;
|
|
27
|
+
justify-self: start;
|
|
28
|
+
margin-block-end: 0.375rem;
|
|
29
|
+
}
|
|
30
|
+
:where([data-sx-file-zone]) {
|
|
31
|
+
grid-area: zone;
|
|
32
|
+
position: relative;
|
|
33
|
+
isolation: isolate;
|
|
34
|
+
display: grid;
|
|
35
|
+
justify-items: center;
|
|
36
|
+
gap: 0.5rem;
|
|
37
|
+
padding: 1.5rem 1rem;
|
|
38
|
+
box-sizing: border-box;
|
|
39
|
+
text-align: center;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
}
|
|
42
|
+
:where([data-sx-file-zone] > [data-sx-file-layer]) {
|
|
43
|
+
position: absolute;
|
|
44
|
+
inset: 0;
|
|
45
|
+
z-index: -1;
|
|
46
|
+
border-radius: inherit;
|
|
47
|
+
pointer-events: none;
|
|
48
|
+
}
|
|
49
|
+
:where([data-sx-file-icon]) {
|
|
50
|
+
display: grid;
|
|
51
|
+
place-items: center;
|
|
52
|
+
}
|
|
53
|
+
:where([data-sx-file-icon] svg, [data-sx-file-card] svg) {
|
|
54
|
+
display: block;
|
|
55
|
+
inline-size: 1.5rem;
|
|
56
|
+
block-size: 1.5rem;
|
|
57
|
+
overflow: visible;
|
|
58
|
+
fill: none;
|
|
59
|
+
stroke: currentColor;
|
|
60
|
+
stroke-width: 1.75;
|
|
61
|
+
stroke-linecap: round;
|
|
62
|
+
stroke-linejoin: round;
|
|
63
|
+
}
|
|
64
|
+
:where(${CONTROL}) {
|
|
65
|
+
max-inline-size: 100%;
|
|
66
|
+
color: transparent;
|
|
67
|
+
font: inherit;
|
|
68
|
+
font-size: max(16px, 0.875rem);
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
}
|
|
71
|
+
:where(${CONTROL})::file-selector-button {
|
|
72
|
+
margin-inline-end: 0;
|
|
73
|
+
padding: 0.5rem 1rem;
|
|
74
|
+
font: inherit;
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
}
|
|
77
|
+
:where(${CONTROL}:focus-visible) {
|
|
78
|
+
outline: 2px solid var(--color-sx-primary, currentColor);
|
|
79
|
+
outline-offset: 2px;
|
|
80
|
+
}
|
|
81
|
+
:where([data-sx-file][data-sx-over] [data-sx-file-zone]) {
|
|
82
|
+
outline: 2px solid var(--color-sx-primary, currentColor);
|
|
83
|
+
outline-offset: -2px;
|
|
84
|
+
}
|
|
85
|
+
:where([data-sx-file][data-sx-over="reject"] [data-sx-file-zone]) {
|
|
86
|
+
outline-color: var(--color-sx-danger, currentColor);
|
|
87
|
+
cursor: no-drop;
|
|
88
|
+
}
|
|
89
|
+
:where([data-sx-file]:has(${CONTROL}:disabled) [data-sx-file-zone]) {
|
|
90
|
+
opacity: 0.55;
|
|
91
|
+
cursor: not-allowed;
|
|
92
|
+
}
|
|
93
|
+
:where([data-sx-file-description]) {
|
|
94
|
+
grid-area: description;
|
|
95
|
+
margin: 0.375rem 0 0;
|
|
96
|
+
}
|
|
97
|
+
:where([data-sx-file-list]) {
|
|
98
|
+
grid-area: list;
|
|
99
|
+
display: grid;
|
|
100
|
+
gap: 0.5rem;
|
|
101
|
+
margin: 0.75rem 0 0;
|
|
102
|
+
padding: 0;
|
|
103
|
+
list-style: none;
|
|
104
|
+
}
|
|
105
|
+
:where([data-sx-file-card]) {
|
|
106
|
+
position: relative;
|
|
107
|
+
isolation: isolate;
|
|
108
|
+
display: grid;
|
|
109
|
+
grid-template-columns: var(--sx-file-thumb) minmax(0, 1fr) auto auto;
|
|
110
|
+
grid-template-areas: "thumb info status actions";
|
|
111
|
+
align-items: center;
|
|
112
|
+
column-gap: 0.75rem;
|
|
113
|
+
padding: 0.5rem;
|
|
114
|
+
box-sizing: border-box;
|
|
115
|
+
}
|
|
116
|
+
:where([data-sx-file-card] > [data-sx-file-layer]) {
|
|
117
|
+
grid-area: status;
|
|
118
|
+
pointer-events: none;
|
|
119
|
+
}
|
|
120
|
+
:where([data-sx-file-thumb]) {
|
|
121
|
+
grid-area: thumb;
|
|
122
|
+
display: grid;
|
|
123
|
+
place-items: center;
|
|
124
|
+
inline-size: var(--sx-file-thumb);
|
|
125
|
+
block-size: var(--sx-file-thumb);
|
|
126
|
+
overflow: hidden;
|
|
127
|
+
border-radius: calc(var(--radius-sx-control, 0.5rem) * 0.75);
|
|
128
|
+
}
|
|
129
|
+
:where([data-sx-file-thumb] > img) {
|
|
130
|
+
display: block;
|
|
131
|
+
inline-size: 100%;
|
|
132
|
+
block-size: 100%;
|
|
133
|
+
object-fit: cover;
|
|
134
|
+
}
|
|
135
|
+
:where([data-sx-file-info]) {
|
|
136
|
+
grid-area: info;
|
|
137
|
+
display: grid;
|
|
138
|
+
min-inline-size: 0;
|
|
139
|
+
gap: 0.125rem;
|
|
140
|
+
}
|
|
141
|
+
:where([data-sx-file-name]) {
|
|
142
|
+
overflow: hidden;
|
|
143
|
+
text-overflow: ellipsis;
|
|
144
|
+
white-space: nowrap;
|
|
145
|
+
}
|
|
146
|
+
:where([data-sx-file-bar]) {
|
|
147
|
+
display: block;
|
|
148
|
+
block-size: 0.25rem;
|
|
149
|
+
margin-block-start: 0.25rem;
|
|
150
|
+
overflow: hidden;
|
|
151
|
+
border-radius: 999px;
|
|
152
|
+
}
|
|
153
|
+
:where([data-sx-file-fill]) {
|
|
154
|
+
display: block;
|
|
155
|
+
block-size: 100%;
|
|
156
|
+
transform-origin: calc(50% - 50% * var(--sx-form-dir)) 50%;
|
|
157
|
+
scale: var(--sx-file-progress, 0) 1;
|
|
158
|
+
background: currentColor;
|
|
159
|
+
}
|
|
160
|
+
:where([data-sx-file-done]) {
|
|
161
|
+
grid-area: status;
|
|
162
|
+
display: none;
|
|
163
|
+
}
|
|
164
|
+
:where([data-sx-file-card][data-sx-done] [data-sx-file-done]) {
|
|
165
|
+
display: grid;
|
|
166
|
+
}
|
|
167
|
+
:where([data-sx-file-card][data-sx-done] [data-sx-file-bar]) {
|
|
168
|
+
opacity: 0;
|
|
169
|
+
}
|
|
170
|
+
:where([data-sx-file-actions]) {
|
|
171
|
+
grid-area: actions;
|
|
172
|
+
display: flex;
|
|
173
|
+
gap: 0.125rem;
|
|
174
|
+
}
|
|
175
|
+
:where([data-sx-file-actions] > button) {
|
|
176
|
+
display: grid;
|
|
177
|
+
place-items: center;
|
|
178
|
+
inline-size: 2rem;
|
|
179
|
+
block-size: 2rem;
|
|
180
|
+
margin: 0;
|
|
181
|
+
padding: 0;
|
|
182
|
+
border: 0;
|
|
183
|
+
border-radius: 50%;
|
|
184
|
+
background: transparent;
|
|
185
|
+
color: inherit;
|
|
186
|
+
cursor: pointer;
|
|
187
|
+
}
|
|
188
|
+
:where([data-sx-file-actions] > button svg) {
|
|
189
|
+
inline-size: 1.125rem;
|
|
190
|
+
block-size: 1.125rem;
|
|
191
|
+
}
|
|
192
|
+
:where([data-sx-file-actions] > button:focus-visible) {
|
|
193
|
+
outline: 2px solid var(--color-sx-primary, currentColor);
|
|
194
|
+
outline-offset: 1px;
|
|
195
|
+
}
|
|
196
|
+
:where([data-sx-file-actions] > button:disabled) {
|
|
197
|
+
opacity: 0.35;
|
|
198
|
+
cursor: default;
|
|
199
|
+
}
|
|
200
|
+
:where([data-sx-file-card][data-sx-leaving]) {
|
|
201
|
+
pointer-events: none;
|
|
202
|
+
}
|
|
203
|
+
:where([data-sx-file-page]) {
|
|
204
|
+
position: fixed;
|
|
205
|
+
inset: 0;
|
|
206
|
+
z-index: 2147483000;
|
|
207
|
+
display: none;
|
|
208
|
+
place-items: center;
|
|
209
|
+
isolation: isolate;
|
|
210
|
+
padding: 1.5rem;
|
|
211
|
+
box-sizing: border-box;
|
|
212
|
+
font-size: 1.5rem;
|
|
213
|
+
}
|
|
214
|
+
:where([data-sx-file][data-sx-page-over] [data-sx-file-page]) {
|
|
215
|
+
display: grid;
|
|
216
|
+
}
|
|
217
|
+
:where([data-sx-file-page] > [data-sx-file-layer]) {
|
|
218
|
+
position: absolute;
|
|
219
|
+
inset: 1rem;
|
|
220
|
+
z-index: -1;
|
|
221
|
+
pointer-events: none;
|
|
222
|
+
}
|
|
223
|
+
:where([data-sx-file-message]) {
|
|
224
|
+
grid-area: message;
|
|
225
|
+
display: grid;
|
|
226
|
+
grid-template-rows: 0fr;
|
|
227
|
+
}
|
|
228
|
+
:where([data-sx-file-message]:has([data-sx-file-says])) {
|
|
229
|
+
grid-template-rows: 1fr;
|
|
230
|
+
}
|
|
231
|
+
:where([data-sx-file-error]) {
|
|
232
|
+
min-block-size: 0;
|
|
233
|
+
margin: 0;
|
|
234
|
+
overflow: hidden;
|
|
235
|
+
}
|
|
236
|
+
:where([data-sx-file-says]) {
|
|
237
|
+
display: block;
|
|
238
|
+
padding-block-start: 0.375rem;
|
|
239
|
+
}
|
|
240
|
+
:where([data-sx-file-sr]) {
|
|
241
|
+
position: absolute;
|
|
242
|
+
inline-size: 1px;
|
|
243
|
+
block-size: 1px;
|
|
244
|
+
overflow: hidden;
|
|
245
|
+
clip-path: inset(50%);
|
|
246
|
+
white-space: nowrap;
|
|
247
|
+
}
|
|
248
|
+
@media (prefers-reduced-motion: reduce) {
|
|
249
|
+
:where([data-sx-file] [data-sx-file-layer]:not([data-sx-file-keep])) {
|
|
250
|
+
display: none;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
@media (forced-colors: active) {
|
|
254
|
+
:where([data-sx-file-zone]) {
|
|
255
|
+
border: 2px dashed CanvasText;
|
|
256
|
+
}
|
|
257
|
+
:where(${CONTROL}) {
|
|
258
|
+
color: CanvasText;
|
|
259
|
+
}
|
|
260
|
+
:where([data-sx-file-card]) {
|
|
261
|
+
border: 1px solid CanvasText;
|
|
262
|
+
}
|
|
263
|
+
:where([data-sx-file-fill]) {
|
|
264
|
+
forced-color-adjust: none;
|
|
265
|
+
background: Highlight;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}`;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Whether a file is one `accept` lets in: `.pdf` by name, `image/*` by type family, `image/png` by type. */
|
|
2
|
+
export declare function accepts(file: {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly type: string;
|
|
5
|
+
}, accept: string | undefined): boolean;
|
|
6
|
+
/** "2.4 MB", in the visitor's language. */
|
|
7
|
+
export declare function fileSize(bytes: number, locale?: string): string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// FileDrop's pure helpers: which files `accept` lets in, and a file's size in words. A plain module, so a server (or a
|
|
2
|
+
// form's own check) can use them too.
|
|
3
|
+
/** Whether a file is one `accept` lets in: `.pdf` by name, `image/*` by type family, `image/png` by type. */
|
|
4
|
+
export function accepts(file, accept) {
|
|
5
|
+
if (!accept)
|
|
6
|
+
return true;
|
|
7
|
+
const name = file.name.toLowerCase();
|
|
8
|
+
const type = file.type.toLowerCase();
|
|
9
|
+
return accept.split(",").some((raw) => {
|
|
10
|
+
const t = raw.trim().toLowerCase();
|
|
11
|
+
if (!t)
|
|
12
|
+
return false;
|
|
13
|
+
if (t.startsWith("."))
|
|
14
|
+
return name.endsWith(t);
|
|
15
|
+
if (t.endsWith("/*"))
|
|
16
|
+
return type.startsWith(t.slice(0, -1));
|
|
17
|
+
return type === t;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/** "2.4 MB", in the visitor's language. */
|
|
21
|
+
export function fileSize(bytes, locale) {
|
|
22
|
+
const [n, unit] = bytes >= 1e9 ? [bytes / 1e9, "gigabyte"] : bytes >= 1e6 ? [bytes / 1e6, "megabyte"] : bytes >= 1e3 ? [bytes / 1e3, "kilobyte"] : [bytes, "byte"];
|
|
23
|
+
try {
|
|
24
|
+
return new Intl.NumberFormat(locale, { style: "unit", unit, unitDisplay: "short", maximumFractionDigits: n < 10 ? 1 : 0 }).format(n);
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return `${Math.round(n * 10) / 10} ${unit === "byte" ? "B" : unit[0].toUpperCase() + "B"}`;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FormStepsBack, FormStepsNext, FormStepsProgress, FormStepsRoot, FormStepsStep } from "./controls/FormSteps.js";
|
|
2
|
+
/** A form in steps: `Root` holds them, `Step` is one, `Progress` shows where you are, `Next` and `Back` move. */
|
|
3
|
+
export declare const FormSteps: {
|
|
4
|
+
Root: typeof FormStepsRoot;
|
|
5
|
+
Step: typeof FormStepsStep;
|
|
6
|
+
Progress: typeof FormStepsProgress;
|
|
7
|
+
Next: typeof FormStepsNext;
|
|
8
|
+
Back: typeof FormStepsBack;
|
|
9
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// FormSteps as one object (`FormSteps.Root`, `.Step`, `.Progress`, `.Next`, `.Back`), built in a plain module: a
|
|
2
|
+
// "use client" module's exports reach a Server Component as opaque references, so an object built there would have
|
|
3
|
+
// no `.Root` on the server (.claude/rules/typescript-esm.md).
|
|
4
|
+
import { FormStepsBack, FormStepsNext, FormStepsProgress, FormStepsRoot, FormStepsStep } from "./controls/FormSteps.js";
|
|
5
|
+
/** A form in steps: `Root` holds them, `Step` is one, `Progress` shows where you are, `Next` and `Back` move. */
|
|
6
|
+
export const FormSteps = { Root: FormStepsRoot, Step: FormStepsStep, Progress: FormStepsProgress, Next: FormStepsNext, Back: FormStepsBack };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface FieldIds {
|
|
2
|
+
readonly control: string;
|
|
3
|
+
readonly label: string;
|
|
4
|
+
readonly description: string;
|
|
5
|
+
readonly error: string;
|
|
6
|
+
}
|
|
7
|
+
/** The ids of a control's parts, from its own id. */
|
|
8
|
+
export declare function fieldIds(id: string): FieldIds;
|
|
9
|
+
/**
|
|
10
|
+
* What `aria-describedby` points at: the error while there is one, the description otherwise, then whatever the
|
|
11
|
+
* developer passed. A screen reader then reads the error with the field, and never a stale hint over it.
|
|
12
|
+
*/
|
|
13
|
+
export declare function fieldDescribedBy(ids: FieldIds, state: {
|
|
14
|
+
readonly error: boolean;
|
|
15
|
+
readonly description: boolean;
|
|
16
|
+
readonly own?: string | undefined;
|
|
17
|
+
}): string | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// The accessibility contract's ids, derived from the control's id. Pure; tested.
|
|
2
|
+
/** The ids of a control's parts, from its own id. */
|
|
3
|
+
export function fieldIds(id) {
|
|
4
|
+
return { control: id, label: `${id}-label`, description: `${id}-description`, error: `${id}-error` };
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* What `aria-describedby` points at: the error while there is one, the description otherwise, then whatever the
|
|
8
|
+
* developer passed. A screen reader then reads the error with the field, and never a stale hint over it.
|
|
9
|
+
*/
|
|
10
|
+
export function fieldDescribedBy(ids, state) {
|
|
11
|
+
const parts = [state.error ? ids.error : state.description ? ids.description : undefined, state.own].filter(Boolean);
|
|
12
|
+
return parts.length > 0 ? parts.join(" ") : undefined;
|
|
13
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const INLINE_CSS = "@layer theme, base, components, utilities;\n@layer components {\n :where([data-sx-inline]) {\n --sx-inline-px: 0.5rem;\n --sx-inline-py: 0.25rem;\n position: relative;\n display: inline-grid;\n grid-template-columns: minmax(0, 1fr);\n align-items: center;\n max-inline-size: 100%;\n vertical-align: middle;\n }\n :where([data-sx-inline-view], [data-sx-inline-control]) {\n grid-area: 1 / 1;\n box-sizing: border-box;\n min-inline-size: 0;\n margin: 0;\n padding: var(--sx-inline-py) var(--sx-inline-px);\n font: inherit;\n line-height: 1.5;\n color: inherit;\n text-align: start;\n }\n :where([data-sx-inline-view]) {\n display: inline-flex;\n align-items: center;\n gap: 0.375rem;\n border: 1px solid transparent;\n border-radius: var(--radius-sx-control, 0.375rem);\n background: transparent;\n cursor: text;\n }\n :where([data-sx-inline-text]) {\n min-inline-size: 0;\n overflow-wrap: anywhere;\n white-space: pre-wrap;\n }\n :where([data-sx-inline-icon], [data-sx-inline-done]) {\n flex: none;\n inline-size: 0.9em;\n block-size: 0.9em;\n overflow: visible;\n fill: none;\n stroke: currentColor;\n stroke-width: 2;\n stroke-linecap: round;\n stroke-linejoin: round;\n }\n :where([data-sx-inline-done]) {\n display: none;\n }\n :where([data-sx-inline][data-sx-saved] [data-sx-inline-done]) {\n display: block;\n }\n :where([data-sx-inline-view]:focus-visible) {\n outline: 2px solid var(--color-sx-primary, currentColor);\n outline-offset: 2px;\n }\n :where([data-sx-inline-control]) {\n min-inline-size: 4ch;\n field-sizing: content;\n border: 1px solid transparent;\n border-radius: var(--radius-sx-control, 0.375rem);\n background: transparent;\n opacity: 0;\n pointer-events: none;\n resize: none;\n }\n :where([data-sx-inline][data-sx-editing] [data-sx-inline-control]) {\n opacity: 1;\n pointer-events: auto;\n }\n :where([data-sx-inline][data-sx-editing] [data-sx-inline-view]) {\n opacity: 0;\n pointer-events: none;\n }\n :where([data-sx-inline-control]:focus-visible) {\n outline: 2px solid var(--color-sx-primary, currentColor);\n outline-offset: 2px;\n }\n :where([data-sx-inline][data-sx-saving] [data-sx-inline-text]) {\n opacity: 0.6;\n }\n :where([data-sx-inline-sr]) {\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n }\n @media (pointer: coarse) {\n :where([data-sx-inline-control]) {\n font-size: max(16px, 1em);\n }\n }\n @media (forced-colors: active) {\n :where([data-sx-inline-control]) {\n border-color: CanvasText;\n }\n }\n}";
|
|
2
|
+
/** What moves: the field grows out of the text and back, and the saved tick draws. Dropped under reduced motion. */
|
|
3
|
+
export declare const INLINE_MOTION = "@layer components {\n :where([data-sx-inline-view], [data-sx-inline-control]) {\n transition: opacity 150ms ease-out, scale 150ms var(--ease-sx-out, ease-out);\n }\n :where([data-sx-inline]:not([data-sx-editing]) [data-sx-inline-control]) {\n scale: 0.97;\n }\n :where([data-sx-inline-done] path) {\n stroke-dasharray: 1 2;\n stroke-dashoffset: 1.01;\n animation: sx-form-inline-done 300ms var(--ease-sx-out, ease-out) forwards;\n }\n @keyframes sx-form-inline-done {\n to {\n stroke-dashoffset: 0;\n }\n }\n}";
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
// The structural sheet of InlineEdit: the text (a button) and the real input share one grid cell. At rest the input is
|
|
2
|
+
// there, invisible and inert (it still submits with the form); while editing, the button steps aside. Positioning only;
|
|
3
|
+
// the look is styles/form.css. Pure strings. See ./CLAUDE.md.
|
|
4
|
+
import { LAYER_ORDER } from "../backgrounds/runtime/rootCss.js";
|
|
5
|
+
const CONTROL = "[data-sx-inline-control]";
|
|
6
|
+
const VIEW = "[data-sx-inline-view]";
|
|
7
|
+
const EDITING = "[data-sx-editing]";
|
|
8
|
+
export const INLINE_CSS = `${LAYER_ORDER}
|
|
9
|
+
@layer components {
|
|
10
|
+
:where([data-sx-inline]) {
|
|
11
|
+
--sx-inline-px: 0.5rem;
|
|
12
|
+
--sx-inline-py: 0.25rem;
|
|
13
|
+
position: relative;
|
|
14
|
+
display: inline-grid;
|
|
15
|
+
grid-template-columns: minmax(0, 1fr);
|
|
16
|
+
align-items: center;
|
|
17
|
+
max-inline-size: 100%;
|
|
18
|
+
vertical-align: middle;
|
|
19
|
+
}
|
|
20
|
+
:where(${VIEW}, ${CONTROL}) {
|
|
21
|
+
grid-area: 1 / 1;
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
min-inline-size: 0;
|
|
24
|
+
margin: 0;
|
|
25
|
+
padding: var(--sx-inline-py) var(--sx-inline-px);
|
|
26
|
+
font: inherit;
|
|
27
|
+
line-height: 1.5;
|
|
28
|
+
color: inherit;
|
|
29
|
+
text-align: start;
|
|
30
|
+
}
|
|
31
|
+
:where(${VIEW}) {
|
|
32
|
+
display: inline-flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
gap: 0.375rem;
|
|
35
|
+
border: 1px solid transparent;
|
|
36
|
+
border-radius: var(--radius-sx-control, 0.375rem);
|
|
37
|
+
background: transparent;
|
|
38
|
+
cursor: text;
|
|
39
|
+
}
|
|
40
|
+
:where([data-sx-inline-text]) {
|
|
41
|
+
min-inline-size: 0;
|
|
42
|
+
overflow-wrap: anywhere;
|
|
43
|
+
white-space: pre-wrap;
|
|
44
|
+
}
|
|
45
|
+
:where([data-sx-inline-icon], [data-sx-inline-done]) {
|
|
46
|
+
flex: none;
|
|
47
|
+
inline-size: 0.9em;
|
|
48
|
+
block-size: 0.9em;
|
|
49
|
+
overflow: visible;
|
|
50
|
+
fill: none;
|
|
51
|
+
stroke: currentColor;
|
|
52
|
+
stroke-width: 2;
|
|
53
|
+
stroke-linecap: round;
|
|
54
|
+
stroke-linejoin: round;
|
|
55
|
+
}
|
|
56
|
+
:where([data-sx-inline-done]) {
|
|
57
|
+
display: none;
|
|
58
|
+
}
|
|
59
|
+
:where([data-sx-inline][data-sx-saved] [data-sx-inline-done]) {
|
|
60
|
+
display: block;
|
|
61
|
+
}
|
|
62
|
+
:where(${VIEW}:focus-visible) {
|
|
63
|
+
outline: 2px solid var(--color-sx-primary, currentColor);
|
|
64
|
+
outline-offset: 2px;
|
|
65
|
+
}
|
|
66
|
+
:where(${CONTROL}) {
|
|
67
|
+
min-inline-size: 4ch;
|
|
68
|
+
field-sizing: content;
|
|
69
|
+
border: 1px solid transparent;
|
|
70
|
+
border-radius: var(--radius-sx-control, 0.375rem);
|
|
71
|
+
background: transparent;
|
|
72
|
+
opacity: 0;
|
|
73
|
+
pointer-events: none;
|
|
74
|
+
resize: none;
|
|
75
|
+
}
|
|
76
|
+
:where([data-sx-inline]${EDITING} ${CONTROL}) {
|
|
77
|
+
opacity: 1;
|
|
78
|
+
pointer-events: auto;
|
|
79
|
+
}
|
|
80
|
+
:where([data-sx-inline]${EDITING} ${VIEW}) {
|
|
81
|
+
opacity: 0;
|
|
82
|
+
pointer-events: none;
|
|
83
|
+
}
|
|
84
|
+
:where(${CONTROL}:focus-visible) {
|
|
85
|
+
outline: 2px solid var(--color-sx-primary, currentColor);
|
|
86
|
+
outline-offset: 2px;
|
|
87
|
+
}
|
|
88
|
+
:where([data-sx-inline][data-sx-saving] [data-sx-inline-text]) {
|
|
89
|
+
opacity: 0.6;
|
|
90
|
+
}
|
|
91
|
+
:where([data-sx-inline-sr]) {
|
|
92
|
+
position: absolute;
|
|
93
|
+
inline-size: 1px;
|
|
94
|
+
block-size: 1px;
|
|
95
|
+
overflow: hidden;
|
|
96
|
+
clip-path: inset(50%);
|
|
97
|
+
white-space: nowrap;
|
|
98
|
+
}
|
|
99
|
+
@media (pointer: coarse) {
|
|
100
|
+
:where(${CONTROL}) {
|
|
101
|
+
font-size: max(16px, 1em);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
@media (forced-colors: active) {
|
|
105
|
+
:where(${CONTROL}) {
|
|
106
|
+
border-color: CanvasText;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}`;
|
|
110
|
+
/** What moves: the field grows out of the text and back, and the saved tick draws. Dropped under reduced motion. */
|
|
111
|
+
export const INLINE_MOTION = `@layer components {
|
|
112
|
+
:where(${VIEW}, ${CONTROL}) {
|
|
113
|
+
transition: opacity 150ms ease-out, scale 150ms var(--ease-sx-out, ease-out);
|
|
114
|
+
}
|
|
115
|
+
:where([data-sx-inline]:not(${EDITING}) ${CONTROL}) {
|
|
116
|
+
scale: 0.97;
|
|
117
|
+
}
|
|
118
|
+
:where([data-sx-inline-done] path) {
|
|
119
|
+
stroke-dasharray: 1 2;
|
|
120
|
+
stroke-dashoffset: 1.01;
|
|
121
|
+
animation: sx-form-inline-done 300ms var(--ease-sx-out, ease-out) forwards;
|
|
122
|
+
}
|
|
123
|
+
@keyframes sx-form-inline-done {
|
|
124
|
+
to {
|
|
125
|
+
stroke-dashoffset: 0;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const NUMBER_CSS: string;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// NumberField's own small sheet, on top of Field's: the browser's spin buttons hidden (ours replace them), the rolling
|
|
2
|
+
// digits laid over the input's own text, the scrub cursor on the label, and the shake at a limit.
|
|
3
|
+
const CONTROL = "[data-sx-field-control]";
|
|
4
|
+
/** The browser's own spin buttons, one rule each: a browser drops a whole selector list that names another's part. */
|
|
5
|
+
const SPIN = ["::-webkit-inner-spin-button", "::-webkit-outer-spin-button"];
|
|
6
|
+
export const NUMBER_CSS = `@layer components {
|
|
7
|
+
:where([data-sx-number]) {
|
|
8
|
+
display: contents;
|
|
9
|
+
}
|
|
10
|
+
:where([data-sx-number] ${CONTROL}) {
|
|
11
|
+
appearance: textfield;
|
|
12
|
+
font-variant-numeric: tabular-nums;
|
|
13
|
+
}
|
|
14
|
+
${SPIN.map((part) => ` :where([data-sx-number] ${CONTROL})${part} {
|
|
15
|
+
appearance: none;
|
|
16
|
+
margin: 0;
|
|
17
|
+
}`).join("\n")}
|
|
18
|
+
:where([data-sx-number]:not([data-sx-typing]):has([data-sx-number-roll]) ${CONTROL}) {
|
|
19
|
+
color: transparent;
|
|
20
|
+
caret-color: var(--color-sx-ink, CanvasText);
|
|
21
|
+
}
|
|
22
|
+
:where([data-sx-number-roll]) {
|
|
23
|
+
position: absolute;
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
white-space: nowrap;
|
|
29
|
+
font-variant-numeric: tabular-nums;
|
|
30
|
+
pointer-events: none;
|
|
31
|
+
}
|
|
32
|
+
:where([data-sx-number][data-sx-typing] [data-sx-number-roll]) {
|
|
33
|
+
visibility: hidden;
|
|
34
|
+
}
|
|
35
|
+
:where([data-sx-number-step][aria-disabled="true"]) {
|
|
36
|
+
opacity: 0.4;
|
|
37
|
+
cursor: default;
|
|
38
|
+
}
|
|
39
|
+
:where([data-sx-number][data-sx-scrub] [data-sx-field-label]) {
|
|
40
|
+
cursor: ew-resize;
|
|
41
|
+
touch-action: pan-y;
|
|
42
|
+
user-select: none;
|
|
43
|
+
-webkit-user-select: none;
|
|
44
|
+
}
|
|
45
|
+
:where([data-sx-number][data-sx-limit] > [data-sx-field]) {
|
|
46
|
+
--sx-field-edge: var(--color-sx-danger, currentColor);
|
|
47
|
+
}
|
|
48
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
49
|
+
:where([data-sx-number][data-sx-limit] [data-sx-field-box]) {
|
|
50
|
+
animation: sx-form-number-limit 0.32s ease-out;
|
|
51
|
+
}
|
|
52
|
+
@keyframes sx-form-number-limit {
|
|
53
|
+
20% { translate: 4px 0; }
|
|
54
|
+
40% { translate: -4px 0; }
|
|
55
|
+
60% { translate: 3px 0; }
|
|
56
|
+
80% { translate: -2px 0; }
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
@media (forced-colors: active) {
|
|
60
|
+
:where([data-sx-number]:not([data-sx-typing]):has([data-sx-number-roll]) ${CONTROL}) {
|
|
61
|
+
color: CanvasText;
|
|
62
|
+
}
|
|
63
|
+
:where([data-sx-number-roll]) {
|
|
64
|
+
display: none;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}`;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const OTP_CSS = "@layer theme, base, components, utilities;\n@layer components {\n :where([data-sx-otp]) {\n --sx-otp-w: 2.75rem;\n --sx-otp-h: 3.25rem;\n --sx-otp-gap: 0.5rem;\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n grid-template-areas: \"label\" \"box\" \"description\" \"message\";\n justify-items: start;\n min-inline-size: 0;\n }\n :where([data-sx-otp-label]) {\n grid-area: label;\n margin-block-end: 0.375rem;\n }\n :where([data-sx-otp-box]) {\n grid-area: box;\n position: relative;\n max-inline-size: 100%;\n }\n :where([data-sx-otp-slots]) {\n display: flex;\n align-items: center;\n gap: var(--sx-otp-gap);\n }\n :where([data-sx-otp-slot]) {\n position: relative;\n display: grid;\n place-items: center;\n flex: 0 1 var(--sx-otp-w);\n min-inline-size: 1.5rem;\n block-size: var(--sx-otp-h);\n box-sizing: border-box;\n font-size: 1.25rem;\n font-variant-numeric: tabular-nums;\n line-height: 1;\n }\n :where([data-sx-otp-char]) {\n grid-area: 1 / 1;\n }\n :where([data-sx-otp-gap]) {\n display: grid;\n place-items: center;\n inline-size: 0.75rem;\n }\n :where([data-sx-otp-gap] > span) {\n inline-size: 100%;\n block-size: 2px;\n border-radius: 1px;\n background: currentColor;\n opacity: 0.4;\n }\n :where([data-sx-otp-control]) {\n position: absolute;\n inset: 0;\n z-index: 1;\n inline-size: 100%;\n block-size: 100%;\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n color: transparent;\n -webkit-text-fill-color: transparent;\n caret-color: transparent;\n font: inherit;\n font-size: max(16px, 1em);\n letter-spacing: 0;\n outline: none;\n cursor: text;\n appearance: none;\n }\n :where([data-sx-otp-control])::selection {\n background: transparent;\n color: transparent;\n }\n :where([data-sx-otp-control]:autofill) {\n -webkit-text-fill-color: transparent;\n transition: background-color 0s 600000s, color 0s 600000s;\n }\n :where([data-sx-otp-control]:disabled) {\n cursor: not-allowed;\n }\n :where([data-sx-otp]:has([data-sx-otp-control]:focus) [data-sx-otp-slot][data-active], [data-sx-otp]:has([data-sx-otp-control]:focus) [data-sx-otp-slot][data-selected]) {\n outline: 2px solid var(--color-sx-primary, currentColor);\n outline-offset: -1px;\n z-index: 0;\n }\n :where([data-sx-otp-caret]) {\n grid-area: 1 / 1;\n inline-size: 2px;\n block-size: 1.15em;\n border-radius: 1px;\n background: currentColor;\n opacity: 0;\n }\n :where([data-sx-otp]:has([data-sx-otp-control]:focus) [data-sx-otp-slot][data-active]:not([data-filled]) [data-sx-otp-caret]) {\n opacity: 1;\n }\n :where([data-sx-otp-description]) {\n grid-area: description;\n margin: 0.375rem 0 0;\n }\n :where([data-sx-otp-message]) {\n grid-area: message;\n display: grid;\n grid-template-rows: 0fr;\n }\n :where([data-sx-otp-message]:has([data-sx-otp-says])) {\n grid-template-rows: 1fr;\n }\n :where([data-sx-otp-error]) {\n min-block-size: 0;\n overflow: hidden;\n margin: 0;\n }\n :where([data-sx-otp-says]) {\n display: block;\n padding-block-start: 0.375rem;\n }\n @media (forced-colors: active) {\n :where([data-sx-otp-slot]) {\n border: 1px solid CanvasText;\n }\n :where([data-sx-otp]:has([data-sx-otp-control]:focus) [data-sx-otp-slot][data-active], [data-sx-otp]:has([data-sx-otp-control]:focus) [data-sx-otp-slot][data-selected]) {\n outline-color: Highlight;\n }\n :where([data-sx-otp-caret]) {\n forced-color-adjust: none;\n background: CanvasText;\n }\n }\n}";
|
|
2
|
+
/** What moves: a typed character pops in (only while the field has the focus: never on load), the caret blinks and
|
|
3
|
+
* stays lit when the page pauses its loops (WCAG 2.2.2). Dropped under reduced motion. */
|
|
4
|
+
export declare const OTP_MOTION = "@layer components {\n :where([data-sx-otp-char]) {\n transition: scale 160ms var(--ease-sx-out, ease-out), opacity 160ms var(--ease-sx-out, ease-out);\n }\n @starting-style {\n :where([data-sx-otp]:has([data-sx-otp-control]:focus) [data-sx-otp-char]) {\n scale: 0.6;\n opacity: 0;\n }\n }\n :where([data-sx-otp-slot]) {\n transition: outline-color 120ms ease-out;\n }\n :where([data-sx-otp]:has([data-sx-otp-control]:focus) [data-sx-otp-slot][data-active]:not([data-filled]) [data-sx-otp-caret]) {\n animation: sx-form-otp-blink 1.06s steps(1, end) infinite;\n }\n :where(html[data-sx-loops-paused] [data-sx-otp-caret]) {\n animation: none;\n }\n @keyframes sx-form-otp-blink {\n 50% {\n opacity: 0;\n }\n }\n}";
|