@metamorph-labs/polymorph 1.0.18 → 1.0.19
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/CHANGELOG.md +242 -0
- package/dist/design/systems/desktop.json +1 -1
- package/dist/design/systems/dew.json +1 -1
- package/dist/design/systems/flint.json +1 -1
- package/dist/design/systems/glassmorphic.json +1 -1
- package/dist/design/systems/harbor.json +1 -1
- package/dist/design/systems/journal.json +1 -1
- package/dist/design/systems/pastel.json +1 -1
- package/dist/design/systems/pebble.json +1 -1
- package/dist/design/systems/plain.json +1 -1
- package/dist/design/systems/pop.json +1 -1
- package/dist/design/systems/press.json +1 -1
- package/dist/packages/angular-ui/src/ai/ArtifactPane.ts +15 -4
- package/dist/packages/angular-ui/src/ai/PromptInput.ts +3 -1
- package/dist/packages/angular-ui/src/archetypes/Dashboard.ts +38 -20
- package/dist/packages/angular-ui/src/archetypes/dashboard.states.ts +52 -0
- package/dist/packages/angular-ui/src/controls/ColorInput.ts +62 -34
- package/dist/packages/angular-ui/src/controls/Combobox.ts +28 -7
- package/dist/packages/angular-ui/src/controls/DatePicker.ts +12 -11
- package/dist/packages/angular-ui/src/controls/DateRangePicker.ts +22 -17
- package/dist/packages/angular-ui/src/controls/DateRangePickerRangeCalendar.ts +3 -2
- package/dist/packages/angular-ui/src/controls/FileUpload.ts +18 -12
- package/dist/packages/angular-ui/src/controls/FileUploadRow.ts +24 -4
- package/dist/packages/angular-ui/src/controls/MultiSelect.ts +49 -12
- package/dist/packages/angular-ui/src/controls/NumberInput.ts +27 -3
- package/dist/packages/angular-ui/src/controls/PhoneInput.ts +9 -5
- package/dist/packages/angular-ui/src/controls/Select.ts +36 -7
- package/dist/packages/angular-ui/src/controls/TagInput.ts +61 -7
- package/dist/packages/angular-ui/src/controls/TimeInput.ts +15 -1
- package/dist/packages/angular-ui/src/controls/select.states.ts +79 -58
- package/dist/packages/angular-ui/src/overlays/Command.ts +50 -13
- package/dist/packages/angular-ui/src/overlays/CommandPanel.ts +11 -7
- package/dist/packages/angular-ui/src/overlays/ToastViewport.ts +1 -1
- package/dist/packages/angular-ui/src/structure/CodeBlock.ts +18 -4
- package/dist/packages/angular-ui/src/structure/Stat.ts +295 -84
- package/dist/packages/angular-ui/src/structure/stat.states.ts +116 -0
- package/dist/packages/cli/src/agents.js +4 -3
- package/dist/packages/cli/src/apply.js +43 -18
- package/dist/packages/cli/src/check.js +4 -0
- package/dist/packages/cli/src/cli.js +6 -2
- package/dist/packages/cli/src/elements.js +12 -2
- package/dist/packages/cli/src/emit.js +43 -8
- package/dist/packages/cli/src/readings.js +29 -3
- package/dist/packages/cli/src/skills/bridge.js +1197 -0
- package/dist/packages/cli/src/skills/facts.js +190 -0
- package/dist/packages/cli/src/skills/native.js +1580 -0
- package/dist/packages/cli/src/skills/rules.js +199 -0
- package/dist/packages/cli/src/skills/runtime.js +1020 -0
- package/dist/packages/cli/src/skills/screen-charts.js +334 -0
- package/dist/packages/cli/src/skills/screen-chat.js +247 -0
- package/dist/packages/cli/src/skills/screen-code.js +565 -0
- package/dist/packages/cli/src/skills/screen-rich-text.js +305 -0
- package/dist/packages/cli/src/skills/screen.js +378 -0
- package/dist/packages/cli/src/skills/setup-packages.js +307 -0
- package/dist/packages/cli/src/skills/setup.js +125 -0
- package/dist/packages/cli/src/skills/theme-documents.js +351 -0
- package/dist/packages/cli/src/skills/theme.js +208 -0
- package/dist/packages/cli/src/skills.js +13 -794
- package/dist/packages/cli/src/theme.js +42 -1
- package/dist/packages/cli/src/tool-verbs.js +19 -4
- package/dist/packages/cli/src/verbs.js +28 -2
- package/dist/packages/elements-ui/dist/cdn/chunks/{AppShellUserCard-0eCCnnN_.js → AppShellUserCard-XT4br4fr.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{AreaChart-DftfzLG0.js → AreaChart-CXNFfbJ8.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/ArtifactPane-Pr9_K2uM.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/{Avatar-DcdMgxgY.js → Avatar-3WXoBPLv.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{Avatar-DcuvZwe7.js → Avatar-BKqjM8qW.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{AvatarButton-D5XKVduu.js → AvatarButton-BasMQCSM.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{AvatarGroup-DgFwJUNO.js → AvatarGroup-COch2-O0.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{BarChart-myuR0aHc.js → BarChart-ugae8zfr.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{ChatMessage-CgQ1h_JP.js → ChatMessage-Bx4yrF2x.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/CodeBlock-B_e5ma3K.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/CodeBlock-Fgtr48Vb.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/ColorInput-CD7rsWRp.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/Combobox-CUw7z6TS.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/{Combobox-DB2FT7so.js → Combobox-hWIFU9X_.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/Command-BXgqRd3I.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/{ConfirmDialog-BtQOAHY2.js → ConfirmDialog-CAaBRKxl.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{Dashboard-ChMPH4_Q.js → Dashboard-DwNw5Wnd.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/DatePicker-DjqtswQR.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/DateRangePicker-LsXFHOzm.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/{DonutChart-BEK89BeL.js → DonutChart-DYXx6eTe.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/FileUpload-3gbZTSSx.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/{FormField-PlLLDKqc.js → FormField-Bvw4cLBc.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{FormField-C6L3vYp4.js → FormField-DzhcinED.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{FunnelChart-DVQz_gad.js → FunnelChart-D24XhrGw.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{Heading-fAcu6Vrw.js → Heading-Cvfyu8pc.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{Heading-CgzEi9OQ.js → Heading-XDJzlwt9.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{Heatmap-BRwR-n-V.js → Heatmap-BQoUS6gY.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{Hero-CV2YWeb4.js → Hero-CXuuFceS.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{Histogram-CCYwlinB.js → Histogram-DW_ZPHpR.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{LineChart-BH6Pq1P1.js → LineChart-kf-zlNWe.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{Markdown-DmZEch4i.js → Markdown-C3rjhIbt.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/ModeSwitch-DQ86CK9h.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/MultiSelect-DbSx9QtV.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/NumberInput-B4ZZOGLl.js +7 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/PhoneInput-BsMfbNi6.js +210 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/PromptInput-l_-zAXSZ.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/{RadarChart-Coje7Sb0.js → RadarChart-CwJAWRki.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{RichTextContent-CufjptHF.js → RichTextContent-D51UfuWk.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{RichTextInput-Dz7yBFUA.js → RichTextInput-B32fN_p9.js} +3 -3
- package/dist/packages/elements-ui/dist/cdn/chunks/{ScatterChart-Do5tQTC5.js → ScatterChart-Mps7l5-i.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/Select-CpsRP0NR.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/Stat-CXR6bP7X.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/Stat-DGcx2ZZq.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/TagInput-BhkLU4gE.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/TimeInput-r2jNTOLN.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/{Toast-CAYGbn7g.js → Toast-BTfcZn0I.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{ToastViewport-CFslglYc.js → ToastViewport-BBQMRCQT.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{ToolCall-DUCoKsoE.js → ToolCall-DNU5kk9_.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{Treemap-Bh3ruYGJ.js → Treemap-BV8TlZHB.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/agent-DfOqpL9c.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/api-DJBiUXxK.js +4 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/avatar.module-D4YdFevY.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/cap-DA71oFHt.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/{cartesian-I5uPfyqv.js → cartesian-CEn2lJCc.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{chart-annotations.module-xUExw4pu.js → chart-annotations.module-hA_KO_Pe.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/chart-brush.module-C_8txUW5.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/chart-twin.module-BpfyTQ9R.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/check-CHvc4yHL.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/css-vars-DeZ4TCna.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/draw-BiQ3Of6N.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/drawing-nhJNBahV.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/field-labels-Df5HuYC5.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/frame-CtTY4oCn.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/on-call-YKLF3-FH.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/runtime-QRQ3CjZg.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/series-uUg6_JtL.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/src-XnWjGSDr.js +67 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/toast-pwGvxH2T.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/urls-Qks0KJ_p.js +6 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/webmcp-Dro53ATH.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/polymorph-all.js +52 -50
- package/dist/packages/elements-ui/dist/cdn/polymorph.css +1 -1
- package/dist/packages/elements-ui/dist/cdn/polymorph.js +1 -1
- package/dist/packages/elements-ui/dist/cdn/prepaint.js +1 -1
- package/dist/packages/elements-ui/dist/cdn/themes/desktop.css +5 -4
- package/dist/packages/elements-ui/dist/cdn/themes/dew.css +5 -4
- package/dist/packages/elements-ui/dist/cdn/themes/flint.css +5 -4
- package/dist/packages/elements-ui/dist/cdn/themes/glassmorphic.css +5 -4
- package/dist/packages/elements-ui/dist/cdn/themes/harbor.css +5 -4
- package/dist/packages/elements-ui/dist/cdn/themes/journal.css +5 -4
- package/dist/packages/elements-ui/dist/cdn/themes/pastel.css +5 -4
- package/dist/packages/elements-ui/dist/cdn/themes/pebble.css +5 -4
- package/dist/packages/elements-ui/dist/cdn/themes/plain.css +5 -4
- package/dist/packages/elements-ui/dist/cdn/themes/pop.css +5 -4
- package/dist/packages/elements-ui/dist/cdn/themes/press.css +5 -4
- package/dist/packages/elements-ui/dist/cdn/themes/terminal.css +5 -4
- package/dist/packages/elements-ui/src/ai/ArtifactPane.ts +2 -0
- package/dist/packages/elements-ui/src/archetypes/dashboard.states.ts +9 -0
- package/dist/packages/elements-ui/src/controls/ColorInput.ts +2 -0
- package/dist/packages/elements-ui/src/controls/NumberInput.ts +2 -0
- package/dist/packages/elements-ui/src/controls/TagInput.ts +4 -0
- package/dist/packages/elements-ui/src/controls/TimeInput.ts +2 -0
- package/dist/packages/elements-ui/src/controls/select.states.ts +10 -0
- package/dist/packages/elements-ui/src/overlays/Command.ts +2 -0
- package/dist/packages/elements-ui/src/structure/CodeBlock.ts +5 -2
- package/dist/packages/elements-ui/src/structure/Stat.ts +6 -0
- package/dist/packages/elements-ui/src/structure/stat.states.ts +33 -0
- package/dist/packages/mcp/src/propose.js +92 -15
- package/dist/packages/mcp/src/server.js +19 -8
- package/dist/packages/mcp/src/tools.js +80 -5
- package/dist/packages/mcp/src/write.js +95 -13
- package/dist/packages/react-ui/src/ai/ArtifactPane.tsx +5 -2
- package/dist/packages/react-ui/src/ai/PromptInput.tsx +5 -2
- package/dist/packages/react-ui/src/archetypes/dashboard.states.tsx +28 -0
- package/dist/packages/react-ui/src/controls/ColorInput.tsx +69 -13
- package/dist/packages/react-ui/src/controls/Combobox.tsx +13 -5
- package/dist/packages/react-ui/src/controls/DatePicker.tsx +3 -0
- package/dist/packages/react-ui/src/controls/DateRangePicker.tsx +22 -5
- package/dist/packages/react-ui/src/controls/FileUpload.tsx +2 -0
- package/dist/packages/react-ui/src/controls/MultiSelect.tsx +30 -6
- package/dist/packages/react-ui/src/controls/NumberInput.tsx +19 -1
- package/dist/packages/react-ui/src/controls/PhoneInput.tsx +3 -3
- package/dist/packages/react-ui/src/controls/Select.tsx +59 -23
- package/dist/packages/react-ui/src/controls/TagInput.tsx +43 -10
- package/dist/packages/react-ui/src/controls/TimeInput.tsx +10 -0
- package/dist/packages/react-ui/src/controls/date-segments.tsx +16 -0
- package/dist/packages/react-ui/src/controls/select.states.tsx +13 -0
- package/dist/packages/react-ui/src/overlays/Command.tsx +23 -2
- package/dist/packages/react-ui/src/overlays/Toaster.tsx +2 -2
- package/dist/packages/react-ui/src/structure/CodeBlock.tsx +7 -3
- package/dist/packages/react-ui/src/structure/Stat.tsx +90 -13
- package/dist/packages/react-ui/src/structure/stat.states.tsx +68 -0
- package/dist/packages/recipes/src/ai/artifact-pane.module.css +4 -4
- package/dist/packages/recipes/src/controls/rich-text-input.module.css +1 -1
- package/dist/packages/recipes/src/structure/avatar.module.css +3 -1
- package/dist/packages/recipes/src/structure/heading.module.css +5 -4
- package/dist/packages/recipes/src/structure/hero.module.css +3 -1
- package/dist/packages/recipes/src/structure/stat.module.css +7 -0
- package/dist/packages/registry/src/card.js +4 -3
- package/dist/packages/registry/src/frameworks.js +28 -1
- package/dist/packages/registry/src/runtime-card.js +300 -0
- package/dist/packages/registry/src/runtime-members.js +176 -0
- package/dist/packages/registry/src/screen-table.js +166 -0
- package/dist/packages/rules/package.js +1 -1
- package/dist/packages/solid-ui/src/ai/ArtifactPane.tsx +11 -3
- package/dist/packages/solid-ui/src/ai/PromptInput.tsx +3 -1
- package/dist/packages/solid-ui/src/archetypes/Dashboard.tsx +3 -0
- package/dist/packages/solid-ui/src/archetypes/dashboard.states.tsx +39 -0
- package/dist/packages/solid-ui/src/controls/ColorInput.tsx +38 -17
- package/dist/packages/solid-ui/src/controls/Combobox.tsx +27 -6
- package/dist/packages/solid-ui/src/controls/DatePicker.tsx +12 -11
- package/dist/packages/solid-ui/src/controls/DateRangePicker.tsx +21 -16
- package/dist/packages/solid-ui/src/controls/DateRangePickerRangeCalendar.tsx +3 -4
- package/dist/packages/solid-ui/src/controls/FileUpload.tsx +1 -0
- package/dist/packages/solid-ui/src/controls/FileUploadRow.tsx +6 -0
- package/dist/packages/solid-ui/src/controls/MultiSelect.tsx +51 -11
- package/dist/packages/solid-ui/src/controls/NumberInput.tsx +21 -2
- package/dist/packages/solid-ui/src/controls/PhoneInput.tsx +8 -4
- package/dist/packages/solid-ui/src/controls/Select.tsx +37 -6
- package/dist/packages/solid-ui/src/controls/TagInput.tsx +26 -5
- package/dist/packages/solid-ui/src/controls/TimeInput.tsx +10 -1
- package/dist/packages/solid-ui/src/controls/select.states.tsx +18 -0
- package/dist/packages/solid-ui/src/overlays/Command.tsx +15 -2
- package/dist/packages/solid-ui/src/overlays/CommandPanel.tsx +7 -7
- package/dist/packages/solid-ui/src/overlays/ToastViewport.tsx +1 -1
- package/dist/packages/solid-ui/src/structure/CodeBlock.tsx +9 -5
- package/dist/packages/solid-ui/src/structure/Stat.tsx +86 -25
- package/dist/packages/solid-ui/src/structure/stat.states.tsx +73 -0
- package/dist/packages/svelte-ui/src/ai/ArtifactPane.svelte +8 -2
- package/dist/packages/svelte-ui/src/ai/PromptInput.svelte +3 -1
- package/dist/packages/svelte-ui/src/archetypes/Dashboard.svelte +3 -0
- package/dist/packages/svelte-ui/src/archetypes/dashboard.states.svelte +2 -0
- package/dist/packages/svelte-ui/src/controls/ColorInput.svelte +29 -8
- package/dist/packages/svelte-ui/src/controls/Combobox.svelte +26 -5
- package/dist/packages/svelte-ui/src/controls/DatePicker.svelte +7 -5
- package/dist/packages/svelte-ui/src/controls/DateRangePicker.svelte +15 -9
- package/dist/packages/svelte-ui/src/controls/DateRangePickerRangeCalendar.svelte +3 -2
- package/dist/packages/svelte-ui/src/controls/FileUpload.svelte +1 -0
- package/dist/packages/svelte-ui/src/controls/FileUploadRow.svelte +8 -1
- package/dist/packages/svelte-ui/src/controls/MultiSelect.svelte +36 -10
- package/dist/packages/svelte-ui/src/controls/NumberInput.svelte +14 -1
- package/dist/packages/svelte-ui/src/controls/PhoneInput.svelte +3 -3
- package/dist/packages/svelte-ui/src/controls/Select.svelte +20 -6
- package/dist/packages/svelte-ui/src/controls/TagInput.svelte +21 -3
- package/dist/packages/svelte-ui/src/controls/TimeInput.svelte +11 -1
- package/dist/packages/svelte-ui/src/controls/select.states.svelte +26 -24
- package/dist/packages/svelte-ui/src/overlays/Command.svelte +13 -1
- package/dist/packages/svelte-ui/src/overlays/CommandPanel.svelte +11 -6
- package/dist/packages/svelte-ui/src/overlays/ToastViewport.svelte +1 -1
- package/dist/packages/svelte-ui/src/structure/CodeBlock.svelte +7 -2
- package/dist/packages/svelte-ui/src/structure/Stat.svelte +70 -17
- package/dist/packages/svelte-ui/src/structure/stat.states.svelte +27 -0
- package/dist/packages/theme/src/admit.js +6 -3
- package/dist/packages/theme/src/color/resolve.js +19 -2
- package/dist/packages/theme/src/derive.js +13 -6
- package/dist/packages/theme/src/emit.js +1 -1
- package/dist/packages/theme/src/runtime.js +58 -0
- package/dist/packages/theme/src/seeds.js +30 -4
- package/dist/packages/theme/src/systems.js +1 -1
- package/dist/packages/theme/src/tokens.js +15 -6
- package/dist/packages/vue-ui/src/ai/ArtifactPane.vue +11 -2
- package/dist/packages/vue-ui/src/ai/PromptInput.vue +3 -1
- package/dist/packages/vue-ui/src/archetypes/Dashboard.vue +3 -0
- package/dist/packages/vue-ui/src/archetypes/dashboard.states.ts +49 -0
- package/dist/packages/vue-ui/src/controls/ColorInput.vue +33 -12
- package/dist/packages/vue-ui/src/controls/Combobox.vue +26 -5
- package/dist/packages/vue-ui/src/controls/DatePicker.vue +12 -11
- package/dist/packages/vue-ui/src/controls/DateRangePicker.vue +20 -15
- package/dist/packages/vue-ui/src/controls/DateRangePickerRangeCalendar.vue +3 -4
- package/dist/packages/vue-ui/src/controls/FileUpload.vue +1 -0
- package/dist/packages/vue-ui/src/controls/FileUploadRow.vue +6 -0
- package/dist/packages/vue-ui/src/controls/MultiSelect.vue +37 -10
- package/dist/packages/vue-ui/src/controls/NumberInput.vue +17 -1
- package/dist/packages/vue-ui/src/controls/PhoneInput.vue +7 -3
- package/dist/packages/vue-ui/src/controls/Select.vue +22 -7
- package/dist/packages/vue-ui/src/controls/TagInput.vue +21 -3
- package/dist/packages/vue-ui/src/controls/TimeInput.vue +10 -1
- package/dist/packages/vue-ui/src/controls/select.states.ts +17 -0
- package/dist/packages/vue-ui/src/overlays/Command.vue +13 -1
- package/dist/packages/vue-ui/src/overlays/CommandPanel.vue +7 -7
- package/dist/packages/vue-ui/src/overlays/ToastViewport.vue +1 -1
- package/dist/packages/vue-ui/src/structure/CodeBlock.vue +7 -2
- package/dist/packages/vue-ui/src/structure/Stat.vue +71 -18
- package/dist/packages/vue-ui/src/structure/stat.states.ts +67 -0
- package/dist/platforms/android/ui/src/generated/kotlin/dev/polymorph/ui/Contracts.kt +144 -33
- package/dist/platforms/android/ui/src/generated/kotlin/dev/polymorph/ui/Members.kt +17 -7
- package/dist/platforms/ios/Sources/PolymorphUI/Generated/Contracts.swift +204 -31
- package/dist/registry/registry.json +371 -75
- package/dist/screen/assets/{screen-CuQbskb8.css → screen-B22PTPwF.css} +1 -1
- package/dist/screen/assets/screen-Cpbh7XMb.js +372 -0
- package/dist/screen/screen.html +3 -3
- package/package.json +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/ArtifactPane-DsmRlr6d.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/CodeBlock-BqP8HZKM.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/CodeBlock-D8VARz0a.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/ColorInput-BrzZOVeL.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/Combobox-BiUq0h-w.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/Command-hmxVRdFg.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/DatePicker-C8prGbJ2.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/DateRangePicker-CO1ioqwN.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/FileUpload-HPQe-ttb.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/ModeSwitch-CerqbGv3.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/MultiSelect-CQq7jPgI.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/NumberInput-Dre9GwBy.js +0 -7
- package/dist/packages/elements-ui/dist/cdn/chunks/PhoneInput-D6_J6Es_.js +0 -210
- package/dist/packages/elements-ui/dist/cdn/chunks/PromptInput-BXcsUQ5W.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/Select-DxGQgv2q.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/Stat-FsMUWigK.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/Stat-WS8v6BQv.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/TagInput-D-uIQEGS.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/TimeInput-Dho571vA.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/agent-DBDk4wLH.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/api-B9sGZiYn.js +0 -4
- package/dist/packages/elements-ui/dist/cdn/chunks/avatar.module-CQwnWhWo.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/cap-Ct4k7zNC.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/chart-brush.module-DycBfben.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/chart-twin.module-Cks7VwS5.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/check-dOfCSYFA.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/draw-DclRgiWM.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/drawing-DjkZr0z8.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/frame-BSvl4y47.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/on-call-Jk1sYJc_.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/receivers-BpRfF6dV.js +0 -4
- package/dist/packages/elements-ui/dist/cdn/chunks/series-C_1TNd2n.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/src-Bub3C9YP.js +0 -67
- package/dist/packages/elements-ui/dist/cdn/chunks/toast-AarMGYJn.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/webmcp-eEPzSqph.js +0 -1
- package/dist/screen/assets/screen-Clj2u6_s.js +0 -372
|
@@ -125,7 +125,7 @@ onDestroy(() => release6?.())
|
|
|
125
125
|
}{#if joined.shown
|
|
126
126
|
}<div bind:this={region} role="region" aria-label={say.viewport} tabindex="-1"
|
|
127
127
|
><ol bind:this={list} class={styles.viewport} tabindex="-1" data-toast-part="list"
|
|
128
|
-
>{#each records as record (record.
|
|
128
|
+
>{#each records as record (record.key)
|
|
129
129
|
}<ToastCard {record} dismissLabel={say.dismiss} {paused}
|
|
130
130
|
/>{/each
|
|
131
131
|
}</ol
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Verbatim code (`design/components/code-block.md`).
|
|
4
4
|
*
|
|
5
5
|
* Generated by `pnpm shells` from `packages/shells/src/members/code-block.ts`, the member's
|
|
6
6
|
* framework-neutral description. Never edit it by hand: change the description and
|
|
@@ -17,6 +17,10 @@ export interface CodeBlockProps {
|
|
|
17
17
|
* The code, rendered verbatim including whitespace.
|
|
18
18
|
*/
|
|
19
19
|
children: Snippet
|
|
20
|
+
/**
|
|
21
|
+
* What a screen reader hears after a copy, default `'Copied'`; apps pass a localized one.
|
|
22
|
+
*/
|
|
23
|
+
copiedLabel?: string
|
|
20
24
|
/**
|
|
21
25
|
* Draws the copy control, the block's only control.
|
|
22
26
|
*/
|
|
@@ -36,6 +40,7 @@ export interface CodeBlockProps {
|
|
|
36
40
|
<script lang="ts">
|
|
37
41
|
let {
|
|
38
42
|
children,
|
|
43
|
+
copiedLabel = 'Copied',
|
|
39
44
|
copyable = false,
|
|
40
45
|
copyLabel = 'Copy',
|
|
41
46
|
label: labelOwn = 'Code block',
|
|
@@ -115,7 +120,7 @@ onDestroy(() => release2?.())
|
|
|
115
120
|
label={copyLabel}
|
|
116
121
|
onClick={() => { copy() }}
|
|
117
122
|
/></div
|
|
118
|
-
><span class={styles.reader} aria-live="polite">{copied ?
|
|
123
|
+
><span class={styles.reader} aria-live="polite">{copied ? copiedLabel : ''}</span
|
|
119
124
|
></div
|
|
120
125
|
>{:else
|
|
121
126
|
}<pre
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
2
|
/**
|
|
3
|
-
* A key number
|
|
3
|
+
* A key number and how it moved (`design/components/stat.md`).
|
|
4
4
|
*
|
|
5
5
|
* Generated by `pnpm shells` from `packages/shells/src/members/stat.ts`, the member's
|
|
6
6
|
* framework-neutral description. Never edit it by hand: change the description and
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
import { Icon, joinSlot, type IconRole } from '@polymorph/svelte'
|
|
11
11
|
import styles from '@polymorph/recipes/structure/stat.module.css'
|
|
12
12
|
import Badge from './Badge.svelte'
|
|
13
|
+
import Skeleton from './Skeleton.svelte'
|
|
13
14
|
import Sparkline from '../charts/Sparkline.svelte'
|
|
14
15
|
|
|
15
16
|
export type DeltaDirection = 'up' | 'down'
|
|
@@ -20,6 +21,12 @@ export interface StatDelta {
|
|
|
20
21
|
positive?: boolean
|
|
21
22
|
}
|
|
22
23
|
|
|
24
|
+
export type StatDeltaLabel = (delta: {
|
|
25
|
+
value: string
|
|
26
|
+
direction: DeltaDirection
|
|
27
|
+
positive: boolean
|
|
28
|
+
}) => string
|
|
29
|
+
|
|
23
30
|
export interface StatTrend {
|
|
24
31
|
direction: DeltaDirection
|
|
25
32
|
label: string
|
|
@@ -32,6 +39,11 @@ export interface StatFooter {
|
|
|
32
39
|
|
|
33
40
|
export interface StatProps {
|
|
34
41
|
delta?: StatDelta
|
|
42
|
+
/**
|
|
43
|
+
* The delta's spoken sentence in the host's words, the localization seam; the default is
|
|
44
|
+
* `{direction} {value} — positive` or `— negative`.
|
|
45
|
+
*/
|
|
46
|
+
deltaLabel?: StatDeltaLabel
|
|
35
47
|
/**
|
|
36
48
|
* Shown when there is no delta, such as "vs last week".
|
|
37
49
|
*/
|
|
@@ -42,6 +54,18 @@ export interface StatProps {
|
|
|
42
54
|
footer?: StatFooter
|
|
43
55
|
icon?: IconRole
|
|
44
56
|
label: string
|
|
57
|
+
/**
|
|
58
|
+
* The number has not arrived. The label row stays, and the value and each part the caller
|
|
59
|
+
* passes that states the number is a Skeleton of that part's size. `value` stays required, as
|
|
60
|
+
* a chart's rows do with its `loading`: pass what there is, `''` or the last value, and it is
|
|
61
|
+
* not drawn.
|
|
62
|
+
*/
|
|
63
|
+
loading?: boolean
|
|
64
|
+
/**
|
|
65
|
+
* What a screen reader hears in the value's place while `loading`, the value's Skeleton's
|
|
66
|
+
* name. Default "Loading".
|
|
67
|
+
*/
|
|
68
|
+
loadingLabel?: string
|
|
45
69
|
/**
|
|
46
70
|
* Tabular figures, so a column of these lines up.
|
|
47
71
|
*/
|
|
@@ -71,10 +95,14 @@ export interface StatProps {
|
|
|
71
95
|
<script lang="ts">
|
|
72
96
|
let {
|
|
73
97
|
delta,
|
|
98
|
+
deltaLabel = ({ value, direction, positive }: Parameters<StatDeltaLabel>[0]) =>
|
|
99
|
+
`${direction} ${value} — ${positive ? 'positive' : 'negative'}`,
|
|
74
100
|
description,
|
|
75
101
|
footer,
|
|
76
102
|
icon,
|
|
77
103
|
label: labelOwn,
|
|
104
|
+
loading = false,
|
|
105
|
+
loadingLabel = 'Loading',
|
|
78
106
|
numeric = true,
|
|
79
107
|
spark,
|
|
80
108
|
sparkLabel = (label: string) => `${label}, recent trend`,
|
|
@@ -92,25 +120,43 @@ const positive = $derived(
|
|
|
92
120
|
|
|
93
121
|
{@render joined.start?.()
|
|
94
122
|
}{#if joined.shown
|
|
95
|
-
}<div
|
|
123
|
+
}<div
|
|
124
|
+
class={styles.stat}
|
|
125
|
+
data-member="stat"
|
|
126
|
+
data-loading={(loading) ? '' : undefined}
|
|
127
|
+
aria-busy={(loading) ? true : undefined}
|
|
96
128
|
><div class={styles.labelRow}
|
|
97
129
|
><span class={styles.label}>{label}</span
|
|
98
130
|
>{#if icon !== undefined || trend !== undefined
|
|
99
131
|
}<span class={styles.labelEnd}
|
|
100
132
|
>{#if icon !== undefined}<span class={styles.glyph}><Icon name={icon} /></span>{/if
|
|
101
|
-
}{#if trend !== undefined
|
|
133
|
+
}{#if trend !== undefined && loading
|
|
134
|
+
}<span class={styles.trendPlaceholder}><Skeleton textStep="xs" width={7} /></span
|
|
135
|
+
>{:else if trend !== undefined
|
|
102
136
|
}<Badge variant="outline" icon={trend.direction}>{trend.label}</Badge
|
|
103
137
|
>{/if
|
|
104
138
|
}</span
|
|
105
139
|
>{/if
|
|
106
140
|
}</div
|
|
107
141
|
><div class={styles.valueRow}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
142
|
+
>{#if loading
|
|
143
|
+
}<Skeleton textStep="3xl" width={10} label={loadingLabel}
|
|
144
|
+
/>{:else
|
|
145
|
+
}<span class={styles.value} data-numeric={(numeric) ? '' : undefined}>{value}</span
|
|
146
|
+
>{/if
|
|
147
|
+
}{#if spark !== undefined
|
|
148
|
+
}<span class={styles.spark}
|
|
149
|
+
>{#if loading
|
|
150
|
+
}<Skeleton shape="rect" size={6} width={9}
|
|
151
|
+
/>{:else
|
|
152
|
+
}<Sparkline data={spark} label={sparkLabel(label)}
|
|
153
|
+
/>{/if
|
|
154
|
+
}</span
|
|
111
155
|
>{/if
|
|
112
156
|
}</div
|
|
113
|
-
>{#if delta !== undefined
|
|
157
|
+
>{#if delta !== undefined && loading
|
|
158
|
+
}<Skeleton textStep="sm" width={9}
|
|
159
|
+
/>{:else if delta !== undefined
|
|
114
160
|
}<span
|
|
115
161
|
class={styles.delta}
|
|
116
162
|
data-direction={delta.direction}
|
|
@@ -118,22 +164,29 @@ const positive = $derived(
|
|
|
118
164
|
><Icon name={delta.direction} size="sm"
|
|
119
165
|
/><span aria-hidden="true">{delta.value}</span
|
|
120
166
|
><span class={styles.spoken}
|
|
121
|
-
>{
|
|
167
|
+
>{deltaLabel({ value: delta.value, direction: delta.direction, positive: positive === true })
|
|
122
168
|
}</span
|
|
123
169
|
></span
|
|
124
|
-
>{:else if description !== undefined
|
|
170
|
+
>{:else if description !== undefined && loading
|
|
171
|
+
}<Skeleton textStep="xs" width={10}
|
|
172
|
+
/>{:else if description !== undefined
|
|
125
173
|
}<span class={styles.description}>{description}</span
|
|
126
174
|
>{/if
|
|
127
175
|
}{#if footer !== undefined
|
|
128
176
|
}<div class={styles.footer}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
177
|
+
>{#if loading
|
|
178
|
+
}<Skeleton textStep="sm"
|
|
179
|
+
/><Skeleton textStep="sm" width={10}
|
|
180
|
+
/>{:else
|
|
181
|
+
}<span class={styles.footerPrimary}
|
|
182
|
+
>{footer.primary
|
|
183
|
+
}{#if trend !== undefined
|
|
184
|
+
}<span class={styles.footerGlyph}><Icon name={trend.direction} size="sm" /></span
|
|
185
|
+
>{/if
|
|
186
|
+
}</span
|
|
187
|
+
><span class={styles.footerSecondary}>{footer.secondary}</span
|
|
188
|
+
>{/if
|
|
189
|
+
}</div
|
|
137
190
|
>{/if
|
|
138
191
|
}</div
|
|
139
192
|
>{/if
|
|
@@ -24,6 +24,27 @@ export const states: ComponentStates = {
|
|
|
24
24
|
{ name: 'trend down — the same chip, the other way', render: entry10 },
|
|
25
25
|
{ name: 'a footer with no trend — the glyph goes with the chip', render: entry11 },
|
|
26
26
|
{ name: 'a trend with no footer — the whole card is the number', render: entry12 },
|
|
27
|
+
{
|
|
28
|
+
name: 'spark trending down beside a down-positive delta — direction is not sentiment, as a shape',
|
|
29
|
+
render: entry13,
|
|
30
|
+
},
|
|
31
|
+
{ name: 'spark with the trend chip — words and shape together', render: entry14 },
|
|
32
|
+
{ name: 'spark alone', render: entry15 },
|
|
33
|
+
{
|
|
34
|
+
name: 'loading — the label stays and the number holds its place',
|
|
35
|
+
render: entry16,
|
|
36
|
+
expect: { 'data-loading': '', 'aria-busy': 'true' },
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'loading with a delta — no sentiment before the number',
|
|
40
|
+
render: entry17,
|
|
41
|
+
expect: { 'data-loading': '', 'aria-busy': 'true' },
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'loading a dashboard card — the chip, the spark and the footer hold their places',
|
|
45
|
+
render: entry18,
|
|
46
|
+
expect: { 'data-loading': '', 'aria-busy': 'true' },
|
|
47
|
+
},
|
|
27
48
|
],
|
|
28
49
|
}
|
|
29
50
|
</script>
|
|
@@ -40,3 +61,9 @@ export const states: ComponentStates = {
|
|
|
40
61
|
{#snippet entry10(overrides: Overrides)}<Stat label="Median response" value="2h 23m" trend={{ direction: 'down', label: '−18%' }} footer={{ primary: 'Faster than last week', secondary: 'Across every open queue' }} {...overrides} />{/snippet}
|
|
41
62
|
{#snippet entry11(overrides: Overrides)}<Stat label="Open tickets" value="128" footer={{ primary: 'Steady all week', secondary: 'Nothing has been waiting past a day' }} {...overrides} />{/snippet}
|
|
42
63
|
{#snippet entry12(overrides: Overrides)}<Stat label="Urgent" value="1" trend={{ direction: 'down', label: '2 fewer' }} {...overrides} />{/snippet}
|
|
64
|
+
{#snippet entry13(overrides: Overrides)}<Stat label="First response" value="26m" delta={{ value: '16m', direction: 'down', positive: true }} spark={[42, 40, 41, 38, 35, 36, 33, 31, 32, 29, 27, 26]} {...overrides} />{/snippet}
|
|
65
|
+
{#snippet entry14(overrides: Overrides)}<Stat label="Revenue" value="$48,200" trend={{ direction: 'up', label: '+12.5%' }} spark={[180, 195, 190, 210, 220, 216, 240, 251, 248, 262, 270, 284]} {...overrides} />{/snippet}
|
|
66
|
+
{#snippet entry15(overrides: Overrides)}<Stat label="Open tickets" value="128" spark={[180, 195, 190, 210, 220, 216, 240, 251, 248, 262, 270, 284]} {...overrides} />{/snippet}
|
|
67
|
+
{#snippet entry16(overrides: Overrides)}<Stat label="Response time" value="" icon="time" loading={true} {...overrides} />{/snippet}
|
|
68
|
+
{#snippet entry17(overrides: Overrides)}<Stat label="Resolved" value="342" delta={{ value: '12%', direction: 'up' }} loading={true} {...overrides} />{/snippet}
|
|
69
|
+
{#snippet entry18(overrides: Overrides)}<Stat label="Solved this week" value="1,204" trend={{ direction: 'up', label: '+12.5%' }} spark={[180, 195, 190, 210, 220, 216, 240, 251, 248, 262, 270, 284]} footer={{ primary: 'Trending up this month', secondary: 'Against the same week last month' }} loading={true} {...overrides} />{/snippet}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FONT_ROLES, GRADIENT_STOP_PINS, fontPackage } from "./seeds.js";
|
|
1
|
+
import { FONT_ROLES, GRADIENT_STOP_PINS, fontPackage, fontSlot } from "./seeds.js";
|
|
2
2
|
import { GRADIENT_BASE } from "./roles.js";
|
|
3
3
|
import { gradientPairingId, pairingId, pairingMeasure } from "./pairings.js";
|
|
4
4
|
import { MODES } from "./theme.js";
|
|
@@ -27,11 +27,14 @@ function schemaFaults(which, error) {
|
|
|
27
27
|
message: `${which}${issue.path.length > 0 ? `.${issue.path.join(".")}` : ""}: ${issue.message}`
|
|
28
28
|
}));
|
|
29
29
|
}
|
|
30
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* The install list: one entry per family, with every role it fills. A heading
|
|
32
|
+
* slot the system leaves out is filled by the body family.
|
|
33
|
+
*/
|
|
31
34
|
function admittedFonts(fonts) {
|
|
32
35
|
const byFamily = /* @__PURE__ */ new Map();
|
|
33
36
|
for (const role of FONT_ROLES) {
|
|
34
|
-
const family = fonts
|
|
37
|
+
const family = fontSlot(fonts, role).family;
|
|
35
38
|
const entry = byFamily.get(family);
|
|
36
39
|
if (entry) entry.roles.push(role);
|
|
37
40
|
else byFamily.set(family, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CHROMA_BUDGET_PEAK, PIN_ROLES, gradientPinFault, gradientStopPin, hasGradient, neutralHueOf, pinnedColor, statusPeakOf } from "../seeds.js";
|
|
1
|
+
import { CHROMA_BUDGET_PEAK, PIN_ROLES, gradientPinFault, gradientStopPin, hasGradient, isPinColor, neutralHueOf, pinnedColor, statusPeakOf } from "../seeds.js";
|
|
2
2
|
import { GRADIENT_BASE, GRADIENT_ROLES } from "../roles.js";
|
|
3
3
|
import { LAWFUL_GRADIENT_PAIRINGS, LAWFUL_PAIRINGS, isDelineation, isFocus, pairingId, pairingMeasure } from "../pairings.js";
|
|
4
4
|
import { GLASS_SURFACE_MIX } from "../derive.js";
|
|
@@ -474,6 +474,23 @@ function resolveMaterialSurface(colors, depth) {
|
|
|
474
474
|
};
|
|
475
475
|
}
|
|
476
476
|
/**
|
|
477
|
+
* A colour written as a palette writes a pin (`#rrggbb`, or the ring's
|
|
478
|
+
* `rgb(r g b / a)`), in OKLCH, or `null` when the text is not one. It is read
|
|
479
|
+
* as a pin is read (`pinnedWorking`), so the numbers are the ones the engine
|
|
480
|
+
* measures. A grey has equal channels and so no chroma, and its hue is `null`:
|
|
481
|
+
* no hue would be drawn from it.
|
|
482
|
+
*/
|
|
483
|
+
function oklchOf(value) {
|
|
484
|
+
if (!isPinColor(value)) return null;
|
|
485
|
+
const { l, c, h, alpha } = parseEmitted(pinnedColor(value));
|
|
486
|
+
return {
|
|
487
|
+
l,
|
|
488
|
+
c,
|
|
489
|
+
h: c === 0 ? null : h,
|
|
490
|
+
alpha: alpha ?? 1
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
/**
|
|
477
494
|
* Keeps alpha through the round trip, so an audit does not measure a
|
|
478
495
|
* translucent dark border as solid white.
|
|
479
496
|
*/
|
|
@@ -488,4 +505,4 @@ function parseEmitted(value) {
|
|
|
488
505
|
};
|
|
489
506
|
}
|
|
490
507
|
//#endregion
|
|
491
|
-
export { ALPHA_NUDGE_STEP, ContrastLawError, GLASS_BACKGROUNDS, GRADIENT_ANGLE, MAX_NUDGE, NUDGE_STEP, auditGlassPairings, auditGradientPairings, auditPairings, generateAllRamps, generateRamps, measurePairing, pairingPasses, ratioOn, resolveColors, resolveGradients, resolveMaterialSurface, resolveModeColors, resolveModeGradients };
|
|
508
|
+
export { ALPHA_NUDGE_STEP, ContrastLawError, GLASS_BACKGROUNDS, GRADIENT_ANGLE, MAX_NUDGE, NUDGE_STEP, auditGlassPairings, auditGradientPairings, auditPairings, generateAllRamps, generateRamps, measurePairing, oklchOf, pairingPasses, ratioOn, resolveColors, resolveGradients, resolveMaterialSurface, resolveModeColors, resolveModeGradients };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DENSITIES, MOTION_TEMPERAMENTS, hasTexture } from "./axes.js";
|
|
2
|
-
import {
|
|
2
|
+
import { fontSlot } from "./seeds.js";
|
|
3
|
+
import { DISPLAY_STEPS, HEADING_TEXT_STEPS, SPACE_STEPS, TEXT_STEPS } from "./tokens.js";
|
|
3
4
|
import { minSizeForWeight } from "./pairings.js";
|
|
4
5
|
import { cssVar } from "./css-vars.js";
|
|
5
6
|
import { PLATFORM_FLOORS } from "./platforms.js";
|
|
@@ -132,13 +133,14 @@ function deriveTextScale(axes, override = void 0) {
|
|
|
132
133
|
if (step === "xl") return xlWeight(px, titleWeight);
|
|
133
134
|
return personality.bodyWeight;
|
|
134
135
|
};
|
|
136
|
+
const headings = HEADING_TEXT_STEPS;
|
|
135
137
|
const entries = TEXT_STEPS.map((step, index) => {
|
|
136
138
|
const px = (step === "sm" ? override?.sm : step === "xs" ? override?.xs : void 0) ?? typeSizePx(index - baseIndex, ratio, base);
|
|
137
139
|
return [step, {
|
|
138
140
|
size: rem(px),
|
|
139
141
|
lineHeight: LINE_HEIGHTS[step],
|
|
140
142
|
weight: weightFor(step, px),
|
|
141
|
-
family: "body",
|
|
143
|
+
family: headings.includes(step) ? "heading" : "body",
|
|
142
144
|
tracking: trackingFor(px, personality)
|
|
143
145
|
}];
|
|
144
146
|
});
|
|
@@ -998,17 +1000,22 @@ var FALLBACK_STACKS = {
|
|
|
998
1000
|
* Apps load the webfonts. The library never bundles them.
|
|
999
1001
|
*/
|
|
1000
1002
|
function deriveFontStacks(axes, seeds) {
|
|
1001
|
-
const stack = (role) => `${quote(seeds.fonts
|
|
1003
|
+
const stack = (role) => `${quote(fontSlot(seeds.fonts, role).family)}, ${FALLBACK_STACKS[fontFallbackClass(axes, seeds, role)]}`;
|
|
1002
1004
|
return {
|
|
1003
1005
|
body: stack("body"),
|
|
1004
1006
|
display: stack("display"),
|
|
1005
|
-
mono: stack("mono")
|
|
1007
|
+
mono: stack("mono"),
|
|
1008
|
+
heading: stack("heading")
|
|
1006
1009
|
};
|
|
1007
1010
|
}
|
|
1008
|
-
/**
|
|
1011
|
+
/**
|
|
1012
|
+
* A slot's fallback class: the seeded one, else the personality's, and always
|
|
1013
|
+
* mono for mono. A heading slot the system leaves out is the body slot, its
|
|
1014
|
+
* class included, so its stack is the body's.
|
|
1015
|
+
*/
|
|
1009
1016
|
function fontFallbackClass(axes, seeds, role) {
|
|
1010
1017
|
const byPersonality = axes.typePersonality === "editorial" ? "serif" : "sans";
|
|
1011
|
-
return seeds.fonts
|
|
1018
|
+
return fontSlot(seeds.fonts, role).fallback ?? (role === "mono" ? "mono" : byPersonality);
|
|
1012
1019
|
}
|
|
1013
1020
|
function deriveNonColorTokens(axes, displayStyle = "normal", overrides = {}) {
|
|
1014
1021
|
const text = deriveTextScale(axes, overrides.type);
|
|
@@ -232,7 +232,7 @@ function emitThemeCSS(theme, options = {}) {
|
|
|
232
232
|
const texturePerMode = theme.tokens.texture.page.light !== theme.tokens.texture.page.dark;
|
|
233
233
|
const base = [
|
|
234
234
|
...EXPOSED_AXES.map((axis) => declare(`axis.${axis}`, theme.axes[axis])),
|
|
235
|
-
...FONT_ROLES.map((role) => declare(`font.${role}`, role
|
|
235
|
+
...FONT_ROLES.map((role) => declare(`font.${role}`, role !== "body" && role !== "mono" && theme.fonts[role] === theme.fonts.body ? `var(${cssVarName("font.body")})` : theme.fonts[role])),
|
|
236
236
|
...TEXT_STEPS.flatMap((step) => typeDeclarations("text", step, theme.tokens.text[step])),
|
|
237
237
|
declare("text.entry.size", theme.tokens.textEntry.size),
|
|
238
238
|
declare("text.entry.lineHeight", theme.tokens.textEntry.lineHeight),
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { DATA_ATTRS } from "./css-vars.js";
|
|
2
|
+
//#region ../theme/src/runtime.ts
|
|
3
|
+
/**
|
|
4
|
+
* The only module in `@polymorph/theme` that touches the DOM (asserted by
|
|
5
|
+
* `runtime.test.ts`). It sets attributes on `<html>` and puts `<style>` in
|
|
6
|
+
* `<head>`, so switching a pairing is a CSS scope change, not a React render.
|
|
7
|
+
*/
|
|
8
|
+
var STORAGE_KEYS = {
|
|
9
|
+
system: "pm-system",
|
|
10
|
+
palette: "pm-palette",
|
|
11
|
+
mode: "pm-mode",
|
|
12
|
+
density: "pm-density",
|
|
13
|
+
motion: "pm-motion"
|
|
14
|
+
};
|
|
15
|
+
var DARK_QUERY = "(prefers-color-scheme: dark)";
|
|
16
|
+
/**
|
|
17
|
+
* The pre-paint script, with `unstored` as the expression for the preference
|
|
18
|
+
* of a reader who stored none, after the declarations in `declare`.
|
|
19
|
+
*/
|
|
20
|
+
var prepaint = (unstored, declare = "") => `(function(){try{var d=document.documentElement,s=localStorage,a=function(k,v){d.setAttribute(k,v)},t=s.getItem('${STORAGE_KEYS.system}'),p=s.getItem('${STORAGE_KEYS.palette}'),` + declare + `m=s.getItem('${STORAGE_KEYS.mode}')||${unstored},y=s.getItem('${STORAGE_KEYS.density}'),o=s.getItem('${STORAGE_KEYS.motion}');if(t)a('${DATA_ATTRS.system}',t);if(p)a('${DATA_ATTRS.palette}',p);a('${DATA_ATTRS.mode}',m==='system'?(matchMedia('${DARK_QUERY}').matches?'dark':'light'):m);if(y)a('${DATA_ATTRS.density}',y);if(o)a('${DATA_ATTRS.motion}',o)}catch(e){}})()`;
|
|
21
|
+
/**
|
|
22
|
+
* Inline this in `<head>`, before any stylesheet, to apply the stored pairing
|
|
23
|
+
* and mode before first paint. Built from the constants above, so keys and
|
|
24
|
+
* attributes match.
|
|
25
|
+
*
|
|
26
|
+
* Under 500 bytes (asserted in tests), a one-liner that never throws, because
|
|
27
|
+
* it blocks parsing. It applies `pm-system`/`pm-palette` if present and **does
|
|
28
|
+
* no migration**: a legacy visitor sees the fallback until hydration migrates
|
|
29
|
+
* them, which keeps the script simple.
|
|
30
|
+
*
|
|
31
|
+
* It knows no system, so a reader who stored no mode follows the device. A
|
|
32
|
+
* page whose systems open in `light` or `dark` inlines `prepaintScript` instead.
|
|
33
|
+
*
|
|
34
|
+
* The call that builds it is marked pure, so a bundler drops the script from
|
|
35
|
+
* an application that does not inline it. Unmarked, a call is kept, and every
|
|
36
|
+
* application that imports the runtime would carry the script's text.
|
|
37
|
+
*/
|
|
38
|
+
var PREPAINT_SCRIPT = /* @__PURE__ */ prepaint(`'system'`);
|
|
39
|
+
/**
|
|
40
|
+
* The pre-paint script for a page that knows its systems' default modes. With
|
|
41
|
+
* nothing stored it applies the mode hydration applies: the worn system's
|
|
42
|
+
* default, where the worn system is the stored one, else `<html data-system>`
|
|
43
|
+
* as the page's markup writes it, else `system`. So a page whose system opens
|
|
44
|
+
* dark is dark from the first paint.
|
|
45
|
+
*
|
|
46
|
+
* It is `PREPAINT_SCRIPT` when no system's default is `light` or `dark`. Each
|
|
47
|
+
* such system adds its name and mode to the script, which blocks parsing, so
|
|
48
|
+
* `runtime.test.ts` holds the script built for the house catalogue to a budget
|
|
49
|
+
* of its own.
|
|
50
|
+
*/
|
|
51
|
+
function prepaintScript(options = {}) {
|
|
52
|
+
const fixed = Object.entries(options.modes ?? {}).filter(([, mode]) => mode === "light" || mode === "dark").sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
53
|
+
if (fixed.length === 0) return PREPAINT_SCRIPT;
|
|
54
|
+
const literal = (value) => JSON.stringify(value).replace(/</g, "\\u003c");
|
|
55
|
+
return prepaint(`M.hasOwnProperty(n)&&M[n]||'system'`, `n=${`t||d.getAttribute('${DATA_ATTRS.system}')` + (options.system === void 0 ? "" : `||${literal(options.system)}`)},M=${literal(Object.fromEntries(fixed))},`);
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
export { DATA_ATTRS, PREPAINT_SCRIPT, STORAGE_KEYS, prepaintScript };
|
|
@@ -25,10 +25,15 @@ var CHROMA_BUDGETS = [
|
|
|
25
25
|
"high"
|
|
26
26
|
];
|
|
27
27
|
var chromaBudgetSchema = z.enum(CHROMA_BUDGETS);
|
|
28
|
+
/**
|
|
29
|
+
* The font roles. `heading` is last because a system file may leave it out:
|
|
30
|
+
* the heading steps then draw in the body slot (`fontSlot`).
|
|
31
|
+
*/
|
|
28
32
|
var FONT_ROLES = [
|
|
29
33
|
"body",
|
|
30
34
|
"display",
|
|
31
|
-
"mono"
|
|
35
|
+
"mono",
|
|
36
|
+
"heading"
|
|
32
37
|
];
|
|
33
38
|
/**
|
|
34
39
|
* Neutrals carry a trace of the accent hue (`docs/theming.md`), at most 3%
|
|
@@ -54,16 +59,30 @@ var fontSpecSchema = z.strictObject({
|
|
|
54
59
|
/**
|
|
55
60
|
* The slot's font-style, a property of the chosen face like its fallback
|
|
56
61
|
* class. Only the display derivation reads it. Body and mono stay upright by
|
|
57
|
-
* convention, not by schema.
|
|
62
|
+
* convention, not by schema, and so does the heading slot.
|
|
58
63
|
*/
|
|
59
64
|
style: z.enum(["normal", "italic"]).optional()
|
|
60
65
|
});
|
|
61
66
|
var fontFamiliesSchema = z.strictObject({
|
|
62
67
|
body: fontSpecSchema,
|
|
63
68
|
display: fontSpecSchema,
|
|
64
|
-
mono: fontSpecSchema
|
|
69
|
+
mono: fontSpecSchema,
|
|
70
|
+
/**
|
|
71
|
+
* The face of the heading steps (`HEADING_TEXT_STEPS`). Optional: a system
|
|
72
|
+
* that leaves it out draws its headings in the body slot, so every system
|
|
73
|
+
* file written without it resolves to the type it had.
|
|
74
|
+
*/
|
|
75
|
+
heading: fontSpecSchema.optional()
|
|
65
76
|
});
|
|
66
77
|
/**
|
|
78
|
+
* The slot a role draws in: the one the system file states, and for a
|
|
79
|
+
* `heading` it leaves out, the body slot. Every reader of a role goes through
|
|
80
|
+
* it, so an absent heading slot is the body slot everywhere.
|
|
81
|
+
*/
|
|
82
|
+
function fontSlot(fonts, role) {
|
|
83
|
+
return role === "heading" ? fonts.heading ?? fonts.body : fonts[role];
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
67
86
|
* Exported because a palette seeds three hues and a pairing's seeds are the
|
|
68
87
|
* palette's fields plus the system's fonts, so both schemas share it.
|
|
69
88
|
*/
|
|
@@ -126,6 +145,13 @@ var ringPinSchema = z.string().refine((value) => {
|
|
|
126
145
|
match[3]
|
|
127
146
|
].every((channel) => Number(channel) <= 255);
|
|
128
147
|
}, "the pinned ring is #rrggbb, or rgb(r g b / a) with channels 0–255 and alpha below 1 to two decimals");
|
|
148
|
+
/**
|
|
149
|
+
* Whether a text is a colour as a palette writes one: `#rrggbb`, or the
|
|
150
|
+
* ring's `rgb(r g b / a)`. The ring's schema is the widest a pin takes.
|
|
151
|
+
*/
|
|
152
|
+
function isPinColor(value) {
|
|
153
|
+
return ringPinSchema.safeParse(value).success;
|
|
154
|
+
}
|
|
129
155
|
var modePinsSchema = z.strictObject({
|
|
130
156
|
"accent.bg": opaquePinSchema.optional(),
|
|
131
157
|
"accent.bgHover": opaquePinSchema.optional(),
|
|
@@ -268,4 +294,4 @@ function fontPackage(family) {
|
|
|
268
294
|
return `${variable ? "@fontsource-variable" : "@fontsource"}/${slug}`;
|
|
269
295
|
}
|
|
270
296
|
//#endregion
|
|
271
|
-
export { CHROMA_BUDGETS, CHROMA_BUDGET_PEAK, FALLBACK_CLASSES, FONT_ROLES, GRADIENT_PINS, GRADIENT_STOP_PINS, MAX_NEUTRAL_TINT, PIN_ROLES, STATUS_CHROMA_FLOOR, chromaBudgetSchema, fontFamiliesSchema, fontPackage, fontSpecSchema, gradientPinFault, gradientStopPin, hasGradient, hueSchema, modePinsSchema, neutralHueOf, neutralTintSchema, pinnedColor, pinsSchema, statusPeakOf };
|
|
297
|
+
export { CHROMA_BUDGETS, CHROMA_BUDGET_PEAK, FALLBACK_CLASSES, FONT_ROLES, GRADIENT_PINS, GRADIENT_STOP_PINS, MAX_NEUTRAL_TINT, PIN_ROLES, STATUS_CHROMA_FLOOR, chromaBudgetSchema, fontFamiliesSchema, fontPackage, fontSlot, fontSpecSchema, gradientPinFault, gradientStopPin, hasGradient, hueSchema, isPinColor, modePinsSchema, neutralHueOf, neutralTintSchema, pinnedColor, pinsSchema, statusPeakOf };
|
|
@@ -12,7 +12,7 @@ import { z } from "zod";
|
|
|
12
12
|
* `resolveTheme` takes axes and seeds as independent inputs, and the files keep
|
|
13
13
|
* them separate:
|
|
14
14
|
*
|
|
15
|
-
* - A **system** holds the structure: the eight axes, the
|
|
15
|
+
* - A **system** holds the structure: the eight axes, the font slots and
|
|
16
16
|
* the presentation defaults. Of colour, it sets only a `defaultPalette`.
|
|
17
17
|
* - A **palette** holds the colour and belongs to no system. Every palette is
|
|
18
18
|
* lawful on every system, so any cross-pairing is safe.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FONT_ROLES } from "./seeds.js";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
//#region ../theme/src/tokens.ts
|
|
3
4
|
/**
|
|
@@ -30,6 +31,18 @@ var TEXT_STEPS = [
|
|
|
30
31
|
"2xl",
|
|
31
32
|
"3xl"
|
|
32
33
|
];
|
|
34
|
+
/**
|
|
35
|
+
* The text steps drawn in the heading slot: the steps the type-usage table
|
|
36
|
+
* gives headings and titles (`design/components/README.md`), from Heading's
|
|
37
|
+
* level 3 at `lg` to a Stat's value at `3xl`. The steps under them are body
|
|
38
|
+
* sizes and draw in the body slot.
|
|
39
|
+
*/
|
|
40
|
+
var HEADING_TEXT_STEPS = [
|
|
41
|
+
"lg",
|
|
42
|
+
"xl",
|
|
43
|
+
"2xl",
|
|
44
|
+
"3xl"
|
|
45
|
+
];
|
|
33
46
|
var DISPLAY_STEPS = [
|
|
34
47
|
"sm",
|
|
35
48
|
"md",
|
|
@@ -165,14 +178,10 @@ z.strictObject({
|
|
|
165
178
|
size: z.string().min(1),
|
|
166
179
|
lineHeight: z.number().positive(),
|
|
167
180
|
weight: z.number().int().min(1).max(1e3),
|
|
168
|
-
family: z.enum(
|
|
169
|
-
"body",
|
|
170
|
-
"display",
|
|
171
|
-
"mono"
|
|
172
|
-
]),
|
|
181
|
+
family: z.enum(FONT_ROLES),
|
|
173
182
|
tracking: z.string().min(1)
|
|
174
183
|
});
|
|
175
184
|
/** Ambient loops a component may run; periods scale inversely. */
|
|
176
185
|
var AMBIENT_ROLES = ["shimmer", "spin"];
|
|
177
186
|
//#endregion
|
|
178
|
-
export { AMBIENT_ROLES, DISPLAY_STEPS, DURATION_ROLES, FIELD_FOCUS_STYLES, GLOW_STEPS, ICON_SIZES, INSET_ASSIGNMENT_CLASSES, NUMERIC_ALIGNS, RADIUS_ASSIGNMENT_CLASSES, RADIUS_STEPS, SHADOW_ASSIGNMENT_CLASSES, SHADOW_STEPS, SPACE_STEPS, SPRING_ROLES, TEXT_STEPS, UNFILLED_HOVERS, Z_STEPS };
|
|
187
|
+
export { AMBIENT_ROLES, DISPLAY_STEPS, DURATION_ROLES, FIELD_FOCUS_STYLES, GLOW_STEPS, HEADING_TEXT_STEPS, ICON_SIZES, INSET_ASSIGNMENT_CLASSES, NUMERIC_ALIGNS, RADIUS_ASSIGNMENT_CLASSES, RADIUS_STEPS, SHADOW_ASSIGNMENT_CLASSES, SHADOW_STEPS, SPACE_STEPS, SPRING_ROLES, TEXT_STEPS, UNFILLED_HOVERS, Z_STEPS };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
/**
|
|
3
|
-
* A side pane
|
|
3
|
+
* A side pane for one artifact a turn produced (`design/components/artifact-pane.md`).
|
|
4
4
|
*
|
|
5
5
|
* Generated by `pnpm shells` from `packages/shells/src/members/artifact-pane.ts`, the member's
|
|
6
6
|
* framework-neutral description. Never edit it by hand: change the description and
|
|
@@ -49,6 +49,11 @@ export interface ArtifactPaneProps {
|
|
|
49
49
|
* Whether the artifact is still being written, which shows a spinner and sets `aria-busy`.
|
|
50
50
|
*/
|
|
51
51
|
streaming?: boolean
|
|
52
|
+
/**
|
|
53
|
+
* The status announced while streaming (default `{title}: still being written`), which apps
|
|
54
|
+
* pass to localize.
|
|
55
|
+
*/
|
|
56
|
+
streamingLabel?: string
|
|
52
57
|
/**
|
|
53
58
|
* The artifact's name, used as the pane's heading and accessible name.
|
|
54
59
|
*/
|
|
@@ -176,7 +181,11 @@ onBeforeUnmount(() => release3?.())
|
|
|
176
181
|
>
|
|
177
182
|
<header :class="styles.header">
|
|
178
183
|
<span :class="styles.mark">
|
|
179
|
-
<Spinner
|
|
184
|
+
<Spinner
|
|
185
|
+
v-if="streaming"
|
|
186
|
+
size="sm"
|
|
187
|
+
:label="streamingLabel ?? `${title}: still being written`"
|
|
188
|
+
/>
|
|
180
189
|
<Icon v-else :name="mark" size="sm" />
|
|
181
190
|
</span>
|
|
182
191
|
<div :class="styles.heading">
|
|
@@ -251,7 +251,9 @@ const active = computed(() =>
|
|
|
251
251
|
)
|
|
252
252
|
const listId = computed(() => `${uid}-suggestions`)
|
|
253
253
|
const say = computed(() => ({
|
|
254
|
-
suggestions:
|
|
254
|
+
suggestions:
|
|
255
|
+
props.messages.suggestions ??
|
|
256
|
+
((count: number) => (count === 1 ? '1 suggestion' : `${count} suggestions`)),
|
|
255
257
|
loadingSuggestions: props.messages.loadingSuggestions ?? 'Loading suggestions…',
|
|
256
258
|
noSuggestions: props.messages.noSuggestions ?? 'No results',
|
|
257
259
|
}))
|
|
@@ -60,11 +60,14 @@ defineSlots<{
|
|
|
60
60
|
:numeric="stat.numeric"
|
|
61
61
|
:icon="stat.icon"
|
|
62
62
|
:delta="stat.delta"
|
|
63
|
+
:deltaLabel="stat.deltaLabel"
|
|
63
64
|
:trend="stat.trend"
|
|
64
65
|
:spark="stat.spark"
|
|
65
66
|
:sparkLabel="stat.sparkLabel"
|
|
66
67
|
:description="stat.description"
|
|
67
68
|
:footer="stat.footer"
|
|
69
|
+
:loading="stat.loading"
|
|
70
|
+
:loadingLabel="stat.loadingLabel"
|
|
68
71
|
/>
|
|
69
72
|
</Card>
|
|
70
73
|
</template>
|