@zyncat/ui 0.11.0 → 0.13.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 +135 -40
- package/dist/alert.css +126 -121
- package/dist/alert.js +12 -14
- package/dist/alert.js.map +1 -1
- package/dist/avatar-group.js.map +1 -1
- package/dist/avatar.css +179 -174
- package/dist/avatar.js.map +1 -1
- package/dist/badge.css +166 -160
- package/dist/badge.js +1 -1
- package/dist/button.css +272 -246
- package/dist/button.js +1 -1
- package/dist/checkbox.css +158 -153
- package/dist/checkbox.js +2 -2
- package/dist/{chunk-AMFGY56I.js → chunk-227ZW4V7.js} +40 -32
- package/dist/chunk-227ZW4V7.js.map +1 -0
- package/dist/{chunk-2ERBBFZS.js → chunk-3MPF7FZV.js} +2 -2
- package/dist/chunk-3MPF7FZV.js.map +1 -0
- package/dist/{chunk-AIQXS2XY.js → chunk-43M6GQ4Q.js} +86 -79
- package/dist/chunk-43M6GQ4Q.js.map +1 -0
- package/dist/{chunk-7SZCJ7WI.js → chunk-45R4Z5XN.js} +3 -3
- package/dist/chunk-45R4Z5XN.js.map +1 -0
- package/dist/{chunk-I4XQ4PV2.js → chunk-4BSHB7R3.js} +9 -7
- package/dist/chunk-4BSHB7R3.js.map +1 -0
- package/dist/{chunk-YGGCQNNU.js → chunk-4C5RZXBT.js} +33 -34
- package/dist/chunk-4C5RZXBT.js.map +1 -0
- package/dist/{chunk-2QWJ6FAX.js → chunk-5PZ43DCG.js} +31 -15
- package/dist/chunk-5PZ43DCG.js.map +1 -0
- package/dist/{chunk-S5ZTZANS.js → chunk-7IZJERGA.js} +35 -12
- package/dist/chunk-7IZJERGA.js.map +1 -0
- package/dist/{chunk-DKVUPFQR.js → chunk-A5WTZACK.js} +22 -12
- package/dist/chunk-A5WTZACK.js.map +1 -0
- package/dist/{chunk-64UU4LGU.js → chunk-AADAJL7D.js} +3 -3
- package/dist/{chunk-64UU4LGU.js.map → chunk-AADAJL7D.js.map} +1 -1
- package/dist/{chunk-XJQQQJAO.js → chunk-CF4QHO4N.js} +21 -11
- package/dist/chunk-CF4QHO4N.js.map +1 -0
- package/dist/{chunk-WM5J5TDI.js → chunk-CNWTIMIP.js} +13 -17
- package/dist/chunk-CNWTIMIP.js.map +1 -0
- package/dist/{chunk-NGTA34V2.js → chunk-DDRSMHN4.js} +16 -10
- package/dist/chunk-DDRSMHN4.js.map +1 -0
- package/dist/{chunk-VTJTGVZZ.js → chunk-DMX2F6B4.js} +2 -2
- package/dist/chunk-DMX2F6B4.js.map +1 -0
- package/dist/{chunk-3SBCBYB7.js → chunk-EAI4POPB.js} +2 -2
- package/dist/{chunk-3SBCBYB7.js.map → chunk-EAI4POPB.js.map} +1 -1
- package/dist/{chunk-Y7AJQVWJ.js → chunk-EF6RPXU7.js} +17 -15
- package/dist/chunk-EF6RPXU7.js.map +1 -0
- package/dist/{chunk-WFHRAKN3.js → chunk-FONOS5RN.js} +14 -15
- package/dist/chunk-FONOS5RN.js.map +1 -0
- package/dist/{chunk-PMECHR3A.js → chunk-FQEHSKEI.js} +2 -2
- package/dist/chunk-FQEHSKEI.js.map +1 -0
- package/dist/chunk-HDSFWZ7L.js +12 -0
- package/dist/chunk-HDSFWZ7L.js.map +1 -0
- package/dist/{chunk-2F5PITAO.js → chunk-HY5MPISE.js} +2 -2
- package/dist/chunk-HY5MPISE.js.map +1 -0
- package/dist/{chunk-QDK66S4G.js → chunk-I45AU6KH.js} +3 -3
- package/dist/chunk-I45AU6KH.js.map +1 -0
- package/dist/{chunk-YGCVWGUG.js → chunk-IJS7TPGV.js} +153 -46
- package/dist/chunk-IJS7TPGV.js.map +1 -0
- package/dist/{chunk-62P3KD57.js → chunk-IUQAUBVM.js} +18 -11
- package/dist/chunk-IUQAUBVM.js.map +1 -0
- package/dist/chunk-JY6A2ZJZ.js +44 -0
- package/dist/chunk-JY6A2ZJZ.js.map +1 -0
- package/dist/{chunk-XWUWYSCT.js → chunk-M43IOM5C.js} +20 -10
- package/dist/chunk-M43IOM5C.js.map +1 -0
- package/dist/{chunk-S7B34VGN.js → chunk-OWNMRMPN.js} +3 -3
- package/dist/{chunk-S7B34VGN.js.map → chunk-OWNMRMPN.js.map} +1 -1
- package/dist/chunk-RFRE4WKX.js +22 -0
- package/dist/chunk-RFRE4WKX.js.map +1 -0
- package/dist/{chunk-NNXJCLTV.js → chunk-RJFGWJ4W.js} +2 -2
- package/dist/chunk-RJFGWJ4W.js.map +1 -0
- package/dist/{chunk-NEF5XAHG.js → chunk-TUTXXC3W.js} +4 -4
- package/dist/chunk-TUTXXC3W.js.map +1 -0
- package/dist/chunk-TVYH4AN7.js +70 -0
- package/dist/chunk-TVYH4AN7.js.map +1 -0
- package/dist/{chunk-U4MHX3KH.js → chunk-VAXCXZ53.js} +33 -12
- package/dist/chunk-VAXCXZ53.js.map +1 -0
- package/dist/chunk-XNIYSAMJ.js +52 -0
- package/dist/chunk-XNIYSAMJ.js.map +1 -0
- package/dist/{chunk-CONSWNIV.js → chunk-Y2YA7QRF.js} +6 -6
- package/dist/chunk-Y2YA7QRF.js.map +1 -0
- package/dist/cli.js +1828 -0
- package/dist/collapse.css +70 -61
- package/dist/collapse.js +2 -2
- package/dist/confetti.css +45 -0
- package/dist/confetti.js +540 -0
- package/dist/confetti.js.map +1 -0
- package/dist/count-badge.js +3 -3
- package/dist/count-badge.js.map +1 -1
- package/dist/date-field.js +24 -19
- package/dist/date-field.js.map +1 -1
- package/dist/date-picker.css +563 -559
- package/dist/date-range-field.js +58 -41
- package/dist/date-range-field.js.map +1 -1
- package/dist/datetime-field.js +24 -19
- package/dist/datetime-field.js.map +1 -1
- package/dist/dialog.css +176 -172
- package/dist/dialog.js +30 -19
- package/dist/dialog.js.map +1 -1
- package/dist/digit-strip.css +65 -0
- package/dist/dropdown.css +65 -0
- package/dist/dropdown.js +350 -0
- package/dist/dropdown.js.map +1 -0
- package/dist/emoji-picker.js +713 -0
- package/dist/emoji-picker.js.map +1 -0
- package/dist/facebook-feed.css +880 -0
- package/dist/facebook-feed.js +697 -0
- package/dist/facebook-feed.js.map +1 -0
- package/dist/flow-field.css +49 -0
- package/dist/flow-field.js +269 -0
- package/dist/flow-field.js.map +1 -0
- package/dist/glide.js +3 -3
- package/dist/icon.css +34 -30
- package/dist/input.css +296 -318
- package/dist/instagram-feed.css +378 -0
- package/dist/instagram-feed.js +272 -0
- package/dist/instagram-feed.js.map +1 -0
- package/dist/lens.css +119 -0
- package/dist/lens.js +307 -0
- package/dist/lens.js.map +1 -0
- package/dist/mcp.js +379 -181
- package/dist/menu-surface.css +127 -0
- package/dist/modal.css +11 -7
- package/dist/modal.js +24 -17
- package/dist/modal.js.map +1 -1
- package/dist/morphing-text.css +84 -0
- package/dist/morphing-text.js +256 -0
- package/dist/morphing-text.js.map +1 -0
- package/dist/motion-devtools.css +237 -233
- package/dist/motion-devtools.js +7 -6
- package/dist/motion-devtools.js.map +1 -1
- package/dist/motion-tokens.js +1 -1
- package/dist/multi-select.js +20 -17
- package/dist/multi-select.js.map +1 -1
- package/dist/number-field.js +11 -7
- package/dist/number-field.js.map +1 -1
- package/dist/odometer.css +58 -59
- package/dist/odometer.js +109 -0
- package/dist/odometer.js.map +1 -0
- package/dist/otp-field.js.map +1 -1
- package/dist/overlay.css +24 -20
- package/dist/pagination.css +42 -38
- package/dist/pagination.js +6 -12
- package/dist/pagination.js.map +1 -1
- package/dist/popover.css +69 -65
- package/dist/popover.js +12 -10
- package/dist/radio-group.css +275 -276
- package/dist/radio-group.js +70 -95
- package/dist/radio-group.js.map +1 -1
- package/dist/select.css +291 -386
- package/dist/select.js +18 -15
- package/dist/select.js.map +1 -1
- package/dist/sheet.css +47 -23
- package/dist/sheet.js +11 -10
- package/dist/status-badge.js +3 -3
- package/dist/status-badge.js.map +1 -1
- package/dist/styles.css +221 -0
- package/dist/support-rail.css +421 -0
- package/dist/support-rail.js +243 -0
- package/dist/support-rail.js.map +1 -0
- package/dist/table.css +333 -323
- package/dist/table.js +32 -21
- package/dist/table.js.map +1 -1
- package/dist/tabs.css +163 -156
- package/dist/tabs.js +26 -20
- package/dist/tabs.js.map +1 -1
- package/dist/tag.css +209 -231
- package/dist/tag.js +11 -10
- package/dist/tag.js.map +1 -1
- package/dist/text-field.js +7 -67
- package/dist/text-field.js.map +1 -1
- package/dist/textarea.css +205 -211
- package/dist/textarea.js +12 -12
- package/dist/textarea.js.map +1 -1
- package/dist/theme.js +69 -0
- package/dist/theme.js.map +1 -0
- package/dist/tiktok.css +662 -0
- package/dist/tiktok.js +494 -0
- package/dist/tiktok.js.map +1 -0
- package/dist/time-field.js +6 -6
- package/dist/time-field.js.map +1 -1
- package/dist/toast.css +237 -233
- package/dist/toast.js +43 -47
- package/dist/toast.js.map +1 -1
- package/dist/toggle-tag.js +1 -1
- package/dist/toggle-tag.js.map +1 -1
- package/dist/toggle.css +139 -135
- package/dist/toggle.js.map +1 -1
- package/dist/tooltip.css +79 -78
- package/dist/tooltip.js +50 -60
- package/dist/tooltip.js.map +1 -1
- package/dist/trigger.css +13 -0
- package/dist/{alert.d.ts → types/components/composites/alert/Alert.d.ts} +13 -15
- package/dist/{date-field.d.ts → types/components/composites/date-picker/DateField.d.ts} +4 -10
- package/dist/types/components/composites/date-picker/DateRangeField.d.ts +21 -0
- package/dist/{datetime-field.d.ts → types/components/composites/date-picker/DateTimeField.d.ts} +4 -10
- package/dist/{time-field.d.ts → types/components/composites/date-picker/TimeField.d.ts} +5 -11
- package/dist/types/components/composites/date-picker/calendar-panel.d.ts +16 -0
- package/dist/types/components/composites/date-picker/date-utils.d.ts +12 -0
- package/dist/types/components/composites/date-picker/field-shell.d.ts +46 -0
- package/dist/types/components/composites/date-picker/range-panel.d.ts +24 -0
- package/dist/types/components/composites/date-picker/time-core.d.ts +14 -0
- package/dist/types/components/composites/date-picker/use-day-focus.d.ts +2 -0
- package/dist/{dialog.d.ts → types/components/composites/dialog/Dialog.d.ts} +10 -11
- package/dist/types/components/composites/dropdown/Dropdown.d.ts +37 -0
- package/dist/types/components/composites/dropdown/menu-panel.d.ts +7 -0
- package/dist/types/components/composites/dropdown/types.d.ts +71 -0
- package/dist/types/components/composites/emoji-picker/EmojiPickerPanel.d.ts +45 -0
- package/dist/types/components/composites/emoji-picker/category-icons.d.ts +9 -0
- package/dist/types/components/composites/emoji-picker/data.d.ts +33 -0
- package/dist/types/components/composites/emoji-picker/dom.d.ts +19 -0
- package/dist/types/components/composites/emoji-picker/getEmojiUrl.d.ts +2 -0
- package/dist/types/components/composites/emoji-picker/navigation.d.ts +7 -0
- package/dist/types/components/composites/emoji-picker/picker.d.ts +20 -0
- package/dist/types/components/composites/emoji-picker/react/category-bar.d.ts +6 -0
- package/dist/types/components/composites/emoji-picker/react/useEmojiPicker.d.ts +50 -0
- package/dist/types/components/composites/emoji-picker/scaffold.d.ts +8 -0
- package/dist/types/components/composites/emoji-picker/search.d.ts +1 -0
- package/dist/types/components/composites/emoji-picker/types.d.ts +13 -0
- package/dist/{modal.d.ts → types/components/composites/modal/Modal.d.ts} +10 -11
- package/dist/{pagination.d.ts → types/components/composites/pagination/Pagination.d.ts} +5 -8
- package/dist/{popover.d.ts → types/components/composites/popover/Popover.d.ts} +11 -14
- package/dist/{multi-select.d.ts → types/components/composites/select/MultiSelect.d.ts} +12 -11
- package/dist/{select.d.ts → types/components/composites/select/Select.d.ts} +16 -14
- package/dist/types/components/composites/select/core/index.d.ts +4 -0
- package/dist/types/components/composites/select/core/menu.d.ts +13 -0
- package/dist/types/components/composites/select/core/panel.d.ts +18 -0
- package/dist/types/components/composites/select/core/trigger.d.ts +16 -0
- package/dist/{types-SGMShK7R.d.ts → types/components/composites/select/core/types.d.ts} +13 -6
- package/dist/types/components/composites/select/core/use-listbox.d.ts +42 -0
- package/dist/{sheet.d.ts → types/components/composites/sheet/Sheet.d.ts} +10 -11
- package/dist/types/components/composites/sheet/use-sheet-drag.d.ts +13 -0
- package/dist/{table.d.ts → types/components/composites/table/Table.d.ts} +12 -12
- package/dist/{tabs.d.ts → types/components/composites/tabs/Tabs.d.ts} +13 -13
- package/dist/types/components/composites/toast/Toast.d.ts +10 -0
- package/dist/{toast-store.d.ts → types/components/composites/toast/toast-store.d.ts} +12 -14
- package/dist/{tooltip.d.ts → types/components/composites/tooltip/Tooltip.d.ts} +6 -10
- package/dist/types/components/composites/tooltip/tooltip-host.d.ts +1 -0
- package/dist/types/components/composites/tooltip/tooltip-store.d.ts +29 -0
- package/dist/types/components/compound/support-rail/SupportRail.d.ts +41 -0
- package/dist/types/components/dev/MotionDevtools.d.ts +24 -0
- package/dist/types/components/dev/slowmo-engine.d.ts +27 -0
- package/dist/types/components/expressive/confetti/Confetti.d.ts +43 -0
- package/dist/types/components/expressive/facebook-feed/FacebookFeed.d.ts +73 -0
- package/dist/types/components/expressive/facebook-feed/chrome.d.ts +30 -0
- package/dist/types/components/expressive/facebook-feed/icons.d.ts +21 -0
- package/dist/types/components/expressive/facebook-feed/post.d.ts +25 -0
- package/dist/types/components/expressive/facebook-feed/reel.d.ts +26 -0
- package/dist/types/components/expressive/facebook-feed/story.d.ts +20 -0
- package/dist/types/components/expressive/flow-field/FlowField.d.ts +23 -0
- package/dist/types/components/expressive/instagram-feed/InstagramFeed.d.ts +59 -0
- package/dist/types/components/expressive/lens/Lens.d.ts +23 -0
- package/dist/types/components/expressive/morphing-text/MorphingText.d.ts +21 -0
- package/dist/types/components/expressive/odometer/Odometer.d.ts +21 -0
- package/dist/types/components/expressive/tiktok/TikTok.d.ts +85 -0
- package/dist/types/components/expressive/tiktok/glyphs.d.ts +40 -0
- package/dist/types/components/expressive/typing-lines/TypingLines.d.ts +25 -0
- package/dist/types/components/expressive/weight-field/WeightField.d.ts +19 -0
- package/dist/types/components/expressive/youtube/YouTube.d.ts +73 -0
- package/dist/types/components/expressive/youtube/format.d.ts +2 -0
- package/dist/types/components/expressive/youtube/glyphs.d.ts +16 -0
- package/dist/types/components/expressive/youtube/media.d.ts +8 -0
- package/dist/types/components/expressive/youtube/post.d.ts +19 -0
- package/dist/types/components/expressive/youtube/short.d.ts +18 -0
- package/dist/types/components/expressive/youtube/video.d.ts +14 -0
- package/dist/types/components/internal/collection/collection.d.ts +19 -0
- package/dist/types/components/internal/glass/glint.d.ts +1 -0
- package/dist/types/components/internal/hooks/use-controllable.d.ts +1 -0
- package/dist/types/components/internal/hooks/use-media-query.d.ts +1 -0
- package/dist/types/components/internal/hooks/use-scroll-edges.d.ts +10 -0
- package/dist/types/components/internal/hooks/use-typeahead.d.ts +5 -0
- package/dist/types/components/internal/icon/Icon.d.ts +33 -0
- package/dist/types/components/internal/icon/IconSlot.d.ts +7 -0
- package/dist/types/components/internal/menu/menu-row.d.ts +11 -0
- package/dist/types/components/internal/overlay/focus.d.ts +8 -0
- package/dist/types/components/internal/overlay/layer.d.ts +38 -0
- package/dist/types/components/internal/overlay/modal.d.ts +18 -0
- package/dist/types/components/internal/overlay/position.d.ts +14 -0
- package/dist/types/components/internal/support/types.d.ts +15 -0
- package/dist/types/components/internal/utils/activation.d.ts +23 -0
- package/dist/types/components/internal/utils/cx.d.ts +1 -0
- package/dist/types/components/internal/utils/token-px.d.ts +1 -0
- package/dist/{avatar.d.ts → types/components/primitives/avatar/Avatar.d.ts} +10 -12
- package/dist/{avatar-group.d.ts → types/components/primitives/avatar/AvatarGroup.d.ts} +7 -9
- package/dist/{badge.d.ts → types/components/primitives/badge/Badge.d.ts} +8 -10
- package/dist/types/components/primitives/badge/CountBadge.d.ts +8 -0
- package/dist/types/components/primitives/badge/StatusBadge.d.ts +15 -0
- package/dist/types/components/primitives/badge/digit-strip.d.ts +5 -0
- package/dist/{button.d.ts → types/components/primitives/button/Button.d.ts} +6 -8
- package/dist/{checkbox.d.ts → types/components/primitives/checkbox/Checkbox.d.ts} +6 -8
- package/dist/types/components/primitives/checkbox/check-glyph.d.ts +6 -0
- package/dist/{collapse.d.ts → types/components/primitives/collapse/Collapse.d.ts} +12 -13
- package/dist/types/components/primitives/collapse/collapse.typecheck.d.ts +2 -0
- package/dist/{number-field.d.ts → types/components/primitives/input/NumberField.d.ts} +7 -9
- package/dist/{otp-field.d.ts → types/components/primitives/input/OtpField.d.ts} +6 -8
- package/dist/{text-field.d.ts → types/components/primitives/input/TextField.d.ts} +7 -9
- package/dist/types/components/primitives/input/field-chrome.d.ts +45 -0
- package/dist/{radio-group.d.ts → types/components/primitives/radio-group/RadioGroup.d.ts} +8 -10
- package/dist/{tag.d.ts → types/components/primitives/tag/Tag.d.ts} +9 -12
- package/dist/{toggle-tag.d.ts → types/components/primitives/tag/ToggleTag.d.ts} +7 -8
- package/dist/{textarea.d.ts → types/components/primitives/textarea/Textarea.d.ts} +7 -9
- package/dist/{toggle.d.ts → types/components/primitives/toggle/Toggle.d.ts} +6 -8
- package/dist/{dom-props-C0jrllBw.d.ts → types/dom-props.d.ts} +1 -3
- package/dist/types/engine/animate.d.ts +30 -0
- package/dist/types/engine/drag.d.ts +17 -0
- package/dist/types/engine/ease.d.ts +15 -0
- package/dist/types/engine/flip.d.ts +18 -0
- package/dist/types/engine/index.d.ts +4 -0
- package/dist/types/engine/loop.d.ts +9 -0
- package/dist/types/motion/element.d.ts +17 -0
- package/dist/types/motion/flip.d.ts +4 -0
- package/dist/types/motion/glide.d.ts +11 -0
- package/dist/types/motion/motion-timing.d.ts +16 -0
- package/dist/types/motion/presence-context.d.ts +11 -0
- package/dist/types/motion/presence.d.ts +12 -0
- package/dist/types/motion/presets.d.ts +6 -0
- package/dist/{timing-7JA_zQHP.d.ts → types/motion/timing.d.ts} +9 -9
- package/dist/types/motion/use-motion.d.ts +17 -0
- package/dist/types/tokens/component-styles.generated.d.ts +262 -0
- package/dist/{motion-scale-Canq4stZ.d.ts → types/tokens/motion-scale.d.ts} +4 -4
- package/dist/{motion-tokens.d.ts → types/tokens/motion-tokens.d.ts} +9 -9
- package/dist/types/tokens/theme-tokens.generated.d.ts +1249 -0
- package/dist/types/tokens/theme.d.ts +12 -0
- package/dist/typing-lines.css +92 -0
- package/dist/typing-lines.js +139 -0
- package/dist/typing-lines.js.map +1 -0
- package/dist/weight-field.css +84 -0
- package/dist/weight-field.js +17 -0
- package/dist/weight-field.js.map +1 -0
- package/dist/youtube.css +611 -0
- package/dist/youtube.js +814 -0
- package/dist/youtube.js.map +1 -0
- package/package.json +155 -49
- package/skills/zyncat-ui/SKILL.md +95 -0
- package/skills/zyncat-ui/references/components.md +85 -0
- package/skills/zyncat-ui/references/recipes.md +171 -0
- package/skills/zyncat-ui/references/theming.md +83 -0
- package/src/components/composites/alert/Alert.tsx +13 -11
- package/src/components/composites/alert/Alert.usage.md +15 -0
- package/src/components/composites/alert/alert.css +126 -121
- package/src/components/composites/date-picker/DateField.tsx +7 -2
- package/src/components/composites/date-picker/DateField.usage.md +10 -0
- package/src/components/composites/date-picker/DateRangeField.tsx +18 -16
- package/src/components/composites/date-picker/DateRangeField.usage.md +10 -0
- package/src/components/composites/date-picker/DateTimeField.tsx +10 -5
- package/src/components/composites/date-picker/DateTimeField.usage.md +12 -0
- package/src/components/composites/date-picker/TimeField.tsx +3 -1
- package/src/components/composites/date-picker/TimeField.usage.md +12 -0
- package/src/components/composites/date-picker/calendar-panel.tsx +15 -10
- package/src/components/composites/date-picker/date-picker.css +563 -559
- package/src/components/composites/date-picker/field-shell.tsx +9 -3
- package/src/components/composites/date-picker/range-panel.tsx +23 -8
- package/src/components/composites/date-picker/time-core.tsx +2 -0
- package/src/components/composites/dialog/Dialog.tsx +30 -15
- package/src/components/composites/dialog/Dialog.usage.md +17 -0
- package/src/components/composites/dialog/dialog.css +176 -172
- package/src/components/composites/dropdown/Dropdown.tsx +184 -0
- package/src/components/composites/dropdown/Dropdown.usage.md +19 -0
- package/src/components/composites/dropdown/dropdown.css +65 -0
- package/src/components/composites/dropdown/menu-panel.tsx +255 -0
- package/src/components/composites/dropdown/types.ts +95 -0
- package/src/components/composites/emoji-picker/EmojiPickerPanel.tsx +153 -0
- package/src/components/composites/emoji-picker/EmojiPickerPanel.usage.md +26 -0
- package/src/components/composites/emoji-picker/category-icons.ts +29 -0
- package/src/components/composites/emoji-picker/data.ts +83 -0
- package/src/components/composites/emoji-picker/dom.ts +79 -0
- package/src/components/composites/emoji-picker/getEmojiUrl.ts +17 -0
- package/src/components/composites/emoji-picker/navigation.ts +86 -0
- package/src/components/composites/emoji-picker/picker.ts +169 -0
- package/src/components/composites/emoji-picker/react/category-bar.tsx +77 -0
- package/src/components/composites/emoji-picker/react/useEmojiPicker.ts +139 -0
- package/src/components/composites/emoji-picker/scaffold.ts +74 -0
- package/src/components/composites/emoji-picker/search.ts +79 -0
- package/src/components/composites/emoji-picker/styles.css +221 -0
- package/src/components/composites/emoji-picker/types.ts +14 -0
- package/src/components/composites/modal/Modal.tsx +24 -13
- package/src/components/composites/modal/Modal.usage.md +24 -0
- package/src/components/composites/modal/modal.css +11 -7
- package/src/components/composites/pagination/Pagination.tsx +6 -11
- package/src/components/composites/pagination/Pagination.usage.md +12 -0
- package/src/components/composites/pagination/pagination.css +42 -38
- package/src/components/composites/popover/Popover.tsx +22 -7
- package/src/components/composites/popover/Popover.usage.md +15 -0
- package/src/components/composites/popover/popover.css +69 -65
- package/src/components/composites/select/MultiSelect.tsx +13 -5
- package/src/components/composites/select/MultiSelect.usage.md +12 -0
- package/src/components/composites/select/Select.tsx +23 -7
- package/src/components/composites/select/Select.usage.md +20 -0
- package/src/components/composites/select/core/index.ts +1 -1
- package/src/components/composites/select/core/menu.tsx +8 -6
- package/src/components/composites/select/core/panel.tsx +25 -26
- package/src/components/composites/select/core/trigger.tsx +36 -24
- package/src/components/composites/select/core/types.ts +17 -15
- package/src/components/composites/select/core/use-listbox.ts +22 -21
- package/src/components/composites/select/select.css +291 -386
- package/src/components/composites/sheet/Sheet.tsx +28 -18
- package/src/components/composites/sheet/Sheet.usage.md +15 -0
- package/src/components/composites/sheet/sheet.css +47 -23
- package/src/components/composites/sheet/use-sheet-drag.ts +19 -15
- package/src/components/composites/table/Table.tsx +17 -6
- package/src/components/composites/table/Table.usage.md +19 -0
- package/src/components/composites/table/table.css +333 -323
- package/src/components/composites/tabs/Tabs.tsx +31 -23
- package/src/components/composites/tabs/Tabs.usage.md +13 -0
- package/src/components/composites/tabs/tabs.css +163 -156
- package/src/components/composites/toast/Toast.tsx +48 -51
- package/src/components/composites/toast/Toast.usage.md +23 -0
- package/src/components/composites/toast/toast-store.usage.md +16 -0
- package/src/components/composites/toast/toast.css +237 -233
- package/src/components/composites/tooltip/Tooltip.tsx +13 -8
- package/src/components/composites/tooltip/Tooltip.usage.md +14 -0
- package/src/components/composites/tooltip/tooltip-host.tsx +29 -61
- package/src/components/composites/tooltip/tooltip-store.ts +10 -0
- package/src/components/composites/tooltip/tooltip.css +79 -78
- package/src/components/compound/support-rail/SupportRail.tsx +343 -0
- package/src/components/compound/support-rail/SupportRail.usage.md +18 -0
- package/src/components/compound/support-rail/support-rail.css +421 -0
- package/src/components/dev/MotionDevtools.tsx +3 -1
- package/src/components/dev/MotionDevtools.usage.md +16 -0
- package/src/components/dev/motion-devtools.css +237 -233
- package/src/components/expressive/confetti/Confetti.tsx +727 -0
- package/src/components/expressive/confetti/Confetti.usage.md +18 -0
- package/src/components/expressive/confetti/confetti.css +45 -0
- package/src/components/expressive/facebook-feed/FacebookFeed.tsx +200 -0
- package/src/components/expressive/facebook-feed/FacebookFeed.usage.md +18 -0
- package/src/components/expressive/facebook-feed/chrome.tsx +120 -0
- package/src/components/expressive/facebook-feed/facebook-feed.css +880 -0
- package/src/components/expressive/facebook-feed/icons.tsx +145 -0
- package/src/components/expressive/facebook-feed/post.tsx +213 -0
- package/src/components/expressive/facebook-feed/reel.tsx +199 -0
- package/src/components/expressive/facebook-feed/story.tsx +132 -0
- package/src/components/expressive/flow-field/FlowField.tsx +348 -0
- package/src/components/expressive/flow-field/FlowField.usage.md +19 -0
- package/src/components/expressive/flow-field/flow-field.css +49 -0
- package/src/components/expressive/instagram-feed/InstagramFeed.tsx +374 -0
- package/src/components/expressive/instagram-feed/InstagramFeed.usage.md +18 -0
- package/src/components/expressive/instagram-feed/instagram-feed.css +378 -0
- package/src/components/expressive/lens/Lens.tsx +415 -0
- package/src/components/expressive/lens/Lens.usage.md +20 -0
- package/src/components/expressive/lens/lens.css +119 -0
- package/src/components/expressive/morphing-text/MorphingText.tsx +328 -0
- package/src/components/expressive/morphing-text/MorphingText.usage.md +19 -0
- package/src/components/expressive/morphing-text/morphing-text.css +84 -0
- package/src/components/expressive/odometer/Odometer.tsx +158 -0
- package/src/components/expressive/odometer/Odometer.usage.md +17 -0
- package/src/components/expressive/odometer/odometer.css +61 -0
- package/src/components/expressive/tiktok/TikTok.tsx +542 -0
- package/src/components/expressive/tiktok/TikTok.usage.md +17 -0
- package/src/components/expressive/tiktok/glyphs.tsx +163 -0
- package/src/components/expressive/tiktok/tiktok.css +662 -0
- package/src/components/expressive/typing-lines/TypingLines.tsx +0 -0
- package/src/components/expressive/typing-lines/TypingLines.usage.md +17 -0
- package/src/components/expressive/typing-lines/typing-lines.css +92 -0
- package/src/components/expressive/weight-field/WeightField.tsx +41 -0
- package/src/components/expressive/weight-field/WeightField.usage.md +20 -0
- package/src/components/expressive/weight-field/weight-field.css +84 -0
- package/src/components/expressive/youtube/YouTube.tsx +192 -0
- package/src/components/expressive/youtube/YouTube.usage.md +18 -0
- package/src/components/expressive/youtube/format.ts +22 -0
- package/src/components/expressive/youtube/glyphs.tsx +235 -0
- package/src/components/expressive/youtube/media.tsx +18 -0
- package/src/components/expressive/youtube/post.tsx +282 -0
- package/src/components/expressive/youtube/short.tsx +212 -0
- package/src/components/expressive/youtube/video.tsx +75 -0
- package/src/components/expressive/youtube/youtube.css +611 -0
- package/src/components/internal/collection/collection.ts +44 -0
- package/src/components/internal/glass/glass.css +88 -84
- package/src/components/internal/hooks/use-media-query.ts +20 -0
- package/src/components/internal/hooks/use-typeahead.ts +28 -0
- package/src/components/internal/icon/Icon.tsx +2 -0
- package/src/components/internal/icon/IconSlot.tsx +2 -0
- package/src/components/internal/icon/icon.css +34 -30
- package/src/components/internal/menu/menu-row.tsx +34 -0
- package/src/components/internal/menu/menu-surface.css +127 -0
- package/src/components/internal/overlay/focus.ts +26 -10
- package/src/components/internal/overlay/layer.tsx +50 -9
- package/src/components/internal/overlay/modal.tsx +14 -12
- package/src/components/internal/overlay/overlay.css +24 -20
- package/src/components/internal/overlay/position.ts +19 -9
- package/src/components/internal/overlay/trigger.css +13 -0
- package/src/components/internal/support/types.ts +16 -0
- package/src/components/internal/utils/activation.ts +78 -0
- package/src/components/primitives/avatar/Avatar.tsx +2 -0
- package/src/components/primitives/avatar/Avatar.usage.md +12 -0
- package/src/components/primitives/avatar/AvatarGroup.tsx +3 -1
- package/src/components/primitives/avatar/AvatarGroup.usage.md +15 -0
- package/src/components/primitives/avatar/avatar.css +179 -174
- package/src/components/primitives/badge/Badge.tsx +3 -1
- package/src/components/primitives/badge/Badge.usage.md +14 -0
- package/src/components/primitives/badge/CountBadge.tsx +2 -2
- package/src/components/primitives/badge/CountBadge.usage.md +13 -0
- package/src/components/primitives/badge/StatusBadge.tsx +3 -1
- package/src/components/primitives/badge/StatusBadge.usage.md +14 -0
- package/src/components/primitives/badge/badge.css +166 -160
- package/src/components/primitives/badge/digit-strip.css +65 -0
- package/src/components/primitives/badge/{odometer.tsx → digit-strip.tsx} +3 -3
- package/src/components/primitives/button/Button.tsx +2 -0
- package/src/components/primitives/button/Button.usage.md +14 -0
- package/src/components/primitives/button/button.css +272 -246
- package/src/components/primitives/checkbox/Checkbox.tsx +3 -1
- package/src/components/primitives/checkbox/Checkbox.usage.md +12 -0
- package/src/components/primitives/checkbox/check-glyph.tsx +1 -0
- package/src/components/primitives/checkbox/checkbox.css +158 -153
- package/src/components/primitives/collapse/Collapse.tsx +3 -1
- package/src/components/primitives/collapse/Collapse.usage.md +17 -0
- package/src/components/primitives/collapse/collapse.css +70 -61
- package/src/components/primitives/collapse/collapse.typecheck.tsx +2 -0
- package/src/components/primitives/input/NumberField.tsx +18 -5
- package/src/components/primitives/input/NumberField.usage.md +12 -0
- package/src/components/primitives/input/OtpField.tsx +2 -0
- package/src/components/primitives/input/OtpField.usage.md +12 -0
- package/src/components/primitives/input/TextField.tsx +16 -4
- package/src/components/primitives/input/TextField.usage.md +13 -0
- package/src/components/primitives/input/field-chrome.tsx +11 -2
- package/src/components/primitives/input/input.css +296 -318
- package/src/components/primitives/radio-group/RadioGroup.tsx +20 -44
- package/src/components/primitives/radio-group/RadioGroup.usage.md +13 -0
- package/src/components/primitives/radio-group/radio-group.css +275 -276
- package/src/components/primitives/tag/Tag.tsx +10 -6
- package/src/components/primitives/tag/Tag.usage.md +14 -0
- package/src/components/primitives/tag/ToggleTag.tsx +4 -2
- package/src/components/primitives/tag/ToggleTag.usage.md +14 -0
- package/src/components/primitives/tag/tag.css +209 -231
- package/src/components/primitives/textarea/Textarea.tsx +17 -7
- package/src/components/primitives/textarea/Textarea.usage.md +12 -0
- package/src/components/primitives/textarea/textarea.css +205 -211
- package/src/components/primitives/toggle/Toggle.tsx +3 -1
- package/src/components/primitives/toggle/Toggle.usage.md +12 -0
- package/src/components/primitives/toggle/toggle.css +139 -135
- package/src/engine/animate.ts +40 -13
- package/src/engine/ease.ts +1 -0
- package/src/engine/flip.ts +32 -15
- package/src/engine/index.ts +2 -1
- package/src/engine/loop.ts +97 -0
- package/src/mcp/server.ts +315 -218
- package/src/motion/element.tsx +1 -0
- package/src/motion/flip.ts +29 -10
- package/src/motion/glide.tsx +11 -14
- package/src/motion/glide.usage.md +15 -0
- package/src/motion/motion-timing.ts +3 -3
- package/src/motion/presence.tsx +12 -5
- package/src/motion/presets.ts +13 -0
- package/src/motion/timing.ts +1 -0
- package/src/motion/use-motion.ts +16 -3
- package/src/styles.css +5 -0
- package/src/tokens/avatar.css +20 -16
- package/src/tokens/color.css +67 -56
- package/src/tokens/component-styles.generated.ts +270 -0
- package/src/tokens/elevation.css +28 -17
- package/src/tokens/fonts.css +1 -1
- package/src/tokens/glass.css +19 -15
- package/src/tokens/icons.css +8 -4
- package/src/tokens/layers.css +9 -4
- package/src/tokens/motion-scale.ts +4 -0
- package/src/tokens/motion-tokens.ts +42 -12
- package/src/tokens/motion-tokens.usage.md +16 -0
- package/src/tokens/motion.css +63 -45
- package/src/tokens/radius.css +12 -8
- package/src/tokens/semantic.css +62 -54
- package/src/tokens/spacing.css +25 -21
- package/src/tokens/theme-tokens.generated.ts +1278 -0
- package/src/tokens/theme.tsx +83 -0
- package/src/tokens/theme.usage.md +36 -0
- package/src/tokens/typography.css +53 -49
- package/dist/chunk-2ERBBFZS.js.map +0 -1
- package/dist/chunk-2F5PITAO.js.map +0 -1
- package/dist/chunk-2QWJ6FAX.js.map +0 -1
- package/dist/chunk-62P3KD57.js.map +0 -1
- package/dist/chunk-7SZCJ7WI.js.map +0 -1
- package/dist/chunk-AIQXS2XY.js.map +0 -1
- package/dist/chunk-AMFGY56I.js.map +0 -1
- package/dist/chunk-CONSWNIV.js.map +0 -1
- package/dist/chunk-DKVUPFQR.js.map +0 -1
- package/dist/chunk-I4XQ4PV2.js.map +0 -1
- package/dist/chunk-NEF5XAHG.js.map +0 -1
- package/dist/chunk-NGTA34V2.js.map +0 -1
- package/dist/chunk-NNXJCLTV.js.map +0 -1
- package/dist/chunk-PMECHR3A.js.map +0 -1
- package/dist/chunk-QDK66S4G.js.map +0 -1
- package/dist/chunk-S5ZTZANS.js.map +0 -1
- package/dist/chunk-U4MHX3KH.js.map +0 -1
- package/dist/chunk-VTJTGVZZ.js.map +0 -1
- package/dist/chunk-WFHRAKN3.js.map +0 -1
- package/dist/chunk-WM5J5TDI.js.map +0 -1
- package/dist/chunk-XJQQQJAO.js.map +0 -1
- package/dist/chunk-XWUWYSCT.js.map +0 -1
- package/dist/chunk-Y7AJQVWJ.js.map +0 -1
- package/dist/chunk-YGCVWGUG.js.map +0 -1
- package/dist/chunk-YGGCQNNU.js.map +0 -1
- package/dist/count-badge.d.ts +0 -13
- package/dist/date-range-field.d.ts +0 -33
- package/dist/field-chrome-CMPOQSLs.d.ts +0 -28
- package/dist/field-shell-Cuda-feL.d.ts +0 -24
- package/dist/glide.d.ts +0 -15
- package/dist/motion-devtools.d.ts +0 -51
- package/dist/status-badge.d.ts +0 -19
- package/dist/toast.d.ts +0 -12
- package/llms.txt +0 -220
- package/src/components/primitives/badge/odometer.css +0 -62
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Confetti - @zyncat/ui/confetti
|
|
2
|
+
|
|
3
|
+
Group: expressive
|
|
4
|
+
Docs: https://ui.zyncat.app/confetti
|
|
5
|
+
|
|
6
|
+
A canvas particle burst you fire yourself: paper flakes, curls, ribbons and foil sequins tumbling on real drag, lift and flip, across three depth layers.
|
|
7
|
+
|
|
8
|
+
Fire it from the ref handle - ref.current.fire({count, duration, emitter}) - bursts coexist, never
|
|
9
|
+
cancel. emitter sides|top|corners is the launch geometry; count is pieces per fire (cap 520, the
|
|
10
|
+
oldest piece retires past it); duration is the seconds the emitter stays open, 0.15 for one shove
|
|
11
|
+
and 2.5 for a taper; speed is sampled live; field container|viewport picks what the canvas covers.
|
|
12
|
+
Retune through --confetti-* on the canvas: paper-1..5, weights, ink, light, shade, gloss, layer.
|
|
13
|
+
Purely decorative - aria-hidden, pointer-events none, never focusable, no live region: announce the
|
|
14
|
+
success yourself. Reduced motion renders nothing and fire() is a no-op.
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
<Confetti ref={confetti} count={170} />
|
|
18
|
+
```
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
@layer zyncat.tokens, zyncat.components;
|
|
2
|
+
|
|
3
|
+
@layer zyncat.components {
|
|
4
|
+
.confetti {
|
|
5
|
+
--confetti-paper-1: oklch(0.53 0.2 288);
|
|
6
|
+
--confetti-paper-2: var(--accent);
|
|
7
|
+
--confetti-paper-3: oklch(0.78 0.115 62);
|
|
8
|
+
--confetti-paper-4: oklch(0.67 0.18 12);
|
|
9
|
+
--confetti-paper-5: var(--text-strong);
|
|
10
|
+
--confetti-weights: 1 1 1 1 0.45;
|
|
11
|
+
|
|
12
|
+
--confetti-ink: var(--text-strong);
|
|
13
|
+
--confetti-light: var(--bg-surface);
|
|
14
|
+
--confetti-shade: 42%;
|
|
15
|
+
--confetti-gloss: 66%;
|
|
16
|
+
--confetti-layer: var(--layer-toast);
|
|
17
|
+
|
|
18
|
+
--confetti-reverse-1: color-mix(in oklab, var(--confetti-ink) var(--confetti-shade), var(--confetti-paper-1));
|
|
19
|
+
--confetti-reverse-2: color-mix(in oklab, var(--confetti-ink) var(--confetti-shade), var(--confetti-paper-2));
|
|
20
|
+
--confetti-reverse-3: color-mix(in oklab, var(--confetti-ink) var(--confetti-shade), var(--confetti-paper-3));
|
|
21
|
+
--confetti-reverse-4: color-mix(in oklab, var(--confetti-ink) var(--confetti-shade), var(--confetti-paper-4));
|
|
22
|
+
--confetti-reverse-5: color-mix(in oklab, var(--confetti-ink) var(--confetti-shade), var(--confetti-paper-5));
|
|
23
|
+
|
|
24
|
+
--confetti-sheen-1: color-mix(in oklab, var(--confetti-light) var(--confetti-gloss), var(--confetti-paper-1));
|
|
25
|
+
--confetti-sheen-2: color-mix(in oklab, var(--confetti-light) var(--confetti-gloss), var(--confetti-paper-2));
|
|
26
|
+
--confetti-sheen-3: color-mix(in oklab, var(--confetti-light) var(--confetti-gloss), var(--confetti-paper-3));
|
|
27
|
+
--confetti-sheen-4: color-mix(in oklab, var(--confetti-light) var(--confetti-gloss), var(--confetti-paper-4));
|
|
28
|
+
--confetti-sheen-5: color-mix(in oklab, var(--confetti-light) var(--confetti-gloss), var(--confetti-paper-5));
|
|
29
|
+
|
|
30
|
+
position: absolute;
|
|
31
|
+
inset: 0;
|
|
32
|
+
display: block;
|
|
33
|
+
width: 100%;
|
|
34
|
+
height: 100%;
|
|
35
|
+
pointer-events: none;
|
|
36
|
+
touch-action: none;
|
|
37
|
+
user-select: none;
|
|
38
|
+
background: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.confetti--viewport {
|
|
42
|
+
position: fixed;
|
|
43
|
+
z-index: var(--confetti-layer);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import './facebook-feed.css';
|
|
4
|
+
|
|
5
|
+
import type { CSSProperties, HTMLAttributes, ReactNode } from 'react';
|
|
6
|
+
|
|
7
|
+
import type { DataAttributes } from '../../../dom-props';
|
|
8
|
+
import { useControllable } from '../../internal/hooks/use-controllable';
|
|
9
|
+
import type { FacebookFeedAction, FacebookMediaType, FacebookRatio } from './chrome';
|
|
10
|
+
import { FacebookPost, type FacebookPostWidth } from './post';
|
|
11
|
+
import { FacebookReel, type FacebookReelStage } from './reel';
|
|
12
|
+
import { FacebookStory } from './story';
|
|
13
|
+
|
|
14
|
+
export type { FacebookFeedAction, FacebookMediaType, FacebookRatio } from './chrome';
|
|
15
|
+
export type { FacebookPostWidth } from './post';
|
|
16
|
+
export type { FacebookReelStage } from './reel';
|
|
17
|
+
|
|
18
|
+
export type FacebookSurface = 'post' | 'reel' | 'story';
|
|
19
|
+
|
|
20
|
+
const DEFAULT_NAME = 'Swiss Nature';
|
|
21
|
+
const DEFAULT_CAPTION = 'This is Switzerland';
|
|
22
|
+
const DEFAULT_STAMP = '31m';
|
|
23
|
+
const DEFAULT_AUDIO = 'Original audio';
|
|
24
|
+
const DEFAULT_RATIO: FacebookRatio = '4:5';
|
|
25
|
+
const DEFAULT_LIKES = 267;
|
|
26
|
+
const DEFAULT_COMMENTS = 12;
|
|
27
|
+
const DEFAULT_SHARES = 4;
|
|
28
|
+
const DEFAULT_SEGMENTS = 2;
|
|
29
|
+
const DEFAULT_SEGMENT = 0;
|
|
30
|
+
const MUTED_BY_SURFACE: Record<FacebookSurface, boolean> = { post: true, reel: true, story: false };
|
|
31
|
+
|
|
32
|
+
export interface FacebookFeedOwnProps {
|
|
33
|
+
/** Which Facebook surface to reproduce: the feed card, the reels stage, or the story stage. @default 'post' */
|
|
34
|
+
surface?: FacebookSurface;
|
|
35
|
+
/** Feed card width. `mobile` is the 390px square-cornered card, `web` the 680px rounded one. @default 'web' */
|
|
36
|
+
width?: FacebookPostWidth;
|
|
37
|
+
/** Reels stage. `narrow` is 557x878 around a 9:16 video, `wide` is 1601x886 around a 16:9 one. @default 'narrow' */
|
|
38
|
+
stage?: FacebookReelStage;
|
|
39
|
+
/** Whether `media` is a still or a clip. A still is echoed into the feed's blurred letterbox backdrop; a clip is not, so it is never fetched twice. @default 'image' */
|
|
40
|
+
type?: FacebookMediaType;
|
|
41
|
+
/** Poster or page name in the header. @default 'Swiss Nature' */
|
|
42
|
+
name?: string;
|
|
43
|
+
/** Post body. The feed cuts it at 250 characters with `See more`; reels take one ellipsised line. Hashtags and @mentions render in link blue. */
|
|
44
|
+
caption?: string;
|
|
45
|
+
/** Frame aspect for the feed card and the story card. Reels stages are fixed. @default '4:5' */
|
|
46
|
+
ratio?: FacebookRatio;
|
|
47
|
+
/** A URL string, or your own node (`<img>`, `<video>`, `next/image`). Omit for a CSS-only placeholder. Nothing is ever autoplayed and no request is ever made for you. */
|
|
48
|
+
media?: ReactNode;
|
|
49
|
+
/** A URL string, or your own node, for the header portrait. Omit for the platform's grey. */
|
|
50
|
+
avatar?: ReactNode;
|
|
51
|
+
/** Show the `· Follow` affordance. Blue in the feed, white on reels. @default true */
|
|
52
|
+
follow?: boolean;
|
|
53
|
+
/** Blue active-story ring around the feed avatar. @default true */
|
|
54
|
+
ring?: boolean;
|
|
55
|
+
/** Relative timestamp in the meta line. @default '31m' */
|
|
56
|
+
stamp?: string;
|
|
57
|
+
/** Blue verified badge after the reels name. @default true */
|
|
58
|
+
verified?: boolean;
|
|
59
|
+
/** Track name on the reels and story audio line. @default 'Original audio' */
|
|
60
|
+
audio?: string;
|
|
61
|
+
/** Reaction count. Exact below 1,000, then `1.2K` / `48K` / `1.4M`. @default 267 */
|
|
62
|
+
likes?: number;
|
|
63
|
+
/** Comment count, formatted like `likes`. @default 12 */
|
|
64
|
+
comments?: number;
|
|
65
|
+
/** Share count, formatted like `likes`. @default 4 */
|
|
66
|
+
shares?: number;
|
|
67
|
+
/** How many story progress segments to draw. @default 2 */
|
|
68
|
+
segments?: number;
|
|
69
|
+
/** Index of the newest filled story segment; every earlier one fills too. @default 0 */
|
|
70
|
+
segment?: number;
|
|
71
|
+
/** Controlled mute state for the reels and story sound button. */
|
|
72
|
+
muted?: boolean;
|
|
73
|
+
/** Uncontrolled initial mute state. @default true on reels, false on the story */
|
|
74
|
+
defaultMuted?: boolean;
|
|
75
|
+
/** Fires when the sound button is pressed. You own the actual `<video>`, so wire it to your own element. */
|
|
76
|
+
onMutedChange?: (muted: boolean) => void;
|
|
77
|
+
/** Controlled like state for the thumb on the feed card and the reels rail. The displayed reaction count adds one while this is on. */
|
|
78
|
+
liked?: boolean;
|
|
79
|
+
/** Uncontrolled initial like state. @default false */
|
|
80
|
+
defaultLiked?: boolean;
|
|
81
|
+
/** Fires when the thumb toggles the like. */
|
|
82
|
+
onLikedChange?: (liked: boolean) => void;
|
|
83
|
+
/** Fires for the actions that carry no state: comment, share, follow, menu, dismiss, more, search, play. */
|
|
84
|
+
onAction?: (action: FacebookFeedAction) => void;
|
|
85
|
+
/** Extra class(es) merged onto the surface root. */
|
|
86
|
+
className?: string;
|
|
87
|
+
/** Inline styles merged onto the surface root. */
|
|
88
|
+
style?: CSSProperties;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface FacebookFeedProps extends FacebookFeedOwnProps {
|
|
92
|
+
/** Standard element attributes (aria-*, data-*, title, ...) forwarded to the surface root. */
|
|
93
|
+
htmlProps?: Omit<HTMLAttributes<HTMLElement>, keyof FacebookFeedOwnProps> & DataAttributes;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function FacebookFeed({
|
|
97
|
+
surface = 'post',
|
|
98
|
+
width = 'web',
|
|
99
|
+
stage = 'narrow',
|
|
100
|
+
type = 'image',
|
|
101
|
+
name = DEFAULT_NAME,
|
|
102
|
+
caption = DEFAULT_CAPTION,
|
|
103
|
+
ratio = DEFAULT_RATIO,
|
|
104
|
+
media,
|
|
105
|
+
avatar,
|
|
106
|
+
follow = true,
|
|
107
|
+
ring = true,
|
|
108
|
+
stamp = DEFAULT_STAMP,
|
|
109
|
+
verified = true,
|
|
110
|
+
audio = DEFAULT_AUDIO,
|
|
111
|
+
likes = DEFAULT_LIKES,
|
|
112
|
+
comments = DEFAULT_COMMENTS,
|
|
113
|
+
shares = DEFAULT_SHARES,
|
|
114
|
+
segments = DEFAULT_SEGMENTS,
|
|
115
|
+
segment = DEFAULT_SEGMENT,
|
|
116
|
+
muted,
|
|
117
|
+
defaultMuted,
|
|
118
|
+
onMutedChange,
|
|
119
|
+
liked,
|
|
120
|
+
defaultLiked = false,
|
|
121
|
+
onLikedChange,
|
|
122
|
+
onAction,
|
|
123
|
+
className = '',
|
|
124
|
+
style,
|
|
125
|
+
htmlProps,
|
|
126
|
+
}: FacebookFeedProps) {
|
|
127
|
+
const [sound, setSound] = useControllable(muted, defaultMuted ?? MUTED_BY_SURFACE[surface], onMutedChange);
|
|
128
|
+
const [reacted, setReacted] = useControllable(liked, defaultLiked, onLikedChange);
|
|
129
|
+
|
|
130
|
+
if (surface === 'reel')
|
|
131
|
+
return (
|
|
132
|
+
<FacebookReel
|
|
133
|
+
name={name}
|
|
134
|
+
caption={caption}
|
|
135
|
+
stage={stage}
|
|
136
|
+
follow={follow}
|
|
137
|
+
verified={verified}
|
|
138
|
+
audio={audio}
|
|
139
|
+
media={media}
|
|
140
|
+
avatar={avatar}
|
|
141
|
+
type={type}
|
|
142
|
+
likes={likes}
|
|
143
|
+
comments={comments}
|
|
144
|
+
shares={shares}
|
|
145
|
+
muted={sound}
|
|
146
|
+
onMutedChange={setSound}
|
|
147
|
+
liked={reacted}
|
|
148
|
+
onLikedChange={setReacted}
|
|
149
|
+
onAction={onAction}
|
|
150
|
+
className={className}
|
|
151
|
+
style={style}
|
|
152
|
+
htmlProps={htmlProps}
|
|
153
|
+
/>
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
if (surface === 'story')
|
|
157
|
+
return (
|
|
158
|
+
<FacebookStory
|
|
159
|
+
name={name}
|
|
160
|
+
stamp={stamp}
|
|
161
|
+
audio={audio}
|
|
162
|
+
ratio={ratio}
|
|
163
|
+
media={media}
|
|
164
|
+
avatar={avatar}
|
|
165
|
+
type={type}
|
|
166
|
+
segments={segments}
|
|
167
|
+
segment={segment}
|
|
168
|
+
muted={sound}
|
|
169
|
+
onMutedChange={setSound}
|
|
170
|
+
onAction={onAction}
|
|
171
|
+
className={className}
|
|
172
|
+
style={style}
|
|
173
|
+
htmlProps={htmlProps}
|
|
174
|
+
/>
|
|
175
|
+
);
|
|
176
|
+
|
|
177
|
+
return (
|
|
178
|
+
<FacebookPost
|
|
179
|
+
name={name}
|
|
180
|
+
caption={caption}
|
|
181
|
+
stamp={stamp}
|
|
182
|
+
follow={follow}
|
|
183
|
+
ring={ring}
|
|
184
|
+
ratio={ratio}
|
|
185
|
+
media={media}
|
|
186
|
+
avatar={avatar}
|
|
187
|
+
type={type}
|
|
188
|
+
likes={likes}
|
|
189
|
+
comments={comments}
|
|
190
|
+
shares={shares}
|
|
191
|
+
width={width}
|
|
192
|
+
liked={reacted}
|
|
193
|
+
onLikedChange={setReacted}
|
|
194
|
+
onAction={onAction}
|
|
195
|
+
className={className}
|
|
196
|
+
style={style}
|
|
197
|
+
htmlProps={htmlProps}
|
|
198
|
+
/>
|
|
199
|
+
);
|
|
200
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# FacebookFeed - @zyncat/ui/facebook-feed
|
|
2
|
+
|
|
3
|
+
Group: replicas
|
|
4
|
+
Docs: https://ui.zyncat.app/facebook-feed
|
|
5
|
+
|
|
6
|
+
Replica of Facebook's three post surfaces, pinned to the platform's real metrics: the feed card, the reels stage and the story stage.
|
|
7
|
+
|
|
8
|
+
Pick it over InstagramFeed when you need Facebook's chrome - caption ABOVE the media, a blurred
|
|
9
|
+
saturated letterbox, the 65px reels rail. surface post|reel|story, width mobile|web, stage
|
|
10
|
+
narrow|wide, type image|video, ratio 4:5|1.1:1|1:1|3:4|16:9. name, caption, stamp, audio, avatar and
|
|
11
|
+
media take a URL string or your own node; follow, ring, verified toggle the chrome;
|
|
12
|
+
likes/comments/shares stay exact below 1,000. liked and muted are controllable toggles; onAction
|
|
13
|
+
reports comment, share, follow, menu, dismiss, more, search, play. Fixed widths, no theming knobs -
|
|
14
|
+
fidelity is the contract.
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
<FacebookFeed surface="post" width="web" media={<img src={src} alt="" />} likes={267} />
|
|
18
|
+
```
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export type FacebookRatio = '4:5' | '1.1:1' | '1:1' | '3:4' | '16:9';
|
|
4
|
+
export type FacebookMediaType = 'image' | 'video';
|
|
5
|
+
|
|
6
|
+
/** The actions a surface reports that carry no state of their own. */
|
|
7
|
+
export type FacebookFeedAction = 'comment' | 'share' | 'follow' | 'menu' | 'dismiss' | 'more' | 'search' | 'play';
|
|
8
|
+
|
|
9
|
+
const THOUSAND = 1e3;
|
|
10
|
+
const TEN_THOUSAND = 1e4;
|
|
11
|
+
const MILLION = 1e6;
|
|
12
|
+
const COMPACT_DECIMALS = 1;
|
|
13
|
+
const TRAILING_ZERO = /\.0$/;
|
|
14
|
+
const THOUSAND_SUFFIX = 'K';
|
|
15
|
+
const MILLION_SUFFIX = 'M';
|
|
16
|
+
|
|
17
|
+
const CAPTION_LIMIT = 250;
|
|
18
|
+
const WORD_BREAK_FLOOR = 0.65;
|
|
19
|
+
const TRAILING_PUNCTUATION = /[\s,.;:—-]+$/;
|
|
20
|
+
const TAG_SPLIT = /([#@][^\s#@]+)/g;
|
|
21
|
+
const TAG_LEADERS = '#@';
|
|
22
|
+
const QUOTE = /"/g;
|
|
23
|
+
const ENCODED_QUOTE = '%22';
|
|
24
|
+
|
|
25
|
+
export function countValue(value: number): number {
|
|
26
|
+
return Math.max(0, Math.round(Number(value) || 0));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function compactCount(value: number): string {
|
|
30
|
+
const n = countValue(value);
|
|
31
|
+
if (n >= MILLION) return (n / MILLION).toFixed(COMPACT_DECIMALS).replace(TRAILING_ZERO, '') + MILLION_SUFFIX;
|
|
32
|
+
if (n >= TEN_THOUSAND) return Math.round(n / THOUSAND) + THOUSAND_SUFFIX;
|
|
33
|
+
if (n >= THOUSAND) return (n / THOUSAND).toFixed(COMPACT_DECIMALS).replace(TRAILING_ZERO, '') + THOUSAND_SUFFIX;
|
|
34
|
+
return String(n);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface CaptionCut {
|
|
38
|
+
head: string;
|
|
39
|
+
cut: boolean;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function cutCaption(text: string): CaptionCut {
|
|
43
|
+
if (text.length <= CAPTION_LIMIT) return { head: text, cut: false };
|
|
44
|
+
let index = text.lastIndexOf(' ', CAPTION_LIMIT);
|
|
45
|
+
if (index < CAPTION_LIMIT * WORD_BREAK_FLOOR) index = CAPTION_LIMIT;
|
|
46
|
+
return { head: text.slice(0, index).replace(TRAILING_PUNCTUATION, ''), cut: true };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface CaptionRun {
|
|
50
|
+
text: string;
|
|
51
|
+
link: boolean;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function splitCaption(text: string): CaptionRun[] {
|
|
55
|
+
const runs: CaptionRun[] = [];
|
|
56
|
+
for (const segment of text.split(TAG_SPLIT)) {
|
|
57
|
+
if (!segment) continue;
|
|
58
|
+
runs.push({ text: segment, link: TAG_LEADERS.includes(segment.charAt(0)) });
|
|
59
|
+
}
|
|
60
|
+
return runs.length ? runs : [{ text, link: false }];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function sourceUrl(media: ReactNode): string {
|
|
64
|
+
return typeof media === 'string' ? media.trim() : '';
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function sourceNode(media: ReactNode): ReactNode {
|
|
68
|
+
return typeof media === 'string' ? null : media;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function backgroundOf(url: string): CSSProperties | undefined {
|
|
72
|
+
return url ? { backgroundImage: `url("${url.replace(QUOTE, ENCODED_QUOTE)}")` } : undefined;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function isFilled(media: ReactNode): boolean {
|
|
76
|
+
if (typeof media === 'string') return media.trim().length > 0;
|
|
77
|
+
return media !== null && media !== undefined && media !== false && media !== true;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface MediaSurfaceProps {
|
|
81
|
+
media?: ReactNode;
|
|
82
|
+
type: FacebookMediaType;
|
|
83
|
+
frontClassName: string;
|
|
84
|
+
backClassName?: string;
|
|
85
|
+
frontRatio?: FacebookRatio;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function MediaSurface({ media, type, frontClassName, backClassName, frontRatio }: MediaSurfaceProps) {
|
|
89
|
+
const style = backgroundOf(sourceUrl(media));
|
|
90
|
+
const node = sourceNode(media);
|
|
91
|
+
const filled = isFilled(media);
|
|
92
|
+
const echo = type === 'image' ? node : null;
|
|
93
|
+
return (
|
|
94
|
+
<>
|
|
95
|
+
{backClassName ? (
|
|
96
|
+
<div className={backClassName} style={style} aria-hidden="true">
|
|
97
|
+
{echo}
|
|
98
|
+
{filled ? null : <span className="facebook-feed-media__fill" />}
|
|
99
|
+
</div>
|
|
100
|
+
) : null}
|
|
101
|
+
<div className={frontClassName} style={style} data-ratio={frontRatio}>
|
|
102
|
+
{node}
|
|
103
|
+
{filled ? null : <span className="facebook-feed-media__fill" />}
|
|
104
|
+
</div>
|
|
105
|
+
</>
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface PortraitProps {
|
|
110
|
+
avatar?: ReactNode;
|
|
111
|
+
className: string;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export function Portrait({ avatar, className }: PortraitProps) {
|
|
115
|
+
return (
|
|
116
|
+
<div className={className} style={backgroundOf(sourceUrl(avatar))}>
|
|
117
|
+
{sourceNode(avatar)}
|
|
118
|
+
</div>
|
|
119
|
+
);
|
|
120
|
+
}
|