@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
package/dist/schema/types.d.ts
CHANGED
|
@@ -135,7 +135,7 @@ export interface EffectValue {
|
|
|
135
135
|
readonly options: Readonly<Record<string, unknown>>;
|
|
136
136
|
}
|
|
137
137
|
/** The groups of configurable pieces. */
|
|
138
|
-
export declare const SCHEMA_FAMILIES: readonly ["background", "transition", "reveal", "carousel-layout", "carousel-modifier", "carousel-presence", "carousel-open", "carousel-physics", "carousel", "ticker", "grid", "grid-open", "scroll", "button", "text", "word-cycle", "typewriter", "number-roll"];
|
|
138
|
+
export declare const SCHEMA_FAMILIES: readonly ["background", "transition", "reveal", "carousel-layout", "carousel-modifier", "carousel-presence", "carousel-open", "carousel-physics", "carousel", "ticker", "grid", "grid-open", "scroll", "button", "text", "word-cycle", "typewriter", "number-roll", "form"];
|
|
139
139
|
export type SchemaFamily = (typeof SCHEMA_FAMILIES)[number];
|
|
140
140
|
/** Where a factory is imported from. */
|
|
141
141
|
export type SchemaEntry = "@sharedex/ui" | "@sharedex/ui/three";
|
|
@@ -147,7 +147,7 @@ export interface SchemaMeta {
|
|
|
147
147
|
readonly family?: string;
|
|
148
148
|
/** The weakest device it runs smoothly on: all, mid, high. */
|
|
149
149
|
readonly tier?: string;
|
|
150
|
-
/** Where it can play (transitions: `carousel`, `reveal`). */
|
|
150
|
+
/** Where it can play (transitions: `carousel`, `reveal`; form effects: the controls they fit, `field`, `checkbox` …). */
|
|
151
151
|
readonly modes?: readonly string[];
|
|
152
152
|
}
|
|
153
153
|
/** One configurable piece. */
|
package/dist/schema/types.js
CHANGED
package/guides/README.md
CHANGED
|
@@ -1,61 +1,62 @@
|
|
|
1
|
-
# @sharedex/ui section guides (for Claude Code)
|
|
2
|
-
|
|
3
|
-
One guide per headless section. Read the guide for a section before building or
|
|
4
|
-
restyling it. They ship inside the package, so they always match the installed
|
|
5
|
-
version: `node_modules/@sharedex/ui/guides/<section>.md`.
|
|
6
|
-
|
|
7
|
-
| Section | Guide |
|
|
8
|
-
|---|---|
|
|
9
|
-
| Hero | [hero.md](hero.md) |
|
|
10
|
-
| About | [about.md](about.md) |
|
|
11
|
-
| Services | [services.md](services.md) |
|
|
12
|
-
| Contact | [contact.md](contact.md) |
|
|
13
|
-
| Backgrounds (any section) | [backgrounds.md](backgrounds.md) |
|
|
14
|
-
| Transitions (reveals, slideshows, scroll effects) | [transitions.md](transitions.md) |
|
|
15
|
-
| Galleries: 3D carousels, Ticker, Grid | [gallery.md](gallery.md) |
|
|
16
|
-
| Buttons and their effects (any section's actions) | [buttons.md](buttons.md) |
|
|
17
|
-
| Text effects (titles, eyebrows, cycling words, rolling figures) | [text.md](text.md) |
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
`
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
the
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
1
|
+
# @sharedex/ui section guides (for Claude Code)
|
|
2
|
+
|
|
3
|
+
One guide per headless section. Read the guide for a section before building or
|
|
4
|
+
restyling it. They ship inside the package, so they always match the installed
|
|
5
|
+
version: `node_modules/@sharedex/ui/guides/<section>.md`.
|
|
6
|
+
|
|
7
|
+
| Section | Guide |
|
|
8
|
+
|---|---|
|
|
9
|
+
| Hero | [hero.md](hero.md) |
|
|
10
|
+
| About | [about.md](about.md) |
|
|
11
|
+
| Services | [services.md](services.md) |
|
|
12
|
+
| Contact | [contact.md](contact.md) |
|
|
13
|
+
| Backgrounds (any section) | [backgrounds.md](backgrounds.md) |
|
|
14
|
+
| Transitions (reveals, slideshows, scroll effects) | [transitions.md](transitions.md) |
|
|
15
|
+
| Galleries: 3D carousels, Ticker, Grid | [gallery.md](gallery.md) |
|
|
16
|
+
| Buttons and their effects (any section's actions) | [buttons.md](buttons.md) |
|
|
17
|
+
| Text effects (titles, eyebrows, cycling words, rolling figures) | [text.md](text.md) |
|
|
18
|
+
| Forms: every control, the wiring, form effects | [forms.md](forms.md) |
|
|
19
|
+
|
|
20
|
+
## Rules for every section
|
|
21
|
+
|
|
22
|
+
- **Layout and content come from the package; the look comes from the project.**
|
|
23
|
+
Pick the layout with the `layout` prop and pass the client's real copy in
|
|
24
|
+
`content`. Don't rebuild a section from scratch with divs.
|
|
25
|
+
- **The default look reads only the `sx-*` tokens.** In a project generated by
|
|
26
|
+
the sharedex Design System Builder, `design/theme.css` already points them at
|
|
27
|
+
the project's brand, so sections match before you change anything.
|
|
28
|
+
- **Configured pieces are already in `design/effects.ts`** (in a project the
|
|
29
|
+
builder generated): the primary buttons' effects, backgrounds, reveals,
|
|
30
|
+
slideshow looks, carousel configs, and the props of tickers, grids and scroll
|
|
31
|
+
effects, the headings' text effects (`titleEffects`, `eyebrowEffects`), the form
|
|
32
|
+
controls' effects (`fieldEffects`, `checkboxEffects` …), as named constants.
|
|
33
|
+
Import them by the names `design/page-plan.md` uses and spread or pass them
|
|
34
|
+
as it shows; don't re-create them, and never call an effect factory during
|
|
35
|
+
render (a new object every render restarts it).
|
|
36
|
+
- **Server Components (Next.js App Router)**: sections, CSS / SVG / image
|
|
37
|
+
backgrounds, reveals and scroll effects work in a Server Component. Carousels,
|
|
38
|
+
slideshows, Tickers and Grids take functions as children, and canvas / WebGL /
|
|
39
|
+
Three.js backgrounds are programs: a page using them is `"use client"`, or
|
|
40
|
+
keeps them in a client component of its own.
|
|
41
|
+
- **Restyle with `className` on any part.** Defaults sit in Tailwind's
|
|
42
|
+
`components` layer; your utility classes always win. Never use `!important`.
|
|
43
|
+
- **`unstyled` on `Root`** removes every visual default and keeps the layout.
|
|
44
|
+
Use it only when the design differs from the default in most parts.
|
|
45
|
+
- **`background` on `Root`** takes a decorative layer, usually
|
|
46
|
+
`<Background.Root effect={…} />`. It sits behind the content automatically.
|
|
47
|
+
See [backgrounds.md](backgrounds.md) for picking an effect.
|
|
48
|
+
- **`reveal` on `Root`** makes the main parts appear one after another when the
|
|
49
|
+
section scrolls into view: `reveal` (fadeUp), `reveal={blurFade()}`, or
|
|
50
|
+
`reveal={{ effect, stagger, delay }}`. See [transitions.md](transitions.md).
|
|
51
|
+
- **`actionEffect` on `Hero.Root`** turns the actions into `Button`s, the first
|
|
52
|
+
wearing the effects. See [buttons.md](buttons.md).
|
|
53
|
+
- **`titleEffect` / `eyebrowEffect` on every `Root`** put text effects on the
|
|
54
|
+
title and the eyebrow; the Hero's `titleWords` + `titleCycle` add a cycling
|
|
55
|
+
word, About's `statRoll` rolls the figures. See [text.md](text.md).
|
|
56
|
+
- **Compose parts to change structure**: render `<X.Root>` with your own
|
|
57
|
+
children and place the parts (and your own elements) in the order you need.
|
|
58
|
+
- **Layouts respond to the section's own width** (container queries), not the
|
|
59
|
+
viewport. Don't add breakpoint classes to change a layout's column count;
|
|
60
|
+
pick another layout instead.
|
|
61
|
+
- **RTL works through logical properties.** Use `ms-*`/`me-*`/`ps-*`/`pe-*` and
|
|
62
|
+
`text-start`/`text-end` in your own classes too.
|
package/guides/contact.md
CHANGED
|
@@ -1,76 +1,99 @@
|
|
|
1
|
-
# Contact
|
|
2
|
-
|
|
3
|
-
How to reach the client: details, the project's own form, and an optional map.
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import { Contact } from "@sharedex/ui";
|
|
7
|
-
|
|
8
|
-
<Contact.Root
|
|
9
|
-
layout="split-info"
|
|
10
|
-
content={{
|
|
11
|
-
title: "Come by or get in touch",
|
|
12
|
-
description: "We answer emails within a day.",
|
|
13
|
-
details: [
|
|
14
|
-
{ label: "Address", value: "Rua das Flores 12, Lisbon", href: "https://maps.app.goo.gl/…" },
|
|
15
|
-
{ label: "Phone", value: "+351 21 000 0000", href: "tel:+351210000000" },
|
|
16
|
-
{ label: "Email", value: "hello@example.com", href: "mailto:hello@example.com" },
|
|
17
|
-
{ label: "Opening hours", value: "Tue–Sun, 7:00–19:00" },
|
|
18
|
-
],
|
|
19
|
-
map: { src: "https://www.openstreetmap.org/export/embed.html?…", title: "Map of our shop" },
|
|
20
|
-
}}
|
|
21
|
-
>
|
|
22
|
-
<Contact.Info />
|
|
23
|
-
<Contact.Form>
|
|
24
|
-
<ContactForm /> {/* the project's form
|
|
25
|
-
</Contact.Form>
|
|
26
|
-
<Contact.Map />
|
|
27
|
-
</Contact.Root>
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
`Contact.Form` is only a slot in the layout. Build the form in the project
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
1
|
+
# Contact
|
|
2
|
+
|
|
3
|
+
How to reach the client: details, the project's own form, and an optional map.
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { Contact } from "@sharedex/ui";
|
|
7
|
+
|
|
8
|
+
<Contact.Root
|
|
9
|
+
layout="split-info"
|
|
10
|
+
content={{
|
|
11
|
+
title: "Come by or get in touch",
|
|
12
|
+
description: "We answer emails within a day.",
|
|
13
|
+
details: [
|
|
14
|
+
{ label: "Address", value: "Rua das Flores 12, Lisbon", href: "https://maps.app.goo.gl/…" },
|
|
15
|
+
{ label: "Phone", value: "+351 21 000 0000", href: "tel:+351210000000" },
|
|
16
|
+
{ label: "Email", value: "hello@example.com", href: "mailto:hello@example.com" },
|
|
17
|
+
{ label: "Opening hours", value: "Tue–Sun, 7:00–19:00" },
|
|
18
|
+
],
|
|
19
|
+
map: { src: "https://www.openstreetmap.org/export/embed.html?…", title: "Map of our shop" },
|
|
20
|
+
}}
|
|
21
|
+
>
|
|
22
|
+
<Contact.Info />
|
|
23
|
+
<Contact.Form>
|
|
24
|
+
<ContactForm /> {/* the project's form, built from @sharedex/ui's controls */}
|
|
25
|
+
</Contact.Form>
|
|
26
|
+
<Contact.Map />
|
|
27
|
+
</Contact.Root>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`Contact.Form` is only a slot in the layout. Build the form in the project, from
|
|
31
|
+
`@sharedex/ui`'s controls, wired the project's way (read
|
|
32
|
+
`node_modules/@sharedex/ui/guides/forms.md`). Without children, the default
|
|
33
|
+
composition is `Contact.Info` + `Contact.Map` (no form).
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
"use client"; // React Hook Form runs in the browser; the section around it can stay a Server Component
|
|
37
|
+
import { Field, Checkbox, ErrorSummary, Button } from "@sharedex/ui";
|
|
38
|
+
import { fieldEffects, checkboxEffects, primaryButtonEffects } from "@/design/effects"; // those the design picked
|
|
39
|
+
|
|
40
|
+
export function ContactForm() {
|
|
41
|
+
const { register, handleSubmit, formState: { errors, submitCount } } = useForm({ resolver, defaultValues, mode: "onTouched", shouldFocusError: false });
|
|
42
|
+
return (
|
|
43
|
+
<form noValidate onSubmit={handleSubmit(send)}>
|
|
44
|
+
<ErrorSummary errors={errors} attempt={submitCount} />
|
|
45
|
+
<Field label="Email" type="email" autoComplete="email" effect={fieldEffects} error={errors.email?.message} {...register("email")} />
|
|
46
|
+
<Field as="textarea" label="Message" rows={4} grow counter={1000} effect={fieldEffects} error={errors.message?.message} {...register("message")} />
|
|
47
|
+
<Checkbox label="I agree to the privacy notice" effect={checkboxEffects} error={errors.privacy?.message} {...register("privacy")} />
|
|
48
|
+
<Button type="submit" effect={primaryButtonEffects}>Send message</Button>
|
|
49
|
+
</form>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
After a successful send, `FormSwap` (`look="success"`) swaps the form for the thanks
|
|
55
|
+
message and moves the focus to it, so a screen reader reads it.
|
|
56
|
+
|
|
57
|
+
## Layouts
|
|
58
|
+
|
|
59
|
+
| `layout` | Use when |
|
|
60
|
+
|---|---|
|
|
61
|
+
| `split-info` | The standard: details beside the form, map full width below. |
|
|
62
|
+
| `centered` | A short page or no map: one narrow centred column, details in a row. |
|
|
63
|
+
| `map` | Location matters (shop, venue): details and form beside a tall map. |
|
|
64
|
+
|
|
65
|
+
## Content
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
interface ContactContent {
|
|
69
|
+
eyebrow?: string;
|
|
70
|
+
title: string; // <h2>
|
|
71
|
+
description?: string;
|
|
72
|
+
details?: { label: string; value: string; href?: string }[]; // rendered as a <dl>
|
|
73
|
+
map?: { src: string; title: string }; // an embeddable map URL; title is required for the iframe
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Parts
|
|
78
|
+
|
|
79
|
+
`Contact.Root` › `Contact.Info` (`Contact.Eyebrow`, `Contact.Title`,
|
|
80
|
+
`Contact.Description`, `Contact.Details`) · `Contact.Form` (slot) ·
|
|
81
|
+
`Contact.Map`.
|
|
82
|
+
|
|
83
|
+
## Background
|
|
84
|
+
|
|
85
|
+
`<Contact.Root background={<Background.Root effect={dotPattern()} />}>` draws a decorative layer behind
|
|
86
|
+
the content (the section is its stacking context, so the content needs no z-index). Any effect from
|
|
87
|
+
`@sharedex/ui` works, or from `@sharedex/ui/three` for the Three.js ones. Keep it still or nearly still: people are reading and typing here. Read
|
|
88
|
+
`node_modules/@sharedex/ui/guides/backgrounds.md` before picking one.
|
|
89
|
+
|
|
90
|
+
## Reveal
|
|
91
|
+
|
|
92
|
+
`reveal` on `Root` plays a transition on the main parts as the section scrolls into view, once:
|
|
93
|
+
the info, then the form, then the map. `reveal` alone is `fadeUp()`, 0.12 s apart; `reveal={blurFade()}` picks the transition;
|
|
94
|
+
`reveal={{ effect, stagger, delay, duration }}` sets the timing. See
|
|
95
|
+
`node_modules/@sharedex/ui/guides/transitions.md`.
|
|
96
|
+
|
|
74
97
|
## Text effects
|
|
75
98
|
|
|
76
99
|
`titleEffect` and `eyebrowEffect` on `Root` put text effects on the title and the eyebrow (one, or a list that
|
|
@@ -78,7 +101,7 @@ stacks): they render as `Text` wearing them. Left out, they stay plain elements.
|
|
|
78
101
|
System Builder generated, pass the configured constants: `titleEffect={titleEffects}`, `eyebrowEffect={eyebrowEffects}`
|
|
79
102
|
from `design/effects.ts`. Read `node_modules/@sharedex/ui/guides/text.md`.
|
|
80
103
|
|
|
81
|
-
## Don't
|
|
82
|
-
|
|
83
|
-
- Don't put the form's submit logic in the section; it lives with the form.
|
|
84
|
-
- Don't embed a map without the client's address confirmed.
|
|
104
|
+
## Don't
|
|
105
|
+
|
|
106
|
+
- Don't put the form's submit logic in the section; it lives with the form.
|
|
107
|
+
- Don't embed a map without the client's address confirmed.
|
package/guides/forms.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Forms
|
|
2
|
+
|
|
3
|
+
`@sharedex/ui`'s form controls each render the browser's own control (`<input>`, `<textarea>`, `<select>`, a checkbox,
|
|
4
|
+
a radio, a range, a file input) and paint around it. The real control does the work: the label, the keyboard, autofill,
|
|
5
|
+
password managers, screen readers, a plain form submit. Effects are plain descriptions (`inputFloat()`) that stack.
|
|
6
|
+
Don't build inputs by hand.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { Field, Checkbox, Switch, Select, ErrorSummary, inputFloat, validColor, checkDraw } from "@sharedex/ui";
|
|
10
|
+
|
|
11
|
+
// module level: an effect made during render is a new object every render
|
|
12
|
+
const fieldEffects = [inputFloat(), validColor()];
|
|
13
|
+
|
|
14
|
+
<Field label="Email" type="email" effect={fieldEffects} error={errors.email?.message} {...register("email")} />
|
|
15
|
+
<Checkbox label="I agree to the terms" effect={checkDraw()} {...register("terms")} />
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
In a project generated by the sharedex Design System Builder, the design's effects are ready in `design/effects.ts`,
|
|
19
|
+
one list per kind of control: `fieldEffects` (`Field`, `NumberField`), `checkboxEffects` (`Checkbox`, `CheckGroup`),
|
|
20
|
+
`radioEffects` (`RadioGroup`), `switchEffects` (`Switch`), `pickerEffects` (`Select`, `Combobox`, `TagsField`),
|
|
21
|
+
`rangeEffects` (`Range`); only the ones the design picked exist. Use those; don't pick new ones. The look of fields is
|
|
22
|
+
the design's: pass nothing, or `variant` as `.claude/rules/design-system.md` says.
|
|
23
|
+
|
|
24
|
+
## The controls
|
|
25
|
+
|
|
26
|
+
| Need | Control | Value |
|
|
27
|
+
|---|---|---|
|
|
28
|
+
| Text, email, password, a message | `Field` (`as="textarea"`; `clearable`, `reveal`, `counter`, `strength`, `status`, `hint`, `grow`; `inline` inside a sentence) | native: `register` |
|
|
29
|
+
| One choice, on or off | `Checkbox`, `Switch` | native |
|
|
30
|
+
| Several choices | `CheckGroup` (select all, a count), `ChipGroup` (filter chips) | native (a list) |
|
|
31
|
+
| One of a few | `RadioGroup` (cards, segments, stars through effects), `ChipGroup multiple={false}` | native |
|
|
32
|
+
| One of many | `Select` (the real `<select>`) | native |
|
|
33
|
+
| Search, many at once, your own words | `Combobox` (`multiple`, `creatable`, `loading`), `TagsField` | a list: `Controller` |
|
|
34
|
+
| A number | `NumberField` (steps, scrub), `Range` (one or two thumbs) | native (`valueAsNumber`); two thumbs: `Controller` |
|
|
35
|
+
| A one-time code, a PIN | `OtpField` (`mask` for a PIN) | native |
|
|
36
|
+
| Files | `FileDrop` (`accept`, `maxSize`, `maxFiles`, `reorder`, `page`, `progress`) | `File[]`: `Controller` |
|
|
37
|
+
| Errors | `ErrorSummary` (takes the focus on submit), `focusFirstError(form)` | |
|
|
38
|
+
| Flow | `FormSteps` (`Root` / `Step` / `Progress` / `Next` / `Back`), `FormReveal`, `FormSwap` | |
|
|
39
|
+
| Small widgets | `InlineEdit`, `SaveStatus`, `PasswordRules`, `FormBuddy` (a sign-in companion) | |
|
|
40
|
+
|
|
41
|
+
## Wiring (React Hook Form + Zod)
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
// the schema is a module-level constant; only the resolver changes, with the language
|
|
45
|
+
const resolver = useMemo(() => zodResolver(schema, { error: makeZodErrorMap(t) }), [t, i18n.language]);
|
|
46
|
+
const { register, control, handleSubmit, formState: { errors, submitCount } } = useForm({
|
|
47
|
+
resolver, defaultValues, mode: "onTouched", shouldFocusError: false,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
<form noValidate onSubmit={handleSubmit(send)}>
|
|
51
|
+
<ErrorSummary errors={errors} attempt={submitCount} />
|
|
52
|
+
<Field label={t("name")} effect={fieldEffects} error={errors.name?.message} {...register("name")} />
|
|
53
|
+
<RadioGroup label={t("plan")} options={plans} error={errors.plan?.message} {...register("plan")} />
|
|
54
|
+
<Controller name="topics" control={control} render={({ field }) => (
|
|
55
|
+
<Combobox label={t("topics")} multiple options={topics} error={errors.topics?.message} {...field} />
|
|
56
|
+
)} />
|
|
57
|
+
<Controller name="files" control={control} render={({ field }) => (
|
|
58
|
+
<FileDrop label={t("files")} accept="image/*,.pdf" maxSize={5_000_000} error={errors.files?.message} {...field} />
|
|
59
|
+
)} />
|
|
60
|
+
</form>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
- **Every prop and the `ref` land on the real control**, so `register()` spreads straight onto `Field`, `Checkbox`,
|
|
64
|
+
`CheckGroup`, `RadioGroup`, `Switch`, `Select`, `ChipGroup`, `OtpField`, `NumberField` and a one-thumb `Range`. A value
|
|
65
|
+
no native control holds (a list, files) goes through a `Controller`'s `field`, as it is.
|
|
66
|
+
- **The error's words go in `error`.** The control then sets `aria-invalid`, points `aria-describedby` at the message,
|
|
67
|
+
and announces it. A red line or a shake is never the only signal.
|
|
68
|
+
- `mode: "onTouched"` checks a field when it is first left, then live: the same moment `:user-invalid` picks. Complete
|
|
69
|
+
`defaultValues`: `""` for text, `false` for a checkbox, `[]` for lists, `undefined` for a radio group.
|
|
70
|
+
- The error map goes in per parse, never through `z.config()` (it is global and would mix languages on a server). The
|
|
71
|
+
server action re-runs `schema.safeParse(values, { error: makeZodErrorMap(t) })` in the sender's language and returns
|
|
72
|
+
the first message.
|
|
73
|
+
- **A plain form works too**: every control submits its value by name (lists as several inputs, files in the real file
|
|
74
|
+
input), and the browser's own checks (`required`, `type`, `pattern`) drive the same error looks.
|
|
75
|
+
- **Files go from the browser to storage** (a signed upload address); the form sends their addresses. `FileDrop`'s
|
|
76
|
+
`progress(file)` shows how far each got.
|
|
77
|
+
|
|
78
|
+
## Effects
|
|
79
|
+
|
|
80
|
+
Each control takes `effect`: one effect or a list; they stack. Effect names start with their control: `input*` and
|
|
81
|
+
`valid*` (Field), `check*`, `radio*`, `switch*`, `picker*` / `list*` / `chipPop` (Select, Combobox, TagsField), `range*`,
|
|
82
|
+
`chip*` (ChipGroup), `file*` (FileDrop), `step*` (FormSteps). A control warns in development about an effect made for
|
|
83
|
+
another one, and about two effects that move the same thing (the last wins: keep one).
|
|
84
|
+
|
|
85
|
+
- **One look per moment.** A floating label with an underline and a red/green border reads well; five label effects
|
|
86
|
+
don't.
|
|
87
|
+
- **Server Components:** the controls are client components that a Server Component can render, and almost every
|
|
88
|
+
effect is plain data. `checkConfetti`, `rangeElastic` and `inputCycle` (unless `vanish: false`) carry code: the
|
|
89
|
+
component holding them starts with `"use client"`. `FormReveal` needs no client code at all.
|
|
90
|
+
- **Reduced motion** keeps every state (an error's colour and words, a check, a chosen option) and drops the movement.
|
|
91
|
+
Endless loops (`inputBeam`, `inputSkeleton`, `switchNeon`) pause off screen and with the page's pause switch
|
|
92
|
+
(`usePauseLoops`).
|
|
93
|
+
|
|
94
|
+
## Rules
|
|
95
|
+
|
|
96
|
+
- A real `<label>` for every control (`label`, or `aria-label` where the sentence names it, as with `inline`). A
|
|
97
|
+
placeholder never replaces a label.
|
|
98
|
+
- Text inputs stay at 16 px or more on phones (the base sheet does it: don't shrink them), so iOS doesn't zoom in.
|
|
99
|
+
- Restyle with `className` (the box you see), `rootClassName` (the whole control), `labelClassName`; your utility
|
|
100
|
+
classes win over the defaults. `unstyled` drops the look and keeps the structure.
|
|
101
|
+
- Every built-in word ("Show password", "Clear", "No results", "Drop files here") is a `labels` prop: pass it
|
|
102
|
+
translated.
|
|
103
|
+
- RTL works through logical properties: slides, lines and thumbs follow the reading direction. A code (`OtpField`)
|
|
104
|
+
always reads left to right.
|
|
105
|
+
- `Contact.Form` is the place for a contact form: see [contact.md](contact.md).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sharedex/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Headless React components: an animated carousel with pure-function layout effects, page sections (Hero, About, Services, Contact) with layout presets and token-driven default looks, and 88 background effects (CSS, SVG, canvas, WebGL, Three.js) on one cheap runtime.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Mohamad Faseh <contact@mohamadfaseh.com>",
|