@yaks/ui 0.0.0-stage → 0.2.36
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/Address.css +9 -0
- package/Address.js +32 -0
- package/Address.js.map +1 -0
- package/Address.ts +35 -0
- package/Annotated.css +17 -0
- package/Annotated.js +27 -0
- package/Annotated.js.map +1 -0
- package/Annotated.ts +32 -0
- package/AppShell.css +133 -0
- package/AppShell.js +90 -0
- package/AppShell.js.map +1 -0
- package/AppShell.ts +75 -0
- package/At.css +16 -0
- package/At.js +28 -0
- package/At.js.map +1 -0
- package/At.ts +37 -0
- package/Attachments.css +110 -0
- package/Attachments.js +119 -0
- package/Attachments.js.map +1 -0
- package/Attachments.ts +158 -0
- package/Badge.css +41 -0
- package/Badge.js +49 -0
- package/Badge.js.map +1 -0
- package/Badge.ts +38 -0
- package/Body.css +61 -0
- package/Body.js +103 -0
- package/Body.js.map +1 -0
- package/Body.ts +144 -0
- package/Button.css +121 -0
- package/Button.js +161 -0
- package/Button.js.map +1 -0
- package/Button.ts +92 -0
- package/Card.css +173 -0
- package/Card.js +165 -0
- package/Card.js.map +1 -0
- package/Card.ts +185 -0
- package/Cards.css +16 -0
- package/Cards.js +36 -0
- package/Cards.js.map +1 -0
- package/Cards.ts +64 -0
- package/Catalog.css +53 -0
- package/Catalog.js +55 -0
- package/Catalog.js.map +1 -0
- package/Catalog.ts +77 -0
- package/Chart.css +55 -0
- package/Chart.js +54 -0
- package/Chart.js.map +1 -0
- package/Chart.ts +62 -0
- package/Check.css +27 -0
- package/Check.js +77 -0
- package/Check.js.map +1 -0
- package/Check.ts +109 -0
- package/Chip.css +64 -0
- package/Chip.js +100 -0
- package/Chip.js.map +1 -0
- package/Chip.ts +66 -0
- package/Chips.css +10 -0
- package/Chips.js +41 -0
- package/Chips.js.map +1 -0
- package/Chips.ts +49 -0
- package/Choices.css +59 -0
- package/Choices.js +56 -0
- package/Choices.js.map +1 -0
- package/Choices.ts +73 -0
- package/Combobox.js +115 -0
- package/Combobox.js.map +1 -0
- package/Combobox.ts +230 -0
- package/Composer.css +247 -0
- package/Composer.js +222 -0
- package/Composer.js.map +1 -0
- package/Composer.ts +249 -0
- package/Contents.css +87 -0
- package/Contents.js +85 -0
- package/Contents.js.map +1 -0
- package/Contents.ts +117 -0
- package/Copy.css +28 -0
- package/Copy.js +62 -0
- package/Copy.js.map +1 -0
- package/Copy.ts +76 -0
- package/Doc.css +29 -0
- package/Doc.js +46 -0
- package/Doc.js.map +1 -0
- package/Doc.ts +64 -0
- package/Dock.css +157 -0
- package/Dock.js +229 -0
- package/Dock.js.map +1 -0
- package/Dock.ts +234 -0
- package/Dot.css +132 -0
- package/Dot.js +91 -0
- package/Dot.js.map +1 -0
- package/Dot.ts +72 -0
- package/Drop.css +133 -0
- package/Drop.js +148 -0
- package/Drop.js.map +1 -0
- package/Drop.ts +162 -0
- package/Edit.css +32 -0
- package/Edit.js +77 -0
- package/Edit.js.map +1 -0
- package/Edit.ts +72 -0
- package/Empty.css +32 -0
- package/Empty.js +45 -0
- package/Empty.js.map +1 -0
- package/Empty.ts +61 -0
- package/ErrorNotice.css +107 -0
- package/ErrorNotice.js +127 -0
- package/ErrorNotice.js.map +1 -0
- package/ErrorNotice.ts +133 -0
- package/Field.css +42 -0
- package/Field.js +186 -0
- package/Field.js.map +1 -0
- package/Field.ts +251 -0
- package/Form.css +95 -0
- package/Form.js +158 -0
- package/Form.js.map +1 -0
- package/Form.ts +212 -0
- package/Gallery.css +42 -0
- package/Gallery.js +57 -0
- package/Gallery.js.map +1 -0
- package/Gallery.ts +89 -0
- package/Group.css +8 -0
- package/Group.js +25 -0
- package/Group.js.map +1 -0
- package/Group.ts +40 -0
- package/Head.css +108 -0
- package/Head.js +124 -0
- package/Head.js.map +1 -0
- package/Head.ts +161 -0
- package/Icon.css +14 -0
- package/Icon.js +79 -0
- package/Icon.js.map +1 -0
- package/Icon.ts +78 -0
- package/IconButton.css +32 -0
- package/IconButton.js +74 -0
- package/IconButton.js.map +1 -0
- package/IconButton.ts +55 -0
- package/Id.css +29 -0
- package/Id.js +42 -0
- package/Id.js.map +1 -0
- package/Id.ts +31 -0
- package/Identity.css +122 -0
- package/Identity.js +88 -0
- package/Identity.js.map +1 -0
- package/Identity.ts +100 -0
- package/Index.css +68 -0
- package/Index.js +66 -0
- package/Index.js.map +1 -0
- package/Index.ts +63 -0
- package/LICENSE +202 -0
- package/Layer.css +82 -0
- package/Layer.js +86 -0
- package/Layer.js.map +1 -0
- package/Layer.ts +85 -0
- package/Lightbox.css +86 -0
- package/Lightbox.js +69 -0
- package/Lightbox.js.map +1 -0
- package/Lightbox.ts +79 -0
- package/Loading.css +22 -0
- package/Loading.js +75 -0
- package/Loading.js.map +1 -0
- package/Loading.ts +87 -0
- package/Logo.css +32 -0
- package/Logo.js +69 -0
- package/Logo.js.map +1 -0
- package/Logo.ts +81 -0
- package/Match.css +7 -0
- package/Match.js +51 -0
- package/Match.js.map +1 -0
- package/Match.ts +53 -0
- package/Menu.css +202 -0
- package/Menu.js +197 -0
- package/Menu.js.map +1 -0
- package/Menu.ts +233 -0
- package/Meter.css +49 -0
- package/Meter.js +149 -0
- package/Meter.js.map +1 -0
- package/Meter.ts +126 -0
- package/Metrics.css +43 -0
- package/Metrics.js +72 -0
- package/Metrics.js.map +1 -0
- package/Metrics.ts +66 -0
- package/Modal.css +94 -0
- package/Modal.js +114 -0
- package/Modal.js.map +1 -0
- package/Modal.ts +149 -0
- package/ModalDOM.css +23 -0
- package/More.css +135 -0
- package/More.js +135 -0
- package/More.js.map +1 -0
- package/More.ts +157 -0
- package/Notes.css +51 -0
- package/Notes.js +64 -0
- package/Notes.js.map +1 -0
- package/Notes.ts +95 -0
- package/Notice.css +30 -0
- package/Notice.js +50 -0
- package/Notice.js.map +1 -0
- package/Notice.ts +40 -0
- package/Overlay.css +8 -0
- package/Overlay.js +25 -0
- package/Overlay.js.map +1 -0
- package/Overlay.ts +33 -0
- package/Pager.css +33 -0
- package/Pager.js +44 -0
- package/Pager.js.map +1 -0
- package/Pager.ts +56 -0
- package/Pairs.css +50 -0
- package/Pairs.js +45 -0
- package/Pairs.js.map +1 -0
- package/Pairs.ts +88 -0
- package/Palette.css +77 -0
- package/Palette.js +41 -0
- package/Palette.js.map +1 -0
- package/Palette.ts +44 -0
- package/Panes.css +68 -0
- package/Panes.js +100 -0
- package/Panes.js.map +1 -0
- package/Panes.ts +97 -0
- package/Passage.css +58 -0
- package/Passage.js +80 -0
- package/Passage.js.map +1 -0
- package/Passage.ts +112 -0
- package/Peek.css +75 -0
- package/Peek.js +51 -0
- package/Peek.js.map +1 -0
- package/Peek.ts +74 -0
- package/Pills.css +127 -0
- package/Pills.js +119 -0
- package/Pills.js.map +1 -0
- package/Pills.ts +131 -0
- package/Plan.css +73 -0
- package/Plan.js +62 -0
- package/Plan.js.map +1 -0
- package/Plan.ts +80 -0
- package/Popover.css +47 -0
- package/Popover.js +62 -0
- package/Popover.js.map +1 -0
- package/Popover.ts +80 -0
- package/Preview.css +89 -0
- package/Preview.js +84 -0
- package/Preview.js.map +1 -0
- package/Preview.ts +98 -0
- package/Prop.css +117 -0
- package/Prop.js +94 -0
- package/Prop.js.map +1 -0
- package/Prop.ts +91 -0
- package/Quote.css +55 -0
- package/Quote.js +79 -0
- package/Quote.js.map +1 -0
- package/Quote.ts +85 -0
- package/README.md +596 -2
- package/Report.css +76 -0
- package/Report.js +105 -0
- package/Report.js.map +1 -0
- package/Report.ts +118 -0
- package/Rows.css +289 -0
- package/Rows.js +265 -0
- package/Rows.js.map +1 -0
- package/Rows.ts +337 -0
- package/Save.css +112 -0
- package/Save.js +100 -0
- package/Save.js.map +1 -0
- package/Save.ts +102 -0
- package/Section.css +52 -0
- package/Section.js +73 -0
- package/Section.js.map +1 -0
- package/Section.ts +86 -0
- package/Select.css +140 -0
- package/Select.js +208 -0
- package/Select.js.map +1 -0
- package/Select.ts +238 -0
- package/Shell.css +292 -0
- package/Shell.js +197 -0
- package/Shell.js.map +1 -0
- package/Shell.ts +193 -0
- package/SideNav.css +105 -0
- package/SideNav.js +197 -0
- package/SideNav.js.map +1 -0
- package/SideNav.ts +189 -0
- package/Skip.css +11 -0
- package/Skip.js +18 -0
- package/Skip.js.map +1 -0
- package/Skip.ts +16 -0
- package/Spark.css +14 -0
- package/Spark.js +84 -0
- package/Spark.js.map +1 -0
- package/Spark.ts +67 -0
- package/Stack.css +13 -0
- package/Stack.js +20 -0
- package/Stack.js.map +1 -0
- package/Stack.ts +31 -0
- package/Stamp.css +11 -0
- package/Stamp.js +40 -0
- package/Stamp.js.map +1 -0
- package/Stamp.ts +62 -0
- package/State.css +10 -0
- package/State.js +38 -0
- package/State.js.map +1 -0
- package/State.ts +38 -0
- package/Surface.css +139 -0
- package/Surface.js +79 -0
- package/Surface.js.map +1 -0
- package/Surface.ts +55 -0
- package/Table.css +147 -0
- package/Table.js +289 -0
- package/Table.js.map +1 -0
- package/Table.ts +343 -0
- package/Tabs.css +100 -0
- package/Tabs.js +108 -0
- package/Tabs.js.map +1 -0
- package/Tabs.ts +111 -0
- package/Tile.css +164 -0
- package/Tile.js +211 -0
- package/Tile.js.map +1 -0
- package/Tile.ts +174 -0
- package/Time.css +5 -0
- package/Time.js +80 -0
- package/Time.js.map +1 -0
- package/Time.ts +105 -0
- package/Timeline.css +35 -0
- package/Timeline.js +55 -0
- package/Timeline.js.map +1 -0
- package/Timeline.ts +84 -0
- package/Tip.css +18 -0
- package/Tip.js +24 -0
- package/Tip.js.map +1 -0
- package/Tip.ts +29 -0
- package/Toast.css +25 -0
- package/Toast.js +32 -0
- package/Toast.js.map +1 -0
- package/Toast.ts +34 -0
- package/Toolbar.css +66 -0
- package/Toolbar.js +58 -0
- package/Toolbar.js.map +1 -0
- package/Toolbar.ts +68 -0
- package/Transcript.css +221 -0
- package/Transcript.js +254 -0
- package/Transcript.js.map +1 -0
- package/Transcript.ts +296 -0
- package/Turns.css +49 -0
- package/Turns.js +58 -0
- package/Turns.js.map +1 -0
- package/Turns.ts +67 -0
- package/Value.css +33 -0
- package/Value.js +60 -0
- package/Value.js.map +1 -0
- package/Value.ts +48 -0
- package/_dist/Address.d.ts +3 -0
- package/_dist/Address.d.ts.map +1 -0
- package/_dist/Annotated.d.ts +3 -0
- package/_dist/Annotated.d.ts.map +1 -0
- package/_dist/AppShell.d.ts +3 -0
- package/_dist/AppShell.d.ts.map +1 -0
- package/_dist/At.d.ts +14 -0
- package/_dist/At.d.ts.map +1 -0
- package/_dist/Attachments.d.ts +6 -0
- package/_dist/Attachments.d.ts.map +1 -0
- package/_dist/Badge.d.ts +19 -0
- package/_dist/Badge.d.ts.map +1 -0
- package/_dist/Body.d.ts +5 -0
- package/_dist/Body.d.ts.map +1 -0
- package/_dist/Button.d.ts +18 -0
- package/_dist/Button.d.ts.map +1 -0
- package/_dist/Card.d.ts +28 -0
- package/_dist/Card.d.ts.map +1 -0
- package/_dist/Cards.d.ts +15 -0
- package/_dist/Cards.d.ts.map +1 -0
- package/_dist/Catalog.d.ts +3 -0
- package/_dist/Catalog.d.ts.map +1 -0
- package/_dist/Chart.d.ts +5 -0
- package/_dist/Chart.d.ts.map +1 -0
- package/_dist/Check.d.ts +17 -0
- package/_dist/Check.d.ts.map +1 -0
- package/_dist/Chip.d.ts +22 -0
- package/_dist/Chip.d.ts.map +1 -0
- package/_dist/Chips.d.ts +15 -0
- package/_dist/Chips.d.ts.map +1 -0
- package/_dist/Choices.d.ts +3 -0
- package/_dist/Choices.d.ts.map +1 -0
- package/_dist/Combobox.d.ts +55 -0
- package/_dist/Combobox.d.ts.map +1 -0
- package/_dist/Composer.d.ts +15 -0
- package/_dist/Composer.d.ts.map +1 -0
- package/_dist/Contents.d.ts +20 -0
- package/_dist/Contents.d.ts.map +1 -0
- package/_dist/Copy.d.ts +24 -0
- package/_dist/Copy.d.ts.map +1 -0
- package/_dist/Doc.d.ts +3 -0
- package/_dist/Doc.d.ts.map +1 -0
- package/_dist/Dock.d.ts +29 -0
- package/_dist/Dock.d.ts.map +1 -0
- package/_dist/Dot.d.ts +16 -0
- package/_dist/Dot.d.ts.map +1 -0
- package/_dist/Drop.d.ts +27 -0
- package/_dist/Drop.d.ts.map +1 -0
- package/_dist/Edit.d.ts +3 -0
- package/_dist/Edit.d.ts.map +1 -0
- package/_dist/Empty.d.ts +16 -0
- package/_dist/Empty.d.ts.map +1 -0
- package/_dist/ErrorNotice.d.ts +16 -0
- package/_dist/ErrorNotice.d.ts.map +1 -0
- package/_dist/Field.d.ts +53 -0
- package/_dist/Field.d.ts.map +1 -0
- package/_dist/Form.d.ts +44 -0
- package/_dist/Form.d.ts.map +1 -0
- package/_dist/Gallery.d.ts +3 -0
- package/_dist/Gallery.d.ts.map +1 -0
- package/_dist/Group.d.ts +14 -0
- package/_dist/Group.d.ts.map +1 -0
- package/_dist/Head.d.ts +13 -0
- package/_dist/Head.d.ts.map +1 -0
- package/_dist/Icon.d.ts +23 -0
- package/_dist/Icon.d.ts.map +1 -0
- package/_dist/IconButton.d.ts +8 -0
- package/_dist/IconButton.d.ts.map +1 -0
- package/_dist/Id.d.ts +3 -0
- package/_dist/Id.d.ts.map +1 -0
- package/_dist/Identity.d.ts +15 -0
- package/_dist/Identity.d.ts.map +1 -0
- package/_dist/Index.d.ts +3 -0
- package/_dist/Index.d.ts.map +1 -0
- package/_dist/Layer.d.ts +8 -0
- package/_dist/Layer.d.ts.map +1 -0
- package/_dist/Lightbox.d.ts +27 -0
- package/_dist/Lightbox.d.ts.map +1 -0
- package/_dist/Loading.d.ts +24 -0
- package/_dist/Loading.d.ts.map +1 -0
- package/_dist/Logo.d.ts +26 -0
- package/_dist/Logo.d.ts.map +1 -0
- package/_dist/Match.d.ts +5 -0
- package/_dist/Match.d.ts.map +1 -0
- package/_dist/Menu.d.ts +23 -0
- package/_dist/Menu.d.ts.map +1 -0
- package/_dist/Meter.d.ts +10 -0
- package/_dist/Meter.d.ts.map +1 -0
- package/_dist/Metrics.d.ts +3 -0
- package/_dist/Metrics.d.ts.map +1 -0
- package/_dist/Modal.d.ts +32 -0
- package/_dist/Modal.d.ts.map +1 -0
- package/_dist/More.d.ts +29 -0
- package/_dist/More.d.ts.map +1 -0
- package/_dist/Notes.d.ts +3 -0
- package/_dist/Notes.d.ts.map +1 -0
- package/_dist/Notice.d.ts +15 -0
- package/_dist/Notice.d.ts.map +1 -0
- package/_dist/Overlay.d.ts +3 -0
- package/_dist/Overlay.d.ts.map +1 -0
- package/_dist/Pager.d.ts +3 -0
- package/_dist/Pager.d.ts.map +1 -0
- package/_dist/Pairs.d.ts +3 -0
- package/_dist/Pairs.d.ts.map +1 -0
- package/_dist/Palette.d.ts +3 -0
- package/_dist/Palette.d.ts.map +1 -0
- package/_dist/Panes.d.ts +3 -0
- package/_dist/Panes.d.ts.map +1 -0
- package/_dist/Passage.d.ts +3 -0
- package/_dist/Passage.d.ts.map +1 -0
- package/_dist/Peek.d.ts +3 -0
- package/_dist/Peek.d.ts.map +1 -0
- package/_dist/Pills.d.ts +3 -0
- package/_dist/Pills.d.ts.map +1 -0
- package/_dist/Plan.d.ts +4 -0
- package/_dist/Plan.d.ts.map +1 -0
- package/_dist/Popover.d.ts +3 -0
- package/_dist/Popover.d.ts.map +1 -0
- package/_dist/Preview.d.ts +8 -0
- package/_dist/Preview.d.ts.map +1 -0
- package/_dist/Prop.d.ts +7 -0
- package/_dist/Prop.d.ts.map +1 -0
- package/_dist/Quote.d.ts +3 -0
- package/_dist/Quote.d.ts.map +1 -0
- package/_dist/Report.d.ts +8 -0
- package/_dist/Report.d.ts.map +1 -0
- package/_dist/Rows.d.ts +36 -0
- package/_dist/Rows.d.ts.map +1 -0
- package/_dist/Save.d.ts +4 -0
- package/_dist/Save.d.ts.map +1 -0
- package/_dist/Section.d.ts +3 -0
- package/_dist/Section.d.ts.map +1 -0
- package/_dist/Select.d.ts +29 -0
- package/_dist/Select.d.ts.map +1 -0
- package/_dist/Shell.d.ts +3 -0
- package/_dist/Shell.d.ts.map +1 -0
- package/_dist/SideNav.d.ts +31 -0
- package/_dist/SideNav.d.ts.map +1 -0
- package/_dist/Skip.d.ts +3 -0
- package/_dist/Skip.d.ts.map +1 -0
- package/_dist/Spark.d.ts +9 -0
- package/_dist/Spark.d.ts.map +1 -0
- package/_dist/Stack.d.ts +11 -0
- package/_dist/Stack.d.ts.map +1 -0
- package/_dist/Stamp.d.ts +3 -0
- package/_dist/Stamp.d.ts.map +1 -0
- package/_dist/State.d.ts +16 -0
- package/_dist/State.d.ts.map +1 -0
- package/_dist/Surface.d.ts +7 -0
- package/_dist/Surface.d.ts.map +1 -0
- package/_dist/Table.d.ts +10 -0
- package/_dist/Table.d.ts.map +1 -0
- package/_dist/Tabs.d.ts +30 -0
- package/_dist/Tabs.d.ts.map +1 -0
- package/_dist/Tile.d.ts +3 -0
- package/_dist/Tile.d.ts.map +1 -0
- package/_dist/Time.d.ts +24 -0
- package/_dist/Time.d.ts.map +1 -0
- package/_dist/Timeline.d.ts +3 -0
- package/_dist/Timeline.d.ts.map +1 -0
- package/_dist/Tip.d.ts +3 -0
- package/_dist/Tip.d.ts.map +1 -0
- package/_dist/Toast.d.ts +5 -0
- package/_dist/Toast.d.ts.map +1 -0
- package/_dist/Toolbar.d.ts +3 -0
- package/_dist/Toolbar.d.ts.map +1 -0
- package/_dist/Transcript.d.ts +35 -0
- package/_dist/Transcript.d.ts.map +1 -0
- package/_dist/Turns.d.ts +3 -0
- package/_dist/Turns.d.ts.map +1 -0
- package/_dist/Value.d.ts +3 -0
- package/_dist/Value.d.ts.map +1 -0
- package/_dist/ahead.d.ts +41 -0
- package/_dist/ahead.d.ts.map +1 -0
- package/_dist/chart-marks.d.ts +75 -0
- package/_dist/chart-marks.d.ts.map +1 -0
- package/_dist/clock.d.ts +4 -0
- package/_dist/clock.d.ts.map +1 -0
- package/_dist/contents-browser.d.ts +29 -0
- package/_dist/contents-browser.d.ts.map +1 -0
- package/_dist/contributions.d.ts +5 -0
- package/_dist/contributions.d.ts.map +1 -0
- package/_dist/copy-browser.d.ts +4 -0
- package/_dist/copy-browser.d.ts.map +1 -0
- package/_dist/el.d.ts +58 -0
- package/_dist/el.d.ts.map +1 -0
- package/_dist/everforest.d.ts +8 -0
- package/_dist/everforest.d.ts.map +1 -0
- package/_dist/float.d.ts +55 -0
- package/_dist/float.d.ts.map +1 -0
- package/_dist/gouache.d.ts +9 -0
- package/_dist/gouache.d.ts.map +1 -0
- package/_dist/guide.d.ts +38 -0
- package/_dist/guide.d.ts.map +1 -0
- package/_dist/halved.d.ts +3 -0
- package/_dist/halved.d.ts.map +1 -0
- package/_dist/history.d.ts +15 -0
- package/_dist/history.d.ts.map +1 -0
- package/_dist/interaction.d.ts +15 -0
- package/_dist/interaction.d.ts.map +1 -0
- package/_dist/kit.d.ts +30 -0
- package/_dist/kit.d.ts.map +1 -0
- package/_dist/ledger.d.ts +3 -0
- package/_dist/ledger.d.ts.map +1 -0
- package/_dist/linen.d.ts +8 -0
- package/_dist/linen.d.ts.map +1 -0
- package/_dist/menus-browser.d.ts +2 -0
- package/_dist/menus-browser.d.ts.map +1 -0
- package/_dist/menus.d.ts +6 -0
- package/_dist/menus.d.ts.map +1 -0
- package/_dist/mod.d.ts +47 -0
- package/_dist/mod.d.ts.map +1 -0
- package/_dist/modal-browser.d.ts +2 -0
- package/_dist/modal-browser.d.ts.map +1 -0
- package/_dist/modal-head.d.ts +43 -0
- package/_dist/modal-head.d.ts.map +1 -0
- package/_dist/navigate.d.ts +170 -0
- package/_dist/navigate.d.ts.map +1 -0
- package/_dist/overlays.d.ts +16 -0
- package/_dist/overlays.d.ts.map +1 -0
- package/_dist/palette-browser.d.ts +3 -0
- package/_dist/palette-browser.d.ts.map +1 -0
- package/_dist/panes-browser.d.ts +4 -0
- package/_dist/panes-browser.d.ts.map +1 -0
- package/_dist/paper.d.ts +6 -0
- package/_dist/paper.d.ts.map +1 -0
- package/_dist/parts.d.ts +102 -0
- package/_dist/parts.d.ts.map +1 -0
- package/_dist/pencil.d.ts +6 -0
- package/_dist/pencil.d.ts.map +1 -0
- package/_dist/placement.d.ts +12 -0
- package/_dist/placement.d.ts.map +1 -0
- package/_dist/relative.d.ts +41 -0
- package/_dist/relative.d.ts.map +1 -0
- package/_dist/rosepine.d.ts +8 -0
- package/_dist/rosepine.d.ts.map +1 -0
- package/_dist/routes.d.ts +20 -0
- package/_dist/routes.d.ts.map +1 -0
- package/_dist/sheet.d.ts +44 -0
- package/_dist/sheet.d.ts.map +1 -0
- package/_dist/slide.d.ts +4 -0
- package/_dist/slide.d.ts.map +1 -0
- package/_dist/stock.d.ts +21 -0
- package/_dist/stock.d.ts.map +1 -0
- package/_dist/store.d.ts +2 -0
- package/_dist/store.d.ts.map +1 -0
- package/_dist/theme.d.ts +102 -0
- package/_dist/theme.d.ts.map +1 -0
- package/_dist/ui.d.ts +2 -0
- package/_dist/ui.d.ts.map +1 -0
- package/_dist/video-cover.d.ts +3 -0
- package/_dist/video-cover.d.ts.map +1 -0
- package/_dist/viewport.d.ts +14 -0
- package/_dist/viewport.d.ts.map +1 -0
- package/_dist/wear.d.ts +5 -0
- package/_dist/wear.d.ts.map +1 -0
- package/ahead.js +81 -0
- package/ahead.js.map +1 -0
- package/ahead.ts +102 -0
- package/base.css +220 -0
- package/base.js +129 -0
- package/base.js.map +1 -0
- package/base.ts +127 -0
- package/chart-marks.js +156 -0
- package/chart-marks.js.map +1 -0
- package/chart-marks.ts +221 -0
- package/clock.js +41 -0
- package/clock.js.map +1 -0
- package/clock.ts +39 -0
- package/contents-browser.js +122 -0
- package/contents-browser.js.map +1 -0
- package/contents-browser.ts +135 -0
- package/contributions.js +28 -0
- package/contributions.js.map +1 -0
- package/contributions.ts +21 -0
- package/copy-browser.js +39 -0
- package/copy-browser.js.map +1 -0
- package/copy-browser.ts +44 -0
- package/deno.json +1 -0
- package/derived.css +64 -0
- package/el.js +176 -0
- package/el.js.map +1 -0
- package/el.ts +240 -0
- package/everforest.css +65 -0
- package/everforest.js +54 -0
- package/everforest.js.map +1 -0
- package/everforest.ts +52 -0
- package/float.js +182 -0
- package/float.js.map +1 -0
- package/float.ts +222 -0
- package/gouache.css +62 -0
- package/gouache.js +54 -0
- package/gouache.js.map +1 -0
- package/gouache.ts +52 -0
- package/guide.js +124 -0
- package/guide.js.map +1 -0
- package/guide.ts +222 -0
- package/halved.js +88 -0
- package/halved.js.map +1 -0
- package/halved.ts +102 -0
- package/history.js +11 -0
- package/history.js.map +1 -0
- package/history.ts +22 -0
- package/interaction.js +23 -0
- package/interaction.js.map +1 -0
- package/interaction.ts +43 -0
- package/kit.js +345 -0
- package/kit.js.map +1 -0
- package/kit.ts +408 -0
- package/ledger/Button.css +22 -0
- package/ledger/Head.css +72 -0
- package/ledger/Tabs.css +19 -0
- package/ledger/Tile.css +12 -0
- package/ledger.js +52 -0
- package/ledger.js.map +1 -0
- package/ledger.ts +34 -0
- package/linen.css +71 -0
- package/linen.js +54 -0
- package/linen.js.map +1 -0
- package/linen.ts +52 -0
- package/lucide.d.ts +4 -0
- package/menus-browser.js +72 -0
- package/menus-browser.js.map +1 -0
- package/menus-browser.ts +75 -0
- package/menus.js +84 -0
- package/menus.js.map +1 -0
- package/menus.ts +90 -0
- package/mod.js +46 -0
- package/mod.js.map +1 -0
- package/mod.ts +78 -0
- package/modal-browser.js +29 -0
- package/modal-browser.js.map +1 -0
- package/modal-browser.ts +31 -0
- package/modal-head.js +75 -0
- package/modal-head.js.map +1 -0
- package/modal-head.ts +81 -0
- package/navigate.js +934 -0
- package/navigate.js.map +1 -0
- package/navigate.ts +1177 -0
- package/overlays.js +177 -0
- package/overlays.js.map +1 -0
- package/overlays.ts +257 -0
- package/package.json +280 -4
- package/palette-browser.js +52 -0
- package/palette-browser.js.map +1 -0
- package/palette-browser.ts +54 -0
- package/panes-browser.js +40 -0
- package/panes-browser.js.map +1 -0
- package/panes-browser.ts +59 -0
- package/paper/base.css +28 -0
- package/paper/grain.css +18 -0
- package/paper.js +14 -0
- package/paper.js.map +1 -0
- package/paper.ts +16 -0
- package/parts.js +102 -0
- package/parts.js.map +1 -0
- package/parts.ts +117 -0
- package/pencil/Address.css +5 -0
- package/pencil/At.css +14 -0
- package/pencil/Body.css +10 -0
- package/pencil/Button.css +81 -0
- package/pencil/Card.css +175 -0
- package/pencil/Chart.css +31 -0
- package/pencil/Check.css +66 -0
- package/pencil/Chip.css +100 -0
- package/pencil/Chips.css +6 -0
- package/pencil/Copy.css +33 -0
- package/pencil/Drop.css +145 -0
- package/pencil/Empty.css +48 -0
- package/pencil/Field.css +42 -0
- package/pencil/Form.css +88 -0
- package/pencil/Loading.css +14 -0
- package/pencil/Menu.css +26 -0
- package/pencil/More.css +41 -0
- package/pencil/Report.css +11 -0
- package/pencil/Rows.css +48 -0
- package/pencil/SideNav.css +173 -0
- package/pencil/State.css +28 -0
- package/pencil/Surface.css +69 -0
- package/pencil/Tabs.css +137 -0
- package/pencil/base.css +19 -0
- package/pencil/paper.webp +0 -0
- package/pencil/pencil.svg +181 -0
- package/pencil.js +81 -0
- package/pencil.js.map +1 -0
- package/pencil.ts +34 -0
- package/placement.js +62 -0
- package/placement.js.map +1 -0
- package/placement.ts +93 -0
- package/relative.js +150 -0
- package/relative.js.map +1 -0
- package/relative.ts +186 -0
- package/resizes.js +23 -0
- package/resizes.js.map +1 -0
- package/resizes.ts +37 -0
- package/rosepine.css +59 -0
- package/rosepine.js +54 -0
- package/rosepine.js.map +1 -0
- package/rosepine.ts +52 -0
- package/routes.js +136 -0
- package/routes.js.map +1 -0
- package/routes.ts +190 -0
- package/sheet.js +7 -0
- package/sheet.js.map +1 -0
- package/sheet.ts +72 -0
- package/slide.js +37 -0
- package/slide.js.map +1 -0
- package/slide.ts +41 -0
- package/stock.js +38 -0
- package/stock.js.map +1 -0
- package/stock.ts +54 -0
- package/store.js +6 -0
- package/store.js.map +1 -0
- package/store.ts +14 -0
- package/theme.js +21 -0
- package/theme.js.map +1 -0
- package/theme.ts +159 -0
- package/ui.js +2 -0
- package/ui.js.map +1 -0
- package/ui.ts +2 -0
- package/video-cover.js +55 -0
- package/video-cover.js.map +1 -0
- package/video-cover.ts +72 -0
- package/viewport.js +56 -0
- package/viewport.js.map +1 -0
- package/viewport.ts +61 -0
- package/wear-build.ts +12 -0
- package/wear.js +40 -0
- package/wear.js.map +1 -0
- package/wear.ts +65 -0
package/README.md
CHANGED
|
@@ -1,3 +1,597 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @yaks/ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Parts with semantic variants, CSS and terminal sheet entries for React and
|
|
4
|
+
Preact. Use the same parts in a browser and [@yaks/tui](../tui/README.md),
|
|
5
|
+
compose kits with themes and skins, and inspect their specimens in the style
|
|
6
|
+
guide.
|
|
7
|
+
|
|
8
|
+
## Component lookup
|
|
9
|
+
|
|
10
|
+
| Building | Use |
|
|
11
|
+
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
12
|
+
| Anchored popover | `Float` for viewport positioning. `Popover` is the painted summary trigger and panel. |
|
|
13
|
+
| Action menu | `Menu` and `Menu.Item`. Use `menus()` to bind a `data-menu-trigger` to a server-rendered menu. |
|
|
14
|
+
| Autocomplete or combobox | `Combobox` for an input and its floating suggestions. Use `Combobox.List` for a field you already render, or `TokenPicker` from `@yaks/ux/token-picker` for multiple values. |
|
|
15
|
+
| Dialog | `Modal` for a native dialog holding a card, or `Layer` for a side or bottom sheet. |
|
|
16
|
+
| Card | `Card` and `Card.Head`, `Card.Title`, `Card.Actions` and `Card.Sub`. Use `Card.Frame` for a card whose contents define its layout. |
|
|
17
|
+
| Page header or toolbar | `Head` for an entity, `AppShell.Bar` for an app toolbar. |
|
|
18
|
+
| Button | `Button` or `IconButton` with a label. |
|
|
19
|
+
| Few choices, one picked | `Pills` |
|
|
20
|
+
| Tabs | `Tabs` for a row of tabs, `TabSet` when it also holds panels. |
|
|
21
|
+
| Text with a send button | `Composer`: one row, `Composer.Attach` (a paperclip) at its left, `Composer.Field` (a textarea with `lines`, one line tall and growing) and `Composer.Send` at its right; icons in `Composer.Tools`; files held inside the field's edge in a `Composer.Well`. Its keys are `@yaks/ux/composer`'s. |
|
|
22
|
+
| Feedback | `Notice` for feedback next to the action. Use `Toast` when the action disappears. `Dock.Toast` is the dock's message preview. |
|
|
23
|
+
|
|
24
|
+
These are looks. What a screen does (staying at the newest line, keeping a
|
|
25
|
+
draft, showing an edit at once, walking by keys) comes from
|
|
26
|
+
[@yaks/ux's behavior lookup](../ux/README.md#behavior-lookup).
|
|
27
|
+
|
|
28
|
+
Open `/ui` or run `yak ui` to see parts and variants. See the
|
|
29
|
+
[yaks.app UI Kits guide](https://yaks.app/docs/kits.md) for the app starter.
|
|
30
|
+
|
|
31
|
+
## Parts and rendering
|
|
32
|
+
|
|
33
|
+
A **part** is a React component with a named CSS class, such as `Dot`, rendering
|
|
34
|
+
`<span class="Dot">` (`Part`). A **variant** is a `mod` value that adds a class
|
|
35
|
+
to a part: `mod: 'ring'` adds `Dot-ring`. `block` attaches named parts using an
|
|
36
|
+
underscore: `Menu.Item` renders `Menu_Item`.
|
|
37
|
+
|
|
38
|
+
A **piece** carries a part's `Component`, stylesheet, terminal `sheet` function,
|
|
39
|
+
optional `native` function, `description` and `specimens` function (`Piece`).
|
|
40
|
+
`native(colors)` gives the React Native style of each class the part renders
|
|
41
|
+
(`Native`), which a native host such as the iOS shell draws its views with
|
|
42
|
+
([@yaks/native](../native/README.md)). A **kit** names pieces (`Kit`); `kit`
|
|
43
|
+
contains the base pieces, `groups` arranges them for the guide, and `kits`
|
|
44
|
+
registers that kit as `base`. A **specimen** is a label and a React element
|
|
45
|
+
showing a part or variant (`Specimen`).
|
|
46
|
+
|
|
47
|
+
Parts present what their caller supplies. The caller chooses variants, owns
|
|
48
|
+
state and handles presses; parts do not read a
|
|
49
|
+
[graph](../graph/README.md#data-model). Their class names let CSS and terminal
|
|
50
|
+
[sheets](../tui/README.md#style) style the same tree.
|
|
51
|
+
|
|
52
|
+
`@yaks/ui/parts` exports every part without the themes, skins, kits and guide. A
|
|
53
|
+
server that draws parts, and a package of components built on them such as
|
|
54
|
+
[@yaks/ux](../ux/README.md), imports `@yaks/ui/parts`. The root exports the
|
|
55
|
+
parts and the looks.
|
|
56
|
+
|
|
57
|
+
A **stylesheet** is a function giving the sheet's URL (`Stylesheet`), called
|
|
58
|
+
where the sheet is read, never when its module loads: a bundled Worker's
|
|
59
|
+
`import.meta.url` is no address to resolve `./x.css` against, so a URL made at
|
|
60
|
+
load throws "Invalid URL string." there. `beside(import.meta.url)` names
|
|
61
|
+
stylesheets next to a module: `let at = beside(import.meta.url)`, then
|
|
62
|
+
`css: at('./Tile.css')`.
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
import { createElement as h } from 'react'
|
|
66
|
+
import { renderToStaticMarkup as renderToString } from 'react-dom/server'
|
|
67
|
+
import { Dot, Tile } from '@yaks/ui'
|
|
68
|
+
import { equal } from '@yaks/testing'
|
|
69
|
+
|
|
70
|
+
const tree = h(
|
|
71
|
+
Tile,
|
|
72
|
+
{ href: '/books/dune' },
|
|
73
|
+
h(Tile.Title, {}, 'Dune'),
|
|
74
|
+
h(Dot, { mod: ['half', 'active'] }),
|
|
75
|
+
)
|
|
76
|
+
equal(
|
|
77
|
+
renderToString(tree),
|
|
78
|
+
'<a href="/books/dune" class="Tile"><span class="Tile_Title">Dune</span><span class="Dot Dot-half Dot-active"></span></a>',
|
|
79
|
+
)
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Exports
|
|
83
|
+
|
|
84
|
+
| Import | Offers |
|
|
85
|
+
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
86
|
+
| `@yaks/ui` | Parts below; `el`, `block`, `Surround`, `Props`, `Part`; `relative`; browser placement; kits, themes, skins, composition helpers and their types; `Guide`, `Specimens` |
|
|
87
|
+
| `@yaks/ui/ui` | Base `kits`, `themes`, `skins` and their default `composition` |
|
|
88
|
+
| `@yaks/ui/chart` | A chart's marks through any `h`: `sparkline`, `columns`, and the days a row keeps (`kept`, `series`, `summed`) |
|
|
89
|
+
| `@yaks/ui/contents` | Browser: `start`, `fill`, `watch` a page's `Contents`, lighting the section in view; pure `current`, `anchor`, `headings` |
|
|
90
|
+
| `@yaks/ui/wear` | Browser: `wear(composition)` links its sheets (`addresses`) ahead of the page's own and settles once they load |
|
|
91
|
+
| `@yaks/ui/stock` | Browser: `wearStock()` links the stock kit (every part in Linen) as one sheet ahead of the page's own, loading no part modules: how a yaks app's page asks for the kit |
|
|
92
|
+
| `@yaks/ui/ahead` | Asking ahead of a press: `AHEAD` and `lookingAhead` mark and read a look ahead, `warmAhead` warms a page's `data-warm` links as they near the screen or a pointer comes to them |
|
|
93
|
+
| `@yaks/ui/navigate` | Browser: `start` follows a server-drawn site's links in place, `swap`/`morph` lay a fetched page over the one shown keeping shared nodes; `arrived`, `leaving` for scripts across swaps |
|
|
94
|
+
| `@yaks/ui/contributions` | Browser-safe `gather` and `Contributions` |
|
|
95
|
+
| `@yaks/ui/guide` | `Guide`, `Specimens`, `Contents`, `Page`, `sections`, `stopsOf`, `stops`, `title` |
|
|
96
|
+
| `@yaks/ui/routes` | `page`, `routes`: the static browser guide at `/ui` |
|
|
97
|
+
| `@yaks/ui/sheet` | `Sheet` and `Style` define the kit’s terminal styling format. |
|
|
98
|
+
| `@yaks/ui/<Part>.css` | A part's stylesheet. On yaks.app, a Worker-rendered page links the compiler's copy under `__packages/@yaks/ui/` within the app mount. |
|
|
99
|
+
|
|
100
|
+
## Building parts
|
|
101
|
+
|
|
102
|
+
`el(tag, base)` makes a part. Falsy `mod` values drop, `class` adds classes,
|
|
103
|
+
`elRef` supplies the element's ref, and other props pass to the element.
|
|
104
|
+
`block(tag, base, elements)` attaches parts by name. Compose a surface from
|
|
105
|
+
`Surface`, `Surface.Raised`, `Surface.Press` or `Surface.Well`: they supply
|
|
106
|
+
flat, elevated, interactive and inset paint. A part adds its layout, while the
|
|
107
|
+
skin supplies the shared edge, shadow and interaction tokens. Every composition
|
|
108
|
+
includes these primitives, including a subset kit.
|
|
109
|
+
|
|
110
|
+
```ts
|
|
111
|
+
import { createElement as h } from 'react'
|
|
112
|
+
import { renderToStaticMarkup as renderToString } from 'react-dom/server'
|
|
113
|
+
import { block, el, Surface } from '@yaks/ui'
|
|
114
|
+
import { equal } from '@yaks/testing'
|
|
115
|
+
|
|
116
|
+
const Mark = el('span', 'Mark')
|
|
117
|
+
const Receipt = block(Surface, 'Receipt', { Title: 'h2' })
|
|
118
|
+
equal(
|
|
119
|
+
renderToString(
|
|
120
|
+
h(
|
|
121
|
+
Receipt,
|
|
122
|
+
{},
|
|
123
|
+
h(
|
|
124
|
+
Receipt.Title,
|
|
125
|
+
{},
|
|
126
|
+
h(Mark, { mod: ['active', false], class: 'extra' }, 'Ready'),
|
|
127
|
+
),
|
|
128
|
+
),
|
|
129
|
+
),
|
|
130
|
+
'<section class="Surface Receipt"><h2 class="Receipt_Title"><span class="Mark Mark-active extra">Ready</span></h2></section>',
|
|
131
|
+
)
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
An `href` makes a part an anchor. `Surround` carries the enclosing anchor's
|
|
135
|
+
href: a nested part with the same href keeps its original tag, and a different
|
|
136
|
+
href becomes `role="link"` with `data-href`. The application handles following
|
|
137
|
+
`data-href`.
|
|
138
|
+
|
|
139
|
+
```ts
|
|
140
|
+
import { createElement as h } from 'react'
|
|
141
|
+
import { renderToStaticMarkup as renderToString } from 'react-dom/server'
|
|
142
|
+
import { Id, Tile } from '@yaks/ui'
|
|
143
|
+
import { equal } from '@yaks/testing'
|
|
144
|
+
|
|
145
|
+
equal(
|
|
146
|
+
renderToString(
|
|
147
|
+
h(
|
|
148
|
+
Tile,
|
|
149
|
+
{ href: '/a' },
|
|
150
|
+
h(Id, { href: '/a' }, 'A'),
|
|
151
|
+
h(Id, { href: '/b' }, 'B'),
|
|
152
|
+
),
|
|
153
|
+
),
|
|
154
|
+
'<a href="/a" class="Tile"><span class="Id">A</span><span role="link" tabindex="0" data-href="/b" class="Id">B</span></a>',
|
|
155
|
+
)
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
For actions inside a list row, put `ErrorNotice.Slot mod="side"` inside
|
|
159
|
+
`Rows.Actions mod="feedback"` within `Rows.Item mod="feedback"`. The notice uses
|
|
160
|
+
the width beside the action group, and the group's controls stay clear.
|
|
161
|
+
|
|
162
|
+
## Base kit
|
|
163
|
+
|
|
164
|
+
| component | parts | variants |
|
|
165
|
+
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
166
|
+
| `Dot` | the pip | shapes `ring` `dashed` `half` `pulse` `check` `cross` `alert`; tones `info` `active` `positive` `negative` `caution` `accent` `special` |
|
|
167
|
+
| `Id` | an identifier | `hover`, `retired` |
|
|
168
|
+
| `Stamp` | a moment, said in words | |
|
|
169
|
+
| `Tabs` | `Tab`, `Badge`; `TabSet` holds their panels: `Legend`, `Item` (an `Input` radio, its `Tab`, its `Panel`) | `Tab-on`, `Tab-hover`, `Tab-line` (one terminal line per control); a set's checked radio lights its tab |
|
|
170
|
+
| `Menu` | `Item`, `Rule` | `Item-hover`, `Item-danger` |
|
|
171
|
+
| `Tip` | a tooltip | |
|
|
172
|
+
| `Field` | a text field | `bare`; `lines` makes it a textarea, `choose` a `Select`, `caret` shows the caret in a terminal |
|
|
173
|
+
| `Select` | one choice among several at the control height, its caret at the end: a native select inside; `Button`, `List`, `Option`, `Value` for a fold of links (the space switcher) | `bare`; the list it opens is @yaks/ux/select's |
|
|
174
|
+
| `At` | `End`: a field with a fixed ending beside it | |
|
|
175
|
+
| `Check` | `Input`: a check box or a radio and its words | |
|
|
176
|
+
| `Pills` | `Item` (the label of its `Input`, a radio or a check box): a few choices side by side | `Item-on`; a checked input lights its pill |
|
|
177
|
+
| `Form` | `Field`, `Label`, `Optional`, `Hint`, `Line`, `Actions`: a form, its fields and what sends it | |
|
|
178
|
+
| `Drop` | `Zone`, `File`, `Say`, `Choose`, `Hint`, `Chosen`, `Item`, `Picture`, `Kind`, `Name`, `Size`, `Note`, `Said` | `gather` (takes a drop anywhere on it), `over`; `Zone-over`, `Item-unread` |
|
|
179
|
+
| `Notice` | a line the page says back | `negative` |
|
|
180
|
+
| `ErrorNotice` | A page banner or a notice in `ErrorNotice.Slot` beside the failed action | `Slot-above`, `Slot-end`, `Slot-reserved`, `Slot-side` |
|
|
181
|
+
| `Choices` | a raised surface; `List` (what scrolls), `Item`, `Text` (body face), `Note` | `code` (its words in the code face), `Item-on` (the picked one), `Item-hover` |
|
|
182
|
+
| `Button` | a press | `add`, `danger`, `go` (the one to press), `quiet` |
|
|
183
|
+
| `Copy` | words to paste elsewhere, in the mono face, and a `Button` wearing `Copy_Go`, a copy glyph, that copies them (`what` names them) | `copied` (a check in the glyph's place) |
|
|
184
|
+
| `Chip` | `Tag`: a name, as a token, and what it is a kind of | hues `0` to `5`, `ghost`, `quiet` (a label that steps back), `code` (words to copy) |
|
|
185
|
+
| `Chips` | a row of chips that wraps | |
|
|
186
|
+
| `Address` | `Name`: a web address, the name in it set apart | |
|
|
187
|
+
| `Icon` | a glyph in lines, drawn from a Lucide icon's nodes (`of`) | |
|
|
188
|
+
| `Logo` | an integration's name with its logo in front (`src`), a plug where it has none; `Mark`, the logo alone | |
|
|
189
|
+
| `Match` | words that match what was sought, marked in place; `marked(text)` marks the runs @yaks/fts sets between `\x01` and `\x02` | |
|
|
190
|
+
| `Value` | a stored value | shapes `text` `num` `bool` `id` `time` `json` `nil` |
|
|
191
|
+
| `Pairs` | `Key`, `Value` | |
|
|
192
|
+
| `Tile` | `Icon`, `Id`, `Kind`, `Title`, `Note`, `Count`, `Sub`, `End` | `on` (the one picked), `hover`, `dim`; `Sub-negative`; `Icon` tones `info` `active` `positive` `negative` `caution` `accent` `special` |
|
|
193
|
+
| `Rows` | `Item`, `More`, `Note`, `Main`, `Name`, `Meta`, `Actions`, `Form`, `Line`, `Toggle`, `Detail` | `nested`, `Item-split`, `Detail-inset` |
|
|
194
|
+
| `Card` | `Head`, `Mark`, `Title`, `Actions`, `Sub`: one surface holding related things | |
|
|
195
|
+
| `Report` | `Total`, `Unit`, `Plot`, `Span`, `Tops`, `Column`, `Heading`, `List`, `Item`, `Label`, `Value`: a card that counts something | |
|
|
196
|
+
| `Group` | a heading over a run of cards | |
|
|
197
|
+
| `Empty` | `Title`: nothing here yet, what will be, and how to start | |
|
|
198
|
+
| `State` | how something stands, in a word beside a `Dot` | tones as `Dot`'s |
|
|
199
|
+
| `Loading` | `Mark`: a read in progress, and what is at work on it | |
|
|
200
|
+
| `Chart` | `Plot`, `Line`, `End`, `Bar`, `Tip`: a series over time | `line`, `bars` |
|
|
201
|
+
| `Section` | `Title`, `Count`, `Note`, `Sub` | `compact`, `Title-compact`, `Note-refused` |
|
|
202
|
+
| `Timeline` | `Item`, `When`, `Who`, `What` | |
|
|
203
|
+
| `Turns` | `Turn`, `Who`, `Text`, `More` | `Turn-on` (the one a page is about), `Turn-quiet` (a tool's) |
|
|
204
|
+
| `Passage` | `By`, `Title`, `Who`, `Text`: a passage of a longer text in a list, who said it, when, where, and the words cut to two lines | |
|
|
205
|
+
| `Body` | the text of a thing, to be read, at its measure | `short`; `typed` (a press types into it) |
|
|
206
|
+
| `More` | `Summary`, `Body`, `Mark` (opens a `More` that is not a `details`), `Label`, `Value`: what most people never need, folded under one line | `quiet` (a step in a conversation), `on` (running), `no` (did not work) |
|
|
207
|
+
| `Doc` | `Title`: a document read and typed into, its title over its text | `typed` (a press types into it) |
|
|
208
|
+
| `Quote` | `Text`, `By`, `Note`: words somebody said, who said them, when, where | |
|
|
209
|
+
| `Edit` | a value typed over where it stands, or a control that reads as a value | `fit` |
|
|
210
|
+
| `Prop` | `Val`, `Hand`, `Pop`, `Tab`, `Row`, `Find`, `Query` | `live`; `Val-nil`, `Hand-empty`, `Pop-list`, `Tab-on`, `Row-none` |
|
|
211
|
+
| `Overlay` | a position floating above the page | |
|
|
212
|
+
| `Peek` | `Head`, `Body`, `Grip`: a card floating over the page, showing one thing whole without leaving it | `sized` (sized by hand) |
|
|
213
|
+
| `Table` | `Head`, `Body`, `Row`, `Heading`, `Cell`, `Toggle`, `Indent` | `Row-picks`, `Row-focus`, `Row-hover`; `Heading-sorts`, `Heading-asc`, `Heading-desc`, `Heading-num`; `Cell-num`, `Cell-key`, `Cell-prose`; `Toggle-open` |
|
|
214
|
+
| `Pager` | `Span`, `Step` | a `Step` is `disabled` with nowhere to go |
|
|
215
|
+
| `Shell` | `Side`, `Brand`, `Find`, `Item`, `Icon`, `Glyph`, `Label`, `Count`, `Shade`, `Main`, `Bar`, `Menu`, `Title`, `Body` | `open` (the sidebar slid over a phone's page); `sheet` (the page on a card, its `--floor`); `Item-on` |
|
|
216
|
+
| `Panes` | `Pane`, `Top`, `Body` | `Pane-nav`, `Pane-main`, `Pane-on`; `Pane-aside` (a nav that goes after the page where the panes stack); `Pane-side` (beside the page, a chat's width) |
|
|
217
|
+
| `Head` | `Title`, `Id`, `Kind`, `Sub`, `Facts` | `Sub-refused` |
|
|
218
|
+
| `Notes` | `Item`, `Text`, `Who`, `When`, `Children` | `Item-done` |
|
|
219
|
+
| `Composer` | `Field`, `Well`, `Choice`, `Tools`, `Send`, `Attach`, `File`, `Voice`, `Stop`, `Name`, `To`, `Figure`, `Status`, `Form`: one row to write and send in, the field growing from one line | `Form-inline`; `data-busy` shows `Stop` in `Send`'s place |
|
|
220
|
+
| `Index` | `Group`, `Head`, `Item` | `Head-on`, `Item-on`, `Item-hover` |
|
|
221
|
+
| `SideNav` | `Link`, `Mark`, `Label`, `Note`, `Rule`, `Edge` | `Link-on` (the page you are on), `Link-hover`; `column` (a column at every width), `alone`, `rail` |
|
|
222
|
+
| `Contents` | `Label`, `List`, `Item`, `Link`, `Menu`, `Summary`; `contents(entries)` draws it | `Link-on` (the section in view), `Item-sub` |
|
|
223
|
+
| `Catalog` | `Group`, `Heading`, `Entry`, `Title`, `Sub` | |
|
|
224
|
+
| `Gallery` | `Figure`, `Caption`, `Stage` | |
|
|
225
|
+
|
|
226
|
+
A `hover` variant lets specimens show a pseudo-class without a pointer. Every
|
|
227
|
+
piece supplies specimens; use them to see the parts and their variants without
|
|
228
|
+
inventing application behavior.
|
|
229
|
+
|
|
230
|
+
A `Tile` is one thing in a list. Its pieces are written flat, in any order: the
|
|
231
|
+
tile sets its `Icon`, its words (the title line over the `Sub`) and its `End`
|
|
232
|
+
side by side on a row that never wraps, so the icon keeps its title's line. A
|
|
233
|
+
tile given an `onClick` is a button, picked from its list: `aria-current` says
|
|
234
|
+
whether it is the one `on`.
|
|
235
|
+
|
|
236
|
+
```ts
|
|
237
|
+
import { createElement as h } from 'react'
|
|
238
|
+
import { renderToStaticMarkup as renderToString } from 'react-dom/server'
|
|
239
|
+
import { Tile } from '@yaks/ui'
|
|
240
|
+
import { equal } from '@yaks/testing'
|
|
241
|
+
|
|
242
|
+
const pick = () => {}
|
|
243
|
+
equal(
|
|
244
|
+
renderToString(
|
|
245
|
+
h(
|
|
246
|
+
Tile,
|
|
247
|
+
{ mod: 'on', onClick: pick },
|
|
248
|
+
h(Tile.End, {}, 'Lv 3'),
|
|
249
|
+
h(Tile.Sub, {}, 'Under way'),
|
|
250
|
+
h(Tile.Title, {}, 'Wolves at the mill'),
|
|
251
|
+
h(Tile.Icon, {}, '◆'),
|
|
252
|
+
),
|
|
253
|
+
),
|
|
254
|
+
'<button type="button" aria-current="true" class="Tile Tile-on">' +
|
|
255
|
+
'<span class="Tile_Icon">◆</span><span class="Tile_Text">' +
|
|
256
|
+
'<span class="Tile_Line"><span class="Tile_Title">Wolves at the mill</span></span>' +
|
|
257
|
+
'<span class="Tile_Sub">Under way</span></span>' +
|
|
258
|
+
'<span class="Tile_End">Lv 3</span></button>',
|
|
259
|
+
)
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
```ts
|
|
263
|
+
import { kit } from '@yaks/ui'
|
|
264
|
+
import { renderToStaticMarkup as renderToString } from 'react-dom/server'
|
|
265
|
+
import { equal } from '@yaks/testing'
|
|
266
|
+
|
|
267
|
+
for (const piece of Object.values(kit)) {
|
|
268
|
+
const samples = piece.specimens()
|
|
269
|
+
equal(samples.length > 0, true)
|
|
270
|
+
for (const [label, tree] of samples) {
|
|
271
|
+
equal(label.length > 0, true)
|
|
272
|
+
equal(renderToString(tree).length > 0, true)
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
`Field` uses an input or, with `lines`, a textarea. `caret` supplies the
|
|
278
|
+
terminal's `data-caret`; a browser uses its own caret. `Stamp` displays words
|
|
279
|
+
supplied by its caller; `relative` can produce those words from a time.
|
|
280
|
+
|
|
281
|
+
```ts
|
|
282
|
+
import { createElement as h } from 'react'
|
|
283
|
+
import { renderToStaticMarkup as renderToString } from 'react-dom/server'
|
|
284
|
+
import { Field, relative, Stamp } from '@yaks/ui'
|
|
285
|
+
import { equal } from '@yaks/testing'
|
|
286
|
+
|
|
287
|
+
const now = Date.parse('2026-09-29T12:00:00Z')
|
|
288
|
+
equal(
|
|
289
|
+
renderToString(h(Stamp, {}, relative('2026-09-29T11:55:00Z', now))),
|
|
290
|
+
'<span class="Stamp">5 minutes ago</span>',
|
|
291
|
+
)
|
|
292
|
+
equal(
|
|
293
|
+
renderToString(h(Field, { lines: true, caret: 0, placeholder: 'Notes' })),
|
|
294
|
+
'<textarea placeholder="Notes" data-caret="0" class="Surface_Well Field"></textarea>',
|
|
295
|
+
)
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
`Table` uses a CSS grid with subgrid rows and accessibility roles. `cols` names
|
|
299
|
+
the column tracks; apply matching variants to cells. Text cuts short with an
|
|
300
|
+
ellipsis, `num` sets right, and `prose` wraps. The table owns its `style` prop
|
|
301
|
+
to carry those tracks. Wide tables sit in `Table.Scroll`, a horizontal
|
|
302
|
+
scrollport around the table. Keep a card or other decorated surface outside that
|
|
303
|
+
scrollport: its border neither creates overflow nor gets clipped when the table
|
|
304
|
+
scrolls. Sorting and selection belong to its caller. `Table.Sort` is a native
|
|
305
|
+
button for a heading; `@yaks/ux` supplies controlled sorting with raw values.
|
|
306
|
+
|
|
307
|
+
A table can be a tree. A row holding rows starts its first cell with a `Toggle`,
|
|
308
|
+
`Toggle-open` while the rows it holds show under it; a row sits one `Indent`
|
|
309
|
+
deep for each row it is under, and an `Indent` stands where a row holds none. An
|
|
310
|
+
`Indent` is as wide as a `Toggle`, so every row's words line up under its
|
|
311
|
+
parent's, in a browser and in a terminal. What a `Toggle` opens is its caller's.
|
|
312
|
+
|
|
313
|
+
```ts
|
|
314
|
+
import { createElement as h } from 'react'
|
|
315
|
+
import { renderToStaticMarkup as renderToString } from 'react-dom/server'
|
|
316
|
+
import { Table } from '@yaks/ui'
|
|
317
|
+
import { parseHTML } from 'linkedom'
|
|
318
|
+
import { equal } from '@yaks/testing'
|
|
319
|
+
|
|
320
|
+
const tree = h(
|
|
321
|
+
Table,
|
|
322
|
+
{ cols: ['num'] },
|
|
323
|
+
h(
|
|
324
|
+
Table.Head,
|
|
325
|
+
{},
|
|
326
|
+
h(Table.Row, {}, h(Table.Heading, { mod: ['num', 'desc'] }, 'Pages')),
|
|
327
|
+
),
|
|
328
|
+
h(Table.Body, {}, h(Table.Row, {}, h(Table.Cell, { mod: 'num' }, '412'))),
|
|
329
|
+
)
|
|
330
|
+
const html = renderToString(tree)
|
|
331
|
+
equal(html.includes('role="table"'), true)
|
|
332
|
+
equal(
|
|
333
|
+
parseHTML(html).document.querySelector('[role=columnheader]')?.textContent,
|
|
334
|
+
'Pages ↓',
|
|
335
|
+
)
|
|
336
|
+
equal(html.includes('class="Table_Cell Table_Cell-num">412'), true)
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
`Toolbar-plain` wraps controls without a background or edge. `Rows.Note` is a
|
|
340
|
+
full-size muted line for an empty list or a count of items left out.
|
|
341
|
+
|
|
342
|
+
## Themes and skins
|
|
343
|
+
|
|
344
|
+
A **theme** supplies a stylesheet defining custom properties and the same colors
|
|
345
|
+
as values for terminal sheets (`Theme`). `Colors` names color roles: background,
|
|
346
|
+
ink, links, headings, states, stored values and code syntax; `hues` holds six
|
|
347
|
+
colors for `Chip`. `themes` names `gouache`, `everforest`, `rosepine` and
|
|
348
|
+
`linen`; `gouache`, the colours of yak.sh's painted yak, is the default, and
|
|
349
|
+
`linen`, warm linen and cream written in coffee, is yaks.app's. Browser themes
|
|
350
|
+
offer light and dark schemes selected by `color-scheme`; terminal colors use the
|
|
351
|
+
dark scheme. Gouache's light scheme is yak.sh's paper and ink, its dark scheme
|
|
352
|
+
yak.sh's terminal windows, so a page that sets `color-scheme: dark` on one
|
|
353
|
+
element paints that element dark. Themes also set fonts, spacing, reading
|
|
354
|
+
measure, radius and shadow.
|
|
355
|
+
|
|
356
|
+
The CSS custom properties use the same names as `Colors`:
|
|
357
|
+
|
|
358
|
+
- Background and ink: `--bg`, `--surface`, `--card`, `--border`, `--border2`,
|
|
359
|
+
`--text` (what a thing says), `--muted` (what describes it: keys, facts,
|
|
360
|
+
stamps, ids), `--dim` (only what is not there: a nil, a placeholder, a
|
|
361
|
+
separator). A theme's colours are its palette's own; `--text` and `--muted`
|
|
362
|
+
come from the palette's darker greys so they read on the three floors, and the
|
|
363
|
+
hues are as the palette gives them.
|
|
364
|
+
- Fills: `--bg-fill`, `--surface-fill`, `--card-fill`, and a Shell's
|
|
365
|
+
`--floor-fill` for the paper its page lies on. Each is its colour under the
|
|
366
|
+
skin's `--texture`, as one `background`. A surface paints its fill, never its
|
|
367
|
+
colour alone, and whatever opens into a surface (a sidebar's current tab, a
|
|
368
|
+
lit tab) paints that surface's fill, so the two cannot differ in tone. Pencil
|
|
369
|
+
sets `--texture` to its grain inside a Shell, where panes scroll apart and the
|
|
370
|
+
grain cannot lie over the whole page; each fill is attached to what it paints
|
|
371
|
+
(`local`), so it scrolls with that pane. Two panes' tiles then do not line up
|
|
372
|
+
where they meet, which the grain's noise hides; a flat colour beside a grained
|
|
373
|
+
one does not hide, which is what this rule prevents.
|
|
374
|
+
- Selection and the primary action: `--accent`; links: `--link`; section titles:
|
|
375
|
+
`--heading`, the text's own ink in both themes: a heading is set apart by size
|
|
376
|
+
and weight, never a hue.
|
|
377
|
+
- Dot tones: `--info`, `--active`, `--positive`, `--negative`, `--caution`,
|
|
378
|
+
`--special`.
|
|
379
|
+
- Values: `--number`, `--literal` (true, false, null), `--time`, `--who`; code
|
|
380
|
+
syntax: `--keyword`, `--string`, `--fn`, `--type`, `--attr`.
|
|
381
|
+
- Chip hues: `--hue-0` through `--hue-5`.
|
|
382
|
+
|
|
383
|
+
Fonts use `--font` and `--mono` (what is copied or typed: ids, shas, code); type
|
|
384
|
+
uses `--size` and `--small`, defaulting to 14px and 12px; spacing uses `--gap`,
|
|
385
|
+
`--radius` and `--measure`; raised boxes use `--shadow`. The base CSS derives
|
|
386
|
+
`--half-gap`, `--soft` and the touch target floor `--tap`.
|
|
387
|
+
|
|
388
|
+
Put page sections in a `Stack` or grid and space siblings with the parent’s
|
|
389
|
+
`gap`. Keep components free of outer margins. Plain parents of sibling cards
|
|
390
|
+
also get the default stack layout.
|
|
391
|
+
|
|
392
|
+
A **skin** supplies CSS by piece name and optional terminal sheet and native
|
|
393
|
+
replacements (`Skin`). An entry's `css` replaces the piece's own; its `over` is
|
|
394
|
+
laid on top of whichever the piece wears, so a skin adds to a piece without
|
|
395
|
+
copying it. A missing entry uses the kit's rendering. `paper`, the default, lays
|
|
396
|
+
yak.sh's paper grain, fine link underlines and medium headings over the
|
|
397
|
+
document's defaults (`base`); `ledger` replaces Head and Tile with printed
|
|
398
|
+
labels and ruled records, and lays its labels over Button and Tabs. Other pieces
|
|
399
|
+
retain the kit's rendering.
|
|
400
|
+
|
|
401
|
+
### Pencil and fine line
|
|
402
|
+
|
|
403
|
+
`pencil`, yaks.app's skin, draws some lines by hand and leaves others fine.
|
|
404
|
+
Which is which depends on what the line does, never on which page it is on:
|
|
405
|
+
|
|
406
|
+
- **Pencil draws a thing.** That covers the outline of anything a person sees as
|
|
407
|
+
one object: a card, a panel, a popover, a menu, a dialog, a toast, a tip, a
|
|
408
|
+
list of suggestions, a bar of pending changes. It covers the outline of every
|
|
409
|
+
control: a press, a field, a tab, a chip that acts. It also covers the rule
|
|
410
|
+
that splits one thing into its parts: a head from its body, a foot, the
|
|
411
|
+
sections of a card, the groups of a menu or a nav.
|
|
412
|
+
- **What floats or can be pressed stands on its hatch**, the pencil's shadow,
|
|
413
|
+
never a soft one.
|
|
414
|
+
- **A fine line sits between like things.** That is one pixel of `--border`
|
|
415
|
+
between the rows of a list, the lines of a table, the days of a transcript, or
|
|
416
|
+
under a chart's columns, and the frame round a picture, a swatch or a meter's
|
|
417
|
+
track.
|
|
418
|
+
|
|
419
|
+
To tell which one a line needs, ask whether it bounds a thing or splits one
|
|
420
|
+
thing into parts (pencil), or separates many things of one kind (a fine line).
|
|
421
|
+
The friends panel is the example: its frame and the rules under its head and
|
|
422
|
+
over its foot are pencil, and the hairlines between friends are fine.
|
|
423
|
+
|
|
424
|
+
A part gets the pencil by composing `Surface`, not by drawing a border of its
|
|
425
|
+
own. `Surface` is a flat thing, `Surface.Raised` floats over the page,
|
|
426
|
+
`Surface.Press` is pressed, and `Surface.Well` is typed in. `Surface.Head` and
|
|
427
|
+
`Surface.Foot` are ruled off from what the surface holds. `tagged(look, tag)`
|
|
428
|
+
puts one of them in another element. In any other skin the same parts draw plain
|
|
429
|
+
lines: `--edge-color` for an outline and `--border2` for a rule.
|
|
430
|
+
|
|
431
|
+
A **composition** supplies `{ kits, theme, skin?, ux? }` to render a page and
|
|
432
|
+
its guide (`Composition`). `composition` is the base kits in `gouache` and
|
|
433
|
+
`paper`; a host that names no theme wears it. `parts` flattens its kits, keeping
|
|
434
|
+
unique names bare and qualifying shared names as `kit/name`. A skin can target
|
|
435
|
+
one kit with `kit/name`; a bare skin key matches every kit, with scoped entries
|
|
436
|
+
taking precedence. `stylesheet` loads the theme, then one CSS rendering per
|
|
437
|
+
piece in kit order; it resolves relative CSS `url()` and quoted `@import`
|
|
438
|
+
addresses against each stylesheet's URL. `sheet` combines the selected terminal
|
|
439
|
+
entries, including the base entries for [@yaks/tui](../tui/README.md)'s widgets,
|
|
440
|
+
and `native` combines the native ones.
|
|
441
|
+
|
|
442
|
+
```ts
|
|
443
|
+
import { composition, ledger, native, sheet, stylesheet } from '@yaks/ui'
|
|
444
|
+
import { equal } from '@yaks/testing'
|
|
445
|
+
|
|
446
|
+
const dressed = { ...composition, skin: ledger }
|
|
447
|
+
const css = await stylesheet(dressed)
|
|
448
|
+
equal(css.includes('.Button'), true)
|
|
449
|
+
equal(sheet(dressed).Button.bold, true)
|
|
450
|
+
equal(sheet(dressed).Field.fg, dressed.theme.colors.text)
|
|
451
|
+
equal(
|
|
452
|
+
native(dressed)['Button-go'].backgroundColor,
|
|
453
|
+
dressed.theme.colors.accent,
|
|
454
|
+
)
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
## Contributions
|
|
458
|
+
|
|
459
|
+
**Contributions** are named kits, UX specimens, themes and skins from a
|
|
460
|
+
[plugin](../graph/README.md#data-model)'s browser-safe `./ui` facet
|
|
461
|
+
(`Contributions`). `gather` combines facets and refuses duplicate contribution
|
|
462
|
+
names. A kit's stylesheets travel with its pieces, so pieces can live in another
|
|
463
|
+
package. `ux` holds descriptions and specimens for controlled
|
|
464
|
+
[@yaks/ux](../ux/README.md) components; the guide does not load their behavior.
|
|
465
|
+
|
|
466
|
+
```ts
|
|
467
|
+
import { createElement as h } from 'react'
|
|
468
|
+
import { gather } from '@yaks/ui/contributions'
|
|
469
|
+
import { kits, skins, themes } from '@yaks/ui/ui'
|
|
470
|
+
import { type Composition, parts } from '@yaks/ui'
|
|
471
|
+
import { equal, throws } from '@yaks/testing'
|
|
472
|
+
|
|
473
|
+
const extra = { ...kits.base.Dot, Component: () => h('span', {}, 'extra') }
|
|
474
|
+
const all = gather([{ kits, themes, skins }, {
|
|
475
|
+
kits: { extra: { Extra: extra } },
|
|
476
|
+
}])
|
|
477
|
+
const c: Composition = { kits: all.kits!, theme: all.themes!.rosepine }
|
|
478
|
+
equal(parts(c).Extra.Component, extra.Component)
|
|
479
|
+
await throws(() => gather([{ kits }, { kits }]))
|
|
480
|
+
const shared = parts({ ...c, kits: { first: kits.base, second: kits.base } })
|
|
481
|
+
equal(shared['first/Button'], kits.base.Button)
|
|
482
|
+
equal(shared['second/Button'], kits.base.Button)
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
## Style guide
|
|
486
|
+
|
|
487
|
+
`Guide` shows each piece's description and specimens, grouped by kit, and UX
|
|
488
|
+
specimens. `Specimens` shows one entry and, when a skin is selected, whether it
|
|
489
|
+
uses the skin or the kit. `Contents` links to each entry. A **stop** is the id
|
|
490
|
+
of the whole guide, a group or an entry (`stopsOf`); `Page` renders one stop.
|
|
491
|
+
|
|
492
|
+
```ts
|
|
493
|
+
import { createElement as h } from 'react'
|
|
494
|
+
import { renderToStaticMarkup as html } from 'react-dom/server'
|
|
495
|
+
import { composition, ledger } from '@yaks/ui'
|
|
496
|
+
import { Contents, Page, stopsOf } from '@yaks/ui/guide'
|
|
497
|
+
import { equal } from '@yaks/testing'
|
|
498
|
+
|
|
499
|
+
const c = { ...composition, skin: ledger }
|
|
500
|
+
equal(stopsOf(c).includes('Button'), true)
|
|
501
|
+
const page = html(h(Page, { stop: 'Button', composition: c }))
|
|
502
|
+
equal(page.includes('data-skin="skin"'), true)
|
|
503
|
+
equal(page.includes('skin rendering'), true)
|
|
504
|
+
|
|
505
|
+
const entry = (stop: string) => ({ href: `#${stop}` })
|
|
506
|
+
equal(
|
|
507
|
+
html(h(Contents, { composition: c, entry })).includes('href="#Button"'),
|
|
508
|
+
true,
|
|
509
|
+
)
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
The selected page's specimen carries its skin coverage in `data-skin` and
|
|
513
|
+
metadata. Its `Gallery` holds the examples; the caller supplies contents links.
|
|
514
|
+
|
|
515
|
+
`routes(host?)` serves `/ui` as static HTML with inline CSS, contents and theme,
|
|
516
|
+
skin and scheme links, and `/ui/file` the files its CSS points at (pencil's line
|
|
517
|
+
and grain), only those. A host supplies gathered contributions as `host.ui`; the
|
|
518
|
+
default shows the base kit. Query parameters select the rendering, for example
|
|
519
|
+
`/ui?theme=rosepine&scheme=light&skin=ledger`.
|
|
520
|
+
|
|
521
|
+
```ts
|
|
522
|
+
import { routes } from '@yaks/ui/routes'
|
|
523
|
+
import { equal } from '@yaks/testing'
|
|
524
|
+
|
|
525
|
+
const [route] = routes()
|
|
526
|
+
const response = await route.handle(
|
|
527
|
+
new Request(
|
|
528
|
+
'https://example.com/ui?theme=rosepine&scheme=light&skin=ledger',
|
|
529
|
+
),
|
|
530
|
+
)
|
|
531
|
+
const html = await response.text()
|
|
532
|
+
equal(response.headers.get('content-type'), 'text/html; charset=utf-8')
|
|
533
|
+
equal(html.includes('color-scheme: light'), true)
|
|
534
|
+
equal(html.includes('skin rendering'), true)
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
Run `yak ui` to open the base guide in a terminal. Use j and k to walk its
|
|
538
|
+
contents, ↑ ↓ PgUp PgDn scroll, t changes theme, s changes skin, and q quits.
|
|
539
|
+
Clicking contents, theme or skin entries selects them. This interactive command
|
|
540
|
+
needs a terminal, so it is not run by this README's Deno examples.
|
|
541
|
+
|
|
542
|
+
```sh
|
|
543
|
+
yak ui
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
## Browser placement
|
|
547
|
+
|
|
548
|
+
`Float` renders its children into an `Overlay` fixed on `document.body`,
|
|
549
|
+
positioned on its anchor's live rectangle and carrying the originating tree's
|
|
550
|
+
React context. This avoids clipping and scaling by ancestors. `place` places a
|
|
551
|
+
fixed element above or below a rectangle, flipping and clamping to the viewport,
|
|
552
|
+
centered on it (`align` `'center'`, a tooltip) or from its start edge
|
|
553
|
+
(`'start'`, a field's suggestions, which `Combobox` floats that way and as wide
|
|
554
|
+
as the field, `--float-anchor-width`); `placeAt` positions it at a point,
|
|
555
|
+
optionally aligned right. `usePlaceAt` repeats placement when the element
|
|
556
|
+
resizes. `tips()` installs one delegated tooltip for `[data-tip]` per page.
|
|
557
|
+
|
|
558
|
+
This example needs a browser DOM, viewport measurements and `ResizeObserver`, so
|
|
559
|
+
the Deno example runner cannot run it. The supplied point is inside a viewport
|
|
560
|
+
larger than the overlay.
|
|
561
|
+
|
|
562
|
+
```ts ignore
|
|
563
|
+
import { createElement as h } from 'react'
|
|
564
|
+
import { render } from '@yaks/react/draw'
|
|
565
|
+
import { Float, placeAt, Tip, tips } from '@yaks/ui'
|
|
566
|
+
import { equal } from '@yaks/testing'
|
|
567
|
+
|
|
568
|
+
const anchor = document.createElement('button')
|
|
569
|
+
anchor.textContent = 'Details'
|
|
570
|
+
anchor.setAttribute('data-tip', 'Open details')
|
|
571
|
+
document.body.append(anchor)
|
|
572
|
+
const root = document.createElement('div')
|
|
573
|
+
document.body.append(root)
|
|
574
|
+
render(
|
|
575
|
+
h(
|
|
576
|
+
Float,
|
|
577
|
+
{ anchor: { current: anchor }, side: 'below' },
|
|
578
|
+
h(Tip, {}, 'Details'),
|
|
579
|
+
),
|
|
580
|
+
root,
|
|
581
|
+
)
|
|
582
|
+
equal(document.body.querySelector('.Overlay')?.textContent, 'Details')
|
|
583
|
+
const overlay = document.body.querySelector<HTMLElement>('.Overlay')!
|
|
584
|
+
placeAt(overlay, 100, 100)
|
|
585
|
+
equal(overlay.style.left, '100px')
|
|
586
|
+
tips()
|
|
587
|
+
render(null, root)
|
|
588
|
+
root.remove()
|
|
589
|
+
anchor.remove()
|
|
590
|
+
```
|
|
591
|
+
|
|
592
|
+
## Limits
|
|
593
|
+
|
|
594
|
+
Application meaning, state and press behavior belong to callers; reusable
|
|
595
|
+
interaction components belong to [@yaks/ux](../ux/README.md). Terminal rendering
|
|
596
|
+
belongs to [@yaks/tui](../tui/README.md). A terminal host supplies no `Float`;
|
|
597
|
+
`Float` itself returns no rendered children when there is no browser body.
|