@epilot/zenith-react 0.2.0-next.3 → 0.2.0-next.4
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 +25 -0
- package/codemods/README.md +168 -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 +20 -0
- package/codemods/migrate/from-volt.ts +20 -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 +389 -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 +87 -77
- package/dist/components/field/field-combobox.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 +83 -53
- 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 +2335 -2129
- 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 +34 -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 +28 -21
- package/scripts/migration-diagnostics-core.mjs +18 -10
- package/scripts/migration-diagnostics.mjs +31 -8
- 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
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { mergeClasses as p, SLOT_ATTR as s, shorthands as
|
|
4
|
-
import { makeZenithStyles as
|
|
5
|
-
import { boxModel as
|
|
6
|
-
import { grayDefault as
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
import { jsx as o, jsxs as W } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import { mergeClasses as p, SLOT_ATTR as s, shorthands as l } from "@epilot/zenith-runtime/v1";
|
|
4
|
+
import { makeZenithStyles as w } from "../../styles/make-styles.js";
|
|
5
|
+
import { boxModel as k } from "../../styles/host-reset.js";
|
|
6
|
+
import { grayDefault as v, fontWeightSemibold as S, accentA8 as A, grayLight as C, leadingBase as L, textBase as D, spacingElement1 as I, spacingElement2 as R } from "../../tokens/index.js";
|
|
7
|
+
import { ComposeAsChild as E } from "../slot/compose-as-child.js";
|
|
8
|
+
function O(c) {
|
|
9
|
+
const e = i.Children.toArray(c);
|
|
10
|
+
return e.length === 1 ? e[0] : c;
|
|
11
|
+
}
|
|
12
|
+
const T = w({
|
|
9
13
|
// A truncating crumb can only shrink if every box above it may shrink below its content too. The
|
|
10
14
|
// nav is the box a flex row (a view header) actually sizes, so it carries the rule; plain trails
|
|
11
15
|
// keep their content size.
|
|
@@ -15,142 +19,137 @@ const k = L({
|
|
|
15
19
|
}
|
|
16
20
|
},
|
|
17
21
|
list: {
|
|
18
|
-
...
|
|
22
|
+
...k,
|
|
19
23
|
// A layout row, not a numbered list: reset the browser's markers and indent so the trail does
|
|
20
24
|
// not depend on the host shipping a CSS reset.
|
|
21
25
|
listStyleType: "none",
|
|
22
|
-
...
|
|
23
|
-
...
|
|
26
|
+
...l.margin(0),
|
|
27
|
+
...l.padding(0),
|
|
24
28
|
display: "flex",
|
|
25
29
|
alignItems: "center",
|
|
26
30
|
// gap-2
|
|
27
|
-
...
|
|
31
|
+
...l.gap(R),
|
|
28
32
|
fontSize: D,
|
|
29
|
-
lineHeight:
|
|
33
|
+
lineHeight: L,
|
|
30
34
|
minWidth: 0
|
|
31
35
|
},
|
|
32
36
|
separator: {
|
|
33
|
-
color:
|
|
37
|
+
color: C
|
|
34
38
|
},
|
|
35
39
|
item: {
|
|
36
40
|
display: "inline-flex",
|
|
37
41
|
alignItems: "center",
|
|
38
42
|
// gap-1
|
|
39
|
-
...
|
|
43
|
+
...l.gap(I)
|
|
40
44
|
},
|
|
41
45
|
itemTruncate: {
|
|
42
|
-
...
|
|
46
|
+
...k,
|
|
43
47
|
minWidth: 0
|
|
44
48
|
},
|
|
45
49
|
truncate: {
|
|
46
|
-
...
|
|
50
|
+
...l.overflow("hidden"),
|
|
47
51
|
textOverflow: "ellipsis",
|
|
48
52
|
whiteSpace: "nowrap"
|
|
49
53
|
},
|
|
50
54
|
link: {
|
|
51
55
|
// A browser underlines a bare `<a>`; the underline is a hover affordance here.
|
|
52
56
|
textDecorationLine: "none",
|
|
53
|
-
fontWeight:
|
|
54
|
-
color:
|
|
57
|
+
fontWeight: S,
|
|
58
|
+
color: C,
|
|
55
59
|
transitionProperty: "color, background-color, border-color, text-decoration-color, fill, stroke",
|
|
56
60
|
transitionDuration: "150ms",
|
|
57
61
|
transitionTimingFunction: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
58
62
|
cursor: "pointer",
|
|
59
63
|
":hover": {
|
|
60
|
-
color:
|
|
64
|
+
color: v,
|
|
61
65
|
textDecorationLine: "underline"
|
|
62
66
|
},
|
|
63
67
|
":focus-visible": {
|
|
64
68
|
outlineWidth: "2px",
|
|
65
69
|
outlineStyle: "solid",
|
|
66
70
|
outlineOffset: "2px",
|
|
67
|
-
outlineColor:
|
|
71
|
+
outlineColor: A
|
|
68
72
|
}
|
|
69
73
|
},
|
|
70
74
|
page: {
|
|
71
|
-
fontWeight:
|
|
72
|
-
color:
|
|
75
|
+
fontWeight: S,
|
|
76
|
+
color: v
|
|
73
77
|
}
|
|
74
|
-
}),
|
|
78
|
+
}), V = i.forwardRef(
|
|
75
79
|
function({
|
|
76
|
-
separator:
|
|
77
|
-
"aria-label":
|
|
78
|
-
className:
|
|
80
|
+
separator: e = "/",
|
|
81
|
+
"aria-label": m = "Breadcrumb",
|
|
82
|
+
className: d,
|
|
79
83
|
children: t,
|
|
80
|
-
...
|
|
81
|
-
},
|
|
82
|
-
const
|
|
84
|
+
...b
|
|
85
|
+
}, a) {
|
|
86
|
+
const n = T(), f = i.Children.toArray(t).filter(i.isValidElement);
|
|
83
87
|
return /* @__PURE__ */ o(
|
|
84
88
|
"nav",
|
|
85
89
|
{
|
|
86
|
-
ref:
|
|
90
|
+
ref: a,
|
|
87
91
|
"data-slot": "breadcrumb",
|
|
88
92
|
[s]: "breadcrumb",
|
|
89
|
-
"aria-label":
|
|
90
|
-
className: p(
|
|
91
|
-
...
|
|
92
|
-
children: /* @__PURE__ */ o("ol", { className:
|
|
93
|
-
|
|
93
|
+
"aria-label": m,
|
|
94
|
+
className: p(n.root, d),
|
|
95
|
+
...b,
|
|
96
|
+
children: /* @__PURE__ */ o("ol", { className: n.list, children: f.map((g, r) => /* @__PURE__ */ W(i.Fragment, { children: [
|
|
97
|
+
r > 0 && /* @__PURE__ */ o(
|
|
94
98
|
"li",
|
|
95
99
|
{
|
|
96
100
|
role: "presentation",
|
|
97
101
|
"aria-hidden": "true",
|
|
98
|
-
className:
|
|
99
|
-
children:
|
|
102
|
+
className: n.separator,
|
|
103
|
+
children: e
|
|
100
104
|
}
|
|
101
105
|
),
|
|
102
|
-
|
|
103
|
-
] },
|
|
106
|
+
g
|
|
107
|
+
] }, r)) })
|
|
104
108
|
}
|
|
105
109
|
);
|
|
106
110
|
}
|
|
107
|
-
),
|
|
108
|
-
href:
|
|
109
|
-
isCurrent:
|
|
110
|
-
className:
|
|
111
|
+
), Z = i.forwardRef(function({
|
|
112
|
+
href: e,
|
|
113
|
+
isCurrent: m = !1,
|
|
114
|
+
className: d,
|
|
111
115
|
children: t,
|
|
112
|
-
asChild:
|
|
113
|
-
truncate:
|
|
114
|
-
title:
|
|
115
|
-
...
|
|
116
|
-
},
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
...c ? { "aria-current": "page" } : {},
|
|
126
|
-
...b,
|
|
127
|
-
children: t
|
|
128
|
-
}
|
|
129
|
-
) : /* @__PURE__ */ o(
|
|
116
|
+
asChild: b = !1,
|
|
117
|
+
truncate: a = !1,
|
|
118
|
+
title: n,
|
|
119
|
+
...f
|
|
120
|
+
}, g) {
|
|
121
|
+
const r = T(), B = !!e, h = a ? r.truncate : void 0, u = n ?? (a && (typeof t == "string" || typeof t == "number") ? String(t) : void 0), y = {
|
|
122
|
+
"data-slot": "breadcrumb-link",
|
|
123
|
+
[s]: "breadcrumb-link",
|
|
124
|
+
...e ? { href: e } : {},
|
|
125
|
+
...u !== void 0 ? { title: u } : {},
|
|
126
|
+
...m ? { "aria-current": "page" } : {},
|
|
127
|
+
...f
|
|
128
|
+
}, x = p(r.link, h, d), N = b ? /* @__PURE__ */ o(E, { ...y, className: x, children: O(t) }) : B ? /* @__PURE__ */ o("a", { ...y, className: x, children: t }) : /* @__PURE__ */ o(
|
|
130
129
|
"span",
|
|
131
130
|
{
|
|
132
131
|
"data-slot": "breadcrumb-page",
|
|
133
132
|
[s]: "breadcrumb-page",
|
|
134
|
-
className: p(
|
|
133
|
+
className: p(r.page, h, d),
|
|
135
134
|
...u !== void 0 ? { title: u } : {},
|
|
136
|
-
...
|
|
135
|
+
...m ? { "aria-current": "page" } : {},
|
|
137
136
|
children: t
|
|
138
137
|
}
|
|
139
138
|
);
|
|
140
139
|
return /* @__PURE__ */ o(
|
|
141
140
|
"li",
|
|
142
141
|
{
|
|
143
|
-
ref:
|
|
142
|
+
ref: g,
|
|
144
143
|
"data-slot": "breadcrumb-item",
|
|
145
144
|
[s]: "breadcrumb-item",
|
|
146
|
-
...
|
|
147
|
-
className: p(
|
|
148
|
-
children:
|
|
145
|
+
...a ? { "data-truncate": "" } : {},
|
|
146
|
+
className: p(r.item, a && r.itemTruncate),
|
|
147
|
+
children: N
|
|
149
148
|
}
|
|
150
149
|
);
|
|
151
150
|
});
|
|
152
151
|
export {
|
|
153
|
-
|
|
154
|
-
|
|
152
|
+
V as Breadcrumb,
|
|
153
|
+
Z as BreadcrumbItem
|
|
155
154
|
};
|
|
156
155
|
//# sourceMappingURL=breadcrumb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumb.js","sources":["../../../src/components/breadcrumb/breadcrumb.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel } from \"../../styles/host-reset\"\nimport * as tokens from \"../../tokens\"\nimport { Slot } from \"@radix-ui/react-slot\"\n\n/** Breadcrumb — Card's compound pattern applied to the nav / ol / li structure. */\n\nexport type BreadcrumbProps = React.ComponentProps<\"nav\"> & {\n separator?: React.ReactNode\n /**\n * Accessible name of the navigation landmark, read by screen readers. Pass a translated string\n * for any locale other than English. Defaults to \"Breadcrumb\".\n */\n \"aria-label\"?: string\n}\n\nconst useStyles = makeZenithStyles({\n // A truncating crumb can only shrink if every box above it may shrink below its content too. The\n // nav is the box a flex row (a view header) actually sizes, so it carries the rule; plain trails\n // keep their content size.\n root: {\n [`&:has([${SLOT_ATTR}=\"breadcrumb-item\"][data-truncate])`]: {\n minWidth: 0,\n },\n },\n list: {\n ...boxModel,\n // A layout row, not a numbered list: reset the browser's markers and indent so the trail does\n // not depend on the host shipping a CSS reset.\n listStyleType: \"none\",\n ...shorthands.margin(0),\n ...shorthands.padding(0),\n display: \"flex\",\n alignItems: \"center\",\n // gap-2\n ...shorthands.gap(tokens.spacingElement2),\n fontSize: tokens.textBase,\n lineHeight: tokens.leadingBase,\n minWidth: 0,\n },\n separator: {\n color: tokens.grayLight,\n },\n item: {\n display: \"inline-flex\",\n alignItems: \"center\",\n // gap-1\n ...shorthands.gap(tokens.spacingElement1),\n },\n itemTruncate: {\n ...boxModel,\n minWidth: 0,\n },\n truncate: {\n ...shorthands.overflow(\"hidden\"),\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n },\n link: {\n // A browser underlines a bare `<a>`; the underline is a hover affordance here.\n textDecorationLine: \"none\",\n fontWeight: tokens.fontWeightSemibold,\n color: tokens.grayLight,\n transitionProperty:\n \"color, background-color, border-color, text-decoration-color, fill, stroke\",\n transitionDuration: \"150ms\",\n transitionTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n cursor: \"pointer\",\n \":hover\": {\n color: tokens.grayDefault,\n textDecorationLine: \"underline\",\n },\n \":focus-visible\": {\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineOffset: \"2px\",\n outlineColor: tokens.accentA8,\n },\n },\n page: {\n fontWeight: tokens.fontWeightSemibold,\n color: tokens.grayDefault,\n },\n})\n\nexport const Breadcrumb = React.forwardRef<HTMLElement, BreadcrumbProps>(\n function Breadcrumb(\n {\n separator = \"/\",\n \"aria-label\": ariaLabel = \"Breadcrumb\",\n className,\n children,\n ...props\n },\n ref\n ) {\n const styles = useStyles()\n const items = React.Children.toArray(children).filter(React.isValidElement)\n\n return (\n <nav\n ref={ref}\n data-slot=\"breadcrumb\"\n {...{ [SLOT_ATTR]: \"breadcrumb\" }}\n aria-label={ariaLabel}\n className={mergeClasses(styles.root, className)}\n {...props}\n >\n <ol className={styles.list}>\n {items.map((child, index) => (\n <React.Fragment key={index}>\n {index > 0 && (\n <li\n role=\"presentation\"\n aria-hidden=\"true\"\n className={styles.separator}\n >\n {separator}\n </li>\n )}\n {child}\n </React.Fragment>\n ))}\n </ol>\n </nav>\n )\n }\n)\n\nexport type BreadcrumbItemProps = Omit<React.ComponentProps<\"a\">, \"href\"> & {\n href?: string\n isCurrent?: boolean\n /**\n * Render the child instead of the built-in `a`, keeping the link styling and slot markers. This\n * is how a consumer supplies a router link. v1 supports it; it was dropped here while the package\n * was on Base UI and restored once it moved back to Radix.\n */\n asChild?: boolean\n /**\n * Keep the crumb on one line and cut it with an ellipsis when the trail runs out of room, with\n * the full text as its `title`. Pass `title` yourself when the children are not plain text.\n */\n truncate?: boolean\n}\n\nexport const BreadcrumbItem = React.forwardRef<\n HTMLLIElement,\n BreadcrumbItemProps\n>(function BreadcrumbItem(\n {\n href,\n isCurrent = false,\n className,\n children,\n asChild = false,\n truncate = false,\n title,\n ...props\n },\n ref\n) {\n const styles = useStyles()\n const isLink = !!href\n\n const LinkRoot = asChild ? Slot : \"a\"\n const truncateClass = truncate ? styles.truncate : undefined\n const fullText =\n title ??\n (truncate && (typeof children === \"string\" || typeof children === \"number\")\n ? String(children)\n : undefined)\n\n const content =\n isLink || asChild ? (\n <LinkRoot\n data-slot=\"breadcrumb-link\"\n {...{ [SLOT_ATTR]: \"breadcrumb-link\" }}\n {...(href ? { href } : {})}\n className={mergeClasses(styles.link, truncateClass, className)}\n {...(fullText !== undefined ? { title: fullText } : {})}\n {...(isCurrent ? { \"aria-current\": \"page\" as const } : {})}\n {...props}\n >\n {children}\n </LinkRoot>\n ) : (\n <span\n data-slot=\"breadcrumb-page\"\n {...{ [SLOT_ATTR]: \"breadcrumb-page\" }}\n className={mergeClasses(styles.page, truncateClass, className)}\n {...(fullText !== undefined ? { title: fullText } : {})}\n {...(isCurrent ? { \"aria-current\": \"page\" as const } : {})}\n >\n {children}\n </span>\n )\n\n return (\n <li\n ref={ref}\n data-slot=\"breadcrumb-item\"\n {...{ [SLOT_ATTR]: \"breadcrumb-item\" }}\n {...(truncate ? { \"data-truncate\": \"\" } : {})}\n className={mergeClasses(styles.item, truncate && styles.itemTruncate)}\n >\n {content}\n </li>\n )\n})\n"],"names":["useStyles","makeZenithStyles","SLOT_ATTR","boxModel","shorthands","tokens.spacingElement2","tokens.textBase","tokens.leadingBase","tokens.grayLight","tokens.spacingElement1","tokens.fontWeightSemibold","tokens.grayDefault","tokens.accentA8","Breadcrumb","React","separator","ariaLabel","className","children","props","ref","styles","items","jsx","mergeClasses","child","index","jsxs","BreadcrumbItem","href","isCurrent","asChild","truncate","title","isLink","LinkRoot","Slot","truncateClass","fullText","content"],"mappings":";;;;;;;AAqBA,MAAMA,IAAYC,EAAiB;AAAA;AAAA;AAAA;AA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AUH,IACR,gBAAAR;AAAA,IAACY;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACJ,CAACjC,CAAS,GAAG;AAAA,MAClB,GAAI2B,IAAO,EAAE,MAAAA,EAAA,IAAS,CAAA;AAAA,MACvB,WAAWL,EAAaH,EAAO,MAAMgB,GAAepB,CAAS;AAAA,MAC5D,GAAIqB,MAAa,SAAY,EAAE,OAAOA,EAAA,IAAa,CAAA;AAAA,MACnD,GAAIR,IAAY,EAAE,gBAAgB,OAAA,IAAoB,CAAA;AAAA,MACtD,GAAGX;AAAA,MAEH,UAAAD;AAAA,IAAA;AAAA,EAAA,IAGH,gBAAAK;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACJ,CAACrB,CAAS,GAAG;AAAA,MACnB,WAAWsB,EAAaH,EAAO,MAAMgB,GAAepB,CAAS;AAAA,MAC5D,GAAIqB,MAAa,SAAY,EAAE,OAAOA,EAAA,IAAa,CAAA;AAAA,MACnD,GAAIR,IAAY,EAAE,gBAAgB,OAAA,IAAoB,CAAA;AAAA,MAEtD,UAAAZ;AAAA,IAAA;AAAA,EAAA;AAIP,SACE,gBAAAK;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAH;AAAA,MACA,aAAU;AAAA,MACJ,CAAClB,CAAS,GAAG;AAAA,MAClB,GAAI8B,IAAW,EAAE,iBAAiB,GAAA,IAAO,CAAA;AAAA,MAC1C,WAAWR,EAAaH,EAAO,MAAMW,KAAYX,EAAO,YAAY;AAAA,MAEnE,UAAAkB;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
|
|
1
|
+
{"version":3,"file":"breadcrumb.js","sources":["../../../src/components/breadcrumb/breadcrumb.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel } from \"../../styles/host-reset\"\nimport * as tokens from \"../../tokens\"\nimport { ComposeAsChild } from \"../slot/compose-as-child\"\n\n/** Breadcrumb — Card's compound pattern applied to the nav / ol / li structure. */\n\n// A single child can arrive wrapped in a one-element array depending on the JSX runtime (MDX call\n// sites do this), which `React.Children.only` rejects. Radix's Slot normalised that.\nfunction onlyChild(children: React.ReactNode) {\n const elements = React.Children.toArray(children)\n return (elements.length === 1 ? elements[0] : children) as React.ReactElement\n}\n\nexport type BreadcrumbProps = React.ComponentProps<\"nav\"> & {\n separator?: React.ReactNode\n /**\n * Accessible name of the navigation landmark, read by screen readers. Pass a translated string\n * for any locale other than English. Defaults to \"Breadcrumb\".\n */\n \"aria-label\"?: string\n}\n\nconst useStyles = makeZenithStyles({\n // A truncating crumb can only shrink if every box above it may shrink below its content too. The\n // nav is the box a flex row (a view header) actually sizes, so it carries the rule; plain trails\n // keep their content size.\n root: {\n [`&:has([${SLOT_ATTR}=\"breadcrumb-item\"][data-truncate])`]: {\n minWidth: 0,\n },\n },\n list: {\n ...boxModel,\n // A layout row, not a numbered list: reset the browser's markers and indent so the trail does\n // not depend on the host shipping a CSS reset.\n listStyleType: \"none\",\n ...shorthands.margin(0),\n ...shorthands.padding(0),\n display: \"flex\",\n alignItems: \"center\",\n // gap-2\n ...shorthands.gap(tokens.spacingElement2),\n fontSize: tokens.textBase,\n lineHeight: tokens.leadingBase,\n minWidth: 0,\n },\n separator: {\n color: tokens.grayLight,\n },\n item: {\n display: \"inline-flex\",\n alignItems: \"center\",\n // gap-1\n ...shorthands.gap(tokens.spacingElement1),\n },\n itemTruncate: {\n ...boxModel,\n minWidth: 0,\n },\n truncate: {\n ...shorthands.overflow(\"hidden\"),\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n },\n link: {\n // A browser underlines a bare `<a>`; the underline is a hover affordance here.\n textDecorationLine: \"none\",\n fontWeight: tokens.fontWeightSemibold,\n color: tokens.grayLight,\n transitionProperty:\n \"color, background-color, border-color, text-decoration-color, fill, stroke\",\n transitionDuration: \"150ms\",\n transitionTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n cursor: \"pointer\",\n \":hover\": {\n color: tokens.grayDefault,\n textDecorationLine: \"underline\",\n },\n \":focus-visible\": {\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineOffset: \"2px\",\n outlineColor: tokens.accentA8,\n },\n },\n page: {\n fontWeight: tokens.fontWeightSemibold,\n color: tokens.grayDefault,\n },\n})\n\nexport const Breadcrumb = React.forwardRef<HTMLElement, BreadcrumbProps>(\n function Breadcrumb(\n {\n separator = \"/\",\n \"aria-label\": ariaLabel = \"Breadcrumb\",\n className,\n children,\n ...props\n },\n ref\n ) {\n const styles = useStyles()\n const items = React.Children.toArray(children).filter(React.isValidElement)\n\n return (\n <nav\n ref={ref}\n data-slot=\"breadcrumb\"\n {...{ [SLOT_ATTR]: \"breadcrumb\" }}\n aria-label={ariaLabel}\n className={mergeClasses(styles.root, className)}\n {...props}\n >\n <ol className={styles.list}>\n {items.map((child, index) => (\n <React.Fragment key={index}>\n {index > 0 && (\n <li\n role=\"presentation\"\n aria-hidden=\"true\"\n className={styles.separator}\n >\n {separator}\n </li>\n )}\n {child}\n </React.Fragment>\n ))}\n </ol>\n </nav>\n )\n }\n)\n\nexport type BreadcrumbItemProps = Omit<React.ComponentProps<\"a\">, \"href\"> & {\n href?: string\n isCurrent?: boolean\n /**\n * Render the child instead of the built-in `a`, keeping the link styling and slot markers. This\n * is how a consumer supplies a router link. The child must be one real element, not a Fragment.\n */\n asChild?: boolean\n /**\n * Keep the crumb on one line and cut it with an ellipsis when the trail runs out of room, with\n * the full text as its `title`. Pass `title` yourself when the children are not plain text.\n */\n truncate?: boolean\n}\n\nexport const BreadcrumbItem = React.forwardRef<\n HTMLLIElement,\n BreadcrumbItemProps\n>(function BreadcrumbItem(\n {\n href,\n isCurrent = false,\n className,\n children,\n asChild = false,\n truncate = false,\n title,\n ...props\n },\n ref\n) {\n const styles = useStyles()\n const isLink = !!href\n\n const truncateClass = truncate ? styles.truncate : undefined\n const fullText =\n title ??\n (truncate && (typeof children === \"string\" || typeof children === \"number\")\n ? String(children)\n : undefined)\n\n const linkProps = {\n \"data-slot\": \"breadcrumb-link\",\n [SLOT_ATTR]: \"breadcrumb-link\",\n ...(href ? { href } : {}),\n ...(fullText !== undefined ? { title: fullText } : {}),\n ...(isCurrent ? { \"aria-current\": \"page\" as const } : {}),\n ...props,\n }\n const linkClassName = mergeClasses(styles.link, truncateClass, className)\n\n const content = asChild ? (\n <ComposeAsChild {...linkProps} className={linkClassName}>\n {onlyChild(children)}\n </ComposeAsChild>\n ) : isLink ? (\n <a {...linkProps} className={linkClassName}>\n {children}\n </a>\n ) : (\n <span\n data-slot=\"breadcrumb-page\"\n {...{ [SLOT_ATTR]: \"breadcrumb-page\" }}\n className={mergeClasses(styles.page, truncateClass, className)}\n {...(fullText !== undefined ? { title: fullText } : {})}\n {...(isCurrent ? { \"aria-current\": \"page\" as const } : {})}\n >\n {children}\n </span>\n )\n\n return (\n <li\n ref={ref}\n data-slot=\"breadcrumb-item\"\n {...{ [SLOT_ATTR]: \"breadcrumb-item\" }}\n {...(truncate ? { \"data-truncate\": \"\" } : {})}\n className={mergeClasses(styles.item, truncate && styles.itemTruncate)}\n >\n {content}\n </li>\n )\n})\n"],"names":["onlyChild","children","elements","React","useStyles","makeZenithStyles","SLOT_ATTR","boxModel","shorthands","tokens.spacingElement2","tokens.textBase","tokens.leadingBase","tokens.grayLight","tokens.spacingElement1","tokens.fontWeightSemibold","tokens.grayDefault","tokens.accentA8","Breadcrumb","separator","ariaLabel","className","props","ref","styles","items","jsx","mergeClasses","child","index","jsxs","BreadcrumbItem","href","isCurrent","asChild","truncate","title","isLink","truncateClass","fullText","linkProps","linkClassName","content","ComposeAsChild"],"mappings":";;;;;;;AAcA,SAASA,EAAUC,GAA2B;AAC5C,QAAMC,IAAWC,EAAM,SAAS,QAAQF,CAAQ;AAChD,SAAQC,EAAS,WAAW,IAAIA,EAAS,CA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les as
|
|
5
|
-
import { boxModel as
|
|
6
|
-
import { capTrim as
|
|
7
|
-
import { radiusLg as E, buttonIconSize as
|
|
8
|
-
import {
|
|
9
|
-
|
|
1
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
2
|
+
import * as n from "react";
|
|
3
|
+
import { mergeClasses as R, SLOT_ATTR as S, shorthands as l } from "@epilot/zenith-runtime/v1";
|
|
4
|
+
import { makeZenithStyles as I } from "../../styles/make-styles.js";
|
|
5
|
+
import { boxModel as a, nativeControl as L } from "../../styles/host-reset.js";
|
|
6
|
+
import { capTrim as O } from "../../styles/text-box.js";
|
|
7
|
+
import { radiusLg as E, buttonIconSize as v, leadingLg as T, textLg as z, leadingBase as A, textBase as D, buttonBaseMinHeight as N, leadingSm as P, textSm as $, leadingXs as V, textXs as X, errorSoft as C, errorA11 as M, errorSoftHover as W, errorOnSoft as _, errorSolidHover as k, errorContrast as j, errorSolid as F, accentSoft as m, grayA12 as K, accentA11 as Z, accentSoftHover as q, accentOnSoft as G, accentSolidHover as x, accentContrast as J, accentSolid as Q, focusRing as U, fontWeightSemibold as Y, buttonBasePaddingInline as ee, spacingElement3 as te } from "../../tokens/index.js";
|
|
8
|
+
import { Button as oe } from "../../_virtual/_zenith-runtime-family_button.js";
|
|
9
|
+
import { useRender as re } from "../../_virtual/_zenith-runtime-family_use-render.js";
|
|
10
|
+
const ne = /* @__PURE__ */ g("span", {});
|
|
11
|
+
function ie(s) {
|
|
12
|
+
const r = n.Children.toArray(s).filter(n.isValidElement);
|
|
13
|
+
return r.length === 1 ? r[0] : void 0;
|
|
14
|
+
}
|
|
15
|
+
const le = I({
|
|
10
16
|
root: {
|
|
11
|
-
...
|
|
17
|
+
...L,
|
|
12
18
|
display: "inline-flex",
|
|
13
19
|
alignItems: "center",
|
|
14
20
|
justifyContent: "center",
|
|
15
|
-
fontWeight:
|
|
21
|
+
fontWeight: Y,
|
|
16
22
|
whiteSpace: "nowrap",
|
|
17
23
|
transitionProperty: "all",
|
|
18
24
|
cursor: "pointer",
|
|
@@ -24,7 +30,7 @@ const te = "button", re = R({
|
|
|
24
30
|
outlineWidth: "2px",
|
|
25
31
|
outlineStyle: "solid",
|
|
26
32
|
outlineOffset: "2px",
|
|
27
|
-
outlineColor:
|
|
33
|
+
outlineColor: U
|
|
28
34
|
},
|
|
29
35
|
"@media (prefers-reduced-motion: reduce)": {
|
|
30
36
|
transitionDuration: "0.01ms"
|
|
@@ -35,113 +41,113 @@ const te = "button", re = R({
|
|
|
35
41
|
color: "currentColor"
|
|
36
42
|
}
|
|
37
43
|
},
|
|
38
|
-
label:
|
|
44
|
+
label: O,
|
|
39
45
|
primary: {
|
|
40
|
-
backgroundColor:
|
|
41
|
-
color:
|
|
42
|
-
":hover:not(:disabled)": { backgroundColor:
|
|
43
|
-
":active:not(:disabled)": { backgroundColor:
|
|
46
|
+
backgroundColor: Q,
|
|
47
|
+
color: J,
|
|
48
|
+
":hover:not(:disabled)": { backgroundColor: x },
|
|
49
|
+
":active:not(:disabled)": { backgroundColor: x }
|
|
44
50
|
},
|
|
45
51
|
secondary: {
|
|
46
|
-
backgroundColor:
|
|
47
|
-
color:
|
|
48
|
-
":hover:not(:disabled)": { backgroundColor:
|
|
52
|
+
backgroundColor: m,
|
|
53
|
+
color: G,
|
|
54
|
+
":hover:not(:disabled)": { backgroundColor: q }
|
|
49
55
|
},
|
|
50
56
|
tertiary: {
|
|
51
57
|
backgroundColor: "transparent",
|
|
52
58
|
color: Z,
|
|
53
|
-
":hover:not(:disabled)": { backgroundColor:
|
|
59
|
+
":hover:not(:disabled)": { backgroundColor: m }
|
|
54
60
|
},
|
|
55
61
|
ghost: {
|
|
56
62
|
backgroundColor: "transparent",
|
|
57
63
|
color: K,
|
|
58
|
-
":hover:not(:disabled)": { backgroundColor:
|
|
64
|
+
":hover:not(:disabled)": { backgroundColor: m }
|
|
59
65
|
},
|
|
60
66
|
primaryDestructive: {
|
|
61
67
|
backgroundColor: F,
|
|
62
|
-
color:
|
|
63
|
-
":hover:not(:disabled)": { backgroundColor:
|
|
64
|
-
":active:not(:disabled)": { backgroundColor:
|
|
68
|
+
color: j,
|
|
69
|
+
":hover:not(:disabled)": { backgroundColor: k },
|
|
70
|
+
":active:not(:disabled)": { backgroundColor: k }
|
|
65
71
|
},
|
|
66
72
|
secondaryDestructive: {
|
|
67
|
-
backgroundColor:
|
|
68
|
-
color:
|
|
73
|
+
backgroundColor: C,
|
|
74
|
+
color: _,
|
|
69
75
|
":hover:not(:disabled)": { backgroundColor: W }
|
|
70
76
|
},
|
|
71
77
|
tertiaryDestructive: {
|
|
72
78
|
backgroundColor: "transparent",
|
|
73
|
-
color:
|
|
74
|
-
":hover:not(:disabled)": { backgroundColor:
|
|
79
|
+
color: M,
|
|
80
|
+
":hover:not(:disabled)": { backgroundColor: C }
|
|
75
81
|
},
|
|
76
82
|
xs: {
|
|
77
|
-
...
|
|
78
|
-
...
|
|
79
|
-
...
|
|
83
|
+
...a,
|
|
84
|
+
...l.paddingInline("0.5rem"),
|
|
85
|
+
...l.paddingBlock("0.25rem"),
|
|
80
86
|
// Cap trimming removes the line-height's leading from direct text. Keep the established
|
|
81
87
|
// 24px control geometry explicitly instead of relying on that incidental text height.
|
|
82
88
|
minHeight: "1.5rem",
|
|
83
|
-
fontSize:
|
|
84
|
-
lineHeight:
|
|
89
|
+
fontSize: X,
|
|
90
|
+
lineHeight: V,
|
|
85
91
|
gap: "4px",
|
|
86
92
|
"& svg": { width: "0.75rem", height: "0.75rem" }
|
|
87
93
|
},
|
|
88
94
|
sm: {
|
|
89
|
-
...
|
|
90
|
-
...
|
|
91
|
-
...
|
|
95
|
+
...a,
|
|
96
|
+
...l.paddingInline(te),
|
|
97
|
+
...l.paddingBlock("0.25rem"),
|
|
92
98
|
// As above, the fixed 28px size is part of Button's contract, independent of its label box.
|
|
93
99
|
minHeight: "1.75rem",
|
|
94
|
-
fontSize:
|
|
100
|
+
fontSize: $,
|
|
95
101
|
lineHeight: P,
|
|
96
102
|
gap: "0.375rem",
|
|
97
103
|
"& svg": { width: "0.875rem", height: "0.875rem" }
|
|
98
104
|
},
|
|
99
105
|
base: {
|
|
100
|
-
...
|
|
106
|
+
...a,
|
|
101
107
|
// Density-bound (DENSITY-SPEC.md §2.4, WP9B1-ACCEPTANCE-WP9B2A): padding-inline is the
|
|
102
108
|
// compact/comfortable lever; min-height is floored by the fixed line-height + padding-block
|
|
103
109
|
// below and cannot shrink, so it is bound too (compact === normal, comfortable raised via an
|
|
104
110
|
// explicit minHeight above the natural content box, same mechanism `lg` already uses).
|
|
105
|
-
...
|
|
106
|
-
...
|
|
107
|
-
minHeight:
|
|
108
|
-
fontSize:
|
|
109
|
-
lineHeight:
|
|
111
|
+
...l.paddingInline(ee),
|
|
112
|
+
...l.paddingBlock("0.25rem"),
|
|
113
|
+
minHeight: N,
|
|
114
|
+
fontSize: D,
|
|
115
|
+
lineHeight: A,
|
|
110
116
|
gap: "0.5rem",
|
|
111
117
|
"& svg": { width: "1rem", height: "1rem" }
|
|
112
118
|
},
|
|
113
119
|
lg: {
|
|
114
|
-
...
|
|
115
|
-
...
|
|
116
|
-
...
|
|
120
|
+
...a,
|
|
121
|
+
...l.paddingInline("1.25rem"),
|
|
122
|
+
...l.paddingBlock("0.25rem"),
|
|
117
123
|
minHeight: "2.5rem",
|
|
118
|
-
fontSize:
|
|
119
|
-
lineHeight:
|
|
124
|
+
fontSize: z,
|
|
125
|
+
lineHeight: T,
|
|
120
126
|
gap: "0.5rem",
|
|
121
127
|
"& svg": { width: "1rem", height: "1rem" }
|
|
122
128
|
},
|
|
123
129
|
iconXs: {
|
|
124
|
-
...
|
|
130
|
+
...a,
|
|
125
131
|
width: "1.5rem",
|
|
126
132
|
height: "1.5rem",
|
|
127
133
|
"& svg": { width: "0.75rem", height: "0.75rem" }
|
|
128
134
|
},
|
|
129
135
|
iconSm: {
|
|
130
|
-
...
|
|
136
|
+
...a,
|
|
131
137
|
width: "1.75rem",
|
|
132
138
|
height: "1.75rem",
|
|
133
139
|
"& svg": { width: "0.875rem", height: "0.875rem" }
|
|
134
140
|
},
|
|
135
141
|
icon: {
|
|
136
|
-
...
|
|
142
|
+
...a,
|
|
137
143
|
// Density-bound: a fixed square, no line-height floor (unlike `base`), so compact/comfortable
|
|
138
144
|
// both move freely (DENSITY-SPEC.md §2.4).
|
|
139
|
-
width:
|
|
140
|
-
height:
|
|
145
|
+
width: v,
|
|
146
|
+
height: v,
|
|
141
147
|
"& svg": { width: "1.125rem", height: "1.125rem" }
|
|
142
148
|
},
|
|
143
149
|
iconLg: {
|
|
144
|
-
...
|
|
150
|
+
...a,
|
|
145
151
|
width: "2.5rem",
|
|
146
152
|
height: "2.5rem",
|
|
147
153
|
"& svg": { width: "1.5rem", height: "1.5rem" }
|
|
@@ -149,54 +155,54 @@ const te = "button", re = R({
|
|
|
149
155
|
normal: { borderRadius: E },
|
|
150
156
|
rounded: { borderRadius: "9999px" }
|
|
151
157
|
});
|
|
152
|
-
function
|
|
153
|
-
return
|
|
154
|
-
const
|
|
155
|
-
return
|
|
158
|
+
function w(s, r = "button") {
|
|
159
|
+
return n.Children.toArray(s).flatMap((e, o) => {
|
|
160
|
+
const d = n.isValidElement(e) && e.key !== null ? String(e.key) : String(o), t = `${r}/${d}`;
|
|
161
|
+
return n.isValidElement(e) && e.type === n.Fragment ? w(e.props.children, t) : [{ node: e, keyPath: t }];
|
|
156
162
|
});
|
|
157
163
|
}
|
|
158
|
-
function
|
|
164
|
+
function ae(s, r) {
|
|
159
165
|
const e = [];
|
|
160
|
-
let
|
|
161
|
-
const
|
|
162
|
-
if (!
|
|
163
|
-
|
|
164
|
-
({ node:
|
|
165
|
-
) ? e.push(...
|
|
166
|
-
/* @__PURE__ */
|
|
166
|
+
let o = [];
|
|
167
|
+
const d = () => {
|
|
168
|
+
if (!o.length) return;
|
|
169
|
+
o.every(
|
|
170
|
+
({ node: i }) => typeof i == "string" && i.trim() === ""
|
|
171
|
+
) ? e.push(...o.map(({ node: i }) => i)) : e.push(
|
|
172
|
+
/* @__PURE__ */ g(
|
|
167
173
|
"span",
|
|
168
174
|
{
|
|
169
175
|
"data-slot": "button-label",
|
|
170
|
-
className:
|
|
171
|
-
children:
|
|
176
|
+
className: r,
|
|
177
|
+
children: o.map(({ node: i }) => i)
|
|
172
178
|
},
|
|
173
|
-
`button-label:${
|
|
179
|
+
`button-label:${o[0].keyPath}`
|
|
174
180
|
)
|
|
175
|
-
),
|
|
181
|
+
), o = [];
|
|
176
182
|
};
|
|
177
|
-
for (const
|
|
178
|
-
if (typeof
|
|
179
|
-
|
|
183
|
+
for (const t of w(s)) {
|
|
184
|
+
if (typeof t.node == "string" || typeof t.node == "number") {
|
|
185
|
+
o.push(t);
|
|
180
186
|
continue;
|
|
181
187
|
}
|
|
182
|
-
|
|
183
|
-
|
|
188
|
+
d(), e.push(
|
|
189
|
+
n.isValidElement(t.node) ? n.cloneElement(t.node, { key: t.keyPath }) : t.node
|
|
184
190
|
);
|
|
185
191
|
}
|
|
186
|
-
return
|
|
192
|
+
return d(), e;
|
|
187
193
|
}
|
|
188
|
-
const
|
|
194
|
+
const be = n.forwardRef(
|
|
189
195
|
function({
|
|
190
|
-
variant:
|
|
196
|
+
variant: r = "primary",
|
|
191
197
|
size: e = "base",
|
|
192
|
-
shape:
|
|
193
|
-
destructive:
|
|
194
|
-
className:
|
|
195
|
-
asChild:
|
|
196
|
-
children:
|
|
197
|
-
...
|
|
198
|
-
},
|
|
199
|
-
const c =
|
|
198
|
+
shape: o = "rounded",
|
|
199
|
+
destructive: d = !1,
|
|
200
|
+
className: t,
|
|
201
|
+
asChild: i = !1,
|
|
202
|
+
children: h,
|
|
203
|
+
...u
|
|
204
|
+
}, p) {
|
|
205
|
+
const c = le(), B = d && r !== "ghost" ? `${r}Destructive` : r, H = {
|
|
200
206
|
xs: "xs",
|
|
201
207
|
sm: "sm",
|
|
202
208
|
base: "base",
|
|
@@ -205,27 +211,38 @@ const me = l.forwardRef(
|
|
|
205
211
|
"icon-sm": "iconSm",
|
|
206
212
|
icon: "icon",
|
|
207
213
|
"icon-lg": "iconLg"
|
|
208
|
-
}[e],
|
|
209
|
-
|
|
210
|
-
|
|
214
|
+
}[e], b = R(
|
|
215
|
+
c.root,
|
|
216
|
+
c[B],
|
|
217
|
+
c[H],
|
|
218
|
+
c[o],
|
|
219
|
+
t
|
|
220
|
+
), f = i ? ie(h) : void 0, y = re({
|
|
221
|
+
render: f ?? ne,
|
|
222
|
+
props: {
|
|
223
|
+
"data-slot": "button",
|
|
224
|
+
[S]: "button",
|
|
225
|
+
className: b,
|
|
226
|
+
...u
|
|
227
|
+
},
|
|
228
|
+
ref: p,
|
|
229
|
+
enabled: f !== void 0
|
|
230
|
+
});
|
|
231
|
+
return y || /* @__PURE__ */ g(
|
|
232
|
+
oe,
|
|
211
233
|
{
|
|
212
|
-
ref:
|
|
234
|
+
ref: p,
|
|
213
235
|
"data-slot": "button",
|
|
214
|
-
[
|
|
215
|
-
className:
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
c[t],
|
|
220
|
-
o
|
|
221
|
-
),
|
|
222
|
-
...y,
|
|
223
|
-
children: w
|
|
236
|
+
[S]: "button",
|
|
237
|
+
className: b,
|
|
238
|
+
type: "submit",
|
|
239
|
+
...u,
|
|
240
|
+
children: ae(h, c.label)
|
|
224
241
|
}
|
|
225
242
|
);
|
|
226
243
|
}
|
|
227
244
|
);
|
|
228
245
|
export {
|
|
229
|
-
|
|
246
|
+
be as Button
|
|
230
247
|
};
|
|
231
248
|
//# sourceMappingURL=button.js.map
|