@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,235 +0,0 @@
|
|
|
1
|
-
import { safeTokenName } from "../../utils/dist/string-utils/cssVar.js";
|
|
2
|
-
import "../../utils/dist/index.js";
|
|
3
|
-
import { isTokenAcceptedByProperty } from "./propertyAcceptedTypes.js";
|
|
4
|
-
import { resolveTokenRef } from "./refs.js";
|
|
5
|
-
import { sniffTokenTypeFromValue } from "./resolveTokenTypes.js";
|
|
6
|
-
//#region ../config/dist/resolveStyleProp.js
|
|
7
|
-
/**
|
|
8
|
-
* Resolve a {@link StyleProp} authored via `defineStyleProp` against the
|
|
9
|
-
* active UDS config, producing a flat list of accepted tokens, literal
|
|
10
|
-
* keywords, and the arbitrary spec — the data that downstream codegen
|
|
11
|
-
* consumes to populate `Custom*` interfaces and emit utility CSS.
|
|
12
|
-
*
|
|
13
|
-
* Filtering invariant: a token is exposed in the resolved pool only when
|
|
14
|
-
* its detected CSS value type is accepted by the prop's `cssProperty`,
|
|
15
|
-
* per {@link PROPERTY_ACCEPTED_TYPES}. Properties absent from that table
|
|
16
|
-
* accept every token.
|
|
17
|
-
*
|
|
18
|
-
* The resolver is pure — given the same `(StyleProp, UdsConfigData)` input
|
|
19
|
-
* it returns the same output. Group lookups are by `namespace` (with a
|
|
20
|
-
* fallback to `cssPrefix`) on the resolved config's `atomic` array.
|
|
21
|
-
*/
|
|
22
|
-
/**
|
|
23
|
-
* Map the legacy 8-entry `TokenType` enum to a {@link CssValueTypeName}.
|
|
24
|
-
* The `'dimension'` case is ambiguous (length vs. percentage); callers
|
|
25
|
-
* disambiguate by sniffing the value string.
|
|
26
|
-
*/
|
|
27
|
-
function tokenTypeToValueType(t) {
|
|
28
|
-
switch (t) {
|
|
29
|
-
case "color": return "color";
|
|
30
|
-
case "dimension": return "length-percentage";
|
|
31
|
-
case "number": return "number";
|
|
32
|
-
case "fontFamily": return "font-family";
|
|
33
|
-
case "fontWeight": return "font-weight";
|
|
34
|
-
case "duration": return "time";
|
|
35
|
-
case "strokeStyle": return "string";
|
|
36
|
-
case "string": return "string";
|
|
37
|
-
default: return;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* A value looks like a CSS shadow when it combines at least one length
|
|
42
|
-
* (offset/blur/spread) with a color reference. Catches both single-shadow
|
|
43
|
-
* (`'0 1px 2px rgba(...)'`) and multi-shadow (`'..., ...'`) forms, plus
|
|
44
|
-
* inset shadows. Used to refine `'string'`-typed tokens to the more precise
|
|
45
|
-
* `'shadow'` value type so they pass the runtime filter on `box-shadow` /
|
|
46
|
-
* `text-shadow` props.
|
|
47
|
-
*/
|
|
48
|
-
const SHADOW_LENGTH_RE = /(?:^|[\s,])-?\d+(?:\.\d+)?(?:px|rem|em|ch|ex)/i;
|
|
49
|
-
const SHADOW_COLOR_RE = /(?:rgba?|hsla?|color|oklch|oklab|lch|lab|hwb)\(|#[0-9a-fA-F]{3,8}\b/;
|
|
50
|
-
function looksLikeShadow(value) {
|
|
51
|
-
const trimmed = value.trim();
|
|
52
|
-
return SHADOW_LENGTH_RE.test(trimmed) && SHADOW_COLOR_RE.test(trimmed);
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Detect a token's CSS value type. Resolution order:
|
|
56
|
-
* 1. Per-token `type` override.
|
|
57
|
-
* 2. Value sniff via {@link sniffTokenTypeFromValue}.
|
|
58
|
-
* 3. Group-level `type`.
|
|
59
|
-
*
|
|
60
|
-
* When the resolved type is `'length-percentage'` and the raw value ends in
|
|
61
|
-
* `%`, narrow to `'percentage'`; otherwise narrow to `'length'`. When the
|
|
62
|
-
* resolved type is `'string'`, narrow shadow-like values to `'shadow'` and
|
|
63
|
-
* ratio-shaped values to `'ratio'`.
|
|
64
|
-
*
|
|
65
|
-
* Exported so Studio (and any other runtime consumer) can resolve a cell's
|
|
66
|
-
* effective `CssValueTypeName` with the same sniff-before-group policy used
|
|
67
|
-
* for `RegisteredTokenGroupMeta`. UDS-1600 tracks removing the remaining
|
|
68
|
-
* mirrored codegen resolver once the token type API settles.
|
|
69
|
-
*
|
|
70
|
-
* The input shapes ({@link DetectTokenValueTypeInput} /
|
|
71
|
-
* {@link DetectTokenValueTypeGroup}) are intentionally minimal: the resolver
|
|
72
|
-
* reads only `token.value`, `token.type`, and `group.type` — never walks
|
|
73
|
-
* `group.tokens`, never checks that `token` is inside `group`. Typing them
|
|
74
|
-
* as full `AtomicToken` would force trimmed-shape consumers (Studio's
|
|
75
|
-
* `TokenEntry`) to either round-trip back to the source group or `as`-assert
|
|
76
|
-
* past the type system.
|
|
77
|
-
*/
|
|
78
|
-
function detectTokenValueType(token, group) {
|
|
79
|
-
let resolved;
|
|
80
|
-
if (token.type) resolved = tokenTypeToValueType(token.type);
|
|
81
|
-
else {
|
|
82
|
-
const sniffed = sniffTokenTypeFromValue(token.value);
|
|
83
|
-
resolved = sniffed ? tokenTypeToValueType(sniffed) : group.type ? tokenTypeToValueType(group.type) : void 0;
|
|
84
|
-
}
|
|
85
|
-
if (resolved === "length-percentage") {
|
|
86
|
-
const trimmed = token.value.trim();
|
|
87
|
-
if (trimmed.endsWith("%")) return "percentage";
|
|
88
|
-
if (/(deg|rad|grad|turn)$/.test(trimmed)) return "angle";
|
|
89
|
-
if (/(ms|s)$/.test(trimmed)) return "time";
|
|
90
|
-
return "length";
|
|
91
|
-
}
|
|
92
|
-
if (resolved === "string") {
|
|
93
|
-
if (looksLikeShadow(token.value)) return "shadow";
|
|
94
|
-
if (/^\d+(?:\.\d+)?\s*\/\s*\d+(?:\.\d+)?$/.test(token.value.trim())) return "ratio";
|
|
95
|
-
}
|
|
96
|
-
return resolved;
|
|
97
|
-
}
|
|
98
|
-
const REF_RE = /^\{([^.{}]+)(?:\.([^.{}]+))?\}$/;
|
|
99
|
-
/**
|
|
100
|
-
* Parse a string ref like `'{palette}'` or `'{spacing.4}'`. Returns
|
|
101
|
-
* `undefined` for any string that isn't a brace ref (so the caller can
|
|
102
|
-
* treat it as a literal keyword).
|
|
103
|
-
*/
|
|
104
|
-
function parseGroupRef(raw) {
|
|
105
|
-
const m = REF_RE.exec(raw);
|
|
106
|
-
if (!m) return void 0;
|
|
107
|
-
const [, group, key] = m;
|
|
108
|
-
if (!group) return void 0;
|
|
109
|
-
return key !== void 0 ? {
|
|
110
|
-
group,
|
|
111
|
-
key
|
|
112
|
-
} : { group };
|
|
113
|
-
}
|
|
114
|
-
function findGroup(atomic, name) {
|
|
115
|
-
return atomic.find((g) => g.namespace === name || g.cssPrefix === name);
|
|
116
|
-
}
|
|
117
|
-
function isNamespacedRef(entry) {
|
|
118
|
-
return typeof entry === "object" && entry !== null && "ref" in entry && "namespace" in entry;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Build `--{configPrefix}-{varPrefix}-{safeName}` (or omit the configPrefix
|
|
122
|
-
* when empty). Mirrors `buildTokenVarName` in `@uds/codegen/css/prepareCss`.
|
|
123
|
-
*/
|
|
124
|
-
function buildCssVar(configPrefix, varPrefix, safeName) {
|
|
125
|
-
return configPrefix ? `--${configPrefix}-${varPrefix}-${safeName}` : `--${varPrefix}-${safeName}`;
|
|
126
|
-
}
|
|
127
|
-
function resolveGroupTokens(group, cssProperty, configPrefix, namespace, skipPropertyFilter = false) {
|
|
128
|
-
const groupName = group.namespace ?? group.cssPrefix ?? "";
|
|
129
|
-
const varPrefix = group.cssPrefix ?? group.namespace ?? "";
|
|
130
|
-
const out = [];
|
|
131
|
-
for (const token of group.tokens) {
|
|
132
|
-
const valueType = detectTokenValueType(token, group);
|
|
133
|
-
if (!skipPropertyFilter && !isTokenAcceptedByProperty(cssProperty, valueType, token.value)) continue;
|
|
134
|
-
const safeName = safeTokenName(token.name);
|
|
135
|
-
out.push({
|
|
136
|
-
name: token.name,
|
|
137
|
-
value: token.value,
|
|
138
|
-
valueType,
|
|
139
|
-
group: groupName,
|
|
140
|
-
namespace,
|
|
141
|
-
qualifiedName: namespace !== void 0 ? `${namespace}.${token.name}` : token.name,
|
|
142
|
-
safeName,
|
|
143
|
-
cssVar: buildCssVar(configPrefix, varPrefix, safeName),
|
|
144
|
-
modifiers: token.modifiers
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
return out;
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Resolve a style prop against the given resolved UDS config. Unknown group
|
|
151
|
-
* refs are silently dropped from `tokens` (callers can detect this by
|
|
152
|
-
* comparing input refs vs. resolved tokens if they need to surface a
|
|
153
|
-
* config-build warning).
|
|
154
|
-
*
|
|
155
|
-
* @param propName - The JSX prop name (the map key from `registerStyleProps`).
|
|
156
|
-
*/
|
|
157
|
-
function resolveStyleProp(propName, styleProp, config) {
|
|
158
|
-
const { cssProperty, classPrefix, values, arbitrary, metadata } = styleProp;
|
|
159
|
-
const pairedWith = styleProp._pairedWith;
|
|
160
|
-
const separator = styleProp._separator;
|
|
161
|
-
const primaryCssProperty = Array.isArray(cssProperty) ? cssProperty[0] : cssProperty;
|
|
162
|
-
const configPrefix = config.prefix;
|
|
163
|
-
const tokens = [];
|
|
164
|
-
const literals = [];
|
|
165
|
-
const literalAliases = {};
|
|
166
|
-
for (const entry of values ?? []) {
|
|
167
|
-
if (typeof entry === "number") {
|
|
168
|
-
if (!literals.includes(entry)) literals.push(entry);
|
|
169
|
-
literalAliases[String(entry)] = String(entry);
|
|
170
|
-
continue;
|
|
171
|
-
}
|
|
172
|
-
if (typeof entry === "string") {
|
|
173
|
-
const parsed = parseGroupRef(entry);
|
|
174
|
-
if (!parsed) {
|
|
175
|
-
literals.push(entry);
|
|
176
|
-
continue;
|
|
177
|
-
}
|
|
178
|
-
const group = findGroup(config.atomic, parsed.group);
|
|
179
|
-
if (!group) continue;
|
|
180
|
-
if (parsed.key !== void 0) {
|
|
181
|
-
const token = group.tokens.find((t) => t.name === parsed.key);
|
|
182
|
-
if (!token) continue;
|
|
183
|
-
const valueType = detectTokenValueType(token, group);
|
|
184
|
-
if (!pairedWith && !isTokenAcceptedByProperty(primaryCssProperty, valueType, token.value)) continue;
|
|
185
|
-
const safeName = safeTokenName(token.name);
|
|
186
|
-
const varPrefix = group.cssPrefix ?? group.namespace ?? parsed.group;
|
|
187
|
-
tokens.push({
|
|
188
|
-
name: token.name,
|
|
189
|
-
value: token.value,
|
|
190
|
-
valueType,
|
|
191
|
-
group: group.namespace ?? group.cssPrefix ?? parsed.group,
|
|
192
|
-
qualifiedName: token.name,
|
|
193
|
-
safeName,
|
|
194
|
-
cssVar: buildCssVar(configPrefix, varPrefix, safeName),
|
|
195
|
-
modifiers: token.modifiers
|
|
196
|
-
});
|
|
197
|
-
} else tokens.push(...resolveGroupTokens(group, primaryCssProperty, configPrefix, void 0, pairedWith !== void 0));
|
|
198
|
-
continue;
|
|
199
|
-
}
|
|
200
|
-
if (isNamespacedRef(entry)) {
|
|
201
|
-
const parsed = parseGroupRef(entry.ref);
|
|
202
|
-
if (!parsed || parsed.key !== void 0) continue;
|
|
203
|
-
const group = findGroup(config.atomic, parsed.group);
|
|
204
|
-
if (!group) continue;
|
|
205
|
-
tokens.push(...resolveGroupTokens(group, primaryCssProperty, configPrefix, entry.namespace, pairedWith !== void 0));
|
|
206
|
-
continue;
|
|
207
|
-
}
|
|
208
|
-
if (typeof entry === "object" && entry !== null && "alias" in entry && "value" in entry) {
|
|
209
|
-
const aliasEntry = entry;
|
|
210
|
-
const aliasKey = aliasEntry.alias;
|
|
211
|
-
const aliasMapKey = typeof aliasKey === "string" ? aliasKey : String(aliasKey);
|
|
212
|
-
let resolvedValue;
|
|
213
|
-
if (typeof aliasEntry.value === "string") resolvedValue = resolveTokenRef(aliasEntry.value, configPrefix);
|
|
214
|
-
else resolvedValue = aliasEntry.value;
|
|
215
|
-
if (!literals.includes(aliasKey)) literals.push(aliasKey);
|
|
216
|
-
literalAliases[aliasMapKey] = resolvedValue;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
return {
|
|
220
|
-
propName,
|
|
221
|
-
cssProperty,
|
|
222
|
-
classPrefix,
|
|
223
|
-
...pairedWith !== void 0 ? {
|
|
224
|
-
pairedWith,
|
|
225
|
-
separator
|
|
226
|
-
} : {},
|
|
227
|
-
tokens,
|
|
228
|
-
literals,
|
|
229
|
-
...Object.keys(literalAliases).length > 0 ? { literalAliases } : {},
|
|
230
|
-
arbitrary,
|
|
231
|
-
metadata: metadata ?? {}
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
//#endregion
|
|
235
|
-
export { detectTokenValueType, resolveStyleProp };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
//#region ../config/dist/resolveTokenTypes.js
|
|
2
|
-
/**
|
|
3
|
-
* Default `TokenType` for each property group. Used to infer a var
|
|
4
|
-
* namespace's type when no explicit `$type` is declared — e.g. a namespace
|
|
5
|
-
* scoped to `['textColor', 'background']` is clearly a `color` namespace.
|
|
6
|
-
*
|
|
7
|
-
* Property groups that hold composite values (`shadow`, `textShadow`) or
|
|
8
|
-
* mixed-kind values (`transform` — mixes rotate/scale/translate/skew) are
|
|
9
|
-
* intentionally omitted; they fall through to `undefined` until the
|
|
10
|
-
* Composite Tokens RFC lands.
|
|
11
|
-
*/
|
|
12
|
-
const propertyGroupDefaultType = {
|
|
13
|
-
textColor: "color",
|
|
14
|
-
background: "color",
|
|
15
|
-
borderColor: "color",
|
|
16
|
-
outlineColor: "color",
|
|
17
|
-
ringColor: "color",
|
|
18
|
-
divideColor: "color",
|
|
19
|
-
shadowColor: "color",
|
|
20
|
-
svgFill: "color",
|
|
21
|
-
svgStroke: "color",
|
|
22
|
-
caretColor: "color",
|
|
23
|
-
textDecorationColor: "color",
|
|
24
|
-
opacity: "number",
|
|
25
|
-
colorOpacity: "number",
|
|
26
|
-
bgOpacity: "number",
|
|
27
|
-
borderColorOpacity: "number",
|
|
28
|
-
divideColorOpacity: "number",
|
|
29
|
-
outlineColorOpacity: "number",
|
|
30
|
-
ringColorOpacity: "number",
|
|
31
|
-
textDecorationColorOpacity: "number",
|
|
32
|
-
svgFillOpacity: "number",
|
|
33
|
-
svgStrokeOpacity: "number",
|
|
34
|
-
shadowColorOpacity: "number",
|
|
35
|
-
caretColorOpacity: "number",
|
|
36
|
-
fontFamily: "fontFamily",
|
|
37
|
-
fontSize: "dimension",
|
|
38
|
-
fontWeight: "fontWeight",
|
|
39
|
-
lineHeight: "number",
|
|
40
|
-
letterSpacing: "dimension",
|
|
41
|
-
blur: "dimension",
|
|
42
|
-
backdropBlur: "dimension",
|
|
43
|
-
animation: "duration",
|
|
44
|
-
zIndex: "number",
|
|
45
|
-
borderWidth: "dimension",
|
|
46
|
-
borderRadius: "dimension",
|
|
47
|
-
outlineWidth: "dimension",
|
|
48
|
-
divideWidth: "dimension",
|
|
49
|
-
ringWidth: "dimension",
|
|
50
|
-
padding: "dimension",
|
|
51
|
-
margin: "dimension",
|
|
52
|
-
offset: "dimension",
|
|
53
|
-
gap: "dimension",
|
|
54
|
-
indent: "dimension",
|
|
55
|
-
scrollSnapGap: "dimension",
|
|
56
|
-
scrollSnapSpacing: "dimension",
|
|
57
|
-
tableBorderSpacing: "dimension",
|
|
58
|
-
width: "dimension",
|
|
59
|
-
height: "dimension",
|
|
60
|
-
aspectRatio: "number",
|
|
61
|
-
positionPlacement: "dimension",
|
|
62
|
-
flex: "number",
|
|
63
|
-
strokeWidth: "dimension"
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* Resolve a token's `TokenType` in priority order:
|
|
67
|
-
*
|
|
68
|
-
* 1. Explicit `$type` (from the token or its group)
|
|
69
|
-
* 2. Derived from `defineScopes` — when all scopes agree on a default type
|
|
70
|
-
* 3. Value sniff (last resort) — regex-matches obvious value shapes
|
|
71
|
-
*
|
|
72
|
-
* Returns `undefined` when none of the strategies produce a confident answer.
|
|
73
|
-
* Consumers (Studio, tooling) should treat `undefined` as "render a plain
|
|
74
|
-
* string input" — never guess wrong.
|
|
75
|
-
*/
|
|
76
|
-
function resolveTokenType(input) {
|
|
77
|
-
if (input.explicit) return input.explicit;
|
|
78
|
-
if (input.scopes && input.scopes.length > 0) {
|
|
79
|
-
const types = /* @__PURE__ */ new Set();
|
|
80
|
-
for (const scope of input.scopes) {
|
|
81
|
-
const t = propertyGroupDefaultType[scope];
|
|
82
|
-
if (t) types.add(t);
|
|
83
|
-
}
|
|
84
|
-
if (types.size === 1) {
|
|
85
|
-
const [only] = types;
|
|
86
|
-
return only;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
if (typeof input.value === "string") {
|
|
90
|
-
const sniffed = sniffTokenTypeFromValue(input.value);
|
|
91
|
-
if (sniffed) return sniffed;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Heuristic last-resort classifier for a raw CSS value. Returns `undefined`
|
|
96
|
-
* when no confident match is possible (e.g. `var(...)` references).
|
|
97
|
-
*
|
|
98
|
-
* Exported for testing; prefer `resolveTokenType` in most call sites.
|
|
99
|
-
*/
|
|
100
|
-
function sniffTokenTypeFromValue(value) {
|
|
101
|
-
const v = value.trim();
|
|
102
|
-
if (v.length === 0) return void 0;
|
|
103
|
-
if (CSS_WIDE_KEYWORDS.has(v)) return "string";
|
|
104
|
-
if (v.startsWith("var(")) return void 0;
|
|
105
|
-
if (COLOR_FUNCTION_RE.test(v)) return "color";
|
|
106
|
-
if (HEX_COLOR_RE.test(v)) return "color";
|
|
107
|
-
if (NAMED_COLOR_KEYWORDS.has(v.toLowerCase())) return "color";
|
|
108
|
-
if (DURATION_RE.test(v)) return "duration";
|
|
109
|
-
if (DIMENSION_RE.test(v)) return "dimension";
|
|
110
|
-
if (PURE_NUMBER_RE.test(v)) return "number";
|
|
111
|
-
}
|
|
112
|
-
const CSS_WIDE_KEYWORDS = new Set([
|
|
113
|
-
"inherit",
|
|
114
|
-
"initial",
|
|
115
|
-
"unset",
|
|
116
|
-
"revert",
|
|
117
|
-
"revert-layer",
|
|
118
|
-
"auto",
|
|
119
|
-
"none",
|
|
120
|
-
"currentColor",
|
|
121
|
-
"currentcolor",
|
|
122
|
-
"transparent"
|
|
123
|
-
]);
|
|
124
|
-
const HEX_COLOR_RE = /^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;
|
|
125
|
-
const COLOR_FUNCTION_RE = /^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix|light-dark)\s*\(/i;
|
|
126
|
-
const NUMBER_RE_SRC = "(?:\\d+(?:\\.\\d+)?|\\.\\d+)";
|
|
127
|
-
const DIMENSION_RE = new RegExp(`^-?${NUMBER_RE_SRC}(?:px|rem|em|%|vh|vw|vmin|vmax|vi|vb|svh|svw|lvh|lvw|dvh|dvw|ch|ex|cap|ic|lh|rlh|pt|pc|in|cm|mm|q|fr|deg|turn|rad|grad)$`, "i");
|
|
128
|
-
const DURATION_RE = new RegExp(`^-?${NUMBER_RE_SRC}(?:ms|s)$`, "i");
|
|
129
|
-
const PURE_NUMBER_RE = new RegExp(`^-?${NUMBER_RE_SRC}$`);
|
|
130
|
-
const NAMED_COLOR_KEYWORDS = new Set([
|
|
131
|
-
"black",
|
|
132
|
-
"white",
|
|
133
|
-
"red",
|
|
134
|
-
"green",
|
|
135
|
-
"blue",
|
|
136
|
-
"yellow",
|
|
137
|
-
"orange",
|
|
138
|
-
"purple",
|
|
139
|
-
"pink",
|
|
140
|
-
"gray",
|
|
141
|
-
"grey",
|
|
142
|
-
"brown",
|
|
143
|
-
"cyan",
|
|
144
|
-
"magenta",
|
|
145
|
-
"silver",
|
|
146
|
-
"gold"
|
|
147
|
-
]);
|
|
148
|
-
//#endregion
|
|
149
|
-
export { propertyGroupDefaultType, resolveTokenType, sniffTokenTypeFromValue };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Replace the active style-prop registry. Called by `resolveConfig`
|
|
3
|
-
* with the full `config.styleProps` map (keyed by JSX prop name).
|
|
4
|
-
*/
|
|
5
|
-
function setRegisteredStyleProps(entries) {
|
|
6
|
-
new Map(Object.entries(entries));
|
|
7
|
-
}
|
|
8
|
-
//#endregion
|
|
9
|
-
export { setRegisteredStyleProps };
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { VarsConfig } from "./types.js";
|
|
2
|
-
import { AtomicToken, ExampleDef, ModeGroup, ModifierDef, MotionPresetsDef, UdsConfig } from "./createConfig.js";
|
|
3
|
-
import { CompositeStylesConfig } from "@uds/types";
|
|
4
|
-
|
|
5
|
-
//#region ../config/dist/serialize.d.ts
|
|
6
|
-
//#region src/serialize.d.ts
|
|
7
|
-
type ModifierNameShape = `_${string}`;
|
|
8
|
-
type TokenRef = {
|
|
9
|
-
$ref: string;
|
|
10
|
-
};
|
|
11
|
-
interface SerializedConfig {
|
|
12
|
-
modes: ModeGroup[];
|
|
13
|
-
modifiers?: ModifierDef[];
|
|
14
|
-
/**
|
|
15
|
-
* Verbatim `defineVars` input. Authoritative source for CSS variable
|
|
16
|
-
* declarations downstream. `atomic` carries derived (property × token)
|
|
17
|
-
* data for utility-class generation; `vars` carries the original
|
|
18
|
-
* namespace-keyed input. New code should rely on `vars`; `atomic` is
|
|
19
|
-
* still emitted for legacy consumers.
|
|
20
|
-
*/
|
|
21
|
-
vars?: VarsConfig;
|
|
22
|
-
atomic: AtomicToken<ModifierNameShape>[];
|
|
23
|
-
compositeStyles?: CompositeStylesConfig;
|
|
24
|
-
/**
|
|
25
|
-
* Legacy field name. Kept on the wire format so older serialized configs
|
|
26
|
-
* (and `draft_base_configs.baseConfig` blobs) continue to deserialize
|
|
27
|
-
* until they're rewritten. New code should populate `compositeStyles`.
|
|
28
|
-
*/
|
|
29
|
-
macros?: Record<string, Record<string, Record<string, unknown>>>;
|
|
30
|
-
motion?: MotionPresetsDef;
|
|
31
|
-
components: SerializedComponentsDef;
|
|
32
|
-
globalStyles?: Record<string, Record<string, SerializedValue>>;
|
|
33
|
-
examples?: Record<string, ExampleDef>;
|
|
34
|
-
preflight: boolean;
|
|
35
|
-
prefix: string;
|
|
36
|
-
presetTokenNames?: Record<string, string[]>;
|
|
37
|
-
}
|
|
38
|
-
type SerializedValue = string | TokenRef | {
|
|
39
|
-
[key: string]: SerializedValue;
|
|
40
|
-
};
|
|
41
|
-
type SerializedSlotStyles = Record<string, SerializedValue>;
|
|
42
|
-
type SerializedComponentConfig = {
|
|
43
|
-
base: Record<string, SerializedSlotStyles>;
|
|
44
|
-
variants?: Record<string, Record<string, Record<string, SerializedSlotStyles>>>;
|
|
45
|
-
compoundVariants?: Array<{
|
|
46
|
-
conditions: Record<string, string>;
|
|
47
|
-
styles: Record<string, SerializedSlotStyles>;
|
|
48
|
-
}>;
|
|
49
|
-
defaultVariants?: Record<string, string>;
|
|
50
|
-
};
|
|
51
|
-
type SerializedComponentsDef = Record<string, SerializedComponentConfig>;
|
|
52
|
-
/**
|
|
53
|
-
* Build a reverse map from `var(--prefix-xxx-yyy)` strings back to
|
|
54
|
-
* `propName.tokenName` reference paths.
|
|
55
|
-
*/
|
|
56
|
-
declare function buildReverseMap(atomic: AtomicToken<ModifierNameShape>[], configPrefix: string): Map<string, string>;
|
|
57
|
-
/**
|
|
58
|
-
* Serialize a UdsConfig for database storage.
|
|
59
|
-
*
|
|
60
|
-
* Walks component slot styles and replaces known `var()` strings with
|
|
61
|
-
* `{ $ref: "propName.tokenName" }` markers so the authoring intent survives
|
|
62
|
-
* a round-trip through JSON.
|
|
63
|
-
*/
|
|
64
|
-
declare function serializeConfig(config: UdsConfig): SerializedConfig;
|
|
65
|
-
/**
|
|
66
|
-
* Deserialize stored config data back into a UdsConfig builder.
|
|
67
|
-
*
|
|
68
|
-
* Resolves `$ref` markers back to `var()` strings using the atomic token
|
|
69
|
-
* definitions, then reconstructs the builder chain.
|
|
70
|
-
*/
|
|
71
|
-
declare function deserializeConfig(data: SerializedConfig): UdsConfig; //#endregion
|
|
72
|
-
//#endregion
|
|
73
|
-
export { SerializedConfig, TokenRef, buildReverseMap, deserializeConfig, serializeConfig };
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import { safeTokenName } from "../../utils/dist/string-utils/cssVar.js";
|
|
2
|
-
import "../../utils/dist/index.js";
|
|
3
|
-
import { getConfigurablePropMapping } from "../../core/dist/configurable-prop-helpers.js";
|
|
4
|
-
import "../../core/dist/index.js";
|
|
5
|
-
import { buildTokenReference, createConfigBuilder, resolveConfig } from "./createConfig.js";
|
|
6
|
-
//#region ../config/dist/serialize.js
|
|
7
|
-
/**
|
|
8
|
-
* Config serialization for lossless round-tripping through a database.
|
|
9
|
-
*
|
|
10
|
-
* serializeConfig: UdsConfig → SerializedConfig (var() → $ref markers)
|
|
11
|
-
* deserializeConfig: SerializedConfig → UdsConfig ($ref markers → var())
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* Migrate the legacy serialized `macros` field into the new
|
|
15
|
-
* `compositeStyles` shape. Each old key (`elevation`) becomes a
|
|
16
|
-
* `{ label, styles }` def. Returns an empty object when there's
|
|
17
|
-
* nothing to migrate so the field is always populated.
|
|
18
|
-
*/
|
|
19
|
-
function upgradeLegacyMacros(legacy) {
|
|
20
|
-
if (!legacy) return {};
|
|
21
|
-
const out = {};
|
|
22
|
-
for (const [name, variants] of Object.entries(legacy)) out[name] = {
|
|
23
|
-
label: name,
|
|
24
|
-
styles: variants
|
|
25
|
-
};
|
|
26
|
-
return out;
|
|
27
|
-
}
|
|
28
|
-
function isTokenRef(val) {
|
|
29
|
-
return typeof val === "object" && val !== null && "$ref" in val && typeof val.$ref === "string";
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Build a reverse map from `var(--prefix-xxx-yyy)` strings back to
|
|
33
|
-
* `propName.tokenName` reference paths.
|
|
34
|
-
*/
|
|
35
|
-
function buildReverseMap(atomic, configPrefix) {
|
|
36
|
-
const map = /* @__PURE__ */ new Map();
|
|
37
|
-
for (const token of atomic) for (const prop of token.properties) {
|
|
38
|
-
const varPrefix = token.cssPrefix ?? getConfigurablePropMapping(prop)?.defaultVarPrefix;
|
|
39
|
-
if (!varPrefix) continue;
|
|
40
|
-
for (const t of token.tokens) {
|
|
41
|
-
const safeName = safeTokenName(t.name);
|
|
42
|
-
const varRef = `var(${configPrefix ? `--${configPrefix}-${varPrefix}-${safeName}` : `--${varPrefix}-${safeName}`})`;
|
|
43
|
-
map.set(varRef, `${prop}.${t.name}`);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return map;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Walk an object, transforming every string leaf with `fn`.
|
|
50
|
-
* Nested objects (pseudo-state blocks like `_hover: { ... }`) are recursed.
|
|
51
|
-
*/
|
|
52
|
-
function walkStrings(obj, fn) {
|
|
53
|
-
const result = {};
|
|
54
|
-
for (const [key, val] of Object.entries(obj)) if (typeof val === "string") result[key] = fn(val);
|
|
55
|
-
else if (typeof val === "object" && val !== null && !Array.isArray(val)) result[key] = walkStrings(val, fn);
|
|
56
|
-
else result[key] = val;
|
|
57
|
-
return result;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Walk a serialized value, resolving `$ref` markers back to strings.
|
|
61
|
-
* Regular string values are passed through unchanged.
|
|
62
|
-
*/
|
|
63
|
-
function resolveRefs(obj, tokenRef) {
|
|
64
|
-
const result = {};
|
|
65
|
-
for (const [key, val] of Object.entries(obj)) if (isTokenRef(val)) {
|
|
66
|
-
const dotIdx = val.$ref.indexOf(".");
|
|
67
|
-
const prop = val.$ref.slice(0, dotIdx);
|
|
68
|
-
const name = val.$ref.slice(dotIdx + 1);
|
|
69
|
-
result[key] = tokenRef[prop]?.[name] ?? `$ref(${val.$ref})`;
|
|
70
|
-
} else if (typeof val === "object" && val !== null && !Array.isArray(val)) result[key] = resolveRefs(val, tokenRef);
|
|
71
|
-
else result[key] = val;
|
|
72
|
-
return result;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Serialize a UdsConfig for database storage.
|
|
76
|
-
*
|
|
77
|
-
* Walks component slot styles and replaces known `var()` strings with
|
|
78
|
-
* `{ $ref: "propName.tokenName" }` markers so the authoring intent survives
|
|
79
|
-
* a round-trip through JSON.
|
|
80
|
-
*/
|
|
81
|
-
function serializeConfig(config) {
|
|
82
|
-
const data = resolveConfig(config);
|
|
83
|
-
const reverseMap = buildReverseMap(data.atomic, data.prefix);
|
|
84
|
-
const replaceVars = (val) => {
|
|
85
|
-
const ref = reverseMap.get(val);
|
|
86
|
-
return ref ? { $ref: ref } : val;
|
|
87
|
-
};
|
|
88
|
-
const components = {};
|
|
89
|
-
for (const [compName, compConfig] of Object.entries(data.components)) {
|
|
90
|
-
const serialized = { base: {} };
|
|
91
|
-
for (const [slot, styles] of Object.entries(compConfig.base ?? {})) serialized.base[slot] = walkStrings(styles, replaceVars);
|
|
92
|
-
if (compConfig.variants) {
|
|
93
|
-
serialized.variants = {};
|
|
94
|
-
for (const [axis, values] of Object.entries(compConfig.variants)) {
|
|
95
|
-
serialized.variants[axis] = {};
|
|
96
|
-
for (const [value, slotOverrides] of Object.entries(values)) {
|
|
97
|
-
serialized.variants[axis][value] = {};
|
|
98
|
-
for (const [slot, styles] of Object.entries(slotOverrides)) serialized.variants[axis][value][slot] = walkStrings(styles, replaceVars);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
if (compConfig.defaultVariants) serialized.defaultVariants = compConfig.defaultVariants;
|
|
103
|
-
components[compName] = serialized;
|
|
104
|
-
}
|
|
105
|
-
const globalStyles = {};
|
|
106
|
-
if (data.globalStyles) for (const [selector, styles] of Object.entries(data.globalStyles)) globalStyles[selector] = walkStrings(styles, replaceVars);
|
|
107
|
-
return {
|
|
108
|
-
modes: data.modes,
|
|
109
|
-
modifiers: data.modifiers.length > 0 ? data.modifiers : void 0,
|
|
110
|
-
vars: data.vars && Object.keys(data.vars).length > 0 ? data.vars : void 0,
|
|
111
|
-
atomic: data.atomic,
|
|
112
|
-
compositeStyles: Object.keys(data.compositeStyles).length > 0 ? data.compositeStyles : void 0,
|
|
113
|
-
motion: Object.keys(data.motion).length > 0 ? data.motion : void 0,
|
|
114
|
-
components,
|
|
115
|
-
globalStyles: Object.keys(globalStyles).length > 0 ? globalStyles : void 0,
|
|
116
|
-
examples: data.examples && Object.keys(data.examples).length > 0 ? data.examples : void 0,
|
|
117
|
-
preflight: data.preflight,
|
|
118
|
-
prefix: data.prefix,
|
|
119
|
-
presetTokenNames: data.presetTokenNames && Object.keys(data.presetTokenNames).length > 0 ? data.presetTokenNames : void 0
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Deserialize stored config data back into a UdsConfig builder.
|
|
124
|
-
*
|
|
125
|
-
* Resolves `$ref` markers back to `var()` strings using the atomic token
|
|
126
|
-
* definitions, then reconstructs the builder chain.
|
|
127
|
-
*/
|
|
128
|
-
function deserializeConfig(data) {
|
|
129
|
-
const tokenRef = buildTokenReference(data.atomic, data.prefix);
|
|
130
|
-
const components = {};
|
|
131
|
-
for (const [compName, compConfig] of Object.entries(data.components)) {
|
|
132
|
-
const resolved = { base: {} };
|
|
133
|
-
const base = {};
|
|
134
|
-
for (const [slot, styles] of Object.entries(compConfig.base ?? {})) base[slot] = resolveRefs(styles, tokenRef);
|
|
135
|
-
resolved.base = base;
|
|
136
|
-
if (compConfig.variants) {
|
|
137
|
-
const variants = {};
|
|
138
|
-
for (const [axis, values] of Object.entries(compConfig.variants)) {
|
|
139
|
-
variants[axis] = {};
|
|
140
|
-
for (const [value, slotOverrides] of Object.entries(values)) {
|
|
141
|
-
variants[axis][value] = {};
|
|
142
|
-
for (const [slot, styles] of Object.entries(slotOverrides)) variants[axis][value][slot] = resolveRefs(styles, tokenRef);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
resolved.variants = variants;
|
|
146
|
-
}
|
|
147
|
-
if (compConfig.defaultVariants) resolved.defaultVariants = compConfig.defaultVariants;
|
|
148
|
-
components[compName] = resolved;
|
|
149
|
-
}
|
|
150
|
-
let config = createConfigBuilder({
|
|
151
|
-
modes: data.modes,
|
|
152
|
-
modifiers: data.modifiers ?? [],
|
|
153
|
-
vars: data.vars,
|
|
154
|
-
atomic: data.atomic,
|
|
155
|
-
compositeStyles: data.compositeStyles ?? upgradeLegacyMacros(data.macros),
|
|
156
|
-
motion: data.motion ?? {},
|
|
157
|
-
components,
|
|
158
|
-
preflight: data.preflight,
|
|
159
|
-
prefix: data.prefix ?? "uds",
|
|
160
|
-
globalStyles: {},
|
|
161
|
-
presetTokenNames: data.presetTokenNames
|
|
162
|
-
});
|
|
163
|
-
if (data.globalStyles && Object.keys(data.globalStyles).length > 0) {
|
|
164
|
-
const globalStyles = {};
|
|
165
|
-
for (const [selector, styles] of Object.entries(data.globalStyles)) globalStyles[selector] = resolveRefs(styles, tokenRef);
|
|
166
|
-
config = config.defineGlobalStyles(globalStyles);
|
|
167
|
-
}
|
|
168
|
-
if (data.examples) for (const [name, examples] of Object.entries(data.examples)) config = config.defineExample(name, examples);
|
|
169
|
-
return config;
|
|
170
|
-
}
|
|
171
|
-
//#endregion
|
|
172
|
-
export { buildReverseMap, deserializeConfig, serializeConfig };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
//#region ../config-utils/dist/componentConfig.d.ts
|
|
2
|
-
//#region src/componentConfig.d.ts
|
|
3
|
-
interface ComponentConfigLike {
|
|
4
|
-
variants?: Record<string, Record<string, unknown>>;
|
|
5
|
-
defaultVariants?: Record<string, unknown> | null | undefined;
|
|
6
|
-
}
|
|
7
|
-
declare function getComponentVariantAxes(componentConfig: ComponentConfigLike | null | undefined): Set<string>;
|
|
8
|
-
declare function getComponentDefaultVariants(defaultVariants: ComponentConfigLike['defaultVariants']): Record<string, string>; //#endregion
|
|
9
|
-
//#endregion
|
|
10
|
-
export { ComponentConfigLike, getComponentDefaultVariants, getComponentVariantAxes };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
//#region ../config-utils/dist/componentConfig.js
|
|
2
|
-
function getComponentVariantAxes(componentConfig) {
|
|
3
|
-
return new Set(Object.keys(componentConfig?.variants ?? {}));
|
|
4
|
-
}
|
|
5
|
-
function getComponentDefaultVariants(defaultVariants) {
|
|
6
|
-
const normalized = {};
|
|
7
|
-
for (const [axis, axisValue] of Object.entries(defaultVariants ?? {})) if (typeof axisValue === "string") normalized[axis] = axisValue;
|
|
8
|
-
return normalized;
|
|
9
|
-
}
|
|
10
|
-
//#endregion
|
|
11
|
-
export { getComponentDefaultVariants, getComponentVariantAxes };
|
package/dist/config-utils.d.ts
DELETED
package/dist/config-utils.js
DELETED