@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
package/dist/config.js
CHANGED
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { buildStylePropClassName } from "./config/dist/className.js";
|
|
2
|
+
import { bool, composite, enums, hidden, slot, string, styleProp, token, tokenGroup } from "./config/dist/component-config.js";
|
|
3
|
+
import { PROPERTY_ACCEPTED_TYPES, isTokenAcceptedByProperty } from "./config/dist/propertyAcceptedTypes.js";
|
|
4
|
+
import { darken, isTokenWithModifier, lighten, resolveTokenValue, resolveTokenWithModifier } from "./config/dist/refs.js";
|
|
5
|
+
import { sniffTokenTypeFromValue } from "./config/dist/sniffTokenType.js";
|
|
6
|
+
import { detectTokenValueType, getColorOpacityMap, resolveStyleProp } from "./config/dist/resolveStyleProp.js";
|
|
7
|
+
import { buildCompositeStylesReference, buildTokenReference, convertModesInputToGroups, createConfigBuilder, darker, interpolate, lighter, rem, resolveConfig, uds } from "./config/dist/createConfig.js";
|
|
8
|
+
import { createStyler } from "./config/dist/createStyler.js";
|
|
9
|
+
import { defineComponent } from "./config/dist/defineComponent.js";
|
|
10
|
+
import { defineCompositeStyle } from "./config/dist/defineCompositeStyle.js";
|
|
11
|
+
import { definePreview } from "./config/dist/definePreview.js";
|
|
12
|
+
import { defineStyleProp } from "./config/dist/defineStyleProp.js";
|
|
13
|
+
import { applyCompoundProps, isLayerHidden, resolveCompoundProps } from "./config/dist/resolveCompoundProps.js";
|
|
3
14
|
import { buildReverseMap, deserializeConfig, serializeConfig } from "./config/dist/serialize.js";
|
|
15
|
+
import { BUILT_IN_PSEUDO, buildStylePropRuntime, processStyleProps } from "./config/dist/style-prop-runtime.js";
|
|
4
16
|
import "./config/dist/index.js";
|
|
5
|
-
|
|
6
|
-
import "./presets/dist/index.js";
|
|
7
|
-
//#region src/config.ts
|
|
8
|
-
/** biome-ignore-all lint/suspicious/noExplicitAny: necessary for dynamic builder */
|
|
9
|
-
const uds = createConfigBuilder({
|
|
10
|
-
atomic: [],
|
|
11
|
-
modes: [],
|
|
12
|
-
modifiers: [],
|
|
13
|
-
compositeStyles: {},
|
|
14
|
-
motion: {},
|
|
15
|
-
components: {},
|
|
16
|
-
globalStyles: {},
|
|
17
|
-
preflight: true,
|
|
18
|
-
prefix: "uds"
|
|
19
|
-
});
|
|
20
|
-
const defaultPreset = defaultPreset$1;
|
|
21
|
-
//#endregion
|
|
22
|
-
export { buildReverseMap, buildTokenReference, createConfigBuilder, darker, defaultColors, defaultPreset, deserializeConfig, lighter, resolveConfig, serializeConfig, uds };
|
|
17
|
+
export { BUILT_IN_PSEUDO, PROPERTY_ACCEPTED_TYPES, applyCompoundProps, bool, buildCompositeStylesReference, buildReverseMap, buildStylePropClassName, buildStylePropRuntime, buildTokenReference, composite, convertModesInputToGroups, createConfigBuilder, createStyler, darken, darker, defineComponent, defineCompositeStyle, definePreview, defineStyleProp, deserializeConfig, detectTokenValueType, enums, getColorOpacityMap, hidden, interpolate, isLayerHidden, isTokenAcceptedByProperty, isTokenWithModifier, lighten, lighter, processStyleProps, rem, resolveCompoundProps, resolveConfig, resolveStyleProp, resolveTokenValue, resolveTokenWithModifier, serializeConfig, slot, sniffTokenTypeFromValue, string, styleProp, token, tokenGroup, uds };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
2
|
//#region ../loader/dist/_virtual/_rolldown/runtime.js
|
|
3
|
-
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
4
3
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
5
4
|
//#endregion
|
|
6
|
-
export {
|
|
5
|
+
export { __require };
|
|
@@ -37,7 +37,7 @@ const manifestLoader = createCachedJsonLoaderWithSeed();
|
|
|
37
37
|
const transformDataLoader = createCachedJsonLoaderWithSeed();
|
|
38
38
|
const loadManifest = manifestLoader.load;
|
|
39
39
|
manifestLoader.seed;
|
|
40
|
-
|
|
40
|
+
transformDataLoader.load;
|
|
41
41
|
transformDataLoader.seed;
|
|
42
42
|
//#endregion
|
|
43
|
-
export { loadManifest
|
|
43
|
+
export { loadManifest };
|
|
@@ -1,29 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
//#region ../loader/dist/loader/babel-utils.js
|
|
3
|
-
/** JSX function names used by compiled JSX (React, etc.) */
|
|
4
|
-
const COMPILED_JSX_NAMES = new Set([
|
|
5
|
-
"jsx",
|
|
6
|
-
"jsxs",
|
|
7
|
-
"jsxDEV",
|
|
8
|
-
"_jsx",
|
|
9
|
-
"_jsxs",
|
|
10
|
-
"_jsxDEV"
|
|
11
|
-
]);
|
|
12
|
-
/**
|
|
13
|
-
* Check whether a callee expression is a compiled JSX call.
|
|
14
|
-
*
|
|
15
|
-
* Matches:
|
|
16
|
-
* - Direct identifiers: `jsx(...)`, `_jsxs(...)`, `jsxDEV(...)`, etc.
|
|
17
|
-
* - Member expressions: `React.jsx(...)`, `_reactJsxRuntime.jsxs(...)`, etc.
|
|
18
|
-
*/
|
|
19
|
-
function isCompiledJsxCallee(node) {
|
|
20
|
-
if (!node) return false;
|
|
21
|
-
if (t.isIdentifier(node)) return COMPILED_JSX_NAMES.has(node.name);
|
|
22
|
-
if (t.isMemberExpression(node) || t.isOptionalMemberExpression(node)) {
|
|
23
|
-
if (!node.computed && t.isIdentifier(node.property)) return COMPILED_JSX_NAMES.has(node.property.name);
|
|
24
|
-
if (node.computed && t.isStringLiteral(node.property)) return COMPILED_JSX_NAMES.has(node.property.value);
|
|
25
|
-
}
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
//#endregion
|
|
29
|
-
export { isCompiledJsxCallee };
|
|
1
|
+
import "@babel/types";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
+
import * as t from "@babel/types";
|
|
2
3
|
//#region ../loader/dist/loader/internal-meta.js
|
|
3
4
|
function hashToNumericId(value) {
|
|
4
5
|
let hash = 2166136261;
|
|
@@ -18,5 +19,41 @@ function buildUdsId(meta) {
|
|
|
18
19
|
function buildSourceRef(resourcePath, projectRoot, location) {
|
|
19
20
|
return `${path.relative(projectRoot, resourcePath).replaceAll(path.sep, "/")}:${location.line}:${location.column + 1}`;
|
|
20
21
|
}
|
|
22
|
+
function getJsxStringAttributeValue(nodePath, attrName) {
|
|
23
|
+
const attribute = nodePath.node.attributes.find((attr) => attr.type === "JSXAttribute" && attr.name?.type === "JSXIdentifier" && attr.name.name === attrName && attr.value?.type === "StringLiteral");
|
|
24
|
+
if (!attribute || attribute.value?.type !== "StringLiteral") return null;
|
|
25
|
+
return attribute.value.value;
|
|
26
|
+
}
|
|
27
|
+
function upsertInternalStringProp(nodePath, propName, value) {
|
|
28
|
+
const existing = nodePath.node.attributes.find((attr) => attr.type === "JSXAttribute" && attr.name?.type === "JSXIdentifier" && attr.name.name === propName);
|
|
29
|
+
if (existing) {
|
|
30
|
+
existing.value = t.stringLiteral(value);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
nodePath.node.attributes.push(t.jsxAttribute(t.jsxIdentifier(propName), t.stringLiteral(value)));
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Inject `data-uds-id` + `data-uds-source` metadata onto a JSX
|
|
37
|
+
* opening element so the devtools panel / anatomy view can locate
|
|
38
|
+
* each element back to its source position.
|
|
39
|
+
*/
|
|
40
|
+
function injectInternalUdsProps(nodePath, resourcePath, projectRoot, fallback = {}) {
|
|
41
|
+
const effectiveResourcePath = resourcePath || nodePath?.hub?.file?.opts?.filename || "";
|
|
42
|
+
if (!effectiveResourcePath) return;
|
|
43
|
+
const start = nodePath.node.loc?.start;
|
|
44
|
+
if (!start?.line || start.column === void 0) return;
|
|
45
|
+
const sourceRef = buildSourceRef(effectiveResourcePath, projectRoot, {
|
|
46
|
+
line: start.line,
|
|
47
|
+
column: start.column
|
|
48
|
+
});
|
|
49
|
+
const udsId = buildUdsId({
|
|
50
|
+
componentName: getJsxStringAttributeValue(nodePath, "data-uds-component") ?? fallback.componentName,
|
|
51
|
+
slotName: getJsxStringAttributeValue(nodePath, "data-uds-slot") ?? fallback.slotName,
|
|
52
|
+
sourceRef
|
|
53
|
+
});
|
|
54
|
+
if (!udsId) return;
|
|
55
|
+
upsertInternalStringProp(nodePath, "data-uds-id", udsId);
|
|
56
|
+
upsertInternalStringProp(nodePath, "data-uds-source", sourceRef);
|
|
57
|
+
}
|
|
21
58
|
//#endregion
|
|
22
|
-
export {
|
|
59
|
+
export { injectInternalUdsProps };
|
|
@@ -1,29 +1,127 @@
|
|
|
1
1
|
//#region ../loader/dist/loader/lower-new-api-primitive.js
|
|
2
2
|
/**
|
|
3
|
+
* Convert a token name to its class-name-safe form. Mirrors
|
|
4
|
+
* `safeTokenName` from `@uds/utils`: `.` → `_`, `/` → `-`. Inlined
|
|
5
|
+
* here so the loader stays free of cross-package runtime imports for
|
|
6
|
+
* a one-line transform.
|
|
7
|
+
*
|
|
8
|
+
* toSafeTokenName('1.5') // → '1_5'
|
|
9
|
+
* toSafeTokenName('always/black') // → 'always-black'
|
|
10
|
+
* toSafeTokenName('brand') // → 'brand'
|
|
11
|
+
*/
|
|
12
|
+
function toSafeTokenName(value) {
|
|
13
|
+
return value.replace(/\./g, "_").replace(/\//g, "-");
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
3
16
|
* Build the className a binding emits for a given value. Mirrors the
|
|
4
17
|
* codegen convention in `packages/codegen/src/css/prepareCss.ts`:
|
|
5
18
|
*
|
|
6
|
-
* - `classPrefix === ''`
|
|
19
|
+
* - `classPrefix === ''` → value IS the class.
|
|
7
20
|
* - Bracketed arbitrary values (`'[#abc]'`) → preserved verbatim
|
|
8
21
|
* (`bg-[#abc]`).
|
|
9
|
-
* -
|
|
22
|
+
* - Boolean `true` (passed in as the string `'true'`) → bare
|
|
23
|
+
* `classPrefix` (`<Box border>` / `<Box border={true}>` →
|
|
24
|
+
* `'border'`, not `'border-true'`).
|
|
25
|
+
* - Blessed token / literal / alias (in `binding.blessedValues`) →
|
|
26
|
+
* `${classPrefix}-${value}`.
|
|
27
|
+
* - Otherwise, if the prop accepts arbitrary values
|
|
28
|
+
* (`binding.acceptsArbitrary`) → `${classPrefix}-[value]`
|
|
29
|
+
* (auto-bracket so the consumer can write `fontSize="0.8125rem"`
|
|
30
|
+
* instead of `fontSize="[0.8125rem]"`).
|
|
31
|
+
* - Otherwise (when blessed/arbitrary metadata is absent — test
|
|
32
|
+
* fixtures) fall back to `${classPrefix}-${value}`.
|
|
33
|
+
*
|
|
34
|
+
* Returns `undefined` when no class should be emitted — caller drops
|
|
35
|
+
* the contribution. Boolean `false` lands here.
|
|
36
|
+
*/
|
|
37
|
+
function buildClassName(binding, value) {
|
|
38
|
+
if (value === "false") return void 0;
|
|
39
|
+
if (value === "true") return binding.classPrefix || void 0;
|
|
40
|
+
const isNoPrefix = binding.classPrefix === "";
|
|
41
|
+
if (value.startsWith("[") && value.endsWith("]")) {
|
|
42
|
+
if (isNoPrefix) return value.slice(1, -1);
|
|
43
|
+
return `${binding.classPrefix}-${value}`;
|
|
44
|
+
}
|
|
45
|
+
if (isNoPrefix) return value;
|
|
46
|
+
if (!(binding.blessedValues !== void 0 || binding.acceptsArbitrary !== void 0)) return `${binding.classPrefix}-${toSafeTokenName(value)}`;
|
|
47
|
+
if (binding.blessedValues?.includes(value)) return `${binding.classPrefix}-${toSafeTokenName(value)}`;
|
|
48
|
+
if (binding.acceptsArbitrary) return `${binding.classPrefix}-[${value}]`;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Read a JS expression node as a literal string when statically
|
|
52
|
+
* resolvable. Mirrors `readStaticString` but operates on a bare
|
|
53
|
+
* expression (used by the branch-compiler below to drill into
|
|
54
|
+
* ternary / `&&` branches that aren't wrapped in JSX containers).
|
|
55
|
+
*
|
|
56
|
+
* Returns `undefined` for any non-literal form.
|
|
57
|
+
*/
|
|
58
|
+
function readStaticStringFromExpression(expr) {
|
|
59
|
+
if (!expr) return void 0;
|
|
60
|
+
if (expr.type === "StringLiteral") return expr.value;
|
|
61
|
+
if (expr.type === "NumericLiteral") return String(expr.value);
|
|
62
|
+
if (expr.type === "BooleanLiteral") return String(expr.value);
|
|
63
|
+
if (expr.type === "TemplateLiteral" && expr.expressions.length === 0 && expr.quasis.length === 1) return expr.quasis[0].value.cooked ?? expr.quasis[0].value.raw;
|
|
64
|
+
if (expr.type === "Identifier" && expr.name === "undefined") return "";
|
|
65
|
+
if (expr.type === "NullLiteral") return "";
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Try to compile a dynamic JSX expression into a className expression
|
|
69
|
+
* with pre-resolved per-branch class names. Mirrors the legacy
|
|
70
|
+
* `tryCompileStaticBranchExpression` in `style-transform.ts` so the
|
|
71
|
+
* new-API lowering matches existing behavior for the common ternary /
|
|
72
|
+
* `&&` patterns:
|
|
73
|
+
*
|
|
74
|
+
* bg={isActive ? 'primary' : undefined}
|
|
75
|
+
* → isActive ? 'bg-primary' : ''
|
|
76
|
+
*
|
|
77
|
+
* color={isActive && 'on-primary'}
|
|
78
|
+
* → isActive && 'color-on-primary'
|
|
79
|
+
*
|
|
80
|
+
* Returns `null` when the expression isn't a statically-resolvable
|
|
81
|
+
* branch shape — caller bails on lowering for that prop. (Variables,
|
|
82
|
+
* function calls, member access of dynamic values: those need runtime
|
|
83
|
+
* resolution.)
|
|
10
84
|
*/
|
|
11
|
-
function
|
|
12
|
-
if (
|
|
13
|
-
|
|
85
|
+
function tryCompileBranchClassExpression(expr, binding, t) {
|
|
86
|
+
if (expr.type === "ConditionalExpression") {
|
|
87
|
+
const consequentValue = readStaticStringFromExpression(expr.consequent);
|
|
88
|
+
const alternateValue = readStaticStringFromExpression(expr.alternate);
|
|
89
|
+
const compileLeafValue = (value) => value === "" ? "" : buildClassName(binding, value) ?? "";
|
|
90
|
+
const compiledConsequent = consequentValue !== void 0 ? t.stringLiteral(compileLeafValue(consequentValue)) : tryCompileBranchClassExpression(expr.consequent, binding, t);
|
|
91
|
+
const compiledAlternate = alternateValue !== void 0 ? t.stringLiteral(compileLeafValue(alternateValue)) : tryCompileBranchClassExpression(expr.alternate, binding, t);
|
|
92
|
+
if (compiledConsequent && compiledAlternate) return t.conditionalExpression(t.cloneNode(expr.test), compiledConsequent, compiledAlternate);
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
if (expr.type === "LogicalExpression" && expr.operator === "&&") {
|
|
96
|
+
const rightValue = readStaticStringFromExpression(expr.right);
|
|
97
|
+
if (rightValue !== void 0) {
|
|
98
|
+
const className = buildClassName(binding, rightValue) ?? "";
|
|
99
|
+
return t.logicalExpression("&&", t.cloneNode(expr.left), t.stringLiteral(className));
|
|
100
|
+
}
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
return null;
|
|
14
104
|
}
|
|
15
105
|
/**
|
|
16
106
|
* Read a JSX attribute value as a literal string when statically
|
|
17
|
-
* resolvable. Handles
|
|
18
|
-
*
|
|
19
|
-
*
|
|
107
|
+
* resolvable. Handles:
|
|
108
|
+
*
|
|
109
|
+
* - `attr="x"` → `"x"`
|
|
110
|
+
* - `attr={"x"}` / `attr={\`x\`}` (no interpolations) → `"x"`
|
|
111
|
+
* - `attr={2}` (numeric literal) → `"2"`
|
|
112
|
+
* - `attr={true}` / `attr={false}` (boolean literal) → `"true"` / `"false"`
|
|
113
|
+
* - `attr` with no value (boolean prop shorthand) → `"true"`
|
|
114
|
+
*
|
|
115
|
+
* Returns `undefined` for any dynamic form so the caller can bail.
|
|
20
116
|
*/
|
|
21
117
|
function readStaticString(value) {
|
|
22
|
-
if (!value) return
|
|
118
|
+
if (!value) return "true";
|
|
23
119
|
if (value.type === "StringLiteral") return value.value;
|
|
24
120
|
if (value.type === "JSXExpressionContainer") {
|
|
25
121
|
const expr = value.expression;
|
|
26
122
|
if (expr.type === "StringLiteral") return expr.value;
|
|
123
|
+
if (expr.type === "NumericLiteral") return String(expr.value);
|
|
124
|
+
if (expr.type === "BooleanLiteral") return String(expr.value);
|
|
27
125
|
if (expr.type === "TemplateLiteral" && expr.expressions.length === 0 && expr.quasis.length === 1) return expr.quasis[0].value.cooked ?? expr.quasis[0].value.raw;
|
|
28
126
|
}
|
|
29
127
|
}
|
|
@@ -42,6 +140,7 @@ function readStaticString(value) {
|
|
|
42
140
|
function lowerNewApiPrimitiveJsx(openingElement, closingElement, entry, t) {
|
|
43
141
|
let tag = entry.tag;
|
|
44
142
|
const classNames = [...entry.defaultClassNames];
|
|
143
|
+
const dynamicClassExprs = [];
|
|
45
144
|
const passthroughAttrs = [];
|
|
46
145
|
let existingClassName = null;
|
|
47
146
|
for (const attr of openingElement.attributes ?? []) {
|
|
@@ -60,16 +159,68 @@ function lowerNewApiPrimitiveJsx(openingElement, closingElement, entry, t) {
|
|
|
60
159
|
}
|
|
61
160
|
const binding = entry.propBindings[attrName];
|
|
62
161
|
if (binding) {
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
65
|
-
|
|
162
|
+
const staticValue = readStaticString(attr.value);
|
|
163
|
+
if (staticValue !== void 0) {
|
|
164
|
+
const className = buildClassName(binding, staticValue);
|
|
165
|
+
if (className !== void 0) classNames.push(className);
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
if (attr.value?.type === "JSXExpressionContainer") {
|
|
169
|
+
const compiled = tryCompileBranchClassExpression(attr.value.expression, binding, t);
|
|
170
|
+
if (compiled) {
|
|
171
|
+
dynamicClassExprs.push(compiled);
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
if (attrName.startsWith("_")) {
|
|
178
|
+
const variantPrefix = entry.modifiersTwMap?.[attrName];
|
|
179
|
+
if (!variantPrefix) continue;
|
|
180
|
+
const objectExpr = attr.value?.type === "JSXExpressionContainer" ? attr.value.expression : void 0;
|
|
181
|
+
if (!objectExpr || objectExpr.type !== "ObjectExpression") return false;
|
|
182
|
+
let bailed = false;
|
|
183
|
+
for (const property of objectExpr.properties) {
|
|
184
|
+
if (property.type !== "ObjectProperty" || property.computed) {
|
|
185
|
+
bailed = true;
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
const key = property.key?.type === "Identifier" ? property.key.name : property.key?.type === "StringLiteral" ? property.key.value : void 0;
|
|
189
|
+
if (!key) {
|
|
190
|
+
bailed = true;
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
const value = readStaticString(property.value);
|
|
194
|
+
if (value === void 0) {
|
|
195
|
+
bailed = true;
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
198
|
+
const innerBinding = entry.propBindings[key];
|
|
199
|
+
if (!innerBinding) {
|
|
200
|
+
bailed = true;
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
const innerClass = buildClassName(innerBinding, value);
|
|
204
|
+
if (innerClass !== void 0) classNames.push(`${variantPrefix}${innerClass}`);
|
|
205
|
+
}
|
|
206
|
+
if (bailed) return false;
|
|
66
207
|
continue;
|
|
67
208
|
}
|
|
68
209
|
passthroughAttrs.push(attr);
|
|
69
210
|
}
|
|
70
211
|
const boundClassName = classNames.join(" ");
|
|
71
212
|
let classNameAttr = null;
|
|
72
|
-
if (
|
|
213
|
+
if (dynamicClassExprs.length > 0) {
|
|
214
|
+
const parts = [];
|
|
215
|
+
if (boundClassName.length > 0) parts.push(t.stringLiteral(boundClassName));
|
|
216
|
+
for (const expr of dynamicClassExprs) parts.push(expr);
|
|
217
|
+
if (existingClassName !== null) {
|
|
218
|
+
if (existingClassName.type === "StringLiteral") parts.push(t.stringLiteral(existingClassName.value));
|
|
219
|
+
else if (existingClassName.type === "JSXExpressionContainer") parts.push(t.cloneNode(existingClassName.expression));
|
|
220
|
+
}
|
|
221
|
+
const joinExpr = t.callExpression(t.memberExpression(t.callExpression(t.memberExpression(t.arrayExpression(parts), t.identifier("filter")), [t.identifier("Boolean")]), t.identifier("join")), [t.stringLiteral(" ")]);
|
|
222
|
+
classNameAttr = t.jsxAttribute(t.jsxIdentifier("className"), t.jsxExpressionContainer(joinExpr));
|
|
223
|
+
} else if (existingClassName === null && boundClassName.length > 0) classNameAttr = t.jsxAttribute(t.jsxIdentifier("className"), t.stringLiteral(boundClassName));
|
|
73
224
|
else if (existingClassName !== null) if (existingClassName.type === "StringLiteral") {
|
|
74
225
|
const merged = boundClassName ? `${existingClassName.value} ${boundClassName}` : existingClassName.value;
|
|
75
226
|
classNameAttr = t.jsxAttribute(t.jsxIdentifier("className"), t.stringLiteral(merged));
|
|
@@ -81,8 +232,19 @@ function lowerNewApiPrimitiveJsx(openingElement, closingElement, entry, t) {
|
|
|
81
232
|
const finalExpr = boundClassName ? t.binaryExpression("+", t.binaryExpression("+", expr, t.stringLiteral(" ")), t.stringLiteral(boundClassName)) : expr;
|
|
82
233
|
classNameAttr = t.jsxAttribute(t.jsxIdentifier("className"), t.jsxExpressionContainer(finalExpr));
|
|
83
234
|
} else return false;
|
|
235
|
+
const anatomyAttrs = [];
|
|
236
|
+
if (entry.componentName) {
|
|
237
|
+
const alreadyHasSlot = passthroughAttrs.some((a) => a.type === "JSXAttribute" && a.name?.name === "data-uds-slot");
|
|
238
|
+
const alreadyHasComponent = passthroughAttrs.some((a) => a.type === "JSXAttribute" && a.name?.name === "data-uds-component");
|
|
239
|
+
if (!alreadyHasSlot) anatomyAttrs.push(t.jsxAttribute(t.jsxIdentifier("data-uds-slot"), t.stringLiteral("root")));
|
|
240
|
+
if (!alreadyHasComponent) anatomyAttrs.push(t.jsxAttribute(t.jsxIdentifier("data-uds-component"), t.stringLiteral(entry.componentName)));
|
|
241
|
+
}
|
|
84
242
|
openingElement.name = t.jsxIdentifier(tag);
|
|
85
|
-
openingElement.attributes =
|
|
243
|
+
openingElement.attributes = [
|
|
244
|
+
...classNameAttr ? [classNameAttr] : [],
|
|
245
|
+
...passthroughAttrs,
|
|
246
|
+
...anatomyAttrs
|
|
247
|
+
];
|
|
86
248
|
if (closingElement) closingElement.name = t.jsxIdentifier(tag);
|
|
87
249
|
return true;
|
|
88
250
|
}
|
|
@@ -1,7 +1,35 @@
|
|
|
1
1
|
import { LoaderDefinitionFunction } from "webpack";
|
|
2
2
|
|
|
3
3
|
//#region ../loader/dist/loader.d.ts
|
|
4
|
+
//#region src/loader.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* The UDS loader's only build-time job. Three responsibilities, one
|
|
7
|
+
* Babel pass:
|
|
8
|
+
*
|
|
9
|
+
* 1. **Import rewrite** — when the source imports a registered
|
|
10
|
+
* component from an aliased local path (e.g.
|
|
11
|
+
* `@/uds/components/box`), rewrite the import source to
|
|
12
|
+
* `'#uds/components'` so it resolves to the codegen-emitted
|
|
13
|
+
* `.uds/components.tsx` barrel. The authoring file
|
|
14
|
+
* (`apps/<app>/src/uds/components/<name>.tsx`) is only read by
|
|
15
|
+
* codegen — production renders the downleveled FC.
|
|
16
|
+
*
|
|
17
|
+
* 2. **Static primitive JSX lowering** — when a JSX site references a
|
|
18
|
+
* registered primitive (`type: 'primitive'` + non-empty
|
|
19
|
+
* `propBindings` in the manifest), try `lowerNewApiPrimitiveJsx`
|
|
20
|
+
* to bake a literal `className="bg-primary"` into the output.
|
|
21
|
+
* Skips the codegen FC's runtime className concatenation entirely
|
|
22
|
+
* in the all-static case. Falls through to the runtime FC when
|
|
23
|
+
* lowering bails.
|
|
24
|
+
*
|
|
25
|
+
* 3. **Dev-mode metadata** — inject `data-uds-id` + `data-uds-source`
|
|
26
|
+
* attrs onto every UDS JSX site so devtools can map elements
|
|
27
|
+
* back to source positions. Off in production.
|
|
28
|
+
*
|
|
29
|
+
* Anything else (motion wiring, composite expansion, slot resolution,
|
|
30
|
+
* styler tracking) is owned by codegen and intentionally absent here.
|
|
31
|
+
*/
|
|
4
32
|
declare const transformLoader: LoaderDefinitionFunction;
|
|
5
|
-
declare const normal: LoaderDefinitionFunction<{}, {}>;
|
|
33
|
+
declare const normal: LoaderDefinitionFunction<{}, {}>; //#endregion
|
|
6
34
|
//#endregion
|
|
7
35
|
export { normal, transformLoader };
|