@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,8 +1,8 @@
|
|
|
1
|
+
import { isTokenAcceptedByProperty } from "./propertyAcceptedTypes.js";
|
|
1
2
|
import { safeTokenName } from "../../utils/dist/string-utils/cssVar.js";
|
|
2
3
|
import "../../utils/dist/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { sniffTokenTypeFromValue } from "./resolveTokenTypes.js";
|
|
4
|
+
import { resolveTokenValue } from "./refs.js";
|
|
5
|
+
import { sniffTokenTypeFromValue } from "./sniffTokenType.js";
|
|
6
6
|
//#region ../config/dist/resolveStyleProp.js
|
|
7
7
|
/**
|
|
8
8
|
* Resolve a {@link StyleProp} authored via `defineStyleProp` against the
|
|
@@ -54,8 +54,7 @@ function looksLikeShadow(value) {
|
|
|
54
54
|
/**
|
|
55
55
|
* Detect a token's CSS value type. Resolution order:
|
|
56
56
|
* 1. Per-token `type` override.
|
|
57
|
-
* 2.
|
|
58
|
-
* 3. Group-level `type`.
|
|
57
|
+
* 2. Group-level `type`.
|
|
59
58
|
*
|
|
60
59
|
* When the resolved type is `'length-percentage'` and the raw value ends in
|
|
61
60
|
* `%`, narrow to `'percentage'`; otherwise narrow to `'length'`. When the
|
|
@@ -63,9 +62,7 @@ function looksLikeShadow(value) {
|
|
|
63
62
|
* ratio-shaped values to `'ratio'`.
|
|
64
63
|
*
|
|
65
64
|
* Exported so Studio (and any other runtime consumer) can resolve a cell's
|
|
66
|
-
* effective `CssValueTypeName
|
|
67
|
-
* for `RegisteredTokenGroupMeta`. UDS-1600 tracks removing the remaining
|
|
68
|
-
* mirrored codegen resolver once the token type API settles.
|
|
65
|
+
* effective `CssValueTypeName`.
|
|
69
66
|
*
|
|
70
67
|
* The input shapes ({@link DetectTokenValueTypeInput} /
|
|
71
68
|
* {@link DetectTokenValueTypeGroup}) are intentionally minimal: the resolver
|
|
@@ -80,7 +77,8 @@ function detectTokenValueType(token, group) {
|
|
|
80
77
|
if (token.type) resolved = tokenTypeToValueType(token.type);
|
|
81
78
|
else {
|
|
82
79
|
const sniffed = sniffTokenTypeFromValue(token.value);
|
|
83
|
-
resolved = sniffed ? tokenTypeToValueType(sniffed) :
|
|
80
|
+
resolved = sniffed ? tokenTypeToValueType(sniffed) : void 0;
|
|
81
|
+
if (resolved === void 0 && group.type) resolved = tokenTypeToValueType(group.type);
|
|
84
82
|
}
|
|
85
83
|
if (resolved === "length-percentage") {
|
|
86
84
|
const trimmed = token.value.trim();
|
|
@@ -95,27 +93,27 @@ function detectTokenValueType(token, group) {
|
|
|
95
93
|
}
|
|
96
94
|
return resolved;
|
|
97
95
|
}
|
|
98
|
-
const REF_RE = /^\{([^.{}]+)(?:\.([^.{}]+))?\}$/;
|
|
99
96
|
/**
|
|
100
|
-
*
|
|
101
|
-
* `
|
|
102
|
-
*
|
|
97
|
+
* Split a `tokenGroup` marker's `group` field into `{ group, key? }`.
|
|
98
|
+
* Plain `'spacing'` resolves the whole group; `'spacing/4'` picks one
|
|
99
|
+
* token from it.
|
|
103
100
|
*/
|
|
104
|
-
function
|
|
105
|
-
const
|
|
106
|
-
if (
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
key
|
|
112
|
-
} : { group };
|
|
101
|
+
function parseGroupPath(raw) {
|
|
102
|
+
const slash = raw.indexOf("/");
|
|
103
|
+
if (slash <= 0 || slash >= raw.length - 1) return { group: raw };
|
|
104
|
+
return {
|
|
105
|
+
group: raw.slice(0, slash),
|
|
106
|
+
key: raw.slice(slash + 1)
|
|
107
|
+
};
|
|
113
108
|
}
|
|
114
109
|
function findGroup(atomic, name) {
|
|
115
110
|
return atomic.find((g) => g.namespace === name || g.cssPrefix === name);
|
|
116
111
|
}
|
|
117
|
-
function
|
|
118
|
-
return typeof entry === "object" && entry !== null && "
|
|
112
|
+
function isTokenGroupMarker(entry) {
|
|
113
|
+
return typeof entry === "object" && entry !== null && entry.__kind === "tokenGroup" && typeof entry.group === "string";
|
|
114
|
+
}
|
|
115
|
+
function isTokenMarker(entry) {
|
|
116
|
+
return typeof entry === "object" && entry !== null && entry.__kind === "token" && typeof entry.ref === "string";
|
|
119
117
|
}
|
|
120
118
|
/**
|
|
121
119
|
* Build `--{configPrefix}-{varPrefix}-{safeName}` (or omit the configPrefix
|
|
@@ -129,12 +127,16 @@ function resolveGroupTokens(group, cssProperty, configPrefix, namespace, skipPro
|
|
|
129
127
|
const varPrefix = group.cssPrefix ?? group.namespace ?? "";
|
|
130
128
|
const out = [];
|
|
131
129
|
for (const token of group.tokens) {
|
|
132
|
-
const
|
|
133
|
-
|
|
130
|
+
const tokenValue = resolveTokenValue(token.value, configPrefix);
|
|
131
|
+
const valueType = detectTokenValueType({
|
|
132
|
+
...token,
|
|
133
|
+
value: tokenValue
|
|
134
|
+
}, group);
|
|
135
|
+
if (!skipPropertyFilter && !isTokenAcceptedByProperty(cssProperty, valueType, tokenValue)) continue;
|
|
134
136
|
const safeName = safeTokenName(token.name);
|
|
135
137
|
out.push({
|
|
136
138
|
name: token.name,
|
|
137
|
-
value:
|
|
139
|
+
value: tokenValue,
|
|
138
140
|
valueType,
|
|
139
141
|
group: groupName,
|
|
140
142
|
namespace,
|
|
@@ -156,6 +158,7 @@ function resolveGroupTokens(group, cssProperty, configPrefix, namespace, skipPro
|
|
|
156
158
|
*/
|
|
157
159
|
function resolveStyleProp(propName, styleProp, config) {
|
|
158
160
|
const { cssProperty, classPrefix, values, arbitrary, metadata } = styleProp;
|
|
161
|
+
const transform = styleProp.transform;
|
|
159
162
|
const pairedWith = styleProp._pairedWith;
|
|
160
163
|
const separator = styleProp._separator;
|
|
161
164
|
const primaryCssProperty = Array.isArray(cssProperty) ? cssProperty[0] : cssProperty;
|
|
@@ -166,27 +169,32 @@ function resolveStyleProp(propName, styleProp, config) {
|
|
|
166
169
|
for (const entry of values ?? []) {
|
|
167
170
|
if (typeof entry === "number") {
|
|
168
171
|
if (!literals.includes(entry)) literals.push(entry);
|
|
169
|
-
literalAliases[String(entry)] = String(entry);
|
|
172
|
+
literalAliases[String(entry)] = transform ? transform(entry) : String(entry);
|
|
170
173
|
continue;
|
|
171
174
|
}
|
|
172
175
|
if (typeof entry === "string") {
|
|
173
|
-
|
|
174
|
-
if (
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
176
|
+
literals.push(entry);
|
|
177
|
+
if (transform) literalAliases[entry] = transform(entry);
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
if (isTokenGroupMarker(entry)) {
|
|
181
|
+
const parsed = parseGroupPath(entry.group);
|
|
178
182
|
const group = findGroup(config.atomic, parsed.group);
|
|
179
183
|
if (!group) continue;
|
|
180
184
|
if (parsed.key !== void 0) {
|
|
181
185
|
const token = group.tokens.find((t) => t.name === parsed.key);
|
|
182
186
|
if (!token) continue;
|
|
183
|
-
const
|
|
184
|
-
|
|
187
|
+
const tokenValue = resolveTokenValue(token.value, configPrefix);
|
|
188
|
+
const valueType = detectTokenValueType({
|
|
189
|
+
...token,
|
|
190
|
+
value: tokenValue
|
|
191
|
+
}, group);
|
|
192
|
+
if (!pairedWith && !isTokenAcceptedByProperty(primaryCssProperty, valueType, tokenValue)) continue;
|
|
185
193
|
const safeName = safeTokenName(token.name);
|
|
186
194
|
const varPrefix = group.cssPrefix ?? group.namespace ?? parsed.group;
|
|
187
195
|
tokens.push({
|
|
188
196
|
name: token.name,
|
|
189
|
-
value:
|
|
197
|
+
value: tokenValue,
|
|
190
198
|
valueType,
|
|
191
199
|
group: group.namespace ?? group.cssPrefix ?? parsed.group,
|
|
192
200
|
qualifiedName: token.name,
|
|
@@ -197,12 +205,12 @@ function resolveStyleProp(propName, styleProp, config) {
|
|
|
197
205
|
} else tokens.push(...resolveGroupTokens(group, primaryCssProperty, configPrefix, void 0, pairedWith !== void 0));
|
|
198
206
|
continue;
|
|
199
207
|
}
|
|
200
|
-
if (
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
const group = findGroup(config.atomic,
|
|
208
|
+
if (typeof entry === "object" && entry !== null && "ref" in entry && "namespace" in entry && isTokenGroupMarker(entry.ref)) {
|
|
209
|
+
const ns = entry.namespace;
|
|
210
|
+
const ref = entry.ref;
|
|
211
|
+
const group = findGroup(config.atomic, ref.group);
|
|
204
212
|
if (!group) continue;
|
|
205
|
-
tokens.push(...resolveGroupTokens(group, primaryCssProperty, configPrefix,
|
|
213
|
+
tokens.push(...resolveGroupTokens(group, primaryCssProperty, configPrefix, ns, pairedWith !== void 0));
|
|
206
214
|
continue;
|
|
207
215
|
}
|
|
208
216
|
if (typeof entry === "object" && entry !== null && "alias" in entry && "value" in entry) {
|
|
@@ -210,7 +218,8 @@ function resolveStyleProp(propName, styleProp, config) {
|
|
|
210
218
|
const aliasKey = aliasEntry.alias;
|
|
211
219
|
const aliasMapKey = typeof aliasKey === "string" ? aliasKey : String(aliasKey);
|
|
212
220
|
let resolvedValue;
|
|
213
|
-
if (
|
|
221
|
+
if (isTokenMarker(aliasEntry.value)) resolvedValue = resolveTokenValue(aliasEntry.value, configPrefix);
|
|
222
|
+
else if (typeof aliasEntry.value === "string") resolvedValue = aliasEntry.value;
|
|
214
223
|
else resolvedValue = aliasEntry.value;
|
|
215
224
|
if (!literals.includes(aliasKey)) literals.push(aliasKey);
|
|
216
225
|
literalAliases[aliasMapKey] = resolvedValue;
|
|
@@ -231,5 +240,21 @@ function resolveStyleProp(propName, styleProp, config) {
|
|
|
231
240
|
metadata: metadata ?? {}
|
|
232
241
|
};
|
|
233
242
|
}
|
|
243
|
+
/**
|
|
244
|
+
* Walk a resolved config's `resolvedStyleProps` and return the
|
|
245
|
+
* color-prop → opacity-sibling-prop map. Built from each opacity
|
|
246
|
+
* sibling's `pairedWith` field (set by the resolver when expanding a
|
|
247
|
+
* `.withOpacity({ as })` parent). Returns an empty object when no
|
|
248
|
+
* pairings exist.
|
|
249
|
+
*
|
|
250
|
+
* Replaces the legacy `colorPropToOpacityProp` table that lived in
|
|
251
|
+
* `@uds/core` — consumers (codegen safelist generation, runtime
|
|
252
|
+
* `getStyles`, loader style-transform) should call this instead.
|
|
253
|
+
*/
|
|
254
|
+
function getColorOpacityMap(config) {
|
|
255
|
+
const map = {};
|
|
256
|
+
for (const resolved of config.resolvedStyleProps ?? []) if (resolved.pairedWith) map[resolved.pairedWith] = resolved.propName;
|
|
257
|
+
return map;
|
|
258
|
+
}
|
|
234
259
|
//#endregion
|
|
235
|
-
export { detectTokenValueType, resolveStyleProp };
|
|
260
|
+
export { detectTokenValueType, getColorOpacityMap, resolveStyleProp };
|
|
@@ -1,9 +1,37 @@
|
|
|
1
|
+
//#region ../config/dist/runtime-registry.js
|
|
2
|
+
let registeredStyleProps = /* @__PURE__ */ new Map();
|
|
3
|
+
let registeredComposites = /* @__PURE__ */ new Map();
|
|
1
4
|
/**
|
|
2
5
|
* Replace the active style-prop registry. Called by `resolveConfig`
|
|
3
6
|
* with the full `config.styleProps` map (keyed by JSX prop name).
|
|
4
7
|
*/
|
|
5
8
|
function setRegisteredStyleProps(entries) {
|
|
6
|
-
new Map(Object.entries(entries));
|
|
9
|
+
registeredStyleProps = new Map(Object.entries(entries));
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Look up a registered style prop by JSX prop name (the key used in
|
|
13
|
+
* `.registerStyleProps({ bg: ... })`). Returns `undefined` if no prop
|
|
14
|
+
* was registered under that name.
|
|
15
|
+
*/
|
|
16
|
+
function getRegisteredStyleProp(name) {
|
|
17
|
+
return registeredStyleProps.get(name);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Replace the active composite-style registry. Called by
|
|
21
|
+
* `resolveConfig` with the full `config.compositeStyles` map.
|
|
22
|
+
* Composites authored via `.defineCompositeStyles({...})` or
|
|
23
|
+
* `.registerComposites({...})` both populate the same map.
|
|
24
|
+
*/
|
|
25
|
+
function setRegisteredComposites(entries) {
|
|
26
|
+
registeredComposites = new Map(Object.entries(entries));
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Look up a registered composite by name (the brace-stripped form —
|
|
30
|
+
* `'textVariant'`, not `'{textVariant}'`). Returns `undefined` if no
|
|
31
|
+
* composite was registered under that name.
|
|
32
|
+
*/
|
|
33
|
+
function getRegisteredComposite(name) {
|
|
34
|
+
return registeredComposites.get(name);
|
|
7
35
|
}
|
|
8
36
|
//#endregion
|
|
9
|
-
export { setRegisteredStyleProps };
|
|
37
|
+
export { getRegisteredComposite, getRegisteredStyleProp, setRegisteredComposites, setRegisteredStyleProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { CompositeStylesConfig } from "./defineCompositeStyle.js";
|
|
1
2
|
import { VarsConfig } from "./types.js";
|
|
2
|
-
import { AtomicToken,
|
|
3
|
-
import { CompositeStylesConfig } from "@uds/types";
|
|
3
|
+
import { AtomicToken, ModeGroup, ModifierDef, MotionPresetsDef, UdsConfig } from "./createConfig.js";
|
|
4
4
|
|
|
5
5
|
//#region ../config/dist/serialize.d.ts
|
|
6
6
|
//#region src/serialize.d.ts
|
|
@@ -11,55 +11,29 @@ type TokenRef = {
|
|
|
11
11
|
interface SerializedConfig {
|
|
12
12
|
modes: ModeGroup[];
|
|
13
13
|
modifiers?: ModifierDef[];
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
16
|
-
* declarations downstream. `atomic` carries derived (property × token)
|
|
17
|
-
* data for utility-class generation; `vars` carries the original
|
|
18
|
-
* namespace-keyed input. New code should rely on `vars`; `atomic` is
|
|
19
|
-
* still emitted for legacy consumers.
|
|
20
|
-
*/
|
|
14
|
+
/** Verbatim `defineVars` input — the authoritative source of CSS variable
|
|
15
|
+
* declarations. */
|
|
21
16
|
vars?: VarsConfig;
|
|
17
|
+
/** Derived (property × token) data for utility-class generation. */
|
|
22
18
|
atomic: AtomicToken<ModifierNameShape>[];
|
|
23
19
|
compositeStyles?: CompositeStylesConfig;
|
|
24
|
-
/**
|
|
25
|
-
* Legacy field name. Kept on the wire format so older serialized configs
|
|
26
|
-
* (and `draft_base_configs.baseConfig` blobs) continue to deserialize
|
|
27
|
-
* until they're rewritten. New code should populate `compositeStyles`.
|
|
28
|
-
*/
|
|
29
|
-
macros?: Record<string, Record<string, Record<string, unknown>>>;
|
|
30
20
|
motion?: MotionPresetsDef;
|
|
31
|
-
components: SerializedComponentsDef;
|
|
32
21
|
globalStyles?: Record<string, Record<string, SerializedValue>>;
|
|
33
|
-
examples?: Record<string, ExampleDef>;
|
|
34
22
|
preflight: boolean;
|
|
35
23
|
prefix: string;
|
|
36
|
-
presetTokenNames?: Record<string, string[]>;
|
|
37
24
|
}
|
|
38
25
|
type SerializedValue = string | TokenRef | {
|
|
39
26
|
[key: string]: SerializedValue;
|
|
40
27
|
};
|
|
41
|
-
type SerializedSlotStyles = Record<string, SerializedValue>;
|
|
42
|
-
type SerializedComponentConfig = {
|
|
43
|
-
base: Record<string, SerializedSlotStyles>;
|
|
44
|
-
variants?: Record<string, Record<string, Record<string, SerializedSlotStyles>>>;
|
|
45
|
-
compoundVariants?: Array<{
|
|
46
|
-
conditions: Record<string, string>;
|
|
47
|
-
styles: Record<string, SerializedSlotStyles>;
|
|
48
|
-
}>;
|
|
49
|
-
defaultVariants?: Record<string, string>;
|
|
50
|
-
};
|
|
51
|
-
type SerializedComponentsDef = Record<string, SerializedComponentConfig>;
|
|
52
28
|
/**
|
|
53
29
|
* Build a reverse map from `var(--prefix-xxx-yyy)` strings back to
|
|
54
30
|
* `propName.tokenName` reference paths.
|
|
55
31
|
*/
|
|
56
32
|
declare function buildReverseMap(atomic: AtomicToken<ModifierNameShape>[], configPrefix: string): Map<string, string>;
|
|
57
33
|
/**
|
|
58
|
-
* Serialize a UdsConfig for database storage.
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* `{ $ref: "propName.tokenName" }` markers so the authoring intent survives
|
|
62
|
-
* a round-trip through JSON.
|
|
34
|
+
* Serialize a UdsConfig for database storage. Walks global styles and
|
|
35
|
+
* replaces known `var()` strings with `{ $ref: "propName.tokenName" }`
|
|
36
|
+
* markers so the authoring intent survives a JSON round-trip.
|
|
63
37
|
*/
|
|
64
38
|
declare function serializeConfig(config: UdsConfig): SerializedConfig;
|
|
65
39
|
/**
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { safeTokenName } from "../../utils/dist/string-utils/cssVar.js";
|
|
2
2
|
import "../../utils/dist/index.js";
|
|
3
|
-
import { getConfigurablePropMapping } from "../../core/dist/configurable-prop-helpers.js";
|
|
4
|
-
import "../../core/dist/index.js";
|
|
5
3
|
import { buildTokenReference, createConfigBuilder, resolveConfig } from "./createConfig.js";
|
|
6
4
|
//#region ../config/dist/serialize.js
|
|
7
5
|
/**
|
|
@@ -10,21 +8,6 @@ import { buildTokenReference, createConfigBuilder, resolveConfig } from "./creat
|
|
|
10
8
|
* serializeConfig: UdsConfig → SerializedConfig (var() → $ref markers)
|
|
11
9
|
* deserializeConfig: SerializedConfig → UdsConfig ($ref markers → var())
|
|
12
10
|
*/
|
|
13
|
-
/**
|
|
14
|
-
* Migrate the legacy serialized `macros` field into the new
|
|
15
|
-
* `compositeStyles` shape. Each old key (`elevation`) becomes a
|
|
16
|
-
* `{ label, styles }` def. Returns an empty object when there's
|
|
17
|
-
* nothing to migrate so the field is always populated.
|
|
18
|
-
*/
|
|
19
|
-
function upgradeLegacyMacros(legacy) {
|
|
20
|
-
if (!legacy) return {};
|
|
21
|
-
const out = {};
|
|
22
|
-
for (const [name, variants] of Object.entries(legacy)) out[name] = {
|
|
23
|
-
label: name,
|
|
24
|
-
styles: variants
|
|
25
|
-
};
|
|
26
|
-
return out;
|
|
27
|
-
}
|
|
28
11
|
function isTokenRef(val) {
|
|
29
12
|
return typeof val === "object" && val !== null && "$ref" in val && typeof val.$ref === "string";
|
|
30
13
|
}
|
|
@@ -35,7 +18,7 @@ function isTokenRef(val) {
|
|
|
35
18
|
function buildReverseMap(atomic, configPrefix) {
|
|
36
19
|
const map = /* @__PURE__ */ new Map();
|
|
37
20
|
for (const token of atomic) for (const prop of token.properties) {
|
|
38
|
-
const varPrefix = token.cssPrefix ??
|
|
21
|
+
const varPrefix = token.cssPrefix ?? token.properties[0];
|
|
39
22
|
if (!varPrefix) continue;
|
|
40
23
|
for (const t of token.tokens) {
|
|
41
24
|
const safeName = safeTokenName(t.name);
|
|
@@ -46,8 +29,8 @@ function buildReverseMap(atomic, configPrefix) {
|
|
|
46
29
|
return map;
|
|
47
30
|
}
|
|
48
31
|
/**
|
|
49
|
-
* Walk an object, transforming every string leaf with `fn`.
|
|
50
|
-
*
|
|
32
|
+
* Walk an object, transforming every string leaf with `fn`. Nested
|
|
33
|
+
* objects (pseudo-state blocks like `_hover: { ... }`) are recursed.
|
|
51
34
|
*/
|
|
52
35
|
function walkStrings(obj, fn) {
|
|
53
36
|
const result = {};
|
|
@@ -72,11 +55,9 @@ function resolveRefs(obj, tokenRef) {
|
|
|
72
55
|
return result;
|
|
73
56
|
}
|
|
74
57
|
/**
|
|
75
|
-
* Serialize a UdsConfig for database storage.
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* `{ $ref: "propName.tokenName" }` markers so the authoring intent survives
|
|
79
|
-
* a round-trip through JSON.
|
|
58
|
+
* Serialize a UdsConfig for database storage. Walks global styles and
|
|
59
|
+
* replaces known `var()` strings with `{ $ref: "propName.tokenName" }`
|
|
60
|
+
* markers so the authoring intent survives a JSON round-trip.
|
|
80
61
|
*/
|
|
81
62
|
function serializeConfig(config) {
|
|
82
63
|
const data = resolveConfig(config);
|
|
@@ -85,23 +66,6 @@ function serializeConfig(config) {
|
|
|
85
66
|
const ref = reverseMap.get(val);
|
|
86
67
|
return ref ? { $ref: ref } : val;
|
|
87
68
|
};
|
|
88
|
-
const components = {};
|
|
89
|
-
for (const [compName, compConfig] of Object.entries(data.components)) {
|
|
90
|
-
const serialized = { base: {} };
|
|
91
|
-
for (const [slot, styles] of Object.entries(compConfig.base ?? {})) serialized.base[slot] = walkStrings(styles, replaceVars);
|
|
92
|
-
if (compConfig.variants) {
|
|
93
|
-
serialized.variants = {};
|
|
94
|
-
for (const [axis, values] of Object.entries(compConfig.variants)) {
|
|
95
|
-
serialized.variants[axis] = {};
|
|
96
|
-
for (const [value, slotOverrides] of Object.entries(values)) {
|
|
97
|
-
serialized.variants[axis][value] = {};
|
|
98
|
-
for (const [slot, styles] of Object.entries(slotOverrides)) serialized.variants[axis][value][slot] = walkStrings(styles, replaceVars);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
if (compConfig.defaultVariants) serialized.defaultVariants = compConfig.defaultVariants;
|
|
103
|
-
components[compName] = serialized;
|
|
104
|
-
}
|
|
105
69
|
const globalStyles = {};
|
|
106
70
|
if (data.globalStyles) for (const [selector, styles] of Object.entries(data.globalStyles)) globalStyles[selector] = walkStrings(styles, replaceVars);
|
|
107
71
|
return {
|
|
@@ -111,12 +75,9 @@ function serializeConfig(config) {
|
|
|
111
75
|
atomic: data.atomic,
|
|
112
76
|
compositeStyles: Object.keys(data.compositeStyles).length > 0 ? data.compositeStyles : void 0,
|
|
113
77
|
motion: Object.keys(data.motion).length > 0 ? data.motion : void 0,
|
|
114
|
-
components,
|
|
115
78
|
globalStyles: Object.keys(globalStyles).length > 0 ? globalStyles : void 0,
|
|
116
|
-
examples: data.examples && Object.keys(data.examples).length > 0 ? data.examples : void 0,
|
|
117
79
|
preflight: data.preflight,
|
|
118
|
-
prefix: data.prefix
|
|
119
|
-
presetTokenNames: data.presetTokenNames && Object.keys(data.presetTokenNames).length > 0 ? data.presetTokenNames : void 0
|
|
80
|
+
prefix: data.prefix
|
|
120
81
|
};
|
|
121
82
|
}
|
|
122
83
|
/**
|
|
@@ -127,45 +88,23 @@ function serializeConfig(config) {
|
|
|
127
88
|
*/
|
|
128
89
|
function deserializeConfig(data) {
|
|
129
90
|
const tokenRef = buildTokenReference(data.atomic, data.prefix);
|
|
130
|
-
const components = {};
|
|
131
|
-
for (const [compName, compConfig] of Object.entries(data.components)) {
|
|
132
|
-
const resolved = { base: {} };
|
|
133
|
-
const base = {};
|
|
134
|
-
for (const [slot, styles] of Object.entries(compConfig.base ?? {})) base[slot] = resolveRefs(styles, tokenRef);
|
|
135
|
-
resolved.base = base;
|
|
136
|
-
if (compConfig.variants) {
|
|
137
|
-
const variants = {};
|
|
138
|
-
for (const [axis, values] of Object.entries(compConfig.variants)) {
|
|
139
|
-
variants[axis] = {};
|
|
140
|
-
for (const [value, slotOverrides] of Object.entries(values)) {
|
|
141
|
-
variants[axis][value] = {};
|
|
142
|
-
for (const [slot, styles] of Object.entries(slotOverrides)) variants[axis][value][slot] = resolveRefs(styles, tokenRef);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
resolved.variants = variants;
|
|
146
|
-
}
|
|
147
|
-
if (compConfig.defaultVariants) resolved.defaultVariants = compConfig.defaultVariants;
|
|
148
|
-
components[compName] = resolved;
|
|
149
|
-
}
|
|
150
91
|
let config = createConfigBuilder({
|
|
151
92
|
modes: data.modes,
|
|
152
93
|
modifiers: data.modifiers ?? [],
|
|
153
94
|
vars: data.vars,
|
|
154
95
|
atomic: data.atomic,
|
|
155
|
-
compositeStyles: data.compositeStyles ??
|
|
96
|
+
compositeStyles: data.compositeStyles ?? {},
|
|
156
97
|
motion: data.motion ?? {},
|
|
157
|
-
components,
|
|
98
|
+
components: {},
|
|
158
99
|
preflight: data.preflight,
|
|
159
100
|
prefix: data.prefix ?? "uds",
|
|
160
|
-
globalStyles: {}
|
|
161
|
-
presetTokenNames: data.presetTokenNames
|
|
101
|
+
globalStyles: {}
|
|
162
102
|
});
|
|
163
103
|
if (data.globalStyles && Object.keys(data.globalStyles).length > 0) {
|
|
164
104
|
const globalStyles = {};
|
|
165
105
|
for (const [selector, styles] of Object.entries(data.globalStyles)) globalStyles[selector] = resolveRefs(styles, tokenRef);
|
|
166
106
|
config = config.defineGlobalStyles(globalStyles);
|
|
167
107
|
}
|
|
168
|
-
if (data.examples) for (const [name, examples] of Object.entries(data.examples)) config = config.defineExample(name, examples);
|
|
169
108
|
return config;
|
|
170
109
|
}
|
|
171
110
|
//#endregion
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TokenType } from "./types.js";
|
|
2
|
+
|
|
3
|
+
//#region ../config/dist/sniffTokenType.d.ts
|
|
4
|
+
//#region src/sniffTokenType.d.ts
|
|
5
|
+
declare function sniffTokenTypeFromValue(value: string): TokenType | undefined; //#endregion
|
|
6
|
+
//#endregion
|
|
7
|
+
export { sniffTokenTypeFromValue };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
//#region ../config/dist/sniffTokenType.js
|
|
2
|
+
const CSS_WIDE_KEYWORDS = new Set([
|
|
3
|
+
"inherit",
|
|
4
|
+
"initial",
|
|
5
|
+
"unset",
|
|
6
|
+
"revert",
|
|
7
|
+
"revert-layer",
|
|
8
|
+
"auto",
|
|
9
|
+
"none",
|
|
10
|
+
"currentColor",
|
|
11
|
+
"currentcolor",
|
|
12
|
+
"transparent"
|
|
13
|
+
]);
|
|
14
|
+
const HEX_COLOR_RE = /^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;
|
|
15
|
+
const COLOR_FUNCTION_RE = /^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix|light-dark)\s*\(/i;
|
|
16
|
+
const NAMED_COLOR_KEYWORDS = new Set([
|
|
17
|
+
"aliceblue",
|
|
18
|
+
"antiquewhite",
|
|
19
|
+
"aqua",
|
|
20
|
+
"aquamarine",
|
|
21
|
+
"azure",
|
|
22
|
+
"beige",
|
|
23
|
+
"bisque",
|
|
24
|
+
"black",
|
|
25
|
+
"blue",
|
|
26
|
+
"brown",
|
|
27
|
+
"crimson",
|
|
28
|
+
"cyan",
|
|
29
|
+
"fuchsia",
|
|
30
|
+
"gold",
|
|
31
|
+
"gray",
|
|
32
|
+
"grey",
|
|
33
|
+
"green",
|
|
34
|
+
"indigo",
|
|
35
|
+
"lime",
|
|
36
|
+
"magenta",
|
|
37
|
+
"maroon",
|
|
38
|
+
"navy",
|
|
39
|
+
"olive",
|
|
40
|
+
"orange",
|
|
41
|
+
"pink",
|
|
42
|
+
"purple",
|
|
43
|
+
"red",
|
|
44
|
+
"silver",
|
|
45
|
+
"teal",
|
|
46
|
+
"violet",
|
|
47
|
+
"white",
|
|
48
|
+
"yellow"
|
|
49
|
+
]);
|
|
50
|
+
const NUMBER_RE_SRC = "(?:\\d+(?:\\.\\d+)?|\\.\\d+)";
|
|
51
|
+
const DIMENSION_RE = new RegExp(`^-?${NUMBER_RE_SRC}(?:px|rem|em|%|vh|vw|vmin|vmax|vi|vb|svh|svw|lvh|lvw|dvh|dvw|ch|ex|cap|ic|lh|rlh|pt|pc|in|cm|mm|q|fr|deg|turn|rad|grad)$`, "i");
|
|
52
|
+
const DURATION_RE = new RegExp(`^-?${NUMBER_RE_SRC}(?:ms|s)$`, "i");
|
|
53
|
+
const PURE_NUMBER_RE = new RegExp(`^-?${NUMBER_RE_SRC}$`);
|
|
54
|
+
function sniffTokenTypeFromValue(value) {
|
|
55
|
+
const v = value.trim();
|
|
56
|
+
if (v.length === 0) return void 0;
|
|
57
|
+
if (CSS_WIDE_KEYWORDS.has(v)) return "string";
|
|
58
|
+
if (v.startsWith("var(")) return void 0;
|
|
59
|
+
if (COLOR_FUNCTION_RE.test(v)) return "color";
|
|
60
|
+
if (HEX_COLOR_RE.test(v)) return "color";
|
|
61
|
+
if (NAMED_COLOR_KEYWORDS.has(v.toLowerCase())) return "color";
|
|
62
|
+
if (DURATION_RE.test(v)) return "duration";
|
|
63
|
+
if (DIMENSION_RE.test(v)) return "dimension";
|
|
64
|
+
if (PURE_NUMBER_RE.test(v)) return "number";
|
|
65
|
+
}
|
|
66
|
+
//#endregion
|
|
67
|
+
export { sniffTokenTypeFromValue };
|
|
@@ -1 +1,75 @@
|
|
|
1
|
-
|
|
1
|
+
import { UdsConfigData } from "./createConfig.js";
|
|
2
|
+
|
|
3
|
+
//#region ../config/dist/style-prop-runtime.d.ts
|
|
4
|
+
//#region src/style-prop-runtime.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Serialized lookup data the runtime consumes. Built once per config (per
|
|
7
|
+
* app or per preview-bundle) by `buildStylePropRuntime`. Plain objects so
|
|
8
|
+
* the whole thing serializes to JSON for codegen embedding.
|
|
9
|
+
*/
|
|
10
|
+
interface StylePropRuntimeData {
|
|
11
|
+
/** propName → class-generation info. */
|
|
12
|
+
readonly styleProps: Readonly<Record<string, StylePropEntry>>;
|
|
13
|
+
/** modifier-prop name (with leading underscore) → resolved selector. */
|
|
14
|
+
readonly modifiers: Readonly<Record<string, ResolvedModifier>>;
|
|
15
|
+
/**
|
|
16
|
+
* Composite group name → variant key → expanded style-prop map.
|
|
17
|
+
* `<Box elevation="1" />` → look up `composites.elevation['1']`, merge
|
|
18
|
+
* into the prop bundle, add the marker class `elevation-1`.
|
|
19
|
+
*/
|
|
20
|
+
readonly composites: Readonly<Record<string, Readonly<Record<string, Readonly<Record<string, unknown>>>>>>;
|
|
21
|
+
}
|
|
22
|
+
interface StylePropEntry {
|
|
23
|
+
/** Class prefix the prop emits (`bg`, `p`, `rounded`). */
|
|
24
|
+
readonly classPrefix: string;
|
|
25
|
+
/** Primary CSS property — fan-out arrays collapse to first entry. */
|
|
26
|
+
readonly cssProperty: string;
|
|
27
|
+
/** The CSS variable prefix this prop's tokens live under. Used to build
|
|
28
|
+
* `var(--<prefix>-<token>)` for opacity-fallback rule injection. */
|
|
29
|
+
readonly varPrefix?: string;
|
|
30
|
+
/** Set on opacity sibling props. */
|
|
31
|
+
readonly pairedWith?: string;
|
|
32
|
+
/** Class-name separator for opacity (default `_`). */
|
|
33
|
+
readonly separator?: string;
|
|
34
|
+
/** Alias → CSS-value map for literal-alias entries (e.g. `col` → `column`). */
|
|
35
|
+
readonly literalAliases?: Readonly<Record<string, string>>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Selector contribution of a modifier. Two flavors:
|
|
39
|
+
* - `pseudo` — appends to the selector, like `:hover`.
|
|
40
|
+
* - `ancestor` — wraps the selector, like `.dark &` or `@media (...)`.
|
|
41
|
+
*/
|
|
42
|
+
interface ResolvedModifier {
|
|
43
|
+
readonly tailwindPrefix: string;
|
|
44
|
+
readonly kind: 'pseudo' | 'ancestor' | 'at-rule';
|
|
45
|
+
/** For pseudo: the suffix (`:hover`). For ancestor: the prefix selector (`.dark`). For at-rule: the rule (`(min-width: 640px)`). */
|
|
46
|
+
readonly selector: string;
|
|
47
|
+
}
|
|
48
|
+
/** Output of `processStyleProps`. */
|
|
49
|
+
interface ProcessStylePropsResult {
|
|
50
|
+
readonly className: string;
|
|
51
|
+
/** CSS rules the runtime needs to inject for arbitrary or fallback classes.
|
|
52
|
+
* Empty when all input resolves to build-time-known utilities. */
|
|
53
|
+
readonly dynamicRules: readonly DynamicRule[];
|
|
54
|
+
}
|
|
55
|
+
/** A single CSS rule the consumer should ensure exists in the document. */
|
|
56
|
+
interface DynamicRule {
|
|
57
|
+
/** Class name the rule targets. Already escaped per CSS spec. */
|
|
58
|
+
readonly className: string;
|
|
59
|
+
/** Full selector (`.cls`, `.dark .cls`, `.cls:hover`). */
|
|
60
|
+
readonly selector: string;
|
|
61
|
+
/** CSS property in kebab-case. */
|
|
62
|
+
readonly cssProperty: string;
|
|
63
|
+
readonly cssValue: string;
|
|
64
|
+
/** Wrapping at-rule, if any (e.g. `@media (min-width: 640px)`). */
|
|
65
|
+
readonly atRule?: string;
|
|
66
|
+
}
|
|
67
|
+
interface ProcessStylePropsOpts {
|
|
68
|
+
/** Compound modifier prefix accumulated through recursion. */
|
|
69
|
+
readonly modifier?: string;
|
|
70
|
+
}
|
|
71
|
+
declare const BUILT_IN_PSEUDO: Record<string, string>;
|
|
72
|
+
declare function buildStylePropRuntime(config: UdsConfigData): StylePropRuntimeData;
|
|
73
|
+
declare function processStyleProps(props: Record<string, unknown>, runtime: StylePropRuntimeData, opts?: ProcessStylePropsOpts): ProcessStylePropsResult; //#endregion
|
|
74
|
+
//#endregion
|
|
75
|
+
export { BUILT_IN_PSEUDO, DynamicRule, ProcessStylePropsOpts, ProcessStylePropsResult, ResolvedModifier, StylePropEntry, StylePropRuntimeData, buildStylePropRuntime, processStyleProps };
|