@entifix/react-controls 0.1.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +7 -0
- package/dist/i18n/catalog/en.d.ts +10 -0
- package/dist/i18n/catalog/en.d.ts.map +1 -0
- package/dist/i18n/catalog/en.js +211 -0
- package/dist/i18n/catalog/en.js.map +1 -0
- package/dist/i18n/catalog/es.d.ts +275 -0
- package/dist/i18n/catalog/es.d.ts.map +1 -0
- package/dist/i18n/catalog/es.js +261 -0
- package/dist/i18n/catalog/es.js.map +1 -0
- package/dist/i18n/catalog/index.d.ts +403 -0
- package/dist/i18n/catalog/index.d.ts.map +1 -0
- package/dist/i18n/catalog/index.js +23 -0
- package/dist/i18n/catalog/index.js.map +1 -0
- package/dist/i18n/entity-labels.d.ts +29 -0
- package/dist/i18n/entity-labels.d.ts.map +1 -0
- package/dist/i18n/entity-labels.js +49 -0
- package/dist/i18n/entity-labels.js.map +1 -0
- package/dist/i18n/fallback-catalogs.d.ts +5 -0
- package/dist/i18n/fallback-catalogs.d.ts.map +1 -0
- package/dist/i18n/fallback-catalogs.js +34 -0
- package/dist/i18n/fallback-catalogs.js.map +1 -0
- package/dist/i18n/i18n-context.d.ts +62 -0
- package/dist/i18n/i18n-context.d.ts.map +1 -0
- package/dist/i18n/i18n-context.js +128 -0
- package/dist/i18n/i18n-context.js.map +1 -0
- package/dist/i18n/index.d.ts +5 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +6 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/spec-support/catalogs.d.ts +2 -0
- package/dist/i18n/spec-support/catalogs.d.ts.map +1 -0
- package/dist/i18n/spec-support/catalogs.js +142 -0
- package/dist/i18n/spec-support/catalogs.js.map +1 -0
- package/dist/i18next/index.d.ts +20 -0
- package/dist/i18next/index.d.ts.map +1 -0
- package/dist/i18next/index.js +60 -0
- package/dist/i18next/index.js.map +1 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -0
- package/dist/preferences/index.d.ts +7 -0
- package/dist/preferences/index.d.ts.map +1 -0
- package/dist/preferences/index.js +8 -0
- package/dist/preferences/index.js.map +1 -0
- package/dist/preferences/indexeddb-ui-preferences-state.d.ts +16 -0
- package/dist/preferences/indexeddb-ui-preferences-state.d.ts.map +1 -0
- package/dist/preferences/indexeddb-ui-preferences-state.js +50 -0
- package/dist/preferences/indexeddb-ui-preferences-state.js.map +1 -0
- package/dist/preferences/local-storage-ui-preferences-state.d.ts +16 -0
- package/dist/preferences/local-storage-ui-preferences-state.d.ts.map +1 -0
- package/dist/preferences/local-storage-ui-preferences-state.js +51 -0
- package/dist/preferences/local-storage-ui-preferences-state.js.map +1 -0
- package/dist/preferences/ui-preferences-context.d.ts +16 -0
- package/dist/preferences/ui-preferences-context.d.ts.map +1 -0
- package/dist/preferences/ui-preferences-context.js +31 -0
- package/dist/preferences/ui-preferences-context.js.map +1 -0
- package/dist/preferences/ui-preferences-state.d.ts +23 -0
- package/dist/preferences/ui-preferences-state.d.ts.map +1 -0
- package/dist/preferences/ui-preferences-state.js +5 -0
- package/dist/preferences/ui-preferences-state.js.map +1 -0
- package/dist/preferences/use-ui-preference.d.ts +20 -0
- package/dist/preferences/use-ui-preference.d.ts.map +1 -0
- package/dist/preferences/use-ui-preference.js +72 -0
- package/dist/preferences/use-ui-preference.js.map +1 -0
- package/dist/preferences/use-viewport-mode.d.ts +33 -0
- package/dist/preferences/use-viewport-mode.d.ts.map +1 -0
- package/dist/preferences/use-viewport-mode.js +53 -0
- package/dist/preferences/use-viewport-mode.js.map +1 -0
- package/dist/primitives.d.ts +25 -0
- package/dist/primitives.d.ts.map +1 -0
- package/dist/primitives.js +54 -0
- package/dist/primitives.js.map +1 -0
- package/dist/theme/index.d.ts +3 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +4 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/theme-context.d.ts +26 -0
- package/dist/theme/theme-context.d.ts.map +1 -0
- package/dist/theme/theme-context.js +79 -0
- package/dist/theme/theme-context.js.map +1 -0
- package/dist/theme/types.d.ts +22 -0
- package/dist/theme/types.d.ts.map +1 -0
- package/dist/theme/types.js +6 -0
- package/dist/theme/types.js.map +1 -0
- package/dist/ui/actions/action-surfaces.d.ts +59 -0
- package/dist/ui/actions/action-surfaces.d.ts.map +1 -0
- package/dist/ui/actions/action-surfaces.js +109 -0
- package/dist/ui/actions/action-surfaces.js.map +1 -0
- package/dist/ui/actions/index.d.ts +2 -0
- package/dist/ui/actions/index.d.ts.map +1 -0
- package/dist/ui/actions/index.js +3 -0
- package/dist/ui/actions/index.js.map +1 -0
- package/dist/ui/atoms/button/button-link.d.ts +27 -0
- package/dist/ui/atoms/button/button-link.d.ts.map +1 -0
- package/dist/ui/atoms/button/button-link.js +23 -0
- package/dist/ui/atoms/button/button-link.js.map +1 -0
- package/dist/ui/atoms/button/button-recipe.d.ts +19 -0
- package/dist/ui/atoms/button/button-recipe.d.ts.map +1 -0
- package/dist/ui/atoms/button/button-recipe.js +42 -0
- package/dist/ui/atoms/button/button-recipe.js.map +1 -0
- package/dist/ui/atoms/button/button.d.ts +7 -0
- package/dist/ui/atoms/button/button.d.ts.map +1 -0
- package/dist/ui/atoms/button/button.js +22 -0
- package/dist/ui/atoms/button/button.js.map +1 -0
- package/dist/ui/atoms/button/index.d.ts +4 -0
- package/dist/ui/atoms/button/index.d.ts.map +1 -0
- package/dist/ui/atoms/button/index.js +5 -0
- package/dist/ui/atoms/button/index.js.map +1 -0
- package/dist/ui/atoms/cell-value/cell-value.d.ts +12 -0
- package/dist/ui/atoms/cell-value/cell-value.d.ts.map +1 -0
- package/dist/ui/atoms/cell-value/cell-value.js +101 -0
- package/dist/ui/atoms/cell-value/cell-value.js.map +1 -0
- package/dist/ui/atoms/cell-value/index.d.ts +2 -0
- package/dist/ui/atoms/cell-value/index.d.ts.map +1 -0
- package/dist/ui/atoms/cell-value/index.js +3 -0
- package/dist/ui/atoms/cell-value/index.js.map +1 -0
- package/dist/ui/atoms/field/checkbox.d.ts +35 -0
- package/dist/ui/atoms/field/checkbox.d.ts.map +1 -0
- package/dist/ui/atoms/field/checkbox.js +46 -0
- package/dist/ui/atoms/field/checkbox.js.map +1 -0
- package/dist/ui/atoms/field/field.d.ts +4 -0
- package/dist/ui/atoms/field/field.d.ts.map +1 -0
- package/dist/ui/atoms/field/field.js +29 -0
- package/dist/ui/atoms/field/field.js.map +1 -0
- package/dist/ui/atoms/field/index.d.ts +3 -0
- package/dist/ui/atoms/field/index.d.ts.map +1 -0
- package/dist/ui/atoms/field/index.js +4 -0
- package/dist/ui/atoms/field/index.js.map +1 -0
- package/dist/ui/atoms/field-control/field-control.d.ts +50 -0
- package/dist/ui/atoms/field-control/field-control.d.ts.map +1 -0
- package/dist/ui/atoms/field-control/field-control.js +82 -0
- package/dist/ui/atoms/field-control/field-control.js.map +1 -0
- package/dist/ui/atoms/field-control/index.d.ts +2 -0
- package/dist/ui/atoms/field-control/index.d.ts.map +1 -0
- package/dist/ui/atoms/field-control/index.js +3 -0
- package/dist/ui/atoms/field-control/index.js.map +1 -0
- package/dist/ui/atoms/skeleton/index.d.ts +2 -0
- package/dist/ui/atoms/skeleton/index.d.ts.map +1 -0
- package/dist/ui/atoms/skeleton/index.js +3 -0
- package/dist/ui/atoms/skeleton/index.js.map +1 -0
- package/dist/ui/atoms/skeleton/skeleton.d.ts +21 -0
- package/dist/ui/atoms/skeleton/skeleton.d.ts.map +1 -0
- package/dist/ui/atoms/skeleton/skeleton.js +33 -0
- package/dist/ui/atoms/skeleton/skeleton.js.map +1 -0
- package/dist/ui/atoms/table/index.d.ts +2 -0
- package/dist/ui/atoms/table/index.d.ts.map +1 -0
- package/dist/ui/atoms/table/index.js +3 -0
- package/dist/ui/atoms/table/index.js.map +1 -0
- package/dist/ui/atoms/table/table.d.ts +30 -0
- package/dist/ui/atoms/table/table.d.ts.map +1 -0
- package/dist/ui/atoms/table/table.js +84 -0
- package/dist/ui/atoms/table/table.js.map +1 -0
- package/dist/ui/atoms/text/index.d.ts +2 -0
- package/dist/ui/atoms/text/index.d.ts.map +1 -0
- package/dist/ui/atoms/text/index.js +3 -0
- package/dist/ui/atoms/text/index.js.map +1 -0
- package/dist/ui/atoms/text/text.d.ts +86 -0
- package/dist/ui/atoms/text/text.d.ts.map +1 -0
- package/dist/ui/atoms/text/text.js +221 -0
- package/dist/ui/atoms/text/text.js.map +1 -0
- package/dist/ui/layout/_demo.d.ts +6 -0
- package/dist/ui/layout/_demo.d.ts.map +1 -0
- package/dist/ui/layout/_demo.js +11 -0
- package/dist/ui/layout/_demo.js.map +1 -0
- package/dist/ui/layout/_shared.d.ts +9 -0
- package/dist/ui/layout/_shared.d.ts.map +1 -0
- package/dist/ui/layout/_shared.js +30 -0
- package/dist/ui/layout/_shared.js.map +1 -0
- package/dist/ui/layout/box/box.d.ts +10 -0
- package/dist/ui/layout/box/box.d.ts.map +1 -0
- package/dist/ui/layout/box/box.js +28 -0
- package/dist/ui/layout/box/box.js.map +1 -0
- package/dist/ui/layout/box/index.d.ts +2 -0
- package/dist/ui/layout/box/index.d.ts.map +1 -0
- package/dist/ui/layout/box/index.js +3 -0
- package/dist/ui/layout/box/index.js.map +1 -0
- package/dist/ui/layout/center/center.d.ts +13 -0
- package/dist/ui/layout/center/center.d.ts.map +1 -0
- package/dist/ui/layout/center/center.js +22 -0
- package/dist/ui/layout/center/center.js.map +1 -0
- package/dist/ui/layout/center/index.d.ts +2 -0
- package/dist/ui/layout/center/index.d.ts.map +1 -0
- package/dist/ui/layout/center/index.js +3 -0
- package/dist/ui/layout/center/index.js.map +1 -0
- package/dist/ui/layout/cluster/cluster.d.ts +11 -0
- package/dist/ui/layout/cluster/cluster.d.ts.map +1 -0
- package/dist/ui/layout/cluster/cluster.js +19 -0
- package/dist/ui/layout/cluster/cluster.js.map +1 -0
- package/dist/ui/layout/cluster/index.d.ts +2 -0
- package/dist/ui/layout/cluster/index.d.ts.map +1 -0
- package/dist/ui/layout/cluster/index.js +3 -0
- package/dist/ui/layout/cluster/index.js.map +1 -0
- package/dist/ui/layout/cover/cover.d.ts +26 -0
- package/dist/ui/layout/cover/cover.d.ts.map +1 -0
- package/dist/ui/layout/cover/cover.js +57 -0
- package/dist/ui/layout/cover/cover.js.map +1 -0
- package/dist/ui/layout/cover/index.d.ts +2 -0
- package/dist/ui/layout/cover/index.d.ts.map +1 -0
- package/dist/ui/layout/cover/index.js +3 -0
- package/dist/ui/layout/cover/index.js.map +1 -0
- package/dist/ui/layout/grid/grid.d.ts +14 -0
- package/dist/ui/layout/grid/grid.d.ts.map +1 -0
- package/dist/ui/layout/grid/grid.js +25 -0
- package/dist/ui/layout/grid/grid.js.map +1 -0
- package/dist/ui/layout/grid/index.d.ts +2 -0
- package/dist/ui/layout/grid/index.d.ts.map +1 -0
- package/dist/ui/layout/grid/index.js +3 -0
- package/dist/ui/layout/grid/index.js.map +1 -0
- package/dist/ui/layout/sidebar/index.d.ts +2 -0
- package/dist/ui/layout/sidebar/index.d.ts.map +1 -0
- package/dist/ui/layout/sidebar/index.js +3 -0
- package/dist/ui/layout/sidebar/index.js.map +1 -0
- package/dist/ui/layout/sidebar/sidebar.d.ts +33 -0
- package/dist/ui/layout/sidebar/sidebar.d.ts.map +1 -0
- package/dist/ui/layout/sidebar/sidebar.js +54 -0
- package/dist/ui/layout/sidebar/sidebar.js.map +1 -0
- package/dist/ui/layout/switcher/index.d.ts +2 -0
- package/dist/ui/layout/switcher/index.d.ts.map +1 -0
- package/dist/ui/layout/switcher/index.js +3 -0
- package/dist/ui/layout/switcher/index.js.map +1 -0
- package/dist/ui/layout/switcher/switcher.d.ts +15 -0
- package/dist/ui/layout/switcher/switcher.d.ts.map +1 -0
- package/dist/ui/layout/switcher/switcher.js +26 -0
- package/dist/ui/layout/switcher/switcher.js.map +1 -0
- package/dist/ui/molecules/breadcrumbs/breadcrumbs.d.ts +27 -0
- package/dist/ui/molecules/breadcrumbs/breadcrumbs.d.ts.map +1 -0
- package/dist/ui/molecules/breadcrumbs/breadcrumbs.js +50 -0
- package/dist/ui/molecules/breadcrumbs/breadcrumbs.js.map +1 -0
- package/dist/ui/molecules/breadcrumbs/index.d.ts +2 -0
- package/dist/ui/molecules/breadcrumbs/index.d.ts.map +1 -0
- package/dist/ui/molecules/breadcrumbs/index.js +3 -0
- package/dist/ui/molecules/breadcrumbs/index.js.map +1 -0
- package/dist/ui/molecules/bulk-action-bar/bulk-action-bar.d.ts +47 -0
- package/dist/ui/molecules/bulk-action-bar/bulk-action-bar.d.ts.map +1 -0
- package/dist/ui/molecules/bulk-action-bar/bulk-action-bar.js +63 -0
- package/dist/ui/molecules/bulk-action-bar/bulk-action-bar.js.map +1 -0
- package/dist/ui/molecules/bulk-action-bar/index.d.ts +2 -0
- package/dist/ui/molecules/bulk-action-bar/index.d.ts.map +1 -0
- package/dist/ui/molecules/bulk-action-bar/index.js +3 -0
- package/dist/ui/molecules/bulk-action-bar/index.js.map +1 -0
- package/dist/ui/molecules/bulk-result/bulk-result.d.ts +31 -0
- package/dist/ui/molecules/bulk-result/bulk-result.d.ts.map +1 -0
- package/dist/ui/molecules/bulk-result/bulk-result.js +86 -0
- package/dist/ui/molecules/bulk-result/bulk-result.js.map +1 -0
- package/dist/ui/molecules/bulk-result/index.d.ts +2 -0
- package/dist/ui/molecules/bulk-result/index.d.ts.map +1 -0
- package/dist/ui/molecules/bulk-result/index.js +3 -0
- package/dist/ui/molecules/bulk-result/index.js.map +1 -0
- package/dist/ui/molecules/card/card.d.ts +5 -0
- package/dist/ui/molecules/card/card.d.ts.map +1 -0
- package/dist/ui/molecules/card/card.js +14 -0
- package/dist/ui/molecules/card/card.js.map +1 -0
- package/dist/ui/molecules/card/index.d.ts +2 -0
- package/dist/ui/molecules/card/index.d.ts.map +1 -0
- package/dist/ui/molecules/card/index.js +3 -0
- package/dist/ui/molecules/card/index.js.map +1 -0
- package/dist/ui/molecules/column-settings/column-settings.d.ts +29 -0
- package/dist/ui/molecules/column-settings/column-settings.d.ts.map +1 -0
- package/dist/ui/molecules/column-settings/column-settings.js +117 -0
- package/dist/ui/molecules/column-settings/column-settings.js.map +1 -0
- package/dist/ui/molecules/column-settings/index.d.ts +2 -0
- package/dist/ui/molecules/column-settings/index.d.ts.map +1 -0
- package/dist/ui/molecules/column-settings/index.js +3 -0
- package/dist/ui/molecules/column-settings/index.js.map +1 -0
- package/dist/ui/molecules/confirm-dialog/confirm-dialog.d.ts +31 -0
- package/dist/ui/molecules/confirm-dialog/confirm-dialog.d.ts.map +1 -0
- package/dist/ui/molecules/confirm-dialog/confirm-dialog.js +68 -0
- package/dist/ui/molecules/confirm-dialog/confirm-dialog.js.map +1 -0
- package/dist/ui/molecules/confirm-dialog/index.d.ts +2 -0
- package/dist/ui/molecules/confirm-dialog/index.d.ts.map +1 -0
- package/dist/ui/molecules/confirm-dialog/index.js +3 -0
- package/dist/ui/molecules/confirm-dialog/index.js.map +1 -0
- package/dist/ui/molecules/drawer/drawer.d.ts +25 -0
- package/dist/ui/molecules/drawer/drawer.d.ts.map +1 -0
- package/dist/ui/molecules/drawer/drawer.js +60 -0
- package/dist/ui/molecules/drawer/drawer.js.map +1 -0
- package/dist/ui/molecules/drawer/index.d.ts +2 -0
- package/dist/ui/molecules/drawer/index.d.ts.map +1 -0
- package/dist/ui/molecules/drawer/index.js +3 -0
- package/dist/ui/molecules/drawer/index.js.map +1 -0
- package/dist/ui/molecules/entity-link-input/entity-link-input.d.ts +36 -0
- package/dist/ui/molecules/entity-link-input/entity-link-input.d.ts.map +1 -0
- package/dist/ui/molecules/entity-link-input/entity-link-input.js +191 -0
- package/dist/ui/molecules/entity-link-input/entity-link-input.js.map +1 -0
- package/dist/ui/molecules/entity-link-input/index.d.ts +2 -0
- package/dist/ui/molecules/entity-link-input/index.d.ts.map +1 -0
- package/dist/ui/molecules/entity-link-input/index.js +3 -0
- package/dist/ui/molecules/entity-link-input/index.js.map +1 -0
- package/dist/ui/molecules/entity-link-picker/entity-link-picker.d.ts +19 -0
- package/dist/ui/molecules/entity-link-picker/entity-link-picker.d.ts.map +1 -0
- package/dist/ui/molecules/entity-link-picker/entity-link-picker.js +78 -0
- package/dist/ui/molecules/entity-link-picker/entity-link-picker.js.map +1 -0
- package/dist/ui/molecules/entity-link-picker/index.d.ts +2 -0
- package/dist/ui/molecules/entity-link-picker/index.d.ts.map +1 -0
- package/dist/ui/molecules/entity-link-picker/index.js +3 -0
- package/dist/ui/molecules/entity-link-picker/index.js.map +1 -0
- package/dist/ui/molecules/entity-record-card/entity-record-card.d.ts +30 -0
- package/dist/ui/molecules/entity-record-card/entity-record-card.d.ts.map +1 -0
- package/dist/ui/molecules/entity-record-card/entity-record-card.js +39 -0
- package/dist/ui/molecules/entity-record-card/entity-record-card.js.map +1 -0
- package/dist/ui/molecules/entity-record-card/index.d.ts +2 -0
- package/dist/ui/molecules/entity-record-card/index.d.ts.map +1 -0
- package/dist/ui/molecules/entity-record-card/index.js +3 -0
- package/dist/ui/molecules/entity-record-card/index.js.map +1 -0
- package/dist/ui/molecules/filter-builder/filter-builder.d.ts +19 -0
- package/dist/ui/molecules/filter-builder/filter-builder.d.ts.map +1 -0
- package/dist/ui/molecules/filter-builder/filter-builder.js +333 -0
- package/dist/ui/molecules/filter-builder/filter-builder.js.map +1 -0
- package/dist/ui/molecules/filter-builder/filter-operators.d.ts +20 -0
- package/dist/ui/molecules/filter-builder/filter-operators.d.ts.map +1 -0
- package/dist/ui/molecules/filter-builder/filter-operators.js +56 -0
- package/dist/ui/molecules/filter-builder/filter-operators.js.map +1 -0
- package/dist/ui/molecules/filter-builder/index.d.ts +3 -0
- package/dist/ui/molecules/filter-builder/index.d.ts.map +1 -0
- package/dist/ui/molecules/filter-builder/index.js +4 -0
- package/dist/ui/molecules/filter-builder/index.js.map +1 -0
- package/dist/ui/molecules/loading-boundary/index.d.ts +2 -0
- package/dist/ui/molecules/loading-boundary/index.d.ts.map +1 -0
- package/dist/ui/molecules/loading-boundary/index.js +3 -0
- package/dist/ui/molecules/loading-boundary/index.js.map +1 -0
- package/dist/ui/molecules/loading-boundary/loading-boundary.d.ts +27 -0
- package/dist/ui/molecules/loading-boundary/loading-boundary.d.ts.map +1 -0
- package/dist/ui/molecules/loading-boundary/loading-boundary.js +42 -0
- package/dist/ui/molecules/loading-boundary/loading-boundary.js.map +1 -0
- package/dist/ui/molecules/menu/index.d.ts +2 -0
- package/dist/ui/molecules/menu/index.d.ts.map +1 -0
- package/dist/ui/molecules/menu/index.js +3 -0
- package/dist/ui/molecules/menu/index.js.map +1 -0
- package/dist/ui/molecules/menu/menu.d.ts +37 -0
- package/dist/ui/molecules/menu/menu.d.ts.map +1 -0
- package/dist/ui/molecules/menu/menu.js +71 -0
- package/dist/ui/molecules/menu/menu.js.map +1 -0
- package/dist/ui/molecules/pagination/index.d.ts +2 -0
- package/dist/ui/molecules/pagination/index.d.ts.map +1 -0
- package/dist/ui/molecules/pagination/index.js +3 -0
- package/dist/ui/molecules/pagination/index.js.map +1 -0
- package/dist/ui/molecules/pagination/pagination.d.ts +13 -0
- package/dist/ui/molecules/pagination/pagination.d.ts.map +1 -0
- package/dist/ui/molecules/pagination/pagination.js +68 -0
- package/dist/ui/molecules/pagination/pagination.js.map +1 -0
- package/dist/ui/molecules/sort-builder/index.d.ts +2 -0
- package/dist/ui/molecules/sort-builder/index.d.ts.map +1 -0
- package/dist/ui/molecules/sort-builder/index.js +3 -0
- package/dist/ui/molecules/sort-builder/index.js.map +1 -0
- package/dist/ui/molecules/sort-builder/sort-builder.d.ts +18 -0
- package/dist/ui/molecules/sort-builder/sort-builder.d.ts.map +1 -0
- package/dist/ui/molecules/sort-builder/sort-builder.js +185 -0
- package/dist/ui/molecules/sort-builder/sort-builder.js.map +1 -0
- package/dist/ui/molecules/stack/index.d.ts +2 -0
- package/dist/ui/molecules/stack/index.d.ts.map +1 -0
- package/dist/ui/molecules/stack/index.js +3 -0
- package/dist/ui/molecules/stack/index.js.map +1 -0
- package/dist/ui/molecules/stack/stack.d.ts +12 -0
- package/dist/ui/molecules/stack/stack.d.ts.map +1 -0
- package/dist/ui/molecules/stack/stack.js +36 -0
- package/dist/ui/molecules/stack/stack.js.map +1 -0
- package/dist/ui/molecules/tab-strip/index.d.ts +2 -0
- package/dist/ui/molecules/tab-strip/index.d.ts.map +1 -0
- package/dist/ui/molecules/tab-strip/index.js +3 -0
- package/dist/ui/molecules/tab-strip/index.js.map +1 -0
- package/dist/ui/molecules/tab-strip/tab-strip.d.ts +29 -0
- package/dist/ui/molecules/tab-strip/tab-strip.d.ts.map +1 -0
- package/dist/ui/molecules/tab-strip/tab-strip.js +82 -0
- package/dist/ui/molecules/tab-strip/tab-strip.js.map +1 -0
- package/dist/ui/molecules/table-toolbar/index.d.ts +2 -0
- package/dist/ui/molecules/table-toolbar/index.d.ts.map +1 -0
- package/dist/ui/molecules/table-toolbar/index.js +3 -0
- package/dist/ui/molecules/table-toolbar/index.js.map +1 -0
- package/dist/ui/molecules/table-toolbar/table-toolbar.d.ts +13 -0
- package/dist/ui/molecules/table-toolbar/table-toolbar.d.ts.map +1 -0
- package/dist/ui/molecules/table-toolbar/table-toolbar.js +28 -0
- package/dist/ui/molecules/table-toolbar/table-toolbar.js.map +1 -0
- package/dist/ui/molecules/theme-switcher/index.d.ts +2 -0
- package/dist/ui/molecules/theme-switcher/index.d.ts.map +1 -0
- package/dist/ui/molecules/theme-switcher/index.js +3 -0
- package/dist/ui/molecules/theme-switcher/index.js.map +1 -0
- package/dist/ui/molecules/theme-switcher/theme-switcher.d.ts +6 -0
- package/dist/ui/molecules/theme-switcher/theme-switcher.d.ts.map +1 -0
- package/dist/ui/molecules/theme-switcher/theme-switcher.js +24 -0
- package/dist/ui/molecules/theme-switcher/theme-switcher.js.map +1 -0
- package/dist/ui/organisms/command-palette/command-palette.d.ts +67 -0
- package/dist/ui/organisms/command-palette/command-palette.d.ts.map +1 -0
- package/dist/ui/organisms/command-palette/command-palette.js +226 -0
- package/dist/ui/organisms/command-palette/command-palette.js.map +1 -0
- package/dist/ui/organisms/command-palette/index.d.ts +2 -0
- package/dist/ui/organisms/command-palette/index.d.ts.map +1 -0
- package/dist/ui/organisms/command-palette/index.js +3 -0
- package/dist/ui/organisms/command-palette/index.js.map +1 -0
- package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.d.ts +43 -0
- package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.d.ts.map +1 -0
- package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.js +281 -0
- package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.js.map +1 -0
- package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.types.d.ts +49 -0
- package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.types.d.ts.map +1 -0
- package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.types.js +3 -0
- package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.types.js.map +1 -0
- package/dist/ui/organisms/entity-detail-grid/index.d.ts +3 -0
- package/dist/ui/organisms/entity-detail-grid/index.d.ts.map +1 -0
- package/dist/ui/organisms/entity-detail-grid/index.js +4 -0
- package/dist/ui/organisms/entity-detail-grid/index.js.map +1 -0
- package/dist/ui/organisms/entity-form/entity-form-slots.d.ts +53 -0
- package/dist/ui/organisms/entity-form/entity-form-slots.d.ts.map +1 -0
- package/dist/ui/organisms/entity-form/entity-form-slots.js +44 -0
- package/dist/ui/organisms/entity-form/entity-form-slots.js.map +1 -0
- package/dist/ui/organisms/entity-form/entity-form.d.ts +4 -0
- package/dist/ui/organisms/entity-form/entity-form.d.ts.map +1 -0
- package/dist/ui/organisms/entity-form/entity-form.js +494 -0
- package/dist/ui/organisms/entity-form/entity-form.js.map +1 -0
- package/dist/ui/organisms/entity-form/entity-form.types.d.ts +151 -0
- package/dist/ui/organisms/entity-form/entity-form.types.d.ts.map +1 -0
- package/dist/ui/organisms/entity-form/entity-form.types.js +3 -0
- package/dist/ui/organisms/entity-form/entity-form.types.js.map +1 -0
- package/dist/ui/organisms/entity-form/index.d.ts +5 -0
- package/dist/ui/organisms/entity-form/index.d.ts.map +1 -0
- package/dist/ui/organisms/entity-form/index.js +6 -0
- package/dist/ui/organisms/entity-form/index.js.map +1 -0
- package/dist/ui/organisms/entity-form/use-entity-form-fields.d.ts +13 -0
- package/dist/ui/organisms/entity-form/use-entity-form-fields.d.ts.map +1 -0
- package/dist/ui/organisms/entity-form/use-entity-form-fields.js +50 -0
- package/dist/ui/organisms/entity-form/use-entity-form-fields.js.map +1 -0
- package/dist/ui/organisms/entity-table/entity-table-slots.d.ts +55 -0
- package/dist/ui/organisms/entity-table/entity-table-slots.d.ts.map +1 -0
- package/dist/ui/organisms/entity-table/entity-table-slots.js +50 -0
- package/dist/ui/organisms/entity-table/entity-table-slots.js.map +1 -0
- package/dist/ui/organisms/entity-table/entity-table.d.ts +4 -0
- package/dist/ui/organisms/entity-table/entity-table.d.ts.map +1 -0
- package/dist/ui/organisms/entity-table/entity-table.js +529 -0
- package/dist/ui/organisms/entity-table/entity-table.js.map +1 -0
- package/dist/ui/organisms/entity-table/entity-table.types.d.ts +126 -0
- package/dist/ui/organisms/entity-table/entity-table.types.d.ts.map +1 -0
- package/dist/ui/organisms/entity-table/entity-table.types.js +3 -0
- package/dist/ui/organisms/entity-table/entity-table.types.js.map +1 -0
- package/dist/ui/organisms/entity-table/index.d.ts +5 -0
- package/dist/ui/organisms/entity-table/index.d.ts.map +1 -0
- package/dist/ui/organisms/entity-table/index.js +6 -0
- package/dist/ui/organisms/entity-table/index.js.map +1 -0
- package/dist/ui/organisms/entity-table/use-entity-table-columns.d.ts +29 -0
- package/dist/ui/organisms/entity-table/use-entity-table-columns.d.ts.map +1 -0
- package/dist/ui/organisms/entity-table/use-entity-table-columns.js +103 -0
- package/dist/ui/organisms/entity-table/use-entity-table-columns.js.map +1 -0
- package/dist/ui/organisms/top-bar/index.d.ts +2 -0
- package/dist/ui/organisms/top-bar/index.d.ts.map +1 -0
- package/dist/ui/organisms/top-bar/index.js +3 -0
- package/dist/ui/organisms/top-bar/index.js.map +1 -0
- package/dist/ui/organisms/top-bar/top-bar.d.ts +20 -0
- package/dist/ui/organisms/top-bar/top-bar.d.ts.map +1 -0
- package/dist/ui/organisms/top-bar/top-bar.js +43 -0
- package/dist/ui/organisms/top-bar/top-bar.js.map +1 -0
- package/dist/ui/organisms/wizard/index.d.ts +3 -0
- package/dist/ui/organisms/wizard/index.d.ts.map +1 -0
- package/dist/ui/organisms/wizard/index.js +4 -0
- package/dist/ui/organisms/wizard/index.js.map +1 -0
- package/dist/ui/organisms/wizard/wizard.d.ts +21 -0
- package/dist/ui/organisms/wizard/wizard.d.ts.map +1 -0
- package/dist/ui/organisms/wizard/wizard.js +260 -0
- package/dist/ui/organisms/wizard/wizard.js.map +1 -0
- package/dist/ui/organisms/wizard/wizard.types.d.ts +83 -0
- package/dist/ui/organisms/wizard/wizard.types.d.ts.map +1 -0
- package/dist/ui/organisms/wizard/wizard.types.js +3 -0
- package/dist/ui/organisms/wizard/wizard.types.js.map +1 -0
- package/dist/ui/utils/cn.d.ts +4 -0
- package/dist/ui/utils/cn.d.ts.map +1 -0
- package/dist/ui/utils/cn.js +5 -0
- package/dist/ui/utils/cn.js.map +1 -0
- package/dist/ui/utils/use-hotkey.d.ts +31 -0
- package/dist/ui/utils/use-hotkey.d.ts.map +1 -0
- package/dist/ui/utils/use-hotkey.js +69 -0
- package/dist/ui/utils/use-hotkey.js.map +1 -0
- package/package.json +118 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How much room the viewport has for chrome.
|
|
3
|
+
*
|
|
4
|
+
* - `compact` — under 768px. Navigation belongs behind a drawer; there is no
|
|
5
|
+
* room for a persistent rail beside the content.
|
|
6
|
+
* - `rail` — 768px to 1024px. Enough for icons, not for labels.
|
|
7
|
+
* - `wide` — 1024px and up. The stored preference decides.
|
|
8
|
+
*/
|
|
9
|
+
export type ViewportMode = 'compact' | 'rail' | 'wide';
|
|
10
|
+
/**
|
|
11
|
+
* The viewport mode, as a media query the shell may branch on.
|
|
12
|
+
*
|
|
13
|
+
* ⚠️ This is the one place in the design system that asks about the viewport,
|
|
14
|
+
* and it is deliberate. `docs/FRONTEND.md`'s no-media-query rule governs the
|
|
15
|
+
* **layout primitives** in `ui/layout/`: they lay themselves out intrinsically
|
|
16
|
+
* with `flex-wrap`/`flex-basis`/`gap`, and `Sidebar` still does. Choosing
|
|
17
|
+
* between a drawer and a persistent rail is not laying out a box — it is picking
|
|
18
|
+
* a navigation *mode*, and no amount of intrinsic sizing produces a focus trap.
|
|
19
|
+
* See ADR 0041.
|
|
20
|
+
*
|
|
21
|
+
* It lives beside the UI preferences rather than in `ui/` because it belongs to
|
|
22
|
+
* the same decision: what the viewport allows and what the person chose are the
|
|
23
|
+
* two inputs to one answer, and only the second is a preference.
|
|
24
|
+
*
|
|
25
|
+
* Resolved in an effect, not during render, and defaulting to `wide`. The server
|
|
26
|
+
* has no viewport, so any other default would render markup the first client
|
|
27
|
+
* pass immediately contradicts — the same reason `useUiPreference` reads after
|
|
28
|
+
* mount rather than during it.
|
|
29
|
+
*/
|
|
30
|
+
export declare function useViewportMode(): ViewportMode;
|
|
31
|
+
/** Exported for tests and for callers that already hold a width. */
|
|
32
|
+
export declare const viewportModeFor: (width: number) => ViewportMode;
|
|
33
|
+
//# sourceMappingURL=use-viewport-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-viewport-mode.d.ts","sourceRoot":"","sources":["../../src/preferences/use-viewport-mode.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAUvD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,IAAI,YAAY,CA+B9C;AAED,oEAAoE;AACpE,eAAO,MAAM,eAAe,UA3DJ,MAAM,KAAG,YA2DK,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
const RAIL_MIN = 768;
|
|
4
|
+
const WIDE_MIN = 1024;
|
|
5
|
+
const modeFor = (width)=>{
|
|
6
|
+
if (width < RAIL_MIN) return 'compact';
|
|
7
|
+
return width < WIDE_MIN ? 'rail' : 'wide';
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* The viewport mode, as a media query the shell may branch on.
|
|
11
|
+
*
|
|
12
|
+
* ⚠️ This is the one place in the design system that asks about the viewport,
|
|
13
|
+
* and it is deliberate. `docs/FRONTEND.md`'s no-media-query rule governs the
|
|
14
|
+
* **layout primitives** in `ui/layout/`: they lay themselves out intrinsically
|
|
15
|
+
* with `flex-wrap`/`flex-basis`/`gap`, and `Sidebar` still does. Choosing
|
|
16
|
+
* between a drawer and a persistent rail is not laying out a box — it is picking
|
|
17
|
+
* a navigation *mode*, and no amount of intrinsic sizing produces a focus trap.
|
|
18
|
+
* See ADR 0041.
|
|
19
|
+
*
|
|
20
|
+
* It lives beside the UI preferences rather than in `ui/` because it belongs to
|
|
21
|
+
* the same decision: what the viewport allows and what the person chose are the
|
|
22
|
+
* two inputs to one answer, and only the second is a preference.
|
|
23
|
+
*
|
|
24
|
+
* Resolved in an effect, not during render, and defaulting to `wide`. The server
|
|
25
|
+
* has no viewport, so any other default would render markup the first client
|
|
26
|
+
* pass immediately contradicts — the same reason `useUiPreference` reads after
|
|
27
|
+
* mount rather than during it.
|
|
28
|
+
*/ export function useViewportMode() {
|
|
29
|
+
const [mode, setMode] = useState('wide');
|
|
30
|
+
useEffect(()=>{
|
|
31
|
+
// `typeof`, not `'matchMedia' in window`: jsdom declares the property and
|
|
32
|
+
// leaves it uncallable, so the `in` check passes and the call then throws
|
|
33
|
+
// inside a passive effect — which surfaces as a broken shell, not a missing
|
|
34
|
+
// media query.
|
|
35
|
+
if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') return;
|
|
36
|
+
const compact = window.matchMedia(`(max-width: ${RAIL_MIN - 1}px)`);
|
|
37
|
+
const wide = window.matchMedia(`(min-width: ${WIDE_MIN}px)`);
|
|
38
|
+
const sync = ()=>{
|
|
39
|
+
setMode(compact.matches ? 'compact' : wide.matches ? 'wide' : 'rail');
|
|
40
|
+
};
|
|
41
|
+
sync();
|
|
42
|
+
compact.addEventListener('change', sync);
|
|
43
|
+
wide.addEventListener('change', sync);
|
|
44
|
+
return ()=>{
|
|
45
|
+
compact.removeEventListener('change', sync);
|
|
46
|
+
wide.removeEventListener('change', sync);
|
|
47
|
+
};
|
|
48
|
+
}, []);
|
|
49
|
+
return mode;
|
|
50
|
+
}
|
|
51
|
+
/** Exported for tests and for callers that already hold a width. */ export const viewportModeFor = modeFor;
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=use-viewport-mode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/preferences/use-viewport-mode.ts"],"sourcesContent":["'use client';\n\nimport { useEffect, useState } from 'react';\n\n/**\n * How much room the viewport has for chrome.\n *\n * - `compact` — under 768px. Navigation belongs behind a drawer; there is no\n * room for a persistent rail beside the content.\n * - `rail` — 768px to 1024px. Enough for icons, not for labels.\n * - `wide` — 1024px and up. The stored preference decides.\n */\nexport type ViewportMode = 'compact' | 'rail' | 'wide';\n\nconst RAIL_MIN = 768;\nconst WIDE_MIN = 1024;\n\nconst modeFor = (width: number): ViewportMode => {\n if (width < RAIL_MIN) return 'compact';\n return width < WIDE_MIN ? 'rail' : 'wide';\n};\n\n/**\n * The viewport mode, as a media query the shell may branch on.\n *\n * ⚠️ This is the one place in the design system that asks about the viewport,\n * and it is deliberate. `docs/FRONTEND.md`'s no-media-query rule governs the\n * **layout primitives** in `ui/layout/`: they lay themselves out intrinsically\n * with `flex-wrap`/`flex-basis`/`gap`, and `Sidebar` still does. Choosing\n * between a drawer and a persistent rail is not laying out a box — it is picking\n * a navigation *mode*, and no amount of intrinsic sizing produces a focus trap.\n * See ADR 0041.\n *\n * It lives beside the UI preferences rather than in `ui/` because it belongs to\n * the same decision: what the viewport allows and what the person chose are the\n * two inputs to one answer, and only the second is a preference.\n *\n * Resolved in an effect, not during render, and defaulting to `wide`. The server\n * has no viewport, so any other default would render markup the first client\n * pass immediately contradicts — the same reason `useUiPreference` reads after\n * mount rather than during it.\n */\nexport function useViewportMode(): ViewportMode {\n const [mode, setMode] = useState<ViewportMode>('wide');\n\n useEffect(() => {\n // `typeof`, not `'matchMedia' in window`: jsdom declares the property and\n // leaves it uncallable, so the `in` check passes and the call then throws\n // inside a passive effect — which surfaces as a broken shell, not a missing\n // media query.\n if (\n typeof window === 'undefined' ||\n typeof window.matchMedia !== 'function'\n )\n return;\n\n const compact = window.matchMedia(`(max-width: ${RAIL_MIN - 1}px)`);\n const wide = window.matchMedia(`(min-width: ${WIDE_MIN}px)`);\n\n const sync = () => {\n setMode(compact.matches ? 'compact' : wide.matches ? 'wide' : 'rail');\n };\n\n sync();\n compact.addEventListener('change', sync);\n wide.addEventListener('change', sync);\n return () => {\n compact.removeEventListener('change', sync);\n wide.removeEventListener('change', sync);\n };\n }, []);\n\n return mode;\n}\n\n/** Exported for tests and for callers that already hold a width. */\nexport const viewportModeFor = modeFor;\n"],"names":["useEffect","useState","RAIL_MIN","WIDE_MIN","modeFor","width","useViewportMode","mode","setMode","window","matchMedia","compact","wide","sync","matches","addEventListener","removeEventListener","viewportModeFor"],"mappings":"AAAA;AAEA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,QAAQ;AAY5C,MAAMC,WAAW;AACjB,MAAMC,WAAW;AAEjB,MAAMC,UAAU,CAACC;IACf,IAAIA,QAAQH,UAAU,OAAO;IAC7B,OAAOG,QAAQF,WAAW,SAAS;AACrC;AAEA;;;;;;;;;;;;;;;;;;;CAmBC,GACD,OAAO,SAASG;IACd,MAAM,CAACC,MAAMC,QAAQ,GAAGP,SAAuB;IAE/CD,UAAU;QACR,0EAA0E;QAC1E,0EAA0E;QAC1E,4EAA4E;QAC5E,eAAe;QACf,IACE,OAAOS,WAAW,eAClB,OAAOA,OAAOC,UAAU,KAAK,YAE7B;QAEF,MAAMC,UAAUF,OAAOC,UAAU,CAAC,CAAC,YAAY,EAAER,WAAW,EAAE,GAAG,CAAC;QAClE,MAAMU,OAAOH,OAAOC,UAAU,CAAC,CAAC,YAAY,EAAEP,SAAS,GAAG,CAAC;QAE3D,MAAMU,OAAO;YACXL,QAAQG,QAAQG,OAAO,GAAG,YAAYF,KAAKE,OAAO,GAAG,SAAS;QAChE;QAEAD;QACAF,QAAQI,gBAAgB,CAAC,UAAUF;QACnCD,KAAKG,gBAAgB,CAAC,UAAUF;QAChC,OAAO;YACLF,QAAQK,mBAAmB,CAAC,UAAUH;YACtCD,KAAKI,mBAAmB,CAAC,UAAUH;QACrC;IACF,GAAG,EAAE;IAEL,OAAON;AACT;AAEA,kEAAkE,GAClE,OAAO,MAAMU,kBAAkBb,QAAQ"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export * from './i18n/index.js';
|
|
2
|
+
export * from './theme/index.js';
|
|
3
|
+
export * from './ui/atoms/button/index.js';
|
|
4
|
+
export * from './ui/atoms/field/index.js';
|
|
5
|
+
export * from './ui/atoms/skeleton/index.js';
|
|
6
|
+
export * from './ui/atoms/table/index.js';
|
|
7
|
+
export * from './ui/atoms/text/index.js';
|
|
8
|
+
export * from './ui/layout/box/index.js';
|
|
9
|
+
export * from './ui/layout/center/index.js';
|
|
10
|
+
export * from './ui/layout/cluster/index.js';
|
|
11
|
+
export * from './ui/layout/cover/index.js';
|
|
12
|
+
export * from './ui/layout/grid/index.js';
|
|
13
|
+
export * from './ui/layout/sidebar/index.js';
|
|
14
|
+
export * from './ui/layout/switcher/index.js';
|
|
15
|
+
export * from './ui/molecules/breadcrumbs/index.js';
|
|
16
|
+
export * from './ui/molecules/card/index.js';
|
|
17
|
+
export * from './ui/molecules/confirm-dialog/index.js';
|
|
18
|
+
export * from './ui/molecules/loading-boundary/index.js';
|
|
19
|
+
export * from './ui/molecules/menu/index.js';
|
|
20
|
+
export * from './ui/molecules/pagination/index.js';
|
|
21
|
+
export * from './ui/molecules/stack/index.js';
|
|
22
|
+
export * from './ui/molecules/tab-strip/index.js';
|
|
23
|
+
export * from './ui/molecules/theme-switcher/index.js';
|
|
24
|
+
export * from './ui/utils/cn.js';
|
|
25
|
+
//# sourceMappingURL=primitives.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../src/primitives.ts"],"names":[],"mappings":"AAyBA,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AAIzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAG9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wCAAwC,CAAC;AACvD,cAAc,0CAA0C,CAAC;AACzD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,wCAAwC,CAAC;AACvD,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// The entity-free half of the design system, published as
|
|
2
|
+
// `@entifix/react-controls/primitives`.
|
|
3
|
+
//
|
|
4
|
+
// It exists because the package's main barrel is one flat re-export of
|
|
5
|
+
// everything, and a bundler cannot drop what a module graph reaches: a
|
|
6
|
+
// storefront page importing `Card` from `.` pulled `EntityTable`,
|
|
7
|
+
// `FilterBuilder`, `SortBuilder`, `ColumnSettings` and the RSQL machinery
|
|
8
|
+
// behind them into its client bundle — 541 KB of back-office UI shipped to a
|
|
9
|
+
// visitor looking at a product.
|
|
10
|
+
//
|
|
11
|
+
// The line drawn here is not "small vs large", it is **presentational vs
|
|
12
|
+
// entity-aware**: everything below can be understood without knowing what an
|
|
13
|
+
// entity is. Anything that reads entity metadata (`CellValue`, `FieldControl`,
|
|
14
|
+
// `EntityTable`, `EntityForm`, the filter/sort/column builders, the link
|
|
15
|
+
// inputs) stays behind the main entry, where the back-office already imports it.
|
|
16
|
+
//
|
|
17
|
+
// Consumers that need both may import both; nothing is duplicated, and the main
|
|
18
|
+
// barrel keeps re-exporting all of this so no existing import breaks.
|
|
19
|
+
// Providers every app mounts, whatever it renders.
|
|
20
|
+
//
|
|
21
|
+
// `./preferences` is deliberately **not** here. The UI-preferences store is
|
|
22
|
+
// backed by Effect `Layer`s, so re-exporting it drags the whole Effect runtime
|
|
23
|
+
// into the browser — and what it remembers (column visibility, table density)
|
|
24
|
+
// only exists in the back-office. A storefront has no preferences to store.
|
|
25
|
+
export * from './i18n/index.js';
|
|
26
|
+
export * from './theme/index.js';
|
|
27
|
+
// Atoms — text, buttons, fields, tables, loading placeholders.
|
|
28
|
+
export * from './ui/atoms/button/index.js';
|
|
29
|
+
export * from './ui/atoms/field/index.js';
|
|
30
|
+
export * from './ui/atoms/skeleton/index.js';
|
|
31
|
+
export * from './ui/atoms/table/index.js';
|
|
32
|
+
export * from './ui/atoms/text/index.js';
|
|
33
|
+
// Layout primitives (Every Layout): flex-first, with `Grid` the one CSS-Grid
|
|
34
|
+
// escape hatch.
|
|
35
|
+
export * from './ui/layout/box/index.js';
|
|
36
|
+
export * from './ui/layout/center/index.js';
|
|
37
|
+
export * from './ui/layout/cluster/index.js';
|
|
38
|
+
export * from './ui/layout/cover/index.js';
|
|
39
|
+
export * from './ui/layout/grid/index.js';
|
|
40
|
+
export * from './ui/layout/sidebar/index.js';
|
|
41
|
+
export * from './ui/layout/switcher/index.js';
|
|
42
|
+
// Molecules that compose the above and nothing else.
|
|
43
|
+
export * from './ui/molecules/breadcrumbs/index.js';
|
|
44
|
+
export * from './ui/molecules/card/index.js';
|
|
45
|
+
export * from './ui/molecules/confirm-dialog/index.js';
|
|
46
|
+
export * from './ui/molecules/loading-boundary/index.js';
|
|
47
|
+
export * from './ui/molecules/menu/index.js';
|
|
48
|
+
export * from './ui/molecules/pagination/index.js';
|
|
49
|
+
export * from './ui/molecules/stack/index.js';
|
|
50
|
+
export * from './ui/molecules/tab-strip/index.js';
|
|
51
|
+
export * from './ui/molecules/theme-switcher/index.js';
|
|
52
|
+
export * from './ui/utils/cn.js';
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=primitives.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/primitives.ts"],"sourcesContent":["// The entity-free half of the design system, published as\n// `@entifix/react-controls/primitives`.\n//\n// It exists because the package's main barrel is one flat re-export of\n// everything, and a bundler cannot drop what a module graph reaches: a\n// storefront page importing `Card` from `.` pulled `EntityTable`,\n// `FilterBuilder`, `SortBuilder`, `ColumnSettings` and the RSQL machinery\n// behind them into its client bundle — 541 KB of back-office UI shipped to a\n// visitor looking at a product.\n//\n// The line drawn here is not \"small vs large\", it is **presentational vs\n// entity-aware**: everything below can be understood without knowing what an\n// entity is. Anything that reads entity metadata (`CellValue`, `FieldControl`,\n// `EntityTable`, `EntityForm`, the filter/sort/column builders, the link\n// inputs) stays behind the main entry, where the back-office already imports it.\n//\n// Consumers that need both may import both; nothing is duplicated, and the main\n// barrel keeps re-exporting all of this so no existing import breaks.\n\n// Providers every app mounts, whatever it renders.\n//\n// `./preferences` is deliberately **not** here. The UI-preferences store is\n// backed by Effect `Layer`s, so re-exporting it drags the whole Effect runtime\n// into the browser — and what it remembers (column visibility, table density)\n// only exists in the back-office. A storefront has no preferences to store.\nexport * from './i18n/index.js';\nexport * from './theme/index.js';\n\n// Atoms — text, buttons, fields, tables, loading placeholders.\nexport * from './ui/atoms/button/index.js';\nexport * from './ui/atoms/field/index.js';\nexport * from './ui/atoms/skeleton/index.js';\nexport * from './ui/atoms/table/index.js';\nexport * from './ui/atoms/text/index.js';\n\n// Layout primitives (Every Layout): flex-first, with `Grid` the one CSS-Grid\n// escape hatch.\nexport * from './ui/layout/box/index.js';\nexport * from './ui/layout/center/index.js';\nexport * from './ui/layout/cluster/index.js';\nexport * from './ui/layout/cover/index.js';\nexport * from './ui/layout/grid/index.js';\nexport * from './ui/layout/sidebar/index.js';\nexport * from './ui/layout/switcher/index.js';\n\n// Molecules that compose the above and nothing else.\nexport * from './ui/molecules/breadcrumbs/index.js';\nexport * from './ui/molecules/card/index.js';\nexport * from './ui/molecules/confirm-dialog/index.js';\nexport * from './ui/molecules/loading-boundary/index.js';\nexport * from './ui/molecules/menu/index.js';\nexport * from './ui/molecules/pagination/index.js';\nexport * from './ui/molecules/stack/index.js';\nexport * from './ui/molecules/tab-strip/index.js';\nexport * from './ui/molecules/theme-switcher/index.js';\nexport * from './ui/utils/cn.js';\n"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,wCAAwC;AACxC,EAAE;AACF,uEAAuE;AACvE,uEAAuE;AACvE,kEAAkE;AAClE,0EAA0E;AAC1E,6EAA6E;AAC7E,gCAAgC;AAChC,EAAE;AACF,yEAAyE;AACzE,6EAA6E;AAC7E,+EAA+E;AAC/E,yEAAyE;AACzE,iFAAiF;AACjF,EAAE;AACF,gFAAgF;AAChF,sEAAsE;AAEtE,mDAAmD;AACnD,EAAE;AACF,4EAA4E;AAC5E,+EAA+E;AAC/E,8EAA8E;AAC9E,4EAA4E;AAC5E,cAAc,kBAAkB;AAChC,cAAc,mBAAmB;AAEjC,+DAA+D;AAC/D,cAAc,6BAA6B;AAC3C,cAAc,4BAA4B;AAC1C,cAAc,+BAA+B;AAC7C,cAAc,4BAA4B;AAC1C,cAAc,2BAA2B;AAEzC,6EAA6E;AAC7E,gBAAgB;AAChB,cAAc,2BAA2B;AACzC,cAAc,8BAA8B;AAC5C,cAAc,+BAA+B;AAC7C,cAAc,6BAA6B;AAC3C,cAAc,4BAA4B;AAC1C,cAAc,+BAA+B;AAC7C,cAAc,gCAAgC;AAE9C,qDAAqD;AACrD,cAAc,sCAAsC;AACpD,cAAc,+BAA+B;AAC7C,cAAc,yCAAyC;AACvD,cAAc,2CAA2C;AACzD,cAAc,+BAA+B;AAC7C,cAAc,qCAAqC;AACnD,cAAc,gCAAgC;AAC9C,cAAc,oCAAoC;AAClD,cAAc,yCAAyC;AACvD,cAAc,mBAAmB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/theme/index.ts"],"sourcesContent":["export * from './theme-context.js';\nexport * from './types.js';\n"],"names":[],"mappings":"AAAA,cAAc,qBAAqB;AACnC,cAAc,aAAa"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type PropsWithChildren } from 'react';
|
|
2
|
+
import type { ThemeContextValue, ThemeOption, ThemePalette } from './types.js';
|
|
3
|
+
export interface ThemeProviderProps extends PropsWithChildren {
|
|
4
|
+
/** The themes this app exposes. First entry is the default unless
|
|
5
|
+
* `defaultTheme` is given. Drives `data-theme` + the switcher. */
|
|
6
|
+
themes: ThemeOption[];
|
|
7
|
+
/** Theme id used for the first paint / when nothing is stored. */
|
|
8
|
+
defaultTheme?: string;
|
|
9
|
+
/** localStorage key — namespace it per app so apps don't clobber each other. */
|
|
10
|
+
storageKey?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Runtime palettes for brands not shipped as CSS presets (multi-tenant /
|
|
13
|
+
* white-label). Keyed by theme id; injected as `[data-theme='id']{…}` vars
|
|
14
|
+
* appended after the app stylesheet, so they override static presets.
|
|
15
|
+
*/
|
|
16
|
+
palettes?: Record<string, ThemePalette>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Applies the active palette by writing `data-theme` on <html> and persisting
|
|
20
|
+
* the choice. Static palette VALUES live in CSS (@entifix/style presets or
|
|
21
|
+
* an app-local themes.css); this flips the selector. Dynamic palettes passed via
|
|
22
|
+
* `palettes` are injected at runtime under the same `data-theme` mechanism.
|
|
23
|
+
*/
|
|
24
|
+
export declare function ThemeProvider({ children, themes, defaultTheme, storageKey, palettes, }: ThemeProviderProps): import("react").JSX.Element;
|
|
25
|
+
export declare function useTheme(): ThemeContextValue;
|
|
26
|
+
//# sourceMappingURL=theme-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-context.d.ts","sourceRoot":"","sources":["../../src/theme/theme-context.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,iBAAiB,EAMvB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAI/E,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB;IAC3D;uEACmE;IACnE,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,kEAAkE;IAClE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gFAAgF;IAChF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CACzC;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,UAA4B,EAC5B,QAAQ,GACT,EAAE,kBAAkB,+BA2DpB;AAED,wBAAgB,QAAQ,IAAI,iBAAiB,CAI5C"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
|
4
|
+
const ThemeContext = /*#__PURE__*/ createContext(null);
|
|
5
|
+
/**
|
|
6
|
+
* Applies the active palette by writing `data-theme` on <html> and persisting
|
|
7
|
+
* the choice. Static palette VALUES live in CSS (@entifix/style presets or
|
|
8
|
+
* an app-local themes.css); this flips the selector. Dynamic palettes passed via
|
|
9
|
+
* `palettes` are injected at runtime under the same `data-theme` mechanism.
|
|
10
|
+
*/ export function ThemeProvider({ children, themes, defaultTheme, storageKey = 'entifix-theme', palettes }) {
|
|
11
|
+
var _ref;
|
|
12
|
+
var _themes_;
|
|
13
|
+
const initial = (_ref = defaultTheme != null ? defaultTheme : (_themes_ = themes[0]) == null ? void 0 : _themes_.id) != null ? _ref : '';
|
|
14
|
+
const [theme, setThemeState] = useState(initial);
|
|
15
|
+
const isKnown = useCallback((value)=>typeof value === 'string' && themes.some((t)=>t.id === value), [
|
|
16
|
+
themes
|
|
17
|
+
]);
|
|
18
|
+
// Hydrate from a previously stored preference on mount. This intentionally
|
|
19
|
+
// runs in an effect (not a lazy initializer): localStorage is unavailable
|
|
20
|
+
// during SSR, so the server renders `initial` and the client corrects after
|
|
21
|
+
// mount — reading it in render would cause a hydration mismatch.
|
|
22
|
+
useEffect(()=>{
|
|
23
|
+
const stored = window.localStorage.getItem(storageKey);
|
|
24
|
+
// eslint-disable-next-line react-hooks/set-state-in-effect -- one-shot SSR-safe hydration, see comment above
|
|
25
|
+
if (isKnown(stored)) setThemeState(stored);
|
|
26
|
+
}, [
|
|
27
|
+
storageKey,
|
|
28
|
+
isKnown
|
|
29
|
+
]);
|
|
30
|
+
// Inject runtime palettes as a single <style> appended to <head>. Being last
|
|
31
|
+
// in the cascade, these win over any static preset defining the same tokens.
|
|
32
|
+
useEffect(()=>{
|
|
33
|
+
if (!palettes || Object.keys(palettes).length === 0) return;
|
|
34
|
+
const styleId = `${storageKey}-runtime-palettes`;
|
|
35
|
+
const css = Object.entries(palettes).map(([id, palette])=>{
|
|
36
|
+
const decls = Object.entries(palette).map(([token, value])=>`--color-${token}: ${value};`).join(' ');
|
|
37
|
+
return `[data-theme='${id}'] { ${decls} }`;
|
|
38
|
+
}).join('\n');
|
|
39
|
+
let el = document.getElementById(styleId);
|
|
40
|
+
if (!el) {
|
|
41
|
+
el = document.createElement('style');
|
|
42
|
+
el.id = styleId;
|
|
43
|
+
document.head.appendChild(el);
|
|
44
|
+
}
|
|
45
|
+
el.textContent = css;
|
|
46
|
+
}, [
|
|
47
|
+
palettes,
|
|
48
|
+
storageKey
|
|
49
|
+
]);
|
|
50
|
+
// Reflect the active theme onto the document + persist it.
|
|
51
|
+
useEffect(()=>{
|
|
52
|
+
document.documentElement.dataset.theme = theme;
|
|
53
|
+
window.localStorage.setItem(storageKey, theme);
|
|
54
|
+
}, [
|
|
55
|
+
theme,
|
|
56
|
+
storageKey
|
|
57
|
+
]);
|
|
58
|
+
const setTheme = useCallback((next)=>setThemeState(next), []);
|
|
59
|
+
const value = useMemo(()=>({
|
|
60
|
+
theme,
|
|
61
|
+
setTheme,
|
|
62
|
+
themes
|
|
63
|
+
}), [
|
|
64
|
+
theme,
|
|
65
|
+
setTheme,
|
|
66
|
+
themes
|
|
67
|
+
]);
|
|
68
|
+
return /*#__PURE__*/ _jsx(ThemeContext.Provider, {
|
|
69
|
+
value: value,
|
|
70
|
+
children: children
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
export function useTheme() {
|
|
74
|
+
const ctx = useContext(ThemeContext);
|
|
75
|
+
if (!ctx) throw new Error('useTheme must be used within a ThemeProvider');
|
|
76
|
+
return ctx;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
//# sourceMappingURL=theme-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/theme/theme-context.tsx"],"sourcesContent":["'use client';\n\nimport {\n createContext,\n type PropsWithChildren,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\n\nimport type { ThemeContextValue, ThemeOption, ThemePalette } from './types.js';\n\nconst ThemeContext = createContext<ThemeContextValue | null>(null);\n\nexport interface ThemeProviderProps extends PropsWithChildren {\n /** The themes this app exposes. First entry is the default unless\n * `defaultTheme` is given. Drives `data-theme` + the switcher. */\n themes: ThemeOption[];\n /** Theme id used for the first paint / when nothing is stored. */\n defaultTheme?: string;\n /** localStorage key — namespace it per app so apps don't clobber each other. */\n storageKey?: string;\n /**\n * Runtime palettes for brands not shipped as CSS presets (multi-tenant /\n * white-label). Keyed by theme id; injected as `[data-theme='id']{…}` vars\n * appended after the app stylesheet, so they override static presets.\n */\n palettes?: Record<string, ThemePalette>;\n}\n\n/**\n * Applies the active palette by writing `data-theme` on <html> and persisting\n * the choice. Static palette VALUES live in CSS (@entifix/style presets or\n * an app-local themes.css); this flips the selector. Dynamic palettes passed via\n * `palettes` are injected at runtime under the same `data-theme` mechanism.\n */\nexport function ThemeProvider({\n children,\n themes,\n defaultTheme,\n storageKey = 'entifix-theme',\n palettes,\n}: ThemeProviderProps) {\n const initial = defaultTheme ?? themes[0]?.id ?? '';\n const [theme, setThemeState] = useState<string>(initial);\n\n const isKnown = useCallback(\n (value: unknown): value is string =>\n typeof value === 'string' && themes.some(t => t.id === value),\n [themes],\n );\n\n // Hydrate from a previously stored preference on mount. This intentionally\n // runs in an effect (not a lazy initializer): localStorage is unavailable\n // during SSR, so the server renders `initial` and the client corrects after\n // mount — reading it in render would cause a hydration mismatch.\n useEffect(() => {\n const stored = window.localStorage.getItem(storageKey);\n // eslint-disable-next-line react-hooks/set-state-in-effect -- one-shot SSR-safe hydration, see comment above\n if (isKnown(stored)) setThemeState(stored);\n }, [storageKey, isKnown]);\n\n // Inject runtime palettes as a single <style> appended to <head>. Being last\n // in the cascade, these win over any static preset defining the same tokens.\n useEffect(() => {\n if (!palettes || Object.keys(palettes).length === 0) return;\n const styleId = `${storageKey}-runtime-palettes`;\n const css = Object.entries(palettes)\n .map(([id, palette]) => {\n const decls = Object.entries(palette)\n .map(([token, value]) => `--color-${token}: ${value};`)\n .join(' ');\n return `[data-theme='${id}'] { ${decls} }`;\n })\n .join('\\n');\n\n let el = document.getElementById(styleId) as HTMLStyleElement | null;\n if (!el) {\n el = document.createElement('style');\n el.id = styleId;\n document.head.appendChild(el);\n }\n el.textContent = css;\n }, [palettes, storageKey]);\n\n // Reflect the active theme onto the document + persist it.\n useEffect(() => {\n document.documentElement.dataset.theme = theme;\n window.localStorage.setItem(storageKey, theme);\n }, [theme, storageKey]);\n\n const setTheme = useCallback((next: string) => setThemeState(next), []);\n\n const value = useMemo<ThemeContextValue>(\n () => ({ theme, setTheme, themes }),\n [theme, setTheme, themes],\n );\n\n return (\n <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>\n );\n}\n\nexport function useTheme(): ThemeContextValue {\n const ctx = useContext(ThemeContext);\n if (!ctx) throw new Error('useTheme must be used within a ThemeProvider');\n return ctx;\n}\n"],"names":["createContext","useCallback","useContext","useEffect","useMemo","useState","ThemeContext","ThemeProvider","children","themes","defaultTheme","storageKey","palettes","initial","id","theme","setThemeState","isKnown","value","some","t","stored","window","localStorage","getItem","Object","keys","length","styleId","css","entries","map","palette","decls","token","join","el","document","getElementById","createElement","head","appendChild","textContent","documentElement","dataset","setItem","setTheme","next","Provider","useTheme","ctx","Error"],"mappings":"AAAA;;AAEA,SACEA,aAAa,EAEbC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,QAAQ,QACH,QAAQ;AAIf,MAAMC,6BAAeN,cAAwC;AAkB7D;;;;;CAKC,GACD,OAAO,SAASO,cAAc,EAC5BC,QAAQ,EACRC,MAAM,EACNC,YAAY,EACZC,aAAa,eAAe,EAC5BC,QAAQ,EACW;QACHF;QAAgBD;IAAhC,MAAMI,WAAUH,OAAAA,uBAAAA,gBAAgBD,WAAAA,MAAM,CAAC,EAAE,qBAATA,SAAWK,EAAE,YAA7BJ,OAAiC;IACjD,MAAM,CAACK,OAAOC,cAAc,GAAGX,SAAiBQ;IAEhD,MAAMI,UAAUhB,YACd,CAACiB,QACC,OAAOA,UAAU,YAAYT,OAAOU,IAAI,CAACC,CAAAA,IAAKA,EAAEN,EAAE,KAAKI,QACzD;QAACT;KAAO;IAGV,2EAA2E;IAC3E,0EAA0E;IAC1E,4EAA4E;IAC5E,iEAAiE;IACjEN,UAAU;QACR,MAAMkB,SAASC,OAAOC,YAAY,CAACC,OAAO,CAACb;QAC3C,6GAA6G;QAC7G,IAAIM,QAAQI,SAASL,cAAcK;IACrC,GAAG;QAACV;QAAYM;KAAQ;IAExB,6EAA6E;IAC7E,6EAA6E;IAC7Ed,UAAU;QACR,IAAI,CAACS,YAAYa,OAAOC,IAAI,CAACd,UAAUe,MAAM,KAAK,GAAG;QACrD,MAAMC,UAAU,GAAGjB,WAAW,iBAAiB,CAAC;QAChD,MAAMkB,MAAMJ,OAAOK,OAAO,CAAClB,UACxBmB,GAAG,CAAC,CAAC,CAACjB,IAAIkB,QAAQ;YACjB,MAAMC,QAAQR,OAAOK,OAAO,CAACE,SAC1BD,GAAG,CAAC,CAAC,CAACG,OAAOhB,MAAM,GAAK,CAAC,QAAQ,EAAEgB,MAAM,EAAE,EAAEhB,MAAM,CAAC,CAAC,EACrDiB,IAAI,CAAC;YACR,OAAO,CAAC,aAAa,EAAErB,GAAG,KAAK,EAAEmB,MAAM,EAAE,CAAC;QAC5C,GACCE,IAAI,CAAC;QAER,IAAIC,KAAKC,SAASC,cAAc,CAACV;QACjC,IAAI,CAACQ,IAAI;YACPA,KAAKC,SAASE,aAAa,CAAC;YAC5BH,GAAGtB,EAAE,GAAGc;YACRS,SAASG,IAAI,CAACC,WAAW,CAACL;QAC5B;QACAA,GAAGM,WAAW,GAAGb;IACnB,GAAG;QAACjB;QAAUD;KAAW;IAEzB,2DAA2D;IAC3DR,UAAU;QACRkC,SAASM,eAAe,CAACC,OAAO,CAAC7B,KAAK,GAAGA;QACzCO,OAAOC,YAAY,CAACsB,OAAO,CAAClC,YAAYI;IAC1C,GAAG;QAACA;QAAOJ;KAAW;IAEtB,MAAMmC,WAAW7C,YAAY,CAAC8C,OAAiB/B,cAAc+B,OAAO,EAAE;IAEtE,MAAM7B,QAAQd,QACZ,IAAO,CAAA;YAAEW;YAAO+B;YAAUrC;QAAO,CAAA,GACjC;QAACM;QAAO+B;QAAUrC;KAAO;IAG3B,qBACE,KAACH,aAAa0C,QAAQ;QAAC9B,OAAOA;kBAAQV;;AAE1C;AAEA,OAAO,SAASyC;IACd,MAAMC,MAAMhD,WAAWI;IACvB,IAAI,CAAC4C,KAAK,MAAM,IAAIC,MAAM;IAC1B,OAAOD;AACT"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A selectable theme. `id` is written to `data-theme` on <html> and matched
|
|
3
|
+
* against the CSS palette blocks; `label` is what the switcher renders.
|
|
4
|
+
*/
|
|
5
|
+
export interface ThemeOption {
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}
|
|
9
|
+
/** The semantic color tokens an app may supply values for. Matches the
|
|
10
|
+
* `--color-*` contract declared in @entifix/style/tokens.css. */
|
|
11
|
+
export type ThemeColorToken = 'surface' | 'surface-elevated' | 'content' | 'content-muted' | 'primary' | 'primary-content' | 'border' | 'accent' | 'danger' | 'danger-subtle' | 'danger-content';
|
|
12
|
+
/** A runtime palette: token → CSS color. Injected as `[data-theme]` vars for
|
|
13
|
+
* brands not known at build time (multi-tenant / white-label). */
|
|
14
|
+
export type ThemePalette = Partial<Record<ThemeColorToken, string>>;
|
|
15
|
+
export interface ThemeContextValue {
|
|
16
|
+
/** Active theme id (written to `data-theme`). */
|
|
17
|
+
theme: string;
|
|
18
|
+
setTheme: (id: string) => void;
|
|
19
|
+
/** The registry this provider was configured with. */
|
|
20
|
+
themes: ThemeOption[];
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/theme/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED;kEACkE;AAClE,MAAM,MAAM,eAAe,GACvB,SAAS,GACT,kBAAkB,GAClB,SAAS,GACT,eAAe,GACf,SAAS,GACT,iBAAiB,GACjB,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,eAAe,GACf,gBAAgB,CAAC;AAErB;mEACmE;AACnE,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC;AAEpE,MAAM,WAAW,iBAAiB;IAChC,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,sDAAsD;IACtD,MAAM,EAAE,WAAW,EAAE,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/theme/types.ts"],"sourcesContent":["/**\n * A selectable theme. `id` is written to `data-theme` on <html> and matched\n * against the CSS palette blocks; `label` is what the switcher renders.\n */\nexport interface ThemeOption {\n id: string;\n label: string;\n}\n\n/** The semantic color tokens an app may supply values for. Matches the\n * `--color-*` contract declared in @entifix/style/tokens.css. */\nexport type ThemeColorToken =\n | 'surface'\n | 'surface-elevated'\n | 'content'\n | 'content-muted'\n | 'primary'\n | 'primary-content'\n | 'border'\n | 'accent'\n | 'danger'\n | 'danger-subtle'\n | 'danger-content';\n\n/** A runtime palette: token → CSS color. Injected as `[data-theme]` vars for\n * brands not known at build time (multi-tenant / white-label). */\nexport type ThemePalette = Partial<Record<ThemeColorToken, string>>;\n\nexport interface ThemeContextValue {\n /** Active theme id (written to `data-theme`). */\n theme: string;\n setTheme: (id: string) => void;\n /** The registry this provider was configured with. */\n themes: ThemeOption[];\n}\n"],"names":[],"mappings":"AAAA;;;CAGC,GAyBD,WAMC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type UseCaseDescriptor } from '@entifix/core';
|
|
2
|
+
/**
|
|
3
|
+
* Where a declared verb is rendered.
|
|
4
|
+
*
|
|
5
|
+
* ADR 0026 gave a use case two independent axes and then built only one
|
|
6
|
+
* surface, so four of the nine cells had nowhere to go: `EntityForm` filtered
|
|
7
|
+
* `binding === 'entity' && placement !== 'context-dependent'` and everything
|
|
8
|
+
* else was dropped without a word. This is the map that closes it —
|
|
9
|
+
* **placement decides the surface, binding decides the payload** — and it lives
|
|
10
|
+
* in one module so no surface re-derives it and the two axes cannot drift
|
|
11
|
+
* apart again ([ADR 0035](../../../../../../docs/adr/0035-entity-actions-selection-and-bulk.md)).
|
|
12
|
+
*/
|
|
13
|
+
export declare const ACTION_SURFACES: readonly ["form-header", "form-footer", "row-menu", "bulk-bar", "table-toolbar", "command-palette"];
|
|
14
|
+
export type ActionSurface = (typeof ACTION_SURFACES)[number];
|
|
15
|
+
/**
|
|
16
|
+
* The overflow trigger's glyph.
|
|
17
|
+
*
|
|
18
|
+
* A constant rather than a literal in JSX, because `react/jsx-no-literals`
|
|
19
|
+
* fails the build on written-in copy and is right to: it cannot tell a
|
|
20
|
+
* typographic glyph from a forgotten Spanish string. The trigger's *name* is a
|
|
21
|
+
* catalog key (`form.moreActions`, `table.actions`) — this is only the mark,
|
|
22
|
+
* and it is never read aloud.
|
|
23
|
+
*/
|
|
24
|
+
export declare const OVERFLOW_GLYPH = "\u22EF";
|
|
25
|
+
/**
|
|
26
|
+
* Every surface this descriptor renders on.
|
|
27
|
+
*
|
|
28
|
+
* ⚠️ **A verb may name more than one cell**, and that is what makes publishing
|
|
29
|
+
* reachable from a form header, a row menu and a selection without becoming
|
|
30
|
+
* three permissions (#216). The primary `binding` + `placement` come first, then
|
|
31
|
+
* whatever `alsoAt` adds, and each is validated the same way — an illegal cell
|
|
32
|
+
* in `alsoAt` throws exactly as one in the primary pair does.
|
|
33
|
+
*
|
|
34
|
+
* Duplicates are collapsed. A descriptor that named the same cell twice would
|
|
35
|
+
* otherwise render the verb twice in one menu, which reads as a bug in the
|
|
36
|
+
* screen rather than in the declaration.
|
|
37
|
+
*/
|
|
38
|
+
export declare function surfacesFor(descriptor: UseCaseDescriptor): readonly ActionSurface[];
|
|
39
|
+
/**
|
|
40
|
+
* The single surface this descriptor renders on.
|
|
41
|
+
*
|
|
42
|
+
* Kept for the callers that genuinely have one — the command palette asks "is
|
|
43
|
+
* this mine?" of an `unbound` verb, which can only ever be in one place. Any
|
|
44
|
+
* caller that renders a *list* of verbs wants {@link surfacesFor}.
|
|
45
|
+
*/
|
|
46
|
+
export declare function surfaceFor(descriptor: UseCaseDescriptor): ActionSurface;
|
|
47
|
+
/**
|
|
48
|
+
* The descriptors one surface should render, in declaration order.
|
|
49
|
+
*
|
|
50
|
+
* Every descriptor is passed through {@link surfacesFor}, so an unrenderable
|
|
51
|
+
* cell throws on the **first render of any surface** rather than only on the
|
|
52
|
+
* one that would have shown it — the same reason
|
|
53
|
+
* `assertLinkSourcesAreEditable` runs as one pass over the registry instead of
|
|
54
|
+
* per row: a check that only fires on the screen that was already looking for
|
|
55
|
+
* the verb is a check that fires after the bug is reported. A cell declared in
|
|
56
|
+
* `alsoAt` is validated on that same first render, not on the surface it names.
|
|
57
|
+
*/
|
|
58
|
+
export declare function useCasesForSurface(surface: ActionSurface, useCases: readonly UseCaseDescriptor[] | undefined): UseCaseDescriptor[];
|
|
59
|
+
//# sourceMappingURL=action-surfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-surfaces.d.ts","sourceRoot":"","sources":["../../../src/ui/actions/action-surfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,iBAAiB,EAEvB,MAAM,eAAe,CAAC;AAEvB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,qGAOlB,CAAC;AACX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAyB7D;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,WAAW,CAAC;AAyBvC;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CACzB,UAAU,EAAE,iBAAiB,GAC5B,SAAS,aAAa,EAAE,CAa1B;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,UAAU,EAAE,iBAAiB,GAAG,aAAa,CAMvE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,SAAS,iBAAiB,EAAE,GAAG,SAAS,GACjD,iBAAiB,EAAE,CAIrB"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { EntifixLogicError } from '@entifix/core';
|
|
2
|
+
/**
|
|
3
|
+
* Where a declared verb is rendered.
|
|
4
|
+
*
|
|
5
|
+
* ADR 0026 gave a use case two independent axes and then built only one
|
|
6
|
+
* surface, so four of the nine cells had nowhere to go: `EntityForm` filtered
|
|
7
|
+
* `binding === 'entity' && placement !== 'context-dependent'` and everything
|
|
8
|
+
* else was dropped without a word. This is the map that closes it —
|
|
9
|
+
* **placement decides the surface, binding decides the payload** — and it lives
|
|
10
|
+
* in one module so no surface re-derives it and the two axes cannot drift
|
|
11
|
+
* apart again ([ADR 0035](../../../../../../docs/adr/0035-entity-actions-selection-and-bulk.md)).
|
|
12
|
+
*/ export const ACTION_SURFACES = [
|
|
13
|
+
'form-header',
|
|
14
|
+
'form-footer',
|
|
15
|
+
'row-menu',
|
|
16
|
+
'bulk-bar',
|
|
17
|
+
'table-toolbar',
|
|
18
|
+
'command-palette'
|
|
19
|
+
];
|
|
20
|
+
/**
|
|
21
|
+
* The nine cells, exhaustively.
|
|
22
|
+
*
|
|
23
|
+
* `collection` + `determining` is deliberately absent, and asking for it
|
|
24
|
+
* throws rather than returning `undefined`. A determining action *finalizes a
|
|
25
|
+
* page* — it is the footer that ends an object page — and a list screen has no
|
|
26
|
+
* such thing to finalize, which is Fiori's own rule. Dropping it silently is
|
|
27
|
+
* the fault this repo already writes an assertion against elsewhere: the verb
|
|
28
|
+
* would be declared, granted, exported, pass every `@r10c/slices` invariant,
|
|
29
|
+
* and simply never appear, which reads to its author as "the permission is
|
|
30
|
+
* wrong" and sends them looking in the wrong place entirely.
|
|
31
|
+
*/ const SURFACE_BY_CELL = {
|
|
32
|
+
'entity:context-independent': 'form-header',
|
|
33
|
+
'entity:determining': 'form-footer',
|
|
34
|
+
'entity:context-dependent': 'row-menu',
|
|
35
|
+
'collection:context-dependent': 'bulk-bar',
|
|
36
|
+
'collection:context-independent': 'table-toolbar',
|
|
37
|
+
'unbound:context-dependent': 'command-palette',
|
|
38
|
+
'unbound:context-independent': 'command-palette',
|
|
39
|
+
'unbound:determining': 'command-palette'
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* The overflow trigger's glyph.
|
|
43
|
+
*
|
|
44
|
+
* A constant rather than a literal in JSX, because `react/jsx-no-literals`
|
|
45
|
+
* fails the build on written-in copy and is right to: it cannot tell a
|
|
46
|
+
* typographic glyph from a forgotten Spanish string. The trigger's *name* is a
|
|
47
|
+
* catalog key (`form.moreActions`, `table.actions`) — this is only the mark,
|
|
48
|
+
* and it is never read aloud.
|
|
49
|
+
*/ export const OVERFLOW_GLYPH = '\u22ef';
|
|
50
|
+
/** Which surface renders one cell. Throws on a cell no surface owns. */ function surfaceForCell(key, binding, placement) {
|
|
51
|
+
const surface = SURFACE_BY_CELL[`${binding}:${placement}`];
|
|
52
|
+
if (surface === undefined) {
|
|
53
|
+
throw new EntifixLogicError(`The use case "${key}" is declared ${binding} + ${placement}, which no surface renders. ` + 'A `determining` action finalizes a page — it is an object page’s footer — and a list ' + 'screen has no page to finalize, so a collection-bound verb cannot be determining. ' + 'Declare it `context-dependent` to reach the bulk bar, or `context-independent` to sit ' + 'in the table toolbar.', undefined, {
|
|
54
|
+
key,
|
|
55
|
+
binding,
|
|
56
|
+
placement
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return surface;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Every surface this descriptor renders on.
|
|
63
|
+
*
|
|
64
|
+
* ⚠️ **A verb may name more than one cell**, and that is what makes publishing
|
|
65
|
+
* reachable from a form header, a row menu and a selection without becoming
|
|
66
|
+
* three permissions (#216). The primary `binding` + `placement` come first, then
|
|
67
|
+
* whatever `alsoAt` adds, and each is validated the same way — an illegal cell
|
|
68
|
+
* in `alsoAt` throws exactly as one in the primary pair does.
|
|
69
|
+
*
|
|
70
|
+
* Duplicates are collapsed. A descriptor that named the same cell twice would
|
|
71
|
+
* otherwise render the verb twice in one menu, which reads as a bug in the
|
|
72
|
+
* screen rather than in the declaration.
|
|
73
|
+
*/ export function surfacesFor(descriptor) {
|
|
74
|
+
var _descriptor_alsoAt;
|
|
75
|
+
const cells = [
|
|
76
|
+
{
|
|
77
|
+
binding: descriptor.binding,
|
|
78
|
+
placement: descriptor.placement
|
|
79
|
+
},
|
|
80
|
+
...(_descriptor_alsoAt = descriptor.alsoAt) != null ? _descriptor_alsoAt : []
|
|
81
|
+
];
|
|
82
|
+
return [
|
|
83
|
+
...new Set(cells.map((cell)=>surfaceForCell(descriptor.key, cell.binding, cell.placement)))
|
|
84
|
+
];
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The single surface this descriptor renders on.
|
|
88
|
+
*
|
|
89
|
+
* Kept for the callers that genuinely have one — the command palette asks "is
|
|
90
|
+
* this mine?" of an `unbound` verb, which can only ever be in one place. Any
|
|
91
|
+
* caller that renders a *list* of verbs wants {@link surfacesFor}.
|
|
92
|
+
*/ export function surfaceFor(descriptor) {
|
|
93
|
+
return surfaceForCell(descriptor.key, descriptor.binding, descriptor.placement);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The descriptors one surface should render, in declaration order.
|
|
97
|
+
*
|
|
98
|
+
* Every descriptor is passed through {@link surfacesFor}, so an unrenderable
|
|
99
|
+
* cell throws on the **first render of any surface** rather than only on the
|
|
100
|
+
* one that would have shown it — the same reason
|
|
101
|
+
* `assertLinkSourcesAreEditable` runs as one pass over the registry instead of
|
|
102
|
+
* per row: a check that only fires on the screen that was already looking for
|
|
103
|
+
* the verb is a check that fires after the bug is reported. A cell declared in
|
|
104
|
+
* `alsoAt` is validated on that same first render, not on the surface it names.
|
|
105
|
+
*/ export function useCasesForSurface(surface, useCases) {
|
|
106
|
+
return (useCases != null ? useCases : []).filter((descriptor)=>surfacesFor(descriptor).includes(surface));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
//# sourceMappingURL=action-surfaces.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/actions/action-surfaces.ts"],"sourcesContent":["import {\n EntifixLogicError,\n type UseCaseBinding,\n type UseCaseDescriptor,\n type UseCasePlacement,\n} from '@entifix/core';\n\n/**\n * Where a declared verb is rendered.\n *\n * ADR 0026 gave a use case two independent axes and then built only one\n * surface, so four of the nine cells had nowhere to go: `EntityForm` filtered\n * `binding === 'entity' && placement !== 'context-dependent'` and everything\n * else was dropped without a word. This is the map that closes it —\n * **placement decides the surface, binding decides the payload** — and it lives\n * in one module so no surface re-derives it and the two axes cannot drift\n * apart again ([ADR 0035](../../../../../../docs/adr/0035-entity-actions-selection-and-bulk.md)).\n */\nexport const ACTION_SURFACES = [\n 'form-header',\n 'form-footer',\n 'row-menu',\n 'bulk-bar',\n 'table-toolbar',\n 'command-palette',\n] as const;\nexport type ActionSurface = (typeof ACTION_SURFACES)[number];\n\n/**\n * The nine cells, exhaustively.\n *\n * `collection` + `determining` is deliberately absent, and asking for it\n * throws rather than returning `undefined`. A determining action *finalizes a\n * page* — it is the footer that ends an object page — and a list screen has no\n * such thing to finalize, which is Fiori's own rule. Dropping it silently is\n * the fault this repo already writes an assertion against elsewhere: the verb\n * would be declared, granted, exported, pass every `@r10c/slices` invariant,\n * and simply never appear, which reads to its author as \"the permission is\n * wrong\" and sends them looking in the wrong place entirely.\n */\nconst SURFACE_BY_CELL: Record<string, ActionSurface> = {\n 'entity:context-independent': 'form-header',\n 'entity:determining': 'form-footer',\n 'entity:context-dependent': 'row-menu',\n 'collection:context-dependent': 'bulk-bar',\n 'collection:context-independent': 'table-toolbar',\n 'unbound:context-dependent': 'command-palette',\n 'unbound:context-independent': 'command-palette',\n 'unbound:determining': 'command-palette',\n};\n\n/**\n * The overflow trigger's glyph.\n *\n * A constant rather than a literal in JSX, because `react/jsx-no-literals`\n * fails the build on written-in copy and is right to: it cannot tell a\n * typographic glyph from a forgotten Spanish string. The trigger's *name* is a\n * catalog key (`form.moreActions`, `table.actions`) — this is only the mark,\n * and it is never read aloud.\n */\nexport const OVERFLOW_GLYPH = '\\u22ef';\n\n/** Which surface renders one cell. Throws on a cell no surface owns. */\nfunction surfaceForCell(\n key: string,\n binding: UseCaseBinding,\n placement: UseCasePlacement,\n): ActionSurface {\n const surface = SURFACE_BY_CELL[`${binding}:${placement}`];\n\n if (surface === undefined) {\n throw new EntifixLogicError(\n `The use case \"${key}\" is declared ${binding} + ${placement}, which no surface renders. ` +\n 'A `determining` action finalizes a page — it is an object page’s footer — and a list ' +\n 'screen has no page to finalize, so a collection-bound verb cannot be determining. ' +\n 'Declare it `context-dependent` to reach the bulk bar, or `context-independent` to sit ' +\n 'in the table toolbar.',\n undefined,\n { key, binding, placement },\n );\n }\n\n return surface;\n}\n\n/**\n * Every surface this descriptor renders on.\n *\n * ⚠️ **A verb may name more than one cell**, and that is what makes publishing\n * reachable from a form header, a row menu and a selection without becoming\n * three permissions (#216). The primary `binding` + `placement` come first, then\n * whatever `alsoAt` adds, and each is validated the same way — an illegal cell\n * in `alsoAt` throws exactly as one in the primary pair does.\n *\n * Duplicates are collapsed. A descriptor that named the same cell twice would\n * otherwise render the verb twice in one menu, which reads as a bug in the\n * screen rather than in the declaration.\n */\nexport function surfacesFor(\n descriptor: UseCaseDescriptor,\n): readonly ActionSurface[] {\n const cells = [\n { binding: descriptor.binding, placement: descriptor.placement },\n ...(descriptor.alsoAt ?? []),\n ];\n\n return [\n ...new Set(\n cells.map(cell =>\n surfaceForCell(descriptor.key, cell.binding, cell.placement),\n ),\n ),\n ];\n}\n\n/**\n * The single surface this descriptor renders on.\n *\n * Kept for the callers that genuinely have one — the command palette asks \"is\n * this mine?\" of an `unbound` verb, which can only ever be in one place. Any\n * caller that renders a *list* of verbs wants {@link surfacesFor}.\n */\nexport function surfaceFor(descriptor: UseCaseDescriptor): ActionSurface {\n return surfaceForCell(\n descriptor.key,\n descriptor.binding,\n descriptor.placement,\n );\n}\n\n/**\n * The descriptors one surface should render, in declaration order.\n *\n * Every descriptor is passed through {@link surfacesFor}, so an unrenderable\n * cell throws on the **first render of any surface** rather than only on the\n * one that would have shown it — the same reason\n * `assertLinkSourcesAreEditable` runs as one pass over the registry instead of\n * per row: a check that only fires on the screen that was already looking for\n * the verb is a check that fires after the bug is reported. A cell declared in\n * `alsoAt` is validated on that same first render, not on the surface it names.\n */\nexport function useCasesForSurface(\n surface: ActionSurface,\n useCases: readonly UseCaseDescriptor[] | undefined,\n): UseCaseDescriptor[] {\n return (useCases ?? []).filter(descriptor =>\n surfacesFor(descriptor).includes(surface),\n );\n}\n"],"names":["EntifixLogicError","ACTION_SURFACES","SURFACE_BY_CELL","OVERFLOW_GLYPH","surfaceForCell","key","binding","placement","surface","undefined","surfacesFor","descriptor","cells","alsoAt","Set","map","cell","surfaceFor","useCasesForSurface","useCases","filter","includes"],"mappings":"AAAA,SACEA,iBAAiB,QAIZ,gBAAgB;AAEvB;;;;;;;;;;CAUC,GACD,OAAO,MAAMC,kBAAkB;IAC7B;IACA;IACA;IACA;IACA;IACA;CACD,CAAU;AAGX;;;;;;;;;;;CAWC,GACD,MAAMC,kBAAiD;IACrD,8BAA8B;IAC9B,sBAAsB;IACtB,4BAA4B;IAC5B,gCAAgC;IAChC,kCAAkC;IAClC,6BAA6B;IAC7B,+BAA+B;IAC/B,uBAAuB;AACzB;AAEA;;;;;;;;CAQC,GACD,OAAO,MAAMC,iBAAiB,SAAS;AAEvC,sEAAsE,GACtE,SAASC,eACPC,GAAW,EACXC,OAAuB,EACvBC,SAA2B;IAE3B,MAAMC,UAAUN,eAAe,CAAC,GAAGI,QAAQ,CAAC,EAAEC,WAAW,CAAC;IAE1D,IAAIC,YAAYC,WAAW;QACzB,MAAM,IAAIT,kBACR,CAAC,cAAc,EAAEK,IAAI,cAAc,EAAEC,QAAQ,GAAG,EAAEC,UAAU,4BAA4B,CAAC,GACvF,0FACA,uFACA,2FACA,yBACFE,WACA;YAAEJ;YAAKC;YAASC;QAAU;IAE9B;IAEA,OAAOC;AACT;AAEA;;;;;;;;;;;;CAYC,GACD,OAAO,SAASE,YACdC,UAA6B;QAIvBA;IAFN,MAAMC,QAAQ;QACZ;YAAEN,SAASK,WAAWL,OAAO;YAAEC,WAAWI,WAAWJ,SAAS;QAAC;YAC3DI,qBAAAA,WAAWE,MAAM,YAAjBF,qBAAqB,EAAE;KAC5B;IAED,OAAO;WACF,IAAIG,IACLF,MAAMG,GAAG,CAACC,CAAAA,OACRZ,eAAeO,WAAWN,GAAG,EAAEW,KAAKV,OAAO,EAAEU,KAAKT,SAAS;KAGhE;AACH;AAEA;;;;;;CAMC,GACD,OAAO,SAASU,WAAWN,UAA6B;IACtD,OAAOP,eACLO,WAAWN,GAAG,EACdM,WAAWL,OAAO,EAClBK,WAAWJ,SAAS;AAExB;AAEA;;;;;;;;;;CAUC,GACD,OAAO,SAASW,mBACdV,OAAsB,EACtBW,QAAkD;IAElD,OAAO,CAACA,mBAAAA,WAAY,EAAE,EAAEC,MAAM,CAACT,CAAAA,aAC7BD,YAAYC,YAAYU,QAAQ,CAACb;AAErC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/actions/index.ts"],"sourcesContent":["export * from './action-surfaces.js';\n"],"names":[],"mappings":"AAAA,cAAc,uBAAuB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
import { type ButtonVariantProps } from './button-recipe.js';
|
|
3
|
+
/**
|
|
4
|
+
* An anchor wearing {@link Button}'s clothes — and, unlike `Button`, a
|
|
5
|
+
* **server** component.
|
|
6
|
+
*
|
|
7
|
+
* Most call-to-action buttons are not buttons: "View product", "Browse
|
|
8
|
+
* category" and "Keep shopping" navigate, and a `<button>` that navigates is
|
|
9
|
+
* both worse for the visitor (no middle-click, no open-in-new-tab, no status
|
|
10
|
+
* bar) and more expensive for the page, because `Button` carries a
|
|
11
|
+
* `'use client'` and would turn every card in a grid into its own client
|
|
12
|
+
* boundary.
|
|
13
|
+
*
|
|
14
|
+
* Reach for `Button` when something actually happens on click; reach for this
|
|
15
|
+
* when the click is a link. It takes no event handlers on purpose — accepting
|
|
16
|
+
* one would quietly demand a client parent to pass it.
|
|
17
|
+
*/
|
|
18
|
+
export interface ButtonLinkProps extends Omit<ComponentPropsWithoutRef<'a'>, 'onClick'>, ButtonVariantProps {
|
|
19
|
+
/**
|
|
20
|
+
* Required: a link with no content is invisible to a screen reader and
|
|
21
|
+
* unclickable to everyone else. `jsx-a11y/anchor-has-content` cannot see
|
|
22
|
+
* through the prop spread below, so the type is what enforces it.
|
|
23
|
+
*/
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
}
|
|
26
|
+
export declare function ButtonLink({ variant, size, className, children, ...props }: ButtonLinkProps): import("react").JSX.Element;
|
|
27
|
+
//# sourceMappingURL=button-link.d.ts.map
|