@yahoo/uds-v5-wip 1.60.0 → 1.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/dist/AssetGroup.d.ts +75 -0
- package/dist/config/dist/AssetGroup.js +114 -0
- package/dist/config/dist/Component.d.ts +309 -0
- package/dist/config/dist/Component.js +897 -0
- package/dist/config/dist/ComponentGroup.d.ts +21 -0
- package/dist/config/dist/ComponentGroup.js +46 -0
- package/dist/config/dist/CompositeStyle.d.ts +28 -0
- package/dist/config/dist/CompositeStyle.js +52 -0
- package/dist/config/dist/Config.d.ts +422 -0
- package/dist/config/dist/Config.js +1426 -0
- package/dist/config/dist/Mode.d.ts +42 -0
- package/dist/config/dist/Mode.js +81 -0
- package/dist/config/dist/Modifier.d.ts +52 -0
- package/dist/config/dist/Modifier.js +97 -0
- package/dist/config/dist/MotionDef.d.ts +50 -0
- package/dist/config/dist/MotionDef.js +97 -0
- package/dist/config/dist/Props.d.ts +284 -39
- package/dist/config/dist/Provider.d.ts +21 -0
- package/dist/config/dist/Provider.js +14 -0
- package/dist/config/dist/StyleProp.d.ts +113 -0
- package/dist/config/dist/StyleProp.js +197 -0
- package/dist/config/dist/Token.d.ts +56 -0
- package/dist/config/dist/Token.js +112 -0
- package/dist/config/dist/TokenGroup.d.ts +33 -0
- package/dist/config/dist/TokenGroup.js +68 -0
- package/dist/config/dist/asset-kind.d.ts +56 -0
- package/dist/config/dist/asset-kind.js +29 -0
- package/dist/config/dist/brands.d.ts +31 -0
- package/dist/config/dist/brands.js +20 -0
- package/dist/config/dist/captureCallerPath.d.ts +49 -0
- package/dist/config/dist/captureCallerPath.js +95 -0
- package/dist/config/dist/colorExpressions.d.ts +132 -0
- package/dist/config/dist/colorExpressions.js +148 -0
- package/dist/config/dist/defineAssetGroup.d.ts +158 -0
- package/dist/config/dist/defineAssetGroup.js +263 -0
- package/dist/config/dist/defineProvider.d.ts +30 -0
- package/dist/config/dist/defineProvider.js +60 -0
- package/dist/config/dist/element-marker.d.ts +55 -0
- package/dist/config/dist/element-marker.js +113 -0
- package/dist/config/dist/entity-utils.d.ts +27 -0
- package/dist/config/dist/entity-utils.js +105 -0
- package/dist/config/dist/factories.d.ts +707 -0
- package/dist/config/dist/factories.js +393 -0
- package/dist/config/dist/foreign-component-name.js +42 -0
- package/dist/config/dist/index.d.ts +31 -13
- package/dist/config/dist/index.js +26 -10
- package/dist/config/dist/interpolate.d.ts +21 -0
- package/dist/{foundational-presets/dist/motion.js → config/dist/interpolate.js} +1 -1
- package/dist/config/dist/markers.d.ts +218 -0
- package/dist/config/dist/markers.js +67 -0
- package/dist/config/dist/refs.d.ts +159 -0
- package/dist/config/dist/refs.js +98 -71
- package/dist/config/dist/token-override-rows.d.ts +67 -0
- package/dist/config/dist/token-override-rows.js +223 -0
- package/dist/config/dist/tokenValueType.js +138 -0
- package/dist/config/dist/types/css-properties.d.ts +233 -0
- package/dist/config/dist/types/css-property-keywords.d.ts +157 -0
- package/dist/config/dist/types/css-property-keywords.js +616 -0
- package/dist/config/dist/types/css-values.d.ts +20 -17
- package/dist/config/dist/types.d.ts +697 -64
- package/dist/config/dist/units.d.ts +15 -0
- package/dist/config/dist/units.js +16 -0
- package/dist/config.d.ts +32 -1562
- package/dist/config.js +28 -21
- package/dist/loader/dist/_virtual/_rolldown/runtime.js +1 -2
- package/dist/loader/dist/index.d.ts +2 -0
- package/dist/loader/dist/index.js +3 -0
- package/dist/loader/dist/loader/artifacts.js +26 -9
- package/dist/loader/dist/loader/babel-utils.js +1 -29
- package/dist/loader/dist/loader.d.ts +17 -1
- package/dist/loader/dist/loader.js +56 -339
- package/dist/loader/dist/next.d.ts +2 -1
- package/dist/loader/dist/next.js +3 -3
- package/dist/loader/dist/transform-runner.js +7 -0
- package/dist/loader/dist/unplugin.d.ts +27 -0
- package/dist/loader/dist/unplugin.js +52 -0
- package/dist/plugin.d.ts +2 -2
- package/dist/plugin.js +3 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/dist/index.js +1 -0
- package/dist/utils/dist/motion-utils/resolveMotionState.d.ts +35 -0
- package/dist/utils/dist/motion-utils/resolveMotionState.js +33 -0
- package/dist/utils/dist/string-utils/componentClassName.d.ts +41 -8
- package/dist/utils/dist/string-utils/componentClassName.js +48 -11
- package/dist/utils.d.ts +3 -2
- package/dist/utils.js +3 -2
- package/package.json +3 -51
- package/dist/components/accordion.config.d.ts +0 -2
- package/dist/components/accordion.config.js +0 -2
- package/dist/components/accordion.d.ts +0 -2
- package/dist/components/accordion.js +0 -2
- package/dist/components/alert.config.d.ts +0 -2
- package/dist/components/alert.config.js +0 -2
- package/dist/components/alert.d.ts +0 -2
- package/dist/components/alert.js +0 -2
- package/dist/components/anchor.config.d.ts +0 -2
- package/dist/components/anchor.config.js +0 -2
- package/dist/components/anchor.d.ts +0 -2
- package/dist/components/anchor.js +0 -2
- package/dist/components/article.d.ts +0 -2
- package/dist/components/article.js +0 -2
- package/dist/components/aside.d.ts +0 -2
- package/dist/components/aside.js +0 -2
- package/dist/components/avatar-group.config.d.ts +0 -2
- package/dist/components/avatar-group.config.js +0 -2
- package/dist/components/avatar-group.d.ts +0 -2
- package/dist/components/avatar-group.js +0 -2
- package/dist/components/avatar.config.d.ts +0 -2
- package/dist/components/avatar.config.js +0 -2
- package/dist/components/avatar.d.ts +0 -2
- package/dist/components/avatar.js +0 -2
- package/dist/components/badge.config.d.ts +0 -2
- package/dist/components/badge.config.js +0 -2
- package/dist/components/badge.d.ts +0 -2
- package/dist/components/badge.js +0 -2
- package/dist/components/box.d.ts +0 -2
- package/dist/components/box.js +0 -2
- package/dist/components/breadcrumb.config.d.ts +0 -2
- package/dist/components/breadcrumb.config.js +0 -2
- package/dist/components/breadcrumb.d.ts +0 -2
- package/dist/components/breadcrumb.js +0 -2
- package/dist/components/button.config.d.ts +0 -2
- package/dist/components/button.config.js +0 -2
- package/dist/components/button.d.ts +0 -2
- package/dist/components/button.js +0 -2
- package/dist/components/card.config.d.ts +0 -2
- package/dist/components/card.config.js +0 -2
- package/dist/components/card.d.ts +0 -2
- package/dist/components/card.js +0 -2
- package/dist/components/collapsible.config.d.ts +0 -2
- package/dist/components/collapsible.config.js +0 -2
- package/dist/components/collapsible.d.ts +0 -2
- package/dist/components/collapsible.js +0 -2
- package/dist/components/command.config.d.ts +0 -2
- package/dist/components/command.config.js +0 -2
- package/dist/components/command.d.ts +0 -2
- package/dist/components/command.js +0 -2
- package/dist/components/control-color.config.d.ts +0 -2
- package/dist/components/control-color.config.js +0 -2
- package/dist/components/control-color.d.ts +0 -2
- package/dist/components/control-color.js +0 -2
- package/dist/components/control-curve.config.d.ts +0 -2
- package/dist/components/control-curve.config.js +0 -2
- package/dist/components/control-curve.d.ts +0 -2
- package/dist/components/control-curve.js +0 -2
- package/dist/components/control-folder.config.d.ts +0 -2
- package/dist/components/control-folder.config.js +0 -2
- package/dist/components/control-folder.d.ts +0 -2
- package/dist/components/control-folder.js +0 -2
- package/dist/components/control-group.config.d.ts +0 -2
- package/dist/components/control-group.config.js +0 -2
- package/dist/components/control-group.d.ts +0 -2
- package/dist/components/control-group.js +0 -2
- package/dist/components/control-knob.config.d.ts +0 -2
- package/dist/components/control-knob.config.js +0 -2
- package/dist/components/control-knob.d.ts +0 -2
- package/dist/components/control-knob.js +0 -2
- package/dist/components/control-panel.config.d.ts +0 -2
- package/dist/components/control-panel.config.js +0 -2
- package/dist/components/control-panel.d.ts +0 -2
- package/dist/components/control-panel.js +0 -2
- package/dist/components/control-select.config.d.ts +0 -2
- package/dist/components/control-select.config.js +0 -2
- package/dist/components/control-select.d.ts +0 -2
- package/dist/components/control-select.js +0 -2
- package/dist/components/control-slider.config.d.ts +0 -2
- package/dist/components/control-slider.config.js +0 -2
- package/dist/components/control-slider.d.ts +0 -2
- package/dist/components/control-slider.js +0 -2
- package/dist/components/control-spring.config.d.ts +0 -2
- package/dist/components/control-spring.config.js +0 -2
- package/dist/components/control-spring.d.ts +0 -2
- package/dist/components/control-spring.js +0 -2
- package/dist/components/control-stepper.config.d.ts +0 -2
- package/dist/components/control-stepper.config.js +0 -2
- package/dist/components/control-stepper.d.ts +0 -2
- package/dist/components/control-stepper.js +0 -2
- package/dist/components/control-toggle.config.d.ts +0 -2
- package/dist/components/control-toggle.config.js +0 -2
- package/dist/components/control-toggle.d.ts +0 -2
- package/dist/components/control-toggle.js +0 -2
- package/dist/components/dist/_slots.js +0 -8
- package/dist/components/dist/accordion.config.d.ts +0 -431
- package/dist/components/dist/accordion.config.js +0 -81
- package/dist/components/dist/accordion.d.ts +0 -453
- package/dist/components/dist/accordion.js +0 -60
- package/dist/components/dist/alert.config.d.ts +0 -219
- package/dist/components/dist/alert.config.js +0 -54
- package/dist/components/dist/alert.d.ts +0 -230
- package/dist/components/dist/alert.js +0 -16
- package/dist/components/dist/anchor.config.d.ts +0 -250
- package/dist/components/dist/anchor.config.js +0 -22
- package/dist/components/dist/anchor.d.ts +0 -261
- package/dist/components/dist/anchor.js +0 -9
- package/dist/components/dist/article.d.ts +0 -11
- package/dist/components/dist/article.js +0 -9
- package/dist/components/dist/aside.d.ts +0 -11
- package/dist/components/dist/aside.js +0 -9
- package/dist/components/dist/avatar-group.config.d.ts +0 -315
- package/dist/components/dist/avatar-group.config.js +0 -33
- package/dist/components/dist/avatar-group.d.ts +0 -329
- package/dist/components/dist/avatar-group.js +0 -39
- package/dist/components/dist/avatar.config.d.ts +0 -197
- package/dist/components/dist/avatar.config.js +0 -49
- package/dist/components/dist/avatar.d.ts +0 -211
- package/dist/components/dist/avatar.js +0 -20
- package/dist/components/dist/badge.config.d.ts +0 -477
- package/dist/components/dist/badge.config.js +0 -99
- package/dist/components/dist/badge.d.ts +0 -489
- package/dist/components/dist/badge.js +0 -16
- package/dist/components/dist/box.d.ts +0 -14
- package/dist/components/dist/box.js +0 -9
- package/dist/components/dist/breadcrumb.config.d.ts +0 -390
- package/dist/components/dist/breadcrumb.config.js +0 -43
- package/dist/components/dist/breadcrumb.d.ts +0 -420
- package/dist/components/dist/breadcrumb.js +0 -119
- package/dist/components/dist/button.config.d.ts +0 -381
- package/dist/components/dist/button.config.js +0 -91
- package/dist/components/dist/button.d.ts +0 -403
- package/dist/components/dist/button.js +0 -35
- package/dist/components/dist/card.config.d.ts +0 -336
- package/dist/components/dist/card.config.js +0 -33
- package/dist/components/dist/card.d.ts +0 -352
- package/dist/components/dist/card.js +0 -27
- package/dist/components/dist/collapsible.config.d.ts +0 -45
- package/dist/components/dist/collapsible.config.js +0 -46
- package/dist/components/dist/collapsible.d.ts +0 -61
- package/dist/components/dist/collapsible.js +0 -38
- package/dist/components/dist/command.config.d.ts +0 -1613
- package/dist/components/dist/command.config.js +0 -170
- package/dist/components/dist/command.d.ts +0 -1722
- package/dist/components/dist/command.js +0 -341
- package/dist/components/dist/control-color.config.d.ts +0 -979
- package/dist/components/dist/control-color.config.js +0 -81
- package/dist/components/dist/control-color.d.ts +0 -995
- package/dist/components/dist/control-color.js +0 -64
- package/dist/components/dist/control-curve.config.d.ts +0 -18
- package/dist/components/dist/control-curve.config.js +0 -14
- package/dist/components/dist/control-curve.d.ts +0 -35
- package/dist/components/dist/control-curve.js +0 -81
- package/dist/components/dist/control-folder.config.d.ts +0 -177
- package/dist/components/dist/control-folder.config.js +0 -47
- package/dist/components/dist/control-folder.d.ts +0 -194
- package/dist/components/dist/control-folder.js +0 -41
- package/dist/components/dist/control-group.config.d.ts +0 -859
- package/dist/components/dist/control-group.config.js +0 -80
- package/dist/components/dist/control-group.d.ts +0 -881
- package/dist/components/dist/control-group.js +0 -89
- package/dist/components/dist/control-knob.config.d.ts +0 -792
- package/dist/components/dist/control-knob.config.js +0 -67
- package/dist/components/dist/control-knob.d.ts +0 -819
- package/dist/components/dist/control-knob.js +0 -148
- package/dist/components/dist/control-panel.config.d.ts +0 -402
- package/dist/components/dist/control-panel.config.js +0 -38
- package/dist/components/dist/control-panel.d.ts +0 -415
- package/dist/components/dist/control-panel.js +0 -22
- package/dist/components/dist/control-select.config.d.ts +0 -1176
- package/dist/components/dist/control-select.config.js +0 -102
- package/dist/components/dist/control-select.d.ts +0 -1200
- package/dist/components/dist/control-select.js +0 -63
- package/dist/components/dist/control-slider.config.d.ts +0 -104
- package/dist/components/dist/control-slider.config.js +0 -98
- package/dist/components/dist/control-slider.d.ts +0 -127
- package/dist/components/dist/control-slider.js +0 -87
- package/dist/components/dist/control-spring.config.d.ts +0 -417
- package/dist/components/dist/control-spring.config.js +0 -36
- package/dist/components/dist/control-spring.d.ts +0 -439
- package/dist/components/dist/control-spring.js +0 -136
- package/dist/components/dist/control-stepper.config.d.ts +0 -1084
- package/dist/components/dist/control-stepper.config.js +0 -108
- package/dist/components/dist/control-stepper.d.ts +0 -1104
- package/dist/components/dist/control-stepper.js +0 -109
- package/dist/components/dist/control-toggle.config.d.ts +0 -407
- package/dist/components/dist/control-toggle.config.js +0 -26
- package/dist/components/dist/control-toggle.d.ts +0 -420
- package/dist/components/dist/control-toggle.js +0 -36
- package/dist/components/dist/createSlot.d.ts +0 -8
- package/dist/components/dist/createSlot.js +0 -89
- package/dist/components/dist/dropdown.config.d.ts +0 -920
- package/dist/components/dist/dropdown.config.js +0 -107
- package/dist/components/dist/dropdown.d.ts +0 -950
- package/dist/components/dist/dropdown.js +0 -92
- package/dist/components/dist/empty-state.config.d.ts +0 -396
- package/dist/components/dist/empty-state.config.js +0 -53
- package/dist/components/dist/empty-state.d.ts +0 -416
- package/dist/components/dist/empty-state.js +0 -33
- package/dist/components/dist/footer.d.ts +0 -11
- package/dist/components/dist/footer.js +0 -9
- package/dist/components/dist/grid.d.ts +0 -41
- package/dist/components/dist/grid.js +0 -34
- package/dist/components/dist/header.d.ts +0 -11
- package/dist/components/dist/header.js +0 -9
- package/dist/components/dist/hstack.d.ts +0 -15
- package/dist/components/dist/hstack.js +0 -21
- package/dist/components/dist/image.d.ts +0 -19
- package/dist/components/dist/image.js +0 -9
- package/dist/components/dist/input.config.d.ts +0 -58
- package/dist/components/dist/input.config.js +0 -42
- package/dist/components/dist/input.d.ts +0 -67
- package/dist/components/dist/input.js +0 -14
- package/dist/components/dist/item.config.d.ts +0 -351
- package/dist/components/dist/item.config.js +0 -83
- package/dist/components/dist/item.d.ts +0 -374
- package/dist/components/dist/item.js +0 -51
- package/dist/components/dist/list.d.ts +0 -19
- package/dist/components/dist/list.js +0 -21
- package/dist/components/dist/main.d.ts +0 -11
- package/dist/components/dist/main.js +0 -9
- package/dist/components/dist/modal.config.d.ts +0 -397
- package/dist/components/dist/modal.config.js +0 -92
- package/dist/components/dist/modal.d.ts +0 -433
- package/dist/components/dist/modal.js +0 -125
- package/dist/components/dist/nav-header.config.d.ts +0 -158
- package/dist/components/dist/nav-header.config.js +0 -26
- package/dist/components/dist/nav-header.d.ts +0 -173
- package/dist/components/dist/nav-header.js +0 -23
- package/dist/components/dist/nav.d.ts +0 -11
- package/dist/components/dist/nav.js +0 -9
- package/dist/components/dist/preset-bar.config.d.ts +0 -192
- package/dist/components/dist/preset-bar.config.js +0 -39
- package/dist/components/dist/preset-bar.d.ts +0 -215
- package/dist/components/dist/preset-bar.js +0 -71
- package/dist/components/dist/presets/index.d.ts +0 -17674
- package/dist/components/dist/presets/index.js +0 -97
- package/dist/components/dist/pressable.d.ts +0 -11
- package/dist/components/dist/pressable.js +0 -9
- package/dist/components/dist/progress.config.d.ts +0 -296
- package/dist/components/dist/progress.config.js +0 -35
- package/dist/components/dist/progress.d.ts +0 -311
- package/dist/components/dist/progress.js +0 -43
- package/dist/components/dist/section.d.ts +0 -11
- package/dist/components/dist/section.js +0 -9
- package/dist/components/dist/select.config.d.ts +0 -31
- package/dist/components/dist/select.config.js +0 -25
- package/dist/components/dist/select.d.ts +0 -45
- package/dist/components/dist/select.js +0 -13
- package/dist/components/dist/sheet.config.d.ts +0 -245
- package/dist/components/dist/sheet.config.js +0 -99
- package/dist/components/dist/sheet.d.ts +0 -267
- package/dist/components/dist/sheet.js +0 -53
- package/dist/components/dist/sidebar.config.d.ts +0 -1651
- package/dist/components/dist/sidebar.config.js +0 -217
- package/dist/components/dist/sidebar.d.ts +0 -1825
- package/dist/components/dist/sidebar.js +0 -492
- package/dist/components/dist/skeleton.config.d.ts +0 -16
- package/dist/components/dist/skeleton.config.js +0 -10
- package/dist/components/dist/skeleton.d.ts +0 -27
- package/dist/components/dist/skeleton.js +0 -16
- package/dist/components/dist/slider.config.d.ts +0 -44
- package/dist/components/dist/slider.config.js +0 -40
- package/dist/components/dist/slider.d.ts +0 -70
- package/dist/components/dist/slider.js +0 -247
- package/dist/components/dist/spinner.config.d.ts +0 -34
- package/dist/components/dist/spinner.config.js +0 -24
- package/dist/components/dist/spinner.d.ts +0 -42
- package/dist/components/dist/spinner.js +0 -29
- package/dist/components/dist/svg.d.ts +0 -21
- package/dist/components/dist/svg.js +0 -17
- package/dist/components/dist/switch.config.d.ts +0 -353
- package/dist/components/dist/switch.config.js +0 -47
- package/dist/components/dist/switch.d.ts +0 -370
- package/dist/components/dist/switch.js +0 -32
- package/dist/components/dist/table.d.ts +0 -36
- package/dist/components/dist/table.js +0 -29
- package/dist/components/dist/tabs.config.d.ts +0 -611
- package/dist/components/dist/tabs.config.js +0 -56
- package/dist/components/dist/tabs.d.ts +0 -632
- package/dist/components/dist/tabs.js +0 -77
- package/dist/components/dist/text.config.d.ts +0 -306
- package/dist/components/dist/text.config.js +0 -149
- package/dist/components/dist/text.d.ts +0 -205
- package/dist/components/dist/text.js +0 -12
- package/dist/components/dist/textarea.config.d.ts +0 -352
- package/dist/components/dist/textarea.config.js +0 -57
- package/dist/components/dist/textarea.d.ts +0 -362
- package/dist/components/dist/textarea.js +0 -9
- package/dist/components/dist/toast.config.d.ts +0 -335
- package/dist/components/dist/toast.config.js +0 -145
- package/dist/components/dist/toast.d.ts +0 -426
- package/dist/components/dist/toast.js +0 -159
- package/dist/components/dist/tooltip.config.d.ts +0 -193
- package/dist/components/dist/tooltip.config.js +0 -40
- package/dist/components/dist/tooltip.d.ts +0 -206
- package/dist/components/dist/tooltip.js +0 -28
- package/dist/components/dist/vstack.d.ts +0 -15
- package/dist/components/dist/vstack.js +0 -20
- package/dist/components/dropdown.config.d.ts +0 -2
- package/dist/components/dropdown.config.js +0 -2
- package/dist/components/dropdown.d.ts +0 -2
- package/dist/components/dropdown.js +0 -2
- package/dist/components/empty-state.config.d.ts +0 -2
- package/dist/components/empty-state.config.js +0 -2
- package/dist/components/empty-state.d.ts +0 -2
- package/dist/components/empty-state.js +0 -2
- package/dist/components/footer.d.ts +0 -2
- package/dist/components/footer.js +0 -2
- package/dist/components/grid.d.ts +0 -2
- package/dist/components/grid.js +0 -2
- package/dist/components/header.d.ts +0 -2
- package/dist/components/header.js +0 -2
- package/dist/components/hstack.d.ts +0 -2
- package/dist/components/hstack.js +0 -2
- package/dist/components/image.d.ts +0 -2
- package/dist/components/image.js +0 -2
- package/dist/components/input.config.d.ts +0 -2
- package/dist/components/input.config.js +0 -2
- package/dist/components/input.d.ts +0 -2
- package/dist/components/input.js +0 -2
- package/dist/components/item.config.d.ts +0 -2
- package/dist/components/item.config.js +0 -2
- package/dist/components/item.d.ts +0 -2
- package/dist/components/item.js +0 -2
- package/dist/components/list.d.ts +0 -2
- package/dist/components/list.js +0 -2
- package/dist/components/main.d.ts +0 -2
- package/dist/components/main.js +0 -2
- package/dist/components/modal.config.d.ts +0 -2
- package/dist/components/modal.config.js +0 -2
- package/dist/components/modal.d.ts +0 -2
- package/dist/components/modal.js +0 -2
- package/dist/components/nav-header.config.d.ts +0 -2
- package/dist/components/nav-header.config.js +0 -2
- package/dist/components/nav-header.d.ts +0 -2
- package/dist/components/nav-header.js +0 -2
- package/dist/components/nav.d.ts +0 -2
- package/dist/components/nav.js +0 -2
- package/dist/components/preset-bar.config.d.ts +0 -2
- package/dist/components/preset-bar.config.js +0 -2
- package/dist/components/preset-bar.d.ts +0 -2
- package/dist/components/preset-bar.js +0 -2
- package/dist/components/presets/index.d.ts +0 -44
- package/dist/components/presets/index.js +0 -44
- package/dist/components/pressable.d.ts +0 -2
- package/dist/components/pressable.js +0 -2
- package/dist/components/progress.config.d.ts +0 -2
- package/dist/components/progress.config.js +0 -2
- package/dist/components/progress.d.ts +0 -2
- package/dist/components/progress.js +0 -2
- package/dist/components/section.d.ts +0 -2
- package/dist/components/section.js +0 -2
- package/dist/components/select.config.d.ts +0 -2
- package/dist/components/select.config.js +0 -2
- package/dist/components/select.d.ts +0 -2
- package/dist/components/select.js +0 -2
- package/dist/components/sheet.config.d.ts +0 -2
- package/dist/components/sheet.config.js +0 -2
- package/dist/components/sheet.d.ts +0 -2
- package/dist/components/sheet.js +0 -2
- package/dist/components/sidebar.config.d.ts +0 -2
- package/dist/components/sidebar.config.js +0 -2
- package/dist/components/sidebar.d.ts +0 -2
- package/dist/components/sidebar.js +0 -2
- package/dist/components/skeleton.config.d.ts +0 -2
- package/dist/components/skeleton.config.js +0 -2
- package/dist/components/skeleton.d.ts +0 -2
- package/dist/components/skeleton.js +0 -2
- package/dist/components/slider.config.d.ts +0 -2
- package/dist/components/slider.config.js +0 -2
- package/dist/components/slider.d.ts +0 -2
- package/dist/components/slider.js +0 -2
- package/dist/components/spinner.config.d.ts +0 -2
- package/dist/components/spinner.config.js +0 -2
- package/dist/components/spinner.d.ts +0 -2
- package/dist/components/spinner.js +0 -2
- package/dist/components/svg.d.ts +0 -2
- package/dist/components/svg.js +0 -2
- package/dist/components/switch.config.d.ts +0 -2
- package/dist/components/switch.config.js +0 -2
- package/dist/components/switch.d.ts +0 -2
- package/dist/components/switch.js +0 -2
- package/dist/components/table.d.ts +0 -2
- package/dist/components/table.js +0 -2
- package/dist/components/tabs.config.d.ts +0 -2
- package/dist/components/tabs.config.js +0 -2
- package/dist/components/tabs.d.ts +0 -2
- package/dist/components/tabs.js +0 -2
- package/dist/components/text.config.d.ts +0 -2
- package/dist/components/text.config.js +0 -2
- package/dist/components/text.d.ts +0 -2
- package/dist/components/text.js +0 -2
- package/dist/components/textarea.config.d.ts +0 -2
- package/dist/components/textarea.config.js +0 -2
- package/dist/components/textarea.d.ts +0 -2
- package/dist/components/textarea.js +0 -2
- package/dist/components/toast.config.d.ts +0 -2
- package/dist/components/toast.config.js +0 -2
- package/dist/components/toast.d.ts +0 -2
- package/dist/components/toast.js +0 -2
- package/dist/components/tooltip.config.d.ts +0 -2
- package/dist/components/tooltip.config.js +0 -2
- package/dist/components/tooltip.d.ts +0 -2
- package/dist/components/tooltip.js +0 -2
- package/dist/components/vstack.d.ts +0 -2
- package/dist/components/vstack.js +0 -2
- package/dist/config/dist/component-config.d.ts +0 -349
- package/dist/config/dist/component-refs.d.ts +0 -98
- package/dist/config/dist/component-resolution.js +0 -78
- package/dist/config/dist/consts/defaultColors.d.ts +0 -253
- package/dist/config/dist/consts/defaultColors.js +0 -252
- package/dist/config/dist/createComponent.d.ts +0 -1
- package/dist/config/dist/createComponent.js +0 -1
- package/dist/config/dist/createConfig.d.ts +0 -375
- package/dist/config/dist/createConfig.js +0 -625
- package/dist/config/dist/defineComponent.d.ts +0 -24
- package/dist/config/dist/defineComponent.js +0 -2
- package/dist/config/dist/defineStyleProp.d.ts +0 -93
- package/dist/config/dist/defineStyleProp.js +0 -60
- package/dist/config/dist/preset-merge.js +0 -192
- package/dist/config/dist/propertyAcceptedTypes.js +0 -220
- package/dist/config/dist/propertyGroups.d.ts +0 -1
- package/dist/config/dist/propertyGroups.js +0 -414
- package/dist/config/dist/resolveStyleProp.d.ts +0 -88
- package/dist/config/dist/resolveStyleProp.js +0 -235
- package/dist/config/dist/resolveTokenTypes.d.ts +0 -1
- package/dist/config/dist/resolveTokenTypes.js +0 -149
- package/dist/config/dist/runtime-registry.js +0 -9
- package/dist/config/dist/serialize.d.ts +0 -73
- package/dist/config/dist/serialize.js +0 -172
- package/dist/config/dist/style-prop-runtime.d.ts +0 -1
- package/dist/config-utils/dist/componentConfig.d.ts +0 -10
- package/dist/config-utils/dist/componentConfig.js +0 -11
- package/dist/config-utils.d.ts +0 -2
- package/dist/config-utils.js +0 -2
- package/dist/core/dist/color-opacity-map.js +0 -33
- package/dist/core/dist/compositeStyles.d.ts +0 -21
- package/dist/core/dist/compositeStyles.js +0 -51
- package/dist/core/dist/configurable-prop-helpers.d.ts +0 -31
- package/dist/core/dist/configurable-prop-helpers.js +0 -61
- package/dist/core/dist/createComponent.boundaries.js +0 -192
- package/dist/core/dist/createComponent.d.ts +0 -56
- package/dist/core/dist/createComponent.js +0 -67
- package/dist/core/dist/createComponentExample.d.ts +0 -41
- package/dist/core/dist/createComponentExample.js +0 -27
- package/dist/core/dist/createProvider.d.ts +0 -12
- package/dist/core/dist/createProvider.js +0 -24
- package/dist/core/dist/generated/stylePropsTwMap.d.ts +0 -1700
- package/dist/core/dist/generated/stylePropsTwMap.js +0 -570
- package/dist/core/dist/getComponentStyles.d.ts +0 -49
- package/dist/core/dist/getComponentStyles.js +0 -85
- package/dist/core/dist/getStyles.d.ts +0 -42
- package/dist/core/dist/getStyles.js +0 -300
- package/dist/core/dist/index.d.ts +0 -13
- package/dist/core/dist/index.js +0 -13
- package/dist/core/dist/modifier-mappings.d.ts +0 -12
- package/dist/core/dist/modifier-mappings.js +0 -61
- package/dist/core/dist/resolveMotionState.d.ts +0 -4
- package/dist/core/dist/resolveMotionState.js +0 -17
- package/dist/core/dist/resolveProps.boundaries.js +0 -131
- package/dist/core/dist/style-prop-data.d.ts +0 -32
- package/dist/core/dist/style-prop-data.js +0 -1257
- package/dist/core/dist/transformPreset.d.ts +0 -17
- package/dist/core/dist/transformPreset.js +0 -28
- package/dist/core/dist/withDefaultStyleProps.d.ts +0 -43
- package/dist/core/dist/withDefaultStyleProps.js +0 -18
- package/dist/core.d.ts +0 -14
- package/dist/core.js +0 -15
- package/dist/createSlot.d.ts +0 -2
- package/dist/createSlot.js +0 -2
- package/dist/fixtures.d.ts +0 -4
- package/dist/fixtures.js +0 -5
- package/dist/foundational-presets/dist/_virtual/_rolldown/runtime.js +0 -13
- package/dist/foundational-presets/dist/defaultPreset.d.ts +0 -1557
- package/dist/foundational-presets/dist/defaultPreset.js +0 -615
- package/dist/foundational-presets/dist/index.d.ts +0 -1
- package/dist/foundational-presets/dist/index.js +0 -1
- package/dist/foundational-presets/dist/motion.d.ts +0 -12
- package/dist/foundational-presets/dist/style-props.js +0 -1445
- package/dist/loader/dist/loader/create-component-data.js +0 -33
- package/dist/loader/dist/loader/create-component-lowering.js +0 -454
- package/dist/loader/dist/loader/data-attr-transform.js +0 -191
- package/dist/loader/dist/loader/dynamic-style-codegen.js +0 -97
- package/dist/loader/dist/loader/internal-meta.js +0 -22
- package/dist/loader/dist/loader/lower-new-api-primitive.js +0 -90
- package/dist/loader/dist/loader/motion-transform.js +0 -717
- package/dist/loader/dist/loader/style-transform.js +0 -670
- package/dist/loader/dist/node_modules/react/cjs/react-jsx-runtime.development.js +0 -203
- package/dist/loader/dist/node_modules/react/cjs/react-jsx-runtime.production.js +0 -25
- package/dist/loader/dist/node_modules/react/cjs/react.development.js +0 -762
- package/dist/loader/dist/node_modules/react/cjs/react.production.js +0 -351
- package/dist/loader/dist/node_modules/react/index.js +0 -10
- package/dist/loader/dist/node_modules/react/jsx-runtime.js +0 -10
- package/dist/loader/dist/packages/core/dist/color-opacity-map.js +0 -33
- package/dist/loader/dist/packages/core/dist/compositeStyles.js +0 -43
- package/dist/loader/dist/packages/core/dist/createComponent.js +0 -6
- package/dist/loader/dist/packages/core/dist/createProvider.js +0 -7
- package/dist/loader/dist/packages/core/dist/generated/stylePropsTwMap.js +0 -570
- package/dist/loader/dist/packages/core/dist/getComponentStyles.js +0 -2
- package/dist/loader/dist/packages/core/dist/getStyles.js +0 -60
- package/dist/loader/dist/packages/core/dist/index.js +0 -6
- package/dist/loader/dist/packages/core/dist/modifier-mappings.js +0 -61
- package/dist/loader/dist/packages/core/dist/style-prop-data.js +0 -1257
- package/dist/loader/dist/packages/core/dist/withDefaultStyleProps.js +0 -1
- package/dist/presets/dist/defaultPreset.d.ts +0 -6
- package/dist/presets/dist/defaultPreset.js +0 -51
- package/dist/presets/dist/index.d.ts +0 -1
- package/dist/presets/dist/index.js +0 -1
- package/dist/presets/motion.d.ts +0 -2
- package/dist/presets/motion.js +0 -2
- package/dist/presets.d.ts +0 -2
- package/dist/presets.js +0 -3
- package/dist/styles.d.ts +0 -4
- package/dist/styles.js +0 -5
- package/dist/transformPreset.d.ts +0 -2
- package/dist/transformPreset.js +0 -3
- /package/dist/{config/dist/component-resolution.d.ts → loader/dist/transform-runner.d.ts} +0 -0
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
//#region ../core/dist/color-opacity-map.js
|
|
2
|
-
/**
|
|
3
|
-
* Maps each color prop name to its corresponding opacity prop name.
|
|
4
|
-
* Used by the runtime (`getStyles`) and loader (`style-transform`) to merge
|
|
5
|
-
* a color value with its opacity before class generation.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* `bg="primary"` + `bgOpacity="75"` → class `bg-primary_75`
|
|
9
|
-
*/
|
|
10
|
-
const colorPropToOpacityProp = {
|
|
11
|
-
bg: "bgOpacity",
|
|
12
|
-
color: "colorOpacity",
|
|
13
|
-
textDecorationColor: "textDecorationColorOpacity",
|
|
14
|
-
borderColor: "borderColorOpacity",
|
|
15
|
-
borderYColor: "borderYColorOpacity",
|
|
16
|
-
borderXColor: "borderXColorOpacity",
|
|
17
|
-
borderStartColor: "borderStartColorOpacity",
|
|
18
|
-
borderLeftColor: "borderLeftColorOpacity",
|
|
19
|
-
borderEndColor: "borderEndColorOpacity",
|
|
20
|
-
borderRightColor: "borderRightColorOpacity",
|
|
21
|
-
borderTopColor: "borderTopColorOpacity",
|
|
22
|
-
borderBottomColor: "borderBottomColorOpacity",
|
|
23
|
-
divideColor: "divideColorOpacity",
|
|
24
|
-
outlineColor: "outlineColorOpacity",
|
|
25
|
-
ringColor: "ringColorOpacity",
|
|
26
|
-
ringOffsetColor: "ringOffsetColorOpacity",
|
|
27
|
-
fillColor: "fillColorOpacity",
|
|
28
|
-
strokeColor: "strokeColorOpacity",
|
|
29
|
-
shadowColor: "shadowColorOpacity",
|
|
30
|
-
caretColor: "caretColorOpacity"
|
|
31
|
-
};
|
|
32
|
-
//#endregion
|
|
33
|
-
export { colorPropToOpacityProp };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { CompositeStylesConfig } from "@uds/types";
|
|
2
|
-
|
|
3
|
-
//#region ../core/dist/compositeStyles.d.ts
|
|
4
|
-
/** Set the composite-styles config (called by loader at build time) */
|
|
5
|
-
declare function setCompositeStylesConfig(config: CompositeStylesConfig): void;
|
|
6
|
-
/** Get the current composite-styles config */
|
|
7
|
-
declare function getCompositeStylesConfig(): CompositeStylesConfig;
|
|
8
|
-
/**
|
|
9
|
-
* Expand composite-style props into their constituent style props + marker classes.
|
|
10
|
-
*
|
|
11
|
-
* - Composite styles are lowest priority: explicit props always win
|
|
12
|
-
* - Nested composite styles are supported (a style bag can reference another group)
|
|
13
|
-
* - Circular references are detected and throw
|
|
14
|
-
* - Marker classes (e.g. "elevation-0") are returned for modifier targeting
|
|
15
|
-
*/
|
|
16
|
-
declare function expandCompositeStyles(props: Record<string, unknown>, config?: CompositeStylesConfig): {
|
|
17
|
-
expanded: Record<string, unknown>;
|
|
18
|
-
markerClasses: string[];
|
|
19
|
-
};
|
|
20
|
-
//#endregion
|
|
21
|
-
export { expandCompositeStyles, getCompositeStylesConfig, setCompositeStylesConfig };
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { safeTokenName } from "../../utils/dist/string-utils/cssVar.js";
|
|
2
|
-
import "../../utils/dist/index.js";
|
|
3
|
-
//#region ../core/dist/compositeStyles.js
|
|
4
|
-
/**
|
|
5
|
-
* Runtime composite-styles config — set by the loader/codegen at build time.
|
|
6
|
-
* Maps composite-style group names to a `{ label, description?, styles }`
|
|
7
|
-
* definition where `styles` holds variant id -> style bag.
|
|
8
|
-
*/
|
|
9
|
-
let compositeStylesConfig = {};
|
|
10
|
-
/** Set the composite-styles config (called by loader at build time) */
|
|
11
|
-
function setCompositeStylesConfig(config) {
|
|
12
|
-
compositeStylesConfig = config;
|
|
13
|
-
}
|
|
14
|
-
/** Get the current composite-styles config */
|
|
15
|
-
function getCompositeStylesConfig() {
|
|
16
|
-
return compositeStylesConfig;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Expand composite-style props into their constituent style props + marker classes.
|
|
20
|
-
*
|
|
21
|
-
* - Composite styles are lowest priority: explicit props always win
|
|
22
|
-
* - Nested composite styles are supported (a style bag can reference another group)
|
|
23
|
-
* - Circular references are detected and throw
|
|
24
|
-
* - Marker classes (e.g. "elevation-0") are returned for modifier targeting
|
|
25
|
-
*/
|
|
26
|
-
function expandCompositeStyles(props, config = compositeStylesConfig) {
|
|
27
|
-
const expanded = {};
|
|
28
|
-
const markers = [];
|
|
29
|
-
const seen = /* @__PURE__ */ new Set();
|
|
30
|
-
function expand(key, value) {
|
|
31
|
-
const def = config[key];
|
|
32
|
-
if (def && typeof value === "string") {
|
|
33
|
-
if (seen.has(key)) throw new Error(`Circular composite style: ${[...seen, key].join(" → ")}`);
|
|
34
|
-
seen.add(key);
|
|
35
|
-
markers.push(`${key}-${safeTokenName(value)}`);
|
|
36
|
-
const bag = def.styles[value];
|
|
37
|
-
if (bag) {
|
|
38
|
-
for (const [k, v] of Object.entries(bag)) if (!(k in expanded)) expand(k, v);
|
|
39
|
-
}
|
|
40
|
-
seen.delete(key);
|
|
41
|
-
} else if (!(key in expanded)) expanded[key] = value;
|
|
42
|
-
}
|
|
43
|
-
for (const [key, value] of Object.entries(props)) if (key in config) expand(key, value);
|
|
44
|
-
for (const [key, value] of Object.entries(props)) if (!(key in config)) expanded[key] = value;
|
|
45
|
-
return {
|
|
46
|
-
expanded,
|
|
47
|
-
markerClasses: markers
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
//#endregion
|
|
51
|
-
export { expandCompositeStyles, getCompositeStylesConfig, setCompositeStylesConfig };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { PropMapping } from "./style-prop-data.js";
|
|
2
|
-
import { ConfigurableProp } from "@uds/types";
|
|
3
|
-
|
|
4
|
-
//#region ../core/dist/configurable-prop-helpers.d.ts
|
|
5
|
-
/** Look up a {@link PropMapping} by ConfigurableProp name. */
|
|
6
|
-
declare function getConfigurablePropMapping(prop: ConfigurableProp): PropMapping | undefined;
|
|
7
|
-
interface ConfigurablePropertyEntry {
|
|
8
|
-
property: string;
|
|
9
|
-
subProperties: string[];
|
|
10
|
-
augmentType: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Derives the configurable properties table from {@link propMappings}.
|
|
14
|
-
* Groups props by augmentType — the primary prop is the one matching
|
|
15
|
-
* a ConfigurableProp name, the rest are sub-properties.
|
|
16
|
-
*/
|
|
17
|
-
declare function getConfigurableProperties(): ConfigurablePropertyEntry[];
|
|
18
|
-
interface CssVariablePrefixEntry {
|
|
19
|
-
property: string;
|
|
20
|
-
cssPrefix: string;
|
|
21
|
-
exampleVariable: string;
|
|
22
|
-
exampleUtility: string;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Derives the CSS variable prefix table from {@link propMappings}.
|
|
26
|
-
* Only includes props that have both `cssProperty` and `defaultVarPrefix`.
|
|
27
|
-
* Deduplicates by `defaultVarPrefix` so each namespace appears once.
|
|
28
|
-
*/
|
|
29
|
-
declare function getCssVariablePrefixes(): CssVariablePrefixEntry[];
|
|
30
|
-
//#endregion
|
|
31
|
-
export { ConfigurablePropertyEntry, CssVariablePrefixEntry, getConfigurablePropMapping, getConfigurableProperties, getCssVariablePrefixes };
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { propMappings } from "./style-prop-data.js";
|
|
2
|
-
//#region ../core/dist/configurable-prop-helpers.js
|
|
3
|
-
/** Maps ConfigurableProp names to propMappings keys when they differ. */
|
|
4
|
-
const configurablePropAliases = {};
|
|
5
|
-
/** Look up a {@link PropMapping} by ConfigurableProp name. */
|
|
6
|
-
function getConfigurablePropMapping(prop) {
|
|
7
|
-
return propMappings[configurablePropAliases[prop] ?? prop];
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Derives the configurable properties table from {@link propMappings}.
|
|
11
|
-
* Groups props by augmentType — the primary prop is the one matching
|
|
12
|
-
* a ConfigurableProp name, the rest are sub-properties.
|
|
13
|
-
*/
|
|
14
|
-
function getConfigurableProperties() {
|
|
15
|
-
const byAugment = {};
|
|
16
|
-
for (const [prop, mapping] of Object.entries(propMappings)) {
|
|
17
|
-
if (!mapping.augmentType) continue;
|
|
18
|
-
const aug = mapping.augmentType;
|
|
19
|
-
if (!byAugment[aug]) byAugment[aug] = [];
|
|
20
|
-
byAugment[aug].push(prop);
|
|
21
|
-
}
|
|
22
|
-
const entries = [];
|
|
23
|
-
for (const [augmentType, props] of Object.entries(byAugment)) {
|
|
24
|
-
const sorted = [...props].sort((a, b) => a.length - b.length);
|
|
25
|
-
const primary = sorted[0];
|
|
26
|
-
const subs = sorted.slice(1);
|
|
27
|
-
entries.push({
|
|
28
|
-
property: primary,
|
|
29
|
-
subProperties: subs,
|
|
30
|
-
augmentType
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
return entries;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Derives the CSS variable prefix table from {@link propMappings}.
|
|
37
|
-
* Only includes props that have both `cssProperty` and `defaultVarPrefix`.
|
|
38
|
-
* Deduplicates by `defaultVarPrefix` so each namespace appears once.
|
|
39
|
-
*/
|
|
40
|
-
function getCssVariablePrefixes() {
|
|
41
|
-
const seen = /* @__PURE__ */ new Set();
|
|
42
|
-
const entries = [];
|
|
43
|
-
for (const [prop, mapping] of Object.entries(propMappings)) {
|
|
44
|
-
if (!mapping.defaultVarPrefix || !mapping.cssProperty) continue;
|
|
45
|
-
if (seen.has(mapping.defaultVarPrefix)) continue;
|
|
46
|
-
seen.add(mapping.defaultVarPrefix);
|
|
47
|
-
const prefix = `--uds-${mapping.defaultVarPrefix}-*`;
|
|
48
|
-
const exampleToken = mapping.defaultVarPrefix.includes("color") ? "brand" : mapping.defaultVarPrefix === "spacing" ? "4" : mapping.defaultVarPrefix === "radius" ? "lg" : mapping.defaultVarPrefix === "border-width" ? "2" : "value";
|
|
49
|
-
const exampleVar = `--uds-${mapping.defaultVarPrefix}-${exampleToken}`;
|
|
50
|
-
const exampleUtility = `${mapping.classPrefix}-${exampleToken}`;
|
|
51
|
-
entries.push({
|
|
52
|
-
property: prop,
|
|
53
|
-
cssPrefix: prefix,
|
|
54
|
-
exampleVariable: exampleVar,
|
|
55
|
-
exampleUtility
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
return entries;
|
|
59
|
-
}
|
|
60
|
-
//#endregion
|
|
61
|
-
export { getConfigurablePropMapping, getConfigurableProperties, getCssVariablePrefixes };
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import { stylePropsTwMap } from "./generated/stylePropsTwMap.js";
|
|
2
|
-
//#region ../core/dist/createComponent.boundaries.js
|
|
3
|
-
const RESERVED_PROP_KEYS = new Set([
|
|
4
|
-
"children",
|
|
5
|
-
"motion",
|
|
6
|
-
"motionConfig",
|
|
7
|
-
"props",
|
|
8
|
-
"data-uds-class"
|
|
9
|
-
]);
|
|
10
|
-
function assertTransformedConfig(nameOrConfig) {
|
|
11
|
-
if (typeof nameOrConfig !== "string") return nameOrConfig;
|
|
12
|
-
return {
|
|
13
|
-
name: nameOrConfig,
|
|
14
|
-
element: "div",
|
|
15
|
-
slots: ["root"],
|
|
16
|
-
variants: [],
|
|
17
|
-
defaultVariants: {},
|
|
18
|
-
ownPropKeys: [],
|
|
19
|
-
_udsUntransformed: true
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
function inferComponentNameFromRenderFn(renderFn) {
|
|
23
|
-
if (typeof renderFn.displayName === "string" && renderFn.displayName.trim().length > 0) return renderFn.displayName;
|
|
24
|
-
if (typeof renderFn.name === "string" && renderFn.name.trim().length > 0) return renderFn.name;
|
|
25
|
-
return "Component";
|
|
26
|
-
}
|
|
27
|
-
function partitionMergedProps(mergedProps, ownPropKeySet, slotNames) {
|
|
28
|
-
const ownProps = {};
|
|
29
|
-
const resolveProps = {};
|
|
30
|
-
let children;
|
|
31
|
-
let injectedClassName;
|
|
32
|
-
let userMotionConfig;
|
|
33
|
-
let slotOverrides;
|
|
34
|
-
for (const key in mergedProps) {
|
|
35
|
-
if (!Object.hasOwn(mergedProps, key)) continue;
|
|
36
|
-
const value = mergedProps[key];
|
|
37
|
-
if (ownPropKeySet.has(key)) {
|
|
38
|
-
ownProps[key] = value;
|
|
39
|
-
continue;
|
|
40
|
-
}
|
|
41
|
-
if (key === "children") {
|
|
42
|
-
children = value;
|
|
43
|
-
continue;
|
|
44
|
-
}
|
|
45
|
-
if (key === "data-uds-class") {
|
|
46
|
-
injectedClassName = typeof value === "string" ? value : void 0;
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
if (key === "motionConfig") {
|
|
50
|
-
userMotionConfig = value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
51
|
-
continue;
|
|
52
|
-
}
|
|
53
|
-
if (slotNames && key.startsWith("_") && value && typeof value === "object" && !Array.isArray(value)) {
|
|
54
|
-
const slotName = key.slice(1);
|
|
55
|
-
if (slotNames.has(slotName)) {
|
|
56
|
-
slotOverrides ??= {};
|
|
57
|
-
slotOverrides[slotName] = value;
|
|
58
|
-
continue;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
if (!RESERVED_PROP_KEYS.has(key)) resolveProps[key] = value;
|
|
62
|
-
}
|
|
63
|
-
return {
|
|
64
|
-
ownProps,
|
|
65
|
-
resolveProps,
|
|
66
|
-
children,
|
|
67
|
-
injectedClassName,
|
|
68
|
-
userMotionConfig,
|
|
69
|
-
slotOverrides
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
function mergeRootClassName(classes, injectedClassName) {
|
|
73
|
-
if (!injectedClassName) return classes;
|
|
74
|
-
return {
|
|
75
|
-
...classes,
|
|
76
|
-
root: `${classes.root ?? ""} ${injectedClassName}`.trim()
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
function buildSlotProps(slots, classes, htmlProps, rootClassName) {
|
|
80
|
-
const slotProps = {};
|
|
81
|
-
for (const slot of slots) slotProps[slot] = { className: classes[slot] };
|
|
82
|
-
const rootSlot = slots.includes("root") ? "root" : slots[0];
|
|
83
|
-
if (!rootSlot) return slotProps;
|
|
84
|
-
const { className: htmlClassName, motionConfig: _mc, ...rootHtmlProps } = htmlProps;
|
|
85
|
-
const mergedRootClassName = [rootClassName ?? slotProps[rootSlot]?.className, typeof htmlClassName === "string" ? htmlClassName : void 0].filter(Boolean).join(" ").trim();
|
|
86
|
-
slotProps[rootSlot] = {
|
|
87
|
-
...slotProps[rootSlot],
|
|
88
|
-
...rootHtmlProps,
|
|
89
|
-
className: mergedRootClassName || void 0
|
|
90
|
-
};
|
|
91
|
-
if (!slotProps.root) slotProps.root = slotProps[rootSlot];
|
|
92
|
-
return slotProps;
|
|
93
|
-
}
|
|
94
|
-
function mergeMotionConfig(defaultMotion, userMotionConfig) {
|
|
95
|
-
if (!defaultMotion && !userMotionConfig) return;
|
|
96
|
-
const merged = { ...defaultMotion ?? {} };
|
|
97
|
-
if (!userMotionConfig) return merged;
|
|
98
|
-
for (const [slot, slotConfig] of Object.entries(userMotionConfig)) {
|
|
99
|
-
if (slotConfig && typeof slotConfig === "object" && !Array.isArray(slotConfig) && merged[slot] && typeof merged[slot] === "object" && !Array.isArray(merged[slot])) {
|
|
100
|
-
merged[slot] = {
|
|
101
|
-
...merged[slot],
|
|
102
|
-
...slotConfig
|
|
103
|
-
};
|
|
104
|
-
continue;
|
|
105
|
-
}
|
|
106
|
-
merged[slot] = slotConfig;
|
|
107
|
-
}
|
|
108
|
-
return merged;
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Render a component that hasn't been transformed by the build plugin.
|
|
112
|
-
* Strips internal data attributes, runs processStyleProps to extract style
|
|
113
|
-
* props into className, and builds minimal slot props for the render function.
|
|
114
|
-
*
|
|
115
|
-
* Returns both the slot props and any extracted own props (non-HTML-attribute
|
|
116
|
-
* values like arrays and objects that should be passed at the top level of
|
|
117
|
-
* the render props, not inside slot props).
|
|
118
|
-
*/
|
|
119
|
-
function buildUntransformedSlotProps(resolveProps, injectedClassName, processStylePropsFn) {
|
|
120
|
-
const { "data-uds-id": _internalUdsId, "data-uds-source": _internalUdsSource, ...publicResolveProps } = resolveProps;
|
|
121
|
-
const { className: userClassName, ...styleAndHtml } = publicResolveProps;
|
|
122
|
-
const [styleClassName, htmlOnly] = processStylePropsFn(styleAndHtml, {
|
|
123
|
-
extractNativeProps: true,
|
|
124
|
-
existingClassName: typeof userClassName === "string" ? userClassName : void 0
|
|
125
|
-
});
|
|
126
|
-
const htmlProps = {};
|
|
127
|
-
const extractedOwnProps = {};
|
|
128
|
-
for (const key in htmlOnly) {
|
|
129
|
-
if (!Object.hasOwn(htmlOnly, key)) continue;
|
|
130
|
-
const value = htmlOnly[key];
|
|
131
|
-
if (key === "as" || key !== "style" && (Array.isArray(value) || value !== null && typeof value === "object" && !(value instanceof Date))) extractedOwnProps[key] = value;
|
|
132
|
-
else htmlProps[key] = value;
|
|
133
|
-
}
|
|
134
|
-
for (const key in styleAndHtml) {
|
|
135
|
-
if (!Object.hasOwn(styleAndHtml, key)) continue;
|
|
136
|
-
if (!(key in htmlOnly)) extractedOwnProps[key] = styleAndHtml[key];
|
|
137
|
-
}
|
|
138
|
-
if (typeof userClassName === "string") for (const token of userClassName.split(" ")) {
|
|
139
|
-
if (!token) continue;
|
|
140
|
-
const entry = stylePropsTwMap[token];
|
|
141
|
-
if (!entry) continue;
|
|
142
|
-
const [propName, propValue] = Object.entries(entry)[0];
|
|
143
|
-
if (propName && propValue !== void 0 && !(propName in extractedOwnProps)) extractedOwnProps[propName] = propValue;
|
|
144
|
-
}
|
|
145
|
-
const rootClassName = [
|
|
146
|
-
typeof userClassName === "string" ? userClassName : void 0,
|
|
147
|
-
styleClassName,
|
|
148
|
-
injectedClassName
|
|
149
|
-
].filter(Boolean).join(" ").trim();
|
|
150
|
-
return {
|
|
151
|
-
slotProps: { root: {
|
|
152
|
-
...htmlProps,
|
|
153
|
-
className: rootClassName || void 0
|
|
154
|
-
} },
|
|
155
|
-
extractedOwnProps
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
function applySlotOverrides(slotProps, slotOverrides, processStylePropsFn) {
|
|
159
|
-
if (!slotOverrides) return slotProps;
|
|
160
|
-
const merged = { ...slotProps };
|
|
161
|
-
for (const [slotName, overrideProps] of Object.entries(slotOverrides)) {
|
|
162
|
-
if (!merged[slotName]) continue;
|
|
163
|
-
const [overrideClassName, overrideHtmlProps] = processStylePropsFn(overrideProps, { extractNativeProps: true });
|
|
164
|
-
const existing = merged[slotName];
|
|
165
|
-
const mergedClassName = [
|
|
166
|
-
typeof existing.className === "string" ? existing.className : "",
|
|
167
|
-
overrideClassName,
|
|
168
|
-
typeof overrideHtmlProps.className === "string" ? overrideHtmlProps.className : ""
|
|
169
|
-
].filter(Boolean).join(" ").trim();
|
|
170
|
-
const { className: _overrideHtmlCn, ...restHtmlProps } = overrideHtmlProps;
|
|
171
|
-
merged[slotName] = {
|
|
172
|
-
...existing,
|
|
173
|
-
...restHtmlProps,
|
|
174
|
-
className: mergedClassName || void 0
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
return merged;
|
|
178
|
-
}
|
|
179
|
-
function mergeSlotMotionProps(slotProps, motionConfig) {
|
|
180
|
-
if (!motionConfig) return slotProps;
|
|
181
|
-
const merged = { ...slotProps };
|
|
182
|
-
for (const [slot, slotMotion] of Object.entries(motionConfig)) {
|
|
183
|
-
if (!slotMotion || typeof slotMotion !== "object" || Array.isArray(slotMotion) || !merged[slot]) continue;
|
|
184
|
-
merged[slot] = {
|
|
185
|
-
...merged[slot],
|
|
186
|
-
...slotMotion
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
return merged;
|
|
190
|
-
}
|
|
191
|
-
//#endregion
|
|
192
|
-
export { applySlotOverrides, assertTransformedConfig, buildSlotProps, buildUntransformedSlotProps, inferComponentNameFromRenderFn, mergeMotionConfig, mergeRootClassName, mergeSlotMotionProps, partitionMergedProps };
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { CreateComponentConfig, CreateComponentProps, CreateComponentRenderFn, CreateComponentSlotTagConfig, CreateComponentTypeInput } from "@uds/types";
|
|
2
|
-
|
|
3
|
-
//#region ../core/dist/createComponent.d.ts
|
|
4
|
-
type PrimitiveTag = keyof React.JSX.IntrinsicElements;
|
|
5
|
-
type SpecConfig<TSpec> = TSpec extends {
|
|
6
|
-
config: infer TConfig extends CreateComponentTypeInput;
|
|
7
|
-
} ? TConfig : string;
|
|
8
|
-
type SpecOwnProps<TSpec> = TSpec extends {
|
|
9
|
-
props: infer TOwnProps;
|
|
10
|
-
} ? TOwnProps : TSpec;
|
|
11
|
-
type SpecSlotConfig<TSpec> = SpecConfig<TSpec> extends infer TConfig extends CreateComponentTypeInput ? TSpec extends {
|
|
12
|
-
slots: infer TSlots;
|
|
13
|
-
} ? TSlots extends CreateComponentSlotTagConfig<TConfig> ? TSlots : 'div' : 'div' : 'div';
|
|
14
|
-
type PrimitiveOwnProps<TSpecOrProps> = TSpecOrProps extends {
|
|
15
|
-
props: infer TOwnProps;
|
|
16
|
-
} ? TOwnProps : TSpecOrProps;
|
|
17
|
-
/**
|
|
18
|
-
* Create a custom uds component with automatic style/variant resolution.
|
|
19
|
-
*
|
|
20
|
-
* At author-time, call `createComponent(renderFn)`. The loader infers the
|
|
21
|
-
* component name from the assigned variable (e.g. `const Name = createComponent(...)`).
|
|
22
|
-
*
|
|
23
|
-
* The uds-loader build plugin rewrites calls to inline a config object so
|
|
24
|
-
* the runtime can resolve styles without an extra manifest import.
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```tsx
|
|
28
|
-
* type CardConfig = typeof cardConfig;
|
|
29
|
-
*
|
|
30
|
-
* interface CardSpec {
|
|
31
|
-
* config: CardConfig;
|
|
32
|
-
* props: CardOwnProps;
|
|
33
|
-
* }
|
|
34
|
-
*
|
|
35
|
-
* export const Card = createComponent<CardSpec>(
|
|
36
|
-
* ({ props, children, title, actions }) => (
|
|
37
|
-
* <VStack {...props.root}>
|
|
38
|
-
* <Text {...props.title}>{title}</Text>
|
|
39
|
-
* {children}
|
|
40
|
-
* </VStack>
|
|
41
|
-
* )
|
|
42
|
-
* );
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
declare function createComponent<TSpecOrProps = {}>(tag: PrimitiveTag): React.FC<TSpecOrProps extends {
|
|
46
|
-
config: infer TConfig extends CreateComponentTypeInput;
|
|
47
|
-
props: infer TOwnProps;
|
|
48
|
-
slots: infer TSlots;
|
|
49
|
-
} ? CreateComponentProps<TConfig, TOwnProps, TSlots extends CreateComponentSlotTagConfig<TConfig> ? TSlots : PrimitiveTag> : TSpecOrProps extends {
|
|
50
|
-
config: infer TConfig extends CreateComponentTypeInput;
|
|
51
|
-
props: infer TOwnProps;
|
|
52
|
-
} ? CreateComponentProps<TConfig, TOwnProps, PrimitiveTag> : PrimitiveOwnProps<TSpecOrProps>>;
|
|
53
|
-
declare function createComponent<TSpec>(renderFn: CreateComponentRenderFn<SpecConfig<TSpec>, SpecOwnProps<TSpec>, SpecSlotConfig<TSpec>>): React.FC<CreateComponentProps<SpecConfig<TSpec>, SpecOwnProps<TSpec>, SpecSlotConfig<TSpec>>>;
|
|
54
|
-
declare function createComponent(config: CreateComponentConfig<string>, renderFn: CreateComponentRenderFn<any, any, any>): React.FC<any>;
|
|
55
|
-
//#endregion
|
|
56
|
-
export { createComponent };
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { processStyleProps } from "./getStyles.js";
|
|
2
|
-
import { createComponentStyler } from "./getComponentStyles.js";
|
|
3
|
-
import { applySlotOverrides, assertTransformedConfig, buildSlotProps, buildUntransformedSlotProps, inferComponentNameFromRenderFn, mergeMotionConfig, mergeRootClassName, mergeSlotMotionProps, partitionMergedProps } from "./createComponent.boundaries.js";
|
|
4
|
-
import { createElement } from "react";
|
|
5
|
-
//#region ../core/dist/createComponent.js
|
|
6
|
-
function createPrimitiveRenderFn(tag) {
|
|
7
|
-
return ({ props, children }) => {
|
|
8
|
-
const { as, ...rootProps } = props.root;
|
|
9
|
-
return createElement(as ?? tag, rootProps, children);
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
function toRenderProps(ownProps, props, children) {
|
|
13
|
-
return {
|
|
14
|
-
...ownProps,
|
|
15
|
-
props,
|
|
16
|
-
children
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
function createComponent(nameOrConfigOrRenderFn, renderFnArg) {
|
|
20
|
-
let nameOrConfig;
|
|
21
|
-
let renderFn = null;
|
|
22
|
-
let isRenderFunctionAuthoringCall = false;
|
|
23
|
-
if (typeof nameOrConfigOrRenderFn === "function") {
|
|
24
|
-
isRenderFunctionAuthoringCall = true;
|
|
25
|
-
renderFn = nameOrConfigOrRenderFn;
|
|
26
|
-
nameOrConfig = inferComponentNameFromRenderFn(nameOrConfigOrRenderFn);
|
|
27
|
-
} else if (typeof nameOrConfigOrRenderFn === "string") {
|
|
28
|
-
if (typeof renderFnArg === "function") throw new Error("createComponent(\"Name\", renderFn) is no longer supported. Use createComponent(renderFn).");
|
|
29
|
-
renderFn = createPrimitiveRenderFn(typeof renderFnArg === "string" ? renderFnArg : nameOrConfigOrRenderFn);
|
|
30
|
-
nameOrConfig = nameOrConfigOrRenderFn;
|
|
31
|
-
} else {
|
|
32
|
-
nameOrConfig = nameOrConfigOrRenderFn;
|
|
33
|
-
if (typeof renderFnArg === "function") renderFn = renderFnArg;
|
|
34
|
-
else if (typeof renderFnArg === "string") renderFn = createPrimitiveRenderFn(renderFnArg);
|
|
35
|
-
}
|
|
36
|
-
if (!renderFn) throw new Error("createComponent requires a render function or a tag");
|
|
37
|
-
const config = assertTransformedConfig(nameOrConfig);
|
|
38
|
-
const { name, element, slots, variants, defaultVariants, ownPropKeys, motion } = config;
|
|
39
|
-
const shouldPassThroughFallbackProps = config._udsUntransformed === true && isRenderFunctionAuthoringCall;
|
|
40
|
-
const styler = createComponentStyler(name, slots, element, variants);
|
|
41
|
-
const ownPropKeySet = new Set(ownPropKeys);
|
|
42
|
-
const slotNameSet = new Set(slots);
|
|
43
|
-
const Component = (props) => {
|
|
44
|
-
const { ownProps, resolveProps, children, injectedClassName, userMotionConfig, slotOverrides } = partitionMergedProps({
|
|
45
|
-
...defaultVariants,
|
|
46
|
-
...props
|
|
47
|
-
}, ownPropKeySet, slotNameSet);
|
|
48
|
-
if (shouldPassThroughFallbackProps) {
|
|
49
|
-
const { slotProps, extractedOwnProps } = buildUntransformedSlotProps(resolveProps, injectedClassName, processStyleProps);
|
|
50
|
-
return renderFn(toRenderProps({
|
|
51
|
-
...ownProps,
|
|
52
|
-
...extractedOwnProps
|
|
53
|
-
}, slotProps, children));
|
|
54
|
-
}
|
|
55
|
-
const { classes: resolvedClasses, htmlProps, className: resolvedClassName } = styler.resolve(resolveProps);
|
|
56
|
-
const classes = mergeRootClassName(resolvedClasses, injectedClassName);
|
|
57
|
-
const mergedRootClassName = [resolvedClassName, injectedClassName].filter(Boolean).join(" ").trim();
|
|
58
|
-
const mergedMotionConfig = mergeMotionConfig(motion, userMotionConfig);
|
|
59
|
-
const finalSlotProps = mergeSlotMotionProps(applySlotOverrides(buildSlotProps(slots, classes, htmlProps, mergedRootClassName || void 0), slotOverrides, processStyleProps), mergedMotionConfig);
|
|
60
|
-
return renderFn(toRenderProps(ownProps, finalSlotProps, children));
|
|
61
|
-
};
|
|
62
|
-
Component.displayName = name;
|
|
63
|
-
Component.__udsVariantValues = config.variantValues;
|
|
64
|
-
return Component;
|
|
65
|
-
}
|
|
66
|
-
//#endregion
|
|
67
|
-
export { createComponent };
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { ComponentProps, ComponentType } from "react";
|
|
2
|
-
|
|
3
|
-
//#region ../core/dist/createComponentExample.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Extracts variant fixtures from a Component's props type.
|
|
6
|
-
* If Button has `variant?: 'brand' | 'outline'` and `size?: 'sm' | 'md'`,
|
|
7
|
-
* fixtures becomes `{ variant: ('brand' | 'outline')[], size: ('sm' | 'md')[] }`.
|
|
8
|
-
*/
|
|
9
|
-
type VariantFixtures<TComponent extends ComponentType<any>> = { [K in keyof ComponentProps<TComponent> as ComponentProps<TComponent>[K] extends string | undefined ? K extends 'children' | 'className' | 'style' | `on${string}` | `aria-${string}` | `data-${string}` | keyof React.JSX.IntrinsicElements['div'] ? never : K : never]: NonNullable<ComponentProps<TComponent>[K]>[] };
|
|
10
|
-
type ExampleProps<TComponent extends ComponentType<any>> = Partial<ComponentProps<TComponent>>;
|
|
11
|
-
type ExampleFn<TComponent extends ComponentType<any>> = ComponentType<ExampleProps<TComponent>>;
|
|
12
|
-
interface ComponentExample<T extends Record<string, ComponentType<any>>> {
|
|
13
|
-
componentName: string;
|
|
14
|
-
examples: T;
|
|
15
|
-
icon?: string;
|
|
16
|
-
minWidth?: number;
|
|
17
|
-
subcomponents: ComponentExample<any>[];
|
|
18
|
-
}
|
|
19
|
-
/** Return type of the examples callback — example fns plus optional metadata. */
|
|
20
|
-
type ExamplesResult<TComponent extends ComponentType<any>> = {
|
|
21
|
-
[key: string]: ExampleFn<TComponent> | string | number | ComponentExample<any>[] | undefined;
|
|
22
|
-
icon?: string;
|
|
23
|
-
minWidth?: number;
|
|
24
|
-
subcomponents?: ComponentExample<any>[];
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Define examples for a UDS component. Props and fixtures are automatically
|
|
28
|
-
* typed from the Component — no config import or manual annotations needed.
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* ```tsx
|
|
32
|
-
* export default createComponentExample(Button, (fixtures) => ({
|
|
33
|
-
* icon: 'M5 5h14v14H5V5zm3 3h8v8H8V8z',
|
|
34
|
-
* default: (props) => <Button variant="brand" {...props}>{props.children ?? 'Brand'}</Button>,
|
|
35
|
-
* anatomy: () => <Button>Default</Button>,
|
|
36
|
-
* }));
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
declare function createComponentExample<TComponent extends ComponentType<any>, T extends Record<string, ExampleFn<TComponent>>>(Component: TComponent, examplesFn: (fixtures: VariantFixtures<TComponent>) => ExamplesResult<TComponent>): ComponentExample<T>;
|
|
40
|
-
//#endregion
|
|
41
|
-
export { ComponentExample, createComponentExample };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
//#region ../core/dist/createComponentExample.js
|
|
2
|
-
/**
|
|
3
|
-
* Define examples for a UDS component. Props and fixtures are automatically
|
|
4
|
-
* typed from the Component — no config import or manual annotations needed.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```tsx
|
|
8
|
-
* export default createComponentExample(Button, (fixtures) => ({
|
|
9
|
-
* icon: 'M5 5h14v14H5V5zm3 3h8v8H8V8z',
|
|
10
|
-
* default: (props) => <Button variant="brand" {...props}>{props.children ?? 'Brand'}</Button>,
|
|
11
|
-
* anatomy: () => <Button>Default</Button>,
|
|
12
|
-
* }));
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
15
|
-
function createComponentExample(Component, examplesFn) {
|
|
16
|
-
const componentName = Component.displayName || Component.name || "Unknown";
|
|
17
|
-
const { icon, minWidth, subcomponents, ...examples } = examplesFn(Component.__udsVariantValues ?? {});
|
|
18
|
-
return {
|
|
19
|
-
componentName,
|
|
20
|
-
examples,
|
|
21
|
-
icon,
|
|
22
|
-
minWidth,
|
|
23
|
-
subcomponents: subcomponents ?? []
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
//#endregion
|
|
27
|
-
export { createComponentExample };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
//#region ../core/dist/createProvider.d.ts
|
|
2
|
-
type ProviderRenderFn<TContext, TProps = Record<never, never>> = (props: {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
} & TProps) => {
|
|
5
|
-
context: TContext;
|
|
6
|
-
render: React.ReactNode;
|
|
7
|
-
};
|
|
8
|
-
declare function createProvider<TContext, TProps = Record<never, never>>(name: string, renderFn: ProviderRenderFn<TContext, TProps>): [React.FC<{
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
} & TProps>, () => TContext];
|
|
11
|
-
//#endregion
|
|
12
|
-
export { createProvider };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { createContext, useContext } from "react";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
//#region ../core/dist/createProvider.js
|
|
5
|
-
function createProvider(name, renderFn) {
|
|
6
|
-
const Context = createContext(null);
|
|
7
|
-
function Provider(props) {
|
|
8
|
-
const result = renderFn(props);
|
|
9
|
-
return /* @__PURE__ */ jsx(Context.Provider, {
|
|
10
|
-
value: result.context,
|
|
11
|
-
children: result.render
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
Provider.displayName = `${name}Provider`;
|
|
15
|
-
Provider.__udsProvider = { name };
|
|
16
|
-
function useProviderContext() {
|
|
17
|
-
const ctx = useContext(Context);
|
|
18
|
-
if (!ctx) throw new Error(`use${name} must be used within ${name}Provider`);
|
|
19
|
-
return ctx;
|
|
20
|
-
}
|
|
21
|
-
return [Provider, useProviderContext];
|
|
22
|
-
}
|
|
23
|
-
//#endregion
|
|
24
|
-
export { createProvider };
|