@justanarthur/modo-ui 1.0.0 → 2.0.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 +59 -20
- package/blocks/desktop-shell/examples.mdx +153 -0
- package/blocks/desktop-shell/index.tsx +352 -0
- package/blocks/shell-card/examples.mdx +72 -0
- package/blocks/shell-card/index.tsx +127 -0
- package/blocks/sidebar-app/index.tsx +3 -2
- package/blocks/sidebar-app/thread-page.tsx +2 -2
- package/components/{button → actions/button}/index.tsx +14 -22
- package/components/actions/button/variants.ts +138 -0
- package/components/{copy → actions/copy}/examples.mdx +40 -2
- package/components/{copy → actions/copy}/index.tsx +206 -36
- package/components/{accordion → containers/accordion}/accordion-content.tsx +14 -11
- package/components/{accordion → containers/accordion}/accordion-context.tsx +21 -12
- package/components/{accordion → containers/accordion}/accordion-group.tsx +11 -11
- package/components/{accordion → containers/accordion}/index.tsx +95 -47
- package/components/{card → containers/card}/card-group.tsx +7 -7
- package/components/{card → containers/card}/card-media.tsx +5 -5
- package/components/{card → containers/card}/card-parts.tsx +27 -17
- package/components/{card → containers/card}/examples.mdx +3 -2
- package/components/{card → containers/card}/index.tsx +12 -11
- package/components/{avatar → data-display/avatar}/examples.mdx +1 -1
- package/components/{avatar → data-display/avatar}/index.tsx +5 -5
- package/components/{badge → data-display/badge}/change-demo.tsx +1 -1
- package/components/{badge → data-display/badge}/index.tsx +8 -10
- package/components/{badge → data-display/badge}/variants.ts +7 -0
- package/components/data-display/diff/examples.mdx +72 -0
- package/components/data-display/diff/index.tsx +147 -0
- package/components/data-display/kbd/examples.mdx +55 -0
- package/components/data-display/kbd/index.tsx +65 -0
- package/components/data-display/list/examples.mdx +157 -0
- package/components/data-display/list/index.tsx +130 -0
- package/components/data-display/log-view/examples.mdx +69 -0
- package/components/data-display/log-view/index.tsx +290 -0
- package/components/data-display/log-view/stream-demo.tsx +46 -0
- package/components/data-display/markdown/examples.mdx +92 -0
- package/components/data-display/markdown/index.tsx +291 -0
- package/components/{table → data-display/table}/context.ts +12 -2
- package/components/{table → data-display/table}/head.tsx +5 -5
- package/components/{table → data-display/table}/index.tsx +40 -14
- package/components/{table → data-display/table}/parts.tsx +66 -52
- package/components/feedback/empty-state/examples.mdx +38 -0
- package/components/feedback/empty-state/index.tsx +96 -0
- package/components/feedback/meter/examples.mdx +61 -0
- package/components/feedback/meter/index.tsx +182 -0
- package/components/{progress → feedback/progress}/examples.mdx +2 -2
- package/components/{progress → feedback/progress}/index.tsx +5 -5
- package/components/{progress → feedback/progress}/step-demo.tsx +1 -1
- package/components/feedback/status-dot/examples.mdx +75 -0
- package/components/feedback/status-dot/index.tsx +105 -0
- package/components/inputs/checkbox/index.tsx +15 -9
- package/components/inputs/choice-list/examples.mdx +101 -0
- package/components/inputs/choice-list/index.tsx +186 -0
- package/components/inputs/color-picker/examples.mdx +10 -0
- package/components/inputs/color-picker/format-menu.tsx +1 -1
- package/components/inputs/color-picker/index.tsx +26 -10
- package/components/inputs/color-picker/inputs-row.tsx +1 -1
- package/components/inputs/color-picker/popover.tsx +40 -8
- package/components/inputs/color-picker/saturation-square.tsx +1 -1
- package/components/inputs/color-picker/swatches.tsx +1 -1
- package/components/inputs/combobox/context.ts +25 -1
- package/components/inputs/combobox/examples.mdx +1 -1
- package/components/inputs/combobox/fields.tsx +100 -51
- package/components/inputs/combobox/index.tsx +218 -200
- package/components/inputs/combobox/list.tsx +1 -1
- package/components/inputs/combobox/remote-demo.tsx +1 -1
- package/components/inputs/date-time/calendar/index.tsx +6 -3
- package/components/inputs/date-time/date-picker/examples.mdx +36 -0
- package/components/inputs/date-time/date-picker/index.tsx +106 -20
- package/components/inputs/date-time/date-range-picker/examples.mdx +36 -0
- package/components/inputs/date-time/date-range-picker/index.tsx +331 -54
- package/components/inputs/date-time/day-rules.ts +6 -3
- package/components/inputs/date-time/duration-picker/examples.mdx +16 -0
- package/components/inputs/date-time/duration-picker/index.tsx +74 -22
- package/components/inputs/date-time/month-picker/examples.mdx +12 -0
- package/components/inputs/date-time/month-picker/index.tsx +76 -21
- package/components/inputs/date-time/picker-shell.tsx +142 -11
- package/components/inputs/date-time/time-columns.tsx +5 -2
- package/components/inputs/date-time/time-picker/examples.mdx +13 -0
- package/components/inputs/date-time/time-picker/index.tsx +63 -12
- package/components/inputs/editable-text/examples.mdx +33 -0
- package/components/inputs/editable-text/index.tsx +175 -0
- package/components/inputs/field/index.tsx +1 -1
- package/components/inputs/file-dropzone/file-row.tsx +2 -2
- package/components/inputs/file-dropzone/index.tsx +5 -0
- package/components/inputs/input/index.tsx +1 -1
- package/components/inputs/key-value/examples.mdx +58 -0
- package/components/inputs/key-value/index.tsx +232 -0
- package/components/inputs/label/examples.mdx +1 -1
- package/components/inputs/number-input/index.tsx +4 -4
- package/components/inputs/radio/examples.mdx +10 -0
- package/components/inputs/radio/index.tsx +15 -6
- package/components/inputs/search/examples.mdx +1 -1
- package/components/inputs/search/index.tsx +1 -1
- package/components/inputs/select/examples.mdx +28 -1
- package/components/inputs/select/index.tsx +248 -167
- package/components/inputs/switch/index.tsx +1 -1
- package/components/navigation/breadcrumb/examples.mdx +45 -0
- package/components/navigation/breadcrumb/index.tsx +284 -0
- package/components/navigation/navigation-menu/context.ts +5 -1
- package/components/navigation/navigation-menu/examples.mdx +23 -0
- package/components/navigation/navigation-menu/index.tsx +8 -1
- package/components/navigation/navigation-menu/indicator.tsx +38 -0
- package/components/navigation/navigation-menu/list.tsx +33 -22
- package/components/navigation/pagination/index.tsx +2 -2
- package/components/navigation/sidebar/index.tsx +1 -1
- package/components/navigation/sidebar/sidebar-menu-item.tsx +1 -1
- package/components/navigation/sidebar/sidebar-rail.tsx +1 -1
- package/components/navigation/tabs/examples.mdx +11 -0
- package/components/navigation/tabs/index.tsx +1 -1
- package/components/navigation/tabs/item.tsx +3 -3
- package/components/navigation/tree/examples.mdx +76 -0
- package/components/navigation/tree/index.tsx +431 -0
- package/components/overlays/alert-dialog/examples.mdx +1 -1
- package/components/overlays/alert-dialog/index.tsx +37 -26
- package/components/overlays/alert-dialog/pending-demo.tsx +1 -1
- package/components/overlays/command/examples.mdx +2 -2
- package/components/overlays/command/index.tsx +20 -17
- package/components/overlays/context-menu/index.tsx +38 -29
- package/components/overlays/dialog/examples.mdx +22 -2
- package/components/overlays/dialog/index.tsx +87 -32
- package/components/overlays/dropdown/examples.mdx +86 -2
- package/components/overlays/dropdown/index.tsx +136 -48
- package/components/overlays/dropdown/menu-item.tsx +165 -65
- package/components/overlays/dropdown/menu-parts.tsx +153 -0
- package/components/overlays/dropdown/menu-popup.tsx +52 -10
- package/components/overlays/dropdown/panel-state.ts +49 -16
- package/components/overlays/dropdown/submenu.tsx +26 -27
- package/components/overlays/lightbox/examples.mdx +29 -0
- package/components/overlays/lightbox/index.tsx +395 -0
- package/components/overlays/popover/anchored-demo.tsx +1 -1
- package/components/overlays/popover/examples.mdx +1 -1
- package/components/overlays/popover/index.tsx +27 -24
- package/components/overlays/preview-card/index.tsx +16 -13
- package/components/overlays/sheet/examples.mdx +14 -1
- package/components/overlays/sheet/index.tsx +122 -54
- package/components/overlays/toast/examples.mdx +17 -1
- package/components/overlays/toast/index.tsx +117 -45
- package/components/overlays/toast/manager.ts +45 -12
- package/components/overlays/tooltip/examples.mdx +7 -7
- package/components/overlays/tooltip/index.tsx +59 -50
- package/dist/base.css +62 -82
- package/dist/blocks/desktop-shell/index.d.ts +84 -0
- package/dist/blocks/desktop-shell/index.js +45 -0
- package/dist/blocks/shell-card/index.d.ts +57 -0
- package/dist/blocks/shell-card/index.js +13 -0
- package/dist/blocks/sidebar-app/index.d.ts +24 -4
- package/dist/blocks/sidebar-app/index.js +43 -37
- package/dist/components/{button → actions/button}/index.d.ts +28 -12
- package/dist/components/actions/button/index.js +22 -0
- package/dist/components/actions/button/variants.d.ts +29 -0
- package/dist/components/{button → actions/button}/variants.js +1 -1
- package/dist/components/actions/copy/index.d.ts +79 -0
- package/dist/components/actions/copy/index.js +26 -0
- package/dist/components/{accordion → containers/accordion}/index.d.ts +51 -19
- package/dist/components/containers/accordion/index.js +40 -0
- package/dist/components/{card → containers/card}/index.d.ts +27 -23
- package/dist/components/containers/card/index.js +58 -0
- package/dist/components/data-display/avatar/index.js +20 -0
- package/dist/components/{badge → data-display/badge}/index.d.ts +6 -3
- package/dist/components/data-display/badge/index.js +21 -0
- package/dist/components/{badge → data-display/badge}/variants.d.ts +6 -1
- package/dist/components/{badge → data-display/badge}/variants.js +1 -1
- package/dist/components/data-display/diff/index.d.ts +42 -0
- package/dist/components/data-display/diff/index.js +17 -0
- package/dist/components/data-display/kbd/index.d.ts +28 -0
- package/dist/components/data-display/kbd/index.js +11 -0
- package/dist/components/data-display/list/index.d.ts +60 -0
- package/dist/components/data-display/list/index.js +21 -0
- package/dist/components/data-display/log-view/index.d.ts +47 -0
- package/dist/components/data-display/log-view/index.js +26 -0
- package/dist/components/data-display/markdown/index.d.ts +43 -0
- package/dist/components/data-display/markdown/index.js +34 -0
- package/dist/components/{table → data-display/table}/index.d.ts +24 -7
- package/dist/components/data-display/table/index.js +40 -0
- package/dist/components/feedback/empty-state/index.d.ts +38 -0
- package/dist/components/feedback/empty-state/index.js +15 -0
- package/dist/components/feedback/meter/index.d.ts +48 -0
- package/dist/components/feedback/meter/index.js +13 -0
- package/dist/components/feedback/progress/index.js +16 -0
- package/dist/components/feedback/status-dot/index.d.ts +37 -0
- package/dist/components/feedback/status-dot/index.js +15 -0
- package/dist/components/inputs/checkbox/index.d.ts +8 -5
- package/dist/components/inputs/checkbox/index.js +13 -13
- package/dist/components/inputs/choice-list/index.d.ts +52 -0
- package/dist/components/inputs/choice-list/index.js +25 -0
- package/dist/components/inputs/color-picker/index.d.ts +39 -23
- package/dist/components/inputs/color-picker/index.js +27 -25
- package/dist/components/inputs/color-picker/variants.d.ts +61 -0
- package/dist/components/inputs/color-picker/variants.js +28 -0
- package/dist/components/inputs/combobox/index.d.ts +40 -9
- package/dist/components/inputs/combobox/index.js +21 -21
- package/dist/components/inputs/date-time/calendar/index.d.ts +6 -1
- package/dist/components/inputs/date-time/calendar/index.js +10 -10
- package/dist/components/inputs/date-time/date-picker/index.d.ts +48 -8
- package/dist/components/inputs/date-time/date-picker/index.js +31 -31
- package/dist/components/inputs/date-time/date-range-picker/index.d.ts +99 -18
- package/dist/components/inputs/date-time/date-range-picker/index.js +32 -30
- package/dist/components/inputs/date-time/duration-picker/index.d.ts +52 -9
- package/dist/components/inputs/date-time/duration-picker/index.js +29 -29
- package/dist/components/inputs/date-time/month-picker/index.d.ts +49 -8
- package/dist/components/inputs/date-time/month-picker/index.js +28 -28
- package/dist/components/inputs/date-time/time-picker/index.d.ts +47 -8
- package/dist/components/inputs/date-time/time-picker/index.js +29 -29
- package/dist/components/inputs/editable-text/index.d.ts +38 -0
- package/dist/components/inputs/editable-text/index.js +17 -0
- package/dist/components/inputs/field/index.js +8 -8
- package/dist/components/inputs/file-dropzone/index.d.ts +3 -1
- package/dist/components/inputs/file-dropzone/index.js +10 -10
- package/dist/components/inputs/input/index.js +9 -9
- package/dist/components/inputs/key-value/index.d.ts +57 -0
- package/dist/components/inputs/key-value/index.js +29 -0
- package/dist/components/inputs/label/index.js +2 -2
- package/dist/components/inputs/number-input/index.d.ts +3 -2
- package/dist/components/inputs/number-input/index.js +11 -11
- package/dist/components/inputs/radio/index.d.ts +2 -2
- package/dist/components/inputs/radio/index.js +11 -11
- package/dist/components/inputs/search/index.js +23 -23
- package/dist/components/inputs/select/index.d.ts +71 -47
- package/dist/components/inputs/select/index.js +23 -22
- package/dist/components/inputs/slider/index.js +4 -4
- package/dist/components/inputs/switch/index.js +9 -9
- package/dist/components/inputs/textarea/index.js +5 -5
- package/dist/components/navigation/breadcrumb/index.d.ts +44 -0
- package/dist/components/navigation/breadcrumb/index.js +45 -0
- package/dist/components/navigation/navigation-menu/index.d.ts +13 -2
- package/dist/components/navigation/navigation-menu/index.js +20 -18
- package/dist/components/navigation/pagination/index.js +19 -19
- package/dist/components/navigation/sidebar/index.d.ts +1 -9
- package/dist/components/navigation/sidebar/index.js +26 -26
- package/dist/components/navigation/tabs/index.d.ts +5 -5
- package/dist/components/navigation/tabs/index.js +12 -12
- package/dist/components/navigation/tree/index.d.ts +65 -0
- package/dist/components/navigation/tree/index.js +25 -0
- package/dist/components/overlays/alert-dialog/index.d.ts +35 -15
- package/dist/components/overlays/alert-dialog/index.js +15 -15
- package/dist/components/overlays/command/index.d.ts +6 -1
- package/dist/components/overlays/command/index.js +21 -21
- package/dist/components/overlays/context-menu/index.d.ts +138 -14
- package/dist/components/overlays/context-menu/index.js +29 -26
- package/dist/components/overlays/dialog/index.d.ts +43 -15
- package/dist/components/overlays/dialog/index.js +14 -14
- package/dist/components/overlays/dropdown/index.d.ts +163 -59
- package/dist/components/overlays/dropdown/index.js +37 -26
- package/dist/components/overlays/lightbox/index.d.ts +59 -0
- package/dist/components/overlays/lightbox/index.js +30 -0
- package/dist/components/overlays/popover/index.d.ts +7 -1
- package/dist/components/overlays/popover/index.js +11 -11
- package/dist/components/overlays/preview-card/index.d.ts +4 -1
- package/dist/components/overlays/preview-card/index.js +10 -10
- package/dist/components/overlays/sheet/index.d.ts +49 -8
- package/dist/components/overlays/sheet/index.js +15 -15
- package/dist/components/overlays/toast/index.d.ts +92 -39
- package/dist/components/overlays/toast/index.js +13 -11
- package/dist/components/overlays/tooltip/index.d.ts +16 -6
- package/dist/components/overlays/tooltip/index.js +8 -8
- package/dist/docs/index.d.ts +54 -0
- package/dist/docs/index.js +327 -0
- package/dist/docs/vite.d.ts +50 -0
- package/dist/docs/vite.js +63 -0
- package/dist/index.d.ts +3722 -2274
- package/dist/index.js +240 -115
- package/dist/lib/date-locale.d.ts +13 -1
- package/dist/lib/date-locale.js +11 -3
- package/dist/lib/field-box.js +3 -3
- package/dist/lib/fluid-hover-highlight.js +4 -4
- package/dist/lib/focus-ring.js +3 -3
- package/dist/lib/goo-indicator.js +3 -3
- package/dist/lib/icon-context.d.ts +7 -2
- package/dist/lib/icon-context.js +4 -2
- package/dist/lib/morph-layers.js +3 -3
- package/dist/lib/overlay.js +3 -3
- package/dist/lib/popup-rows.js +2 -2
- package/dist/lib/popup-surface.js +7 -7
- package/dist/lib/row-index.d.ts +6 -9
- package/dist/lib/row-index.js +1 -1
- package/dist/lib/row-order.d.ts +28 -0
- package/dist/lib/row-order.js +11 -0
- package/dist/lib/scroll-column.js +6 -6
- package/dist/lib/shape-context.d.ts +8 -1
- package/dist/lib/shape-context.js +4 -2
- package/dist/lib/slot.d.ts +9 -2
- package/dist/lib/slot.js +5 -3
- package/dist/lib/use-merge-split.js +4 -4
- package/dist/lib/use-morph.js +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/lib/weight-label.js +2 -2
- package/dist/preset.d.ts +9 -0
- package/dist/preset.js +11 -2
- package/dist/primitives/content/code/index.js +14 -0
- package/dist/primitives/content/skeleton/index.js +14 -0
- package/dist/primitives/layout/resizable/index.d.ts +67 -0
- package/dist/primitives/layout/resizable/index.js +16 -0
- package/dist/primitives/layout/scroll-area/index.js +14 -0
- package/dist/primitives/{separator → layout/separator}/index.js +2 -2
- package/dist/primitives/layout/sortable/index.d.ts +79 -0
- package/dist/primitives/layout/sortable/index.js +23 -0
- package/dist/primitives/layout/virtual-list/index.d.ts +50 -0
- package/dist/primitives/layout/virtual-list/index.js +9 -0
- package/dist/primitives/systems/craft/index.js +16 -0
- package/dist/primitives/systems/fluid-hover/index.js +30 -0
- package/dist/primitives/{morph → systems/morph}/index.d.ts +3 -1
- package/dist/primitives/systems/morph/index.js +30 -0
- package/dist/primitives/systems/motion/index.js +25 -0
- package/dist/primitives/{sizes → systems/sizes}/index.d.ts +2 -2
- package/dist/primitives/{sizes → systems/sizes}/index.js +4 -4
- package/dist/primitives/{surface → systems/surface}/index.js +6 -6
- package/dist/shared/{components-7t3pz7v7.js → components-0cpte6s1.js} +76 -40
- package/dist/shared/{components-gc5zky2w.js → components-0h2mng6m.js} +7 -7
- package/dist/shared/{components-62mg6pab.js → components-14wzcym0.js} +16 -16
- package/dist/shared/components-1asw2ph0.js +237 -0
- package/dist/shared/{components-p0z99d5b.js → components-1bnf96sr.js} +17 -15
- package/dist/shared/components-1f3a7gmg.js +168 -0
- package/dist/shared/components-1hb27y2e.js +77 -0
- package/dist/shared/{components-1axxc3tk.js → components-1hga6pkn.js} +8 -8
- package/dist/shared/{components-wyfmhtw9.js → components-1ztgy933.js} +2 -2
- package/dist/shared/{components-0h3f5jae.js → components-22h8dvt1.js} +19 -16
- package/dist/shared/{components-07g2gbjy.js → components-280grw6q.js} +19 -12
- package/dist/shared/components-29ebea21.js +129 -0
- package/dist/shared/{components-zbzx62pg.js → components-2m2hg11x.js} +93 -378
- package/dist/shared/components-3rvrdsa9.js +208 -0
- package/dist/shared/components-464zs8v6.js +152 -0
- package/dist/shared/components-4t2cjav8.js +73 -0
- package/dist/shared/{components-9ybenn5v.js → components-5xs8pkkj.js} +5 -5
- package/dist/shared/{components-gbsdhmrv.js → components-62510420.js} +62 -27
- package/dist/shared/components-6h5qg9rs.js +188 -0
- package/dist/shared/{components-7fsy0jxg.js → components-6rtawx8y.js} +108 -75
- package/dist/shared/{components-n7e31ct4.js → components-77gxngmc.js} +8 -8
- package/dist/shared/components-7mj5wsv3.js +200 -0
- package/dist/shared/{components-amsc86fb.js → components-7xc2dne4.js} +68 -37
- package/dist/shared/{components-pedbt2dc.js → components-8pnvkrbw.js} +1 -1
- package/dist/shared/{components-be3wggg1.js → components-91mmbrw3.js} +5 -5
- package/dist/shared/components-92mvpt9h.js +243 -0
- package/dist/shared/{components-jtfptckj.js → components-9ca0c92a.js} +6 -6
- package/dist/shared/{components-ejn6tvbw.js → components-9h3g4mnq.js} +1 -1
- package/dist/shared/components-9rebr89j.js +249 -0
- package/dist/shared/{components-re8p99fj.js → components-9z7bq8gn.js} +147 -21
- package/dist/shared/{components-3js2vgds.js → components-a1ms36qq.js} +3 -3
- package/dist/shared/{components-q4wyd06h.js → components-a1mwqxsv.js} +88 -22
- package/dist/shared/{components-cy5z8zxy.js → components-azrjnfxn.js} +2 -2
- package/dist/shared/{components-85epgxwf.js → components-b2kjsn1s.js} +60 -37
- package/dist/shared/{components-vgzerqt0.js → components-b7p1pjcm.js} +8 -7
- package/dist/shared/{components-j4z3rtw2.js → components-b9bj65j3.js} +46 -21
- package/dist/shared/{components-0mrhj88d.js → components-c515d6xr.js} +2 -2
- package/dist/shared/{components-5f3tq4qb.js → components-chda6b23.js} +2 -2
- package/dist/shared/{components-az04rmng.js → components-cp5ym3g2.js} +2 -2
- package/dist/shared/components-czvraaw9.js +135 -0
- package/dist/shared/{components-kn5c7652.js → components-e7zxwja1.js} +7 -6
- package/dist/shared/components-ee09xmkh.js +359 -0
- package/dist/shared/{components-3m4rqrqm.js → components-esy5nsvc.js} +3 -3
- package/dist/shared/{components-34brwmgp.js → components-ev0ytbqb.js} +12 -10
- package/dist/shared/{components-zpatc9x3.js → components-fmyvz4r2.js} +9 -8
- package/dist/shared/{components-f9adtfq8.js → components-fpsfr52a.js} +1 -1
- package/dist/shared/{components-zf0nnvvg.js → components-fqsgd07c.js} +68 -24
- package/dist/shared/{components-5vyaexsj.js → components-g35n8tzm.js} +2 -2
- package/dist/shared/components-g8qgr7p8.js +28 -0
- package/dist/shared/{components-88r046aa.js → components-gd8gmr6w.js} +4 -4
- package/dist/shared/{components-f75y4gn8.js → components-gsstwhtv.js} +6 -6
- package/dist/shared/{components-1hc3xv0y.js → components-h0x2pj2y.js} +170 -118
- package/dist/shared/components-h8v9nh5r.js +142 -0
- package/dist/shared/{components-6xfhc5qm.js → components-hcftn5r8.js} +14 -12
- package/dist/shared/components-hh1g7r3t.js +57 -0
- package/dist/shared/{components-jm91mjm1.js → components-hz6armxa.js} +13 -9
- package/dist/shared/{components-k81x1aea.js → components-j3q9kaps.js} +2 -2
- package/dist/shared/{components-88ktjdg0.js → components-j79a6jqa.js} +13 -12
- package/dist/shared/{components-k785rge6.js → components-jeecysvd.js} +24 -168
- package/dist/shared/{components-1nv9q3s8.js → components-jnhpgpfk.js} +29 -2
- package/dist/shared/{components-wgd1nebp.js → components-jw45ck66.js} +4 -4
- package/dist/shared/{components-7fqnqbh0.js → components-kwxye0an.js} +10 -4
- package/dist/shared/{components-qrpdtvxa.js → components-kxpcj2ry.js} +7 -1
- package/dist/shared/components-m3vxpz2z.js +123 -0
- package/dist/shared/{components-86vvx0c8.js → components-me742146.js} +9 -9
- package/dist/shared/{components-jx9qb4z8.js → components-n0gbyp5a.js} +18 -16
- package/dist/shared/{components-8hfrd2fk.js → components-nhmgr5xc.js} +14 -14
- package/dist/shared/{components-nv5m3gcv.js → components-nxqrw789.js} +2 -2
- package/dist/shared/{components-1a7cr7vh.js → components-nz14rwtd.js} +1 -1
- package/dist/shared/{components-j8tcbm8y.js → components-p32aqk3q.js} +2 -2
- package/dist/shared/components-pa2t12j2.js +327 -0
- package/dist/shared/{components-r33dxr5j.js → components-q0hs5rqn.js} +1 -1
- package/dist/shared/{components-xzcgr3gy.js → components-q7zk70tx.js} +6 -6
- package/dist/shared/{components-8sazy704.js → components-r5q9gdh4.js} +13 -12
- package/dist/shared/{components-tjxy84s9.js → components-rgng034x.js} +1 -1
- package/dist/shared/{components-skn189mp.js → components-rzy6h7s4.js} +5 -5
- package/dist/shared/{components-wrbw67f6.js → components-s4x951hj.js} +3 -3
- package/dist/shared/{components-gw0wd7gd.js → components-s90v3jpr.js} +371 -187
- package/dist/shared/components-t0c1rw40.js +75 -0
- package/dist/shared/components-t84071ay.js +76 -0
- package/dist/shared/{components-0p2na0cp.js → components-ta4e10mx.js} +3 -3
- package/dist/shared/components-twyj2y8c.js +336 -0
- package/dist/shared/components-vfreweq3.js +210 -0
- package/dist/shared/{components-2xmke84n.js → components-w1ysefg1.js} +2 -2
- package/dist/shared/{components-5atrr490.js → components-w2at9ntm.js} +27 -13
- package/dist/shared/{components-346ged8v.js → components-wq9hrera.js} +2 -2
- package/dist/shared/{components-tnj6mkhg.js → components-wx1dcp2n.js} +17 -10
- package/dist/shared/components-xa9fvd5b.js +302 -0
- package/dist/shared/{components-1jxw899c.js → components-xnkc892z.js} +8 -6
- package/dist/shared/{components-ycx2kxeq.js → components-xnp09586.js} +1 -1
- package/dist/shared/{components-vp6vzsee.js → components-y09nr7fe.js} +1 -1
- package/dist/shared/{components-sesrjvcc.js → components-y4gsk1jt.js} +3 -3
- package/dist/shared/{components-099sdasz.js → components-y8m64zdw.js} +31 -22
- package/dist/shared/components-yf2gtq68.js +302 -0
- package/dist/shared/{components-xpw8dzb0.js → components-ymq8tbq9.js} +2 -2
- package/dist/shared/components-ywgqahmg.js +80 -0
- package/dist/shared/{components-5ynncdpn.js → components-z0kz9rxj.js} +2 -2
- package/dist/styles.css +212 -137
- package/dist/tailwind.css +14 -0
- package/dist/tokens.css +37 -4
- package/docs/chrome.css +175 -0
- package/docs/chrome.tsx +314 -0
- package/docs/index.ts +8 -0
- package/docs/vite.ts +123 -0
- package/index.ts +40 -21
- package/lib/date-locale.ts +152 -6
- package/lib/icon-context.tsx +45 -1
- package/lib/row-index.tsx +6 -16
- package/lib/row-order.tsx +111 -0
- package/lib/shape-context.tsx +9 -1
- package/lib/slot.tsx +17 -4
- package/lib/use-autosize-textarea.ts +1 -1
- package/lib/use-morph.ts +1 -1
- package/lib/utils.ts +1 -1
- package/package.json +200 -38
- package/primitives/{code → content/code}/index.tsx +4 -4
- package/primitives/{skeleton → content/skeleton}/examples.mdx +1 -1
- package/primitives/{skeleton → content/skeleton}/index.tsx +4 -4
- package/primitives/layout/resizable/examples.mdx +93 -0
- package/primitives/layout/resizable/index.tsx +332 -0
- package/primitives/{scroll-area → layout/scroll-area}/index.tsx +3 -3
- package/primitives/{separator → layout/separator}/examples.mdx +1 -1
- package/primitives/{separator → layout/separator}/index.tsx +1 -1
- package/primitives/layout/sortable/examples.mdx +53 -0
- package/primitives/layout/sortable/index.tsx +351 -0
- package/primitives/layout/virtual-list/examples.mdx +45 -0
- package/primitives/layout/virtual-list/index.tsx +269 -0
- package/primitives/layout/virtual-list/jump-demo.tsx +53 -0
- package/primitives/{craft → systems/craft}/demos.tsx +8 -8
- package/primitives/{craft → systems/craft}/examples.mdx +5 -5
- package/primitives/{craft → systems/craft}/index.tsx +3 -3
- package/primitives/{fluid-hover → systems/fluid-hover}/examples.mdx +1 -1
- package/primitives/{fluid-hover → systems/fluid-hover}/index.tsx +10 -10
- package/primitives/{morph → systems/morph}/examples.mdx +4 -4
- package/primitives/{morph → systems/morph}/index.tsx +71 -66
- package/primitives/{motion → systems/motion}/index.tsx +5 -5
- package/primitives/{sizes → systems/sizes}/examples.mdx +4 -4
- package/primitives/{sizes → systems/sizes}/index.tsx +8 -8
- package/primitives/{surface → systems/surface}/examples.mdx +2 -2
- package/primitives/{surface → systems/surface}/index.tsx +3 -3
- package/tokens/colors.css +234 -0
- package/tokens/motion.css +40 -0
- package/tokens/radius.css +24 -0
- package/tokens/spacing.css +9 -0
- package/tokens/typography.css +119 -0
- package/components/AI/input-message/examples.mdx +0 -134
- package/components/AI/input-message/file-preview-tile.tsx +0 -59
- package/components/AI/input-message/file-thumbnail.tsx +0 -146
- package/components/AI/input-message/index.tsx +0 -625
- package/components/AI/input-message/input-message.css +0 -25
- package/components/AI/input-message/queued-row.tsx +0 -102
- package/components/AI/input-message/shared.ts +0 -38
- package/components/AI/input-message/suggestion-row.tsx +0 -64
- package/components/AI/input-message/use-composer-files.ts +0 -142
- package/components/AI/input-message/use-history-nav.ts +0 -60
- package/components/AI/input-message/use-message-queue.ts +0 -108
- package/components/AI/input-message/use-region-height.ts +0 -34
- package/components/AI/thinking-indicator/examples.mdx +0 -27
- package/components/AI/thinking-indicator/index.tsx +0 -188
- package/components/button/variants.ts +0 -63
- package/dist/components/AI/input-message/index.d.ts +0 -128
- package/dist/components/AI/input-message/index.js +0 -39
- package/dist/components/AI/thinking-indicator/index.d.ts +0 -34
- package/dist/components/AI/thinking-indicator/index.js +0 -17
- package/dist/components/accordion/index.js +0 -39
- package/dist/components/avatar/index.js +0 -20
- package/dist/components/badge/index.js +0 -21
- package/dist/components/button/index.js +0 -22
- package/dist/components/button/variants.d.ts +0 -8
- package/dist/components/card/index.js +0 -57
- package/dist/components/copy/index.d.ts +0 -46
- package/dist/components/copy/index.js +0 -25
- package/dist/components/progress/index.js +0 -16
- package/dist/components/table/index.js +0 -39
- package/dist/primitives/code/index.js +0 -14
- package/dist/primitives/craft/index.js +0 -16
- package/dist/primitives/fluid-hover/index.js +0 -30
- package/dist/primitives/morph/index.js +0 -29
- package/dist/primitives/motion/index.js +0 -25
- package/dist/primitives/scroll-area/index.js +0 -14
- package/dist/primitives/skeleton/index.js +0 -14
- package/dist/shared/components-1p3k62x2.js +0 -137
- package/dist/shared/components-38wa9nx5.js +0 -19
- package/dist/shared/components-50rh4ggz.js +0 -54
- package/dist/shared/components-bdkm2jzy.js +0 -34
- package/dist/shared/components-gkdx1787.js +0 -159
- package/dist/shared/components-nskr4hwg.js +0 -1008
- /package/components/{button → actions/button}/examples.mdx +0 -0
- /package/components/{button → actions/button}/loading-demo.tsx +0 -0
- /package/components/{accordion → containers/accordion}/examples.mdx +0 -0
- /package/components/{badge → data-display/badge}/examples.mdx +0 -0
- /package/components/{table → data-display/table}/examples.mdx +0 -0
- /package/components/{table → data-display/table}/sort-demo.tsx +0 -0
- /package/components/{progress → feedback/progress}/progress.css +0 -0
- /package/components/inputs/color-picker/{color-math.ts → variants.ts} +0 -0
- /package/dist/components/{avatar → data-display/avatar}/index.d.ts +0 -0
- /package/dist/components/{progress → feedback/progress}/index.d.ts +0 -0
- /package/dist/primitives/{code → content/code}/index.d.ts +0 -0
- /package/dist/primitives/{skeleton → content/skeleton}/index.d.ts +0 -0
- /package/dist/primitives/{scroll-area → layout/scroll-area}/index.d.ts +0 -0
- /package/dist/primitives/{separator → layout/separator}/index.d.ts +0 -0
- /package/dist/primitives/{craft → systems/craft}/index.d.ts +0 -0
- /package/dist/primitives/{fluid-hover → systems/fluid-hover}/index.d.ts +0 -0
- /package/dist/primitives/{motion → systems/motion}/index.d.ts +0 -0
- /package/dist/primitives/{surface → systems/surface}/index.d.ts +0 -0
- /package/primitives/{code → content/code}/examples.mdx +0 -0
- /package/primitives/{skeleton → content/skeleton}/skeleton.css +0 -0
- /package/primitives/{scroll-area → layout/scroll-area}/examples.mdx +0 -0
- /package/primitives/{motion → systems/motion}/examples.mdx +0 -0
- /package/primitives/{surface → systems/surface}/surface.css +0 -0
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Fluid Functionalism color tokens.
|
|
3
|
+
*
|
|
4
|
+
* Source: mickadesign/fluid-functionalism `app/globals.css` §1 (DESIGN TOKENS)
|
|
5
|
+
* at commit b3587bdbd83fc66c2a6aae3817ffb856cb09260b — MIT License
|
|
6
|
+
* © 2026 Micka Touillaud — fluidfunctionalism.com.
|
|
7
|
+
*
|
|
8
|
+
* Migration from upstream: every HEX literal was converted to its exact oklch
|
|
9
|
+
* equivalent (sRGB → OKLab, round-trip verified to the original hex). The
|
|
10
|
+
* rgb()/rgba() alpha overlays (--overlay, --hover, --active, --shadow-color,
|
|
11
|
+
* --dm-*) are kept as-is — they are alpha contracts, not palette colors.
|
|
12
|
+
*
|
|
13
|
+
* Every color token is written ONCE, as light-dark(light, dark). Which side
|
|
14
|
+
* renders is driven by `color-scheme` (set in base.css): :root follows the
|
|
15
|
+
* OS, and a `.light` or `.dark` class pins it. The block is declared on
|
|
16
|
+
* `:root, .light, .dark` — not just `:root` — because light-dark() inside a
|
|
17
|
+
* custom property resolves against the color-scheme of the element the
|
|
18
|
+
* property is declared on, so a forced-scope subtree becomes its own
|
|
19
|
+
* resolution point.
|
|
20
|
+
*
|
|
21
|
+
* The surface ladder and its shadow recipes live with their primitive in
|
|
22
|
+
* primitives/systems/surface/surface.css. The one token that cannot ride
|
|
23
|
+
* light-dark() here — the --overlay RGB triplet (consumed as
|
|
24
|
+
* rgb(var(--overlay) / α), an alpha contract) — is re-pointed per scheme in
|
|
25
|
+
* base.css.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
:root,
|
|
29
|
+
.light,
|
|
30
|
+
.dark {
|
|
31
|
+
/* The surface ladder (--surface-1..8) and the shadow recipes pair with it
|
|
32
|
+
in primitives/systems/surface/surface.css. */
|
|
33
|
+
|
|
34
|
+
/* ── Semantic tokens ── */
|
|
35
|
+
/* Same color as --surface-1, inlined so the global token set never
|
|
36
|
+
depends on the surface primitive's CSS being loaded. */
|
|
37
|
+
--background: light-dark(oklch(0.985 0 0), oklch(0.205 0 0));
|
|
38
|
+
--foreground: light-dark(oklch(0.205 0 0), oklch(0.97 0 0));
|
|
39
|
+
/* Same color as --surface-3, inlined for the same reason. */
|
|
40
|
+
--card: light-dark(oklch(1 0 0), oklch(0.264 0 0));
|
|
41
|
+
--card-foreground: light-dark(oklch(0.205 0 0), oklch(0.97 0 0));
|
|
42
|
+
/* Light `muted` decouples from surface-2: the light surface ladder is so
|
|
43
|
+
compressed that a ladder value would read as near-white, making anything
|
|
44
|
+
sitting on it blend together. A slightly greyer value gives muted real
|
|
45
|
+
semantic presence. Dark keeps the ladder value (= surface-2). */
|
|
46
|
+
--muted: light-dark(oklch(0.967 0.001 286.375), oklch(0.235 0 0));
|
|
47
|
+
--muted-foreground: light-dark(oklch(0.556 0 0), oklch(0.7155 0 0));
|
|
48
|
+
/* A tray set into the page, below surface 1 in both schemes (greyer in
|
|
49
|
+
light, darker in dark), so a card resting in it lifts out: ShellCard. */
|
|
50
|
+
--sunken: light-dark(oklch(0.955 0 0), oklch(0.17 0 0));
|
|
51
|
+
|
|
52
|
+
/* ── Interactive states ── */
|
|
53
|
+
--accent: light-dark(oklch(0.922 0 0), oklch(0.439 0 0));
|
|
54
|
+
--accent-foreground: light-dark(oklch(0.205 0 0), oklch(0.97 0 0));
|
|
55
|
+
/* --accent nudged toward the overlay direction (the switch track's hover). */
|
|
56
|
+
--accent-hover: color-mix(in oklab, var(--accent), rgb(var(--overlay)) 10%);
|
|
57
|
+
--selected: light-dark(oklch(0.87 0 0), oklch(0.439 0 0));
|
|
58
|
+
|
|
59
|
+
/* ── Borders ──
|
|
60
|
+
--border mixes from --foreground, so it tracks the theme automatically —
|
|
61
|
+
including inside nested forced scopes, where light-dark() re-resolves
|
|
62
|
+
--foreground before the mix happens. */
|
|
63
|
+
--border: color-mix(in oklab, var(--foreground) 12%, transparent);
|
|
64
|
+
--ring: light-dark(oklch(0.922 0 0), oklch(0.371 0 0));
|
|
65
|
+
--input: light-dark(oklch(0.922 0 0), oklch(0.371 0 0));
|
|
66
|
+
|
|
67
|
+
/* ── Error / Destructive ── */
|
|
68
|
+
--destructive: light-dark(oklch(0.6368 0.2078 25.33), oklch(0.7106 0.1661 22.22));
|
|
69
|
+
--destructive-light: light-dark(oklch(0.971 0.013 17.38), oklch(0.2575 0.0886 26.04));
|
|
70
|
+
|
|
71
|
+
/* ── Brand blue ──
|
|
72
|
+
FF's one chromatic accent: the switch's on-track, the copy field's hover
|
|
73
|
+
highlight, drop-target and selected-swatch rings. */
|
|
74
|
+
--brand: oklch(0.693 0.16 265);
|
|
75
|
+
--brand-hover: oklch(0.649 0.164 264.76);
|
|
76
|
+
|
|
77
|
+
/* ── Focus indicator ──
|
|
78
|
+
Every component focus ring reads it (`ring-focus-ring`,
|
|
79
|
+
`border-focus-ring`), so this is the single theming point. */
|
|
80
|
+
--focus-ring: var(--brand);
|
|
81
|
+
|
|
82
|
+
/* ── Alpha checkerboard (color-picker swatches) ── */
|
|
83
|
+
--checker-a: light-dark(oklch(0.792 0 0), oklch(0.239 0 0));
|
|
84
|
+
--checker-b: light-dark(oklch(1 0 0), oklch(0.285 0 0));
|
|
85
|
+
/* Swatch edges: a mid-grey hairline that reads on any swatch color in
|
|
86
|
+
either scheme, plus the hover / selected rings, set off by a
|
|
87
|
+
--background gap. */
|
|
88
|
+
--swatch-edge: rgb(127 127 127 / 0.25);
|
|
89
|
+
--swatch-edge-hover: rgb(127 127 127 / 0.4);
|
|
90
|
+
--shadow-swatch: inset 0 0 0 1px var(--swatch-edge);
|
|
91
|
+
--shadow-swatch-hover: var(--shadow-swatch), 0 0 0 2px var(--background), 0 0 0 4px var(--swatch-edge-hover);
|
|
92
|
+
--shadow-swatch-selected: var(--shadow-swatch), 0 0 0 2px var(--background), 0 0 0 4px var(--brand);
|
|
93
|
+
|
|
94
|
+
/* ── Thumbs (switch, slider) ──
|
|
95
|
+
White in both schemes, set off by a soft drop. */
|
|
96
|
+
--thumb: oklch(1 0 0);
|
|
97
|
+
--shadow-thumb: 0 1px 2px rgb(0 0 0 / 0.1);
|
|
98
|
+
|
|
99
|
+
/* ── Color picker affordances ──
|
|
100
|
+
Drawn over any user color, so fixed white and black rather than theme
|
|
101
|
+
colors: they have to read on every fill, in either scheme. */
|
|
102
|
+
--picker-edge: oklch(0 0 0);
|
|
103
|
+
--picker-ring: oklch(1 0 0 / 0.55);
|
|
104
|
+
--picker-thumb-border: oklch(1 0 0 / 0.9);
|
|
105
|
+
--shadow-picker-thumb: 0 0 0 1px var(--picker-edge);
|
|
106
|
+
--shadow-picker-cursor: 0 0 0 1px oklch(0 0 0 / 0.2);
|
|
107
|
+
--drop-shadow-picker-cursor: 0 1px 1px oklch(0 0 0 / 0.4);
|
|
108
|
+
|
|
109
|
+
/* ── Composer (the ai kit's Composer.Draft) ──
|
|
110
|
+
The focused edge recolors surface-2's 1px ring; the drop keeps the
|
|
111
|
+
composer's lift under every edge state. */
|
|
112
|
+
--composer-edge-focus: color-mix(in oklab, var(--foreground) 20%, transparent);
|
|
113
|
+
--composer-edge-drop: 0 1px 1px -0.5px var(--shadow-color);
|
|
114
|
+
|
|
115
|
+
/* ── Controls ──
|
|
116
|
+
An unchecked checkbox or radio takes a stronger edge than --border;
|
|
117
|
+
a modal dialog dims the page behind it with the scrim. */
|
|
118
|
+
--control-border: light-dark(oklch(0.708 0 0), oklch(0.556 0 0));
|
|
119
|
+
--scrim: light-dark(oklch(0 0 0 / 0.4), oklch(0 0 0 / 0.8));
|
|
120
|
+
|
|
121
|
+
/* ── Button status washes (local) ──
|
|
122
|
+
Button's destructive and success variants: the hue as text on a wash of
|
|
123
|
+
itself, never a solid fill behind text (DESIGN.md › Status). The washes
|
|
124
|
+
mix toward transparent like --hover, so they read on any surface level,
|
|
125
|
+
and deepen on hover and press (16 → 20 → 24%). The -strong text steps
|
|
126
|
+
are the hue darkened in light and lightened in dark, so a 13px label
|
|
127
|
+
holds WCAG AA (≥ 4.5:1) on its wash at rest, hover and press over
|
|
128
|
+
surfaces 1–5 in both schemes. */
|
|
129
|
+
--destructive-strong: light-dark(oklch(0.47 0.175 27), oklch(0.81 0.105 22));
|
|
130
|
+
--destructive-wash: color-mix(in oklab, var(--destructive) 16%, transparent);
|
|
131
|
+
--destructive-wash-hover: color-mix(in oklab, var(--destructive) 20%, transparent);
|
|
132
|
+
--destructive-wash-active: color-mix(in oklab, var(--destructive) 24%, transparent);
|
|
133
|
+
--success-strong: light-dark(oklch(0.46 0.12 151), oklch(0.83 0.15 152));
|
|
134
|
+
--success-wash: color-mix(in oklab, var(--status-success) 16%, transparent);
|
|
135
|
+
--success-wash-hover: color-mix(in oklab, var(--status-success) 20%, transparent);
|
|
136
|
+
--success-wash-active: color-mix(in oklab, var(--status-success) 24%, transparent);
|
|
137
|
+
|
|
138
|
+
/* ── Button outline (local) ──
|
|
139
|
+
The outline variant's frame on --control-border, which holds 3:1
|
|
140
|
+
against the surfaces (WCAG 1.4.11) where --border is a hairline. At
|
|
141
|
+
rest it is a 1px ring outside the fill; pressed it hands off to an inset
|
|
142
|
+
ring, so the frame moves in with the fill. */
|
|
143
|
+
--shadow-button-outline: 0 0 0 1px var(--control-border), inset 0 0 0 0 var(--control-border);
|
|
144
|
+
--shadow-button-outline-pressed: 0 0 0 0 var(--control-border), inset 0 0 0 1px var(--control-border);
|
|
145
|
+
/* The ghost variant's rest ring: the 1px spread its hover wash grows into,
|
|
146
|
+
transparent so the ring fades in instead of popping. */
|
|
147
|
+
--shadow-button-ghost: 0 0 0 1px transparent;
|
|
148
|
+
|
|
149
|
+
/* ── Placeholders ──
|
|
150
|
+
The Skeleton's fill: a foreground mix like --border, so it tracks the
|
|
151
|
+
scheme and reads on any surface level. */
|
|
152
|
+
--skeleton: color-mix(in oklab, var(--foreground) 8%, transparent);
|
|
153
|
+
|
|
154
|
+
/* ── Surface-relative interactive overlays (work on any elevation) ──
|
|
155
|
+
--overlay is the tint-direction triplet — black for light surfaces,
|
|
156
|
+
white for dark. Components consume it as rgb(var(--overlay) / α), so it
|
|
157
|
+
stays an RGB triplet and switches per theme in base.css. --hover and
|
|
158
|
+
--active are the pre-mixed conveniences. */
|
|
159
|
+
--overlay: 0 0 0;
|
|
160
|
+
--hover: light-dark(rgb(0 0 0 / 0.04), rgb(255 255 255 / 0.06));
|
|
161
|
+
--active: light-dark(rgb(0 0 0 / 0.07), rgb(255 255 255 / 0.1));
|
|
162
|
+
|
|
163
|
+
/* ── Syntax (primitives/content/code) ──
|
|
164
|
+
Low-chroma hues so code reads as text first; identifiers, JSX text and
|
|
165
|
+
punctuation ride the existing foreground pair. */
|
|
166
|
+
--syntax-keyword: light-dark(oklch(0.52 0.16 300), oklch(0.76 0.12 300));
|
|
167
|
+
--syntax-string: light-dark(oklch(0.52 0.12 150), oklch(0.79 0.11 150));
|
|
168
|
+
--syntax-class: light-dark(oklch(0.56 0.12 65), oklch(0.81 0.1 75));
|
|
169
|
+
--syntax-entity: light-dark(oklch(0.52 0.15 255), oklch(0.77 0.11 250));
|
|
170
|
+
--syntax-property: light-dark(oklch(0.52 0.1 205), oklch(0.79 0.08 200));
|
|
171
|
+
--syntax-comment: light-dark(oklch(0.62 0 0), oklch(0.56 0 0));
|
|
172
|
+
--syntax-identifier: var(--foreground);
|
|
173
|
+
--syntax-jsx: var(--foreground);
|
|
174
|
+
--syntax-sign: var(--muted-foreground);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* ── Primary action (theme hooks) ──
|
|
178
|
+
What the primary Button paints, as hooks a host re-points to recolour it
|
|
179
|
+
(a brand fill with a lit edge) without forking the component:
|
|
180
|
+
--primary the fill. Defaults to the ink.
|
|
181
|
+
--primary-hover its hover fill, 10% toward --background.
|
|
182
|
+
--primary-active its pressed fill, 20% toward --background.
|
|
183
|
+
--primary-foreground the label on the fill. Defaults to --background.
|
|
184
|
+
--shadow-button-primary an extra shadow list for the fill layer, drawn
|
|
185
|
+
over the layer's own press ring (a highlight,
|
|
186
|
+
an outline, a drop). The default is an
|
|
187
|
+
invisible no-op that stays valid in a list.
|
|
188
|
+
All five default to what the primary Button always drew. Override
|
|
189
|
+
--primary-hover and --primary-active with --primary, since their defaults
|
|
190
|
+
mix from the value --primary has where they are declared. `bg-primary`,
|
|
191
|
+
`text-primary-foreground` and `shadow-button-primary` read them. Zero
|
|
192
|
+
specificity (:where), so a host's override wins in any stylesheet order. */
|
|
193
|
+
:where(:root, .light, .dark) {
|
|
194
|
+
--primary: var(--foreground);
|
|
195
|
+
--primary-hover: color-mix(in oklab, var(--primary) 90%, var(--background));
|
|
196
|
+
--primary-active: color-mix(in oklab, var(--primary) 80%, var(--background));
|
|
197
|
+
--primary-foreground: var(--background);
|
|
198
|
+
--shadow-button-primary: 0 0 #0000;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/* ── Badge palette ──
|
|
202
|
+
Badge's `color` hues (upstream hex, as exact oklch). Constant across
|
|
203
|
+
schemes; the solid variant mixes each 15% into --background. */
|
|
204
|
+
:root {
|
|
205
|
+
--badge-gray: oklch(0.715 0 0);
|
|
206
|
+
--badge-red: oklch(0.637 0.208 25.33);
|
|
207
|
+
--badge-orange: oklch(0.7049 0.1867 47.6);
|
|
208
|
+
--badge-amber: oklch(0.7686 0.1647 70.08);
|
|
209
|
+
--badge-yellow: oklch(0.7952 0.1617 86.05);
|
|
210
|
+
--badge-lime: oklch(0.7681 0.2044 130.85);
|
|
211
|
+
--badge-green: oklch(0.723 0.192 149.58);
|
|
212
|
+
--badge-emerald: oklch(0.6959 0.1491 162.48);
|
|
213
|
+
--badge-teal: oklch(0.704 0.123 182.5);
|
|
214
|
+
--badge-cyan: oklch(0.7148 0.1257 215.22);
|
|
215
|
+
--badge-blue: oklch(0.623 0.188 259.81);
|
|
216
|
+
--badge-indigo: oklch(0.585 0.204 277.12);
|
|
217
|
+
--badge-violet: oklch(0.606 0.219 292.72);
|
|
218
|
+
--badge-purple: oklch(0.627 0.233 303.9);
|
|
219
|
+
--badge-fuchsia: oklch(0.667 0.259 322.15);
|
|
220
|
+
--badge-pink: oklch(0.656 0.212 354.31);
|
|
221
|
+
--badge-rose: oklch(0.645 0.215 16.44);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/* ── Status roles ──
|
|
225
|
+
The toast states, picked from the badge palette (and --destructive /
|
|
226
|
+
--brand) by reference, so a status reads the same wherever it shows. */
|
|
227
|
+
:root {
|
|
228
|
+
--status-success: var(--badge-green);
|
|
229
|
+
--status-loading: var(--badge-gray);
|
|
230
|
+
--status-error: var(--destructive);
|
|
231
|
+
--status-warning: var(--badge-amber);
|
|
232
|
+
--status-info: var(--badge-blue);
|
|
233
|
+
--status-action: var(--brand);
|
|
234
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Fluid Functionalism motion tokens.
|
|
3
|
+
*
|
|
4
|
+
* Source: mickadesign/fluid-functionalism `registry/default/lib/springs.ts`
|
|
5
|
+
* at commit b3587bdbd83fc66c2a6aae3817ffb856cb09260b — MIT License © 2026
|
|
6
|
+
* Micka Touillaud — fluidfunctionalism.com.
|
|
7
|
+
*
|
|
8
|
+
* FF's motion is JS: the `spring` tiers in lib/springs.ts feed
|
|
9
|
+
* `motion/react`, and components always reach for a tier rather than a
|
|
10
|
+
* hand-written duration. These properties mirror those tiers for CSS
|
|
11
|
+
* consumers and for the tokens page — keep the two in sync.
|
|
12
|
+
*
|
|
13
|
+
* Each tier's enter transition is a spring of the given duration; its exit is
|
|
14
|
+
* a plain tween one step quicker, so a dismissal reads as crisp and final.
|
|
15
|
+
* fast 80ms enter, 60ms exit — critically damped (bounce 0)
|
|
16
|
+
* moderate 160ms enter, 120ms exit — critically damped (bounce 0): panels,
|
|
17
|
+
* dropdowns, tabs, merged selection backgrounds
|
|
18
|
+
* slow 240ms enter, 160ms exit — the one tier with a little bounce
|
|
19
|
+
* (bounce 0.12)
|
|
20
|
+
* The bigger the thing that moves, the slower the tier.
|
|
21
|
+
*
|
|
22
|
+
* Local addition: `goo`, the morph engine's tier for the goo effect — 250ms
|
|
23
|
+
* to land (bounce 0.15), a 200ms spring back — so the liquid neck reads.
|
|
24
|
+
*
|
|
25
|
+
* Local addition: `loop`, the period of ambient animations that run while
|
|
26
|
+
* something is pending (the skeleton's pulse, the spinner, the indeterminate
|
|
27
|
+
* progress bar). They never land, so they are not a spring tier.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
:root {
|
|
31
|
+
--duration-fast: 80ms;
|
|
32
|
+
--duration-fast-exit: 60ms;
|
|
33
|
+
--duration-moderate: 160ms;
|
|
34
|
+
--duration-moderate-exit: 120ms;
|
|
35
|
+
--duration-slow: 240ms;
|
|
36
|
+
--duration-slow-exit: 160ms;
|
|
37
|
+
--duration-goo: 250ms;
|
|
38
|
+
--duration-goo-exit: 200ms;
|
|
39
|
+
--duration-loop: 2s;
|
|
40
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/* Fluid Functionalism's corner token (upstream tokens/radius.css). */
|
|
3
|
+
--radius: 0.625rem;
|
|
4
|
+
|
|
5
|
+
/* Small-box corners between wind4's xs (2px) and md (6px) steps, read by
|
|
6
|
+
the `rounded-box|glyph` utility in preset.ts: checkbox squares and
|
|
7
|
+
keycaps, and the composer's stop glyph. */
|
|
8
|
+
--radius-box: 5px;
|
|
9
|
+
--radius-glyph: 3px;
|
|
10
|
+
|
|
11
|
+
/* shape-context's steps off wind4's scale, read by `rounded-pill|focus-ring|
|
|
12
|
+
pill-focus-ring` in preset.ts: the pill mode's item corner, and the focus
|
|
13
|
+
ring 2px outside an item in each mode (item + 2, so it stays concentric).
|
|
14
|
+
test/shape-radii.test.ts holds shape-classes' numeric radii to them. */
|
|
15
|
+
--radius-pill: 20px;
|
|
16
|
+
--radius-focus-ring: 10px;
|
|
17
|
+
--radius-pill-focus-ring: 22px;
|
|
18
|
+
|
|
19
|
+
/* A shell one spacing step around a container, concentric with it: the
|
|
20
|
+
container's corner (12px rounded, 24px pill) plus the inset, read by
|
|
21
|
+
`rounded-shell|pill-shell` (ShellCard). */
|
|
22
|
+
--radius-shell: calc(12px + var(--space-2));
|
|
23
|
+
--radius-pill-shell: calc(24px + var(--space-2));
|
|
24
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Fluid Functionalism type tokens.
|
|
3
|
+
*
|
|
4
|
+
* Source: mickadesign/fluid-functionalism `app/globals.css` §3–4 (`--font-sans`,
|
|
5
|
+
* the `--fs-*` type-scale roles and their `@utility text-*` classes) at commit
|
|
6
|
+
* b3587bdbd83fc66c2a6aae3817ffb856cb09260b — MIT License © 2026 Micka
|
|
7
|
+
* Touillaud — fluidfunctionalism.com.
|
|
8
|
+
*
|
|
9
|
+
* Local changes:
|
|
10
|
+
* - The family is Inter Variable from @fontsource-variable/inter/opsz
|
|
11
|
+
* (imported in base.css) instead of upstream's self-hosted
|
|
12
|
+
* InterVariable.ttf. The opsz build matters: the `--weight-*` ladder sets
|
|
13
|
+
* both the wght and opsz axes.
|
|
14
|
+
* - The role sizes are renamed `--fs-*` → `--text-*` and read by the
|
|
15
|
+
* `text-<role>[-compact]` utility in preset.ts. They hold both columns of
|
|
16
|
+
* `typeScale` in lib/size-context.tsx (keep the two in sync), so a
|
|
17
|
+
* component's `compact ? … : …` picks a token on either side. Upstream's
|
|
18
|
+
* site-chrome extras — the 22px mobile display step and the
|
|
19
|
+
* `html[data-size="compact"]` override set by the docs site's
|
|
20
|
+
* SizeAttribute — are not carried over.
|
|
21
|
+
* - `micro` (keycaps, one notch below caption) is a local role.
|
|
22
|
+
* - Each role's line-height (FF's typography page: 28/34, 16/22, 14/20,
|
|
23
|
+
* 13/20, 12/16) is a `--leading-*` token, emitted by the same
|
|
24
|
+
* `text-<role>` rule; the compact step keeps its role's leading.
|
|
25
|
+
* - The docs chrome's element roles (`--font-size-<el>`, `--line-height-<el>`,
|
|
26
|
+
* `--font-weight-<el>`, `--color-<el>`) reference these, following FF's
|
|
27
|
+
* rules: headings in foreground, text muted.
|
|
28
|
+
* - Upstream's `fontWeights` (lib/font-weight.ts, fontVariationSettings
|
|
29
|
+
* strings) become the `--weight-*` variation settings, read by the
|
|
30
|
+
* `weight-*` utility in preset.ts. Each derives its wght from
|
|
31
|
+
* `--font-weight-*`, the plain font-weight form the docs chrome reads.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
:root {
|
|
35
|
+
--font-sans: "Inter Variable", ui-sans-serif, system-ui, sans-serif;
|
|
36
|
+
--font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
|
|
37
|
+
|
|
38
|
+
/* Page titles. */
|
|
39
|
+
--text-display: 28px;
|
|
40
|
+
/* Section headings, dialog titles. */
|
|
41
|
+
--text-title: 16px;
|
|
42
|
+
/* Card titles, emphasized rows. */
|
|
43
|
+
--text-subtitle: 14px;
|
|
44
|
+
/* Control labels and body copy. */
|
|
45
|
+
--text-body: 13px;
|
|
46
|
+
/* Secondary text: descriptions, meta rows, errors, group labels. */
|
|
47
|
+
--text-caption: 12px;
|
|
48
|
+
/* Keycaps and chips. */
|
|
49
|
+
--text-micro: 11px;
|
|
50
|
+
|
|
51
|
+
/* Each role's paired line-height. */
|
|
52
|
+
--leading-display: 34px;
|
|
53
|
+
--leading-title: 22px;
|
|
54
|
+
--leading-subtitle: 20px;
|
|
55
|
+
--leading-body: 20px;
|
|
56
|
+
--leading-caption: 16px;
|
|
57
|
+
--leading-micro: 14px;
|
|
58
|
+
|
|
59
|
+
/* The compact step: each role one notch down. */
|
|
60
|
+
--text-display-compact: 24px;
|
|
61
|
+
--text-title-compact: 15px;
|
|
62
|
+
--text-subtitle-compact: 13px;
|
|
63
|
+
--text-body-compact: 12px;
|
|
64
|
+
--text-caption-compact: 11px;
|
|
65
|
+
--text-micro-compact: 10px;
|
|
66
|
+
|
|
67
|
+
/* Inter variable weights, each paired with the opsz that keeps a label's
|
|
68
|
+
advance width steady as it changes weight. */
|
|
69
|
+
--font-weight-normal: 400;
|
|
70
|
+
--font-weight-medium: 450;
|
|
71
|
+
--font-weight-semibold: 550;
|
|
72
|
+
--font-weight-bold: 700;
|
|
73
|
+
--weight-normal: "wght" var(--font-weight-normal), "opsz" 14;
|
|
74
|
+
--weight-medium: "wght" var(--font-weight-medium), "opsz" 15;
|
|
75
|
+
--weight-semibold: "wght" var(--font-weight-semibold), "opsz" 18;
|
|
76
|
+
--weight-bold: "wght" var(--font-weight-bold), "opsz" 25;
|
|
77
|
+
|
|
78
|
+
/* The docs chrome's elements (modo's type contract), on the roles above. */
|
|
79
|
+
--font-size-h1: var(--text-display);
|
|
80
|
+
--line-height-h1: var(--leading-display);
|
|
81
|
+
--font-weight-h1: var(--font-weight-bold);
|
|
82
|
+
--color-h1: var(--foreground);
|
|
83
|
+
|
|
84
|
+
--font-size-h2: var(--text-title);
|
|
85
|
+
--line-height-h2: var(--leading-title);
|
|
86
|
+
--font-weight-h2: var(--font-weight-semibold);
|
|
87
|
+
--color-h2: var(--foreground);
|
|
88
|
+
|
|
89
|
+
--font-size-h3: var(--text-subtitle);
|
|
90
|
+
--line-height-h3: var(--leading-subtitle);
|
|
91
|
+
--font-weight-h3: var(--font-weight-semibold);
|
|
92
|
+
--color-h3: var(--foreground);
|
|
93
|
+
|
|
94
|
+
--font-size-h4: var(--text-body);
|
|
95
|
+
--line-height-h4: var(--leading-body);
|
|
96
|
+
--font-weight-h4: var(--font-weight-semibold);
|
|
97
|
+
--color-h4: var(--foreground);
|
|
98
|
+
|
|
99
|
+
--font-size-p: var(--text-body);
|
|
100
|
+
--line-height-p: var(--leading-body);
|
|
101
|
+
--font-weight-p: var(--font-weight-normal);
|
|
102
|
+
--color-p: var(--muted-foreground);
|
|
103
|
+
|
|
104
|
+
--font-size-lead: var(--text-body);
|
|
105
|
+
--line-height-lead: var(--leading-body);
|
|
106
|
+
--font-weight-lead: var(--font-weight-normal);
|
|
107
|
+
--color-lead: var(--muted-foreground);
|
|
108
|
+
|
|
109
|
+
--font-size-eyebrow: var(--text-caption);
|
|
110
|
+
--line-height-eyebrow: var(--leading-caption);
|
|
111
|
+
--font-weight-eyebrow: var(--font-weight-medium);
|
|
112
|
+
--color-eyebrow: var(--muted-foreground);
|
|
113
|
+
|
|
114
|
+
--font-size-sm: var(--text-caption);
|
|
115
|
+
--line-height-sm: var(--leading-caption);
|
|
116
|
+
|
|
117
|
+
--font-size-xs: var(--text-micro);
|
|
118
|
+
--line-height-xs: var(--leading-micro);
|
|
119
|
+
}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import InputMessage from './index'
|
|
2
|
-
import Button from '../../button'
|
|
3
|
-
import { ChevronDown, Plus } from 'lucide-react'
|
|
4
|
-
|
|
5
|
-
# Basic
|
|
6
|
-
|
|
7
|
-
No props at all: the composer keeps its own draft, grows as you type and
|
|
8
|
-
clears itself on Enter.
|
|
9
|
-
|
|
10
|
-
<div className="w-full max-w-xl">
|
|
11
|
-
<InputMessage />
|
|
12
|
-
</div>
|
|
13
|
-
|
|
14
|
-
# Suggestions
|
|
15
|
-
|
|
16
|
-
The ghost placeholder renders with a Tab keycap — Tab fills it into the
|
|
17
|
-
composer. ArrowDown/ArrowUp walk the list below (focus stays in the
|
|
18
|
-
textarea) and Enter or click fills the highlighted prompt; the first row
|
|
19
|
-
shows a ↓ hint until a row is highlighted. Typing collapses the list.
|
|
20
|
-
|
|
21
|
-
<div className="w-full max-w-xl">
|
|
22
|
-
<InputMessage
|
|
23
|
-
placeholderSuggestion="Why is every other input box so stiff?"
|
|
24
|
-
suggestions={[
|
|
25
|
-
'What is Fluid Functionalism about?',
|
|
26
|
-
'How does Micka tune the springs behind these animations?',
|
|
27
|
-
'Install the InputMessage component in my project',
|
|
28
|
-
'Draft a short thank-you note to Micka for the library',
|
|
29
|
-
]}
|
|
30
|
-
/>
|
|
31
|
-
</div>
|
|
32
|
-
|
|
33
|
-
# Attachments
|
|
34
|
-
|
|
35
|
-
`defaultFiles` seeds the composer and turns attachment behavior on: drop a
|
|
36
|
-
PNG, JPEG or PDF anywhere on the panel, or use the render-fn slot's
|
|
37
|
-
`openFilePicker`. Images preview with object-cover, PDFs render their
|
|
38
|
-
first page, anything else falls back to a document glyph — hover a tile
|
|
39
|
-
for its × button.
|
|
40
|
-
|
|
41
|
-
<div className="w-full max-w-xl">
|
|
42
|
-
<InputMessage
|
|
43
|
-
defaultFiles={[
|
|
44
|
-
new File(['<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><rect width="80" height="80" fill="#6B97FF" /></svg>'], 'swatch.svg', { type: 'image/svg+xml' }),
|
|
45
|
-
new File(['Quarterly notes'], 'notes.txt', { type: 'text/plain' }),
|
|
46
|
-
]}
|
|
47
|
-
leftSlot={({ openFilePicker }) => (
|
|
48
|
-
<Button variant="ghost" size="icon-compact" aria-label="Attach" onClick={() => openFilePicker()}>
|
|
49
|
-
<Plus />
|
|
50
|
-
</Button>
|
|
51
|
-
)}
|
|
52
|
-
/>
|
|
53
|
-
</div>
|
|
54
|
-
|
|
55
|
-
# Queued messages
|
|
56
|
-
|
|
57
|
-
`defaultStatus="streaming"` plus `defaultQueue` runs the composer as if a
|
|
58
|
-
response were in flight: the send button is a Queue action, so a typed
|
|
59
|
-
message joins the rows above instead of sending. Drag a row (or Alt+↑/↓)
|
|
60
|
-
to reorder, double-click to pull it back into the composer, × to drop it.
|
|
61
|
-
Clear the draft and the button becomes Stop — pressing it ends the
|
|
62
|
-
response, and that streaming→idle edge dispatches the row at the top.
|
|
63
|
-
|
|
64
|
-
<div className="w-full max-w-xl">
|
|
65
|
-
<InputMessage
|
|
66
|
-
defaultStatus="streaming"
|
|
67
|
-
defaultQueue={[
|
|
68
|
-
{ id: 'q1', text: 'Also add a dark-mode screenshot', files: [] },
|
|
69
|
-
{ id: 'q2', text: 'And link the changelog entry', files: [] },
|
|
70
|
-
]}
|
|
71
|
-
/>
|
|
72
|
-
</div>
|
|
73
|
-
|
|
74
|
-
# History
|
|
75
|
-
|
|
76
|
-
`history` lists sent messages, oldest first. With the caret on the first
|
|
77
|
-
line, ArrowUp recalls the previous one; ArrowDown on the last line walks
|
|
78
|
-
forward and, past the newest, brings back the draft.
|
|
79
|
-
|
|
80
|
-
<div className="w-full max-w-xl">
|
|
81
|
-
<InputMessage history={['Summarize the release notes', 'Now as a bulleted list']} />
|
|
82
|
-
</div>
|
|
83
|
-
|
|
84
|
-
# Left Slot Only
|
|
85
|
-
|
|
86
|
-
`leftSlot` takes the bottom-left action area — an attach button, a model
|
|
87
|
-
switcher, a mode toggle.
|
|
88
|
-
|
|
89
|
-
<div className="w-full max-w-xl">
|
|
90
|
-
<InputMessage
|
|
91
|
-
leftSlot={
|
|
92
|
-
<Button variant="ghost" size="icon-compact" aria-label="Attach">
|
|
93
|
-
<Plus />
|
|
94
|
-
</Button>
|
|
95
|
-
}
|
|
96
|
-
/>
|
|
97
|
-
</div>
|
|
98
|
-
|
|
99
|
-
# Right Slot Only
|
|
100
|
-
|
|
101
|
-
`rightSlot` sits in the bottom-right, just before the built-in send
|
|
102
|
-
button.
|
|
103
|
-
|
|
104
|
-
<div className="w-full max-w-xl">
|
|
105
|
-
<InputMessage
|
|
106
|
-
rightSlot={
|
|
107
|
-
<Button variant="ghost" size="compact" trailingIcon={ChevronDown}>
|
|
108
|
-
Sonnet 4.6
|
|
109
|
-
</Button>
|
|
110
|
-
}
|
|
111
|
-
/>
|
|
112
|
-
</div>
|
|
113
|
-
|
|
114
|
-
# Send Handler
|
|
115
|
-
|
|
116
|
-
`onSend` receives the trimmed text and the attached files; an uncontrolled
|
|
117
|
-
composer clears its own draft afterwards. The handler here is an empty
|
|
118
|
-
arrow — in an app it is where the message joins the transcript.
|
|
119
|
-
|
|
120
|
-
<div className="w-full max-w-xl">
|
|
121
|
-
<InputMessage
|
|
122
|
-
onSend={() => {}}
|
|
123
|
-
placeholder="Press Enter to send. Shift+Enter for newline."
|
|
124
|
-
/>
|
|
125
|
-
</div>
|
|
126
|
-
|
|
127
|
-
# Disabled
|
|
128
|
-
|
|
129
|
-
Dims the panel to 50% and drops pointer events — textarea, send button and
|
|
130
|
-
drag-and-drop all go inert.
|
|
131
|
-
|
|
132
|
-
<div className="w-full max-w-xl">
|
|
133
|
-
<InputMessage defaultValue="This composer is disabled" disabled />
|
|
134
|
-
</div>
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Ported from Fluid Functionalism — github.com/mickadesign/fluid-functionalism
|
|
3
|
-
* `registry/default/input-message.tsx` @ b3587bdbd83fc66c2a6aae3817ffb856cb09260b
|
|
4
|
-
* MIT License © 2026 Micka Touillaud (notice: LICENSE.fluid-functionalism). Local changes: see PORTING.md.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
'use client'
|
|
8
|
-
|
|
9
|
-
import { motion } from 'motion/react'
|
|
10
|
-
import { forwardRef } from 'react'
|
|
11
|
-
import { useIcon } from '../../../lib/icon-context'
|
|
12
|
-
import { spring } from '../../../lib/springs'
|
|
13
|
-
import { Tooltip } from '../../overlays/tooltip'
|
|
14
|
-
import { FileThumbnail } from './file-thumbnail'
|
|
15
|
-
|
|
16
|
-
interface FilePreviewTileProps {
|
|
17
|
-
file: File
|
|
18
|
-
onRemove: () => void
|
|
19
|
-
size: number
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// A forwardRef: `<AnimatePresence mode="popLayout">` measures the exiting tile
|
|
23
|
-
// through a ref, which React 18 drops on a plain function component.
|
|
24
|
-
const FilePreviewTile = forwardRef<HTMLDivElement, FilePreviewTileProps>(function FilePreviewTile(
|
|
25
|
-
{ file, onRemove, size },
|
|
26
|
-
ref,
|
|
27
|
-
) {
|
|
28
|
-
const XIcon = useIcon('x')
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<motion.div
|
|
32
|
-
ref={ref}
|
|
33
|
-
layout
|
|
34
|
-
initial={{ opacity: 0, scale: 0.9 }}
|
|
35
|
-
animate={{ opacity: 1, scale: 1 }}
|
|
36
|
-
exit={{ opacity: 0, scale: 0.9, transition: spring.fast.exit }}
|
|
37
|
-
transition={spring.fast}
|
|
38
|
-
className="relative shrink-0 cursor-default group/tile"
|
|
39
|
-
>
|
|
40
|
-
<FileThumbnail file={file} size={size} />
|
|
41
|
-
<Tooltip content="Remove" side="top">
|
|
42
|
-
<button
|
|
43
|
-
type="button"
|
|
44
|
-
onClick={e => {
|
|
45
|
-
e.stopPropagation()
|
|
46
|
-
onRemove()
|
|
47
|
-
}}
|
|
48
|
-
aria-label={`Remove ${file.name}`}
|
|
49
|
-
// Pinned to the light scheme so the badge keeps one contrast over any image.
|
|
50
|
-
className="light absolute top-1 right-1 w-5 h-5 rounded-full bg-foreground text-background opacity-0 group-hover/tile:opacity-100 transition-opacity duration-fast flex items-center justify-center cursor-pointer outline-none focus-visible:opacity-100 focus-visible:ring-1 focus-visible:ring-focus-ring"
|
|
51
|
-
>
|
|
52
|
-
<XIcon size={12} strokeWidth={2.5} />
|
|
53
|
-
</button>
|
|
54
|
-
</Tooltip>
|
|
55
|
-
</motion.div>
|
|
56
|
-
)
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
export { FilePreviewTile }
|