@epilot/zenith-react 0.2.0-next.3 → 0.2.0-next.5
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/README.md +37 -1
- package/codemods/README.md +182 -0
- package/codemods/format.ts +86 -0
- package/codemods/migrate/base-elements/accordion.ts +132 -0
- package/codemods/migrate/base-elements/alert.ts +81 -0
- package/codemods/migrate/base-elements/avatar.ts +116 -0
- package/codemods/migrate/base-elements/button.ts +188 -0
- package/codemods/migrate/base-elements/checkbox.ts +17 -0
- package/codemods/migrate/base-elements/chip.ts +87 -0
- package/codemods/migrate/base-elements/chip360.ts +162 -0
- package/codemods/migrate/base-elements/circular-progress.ts +73 -0
- package/codemods/migrate/base-elements/dialog.ts +323 -0
- package/codemods/migrate/base-elements/divider.ts +61 -0
- package/codemods/migrate/base-elements/feedback-message.ts +95 -0
- package/codemods/migrate/base-elements/icon-button.ts +203 -0
- package/codemods/migrate/base-elements/index.ts +55 -0
- package/codemods/migrate/base-elements/mui-props.ts +29 -0
- package/codemods/migrate/base-elements/notification.ts +98 -0
- package/codemods/migrate/base-elements/paper.ts +78 -0
- package/codemods/migrate/base-elements/select.ts +328 -0
- package/codemods/migrate/base-elements/shared.ts +910 -0
- package/codemods/migrate/base-elements/skeleton.ts +83 -0
- package/codemods/migrate/base-elements/switch.ts +19 -0
- package/codemods/migrate/base-elements/tabs.ts +222 -0
- package/codemods/migrate/base-elements/text-field.ts +425 -0
- package/codemods/migrate/base-elements/toggle-button.ts +185 -0
- package/codemods/migrate/base-elements/tooltip.ts +231 -0
- package/codemods/migrate/base-elements/typography.ts +247 -0
- package/codemods/migrate/base-elements/unsupported.ts +277 -0
- package/codemods/migrate/from-base-elements.ts +26 -0
- package/codemods/migrate/from-volt.ts +26 -0
- package/codemods/migrate/lib/imports.ts +399 -0
- package/codemods/migrate/lib/jsx.ts +313 -0
- package/codemods/migrate/lib/run-migration.ts +528 -0
- package/codemods/migrate/lib/source.ts +6 -0
- package/codemods/migrate/lib/todo.ts +107 -0
- package/codemods/migrate/lib/types.ts +114 -0
- package/codemods/migrate/volt/class-helpers.ts +37 -0
- package/codemods/migrate/volt/index.ts +18 -0
- package/codemods/migrate/volt/pagination.ts +26 -0
- package/codemods/migrate/volt/same-name.ts +293 -0
- package/codemods/migrate/volt/stylesheets.ts +18 -0
- package/codemods/migrate/volt/tanstack-types.ts +20 -0
- package/codemods/radix-to-base-ui.ts +677 -0
- package/dist/_virtual/_zenith-runtime-family_accordion.js +7 -0
- package/dist/_virtual/_zenith-runtime-family_accordion.js.map +1 -0
- package/dist/_virtual/_zenith-runtime-family_alert-dialog.js +7 -0
- package/dist/_virtual/_zenith-runtime-family_alert-dialog.js.map +1 -0
- package/dist/_virtual/_zenith-runtime-family_avatar.js +7 -0
- package/dist/_virtual/_zenith-runtime-family_avatar.js.map +1 -0
- package/dist/_virtual/_zenith-runtime-family_button.js +7 -0
- package/dist/_virtual/_zenith-runtime-family_button.js.map +1 -0
- package/dist/_virtual/_zenith-runtime-family_checkbox.js +7 -0
- package/dist/_virtual/_zenith-runtime-family_checkbox.js.map +1 -0
- package/dist/_virtual/_zenith-runtime-family_csp-provider.js +7 -0
- package/dist/_virtual/_zenith-runtime-family_csp-provider.js.map +1 -0
- package/dist/_virtual/_zenith-runtime-family_dialog.js +7 -0
- package/dist/_virtual/_zenith-runtime-family_dialog.js.map +1 -0
- package/dist/_virtual/_zenith-runtime-family_direction-provider.js +8 -0
- package/dist/_virtual/_zenith-runtime-family_direction-provider.js.map +1 -0
- package/dist/_virtual/_zenith-runtime-family_menu.js +7 -0
- package/dist/_virtual/_zenith-runtime-family_menu.js.map +1 -0
- package/dist/_virtual/_zenith-runtime-family_merge-props.js +11 -0
- package/dist/_virtual/_zenith-runtime-family_merge-props.js.map +1 -0
- package/dist/_virtual/_zenith-runtime-family_popover.js +7 -0
- package/dist/_virtual/_zenith-runtime-family_popover.js.map +1 -0
- package/dist/_virtual/_zenith-runtime-family_radio-group.js +7 -0
- package/dist/_virtual/_zenith-runtime-family_radio-group.js.map +1 -0
- package/dist/_virtual/_zenith-runtime-family_radio.js +7 -0
- package/dist/_virtual/_zenith-runtime-family_radio.js.map +1 -0
- package/dist/_virtual/_zenith-runtime-family_scroll-area.js +7 -0
- package/dist/_virtual/_zenith-runtime-family_scroll-area.js.map +1 -0
- package/dist/_virtual/_zenith-runtime-family_select.js +7 -0
- package/dist/_virtual/_zenith-runtime-family_select.js.map +1 -0
- package/dist/_virtual/_zenith-runtime-family_separator.js +7 -0
- package/dist/_virtual/_zenith-runtime-family_separator.js.map +1 -0
- package/dist/_virtual/_zenith-runtime-family_switch.js +7 -0
- package/dist/_virtual/_zenith-runtime-family_switch.js.map +1 -0
- package/dist/_virtual/_zenith-runtime-family_tabs.js +7 -0
- package/dist/_virtual/_zenith-runtime-family_tabs.js.map +1 -0
- package/dist/_virtual/_zenith-runtime-family_toast.js +7 -0
- package/dist/_virtual/_zenith-runtime-family_toast.js.map +1 -0
- package/dist/_virtual/_zenith-runtime-family_toggle-group.js +7 -0
- package/dist/_virtual/_zenith-runtime-family_toggle-group.js.map +1 -0
- package/dist/_virtual/_zenith-runtime-family_toggle.js +7 -0
- package/dist/_virtual/_zenith-runtime-family_toggle.js.map +1 -0
- package/dist/_virtual/_zenith-runtime-family_tooltip.js +7 -0
- package/dist/_virtual/_zenith-runtime-family_tooltip.js.map +1 -0
- package/dist/_virtual/_zenith-runtime-family_use-render.js +7 -0
- package/dist/_virtual/_zenith-runtime-family_use-render.js.map +1 -0
- package/dist/components/accordion/accordion.js +179 -96
- package/dist/components/accordion/accordion.js.map +1 -1
- package/dist/components/alert-dialog/alert-dialog.js +243 -206
- package/dist/components/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/avatar/avatar.js +94 -82
- package/dist/components/avatar/avatar.js.map +1 -1
- package/dist/components/badge/badge.js +11 -11
- package/dist/components/breadcrumb/breadcrumb.js +69 -70
- package/dist/components/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/button/button.js +119 -102
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/checkbox/checkbox.js +68 -51
- package/dist/components/checkbox/checkbox.js.map +1 -1
- package/dist/components/date-range-picker/date-range-picker.js +100 -90
- package/dist/components/date-range-picker/date-range-picker.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker-input.js +118 -108
- package/dist/components/date-time-picker/date-time-picker-input.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker-panel.js +91 -94
- package/dist/components/date-time-picker/date-time-picker-panel.js.map +1 -1
- package/dist/components/dialog/dialog.js +238 -228
- package/dist/components/dialog/dialog.js.map +1 -1
- package/dist/components/drawer/drawer.js +259 -321
- package/dist/components/drawer/drawer.js.map +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.js +533 -279
- package/dist/components/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/components/field/field-combobox.js +205 -186
- package/dist/components/field/field-combobox.js.map +1 -1
- package/dist/components/field/field-select.js +37 -22
- package/dist/components/field/field-select.js.map +1 -1
- package/dist/components/list/list-sortable.js +104 -0
- package/dist/components/list/list-sortable.js.map +1 -0
- package/dist/components/list/list.js +246 -324
- package/dist/components/list/list.js.map +1 -1
- package/dist/components/option-card/option-card.js +121 -117
- package/dist/components/option-card/option-card.js.map +1 -1
- package/dist/components/pill/pill.js +7 -7
- package/dist/components/popover/popover.js +223 -127
- package/dist/components/popover/popover.js.map +1 -1
- package/dist/components/radio/radio-group-base.js +54 -0
- package/dist/components/radio/radio-group-base.js.map +1 -0
- package/dist/components/radio/radio.js +71 -60
- package/dist/components/radio/radio.js.map +1 -1
- package/dist/components/scroll-area/scroll-area.js +142 -108
- package/dist/components/scroll-area/scroll-area.js.map +1 -1
- package/dist/components/scroll-overflow/scroll-overflow.js +156 -127
- package/dist/components/scroll-overflow/scroll-overflow.js.map +1 -1
- package/dist/components/segmented-control/segmented-control.js +93 -81
- package/dist/components/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/select/select.js +485 -310
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/separator/separator.js.map +1 -1
- package/dist/components/slot/compose-as-child.js +15 -12
- package/dist/components/slot/compose-as-child.js.map +1 -1
- package/dist/components/switch/switch.js +75 -68
- package/dist/components/switch/switch.js.map +1 -1
- package/dist/components/table/table-pagination.js +212 -175
- package/dist/components/table/table-pagination.js.map +1 -1
- package/dist/components/tabs/tabs.js +193 -190
- package/dist/components/tabs/tabs.js.map +1 -1
- package/dist/components/toast/toast.js +610 -148
- package/dist/components/toast/toast.js.map +1 -1
- package/dist/components/toggle/toggle-group.js +143 -32
- package/dist/components/toggle/toggle-group.js.map +1 -1
- package/dist/components/toggle/toggle.js +82 -49
- package/dist/components/toggle/toggle.js.map +1 -1
- package/dist/components/tooltip/tooltip.js +298 -138
- package/dist/components/tooltip/tooltip.js.map +1 -1
- package/dist/index.d.ts +2336 -2130
- package/dist/index.js +24 -23
- package/dist/list/sortable/index.d.ts +29 -0
- package/dist/list/sortable/index.js +5 -0
- package/dist/{_virtual → list/sortable}/index.js.map +1 -1
- package/dist/packages/tokens/dist/delivery/index.js +10 -10
- package/dist/packages/tokens/dist/delivery/index.js.map +1 -1
- package/dist/packages/tokens/dist/generated/core.generated.js +6 -15
- package/dist/packages/tokens/dist/generated/core.generated.js.map +1 -1
- package/dist/packages/tokens/dist/generated/palette.generated.js +4 -5
- package/dist/packages/tokens/dist/generated/palette.generated.js.map +1 -1
- package/dist/packages/tokens/dist/generated/palette.meta.generated.js +5 -0
- package/dist/packages/tokens/dist/generated/palette.meta.generated.js.map +1 -0
- package/dist/packages/tokens/dist/install.js +40 -17
- package/dist/packages/tokens/dist/install.js.map +1 -1
- package/dist/renderer/runtime-contract.generated.js +8 -0
- package/dist/renderer/runtime-contract.generated.js.map +1 -0
- package/dist/renderer/served.js +39 -0
- package/dist/renderer/served.js.map +1 -0
- package/dist/tokens/core.meta.generated.js +2 -2
- package/dist/tokens/core.meta.generated.js.map +1 -1
- package/dist/tokens/index.d.ts +1028 -1028
- package/dist/tokens/index.js +863 -863
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/palette.meta.generated.js +5 -0
- package/dist/tokens/palette.meta.generated.js.map +1 -0
- package/dist/tokens.json +1 -1
- package/dist/vendor/.bun/@radix-ui_react-dialog@1.1.15_2b23df507bdda662/vendor/@radix-ui/react-dialog/dist/index.js +57 -62
- package/dist/vendor/.bun/@radix-ui_react-dialog@1.1.15_2b23df507bdda662/vendor/@radix-ui/react-dialog/dist/index.js.map +1 -1
- package/dist/vendor/.bun/@radix-ui_react-slot@1.2.3_0ac650c021fb1b59/vendor/@radix-ui/react-slot/dist/index.js +32 -38
- package/dist/vendor/.bun/@radix-ui_react-slot@1.2.3_0ac650c021fb1b59/vendor/@radix-ui/react-slot/dist/index.js.map +1 -1
- package/package.json +29 -21
- package/scripts/migration-diagnostics-core.mjs +302 -10
- package/scripts/migration-diagnostics.mjs +31 -8
- package/scripts/migration-sweep.mjs +10 -10
- package/testing/setup.cjs +87 -0
- package/dist/_virtual/index.js +0 -6
- package/dist/_virtual/index2.js +0 -5
- package/dist/_virtual/index2.js.map +0 -1
- package/dist/_virtual/use-sync-external-store-shim.development.js +0 -5
- package/dist/_virtual/use-sync-external-store-shim.development.js.map +0 -1
- package/dist/_virtual/use-sync-external-store-shim.production.js +0 -5
- package/dist/_virtual/use-sync-external-store-shim.production.js.map +0 -1
- package/dist/tokens/palette.generated.js +0 -5
- package/dist/tokens/palette.generated.js.map +0 -1
- package/dist/vendor/.bun/@floating-ui_core@1.8.0/vendor/@floating-ui/core/dist/floating-ui.core.js +0 -512
- package/dist/vendor/.bun/@floating-ui_core@1.8.0/vendor/@floating-ui/core/dist/floating-ui.core.js.map +0 -1
- package/dist/vendor/.bun/@floating-ui_dom@1.8.0/vendor/@floating-ui/dom/dist/floating-ui.dom.js +0 -396
- package/dist/vendor/.bun/@floating-ui_dom@1.8.0/vendor/@floating-ui/dom/dist/floating-ui.dom.js.map +0 -1
- package/dist/vendor/.bun/@floating-ui_react-dom@2.1.9_6f4b9a1cfb20c0ae/vendor/@floating-ui/react-dom/dist/floating-ui.react-dom.js +0 -233
- package/dist/vendor/.bun/@floating-ui_react-dom@2.1.9_6f4b9a1cfb20c0ae/vendor/@floating-ui/react-dom/dist/floating-ui.react-dom.js.map +0 -1
- package/dist/vendor/.bun/@floating-ui_utils@0.2.12/vendor/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -137
- package/dist/vendor/.bun/@floating-ui_utils@0.2.12/vendor/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +0 -1
- package/dist/vendor/.bun/@floating-ui_utils@0.2.12/vendor/@floating-ui/utils/dist/floating-ui.utils.js +0 -129
- package/dist/vendor/.bun/@floating-ui_utils@0.2.12/vendor/@floating-ui/utils/dist/floating-ui.utils.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_number@1.1.1/vendor/@radix-ui/number/dist/index.js +0 -7
- package/dist/vendor/.bun/@radix-ui_number@1.1.1/vendor/@radix-ui/number/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-accordion@1.2.12_2b23df507bdda662/vendor/@radix-ui/react-accordion/dist/index.js +0 -240
- package/dist/vendor/.bun/@radix-ui_react-accordion@1.2.12_2b23df507bdda662/vendor/@radix-ui/react-accordion/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-alert-dialog@1.1.15_2b23df507bdda662/vendor/@radix-ui/react-alert-dialog/dist/index.js +0 -128
- package/dist/vendor/.bun/@radix-ui_react-alert-dialog@1.1.15_2b23df507bdda662/vendor/@radix-ui/react-alert-dialog/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-arrow@1.1.7_2b23df507bdda662/vendor/@radix-ui/react-arrow/dist/index.js +0 -25
- package/dist/vendor/.bun/@radix-ui_react-arrow@1.1.7_2b23df507bdda662/vendor/@radix-ui/react-arrow/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-avatar@1.1.10_2b23df507bdda662/vendor/@radix-ui/react-avatar/dist/index.js +0 -76
- package/dist/vendor/.bun/@radix-ui_react-avatar@1.1.10_2b23df507bdda662/vendor/@radix-ui/react-avatar/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-checkbox@1.3.3_2b23df507bdda662/vendor/@radix-ui/react-checkbox/dist/index.js +0 -252
- package/dist/vendor/.bun/@radix-ui_react-checkbox@1.3.3_2b23df507bdda662/vendor/@radix-ui/react-checkbox/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-collapsible@1.1.12_2b23df507bdda662/vendor/@radix-ui/react-collapsible/dist/index.js +0 -121
- package/dist/vendor/.bun/@radix-ui_react-collapsible@1.1.12_2b23df507bdda662/vendor/@radix-ui/react-collapsible/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-collection@1.1.7_2b23df507bdda662/vendor/@radix-ui/react-collection/dist/index.js +0 -49
- package/dist/vendor/.bun/@radix-ui_react-collection@1.1.7_2b23df507bdda662/vendor/@radix-ui/react-collection/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-direction@1.1.1_0ac650c021fb1b59/vendor/@radix-ui/react-direction/dist/index.js +0 -11
- package/dist/vendor/.bun/@radix-ui_react-direction@1.1.1_0ac650c021fb1b59/vendor/@radix-ui/react-direction/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-dropdown-menu@2.1.16_2b23df507bdda662/vendor/@radix-ui/react-dropdown-menu/dist/index.js +0 -228
- package/dist/vendor/.bun/@radix-ui_react-dropdown-menu@2.1.16_2b23df507bdda662/vendor/@radix-ui/react-dropdown-menu/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-menu@2.1.16_2b23df507bdda662/vendor/@radix-ui/react-menu/dist/index.js +0 -653
- package/dist/vendor/.bun/@radix-ui_react-menu@2.1.16_2b23df507bdda662/vendor/@radix-ui/react-menu/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-popover@1.1.15_2b23df507bdda662/vendor/@radix-ui/react-popover/dist/index.js +0 -244
- package/dist/vendor/.bun/@radix-ui_react-popover@1.1.15_2b23df507bdda662/vendor/@radix-ui/react-popover/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-popper@1.2.8_2b23df507bdda662/vendor/@radix-ui/react-popper/dist/index.js +0 -222
- package/dist/vendor/.bun/@radix-ui_react-popper@1.2.8_2b23df507bdda662/vendor/@radix-ui/react-popper/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-radio-group@1.3.8_2b23df507bdda662/vendor/@radix-ui/react-radio-group/dist/index.js +0 -239
- package/dist/vendor/.bun/@radix-ui_react-radio-group@1.3.8_2b23df507bdda662/vendor/@radix-ui/react-radio-group/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-roving-focus@1.1.11_2b23df507bdda662/vendor/@radix-ui/react-roving-focus/dist/index.js +0 -184
- package/dist/vendor/.bun/@radix-ui_react-roving-focus@1.1.11_2b23df507bdda662/vendor/@radix-ui/react-roving-focus/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-scroll-area@1.2.10_2b23df507bdda662/vendor/@radix-ui/react-scroll-area/dist/index.js +0 -535
- package/dist/vendor/.bun/@radix-ui_react-scroll-area@1.2.10_2b23df507bdda662/vendor/@radix-ui/react-scroll-area/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-select@2.2.6_2b23df507bdda662/vendor/@radix-ui/react-select/dist/index.js +0 -863
- package/dist/vendor/.bun/@radix-ui_react-select@2.2.6_2b23df507bdda662/vendor/@radix-ui/react-select/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-slot@1.2.4_0ac650c021fb1b59/vendor/@radix-ui/react-slot/dist/index.js +0 -63
- package/dist/vendor/.bun/@radix-ui_react-slot@1.2.4_0ac650c021fb1b59/vendor/@radix-ui/react-slot/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-switch@1.2.6_2b23df507bdda662/vendor/@radix-ui/react-switch/dist/index.js +0 -133
- package/dist/vendor/.bun/@radix-ui_react-switch@1.2.6_2b23df507bdda662/vendor/@radix-ui/react-switch/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-tabs@1.1.13_2b23df507bdda662/vendor/@radix-ui/react-tabs/dist/index.js +0 -164
- package/dist/vendor/.bun/@radix-ui_react-tabs@1.1.13_2b23df507bdda662/vendor/@radix-ui/react-tabs/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-toggle-group@1.1.11_2b23df507bdda662/vendor/@radix-ui/react-toggle-group/dist/index.js +0 -138
- package/dist/vendor/.bun/@radix-ui_react-toggle-group@1.1.11_2b23df507bdda662/vendor/@radix-ui/react-toggle-group/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-toggle@1.1.10_2b23df507bdda662/vendor/@radix-ui/react-toggle/dist/index.js +0 -34
- package/dist/vendor/.bun/@radix-ui_react-toggle@1.1.10_2b23df507bdda662/vendor/@radix-ui/react-toggle/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-tooltip@1.2.8_2b23df507bdda662/vendor/@radix-ui/react-tooltip/dist/index.js +0 -340
- package/dist/vendor/.bun/@radix-ui_react-tooltip@1.2.8_2b23df507bdda662/vendor/@radix-ui/react-tooltip/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-use-is-hydrated@0.1.0_0ac650c021fb1b59/vendor/@radix-ui/react-use-is-hydrated/dist/index.js +0 -16
- package/dist/vendor/.bun/@radix-ui_react-use-is-hydrated@0.1.0_0ac650c021fb1b59/vendor/@radix-ui/react-use-is-hydrated/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-use-previous@1.1.1_0ac650c021fb1b59/vendor/@radix-ui/react-use-previous/dist/index.js +0 -9
- package/dist/vendor/.bun/@radix-ui_react-use-previous@1.1.1_0ac650c021fb1b59/vendor/@radix-ui/react-use-previous/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-use-size@1.1.1_0ac650c021fb1b59/vendor/@radix-ui/react-use-size/dist/index.js +0 -28
- package/dist/vendor/.bun/@radix-ui_react-use-size@1.1.1_0ac650c021fb1b59/vendor/@radix-ui/react-use-size/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-visually-hidden@1.2.3_2b23df507bdda662/vendor/@radix-ui/react-visually-hidden/dist/index.js +0 -33
- package/dist/vendor/.bun/@radix-ui_react-visually-hidden@1.2.3_2b23df507bdda662/vendor/@radix-ui/react-visually-hidden/dist/index.js.map +0 -1
- package/dist/vendor/.bun/sonner@2.0.7_6f4b9a1cfb20c0ae/vendor/sonner/dist/index.js +0 -747
- package/dist/vendor/.bun/sonner@2.0.7_6f4b9a1cfb20c0ae/vendor/sonner/dist/index.js.map +0 -1
- package/dist/vendor/.bun/use-sync-external-store@1.7.0_62547eec5a2188e3/vendor/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +0 -68
- package/dist/vendor/.bun/use-sync-external-store@1.7.0_62547eec5a2188e3/vendor/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +0 -1
- package/dist/vendor/.bun/use-sync-external-store@1.7.0_62547eec5a2188e3/vendor/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -56
- package/dist/vendor/.bun/use-sync-external-store@1.7.0_62547eec5a2188e3/vendor/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +0 -1
- package/dist/vendor/.bun/use-sync-external-store@1.7.0_62547eec5a2188e3/vendor/use-sync-external-store/shim/index.js +0 -11
- package/dist/vendor/.bun/use-sync-external-store@1.7.0_62547eec5a2188e3/vendor/use-sync-external-store/shim/index.js.map +0 -1
|
@@ -29,6 +29,22 @@ export const RULES = [
|
|
|
29
29
|
description:
|
|
30
30
|
'A decorative (non-core) token family is used, with varying confidence that a correctly-scoped install call covers it (high confidence for no local evidence at all, down to low for an unresolved dynamic path). This rule NEVER reports severity "error": local absence of an install call does not prove a bootstrap/provider install does not exist elsewhere — this is single-source analysis with no cross-file tracing, so it cannot assert a definite defect, only flag what needs verification. Core families (accent/gray/error/warning/success/info) are excluded — they load by default. Requires an injected TypeScript module (see requiresTypeScript).',
|
|
31
31
|
},
|
|
32
|
+
{
|
|
33
|
+
code: "radix-data-state-selector",
|
|
34
|
+
title: "Radix-era data-state selector or query",
|
|
35
|
+
defaultSeverity: "warning",
|
|
36
|
+
requiresTypeScript: false,
|
|
37
|
+
description:
|
|
38
|
+
"A `data-state` attribute selector, Tailwind `data-[state=…]` variant, JSX attribute or test query reads a state Radix set (`open`, `closed`, `checked`, `active`, `on`, …). The Base UI parts carry one attribute per state instead (`data-open`, `data-checked`, `data-active`, `data-pressed`, …), so the selector stops matching after the upgrade; the suggestion names the replacement per family (RADIX_RENAMES, the upgrade guide's table). A warning, not an error: Zenith's own List, Table and DataTable keep their `data-state` values, and a selector alone does not say which element it targets.",
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
code: "radix-css-variable",
|
|
42
|
+
title: "Radix-era --radix-* CSS variable",
|
|
43
|
+
defaultSeverity: "error",
|
|
44
|
+
requiresTypeScript: false,
|
|
45
|
+
description:
|
|
46
|
+
"A `--radix-*` custom property (`--radix-popover-content-transform-origin`, `--radix-select-trigger-width`, `--radix-accordion-content-height`, …) is read. Base UI publishes none of them; the positioner and panel variables have new names (`--transform-origin`, `--available-width`, `--anchor-width`, `--accordion-panel-height`, …), which the suggestion gives.",
|
|
47
|
+
},
|
|
32
48
|
]
|
|
33
49
|
|
|
34
50
|
/** ts/tsx/js/jsx — the extensions `unestablished-palette-install` can parse. Exported so the
|
|
@@ -165,9 +181,277 @@ function textualFindings(identity, fileLabel, raw) {
|
|
|
165
181
|
)
|
|
166
182
|
}
|
|
167
183
|
|
|
184
|
+
findings.push(...radixFindings(identity, fileLabel, stripped, lineOf, colOf))
|
|
185
|
+
return findings
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// ---------------------------------------------------------------------------
|
|
189
|
+
// Rule 4 + 5: Radix-era state attributes and CSS variables (textual, comment-stripped)
|
|
190
|
+
// ---------------------------------------------------------------------------
|
|
191
|
+
|
|
192
|
+
/** The Zenith parts an overlay-style `data-state="open|closed"` became `data-open`/`data-closed` on. */
|
|
193
|
+
const OPEN_CLOSED_PARTS = [
|
|
194
|
+
"Dialog",
|
|
195
|
+
"AlertDialog",
|
|
196
|
+
"Drawer",
|
|
197
|
+
"Popover",
|
|
198
|
+
"FieldCombobox",
|
|
199
|
+
"Tooltip",
|
|
200
|
+
"DropdownMenu content and sub content",
|
|
201
|
+
"Select content",
|
|
202
|
+
"Accordion item and panel",
|
|
203
|
+
]
|
|
204
|
+
const POPUP_TRIGGERS = [
|
|
205
|
+
"Dialog trigger",
|
|
206
|
+
"AlertDialog trigger",
|
|
207
|
+
"Drawer trigger",
|
|
208
|
+
"Popover trigger",
|
|
209
|
+
"Tooltip trigger",
|
|
210
|
+
"DropdownMenu trigger and sub trigger",
|
|
211
|
+
"Select trigger",
|
|
212
|
+
]
|
|
213
|
+
const CHECKED_PARTS = [
|
|
214
|
+
"Checkbox",
|
|
215
|
+
"Switch (root and thumb)",
|
|
216
|
+
"Radio",
|
|
217
|
+
"SegmentedControl",
|
|
218
|
+
"DropdownMenu checkbox and radio items",
|
|
219
|
+
]
|
|
220
|
+
|
|
221
|
+
/** The Radix primitive names Zenith's positioned families used in their `--radix-*` variables. */
|
|
222
|
+
export const RADIX_VARIABLE_FAMILIES = [
|
|
223
|
+
{ radix: "popover", zenith: "Popover, FieldCombobox" },
|
|
224
|
+
{ radix: "dropdown-menu", zenith: "DropdownMenu" },
|
|
225
|
+
{ radix: "select", zenith: "Select" },
|
|
226
|
+
{ radix: "tooltip", zenith: "Tooltip" },
|
|
227
|
+
]
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* The attribute and CSS-variable renames of the Base UI port (DECISIONS.md D12), one row per
|
|
231
|
+
* Radix name and Base UI replacement. The rules below match on these, and
|
|
232
|
+
* `renderRadixRenamesMarkdown()` prints the upgrade guide's table from them, so the two cannot
|
|
233
|
+
* drift. Family names are Zenith's; `<family>` in a variable name stands for one of
|
|
234
|
+
* RADIX_VARIABLE_FAMILIES. A `baseUi` of null means the state has no attribute any more: it is
|
|
235
|
+
* the part without the other one (`:not([data-active])`).
|
|
236
|
+
*/
|
|
237
|
+
export const RADIX_RENAMES = {
|
|
238
|
+
attributes: [
|
|
239
|
+
{ value: "open", baseUi: "data-open", parts: OPEN_CLOSED_PARTS },
|
|
240
|
+
{ value: "open", baseUi: "data-popup-open", parts: POPUP_TRIGGERS },
|
|
241
|
+
{ value: "open", baseUi: "data-panel-open", parts: ["Accordion trigger"] },
|
|
242
|
+
{ value: "closed", baseUi: "data-closed", parts: OPEN_CLOSED_PARTS },
|
|
243
|
+
{ value: "delayed-open", baseUi: "data-open", parts: ["Tooltip"] },
|
|
244
|
+
{ value: "instant-open", baseUi: "data-open", parts: ["Tooltip"] },
|
|
245
|
+
{ value: "checked", baseUi: "data-checked", parts: CHECKED_PARTS },
|
|
246
|
+
{ value: "checked", baseUi: "data-selected", parts: ["Select item"] },
|
|
247
|
+
{ value: "unchecked", baseUi: "data-unchecked", parts: CHECKED_PARTS },
|
|
248
|
+
{
|
|
249
|
+
value: "indeterminate",
|
|
250
|
+
baseUi: "data-indeterminate",
|
|
251
|
+
parts: ["Checkbox"],
|
|
252
|
+
},
|
|
253
|
+
{ value: "active", baseUi: "data-active", parts: ["Tabs trigger"] },
|
|
254
|
+
{
|
|
255
|
+
value: "inactive",
|
|
256
|
+
baseUi: null,
|
|
257
|
+
parts: ["Tabs trigger"],
|
|
258
|
+
note: "the trigger without `data-active`",
|
|
259
|
+
},
|
|
260
|
+
{ value: "on", baseUi: "data-pressed", parts: ["Toggle", "OptionCard"] },
|
|
261
|
+
{
|
|
262
|
+
value: "off",
|
|
263
|
+
baseUi: null,
|
|
264
|
+
parts: ["Toggle", "OptionCard"],
|
|
265
|
+
note: "the part without `data-pressed`",
|
|
266
|
+
},
|
|
267
|
+
],
|
|
268
|
+
variables: [
|
|
269
|
+
{
|
|
270
|
+
radix: "--radix-<family>-content-transform-origin",
|
|
271
|
+
baseUi: "--transform-origin",
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
radix: "--radix-<family>-content-available-width",
|
|
275
|
+
baseUi: "--available-width",
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
radix: "--radix-<family>-content-available-height",
|
|
279
|
+
baseUi: "--available-height",
|
|
280
|
+
},
|
|
281
|
+
{ radix: "--radix-<family>-trigger-width", baseUi: "--anchor-width" },
|
|
282
|
+
{ radix: "--radix-<family>-trigger-height", baseUi: "--anchor-height" },
|
|
283
|
+
{
|
|
284
|
+
radix: "--radix-accordion-content-height",
|
|
285
|
+
baseUi: "--accordion-panel-height",
|
|
286
|
+
parts: ["Accordion panel"],
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
radix: "--radix-accordion-content-width",
|
|
290
|
+
baseUi: "--accordion-panel-width",
|
|
291
|
+
parts: ["Accordion panel"],
|
|
292
|
+
},
|
|
293
|
+
],
|
|
294
|
+
/** Attributes the port left alone, for the table's footnote. */
|
|
295
|
+
unchanged: [
|
|
296
|
+
"data-highlighted",
|
|
297
|
+
"data-side",
|
|
298
|
+
"data-orientation",
|
|
299
|
+
"data-disabled",
|
|
300
|
+
"data-slot",
|
|
301
|
+
],
|
|
302
|
+
/** New under Base UI: a part entering or leaving carries one of these while it transitions. */
|
|
303
|
+
added: ["data-starting-style", "data-ending-style"],
|
|
304
|
+
/** Zenith's own parts that still set `data-state`, with the values they use. */
|
|
305
|
+
keptDataState: [
|
|
306
|
+
{ part: "List group", values: ["open", "closed"] },
|
|
307
|
+
{ part: "Table row and DataTable row", values: ["selected"] },
|
|
308
|
+
{ part: "DataTable body", values: ["loading", "error", "empty"] },
|
|
309
|
+
],
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
const RADIX_STATE_VALUES = new Set(RADIX_RENAMES.attributes.map((a) => a.value))
|
|
313
|
+
/** `open` and `closed` are also Zenith's List values, so a hit on them is only probably Radix. */
|
|
314
|
+
const SHARED_STATE_VALUES = new Set(
|
|
315
|
+
RADIX_RENAMES.keptDataState
|
|
316
|
+
.flatMap((k) => k.values)
|
|
317
|
+
.filter((v) => RADIX_STATE_VALUES.has(v))
|
|
318
|
+
)
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* `data-state` wherever consumer code spells it: an attribute selector (`[data-state="open"]`,
|
|
322
|
+
* `[data-state=open]`, inside a CSS-in-JS string too), a JSX attribute, a Tailwind variant
|
|
323
|
+
* (`data-[state=open]:…`) and a test query (`toHaveAttribute("data-state", "open")`,
|
|
324
|
+
* `getAttribute("data-state")`). Group 1: the Tailwind value; 3: the selector or attribute
|
|
325
|
+
* value; 4: the query's value argument.
|
|
326
|
+
*/
|
|
327
|
+
const DATA_STATE_RE =
|
|
328
|
+
/data-\[state=([a-z-]+)\]|\bdata-state\b(?![a-z0-9-])(?:\s*[~|^$*]?=\s*(["']?)([a-z-]+)\2|["']\s*,\s*["']([a-z-]+)["'])?/g
|
|
329
|
+
const RADIX_VAR_RE = /--radix-[a-z0-9-]+/g
|
|
330
|
+
|
|
331
|
+
const familyPattern = `(?<family>${RADIX_VARIABLE_FAMILIES.map((f) => f.radix).join("|")})`
|
|
332
|
+
const VARIABLE_MATCHERS = RADIX_RENAMES.variables.map((v) => ({
|
|
333
|
+
...v,
|
|
334
|
+
re: new RegExp(`^${v.radix.replace("<family>", familyPattern)}$`),
|
|
335
|
+
}))
|
|
336
|
+
|
|
337
|
+
const describeParts = (parts) => parts.join(", ")
|
|
338
|
+
|
|
339
|
+
/** What replaces `data-state="<value>"`, per family, or null for a value Radix never set. */
|
|
340
|
+
export function dataStateReplacement(value) {
|
|
341
|
+
if (!value) {
|
|
342
|
+
return "one attribute per state on the Base UI part: data-open/data-closed (overlays, Accordion), data-popup-open (triggers), data-checked/data-unchecked (Checkbox, Switch, Radio, SegmentedControl, menu items), data-selected (Select item), data-active (Tabs), data-pressed (Toggle, OptionCard); see the upgrade guide's rename table."
|
|
343
|
+
}
|
|
344
|
+
const rows = RADIX_RENAMES.attributes.filter((a) => a.value === value)
|
|
345
|
+
if (!rows.length) return null
|
|
346
|
+
return rows
|
|
347
|
+
.map((r) =>
|
|
348
|
+
r.baseUi
|
|
349
|
+
? `${r.baseUi} on ${describeParts(r.parts)}`
|
|
350
|
+
: `no attribute on ${describeParts(r.parts)} (${r.note})`
|
|
351
|
+
)
|
|
352
|
+
.join("; ")
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/** The Base UI variable for a `--radix-*` name, or null when no Zenith family used it. */
|
|
356
|
+
export function radixVariableReplacement(name) {
|
|
357
|
+
for (const m of VARIABLE_MATCHERS) {
|
|
358
|
+
const hit = m.re.exec(name)
|
|
359
|
+
if (!hit) continue
|
|
360
|
+
const family = hit.groups?.family
|
|
361
|
+
const parts = family
|
|
362
|
+
? RADIX_VARIABLE_FAMILIES.find((f) => f.radix === family).zenith
|
|
363
|
+
: describeParts(m.parts)
|
|
364
|
+
return { baseUi: m.baseUi, parts }
|
|
365
|
+
}
|
|
366
|
+
return null
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
function radixFindings(identity, fileLabel, stripped, lineOf, colOf) {
|
|
370
|
+
const findings = []
|
|
371
|
+
for (const m of stripped.matchAll(DATA_STATE_RE)) {
|
|
372
|
+
const value = m[1] ?? m[3] ?? m[4]
|
|
373
|
+
if (value && !RADIX_STATE_VALUES.has(value)) continue // Zenith's own values (selected, loading, …)
|
|
374
|
+
const replacement = dataStateReplacement(value)
|
|
375
|
+
findings.push(
|
|
376
|
+
makeFinding(identity, {
|
|
377
|
+
code: "radix-data-state-selector",
|
|
378
|
+
severity: "warning",
|
|
379
|
+
confidence:
|
|
380
|
+
!value || SHARED_STATE_VALUES.has(value) ? "medium" : "high",
|
|
381
|
+
file: fileLabel,
|
|
382
|
+
line: lineOf(m.index),
|
|
383
|
+
column: colOf(m.index),
|
|
384
|
+
evidence: m[0],
|
|
385
|
+
explanation: value
|
|
386
|
+
? `Radix set data-state="${value}"; the Base UI part carries a dedicated attribute instead, so this selector or query matches nothing after the upgrade.${SHARED_STATE_VALUES.has(value) ? " Zenith's List still uses this value on its groups; leave the selector if it targets one." : ""}`
|
|
387
|
+
: "Radix set data-state on every stateful part; the Base UI parts carry one attribute per state instead. Zenith's List, Table and DataTable keep their own data-state values, so check what this reads.",
|
|
388
|
+
suggestion: `Use ${replacement}.`,
|
|
389
|
+
})
|
|
390
|
+
)
|
|
391
|
+
}
|
|
392
|
+
for (const m of stripped.matchAll(RADIX_VAR_RE)) {
|
|
393
|
+
const replacement = radixVariableReplacement(m[0])
|
|
394
|
+
findings.push(
|
|
395
|
+
makeFinding(identity, {
|
|
396
|
+
code: "radix-css-variable",
|
|
397
|
+
severity: "error",
|
|
398
|
+
confidence: "high",
|
|
399
|
+
file: fileLabel,
|
|
400
|
+
line: lineOf(m.index),
|
|
401
|
+
column: colOf(m.index),
|
|
402
|
+
evidence: m[0],
|
|
403
|
+
explanation:
|
|
404
|
+
"Base UI publishes no --radix-* custom property, so this resolves to nothing after the upgrade.",
|
|
405
|
+
suggestion: replacement
|
|
406
|
+
? `Read ${replacement.baseUi} instead (${replacement.parts}).`
|
|
407
|
+
: "No Zenith family sets a Base UI counterpart for this variable; the declaration that reads it needs another source.",
|
|
408
|
+
})
|
|
409
|
+
)
|
|
410
|
+
}
|
|
168
411
|
return findings
|
|
169
412
|
}
|
|
170
413
|
|
|
414
|
+
/** The upgrade guide's rename table, from RADIX_RENAMES: one Markdown document with two tables. */
|
|
415
|
+
export function renderRadixRenamesMarkdown() {
|
|
416
|
+
const code = (s) => `\`${s}\``
|
|
417
|
+
const attributeRows = RADIX_RENAMES.attributes.map(
|
|
418
|
+
(a) =>
|
|
419
|
+
`| ${code(`data-state="${a.value}"`)} | ${a.baseUi ? code(a.baseUi) : `none (${a.note})`} | ${describeParts(a.parts)} |`
|
|
420
|
+
)
|
|
421
|
+
const variableRows = RADIX_RENAMES.variables.map((v) => {
|
|
422
|
+
const parts = v.parts
|
|
423
|
+
? describeParts(v.parts)
|
|
424
|
+
: RADIX_VARIABLE_FAMILIES.map((f) => f.zenith).join(", ")
|
|
425
|
+
return `| ${code(v.radix)} | ${code(v.baseUi)} | ${parts} |`
|
|
426
|
+
})
|
|
427
|
+
const families = RADIX_VARIABLE_FAMILIES.map(
|
|
428
|
+
(f) => `${code(f.radix)} (${f.zenith})`
|
|
429
|
+
).join(", ")
|
|
430
|
+
const kept = RADIX_RENAMES.keptDataState
|
|
431
|
+
.map((k) => `${k.part} (${k.values.map((v) => code(`"${v}"`)).join(", ")})`)
|
|
432
|
+
.join("; ")
|
|
433
|
+
return [
|
|
434
|
+
"<!-- Generated by packages/react/scripts/migration-renames.mjs from RADIX_RENAMES in migration-diagnostics-core.mjs. Do not edit; run `bun scripts/migration-renames.mjs --write`. -->",
|
|
435
|
+
"",
|
|
436
|
+
"### State attributes",
|
|
437
|
+
"",
|
|
438
|
+
"| Radix | Base UI | Zenith parts |",
|
|
439
|
+
"| --- | --- | --- |",
|
|
440
|
+
...attributeRows,
|
|
441
|
+
"",
|
|
442
|
+
`${RADIX_RENAMES.added.map(code).join(" and ")} are new: a part carries one while it enters or leaves. ${RADIX_RENAMES.unchanged.map(code).join(", ")} and the ${code("aria-*")} attributes are unchanged. Zenith's own parts keep ${code("data-state")}: ${kept}.`,
|
|
443
|
+
"",
|
|
444
|
+
"### CSS variables",
|
|
445
|
+
"",
|
|
446
|
+
"| Radix | Base UI | Zenith parts |",
|
|
447
|
+
"| --- | --- | --- |",
|
|
448
|
+
...variableRows,
|
|
449
|
+
"",
|
|
450
|
+
`${code("<family>")} is ${families}.`,
|
|
451
|
+
"",
|
|
452
|
+
].join("\n")
|
|
453
|
+
}
|
|
454
|
+
|
|
171
455
|
// ---------------------------------------------------------------------------
|
|
172
456
|
// Rule 3: syntax-aware (TypeScript AST) palette-install analysis
|
|
173
457
|
// ---------------------------------------------------------------------------
|
|
@@ -397,6 +681,13 @@ function createScopeHelpers(ts) {
|
|
|
397
681
|
}
|
|
398
682
|
}
|
|
399
683
|
|
|
684
|
+
/** The package's palette installers. `preparePaletteTokens` is the awaitable `ensurePaletteTokens`. */
|
|
685
|
+
const PALETTE_INSTALLERS = new Set([
|
|
686
|
+
"ensurePaletteTokens",
|
|
687
|
+
"ensurePaletteTokensFor",
|
|
688
|
+
"preparePaletteTokens",
|
|
689
|
+
])
|
|
690
|
+
|
|
400
691
|
/** Collects trusted import bindings (installer, namespace, individual token names) — value-only:
|
|
401
692
|
* a `import type {...}` clause or a `import { type X }` specifier is never trusted as a runtime
|
|
402
693
|
* binding, since it cannot be called/read at runtime (and using it as if it could is itself a
|
|
@@ -406,9 +697,9 @@ function collectBindings(sf, ts, identity) {
|
|
|
406
697
|
identity.packageName,
|
|
407
698
|
`${identity.packageName}/tokens`,
|
|
408
699
|
])
|
|
409
|
-
// local (possibly aliased) name -> the ORIGINAL imported symbol (
|
|
410
|
-
//
|
|
411
|
-
//
|
|
700
|
+
// local (possibly aliased) name -> the ORIGINAL imported symbol (one of PALETTE_INSTALLERS).
|
|
701
|
+
// installDecorativeStatus must key off this canonical name, never the local spelling —
|
|
702
|
+
// `import { ensurePaletteTokens as install }` is a genuine, correct install.
|
|
412
703
|
const installerNames = new Map()
|
|
413
704
|
const namespaceNames = new Set()
|
|
414
705
|
const tokenBindings = new Map()
|
|
@@ -429,10 +720,7 @@ function collectBindings(sf, ts, identity) {
|
|
|
429
720
|
if (el.isTypeOnly) continue
|
|
430
721
|
const imported = (el.propertyName ?? el.name).text
|
|
431
722
|
const local = el.name.text
|
|
432
|
-
if (
|
|
433
|
-
imported === "ensurePaletteTokens" ||
|
|
434
|
-
imported === "ensurePaletteTokensFor"
|
|
435
|
-
) {
|
|
723
|
+
if (PALETTE_INSTALLERS.has(imported)) {
|
|
436
724
|
installerNames.set(local, imported)
|
|
437
725
|
} else if (imported === "tokens") {
|
|
438
726
|
// `export * as tokens from "./tokens"` at the package root — a named import of this
|
|
@@ -471,7 +759,12 @@ function installDecorativeStatus(call, ts, identity, bindings) {
|
|
|
471
759
|
// uses the real member name.
|
|
472
760
|
canonicalName = callee.name.text
|
|
473
761
|
}
|
|
474
|
-
|
|
762
|
+
// Both install the whole sheet whatever they are passed.
|
|
763
|
+
if (
|
|
764
|
+
canonicalName === "ensurePaletteTokens" ||
|
|
765
|
+
canonicalName === "preparePaletteTokens"
|
|
766
|
+
)
|
|
767
|
+
return "confirmed"
|
|
475
768
|
if (canonicalName === "ensurePaletteTokensFor") {
|
|
476
769
|
const arg = call.arguments[0]
|
|
477
770
|
if (!arg) return "not-decorative"
|
|
@@ -499,8 +792,7 @@ function isTrustedInstallerCall(call, ts, scope, bindings) {
|
|
|
499
792
|
return (
|
|
500
793
|
bindings.namespaceNames.has(objName) &&
|
|
501
794
|
!scope.isShadowedBeforeSourceFile(callee.expression, objName) &&
|
|
502
|
-
(callee.name.text
|
|
503
|
-
callee.name.text === "ensurePaletteTokensFor")
|
|
795
|
+
PALETTE_INSTALLERS.has(callee.name.text)
|
|
504
796
|
)
|
|
505
797
|
}
|
|
506
798
|
return false
|
|
@@ -62,23 +62,46 @@ export function resolveGeneratedTokenFile(packageDir, file) {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
|
-
* The generated token module, then
|
|
66
|
-
*
|
|
67
|
-
*
|
|
65
|
+
* The generated token module, then every other shipped copy of its literals: the
|
|
66
|
+
* `<name>.meta.generated.js` identity module beside it, and the `dist/tokens` stubs of both. The
|
|
67
|
+
* build tree-shakes literals a module does not use (the lazy palette chunk keeps only its CSS; its
|
|
68
|
+
* NS and SHEET_HASH ship in the meta modules), so the identity check reads them all. Throws like
|
|
69
|
+
* resolveGeneratedTokenFile.
|
|
68
70
|
*/
|
|
69
71
|
export function generatedTokenFiles(packageDir, file) {
|
|
70
72
|
const found = resolveGeneratedTokenFile(packageDir, file)
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
const meta = file.replace(/\.generated\.js$/, ".meta.generated.js")
|
|
74
|
+
const shippedDir = found.relativePath.slice(0, -file.length - 1)
|
|
75
|
+
const copies = new Set([
|
|
76
|
+
`${shippedDir}/${meta}`,
|
|
77
|
+
`${LEGACY_TOKEN_DIR}/${file}`,
|
|
78
|
+
`${LEGACY_TOKEN_DIR}/${meta}`,
|
|
79
|
+
])
|
|
80
|
+
copies.delete(found.relativePath)
|
|
81
|
+
return [
|
|
82
|
+
found,
|
|
83
|
+
...[...copies]
|
|
84
|
+
.filter((relativePath) => existsSync(join(packageDir, relativePath)))
|
|
85
|
+
.map((relativePath) => ({
|
|
86
|
+
full: join(packageDir, relativePath),
|
|
87
|
+
relativePath,
|
|
88
|
+
})),
|
|
89
|
+
]
|
|
75
90
|
}
|
|
76
91
|
|
|
77
92
|
function readGeneratedFamilies(packageDir, file) {
|
|
78
93
|
const { full, relativePath } = resolveGeneratedTokenFile(packageDir, file)
|
|
79
94
|
const content = readFileSync(full, "utf8")
|
|
95
|
+
// A module whose sheet the runtime serves (D13) lists its families instead of carrying the
|
|
96
|
+
// declarations; an older package carries the sheet, whose declarations name the families.
|
|
97
|
+
// The bundler may rename the binding (`const r = Object.freeze([...]); export { r as FAMILIES }`).
|
|
98
|
+
const listed =
|
|
99
|
+
/\bFAMILIES\b/.test(content) &&
|
|
100
|
+
/Object\.freeze\(\[((?:\s*"[a-z]+"\s*,?)+)\]\)/.exec(content)
|
|
80
101
|
const families = new Set(
|
|
81
|
-
|
|
102
|
+
listed
|
|
103
|
+
? [...listed[1].matchAll(/"([a-z]+)"/g)].map((m) => m[1])
|
|
104
|
+
: [...content.matchAll(/--zenith-[a-z0-9]+-([a-z]+)-/g)].map((m) => m[1])
|
|
82
105
|
)
|
|
83
106
|
if (families.size === 0) {
|
|
84
107
|
throw new Error(
|
|
@@ -16,6 +16,14 @@ import {
|
|
|
16
16
|
const DEFAULT_PACKAGE_DIR = resolve(import.meta.dirname, "..")
|
|
17
17
|
const KNOWN_FLAGS = new Set(["--json", "--package", "--exclude"])
|
|
18
18
|
|
|
19
|
+
/** One finding: where and what, then the fix on its own line so the text report carries it too. */
|
|
20
|
+
function printFinding(f) {
|
|
21
|
+
console.log(
|
|
22
|
+
` [${f.severity}] ${f.code.padEnd(28)} ${f.file}:${f.line}:${f.column} ${f.evidence}`
|
|
23
|
+
)
|
|
24
|
+
if (f.suggestion) console.log(` → ${f.suggestion}`)
|
|
25
|
+
}
|
|
26
|
+
|
|
19
27
|
function usage() {
|
|
20
28
|
return (
|
|
21
29
|
"usage: node migration-sweep.mjs [--json] [--package <dir>] [--exclude <path>]... <path> [...]\n" +
|
|
@@ -157,11 +165,7 @@ export async function runCli(argv) {
|
|
|
157
165
|
? ` (${r.findings.length} finding(s) from the rules that did run, below)`
|
|
158
166
|
: "")
|
|
159
167
|
)
|
|
160
|
-
for (const f of r.findings)
|
|
161
|
-
console.log(
|
|
162
|
-
` [${f.severity}] ${f.code.padEnd(28)} ${f.file}:${f.line}:${f.column} ${f.evidence}`
|
|
163
|
-
)
|
|
164
|
-
}
|
|
168
|
+
for (const f of r.findings) printFinding(f)
|
|
165
169
|
continue
|
|
166
170
|
}
|
|
167
171
|
if (!r.findings.length) {
|
|
@@ -171,11 +175,7 @@ export async function runCli(argv) {
|
|
|
171
175
|
continue
|
|
172
176
|
}
|
|
173
177
|
console.log(` ✗ ${name} — ${r.findings.length} finding(s)`)
|
|
174
|
-
for (const f of r.findings)
|
|
175
|
-
console.log(
|
|
176
|
-
` [${f.severity}] ${f.code.padEnd(28)} ${f.file}:${f.line}:${f.column} ${f.evidence}`
|
|
177
|
-
)
|
|
178
|
-
}
|
|
178
|
+
for (const f of r.findings) printFinding(f)
|
|
179
179
|
}
|
|
180
180
|
console.log("")
|
|
181
181
|
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test setup for consumers of this package, for Vitest and Jest alike.
|
|
3
|
+
*
|
|
4
|
+
* WHY THIS EXISTS. Base UI, which sits under Switch, Checkbox, Radio and Select, re-dispatches a
|
|
5
|
+
* label's click as `new PointerEvent("click")`, the event type browsers use for clicks. jsdom
|
|
6
|
+
* added `PointerEvent` in 27; on an older jsdom (26 and below) the constructor does not exist, the
|
|
7
|
+
* dispatch throws, and the click never reaches the control. Nothing is wrong in the app.
|
|
8
|
+
*
|
|
9
|
+
* It installs a `PointerEvent` only where there is none. It mirrors Chromium's defaults for
|
|
10
|
+
* `new PointerEvent(type)`, and steps aside wherever the environment already has one, so it is
|
|
11
|
+
* safe to keep after a jsdom upgrade. It does nothing outside a DOM (a Node test environment).
|
|
12
|
+
*
|
|
13
|
+
* USAGE
|
|
14
|
+
*
|
|
15
|
+
* // vitest.config.ts
|
|
16
|
+
* export default defineConfig({
|
|
17
|
+
* test: {
|
|
18
|
+
* environment: "jsdom",
|
|
19
|
+
* setupFiles: ["@epilot/zenith-react/testing/setup.cjs"],
|
|
20
|
+
* },
|
|
21
|
+
* })
|
|
22
|
+
*
|
|
23
|
+
* // jest.config.cjs
|
|
24
|
+
* const griffel = require("@epilot/zenith-react/testing/jest-preset.cjs")
|
|
25
|
+
*
|
|
26
|
+
* module.exports = griffel.withGriffel(
|
|
27
|
+
* {
|
|
28
|
+
* testEnvironment: "jsdom",
|
|
29
|
+
* setupFiles: ["@epilot/zenith-react/testing/setup.cjs"],
|
|
30
|
+
* // Jest 28+ resolves package exports with the `require` condition, which
|
|
31
|
+
* // @epilot/zenith-react does not have: without the mapping the first import
|
|
32
|
+
* // fails with "Cannot find module".
|
|
33
|
+
* moduleNameMapper: {
|
|
34
|
+
* "^@epilot/zenith-react$":
|
|
35
|
+
* "<rootDir>/node_modules/@epilot/zenith-react/dist/index.js",
|
|
36
|
+
* "^@epilot/zenith-runtime/v1$":
|
|
37
|
+
* "<rootDir>/node_modules/@epilot/zenith-runtime/dist/v1/index.js",
|
|
38
|
+
* },
|
|
39
|
+
* },
|
|
40
|
+
* { alsoTransform: ["@epilot/zenith-runtime", "@base-ui", "@floating-ui"] }
|
|
41
|
+
* )
|
|
42
|
+
*
|
|
43
|
+
* Keep it in `setupFiles` (it runs before the test framework and the first import of a component);
|
|
44
|
+
* a setup run later still works, but a module that read `PointerEvent` at import time would not
|
|
45
|
+
* see it.
|
|
46
|
+
*/
|
|
47
|
+
function installPointerEvent(scope) {
|
|
48
|
+
if (typeof scope.MouseEvent === "undefined") return false
|
|
49
|
+
if (typeof scope.PointerEvent !== "undefined") return false
|
|
50
|
+
|
|
51
|
+
class PointerEvent extends scope.MouseEvent {
|
|
52
|
+
constructor(type, init = {}) {
|
|
53
|
+
super(type, init)
|
|
54
|
+
this.pointerId = init.pointerId ?? 0
|
|
55
|
+
this.width = init.width ?? 1
|
|
56
|
+
this.height = init.height ?? 1
|
|
57
|
+
this.pressure = init.pressure ?? 0
|
|
58
|
+
this.tangentialPressure = init.tangentialPressure ?? 0
|
|
59
|
+
this.tiltX = init.tiltX ?? 0
|
|
60
|
+
this.tiltY = init.tiltY ?? 0
|
|
61
|
+
this.twist = init.twist ?? 0
|
|
62
|
+
this.pointerType = init.pointerType ?? ""
|
|
63
|
+
this.isPrimary = init.isPrimary ?? false
|
|
64
|
+
this._coalescedEvents = init.coalescedEvents ?? []
|
|
65
|
+
this._predictedEvents = init.predictedEvents ?? []
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
getCoalescedEvents() {
|
|
69
|
+
return [...this._coalescedEvents]
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
getPredictedEvents() {
|
|
73
|
+
return [...this._predictedEvents]
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
scope.PointerEvent = PointerEvent
|
|
78
|
+
// Vitest copies the jsdom window onto `globalThis` once; the class has to reach both.
|
|
79
|
+
if (typeof globalThis !== "undefined" && globalThis !== scope) {
|
|
80
|
+
globalThis.PointerEvent = PointerEvent
|
|
81
|
+
}
|
|
82
|
+
return true
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (typeof window !== "undefined") installPointerEvent(window)
|
|
86
|
+
|
|
87
|
+
module.exports = { installPointerEvent }
|
package/dist/_virtual/index.js
DELETED
package/dist/_virtual/index2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-sync-external-store-shim.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-sync-external-store-shim.production.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|