@mkbabb/glass-ui 6.0.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -34
- package/dist/DropdownMenuTrigger-ClIq8RJE.js +93 -0
- package/dist/FeedbackMark-DZq5001h.js +23 -0
- package/dist/Input-9BlLluik.js +77 -0
- package/dist/{PagerDots-BoTQ7g5l.js → PagerDots-BEq0MgtH.js} +85 -81
- package/dist/Surface-kFQeYrYv.js +82 -0
- package/dist/accent-tone-solve-Cw7WkRD9.js +14 -0
- package/dist/animated-digit.js +5 -5
- package/dist/asElement-CRnm6A2v.js +9 -0
- package/dist/aurora.js +831 -776
- package/dist/axes.js +25 -14
- package/dist/badge-u65NClWn.js +62 -0
- package/dist/badge.js +1 -1
- package/dist/blob-config.js +1 -1
- package/dist/blob.js +442 -395
- package/dist/button-Bu9F4uU6.js +98 -0
- package/dist/button.js +2 -2
- package/dist/canvas.js +1 -1
- package/dist/card-Bk96VI2R.js +234 -0
- package/dist/card.js +2 -2
- package/dist/carousel.js +109 -169
- package/dist/chip-DFZQr6rV.js +129 -0
- package/dist/chip.js +2 -81
- package/dist/{class-names-5jotTFzp.js → class-names-Cpy5eaBk.js} +11 -4
- package/dist/collapsible-BAP95XTt.js +154 -0
- package/dist/collapsible.js +1 -1
- package/dist/color.js +46 -50
- package/dist/{procedural-color.wgsl-B9mLK7v0.js → color.wgsl-Ct5o9dpf.js} +155 -121
- package/dist/command-SFqDQ65h.js +320 -0
- package/dist/command.js +1 -1
- package/dist/completion-seal.js +54 -54
- package/dist/components/_shared/FeedbackMark.vue.d.ts +11 -0
- package/dist/components/_shared/axes.d.ts +9 -3
- package/dist/components/_shared/class-names.d.ts +9 -8
- package/dist/components/_shared/control-size.d.ts +2 -0
- package/dist/components/_shared/disclosure-context.d.ts +7 -0
- package/dist/components/_shared/disclosure.css +1 -0
- package/dist/components/_shared/feedback.d.ts +7 -0
- package/dist/components/_shared/field-control.css +1 -0
- package/dist/components/_shared/field-surfaces.css +1 -1
- package/dist/components/_shared/fieldControl.d.ts +13 -0
- package/dist/components/_shared/floating.d.ts +14 -0
- package/dist/components/_shared/index.d.ts +2 -6
- package/dist/components/_shared/interaction.d.ts +23 -0
- package/dist/components/_shared/menu.css +1 -1
- package/dist/components/_shared/menuRowClass.d.ts +2 -0
- package/dist/components/_shared/primitive.d.ts +19 -0
- package/dist/components/_shared/resolveSurfaceClass.d.ts +3 -0
- package/dist/components/_shared/selection.d.ts +7 -0
- package/dist/components/_shared/useMotionAxis.d.ts +3 -2
- package/dist/components/accordion/Accordion.vue.d.ts +41 -16
- package/dist/components/accordion/AccordionContent.vue.d.ts +11 -9
- package/dist/components/accordion/AccordionItem.vue.d.ts +12 -9
- package/dist/components/accordion/AccordionTrigger.vue.d.ts +8 -11
- package/dist/components/accordion/index.d.ts +4 -4
- package/dist/components/alert/Alert.vue.d.ts +9 -5
- package/dist/components/alert/index.d.ts +17 -8
- package/dist/components/animated-digit/AnimatedDigit.vue.d.ts +2 -3
- package/dist/components/aurora/Aurora.vue.d.ts +37 -42
- package/dist/components/aurora/composables/atoms-fields.d.ts +13 -2
- package/dist/components/aurora/composables/atoms.d.ts +52 -50
- package/dist/components/aurora/composables/auroraFallbackGround.d.ts +13 -13
- package/dist/components/aurora/composables/auroraImageSource.d.ts +4 -5
- package/dist/components/aurora/composables/color.d.ts +15 -20
- package/dist/components/aurora/composables/frameLoop.d.ts +14 -11
- package/dist/components/aurora/composables/glSetup.d.ts +19 -2
- package/dist/components/aurora/composables/runtime.d.ts +56 -60
- package/dist/components/aurora/composables/uniformBridge.d.ts +9 -14
- package/dist/components/aurora/composables/uniformBridgeWGPU.d.ts +21 -22
- package/dist/components/aurora/composables/uniformBridgeWGPUImage.d.ts +13 -13
- package/dist/components/aurora/composables/useAurora.d.ts +19 -30
- package/dist/components/aurora/composables/wgpuSetup.d.ts +10 -8
- package/dist/components/aurora/constants/budget.d.ts +12 -25
- package/dist/components/aurora/constants/presets.d.ts +47 -58
- package/dist/components/aurora/constants/renderMode.d.ts +21 -36
- package/dist/components/aurora/constants/shaders/aurora-image.wgsl.d.ts +1 -1
- package/dist/components/aurora/constants/shaders/aurora-mediums.wgsl.d.ts +1 -1
- package/dist/components/aurora/constants/shaders/aurora.wgsl.d.ts +1 -1
- package/dist/components/aurora/constants/shaders/brush.glsl.d.ts +1 -1
- package/dist/components/aurora/constants/shaders/composition.glsl.d.ts +1 -1
- package/dist/components/aurora/constants/shaders/flow.glsl.d.ts +1 -1
- package/dist/components/aurora/constants/shaders/metal-medium.glsl.d.ts +2 -2
- package/dist/components/aurora/constants/shaders/oil-modes.glsl.d.ts +1 -1
- package/dist/components/aurora/constants/shaders/vangogh-medium.glsl.d.ts +1 -1
- package/dist/components/aurora/index.d.ts +2 -1
- package/dist/components/avatar/Avatar.vue.d.ts +72 -11
- package/dist/components/avatar/AvatarFallback.vue.d.ts +1 -2
- package/dist/components/avatar/AvatarImage.vue.d.ts +12 -8
- package/dist/components/avatar/index.d.ts +3 -9
- package/dist/components/avatar/styles.css +1 -0
- package/dist/components/badge/Badge.vue.d.ts +2 -9
- package/dist/components/badge/index.d.ts +32 -9
- package/dist/components/blob/Blob.vue.d.ts +5 -12
- package/dist/components/blob/composables/blobSimulation.d.ts +80 -0
- package/dist/components/blob/composables/buildMetaballProgram.d.ts +1 -1
- package/dist/components/blob/composables/resolveBlobSurface.d.ts +6 -0
- package/dist/components/blob/composables/satelliteKinematics.d.ts +3 -3
- package/dist/components/blob/composables/uniformBridgeWGPU.d.ts +1 -1
- package/dist/components/blob/composables/uploadBlobUniforms.d.ts +4 -31
- package/dist/components/blob/composables/useBlobMood.d.ts +5 -5
- package/dist/components/blob/composables/useBlobPointer.d.ts +11 -12
- package/dist/components/blob/composables/useMetaballRenderer.d.ts +27 -24
- package/dist/components/blob/composables/wgpuSetup.d.ts +7 -5
- package/dist/components/blob/config.d.ts +1 -1
- package/dist/components/blob/index.d.ts +2 -2
- package/dist/components/blob/presets.d.ts +2 -2
- package/dist/components/blob/shaders/metaball-palette.wgsl.d.ts +1 -1
- package/dist/components/blob/shaders/metaball-uniforms.glsl.d.ts +1 -1
- package/dist/components/blob/shaders/metaball.wgsl.d.ts +1 -1
- package/dist/components/blob/shaders/sdf-body.glsl.d.ts +1 -1
- package/dist/components/blob/shaders/watercolor-edges.glsl.d.ts +1 -1
- package/dist/components/blob/types.d.ts +28 -60
- package/dist/components/button/Button.vue.d.ts +26 -20
- package/dist/components/button/index.d.ts +1 -9
- package/dist/components/button/styles.css +1 -0
- package/dist/components/card/Card.vue.d.ts +20 -155
- package/dist/components/card/CardAction.vue.d.ts +0 -7
- package/dist/components/card/CardContent.vue.d.ts +2 -2
- package/dist/components/card/CardDescription.vue.d.ts +2 -2
- package/dist/components/card/CardFooter.vue.d.ts +2 -2
- package/dist/components/card/CardHeader.vue.d.ts +3 -42
- package/dist/components/card/CardTitle.vue.d.ts +6 -3
- package/dist/components/card/card-scroll.css +1 -1
- package/dist/components/card/index.d.ts +1 -3
- package/dist/components/card/styles.css +1 -1
- package/dist/components/carousel/index.d.ts +0 -2
- package/dist/components/carousel/interface.d.ts +2 -0
- package/dist/components/checkbox/Checkbox.vue.d.ts +17 -9
- package/dist/components/checkbox/index.d.ts +1 -1
- package/dist/components/checkbox/styles.css +1 -0
- package/dist/components/chip/Chip.vue.d.ts +12 -7
- package/dist/components/chip/chipVariants.d.ts +20 -43
- package/dist/components/chip/index.d.ts +1 -1
- package/dist/components/chip/types.d.ts +45 -30
- package/dist/components/collapsible/Collapsible.vue.d.ts +22 -9
- package/dist/components/collapsible/CollapsibleContent.vue.d.ts +11 -5
- package/dist/components/collapsible/CollapsibleTrigger.vue.d.ts +12 -9
- package/dist/components/collapsible/index.d.ts +3 -3
- package/dist/components/combobox/Combobox.vue.d.ts +10 -20
- package/dist/components/combobox/ComboboxAnchor.vue.d.ts +2 -6
- package/dist/components/combobox/ComboboxEmpty.vue.d.ts +2 -6
- package/dist/components/combobox/ComboboxGroup.vue.d.ts +2 -7
- package/dist/components/combobox/ComboboxInput.vue.d.ts +7 -12
- package/dist/components/combobox/ComboboxItem.vue.d.ts +7 -11
- package/dist/components/combobox/ComboboxItemIndicator.vue.d.ts +2 -6
- package/dist/components/combobox/ComboboxList.vue.d.ts +14 -17
- package/dist/components/combobox/ComboboxTrigger.vue.d.ts +16 -0
- package/dist/components/combobox/index.d.ts +2 -1
- package/dist/components/combobox/types.d.ts +87 -0
- package/dist/components/command/Command.vue.d.ts +9 -23
- package/dist/components/command/CommandDialog.vue.d.ts +4 -9
- package/dist/components/command/CommandEmpty.vue.d.ts +2 -6
- package/dist/components/command/CommandGroup.vue.d.ts +2 -7
- package/dist/components/command/CommandInput.vue.d.ts +6 -7
- package/dist/components/command/CommandItem.vue.d.ts +7 -11
- package/dist/components/command/CommandList.vue.d.ts +12 -19
- package/dist/components/command/CommandSeparator.vue.d.ts +2 -6
- package/dist/components/command/CommandShortcut.vue.d.ts +2 -2
- package/dist/components/command/dialogContext.d.ts +6 -0
- package/dist/components/command/index.d.ts +10 -10
- package/dist/components/command/styles.css +1 -0
- package/dist/components/command/types.d.ts +27 -0
- package/dist/components/completion-seal/CompletionSeal.vue.d.ts +2 -2
- package/dist/components/completion-seal/constants.d.ts +2 -2
- package/dist/components/configurator/Configurator.vue.d.ts +6 -6
- package/dist/components/configurator/ConfiguratorLayer.vue.d.ts +14 -18
- package/dist/components/configurator/ConfiguratorRow.vue.d.ts +14 -17
- package/dist/components/configurator/size.d.ts +5 -7
- package/dist/components/configurator/styles.css +1 -1
- package/dist/components/constellation/Constellation.vue.d.ts +1 -1
- package/dist/components/constellation/composables/createConstellationField.d.ts +2 -2
- package/dist/components/constellation/constants.d.ts +8 -8
- package/dist/components/constellation/constellationField.d.ts +5 -6
- package/dist/components/constellation/constellationInteraction.d.ts +8 -8
- package/dist/components/constellation/constellationTypes.d.ts +53 -54
- package/dist/components/constellation/constellationWell.d.ts +2 -2
- package/dist/components/dark-mode-toggle/DarkModeToggle.vue.d.ts +12 -0
- package/dist/components/dark-mode-toggle/dark-mode-toggle.css +1 -0
- package/dist/components/dark-mode-toggle/index.d.ts +2 -0
- package/dist/components/data-table/DataTable.vue.d.ts +11 -59
- package/dist/components/data-table/composables/useDataTableRowIdentity.d.ts +5 -23
- package/dist/components/data-table/index.d.ts +1 -1
- package/dist/components/data-table/styles.css +1 -0
- package/dist/components/data-table/types.d.ts +10 -12
- package/dist/components/deck/index.d.ts +0 -1
- package/dist/components/dialog/Dialog.vue.d.ts +8 -3
- package/dist/components/dialog/DialogClose.vue.d.ts +3 -1
- package/dist/components/dialog/DialogContent.vue.d.ts +27 -90
- package/dist/components/dialog/DialogDescription.vue.d.ts +5 -6
- package/dist/components/dialog/DialogTitle.vue.d.ts +5 -6
- package/dist/components/dialog/DialogTrigger.vue.d.ts +3 -1
- package/dist/components/{_shared → dialog}/ModalOverlay.vue.d.ts +18 -16
- package/dist/components/dialog/dialogStageContext.d.ts +7 -0
- package/dist/components/dialog/index.d.ts +8 -8
- package/dist/components/dialog/placement.css +1 -1
- package/dist/components/dialog/sheet-motion.d.ts +17 -0
- package/dist/components/dock/DockControl.vue.d.ts +9 -12
- package/dist/components/dock/DockCrossfade.vue.d.ts +4 -8
- package/dist/components/dock/DockLayer.vue.d.ts +2 -3
- package/dist/components/dock/DockLayerGroup.vue.d.ts +6 -6
- package/dist/components/dock/DockSeparator.vue.d.ts +8 -8
- package/dist/components/dock/composables/dockContext.d.ts +4 -14
- package/dist/components/dock/composables/dockCrossfadeContext.d.ts +6 -7
- package/dist/components/dock/composables/dockMorphMeasure.d.ts +7 -86
- package/dist/components/dock/composables/index.d.ts +1 -1
- package/dist/components/dock/composables/useDockClickIntegrity.d.ts +1 -1
- package/dist/components/dock/composables/useDockHold.d.ts +4 -5
- package/dist/components/dock/composables/useDockMorph.d.ts +26 -0
- package/dist/components/dock/composables/useDockOverflowFit.d.ts +4 -6
- package/dist/components/dock/composables/useDockSearch.d.ts +8 -8
- package/dist/components/dock/composables/useDockShellProps.d.ts +46 -43
- package/dist/components/dock/composables/useDockSpring.d.ts +7 -11
- package/dist/components/dock/composables/useDockState.d.ts +12 -3
- package/dist/components/dock/composables/useDockTouchGate.d.ts +14 -23
- package/dist/components/dock/constants.d.ts +5 -78
- package/dist/components/dock/index.d.ts +2 -7
- package/dist/components/dock/styles/controls.css +1 -1
- package/dist/components/dock/styles/crossfade.css +1 -1
- package/dist/components/dock/styles/density.css +1 -1
- package/dist/components/dock/styles/index.css +1 -1
- package/dist/components/dock/styles/layer-group.css +1 -1
- package/dist/components/dock/styles/layers.css +1 -1
- package/dist/components/dock/styles/morph.css +1 -1
- package/dist/components/dock/styles/shape.css +1 -1
- package/dist/components/dock/styles/shell.css +1 -1
- package/dist/components/drawer/Drawer.vue.d.ts +17 -20
- package/dist/components/drawer/DrawerContent.vue.d.ts +15 -16
- package/dist/components/drawer/DrawerDescription.vue.d.ts +5 -6
- package/dist/components/drawer/DrawerOverlay.vue.d.ts +6 -6
- package/dist/components/drawer/DrawerTitle.vue.d.ts +5 -6
- package/dist/components/drawer/composables/drawerSnapContext.d.ts +7 -1
- package/dist/components/drawer/composables/useDrawerSnap.d.ts +3 -1
- package/dist/components/drawer/constants.d.ts +7 -25
- package/dist/components/drawer/index.d.ts +10 -10
- package/dist/components/drawer/styles.css +1 -1
- package/dist/components/dropdown-menu/DropdownMenu.vue.d.ts +43 -16
- package/dist/components/dropdown-menu/DropdownMenuCheckboxItem.vue.d.ts +22 -13
- package/dist/components/dropdown-menu/DropdownMenuContent.vue.d.ts +28 -19
- package/dist/components/dropdown-menu/DropdownMenuGroup.vue.d.ts +6 -4
- package/dist/components/dropdown-menu/DropdownMenuItem.vue.d.ts +21 -9
- package/dist/components/dropdown-menu/DropdownMenuLabel.vue.d.ts +9 -9
- package/dist/components/dropdown-menu/DropdownMenuRadioGroup.vue.d.ts +13 -6
- package/dist/components/dropdown-menu/DropdownMenuRadioItem.vue.d.ts +18 -11
- package/dist/components/dropdown-menu/DropdownMenuSeparator.vue.d.ts +5 -6
- package/dist/components/dropdown-menu/DropdownMenuShortcut.vue.d.ts +7 -8
- package/dist/components/dropdown-menu/DropdownMenuSub.vue.d.ts +15 -7
- package/dist/components/dropdown-menu/DropdownMenuSubContent.vue.d.ts +24 -17
- package/dist/components/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts +11 -9
- package/dist/components/dropdown-menu/DropdownMenuTrigger.vue.d.ts +15 -8
- package/dist/components/dropdown-menu/index.d.ts +15 -15
- package/dist/components/dropdown-menu/styles.css +1 -0
- package/dist/components/dropdown-menu/useMenuTrigger.d.ts +2 -9
- package/dist/components/easing/composables/useEasingPicker.d.ts +5 -8
- package/dist/components/easing/constants.d.ts +1 -1
- package/dist/components/expandable-container/ExpandableContainer.vue.d.ts +1 -25
- package/dist/components/expandable-container/styles.css +1 -0
- package/dist/components/fading-scroll/FadingScroll.vue.d.ts +4 -0
- package/dist/components/fading-scroll/composables/useFadingScroll.d.ts +4 -0
- package/dist/components/fading-scroll/constants.d.ts +1 -2
- package/dist/components/fourier-field/FourierField.vue.d.ts +3 -5
- package/dist/components/fourier-field/composables/fourierFieldGLSetup.d.ts +1 -1
- package/dist/components/fourier-field/composables/fourierFieldWGPUSetup.d.ts +1 -1
- package/dist/components/fourier-field/composables/useFourierField.d.ts +4 -4
- package/dist/components/fourier-field/constants.d.ts +10 -10
- package/dist/components/fourier-field/index.d.ts +3 -3
- package/dist/components/fourier-field/presets.d.ts +3 -3
- package/dist/components/fourier-field/shaders/fourier-field.glsl.d.ts +2 -2
- package/dist/components/fourier-field/shaders/fourier-field.render.wgsl.d.ts +1 -1
- package/dist/components/handmark/HandMark.vue.d.ts +1 -1
- package/dist/components/handmark/brush.d.ts +1 -1
- package/dist/components/handmark/composables/useHandMark.d.ts +4 -4
- package/dist/components/handmark/constants.d.ts +10 -10
- package/dist/components/handmark/geometry.d.ts +8 -8
- package/dist/components/handmark/index.d.ts +7 -8
- package/dist/components/handmark/noise.d.ts +3 -3
- package/dist/components/handmark/types.d.ts +2 -2
- package/dist/components/header-ribbon/HeaderRibbon.vue.d.ts +3 -21
- package/dist/components/header-ribbon/styles.css +1 -0
- package/dist/components/header-ribbon/types.d.ts +5 -2
- package/dist/components/index.d.ts +0 -3
- package/dist/components/infinite-scroll/composables/types.d.ts +1 -1
- package/dist/components/input/Input.vue.d.ts +10 -35
- package/dist/components/input/index.d.ts +2 -1
- package/dist/components/input/types.d.ts +22 -0
- package/dist/components/instrument-chassis/InstrumentChassis.vue.d.ts +10 -84
- package/dist/components/instrument-chassis/index.d.ts +1 -2
- package/dist/components/instrument-chassis/styles.css +1 -1
- package/dist/components/instrument-chassis/types.d.ts +13 -0
- package/dist/components/label/Label.vue.d.ts +9 -14
- package/dist/components/label/index.d.ts +1 -1
- package/dist/components/labeled-field/LabeledField.vue.d.ts +10 -108
- package/dist/components/labeled-field/LabeledInput.vue.d.ts +3 -23
- package/dist/components/labeled-field/LabeledSelect.vue.d.ts +12 -18
- package/dist/components/labeled-field/LabeledSlider.vue.d.ts +12 -18
- package/dist/components/labeled-field/LabeledSwitch.vue.d.ts +14 -17
- package/dist/components/labeled-field/index.d.ts +1 -0
- package/dist/components/labeled-field/types.d.ts +50 -0
- package/dist/components/liquid-grid/composables/liquidGrid.d.ts +5 -5
- package/dist/components/liquid-grid/constants.d.ts +6 -7
- package/dist/components/liquid-grid/shaders/liquid-grid.glsl.d.ts +1 -1
- package/dist/components/liquid-grid/shaders/liquid-grid.wgsl.d.ts +1 -1
- package/dist/components/metric/Metric.vue.d.ts +24 -0
- package/dist/components/metric/MetricCell.vue.d.ts +26 -0
- package/dist/components/metric/MetricRow.vue.d.ts +22 -0
- package/dist/components/metric/MetricStack.vue.d.ts +16 -0
- package/dist/components/metric/coalesce-metric.d.ts +7 -28
- package/dist/components/metric/index.d.ts +5 -0
- package/dist/components/metric/styles.css +1 -0
- package/dist/components/metric/types.d.ts +32 -0
- package/dist/components/number-field/NumberField.vue.d.ts +21 -9
- package/dist/components/number-field/NumberFieldContent.vue.d.ts +2 -2
- package/dist/components/number-field/NumberFieldDecrement.vue.d.ts +6 -6
- package/dist/components/number-field/NumberFieldIncrement.vue.d.ts +6 -6
- package/dist/components/number-field/NumberFieldInput.vue.d.ts +1 -6
- package/dist/components/number-field/context.d.ts +6 -0
- package/dist/components/number-field/index.d.ts +5 -5
- package/dist/components/number-field/styles.css +1 -0
- package/dist/components/pager-dots/constants.d.ts +1 -2
- package/dist/components/pager-dots/index.d.ts +0 -2
- package/dist/components/paper-backdrop/PaperBackdrop.vue.d.ts +1 -14
- package/dist/components/paper-backdrop/index.d.ts +1 -1
- package/dist/components/popover/Popover.vue.d.ts +24 -36
- package/dist/components/popover/PopoverContent.vue.d.ts +23 -29
- package/dist/components/popover/PopoverTrigger.vue.d.ts +12 -7
- package/dist/components/popover/index.d.ts +3 -3
- package/dist/components/popover/popoverContext.d.ts +3 -4
- package/dist/components/progress/Progress.vue.d.ts +5 -13
- package/dist/components/progress/index.d.ts +1 -0
- package/dist/components/progress/types.d.ts +19 -0
- package/dist/components/pulse/Pulse.vue.d.ts +8 -47
- package/dist/components/pulse/index.d.ts +1 -0
- package/dist/components/radio-group/RadioGroup.vue.d.ts +27 -15
- package/dist/components/radio-group/RadioGroupItem.vue.d.ts +9 -6
- package/dist/components/radio-group/index.d.ts +2 -0
- package/dist/components/radio-group/styles.css +1 -0
- package/dist/components/scroll-progress-rim/styles.css +1 -1
- package/dist/components/search/FuzzySearch.vue.d.ts +2 -2
- package/dist/components/search/SearchBar.vue.d.ts +2 -2
- package/dist/components/search/searchVariants.d.ts +15 -17
- package/dist/components/select/Select.vue.d.ts +25 -14
- package/dist/components/select/SelectContent.vue.d.ts +26 -29
- package/dist/components/select/SelectGroup.vue.d.ts +7 -11
- package/dist/components/select/SelectItem.vue.d.ts +24 -13
- package/dist/components/select/SelectLabel.vue.d.ts +7 -11
- package/dist/components/select/SelectScrollDownButton.vue.d.ts +3 -4
- package/dist/components/select/SelectScrollUpButton.vue.d.ts +3 -4
- package/dist/components/select/SelectSeparator.vue.d.ts +5 -6
- package/dist/components/select/SelectTrigger.vue.d.ts +15 -41
- package/dist/components/select/SelectValue.vue.d.ts +13 -7
- package/dist/components/select/index.d.ts +16 -8
- package/dist/components/separator/Separator.vue.d.ts +11 -6
- package/dist/components/separator/index.d.ts +1 -1
- package/dist/components/skeleton/Skeleton.vue.d.ts +3 -31
- package/dist/components/slider/Slider.vue.d.ts +10 -37
- package/dist/components/slider/index.d.ts +1 -45
- package/dist/components/slider/types.d.ts +25 -0
- package/dist/components/sortable-list/SortableList.vue.d.ts +1 -1
- package/dist/components/sortable-list/composables/ghostRenderer.d.ts +1 -1
- package/dist/components/sortable-list/composables/touchGate.d.ts +1 -1
- package/dist/components/sortable-list/composables/transitionTiming.d.ts +1 -1
- package/dist/components/status-dot/StatusDot.vue.d.ts +7 -10
- package/dist/components/status-dot/index.d.ts +1 -0
- package/dist/components/surface/Surface.vue.d.ts +13 -21
- package/dist/components/surface/index.d.ts +2 -2
- package/dist/components/switch/Switch.vue.d.ts +20 -11
- package/dist/components/switch/index.d.ts +2 -1
- package/dist/components/switch/styles.css +1 -0
- package/dist/components/table/Table.vue.d.ts +1 -1
- package/dist/components/tabs/SegmentedTabs.vue.d.ts +21 -13
- package/dist/components/tabs/composables/useTabDragMorph.d.ts +6 -6
- package/dist/components/tabs/composables/useTabResponsive.d.ts +5 -6
- package/dist/components/tabs/composables/useTabRovingFocus.d.ts +16 -16
- package/dist/components/tabs/constants.d.ts +1 -1
- package/dist/components/tabs/index.d.ts +1 -1
- package/dist/components/tabs/styles/drag.css +1 -1
- package/dist/components/tabs/styles/segmented.css +1 -1
- package/dist/components/tags-input/TagsInput.vue.d.ts +28 -15
- package/dist/components/tags-input/TagsInputInput.vue.d.ts +8 -6
- package/dist/components/tags-input/TagsInputItem.vue.d.ts +9 -8
- package/dist/components/tags-input/TagsInputItemDelete.vue.d.ts +5 -6
- package/dist/components/tags-input/TagsInputItemText.vue.d.ts +5 -6
- package/dist/components/tags-input/context.d.ts +5 -0
- package/dist/components/tags-input/index.d.ts +5 -5
- package/dist/components/tags-input/styles.css +1 -0
- package/dist/components/textarea/Textarea.vue.d.ts +10 -55
- package/dist/components/textarea/index.d.ts +2 -1
- package/dist/components/textarea/types.d.ts +22 -0
- package/dist/components/timeline/ContinuousMarkers.vue.d.ts +2 -4
- package/dist/components/timeline/ContinuousRail.vue.d.ts +3 -6
- package/dist/components/timeline/ContinuousTimeline.vue.d.ts +12 -13
- package/dist/components/timeline/GlassTimeline.vue.d.ts +7 -8
- package/dist/components/timeline/ScrubberTimeline.vue.d.ts +4 -4
- package/dist/components/timeline/SegmentedTimeline.vue.d.ts +2 -3
- package/dist/components/timeline/geometry.d.ts +3 -4
- package/dist/components/timeline/types.d.ts +3 -3
- package/dist/components/toast/Toast.vue.d.ts +37 -79
- package/dist/components/toast/ToastAction.vue.d.ts +5 -5
- package/dist/components/toast/ToastClose.vue.d.ts +4 -5
- package/dist/components/toast/ToastDescription.vue.d.ts +4 -5
- package/dist/components/toast/ToastTitle.vue.d.ts +4 -5
- package/dist/components/toast/Toaster.vue.d.ts +1 -1
- package/dist/components/toast/index.d.ts +8 -9
- package/dist/components/toast/use-toast.d.ts +20 -163
- package/dist/components/toggle-group/ToggleGroup.vue.d.ts +44 -22
- package/dist/components/toggle-group/ToggleGroupItem.vue.d.ts +11 -9
- package/dist/components/toggle-group/index.d.ts +3 -2
- package/dist/components/toggle-group/styles.css +1 -0
- package/dist/components/toggle-group/toggleGroupContext.d.ts +4 -15
- package/dist/components/tooltip/Tooltip.vue.d.ts +20 -7
- package/dist/components/tooltip/TooltipContent.vue.d.ts +20 -12
- package/dist/components/tooltip/TooltipProvider.vue.d.ts +12 -5
- package/dist/components/tooltip/TooltipTrigger.vue.d.ts +12 -5
- package/dist/components/tooltip/index.d.ts +4 -4
- package/dist/components/typewriter/composables/useTypewriter.d.ts +1 -0
- package/dist/components/typewriter/utils/timing.d.ts +0 -2
- package/dist/components/watercolor-dot/WatercolorDot.vue.d.ts +5 -18
- package/dist/components/watercolor-dot/useWatercolorBlob.d.ts +1 -4
- package/dist/composables/color/accent-tone-solve.d.ts +2 -5
- package/dist/composables/color/index.d.ts +31 -38
- package/dist/composables/color/useAccentTone.d.ts +0 -3
- package/dist/composables/color/value.d.ts +21 -0
- package/dist/composables/context/createContext.d.ts +2 -2
- package/dist/composables/dark/index.d.ts +1 -1
- package/dist/composables/dark/useGlobalDark.d.ts +7 -6
- package/dist/composables/dom/useBreakpoint.d.ts +2 -2
- package/dist/composables/dom/useClipboard.d.ts +28 -52
- package/dist/composables/dom/useDocumentVisibility.d.ts +3 -1
- package/dist/composables/dom/useIdleReady.d.ts +5 -6
- package/dist/composables/dom/useTokenColor.d.ts +2 -2
- package/dist/composables/dom/useUserInvalidAria.d.ts +2 -3
- package/dist/composables/dom/useViewportReady.d.ts +4 -4
- package/dist/composables/glass/backdropLuminanceSample.d.ts +7 -6
- package/dist/composables/glass/canvas2d/useCanvas2D.d.ts +7 -1
- package/dist/composables/glass/textureUpload.d.ts +8 -10
- package/dist/composables/glass/useGlassBackdropLuminance.d.ts +11 -19
- package/dist/composables/glass/useSpecularPointer.d.ts +6 -6
- package/dist/composables/glass/useSpecularTracking.d.ts +12 -15
- package/dist/composables/glass/wave/waveField.d.ts +2 -2
- package/dist/composables/glass/wave/waveField.glsl.d.ts +1 -1
- package/dist/composables/glass/wave/waveField.wgsl.d.ts +1 -1
- package/dist/composables/glass/webgl/backingSize.d.ts +5 -8
- package/dist/composables/glass/webgl/compile.d.ts +1 -1
- package/dist/composables/glass/webgl/createCanvasLifecycle.d.ts +20 -20
- package/dist/composables/glass/webgl/useWebGLCanvas.d.ts +16 -28
- package/dist/composables/glass/webgl/visibility.d.ts +3 -4
- package/dist/composables/glass/webgpu/useGpuSubstrate.d.ts +10 -10
- package/dist/composables/glass/webgpu/useWebGPUCanvas.d.ts +1 -1
- package/dist/composables/glass/webgpu/webgpuCanvasTypes.d.ts +12 -10
- package/dist/composables/glass/webgpu/webgpuDevice.d.ts +15 -16
- package/dist/composables/motion/core/asElement.d.ts +2 -0
- package/dist/composables/motion/{constants.d.ts → core/constants.d.ts} +2 -3
- package/dist/composables/motion/core/index.d.ts +20 -23
- package/dist/composables/motion/core/useReducedMotion.d.ts +5 -0
- package/dist/composables/motion/core/useViewTransition.d.ts +44 -0
- package/dist/composables/motion/index.d.ts +14 -16
- package/dist/composables/motion/{useDockCtaReceive.d.ts → morph/useDockCtaReceive.d.ts} +2 -3
- package/dist/composables/motion/{useDragMorph.d.ts → morph/useDragMorph.d.ts} +7 -7
- package/dist/composables/motion/morph/useElementMorph.d.ts +50 -0
- package/dist/composables/motion/{useLeadTrail.d.ts → morph/useLeadTrail.d.ts} +6 -6
- package/dist/composables/motion/{useSelectionGroup.d.ts → morph/useSelectionGroup.d.ts} +7 -5
- package/dist/composables/motion/{useSelectionIndicator.d.ts → morph/useSelectionIndicator.d.ts} +9 -16
- package/dist/composables/motion/{useNumericTransition.d.ts → number/useNumericTransition.d.ts} +2 -2
- package/dist/composables/motion/{pointerFieldMappings.d.ts → pointer/pointerFieldMappings.d.ts} +7 -10
- package/dist/composables/motion/{usePointerVelocityField.d.ts → pointer/usePointerVelocityField.d.ts} +1 -1
- package/dist/composables/motion/{bloomUpField.d.ts → reveal/bloomUpField.d.ts} +1 -1
- package/dist/composables/motion/reveal/useBloomUp.d.ts +33 -0
- package/dist/composables/motion/{useLiquidReveal.d.ts → reveal/useLiquidReveal.d.ts} +5 -5
- package/dist/composables/motion/{useStagger.d.ts → reveal/useStagger.d.ts} +3 -3
- package/dist/composables/motion/reveal/useStaggerReveal.d.ts +28 -0
- package/dist/composables/motion/{useScrollChrome.d.ts → scroll/useScrollChrome.d.ts} +2 -2
- package/dist/composables/motion/{useScrollProgress.d.ts → scroll/useScrollProgress.d.ts} +12 -2
- package/dist/composables/motion/{springPresets.d.ts → spring/springPresets.d.ts} +8 -7
- package/dist/composables/motion/{springProjection.d.ts → spring/springProjection.d.ts} +3 -0
- package/dist/composables/motion/{useLiquidFlex.d.ts → spring/useLiquidFlex.d.ts} +11 -12
- package/dist/composables/motion/{useLiquidPress.d.ts → spring/useLiquidPress.d.ts} +3 -3
- package/dist/composables/motion/{useSpring.d.ts → spring/useSpring.d.ts} +5 -2
- package/dist/composables/motion/{useSpringMount.d.ts → spring/useSpringMount.d.ts} +8 -1
- package/dist/composables/sidebar/types.d.ts +3 -3
- package/dist/{configurator-CSENXXSy.js → configurator-M5OaIlJd.js} +11 -11
- package/dist/configurator.js +1 -1
- package/dist/{constants-DRZmNIY-.js → constants-nBz23tJE.js} +1 -1
- package/dist/constellation.js +125 -124
- package/dist/{createCanvasLifecycle-hsFkQVdl.js → createCanvasLifecycle-DbXRwjU_.js} +87 -82
- package/dist/dark-mode-toggle.d.ts +1 -0
- package/dist/dark-mode-toggle.js +43 -0
- package/dist/dark.js +1 -1
- package/dist/data-table-BygKg6ZA.js +491 -0
- package/dist/data-table.js +1 -1
- package/dist/deck.js +3 -3
- package/dist/dialog-TNRDkcE4.js +385 -0
- package/dist/dialog.js +1 -1
- package/dist/dock.js +523 -940
- package/dist/dockContext-BUTlGRNJ.js +13 -0
- package/dist/dom.js +52 -114
- package/dist/drawer.js +262 -209
- package/dist/dropdown-menu-BlbnvMaZ.js +507 -0
- package/dist/dropdown-menu.js +2 -2
- package/dist/easing.js +294 -278
- package/dist/expandable-container.js +107 -93
- package/dist/fading-scroll-DhxXIhm2.js +96 -0
- package/dist/fading-scroll.js +1 -1
- package/dist/field-control.css_vue_type_style_index_0_src_true_lang-CeLay9Tk.js +21 -0
- package/dist/floating-dB5TD88k.js +7 -0
- package/dist/{flow.glsl-DEGFGE11.js → flow.wgsl-Cd2GUkPx.js} +2 -2
- package/dist/fonts/README.md +14 -18
- package/dist/forms.js +279 -174
- package/dist/fourier-field.js +148 -148
- package/dist/glass-ui.css +1 -1
- package/dist/glass-ui.js +512 -373
- package/dist/handmark.js +4 -4
- package/dist/header-ribbon.js +37 -68
- package/dist/index.d.ts +9 -18
- package/dist/infinite-scroll.js +31 -28
- package/dist/instrument-chassis.js +54 -2
- package/dist/label-DnMqH7jr.js +55 -0
- package/dist/label.js +1 -1
- package/dist/labeled-field.js +291 -214
- package/dist/liquid-grid.js +141 -151
- package/dist/menuRowClass-Nh7CtMON.js +12 -0
- package/dist/metric.d.ts +1 -0
- package/dist/metric.js +192 -0
- package/dist/motion-core.js +73 -165
- package/dist/motion.js +104 -161
- package/dist/number-field-Boe09SvX.js +154 -0
- package/dist/number-field.js +1 -1
- package/dist/pager-dots.js +2 -2
- package/dist/paper-backdrop.js +16 -24
- package/dist/{pointerFieldMappings-CZojkgKj.js → pointerFieldMappings-DP5tla5z.js} +4 -7
- package/dist/popover-BQGYXZyO.js +244 -0
- package/dist/popover.js +1 -1
- package/dist/{presets-CxeNvxuO.js → presets-5myqNv59.js} +1 -1
- package/dist/primitive-B2t2jdqM.js +11 -0
- package/dist/progress-DClbhRAT.js +88 -0
- package/dist/progress.js +1 -1
- package/dist/pulse.js +29 -43
- package/dist/reactive.js +1 -1
- package/dist/resolveCanvasColor-DS_6DBxA.js +82 -0
- package/dist/resolveSurfaceClass-DCZ4PZcy.js +6 -0
- package/dist/{scrollReader-C2oK9Hb8.js → scrollReader-Brf5cQNo.js} +1 -1
- package/dist/search.js +241 -213
- package/dist/select-BcBAyLXA.js +336 -0
- package/dist/select.js +1 -1
- package/dist/selection-DqIULxRG.js +6 -0
- package/dist/separator-CgZInrX-.js +75 -0
- package/dist/separator.js +1 -1
- package/dist/sidebar.js +53 -42
- package/dist/slider-DzqeQmMu.js +162 -0
- package/dist/slider.js +2 -2
- package/dist/sortable-list.js +9 -8
- package/dist/springPresets-rCii5KqX.js +52 -0
- package/dist/status-dot.js +26 -43
- package/dist/styles/accessibility.css +1 -1
- package/dist/styles/animations.css +1 -1
- package/dist/styles/components.css +1 -1
- package/dist/styles/glass/a11y-fallback.css +1 -1
- package/dist/styles/glass/accent-tone.css +1 -1
- package/dist/styles/glass/control-surfaces.css +1 -1
- package/dist/styles/glass/defined.css +1 -1
- package/dist/styles/glass/glass-atom.css +1 -1
- package/dist/styles/glass/glass-capsule.css +1 -1
- package/dist/styles/glass/glass-chip.css +1 -1
- package/dist/styles/glass/ladder.css +1 -1
- package/dist/styles/glass/liquid-fill.css +1 -1
- package/dist/styles/glass/material-roles.css +1 -1
- package/dist/styles/glass/material.css +1 -1
- package/dist/styles/glass/reveal.css +1 -1
- package/dist/styles/glass/squircle.css +1 -1
- package/dist/styles/glass/surface-axis.css +1 -1
- package/dist/styles/glass/surfaces-pager.css +1 -1
- package/dist/styles/glass/surfaces.css +1 -1
- package/dist/styles/glass-refract.css +1 -1
- package/dist/styles/glass.css +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/styles/paper.css +1 -1
- package/dist/styles/scroll-driven.css +1 -1
- package/dist/styles/theme/bridges.css +1 -1
- package/dist/styles/theme/radius.css +1 -1
- package/dist/styles/tokens/color-radius.css +1 -1
- package/dist/styles/tokens/dark-arm.css +1 -1
- package/dist/styles/tokens/glass-deep.css +1 -1
- package/dist/styles/tokens/glass-fx.css +1 -1
- package/dist/styles/tokens/glass.css +1 -1
- package/dist/styles/tokens/light-dark.css +1 -1
- package/dist/styles/tokens/manifest.d.ts +14 -0
- package/dist/styles/tokens/manifest.ts +56 -0
- package/dist/styles/tokens/motion-registers.css +1 -1
- package/dist/styles/tokens/offsets.css +1 -1
- package/dist/styles/tokens/property-regs-specular.css +1 -1
- package/dist/styles/tokens/property-regs.css +1 -1
- package/dist/styles/tokens/scale-paper.css +1 -1
- package/dist/styles/tokens/scheme-motion.css +1 -1
- package/dist/styles/tokens/scheme-spring.css +1 -1
- package/dist/styles/tokens/scroll-tokens.css +1 -1
- package/dist/styles/tokens/shadow.css +1 -1
- package/dist/styles/tokens/sizing-config.css +1 -1
- package/dist/styles/tokens/sizing.css +1 -1
- package/dist/styles/tokens.d.ts +4 -9
- package/dist/styles/tokens.ts +5 -9
- package/dist/styles/transitions.css +1 -1
- package/dist/styles/typography/scale.css +1 -1
- package/dist/styles/typography/semantic.css +1 -1
- package/dist/styles/typography/utilities.css +1 -1
- package/dist/styles/utilities/a11y-overrides.css +1 -1
- package/dist/styles/utilities/base-misc.css +1 -1
- package/dist/styles/utilities/base.css +1 -1
- package/dist/styles/utilities/btn.css +1 -1
- package/dist/styles/utilities/components.css +1 -1
- package/dist/styles/utilities/metal.css +1 -1
- package/dist/styles/utilities/responsive.css +1 -0
- package/dist/styles/view-transition.css +1 -1
- package/dist/{supportsCssTimeline-Dz-GVxXM.js → supportsCssTimeline-C2zyWpl8.js} +1 -1
- package/dist/surface.js +2 -3
- package/dist/switch-DZjQuFLa.js +54 -0
- package/dist/switch.js +1 -1
- package/dist/tabs.js +141 -169
- package/dist/timeline.js +86 -87
- package/dist/toast-CH5mnsYT.js +267 -0
- package/dist/toast.js +1 -1
- package/dist/toggle-group-O6jBo7AE.js +150 -0
- package/dist/toggle-group.js +1 -1
- package/dist/tokens.js +96 -5
- package/dist/tooltip-Drx5qnw_.js +148 -0
- package/dist/tooltip.js +1 -1
- package/dist/typewriter.js +222 -193
- package/dist/{useAccentTone-C-p6WdPe.js → useAccentTone-DyInfHXE.js} +2 -2
- package/dist/{useAnimatedNumber-BRVVaFFc.js → useAnimatedNumber-WPtMz0AN.js} +2 -2
- package/dist/useClipboard-D36OTaeT.js +53 -0
- package/dist/useDockCtaReceive-DkrOTM0q.js +146 -0
- package/dist/useDocumentVisibility-Dh_TGXsU.js +21 -0
- package/dist/useDragMorph-BogSV_nv.js +293 -0
- package/dist/{useIntersectionPause-B-dbxl9w.js → useIntersectionPause-B5mAU6XY.js} +15 -15
- package/dist/useLeadTrail-AW1-zZcd.js +74 -0
- package/dist/{useLiquidFlex-Ch4exNvN.js → useLiquidFlex-TJZmRqyY.js} +1 -1
- package/dist/useLiquidPress-BOxuDkKa.js +101 -0
- package/dist/useMotionAxis-D-rtIhca.js +19 -0
- package/dist/usePointerVelocityField-DsIf7yyq.js +121 -0
- package/dist/useRAFLoop-B3YlWK4M.js +98 -0
- package/dist/useReducedMotion-vCXA_vyM.js +27 -0
- package/dist/useRoutePointer-B8itM7Ka.js +53 -0
- package/dist/useScrollProgress-CSFYXIZT.js +43 -0
- package/dist/useScrollTrigger-BDdqptlc.js +87 -0
- package/dist/useSelectionGroup-B5XplBbo.js +132 -0
- package/dist/{useSpring-BBSKFx_0.js → useSpring-9u2_shxV.js} +2 -2
- package/dist/useSpringMount-uQ8QL9Ff.js +74 -0
- package/dist/useTabRovingFocus-YnWh-Ytr.js +169 -0
- package/dist/useTextHighlight-mfwNIC1f.js +112 -0
- package/dist/{useTouchGate-Cj5fOkTv.js → useTouchGate-B4mzQcHJ.js} +1 -1
- package/dist/vSpecular-DMJo8pfD.js +68 -0
- package/dist/value-DMhh2R94.js +33 -0
- package/dist/watercolor-dot.js +77 -103
- package/package.json +163 -232
- package/dist/DropdownMenuTrigger-BzQtd9lt.js +0 -65
- package/dist/FadingScroll-C1ZWEjmG.js +0 -83
- package/dist/Input-B4WQ_CMc.js +0 -57
- package/dist/Surface-BWRfwyn8.js +0 -59
- package/dist/accent-tone-solve-Dii9ePhK.js +0 -20
- package/dist/badge-C0C-rTBu.js +0 -80
- package/dist/button-32mg6xA8.js +0 -194
- package/dist/card-16xmzIr3.js +0 -303
- package/dist/coalesce-metric-znAcLzkB.js +0 -13
- package/dist/collapsible-bPzS1aQk.js +0 -63
- package/dist/color-swatch.d.ts +0 -1
- package/dist/color-swatch.js +0 -48
- package/dist/command-BjPjUU9z.js +0 -307
- package/dist/components/_shared/menuItemVariants.d.ts +0 -51
- package/dist/components/_shared/useControlSize.d.ts +0 -46
- package/dist/components/_shared/useStalePropWarning.d.ts +0 -27
- package/dist/components/_shared/useSurfaceAxis.d.ts +0 -64
- package/dist/components/card/ScrollCard.vue.d.ts +0 -33
- package/dist/components/card/ScrollCardHeader.vue.d.ts +0 -17
- package/dist/components/carousel/CarouselNext.vue.d.ts +0 -21
- package/dist/components/carousel/CarouselPrevious.vue.d.ts +0 -21
- package/dist/components/color-swatch/ColorSwatch.vue.d.ts +0 -22
- package/dist/components/color-swatch/index.d.ts +0 -1
- package/dist/components/controls/DarkModeToggle.vue.d.ts +0 -32
- package/dist/components/controls/dark-mode-toggle.css +0 -1
- package/dist/components/controls/index.d.ts +0 -1
- package/dist/components/data-table/DataTablePagination.vue.d.ts +0 -13
- package/dist/components/dock/DockSection.vue.d.ts +0 -69
- package/dist/components/dock/DockStack.vue.d.ts +0 -73
- package/dist/components/dock/composables/dockMorphContext.d.ts +0 -91
- package/dist/components/dock/composables/useDockFisheye.d.ts +0 -24
- package/dist/components/dock/composables/useDockPopover.d.ts +0 -70
- package/dist/components/dock/styles/fisheye.css +0 -1
- package/dist/components/dock/styles/popover.css +0 -1
- package/dist/components/dock/styles/section.css +0 -1
- package/dist/components/focus-scope/FocusScope.vue.d.ts +0 -20
- package/dist/components/focus-scope/index.d.ts +0 -2
- package/dist/components/goo-filter/GooFilter.vue.d.ts +0 -22
- package/dist/components/goo-filter/index.d.ts +0 -1
- package/dist/components/icon-chip/IconChip.vue.d.ts +0 -4
- package/dist/components/icon-chip/index.d.ts +0 -2
- package/dist/components/icon-chip/styles.css +0 -1
- package/dist/components/icon-chip/types.d.ts +0 -92
- package/dist/components/icon-tooltip/IconTooltip.vue.d.ts +0 -16
- package/dist/components/icon-tooltip/index.d.ts +0 -1
- package/dist/components/instrument-chassis/ChassisDivider.vue.d.ts +0 -30
- package/dist/components/metric-badge/MetricBadge.vue.d.ts +0 -40
- package/dist/components/metric-badge/index.d.ts +0 -2
- package/dist/components/metric-cell/MetricCell.vue.d.ts +0 -108
- package/dist/components/metric-cell/index.d.ts +0 -2
- package/dist/components/metric-stack/MetricRow.vue.d.ts +0 -120
- package/dist/components/metric-stack/MetricStack.vue.d.ts +0 -92
- package/dist/components/metric-stack/index.d.ts +0 -4
- package/dist/components/notification/Notification.vue.d.ts +0 -16
- package/dist/components/notification/index.d.ts +0 -1
- package/dist/components/progress/ProgressDefault.vue.d.ts +0 -9
- package/dist/components/progress/ProgressGradient.vue.d.ts +0 -26
- package/dist/components/progress/ProgressLiquid.vue.d.ts +0 -22
- package/dist/components/progress/valueMarks.css +0 -1
- package/dist/components/spa-view/SpaView.vue.d.ts +0 -50
- package/dist/components/spa-view/index.d.ts +0 -2
- package/dist/components/split-chars/SplitChars.vue.d.ts +0 -53
- package/dist/components/split-chars/index.d.ts +0 -1
- package/dist/components/tabs/composables/useEyeglassLive.d.ts +0 -17
- package/dist/components/toggle/Toggle.vue.d.ts +0 -29
- package/dist/components/toggle/index.d.ts +0 -26
- package/dist/composables/glass/webgl/shaders/glass-refract.glsl.d.ts +0 -36
- package/dist/composables/motion/curves.d.ts +0 -48
- package/dist/composables/motion/gooBarbellGeometry.d.ts +0 -79
- package/dist/composables/motion/morphSignatures.d.ts +0 -88
- package/dist/composables/motion/suite.d.ts +0 -2
- package/dist/composables/motion/useBloomUp.d.ts +0 -97
- package/dist/composables/motion/useCharStagger.d.ts +0 -44
- package/dist/composables/motion/useElementMorph.d.ts +0 -107
- package/dist/composables/motion/useGooMorph.d.ts +0 -72
- package/dist/composables/motion/usePrioritizedTask.d.ts +0 -41
- package/dist/composables/motion/useStaggerReveal.d.ts +0 -52
- package/dist/composables/motion/useViewTransition.d.ts +0 -81
- package/dist/composables/virtual/index.d.ts +0 -4
- package/dist/composables/virtual/useVirtualSectionWindow.d.ts +0 -72
- package/dist/composables/virtual/useWindowedStore.d.ts +0 -43
- package/dist/composables/virtual/virtualSectionLayout.d.ts +0 -103
- package/dist/controls.d.ts +0 -1
- package/dist/controls.js +0 -83
- package/dist/data-table-DveMdgBM.js +0 -629
- package/dist/dialog-BzQxKrUr.js +0 -281
- package/dist/dockContext-4S9qP0Z4.js +0 -13
- package/dist/dropdown-menu-DORIA52F.js +0 -378
- package/dist/focus-scope-DUTKveod.js +0 -23
- package/dist/focus-scope.d.ts +0 -1
- package/dist/focus-scope.js +0 -2
- package/dist/icon-chip-BWuxz1-u.js +0 -57
- package/dist/icon-chip.d.ts +0 -1
- package/dist/icon-chip.js +0 -2
- package/dist/icon-tooltip-CO6rw0dZ.js +0 -25
- package/dist/icon-tooltip.d.ts +0 -1
- package/dist/icon-tooltip.js +0 -2
- package/dist/instrument-chassis-Cvstg4_U.js +0 -65
- package/dist/label-Cj38tJKG.js +0 -36
- package/dist/menuItemVariants-D6AOzzND.js +0 -36
- package/dist/metric-badge.d.ts +0 -1
- package/dist/metric-badge.js +0 -79
- package/dist/metric-cell.d.ts +0 -1
- package/dist/metric-cell.js +0 -61
- package/dist/metric-stack.d.ts +0 -1
- package/dist/metric-stack.js +0 -113
- package/dist/motion-curves.d.ts +0 -1
- package/dist/motion-curves.js +0 -146
- package/dist/notification-DVs7ODMg.js +0 -52
- package/dist/notification.d.ts +0 -1
- package/dist/notification.js +0 -2
- package/dist/number-field-PvkGedHk.js +0 -140
- package/dist/popover-WMgyRSyN.js +0 -256
- package/dist/progress-C-HHuFZy.js +0 -192
- package/dist/resolveCanvasColor-yarP5bdk.js +0 -93
- package/dist/select-BIv4R3Ir.js +0 -326
- package/dist/separator-CBU94kTM.js +0 -62
- package/dist/slider-Cc_qw6GA.js +0 -166
- package/dist/spa-view.d.ts +0 -1
- package/dist/spa-view.js +0 -46
- package/dist/springPresets-h5VKJQqG.js +0 -58
- package/dist/styles/glass/progress-rail.css +0 -1
- package/dist/switch-Boj4Ucn5.js +0 -49
- package/dist/toast-kAbchIN2.js +0 -281
- package/dist/toggle-group-BPchFsns.js +0 -178
- package/dist/tooltip-BmOQJzh0.js +0 -111
- package/dist/useControlSize-CFfOk8I-.js +0 -9
- package/dist/useDockCtaReceive-CK-RLASa.js +0 -257
- package/dist/useDocumentVisibility-YeBDGqtI.js +0 -17
- package/dist/useDragMorph-7ygF9O0m.js +0 -93
- package/dist/useGooMorph-D1F6QJlH.js +0 -349
- package/dist/useLeadTrail-BYu8dq4G.js +0 -74
- package/dist/useLiquidPress-BYcwwGQV.js +0 -68
- package/dist/useMotionAxis-DCCXMC-i.js +0 -20
- package/dist/usePointerVelocityField-BdvnO0py.js +0 -122
- package/dist/useRAFLoop-BtwQ9DyY.js +0 -109
- package/dist/useRoutePointer-BDNMFN73.js +0 -52
- package/dist/useScrollProgress-DZI4nf4v.js +0 -35
- package/dist/useSelectionGroup-LDzBdR1Y.js +0 -215
- package/dist/useSpringMount-C6-DBx4e.js +0 -71
- package/dist/useSpringPress-BypV_KO-.js +0 -36
- package/dist/useSurfaceAxis-DudiZVOR.js +0 -10
- package/dist/useTabRovingFocus-DkLYwo4L.js +0 -143
- package/dist/vReveal-DZfWl9XI.js +0 -10
- package/dist/vSpecular-CQFmLNzA.js +0 -68
- package/src/fonts/README.md +0 -124
- package/src/fonts/fira-code/OFL.txt +0 -93
- package/src/fonts/fira-code/fira-code-latin-ext.woff2 +0 -0
- package/src/fonts/fira-code/fira-code-latin.woff2 +0 -0
- package/src/fonts/plus-jakarta-sans/OFL.txt +0 -93
- package/src/fonts/plus-jakarta-sans/plus-jakarta-sans-latin-ext.woff2 +0 -0
- package/src/fonts/plus-jakarta-sans/plus-jakarta-sans-latin.woff2 +0 -0
- package/src/styles/accessibility.css +0 -48
- package/src/styles/animations.css +0 -468
- package/src/styles/draw-in.css +0 -89
- package/src/styles/fonts.css +0 -143
- package/src/styles/glass/a11y-fallback.css +0 -188
- package/src/styles/glass/accent-tone.css +0 -66
- package/src/styles/glass/control-surfaces.css +0 -171
- package/src/styles/glass/deep.css +0 -114
- package/src/styles/glass/defined.css +0 -88
- package/src/styles/glass/glass-atom.css +0 -247
- package/src/styles/glass/glass-capsule.css +0 -175
- package/src/styles/glass/glass-chip.css +0 -211
- package/src/styles/glass/grain-overlay.css +0 -79
- package/src/styles/glass/ladder-undershadow.css +0 -61
- package/src/styles/glass/ladder.css +0 -452
- package/src/styles/glass/liquid-enter.css +0 -240
- package/src/styles/glass/liquid-fill.css +0 -65
- package/src/styles/glass/material-roles.css +0 -18
- package/src/styles/glass/material.css +0 -500
- package/src/styles/glass/progress-rail.css +0 -78
- package/src/styles/glass/reveal.css +0 -333
- package/src/styles/glass/rim.css +0 -122
- package/src/styles/glass/squircle.css +0 -58
- package/src/styles/glass/surface-axis.css +0 -136
- package/src/styles/glass/surfaces-pager.css +0 -79
- package/src/styles/glass/surfaces.css +0 -434
- package/src/styles/glass-refract.css +0 -112
- package/src/styles/glass-specular-track.css +0 -74
- package/src/styles/glass.css +0 -110
- package/src/styles/index.css +0 -288
- package/src/styles/paper.css +0 -187
- package/src/styles/scroll-choreography.css +0 -294
- package/src/styles/scroll-chrome.css +0 -123
- package/src/styles/scroll-driven.css +0 -123
- package/src/styles/theme/bridges.css +0 -380
- package/src/styles/theme/dark.css +0 -7
- package/src/styles/theme/literals.css +0 -104
- package/src/styles/theme/radius.css +0 -148
- package/src/styles/theme.css +0 -33
- package/src/styles/tokens/color-radius.css +0 -308
- package/src/styles/tokens/dark-arm-glass.css +0 -55
- package/src/styles/tokens/dark-arm.css +0 -455
- package/src/styles/tokens/glass-deep.css +0 -126
- package/src/styles/tokens/glass-fx.css +0 -480
- package/src/styles/tokens/glass.css +0 -477
- package/src/styles/tokens/light-dark.css +0 -216
- package/src/styles/tokens/motion-registers.css +0 -93
- package/src/styles/tokens/offsets.css +0 -142
- package/src/styles/tokens/on-glass-fg.css +0 -39
- package/src/styles/tokens/property-regs-specular.css +0 -160
- package/src/styles/tokens/property-regs.css +0 -448
- package/src/styles/tokens/scale-paper.css +0 -495
- package/src/styles/tokens/scheme-motion.css +0 -425
- package/src/styles/tokens/scheme-spring.css +0 -282
- package/src/styles/tokens/scroll-tokens.css +0 -137
- package/src/styles/tokens/shadow.css +0 -206
- package/src/styles/tokens/sizing-config.css +0 -110
- package/src/styles/tokens/sizing.css +0 -505
- package/src/styles/tokens.css +0 -68
- package/src/styles/tokens.ts +0 -58
- package/src/styles/transitions.css +0 -228
- package/src/styles/typography/scale.css +0 -166
- package/src/styles/typography/semantic.css +0 -233
- package/src/styles/typography/utilities.css +0 -197
- package/src/styles/typography.css +0 -46
- package/src/styles/utilities/a11y-overrides.css +0 -184
- package/src/styles/utilities/base-misc.css +0 -307
- package/src/styles/utilities/base.css +0 -337
- package/src/styles/utilities/btn.css +0 -306
- package/src/styles/utilities/components.css +0 -337
- package/src/styles/utilities/metal.css +0 -272
- package/src/styles/utilities.css +0 -24
- package/src/styles/view-transition.css +0 -67
- package/src/styles/viz-reveal.css +0 -63
- /package/dist/{_plugin-vue_export-helper-C1je1s0u.js → _plugin-vue_export-helper-B3ysoDQm.js} +0 -0
- /package/dist/{compile-DK3Fri1B.js → compile-D7VYG3gi.js} +0 -0
- /package/dist/composables/glass/{webgl/shaders/procedural-color.glsl.d.ts → procedural/color.glsl.d.ts} +0 -0
- /package/dist/{components/aurora/constants/shaders/procedural-color.wgsl.d.ts → composables/glass/procedural/color.wgsl.d.ts} +0 -0
- /package/dist/composables/motion/{motionTempo.d.ts → core/motionTempo.d.ts} +0 -0
- /package/dist/composables/motion/{useIntersectionPause.d.ts → core/useIntersectionPause.d.ts} +0 -0
- /package/dist/composables/motion/{useRAFLoop.d.ts → core/useRAFLoop.d.ts} +0 -0
- /package/dist/composables/motion/{useYieldToMain.d.ts → core/useYieldToMain.d.ts} +0 -0
- /package/dist/composables/motion/{useAnimatedNumber.d.ts → number/useAnimatedNumber.d.ts} +0 -0
- /package/dist/composables/motion/{useAnimatedNumberMap.d.ts → number/useAnimatedNumberMap.d.ts} +0 -0
- /package/dist/composables/motion/{useCountup.d.ts → number/useCountup.d.ts} +0 -0
- /package/dist/composables/motion/{useRoutePointer.d.ts → pointer/useRoutePointer.d.ts} +0 -0
- /package/dist/composables/motion/{useTextHighlight.d.ts → reveal/useTextHighlight.d.ts} +0 -0
- /package/dist/composables/motion/{vReveal.d.ts → reveal/vReveal.d.ts} +0 -0
- /package/dist/composables/motion/{scrollReader.d.ts → scroll/scrollReader.d.ts} +0 -0
- /package/dist/composables/motion/{supportsCssTimeline.d.ts → scroll/supportsCssTimeline.d.ts} +0 -0
- /package/dist/composables/motion/{useScrollPin.d.ts → scroll/useScrollPin.d.ts} +0 -0
- /package/dist/composables/motion/{useScrollScene.d.ts → scroll/useScrollScene.d.ts} +0 -0
- /package/dist/composables/motion/{useScrollTrigger.d.ts → scroll/useScrollTrigger.d.ts} +0 -0
- /package/dist/composables/motion/{useSpringPress.d.ts → spring/useSpringPress.d.ts} +0 -0
- /package/dist/{createContext-FU0n5MGK.js → createContext-BhkE9mLH.js} +0 -0
- /package/dist/{dark-DIH-blY1.js → dark-z_P5QwqI.js} +0 -0
- /package/dist/{motionTempo-CMS5b0Vu.js → motionTempo-tscp92Nm.js} +0 -0
- /package/dist/{prng-Dz2_9RJu.js → prng-2uS6J_A1.js} +0 -0
- /package/dist/{rendererStatus-C2-zC2Q-.js → rendererStatus-BxUlBLVy.js} +0 -0
- /package/dist/{useDragVelocity-CbMZEBaC.js → useDragVelocity-6ONX0sr0.js} +0 -0
- /package/dist/{useFuzzySearch-BOgep7RE.js → useFuzzySearch-CUnZknpm.js} +0 -0
- /package/dist/{useResizeObserver-BcUTquV7.js → useResizeObserver-CdUlm2QZ.js} +0 -0
- /package/dist/{useResolveTokenColor-C07e-qaT.js → useResolveTokenColor-B2FfJnd9.js} +0 -0
- /package/dist/{useTimer-D8koDvJS.js → useTimer-C3yfti4C.js} +0 -0
- /package/dist/{useUserInvalidAria-Cr4nR3tu.js → useUserInvalidAria-0GNrddMX.js} +0 -0
- /package/dist/{valueDomain-B8L04u3U.js → valueDomain-SbVzoHMH.js} +0 -0
- /package/dist/{writeVelocityWeight-D_AcvTsE.js → writeVelocityWeight-DoGOCW3e.js} +0 -0
|
@@ -1,26 +1,20 @@
|
|
|
1
|
-
type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
descriptions?: Record<string, string>;
|
|
6
|
-
label: string;
|
|
7
|
-
tooltip: string;
|
|
8
|
-
labelClass?: string;
|
|
9
|
-
/** AQ.W4 §W4.5 — thread the required-field asterisk onto the label. */
|
|
10
|
-
required?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* AZ.W-BLOB-REDRESS — render the label `sr-only` (kept for a11y, hidden
|
|
13
|
-
* visually) when an enclosing chrome row (a `<ConfiguratorRow>`) already
|
|
14
|
-
* supplies the visible human label. Avoids the double-label leak.
|
|
15
|
-
*/
|
|
16
|
-
hideLabel?: boolean;
|
|
1
|
+
import type { LabeledSelectProps } from "./types";
|
|
2
|
+
declare var __VLS_48: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
error?: (props: typeof __VLS_48) => any;
|
|
17
5
|
};
|
|
18
|
-
declare const
|
|
6
|
+
declare const __VLS_base: import("vue").DefineComponent<LabeledSelectProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
7
|
"update:modelValue": (value: string) => any;
|
|
20
8
|
"update:open": (value: boolean) => any;
|
|
21
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<LabeledSelectProps> & Readonly<{
|
|
22
10
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
23
11
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
24
12
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
25
14
|
declare const _default: typeof __VLS_export;
|
|
26
15
|
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -1,24 +1,18 @@
|
|
|
1
|
-
type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
labelClass?: string;
|
|
6
|
-
min: number;
|
|
7
|
-
max: number;
|
|
8
|
-
step: number;
|
|
9
|
-
/** AQ.W4 §W4.5 — thread the required-field asterisk onto the label. */
|
|
10
|
-
required?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* AZ.W-BLOB-REDRESS — render the label `sr-only` (kept for a11y, hidden
|
|
13
|
-
* visually) when an enclosing chrome row (a `<ConfiguratorRow>`) already
|
|
14
|
-
* supplies the visible human label. Avoids the double-label leak.
|
|
15
|
-
*/
|
|
16
|
-
hideLabel?: boolean;
|
|
1
|
+
import type { LabeledSliderProps } from "./types";
|
|
2
|
+
declare var __VLS_17: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
error?: (props: typeof __VLS_17) => any;
|
|
17
5
|
};
|
|
18
|
-
declare const
|
|
6
|
+
declare const __VLS_base: import("vue").DefineComponent<LabeledSliderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
7
|
"update:modelValue": (value: number) => any;
|
|
20
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<LabeledSliderProps> & Readonly<{
|
|
21
9
|
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
22
10
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
23
12
|
declare const _default: typeof __VLS_export;
|
|
24
13
|
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
labelClass?: string;
|
|
6
|
-
/** AQ.W4 §W4.5 — thread the required-field asterisk onto the label. */
|
|
7
|
-
required?: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* AZ.W-BLOB-REDRESS — render the label `sr-only` (kept for a11y, hidden
|
|
10
|
-
* visually) when an enclosing chrome row (a `<ConfiguratorRow>`) already
|
|
11
|
-
* supplies the visible human label. Avoids the double-label leak.
|
|
12
|
-
*/
|
|
13
|
-
hideLabel?: boolean;
|
|
1
|
+
import type { LabeledSwitchProps } from "./types";
|
|
2
|
+
declare var __VLS_17: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
error?: (props: typeof __VLS_17) => any;
|
|
14
5
|
};
|
|
15
|
-
declare const
|
|
16
|
-
"update:
|
|
17
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
18
|
-
"onUpdate:
|
|
6
|
+
declare const __VLS_base: import("vue").DefineComponent<LabeledSwitchProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
"update:modelValue": (value: boolean) => any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<LabeledSwitchProps> & Readonly<{
|
|
9
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
19
10
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
20
12
|
declare const _default: typeof __VLS_export;
|
|
21
13
|
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -3,3 +3,4 @@ export { default as LabeledInput } from "./LabeledInput.vue";
|
|
|
3
3
|
export { default as LabeledSelect } from "./LabeledSelect.vue";
|
|
4
4
|
export { default as LabeledSlider } from "./LabeledSlider.vue";
|
|
5
5
|
export { default as LabeledSwitch } from "./LabeledSwitch.vue";
|
|
6
|
+
export type { LabeledFieldCommonProps, LabeledFieldErrorLive, LabeledFieldLayout, LabeledFieldProps, LabeledFieldSlotProps, LabeledInputProps, LabeledSelectProps, LabeledSliderProps, LabeledSwitchProps, } from "./types";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { InputProps } from "../input";
|
|
2
|
+
import type { LabelRequirement } from "../label";
|
|
3
|
+
import type { SliderProps } from "../slider";
|
|
4
|
+
import type { SwitchProps } from "../switch";
|
|
5
|
+
export type LabeledFieldLayout = "default" | "horizontal";
|
|
6
|
+
export type LabeledFieldErrorLive = "off" | "polite" | "assertive";
|
|
7
|
+
export interface LabeledFieldCommonProps {
|
|
8
|
+
label: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
requirement?: LabelRequirement;
|
|
11
|
+
layout?: LabeledFieldLayout;
|
|
12
|
+
errorLive?: LabeledFieldErrorLive;
|
|
13
|
+
}
|
|
14
|
+
export interface LabeledFieldProps extends LabeledFieldCommonProps {
|
|
15
|
+
invalid?: boolean;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the control is a native labelable element (`input`, `select`, native
|
|
19
|
+
* `button`) the label's `for` can target. Defaults to `true`. Composite controls
|
|
20
|
+
* whose root is a non-labelable element — e.g. reka Slider's `span` root — set
|
|
21
|
+
* this `false` so the label drops the invalid `for` and the control names itself
|
|
22
|
+
* through `aria-labelledby` (the slot's `labelledBy`) instead.
|
|
23
|
+
*/
|
|
24
|
+
controlLabelable?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface LabeledFieldSlotProps {
|
|
27
|
+
controlId: string;
|
|
28
|
+
labelledBy: string;
|
|
29
|
+
describedBy?: string;
|
|
30
|
+
errorId?: string;
|
|
31
|
+
invalid: boolean;
|
|
32
|
+
disabled: boolean;
|
|
33
|
+
required: boolean;
|
|
34
|
+
}
|
|
35
|
+
export type LabeledInputProps = Omit<InputProps, "class"> & LabeledFieldCommonProps;
|
|
36
|
+
export interface LabeledSelectProps extends LabeledFieldCommonProps {
|
|
37
|
+
modelValue: string;
|
|
38
|
+
items: readonly string[];
|
|
39
|
+
open?: boolean;
|
|
40
|
+
placeholder?: string;
|
|
41
|
+
invalid?: boolean;
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
required?: boolean;
|
|
44
|
+
}
|
|
45
|
+
export type LabeledSliderProps = Omit<SliderProps, "class" | "modelValue"> & LabeledFieldCommonProps & {
|
|
46
|
+
modelValue: number;
|
|
47
|
+
};
|
|
48
|
+
export type LabeledSwitchProps = Omit<SwitchProps, "class" | "modelValue"> & LabeledFieldCommonProps & {
|
|
49
|
+
modelValue: boolean;
|
|
50
|
+
};
|
|
@@ -3,10 +3,10 @@ export interface Vec2 {
|
|
|
3
3
|
x: number;
|
|
4
4
|
y: number;
|
|
5
5
|
}
|
|
6
|
-
/** The curl central-difference epsilon (matches `flow.glsl.ts
|
|
6
|
+
/** The curl central-difference epsilon (matches `flow.glsl.ts`, `flow.wgsl.ts`). */
|
|
7
7
|
export declare const CURL_EPS = 0.012;
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* the liquid-grid curl-sampling spatial frequency (in CELL units).
|
|
10
10
|
* `g0 = uv · gridScale` is CELL-scale (span ~14–40 cells), so the warp must sample the curl
|
|
11
11
|
* potential at a frequency an ORDER OF MAGNITUDE below the grid frequency for the warp to be
|
|
12
12
|
* locally affine at the cell scale — the sheet bows as ONE smooth curve (base wavelength 1/0.03 ≈
|
|
@@ -21,7 +21,7 @@ export declare function potentialFBM(p: Vec2): number;
|
|
|
21
21
|
export declare function curlFBM(p: Vec2): Vec2;
|
|
22
22
|
/**
|
|
23
23
|
* The Ben Golus derivative-AA grid line coverage at `g` (grid space). `targetWidth` is the
|
|
24
|
-
* desired line half-width in GRID UNITS (the caller passes `lineWidthPx
|
|
24
|
+
* desired line half-width in GRID UNITS (the caller passes `lineWidthPx, minorPitchPx` so
|
|
25
25
|
* the line is N device-pixels wide); `uvDeriv` is the per-axis screen-space derivative of
|
|
26
26
|
* `g` (in the shaders `length(vec2(dFdx(g), dFdy(g)))`; in JS the caller passes it
|
|
27
27
|
* analytically so the path is reproducible). Returns line coverage [0..1].
|
|
@@ -44,7 +44,7 @@ export declare function gridCoverage(g: Vec2, targetWidth: number, uvDeriv: Vec2
|
|
|
44
44
|
* it from `dpdx`/`dpdy`. Returns `{ line, alpha }` — the line coverage + the global alpha.
|
|
45
45
|
*/
|
|
46
46
|
export interface LiquidGridSampleParams {
|
|
47
|
-
/** The grid scale (view
|
|
47
|
+
/** The grid scale (view, minorPitch → LARGER cells = smaller scale). */
|
|
48
48
|
gridScale: number;
|
|
49
49
|
/** The traveling-wave front direction. */
|
|
50
50
|
waveDir: Vec2;
|
|
@@ -78,7 +78,7 @@ export interface LiquidGridSampleParams {
|
|
|
78
78
|
fieldAlpha: number;
|
|
79
79
|
/** The FIXED per-axis derivative (the JS round-trip; shaders use dpdx/dpdy). */
|
|
80
80
|
uvDeriv: Vec2;
|
|
81
|
-
/** The filled-FACE opacity (0 → the face evaporates →
|
|
81
|
+
/** The filled-FACE opacity (0 → the face evaporates → the line-only render). */
|
|
82
82
|
faceAlpha?: number;
|
|
83
83
|
/** The slope-shade ∇H Lambert gain. */
|
|
84
84
|
faceReliefGain?: number;
|
|
@@ -39,8 +39,7 @@ export interface LiquidGridConfig {
|
|
|
39
39
|
lineColor: OklchStop;
|
|
40
40
|
/**
|
|
41
41
|
* The filled-FACE opacity — **default `0`** so the face EVAPORATES → byte-identical to the
|
|
42
|
-
* line-only
|
|
43
|
-
* stay GREEN). The demo `LIQUID_GRID_PRESET_RIPPLE` lifts it (presets-in-consumers).
|
|
42
|
+
* line-only default render. The demo `LIQUID_GRID_PRESET_RIPPLE` lifts it.
|
|
44
43
|
*/
|
|
45
44
|
faceAlpha: number;
|
|
46
45
|
/** The slope-shade gain (the ∇H Lambert relief — higher = steeper crest/trough contrast). */
|
|
@@ -52,7 +51,7 @@ export interface LiquidGridConfig {
|
|
|
52
51
|
/**
|
|
53
52
|
* The 3-stop warm-DIVERGENT face ramp (FOLD B — height-keyed, NOT a 2-point mid-park `mix`):
|
|
54
53
|
* trough → mid → crest. ALL hues ∈ [20,90] (rose-umber → ember/amber → warm-wheat) so the
|
|
55
|
-
* teal
|
|
54
|
+
* teal/navy exclusion is clear by construction.
|
|
56
55
|
*/
|
|
57
56
|
faceWarmLo: OklchStop;
|
|
58
57
|
faceWarmMid: OklchStop;
|
|
@@ -61,14 +60,14 @@ export interface LiquidGridConfig {
|
|
|
61
60
|
lightDir: [number, number];
|
|
62
61
|
/** The ground (default transparent so it suffuses over the page). */
|
|
63
62
|
background: OklchStop | "transparent";
|
|
64
|
-
/** Pointer bulge (§4/§8) — on (demo)
|
|
63
|
+
/** Pointer bulge (§4/§8) — on (demo), off (suffusion). */
|
|
65
64
|
interactive: boolean;
|
|
66
65
|
/** ONE static frame then park under `prefers-reduced-motion: reduce`. */
|
|
67
66
|
respectReducedMotion: boolean;
|
|
68
67
|
}
|
|
69
68
|
/**
|
|
70
69
|
* The warm-cream identity line ink (the library default — NOT a themed hue). A warm-amber
|
|
71
|
-
* ink in the `--foreground` family (OKLab hue ~62, the
|
|
70
|
+
* ink in the `--foreground` family (OKLab hue ~62, the warm identity) so the
|
|
72
71
|
* grid reads as warm ink over the page; the SFC resolves the live `--foreground` token at
|
|
73
72
|
* mount, this stop is the SSR/no-token fallback identity. A consumer (the demo) themes it
|
|
74
73
|
* through a PRESET, never a token edit. NEVER teal/navy (h in [180,280] reds P5).
|
|
@@ -76,9 +75,9 @@ export interface LiquidGridConfig {
|
|
|
76
75
|
export declare const WARM_IDENTITY_INK: OklchStop;
|
|
77
76
|
/**
|
|
78
77
|
* The library-default FACE ramp stops — a CALM warm-divergent fold the face would paint IF lit
|
|
79
|
-
* (the `faceAlpha:0` default keeps the face evaporated, so these never paint
|
|
78
|
+
* (the `faceAlpha:0` default keeps the face evaporated, so these never paint by default; they are
|
|
80
79
|
* the warm-identity SSR fallback the vivid demo preset overrides). ALL hues ∈ [20,90] — the
|
|
81
|
-
* teal
|
|
80
|
+
* teal/navy exclusion is clear by construction.
|
|
82
81
|
* trough → rose-umber, mid → ember-amber, crest → warm-wheat.
|
|
83
82
|
*/
|
|
84
83
|
export declare const FACE_WARM_LO: OklchStop;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** The full-screen-triangle vertex shader (the substrate's standard fullscreen pass). */
|
|
2
2
|
export declare const LIQUID_GRID_VERT_GLSL = "#version 300 es\nprecision highp float;\nin vec2 aPosition;\nout vec2 vUv;\nvoid main() {\n vUv = aPosition; // [-1,1]\u00B2 domain\n gl_Position = vec4(aPosition, 0.0, 1.0);\n}";
|
|
3
3
|
/** The liquid-grid fragment source — the liquid AA-grid (the same field as the WGSL primary). */
|
|
4
|
-
export declare const LIQUID_GRID_FRAG_GLSL = "#version 300 es\nprecision highp float;\n\n#define TAU 6.283185307179586\n\nin vec2 vUv;\nout vec4 fragColor;\n\nuniform float uTime;\nuniform float uGridScale;\nuniform float uMajorEvery;\nuniform float uAspect;\nuniform vec4 uWarp; // (warpScale, warpSpeed, warpScale2, warpSpeed2)\nuniform float uAmplitude;\nuniform vec4 uGrid; // (targetWidth, targetWidthMajor, minorAlpha, majorAlpha)\nuniform float uFieldAlpha;\nuniform float uHasBackground;\nuniform vec4 uCursor; // (cursorX, cursorY, swirlStrength, swirlRadius)\nuniform float uBulgeMode; // +1 repel / \u22121 attract (signs the swirl)\nuniform float uInteractive; // 1 = cursor swirl on\nuniform vec4 uWave; // (waveDirX, waveDirY, waveK, waveOmega)\nuniform vec4 uWave2; // (waveSigma, twistMax, _pad, amp) \u2014 affine sheet-warp envelope\nuniform vec3 uLineColor; // linear-sRGB ink\nuniform vec3 uBg; // linear-sRGB themed bg\n// \u2500\u2500 The FACE (BD.W-PAPERGRID-FACE) \u2014 the height-lit filled cell interior \u2500\u2500\nuniform vec4 uFace; // (faceAlpha, faceRelief, squashK, baseInset)\nuniform vec2 uLightDir; // the cel key-light direction\nuniform vec3 uFaceLo; // linear-sRGB rose-umber trough (FOLD B, 3-stop)\nuniform vec3 uFaceMid; // linear-sRGB ember-amber mid\nuniform vec3 uFaceHi; // linear-sRGB warm-wheat crest\n\n\nfloat srgbToLinearCh(float c) {\n return c <= 0.04045 ? c / 12.92 : pow((c + 0.055) / 1.055, 2.4);\n}\nvec3 srgbToLinear(vec3 c) {\n return vec3(srgbToLinearCh(c.r), srgbToLinearCh(c.g), srgbToLinearCh(c.b));\n}\n\nfloat linearToSrgbCh(float c) {\n return c <= 0.0031308 ? c * 12.92 : 1.055 * pow(c, 1.0 / 2.4) - 0.055;\n}\nvec3 linearToSrgb(vec3 c) {\n return vec3(linearToSrgbCh(c.r), linearToSrgbCh(c.g), linearToSrgbCh(c.b));\n}\n\n// The 3-stop warm-divergent FACE ramp (FOLD B \u2014 height-keyed, NOT a 2-point mid-park). All stops\n// warm hue \u2208 [20,90]; linear-space (the OETF runs in main, FOLD E).\nvec3 faceRamp(float rampT) {\n float s = clamp(rampT, 0.0, 1.0);\n if (s < 0.5) {\n return mix(uFaceLo, uFaceMid, s * 2.0);\n }\n return mix(uFaceMid, uFaceHi, (s - 0.5) * 2.0);\n}\n\n// The shared divergence-free 2D-curl operator (flow.glsl.ts) \u2014 the prototype declares\n// potentialFBM; the host defines its BODY below the splice (GLSL forward-declaration).\n\nconst float CURL_EPS = 0.012;\n\n// Scalar fbm potential psi \u2014 the host's noise basis, wrapped so the curl operator is\n// basis-agnostic. A host carrying its own fbm defines this as: return fbm(p);\nfloat potentialFBM(vec2 p);\n\n// \u2207\u00D7\u03C8 in 2D \u2014 the divergence-free flow direction. Central finite differences of the\n// scalar potential give the partials; the cross-pairing (\u2202y, \u2212\u2202x) is the 2D curl.\nvec2 curlFBM(vec2 p) {\n float dx = potentialFBM(p + vec2(CURL_EPS, 0.0)) - potentialFBM(p - vec2(CURL_EPS, 0.0));\n float dy = potentialFBM(p + vec2(0.0, CURL_EPS)) - potentialFBM(p - vec2(0.0, CURL_EPS));\n // \u03C8-gradient is (dx, dy)/(2\u00B7eps); the curl rotates it 90\u00B0: (\u2202\u03C8/\u2202y, \u2212\u2202\u03C8/\u2202x).\n vec2 g = vec2(dx, dy) / (2.0 * CURL_EPS);\n return vec2(g.y, -g.x);\n}\n\n\n// \u2500\u2500 The host noise basis (transcribes liquidGrid.ts hash21/valueNoise/potentialFBM) \u2500\u2500\nfloat hash21(float x, float y) {\n float px = fract(x * 0.1031);\n float py = fract(y * 0.1031);\n float pz = fract(x * 0.1031);\n float d = px * (py + 33.33) + py * (pz + 33.33) + pz * (px + 33.33);\n px += d;\n py += d;\n pz += d;\n return fract((px + py) * pz);\n}\n\nfloat valueNoise(float x, float y) {\n float ix = floor(x);\n float iy = floor(y);\n float fx = x - ix;\n float fy = y - iy;\n float ux = fx * fx * fx * (fx * (fx * 6.0 - 15.0) + 10.0);\n float uy = fy * fy * fy * (fy * (fy * 6.0 - 15.0) + 10.0);\n float a = hash21(ix, iy);\n float b = hash21(ix + 1.0, iy);\n float c = hash21(ix, iy + 1.0);\n float d2 = hash21(ix + 1.0, iy + 1.0);\n return mix(mix(a, b, ux), mix(c, d2, ux), uy);\n}\n\n// The 3-octave scalar fbm potential \u2014 the curl chunk's forward-declared potentialFBM body.\nfloat potentialFBM(vec2 p) {\n float v = 0.0;\n float amp = 0.5;\n float freq = 1.0;\n float px = p.x;\n float py = p.y;\n for (int i = 0; i < 3; i++) {\n v += amp * valueNoise(px * freq, py * freq);\n // FBM_ROT mat2(0.8, 0.6, -0.6, 0.8) \u2014 same rotation as the shared chunk.\n float rx = 0.8 * px - 0.6 * py;\n float ry = 0.6 * px + 0.8 * py;\n px = rx;\n py = ry;\n freq *= 2.0;\n amp *= 0.5;\n }\n return v;\n}\n\n// The shared traveling-wave WARP chunk (waveField.glsl.ts \u2014 waveFlow/cursorSwirl/\n// travelingEnvelope + the FACE leaf; spliced AFTER valueNoise + potentialFBM bodies + the curlFBM\n// chunk). liquid-grid + concentric read the SAME waveFlow continuous affine sheet-warp (the DRY\n// coupling \u2014 a leaf tune moves both, never the retired per-cell twist / LINE-warp).\n\n#ifndef WAVE_FIELD_TAU\n#define WAVE_FIELD_TAU 6.283185307179586\n#endif\n\n// The traveling-wave envelope \u2014 a moving Gaussian crest band sweeping along waveDir.\nfloat travelingEnvelope(vec2 pivot, float t, vec2 waveDir, float waveK, float waveOmega, float waveSigma) {\n float coord = dot(pivot, waveDir) * waveK - t * waveOmega;\n float crest = fract(coord / WAVE_FIELD_TAU);\n float z = (crest - 0.5) * 2.0;\n return exp(-(z * z) / max(waveSigma, 1e-3));\n}\n\n// The curl-direction scalar \u2014 the smooth low-freq director the per-cell twist follows.\nfloat curlScalar(vec2 cc, float t) {\n vec2 f = curlFBM(vec2(cc.x * 0.5 + t * 0.08, cc.y * 0.5 - t * 0.06));\n return clamp(f.x, -1.0, 1.0);\n}\n\n// The directed-twist FLOOR (the visibility cure): keep the curl SIGN (adjacent cells lean\n// together) but floor the magnitude so a crest-band cell ALWAYS rotates decisively.\n#ifndef WAVE_FIELD_TWIST_FLOOR\n#define WAVE_FIELD_TWIST_FLOOR 0.62\n#endif\nfloat directedTwist(float s, float floorMag) {\n float mag = max(floorMag, abs(s));\n float sgn = tanh(s * 6.0);\n return sgn * mag;\n}\n\n// \u2500\u2500 The FACE leaf (the structurally-absent RE-INVENT \u2014 height-lit filled cell interior) \u2500\u2500\n// Defined ABOVE cellTwist: cellTwist rides cellHeight via the driver so twist + face read ONE\n// envelope.\n\n// The sheet displacement at a cell center = the EXACT traveling-wave scalar the twist rides.\nfloat cellHeight(vec2 cc, float t, vec2 waveDir, float waveK, float waveOmega, float waveSigma, float amp) {\n return travelingEnvelope(cc, t, waveDir, waveK, waveOmega, waveSigma) * amp;\n}\n\n// The pre-twist driver (FOLD A): the cell pivot cc + the crest envelope env the twist AND the\n// face both ride. The face samples height/relief at THIS pre-twist cc (floor(twisted_g) at the\n// crest lights a NEIGHBOUR cell). cc in .xy, env in .z.\nvec3 cellDriver(vec2 g, float cellSize, float t, vec2 waveDir, float waveK, float waveOmega,\n float waveSigma, float amp) {\n float cs = max(cellSize, 1e-3);\n vec2 cc = (floor(g / cs) + 0.5) * cs;\n float env = cellHeight(cc, t, waveDir, waveK, waveOmega, waveSigma, amp);\n return vec3(cc, env);\n}\n\n// The central-difference slope of cellHeight across a cell (eps = 0.5\u00B7cellSize) \u2014 derivative-\n// FREE (NO dFdx on the height) \u2192 Safari WebGL2-safe. Returns \u2207H.\nvec2 faceRelief(vec2 cc, float cellSize, float t, vec2 waveDir, float waveK, float waveOmega,\n float waveSigma, float amp) {\n float eps = max(cellSize, 1e-3) * 0.5;\n float hxp = cellHeight(cc + vec2(eps, 0.0), t, waveDir, waveK, waveOmega, waveSigma, amp);\n float hxm = cellHeight(cc - vec2(eps, 0.0), t, waveDir, waveK, waveOmega, waveSigma, amp);\n float hyp = cellHeight(cc + vec2(0.0, eps), t, waveDir, waveK, waveOmega, waveSigma, amp);\n float hym = cellHeight(cc - vec2(0.0, eps), t, waveDir, waveK, waveOmega, waveSigma, amp);\n return vec2((hxp - hxm) / (2.0 * eps), (hyp - hym) / (2.0 * eps));\n}\n\n// Soft inset-square coverage inside a (warped) cell \u2014 the filled FACE plateau. d is the distance\n// into the cell from the nearest gutter (the Golus triangle-wave); the inset retreats as it grows\n// (the squash). aa = the shader's fwidth(g) (JS passes a fixed uvDeriv).\nfloat facePlateau(vec2 g, float inset, vec2 uvDeriv) {\n vec2 tri = 1.0 - abs(fract(g) * 2.0 - 1.0);\n float d = min(tri.x, tri.y);\n float aa = max(uvDeriv.x, uvDeriv.y) * 1.5;\n return smoothstep(inset, inset + 2.0 * aa, d);\n}\n\n// The cell-local twist about each cell's own center, gated by the traveling wave + directed\n// by the curl flow. amp is the spring-eased envelope amplitude the JS host drives. FOLD C: the\n// TWIST_FLOOR is crest-gated by env so OFF-crest cells relax to flat calm paper (the traveling\n// read, not static foil).\nvec2 cellTwist(vec2 g, float cellSize, float t, vec2 waveDir, float waveK, float waveOmega,\n float waveSigma, float twistMax, float shearMax, float amp) {\n vec3 drv = cellDriver(g, cellSize, t, waveDir, waveK, waveOmega, waveSigma, amp);\n vec2 cc = drv.xy;\n float env = drv.z;\n float floorMag = WAVE_FIELD_TWIST_FLOOR * env; // FOLD C: crest-gated floor\n float theta = twistMax * env * directedTwist(curlScalar(cc, t), floorMag);\n float shear = shearMax * env * directedTwist(curlScalar(cc + vec2(17.3, 9.1), t), floorMag);\n vec2 local = g - cc;\n float ct = cos(theta);\n float st = sin(theta);\n vec2 rot = vec2(ct * local.x - st * local.y, st * local.x + ct * local.y);\n rot.x += shear * rot.y; // a small skew so the box MORPHS, not just rotates\n return cc + rot;\n}\n\n// The CONTINUOUS traveling-wave FLOW warp \u2014 the SMOOTH twin of cellTwist (no per-cell seam;\n// for the level-set contours that shatter into a mesh under the cell discontinuity).\n// BG.W-GRID-AFFINE \u2014 warpFreq is the HOST-supplied curl-sampling spatial frequency (the caller's\n// own coordinate units): an order of magnitude BELOW its grid frequency so the warp is locally\n// affine (major lines bow as ONE smooth curve, no sub-cell crackle). liquid-grid (cell-scale g0)\n// passes ~0.03; concentric (unit-scale p) passes 0.6. The 1.833333 second-flow ratio transcribes\n// WAVE_FLOW_SECOND_RATIO. Amplitude unchanged \u2014 curl magnitude is the intrinsic gradient at the\n// fixed CURL_EPS, independent of warpFreq; the t-drift is host-agnostic.\nvec2 waveFlow(vec2 g, float t, vec2 waveDir, float waveK, float waveOmega, float waveSigma,\n float twistMax, float amp, float warpFreq) {\n float env = travelingEnvelope(g, t, waveDir, waveK, waveOmega, waveSigma) * amp;\n vec2 f = curlFBM(vec2(g.x * warpFreq + t * 0.05, g.y * warpFreq - t * 0.04));\n float wf2 = warpFreq * 1.833333;\n vec2 f2 = curlFBM(vec2(g.x * wf2 - t * 0.03, g.y * wf2 + t * 0.035));\n float k = twistMax * env;\n return g + (f + f2 * 0.5) * k;\n}\n\n// The local cursor swirl \u2014 the finger twists the cells around it (re-aimed cursorBulge).\nvec2 cursorSwirl(vec2 g, vec2 cursor, float strength, float radius) {\n vec2 to = g - cursor;\n float d2 = dot(to, to);\n float r = max(radius, 1e-4);\n float theta = strength * exp(-d2 / (2.0 * r * r));\n float ct = cos(theta);\n float st = sin(theta);\n return cursor + vec2(ct * to.x - st * to.y, st * to.x + ct * to.y);\n}\n\n// The LOW-octave value-noise topography \u2014 the scalar field concentric extracts contours of.\nfloat heightField(vec2 p, float octavesF, float seed) {\n float v = 0.0;\n float amp = 0.5;\n float freq = 1.0;\n float px = p.x + seed;\n float py = p.y - seed;\n int n = int(clamp(octavesF, 1.0, 6.0));\n for (int i = 0; i < 6; i++) {\n if (i >= n) break;\n v += amp * valueNoise(px * freq, py * freq);\n float rx = 0.8 * px - 0.6 * py;\n float ry = 0.6 * px + 0.8 * py;\n px = rx;\n py = ry;\n freq *= 2.0;\n amp *= 0.5;\n }\n return v;\n}\n\n// The \u03C9=\u221A(g\u00B7k) breathing swell \u2014 basins inflate/deflate with weight.\nfloat waveSwell(float t, float phase) {\n return sin(t * 0.35 + phase) * 0.5 + sin(t * 0.21 + phase * 1.7) * 0.5;\n}\n\n\n// \u2500\u2500 \u00A71 The Ben Golus derivative-AA grid coverage (transcribes liquidGrid.ts gridCoverage) \u2500\u2500\nfloat gridCoverage(vec2 g, float targetWidth, vec2 uvDeriv) {\n vec2 gridUV = 1.0 - abs(fract(g) * 2.0 - 1.0);\n vec2 drawWidth = clamp(vec2(targetWidth), uvDeriv, vec2(0.5));\n vec2 lineAA = uvDeriv * 1.5;\n vec2 grid2 = smoothstep(drawWidth + lineAA, drawWidth - lineAA, gridUV);\n grid2 *= clamp(vec2(targetWidth) / max(drawWidth, vec2(1e-6)), vec2(0.0), vec2(1.0));\n grid2 = mix(grid2, vec2(targetWidth), clamp(uvDeriv * 2.0 - 1.0, vec2(0.0), vec2(1.0)));\n return max(grid2.x, grid2.y);\n}\n\nvoid main() {\n float aspect = max(uAspect, 1e-4);\n vec2 uv = vec2(vUv.x * aspect, vUv.y);\n\n // \u00A75 the per-pixel kernel: AFFINE sheet-warp + cursor-swirl the grid coordinate, then two-tier\n // Golus. waveFlow is the SMOOTH continuous domain transform (the SAME warp concentric reads) \u2014\n // a low-order curl-flow displacement gated by the traveling wave, locally affine at the cell\n // scale, so the sheet bows/shears as ONE coherent transform (major lines a single smooth curve,\n // no per-cell seam); cursorSwirl twists the cells about the finger. The Golus dv reads the FINAL\n // warped coord (the crisp-line fence survives).\n vec2 g0 = uv * uGridScale;\n // BG.W-GRID-AFFINE \u2014 g0 is CELL-scale, so pass the tiny 0.03 curl-sampling frequency (== the JS\n // LIQUID_GRID_WARP_FREQ) so the warp is locally affine at the cell scale (major lines bow as ONE\n // smooth curve, no sub-cell crackle). Concentric passes 0.6 (its p is unit-scale).\n vec2 g = waveFlow(g0, uTime, uWave.xy, uWave.z, uWave.w, uWave2.x, uWave2.y, uWave2.w, 0.03);\n if (uInteractive > 0.5) {\n g = cursorSwirl(g, uCursor.xy, uCursor.z * uBulgeMode, uCursor.w);\n }\n\n // The screen-space derivative of g (Golus): length(vec2(dFdx, dFdy)) per axis (the actual\n // backing-store pixel \u2014 NOT a CSS sub-pixel, the blur-kill).\n vec2 dv = vec2(\n length(vec2(dFdx(g.x), dFdy(g.x))),\n length(vec2(dFdx(g.y), dFdy(g.y)))\n );\n\n float minor = gridCoverage(g, uGrid.x, dv);\n float me = max(uMajorEvery, 1.0);\n float major = gridCoverage(g / me, uGrid.y, dv / me);\n float line = max(minor * uGrid.z, major * uGrid.w);\n\n // \u2500\u2500 The FACE (BD.W-PAPERGRID-FACE) \u2014 height-lit filled cell interior \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n // Sample height/relief at the WARPED-space cell center (floor(g)+0.5, the cell the fragment\n // lands in under the affine warp); Lambert the \u2207H slope against the fixed cel key-light; squash\n // the inset so the crest face inflates; multi-stop warm-divergent ramp keyed on mix(shade, h)\n // (FOLD B); the ink through the production OETF (FOLD E).\n vec2 cc = floor(g) + 0.5;\n float h = cellHeight(cc, uTime, uWave.xy, uWave.z, uWave.w, uWave2.x, uWave2.w);\n vec2 grad = faceRelief(cc, 1.0, uTime, uWave.xy, uWave.z, uWave.w, uWave2.x, uWave2.w);\n vec3 n = normalize(vec3(-grad * uFace.y, 1.0));\n float shade = clamp(0.5 + dot(n, normalize(vec3(uLightDir, 1.0))) * 0.5, 0.0, 1.0);\n float inset = uFace.w * (1.0 - uFace.z * h); // squash & stretch\n float face = facePlateau(g, inset, dv);\n float rampT = clamp(shade * 0.5 + h * 0.5, 0.0, 1.0); // FOLD B \u2014 height-keyed crest\n vec3 faceInk = clamp(linearToSrgb(faceRamp(rampT)), vec3(0.0), vec3(1.0));\n float faceA = face * uFace.x * uFieldAlpha; // FOLD D \u2014 one field-blend scalar\n\n vec3 col = clamp(linearToSrgb(uLineColor), vec3(0.0), vec3(1.0));\n if (uHasBackground > 0.5) {\n vec3 bg = clamp(linearToSrgb(uBg), vec3(0.0), vec3(1.0));\n vec3 base = mix(bg, faceInk, faceA);\n float a = line * uFieldAlpha;\n fragColor = vec4(mix(base, col, a), 1.0);\n return;\n }\n // transparent ground: the FACE composites UNDER the line, the SOURCE-OVER operator in\n // PREMULTIPLIED space. faceAlpha:0 \u2192 faceA=0 \u2192 the face term vanishes \u2192 vec4(col\u00B7line, line) =\n // byte-identical to the HEAD line-only render.\n vec3 linePremult = (col * line) * uFieldAlpha; // line layer (the FieldAlpha subtlety)\n float lineA = line * uFieldAlpha;\n vec3 facePremult = faceInk * faceA; // face layer premultiplied (faceA folds field)\n vec3 outPremult = linePremult + facePremult * (1.0 - lineA);\n float a = lineA + faceA * (1.0 - lineA);\n fragColor = vec4(outPremult, a); // premultiplied over transparent\n}";
|
|
4
|
+
export declare const LIQUID_GRID_FRAG_GLSL = "#version 300 es\nprecision highp float;\n\n#define TAU 6.283185307179586\n\nin vec2 vUv;\nout vec4 fragColor;\n\nuniform float uTime;\nuniform float uGridScale;\nuniform float uMajorEvery;\nuniform float uAspect;\nuniform vec4 uWarp; // (warpScale, warpSpeed, warpScale2, warpSpeed2)\nuniform float uAmplitude;\nuniform vec4 uGrid; // (targetWidth, targetWidthMajor, minorAlpha, majorAlpha)\nuniform float uFieldAlpha;\nuniform float uHasBackground;\nuniform vec4 uCursor; // (cursorX, cursorY, swirlStrength, swirlRadius)\nuniform float uBulgeMode; // +1 repel / \u22121 attract (signs the swirl)\nuniform float uInteractive; // 1 = cursor swirl on\nuniform vec4 uWave; // (waveDirX, waveDirY, waveK, waveOmega)\nuniform vec4 uWave2; // (waveSigma, twistMax, _pad, amp) \u2014 affine sheet-warp envelope\nuniform vec3 uLineColor; // linear-sRGB ink\nuniform vec3 uBg; // linear-sRGB themed bg\n// \u2500\u2500 The FACE \u2014 the height-lit filled cell interior \u2500\u2500\nuniform vec4 uFace; // (faceAlpha, faceRelief, squashK, baseInset)\nuniform vec2 uLightDir; // the cel key-light direction\nuniform vec3 uFaceLo; // linear-sRGB rose-umber trough (FOLD B, 3-stop)\nuniform vec3 uFaceMid; // linear-sRGB ember-amber mid\nuniform vec3 uFaceHi; // linear-sRGB warm-wheat crest\n\n\nfloat srgbToLinearCh(float c) {\n return c <= 0.04045 ? c / 12.92 : pow((c + 0.055) / 1.055, 2.4);\n}\nvec3 srgbToLinear(vec3 c) {\n return vec3(srgbToLinearCh(c.r), srgbToLinearCh(c.g), srgbToLinearCh(c.b));\n}\n\nfloat linearToSrgbCh(float c) {\n return c <= 0.0031308 ? c * 12.92 : 1.055 * pow(c, 1.0 / 2.4) - 0.055;\n}\nvec3 linearToSrgb(vec3 c) {\n return vec3(linearToSrgbCh(c.r), linearToSrgbCh(c.g), linearToSrgbCh(c.b));\n}\n\n// The 3-stop warm-divergent FACE ramp (FOLD B \u2014 height-keyed, NOT a 2-point mid-park). All stops\n// warm hue \u2208 [20,90]; linear-space (the OETF runs in main, FOLD E).\nvec3 faceRamp(float rampT) {\n float s = clamp(rampT, 0.0, 1.0);\n if (s < 0.5) {\n return mix(uFaceLo, uFaceMid, s * 2.0);\n }\n return mix(uFaceMid, uFaceHi, (s - 0.5) * 2.0);\n}\n\n// The shared divergence-free 2D-curl operator (flow.glsl.ts) \u2014 the prototype declares\n// potentialFBM; the host defines its BODY below the splice (GLSL forward-declaration).\n\nconst float CURL_EPS = 0.012;\n\n// Scalar fbm potential psi \u2014 the host's noise basis, wrapped so the curl operator is\n// basis-agnostic. A host carrying its own fbm defines this as: return fbm(p);\nfloat potentialFBM(vec2 p);\n\n// \u2207\u00D7\u03C8 in 2D \u2014 the divergence-free flow direction. Central finite differences of the\n// scalar potential give the partials; the cross-pairing (\u2202y, \u2212\u2202x) is the 2D curl.\nvec2 curlFBM(vec2 p) {\n float dx = potentialFBM(p + vec2(CURL_EPS, 0.0)) - potentialFBM(p - vec2(CURL_EPS, 0.0));\n float dy = potentialFBM(p + vec2(0.0, CURL_EPS)) - potentialFBM(p - vec2(0.0, CURL_EPS));\n // \u03C8-gradient is (dx, dy)/(2\u00B7eps); the curl rotates it 90\u00B0: (\u2202\u03C8/\u2202y, \u2212\u2202\u03C8/\u2202x).\n vec2 g = vec2(dx, dy) / (2.0 * CURL_EPS);\n return vec2(g.y, -g.x);\n}\n\n\n// \u2500\u2500 The host noise basis (transcribes liquidGrid.ts hash21/valueNoise/potentialFBM) \u2500\u2500\nfloat hash21(float x, float y) {\n float px = fract(x * 0.1031);\n float py = fract(y * 0.1031);\n float pz = fract(x * 0.1031);\n float d = px * (py + 33.33) + py * (pz + 33.33) + pz * (px + 33.33);\n px += d;\n py += d;\n pz += d;\n return fract((px + py) * pz);\n}\n\nfloat valueNoise(float x, float y) {\n float ix = floor(x);\n float iy = floor(y);\n float fx = x - ix;\n float fy = y - iy;\n float ux = fx * fx * fx * (fx * (fx * 6.0 - 15.0) + 10.0);\n float uy = fy * fy * fy * (fy * (fy * 6.0 - 15.0) + 10.0);\n float a = hash21(ix, iy);\n float b = hash21(ix + 1.0, iy);\n float c = hash21(ix, iy + 1.0);\n float d2 = hash21(ix + 1.0, iy + 1.0);\n return mix(mix(a, b, ux), mix(c, d2, ux), uy);\n}\n\n// The 3-octave scalar fbm potential \u2014 the curl chunk's forward-declared potentialFBM body.\nfloat potentialFBM(vec2 p) {\n float v = 0.0;\n float amp = 0.5;\n float freq = 1.0;\n float px = p.x;\n float py = p.y;\n for (int i = 0; i < 3; i++) {\n v += amp * valueNoise(px * freq, py * freq);\n // FBM_ROT mat2(0.8, 0.6, -0.6, 0.8) \u2014 same rotation as the shared chunk.\n float rx = 0.8 * px - 0.6 * py;\n float ry = 0.6 * px + 0.8 * py;\n px = rx;\n py = ry;\n freq *= 2.0;\n amp *= 0.5;\n }\n return v;\n}\n\n// The shared traveling-wave WARP chunk (waveField.glsl.ts \u2014 waveFlow/cursorSwirl/\n// travelingEnvelope + the FACE leaf; spliced AFTER valueNoise + potentialFBM bodies + the curlFBM\n// chunk). liquid-grid + concentric read the SAME waveFlow continuous affine sheet-warp (the DRY\n// coupling \u2014 a leaf tune moves both, never the retired per-cell twist or line warp).\n\n#ifndef WAVE_FIELD_TAU\n#define WAVE_FIELD_TAU 6.283185307179586\n#endif\n\n// The traveling-wave envelope \u2014 a moving Gaussian crest band sweeping along waveDir.\nfloat travelingEnvelope(vec2 pivot, float t, vec2 waveDir, float waveK, float waveOmega, float waveSigma) {\n float coord = dot(pivot, waveDir) * waveK - t * waveOmega;\n float crest = fract(coord / WAVE_FIELD_TAU);\n float z = (crest - 0.5) * 2.0;\n return exp(-(z * z) / max(waveSigma, 1e-3));\n}\n\n// The curl-direction scalar \u2014 the smooth low-freq director the per-cell twist follows.\nfloat curlScalar(vec2 cc, float t) {\n vec2 f = curlFBM(vec2(cc.x * 0.5 + t * 0.08, cc.y * 0.5 - t * 0.06));\n return clamp(f.x, -1.0, 1.0);\n}\n\n// The directed-twist FLOOR (the visibility cure): keep the curl SIGN (adjacent cells lean\n// together) but floor the magnitude so a crest-band cell ALWAYS rotates decisively.\n#ifndef WAVE_FIELD_TWIST_FLOOR\n#define WAVE_FIELD_TWIST_FLOOR 0.62\n#endif\nfloat directedTwist(float s, float floorMag) {\n float mag = max(floorMag, abs(s));\n float sgn = tanh(s * 6.0);\n return sgn * mag;\n}\n\n// \u2500\u2500 The FACE leaf (the structurally-absent RE-INVENT \u2014 height-lit filled cell interior) \u2500\u2500\n// Defined ABOVE cellTwist: cellTwist rides cellHeight via the driver so twist + face read ONE\n// envelope.\n\n// The sheet displacement at a cell center = the EXACT traveling-wave scalar the twist rides.\nfloat cellHeight(vec2 cc, float t, vec2 waveDir, float waveK, float waveOmega, float waveSigma, float amp) {\n return travelingEnvelope(cc, t, waveDir, waveK, waveOmega, waveSigma) * amp;\n}\n\n// The pre-twist driver (FOLD A): the cell pivot cc + the crest envelope env the twist AND the\n// face both ride. The face samples height/relief at THIS pre-twist cc (floor(twisted_g) at the\n// crest lights a neighbouring cell). cc is in .xy and env in .z.\nvec3 cellDriver(vec2 g, float cellSize, float t, vec2 waveDir, float waveK, float waveOmega,\n float waveSigma, float amp) {\n float cs = max(cellSize, 1e-3);\n vec2 cc = (floor(g / cs) + 0.5) * cs;\n float env = cellHeight(cc, t, waveDir, waveK, waveOmega, waveSigma, amp);\n return vec3(cc, env);\n}\n\n// The central-difference slope of cellHeight across a cell (eps = 0.5\u00B7cellSize) \u2014 derivative-\n// FREE (NO dFdx on the height) \u2192 Safari WebGL2-safe. Returns \u2207H.\nvec2 faceRelief(vec2 cc, float cellSize, float t, vec2 waveDir, float waveK, float waveOmega,\n float waveSigma, float amp) {\n float eps = max(cellSize, 1e-3) * 0.5;\n float hxp = cellHeight(cc + vec2(eps, 0.0), t, waveDir, waveK, waveOmega, waveSigma, amp);\n float hxm = cellHeight(cc - vec2(eps, 0.0), t, waveDir, waveK, waveOmega, waveSigma, amp);\n float hyp = cellHeight(cc + vec2(0.0, eps), t, waveDir, waveK, waveOmega, waveSigma, amp);\n float hym = cellHeight(cc - vec2(0.0, eps), t, waveDir, waveK, waveOmega, waveSigma, amp);\n return vec2((hxp - hxm) / (2.0 * eps), (hyp - hym) / (2.0 * eps));\n}\n\n// Soft inset-square coverage inside a (warped) cell \u2014 the filled FACE plateau. d is the distance\n// into the cell from the nearest gutter (the Golus triangle-wave); the inset retreats as it grows\n// (the squash). aa = the shader's fwidth(g) (JS passes a fixed uvDeriv).\nfloat facePlateau(vec2 g, float inset, vec2 uvDeriv) {\n vec2 tri = 1.0 - abs(fract(g) * 2.0 - 1.0);\n float d = min(tri.x, tri.y);\n float aa = max(uvDeriv.x, uvDeriv.y) * 1.5;\n return smoothstep(inset, inset + 2.0 * aa, d);\n}\n\n// The cell-local twist about each cell's own center, gated by the traveling wave + directed\n// by the curl flow. amp is the spring-eased envelope amplitude the JS host drives. FOLD C: the\n// TWIST_FLOOR is crest-gated by env so OFF-crest cells relax to flat calm paper (the traveling\n// read, not static foil).\nvec2 cellTwist(vec2 g, float cellSize, float t, vec2 waveDir, float waveK, float waveOmega,\n float waveSigma, float twistMax, float shearMax, float amp) {\n vec3 drv = cellDriver(g, cellSize, t, waveDir, waveK, waveOmega, waveSigma, amp);\n vec2 cc = drv.xy;\n float env = drv.z;\n float floorMag = WAVE_FIELD_TWIST_FLOOR * env; // FOLD C: crest-gated floor\n float theta = twistMax * env * directedTwist(curlScalar(cc, t), floorMag);\n float shear = shearMax * env * directedTwist(curlScalar(cc + vec2(17.3, 9.1), t), floorMag);\n vec2 local = g - cc;\n float ct = cos(theta);\n float st = sin(theta);\n vec2 rot = vec2(ct * local.x - st * local.y, st * local.x + ct * local.y);\n rot.x += shear * rot.y; // a small skew so the box MORPHS, not just rotates\n return cc + rot;\n}\n\n// The CONTINUOUS traveling-wave FLOW warp \u2014 the SMOOTH twin of cellTwist (no per-cell seam;\n// for the level-set contours that shatter into a mesh under the cell discontinuity).\n// warpFreq is the host-supplied curl-sampling spatial frequency (the caller's\n// own coordinate units): an order of magnitude BELOW its grid frequency so the warp is locally\n// affine (major lines bow as one smooth curve, no sub-cell crackle). LiquidGrid (cell-scale g0)\n// passes ~0.03; concentric (unit-scale p) passes 0.6. The 1.833333 second-flow ratio transcribes\n// WAVE_FLOW_SECOND_RATIO. Amplitude unchanged \u2014 curl magnitude is the intrinsic gradient at the\n// fixed CURL_EPS, independent of warpFreq; the t-drift is host-agnostic.\nvec2 waveFlow(vec2 g, float t, vec2 waveDir, float waveK, float waveOmega, float waveSigma,\n float twistMax, float amp, float warpFreq) {\n float env = travelingEnvelope(g, t, waveDir, waveK, waveOmega, waveSigma) * amp;\n vec2 f = curlFBM(vec2(g.x * warpFreq + t * 0.05, g.y * warpFreq - t * 0.04));\n float wf2 = warpFreq * 1.833333;\n vec2 f2 = curlFBM(vec2(g.x * wf2 - t * 0.03, g.y * wf2 + t * 0.035));\n float k = twistMax * env;\n return g + (f + f2 * 0.5) * k;\n}\n\n// The local cursor swirl \u2014 the finger twists the cells around it (re-aimed cursorBulge).\nvec2 cursorSwirl(vec2 g, vec2 cursor, float strength, float radius) {\n vec2 to = g - cursor;\n float d2 = dot(to, to);\n float r = max(radius, 1e-4);\n float theta = strength * exp(-d2 / (2.0 * r * r));\n float ct = cos(theta);\n float st = sin(theta);\n return cursor + vec2(ct * to.x - st * to.y, st * to.x + ct * to.y);\n}\n\n// The LOW-octave value-noise topography \u2014 the scalar field concentric extracts contours of.\nfloat heightField(vec2 p, float octavesF, float seed) {\n float v = 0.0;\n float amp = 0.5;\n float freq = 1.0;\n float px = p.x + seed;\n float py = p.y - seed;\n int n = int(clamp(octavesF, 1.0, 6.0));\n for (int i = 0; i < 6; i++) {\n if (i >= n) break;\n v += amp * valueNoise(px * freq, py * freq);\n float rx = 0.8 * px - 0.6 * py;\n float ry = 0.6 * px + 0.8 * py;\n px = rx;\n py = ry;\n freq *= 2.0;\n amp *= 0.5;\n }\n return v;\n}\n\n// The \u03C9=\u221A(g\u00B7k) breathing swell \u2014 basins inflate/deflate with weight.\nfloat waveSwell(float t, float phase) {\n return sin(t * 0.35 + phase) * 0.5 + sin(t * 0.21 + phase * 1.7) * 0.5;\n}\n\n\n// \u2500\u2500 \u00A71 The Ben Golus derivative-AA grid coverage (transcribes liquidGrid.ts gridCoverage) \u2500\u2500\nfloat gridCoverage(vec2 g, float targetWidth, vec2 uvDeriv) {\n vec2 gridUV = 1.0 - abs(fract(g) * 2.0 - 1.0);\n vec2 drawWidth = clamp(vec2(targetWidth), uvDeriv, vec2(0.5));\n vec2 lineAA = uvDeriv * 1.5;\n vec2 grid2 = smoothstep(drawWidth + lineAA, drawWidth - lineAA, gridUV);\n grid2 *= clamp(vec2(targetWidth) / max(drawWidth, vec2(1e-6)), vec2(0.0), vec2(1.0));\n grid2 = mix(grid2, vec2(targetWidth), clamp(uvDeriv * 2.0 - 1.0, vec2(0.0), vec2(1.0)));\n return max(grid2.x, grid2.y);\n}\n\nvoid main() {\n float aspect = max(uAspect, 1e-4);\n vec2 uv = vec2(vUv.x * aspect, vUv.y);\n\n // \u00A75 the per-pixel kernel: AFFINE sheet-warp + cursor-swirl the grid coordinate, then two-tier\n // Golus. waveFlow is the SMOOTH continuous domain transform (the SAME warp concentric reads) \u2014\n // a low-order curl-flow displacement gated by the traveling wave, locally affine at the cell\n // scale, so the sheet bows/shears as ONE coherent transform (major lines a single smooth curve,\n // no per-cell seam); cursorSwirl twists the cells about the finger. The Golus dv reads the FINAL\n // warped coord (the crisp-line fence survives).\n vec2 g0 = uv * uGridScale;\n // g0 is cell-scale, so pass the tiny 0.03 curl-sampling frequency (== the JS\n // LIQUID_GRID_WARP_FREQ) so the warp is locally affine at the cell scale (major lines bow as ONE\n // smooth curve, no sub-cell crackle). Concentric passes 0.6 (its p is unit-scale).\n vec2 g = waveFlow(g0, uTime, uWave.xy, uWave.z, uWave.w, uWave2.x, uWave2.y, uWave2.w, 0.03);\n if (uInteractive > 0.5) {\n g = cursorSwirl(g, uCursor.xy, uCursor.z * uBulgeMode, uCursor.w);\n }\n\n // The screen-space derivative of g (Golus): length(vec2(dFdx, dFdy)) per axis (the actual\n // backing-store pixel \u2014 NOT a CSS sub-pixel, the blur-kill).\n vec2 dv = vec2(\n length(vec2(dFdx(g.x), dFdy(g.x))),\n length(vec2(dFdx(g.y), dFdy(g.y)))\n );\n\n float minor = gridCoverage(g, uGrid.x, dv);\n float me = max(uMajorEvery, 1.0);\n float major = gridCoverage(g / me, uGrid.y, dv / me);\n float line = max(minor * uGrid.z, major * uGrid.w);\n\n // \u2500\u2500 The FACE \u2014 height-lit filled cell interior \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n // Sample height/relief at the WARPED-space cell center (floor(g)+0.5, the cell the fragment\n // lands in under the affine warp); Lambert the \u2207H slope against the fixed cel key-light; squash\n // the inset so the crest face inflates; multi-stop warm-divergent ramp keyed on mix(shade, h)\n // (FOLD B); the ink through the production OETF (FOLD E).\n vec2 cc = floor(g) + 0.5;\n float h = cellHeight(cc, uTime, uWave.xy, uWave.z, uWave.w, uWave2.x, uWave2.w);\n vec2 grad = faceRelief(cc, 1.0, uTime, uWave.xy, uWave.z, uWave.w, uWave2.x, uWave2.w);\n vec3 n = normalize(vec3(-grad * uFace.y, 1.0));\n float shade = clamp(0.5 + dot(n, normalize(vec3(uLightDir, 1.0))) * 0.5, 0.0, 1.0);\n float inset = uFace.w * (1.0 - uFace.z * h); // squash & stretch\n float face = facePlateau(g, inset, dv);\n float rampT = clamp(shade * 0.5 + h * 0.5, 0.0, 1.0); // FOLD B \u2014 height-keyed crest\n vec3 faceInk = clamp(linearToSrgb(faceRamp(rampT)), vec3(0.0), vec3(1.0));\n float faceA = face * uFace.x * uFieldAlpha; // FOLD D \u2014 one field-blend scalar\n\n vec3 col = clamp(linearToSrgb(uLineColor), vec3(0.0), vec3(1.0));\n if (uHasBackground > 0.5) {\n vec3 bg = clamp(linearToSrgb(uBg), vec3(0.0), vec3(1.0));\n vec3 base = mix(bg, faceInk, faceA);\n float a = line * uFieldAlpha;\n fragColor = vec4(mix(base, col, a), 1.0);\n return;\n }\n // transparent ground: the FACE composites UNDER the line, the SOURCE-OVER operator in\n // PREMULTIPLIED space. faceAlpha:0 \u2192 faceA=0 \u2192 the face term vanishes \u2192 vec4(col\u00B7line, line) =\n // identical to the plain line-only render.\n vec3 linePremult = (col * line) * uFieldAlpha; // line layer (the FieldAlpha subtlety)\n float lineA = line * uFieldAlpha;\n vec3 facePremult = faceInk * faceA; // face layer premultiplied (faceA folds field)\n vec3 outPremult = linePremult + facePremult * (1.0 - lineA);\n float a = lineA + faceA * (1.0 - lineA);\n fragColor = vec4(outPremult, a); // premultiplied over transparent\n}";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIQUID_GRID_WGSL = "\nconst TAU: f32 = 6.283185307179586;\n\n// \u2500\u2500 Paper-grid uniforms (the typed-struct source-of-truth \u2014 see uniformBridgeWGPU.ts) \u2500\u2500\nstruct LiquidGridUniforms {\n // u0: (uTime, uGridScale, uMinorPitch, uMajorEvery)\n u0: vec4<f32>,\n // face: (uFaceAlpha, uFaceRelief, uSquashK, uBaseInset) \u2014 the height-lit FACE (re-points the retired warp lane)\n face: vec4<f32>,\n // warp2: (uAmplitude, uAspect, uLightDirX, uLightDirY) \u2014 aspect + the cel key-light\n warp2: vec4<f32>,\n // grid: (uTargetWidth, uTargetWidthMajor, uMinorAlpha, uMajorAlpha)\n grid: vec4<f32>,\n // field: (uFieldAlpha, uHasBackground, _pad, _pad)\n field: vec4<f32>,\n // cursor: (uCursorX, uCursorY, uSwirlStrength, uSwirlRadius)\n cursor: vec4<f32>,\n // cursor2: (uBulgeMode, uInteractive, _pad, _pad)\n cursor2: vec4<f32>,\n // line: (uLineColor.rgb (linear), _pad)\n line: vec4<f32>,\n // bg: (uBg.rgb (linear), _pad)\n bg: vec4<f32>,\n // wave: (waveDirX, waveDirY, waveK, waveOmega) \u2014 the traveling-wave crest\n wave: vec4<f32>,\n // wave2: (waveSigma, twistMax, _pad, amp) \u2014 the affine sheet-warp envelope (amp: spring-eased)\n wave2: vec4<f32>,\n // faceLo: (rose-umber trough .rgb (linear), _pad) \u2014 the warm-divergent ramp (FOLD B, 3-stop)\n faceLo: vec4<f32>,\n // faceMid: (ember-amber mid .rgb (linear), _pad)\n faceMid: vec4<f32>,\n // faceHi: (warm-wheat crest .rgb (linear), _pad)\n faceHi: vec4<f32>,\n};\n\n@group(0) @binding(0) var<uniform> u: LiquidGridUniforms;\n\n\nfn srgbToLinearCh(c: f32) -> f32 {\n if (c <= 0.04045) { return c / 12.92; }\n return pow((c + 0.055) / 1.055, 2.4);\n}\nfn srgbToLinear(c: vec3<f32>) -> vec3<f32> {\n return vec3<f32>(srgbToLinearCh(c.r), srgbToLinearCh(c.g), srgbToLinearCh(c.b));\n}\n\nfn linearToSrgbCh(c: f32) -> f32 {\n if (c <= 0.0031308) { return c * 12.92; }\n return 1.055 * pow(c, 1.0 / 2.4) - 0.055;\n}\nfn linearToSrgb(c: vec3<f32>) -> vec3<f32> {\n return vec3<f32>(linearToSrgbCh(c.r), linearToSrgbCh(c.g), linearToSrgbCh(c.b));\n}\n\n// \u2500\u2500 The host noise basis (transcribes liquidGrid.ts hash21/valueNoise/potentialFBM) \u2500\u2500\n// A quintic-faded 2D value-noise fbm potential \u2014 the SAME basis the dot-flow-field carries\n// (so the suite speaks ONE noise basis). DECLARED ABOVE the curl splice (WGSL has no forward\n// declaration \u2014 a function may only call one declared earlier).\nfn hash21(x: f32, y: f32) -> f32 {\n var px = fract(x * 0.1031);\n var py = fract(y * 0.1031);\n var pz = fract(x * 0.1031);\n let d = px * (py + 33.33) + py * (pz + 33.33) + pz * (px + 33.33);\n px = px + d;\n py = py + d;\n pz = pz + d;\n return fract((px + py) * pz);\n}\n\nfn valueNoise(x: f32, y: f32) -> f32 {\n let ix = floor(x);\n let iy = floor(y);\n let fx = x - ix;\n let fy = y - iy;\n let ux = fx * fx * fx * (fx * (fx * 6.0 - 15.0) + 10.0);\n let uy = fy * fy * fy * (fy * (fy * 6.0 - 15.0) + 10.0);\n let a = hash21(ix, iy);\n let b = hash21(ix + 1.0, iy);\n let c = hash21(ix, iy + 1.0);\n let d2 = hash21(ix + 1.0, iy + 1.0);\n return mix(mix(a, b, ux), mix(c, d2, ux), uy);\n}\n\n// The 3-octave scalar fbm potential \u2014 the host noise basis the curl operator wraps.\nfn potentialFBM(p: vec2f) -> f32 {\n var v = 0.0;\n var amp = 0.5;\n var freq = 1.0;\n var px = p.x;\n var py = p.y;\n for (var i = 0; i < 3; i = i + 1) {\n v = v + amp * valueNoise(px * freq, py * freq);\n // FBM_ROT mat2(0.8, 0.6, -0.6, 0.8) \u2014 same rotation as the shared chunk.\n let rx = 0.8 * px - 0.6 * py;\n let ry = 0.6 * px + 0.8 * py;\n px = rx;\n py = ry;\n freq = freq * 2.0;\n amp = amp * 0.5;\n }\n return v;\n}\n\n// The shared divergence-free 2D-curl operator (flow.wgsl.ts \u2014 the FIRST WGSL curl consumer).\n\nconst CURL_EPS: f32 = 0.012;\n\n// \u2207\u00D7\u03C8 in 2D \u2014 the divergence-free flow direction. Central finite differences of the\n// scalar potential give the partials; the cross-pairing (\u2202y, \u2212\u2202x) is the 2D curl.\nfn curlFBM(p: vec2f) -> vec2f {\n let dx = potentialFBM(p + vec2f(CURL_EPS, 0.0)) - potentialFBM(p - vec2f(CURL_EPS, 0.0));\n let dy = potentialFBM(p + vec2f(0.0, CURL_EPS)) - potentialFBM(p - vec2f(0.0, CURL_EPS));\n // \u03C8-gradient is (dx, dy)/(2\u00B7eps); the curl rotates it 90\u00B0: (\u2202\u03C8/\u2202y, \u2212\u2202\u03C8/\u2202x).\n let g = vec2f(dx, dy) / (2.0 * CURL_EPS);\n return vec2f(g.y, -g.x);\n}\n\n\n// The shared traveling-wave WARP chunk (waveField.wgsl.ts \u2014 waveFlow/cursorSwirl/\n// travelingEnvelope + the FACE leaf; splices AFTER valueNoise + curlFBM are declared). liquid-grid\n// + concentric read the SAME waveFlow continuous affine sheet-warp (the DRY coupling \u2014 a leaf\n// tune moves both).\n\nconst WAVE_FIELD_TAU: f32 = 6.283185307179586;\n\n// The traveling-wave envelope \u2014 a moving Gaussian crest band sweeping along waveDir.\nfn travelingEnvelope(pivot: vec2f, t: f32, waveDir: vec2f, waveK: f32, waveOmega: f32, waveSigma: f32) -> f32 {\n let coord = dot(pivot, waveDir) * waveK - t * waveOmega;\n let crest = fract(coord / WAVE_FIELD_TAU);\n let z = (crest - 0.5) * 2.0;\n return exp(-(z * z) / max(waveSigma, 1e-3));\n}\n\n// The curl-direction scalar \u2014 the smooth low-freq director the per-cell twist follows.\nfn curlScalar(cc: vec2f, t: f32) -> f32 {\n let f = curlFBM(vec2f(cc.x * 0.5 + t * 0.08, cc.y * 0.5 - t * 0.06));\n return clamp(f.x, -1.0, 1.0);\n}\n\n// The directed-twist FLOOR (the visibility cure): keep the curl SIGN (adjacent cells lean\n// together) but floor the magnitude so a crest-band cell ALWAYS rotates decisively.\nconst WAVE_FIELD_TWIST_FLOOR: f32 = 0.62;\nfn directedTwist(s: f32, floorMag: f32) -> f32 {\n let mag = max(floorMag, abs(s));\n let sgn = tanh(s * 6.0);\n return sgn * mag;\n}\n\n// \u2500\u2500 The FACE leaf (the structurally-absent RE-INVENT \u2014 height-lit filled cell interior) \u2500\u2500\n// DECLARED ABOVE cellTwist (no WGSL forward declaration): cellTwist rides cellHeight via the\n// driver so twist + face read ONE envelope.\n\n// The sheet displacement at a cell center = the EXACT traveling-wave scalar the twist rides.\nfn cellHeight(cc: vec2f, t: f32, waveDir: vec2f, waveK: f32, waveOmega: f32, waveSigma: f32, amp: f32) -> f32 {\n return travelingEnvelope(cc, t, waveDir, waveK, waveOmega, waveSigma) * amp;\n}\n\n// The pre-twist driver (FOLD A): the cell pivot cc + the crest envelope env the twist AND the\n// face both ride. The face samples height/relief at THIS pre-twist cc (the crest twist crosses\n// the cell boundary \u2192 floor(twisted_g) would light a NEIGHBOUR cell). cc in .xy, env in .z.\nfn cellDriver(g: vec2f, cellSize: f32, t: f32, waveDir: vec2f, waveK: f32, waveOmega: f32,\n waveSigma: f32, amp: f32) -> vec3f {\n let cs = max(cellSize, 1e-3);\n let cc = (floor(g / cs) + 0.5) * cs;\n let env = cellHeight(cc, t, waveDir, waveK, waveOmega, waveSigma, amp);\n return vec3f(cc, env);\n}\n\n// The central-difference slope of cellHeight across a cell (eps = 0.5\u00B7cellSize) \u2014 derivative-\n// FREE (NO dFdx on the height) \u2192 Safari WebGL2-safe. Returns \u2207H.\nfn faceRelief(cc: vec2f, cellSize: f32, t: f32, waveDir: vec2f, waveK: f32, waveOmega: f32,\n waveSigma: f32, amp: f32) -> vec2f {\n let eps = max(cellSize, 1e-3) * 0.5;\n let hxp = cellHeight(cc + vec2f(eps, 0.0), t, waveDir, waveK, waveOmega, waveSigma, amp);\n let hxm = cellHeight(cc - vec2f(eps, 0.0), t, waveDir, waveK, waveOmega, waveSigma, amp);\n let hyp = cellHeight(cc + vec2f(0.0, eps), t, waveDir, waveK, waveOmega, waveSigma, amp);\n let hym = cellHeight(cc - vec2f(0.0, eps), t, waveDir, waveK, waveOmega, waveSigma, amp);\n return vec2f((hxp - hxm) / (2.0 * eps), (hyp - hym) / (2.0 * eps));\n}\n\n// Soft inset-square coverage inside a (warped) cell \u2014 the filled FACE plateau. d is the\n// distance into the cell from the nearest gutter (the Golus triangle-wave); the inset retreats\n// as it grows (the squash). aa = the shader's fwidth(g) (JS passes a fixed uvDeriv).\nfn facePlateau(g: vec2f, inset: f32, uvDeriv: vec2f) -> f32 {\n let tri = 1.0 - abs(fract(g) * 2.0 - 1.0);\n let d = min(tri.x, tri.y);\n let aa = max(uvDeriv.x, uvDeriv.y) * 1.5;\n return smoothstep(inset, inset + 2.0 * aa, d);\n}\n\n// The cell-local twist about each cell's own center, gated by the traveling wave + directed\n// by the curl flow. amp is the spring-eased envelope amplitude the JS host drives. FOLD C: the\n// TWIST_FLOOR is crest-gated by env so OFF-crest cells relax to flat calm paper (the traveling\n// read, not static foil).\nfn cellTwist(g: vec2f, cellSize: f32, t: f32, waveDir: vec2f, waveK: f32, waveOmega: f32,\n waveSigma: f32, twistMax: f32, shearMax: f32, amp: f32) -> vec2f {\n let drv = cellDriver(g, cellSize, t, waveDir, waveK, waveOmega, waveSigma, amp);\n let cc = drv.xy;\n let env = drv.z;\n let floorMag = WAVE_FIELD_TWIST_FLOOR * env; // FOLD C: crest-gated floor\n let theta = twistMax * env * directedTwist(curlScalar(cc, t), floorMag);\n let shear = shearMax * env * directedTwist(curlScalar(cc + vec2f(17.3, 9.1), t), floorMag);\n let local = g - cc;\n let ct = cos(theta);\n let st = sin(theta);\n var rot = vec2f(ct * local.x - st * local.y, st * local.x + ct * local.y);\n rot.x = rot.x + shear * rot.y; // a small skew so the box MORPHS, not just rotates\n return cc + rot;\n}\n\n// The CONTINUOUS traveling-wave FLOW warp \u2014 the SMOOTH twin of cellTwist (no per-cell seam;\n// for the level-set contours that shatter into a mesh under the cell discontinuity).\n// BG.W-GRID-AFFINE \u2014 warpFreq is the HOST-supplied curl-sampling spatial frequency (the caller's\n// own coordinate units): an order of magnitude BELOW its grid frequency so the warp is locally\n// affine (major lines bow as ONE smooth curve, no sub-cell crackle). liquid-grid (cell-scale g0)\n// passes ~0.03; concentric (unit-scale p) passes 0.6. The 1.833333 second-flow ratio transcribes\n// WAVE_FLOW_SECOND_RATIO. Amplitude unchanged \u2014 curl magnitude is the intrinsic gradient at the\n// fixed CURL_EPS, independent of warpFreq; the t-drift is host-agnostic.\nfn waveFlow(g: vec2f, t: f32, waveDir: vec2f, waveK: f32, waveOmega: f32, waveSigma: f32,\n twistMax: f32, amp: f32, warpFreq: f32) -> vec2f {\n let env = travelingEnvelope(g, t, waveDir, waveK, waveOmega, waveSigma) * amp;\n let f = curlFBM(vec2f(g.x * warpFreq + t * 0.05, g.y * warpFreq - t * 0.04));\n let wf2 = warpFreq * 1.833333;\n let f2 = curlFBM(vec2f(g.x * wf2 - t * 0.03, g.y * wf2 + t * 0.035));\n let k = twistMax * env;\n return g + (f + f2 * 0.5) * k;\n}\n\n// The local cursor swirl \u2014 the finger twists the cells around it (re-aimed cursorBulge).\nfn cursorSwirl(g: vec2f, cursor: vec2f, strength: f32, radius: f32) -> vec2f {\n let to = g - cursor;\n let d2 = dot(to, to);\n let r = max(radius, 1e-4);\n let theta = strength * exp(-d2 / (2.0 * r * r));\n let ct = cos(theta);\n let st = sin(theta);\n return cursor + vec2f(ct * to.x - st * to.y, st * to.x + ct * to.y);\n}\n\n// The LOW-octave value-noise topography \u2014 the scalar field concentric extracts contours of.\nfn heightField(p: vec2f, octavesF: f32, seed: f32) -> f32 {\n var v = 0.0;\n var amp = 0.5;\n var freq = 1.0;\n var px = p.x + seed;\n var py = p.y - seed;\n let n = i32(clamp(octavesF, 1.0, 6.0));\n for (var i = 0; i < 6; i = i + 1) {\n if (i >= n) { break; }\n v = v + amp * valueNoise(px * freq, py * freq);\n let rx = 0.8 * px - 0.6 * py;\n let ry = 0.6 * px + 0.8 * py;\n px = rx;\n py = ry;\n freq = freq * 2.0;\n amp = amp * 0.5;\n }\n return v;\n}\n\n// The \u03C9=\u221A(g\u00B7k) breathing swell \u2014 basins inflate/deflate with weight.\nfn waveSwell(t: f32, phase: f32) -> f32 {\n return sin(t * 0.35 + phase) * 0.5 + sin(t * 0.21 + phase * 1.7) * 0.5;\n}\n\n\n// \u2500\u2500 \u00A71 The crisp line: Ben Golus derivative-AA grid coverage (transcribes gridCoverage) \u2500\u2500\n// targetWidth is the line half-width in GRID UNITS (lineWidthPx / minorPitchPx); uvDeriv is\n// the per-axis screen-space derivative of g (length(vec2(dpdx, dpdy)) per axis). Returns\n// line coverage [0..1] \u2014 exactly N device-pixels wide at ANY DPR/zoom (the blur-kill).\nfn gridCoverage(g: vec2f, targetWidth: f32, uvDeriv: vec2f) -> f32 {\n // triangle wave per axis: 0 at a line, 1 at the cell center.\n let gridUV = 1.0 - abs(fract(g) * 2.0 - 1.0);\n let drawWidth = clamp(vec2f(targetWidth), uvDeriv, vec2f(0.5));\n let lineAA = uvDeriv * 1.5;\n // smoothstep with edge0 > edge1 (Golus) \u2192 a falling edge.\n var grid2 = smoothstep(drawWidth + lineAA, drawWidth - lineAA, gridUV);\n // preserve thin-line intensity where the line is sub-drawWidth.\n grid2 = grid2 * clamp(vec2f(targetWidth) / max(drawWidth, vec2f(1e-6)), vec2f(0.0), vec2f(1.0));\n // Moir\u00E9 suppression: fade toward the average where the cell packs tighter than a pixel.\n grid2 = mix(grid2, vec2f(targetWidth), clamp(uvDeriv * 2.0 - 1.0, vec2f(0.0), vec2f(1.0)));\n return max(grid2.x, grid2.y);\n}\n\n// \u2500\u2500 The 3-stop warm-divergent FACE ramp (FOLD B \u2014 height-keyed, NOT a 2-point mid-park) \u2500\u2500\n// trough (faceLo) \u2192 mid (faceMid) \u2192 crest (faceHi), keyed on rampT = mix(shade, h). All stops\n// are warm hue \u2208 [20,90] (the teal-navy purge clear by construction). Linear-space stops; the\n// fs_main routes the result through the production OETF (FOLD E).\nfn faceRamp(rampT: f32) -> vec3f {\n let s = clamp(rampT, 0.0, 1.0);\n if (s < 0.5) {\n return mix(u.faceLo.rgb, u.faceMid.rgb, s * 2.0);\n }\n return mix(u.faceMid.rgb, u.faceHi.rgb, (s - 0.5) * 2.0);\n}\n\n// Full-screen-triangle (the pilot idiom): NDC corners (-1,-1),(3,-1),(-1,3) cover the\n// viewport from a single 3-vertex draw \u2014 no vertex buffer.\nstruct VSOut {\n @builtin(position) pos: vec4f,\n @location(0) uv: vec2f, // domain [-1,1]\u00B2, aspect-corrected x\n};\n\n@vertex\nfn vs_main(@builtin(vertex_index) vi: u32) -> VSOut {\n var corners = array<vec2f, 3>(\n vec2f(-1.0, -1.0), vec2f(3.0, -1.0), vec2f(-1.0, 3.0),\n );\n let c = corners[vi];\n var out: VSOut;\n out.pos = vec4f(c, 0.0, 1.0);\n out.uv = vec2f(c.x, c.y);\n return out;\n}\n\n@fragment\nfn fs_main(in: VSOut) -> @location(0) vec4f {\n let aspect = max(u.warp2.y, 1e-4);\n // aspect-correct the domain x so the cells read square.\n let uv = vec2f(in.uv.x * aspect, in.uv.y);\n let t = u.u0.x;\n let gridScale = u.u0.y;\n\n // \u00A75 the per-pixel kernel: AFFINE sheet-warp + cursor-swirl the grid coordinate, then two-tier\n // Golus. waveFlow is the SMOOTH continuous domain transform (the SAME warp concentric reads) \u2014\n // a low-order curl-flow displacement gated by the traveling wave, locally affine at the cell\n // scale, so the sheet bows/shears as ONE coherent transform (major lines a single smooth curve,\n // no per-cell seam); cursorSwirl twists the cells about the finger. The Golus dv reads the FINAL\n // warped coord (the crisp-line fence survives).\n let g0 = uv * gridScale;\n // BG.W-GRID-AFFINE \u2014 g0 is CELL-scale, so pass the tiny 0.03 curl-sampling frequency (== the JS\n // LIQUID_GRID_WARP_FREQ) so the warp is locally affine at the cell scale (major lines bow as ONE\n // smooth curve, no sub-cell crackle). Concentric passes 0.6 (its p is unit-scale).\n var g = waveFlow(g0, t, u.wave.xy, u.wave.z, u.wave.w, u.wave2.x, u.wave2.y, u.wave2.w, 0.03);\n if (u.cursor2.y > 0.5) {\n // bulgeMode (cursor2.x: +repel / \u2212attract) signs the swirl direction.\n g = cursorSwirl(g, u.cursor.xy, u.cursor.z * u.cursor2.x, u.cursor.w);\n }\n\n // The screen-space derivative of g (Golus): length(vec2(dpdx, dpdy)) per axis. fwidth-class\n // derivative reads the ACTUAL backing-store pixel (NOT fwidthFine \u2014 Compatibility-Mode safe).\n let dv = vec2f(\n length(vec2f(dpdx(g.x), dpdy(g.x))),\n length(vec2f(dpdx(g.y), dpdy(g.y))),\n );\n\n let minor = gridCoverage(g, u.grid.x, dv);\n // The major tier evals at g / majorEvery with its own derivative scaling.\n let me = max(u.u0.w, 1.0);\n let major = gridCoverage(g / me, u.grid.y, dv / me);\n let line = max(minor * u.grid.z, major * u.grid.w);\n\n // \u2500\u2500 The FACE (BD.W-PAPERGRID-FACE) \u2014 height-lit filled cell interior \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n // Sample height/relief at the WARPED-space cell center (floor(g)+0.5, the cell the fragment\n // lands in under the affine warp); Lambert the \u2207H slope against the fixed cel key-light; squash\n // the inset so the crest face inflates; multi-stop warm-divergent ramp keyed on mix(shade, h)\n // (FOLD B); the ink through the production OETF (FOLD E).\n let cc = floor(g) + vec2f(0.5);\n let h = cellHeight(cc, t, u.wave.xy, u.wave.z, u.wave.w, u.wave2.x, u.wave2.w);\n let grad = faceRelief(cc, 1.0, t, u.wave.xy, u.wave.z, u.wave.w, u.wave2.x, u.wave2.w);\n let n = normalize(vec3f(-grad * u.face.y, 1.0));\n let shade = clamp(0.5 + dot(n, normalize(vec3f(u.warp2.zw, 1.0))) * 0.5, 0.0, 1.0);\n let inset = u.face.w * (1.0 - u.face.z * h); // squash & stretch\n let face = facePlateau(g, inset, dv);\n let rampT = clamp(shade * 0.5 + h * 0.5, 0.0, 1.0); // FOLD B \u2014 height-keyed crest\n let faceInk = clamp(linearToSrgb(faceRamp(rampT)), vec3f(0.0), vec3f(1.0));\n let faceA = face * u.face.x * u.field.x; // FOLD D \u2014 one field-blend scalar\n\n let col = clamp(linearToSrgb(u.line.rgb), vec3f(0.0), vec3f(1.0));\n let hasBg = u.field.y;\n if (hasBg > 0.5) {\n // opaque ground: the face fills the cell, the ink over the themed bg, the line on top.\n let bg = clamp(linearToSrgb(u.bg.rgb), vec3f(0.0), vec3f(1.0));\n let base = mix(bg, faceInk, faceA);\n let a = line * u.field.x;\n let outRgb = mix(base, col, a);\n return vec4f(outRgb, 1.0);\n }\n // transparent ground: the FACE composites UNDER the line, the SOURCE-OVER operator in\n // PREMULTIPLIED space (the page reads through the gutters). faceAlpha:0 \u2192 faceA=0 \u2192 the face\n // term vanishes \u2192 vec4f(col\u00B7line, line) = byte-identical to the HEAD line-only render.\n let linePremult = (col * line) * u.field.x; // line layer (the FieldAlpha global subtlety)\n let lineA = line * u.field.x;\n let facePremult = faceInk * faceA; // face layer premultiplied (faceA folds field.x)\n let outPremult = linePremult + facePremult * (1.0 - lineA);\n let a = lineA + faceA * (1.0 - lineA);\n return vec4f(outPremult, a); // premultiplied over transparent\n}\n";
|
|
1
|
+
export declare const LIQUID_GRID_WGSL = "\nconst TAU: f32 = 6.283185307179586;\n\n// \u2500\u2500 Paper-grid uniforms (the typed-struct source-of-truth \u2014 see uniformBridgeWGPU.ts) \u2500\u2500\nstruct LiquidGridUniforms {\n // u0: (uTime, uGridScale, uMinorPitch, uMajorEvery)\n u0: vec4<f32>,\n // face: (uFaceAlpha, uFaceRelief, uSquashK, uBaseInset) \u2014 the height-lit FACE (re-points the retired warp lane)\n face: vec4<f32>,\n // warp2: (uAmplitude, uAspect, uLightDirX, uLightDirY) \u2014 aspect + the cel key-light\n warp2: vec4<f32>,\n // grid: (uTargetWidth, uTargetWidthMajor, uMinorAlpha, uMajorAlpha)\n grid: vec4<f32>,\n // field: (uFieldAlpha, uHasBackground, _pad, _pad)\n field: vec4<f32>,\n // cursor: (uCursorX, uCursorY, uSwirlStrength, uSwirlRadius)\n cursor: vec4<f32>,\n // cursor2: (uBulgeMode, uInteractive, _pad, _pad)\n cursor2: vec4<f32>,\n // line: (uLineColor.rgb (linear), _pad)\n line: vec4<f32>,\n // bg: (uBg.rgb (linear), _pad)\n bg: vec4<f32>,\n // wave: (waveDirX, waveDirY, waveK, waveOmega) \u2014 the traveling-wave crest\n wave: vec4<f32>,\n // wave2: (waveSigma, twistMax, _pad, amp) \u2014 the affine sheet-warp envelope (amp: spring-eased)\n wave2: vec4<f32>,\n // faceLo: (rose-umber trough.rgb (linear), _pad) \u2014 the warm-divergent ramp (FOLD B, 3-stop)\n faceLo: vec4<f32>,\n // faceMid: (ember-amber mid.rgb (linear), _pad)\n faceMid: vec4<f32>,\n // faceHi: (warm-wheat crest.rgb (linear), _pad)\n faceHi: vec4<f32>,\n};\n\n@group(0) @binding(0) var<uniform> u: LiquidGridUniforms;\n\n\nfn srgbToLinearCh(c: f32) -> f32 {\n if (c <= 0.04045) { return c / 12.92; }\n return pow((c + 0.055) / 1.055, 2.4);\n}\nfn srgbToLinear(c: vec3<f32>) -> vec3<f32> {\n return vec3<f32>(srgbToLinearCh(c.r), srgbToLinearCh(c.g), srgbToLinearCh(c.b));\n}\n\nfn linearToSrgbCh(c: f32) -> f32 {\n if (c <= 0.0031308) { return c * 12.92; }\n return 1.055 * pow(c, 1.0 / 2.4) - 0.055;\n}\nfn linearToSrgb(c: vec3<f32>) -> vec3<f32> {\n return vec3<f32>(linearToSrgbCh(c.r), linearToSrgbCh(c.g), linearToSrgbCh(c.b));\n}\n\n// \u2500\u2500 The host noise basis (transcribes liquidGrid.ts hash21/valueNoise/potentialFBM) \u2500\u2500\n// A quintic-faded 2D value-noise fbm potential \u2014 the SAME basis the dot-flow-field carries\n// (so the suite speaks ONE noise basis). DECLARED ABOVE the curl splice (WGSL has no forward\n// declaration \u2014 a function may only call one declared earlier).\nfn hash21(x: f32, y: f32) -> f32 {\n var px = fract(x * 0.1031);\n var py = fract(y * 0.1031);\n var pz = fract(x * 0.1031);\n let d = px * (py + 33.33) + py * (pz + 33.33) + pz * (px + 33.33);\n px = px + d;\n py = py + d;\n pz = pz + d;\n return fract((px + py) * pz);\n}\n\nfn valueNoise(x: f32, y: f32) -> f32 {\n let ix = floor(x);\n let iy = floor(y);\n let fx = x - ix;\n let fy = y - iy;\n let ux = fx * fx * fx * (fx * (fx * 6.0 - 15.0) + 10.0);\n let uy = fy * fy * fy * (fy * (fy * 6.0 - 15.0) + 10.0);\n let a = hash21(ix, iy);\n let b = hash21(ix + 1.0, iy);\n let c = hash21(ix, iy + 1.0);\n let d2 = hash21(ix + 1.0, iy + 1.0);\n return mix(mix(a, b, ux), mix(c, d2, ux), uy);\n}\n\n// The 3-octave scalar fbm potential \u2014 the host noise basis the curl operator wraps.\nfn potentialFBM(p: vec2f) -> f32 {\n var v = 0.0;\n var amp = 0.5;\n var freq = 1.0;\n var px = p.x;\n var py = p.y;\n for (var i = 0; i < 3; i = i + 1) {\n v = v + amp * valueNoise(px * freq, py * freq);\n // FBM_ROT mat2(0.8, 0.6, -0.6, 0.8) \u2014 same rotation as the shared chunk.\n let rx = 0.8 * px - 0.6 * py;\n let ry = 0.6 * px + 0.8 * py;\n px = rx;\n py = ry;\n freq = freq * 2.0;\n amp = amp * 0.5;\n }\n return v;\n}\n\n// The shared divergence-free 2D-curl operator (flow.wgsl.ts \u2014 the FIRST WGSL curl consumer).\n\nconst CURL_EPS: f32 = 0.012;\n\n// \u2207\u00D7\u03C8 in 2D \u2014 the divergence-free flow direction. Central finite differences of the\n// scalar potential give the partials; the cross-pairing (\u2202y, \u2212\u2202x) is the 2D curl.\nfn curlFBM(p: vec2f) -> vec2f {\n let dx = potentialFBM(p + vec2f(CURL_EPS, 0.0)) - potentialFBM(p - vec2f(CURL_EPS, 0.0));\n let dy = potentialFBM(p + vec2f(0.0, CURL_EPS)) - potentialFBM(p - vec2f(0.0, CURL_EPS));\n // \u03C8-gradient is (dx, dy)/(2\u00B7eps); the curl rotates it 90\u00B0: (\u2202\u03C8/\u2202y, \u2212\u2202\u03C8/\u2202x).\n let g = vec2f(dx, dy) / (2.0 * CURL_EPS);\n return vec2f(g.y, -g.x);\n}\n\n\n// The shared traveling-wave WARP chunk (waveField.wgsl.ts \u2014 waveFlow/cursorSwirl/\n// travelingEnvelope + the FACE leaf; splices AFTER valueNoise + curlFBM are declared). liquid-grid\n// + concentric read the SAME waveFlow continuous affine sheet-warp (the DRY coupling \u2014 a leaf\n// tune moves both).\n\nconst WAVE_FIELD_TAU: f32 = 6.283185307179586;\n\n// The traveling-wave envelope \u2014 a moving Gaussian crest band sweeping along waveDir.\nfn travelingEnvelope(pivot: vec2f, t: f32, waveDir: vec2f, waveK: f32, waveOmega: f32, waveSigma: f32) -> f32 {\n let coord = dot(pivot, waveDir) * waveK - t * waveOmega;\n let crest = fract(coord / WAVE_FIELD_TAU);\n let z = (crest - 0.5) * 2.0;\n return exp(-(z * z) / max(waveSigma, 1e-3));\n}\n\n// The curl-direction scalar \u2014 the smooth low-freq director the per-cell twist follows.\nfn curlScalar(cc: vec2f, t: f32) -> f32 {\n let f = curlFBM(vec2f(cc.x * 0.5 + t * 0.08, cc.y * 0.5 - t * 0.06));\n return clamp(f.x, -1.0, 1.0);\n}\n\n// The directed-twist FLOOR (the visibility cure): keep the curl SIGN (adjacent cells lean\n// together) but floor the magnitude so a crest-band cell ALWAYS rotates decisively.\nconst WAVE_FIELD_TWIST_FLOOR: f32 = 0.62;\nfn directedTwist(s: f32, floorMag: f32) -> f32 {\n let mag = max(floorMag, abs(s));\n let sgn = tanh(s * 6.0);\n return sgn * mag;\n}\n\n// \u2500\u2500 The FACE leaf (the structurally-absent RE-INVENT \u2014 height-lit filled cell interior) \u2500\u2500\n// DECLARED ABOVE cellTwist (no WGSL forward declaration): cellTwist rides cellHeight via the\n// driver so twist + face read ONE envelope.\n\n// The sheet displacement at a cell center = the EXACT traveling-wave scalar the twist rides.\nfn cellHeight(cc: vec2f, t: f32, waveDir: vec2f, waveK: f32, waveOmega: f32, waveSigma: f32, amp: f32) -> f32 {\n return travelingEnvelope(cc, t, waveDir, waveK, waveOmega, waveSigma) * amp;\n}\n\n// The pre-twist driver (FOLD A): the cell pivot cc + the crest envelope env the twist AND the\n// face both ride. The face samples height/relief at THIS pre-twist cc (the crest twist crosses\n// the cell boundary \u2192 floor(twisted_g) would light a neighbouring cell). cc is in .xy and env in .z.\nfn cellDriver(g: vec2f, cellSize: f32, t: f32, waveDir: vec2f, waveK: f32, waveOmega: f32,\n waveSigma: f32, amp: f32) -> vec3f {\n let cs = max(cellSize, 1e-3);\n let cc = (floor(g / cs) + 0.5) * cs;\n let env = cellHeight(cc, t, waveDir, waveK, waveOmega, waveSigma, amp);\n return vec3f(cc, env);\n}\n\n// The central-difference slope of cellHeight across a cell (eps = 0.5\u00B7cellSize) \u2014 derivative-\n// FREE (NO dFdx on the height) \u2192 Safari WebGL2-safe. Returns \u2207H.\nfn faceRelief(cc: vec2f, cellSize: f32, t: f32, waveDir: vec2f, waveK: f32, waveOmega: f32,\n waveSigma: f32, amp: f32) -> vec2f {\n let eps = max(cellSize, 1e-3) * 0.5;\n let hxp = cellHeight(cc + vec2f(eps, 0.0), t, waveDir, waveK, waveOmega, waveSigma, amp);\n let hxm = cellHeight(cc - vec2f(eps, 0.0), t, waveDir, waveK, waveOmega, waveSigma, amp);\n let hyp = cellHeight(cc + vec2f(0.0, eps), t, waveDir, waveK, waveOmega, waveSigma, amp);\n let hym = cellHeight(cc - vec2f(0.0, eps), t, waveDir, waveK, waveOmega, waveSigma, amp);\n return vec2f((hxp - hxm) / (2.0 * eps), (hyp - hym) / (2.0 * eps));\n}\n\n// Soft inset-square coverage inside a (warped) cell \u2014 the filled FACE plateau. d is the\n// distance into the cell from the nearest gutter (the Golus triangle-wave); the inset retreats\n// as it grows (the squash). aa = the shader's fwidth(g) (JS passes a fixed uvDeriv).\nfn facePlateau(g: vec2f, inset: f32, uvDeriv: vec2f) -> f32 {\n let tri = 1.0 - abs(fract(g) * 2.0 - 1.0);\n let d = min(tri.x, tri.y);\n let aa = max(uvDeriv.x, uvDeriv.y) * 1.5;\n return smoothstep(inset, inset + 2.0 * aa, d);\n}\n\n// The cell-local twist about each cell's own center, gated by the traveling wave + directed\n// by the curl flow. amp is the spring-eased envelope amplitude the JS host drives. FOLD C: the\n// TWIST_FLOOR is crest-gated by env so OFF-crest cells relax to flat calm paper (the traveling\n// read, not static foil).\nfn cellTwist(g: vec2f, cellSize: f32, t: f32, waveDir: vec2f, waveK: f32, waveOmega: f32,\n waveSigma: f32, twistMax: f32, shearMax: f32, amp: f32) -> vec2f {\n let drv = cellDriver(g, cellSize, t, waveDir, waveK, waveOmega, waveSigma, amp);\n let cc = drv.xy;\n let env = drv.z;\n let floorMag = WAVE_FIELD_TWIST_FLOOR * env; // FOLD C: crest-gated floor\n let theta = twistMax * env * directedTwist(curlScalar(cc, t), floorMag);\n let shear = shearMax * env * directedTwist(curlScalar(cc + vec2f(17.3, 9.1), t), floorMag);\n let local = g - cc;\n let ct = cos(theta);\n let st = sin(theta);\n var rot = vec2f(ct * local.x - st * local.y, st * local.x + ct * local.y);\n rot.x = rot.x + shear * rot.y; // a small skew so the box MORPHS, not just rotates\n return cc + rot;\n}\n\n// The CONTINUOUS traveling-wave FLOW warp \u2014 the SMOOTH twin of cellTwist (no per-cell seam;\n// for the level-set contours that shatter into a mesh under the cell discontinuity).\n// warpFreq is the host-supplied curl-sampling spatial frequency (the caller's\n// own coordinate units): an order of magnitude BELOW its grid frequency so the warp is locally\n// affine (major lines bow as one smooth curve, no sub-cell crackle). LiquidGrid (cell-scale g0)\n// passes ~0.03; concentric (unit-scale p) passes 0.6. The 1.833333 second-flow ratio transcribes\n// WAVE_FLOW_SECOND_RATIO. Amplitude unchanged \u2014 curl magnitude is the intrinsic gradient at the\n// fixed CURL_EPS, independent of warpFreq; the t-drift is host-agnostic.\nfn waveFlow(g: vec2f, t: f32, waveDir: vec2f, waveK: f32, waveOmega: f32, waveSigma: f32,\n twistMax: f32, amp: f32, warpFreq: f32) -> vec2f {\n let env = travelingEnvelope(g, t, waveDir, waveK, waveOmega, waveSigma) * amp;\n let f = curlFBM(vec2f(g.x * warpFreq + t * 0.05, g.y * warpFreq - t * 0.04));\n let wf2 = warpFreq * 1.833333;\n let f2 = curlFBM(vec2f(g.x * wf2 - t * 0.03, g.y * wf2 + t * 0.035));\n let k = twistMax * env;\n return g + (f + f2 * 0.5) * k;\n}\n\n// The local cursor swirl \u2014 the finger twists the cells around it (re-aimed cursorBulge).\nfn cursorSwirl(g: vec2f, cursor: vec2f, strength: f32, radius: f32) -> vec2f {\n let to = g - cursor;\n let d2 = dot(to, to);\n let r = max(radius, 1e-4);\n let theta = strength * exp(-d2 / (2.0 * r * r));\n let ct = cos(theta);\n let st = sin(theta);\n return cursor + vec2f(ct * to.x - st * to.y, st * to.x + ct * to.y);\n}\n\n// The LOW-octave value-noise topography \u2014 the scalar field concentric extracts contours of.\nfn heightField(p: vec2f, octavesF: f32, seed: f32) -> f32 {\n var v = 0.0;\n var amp = 0.5;\n var freq = 1.0;\n var px = p.x + seed;\n var py = p.y - seed;\n let n = i32(clamp(octavesF, 1.0, 6.0));\n for (var i = 0; i < 6; i = i + 1) {\n if (i >= n) { break; }\n v = v + amp * valueNoise(px * freq, py * freq);\n let rx = 0.8 * px - 0.6 * py;\n let ry = 0.6 * px + 0.8 * py;\n px = rx;\n py = ry;\n freq = freq * 2.0;\n amp = amp * 0.5;\n }\n return v;\n}\n\n// The \u03C9=\u221A(g\u00B7k) breathing swell \u2014 basins inflate/deflate with weight.\nfn waveSwell(t: f32, phase: f32) -> f32 {\n return sin(t * 0.35 + phase) * 0.5 + sin(t * 0.21 + phase * 1.7) * 0.5;\n}\n\n\n// \u2500\u2500 \u00A71 The crisp line: Ben Golus derivative-AA grid coverage (transcribes gridCoverage) \u2500\u2500\n// targetWidth is the line half-width in grid units (lineWidthPx / minorPitchPx); uvDeriv is\n// the per-axis screen-space derivative of g (length(vec2(dpdx, dpdy)) per axis). Returns\n// line coverage [0..1] \u2014 exactly N device-pixels wide at ANY DPR/zoom (the blur-kill).\nfn gridCoverage(g: vec2f, targetWidth: f32, uvDeriv: vec2f) -> f32 {\n // triangle wave per axis: 0 at a line, 1 at the cell center.\n let gridUV = 1.0 - abs(fract(g) * 2.0 - 1.0);\n let drawWidth = clamp(vec2f(targetWidth), uvDeriv, vec2f(0.5));\n let lineAA = uvDeriv * 1.5;\n // smoothstep with edge0 > edge1 (Golus) \u2192 a falling edge.\n var grid2 = smoothstep(drawWidth + lineAA, drawWidth - lineAA, gridUV);\n // preserve thin-line intensity where the line is sub-drawWidth.\n grid2 = grid2 * clamp(vec2f(targetWidth) / max(drawWidth, vec2f(1e-6)), vec2f(0.0), vec2f(1.0));\n // Moir\u00E9 suppression: fade toward the average where the cell packs tighter than a pixel.\n grid2 = mix(grid2, vec2f(targetWidth), clamp(uvDeriv * 2.0 - 1.0, vec2f(0.0), vec2f(1.0)));\n return max(grid2.x, grid2.y);\n}\n\n// \u2500\u2500 The 3-stop warm-divergent FACE ramp (FOLD B \u2014 height-keyed, NOT a 2-point mid-park) \u2500\u2500\n// trough (faceLo) \u2192 mid (faceMid) \u2192 crest (faceHi), keyed on rampT = mix(shade, h). All stops\n// are warm hue \u2208 [20,90] (the teal-navy purge clear by construction). Linear-space stops; the\n// fs_main routes the result through the production OETF (FOLD E).\nfn faceRamp(rampT: f32) -> vec3f {\n let s = clamp(rampT, 0.0, 1.0);\n if (s < 0.5) {\n return mix(u.faceLo.rgb, u.faceMid.rgb, s * 2.0);\n }\n return mix(u.faceMid.rgb, u.faceHi.rgb, (s - 0.5) * 2.0);\n}\n\n// Full-screen-triangle (the pilot idiom): NDC corners (-1,-1),(3,-1),(-1,3) cover the\n// viewport from a single 3-vertex draw \u2014 no vertex buffer.\nstruct VSOut {\n @builtin(position) pos: vec4f,\n @location(0) uv: vec2f, // domain [-1,1]\u00B2, aspect-corrected x\n};\n\n@vertex\nfn vs_main(@builtin(vertex_index) vi: u32) -> VSOut {\n var corners = array<vec2f, 3>(\n vec2f(-1.0, -1.0), vec2f(3.0, -1.0), vec2f(-1.0, 3.0),\n );\n let c = corners[vi];\n var out: VSOut;\n out.pos = vec4f(c, 0.0, 1.0);\n out.uv = vec2f(c.x, c.y);\n return out;\n}\n\n@fragment\nfn fs_main(in: VSOut) -> @location(0) vec4f {\n let aspect = max(u.warp2.y, 1e-4);\n // aspect-correct the domain x so the cells read square.\n let uv = vec2f(in.uv.x * aspect, in.uv.y);\n let t = u.u0.x;\n let gridScale = u.u0.y;\n\n // \u00A75 the per-pixel kernel: AFFINE sheet-warp + cursor-swirl the grid coordinate, then two-tier\n // Golus. waveFlow is the SMOOTH continuous domain transform (the SAME warp concentric reads) \u2014\n // a low-order curl-flow displacement gated by the traveling wave, locally affine at the cell\n // scale, so the sheet bows/shears as ONE coherent transform (major lines a single smooth curve,\n // no per-cell seam); cursorSwirl twists the cells about the finger. The Golus dv reads the FINAL\n // warped coord (the crisp-line fence survives).\n let g0 = uv * gridScale;\n // g0 is CELL-scale, so pass the tiny 0.03 curl-sampling frequency (== the JS\n // LIQUID_GRID_WARP_FREQ) so the warp is locally affine at the cell scale (major lines bow as ONE\n // smooth curve, no sub-cell crackle). Concentric passes 0.6 (its p is unit-scale).\n var g = waveFlow(g0, t, u.wave.xy, u.wave.z, u.wave.w, u.wave2.x, u.wave2.y, u.wave2.w, 0.03);\n if (u.cursor2.y > 0.5) {\n // bulgeMode (cursor2.x: +repel, \u2212attract) signs the swirl direction.\n g = cursorSwirl(g, u.cursor.xy, u.cursor.z * u.cursor2.x, u.cursor.w);\n }\n\n // The screen-space derivative of g (Golus): length(vec2(dpdx, dpdy)) per axis. fwidth-class\n // derivative reads the ACTUAL backing-store pixel (NOT fwidthFine \u2014 Compatibility-Mode safe).\n let dv = vec2f(\n length(vec2f(dpdx(g.x), dpdy(g.x))),\n length(vec2f(dpdx(g.y), dpdy(g.y))),\n );\n\n let minor = gridCoverage(g, u.grid.x, dv);\n // The major tier evaluates at g / majorEvery with its own derivative scaling.\n let me = max(u.u0.w, 1.0);\n let major = gridCoverage(g / me, u.grid.y, dv / me);\n let line = max(minor * u.grid.z, major * u.grid.w);\n\n // \u2500\u2500 The FACE \u2014 height-lit filled cell interior \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n // Sample height/relief at the WARPED-space cell center (floor(g)+0.5, the cell the fragment\n // lands in under the affine warp); Lambert the \u2207H slope against the fixed cel key-light; squash\n // the inset so the crest face inflates; multi-stop warm-divergent ramp keyed on mix(shade, h)\n // (FOLD B); the ink through the production OETF (FOLD E).\n let cc = floor(g) + vec2f(0.5);\n let h = cellHeight(cc, t, u.wave.xy, u.wave.z, u.wave.w, u.wave2.x, u.wave2.w);\n let grad = faceRelief(cc, 1.0, t, u.wave.xy, u.wave.z, u.wave.w, u.wave2.x, u.wave2.w);\n let n = normalize(vec3f(-grad * u.face.y, 1.0));\n let shade = clamp(0.5 + dot(n, normalize(vec3f(u.warp2.zw, 1.0))) * 0.5, 0.0, 1.0);\n let inset = u.face.w * (1.0 - u.face.z * h); // squash & stretch\n let face = facePlateau(g, inset, dv);\n let rampT = clamp(shade * 0.5 + h * 0.5, 0.0, 1.0); // FOLD B \u2014 height-keyed crest\n let faceInk = clamp(linearToSrgb(faceRamp(rampT)), vec3f(0.0), vec3f(1.0));\n let faceA = face * u.face.x * u.field.x; // FOLD D \u2014 one field-blend scalar\n\n let col = clamp(linearToSrgb(u.line.rgb), vec3f(0.0), vec3f(1.0));\n let hasBg = u.field.y;\n if (hasBg > 0.5) {\n // opaque ground: the face fills the cell, the ink over the themed bg, the line on top.\n let bg = clamp(linearToSrgb(u.bg.rgb), vec3f(0.0), vec3f(1.0));\n let base = mix(bg, faceInk, faceA);\n let a = line * u.field.x;\n let outRgb = mix(base, col, a);\n return vec4f(outRgb, 1.0);\n }\n // transparent ground: the FACE composites UNDER the line, the SOURCE-OVER operator in\n // PREMULTIPLIED space (the page reads through the gutters). faceAlpha:0 \u2192 faceA=0 \u2192 the face\n // term vanishes \u2192 vec4f(col\u00B7line, line) = the line-only render.\n let linePremult = (col * line) * u.field.x; // line layer (the FieldAlpha global subtlety)\n let lineA = line * u.field.x;\n let facePremult = faceInk * faceA; // face layer premultiplied (faceA folds field.x)\n let outPremult = linePremult + facePremult * (1.0 - lineA);\n let a = lineA + faceA * (1.0 - lineA);\n return vec4f(outPremult, a); // premultiplied over transparent\n}\n";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { MetricProps } from "./types";
|
|
2
|
+
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {}, __VLS_7: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
label?: (props: typeof __VLS_1) => any;
|
|
5
|
+
} & {
|
|
6
|
+
value?: (props: typeof __VLS_3) => any;
|
|
7
|
+
} & {
|
|
8
|
+
unit?: (props: typeof __VLS_5) => any;
|
|
9
|
+
} & {
|
|
10
|
+
context?: (props: typeof __VLS_7) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_base: import("vue").DefineComponent<MetricProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MetricProps> & Readonly<{}>, {
|
|
13
|
+
size: import("./types").MetricSize;
|
|
14
|
+
orientation: import("./types").MetricOrientation;
|
|
15
|
+
loading: boolean;
|
|
16
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
18
|
+
declare const _default: typeof __VLS_export;
|
|
19
|
+
export default _default;
|
|
20
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
21
|
+
new (): {
|
|
22
|
+
$slots: S;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { MetricCellProps } from "./types";
|
|
2
|
+
declare var __VLS_1: {}, __VLS_8: {}, __VLS_10: {}, __VLS_12: {}, __VLS_14: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
icon?: (props: typeof __VLS_1) => any;
|
|
5
|
+
} & {
|
|
6
|
+
label?: (props: typeof __VLS_8) => any;
|
|
7
|
+
} & {
|
|
8
|
+
value?: (props: typeof __VLS_10) => any;
|
|
9
|
+
} & {
|
|
10
|
+
unit?: (props: typeof __VLS_12) => any;
|
|
11
|
+
} & {
|
|
12
|
+
context?: (props: typeof __VLS_14) => any;
|
|
13
|
+
};
|
|
14
|
+
declare const __VLS_base: import("vue").DefineComponent<MetricCellProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MetricCellProps> & Readonly<{}>, {
|
|
15
|
+
loading: boolean;
|
|
16
|
+
iconSize: number;
|
|
17
|
+
iconStrokeWidth: number;
|
|
18
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { MetricRowProps } from "./types";
|
|
2
|
+
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {}, __VLS_7: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
label?: (props: typeof __VLS_1) => any;
|
|
5
|
+
} & {
|
|
6
|
+
context?: (props: typeof __VLS_3) => any;
|
|
7
|
+
} & {
|
|
8
|
+
value?: (props: typeof __VLS_5) => any;
|
|
9
|
+
} & {
|
|
10
|
+
unit?: (props: typeof __VLS_7) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_base: import("vue").DefineComponent<MetricRowProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MetricRowProps> & Readonly<{}>, {
|
|
13
|
+
loading: boolean;
|
|
14
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { MetricStackProps } from "./types";
|
|
2
|
+
declare var __VLS_1: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
default?: (props: typeof __VLS_1) => any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_base: import("vue").DefineComponent<MetricStackProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MetricStackProps> & Readonly<{}>, {
|
|
7
|
+
density: import("./types").MetricDensity;
|
|
8
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
12
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
13
|
+
new (): {
|
|
14
|
+
$slots: S;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -1,29 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/** The value type every Metric* primary field accepts. */
|
|
4
|
-
export type MetricValue = string | number | null | undefined;
|
|
5
|
-
/**
|
|
6
|
-
* The shared value-props shape the four Metric* surfaces extend (each adds its
|
|
7
|
-
* own register-specific props on top — icon, label, size, density, …).
|
|
8
|
-
*/
|
|
9
|
-
export interface MetricValueProps {
|
|
10
|
-
/** The primary metric. A valid `0` renders `"0"`, never the placeholder. */
|
|
11
|
-
value?: MetricValue;
|
|
12
|
-
/** Unit suffix appended after the value (e.g. "Mbps", "ms"). */
|
|
13
|
-
unit?: string;
|
|
14
|
-
/** Substitute glyph when the value is empty (null / undefined / ""). */
|
|
15
|
-
placeholder?: string;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* The canonical empty-value substitution for the Metric* family.
|
|
19
|
-
*
|
|
20
|
-
* Returns BOTH the display string AND the `isEmpty` flag so a surface's
|
|
21
|
-
* muted/color gates read `isEmpty` (the correct empty signal) rather than the
|
|
22
|
-
* truthy `!value` (the bug — `!0` is `true`). `coalesceMetric(0)` →
|
|
23
|
-
* `{ display: "0", isEmpty: false }`, so a `0` is NOT muted and DOES get its
|
|
24
|
-
* color; only `null` / `undefined` / `""` are empty.
|
|
25
|
-
*/
|
|
26
|
-
export declare function coalesceMetric(value: MetricValue, placeholder?: string): {
|
|
1
|
+
import type { MetricValue } from "./types";
|
|
2
|
+
interface CoalescedMetric {
|
|
27
3
|
display: string;
|
|
28
|
-
|
|
29
|
-
|
|
4
|
+
empty: boolean;
|
|
5
|
+
loading: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function coalesceMetric(value: MetricValue, placeholder?: string, loading?: boolean): CoalescedMetric;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as Metric } from "./Metric.vue";
|
|
2
|
+
export { default as MetricCell } from "./MetricCell.vue";
|
|
3
|
+
export { default as MetricRow } from "./MetricRow.vue";
|
|
4
|
+
export { default as MetricStack } from "./MetricStack.vue";
|
|
5
|
+
export type { MetricCellProps, MetricDensity, MetricOrientation, MetricProps, MetricRowProps, MetricSize, MetricStackProps, MetricValue, MetricValueProps, } from "./types";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer components { :where(.metric, .metric-cell, .metric-row) { min-inline-size: 0; color: var(--foreground); } .metric { display: inline-grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); align-items: baseline; gap: 0.125rem 0.5rem; } .metric[data-orientation="stacked"] { grid-template-columns: minmax(0, 1fr); } .metric__label, .metric__context { min-inline-size: 0; overflow-wrap: anywhere; color: var(--muted-foreground); } .metric__label { font-size: var(--type-micro); font-weight: 550; letter-spacing: var(--type-tracking-wide); text-transform: uppercase; } .metric__context { grid-column: 1 / -1; font-size: var(--type-caption); line-height: 1.35; } .metric__reading { display: inline-flex; min-inline-size: 0; align-items: baseline; gap: 0.3em; } .metric__value { min-inline-size: 3ch; overflow-wrap: anywhere; font-family: var(--font-mono); font-size: var(--type-prose); font-weight: 650; font-variant-numeric: tabular-nums lining-nums; letter-spacing: var(--type-tracking-tight); line-height: 1; } .metric__unit { flex: none; color: var(--muted-foreground); font-family: var(--font-mono); font-size: var(--type-caption); line-height: 1; } .metric[data-size="sm"] .metric__value { font-size: var(--type-small); } .metric[data-size="lg"] .metric__value, .metric-cell .metric__value { font-size: var(--type-title); } .metric[data-size="xl"] .metric__value { font-size: var(--type-display-3); } :where(.metric, .metric-cell, .metric-row)[data-empty] .metric__value { color: var(--muted-foreground); } :where(.metric, .metric-cell, .metric-row)[data-loading] .metric__value { color: transparent; border-radius: var(--radius-sm); background: var(--surface-tint-15); } :where(.metric, .metric-cell, .metric-row)[data-loading] .metric__unit { visibility: hidden; } .metric-cell { display: grid; align-content: start; gap: 0.375rem; padding: clamp(0.75rem, 2cqi, 1rem); border: 1px solid var(--glass-border-wash); border-radius: var(--radius-card); background: var(--glass-bg-wash); -webkit-backdrop-filter: var(--glass-blur-wash); backdrop-filter: var(--glass-blur-wash); } .metric-cell__heading { display: flex; min-inline-size: 0; align-items: center; gap: 0.375rem; } .metric-cell__icon { flex: none; color: var(--muted-foreground); } .metric-stack { container: metric-stack / inline-size; display: grid; grid-template-columns: minmax(7rem, 1fr) minmax(0, auto); gap: 0.75rem 1.25rem; inline-size: 100%; } .metric-stack[data-density="compact"] { gap: 0.5rem 1rem; } .metric-row { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: baseline; padding-block: 0.25rem; } .metric-row__term { display: grid; min-inline-size: 0; gap: 0.125rem; } .metric-row > .metric__reading { justify-self: end; } .metric-row .metric__context { grid-column: auto; } @container metric-stack (max-width: 24rem) { .metric-row { grid-template-columns: minmax(0, 1fr); gap: 0.25rem; } .metric-row > .metric__reading { justify-self: start; } } }
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Component, FunctionalComponent, HTMLAttributes } from "vue";
|
|
2
|
+
export type MetricValue = string | number | null | undefined;
|
|
3
|
+
export type MetricSize = "sm" | "md" | "lg" | "xl";
|
|
4
|
+
export type MetricOrientation = "inline" | "stacked";
|
|
5
|
+
export type MetricDensity = "default" | "compact";
|
|
6
|
+
export interface MetricValueProps {
|
|
7
|
+
value?: MetricValue;
|
|
8
|
+
unit?: string;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
}
|
|
12
|
+
interface MetricTextProps extends MetricValueProps {
|
|
13
|
+
label?: string;
|
|
14
|
+
context?: string;
|
|
15
|
+
class?: HTMLAttributes["class"];
|
|
16
|
+
}
|
|
17
|
+
export interface MetricProps extends MetricTextProps {
|
|
18
|
+
size?: MetricSize;
|
|
19
|
+
orientation?: MetricOrientation;
|
|
20
|
+
}
|
|
21
|
+
export interface MetricCellProps extends MetricTextProps {
|
|
22
|
+
icon?: Component | FunctionalComponent | object | null;
|
|
23
|
+
iconSize?: number;
|
|
24
|
+
iconStrokeWidth?: number;
|
|
25
|
+
}
|
|
26
|
+
export interface MetricRowProps extends MetricTextProps {
|
|
27
|
+
}
|
|
28
|
+
export interface MetricStackProps {
|
|
29
|
+
density?: MetricDensity;
|
|
30
|
+
class?: HTMLAttributes["class"];
|
|
31
|
+
}
|
|
32
|
+
export {};
|