@yahoo/uds-v5-wip 1.60.0 → 1.62.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/dist/config/dist/AssetGroup.d.ts +75 -0
- package/dist/config/dist/AssetGroup.js +114 -0
- package/dist/config/dist/Component.d.ts +309 -0
- package/dist/config/dist/Component.js +897 -0
- package/dist/config/dist/ComponentGroup.d.ts +21 -0
- package/dist/config/dist/ComponentGroup.js +46 -0
- package/dist/config/dist/CompositeStyle.d.ts +28 -0
- package/dist/config/dist/CompositeStyle.js +52 -0
- package/dist/config/dist/Config.d.ts +422 -0
- package/dist/config/dist/Config.js +1426 -0
- package/dist/config/dist/Mode.d.ts +42 -0
- package/dist/config/dist/Mode.js +81 -0
- package/dist/config/dist/Modifier.d.ts +52 -0
- package/dist/config/dist/Modifier.js +97 -0
- package/dist/config/dist/MotionDef.d.ts +50 -0
- package/dist/config/dist/MotionDef.js +97 -0
- package/dist/config/dist/Props.d.ts +284 -39
- package/dist/config/dist/Provider.d.ts +21 -0
- package/dist/config/dist/Provider.js +14 -0
- package/dist/config/dist/StyleProp.d.ts +113 -0
- package/dist/config/dist/StyleProp.js +197 -0
- package/dist/config/dist/Token.d.ts +56 -0
- package/dist/config/dist/Token.js +112 -0
- package/dist/config/dist/TokenGroup.d.ts +33 -0
- package/dist/config/dist/TokenGroup.js +68 -0
- package/dist/config/dist/asset-kind.d.ts +56 -0
- package/dist/config/dist/asset-kind.js +29 -0
- package/dist/config/dist/brands.d.ts +31 -0
- package/dist/config/dist/brands.js +20 -0
- package/dist/config/dist/captureCallerPath.d.ts +49 -0
- package/dist/config/dist/captureCallerPath.js +95 -0
- package/dist/config/dist/colorExpressions.d.ts +132 -0
- package/dist/config/dist/colorExpressions.js +148 -0
- package/dist/config/dist/defineAssetGroup.d.ts +158 -0
- package/dist/config/dist/defineAssetGroup.js +263 -0
- package/dist/config/dist/defineProvider.d.ts +30 -0
- package/dist/config/dist/defineProvider.js +60 -0
- package/dist/config/dist/element-marker.d.ts +55 -0
- package/dist/config/dist/element-marker.js +113 -0
- package/dist/config/dist/entity-utils.d.ts +27 -0
- package/dist/config/dist/entity-utils.js +105 -0
- package/dist/config/dist/factories.d.ts +707 -0
- package/dist/config/dist/factories.js +393 -0
- package/dist/config/dist/foreign-component-name.js +42 -0
- package/dist/config/dist/index.d.ts +31 -13
- package/dist/config/dist/index.js +26 -10
- package/dist/config/dist/interpolate.d.ts +21 -0
- package/dist/{foundational-presets/dist/motion.js → config/dist/interpolate.js} +1 -1
- package/dist/config/dist/markers.d.ts +218 -0
- package/dist/config/dist/markers.js +67 -0
- package/dist/config/dist/refs.d.ts +159 -0
- package/dist/config/dist/refs.js +98 -71
- package/dist/config/dist/token-override-rows.d.ts +67 -0
- package/dist/config/dist/token-override-rows.js +223 -0
- package/dist/config/dist/tokenValueType.js +138 -0
- package/dist/config/dist/types/css-properties.d.ts +233 -0
- package/dist/config/dist/types/css-property-keywords.d.ts +157 -0
- package/dist/config/dist/types/css-property-keywords.js +616 -0
- package/dist/config/dist/types/css-values.d.ts +20 -17
- package/dist/config/dist/types.d.ts +697 -64
- package/dist/config/dist/units.d.ts +15 -0
- package/dist/config/dist/units.js +16 -0
- package/dist/config.d.ts +32 -1562
- package/dist/config.js +28 -21
- package/dist/loader/dist/_virtual/_rolldown/runtime.js +1 -2
- package/dist/loader/dist/index.d.ts +2 -0
- package/dist/loader/dist/index.js +3 -0
- package/dist/loader/dist/loader/artifacts.js +26 -9
- package/dist/loader/dist/loader/babel-utils.js +1 -29
- package/dist/loader/dist/loader.d.ts +17 -1
- package/dist/loader/dist/loader.js +56 -339
- package/dist/loader/dist/next.d.ts +2 -1
- package/dist/loader/dist/next.js +3 -3
- package/dist/loader/dist/transform-runner.js +7 -0
- package/dist/loader/dist/unplugin.d.ts +27 -0
- package/dist/loader/dist/unplugin.js +52 -0
- package/dist/plugin.d.ts +2 -2
- package/dist/plugin.js +3 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/dist/index.js +1 -0
- package/dist/utils/dist/motion-utils/resolveMotionState.d.ts +35 -0
- package/dist/utils/dist/motion-utils/resolveMotionState.js +33 -0
- package/dist/utils/dist/string-utils/componentClassName.d.ts +41 -8
- package/dist/utils/dist/string-utils/componentClassName.js +48 -11
- package/dist/utils.d.ts +3 -2
- package/dist/utils.js +3 -2
- package/package.json +3 -51
- package/dist/components/accordion.config.d.ts +0 -2
- package/dist/components/accordion.config.js +0 -2
- package/dist/components/accordion.d.ts +0 -2
- package/dist/components/accordion.js +0 -2
- package/dist/components/alert.config.d.ts +0 -2
- package/dist/components/alert.config.js +0 -2
- package/dist/components/alert.d.ts +0 -2
- package/dist/components/alert.js +0 -2
- package/dist/components/anchor.config.d.ts +0 -2
- package/dist/components/anchor.config.js +0 -2
- package/dist/components/anchor.d.ts +0 -2
- package/dist/components/anchor.js +0 -2
- package/dist/components/article.d.ts +0 -2
- package/dist/components/article.js +0 -2
- package/dist/components/aside.d.ts +0 -2
- package/dist/components/aside.js +0 -2
- package/dist/components/avatar-group.config.d.ts +0 -2
- package/dist/components/avatar-group.config.js +0 -2
- package/dist/components/avatar-group.d.ts +0 -2
- package/dist/components/avatar-group.js +0 -2
- package/dist/components/avatar.config.d.ts +0 -2
- package/dist/components/avatar.config.js +0 -2
- package/dist/components/avatar.d.ts +0 -2
- package/dist/components/avatar.js +0 -2
- package/dist/components/badge.config.d.ts +0 -2
- package/dist/components/badge.config.js +0 -2
- package/dist/components/badge.d.ts +0 -2
- package/dist/components/badge.js +0 -2
- package/dist/components/box.d.ts +0 -2
- package/dist/components/box.js +0 -2
- package/dist/components/breadcrumb.config.d.ts +0 -2
- package/dist/components/breadcrumb.config.js +0 -2
- package/dist/components/breadcrumb.d.ts +0 -2
- package/dist/components/breadcrumb.js +0 -2
- package/dist/components/button.config.d.ts +0 -2
- package/dist/components/button.config.js +0 -2
- package/dist/components/button.d.ts +0 -2
- package/dist/components/button.js +0 -2
- package/dist/components/card.config.d.ts +0 -2
- package/dist/components/card.config.js +0 -2
- package/dist/components/card.d.ts +0 -2
- package/dist/components/card.js +0 -2
- package/dist/components/collapsible.config.d.ts +0 -2
- package/dist/components/collapsible.config.js +0 -2
- package/dist/components/collapsible.d.ts +0 -2
- package/dist/components/collapsible.js +0 -2
- package/dist/components/command.config.d.ts +0 -2
- package/dist/components/command.config.js +0 -2
- package/dist/components/command.d.ts +0 -2
- package/dist/components/command.js +0 -2
- package/dist/components/control-color.config.d.ts +0 -2
- package/dist/components/control-color.config.js +0 -2
- package/dist/components/control-color.d.ts +0 -2
- package/dist/components/control-color.js +0 -2
- package/dist/components/control-curve.config.d.ts +0 -2
- package/dist/components/control-curve.config.js +0 -2
- package/dist/components/control-curve.d.ts +0 -2
- package/dist/components/control-curve.js +0 -2
- package/dist/components/control-folder.config.d.ts +0 -2
- package/dist/components/control-folder.config.js +0 -2
- package/dist/components/control-folder.d.ts +0 -2
- package/dist/components/control-folder.js +0 -2
- package/dist/components/control-group.config.d.ts +0 -2
- package/dist/components/control-group.config.js +0 -2
- package/dist/components/control-group.d.ts +0 -2
- package/dist/components/control-group.js +0 -2
- package/dist/components/control-knob.config.d.ts +0 -2
- package/dist/components/control-knob.config.js +0 -2
- package/dist/components/control-knob.d.ts +0 -2
- package/dist/components/control-knob.js +0 -2
- package/dist/components/control-panel.config.d.ts +0 -2
- package/dist/components/control-panel.config.js +0 -2
- package/dist/components/control-panel.d.ts +0 -2
- package/dist/components/control-panel.js +0 -2
- package/dist/components/control-select.config.d.ts +0 -2
- package/dist/components/control-select.config.js +0 -2
- package/dist/components/control-select.d.ts +0 -2
- package/dist/components/control-select.js +0 -2
- package/dist/components/control-slider.config.d.ts +0 -2
- package/dist/components/control-slider.config.js +0 -2
- package/dist/components/control-slider.d.ts +0 -2
- package/dist/components/control-slider.js +0 -2
- package/dist/components/control-spring.config.d.ts +0 -2
- package/dist/components/control-spring.config.js +0 -2
- package/dist/components/control-spring.d.ts +0 -2
- package/dist/components/control-spring.js +0 -2
- package/dist/components/control-stepper.config.d.ts +0 -2
- package/dist/components/control-stepper.config.js +0 -2
- package/dist/components/control-stepper.d.ts +0 -2
- package/dist/components/control-stepper.js +0 -2
- package/dist/components/control-toggle.config.d.ts +0 -2
- package/dist/components/control-toggle.config.js +0 -2
- package/dist/components/control-toggle.d.ts +0 -2
- package/dist/components/control-toggle.js +0 -2
- package/dist/components/dist/_slots.js +0 -8
- package/dist/components/dist/accordion.config.d.ts +0 -431
- package/dist/components/dist/accordion.config.js +0 -81
- package/dist/components/dist/accordion.d.ts +0 -453
- package/dist/components/dist/accordion.js +0 -60
- package/dist/components/dist/alert.config.d.ts +0 -219
- package/dist/components/dist/alert.config.js +0 -54
- package/dist/components/dist/alert.d.ts +0 -230
- package/dist/components/dist/alert.js +0 -16
- package/dist/components/dist/anchor.config.d.ts +0 -250
- package/dist/components/dist/anchor.config.js +0 -22
- package/dist/components/dist/anchor.d.ts +0 -261
- package/dist/components/dist/anchor.js +0 -9
- package/dist/components/dist/article.d.ts +0 -11
- package/dist/components/dist/article.js +0 -9
- package/dist/components/dist/aside.d.ts +0 -11
- package/dist/components/dist/aside.js +0 -9
- package/dist/components/dist/avatar-group.config.d.ts +0 -315
- package/dist/components/dist/avatar-group.config.js +0 -33
- package/dist/components/dist/avatar-group.d.ts +0 -329
- package/dist/components/dist/avatar-group.js +0 -39
- package/dist/components/dist/avatar.config.d.ts +0 -197
- package/dist/components/dist/avatar.config.js +0 -49
- package/dist/components/dist/avatar.d.ts +0 -211
- package/dist/components/dist/avatar.js +0 -20
- package/dist/components/dist/badge.config.d.ts +0 -477
- package/dist/components/dist/badge.config.js +0 -99
- package/dist/components/dist/badge.d.ts +0 -489
- package/dist/components/dist/badge.js +0 -16
- package/dist/components/dist/box.d.ts +0 -14
- package/dist/components/dist/box.js +0 -9
- package/dist/components/dist/breadcrumb.config.d.ts +0 -390
- package/dist/components/dist/breadcrumb.config.js +0 -43
- package/dist/components/dist/breadcrumb.d.ts +0 -420
- package/dist/components/dist/breadcrumb.js +0 -119
- package/dist/components/dist/button.config.d.ts +0 -381
- package/dist/components/dist/button.config.js +0 -91
- package/dist/components/dist/button.d.ts +0 -403
- package/dist/components/dist/button.js +0 -35
- package/dist/components/dist/card.config.d.ts +0 -336
- package/dist/components/dist/card.config.js +0 -33
- package/dist/components/dist/card.d.ts +0 -352
- package/dist/components/dist/card.js +0 -27
- package/dist/components/dist/collapsible.config.d.ts +0 -45
- package/dist/components/dist/collapsible.config.js +0 -46
- package/dist/components/dist/collapsible.d.ts +0 -61
- package/dist/components/dist/collapsible.js +0 -38
- package/dist/components/dist/command.config.d.ts +0 -1613
- package/dist/components/dist/command.config.js +0 -170
- package/dist/components/dist/command.d.ts +0 -1722
- package/dist/components/dist/command.js +0 -341
- package/dist/components/dist/control-color.config.d.ts +0 -979
- package/dist/components/dist/control-color.config.js +0 -81
- package/dist/components/dist/control-color.d.ts +0 -995
- package/dist/components/dist/control-color.js +0 -64
- package/dist/components/dist/control-curve.config.d.ts +0 -18
- package/dist/components/dist/control-curve.config.js +0 -14
- package/dist/components/dist/control-curve.d.ts +0 -35
- package/dist/components/dist/control-curve.js +0 -81
- package/dist/components/dist/control-folder.config.d.ts +0 -177
- package/dist/components/dist/control-folder.config.js +0 -47
- package/dist/components/dist/control-folder.d.ts +0 -194
- package/dist/components/dist/control-folder.js +0 -41
- package/dist/components/dist/control-group.config.d.ts +0 -859
- package/dist/components/dist/control-group.config.js +0 -80
- package/dist/components/dist/control-group.d.ts +0 -881
- package/dist/components/dist/control-group.js +0 -89
- package/dist/components/dist/control-knob.config.d.ts +0 -792
- package/dist/components/dist/control-knob.config.js +0 -67
- package/dist/components/dist/control-knob.d.ts +0 -819
- package/dist/components/dist/control-knob.js +0 -148
- package/dist/components/dist/control-panel.config.d.ts +0 -402
- package/dist/components/dist/control-panel.config.js +0 -38
- package/dist/components/dist/control-panel.d.ts +0 -415
- package/dist/components/dist/control-panel.js +0 -22
- package/dist/components/dist/control-select.config.d.ts +0 -1176
- package/dist/components/dist/control-select.config.js +0 -102
- package/dist/components/dist/control-select.d.ts +0 -1200
- package/dist/components/dist/control-select.js +0 -63
- package/dist/components/dist/control-slider.config.d.ts +0 -104
- package/dist/components/dist/control-slider.config.js +0 -98
- package/dist/components/dist/control-slider.d.ts +0 -127
- package/dist/components/dist/control-slider.js +0 -87
- package/dist/components/dist/control-spring.config.d.ts +0 -417
- package/dist/components/dist/control-spring.config.js +0 -36
- package/dist/components/dist/control-spring.d.ts +0 -439
- package/dist/components/dist/control-spring.js +0 -136
- package/dist/components/dist/control-stepper.config.d.ts +0 -1084
- package/dist/components/dist/control-stepper.config.js +0 -108
- package/dist/components/dist/control-stepper.d.ts +0 -1104
- package/dist/components/dist/control-stepper.js +0 -109
- package/dist/components/dist/control-toggle.config.d.ts +0 -407
- package/dist/components/dist/control-toggle.config.js +0 -26
- package/dist/components/dist/control-toggle.d.ts +0 -420
- package/dist/components/dist/control-toggle.js +0 -36
- package/dist/components/dist/createSlot.d.ts +0 -8
- package/dist/components/dist/createSlot.js +0 -89
- package/dist/components/dist/dropdown.config.d.ts +0 -920
- package/dist/components/dist/dropdown.config.js +0 -107
- package/dist/components/dist/dropdown.d.ts +0 -950
- package/dist/components/dist/dropdown.js +0 -92
- package/dist/components/dist/empty-state.config.d.ts +0 -396
- package/dist/components/dist/empty-state.config.js +0 -53
- package/dist/components/dist/empty-state.d.ts +0 -416
- package/dist/components/dist/empty-state.js +0 -33
- package/dist/components/dist/footer.d.ts +0 -11
- package/dist/components/dist/footer.js +0 -9
- package/dist/components/dist/grid.d.ts +0 -41
- package/dist/components/dist/grid.js +0 -34
- package/dist/components/dist/header.d.ts +0 -11
- package/dist/components/dist/header.js +0 -9
- package/dist/components/dist/hstack.d.ts +0 -15
- package/dist/components/dist/hstack.js +0 -21
- package/dist/components/dist/image.d.ts +0 -19
- package/dist/components/dist/image.js +0 -9
- package/dist/components/dist/input.config.d.ts +0 -58
- package/dist/components/dist/input.config.js +0 -42
- package/dist/components/dist/input.d.ts +0 -67
- package/dist/components/dist/input.js +0 -14
- package/dist/components/dist/item.config.d.ts +0 -351
- package/dist/components/dist/item.config.js +0 -83
- package/dist/components/dist/item.d.ts +0 -374
- package/dist/components/dist/item.js +0 -51
- package/dist/components/dist/list.d.ts +0 -19
- package/dist/components/dist/list.js +0 -21
- package/dist/components/dist/main.d.ts +0 -11
- package/dist/components/dist/main.js +0 -9
- package/dist/components/dist/modal.config.d.ts +0 -397
- package/dist/components/dist/modal.config.js +0 -92
- package/dist/components/dist/modal.d.ts +0 -433
- package/dist/components/dist/modal.js +0 -125
- package/dist/components/dist/nav-header.config.d.ts +0 -158
- package/dist/components/dist/nav-header.config.js +0 -26
- package/dist/components/dist/nav-header.d.ts +0 -173
- package/dist/components/dist/nav-header.js +0 -23
- package/dist/components/dist/nav.d.ts +0 -11
- package/dist/components/dist/nav.js +0 -9
- package/dist/components/dist/preset-bar.config.d.ts +0 -192
- package/dist/components/dist/preset-bar.config.js +0 -39
- package/dist/components/dist/preset-bar.d.ts +0 -215
- package/dist/components/dist/preset-bar.js +0 -71
- package/dist/components/dist/presets/index.d.ts +0 -17674
- package/dist/components/dist/presets/index.js +0 -97
- package/dist/components/dist/pressable.d.ts +0 -11
- package/dist/components/dist/pressable.js +0 -9
- package/dist/components/dist/progress.config.d.ts +0 -296
- package/dist/components/dist/progress.config.js +0 -35
- package/dist/components/dist/progress.d.ts +0 -311
- package/dist/components/dist/progress.js +0 -43
- package/dist/components/dist/section.d.ts +0 -11
- package/dist/components/dist/section.js +0 -9
- package/dist/components/dist/select.config.d.ts +0 -31
- package/dist/components/dist/select.config.js +0 -25
- package/dist/components/dist/select.d.ts +0 -45
- package/dist/components/dist/select.js +0 -13
- package/dist/components/dist/sheet.config.d.ts +0 -245
- package/dist/components/dist/sheet.config.js +0 -99
- package/dist/components/dist/sheet.d.ts +0 -267
- package/dist/components/dist/sheet.js +0 -53
- package/dist/components/dist/sidebar.config.d.ts +0 -1651
- package/dist/components/dist/sidebar.config.js +0 -217
- package/dist/components/dist/sidebar.d.ts +0 -1825
- package/dist/components/dist/sidebar.js +0 -492
- package/dist/components/dist/skeleton.config.d.ts +0 -16
- package/dist/components/dist/skeleton.config.js +0 -10
- package/dist/components/dist/skeleton.d.ts +0 -27
- package/dist/components/dist/skeleton.js +0 -16
- package/dist/components/dist/slider.config.d.ts +0 -44
- package/dist/components/dist/slider.config.js +0 -40
- package/dist/components/dist/slider.d.ts +0 -70
- package/dist/components/dist/slider.js +0 -247
- package/dist/components/dist/spinner.config.d.ts +0 -34
- package/dist/components/dist/spinner.config.js +0 -24
- package/dist/components/dist/spinner.d.ts +0 -42
- package/dist/components/dist/spinner.js +0 -29
- package/dist/components/dist/svg.d.ts +0 -21
- package/dist/components/dist/svg.js +0 -17
- package/dist/components/dist/switch.config.d.ts +0 -353
- package/dist/components/dist/switch.config.js +0 -47
- package/dist/components/dist/switch.d.ts +0 -370
- package/dist/components/dist/switch.js +0 -32
- package/dist/components/dist/table.d.ts +0 -36
- package/dist/components/dist/table.js +0 -29
- package/dist/components/dist/tabs.config.d.ts +0 -611
- package/dist/components/dist/tabs.config.js +0 -56
- package/dist/components/dist/tabs.d.ts +0 -632
- package/dist/components/dist/tabs.js +0 -77
- package/dist/components/dist/text.config.d.ts +0 -306
- package/dist/components/dist/text.config.js +0 -149
- package/dist/components/dist/text.d.ts +0 -205
- package/dist/components/dist/text.js +0 -12
- package/dist/components/dist/textarea.config.d.ts +0 -352
- package/dist/components/dist/textarea.config.js +0 -57
- package/dist/components/dist/textarea.d.ts +0 -362
- package/dist/components/dist/textarea.js +0 -9
- package/dist/components/dist/toast.config.d.ts +0 -335
- package/dist/components/dist/toast.config.js +0 -145
- package/dist/components/dist/toast.d.ts +0 -426
- package/dist/components/dist/toast.js +0 -159
- package/dist/components/dist/tooltip.config.d.ts +0 -193
- package/dist/components/dist/tooltip.config.js +0 -40
- package/dist/components/dist/tooltip.d.ts +0 -206
- package/dist/components/dist/tooltip.js +0 -28
- package/dist/components/dist/vstack.d.ts +0 -15
- package/dist/components/dist/vstack.js +0 -20
- package/dist/components/dropdown.config.d.ts +0 -2
- package/dist/components/dropdown.config.js +0 -2
- package/dist/components/dropdown.d.ts +0 -2
- package/dist/components/dropdown.js +0 -2
- package/dist/components/empty-state.config.d.ts +0 -2
- package/dist/components/empty-state.config.js +0 -2
- package/dist/components/empty-state.d.ts +0 -2
- package/dist/components/empty-state.js +0 -2
- package/dist/components/footer.d.ts +0 -2
- package/dist/components/footer.js +0 -2
- package/dist/components/grid.d.ts +0 -2
- package/dist/components/grid.js +0 -2
- package/dist/components/header.d.ts +0 -2
- package/dist/components/header.js +0 -2
- package/dist/components/hstack.d.ts +0 -2
- package/dist/components/hstack.js +0 -2
- package/dist/components/image.d.ts +0 -2
- package/dist/components/image.js +0 -2
- package/dist/components/input.config.d.ts +0 -2
- package/dist/components/input.config.js +0 -2
- package/dist/components/input.d.ts +0 -2
- package/dist/components/input.js +0 -2
- package/dist/components/item.config.d.ts +0 -2
- package/dist/components/item.config.js +0 -2
- package/dist/components/item.d.ts +0 -2
- package/dist/components/item.js +0 -2
- package/dist/components/list.d.ts +0 -2
- package/dist/components/list.js +0 -2
- package/dist/components/main.d.ts +0 -2
- package/dist/components/main.js +0 -2
- package/dist/components/modal.config.d.ts +0 -2
- package/dist/components/modal.config.js +0 -2
- package/dist/components/modal.d.ts +0 -2
- package/dist/components/modal.js +0 -2
- package/dist/components/nav-header.config.d.ts +0 -2
- package/dist/components/nav-header.config.js +0 -2
- package/dist/components/nav-header.d.ts +0 -2
- package/dist/components/nav-header.js +0 -2
- package/dist/components/nav.d.ts +0 -2
- package/dist/components/nav.js +0 -2
- package/dist/components/preset-bar.config.d.ts +0 -2
- package/dist/components/preset-bar.config.js +0 -2
- package/dist/components/preset-bar.d.ts +0 -2
- package/dist/components/preset-bar.js +0 -2
- package/dist/components/presets/index.d.ts +0 -44
- package/dist/components/presets/index.js +0 -44
- package/dist/components/pressable.d.ts +0 -2
- package/dist/components/pressable.js +0 -2
- package/dist/components/progress.config.d.ts +0 -2
- package/dist/components/progress.config.js +0 -2
- package/dist/components/progress.d.ts +0 -2
- package/dist/components/progress.js +0 -2
- package/dist/components/section.d.ts +0 -2
- package/dist/components/section.js +0 -2
- package/dist/components/select.config.d.ts +0 -2
- package/dist/components/select.config.js +0 -2
- package/dist/components/select.d.ts +0 -2
- package/dist/components/select.js +0 -2
- package/dist/components/sheet.config.d.ts +0 -2
- package/dist/components/sheet.config.js +0 -2
- package/dist/components/sheet.d.ts +0 -2
- package/dist/components/sheet.js +0 -2
- package/dist/components/sidebar.config.d.ts +0 -2
- package/dist/components/sidebar.config.js +0 -2
- package/dist/components/sidebar.d.ts +0 -2
- package/dist/components/sidebar.js +0 -2
- package/dist/components/skeleton.config.d.ts +0 -2
- package/dist/components/skeleton.config.js +0 -2
- package/dist/components/skeleton.d.ts +0 -2
- package/dist/components/skeleton.js +0 -2
- package/dist/components/slider.config.d.ts +0 -2
- package/dist/components/slider.config.js +0 -2
- package/dist/components/slider.d.ts +0 -2
- package/dist/components/slider.js +0 -2
- package/dist/components/spinner.config.d.ts +0 -2
- package/dist/components/spinner.config.js +0 -2
- package/dist/components/spinner.d.ts +0 -2
- package/dist/components/spinner.js +0 -2
- package/dist/components/svg.d.ts +0 -2
- package/dist/components/svg.js +0 -2
- package/dist/components/switch.config.d.ts +0 -2
- package/dist/components/switch.config.js +0 -2
- package/dist/components/switch.d.ts +0 -2
- package/dist/components/switch.js +0 -2
- package/dist/components/table.d.ts +0 -2
- package/dist/components/table.js +0 -2
- package/dist/components/tabs.config.d.ts +0 -2
- package/dist/components/tabs.config.js +0 -2
- package/dist/components/tabs.d.ts +0 -2
- package/dist/components/tabs.js +0 -2
- package/dist/components/text.config.d.ts +0 -2
- package/dist/components/text.config.js +0 -2
- package/dist/components/text.d.ts +0 -2
- package/dist/components/text.js +0 -2
- package/dist/components/textarea.config.d.ts +0 -2
- package/dist/components/textarea.config.js +0 -2
- package/dist/components/textarea.d.ts +0 -2
- package/dist/components/textarea.js +0 -2
- package/dist/components/toast.config.d.ts +0 -2
- package/dist/components/toast.config.js +0 -2
- package/dist/components/toast.d.ts +0 -2
- package/dist/components/toast.js +0 -2
- package/dist/components/tooltip.config.d.ts +0 -2
- package/dist/components/tooltip.config.js +0 -2
- package/dist/components/tooltip.d.ts +0 -2
- package/dist/components/tooltip.js +0 -2
- package/dist/components/vstack.d.ts +0 -2
- package/dist/components/vstack.js +0 -2
- package/dist/config/dist/component-config.d.ts +0 -349
- package/dist/config/dist/component-refs.d.ts +0 -98
- package/dist/config/dist/component-resolution.js +0 -78
- package/dist/config/dist/consts/defaultColors.d.ts +0 -253
- package/dist/config/dist/consts/defaultColors.js +0 -252
- package/dist/config/dist/createComponent.d.ts +0 -1
- package/dist/config/dist/createComponent.js +0 -1
- package/dist/config/dist/createConfig.d.ts +0 -375
- package/dist/config/dist/createConfig.js +0 -625
- package/dist/config/dist/defineComponent.d.ts +0 -24
- package/dist/config/dist/defineComponent.js +0 -2
- package/dist/config/dist/defineStyleProp.d.ts +0 -93
- package/dist/config/dist/defineStyleProp.js +0 -60
- package/dist/config/dist/preset-merge.js +0 -192
- package/dist/config/dist/propertyAcceptedTypes.js +0 -220
- package/dist/config/dist/propertyGroups.d.ts +0 -1
- package/dist/config/dist/propertyGroups.js +0 -414
- package/dist/config/dist/resolveStyleProp.d.ts +0 -88
- package/dist/config/dist/resolveStyleProp.js +0 -235
- package/dist/config/dist/resolveTokenTypes.d.ts +0 -1
- package/dist/config/dist/resolveTokenTypes.js +0 -149
- package/dist/config/dist/runtime-registry.js +0 -9
- package/dist/config/dist/serialize.d.ts +0 -73
- package/dist/config/dist/serialize.js +0 -172
- package/dist/config/dist/style-prop-runtime.d.ts +0 -1
- package/dist/config-utils/dist/componentConfig.d.ts +0 -10
- package/dist/config-utils/dist/componentConfig.js +0 -11
- package/dist/config-utils.d.ts +0 -2
- package/dist/config-utils.js +0 -2
- package/dist/core/dist/color-opacity-map.js +0 -33
- package/dist/core/dist/compositeStyles.d.ts +0 -21
- package/dist/core/dist/compositeStyles.js +0 -51
- package/dist/core/dist/configurable-prop-helpers.d.ts +0 -31
- package/dist/core/dist/configurable-prop-helpers.js +0 -61
- package/dist/core/dist/createComponent.boundaries.js +0 -192
- package/dist/core/dist/createComponent.d.ts +0 -56
- package/dist/core/dist/createComponent.js +0 -67
- package/dist/core/dist/createComponentExample.d.ts +0 -41
- package/dist/core/dist/createComponentExample.js +0 -27
- package/dist/core/dist/createProvider.d.ts +0 -12
- package/dist/core/dist/createProvider.js +0 -24
- package/dist/core/dist/generated/stylePropsTwMap.d.ts +0 -1700
- package/dist/core/dist/generated/stylePropsTwMap.js +0 -570
- package/dist/core/dist/getComponentStyles.d.ts +0 -49
- package/dist/core/dist/getComponentStyles.js +0 -85
- package/dist/core/dist/getStyles.d.ts +0 -42
- package/dist/core/dist/getStyles.js +0 -300
- package/dist/core/dist/index.d.ts +0 -13
- package/dist/core/dist/index.js +0 -13
- package/dist/core/dist/modifier-mappings.d.ts +0 -12
- package/dist/core/dist/modifier-mappings.js +0 -61
- package/dist/core/dist/resolveMotionState.d.ts +0 -4
- package/dist/core/dist/resolveMotionState.js +0 -17
- package/dist/core/dist/resolveProps.boundaries.js +0 -131
- package/dist/core/dist/style-prop-data.d.ts +0 -32
- package/dist/core/dist/style-prop-data.js +0 -1257
- package/dist/core/dist/transformPreset.d.ts +0 -17
- package/dist/core/dist/transformPreset.js +0 -28
- package/dist/core/dist/withDefaultStyleProps.d.ts +0 -43
- package/dist/core/dist/withDefaultStyleProps.js +0 -18
- package/dist/core.d.ts +0 -14
- package/dist/core.js +0 -15
- package/dist/createSlot.d.ts +0 -2
- package/dist/createSlot.js +0 -2
- package/dist/fixtures.d.ts +0 -4
- package/dist/fixtures.js +0 -5
- package/dist/foundational-presets/dist/_virtual/_rolldown/runtime.js +0 -13
- package/dist/foundational-presets/dist/defaultPreset.d.ts +0 -1557
- package/dist/foundational-presets/dist/defaultPreset.js +0 -615
- package/dist/foundational-presets/dist/index.d.ts +0 -1
- package/dist/foundational-presets/dist/index.js +0 -1
- package/dist/foundational-presets/dist/motion.d.ts +0 -12
- package/dist/foundational-presets/dist/style-props.js +0 -1445
- package/dist/loader/dist/loader/create-component-data.js +0 -33
- package/dist/loader/dist/loader/create-component-lowering.js +0 -454
- package/dist/loader/dist/loader/data-attr-transform.js +0 -191
- package/dist/loader/dist/loader/dynamic-style-codegen.js +0 -97
- package/dist/loader/dist/loader/internal-meta.js +0 -22
- package/dist/loader/dist/loader/lower-new-api-primitive.js +0 -90
- package/dist/loader/dist/loader/motion-transform.js +0 -717
- package/dist/loader/dist/loader/style-transform.js +0 -670
- package/dist/loader/dist/node_modules/react/cjs/react-jsx-runtime.development.js +0 -203
- package/dist/loader/dist/node_modules/react/cjs/react-jsx-runtime.production.js +0 -25
- package/dist/loader/dist/node_modules/react/cjs/react.development.js +0 -762
- package/dist/loader/dist/node_modules/react/cjs/react.production.js +0 -351
- package/dist/loader/dist/node_modules/react/index.js +0 -10
- package/dist/loader/dist/node_modules/react/jsx-runtime.js +0 -10
- package/dist/loader/dist/packages/core/dist/color-opacity-map.js +0 -33
- package/dist/loader/dist/packages/core/dist/compositeStyles.js +0 -43
- package/dist/loader/dist/packages/core/dist/createComponent.js +0 -6
- package/dist/loader/dist/packages/core/dist/createProvider.js +0 -7
- package/dist/loader/dist/packages/core/dist/generated/stylePropsTwMap.js +0 -570
- package/dist/loader/dist/packages/core/dist/getComponentStyles.js +0 -2
- package/dist/loader/dist/packages/core/dist/getStyles.js +0 -60
- package/dist/loader/dist/packages/core/dist/index.js +0 -6
- package/dist/loader/dist/packages/core/dist/modifier-mappings.js +0 -61
- package/dist/loader/dist/packages/core/dist/style-prop-data.js +0 -1257
- package/dist/loader/dist/packages/core/dist/withDefaultStyleProps.js +0 -1
- package/dist/presets/dist/defaultPreset.d.ts +0 -6
- package/dist/presets/dist/defaultPreset.js +0 -51
- package/dist/presets/dist/index.d.ts +0 -1
- package/dist/presets/dist/index.js +0 -1
- package/dist/presets/motion.d.ts +0 -2
- package/dist/presets/motion.js +0 -2
- package/dist/presets.d.ts +0 -2
- package/dist/presets.js +0 -3
- package/dist/styles.d.ts +0 -4
- package/dist/styles.js +0 -5
- package/dist/transformPreset.d.ts +0 -2
- package/dist/transformPreset.js +0 -3
- /package/dist/{config/dist/component-resolution.d.ts → loader/dist/transform-runner.d.ts} +0 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
//#region ../config/dist/captureCallerPath.js
|
|
2
|
+
/**
|
|
3
|
+
* Inspect the current call stack and return the first frame whose file
|
|
4
|
+
* path sits outside the `@uds/config` package itself — i.e. the
|
|
5
|
+
* user's authoring site.
|
|
6
|
+
*
|
|
7
|
+
* Stashing the path at definition time gives every config object its
|
|
8
|
+
* origin for free. Consumers (codegen, CSS scanner, AI prompt builder)
|
|
9
|
+
* read `__sourcePath` off the config map directly instead of walking
|
|
10
|
+
* the AST to re-derive where each registration was authored.
|
|
11
|
+
*
|
|
12
|
+
* The skip predicate matches `/packages/config/` (workspace
|
|
13
|
+
* layout) and `/@uds/config/` (consumer node_modules layout) so
|
|
14
|
+
* internal frames never leak through. Returns `undefined` when no
|
|
15
|
+
* eligible frame is found.
|
|
16
|
+
*
|
|
17
|
+
* Stack format coverage:
|
|
18
|
+
* - Bun / V8 in-process: ` at fn (/abs/path.ts:L:C)` or bare
|
|
19
|
+
* ` at /abs/path.ts:L:C` (no parens).
|
|
20
|
+
* - Node native stacks: `file:///abs/path.ts:L:C` URL form.
|
|
21
|
+
* - Source-mapped frames downleveled through tsdown: `.js` files.
|
|
22
|
+
*
|
|
23
|
+
* The regex picks the first `(...).ext:line:col` token; the
|
|
24
|
+
* surrounding `at fn` / paren wrapping is ignored.
|
|
25
|
+
*/
|
|
26
|
+
const INTERNAL_FRAME_MARKERS = ["/packages/config/", "/@uds/config/"];
|
|
27
|
+
const FRAME_PATH_RE = /\(?(?:file:\/\/)?(\/[^):\s]+?\.[cm]?[jt]sx?):\d+(?::\d+)?\)?/;
|
|
28
|
+
const TEST_FILE_RE = /\.test\.[jt]sx?$/;
|
|
29
|
+
function isInternalFrame(path) {
|
|
30
|
+
if (TEST_FILE_RE.test(path)) return false;
|
|
31
|
+
return INTERNAL_FRAME_MARKERS.some((marker) => path.includes(marker));
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* `@uds/codegen`'s `loadConfig` bundles `uds.config.ts` with
|
|
35
|
+
* `Bun.build` and runs the bundle from `<cwd>/.uds/config-bundle/`.
|
|
36
|
+
* The bundle's inline sourcemap maps frames back to paths *relative
|
|
37
|
+
* to the bundle output dir* — e.g.
|
|
38
|
+
* `apps/docs/.uds/config-bundle/src/uds/components/button.tsx`,
|
|
39
|
+
* not the original `apps/docs/src/uds/components/button.tsx`.
|
|
40
|
+
* Strip the segment so `Component.sourceFilePath` resolves to a
|
|
41
|
+
* readable on-disk path. Matches `/.uds/config-bundle/` so it's
|
|
42
|
+
* agnostic to which app the bundle was emitted under.
|
|
43
|
+
*/
|
|
44
|
+
const CONFIG_BUNDLE_PATH_SEGMENT = "/.uds/config-bundle/";
|
|
45
|
+
function normalizeBundlePath(path) {
|
|
46
|
+
const idx = path.indexOf(CONFIG_BUNDLE_PATH_SEGMENT);
|
|
47
|
+
if (idx === -1) return path;
|
|
48
|
+
return path.slice(0, idx + 1) + path.slice(idx + 20);
|
|
49
|
+
}
|
|
50
|
+
function captureCallerPath() {
|
|
51
|
+
const stack = (/* @__PURE__ */ new Error()).stack;
|
|
52
|
+
if (!stack) return void 0;
|
|
53
|
+
for (const line of stack.split("\n")) {
|
|
54
|
+
const match = line.match(FRAME_PATH_RE);
|
|
55
|
+
if (!match) continue;
|
|
56
|
+
const path = normalizeBundlePath(match[1]);
|
|
57
|
+
if (isInternalFrame(path)) continue;
|
|
58
|
+
return path;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Non-enumerable `__sourcePath` slot key. Centralized so codegen
|
|
63
|
+
* consumers and authoring helpers agree on one spelling.
|
|
64
|
+
*/
|
|
65
|
+
const SOURCE_PATH_KEY = "__sourcePath";
|
|
66
|
+
/**
|
|
67
|
+
* Attach `__sourcePath` to a config object non-enumerably.
|
|
68
|
+
* `JSON.stringify` ignores non-enumerable properties so the wire format
|
|
69
|
+
* stays clean.
|
|
70
|
+
*
|
|
71
|
+
* No-op when `path` is `undefined` — keeps the config shape stable
|
|
72
|
+
* when the stack-walk yields no eligible frame.
|
|
73
|
+
*/
|
|
74
|
+
function attachSourcePath(target, path) {
|
|
75
|
+
if (!path) return target;
|
|
76
|
+
Object.defineProperty(target, SOURCE_PATH_KEY, {
|
|
77
|
+
enumerable: false,
|
|
78
|
+
configurable: true,
|
|
79
|
+
writable: true,
|
|
80
|
+
value: path
|
|
81
|
+
});
|
|
82
|
+
return target;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Read `__sourcePath` off a config object. Returns `undefined` when
|
|
86
|
+
* the slot was never set (e.g. configs produced outside the `define*`
|
|
87
|
+
* helpers).
|
|
88
|
+
*/
|
|
89
|
+
function readSourcePath(target) {
|
|
90
|
+
if (target === null || typeof target !== "object" && typeof target !== "function") return;
|
|
91
|
+
const value = target[SOURCE_PATH_KEY];
|
|
92
|
+
return typeof value === "string" ? value : void 0;
|
|
93
|
+
}
|
|
94
|
+
//#endregion
|
|
95
|
+
export { SOURCE_PATH_KEY, attachSourcePath, captureCallerPath, readSourcePath };
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { TokenRef } from "./refs.js";
|
|
2
|
+
import { CssAngle, CssColor, CssLength, CssPercentage } from "./types/css-values.js";
|
|
3
|
+
|
|
4
|
+
//#region ../config/dist/colorExpressions.d.ts
|
|
5
|
+
//#region src/colorExpressions.d.ts
|
|
6
|
+
/** Position used for gradient stops + radial center — a CSS length or percentage. */
|
|
7
|
+
type LengthOrPercent = CssLength | CssPercentage;
|
|
8
|
+
/** Line direction keyword for `linear-gradient(to <dir>, …)`. */
|
|
9
|
+
type LineDirection = 'top' | 'right' | 'bottom' | 'left' | 'top right' | 'top left' | 'bottom right' | 'bottom left';
|
|
10
|
+
/** Color space accepted by `color-mix()` and gradient `<color-interpolation-method>`. */
|
|
11
|
+
type ColorSpace = 'srgb' | 'srgb-linear' | 'oklab' | 'oklch' | 'lab' | 'lch' | 'hsl' | 'hwb';
|
|
12
|
+
/** Radial gradient extent keyword. */
|
|
13
|
+
type RadialSize = 'closest-side' | 'closest-corner' | 'farthest-side' | 'farthest-corner';
|
|
14
|
+
interface MixExpr {
|
|
15
|
+
readonly __kind: 'mix';
|
|
16
|
+
readonly from: ColorValue;
|
|
17
|
+
readonly to: ColorValue;
|
|
18
|
+
readonly amount: CssPercentage;
|
|
19
|
+
readonly colorSpace?: ColorSpace;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* `darken(color, N)` / `lighten(color, N)` — one-arg shade shorthands that
|
|
23
|
+
* blend a color toward black (darken) or white (lighten) by `amount`%, using
|
|
24
|
+
* `light-dark(...)` so the blend direction flips per color scheme. A focused
|
|
25
|
+
* pair alongside the general `mix`; resolves through the same pipeline.
|
|
26
|
+
*/
|
|
27
|
+
interface ShadeExpr {
|
|
28
|
+
readonly __kind: 'darken' | 'lighten';
|
|
29
|
+
readonly color: ColorValue;
|
|
30
|
+
/** Mix percentage toward black/white — `10` → `10%`. */
|
|
31
|
+
readonly amount: number;
|
|
32
|
+
}
|
|
33
|
+
interface GradientStop {
|
|
34
|
+
readonly color: ColorValue;
|
|
35
|
+
readonly at?: LengthOrPercent;
|
|
36
|
+
}
|
|
37
|
+
interface LinearGradientExpr {
|
|
38
|
+
readonly __kind: 'linear-gradient';
|
|
39
|
+
readonly angle?: CssAngle | `to ${LineDirection}`;
|
|
40
|
+
readonly stops: readonly GradientStop[];
|
|
41
|
+
readonly interpolation?: ColorSpace;
|
|
42
|
+
readonly repeating?: boolean;
|
|
43
|
+
}
|
|
44
|
+
interface RadialGradientExpr {
|
|
45
|
+
readonly __kind: 'radial-gradient';
|
|
46
|
+
readonly shape?: 'circle' | 'ellipse';
|
|
47
|
+
readonly size?: RadialSize;
|
|
48
|
+
readonly position?: LengthOrPercent | 'center' | 'top' | 'right' | 'bottom' | 'left';
|
|
49
|
+
readonly stops: readonly GradientStop[];
|
|
50
|
+
readonly interpolation?: ColorSpace;
|
|
51
|
+
readonly repeating?: boolean;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Any expression / marker that resolves to a CSS color value.
|
|
55
|
+
*
|
|
56
|
+
* `TokenRef` here is intentionally un-narrowed by token type. When
|
|
57
|
+
* the `Registered*` augmentations grow a `__type` slot, this can
|
|
58
|
+
* narrow to color-typed tokens — until then runtime + patch
|
|
59
|
+
* validation catches type mismatches.
|
|
60
|
+
*/
|
|
61
|
+
type ColorValue = CssColor | TokenRef | MixExpr;
|
|
62
|
+
/** Anything that resolves to a CSS `background-image`-eligible value. */
|
|
63
|
+
type GradientValue = TokenRef | LinearGradientExpr | RadialGradientExpr;
|
|
64
|
+
/** Union of every structured expression authored via these helpers. */
|
|
65
|
+
type ColorExpression = MixExpr | ShadeExpr | LinearGradientExpr | RadialGradientExpr;
|
|
66
|
+
declare function isMixExpr(value: unknown): value is MixExpr;
|
|
67
|
+
declare function isLinearGradientExpr(value: unknown): value is LinearGradientExpr;
|
|
68
|
+
declare function isRadialGradientExpr(value: unknown): value is RadialGradientExpr;
|
|
69
|
+
declare function isColorExpression(value: unknown): value is ColorExpression;
|
|
70
|
+
/**
|
|
71
|
+
* `color-mix(in <space>, <from> <amount>, <to>)` — blend `from` and
|
|
72
|
+
* `to` at the given percentage. Inputs can be CSS color literals,
|
|
73
|
+
* `token('ns/name')` markers, or other `mix()` outputs.
|
|
74
|
+
*
|
|
75
|
+
* mix(token('bg/primary'), 'transparent', '20%')
|
|
76
|
+
* mix('#000', token('bg/accent'), '40%', 'oklab')
|
|
77
|
+
*/
|
|
78
|
+
declare function mix(from: ColorValue, to: ColorValue, amount: CssPercentage, colorSpace?: ColorSpace): MixExpr;
|
|
79
|
+
/**
|
|
80
|
+
* Opacity sugar — `alpha(color, 0.2)` resolves to
|
|
81
|
+
* `color-mix(in srgb, color 20%, transparent)`, which renders as
|
|
82
|
+
* `color` at 20% opacity. The numeric API matches `rgba()` and the
|
|
83
|
+
* CSS `opacity` property (both 0..1).
|
|
84
|
+
*
|
|
85
|
+
* Out-of-range values clamp to `[0, 1]`. The mix amount is the
|
|
86
|
+
* color's share of the blend (`color-mix(in srgb, A X%, B)` defines
|
|
87
|
+
* `X%` as A's proportion), so `opacity * 100` is exactly what goes on
|
|
88
|
+
* the wire.
|
|
89
|
+
*/
|
|
90
|
+
declare function alpha(color: ColorValue, opacity: number): MixExpr;
|
|
91
|
+
/**
|
|
92
|
+
* `darken(color, 10)` → `color-mix(in oklch, color, light-dark(black, white) 10%)`
|
|
93
|
+
* — blends `color` toward black in light mode, white in dark mode. Pairs with
|
|
94
|
+
* `lighten`. `color` is usually a `token('bg/brand')` ref but accepts any
|
|
95
|
+
* `ColorValue`.
|
|
96
|
+
*/
|
|
97
|
+
declare function darken(color: ColorValue, amount: number): ShadeExpr;
|
|
98
|
+
/** Mirror of `darken()`; blends toward white in light mode, black in dark. */
|
|
99
|
+
declare function lighten(color: ColorValue, amount: number): ShadeExpr;
|
|
100
|
+
/**
|
|
101
|
+
* `linear-gradient(<angle>, <stop1>, <stop2>, …)` — directional
|
|
102
|
+
* gradient. `angle` accepts a CSS angle (`'135deg'`) or a `to <dir>`
|
|
103
|
+
* keyword. Stops carry a `color` and optional `at` position — bare
|
|
104
|
+
* stops let the engine space evenly.
|
|
105
|
+
*/
|
|
106
|
+
declare function linearGradient(spec: {
|
|
107
|
+
angle?: CssAngle | `to ${LineDirection}`;
|
|
108
|
+
stops: readonly GradientStop[];
|
|
109
|
+
interpolation?: ColorSpace;
|
|
110
|
+
repeating?: boolean;
|
|
111
|
+
}): LinearGradientExpr;
|
|
112
|
+
/**
|
|
113
|
+
* `radial-gradient(<shape> <size> at <position>, <stop1>, …)` —
|
|
114
|
+
* gradient radiating outward from `position`. Defaults match CSS
|
|
115
|
+
* (ellipse at center).
|
|
116
|
+
*/
|
|
117
|
+
declare function radialGradient(spec: {
|
|
118
|
+
shape?: 'circle' | 'ellipse';
|
|
119
|
+
size?: RadialSize;
|
|
120
|
+
position?: LengthOrPercent | 'center' | 'top' | 'right' | 'bottom' | 'left';
|
|
121
|
+
stops: readonly GradientStop[];
|
|
122
|
+
interpolation?: ColorSpace;
|
|
123
|
+
repeating?: boolean;
|
|
124
|
+
}): RadialGradientExpr;
|
|
125
|
+
type TokenRefToCss = (ref: string) => string;
|
|
126
|
+
/**
|
|
127
|
+
* Resolve any structured color expression to its CSS string. The
|
|
128
|
+
* single entry point codegen calls after `isColorExpression` fires.
|
|
129
|
+
*/
|
|
130
|
+
declare function resolveColorExpression(expr: ColorExpression, tokenRefToCss: TokenRefToCss): string; //#endregion
|
|
131
|
+
//#endregion
|
|
132
|
+
export { ColorExpression, ColorSpace, ColorValue, GradientStop, GradientValue, LengthOrPercent, LineDirection, LinearGradientExpr, MixExpr, RadialGradientExpr, RadialSize, TokenRefToCss, alpha, darken, isColorExpression, isLinearGradientExpr, isMixExpr, isRadialGradientExpr, lighten, linearGradient, mix, radialGradient, resolveColorExpression };
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { isTokenRef } from "./refs.js";
|
|
2
|
+
//#region ../config/dist/colorExpressions.js
|
|
3
|
+
function hasKind(value, kind) {
|
|
4
|
+
return typeof value === "object" && value !== null && value.__kind === kind;
|
|
5
|
+
}
|
|
6
|
+
function isMixExpr(value) {
|
|
7
|
+
return hasKind(value, "mix");
|
|
8
|
+
}
|
|
9
|
+
function isShadeExpr(value) {
|
|
10
|
+
return hasKind(value, "darken") || hasKind(value, "lighten");
|
|
11
|
+
}
|
|
12
|
+
function isLinearGradientExpr(value) {
|
|
13
|
+
return hasKind(value, "linear-gradient");
|
|
14
|
+
}
|
|
15
|
+
function isRadialGradientExpr(value) {
|
|
16
|
+
return hasKind(value, "radial-gradient");
|
|
17
|
+
}
|
|
18
|
+
function isColorExpression(value) {
|
|
19
|
+
return isMixExpr(value) || isShadeExpr(value) || isLinearGradientExpr(value) || isRadialGradientExpr(value);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* `color-mix(in <space>, <from> <amount>, <to>)` — blend `from` and
|
|
23
|
+
* `to` at the given percentage. Inputs can be CSS color literals,
|
|
24
|
+
* `token('ns/name')` markers, or other `mix()` outputs.
|
|
25
|
+
*
|
|
26
|
+
* mix(token('bg/primary'), 'transparent', '20%')
|
|
27
|
+
* mix('#000', token('bg/accent'), '40%', 'oklab')
|
|
28
|
+
*/
|
|
29
|
+
function mix(from, to, amount, colorSpace) {
|
|
30
|
+
return {
|
|
31
|
+
__kind: "mix",
|
|
32
|
+
from,
|
|
33
|
+
to,
|
|
34
|
+
amount,
|
|
35
|
+
colorSpace
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Opacity sugar — `alpha(color, 0.2)` resolves to
|
|
40
|
+
* `color-mix(in srgb, color 20%, transparent)`, which renders as
|
|
41
|
+
* `color` at 20% opacity. The numeric API matches `rgba()` and the
|
|
42
|
+
* CSS `opacity` property (both 0..1).
|
|
43
|
+
*
|
|
44
|
+
* Out-of-range values clamp to `[0, 1]`. The mix amount is the
|
|
45
|
+
* color's share of the blend (`color-mix(in srgb, A X%, B)` defines
|
|
46
|
+
* `X%` as A's proportion), so `opacity * 100` is exactly what goes on
|
|
47
|
+
* the wire.
|
|
48
|
+
*/
|
|
49
|
+
function alpha(color, opacity) {
|
|
50
|
+
return {
|
|
51
|
+
__kind: "mix",
|
|
52
|
+
from: color,
|
|
53
|
+
to: "transparent",
|
|
54
|
+
amount: `${Math.round(Math.max(0, Math.min(1, opacity)) * 100)}%`,
|
|
55
|
+
colorSpace: "srgb"
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* `darken(color, 10)` → `color-mix(in oklch, color, light-dark(black, white) 10%)`
|
|
60
|
+
* — blends `color` toward black in light mode, white in dark mode. Pairs with
|
|
61
|
+
* `lighten`. `color` is usually a `token('bg/brand')` ref but accepts any
|
|
62
|
+
* `ColorValue`.
|
|
63
|
+
*/
|
|
64
|
+
function darken(color, amount) {
|
|
65
|
+
return {
|
|
66
|
+
__kind: "darken",
|
|
67
|
+
color,
|
|
68
|
+
amount
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/** Mirror of `darken()`; blends toward white in light mode, black in dark. */
|
|
72
|
+
function lighten(color, amount) {
|
|
73
|
+
return {
|
|
74
|
+
__kind: "lighten",
|
|
75
|
+
color,
|
|
76
|
+
amount
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* `linear-gradient(<angle>, <stop1>, <stop2>, …)` — directional
|
|
81
|
+
* gradient. `angle` accepts a CSS angle (`'135deg'`) or a `to <dir>`
|
|
82
|
+
* keyword. Stops carry a `color` and optional `at` position — bare
|
|
83
|
+
* stops let the engine space evenly.
|
|
84
|
+
*/
|
|
85
|
+
function linearGradient(spec) {
|
|
86
|
+
return {
|
|
87
|
+
__kind: "linear-gradient",
|
|
88
|
+
...spec
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* `radial-gradient(<shape> <size> at <position>, <stop1>, …)` —
|
|
93
|
+
* gradient radiating outward from `position`. Defaults match CSS
|
|
94
|
+
* (ellipse at center).
|
|
95
|
+
*/
|
|
96
|
+
function radialGradient(spec) {
|
|
97
|
+
return {
|
|
98
|
+
__kind: "radial-gradient",
|
|
99
|
+
...spec
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function resolveColorValue(value, tokenRefToCss) {
|
|
103
|
+
if (typeof value === "string") return value;
|
|
104
|
+
if (isMixExpr(value)) return resolveMixExpr(value, tokenRefToCss);
|
|
105
|
+
if (isTokenRef(value)) return tokenRefToCss(value.ref);
|
|
106
|
+
return "";
|
|
107
|
+
}
|
|
108
|
+
function resolveMixExpr(expr, tokenRefToCss) {
|
|
109
|
+
const space = expr.colorSpace ?? "srgb";
|
|
110
|
+
const from = resolveColorValue(expr.from, tokenRefToCss);
|
|
111
|
+
const to = resolveColorValue(expr.to, tokenRefToCss);
|
|
112
|
+
return `color-mix(in ${space}, ${from} ${expr.amount}, ${to})`;
|
|
113
|
+
}
|
|
114
|
+
function resolveShadeExpr(expr, tokenRefToCss) {
|
|
115
|
+
return `color-mix(in oklch, ${resolveColorValue(expr.color, tokenRefToCss)}, ${expr.__kind === "darken" ? "light-dark(black, white)" : "light-dark(white, black)"} ${expr.amount}%)`;
|
|
116
|
+
}
|
|
117
|
+
function renderStops(stops, tokenRefToCss) {
|
|
118
|
+
const parts = [];
|
|
119
|
+
for (const stop of stops) {
|
|
120
|
+
const color = resolveColorValue(stop.color, tokenRefToCss);
|
|
121
|
+
parts.push(stop.at !== void 0 ? `${color} ${stop.at}` : color);
|
|
122
|
+
}
|
|
123
|
+
return parts.join(", ");
|
|
124
|
+
}
|
|
125
|
+
function resolveLinearGradientExpr(expr, tokenRefToCss) {
|
|
126
|
+
const fn = expr.repeating ? "repeating-linear-gradient" : "linear-gradient";
|
|
127
|
+
const prefix = expr.angle !== void 0 ? `${expr.angle}, ` : "";
|
|
128
|
+
return `${fn}(${expr.interpolation ? `in ${expr.interpolation}, ` : ""}${prefix}${renderStops(expr.stops, tokenRefToCss)})`;
|
|
129
|
+
}
|
|
130
|
+
function resolveRadialGradientExpr(expr, tokenRefToCss) {
|
|
131
|
+
const fn = expr.repeating ? "repeating-radial-gradient" : "radial-gradient";
|
|
132
|
+
const shapeAndSize = [expr.shape ?? "", expr.size ?? ""].filter(Boolean).join(" ");
|
|
133
|
+
const positionPart = expr.position ? ` at ${expr.position}` : "";
|
|
134
|
+
const head = shapeAndSize || positionPart ? `${shapeAndSize}${positionPart}, ` : "";
|
|
135
|
+
return `${fn}(${expr.interpolation ? `in ${expr.interpolation}, ` : ""}${head}${renderStops(expr.stops, tokenRefToCss)})`;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Resolve any structured color expression to its CSS string. The
|
|
139
|
+
* single entry point codegen calls after `isColorExpression` fires.
|
|
140
|
+
*/
|
|
141
|
+
function resolveColorExpression(expr, tokenRefToCss) {
|
|
142
|
+
if (isMixExpr(expr)) return resolveMixExpr(expr, tokenRefToCss);
|
|
143
|
+
if (isShadeExpr(expr)) return resolveShadeExpr(expr, tokenRefToCss);
|
|
144
|
+
if (isLinearGradientExpr(expr)) return resolveLinearGradientExpr(expr, tokenRefToCss);
|
|
145
|
+
return resolveRadialGradientExpr(expr, tokenRefToCss);
|
|
146
|
+
}
|
|
147
|
+
//#endregion
|
|
148
|
+
export { alpha, darken, isColorExpression, isLinearGradientExpr, isMixExpr, isRadialGradientExpr, lighten, linearGradient, mix, radialGradient, resolveColorExpression };
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { ComponentRef } from "./refs.js";
|
|
2
|
+
import { FontAssetMember } from "./types.js";
|
|
3
|
+
|
|
4
|
+
//#region ../config/dist/defineAssetGroup.d.ts
|
|
5
|
+
//#region src/defineAssetGroup.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Static metadata an icon-class member may carry (the UDS v3 generated
|
|
8
|
+
* icons stamp this shape). All fields optional — metadata-less
|
|
9
|
+
* libraries (Phosphor) fall back to the documented harvest convention
|
|
10
|
+
* (PascalCase export key + component-shaped value).
|
|
11
|
+
*/
|
|
12
|
+
interface IconAssetMetadata {
|
|
13
|
+
readonly name?: string;
|
|
14
|
+
readonly isSvgIcon?: boolean;
|
|
15
|
+
readonly variants?: readonly string[];
|
|
16
|
+
readonly category?: string;
|
|
17
|
+
readonly tags?: readonly string[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* One icon-class member — a React component (plain function or a
|
|
21
|
+
* forwardRef/memo exotic) optionally carrying static `.metadata`.
|
|
22
|
+
* Typed structurally so `@uds/config` doesn't depend on React types
|
|
23
|
+
* here; the renderer casts at the registry boundary.
|
|
24
|
+
*/
|
|
25
|
+
type IconAssetMember = ((props: never) => unknown) & {
|
|
26
|
+
readonly metadata?: IconAssetMetadata;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Icon branch — `type` is optional so icon authors never declare the
|
|
30
|
+
* class. `sizes` is required unless `props` is used (which normalizes
|
|
31
|
+
* into the flat fields). It's load-bearing render data (the `<svg>`
|
|
32
|
+
* shell reads px from it) and the picker's size-option list is derived
|
|
33
|
+
* from its keys.
|
|
34
|
+
*/
|
|
35
|
+
interface IconAssetGroupConfig<P = Record<string, unknown>> {
|
|
36
|
+
type?: 'icon';
|
|
37
|
+
/** Named size → px (`{ sm: 16, md: 24 }`). Picker options = keys. */
|
|
38
|
+
sizes?: Readonly<Record<string, number>>;
|
|
39
|
+
/**
|
|
40
|
+
* Group-level variant superset the picker starts from. Omitted ⇒
|
|
41
|
+
* harvested union of members' `.metadata.variants` (first-seen
|
|
42
|
+
* order), which by construction can't drift behind the library.
|
|
43
|
+
* Required (in practice) for metadata-less libraries.
|
|
44
|
+
*/
|
|
45
|
+
variants?: readonly string[];
|
|
46
|
+
/** Display label. Defaults to the title-cased registration key. */
|
|
47
|
+
label?: string;
|
|
48
|
+
description?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Filter harvested members by their export key — return `false` to skip one.
|
|
51
|
+
* A large third-party package often ships more than its canonical glyph set
|
|
52
|
+
* (Phosphor exports both `HouseIcon` and a deprecated bare `House` alias, plus
|
|
53
|
+
* non-glyph `IconBase`/`IconContext`). Passing the package wildcard is required
|
|
54
|
+
* for codegen to bundle live members, so this predicate is how you narrow that
|
|
55
|
+
* wildcard to the real icons (e.g. `(n) => n.endsWith('Icon')`). Applied before
|
|
56
|
+
* the PascalCase / component-shape checks; runs over every export key.
|
|
57
|
+
*/
|
|
58
|
+
include?: (name: string) => boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Authoring sugar mirroring the member component's own prop axes. Each entry
|
|
61
|
+
* is a picker value-set, NOT a style map: keys are the member's
|
|
62
|
+
* prop names, values are the allowed choices. Exactly ONE entry must be a
|
|
63
|
+
* named→px MAP (the size axis); at most one entry may be an ARRAY (the variant
|
|
64
|
+
* axis). Normalized at config-eval into the flat `sizes`/`variants` fields.
|
|
65
|
+
* Cannot be combined with those flat fields. Type the members via
|
|
66
|
+
* `defineAssetGroup<IconProps>(...)` to constrain keys to the component's
|
|
67
|
+
* props (e.g. `variant` → its enum).
|
|
68
|
+
*/
|
|
69
|
+
props?: { [K in keyof P]?: Readonly<Record<string, number>> | readonly NonNullable<P[K]>[] };
|
|
70
|
+
/**
|
|
71
|
+
* The component that authors this group's members in exported code —
|
|
72
|
+
* e.g. `'Icon'` so a placed asset node `yahoo-os:asset:icons/Trophy`
|
|
73
|
+
* round-trips through code views as `<Icon name="Trophy" … />`. There
|
|
74
|
+
* is no implicit link between a group and a component (a group's members
|
|
75
|
+
* and a component's `name` enum are decoupled even when built from the
|
|
76
|
+
* same package), so the authoring component is declared explicitly.
|
|
77
|
+
* It is also the component a placed member *renders through* on the canvas:
|
|
78
|
+
* the resolved `Icon` owns the set-specific size/variant→glyph mapping. Omit
|
|
79
|
+
* it for a component-less system: members render bare and exporters fall back
|
|
80
|
+
* to the bare member tag. Accepts a typed `ComponentRef` (from
|
|
81
|
+
* `component()`) or a bare string.
|
|
82
|
+
*/
|
|
83
|
+
component?: string | ComponentRef;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Font branch — `type: 'font'` declares the class. The `never` fields
|
|
87
|
+
* make icon-class props a compile error inside a `{ type: 'font' }`
|
|
88
|
+
* literal regardless of property order (the union is ordering-free,
|
|
89
|
+
* unlike the chained-methods spelling it replaced).
|
|
90
|
+
*/
|
|
91
|
+
interface FontAssetGroupConfig {
|
|
92
|
+
type: 'font';
|
|
93
|
+
label?: string;
|
|
94
|
+
description?: string;
|
|
95
|
+
/** Icon-class prop — excluded on the font branch at the type level. */
|
|
96
|
+
sizes?: never;
|
|
97
|
+
/** Icon-class prop — excluded on the font branch at the type level. */
|
|
98
|
+
variants?: never;
|
|
99
|
+
/** Icon-class prop — excluded on the font branch at the type level. */
|
|
100
|
+
props?: never;
|
|
101
|
+
/** Icon-class prop — excluded on the font branch at the type level. */
|
|
102
|
+
component?: never;
|
|
103
|
+
}
|
|
104
|
+
type AssetGroupConfig = IconAssetGroupConfig<Record<string, unknown>> | FontAssetGroupConfig;
|
|
105
|
+
interface AssetGroupDefinitionBase {
|
|
106
|
+
/** Invariant ref tag — identical for every asset class. */
|
|
107
|
+
readonly __kind: 'assetGroup';
|
|
108
|
+
/**
|
|
109
|
+
* The group's slug — late-bound from the `registerAssetGroups`
|
|
110
|
+
* record key. Reading before registration throws.
|
|
111
|
+
*/
|
|
112
|
+
readonly ref: string;
|
|
113
|
+
readonly label?: string;
|
|
114
|
+
readonly description?: string;
|
|
115
|
+
}
|
|
116
|
+
interface IconAssetGroupDefinition extends AssetGroupDefinitionBase {
|
|
117
|
+
readonly assetKind: 'icon';
|
|
118
|
+
/** Harvested members, keyed by asset name (the `${assetName}` id segment). */
|
|
119
|
+
readonly members: Readonly<Record<string, IconAssetMember>>;
|
|
120
|
+
/** Per-member harvested `.metadata` (name/variants/category/tags). */
|
|
121
|
+
readonly memberMetadata: Readonly<Record<string, IconAssetMetadata>>;
|
|
122
|
+
readonly sizes: Readonly<Record<string, number>>;
|
|
123
|
+
/** Resolved variant superset — declared, or the harvested union. */
|
|
124
|
+
readonly variants: readonly string[];
|
|
125
|
+
/** Authoring component for code export (`'Icon'`), if declared. */
|
|
126
|
+
readonly component?: string;
|
|
127
|
+
}
|
|
128
|
+
interface FontAssetGroupDefinition extends AssetGroupDefinitionBase {
|
|
129
|
+
readonly assetKind: 'font';
|
|
130
|
+
/** Members keyed by `FontID` (kebab-case) — pure-JSON data records. */
|
|
131
|
+
readonly members: Readonly<Record<string, FontAssetMember>>;
|
|
132
|
+
}
|
|
133
|
+
type AssetGroupDefinition = IconAssetGroupDefinition | FontAssetGroupDefinition;
|
|
134
|
+
/**
|
|
135
|
+
* `defineAssetGroup(members)` return value — the only thing you can do
|
|
136
|
+
* with it is `.config({...})`, which completes the definition. The
|
|
137
|
+
* overloads branch the return type on the config union's discriminant.
|
|
138
|
+
* The phantom `P` generic flows from `defineAssetGroup<P>(...)` and
|
|
139
|
+
* constrains the `props` block keys/values to the member component's
|
|
140
|
+
* own props.
|
|
141
|
+
*/
|
|
142
|
+
interface AssetGroupBuilder<P = Record<string, unknown>> {
|
|
143
|
+
config(config: IconAssetGroupConfig<P>): IconAssetGroupDefinition;
|
|
144
|
+
config(config: FontAssetGroupConfig): FontAssetGroupDefinition;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Attach icon metadata to a single one-off icon and hand it back
|
|
148
|
+
* unchanged. `isSvgIcon: true` is implied —
|
|
149
|
+
* the point of the call is to mark the component as an icon so the
|
|
150
|
+
* group harvest picks it up. Slots still point at the *group*, never
|
|
151
|
+
* at this.
|
|
152
|
+
*/
|
|
153
|
+
declare function defineAssetIcon<T>(component: T, metadata: Omit<IconAssetMetadata, 'isSvgIcon'>): T & {
|
|
154
|
+
readonly metadata: IconAssetMetadata;
|
|
155
|
+
};
|
|
156
|
+
declare function defineAssetGroup<P = Record<string, unknown>>(members: Readonly<Record<string, unknown>>): AssetGroupBuilder<P>; //#endregion
|
|
157
|
+
//#endregion
|
|
158
|
+
export { AssetGroupBuilder, AssetGroupConfig, AssetGroupDefinition, FontAssetGroupConfig, FontAssetGroupDefinition, IconAssetGroupConfig, IconAssetGroupDefinition, IconAssetMember, IconAssetMetadata, defineAssetGroup, defineAssetIcon };
|