@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Filtered multiple choice (`design/components/multi-select.md`).
|
|
3
3
|
*
|
|
4
4
|
* Generated by `pnpm shells` from `packages/shells/src/members/multi-select.ts`, the member's
|
|
5
5
|
* framework-neutral description. Never edit it by hand: change the description and
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
composingKey,
|
|
21
21
|
derived,
|
|
22
22
|
elementRef,
|
|
23
|
+
fieldLabelIds,
|
|
23
24
|
fieldValue,
|
|
24
25
|
holdFieldEscape,
|
|
25
26
|
lineStartKey,
|
|
@@ -64,7 +65,7 @@ export interface MultiSelectMessages {
|
|
|
64
65
|
options?: (count: number) => string
|
|
65
66
|
}
|
|
66
67
|
|
|
67
|
-
/**
|
|
68
|
+
/** Filtered multiple choice: the inputs it takes, by the React member's prop names. */
|
|
68
69
|
export interface MultiSelectProps {
|
|
69
70
|
/**
|
|
70
71
|
* Allows values outside `options` (the spec's boundary with TagInput). Typed text that matches
|
|
@@ -154,7 +155,7 @@ export interface MultiSelectProps {
|
|
|
154
155
|
value?: string[]
|
|
155
156
|
}
|
|
156
157
|
|
|
157
|
-
/**
|
|
158
|
+
/** Filtered multiple choice. */
|
|
158
159
|
@Component({
|
|
159
160
|
selector: 'pm-multi-select',
|
|
160
161
|
encapsulation: ViewEncapsulation.None,
|
|
@@ -523,6 +524,7 @@ export class MultiSelect {
|
|
|
523
524
|
protected readonly announcement = cell(() => '')
|
|
524
525
|
protected readonly loadMoreAt = cell(() => -1)
|
|
525
526
|
protected readonly settled = cell(() => false)
|
|
527
|
+
protected readonly fieldLabels = cell(() => undefined as string | undefined)
|
|
526
528
|
protected readonly chipList = elementRef<HTMLElement>()
|
|
527
529
|
protected readonly frame = elementRef<HTMLElement>()
|
|
528
530
|
protected readonly list = elementRef<HTMLElement>()
|
|
@@ -545,12 +547,15 @@ export class MultiSelect {
|
|
|
545
547
|
showOptions: 'Show options',
|
|
546
548
|
remove: (label: string) => `Remove ${label}`,
|
|
547
549
|
loadingOptions: 'Loading options…',
|
|
548
|
-
options: (count: number) => `${count} options
|
|
550
|
+
options: (count: number) => (count === 1 ? '1 option' : `${count} options`),
|
|
549
551
|
...this.$p.messages,
|
|
550
552
|
}))
|
|
551
553
|
protected readonly atMax = derived(
|
|
552
554
|
() => this.$p.max !== undefined && this.values.value.length >= this.$p.max,
|
|
553
555
|
)
|
|
556
|
+
protected readonly unnamed = derived(
|
|
557
|
+
() => this.$p['aria-label'] === undefined && this.$p['aria-labelledby'] === undefined,
|
|
558
|
+
)
|
|
554
559
|
protected readonly countId = derived(() => `${this.uid}-count`)
|
|
555
560
|
protected readonly labels = derived(
|
|
556
561
|
() => new Map(this.$p.options.map((option) => [option.value, option.label] as const)),
|
|
@@ -663,7 +668,26 @@ export class MultiSelect {
|
|
|
663
668
|
protected readonly documentDirection = useDirection(() => this.frame.value)
|
|
664
669
|
protected readonly service: { readonly value: zag.Service } = setup(() =>
|
|
665
670
|
useMachine(
|
|
666
|
-
|
|
671
|
+
{
|
|
672
|
+
...zag.machine,
|
|
673
|
+
implementations: {
|
|
674
|
+
...zag.machine.implementations,
|
|
675
|
+
actions: {
|
|
676
|
+
...zag.machine.implementations?.actions,
|
|
677
|
+
announceHighlightedItem: (params) =>
|
|
678
|
+
zag.machine.implementations?.actions?.announceHighlightedItem?.({
|
|
679
|
+
...params,
|
|
680
|
+
context: {
|
|
681
|
+
...params.context,
|
|
682
|
+
get: ((name: string) =>
|
|
683
|
+
name === 'value'
|
|
684
|
+
? []
|
|
685
|
+
: params.context.get(name as never)) as typeof params.context.get,
|
|
686
|
+
},
|
|
687
|
+
}),
|
|
688
|
+
},
|
|
689
|
+
},
|
|
690
|
+
} as typeof zag.machine,
|
|
667
691
|
() =>
|
|
668
692
|
({
|
|
669
693
|
id: this.uid,
|
|
@@ -879,7 +903,7 @@ export class MultiSelect {
|
|
|
879
903
|
),
|
|
880
904
|
)
|
|
881
905
|
private release2: (() => void) | undefined
|
|
882
|
-
private
|
|
906
|
+
private release7: (() => void) | undefined
|
|
883
907
|
|
|
884
908
|
constructor() {
|
|
885
909
|
mountEffect(() => this.effect1())
|
|
@@ -904,8 +928,13 @@ export class MultiSelect {
|
|
|
904
928
|
() => this.effect5(),
|
|
905
929
|
true,
|
|
906
930
|
)
|
|
907
|
-
|
|
908
|
-
|
|
931
|
+
watchEffect(
|
|
932
|
+
() => this.api.value.open && this.unnamed.value,
|
|
933
|
+
() => this.effect6(),
|
|
934
|
+
true,
|
|
935
|
+
)
|
|
936
|
+
inject(DestroyRef).onDestroy(() => this.release7?.())
|
|
937
|
+
mountEffect(() => this.effect7())
|
|
909
938
|
}
|
|
910
939
|
|
|
911
940
|
protected e1() {
|
|
@@ -1171,7 +1200,7 @@ export class MultiSelect {
|
|
|
1171
1200
|
class: styles.listbox,
|
|
1172
1201
|
hidden: undefined,
|
|
1173
1202
|
'aria-label': this.$p['aria-labelledby'] === undefined ? this.$p['aria-label'] : undefined,
|
|
1174
|
-
'aria-labelledby': this.$p['aria-labelledby'],
|
|
1203
|
+
'aria-labelledby': this.unnamed.value ? this.fieldLabels.value : this.$p['aria-labelledby'],
|
|
1175
1204
|
onScroll: () => this.h9(),
|
|
1176
1205
|
})
|
|
1177
1206
|
}
|
|
@@ -1359,7 +1388,7 @@ export class MultiSelect {
|
|
|
1359
1388
|
class: styles.listbox,
|
|
1360
1389
|
hidden: undefined,
|
|
1361
1390
|
'aria-label': this.$p['aria-labelledby'] === undefined ? this.$p['aria-label'] : undefined,
|
|
1362
|
-
'aria-labelledby': this.$p['aria-labelledby'],
|
|
1391
|
+
'aria-labelledby': this.unnamed.value ? this.fieldLabels.value : this.$p['aria-labelledby'],
|
|
1363
1392
|
onScroll: () => this.h10(),
|
|
1364
1393
|
})
|
|
1365
1394
|
}
|
|
@@ -1521,7 +1550,15 @@ export class MultiSelect {
|
|
|
1521
1550
|
}
|
|
1522
1551
|
|
|
1523
1552
|
private effect6(): void {
|
|
1524
|
-
|
|
1553
|
+
void (
|
|
1554
|
+
this.api.value.open &&
|
|
1555
|
+
this.unnamed.value &&
|
|
1556
|
+
(this.fieldLabels.value = fieldLabelIds(this.textField.value, this.uid))
|
|
1557
|
+
)
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
private effect7(): void {
|
|
1561
|
+
this.release7?.()
|
|
1525
1562
|
const ran = agentMember({
|
|
1526
1563
|
member: 'MultiSelect',
|
|
1527
1564
|
element: () => this.textField.value,
|
|
@@ -1573,7 +1610,7 @@ export class MultiSelect {
|
|
|
1573
1610
|
close: () => this.api.value.setOpen(false),
|
|
1574
1611
|
},
|
|
1575
1612
|
})
|
|
1576
|
-
this.
|
|
1613
|
+
this.release7 = () => {
|
|
1577
1614
|
ran()
|
|
1578
1615
|
}
|
|
1579
1616
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A field that
|
|
2
|
+
* A number field that formats and steps (`design/components/number-input.md`).
|
|
3
3
|
*
|
|
4
4
|
* Generated by `pnpm shells` from `packages/shells/src/members/number-input.ts`, the member's
|
|
5
5
|
* framework-neutral description. Never edit it by hand: change the description and
|
|
@@ -39,7 +39,12 @@ export interface NumberFormat {
|
|
|
39
39
|
maximumFractionDigits?: number
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
export interface NumberInputMessages {
|
|
43
|
+
increment?: string
|
|
44
|
+
decrement?: string
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** A number field that formats and steps: the inputs it takes, by the React member's prop names. */
|
|
43
48
|
export interface NumberInputProps {
|
|
44
49
|
'aria-describedby'?: string
|
|
45
50
|
/**
|
|
@@ -59,6 +64,10 @@ export interface NumberInputProps {
|
|
|
59
64
|
id?: string
|
|
60
65
|
invalid?: boolean
|
|
61
66
|
max?: number
|
|
67
|
+
/**
|
|
68
|
+
* The steppers' names in the host's words.
|
|
69
|
+
*/
|
|
70
|
+
messages?: NumberInputMessages
|
|
62
71
|
/**
|
|
63
72
|
* Typed values are clamped at commit. The steppers snap to the step and stop at the limits.
|
|
64
73
|
*/
|
|
@@ -86,7 +95,7 @@ export interface NumberInputProps {
|
|
|
86
95
|
value?: number | null
|
|
87
96
|
}
|
|
88
97
|
|
|
89
|
-
/** A field that
|
|
98
|
+
/** A number field that formats and steps. */
|
|
90
99
|
@Component({
|
|
91
100
|
selector: 'pm-number-input',
|
|
92
101
|
encapsulation: ViewEncapsulation.None,
|
|
@@ -170,6 +179,10 @@ export class NumberInput {
|
|
|
170
179
|
transform: (value: NumberInputProps['invalid']) => (value === undefined ? false : value),
|
|
171
180
|
})
|
|
172
181
|
readonly max = input<NumberInputProps['max']>(undefined)
|
|
182
|
+
/**
|
|
183
|
+
* The steppers' names in the host's words.
|
|
184
|
+
*/
|
|
185
|
+
readonly messages = input<NumberInputProps['messages']>(undefined)
|
|
173
186
|
/**
|
|
174
187
|
* Typed values are clamped at commit. The steppers snap to the step and stop at the limits.
|
|
175
188
|
*/
|
|
@@ -225,6 +238,7 @@ export class NumberInput {
|
|
|
225
238
|
id: () => this.id(),
|
|
226
239
|
invalid: () => this.invalid(),
|
|
227
240
|
max: () => this.max(),
|
|
241
|
+
messages: () => this.messages(),
|
|
228
242
|
min: () => this.min(),
|
|
229
243
|
name: () => this.name(),
|
|
230
244
|
placeholder: () => this.placeholder(),
|
|
@@ -243,6 +257,11 @@ export class NumberInput {
|
|
|
243
257
|
)
|
|
244
258
|
protected readonly draft = cell(() => '')
|
|
245
259
|
protected readonly control = elementRef<HTMLElement>()
|
|
260
|
+
protected readonly say = derived(() => ({
|
|
261
|
+
increment: 'increment value',
|
|
262
|
+
decrement: 'decrease value',
|
|
263
|
+
...this.$p.messages,
|
|
264
|
+
}))
|
|
246
265
|
protected readonly documentDirection = useDirection(() => this.control.value)
|
|
247
266
|
protected readonly service: { readonly value: zag.Service } = setup(() =>
|
|
248
267
|
useMachine(
|
|
@@ -267,6 +286,10 @@ export class NumberInput {
|
|
|
267
286
|
required: this.$p['aria-required'],
|
|
268
287
|
allowMouseWheel: false,
|
|
269
288
|
ids: this.$p.id === undefined ? undefined : { input: this.$p.id },
|
|
289
|
+
translations: {
|
|
290
|
+
incrementLabel: this.say.value.increment,
|
|
291
|
+
decrementLabel: this.say.value.decrement,
|
|
292
|
+
},
|
|
270
293
|
onValueChange: (details) => {
|
|
271
294
|
void (this.service.value.event.current().type === 'INPUT.CHANGE'
|
|
272
295
|
? (this.draft.value = details.value)
|
|
@@ -361,6 +384,7 @@ export class NumberInput {
|
|
|
361
384
|
name: undefined,
|
|
362
385
|
placeholder: this.$p.placeholder,
|
|
363
386
|
role: undefined,
|
|
387
|
+
'aria-roledescription': undefined,
|
|
364
388
|
'aria-valuemin': undefined,
|
|
365
389
|
'aria-valuemax': undefined,
|
|
366
390
|
'aria-valuenow': undefined,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A phone number
|
|
2
|
+
* A phone number as one E.164 string (`design/components/phone-input.md`).
|
|
3
3
|
*
|
|
4
4
|
* Generated by `pnpm shells` from `packages/shells/src/members/phone-input.ts`, the member's
|
|
5
5
|
* framework-neutral description. Never edit it by hand: change the description and
|
|
@@ -42,7 +42,7 @@ export interface PhoneInputMessages {
|
|
|
42
42
|
noCountry?: string
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
/** A phone number
|
|
45
|
+
/** A phone number as one E.164 string: the inputs it takes, by the React member's prop names. */
|
|
46
46
|
export interface PhoneInputProps {
|
|
47
47
|
'aria-describedby'?: string
|
|
48
48
|
/**
|
|
@@ -91,7 +91,7 @@ export interface PhoneInputProps {
|
|
|
91
91
|
value?: string
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
/** A phone number
|
|
94
|
+
/** A phone number as one E.164 string. */
|
|
95
95
|
@Component({
|
|
96
96
|
selector: 'pm-phone-input',
|
|
97
97
|
encapsulation: ViewEncapsulation.None,
|
|
@@ -289,7 +289,7 @@ export class PhoneInput {
|
|
|
289
289
|
protected readonly say = derived(() => ({
|
|
290
290
|
country: 'Country calling code',
|
|
291
291
|
showCountries: 'Show countries',
|
|
292
|
-
countriesShown: (count: number) => `${count} countries
|
|
292
|
+
countriesShown: (count: number) => (count === 1 ? '1 country' : `${count} countries`),
|
|
293
293
|
noCountry: 'No matching country',
|
|
294
294
|
...this.$p.messages,
|
|
295
295
|
}))
|
|
@@ -497,7 +497,11 @@ export class PhoneInput {
|
|
|
497
497
|
|
|
498
498
|
protected e27(): ComboboxProps['messages'] {
|
|
499
499
|
if (this.$p.readOnly) return undefined as never
|
|
500
|
-
return {
|
|
500
|
+
return {
|
|
501
|
+
showOptions: this.say.value.showCountries,
|
|
502
|
+
options: this.say.value.countriesShown,
|
|
503
|
+
list: this.say.value.country,
|
|
504
|
+
}
|
|
501
505
|
}
|
|
502
506
|
|
|
503
507
|
protected e28(): ComboboxProps['emptyMessage'] {
|
|
@@ -16,8 +16,10 @@ import {
|
|
|
16
16
|
Ref,
|
|
17
17
|
Spread,
|
|
18
18
|
agentMember,
|
|
19
|
+
cell,
|
|
19
20
|
derived,
|
|
20
21
|
elementRef,
|
|
22
|
+
fieldLabelIds,
|
|
21
23
|
fieldValue,
|
|
22
24
|
followHighlight,
|
|
23
25
|
mergeParts,
|
|
@@ -96,7 +98,10 @@ export interface SelectProps {
|
|
|
96
98
|
presentation?: 'auto' | 'popover'
|
|
97
99
|
size?: 'sm' | 'md' | 'lg'
|
|
98
100
|
/**
|
|
99
|
-
*
|
|
101
|
+
* The chosen option's value. Controlled when given. `null` is nothing chosen: the trigger
|
|
102
|
+
* shows the placeholder, or the empty choice when `emptyOption` is set. A caller clears the
|
|
103
|
+
* choice with `null`, because `undefined` is no value, which hands the choice back to the
|
|
104
|
+
* member.
|
|
100
105
|
*/
|
|
101
106
|
value?: string | null
|
|
102
107
|
}
|
|
@@ -314,7 +319,10 @@ export class Select {
|
|
|
314
319
|
transform: (value: SelectProps['size']) => (value === undefined ? 'md' : value),
|
|
315
320
|
})
|
|
316
321
|
/**
|
|
317
|
-
*
|
|
322
|
+
* The chosen option's value. Controlled when given. `null` is nothing chosen: the trigger
|
|
323
|
+
* shows the placeholder, or the empty choice when `emptyOption` is set. A caller clears the
|
|
324
|
+
* choice with `null`, because `undefined` is no value, which hands the choice back to the
|
|
325
|
+
* member.
|
|
318
326
|
*/
|
|
319
327
|
readonly value = input<SelectProps['value']>(undefined)
|
|
320
328
|
readonly onChange = output<string | null>({ alias: 'change' })
|
|
@@ -341,12 +349,16 @@ export class Select {
|
|
|
341
349
|
})
|
|
342
350
|
protected readonly $p = this.$.props
|
|
343
351
|
protected readonly uid = uniqueId()
|
|
352
|
+
protected readonly fieldLabels = cell(() => undefined as string | undefined)
|
|
344
353
|
protected readonly panel = elementRef<HTMLElement>()
|
|
345
354
|
protected readonly scrim = elementRef<HTMLElement>()
|
|
346
355
|
protected readonly sheetPanel = elementRef<HTMLElement>()
|
|
347
356
|
protected readonly trigger = elementRef<HTMLElement>()
|
|
348
357
|
protected readonly phone = useMediaQuery('phone')
|
|
349
358
|
protected readonly sheeting = derived(() => this.$p.presentation === 'auto' && this.phone())
|
|
359
|
+
protected readonly unnamed = derived(
|
|
360
|
+
() => this.$p['aria-label'] === undefined && this.$p['aria-labelledby'] === undefined,
|
|
361
|
+
)
|
|
350
362
|
protected readonly emptyChoice = derived(() => ({
|
|
351
363
|
value: '__polymorph-empty-choice__',
|
|
352
364
|
label: this.$p.emptyOption ?? '',
|
|
@@ -434,7 +446,7 @@ export class Select {
|
|
|
434
446
|
'dialog.scrim',
|
|
435
447
|
),
|
|
436
448
|
)
|
|
437
|
-
private
|
|
449
|
+
private release5: (() => void) | undefined
|
|
438
450
|
|
|
439
451
|
constructor() {
|
|
440
452
|
watchEffect(
|
|
@@ -452,8 +464,13 @@ export class Select {
|
|
|
452
464
|
() => this.effect3(),
|
|
453
465
|
true,
|
|
454
466
|
)
|
|
455
|
-
|
|
456
|
-
|
|
467
|
+
watchEffect(
|
|
468
|
+
() => this.api.value.open && this.unnamed.value,
|
|
469
|
+
() => this.effect4(),
|
|
470
|
+
true,
|
|
471
|
+
)
|
|
472
|
+
inject(DestroyRef).onDestroy(() => this.release5?.())
|
|
473
|
+
mountEffect(() => this.effect5())
|
|
457
474
|
}
|
|
458
475
|
|
|
459
476
|
protected e1() {
|
|
@@ -539,6 +556,8 @@ export class Select {
|
|
|
539
556
|
'--radix-select-content-transform-origin': 'var(--transform-origin)',
|
|
540
557
|
},
|
|
541
558
|
hidden: undefined,
|
|
559
|
+
'aria-label': this.$p['aria-labelledby'] === undefined ? this.$p['aria-label'] : undefined,
|
|
560
|
+
'aria-labelledby': this.unnamed.value ? this.fieldLabels.value : this.$p['aria-labelledby'],
|
|
542
561
|
'data-size': this.$p.size,
|
|
543
562
|
'data-member': 'select',
|
|
544
563
|
onFocus: () => this.h1(),
|
|
@@ -827,6 +846,8 @@ export class Select {
|
|
|
827
846
|
return mergeParts(this.api.value.getContentProps(), {
|
|
828
847
|
class: styles.sheetList,
|
|
829
848
|
hidden: undefined,
|
|
849
|
+
'aria-label': this.$p['aria-labelledby'] === undefined ? this.$p['aria-label'] : undefined,
|
|
850
|
+
'aria-labelledby': this.unnamed.value ? this.fieldLabels.value : this.$p['aria-labelledby'],
|
|
830
851
|
'data-size': this.$p.size,
|
|
831
852
|
'data-member': 'select',
|
|
832
853
|
onFocus: () => this.h5(),
|
|
@@ -1086,7 +1107,15 @@ export class Select {
|
|
|
1086
1107
|
}
|
|
1087
1108
|
|
|
1088
1109
|
private effect4(): void {
|
|
1089
|
-
|
|
1110
|
+
void (
|
|
1111
|
+
this.api.value.open &&
|
|
1112
|
+
this.unnamed.value &&
|
|
1113
|
+
(this.fieldLabels.value = fieldLabelIds(this.trigger.value, this.uid))
|
|
1114
|
+
)
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
private effect5(): void {
|
|
1118
|
+
this.release5?.()
|
|
1090
1119
|
const ran = agentMember({
|
|
1091
1120
|
member: 'Select',
|
|
1092
1121
|
element: () => this.trigger.value,
|
|
@@ -1117,7 +1146,7 @@ export class Select {
|
|
|
1117
1146
|
close: () => this.api.value.setOpen(false),
|
|
1118
1147
|
},
|
|
1119
1148
|
})
|
|
1120
|
-
this.
|
|
1149
|
+
this.release5 = () => {
|
|
1121
1150
|
ran()
|
|
1122
1151
|
}
|
|
1123
1152
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Free-text
|
|
2
|
+
* Free-text tags (`design/components/tag-input.md`).
|
|
3
3
|
*
|
|
4
4
|
* Generated by `pnpm shells` from `packages/shells/src/members/tag-input.ts`, the member's
|
|
5
5
|
* framework-neutral description. Never edit it by hand: change the description and
|
|
@@ -31,7 +31,11 @@ import { useListPresence } from '@polymorph/angular/motion'
|
|
|
31
31
|
import styles from '@polymorph/recipes/controls/tag-input.module.css'
|
|
32
32
|
import { TagInputChip, type TagInputChipProps } from './TagInputChip'
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
export type TagInputCountLabel = (tags: { count: number; max?: number; atMax: boolean }) => string
|
|
35
|
+
|
|
36
|
+
export type TagInputRemovedLabel = (tag: string, count: number) => string
|
|
37
|
+
|
|
38
|
+
/** Free-text tags: the inputs it takes, by the React member's prop names. */
|
|
35
39
|
export interface TagInputProps {
|
|
36
40
|
'aria-describedby'?: string
|
|
37
41
|
/**
|
|
@@ -40,6 +44,11 @@ export interface TagInputProps {
|
|
|
40
44
|
'aria-label'?: string
|
|
41
45
|
'aria-labelledby'?: string
|
|
42
46
|
'aria-required'?: boolean
|
|
47
|
+
/**
|
|
48
|
+
* The count sentence in the host's words, part of the field's description, the localization
|
|
49
|
+
* seam; the default is `{count} added`, or `Maximum of {max} added` at the maximum.
|
|
50
|
+
*/
|
|
51
|
+
countLabel?: TagInputCountLabel
|
|
43
52
|
defaultValue?: string[]
|
|
44
53
|
disabled?: boolean
|
|
45
54
|
id?: string
|
|
@@ -58,6 +67,11 @@ export interface TagInputProps {
|
|
|
58
67
|
* Shown only while empty. The chips are the value, and a placeholder beside them is clutter.
|
|
59
68
|
*/
|
|
60
69
|
placeholder?: string
|
|
70
|
+
/**
|
|
71
|
+
* What a removal announces in the host's words, the localization seam; the default is `{tag}
|
|
72
|
+
* removed, {count} remain`, and `{tag} removed, 1 remains` when one tag remains.
|
|
73
|
+
*/
|
|
74
|
+
removedLabel?: TagInputRemovedLabel
|
|
61
75
|
/**
|
|
62
76
|
* The accessible name of a chip's remove button. It is a function because the tag is data and
|
|
63
77
|
* the text around it comes from the app's message catalog. Defaults to `Remove {tag}`.
|
|
@@ -73,7 +87,7 @@ export interface TagInputProps {
|
|
|
73
87
|
value?: string[]
|
|
74
88
|
}
|
|
75
89
|
|
|
76
|
-
/** Free-text
|
|
90
|
+
/** Free-text tags. */
|
|
77
91
|
@Component({
|
|
78
92
|
selector: 'pm-tag-input',
|
|
79
93
|
encapsulation: ViewEncapsulation.None,
|
|
@@ -160,6 +174,24 @@ export class TagInput {
|
|
|
160
174
|
readonly ariaRequired = input<TagInputProps['aria-required']>(undefined, {
|
|
161
175
|
alias: 'aria-required',
|
|
162
176
|
})
|
|
177
|
+
/**
|
|
178
|
+
* The count sentence in the host's words, part of the field's description, the localization
|
|
179
|
+
* seam; the default is `{count} added`, or `Maximum of {max} added` at the maximum.
|
|
180
|
+
*/
|
|
181
|
+
readonly countLabel = input<
|
|
182
|
+
Exclude<TagInputProps['countLabel'], undefined>,
|
|
183
|
+
TagInputProps['countLabel']
|
|
184
|
+
>(
|
|
185
|
+
({ count, max, atMax }: Parameters<TagInputCountLabel>[0]) =>
|
|
186
|
+
atMax ? `Maximum of ${max} added` : `${count} added`,
|
|
187
|
+
{
|
|
188
|
+
transform: (value: TagInputProps['countLabel']) =>
|
|
189
|
+
value === undefined
|
|
190
|
+
? ({ count, max, atMax }: Parameters<TagInputCountLabel>[0]) =>
|
|
191
|
+
atMax ? `Maximum of ${max} added` : `${count} added`
|
|
192
|
+
: value,
|
|
193
|
+
},
|
|
194
|
+
)
|
|
163
195
|
readonly defaultValue = input<TagInputProps['defaultValue']>(undefined)
|
|
164
196
|
readonly disabled = input<
|
|
165
197
|
Exclude<TagInputProps['disabled'], undefined>,
|
|
@@ -186,6 +218,24 @@ export class TagInput {
|
|
|
186
218
|
* Shown only while empty. The chips are the value, and a placeholder beside them is clutter.
|
|
187
219
|
*/
|
|
188
220
|
readonly placeholder = input<TagInputProps['placeholder']>(undefined)
|
|
221
|
+
/**
|
|
222
|
+
* What a removal announces in the host's words, the localization seam; the default is `{tag}
|
|
223
|
+
* removed, {count} remain`, and `{tag} removed, 1 remains` when one tag remains.
|
|
224
|
+
*/
|
|
225
|
+
readonly removedLabel = input<
|
|
226
|
+
Exclude<TagInputProps['removedLabel'], undefined>,
|
|
227
|
+
TagInputProps['removedLabel']
|
|
228
|
+
>(
|
|
229
|
+
(tag: string, count: number) =>
|
|
230
|
+
count === 1 ? `${tag} removed, 1 remains` : `${tag} removed, ${count} remain`,
|
|
231
|
+
{
|
|
232
|
+
transform: (value: TagInputProps['removedLabel']) =>
|
|
233
|
+
value === undefined
|
|
234
|
+
? (tag: string, count: number) =>
|
|
235
|
+
count === 1 ? `${tag} removed, 1 remains` : `${tag} removed, ${count} remain`
|
|
236
|
+
: value,
|
|
237
|
+
},
|
|
238
|
+
)
|
|
189
239
|
/**
|
|
190
240
|
* The accessible name of a chip's remove button. It is a function because the tag is data and
|
|
191
241
|
* the text around it comes from the app's message catalog. Defaults to `Remove {tag}`.
|
|
@@ -227,6 +277,7 @@ export class TagInput {
|
|
|
227
277
|
'aria-label': () => this.ariaLabel(),
|
|
228
278
|
'aria-labelledby': () => this.ariaLabelledby(),
|
|
229
279
|
'aria-required': () => this.ariaRequired(),
|
|
280
|
+
countLabel: () => this.countLabel(),
|
|
230
281
|
defaultValue: () => this.defaultValue(),
|
|
231
282
|
disabled: () => this.disabled(),
|
|
232
283
|
id: () => this.id(),
|
|
@@ -234,6 +285,7 @@ export class TagInput {
|
|
|
234
285
|
max: () => this.max(),
|
|
235
286
|
name: () => this.name(),
|
|
236
287
|
placeholder: () => this.placeholder(),
|
|
288
|
+
removedLabel: () => this.removedLabel(),
|
|
237
289
|
removeLabel: () => this.removeLabel(),
|
|
238
290
|
size: () => this.size(),
|
|
239
291
|
validate: () => this.validate(),
|
|
@@ -291,7 +343,7 @@ export class TagInput {
|
|
|
291
343
|
const at = before.indexOf(tag)
|
|
292
344
|
const target = at === -1 || at + 1 >= before.length ? null : this.removeButton.value(at + 1)
|
|
293
345
|
this.commit.value(before.filter((other) => other !== tag))
|
|
294
|
-
this.announcement.value =
|
|
346
|
+
this.announcement.value = this.$p.removedLabel(tag, before.length - 1)
|
|
295
347
|
if (target) target.focus()
|
|
296
348
|
else this.field.value?.focus()
|
|
297
349
|
})
|
|
@@ -529,9 +581,11 @@ export class TagInput {
|
|
|
529
581
|
}
|
|
530
582
|
|
|
531
583
|
protected e29() {
|
|
532
|
-
return this.
|
|
533
|
-
|
|
534
|
-
:
|
|
584
|
+
return this.$p.countLabel({
|
|
585
|
+
count: this.values.value.length,
|
|
586
|
+
max: this.$p.max,
|
|
587
|
+
atMax: this.atMax.value,
|
|
588
|
+
})
|
|
535
589
|
}
|
|
536
590
|
|
|
537
591
|
protected e30() {
|
|
@@ -32,6 +32,10 @@ import {
|
|
|
32
32
|
} from '@polymorph/angular'
|
|
33
33
|
import styles from '@polymorph/recipes/controls/time-input.module.css'
|
|
34
34
|
|
|
35
|
+
export interface TimeInputMessages {
|
|
36
|
+
empty: string
|
|
37
|
+
}
|
|
38
|
+
|
|
35
39
|
/** A segmented time-of-day field with no popup: the inputs it takes, by the React member's prop names. */
|
|
36
40
|
export interface TimeInputProps {
|
|
37
41
|
'aria-describedby'?: string
|
|
@@ -59,6 +63,10 @@ export interface TimeInputProps {
|
|
|
59
63
|
* Sets the segment order, the day period names and the separator.
|
|
60
64
|
*/
|
|
61
65
|
locale?: string
|
|
66
|
+
/**
|
|
67
|
+
* Defaults to generic English (`Empty`). Localized hosts pass strings from their catalog.
|
|
68
|
+
*/
|
|
69
|
+
messages?: TimeInputMessages
|
|
62
70
|
/**
|
|
63
71
|
* Serializes the ISO-8601 time in `Time`'s own format, such as `"09:30:00"`.
|
|
64
72
|
*/
|
|
@@ -189,6 +197,10 @@ export class TimeInput {
|
|
|
189
197
|
* Sets the segment order, the day period names and the separator.
|
|
190
198
|
*/
|
|
191
199
|
readonly locale = input<TimeInputProps['locale']>(undefined)
|
|
200
|
+
/**
|
|
201
|
+
* Defaults to generic English (`Empty`). Localized hosts pass strings from their catalog.
|
|
202
|
+
*/
|
|
203
|
+
readonly messages = input<TimeInputProps['messages']>(undefined)
|
|
192
204
|
/**
|
|
193
205
|
* Serializes the ISO-8601 time in `Time`'s own format, such as `"09:30:00"`.
|
|
194
206
|
*/
|
|
@@ -228,6 +240,7 @@ export class TimeInput {
|
|
|
228
240
|
id: () => this.id(),
|
|
229
241
|
invalid: () => this.invalid(),
|
|
230
242
|
locale: () => this.locale(),
|
|
243
|
+
messages: () => this.messages(),
|
|
231
244
|
name: () => this.name(),
|
|
232
245
|
readOnly: () => this.readOnly(),
|
|
233
246
|
size: () => this.size(),
|
|
@@ -249,6 +262,7 @@ export class TimeInput {
|
|
|
249
262
|
() => (this.$p.value !== undefined ? this.$p.value : this.$p.defaultValue)?.toString() ?? '',
|
|
250
263
|
)
|
|
251
264
|
protected readonly field = elementRef<HTMLElement>()
|
|
265
|
+
protected readonly say = derived(() => this.$p.messages ?? { empty: 'Empty' })
|
|
252
266
|
protected readonly language = derived(
|
|
253
267
|
() => this.$p.locale ?? this.browserLanguage.value ?? 'en-US',
|
|
254
268
|
)
|
|
@@ -494,7 +508,7 @@ export class TimeInput {
|
|
|
494
508
|
|
|
495
509
|
protected e25(segment: Each<ReturnType<TimeInput['e12']>>) {
|
|
496
510
|
if (segment.type === 'literal') return undefined as never
|
|
497
|
-
return segment.placeholder ?
|
|
511
|
+
return segment.placeholder ? this.say.value.empty : segment.text
|
|
498
512
|
}
|
|
499
513
|
|
|
500
514
|
protected e26(segment: Each<ReturnType<TimeInput['e12']>>) {
|