@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
|
@@ -1,72 +1,705 @@
|
|
|
1
|
+
import { ComponentRef, CompositeRef, ModeRef, TagRef, TokenGroupRef, TokenRef } from "./refs.js";
|
|
2
|
+
import { ColorExpression } from "./colorExpressions.js";
|
|
3
|
+
import { CssPropertyName, CssPropertyValues } from "./types/css-properties.js";
|
|
4
|
+
import { IconAssetMetadata } from "./defineAssetGroup.js";
|
|
5
|
+
|
|
1
6
|
//#region ../config/dist/types.d.ts
|
|
2
7
|
//#region src/types.d.ts
|
|
3
8
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
* can
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* A
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
*
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
9
|
+
* CSS value-type names used to tag a token. The scaffold leaves the
|
|
10
|
+
* union open so token-type tightening (a closed CSS-value-type union)
|
|
11
|
+
* lands as a follow-up — needs to ship with type-narrowing on
|
|
12
|
+
* `defineStyleProp({ values: ... })` to be useful.
|
|
13
|
+
*/
|
|
14
|
+
type TokenType = string;
|
|
15
|
+
/**
|
|
16
|
+
* What a token's `value` can hold:
|
|
17
|
+
*
|
|
18
|
+
* - A literal — `string` (`'#1167f4'`, `'1rem'`), `number`, `boolean`.
|
|
19
|
+
* - A `token('ns/name')` marker pointing at another token.
|
|
20
|
+
* - A structured `ColorExpression` — `mix(...)`, `alpha(...)`,
|
|
21
|
+
* `linearGradient(...)`, `radialGradient(...)`. Codegen resolves the
|
|
22
|
+
* expression to a CSS function call (`color-mix(...)`,
|
|
23
|
+
* `linear-gradient(...)`) via `resolveColorExpression`.
|
|
24
|
+
*/
|
|
25
|
+
type TokenValue = string | number | boolean | TokenRef | ColorExpression;
|
|
26
|
+
type TokenModifierKey = `_${string}`;
|
|
27
|
+
type TokenModifierValue = TokenValue | TokenDefinition;
|
|
28
|
+
/**
|
|
29
|
+
* Authored shape for one token. Modifier values live as flat `_${key}`
|
|
30
|
+
* properties on the same object — matches the doc's example
|
|
31
|
+
* `{ value: '#1167f4', _dark: '#88bcfb' }` and the wire format.
|
|
32
|
+
*
|
|
33
|
+
* `Token` normalizes flat keys into a `modifiers` map at construction
|
|
34
|
+
* time so consumers reading the class instance work with the
|
|
35
|
+
* doc-described class shape.
|
|
36
|
+
*/
|
|
37
|
+
type TokenDefinition = {
|
|
38
|
+
value: TokenValue;
|
|
39
|
+
type?: TokenType;
|
|
40
|
+
} & { [K in `_${string}`]?: TokenModifierValue };
|
|
41
|
+
/**
|
|
42
|
+
* Authored shape — the bare tokens record. Mirrors the old `@uds/config`
|
|
43
|
+
* `defineTokenGroup(tokens)` signature: input is the tokens map; group
|
|
44
|
+
* metadata (label / description) is attached separately via the
|
|
45
|
+
* registration call, not nested under a wrapper.
|
|
46
|
+
*/
|
|
47
|
+
/**
|
|
48
|
+
* A token group: a tokens record + optional Studio-facing metadata.
|
|
49
|
+
* Mirrors main's `TokenGroupDef`. The parent record key in
|
|
50
|
+
* `registerTokenGroups({...})` carries the namespace, so it doesn't
|
|
51
|
+
* appear here. Tokens nest under `tokens` so a token named `'label'`
|
|
52
|
+
* (or any meta key) can never collide with group metadata.
|
|
53
|
+
*/
|
|
54
|
+
interface TokenGroupDefinition {
|
|
55
|
+
tokens: Record<string, TokenDefinition>;
|
|
56
|
+
label?: string;
|
|
57
|
+
description?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Alias for the on-disk wire shape — structurally identical to
|
|
61
|
+
* `TokenGroupDefinition`. Used as the return type of
|
|
62
|
+
* `TokenGroup.toJSON()` so the serialization intent reads at call
|
|
63
|
+
* sites; consumers reading `config.json` see `SerializedTokenGroup`,
|
|
64
|
+
* authors writing `registerTokenGroups` see `TokenGroupDefinition`.
|
|
65
|
+
*/
|
|
66
|
+
type SerializedTokenGroup = TokenGroupDefinition;
|
|
67
|
+
interface ModifierDefinition {
|
|
68
|
+
selector?: string | CompositeRef | ModeRef;
|
|
69
|
+
media?: string;
|
|
70
|
+
description?: string;
|
|
71
|
+
}
|
|
72
|
+
interface ModeOptionDefinition {
|
|
73
|
+
/**
|
|
74
|
+
* Modifier the option contributes. Defaults to `_${optionName}` —
|
|
75
|
+
* `colorMode: { options: { light: {...}, dark: {...} } }` produces
|
|
76
|
+
* modifiers `_light` and `_dark` without restating them. Override
|
|
77
|
+
* when the option name and the desired modifier should differ.
|
|
78
|
+
*/
|
|
79
|
+
modifier?: TokenModifierKey;
|
|
80
|
+
label?: string;
|
|
81
|
+
description?: string;
|
|
82
|
+
/**
|
|
83
|
+
* CSS selector text the option produces — for `colorMode/dark`,
|
|
84
|
+
* `'.dark'` so consumers can write `<html class="dark">` and have
|
|
85
|
+
* the dark-mode tokens apply. Mirrors the old
|
|
86
|
+
* `@uds/config` `ModeOptionInput.css` field name.
|
|
87
|
+
*/
|
|
88
|
+
css?: string;
|
|
89
|
+
media?: string;
|
|
90
|
+
}
|
|
91
|
+
type ModeDefinition = Record<string, ModeOptionDefinition>;
|
|
92
|
+
type CompositeStyleObject = Record<string, unknown>;
|
|
93
|
+
interface CompositeStyleDefinition {
|
|
94
|
+
label: string;
|
|
95
|
+
description?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Named style variants keyed by variant name. Mirrors the old
|
|
98
|
+
* `@uds/config` `defineCompositeStyle({ styles })` field name —
|
|
99
|
+
* authors write `styles: { sm: {...}, md: {...} }`.
|
|
100
|
+
*/
|
|
101
|
+
styles: Record<string, CompositeStyleObject>;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Any CSS property name `defineStyleProp` can target. Standard
|
|
105
|
+
* property names come from the `CssPropertyValues` registry; custom
|
|
106
|
+
* CSS properties (`--*`) are open template strings.
|
|
107
|
+
*/
|
|
108
|
+
type StylePropProperty = CssPropertyName | `--${string}`;
|
|
109
|
+
/**
|
|
110
|
+
* Literal-keyword subset accepted by a CSS property. For standard
|
|
111
|
+
* properties, falls out of `CssPropertyValues[P]`. For custom CSS
|
|
112
|
+
* properties (`--*`), open string — narrowing happens via the
|
|
113
|
+
* `cssType` field on the style-prop spec.
|
|
114
|
+
*/
|
|
115
|
+
type LiteralFor<P extends StylePropProperty> = [P] extends [CssPropertyName] ? Extract<CssPropertyValues[P], string> : string;
|
|
116
|
+
/**
|
|
117
|
+
* Author-friendly alias for a CSS keyword. `alias` is what the JSX
|
|
118
|
+
* value site uses (`flexDirection="col"`); `value` is the underlying
|
|
119
|
+
* CSS the prop resolves to.
|
|
120
|
+
*
|
|
121
|
+
* - `string` — a single CSS keyword (`'column'`).
|
|
122
|
+
* - `Record<string, string>` — a multi-property emission, used to
|
|
123
|
+
* write vendor-prefixed pairs (`{ '-webkit-user-select': 'none',
|
|
124
|
+
* 'user-select': 'none' }`) so a single utility class sets both at
|
|
125
|
+
* once and matches Tailwind's built-in body byte-for-byte (avoids
|
|
126
|
+
* cascade overrides).
|
|
127
|
+
*
|
|
128
|
+
* `value` is kept un-narrowed here — per-property narrowing via
|
|
129
|
+
* `LiteralFor<P>` would explode the union across every CSS property
|
|
130
|
+
* and hit TS's "too complex" limit.
|
|
131
|
+
*/
|
|
132
|
+
interface ValueAlias {
|
|
133
|
+
alias: string | boolean | number;
|
|
134
|
+
value: string | Record<string, string>;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* A single entry in a style-prop's `values` array. Narrowed against
|
|
138
|
+
* the chosen `cssProperty` so authoring sites like
|
|
139
|
+
* `values: ['banana']` on a `border-color` prop error at compile time.
|
|
140
|
+
*
|
|
141
|
+
* - `TokenGroupRef` — pulls every token in the named namespace
|
|
142
|
+
* into the prop's accepted value set.
|
|
143
|
+
* - `LiteralFor<P>` — a CSS keyword the property accepts per spec
|
|
144
|
+
* (e.g. `'transparent'` for `border-color`).
|
|
145
|
+
* - `number` — bare numeric values where CSS itself accepts numbers
|
|
146
|
+
* (e.g. `line-clamp: 3`).
|
|
147
|
+
* - `ValueAlias<P>` — `{ alias, value }` pair for Tailwind-style
|
|
148
|
+
* shorthands; the alias appears at the JSX value site and resolves
|
|
149
|
+
* to the underlying CSS keyword at emit time.
|
|
150
|
+
*/
|
|
151
|
+
type ValuesEntry<P extends StylePropProperty = StylePropProperty> = TokenGroupRef | LiteralFor<P> | number | ValueAlias;
|
|
152
|
+
interface ArbitrarySpec {
|
|
153
|
+
type?: TokenType;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* One entry in a multi-shape `arbitrary` array. `toCss` lets the prop
|
|
157
|
+
* coerce a runtime value into the actual CSS string (e.g. wrapping a
|
|
158
|
+
* raw `'1px'` in `var(--...)` or stitching multi-property output). The
|
|
159
|
+
* `regex` variant accepts any string matching a pattern instead of
|
|
160
|
+
* binding to a named value type.
|
|
161
|
+
*/
|
|
162
|
+
type ArbitraryEntry = {
|
|
163
|
+
type: TokenType;
|
|
164
|
+
toCss?: (value: unknown) => string;
|
|
165
|
+
} | {
|
|
166
|
+
type: 'regex';
|
|
167
|
+
pattern: RegExp;
|
|
168
|
+
toCss?: (value: string) => string;
|
|
60
169
|
};
|
|
61
170
|
/**
|
|
62
|
-
*
|
|
171
|
+
* Author-time shape for `arbitrary`. Four forms:
|
|
172
|
+
* - `true` — accept any bracketed value, passed through verbatim into the
|
|
173
|
+
* prop's `cssProperty` (`arbitrary: true` → `blur="[blur(6px)]"` →
|
|
174
|
+
* `filter: blur(6px)`). Use when the bracket already carries the full CSS
|
|
175
|
+
* value and needs no data-type validation or transform.
|
|
176
|
+
* - bare `TokenType` string (`arbitrary: 'length-percentage'`) —
|
|
177
|
+
* shorthand for `{ type: ... }`.
|
|
178
|
+
* - `ArbitrarySpec` object (`arbitrary: { type: 'color' }`).
|
|
179
|
+
* - `ArbitraryEntry[]` for multi-shape props that accept several
|
|
180
|
+
* value-type variants (e.g. `grid-template-rows` taking integers,
|
|
181
|
+
* length-percentages, and full track lists).
|
|
182
|
+
* Normalized at `StyleProp` construction time (`true` → `{}`).
|
|
183
|
+
*/
|
|
184
|
+
type ArbitraryInput = boolean | TokenType | ArbitrarySpec | readonly ArbitraryEntry[];
|
|
185
|
+
/**
|
|
186
|
+
* Authored shape attached by `defineStyleProp(spec).withOpacity({...})`.
|
|
187
|
+
* Declares a paired opacity sibling style-prop: the parent emits
|
|
188
|
+
* `${classPrefix}-${tokenName}` for the bare value AND
|
|
189
|
+
* `${classPrefix}-${tokenName}${separator}${opacityValue}` when the
|
|
190
|
+
* sibling prop is set. The sibling itself is registered alongside the
|
|
191
|
+
* parent at `registerStyleProps` time.
|
|
192
|
+
*
|
|
193
|
+
* `ref` (deprecated alias for `as`) is kept for back-compat with sites
|
|
194
|
+
* that read the opacity pair as `{ ref }` — codegen's `extractClasses.ts`
|
|
195
|
+
* checks `opacityPair.ref` directly.
|
|
196
|
+
*/
|
|
197
|
+
interface OpacityPairSpec {
|
|
198
|
+
/** JSX-prop name for the opacity sibling (e.g. `'bgOpacity'`). */
|
|
199
|
+
as: string;
|
|
200
|
+
/** Token group the opacity sibling pulls values from. */
|
|
201
|
+
values: TokenGroupRef;
|
|
202
|
+
/**
|
|
203
|
+
* Class-name separator between the parent's token suffix and the
|
|
204
|
+
* opacity value. Defaults to `'_'`. Pass `'/'` for Tailwind-flavored
|
|
205
|
+
* output (`bg-primary/75`).
|
|
206
|
+
*/
|
|
207
|
+
separator?: string;
|
|
208
|
+
/** Back-compat alias of `as`. New code should use `as`. */
|
|
209
|
+
ref?: string;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Authoring metadata attached via `defineStyleProp(spec).metadata({...})`.
|
|
213
|
+
* Consumed by codegen prompt artifacts and Studio's UI. Kept open
|
|
214
|
+
* (`Readonly<Record<string, unknown>>`) — `label` / `description` are
|
|
215
|
+
* the conventional fields but the slot doesn't enforce.
|
|
216
|
+
*/
|
|
217
|
+
type StylePropMetadata = Readonly<Record<string, unknown>>;
|
|
218
|
+
/**
|
|
219
|
+
* Authoring metadata attached via
|
|
220
|
+
* `defineComponent(...).config(...).metadata({...})`. `description`
|
|
221
|
+
* shows up in codegen's AI prompt artifact next to the component name;
|
|
222
|
+
* `events` lists React/HTML event handler names the component supports
|
|
223
|
+
* (`'focus'`, `'press'`, etc.) — when unset, the synthesizer falls
|
|
224
|
+
* back to the standard React event roster. `deprecated` keeps a component
|
|
225
|
+
* out of the AI prompt artifact while leaving it registered and renderable.
|
|
226
|
+
*/
|
|
227
|
+
interface ComponentMetadata {
|
|
228
|
+
/**
|
|
229
|
+
* Human-facing display name for Studio's palette. Defaults to the
|
|
230
|
+
* component's registered name when absent. Lets two components present
|
|
231
|
+
* the same label (e.g. both "Badge") while keeping distinct, stable
|
|
232
|
+
* identities (`uds:Badge` vs `uds:StudioBadge`) — identity stays the
|
|
233
|
+
* registered name, never this label.
|
|
234
|
+
*/
|
|
235
|
+
readonly label?: string;
|
|
236
|
+
readonly description?: string;
|
|
237
|
+
readonly events?: readonly string[];
|
|
238
|
+
/**
|
|
239
|
+
* Marks the component as deprecated. Deprecated components are omitted
|
|
240
|
+
* from codegen's AI prompt artifact so the model won't reach for them in
|
|
241
|
+
* new work — they remain fully registered and renderable everywhere else.
|
|
242
|
+
*/
|
|
243
|
+
readonly deprecated?: boolean;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Authored shape for `defineStyleProp`. `P` is the CSS property name
|
|
247
|
+
* (or names, when `cssProperty` is an array of side-shorthand props)
|
|
248
|
+
* — `values` narrows against `LiteralFor<P>` so unsupported keywords
|
|
249
|
+
* surface at the authoring site.
|
|
250
|
+
*
|
|
251
|
+
* No default for `P`: the wide case would force TypeScript to
|
|
252
|
+
* materialize `Extract<CssPropertyValues[CssPropertyName], string>`
|
|
253
|
+
* (a giant union) at every reference site. Wide-typed consumers
|
|
254
|
+
* (`Config.styleProps`, the wire format) use `AnyStylePropDefinition`
|
|
255
|
+
* instead.
|
|
256
|
+
*/
|
|
257
|
+
interface StylePropDefinition<P extends StylePropProperty> {
|
|
258
|
+
cssProperty: P | readonly P[];
|
|
259
|
+
classPrefix: string;
|
|
260
|
+
/**
|
|
261
|
+
* Token-group refs + literal keywords + bare numbers the prop accepts.
|
|
262
|
+
* Optional — `values: []` (or omitting it) is meaningful for props
|
|
263
|
+
* that only take arbitrary `[...]` escape values (e.g. `motion`).
|
|
264
|
+
*/
|
|
265
|
+
values?: readonly ValuesEntry<P>[];
|
|
266
|
+
arbitrary?: ArbitraryInput;
|
|
267
|
+
/**
|
|
268
|
+
* Marks the prop as emitting a *negative* value: the resolved token or
|
|
269
|
+
* arbitrary value is wrapped in `calc(<value> * -1)` at emit time, so
|
|
270
|
+
* `offsetTop="3"` (a `negative` prop) paints
|
|
271
|
+
* `margin-top: calc(var(--uds-spacing-3) * -1)`. This flag is the single
|
|
272
|
+
* source of negativity — both the build-time emitter (`prepareCss`) and
|
|
273
|
+
* the runtime injector (`renderGetStyles`) read it, replacing the old
|
|
274
|
+
* `classPrefix.startsWith('-')` heuristic. It's also the structured signal
|
|
275
|
+
* the MCP / AI guidance / spec lint use to identify overlap-prone props.
|
|
276
|
+
*
|
|
277
|
+
* Negative props conventionally still use a `-`-led `classPrefix` (`-mt`)
|
|
278
|
+
* so the utility reads as a Tailwind negative class (`.-mt-3`) and stays
|
|
279
|
+
* distinct from a positive sibling (`marginTop` → `.mt-3`) — but the prefix
|
|
280
|
+
* only *names* the class; this flag *drives* the negation.
|
|
281
|
+
*/
|
|
282
|
+
negative?: boolean;
|
|
283
|
+
cssType?: TokenType;
|
|
284
|
+
metadata?: StylePropMetadata;
|
|
285
|
+
opacityPair?: OpacityPairSpec;
|
|
286
|
+
/**
|
|
287
|
+
* Optional value coercion the renderer applies after token resolution.
|
|
288
|
+
* Takes the resolved value (number for bare-numeric tokens, string
|
|
289
|
+
* otherwise) and returns the final CSS string. Lets props like
|
|
290
|
+
* `gridTemplateColumns` accept `12` and emit
|
|
291
|
+
* `repeat(12, minmax(0, 1fr))`.
|
|
292
|
+
*/
|
|
293
|
+
transform?: (value: string | number) => string;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Wide structural shape used by `Config.registerStyleProps` and the
|
|
297
|
+
* `StyleProp` class storage. Any concretely-narrowed
|
|
298
|
+
* `StylePropDefinition<P>` is assignable to this. `values` is the
|
|
299
|
+
* un-narrowed marker/literal/number union — runtime treats every
|
|
300
|
+
* entry uniformly, so the narrowing in `StylePropDefinition<P>` is
|
|
301
|
+
* purely an authoring-time check.
|
|
302
|
+
*/
|
|
303
|
+
interface AnyStylePropDefinition {
|
|
304
|
+
cssProperty: StylePropProperty | readonly StylePropProperty[];
|
|
305
|
+
classPrefix: string;
|
|
306
|
+
values?: readonly (TokenGroupRef | string | number | ValueAlias)[];
|
|
307
|
+
arbitrary?: ArbitraryInput;
|
|
308
|
+
/** See {@link StylePropDefinition.negative} — emit `calc(<value> * -1)`. */
|
|
309
|
+
negative?: boolean;
|
|
310
|
+
cssType?: TokenType;
|
|
311
|
+
metadata?: StylePropMetadata;
|
|
312
|
+
opacityPair?: OpacityPairSpec;
|
|
313
|
+
transform?: (value: string | number) => string;
|
|
314
|
+
}
|
|
315
|
+
type MotionKeyframes = Record<string, Record<string, unknown>>;
|
|
316
|
+
interface MotionTransition {
|
|
317
|
+
duration?: number | string;
|
|
318
|
+
delay?: number | string;
|
|
319
|
+
ease?: string | readonly number[];
|
|
320
|
+
[key: string]: unknown;
|
|
321
|
+
}
|
|
322
|
+
interface MotionStateKeyframe {
|
|
323
|
+
[key: string]: unknown;
|
|
324
|
+
}
|
|
325
|
+
interface CssMotionDefinition {
|
|
326
|
+
runtime: 'css';
|
|
327
|
+
keyframes: MotionKeyframes;
|
|
328
|
+
transition?: MotionTransition;
|
|
329
|
+
/**
|
|
330
|
+
* Open index signature for `animation-*` CSS shorthand fields the
|
|
331
|
+
* old `@uds/config` placed directly on the motion def
|
|
332
|
+
* (`animationDuration`, `animationTimingFunction`, etc.). Codegen
|
|
333
|
+
* reads them off the toJSON'd shape and folds them into the emitted
|
|
334
|
+
* `animation: ...` declaration alongside the keyframes/transition.
|
|
335
|
+
*/
|
|
336
|
+
[key: string]: unknown;
|
|
337
|
+
}
|
|
338
|
+
interface JsMotionDefinition {
|
|
339
|
+
runtime: 'js';
|
|
340
|
+
initial?: MotionStateKeyframe;
|
|
341
|
+
animate?: MotionStateKeyframe;
|
|
342
|
+
/**
|
|
343
|
+
* Exit keyframes — applied when the host element unmounts. Requires
|
|
344
|
+
* the consumer to render the slot conditionally so the JS runtime
|
|
345
|
+
* (`motion/react`'s `<AnimatePresence>`) can play the exit before the
|
|
346
|
+
* node detaches.
|
|
347
|
+
*/
|
|
348
|
+
exit?: MotionStateKeyframe;
|
|
349
|
+
transition?: MotionTransition;
|
|
350
|
+
/** Keyframes applied while the element is hovered. */
|
|
351
|
+
whileHover?: MotionStateKeyframe;
|
|
352
|
+
/** Keyframes applied while the element is actively pressed. */
|
|
353
|
+
whileTap?: MotionStateKeyframe;
|
|
354
|
+
}
|
|
355
|
+
type MotionDefinitionInput = CssMotionDefinition | JsMotionDefinition;
|
|
356
|
+
/**
|
|
357
|
+
* Layer-with-overrides shape — the old `@uds/config` authoring form
|
|
358
|
+
* where a layer carries its tag and its per-layer overrides
|
|
359
|
+
* (`defaultProps`, `base`, etc.) inline. Codegen reads `tag` to set
|
|
360
|
+
* the layer's element and the remaining fields contribute to the
|
|
361
|
+
* layer's emitted styles. Used in tests + legacy configs; the
|
|
362
|
+
* structured marker forms (`tag('div')` etc.) are preferred for new
|
|
363
|
+
* code because they round-trip cleanly through JSON.
|
|
364
|
+
*/
|
|
365
|
+
interface LayerWithOverrides {
|
|
366
|
+
tag: string | TagRef | ComponentRef;
|
|
367
|
+
defaultProps?: Record<string, unknown>;
|
|
368
|
+
base?: Record<string, unknown>;
|
|
369
|
+
[key: string]: unknown;
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* What can appear as a layer's value in `defineComponent`'s `layers`
|
|
373
|
+
* map. Five authoring forms:
|
|
374
|
+
*
|
|
375
|
+
* - bare tag name string — `'div'`, `'span'`. The old `@uds/config`
|
|
376
|
+
* layer syntax; `Component` normalizes to a `TagRef` at construction.
|
|
377
|
+
* - `TagRef` — `tag('div')` marker form (equivalent to the bare
|
|
378
|
+
* string; both produce the same on-disk shape).
|
|
379
|
+
* - `ComponentRef` — string-keyed reference to a registered
|
|
380
|
+
* component (`component('Box')`).
|
|
381
|
+
* - `ComponentDefinition` value — the registered component itself
|
|
382
|
+
* (`{ root: Box, trigger: Pressable }`). Identity-keyed; codegen
|
|
383
|
+
* resolves it back to a component name via its
|
|
384
|
+
* `configToName` reverse map at type-narrowing + class-extraction
|
|
385
|
+
* time. Permits ergonomic `.layers({ root: Box })` authoring.
|
|
386
|
+
* - `LayerWithOverrides` — `{ tag, defaultProps?, base?, ... }`. The
|
|
387
|
+
* old layer-with-overrides shape; `Component` lifts `tag` onto
|
|
388
|
+
* `Layer.tag` and leaves the remaining fields on the layer entry
|
|
389
|
+
* for codegen to read.
|
|
390
|
+
*/
|
|
391
|
+
type LayerInput = string | TagRef | ComponentRef | ComponentDefinition | LayerWithOverrides;
|
|
392
|
+
type BaseStyles = Record<string, Record<string, unknown>>;
|
|
393
|
+
interface CompoundPropsEntry {
|
|
394
|
+
when: Record<string, unknown>;
|
|
395
|
+
layers: Record<string, unknown>;
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Per-layer framer-motion spec a component carries inline. Mirrors
|
|
399
|
+
* main's `SlotMotion`: every field is `unknown` because the framer-
|
|
400
|
+
* motion API surface is wide and we don't want to lock authoring to
|
|
401
|
+
* a particular `motion/react` version. Codegen passes the value
|
|
402
|
+
* through to the runtime renderer.
|
|
403
|
+
*/
|
|
404
|
+
interface SlotMotion {
|
|
405
|
+
readonly runtime?: 'js' | 'css';
|
|
406
|
+
readonly initial?: unknown;
|
|
407
|
+
readonly animate?: unknown;
|
|
408
|
+
readonly exit?: unknown;
|
|
409
|
+
readonly transition?: unknown;
|
|
410
|
+
readonly whileHover?: unknown;
|
|
411
|
+
readonly whileTap?: unknown;
|
|
412
|
+
readonly drag?: unknown;
|
|
413
|
+
readonly dragConstraints?: unknown;
|
|
414
|
+
readonly dragElastic?: unknown;
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Component-level motion field. Three shapes:
|
|
418
|
+
* - `string` — alias of a `registerMotion({...})` preset.
|
|
419
|
+
* - `{ runtime, ... }` — inline `SlotMotion` applied to the root.
|
|
420
|
+
* - `Record<string, SlotMotion>` — per-layer record keyed by layer
|
|
421
|
+
* name (`{ icon: {...}, menu: {...} }`); each layer animates
|
|
422
|
+
* independently with its own framer config.
|
|
423
|
+
*/
|
|
424
|
+
type ComponentMotionValue = string | SlotMotion | Record<string, SlotMotion>;
|
|
425
|
+
type PropBinding = unknown;
|
|
426
|
+
/**
|
|
427
|
+
* Extract the literal HTML tag from a `layers` map when it can be read
|
|
428
|
+
* statically. Returns the bare-tag literal (`'a' | 'div' | ...`) when:
|
|
429
|
+
*
|
|
430
|
+
* - `layers.root` is a bare tag string (`'a'`),
|
|
431
|
+
* - `layers.root` is a `TagRef<'a'>` marker,
|
|
432
|
+
* - `layers.root` is a `LayerWithOverrides` (`{ tag: 'a', ... }`) where
|
|
433
|
+
* `tag` is a bare string or `TagRef`, or
|
|
434
|
+
* - `layers.root` is a value-extend wrapper carrying its own captured
|
|
435
|
+
* root tag (recurses one level so `defineComponent(Box)` inherits
|
|
436
|
+
* Box's `'div'` root tag).
|
|
437
|
+
*
|
|
438
|
+
* Returns `undefined` when `layers.root` is a value-extend wrapper
|
|
439
|
+
* without a captured tag, or when the field is absent. `Props<T>`
|
|
440
|
+
* reads this and substitutes `ComponentPropsWithRef<TTag>` for the
|
|
441
|
+
* generic `HTMLAttributes<HTMLElement>` when narrowable.
|
|
442
|
+
*/
|
|
443
|
+
type RootTag<TLayers> = TLayers extends {
|
|
444
|
+
root: infer R;
|
|
445
|
+
} ? R extends string ? R : R extends {
|
|
446
|
+
__kind: 'tag';
|
|
447
|
+
ref: infer T extends string;
|
|
448
|
+
} ? T : R extends {
|
|
449
|
+
tag: infer T extends string;
|
|
450
|
+
} ? T : R extends {
|
|
451
|
+
tag: {
|
|
452
|
+
__kind: 'tag';
|
|
453
|
+
ref: infer T extends string;
|
|
454
|
+
};
|
|
455
|
+
} ? T : R extends {
|
|
456
|
+
defaultProps: {
|
|
457
|
+
as: infer A extends string;
|
|
458
|
+
};
|
|
459
|
+
} ? A : R extends ComponentDefinition<Record<string, LayerInput>, Record<string, PropBinding>, infer TInnerTag> ? TInnerTag : undefined : undefined;
|
|
460
|
+
/**
|
|
461
|
+
* Structural shape of a `defineComponent` config. Parameterized over its
|
|
462
|
+
* `layers`, `props`, and the resolved root tag so a wrapping `Props<T>`
|
|
463
|
+
* walker can read each piece independently without unfolding the wide
|
|
464
|
+
* structural surface at every recursion.
|
|
465
|
+
*
|
|
466
|
+
* Defaults match the historic open shape so existing 70+ use sites that
|
|
467
|
+
* write `ComponentDefinition` un-parameterized continue to typecheck —
|
|
468
|
+
* the narrow forms only kick in when authoring chains thread literal
|
|
469
|
+
* generics through (`defineComponent('div')` → `TTag = 'div'`).
|
|
470
|
+
*/
|
|
471
|
+
interface ComponentDefinition<TLayers extends Record<string, LayerInput> = Record<string, LayerInput>, TProps extends Record<string, PropBinding> = Record<string, PropBinding>, TTag extends string | undefined = string | undefined> {
|
|
472
|
+
layers: TLayers;
|
|
473
|
+
props?: TProps;
|
|
474
|
+
base?: BaseStyles;
|
|
475
|
+
defaultProps?: Record<string, unknown>;
|
|
476
|
+
compoundProps?: readonly CompoundPropsEntry[];
|
|
477
|
+
motion?: ComponentMotionValue;
|
|
478
|
+
/**
|
|
479
|
+
* Phantom slot — populated only as a type marker (never read at
|
|
480
|
+
* runtime) so `RootTag<TLayers>` callers can fall back to this when
|
|
481
|
+
* the layer's root is a value-extend wrapper. The value-extend chain
|
|
482
|
+
* threads its captured `TTag` through here.
|
|
483
|
+
*/
|
|
484
|
+
readonly __tag?: TTag;
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Authored shape for a component's preview block — attached via
|
|
488
|
+
* `defineComponent({...}).preview({...})`. Carries the data Studio +
|
|
489
|
+
* codegen need to render a component tile: `defaultProps` is the
|
|
490
|
+
* baseline JSX prop bag; `matrix` declares the axes for the canvas
|
|
491
|
+
* grid view. Stored verbatim on `Component.preview` and round-trips
|
|
492
|
+
* through JSON unchanged.
|
|
493
|
+
*
|
|
494
|
+
* Named `PreviewDefinition` to match the package's `*Definition`
|
|
495
|
+
* convention and avoid confusion with json-render's `spec` (the
|
|
496
|
+
* canvas-renderable tree that lives at `ManifestPreviewEntry.spec`).
|
|
497
|
+
*
|
|
498
|
+
* `matrix.columns` / `matrix.rows` are typed as `unknown[]` — concrete
|
|
499
|
+
* axis-entry shapes (prop-axis, modifier-axis) belong to the renderer
|
|
500
|
+
* surface, not the authoring contract.
|
|
501
|
+
*/
|
|
502
|
+
interface PreviewDefinition<TProps extends Record<string, unknown> = Record<string, unknown>> {
|
|
503
|
+
/**
|
|
504
|
+
* Authored — passed to `.preview({ defaultProps })`. Narrowed against
|
|
505
|
+
* the component's resolved JSX prop shape so callback params
|
|
506
|
+
* (`onSubmit: (event) => ...`) infer from the component's declared
|
|
507
|
+
* `TExtra` rather than collapsing to `any`. Falls back to the wide
|
|
508
|
+
* `Record<string, unknown>` when the call site doesn't supply a
|
|
509
|
+
* `TProps` generic (Studio + codegen consume the loose shape).
|
|
510
|
+
*/
|
|
511
|
+
readonly defaultProps?: Partial<TProps>;
|
|
512
|
+
/** Authored — passed to `.preview({ matrix })`. Drives the canvas grid view. */
|
|
513
|
+
readonly matrix?: {
|
|
514
|
+
readonly columns?: readonly unknown[];
|
|
515
|
+
readonly rows?: readonly unknown[];
|
|
516
|
+
};
|
|
517
|
+
/**
|
|
518
|
+
* Codegen-extracted — parsed json-render spec from
|
|
519
|
+
* `defaultProps.children` JSX. Studio's canvas + docs read this to
|
|
520
|
+
* render the preview tile. Plain JSON (no functions / React elements).
|
|
521
|
+
*/
|
|
522
|
+
readonly spec?: Readonly<Record<string, unknown>>;
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Wire shape for a component — what lands in `config.json`. The
|
|
526
|
+
* authored `ComponentDefinition` plus the two enrichments that aren't
|
|
527
|
+
* authored at the call site: `preview` (added by the `.preview()`
|
|
528
|
+
* chain) and `sourceFilePath` (stack-walked by `captureCallerPath` at
|
|
529
|
+
* `defineComponent` time). Kept separate from `ComponentDefinition`
|
|
530
|
+
* so IDE completions inside `defineComponent({...})` don't suggest
|
|
531
|
+
* fields the author can't write directly.
|
|
532
|
+
*/
|
|
533
|
+
interface SerializedComponent extends ComponentDefinition {
|
|
534
|
+
preview?: PreviewDefinition;
|
|
535
|
+
/**
|
|
536
|
+
* Path of the file that defined the component. Relative to
|
|
537
|
+
* `meta.projectRoot` when `Config.toJSON({ projectRoot })` is used
|
|
538
|
+
* (CLI's path) — keeps `config.json` portable across machines.
|
|
539
|
+
* Absolute when serialized without a `projectRoot`.
|
|
540
|
+
*/
|
|
541
|
+
sourceFilePath?: string;
|
|
542
|
+
/**
|
|
543
|
+
* Set on a sub-part — name of the parent that owns it. Mirrors
|
|
544
|
+
* `Component.derived.subcomponentOf`. The authored relationship is
|
|
545
|
+
* declared on the parent via `.subcomponents({...})`; this field is
|
|
546
|
+
* the wire-format echo so `Config.fromJSON` can rebuild the linkage
|
|
547
|
+
* without re-running the original `.subcomponents` chain.
|
|
548
|
+
*/
|
|
549
|
+
subcomponentOf?: string;
|
|
550
|
+
/**
|
|
551
|
+
* Name of the component this one value-extends via `defineComponent(Source)`.
|
|
552
|
+
* Mirrors `Component.extendsFrom`; lets consumers diff a child's props
|
|
553
|
+
* against the parent's instead of re-listing the inherited surface.
|
|
554
|
+
*/
|
|
555
|
+
extendsFrom?: string;
|
|
556
|
+
/**
|
|
557
|
+
* Set on a parent — child names declared via `.subcomponents({...})`.
|
|
558
|
+
* Mirrors `Component.derived.subcomponents`.
|
|
559
|
+
*/
|
|
560
|
+
subcomponents?: readonly string[];
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* Authored shape for a component group — a labeled bundle of
|
|
564
|
+
* registered components surfaced together in the Studio palette,
|
|
565
|
+
* codegen catalog, and AI prompt.
|
|
566
|
+
*
|
|
567
|
+
* `components` is keyed by the registration name (same surface as
|
|
568
|
+
* `registerComponents`); each value is a plain `ComponentDefinition`.
|
|
569
|
+
* Registration flattens these into `Config.components` and stamps
|
|
570
|
+
* `componentGroup` on each member's `Component.derived`.
|
|
571
|
+
*
|
|
572
|
+
* The serialized form (`SerializedComponentGroup`) replaces
|
|
573
|
+
* `components: Record<string, ComponentDefinition>` with
|
|
574
|
+
* `components: readonly string[]` — names only — because the
|
|
575
|
+
* definitions themselves live under `config.components` on disk.
|
|
576
|
+
*/
|
|
577
|
+
interface ComponentGroupDefinition {
|
|
578
|
+
label: string;
|
|
579
|
+
description?: string;
|
|
580
|
+
components: Record<string, ComponentDefinition>;
|
|
581
|
+
}
|
|
582
|
+
interface SerializedComponentGroup {
|
|
583
|
+
label: string;
|
|
584
|
+
description?: string;
|
|
585
|
+
components: readonly string[];
|
|
586
|
+
}
|
|
587
|
+
/**
|
|
588
|
+
* One font-class asset member — a pure-JSON data record (no FC to
|
|
589
|
+
* render), mirroring `@yahoo/uds-fonts`' `FontDeclarationConfig`. The
|
|
590
|
+
* structural contract the font-class member guard enforces is
|
|
591
|
+
* `fontFamily` + `declarations[]`; everything else (`fallback`,
|
|
592
|
+
* weights/axes, `isVariableFont`, …) rides along through the open
|
|
593
|
+
* index so the registered record stays faithful to the source map
|
|
594
|
+
* without `@uds/config` depending on the font package's types.
|
|
595
|
+
*/
|
|
596
|
+
interface FontAssetMember {
|
|
597
|
+
/** CSS-facing family name (`'YA Sans VF'`). */
|
|
598
|
+
readonly fontFamily: string;
|
|
599
|
+
/**
|
|
600
|
+
* `@font-face` source declarations (CDN URLs, weights/axes) — pure
|
|
601
|
+
* JSON the browser loader derives `@font-face` rules from.
|
|
602
|
+
*/
|
|
603
|
+
readonly declarations: readonly Record<string, unknown>[];
|
|
604
|
+
readonly [key: string]: unknown;
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* Wire shape for one asset group, discriminated by `assetKind` from
|
|
608
|
+
* day one so future asset classes extend the union without a wire
|
|
609
|
+
* migration. The member shape is per-class:
|
|
63
610
|
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
611
|
+
* - `'icon'` — `members` is a member-*name* list. The React
|
|
612
|
+
* components ship in the consumer bundle, so the serialized form
|
|
613
|
+
* only needs names (mirrors `SerializedComponentGroup.components`).
|
|
614
|
+
* - `'font'` — `members` is the full member-*record* map. Font
|
|
615
|
+
* members are already plain JSON and the browser `@font-face`
|
|
616
|
+
* loader needs the records themselves.
|
|
617
|
+
*/
|
|
618
|
+
interface SerializedIconAssetGroup {
|
|
619
|
+
assetKind: 'icon';
|
|
620
|
+
label: string;
|
|
621
|
+
description?: string;
|
|
622
|
+
/** Named size → px. The picker's size options are these keys. */
|
|
623
|
+
sizes: Readonly<Record<string, number>>;
|
|
624
|
+
/** Group-level variant superset (declared or harvested union). */
|
|
625
|
+
variants: readonly string[];
|
|
626
|
+
/**
|
|
627
|
+
* Authoring component for code export (`'Icon'`) — lets code views
|
|
628
|
+
* serialize a placed asset node as `<Icon name="Trophy" … />` and
|
|
629
|
+
* round-trip it. Also the component a placed member renders through on
|
|
630
|
+
* the canvas. Omitted for a component-less group (members render bare).
|
|
631
|
+
*/
|
|
632
|
+
component?: string;
|
|
633
|
+
members: readonly string[];
|
|
634
|
+
/**
|
|
635
|
+
* Per-member harvested metadata (each icon's own variants, category,
|
|
636
|
+
* tags), keyed by asset name. Carried on the wire so the browser picker
|
|
637
|
+
* can narrow ragged variants and search tags/category from the resolved
|
|
638
|
+
* config alone — without introspecting live member components. Omitted
|
|
639
|
+
* when no member carried metadata (e.g. a metadata-less library).
|
|
640
|
+
*/
|
|
641
|
+
memberMetadata?: Readonly<Record<string, IconAssetMetadata>>;
|
|
642
|
+
}
|
|
643
|
+
interface SerializedFontAssetGroup {
|
|
644
|
+
assetKind: 'font';
|
|
645
|
+
label: string;
|
|
646
|
+
description?: string;
|
|
647
|
+
members: Readonly<Record<string, FontAssetMember>>;
|
|
648
|
+
}
|
|
649
|
+
type SerializedAssetGroup = SerializedIconAssetGroup | SerializedFontAssetGroup;
|
|
650
|
+
type GlobalStylesDef = Record<string, Record<string, unknown>>;
|
|
651
|
+
/**
|
|
652
|
+
* Build-time knobs settable via `config.configure({ buildOptions })`. Read
|
|
653
|
+
* by the codegen pipeline (`@uds/codegen`) and the CLI to gate
|
|
654
|
+
* artifact emission. Authored on the config instance, propagated as-is.
|
|
655
|
+
*/
|
|
656
|
+
interface BuildOptions {
|
|
657
|
+
skipCssVariables?: boolean;
|
|
658
|
+
preflight?: boolean;
|
|
659
|
+
/**
|
|
660
|
+
* Scope every emitted CSS selector under this class name. The
|
|
661
|
+
* emitter's `:root` block becomes `.<cssScope>`; mode/theme blocks
|
|
662
|
+
* (e.g. `.dark` or `[data-theme="slate"]`) append `.<cssScope>` so
|
|
663
|
+
* they still apply when the attribute is on `<html>`. Utility
|
|
664
|
+
* classes nest under `.<cssScope>` so two UDS-powered packages on
|
|
665
|
+
* the same page don't collide.
|
|
666
|
+
*/
|
|
667
|
+
cssScope?: string;
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* `Config.toJSON()` produces this shape. Mirrors authored fields exactly
|
|
671
|
+
* — derived data is never serialized. The `{ __kind, ref }` marker shape
|
|
672
|
+
* appears wherever a position can hold either a literal or a cross-ref.
|
|
69
673
|
*/
|
|
70
|
-
|
|
674
|
+
interface SerializedConfig {
|
|
675
|
+
schemaVersion: number;
|
|
676
|
+
builtAt?: string;
|
|
677
|
+
prefix: string;
|
|
678
|
+
/** Registry namespace that prefixes component `registryKey`s
|
|
679
|
+
* (`<namespace>:<Component>`). Absent for un-namespaced configs.
|
|
680
|
+
* Declared via `configure({ namespace })`. */
|
|
681
|
+
namespace?: string;
|
|
682
|
+
preflight: boolean;
|
|
683
|
+
designPrinciples?: readonly string[];
|
|
684
|
+
globalStyles?: GlobalStylesDef;
|
|
685
|
+
/** Raw CSS strings included verbatim via `config.includeCss()` (e.g.
|
|
686
|
+
* `@font-face` blocks). Emitted after compilation, ahead of generated CSS. */
|
|
687
|
+
rawCss?: readonly string[];
|
|
688
|
+
modes?: Record<string, ModeDefinition>;
|
|
689
|
+
modifiers?: Record<string, ModifierDefinition>;
|
|
690
|
+
tokenGroups?: Record<string, SerializedTokenGroup>;
|
|
691
|
+
styleProps?: Record<string, AnyStylePropDefinition>;
|
|
692
|
+
compositeStyles?: Record<string, CompositeStyleDefinition>;
|
|
693
|
+
motion?: Record<string, MotionDefinitionInput>;
|
|
694
|
+
components?: Record<string, SerializedComponent>;
|
|
695
|
+
componentGroups?: Record<string, SerializedComponentGroup>;
|
|
696
|
+
/**
|
|
697
|
+
* Registered asset groups, keyed by slug. Optional — old
|
|
698
|
+
* `config.json` files without it hydrate to an empty map; no
|
|
699
|
+
* `schemaVersion` bump.
|
|
700
|
+
*/
|
|
701
|
+
assetGroups?: Record<string, SerializedAssetGroup>;
|
|
702
|
+
providers?: Record<string, Record<string, never>>;
|
|
703
|
+
} //#endregion
|
|
71
704
|
//#endregion
|
|
72
|
-
export {
|
|
705
|
+
export { AnyStylePropDefinition, ArbitraryEntry, ArbitrarySpec, BaseStyles, BuildOptions, ComponentDefinition, ComponentGroupDefinition, ComponentMetadata, ComponentMotionValue, CompositeStyleDefinition, CompositeStyleObject, CompoundPropsEntry, CssMotionDefinition, FontAssetMember, GlobalStylesDef, JsMotionDefinition, LayerInput, LiteralFor, ModeDefinition, ModeOptionDefinition, ModifierDefinition, MotionDefinitionInput, MotionKeyframes, MotionStateKeyframe, MotionTransition, OpacityPairSpec, PreviewDefinition, PropBinding, RootTag, SerializedAssetGroup, SerializedComponent, SerializedComponentGroup, SerializedConfig, SerializedFontAssetGroup, SerializedIconAssetGroup, SerializedTokenGroup, SlotMotion, StylePropDefinition, StylePropMetadata, StylePropProperty, TokenDefinition, TokenGroupDefinition, TokenModifierKey, TokenModifierValue, TokenType, TokenValue, ValuesEntry };
|