@yahoo/uds-v5-wip 1.60.0 → 1.61.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/codegen/dist/loader/getLoaderArtifacts.js +2 -0
- package/dist/config/dist/Props.d.ts +161 -25
- package/dist/config/dist/bindRender.d.ts +16 -0
- package/dist/config/dist/bindRender.js +310 -0
- package/dist/config/dist/className.d.ts +54 -0
- package/dist/config/dist/className.js +77 -0
- package/dist/config/dist/component-config.d.ts +674 -161
- package/dist/config/dist/component-config.js +163 -0
- package/dist/config/dist/component-refs.d.ts +41 -18
- package/dist/config/dist/createConfig.d.ts +140 -59
- package/dist/config/dist/createConfig.js +95 -217
- package/dist/config/dist/createStyler.d.ts +35 -0
- package/dist/config/dist/createStyler.js +93 -0
- package/dist/config/dist/defineComponent.d.ts +297 -4
- package/dist/config/dist/defineComponent.js +264 -2
- package/dist/config/dist/defineCompositeStyle.d.ts +93 -0
- package/dist/config/dist/defineCompositeStyle.js +18 -0
- package/dist/config/dist/defineMotionConfig.d.ts +152 -0
- package/dist/config/dist/definePreview.d.ts +45 -0
- package/dist/config/dist/definePreview.js +35 -0
- package/dist/config/dist/defineStyleProp.d.ts +199 -3
- package/dist/config/dist/defineStyleProp.js +3 -2
- package/dist/config/dist/index.d.ts +20 -11
- package/dist/config/dist/index.js +8 -4
- package/dist/config/dist/merge-utils.js +51 -0
- package/dist/config/dist/propertyAcceptedTypes.d.ts +19 -0
- package/dist/config/dist/refs.d.ts +85 -0
- package/dist/config/dist/refs.js +92 -47
- package/dist/config/dist/resolveCompoundProps.d.ts +65 -0
- package/dist/config/dist/resolveCompoundProps.js +120 -0
- package/dist/config/dist/resolveStyleProp.d.ts +72 -3
- package/dist/config/dist/resolveStyleProp.js +68 -43
- package/dist/config/dist/runtime-registry.js +30 -2
- package/dist/config/dist/serialize.d.ts +8 -34
- package/dist/config/dist/serialize.js +10 -71
- package/dist/config/dist/sniffTokenType.d.ts +7 -0
- package/dist/config/dist/sniffTokenType.js +67 -0
- package/dist/config/dist/style-prop-runtime.d.ts +75 -1
- package/dist/config/dist/style-prop-runtime.js +390 -0
- package/dist/config/dist/types/css-properties.d.ts +223 -0
- package/dist/config/dist/types/css-values.d.ts +2 -1
- package/dist/config/dist/types.d.ts +14 -3
- package/dist/config.d.ts +21 -1560
- package/dist/config.js +15 -20
- 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 +2 -2
- package/dist/loader/dist/loader/babel-utils.js +1 -29
- package/dist/loader/dist/loader/internal-meta.js +38 -1
- package/dist/loader/dist/loader/lower-new-api-primitive.js +176 -14
- package/dist/loader/dist/loader.d.ts +29 -1
- package/dist/loader/dist/loader.js +71 -309
- package/dist/loader/dist/next.d.ts +2 -1
- package/dist/loader/dist/transform-runner.js +14 -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/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-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/preset-merge.js +0 -192
- package/dist/config/dist/propertyGroups.d.ts +0 -1
- package/dist/config/dist/propertyGroups.js +0 -414
- package/dist/config/dist/resolveTokenTypes.d.ts +0 -1
- package/dist/config/dist/resolveTokenTypes.js +0 -149
- 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/motion.js +0 -10
- 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/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,15 +1,11 @@
|
|
|
1
1
|
import { kebabCase } from "../../utils/dist/string-utils/kebabCase.js";
|
|
2
2
|
import { safeTokenName } from "../../utils/dist/string-utils/cssVar.js";
|
|
3
3
|
import "../../utils/dist/index.js";
|
|
4
|
-
import {
|
|
5
|
-
import "../../core/dist/index.js";
|
|
6
|
-
import { buildMotionReference, resolveComponentMotionAliases, validateComponentVariants } from "./component-resolution.js";
|
|
7
|
-
import { applyPresetToData, deepMerge, mergeAtomic } from "./preset-merge.js";
|
|
8
|
-
import { resolveTokenType, sniffTokenTypeFromValue } from "./resolveTokenTypes.js";
|
|
4
|
+
import { sniffTokenTypeFromValue } from "./sniffTokenType.js";
|
|
9
5
|
import { resolveStyleProp } from "./resolveStyleProp.js";
|
|
10
|
-
import {
|
|
6
|
+
import { mergeAtomic } from "./merge-utils.js";
|
|
7
|
+
import { setRegisteredComposites, setRegisteredStyleProps } from "./runtime-registry.js";
|
|
11
8
|
//#region ../config/dist/createConfig.js
|
|
12
|
-
/** biome-ignore-all lint/suspicious/noExplicitAny: necessary for dynamic builder to work correctly */
|
|
13
9
|
/**
|
|
14
10
|
* Convert the authored object-keyed input into the internal `ModeGroup[]` shape.
|
|
15
11
|
* Derives `_${optionKey}` modifiers when no explicit `modifier` is provided.
|
|
@@ -43,7 +39,7 @@ function convertModesInputToGroups(input) {
|
|
|
43
39
|
function buildTokenReference(atomic, configPrefix) {
|
|
44
40
|
const result = Object.create(null);
|
|
45
41
|
for (const token of atomic) {
|
|
46
|
-
const varPrefix = token.cssPrefix ??
|
|
42
|
+
const varPrefix = token.cssPrefix ?? token.properties[0];
|
|
47
43
|
const tokenEntries = Object.create(null);
|
|
48
44
|
for (const t of token.tokens) {
|
|
49
45
|
const safeName = safeTokenName(t.name);
|
|
@@ -95,27 +91,6 @@ function resolveCompositeRefsInSelector(selector, compositeStyles) {
|
|
|
95
91
|
});
|
|
96
92
|
}
|
|
97
93
|
/**
|
|
98
|
-
* Migrate legacy `macros` JSON (the pre-rename shape) into the new
|
|
99
|
-
* `compositeStyles` shape. Each old key (`elevation`) becomes a `{ label,
|
|
100
|
-
* styles }` def so older serialized configs (in `uds.config.json`,
|
|
101
|
-
* `draft_base_configs.baseConfig`) keep loading until they're rewritten.
|
|
102
|
-
*
|
|
103
|
-
* Returns `undefined` when no legacy data is present so callers can chain
|
|
104
|
-
* a fallback (`?? {}`).
|
|
105
|
-
*/
|
|
106
|
-
function upgradeLegacyMacros(legacy) {
|
|
107
|
-
if (!legacy || typeof legacy !== "object") return void 0;
|
|
108
|
-
const out = {};
|
|
109
|
-
for (const [name, variants] of Object.entries(legacy)) {
|
|
110
|
-
if (!variants || typeof variants !== "object") continue;
|
|
111
|
-
out[name] = {
|
|
112
|
-
label: name,
|
|
113
|
-
styles: variants
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
return Object.keys(out).length > 0 ? out : void 0;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
94
|
* Convert a VarGroupDef into AtomicToken tokens, extracting modifier overrides.
|
|
120
95
|
*
|
|
121
96
|
* Also extracts group-level metadata:
|
|
@@ -129,15 +104,10 @@ function varGroupToTokens(varGroup, knownModifiers) {
|
|
|
129
104
|
let groupType;
|
|
130
105
|
let groupDescription;
|
|
131
106
|
const tokens = [];
|
|
107
|
+
for (const [tokenName, rawDef] of Object.entries(varGroup)) if (tokenName === "$type" && typeof rawDef === "string") groupType = rawDef;
|
|
108
|
+
else if (tokenName === "$description" && typeof rawDef === "string") groupDescription = rawDef;
|
|
132
109
|
for (const [tokenName, rawDef] of Object.entries(varGroup)) {
|
|
133
|
-
if (tokenName === "$type")
|
|
134
|
-
if (typeof rawDef === "string") groupType = rawDef;
|
|
135
|
-
continue;
|
|
136
|
-
}
|
|
137
|
-
if (tokenName === "$description") {
|
|
138
|
-
if (typeof rawDef === "string") groupDescription = rawDef;
|
|
139
|
-
continue;
|
|
140
|
-
}
|
|
110
|
+
if (tokenName === "$type" || tokenName === "$description") continue;
|
|
141
111
|
if (rawDef == null || typeof rawDef !== "object") continue;
|
|
142
112
|
const tokenDef = rawDef;
|
|
143
113
|
const modifiers = {};
|
|
@@ -145,10 +115,16 @@ function varGroupToTokens(varGroup, knownModifiers) {
|
|
|
145
115
|
if (key === "value" || key === "$type" || val === void 0) continue;
|
|
146
116
|
if (key.startsWith("_") && knownModifiers.has(key)) modifiers[key] = val;
|
|
147
117
|
}
|
|
118
|
+
const value = tokenDef.value;
|
|
119
|
+
let perTokenType = tokenDef.$type;
|
|
120
|
+
if (!perTokenType && groupType && typeof value === "string") {
|
|
121
|
+
const sniffed = sniffTokenTypeFromValue(value);
|
|
122
|
+
if (sniffed && sniffed !== groupType) perTokenType = sniffed;
|
|
123
|
+
}
|
|
148
124
|
tokens.push({
|
|
149
125
|
name: tokenName,
|
|
150
|
-
value
|
|
151
|
-
...
|
|
126
|
+
value,
|
|
127
|
+
...perTokenType ? { type: perTokenType } : {},
|
|
152
128
|
...Object.keys(modifiers).length > 0 ? { modifiers } : {}
|
|
153
129
|
});
|
|
154
130
|
}
|
|
@@ -168,7 +144,6 @@ function varGroupToTokens(varGroup, knownModifiers) {
|
|
|
168
144
|
function buildNamespaceConsumers(styleProps) {
|
|
169
145
|
const result = /* @__PURE__ */ new Map();
|
|
170
146
|
if (!styleProps) return result;
|
|
171
|
-
const refRe = /^\{([^.{}]+)/;
|
|
172
147
|
const addConsumer = (namespace, propName) => {
|
|
173
148
|
const list = result.get(namespace);
|
|
174
149
|
if (!list) {
|
|
@@ -177,14 +152,17 @@ function buildNamespaceConsumers(styleProps) {
|
|
|
177
152
|
}
|
|
178
153
|
if (!list.includes(propName)) list.push(propName);
|
|
179
154
|
};
|
|
155
|
+
const namespaceOf = (entry) => {
|
|
156
|
+
if (typeof entry === "object" && entry !== null && entry.__kind === "tokenGroup" && typeof entry.group === "string") {
|
|
157
|
+
const group = entry.group;
|
|
158
|
+
const slash = group.indexOf("/");
|
|
159
|
+
return slash > 0 ? group.slice(0, slash) : group;
|
|
160
|
+
}
|
|
161
|
+
if (typeof entry === "object" && entry !== null && "ref" in entry && typeof entry.ref === "object") return namespaceOf(entry.ref);
|
|
162
|
+
};
|
|
180
163
|
for (const [propName, prop] of Object.entries(styleProps)) for (const entry of prop.values ?? []) {
|
|
181
|
-
|
|
182
|
-
if (
|
|
183
|
-
else if (entry !== null && typeof entry === "object" && "ref" in entry && typeof entry.ref === "string") raw = entry.ref;
|
|
184
|
-
if (!raw) continue;
|
|
185
|
-
const match = refRe.exec(raw);
|
|
186
|
-
if (!match || !match[1]) continue;
|
|
187
|
-
addConsumer(match[1], propName);
|
|
164
|
+
const ns = namespaceOf(entry);
|
|
165
|
+
if (ns) addConsumer(ns, propName);
|
|
188
166
|
}
|
|
189
167
|
return result;
|
|
190
168
|
}
|
|
@@ -205,17 +183,12 @@ function synthesizeAtomicFromVarsAndStyleProps(vars, styleProps, modes) {
|
|
|
205
183
|
const { tokens, groupType, groupDescription } = varGroupToTokens(varGroup, knownModifiers);
|
|
206
184
|
const properties = consumers.get(namespace) ?? [];
|
|
207
185
|
const cssPfx = kebabCase(namespace);
|
|
208
|
-
const resolvedGroupType = resolveTokenType({ explicit: groupType });
|
|
209
|
-
if (resolvedGroupType && resolvedGroupType !== "string") for (const token of tokens) {
|
|
210
|
-
if (token.type) continue;
|
|
211
|
-
if (sniffTokenTypeFromValue(token.value) === "string") token.type = "string";
|
|
212
|
-
}
|
|
213
186
|
result.push({
|
|
214
187
|
properties,
|
|
215
188
|
tokens,
|
|
216
189
|
namespace,
|
|
217
190
|
cssPrefix: cssPfx,
|
|
218
|
-
...
|
|
191
|
+
...groupType ? { type: groupType } : {},
|
|
219
192
|
...groupDescription ? { description: groupDescription } : {}
|
|
220
193
|
});
|
|
221
194
|
}
|
|
@@ -228,10 +201,10 @@ function resolveConfig(config) {
|
|
|
228
201
|
else configData = {
|
|
229
202
|
modes: config.modes ?? [],
|
|
230
203
|
modifiers: config.modifiers ?? [],
|
|
231
|
-
atomic:
|
|
232
|
-
compositeStyles: config.compositeStyles ??
|
|
204
|
+
atomic: [],
|
|
205
|
+
compositeStyles: config.compositeStyles ?? {},
|
|
233
206
|
motion: config.motion ?? {},
|
|
234
|
-
components:
|
|
207
|
+
components: {},
|
|
235
208
|
globalStyles: config.globalStyles ?? {},
|
|
236
209
|
preflight: config.preflight ?? true,
|
|
237
210
|
prefix: config.prefix ?? "uds",
|
|
@@ -239,7 +212,6 @@ function resolveConfig(config) {
|
|
|
239
212
|
examples: config.examples,
|
|
240
213
|
designPrinciples: config.designPrinciples,
|
|
241
214
|
vars: config.vars,
|
|
242
|
-
presetTokenNames: config.presetTokenNames,
|
|
243
215
|
styleProps: config.styleProps
|
|
244
216
|
};
|
|
245
217
|
if (configData.vars) {
|
|
@@ -260,89 +232,10 @@ function resolveConfig(config) {
|
|
|
260
232
|
};
|
|
261
233
|
}
|
|
262
234
|
if (configData.styleProps) setRegisteredStyleProps(configData.styleProps);
|
|
235
|
+
if (configData.compositeStyles) setRegisteredComposites(configData.compositeStyles);
|
|
263
236
|
}
|
|
264
237
|
return configData;
|
|
265
238
|
}
|
|
266
|
-
function isComponentDefinition(input) {
|
|
267
|
-
return typeof input === "object" && input !== null && "requiredTokens" in input && "components" in input;
|
|
268
|
-
}
|
|
269
|
-
function resolvePresetData(input) {
|
|
270
|
-
if (isComponentDefinition(input)) return {
|
|
271
|
-
modes: [],
|
|
272
|
-
modifiers: [],
|
|
273
|
-
atomic: [],
|
|
274
|
-
compositeStyles: {},
|
|
275
|
-
motion: input.motion ?? {},
|
|
276
|
-
components: input.components,
|
|
277
|
-
globalStyles: {},
|
|
278
|
-
preflight: true,
|
|
279
|
-
prefix: "uds"
|
|
280
|
-
};
|
|
281
|
-
if ("defineVars" in input) return resolveConfig(input);
|
|
282
|
-
return {
|
|
283
|
-
modes: input.modes ?? [],
|
|
284
|
-
modifiers: input.modifiers ?? [],
|
|
285
|
-
atomic: input.atomic ?? [],
|
|
286
|
-
compositeStyles: input.compositeStyles ?? {},
|
|
287
|
-
motion: input.motion ?? {},
|
|
288
|
-
components: input.components ?? {},
|
|
289
|
-
globalStyles: input.globalStyles ?? {},
|
|
290
|
-
preflight: input.preflight ?? true,
|
|
291
|
-
prefix: input.prefix ?? "uds",
|
|
292
|
-
examples: input.examples,
|
|
293
|
-
designPrinciples: input.designPrinciples,
|
|
294
|
-
vars: input.vars,
|
|
295
|
-
presetTokenNames: input.presetTokenNames
|
|
296
|
-
};
|
|
297
|
-
}
|
|
298
|
-
function extractVarReferences(value) {
|
|
299
|
-
if (typeof value !== "string") return [];
|
|
300
|
-
return value.match(/var\([^()]+\)/g) ?? [];
|
|
301
|
-
}
|
|
302
|
-
function collectRequiredTokensFromObject(value, out) {
|
|
303
|
-
if (value == null) return;
|
|
304
|
-
if (typeof value === "string") {
|
|
305
|
-
const refs = extractVarReferences(value);
|
|
306
|
-
for (const ref of refs) out.add(ref);
|
|
307
|
-
return;
|
|
308
|
-
}
|
|
309
|
-
if (Array.isArray(value)) {
|
|
310
|
-
for (const item of value) collectRequiredTokensFromObject(item, out);
|
|
311
|
-
return;
|
|
312
|
-
}
|
|
313
|
-
if (typeof value === "object") for (const child of Object.values(value)) collectRequiredTokensFromObject(child, out);
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
* Collect the set of `var(--uds-X-Y)` references a component preset uses, so
|
|
317
|
-
* downstream `compose()` calls can verify the target config emits those
|
|
318
|
-
* variables. Storing raw var refs (instead of `propName.tokenKey` pairs)
|
|
319
|
-
* decouples the check from prop/namespace association lookups — only the
|
|
320
|
-
* actual CSS variable surface needs to be compatible.
|
|
321
|
-
*/
|
|
322
|
-
function collectRequiredTokens(_sourceData, components, motion) {
|
|
323
|
-
const out = /* @__PURE__ */ new Set();
|
|
324
|
-
collectRequiredTokensFromObject(components, out);
|
|
325
|
-
if (motion) collectRequiredTokensFromObject(motion, out);
|
|
326
|
-
return Array.from(out).sort();
|
|
327
|
-
}
|
|
328
|
-
function buildComponentsAccessor(components) {
|
|
329
|
-
const accessor = {};
|
|
330
|
-
for (const [name, config] of Object.entries(components)) {
|
|
331
|
-
const comp = {};
|
|
332
|
-
comp.base = { ...config.base?.root ?? {} };
|
|
333
|
-
for (const [slot, styles] of Object.entries(config.base ?? {})) if (slot !== "root") comp.base[slot] = styles;
|
|
334
|
-
if (config.variants) for (const [axis, values] of Object.entries(config.variants)) {
|
|
335
|
-
const axisAcc = {};
|
|
336
|
-
for (const [val, slots] of Object.entries(values)) {
|
|
337
|
-
axisAcc[val] = { ...slots.root ?? {} };
|
|
338
|
-
for (const [slot, styles] of Object.entries(slots)) if (slot !== "root") axisAcc[val][slot] = styles;
|
|
339
|
-
}
|
|
340
|
-
comp[axis] = axisAcc;
|
|
341
|
-
}
|
|
342
|
-
accessor[name] = comp;
|
|
343
|
-
}
|
|
344
|
-
return accessor;
|
|
345
|
-
}
|
|
346
239
|
function createConfigBuilder(data, extensions) {
|
|
347
240
|
const next = (overrides = {}) => createConfigBuilder({
|
|
348
241
|
...data,
|
|
@@ -424,6 +317,51 @@ function createConfigBuilder(data, extensions) {
|
|
|
424
317
|
}
|
|
425
318
|
}, extensions);
|
|
426
319
|
},
|
|
320
|
+
registerComposites(composites) {
|
|
321
|
+
const resolved = {};
|
|
322
|
+
for (const [name, value] of Object.entries(composites)) resolved[name] = {
|
|
323
|
+
label: value.label,
|
|
324
|
+
...value.description !== void 0 ? { description: value.description } : {},
|
|
325
|
+
styles: value.styles
|
|
326
|
+
};
|
|
327
|
+
const allCompositeStyles = {
|
|
328
|
+
...data.compositeStyles,
|
|
329
|
+
...resolved
|
|
330
|
+
};
|
|
331
|
+
const edges = /* @__PURE__ */ new Map();
|
|
332
|
+
for (const [groupName, def] of Object.entries(allCompositeStyles)) {
|
|
333
|
+
const targets = /* @__PURE__ */ new Set();
|
|
334
|
+
for (const bag of Object.values(def.styles)) if (bag && typeof bag === "object") {
|
|
335
|
+
for (const key of Object.keys(bag)) if (key in allCompositeStyles) targets.add(key);
|
|
336
|
+
}
|
|
337
|
+
if (targets.size > 0) edges.set(groupName, targets);
|
|
338
|
+
}
|
|
339
|
+
const visited = /* @__PURE__ */ new Set();
|
|
340
|
+
const stack = /* @__PURE__ */ new Set();
|
|
341
|
+
const path = [];
|
|
342
|
+
function dfs(node) {
|
|
343
|
+
if (stack.has(node)) {
|
|
344
|
+
const cycleStart = path.indexOf(node);
|
|
345
|
+
throw new Error(`Circular composite style reference: ${[...path.slice(cycleStart), node].join(" → ")}`);
|
|
346
|
+
}
|
|
347
|
+
if (visited.has(node)) return;
|
|
348
|
+
visited.add(node);
|
|
349
|
+
stack.add(node);
|
|
350
|
+
path.push(node);
|
|
351
|
+
const neighbors = edges.get(node);
|
|
352
|
+
if (neighbors) for (const neighbor of neighbors) dfs(neighbor);
|
|
353
|
+
path.pop();
|
|
354
|
+
stack.delete(node);
|
|
355
|
+
}
|
|
356
|
+
for (const node of edges.keys()) dfs(node);
|
|
357
|
+
return createConfigBuilder({
|
|
358
|
+
...data,
|
|
359
|
+
compositeStyles: {
|
|
360
|
+
...data.compositeStyles,
|
|
361
|
+
...resolved
|
|
362
|
+
}
|
|
363
|
+
}, extensions);
|
|
364
|
+
},
|
|
427
365
|
registerStyleProps(props) {
|
|
428
366
|
const expanded = {};
|
|
429
367
|
for (const [propName, prop] of Object.entries(props)) {
|
|
@@ -433,7 +371,7 @@ function createConfigBuilder(data, extensions) {
|
|
|
433
371
|
kind: "styleProp",
|
|
434
372
|
cssProperty: prop.cssProperty,
|
|
435
373
|
classPrefix: "",
|
|
436
|
-
values: prop.opacityPair.values,
|
|
374
|
+
values: [prop.opacityPair.values],
|
|
437
375
|
arbitrary: void 0,
|
|
438
376
|
cssType: prop.cssType,
|
|
439
377
|
metadata: { label: prop.metadata?.label ? `${prop.metadata.label} opacity` : void 0 },
|
|
@@ -453,8 +391,10 @@ function createConfigBuilder(data, extensions) {
|
|
|
453
391
|
},
|
|
454
392
|
registerComponents(configs) {
|
|
455
393
|
const normalized = {};
|
|
394
|
+
const instances = {};
|
|
456
395
|
for (const [name, entry] of Object.entries(configs)) {
|
|
457
|
-
const
|
|
396
|
+
const isBound = typeof entry === "function" && "__config" in entry;
|
|
397
|
+
const config = isBound ? entry.__config : entry;
|
|
458
398
|
Object.defineProperty(config, "__componentName", {
|
|
459
399
|
enumerable: false,
|
|
460
400
|
configurable: true,
|
|
@@ -462,10 +402,23 @@ function createConfigBuilder(data, extensions) {
|
|
|
462
402
|
value: name
|
|
463
403
|
});
|
|
464
404
|
normalized[name] = config;
|
|
405
|
+
if (isBound) instances[name] = entry;
|
|
465
406
|
}
|
|
466
|
-
return next({
|
|
467
|
-
|
|
468
|
-
|
|
407
|
+
return next({
|
|
408
|
+
components: {
|
|
409
|
+
...data.components,
|
|
410
|
+
...normalized
|
|
411
|
+
},
|
|
412
|
+
componentInstances: {
|
|
413
|
+
...data.componentInstances ?? {},
|
|
414
|
+
...instances
|
|
415
|
+
}
|
|
416
|
+
});
|
|
417
|
+
},
|
|
418
|
+
registerPreviews(previews) {
|
|
419
|
+
return next({ previews: {
|
|
420
|
+
...data.previews ?? {},
|
|
421
|
+
...previews
|
|
469
422
|
} });
|
|
470
423
|
},
|
|
471
424
|
defineMotion(presets) {
|
|
@@ -479,24 +432,6 @@ function createConfigBuilder(data, extensions) {
|
|
|
479
432
|
}
|
|
480
433
|
}, extensions);
|
|
481
434
|
},
|
|
482
|
-
defineComponents(params) {
|
|
483
|
-
const tokenReference = buildTokenReference(data.atomic, data.prefix);
|
|
484
|
-
const motionReference = buildMotionReference(data.motion);
|
|
485
|
-
const componentsAccessor = buildComponentsAccessor(data.components);
|
|
486
|
-
const newComponents = resolveComponentMotionAliases(typeof params === "function" ? params({
|
|
487
|
-
tokens: tokenReference,
|
|
488
|
-
motion: motionReference,
|
|
489
|
-
components: componentsAccessor
|
|
490
|
-
}) : params, data.motion);
|
|
491
|
-
validateComponentVariants(newComponents);
|
|
492
|
-
const mergedComponents = { ...data.components };
|
|
493
|
-
for (const [name, def] of Object.entries(newComponents)) {
|
|
494
|
-
const existing = mergedComponents[name];
|
|
495
|
-
if (existing && typeof existing === "object" && typeof def === "object") mergedComponents[name] = deepMerge(existing, def);
|
|
496
|
-
else mergedComponents[name] = def;
|
|
497
|
-
}
|
|
498
|
-
return next({ components: mergedComponents });
|
|
499
|
-
},
|
|
500
435
|
defineGlobalStyles(params) {
|
|
501
436
|
const tokenReference = buildTokenReference(data.atomic, data.prefix);
|
|
502
437
|
const newGlobalStyles = typeof params === "function" ? params(tokenReference) : params;
|
|
@@ -508,63 +443,6 @@ function createConfigBuilder(data, extensions) {
|
|
|
508
443
|
defineDesignPrinciples(principles) {
|
|
509
444
|
return next({ designPrinciples: [...data.designPrinciples ?? [], ...principles] });
|
|
510
445
|
},
|
|
511
|
-
defineExample(name, examples) {
|
|
512
|
-
const componentConfig = data.components[name];
|
|
513
|
-
if (!componentConfig) throw new Error(`defineExample: component "${name}" not found. Available components: ${Object.keys(data.components).join(", ")}`);
|
|
514
|
-
const variantAxes = Object.keys(componentConfig.variants ?? {});
|
|
515
|
-
for (const [exampleKey, entry] of Object.entries(examples)) if (entry.each && !variantAxes.includes(entry.each)) throw new Error(`defineExample: "${name}" example "${exampleKey}" references unknown variant axis "${entry.each}". Available axes: ${variantAxes.join(", ") || "(none)"}`);
|
|
516
|
-
return next({ examples: {
|
|
517
|
-
...data.examples,
|
|
518
|
-
[name]: examples
|
|
519
|
-
} });
|
|
520
|
-
},
|
|
521
|
-
compose(...presets) {
|
|
522
|
-
return createConfigBuilder(presets.reduce((acc, preset) => {
|
|
523
|
-
return applyPresetToData(acc, resolvePresetData(preset));
|
|
524
|
-
}, data), extensions);
|
|
525
|
-
},
|
|
526
|
-
defineComponent(name, component, motion) {
|
|
527
|
-
const tokenReference = buildTokenReference(data.atomic, data.prefix);
|
|
528
|
-
const resolvedMotion = typeof motion === "function" ? motion(tokenReference) : motion;
|
|
529
|
-
const motionReference = buildMotionReference({
|
|
530
|
-
...data.motion,
|
|
531
|
-
...resolvedMotion ?? {}
|
|
532
|
-
});
|
|
533
|
-
const componentsAccessor = buildComponentsAccessor(data.components);
|
|
534
|
-
const inputComponent = typeof component === "function" ? component({
|
|
535
|
-
tokens: tokenReference,
|
|
536
|
-
motion: motionReference,
|
|
537
|
-
components: componentsAccessor
|
|
538
|
-
}) : component;
|
|
539
|
-
const resolvedComponents = resolveComponentMotionAliases({ [name]: inputComponent }, {
|
|
540
|
-
...data.motion,
|
|
541
|
-
...resolvedMotion ?? {}
|
|
542
|
-
});
|
|
543
|
-
validateComponentVariants(resolvedComponents);
|
|
544
|
-
return {
|
|
545
|
-
name,
|
|
546
|
-
requiredTokens: collectRequiredTokens(data, resolvedComponents, resolvedMotion),
|
|
547
|
-
components: resolvedComponents,
|
|
548
|
-
motion: resolvedMotion
|
|
549
|
-
};
|
|
550
|
-
},
|
|
551
|
-
from(input) {
|
|
552
|
-
return createConfigBuilder({
|
|
553
|
-
modes: input.modes ?? data.modes,
|
|
554
|
-
modifiers: input.modifiers ?? data.modifiers,
|
|
555
|
-
atomic: input.atomic ?? data.atomic,
|
|
556
|
-
compositeStyles: input.compositeStyles ?? data.compositeStyles,
|
|
557
|
-
motion: input.motion ?? data.motion,
|
|
558
|
-
components: input.components ?? data.components,
|
|
559
|
-
globalStyles: input.globalStyles ?? data.globalStyles,
|
|
560
|
-
preflight: input.preflight ?? data.preflight,
|
|
561
|
-
prefix: input.prefix ?? data.prefix,
|
|
562
|
-
examples: input.examples ?? data.examples,
|
|
563
|
-
designPrinciples: input.designPrinciples ?? data.designPrinciples,
|
|
564
|
-
vars: input.vars ?? data.vars,
|
|
565
|
-
presetTokenNames: input.presetTokenNames ?? data.presetTokenNames
|
|
566
|
-
}, extensions);
|
|
567
|
-
},
|
|
568
446
|
extend(ext) {
|
|
569
447
|
return createConfigBuilder(data, {
|
|
570
448
|
...extensions,
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { UdsConfigData } from "./createConfig.js";
|
|
2
|
+
|
|
3
|
+
//#region ../config/dist/createStyler.d.ts
|
|
4
|
+
//#region src/createStyler.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* A styler bound to a resolved config's style-prop registry. Takes a
|
|
7
|
+
* props object and returns the className string. Empty string when
|
|
8
|
+
* no prop matches a registered style prop.
|
|
9
|
+
*/
|
|
10
|
+
type Styler = (props: Record<string, unknown>) => string;
|
|
11
|
+
/**
|
|
12
|
+
* Bind a styler to a resolved config. Reads the registered style-
|
|
13
|
+
* prop registry once; the returned function does just per-call
|
|
14
|
+
* className composition.
|
|
15
|
+
*
|
|
16
|
+
* // codegen / build pipeline
|
|
17
|
+
* const getStyles = createStyler(resolveConfig(udsBuilder));
|
|
18
|
+
* for (const site of scannedJsxSites) {
|
|
19
|
+
* const merged = mergeComponentDefaults(site.config, site.props);
|
|
20
|
+
* safelist.add(getStyles(merged));
|
|
21
|
+
* }
|
|
22
|
+
*
|
|
23
|
+
* `resolvedConfig` is the output of `resolveConfig(udsBuilder)`. The
|
|
24
|
+
* styler closes over the registry under either of two fields:
|
|
25
|
+
*
|
|
26
|
+
* - `resolvedStyleProps` — the canonical resolved registry the
|
|
27
|
+
* codegen + runtime consume; entries carry `propName` +
|
|
28
|
+
* `classPrefix`.
|
|
29
|
+
* - `styleProps` — fallback to the unresolved map when
|
|
30
|
+
* `resolvedStyleProps` isn't populated (test configs that skip
|
|
31
|
+
* the full resolver).
|
|
32
|
+
*/
|
|
33
|
+
declare function createStyler(resolvedConfig: UdsConfigData): Styler; //#endregion
|
|
34
|
+
//#endregion
|
|
35
|
+
export { Styler, createStyler };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { buildStylePropClassName } from "./className.js";
|
|
2
|
+
//#region ../config/dist/createStyler.js
|
|
3
|
+
/**
|
|
4
|
+
* **NEW-API ONLY** — factory that produces a styler bound to a
|
|
5
|
+
* resolved config's registered style props. The returned function
|
|
6
|
+
* takes a props object and returns the className string for those
|
|
7
|
+
* style-prop values.
|
|
8
|
+
*
|
|
9
|
+
* const getStyles = createStyler(resolveConfig(udsBuilder));
|
|
10
|
+
* getStyles({ bg: 'brand', gap: '4' });
|
|
11
|
+
* // → 'bg-brand gap-4'
|
|
12
|
+
*
|
|
13
|
+
* Parity with the legacy `getStyles` from `@uds/core`, but the lookup
|
|
14
|
+
* is sourced from the user's `.registerStyleProps({...})` registry
|
|
15
|
+
* (via `resolveConfig`) instead of `@uds/core`'s hardcoded
|
|
16
|
+
* `propMappings` table. Registering a style prop is enough to make
|
|
17
|
+
* it work — no edits to `@uds/core`.
|
|
18
|
+
*
|
|
19
|
+
* Used by:
|
|
20
|
+
*
|
|
21
|
+
* - `@uds/codegen/css/extractClasses` (build-time CSS scanner) —
|
|
22
|
+
* populates the Tailwind safelist with every class the runtime
|
|
23
|
+
* can produce. The scanner walks JSX call sites, merges the
|
|
24
|
+
* component's `defaultProps` into the JSX props, and passes the
|
|
25
|
+
* merged shape here.
|
|
26
|
+
* - Custom tooling that wants "what would the runtime render?"
|
|
27
|
+
* without going through React.
|
|
28
|
+
*
|
|
29
|
+
* Both the styler and `bindRender` (the runtime) call the same
|
|
30
|
+
* `buildStylePropClassName` helper in `./className.ts` — that's the
|
|
31
|
+
* load-bearing invariant: identical class strings for the same
|
|
32
|
+
* inputs.
|
|
33
|
+
*
|
|
34
|
+
* Scope: only style-prop bindings the user registered. Markers
|
|
35
|
+
* (`bool()` / `enums()`), `ForwardBinding`, compound variants, and
|
|
36
|
+
* `_<modifier>` props don't flow through here — they're handled by
|
|
37
|
+
* codegen via dedicated emission paths (component-utility classes,
|
|
38
|
+
* modifier-prefixed @utility blocks).
|
|
39
|
+
*/
|
|
40
|
+
/**
|
|
41
|
+
* Bind a styler to a resolved config. Reads the registered style-
|
|
42
|
+
* prop registry once; the returned function does just per-call
|
|
43
|
+
* className composition.
|
|
44
|
+
*
|
|
45
|
+
* // codegen / build pipeline
|
|
46
|
+
* const getStyles = createStyler(resolveConfig(udsBuilder));
|
|
47
|
+
* for (const site of scannedJsxSites) {
|
|
48
|
+
* const merged = mergeComponentDefaults(site.config, site.props);
|
|
49
|
+
* safelist.add(getStyles(merged));
|
|
50
|
+
* }
|
|
51
|
+
*
|
|
52
|
+
* `resolvedConfig` is the output of `resolveConfig(udsBuilder)`. The
|
|
53
|
+
* styler closes over the registry under either of two fields:
|
|
54
|
+
*
|
|
55
|
+
* - `resolvedStyleProps` — the canonical resolved registry the
|
|
56
|
+
* codegen + runtime consume; entries carry `propName` +
|
|
57
|
+
* `classPrefix`.
|
|
58
|
+
* - `styleProps` — fallback to the unresolved map when
|
|
59
|
+
* `resolvedStyleProps` isn't populated (test configs that skip
|
|
60
|
+
* the full resolver).
|
|
61
|
+
*/
|
|
62
|
+
function createStyler(resolvedConfig) {
|
|
63
|
+
const classPrefixByPropName = buildClassPrefixLookup(resolvedConfig);
|
|
64
|
+
return (props) => classNameFor(props, classPrefixByPropName);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Per-styler resolved style-prop lookup. Keys are JSX-prop names
|
|
68
|
+
* (e.g. `bg`, `padding`); values are the `classPrefix` the style
|
|
69
|
+
* prop registered with.
|
|
70
|
+
*
|
|
71
|
+
* `resolvedStyleProps` (the canonical shape) takes precedence;
|
|
72
|
+
* `styleProps` (the unresolved map) is consulted only when a prop
|
|
73
|
+
* isn't already present — that keeps test configs that skip the
|
|
74
|
+
* full resolver working without overriding the canonical entries.
|
|
75
|
+
*/
|
|
76
|
+
function buildClassPrefixLookup(config) {
|
|
77
|
+
const out = {};
|
|
78
|
+
for (const entry of config.resolvedStyleProps ?? []) if (entry.propName) out[entry.propName] = entry.classPrefix ?? "";
|
|
79
|
+
for (const [propName, styleProp] of Object.entries(config.styleProps ?? {})) if (!(propName in out)) out[propName] = styleProp.classPrefix ?? "";
|
|
80
|
+
return out;
|
|
81
|
+
}
|
|
82
|
+
function classNameFor(props, classPrefixByPropName) {
|
|
83
|
+
const classNames = [];
|
|
84
|
+
for (const [propName, value] of Object.entries(props)) {
|
|
85
|
+
const classPrefix = classPrefixByPropName[propName];
|
|
86
|
+
if (classPrefix === void 0) continue;
|
|
87
|
+
const className = buildStylePropClassName({ classPrefix }, value);
|
|
88
|
+
if (className) classNames.push(className);
|
|
89
|
+
}
|
|
90
|
+
return classNames.join(" ");
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
93
|
+
export { createStyler };
|