@endora-commerce/admin-kit 0.0.0-stage → 0.100.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 +212 -2
- package/dist/components/FileDropzone.d.ts +13 -0
- package/dist/components/FileDropzone.d.ts.map +1 -0
- package/dist/components/FileDropzone.js +39 -0
- package/dist/components/FileDropzone.js.map +1 -0
- package/dist/components/PaginationFooter.d.ts +25 -0
- package/dist/components/PaginationFooter.d.ts.map +1 -0
- package/dist/components/PaginationFooter.js +33 -0
- package/dist/components/PaginationFooter.js.map +1 -0
- package/dist/components/ResponsiveTable.d.ts +26 -0
- package/dist/components/ResponsiveTable.d.ts.map +1 -0
- package/dist/components/ResponsiveTable.js +34 -0
- package/dist/components/ResponsiveTable.js.map +1 -0
- package/dist/components/RowActionMenu.d.ts +40 -0
- package/dist/components/RowActionMenu.d.ts.map +1 -0
- package/dist/components/RowActionMenu.js +15 -0
- package/dist/components/RowActionMenu.js.map +1 -0
- package/dist/components/StickyFormActions.d.ts +10 -0
- package/dist/components/StickyFormActions.d.ts.map +1 -0
- package/dist/components/StickyFormActions.js +10 -0
- package/dist/components/StickyFormActions.js.map +1 -0
- package/dist/components/TouchReorderButtons.d.ts +13 -0
- package/dist/components/TouchReorderButtons.d.ts.map +1 -0
- package/dist/components/TouchReorderButtons.js +12 -0
- package/dist/components/TouchReorderButtons.js.map +1 -0
- package/dist/components/admin-user-picker/AdminUserPicker.d.ts +14 -0
- package/dist/components/admin-user-picker/AdminUserPicker.d.ts.map +1 -0
- package/dist/components/admin-user-picker/AdminUserPicker.js +68 -0
- package/dist/components/admin-user-picker/AdminUserPicker.js.map +1 -0
- package/dist/components/asset-picker/AssetFieldPicker.d.ts +32 -0
- package/dist/components/asset-picker/AssetFieldPicker.d.ts.map +1 -0
- package/dist/components/asset-picker/AssetFieldPicker.js +42 -0
- package/dist/components/asset-picker/AssetFieldPicker.js.map +1 -0
- package/dist/components/asset-picker/AssetPicker.d.ts +31 -0
- package/dist/components/asset-picker/AssetPicker.d.ts.map +1 -0
- package/dist/components/asset-picker/AssetPicker.js +68 -0
- package/dist/components/asset-picker/AssetPicker.js.map +1 -0
- package/dist/components/asset-picker/AssetUploader.d.ts +15 -0
- package/dist/components/asset-picker/AssetUploader.d.ts.map +1 -0
- package/dist/components/asset-picker/AssetUploader.js +61 -0
- package/dist/components/asset-picker/AssetUploader.js.map +1 -0
- package/dist/components/asset-picker/assets-api.d.ts +49 -0
- package/dist/components/asset-picker/assets-api.d.ts.map +1 -0
- package/dist/components/asset-picker/assets-api.js +67 -0
- package/dist/components/asset-picker/assets-api.js.map +1 -0
- package/dist/components/category-picker/CategorySelect.d.ts +14 -0
- package/dist/components/category-picker/CategorySelect.d.ts.map +1 -0
- package/dist/components/category-picker/CategorySelect.js +41 -0
- package/dist/components/category-picker/CategorySelect.js.map +1 -0
- package/dist/components/category-tree-picker/CategoryTreeNodeRow.d.ts +18 -0
- package/dist/components/category-tree-picker/CategoryTreeNodeRow.d.ts.map +1 -0
- package/dist/components/category-tree-picker/CategoryTreeNodeRow.js +19 -0
- package/dist/components/category-tree-picker/CategoryTreeNodeRow.js.map +1 -0
- package/dist/components/category-tree-picker/CategoryTreePicker.d.ts +23 -0
- package/dist/components/category-tree-picker/CategoryTreePicker.d.ts.map +1 -0
- package/dist/components/category-tree-picker/CategoryTreePicker.js +82 -0
- package/dist/components/category-tree-picker/CategoryTreePicker.js.map +1 -0
- package/dist/components/category-tree-picker/category-tree-utils.d.ts +35 -0
- package/dist/components/category-tree-picker/category-tree-utils.d.ts.map +1 -0
- package/dist/components/category-tree-picker/category-tree-utils.js +140 -0
- package/dist/components/category-tree-picker/category-tree-utils.js.map +1 -0
- package/dist/components/category-tree-picker/index.d.ts +4 -0
- package/dist/components/category-tree-picker/index.d.ts.map +1 -0
- package/dist/components/category-tree-picker/index.js +2 -0
- package/dist/components/category-tree-picker/index.js.map +1 -0
- package/dist/components/charts/echart.d.ts +17 -0
- package/dist/components/charts/echart.d.ts.map +1 -0
- package/dist/components/charts/echart.js +61 -0
- package/dist/components/charts/echart.js.map +1 -0
- package/dist/components/cms-picker/CmsBlockPicker.d.ts +14 -0
- package/dist/components/cms-picker/CmsBlockPicker.d.ts.map +1 -0
- package/dist/components/cms-picker/CmsBlockPicker.js +40 -0
- package/dist/components/cms-picker/CmsBlockPicker.js.map +1 -0
- package/dist/components/cms-picker/CmsPagePicker.d.ts +15 -0
- package/dist/components/cms-picker/CmsPagePicker.d.ts.map +1 -0
- package/dist/components/cms-picker/CmsPagePicker.js +80 -0
- package/dist/components/cms-picker/CmsPagePicker.js.map +1 -0
- package/dist/components/content-language-tabs/ContentLanguageTabs.d.ts +30 -0
- package/dist/components/content-language-tabs/ContentLanguageTabs.d.ts.map +1 -0
- package/dist/components/content-language-tabs/ContentLanguageTabs.js +14 -0
- package/dist/components/content-language-tabs/ContentLanguageTabs.js.map +1 -0
- package/dist/components/country-select/CountrySelect.d.ts +29 -0
- package/dist/components/country-select/CountrySelect.d.ts.map +1 -0
- package/dist/components/country-select/CountrySelect.js +40 -0
- package/dist/components/country-select/CountrySelect.js.map +1 -0
- package/dist/components/country-select/index.d.ts +3 -0
- package/dist/components/country-select/index.d.ts.map +1 -0
- package/dist/components/country-select/index.js +3 -0
- package/dist/components/country-select/index.js.map +1 -0
- package/dist/components/country-select/useCountriesQuery.d.ts +12 -0
- package/dist/components/country-select/useCountriesQuery.d.ts.map +1 -0
- package/dist/components/country-select/useCountriesQuery.js +69 -0
- package/dist/components/country-select/useCountriesQuery.js.map +1 -0
- package/dist/components/custom-field-values/CustomFieldValuesPanel.d.ts +48 -0
- package/dist/components/custom-field-values/CustomFieldValuesPanel.d.ts.map +1 -0
- package/dist/components/custom-field-values/CustomFieldValuesPanel.js +122 -0
- package/dist/components/custom-field-values/CustomFieldValuesPanel.js.map +1 -0
- package/dist/components/customer-group-picker/CustomerGroupPicker.d.ts +14 -0
- package/dist/components/customer-group-picker/CustomerGroupPicker.d.ts.map +1 -0
- package/dist/components/customer-group-picker/CustomerGroupPicker.js +36 -0
- package/dist/components/customer-group-picker/CustomerGroupPicker.js.map +1 -0
- package/dist/components/customer-picker/CustomerPicker.d.ts +18 -0
- package/dist/components/customer-picker/CustomerPicker.d.ts.map +1 -0
- package/dist/components/customer-picker/CustomerPicker.js +85 -0
- package/dist/components/customer-picker/CustomerPicker.js.map +1 -0
- package/dist/components/dictionary-picker/CountryPicker.d.ts +26 -0
- package/dist/components/dictionary-picker/CountryPicker.d.ts.map +1 -0
- package/dist/components/dictionary-picker/CountryPicker.js +29 -0
- package/dist/components/dictionary-picker/CountryPicker.js.map +1 -0
- package/dist/components/dictionary-picker/CurrencyPicker.d.ts +17 -0
- package/dist/components/dictionary-picker/CurrencyPicker.d.ts.map +1 -0
- package/dist/components/dictionary-picker/CurrencyPicker.js +29 -0
- package/dist/components/dictionary-picker/CurrencyPicker.js.map +1 -0
- package/dist/components/dictionary-picker/dictionary-api.d.ts +21 -0
- package/dist/components/dictionary-picker/dictionary-api.d.ts.map +1 -0
- package/dist/components/dictionary-picker/dictionary-api.js +26 -0
- package/dist/components/dictionary-picker/dictionary-api.js.map +1 -0
- package/dist/components/dictionary-picker/index.d.ts +4 -0
- package/dist/components/dictionary-picker/index.d.ts.map +1 -0
- package/dist/components/dictionary-picker/index.js +4 -0
- package/dist/components/dictionary-picker/index.js.map +1 -0
- package/dist/components/fulfilment-strategy-picker/FulfilmentStrategyPicker.d.ts +49 -0
- package/dist/components/fulfilment-strategy-picker/FulfilmentStrategyPicker.d.ts.map +1 -0
- package/dist/components/fulfilment-strategy-picker/FulfilmentStrategyPicker.js +43 -0
- package/dist/components/fulfilment-strategy-picker/FulfilmentStrategyPicker.js.map +1 -0
- package/dist/components/hooks/useFocusTrap.d.ts +6 -0
- package/dist/components/hooks/useFocusTrap.d.ts.map +1 -0
- package/dist/components/hooks/useFocusTrap.js +41 -0
- package/dist/components/hooks/useFocusTrap.js.map +1 -0
- package/dist/components/hooks/useViewportTier.d.ts +7 -0
- package/dist/components/hooks/useViewportTier.d.ts.map +1 -0
- package/dist/components/hooks/useViewportTier.js +23 -0
- package/dist/components/hooks/useViewportTier.js.map +1 -0
- package/dist/components/index.d.ts +101 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +63 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/organization-picker/OrganizationPicker.d.ts +28 -0
- package/dist/components/organization-picker/OrganizationPicker.d.ts.map +1 -0
- package/dist/components/organization-picker/OrganizationPicker.js +35 -0
- package/dist/components/organization-picker/OrganizationPicker.js.map +1 -0
- package/dist/components/organization-picker/OrganizationPickerMulti.d.ts +32 -0
- package/dist/components/organization-picker/OrganizationPickerMulti.d.ts.map +1 -0
- package/dist/components/organization-picker/OrganizationPickerMulti.js +55 -0
- package/dist/components/organization-picker/OrganizationPickerMulti.js.map +1 -0
- package/dist/components/organization-picker/OrganizationStatusBadge.d.ts +7 -0
- package/dist/components/organization-picker/OrganizationStatusBadge.d.ts.map +1 -0
- package/dist/components/organization-picker/OrganizationStatusBadge.js +33 -0
- package/dist/components/organization-picker/OrganizationStatusBadge.js.map +1 -0
- package/dist/components/organization-picker/useOrganizationsQuery.d.ts +33 -0
- package/dist/components/organization-picker/useOrganizationsQuery.d.ts.map +1 -0
- package/dist/components/organization-picker/useOrganizationsQuery.js +92 -0
- package/dist/components/organization-picker/useOrganizationsQuery.js.map +1 -0
- package/dist/components/payment-method-availability/MethodAvailabilityCell.d.ts +38 -0
- package/dist/components/payment-method-availability/MethodAvailabilityCell.d.ts.map +1 -0
- package/dist/components/payment-method-availability/MethodAvailabilityCell.js +50 -0
- package/dist/components/payment-method-availability/MethodAvailabilityCell.js.map +1 -0
- package/dist/components/product-picker/ProductPicker.d.ts +22 -0
- package/dist/components/product-picker/ProductPicker.d.ts.map +1 -0
- package/dist/components/product-picker/ProductPicker.js +143 -0
- package/dist/components/product-picker/ProductPicker.js.map +1 -0
- package/dist/components/reorder/ReorderAnnouncer.d.ts +29 -0
- package/dist/components/reorder/ReorderAnnouncer.d.ts.map +1 -0
- package/dist/components/reorder/ReorderAnnouncer.js +6 -0
- package/dist/components/reorder/ReorderAnnouncer.js.map +1 -0
- package/dist/components/reorder/useReorderList.d.ts +121 -0
- package/dist/components/reorder/useReorderList.d.ts.map +1 -0
- package/dist/components/reorder/useReorderList.js +241 -0
- package/dist/components/reorder/useReorderList.js.map +1 -0
- package/dist/components/rule-builder/RuleBuilder.d.ts +105 -0
- package/dist/components/rule-builder/RuleBuilder.d.ts.map +1 -0
- package/dist/components/rule-builder/RuleBuilder.js +138 -0
- package/dist/components/rule-builder/RuleBuilder.js.map +1 -0
- package/dist/components/sales-channel-picker/SalesChannelPicker.d.ts +15 -0
- package/dist/components/sales-channel-picker/SalesChannelPicker.d.ts.map +1 -0
- package/dist/components/sales-channel-picker/SalesChannelPicker.js +79 -0
- package/dist/components/sales-channel-picker/SalesChannelPicker.js.map +1 -0
- package/dist/components/scope-notice/ScopeNotice.d.ts +33 -0
- package/dist/components/scope-notice/ScopeNotice.d.ts.map +1 -0
- package/dist/components/scope-notice/ScopeNotice.js +11 -0
- package/dist/components/scope-notice/ScopeNotice.js.map +1 -0
- package/dist/components/scope-picker/ScopePicker.d.ts +28 -0
- package/dist/components/scope-picker/ScopePicker.d.ts.map +1 -0
- package/dist/components/scope-picker/ScopePicker.js +114 -0
- package/dist/components/scope-picker/ScopePicker.js.map +1 -0
- package/dist/components/scope-picker/sales-channels-api.d.ts +19 -0
- package/dist/components/scope-picker/sales-channels-api.d.ts.map +1 -0
- package/dist/components/scope-picker/sales-channels-api.js +30 -0
- package/dist/components/scope-picker/sales-channels-api.js.map +1 -0
- package/dist/components/status-transition-graph/StatusTransitionGraph.d.ts +26 -0
- package/dist/components/status-transition-graph/StatusTransitionGraph.d.ts.map +1 -0
- package/dist/components/status-transition-graph/StatusTransitionGraph.js +241 -0
- package/dist/components/status-transition-graph/StatusTransitionGraph.js.map +1 -0
- package/dist/components/status-transition-graph/index.d.ts +3 -0
- package/dist/components/status-transition-graph/index.d.ts.map +1 -0
- package/dist/components/status-transition-graph/index.js +2 -0
- package/dist/components/status-transition-graph/index.js.map +1 -0
- package/dist/contributions/index.d.ts +44 -0
- package/dist/contributions/index.d.ts.map +1 -0
- package/dist/contributions/index.js +42 -0
- package/dist/contributions/index.js.map +1 -0
- package/dist/contributions/zone-component.d.ts +70 -0
- package/dist/contributions/zone-component.d.ts.map +1 -0
- package/dist/contributions/zone-component.js +26 -0
- package/dist/contributions/zone-component.js.map +1 -0
- package/dist/field-protection/FieldProtectionPricePanel.d.ts +26 -0
- package/dist/field-protection/FieldProtectionPricePanel.d.ts.map +1 -0
- package/dist/field-protection/FieldProtectionPricePanel.js +14 -0
- package/dist/field-protection/FieldProtectionPricePanel.js.map +1 -0
- package/dist/field-protection/FieldProtectionSummary.d.ts +18 -0
- package/dist/field-protection/FieldProtectionSummary.d.ts.map +1 -0
- package/dist/field-protection/FieldProtectionSummary.js +18 -0
- package/dist/field-protection/FieldProtectionSummary.js.map +1 -0
- package/dist/field-protection/FieldProtectionToggle.d.ts +36 -0
- package/dist/field-protection/FieldProtectionToggle.d.ts.map +1 -0
- package/dist/field-protection/FieldProtectionToggle.js +30 -0
- package/dist/field-protection/FieldProtectionToggle.js.map +1 -0
- package/dist/field-protection/describe-path.d.ts +27 -0
- package/dist/field-protection/describe-path.d.ts.map +1 -0
- package/dist/field-protection/describe-path.js +28 -0
- package/dist/field-protection/describe-path.js.map +1 -0
- package/dist/field-protection/index.d.ts +46 -0
- package/dist/field-protection/index.d.ts.map +1 -0
- package/dist/field-protection/index.js +41 -0
- package/dist/field-protection/index.js.map +1 -0
- package/dist/field-protection/types.d.ts +93 -0
- package/dist/field-protection/types.d.ts.map +1 -0
- package/dist/field-protection/types.js +2 -0
- package/dist/field-protection/types.js.map +1 -0
- package/dist/field-protection/use-field-protection.d.ts +27 -0
- package/dist/field-protection/use-field-protection.d.ts.map +1 -0
- package/dist/field-protection/use-field-protection.js +149 -0
- package/dist/field-protection/use-field-protection.js.map +1 -0
- package/dist/i18n/TranslationProvider.d.ts +27 -0
- package/dist/i18n/TranslationProvider.d.ts.map +1 -0
- package/dist/i18n/TranslationProvider.js +130 -0
- package/dist/i18n/TranslationProvider.js.map +1 -0
- package/dist/i18n/app-language-context.d.ts +8 -0
- package/dist/i18n/app-language-context.d.ts.map +1 -0
- package/dist/i18n/app-language-context.js +13 -0
- package/dist/i18n/app-language-context.js.map +1 -0
- package/dist/i18n/index.d.ts +29 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +25 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/interpolate.d.ts +2 -0
- package/dist/i18n/interpolate.d.ts.map +1 -0
- package/dist/i18n/interpolate.js +10 -0
- package/dist/i18n/interpolate.js.map +1 -0
- package/dist/i18n/language-storage.d.ts +16 -0
- package/dist/i18n/language-storage.d.ts.map +1 -0
- package/dist/i18n/language-storage.js +26 -0
- package/dist/i18n/language-storage.js.map +1 -0
- package/dist/i18n/resolver.d.ts +19 -0
- package/dist/i18n/resolver.d.ts.map +1 -0
- package/dist/i18n/resolver.js +23 -0
- package/dist/i18n/resolver.js.map +1 -0
- package/dist/i18n/types.d.ts +12 -0
- package/dist/i18n/types.d.ts.map +1 -0
- package/dist/i18n/types.js +7 -0
- package/dist/i18n/types.js.map +1 -0
- package/dist/i18n/useTranslation.d.ts +2 -0
- package/dist/i18n/useTranslation.d.ts.map +1 -0
- package/dist/i18n/useTranslation.js +16 -0
- package/dist/i18n/useTranslation.js.map +1 -0
- package/dist/lib/admin-actions/icon-map.d.ts +3 -0
- package/dist/lib/admin-actions/icon-map.d.ts.map +1 -0
- package/dist/lib/admin-actions/icon-map.js +115 -0
- package/dist/lib/admin-actions/icon-map.js.map +1 -0
- package/dist/lib/api-client.d.ts +55 -0
- package/dist/lib/api-client.d.ts.map +1 -0
- package/dist/lib/api-client.js +89 -0
- package/dist/lib/api-client.js.map +1 -0
- package/dist/lib/asset-url.d.ts +32 -0
- package/dist/lib/asset-url.d.ts.map +1 -0
- package/dist/lib/asset-url.js +42 -0
- package/dist/lib/asset-url.js.map +1 -0
- package/dist/lib/auth.d.ts +92 -0
- package/dist/lib/auth.d.ts.map +1 -0
- package/dist/lib/auth.js +133 -0
- package/dist/lib/auth.js.map +1 -0
- package/dist/lib/format.d.ts +2 -0
- package/dist/lib/format.d.ts.map +1 -0
- package/dist/lib/format.js +9 -0
- package/dist/lib/format.js.map +1 -0
- package/dist/lib/index.d.ts +46 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +41 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/invoice-email-outcome.d.ts +53 -0
- package/dist/lib/invoice-email-outcome.d.ts.map +1 -0
- package/dist/lib/invoice-email-outcome.js +43 -0
- package/dist/lib/invoice-email-outcome.js.map +1 -0
- package/dist/lib/module-presence/ModulePresenceProvider.d.ts +49 -0
- package/dist/lib/module-presence/ModulePresenceProvider.d.ts.map +1 -0
- package/dist/lib/module-presence/ModulePresenceProvider.js +73 -0
- package/dist/lib/module-presence/ModulePresenceProvider.js.map +1 -0
- package/dist/lib/module-presence/api.d.ts +15 -0
- package/dist/lib/module-presence/api.d.ts.map +1 -0
- package/dist/lib/module-presence/api.js +25 -0
- package/dist/lib/module-presence/api.js.map +1 -0
- package/dist/lib/module-presence/index.d.ts +3 -0
- package/dist/lib/module-presence/index.d.ts.map +1 -0
- package/dist/lib/module-presence/index.js +3 -0
- package/dist/lib/module-presence/index.js.map +1 -0
- package/dist/lib/money.d.ts +22 -0
- package/dist/lib/money.d.ts.map +1 -0
- package/dist/lib/money.js +51 -0
- package/dist/lib/money.js.map +1 -0
- package/dist/lib/page-size-options.d.ts +15 -0
- package/dist/lib/page-size-options.d.ts.map +1 -0
- package/dist/lib/page-size-options.js +14 -0
- package/dist/lib/page-size-options.js.map +1 -0
- package/dist/lib/status-color.d.ts +32 -0
- package/dist/lib/status-color.d.ts.map +1 -0
- package/dist/lib/status-color.js +24 -0
- package/dist/lib/status-color.js.map +1 -0
- package/dist/lib/surface-visibility.d.ts +70 -0
- package/dist/lib/surface-visibility.d.ts.map +1 -0
- package/dist/lib/surface-visibility.js +37 -0
- package/dist/lib/surface-visibility.js.map +1 -0
- package/dist/lib/text-normalization.d.ts +56 -0
- package/dist/lib/text-normalization.d.ts.map +1 -0
- package/dist/lib/text-normalization.js +59 -0
- package/dist/lib/text-normalization.js.map +1 -0
- package/dist/lib/use-page-size-preference.d.ts +29 -0
- package/dist/lib/use-page-size-preference.d.ts.map +1 -0
- package/dist/lib/use-page-size-preference.js +61 -0
- package/dist/lib/use-page-size-preference.js.map +1 -0
- package/dist/lib/use-unsaved-changes-prompt.d.ts +23 -0
- package/dist/lib/use-unsaved-changes-prompt.d.ts.map +1 -0
- package/dist/lib/use-unsaved-changes-prompt.js +75 -0
- package/dist/lib/use-unsaved-changes-prompt.js.map +1 -0
- package/dist/lib/utils.d.ts +9 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +12 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/uuid.d.ts +8 -0
- package/dist/lib/uuid.d.ts.map +1 -0
- package/dist/lib/uuid.js +18 -0
- package/dist/lib/uuid.js.map +1 -0
- package/dist/ui/alert.d.ts +12 -0
- package/dist/ui/alert.d.ts.map +1 -0
- package/dist/ui/alert.js +22 -0
- package/dist/ui/alert.js.map +1 -0
- package/dist/ui/badge.d.ts +10 -0
- package/dist/ui/badge.d.ts.map +1 -0
- package/dist/ui/badge.js +21 -0
- package/dist/ui/badge.js.map +1 -0
- package/dist/ui/button.d.ts +12 -0
- package/dist/ui/button.d.ts.map +1 -0
- package/dist/ui/button.js +31 -0
- package/dist/ui/button.js.map +1 -0
- package/dist/ui/card.d.ts +8 -0
- package/dist/ui/card.d.ts.map +1 -0
- package/dist/ui/card.js +16 -0
- package/dist/ui/card.js.map +1 -0
- package/dist/ui/checkbox.d.ts +8 -0
- package/dist/ui/checkbox.d.ts.map +1 -0
- package/dist/ui/checkbox.js +11 -0
- package/dist/ui/checkbox.js.map +1 -0
- package/dist/ui/color-picker.d.ts +23 -0
- package/dist/ui/color-picker.d.ts.map +1 -0
- package/dist/ui/color-picker.js +76 -0
- package/dist/ui/color-picker.js.map +1 -0
- package/dist/ui/combobox.d.ts +68 -0
- package/dist/ui/combobox.d.ts.map +1 -0
- package/dist/ui/combobox.js +182 -0
- package/dist/ui/combobox.js.map +1 -0
- package/dist/ui/dropdown-menu.d.ts +26 -0
- package/dist/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/ui/dropdown-menu.js +38 -0
- package/dist/ui/dropdown-menu.js.map +1 -0
- package/dist/ui/index.d.ts +47 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +38 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/input.d.ts +3 -0
- package/dist/ui/input.d.ts.map +1 -0
- package/dist/ui/input.js +8 -0
- package/dist/ui/input.js.map +1 -0
- package/dist/ui/label.d.ts +4 -0
- package/dist/ui/label.d.ts.map +1 -0
- package/dist/ui/label.js +9 -0
- package/dist/ui/label.js.map +1 -0
- package/dist/ui/multi-select.d.ts +32 -0
- package/dist/ui/multi-select.d.ts.map +1 -0
- package/dist/ui/multi-select.js +63 -0
- package/dist/ui/multi-select.js.map +1 -0
- package/dist/ui/page-header.d.ts +21 -0
- package/dist/ui/page-header.d.ts.map +1 -0
- package/dist/ui/page-header.js +9 -0
- package/dist/ui/page-header.js.map +1 -0
- package/dist/ui/route-tabs.d.ts +58 -0
- package/dist/ui/route-tabs.d.ts.map +1 -0
- package/dist/ui/route-tabs.js +34 -0
- package/dist/ui/route-tabs.js.map +1 -0
- package/dist/ui/save-button-group.d.ts +27 -0
- package/dist/ui/save-button-group.d.ts.map +1 -0
- package/dist/ui/save-button-group.js +44 -0
- package/dist/ui/save-button-group.js.map +1 -0
- package/dist/ui/section.d.ts +20 -0
- package/dist/ui/section.d.ts.map +1 -0
- package/dist/ui/section.js +7 -0
- package/dist/ui/section.js.map +1 -0
- package/dist/ui/select.d.ts +10 -0
- package/dist/ui/select.d.ts.map +1 -0
- package/dist/ui/select.js +15 -0
- package/dist/ui/select.js.map +1 -0
- package/dist/ui/separator.d.ts +3 -0
- package/dist/ui/separator.d.ts.map +1 -0
- package/dist/ui/separator.js +7 -0
- package/dist/ui/separator.js.map +1 -0
- package/dist/ui/table.d.ts +10 -0
- package/dist/ui/table.d.ts.map +1 -0
- package/dist/ui/table.js +20 -0
- package/dist/ui/table.js.map +1 -0
- package/dist/ui/textarea.d.ts +3 -0
- package/dist/ui/textarea.d.ts.map +1 -0
- package/dist/ui/textarea.js +8 -0
- package/dist/ui/textarea.js.map +1 -0
- package/dist/zones/AdminContributionsProvider.d.ts +72 -0
- package/dist/zones/AdminContributionsProvider.d.ts.map +1 -0
- package/dist/zones/AdminContributionsProvider.js +63 -0
- package/dist/zones/AdminContributionsProvider.js.map +1 -0
- package/dist/zones/AdminZone.d.ts +30 -0
- package/dist/zones/AdminZone.d.ts.map +1 -0
- package/dist/zones/AdminZone.js +59 -0
- package/dist/zones/AdminZone.js.map +1 -0
- package/dist/zones/RouteTabsZone.d.ts +62 -0
- package/dist/zones/RouteTabsZone.d.ts.map +1 -0
- package/dist/zones/RouteTabsZone.js +25 -0
- package/dist/zones/RouteTabsZone.js.map +1 -0
- package/dist/zones/ZoneErrorBoundary.d.ts +36 -0
- package/dist/zones/ZoneErrorBoundary.d.ts.map +1 -0
- package/dist/zones/ZoneErrorBoundary.js +44 -0
- package/dist/zones/ZoneErrorBoundary.js.map +1 -0
- package/dist/zones/index.d.ts +31 -0
- package/dist/zones/index.d.ts.map +1 -0
- package/dist/zones/index.js +27 -0
- package/dist/zones/index.js.map +1 -0
- package/dist/zones/use-admin-zone.d.ts +32 -0
- package/dist/zones/use-admin-zone.d.ts.map +1 -0
- package/dist/zones/use-admin-zone.js +96 -0
- package/dist/zones/use-admin-zone.js.map +1 -0
- package/package.json +94 -3
- package/tailwind.css +14 -0
- package/theme.css +2056 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Endora sp. z o.o. and the Endora Commerce contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,213 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@endora-commerce/admin-kit`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The admin surface a module package's `./admin` layer is written against
|
|
4
|
+
(feature 091, `specs/091-module-owned-admin-surfaces/`).
|
|
5
|
+
|
|
6
|
+
## What it publishes
|
|
7
|
+
|
|
8
|
+
Five subpaths, each an explicit barrel, all resolving at `./dist`:
|
|
9
|
+
|
|
10
|
+
| Subpath | What it is |
|
|
11
|
+
| --- | --- |
|
|
12
|
+
| `./ui` | the shadcn/Radix primitives — `button`, `alert`, `card`, `page-header`, `input`, `label`, `select`, `badge`, `table`, `checkbox`, `textarea`, `multi-select`, `combobox`, `save-button-group`, `color-picker`, `route-tabs`, `separator` |
|
|
13
|
+
| `./components` | the composites — `ResponsiveTable`, `PaginationFooter`, `RuleBuilder`, `StickyFormActions`, `TouchReorderButtons`, `<EChart>`, the pickers, the reorder helpers |
|
|
14
|
+
| `./lib` | `apiClient`, `format`, `money`, `utils` (`cn`), `text-normalization` (the one `foldDiacritics` / `slugify` owner), `uuid`, the unsaved-changes prompt, the icon map, the page-size options — and, since P3, the **session cluster**: `AuthProvider` / `useAuth`, `ModulePresenceProvider` / `useModulePresence`, `useSurfaceVisibility` and `usePageSizePreference` |
|
|
15
|
+
| `./i18n` | `useTranslation`, `TranslationProvider`, the language context and the resolver |
|
|
16
|
+
| `./contributions` | the declaration types, re-exported from `@endora-commerce/contracts` so a module needs one import for the shapes and not two |
|
|
17
|
+
|
|
18
|
+
**The membership is derived, never designed** (`admin-kit-surface.md` §1). Re-measured
|
|
19
|
+
on the day Phase 1b landed: **1782** reaches from **329** files under the admin's module
|
|
20
|
+
directories land on **62** distinct host modules, with `button` (186), `alert` (161) and
|
|
21
|
+
`card` (142) at the top. Of those 1782, **1690 are published here** and the 92 that are
|
|
22
|
+
not are ledgered, named, and each has a retiring condition — see below.
|
|
23
|
+
|
|
24
|
+
The transitive closure of that surface inside `admin/src` is **74 files**, of which **57**
|
|
25
|
+
moved into this package and **17** deliberately did not.
|
|
26
|
+
|
|
27
|
+
## How it is wired, and the property that has to hold
|
|
28
|
+
|
|
29
|
+
The implementations **moved**; `admin/src` keeps a one-line re-export shim at each of the
|
|
30
|
+
**53** old paths a remaining admin file names. So all 1690 existing `@/…` specifiers work
|
|
31
|
+
unchanged and every binding has exactly one home — the shape feature 080 used for the
|
|
32
|
+
platform relocation.
|
|
33
|
+
|
|
34
|
+
`admin-kit-surface.md` R4 originally said the kit would be a **façade** over `admin/src`
|
|
35
|
+
with nothing moving. It cannot be built, and both halves of the reason were measured on a
|
|
36
|
+
two-file probe:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
src/ui/index.ts(1,24): error TS6059: File 'admin/src/components/ui/button.tsx'
|
|
40
|
+
is not under 'rootDir' '…/src'. 'rootDir' is expected to contain all source files.
|
|
41
|
+
admin/src/components/ui/button.tsx(4,20): error TS2307: Cannot find module '@/lib/utils'
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Dropping `rootDir` makes it compile and emits a **second copy** of every component into
|
|
45
|
+
this package's `dist` — a duplicated module-scope value in a tree full of React context,
|
|
46
|
+
which is what `check:singleton-identity` refuses on the backend and for which there is no
|
|
47
|
+
frontend instrument at all.
|
|
48
|
+
|
|
49
|
+
So the property that has to hold is *one copy*, and it is asserted by reference equality
|
|
50
|
+
rather than by structure: `admin/test/kit/admin-kit-identity.test.ts` compares the binding
|
|
51
|
+
reached through a shim with the binding reached through the barrel using `toBe`, for a
|
|
52
|
+
function, a component, the API-client singleton, the `ApiError` class (`instanceof`) and a
|
|
53
|
+
React context. A second `createContext()` passes every structural comparison and is a
|
|
54
|
+
`null` context at runtime with no type error; that is the failure this file exists to make
|
|
55
|
+
impossible.
|
|
56
|
+
|
|
57
|
+
## What is still not published, and why
|
|
58
|
+
|
|
59
|
+
Two groups, 8 reaches, every one of them in `backend/scripts/ledgers/admin-surface.ts`
|
|
60
|
+
with its retiring condition. Both opened much larger — 77 reaches when Phase 1b closed —
|
|
61
|
+
and both were drained by a publication rather than by the batch that met them. `check:admin-surface` holds the ledger both ways, so neither
|
|
62
|
+
group can grow quietly and neither can be left behind once it is repaired.
|
|
63
|
+
|
|
64
|
+
**`asset-picker` (4 reaches).** Phase 1b left four pickers here, on the ground that each
|
|
65
|
+
fetched from **another module's** API client and publishing it would put module knowledge
|
|
66
|
+
in the kit and break R6. **P2 retired three of the four** — `sales-channel-picker`,
|
|
67
|
+
`cms-picker` and `organization-picker` are published above, because a picker whose module
|
|
68
|
+
knowledge is a *request* stops having any once the request is rebuilt from the published
|
|
69
|
+
`apiClient` and the owner's contract types. That is the same exit Phase 4's batches three
|
|
70
|
+
and five took for a module screen, and it is not the exit this section predicted: it said
|
|
71
|
+
the group *"retires with Phase 2"* through a zone contribution, and Phase 2 landed and
|
|
72
|
+
retired none of them, because the zone mechanism is P4's and does not exist yet.
|
|
73
|
+
|
|
74
|
+
~~`asset-picker` is left, and for a reason of kind rather than of size: its module knowledge
|
|
75
|
+
is `assets_library`' `AssetPicker` **component**, which no URL replaces. It is FR-007's
|
|
76
|
+
worked example and **retires with P4**.~~ **Retired by P4c instead (!1225/!1230), not by P4** — see
|
|
77
|
+
the withdrawal below; it needed no mechanism. Inverting the pickers to take their data by prop
|
|
78
|
+
was considered and rejected in Phase 1b and stays rejected: it moves the module knowledge
|
|
79
|
+
to the consumer, which owns the data no more than the kit does.
|
|
80
|
+
|
|
81
|
+
**The two tab strips over two modules' pages (4 reaches).** This entry read *"the admin's
|
|
82
|
+
session and module-presence state, 73 reaches"* and named the four hooks. **P3 published all
|
|
83
|
+
four**, and they are in the `./lib` row above.
|
|
84
|
+
|
|
85
|
+
What blocked them was never a design question — it was a measurement, and the measurement was
|
|
86
|
+
right. 23 of the admin's test files mocked those modules **at the module path**, on purpose:
|
|
87
|
+
`TaxesPage.permission-gating.test.tsx` said so in its own comment, *"the mocks stop at
|
|
88
|
+
`useAuth` and `useModulePresence` deliberately, so the real `useSurfaceVisibility` is the
|
|
89
|
+
thing under test rather than a stub of it."* `vi.mock` keys on a module id, so moving
|
|
90
|
+
`surface-visibility` here alongside `auth` put that seam **inside** the package, where those
|
|
91
|
+
mocks could not reach it. Measured by doing it: **36 files and 179 tests**, every one failing
|
|
92
|
+
with `useAuth must be used inside <AuthProvider>` — and **37** by the time it landed, because
|
|
93
|
+
a module with an off-state test of its own arrived on `master` in the meantime. A count
|
|
94
|
+
describes one commit; re-derive the population against the tree that will run. They drive the real providers now, seeded
|
|
95
|
+
through `initial` on both — a better test on its own terms, because a permission gate
|
|
96
|
+
asserted against a stub of the predicate asserts that the stub was consulted.
|
|
97
|
+
|
|
98
|
+
What is left is `InvoiceSectionTabs` and `OrderEntryTabs`, which are components rather than
|
|
99
|
+
hooks and were never blocked by the same thing. Each renders on two modules' pages and
|
|
100
|
+
belongs to neither — `invoices` and its templates screen, `orders` and `quick_order` — so
|
|
101
|
+
publishing one would put that pairing in the kit, which is module knowledge (R6). They
|
|
102
|
+
**retire with P4**, like `asset-picker`: a tab strip over two modules' surfaces is a zone
|
|
103
|
+
with two contributions.
|
|
104
|
+
|
|
105
|
+
**The substitution seam for the session cluster is a prop, not a mock**, and that was
|
|
106
|
+
measured rather than chosen. `AuthProvider` takes `initial: AdminMe` and
|
|
107
|
+
`ModulePresenceProvider` has taken `initial` since feature 073; supply either and the
|
|
108
|
+
provider starts resolved and skips its boot fetch. The alternative — a kit file importing
|
|
109
|
+
`apiClient` from this package's own `./lib` barrel, which is the seam P2 established for the
|
|
110
|
+
three published pickers — **does not work for a member of that barrel**: it is a cycle, and
|
|
111
|
+
under a `vi.mock` factory calling `importActual` it resolves to the *real* module, so the
|
|
112
|
+
stub is bypassed silently and the request goes out to whatever is listening on the API
|
|
113
|
+
origin. `auth.tsx` and `module-presence/api.ts` therefore import `./api-client.js` directly
|
|
114
|
+
and say so in place. The same is true of `i18n/language-storage.ts` and the five older
|
|
115
|
+
data-fetching components, which is `specs/deferred-defects.md`'s entry from !1212.
|
|
116
|
+
|
|
117
|
+
`PAGE_SIZE_OPTIONS` was the one binding Phase 1b split out of a module that stayed behind:
|
|
118
|
+
the **constant** was design-system and the **preference** was application state, because the
|
|
119
|
+
hook reads the signed-in admin's id. That id is `useAuth`'s, which is published now, so the
|
|
120
|
+
split has nothing left to separate — both halves are here and the shim forwards both.
|
|
121
|
+
|
|
122
|
+
## How a kit component gets its data
|
|
123
|
+
|
|
124
|
+
**It builds the request itself, from the published `apiClient` and the owner's contract
|
|
125
|
+
types.** That is not a new rule — five components did it before P2 (`CustomerPicker`,
|
|
126
|
+
`AdminUserPicker`, `CustomerGroupPicker`, `CategorySelect` and `useCountriesQuery`, the
|
|
127
|
+
last of them over `dictionaries`' public dictionary facade) — but it had never been
|
|
128
|
+
written down, which is how four pickers came to be blocked on a mechanism nobody was
|
|
129
|
+
building.
|
|
130
|
+
|
|
131
|
+
The rule R6 states is *no module knowledge*, and an HTTP path plus a schema out of
|
|
132
|
+
`@endora-commerce/contracts` is not module knowledge: the kit already depends on that
|
|
133
|
+
package, both sides compile it, and Principle II makes it the one place the shape is
|
|
134
|
+
defined. What R6 refuses is a **module's code** — its admin API client, its components, a
|
|
135
|
+
module id in a branch — and that is exactly what a rebuilt request removes.
|
|
136
|
+
|
|
137
|
+
Two alternatives were weighed and rejected. **Taking the data by prop** moves the module
|
|
138
|
+
knowledge to the consumer, which owns it no more than the kit does, and rewrites every
|
|
139
|
+
public component API and every consumer. **Injecting a loader through a kit context**
|
|
140
|
+
is the same displacement with a registration step, and it would make a picker's behaviour
|
|
141
|
+
depend on which provider happened to be mounted — untypeable at the call site and
|
|
142
|
+
invisible to `check:admin-surface`.
|
|
143
|
+
|
|
144
|
+
~~The limit is stated so it is not discovered later: a picker whose module knowledge is a
|
|
145
|
+
**component** has nothing to rebuild. `asset-picker` renders `assets_library`' own
|
|
146
|
+
`AssetPicker`, so it stays unpublished until P4's zone mechanism exists.~~
|
|
147
|
+
|
|
148
|
+
**Withdrawn, 2026-08-31 (P4c, !1225/!1230).** That limit was drawn one level too shallow and
|
|
149
|
+
`asset-picker` is now published. Its module knowledge was never the component: `AssetPicker` is 153
|
|
150
|
+
lines calling `apiClient.get` over a path, with every type already in `@endora-commerce/contracts`,
|
|
151
|
+
and `AssetUploader` posts multipart over the `apiBaseUrl` the kit publishes. Reading it as a
|
|
152
|
+
component-shaped reach kept 19 ledger keys waiting on a mechanism they never needed.
|
|
153
|
+
`CustomFieldValuesPanel` (P4e, !1232) was the second case of the same misreading.
|
|
154
|
+
|
|
155
|
+
**What decides it instead** — the rule that replaced this paragraph: a reach is a **zone
|
|
156
|
+
contribution** when the *owner* decides that it appears, and a **published component** when the
|
|
157
|
+
*consumer* does. Mechanically: does the consumer pass a value in and get one back? See
|
|
158
|
+
`specs/091-module-owned-admin-surfaces/contracts/admin-component-contribution.md` §Z1.
|
|
159
|
+
|
|
160
|
+
## Rules
|
|
161
|
+
|
|
162
|
+
- **A key is reused when its *value* is already in `core`, not when its *name* looks generic.**
|
|
163
|
+
R-1's repairs folded `common.close` into `common.action.close` and `common.loading` into
|
|
164
|
+
`common.state.loading` because both were **byte-identical** in `en` and `pl`; `common.search` had no
|
|
165
|
+
`core` equivalent and was added to the `common.action.*` family rather than kept as a
|
|
166
|
+
component-scoped near-duplicate. `CategoryTreePicker` folded **none** of its seven — *"Loading
|
|
167
|
+
categories…"* is not `common.state.loading`'s *"Loading…"*, and `core` already carries
|
|
168
|
+
`countrySelect.loading` = *"Loading countries…"* beside the generic one, so a kit component keeping
|
|
169
|
+
its own specific sentence is the established shape here. Folding by name is a copy change wearing a
|
|
170
|
+
refactor's clothes.
|
|
171
|
+
|
|
172
|
+
- **Every dependency the kit renders with is a `peerDependency`** so the application
|
|
173
|
+
resolves one copy (R7). Two copies of `react-router-dom` is two router contexts and a
|
|
174
|
+
`useNavigate()` that throws; two copies of `react` is hooks that fail at runtime with no
|
|
175
|
+
type error.
|
|
176
|
+
- **No wildcard subpath** (R1) and **no `export *` in a barrel** (R2) —
|
|
177
|
+
`check:admin-surface` exits 2 on a barrel it cannot enumerate, because a short published
|
|
178
|
+
set reports *more* findings and its obvious repair is to widen the barrel silently.
|
|
179
|
+
- **No root export** (R3): a consumer names the group it wants, so a reach is legible in
|
|
180
|
+
the import line.
|
|
181
|
+
- **The kit adds no component** (R5): a component that exists only here is one the admin
|
|
182
|
+
application does not use, which is how a design system acquires two answers to one
|
|
183
|
+
question. New pieces go into the admin first and are published in the same merge request.
|
|
184
|
+
- **Tailwind utility classes are permitted** (R9), and that is the deliberate asymmetry
|
|
185
|
+
with the storefront: the admin has exactly one first-party UI and no theme to negotiate
|
|
186
|
+
with (D-15).
|
|
187
|
+
- **Both `tsconfig.base.json` `paths` entries are written, and the bare one names a file
|
|
188
|
+
this package deliberately does not have.** R3 gives the kit no root export, so a consumer
|
|
189
|
+
names the group it wants. The pair is written anyway because
|
|
190
|
+
`workspace-resolution.test.ts` requires both or neither — one of the two is still a
|
|
191
|
+
capture — and the missing target fails closed: `tsc` falls through to node resolution,
|
|
192
|
+
which the `exports` map refuses for `.` exactly as it should. (The reason lives here
|
|
193
|
+
rather than beside the entry because that test reads `tsconfig.base.json` with
|
|
194
|
+
`JSON.parse`, which rejects a comment.)
|
|
195
|
+
- **This package carries no `endora` block**, and that is load-bearing:
|
|
196
|
+
`backend/test/unit/harness/workspace-resolution.test.ts` reads that block to decide which
|
|
197
|
+
members are *refused* a `tsconfig.base.json` `paths` entry. The kit is a library the
|
|
198
|
+
admin and a module's admin layer resolve, not a member the platform composes, so it takes
|
|
199
|
+
both entries.
|
|
200
|
+
- **`vite` is a devDependency for one type declaration.** Five moved files read
|
|
201
|
+
`import.meta.env` — one for the API base URL, four to keep a diagnostic out of a
|
|
202
|
+
production bundle — and the expressions are kept **verbatim**, because Vite replaces
|
|
203
|
+
`import.meta.env.VITE_API_BASE_URL` at build time and a cast or an indirection is a
|
|
204
|
+
chance for that replacement to stop happening in a way no type-check can see. Nothing
|
|
205
|
+
imports `vite`, so it does not reach `dist` and is not a consumer's dependency.
|
|
206
|
+
|
|
207
|
+
## Known rough edge
|
|
208
|
+
|
|
209
|
+
`./i18n` publishes `resolve` (the translation resolver) under that bare name, because it
|
|
210
|
+
is the name every existing caller and both of its tests already use and this merge request
|
|
211
|
+
is a move. It is a poor name on a public barrel and renaming it is a `major` under R12 —
|
|
212
|
+
worth doing before the first package is published, not inside a change whose subject is a
|
|
213
|
+
file relocation.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Drag-and-drop file picker (feature 039). Reads the dropped / selected file
|
|
4
|
+
* as base64 and hands it to `onFile`; all parsing stays on the backend.
|
|
5
|
+
*/
|
|
6
|
+
export declare function FileDropzone({ onFile, accept, label, selectedLabel, }: {
|
|
7
|
+
onFile: (filename: string, contentBase64: string) => void;
|
|
8
|
+
accept?: string;
|
|
9
|
+
label?: string;
|
|
10
|
+
/** Rendered instead of `label` once a file is chosen. Defaults to `Selected: <name>`. */
|
|
11
|
+
selectedLabel?: (filename: string) => string;
|
|
12
|
+
}): ReactNode;
|
|
13
|
+
//# sourceMappingURL=FileDropzone.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileDropzone.d.ts","sourceRoot":"","sources":["../../src/components/FileDropzone.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,MAAqB,EACrB,KAA2D,EAC3D,aAAa,GACd,EAAE;IACD,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yFAAyF;IACzF,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;CAC9C,GAAG,SAAS,CAsDZ"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useState } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Drag-and-drop file picker (feature 039). Reads the dropped / selected file
|
|
5
|
+
* as base64 and hands it to `onFile`; all parsing stays on the backend.
|
|
6
|
+
*/
|
|
7
|
+
export function FileDropzone({ onFile, accept = '.csv,.xlsx', label = 'Drag a CSV or Excel file here, or click to choose', selectedLabel, }) {
|
|
8
|
+
const inputRef = useRef(null);
|
|
9
|
+
const [name, setName] = useState(null);
|
|
10
|
+
const [dragging, setDragging] = useState(false);
|
|
11
|
+
function ingest(file) {
|
|
12
|
+
setName(file.name);
|
|
13
|
+
const reader = new FileReader();
|
|
14
|
+
reader.onload = () => {
|
|
15
|
+
const dataUrl = typeof reader.result === 'string' ? reader.result : '';
|
|
16
|
+
const comma = dataUrl.indexOf(',');
|
|
17
|
+
onFile(file.name, comma >= 0 ? dataUrl.slice(comma + 1) : '');
|
|
18
|
+
};
|
|
19
|
+
reader.readAsDataURL(file);
|
|
20
|
+
}
|
|
21
|
+
return (_jsxs("div", { children: [_jsx("div", { className: `rounded-md border-2 border-dashed p-6 text-center text-sm cursor-pointer ${dragging ? 'border-primary bg-muted' : 'border-muted-foreground/30'}`, onDragOver: (e) => {
|
|
22
|
+
e.preventDefault();
|
|
23
|
+
setDragging(true);
|
|
24
|
+
}, onDragLeave: () => setDragging(false), onDrop: (e) => {
|
|
25
|
+
e.preventDefault();
|
|
26
|
+
setDragging(false);
|
|
27
|
+
const file = e.dataTransfer.files?.[0];
|
|
28
|
+
if (file)
|
|
29
|
+
ingest(file);
|
|
30
|
+
}, onClick: () => inputRef.current?.click(), onKeyDown: (e) => {
|
|
31
|
+
if (e.key === 'Enter' || e.key === ' ')
|
|
32
|
+
inputRef.current?.click();
|
|
33
|
+
}, role: "button", tabIndex: 0, children: name ? (selectedLabel ? selectedLabel(name) : `Selected: ${name}`) : label }), _jsx("input", { ref: inputRef, type: "file", accept: accept, className: "hidden", onChange: (e) => {
|
|
34
|
+
const file = e.target.files?.[0];
|
|
35
|
+
if (file)
|
|
36
|
+
ingest(file);
|
|
37
|
+
} })] }));
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=FileDropzone.js.map
|
|
@@ -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AAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { type PageSizeOption } from '../lib/page-size-options.js';
|
|
3
|
+
export interface PaginationFooterProps {
|
|
4
|
+
/** Zero-based page index. */
|
|
5
|
+
page: number;
|
|
6
|
+
/** Currently chosen page size; must be one of `PAGE_SIZE_OPTIONS`. */
|
|
7
|
+
pageSize: PageSizeOption;
|
|
8
|
+
/** Total number of items across all pages (post-filter). */
|
|
9
|
+
total: number;
|
|
10
|
+
/** Called when the user picks a different page size. The list owner
|
|
11
|
+
* is responsible for resetting `page` to 0 (we don't do it here so
|
|
12
|
+
* the footer stays a pure presentational component). */
|
|
13
|
+
onPageSizeChange: (next: PageSizeOption) => void;
|
|
14
|
+
onPrev: () => void;
|
|
15
|
+
onNext: () => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Pagination footer used by the admin list pages — renders a
|
|
19
|
+
* "Showing X–Y of Z" summary, a rows-per-page dropdown wired to
|
|
20
|
+
* `usePageSizePreference`, and Prev/Next buttons. Disabled-state on
|
|
21
|
+
* the buttons reflects page bounds; the empty-list case still renders
|
|
22
|
+
* (so the footer doesn't disappear and "wiggle" the layout).
|
|
23
|
+
*/
|
|
24
|
+
export declare function PaginationFooter(props: PaginationFooterProps): ReactNode;
|
|
25
|
+
//# sourceMappingURL=PaginationFooter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaginationFooter.d.ts","sourceRoot":"","sources":["../../src/components/PaginationFooter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAGrF,MAAM,WAAW,qBAAqB;IACpC,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,QAAQ,EAAE,cAAc,CAAC;IACzB,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd;;6DAEyD;IACzD,gBAAgB,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IACjD,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,SAAS,CAoExE"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronLeft, ChevronRight } from 'lucide-react';
|
|
3
|
+
import { PAGE_SIZE_OPTIONS } from '../lib/page-size-options.js';
|
|
4
|
+
import { useTranslation } from '../i18n/useTranslation.js';
|
|
5
|
+
/**
|
|
6
|
+
* Pagination footer used by the admin list pages — renders a
|
|
7
|
+
* "Showing X–Y of Z" summary, a rows-per-page dropdown wired to
|
|
8
|
+
* `usePageSizePreference`, and Prev/Next buttons. Disabled-state on
|
|
9
|
+
* the buttons reflects page bounds; the empty-list case still renders
|
|
10
|
+
* (so the footer doesn't disappear and "wiggle" the layout).
|
|
11
|
+
*/
|
|
12
|
+
export function PaginationFooter(props) {
|
|
13
|
+
const { page, pageSize, total, onPageSizeChange, onPrev, onNext } = props;
|
|
14
|
+
const t = useTranslation('core');
|
|
15
|
+
const totalPages = total === 0 ? 1 : Math.ceil(total / pageSize);
|
|
16
|
+
const safePage = Math.min(Math.max(0, page), Math.max(0, totalPages - 1));
|
|
17
|
+
const start = total === 0 ? 0 : safePage * pageSize + 1;
|
|
18
|
+
const end = Math.min((safePage + 1) * pageSize, total);
|
|
19
|
+
const isFirst = safePage === 0;
|
|
20
|
+
const isLast = safePage >= totalPages - 1;
|
|
21
|
+
return (_jsxs("div", { className: "b2b-card__foot", children: [_jsxs("div", { className: "b2b-row", style: { gap: 12, alignItems: 'center' }, children: [_jsx("div", { className: "b2b-muted", style: { fontSize: 12 }, children: total === 0
|
|
22
|
+
? t('common.pagination.noResults')
|
|
23
|
+
: t('common.pagination.showingRange', { start, end, total }) }), _jsxs("label", { className: "b2b-row", style: { gap: 6, alignItems: 'center', fontSize: 12, color: 'var(--fg-muted)' }, children: [t('common.pagination.rowsPerPage'), _jsx("select", { className: "b2b-field b2b-field--sm", value: pageSize, onChange: (e) => {
|
|
24
|
+
const next = Number.parseInt(e.target.value, 10);
|
|
25
|
+
if (PAGE_SIZE_OPTIONS.includes(next)) {
|
|
26
|
+
onPageSizeChange(next);
|
|
27
|
+
}
|
|
28
|
+
}, style: { height: 28, padding: '0 24px 0 8px', fontSize: 12 }, children: PAGE_SIZE_OPTIONS.map((opt) => (_jsx("option", { value: opt, children: opt }, opt))) })] })] }), _jsxs("div", { className: "b2b-row", style: { gap: 8, alignItems: 'center' }, children: [_jsx("span", { className: "b2b-muted", style: { fontSize: 12 }, children: t('common.pagination.pageXofY', {
|
|
29
|
+
page: totalPages === 0 ? 0 : safePage + 1,
|
|
30
|
+
total: totalPages,
|
|
31
|
+
}) }), _jsxs("button", { type: "button", className: "b2b-btn b2b-btn--default b2b-btn--sm", onClick: onPrev, disabled: isFirst, children: [_jsx(ChevronLeft, { size: 13 }), " ", t('common.pagination.previous')] }), _jsxs("button", { type: "button", className: "b2b-btn b2b-btn--default b2b-btn--sm", onClick: onNext, disabled: isLast, children: [t('common.pagination.next'), " ", _jsx(ChevronRight, { size: 13 })] })] })] }));
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=PaginationFooter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaginationFooter.js","sourceRoot":"","sources":["../../src/components/PaginationFooter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,EAAE,iBAAiB,EAAuB,MAAM,6BAA6B,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAiB3D;;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C,sCAAsC,EAChD,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,OAAO,aAEjB,KAAC,WAAW,IAAC,IAAI,EAAE,EAAE,GAAI,OAAE,CAAC,CAAC,4BAA4B,CAAC,IACnD,EACT,kBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,sCAAsC,EAChD,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,aAEf,CAAC,CAAC,wBAAwB,CAAC,OAAE,KAAC,YAAY,IAAC,IAAI,EAAE,EAAE,GAAI,IACjD,IACL,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface ResponsiveColumn<T> {
|
|
3
|
+
id: string;
|
|
4
|
+
header: ReactNode;
|
|
5
|
+
/** Shown in the card headline on mobile. At least one column must be primary. */
|
|
6
|
+
primary?: boolean;
|
|
7
|
+
/** Omitted from the card headline; still shown in the desktop table. */
|
|
8
|
+
hideOnMobile?: boolean;
|
|
9
|
+
render: (row: T) => ReactNode;
|
|
10
|
+
/** Optional second line under the headline on mobile. */
|
|
11
|
+
meta?: (row: T) => ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ResponsiveTableProps<T> {
|
|
15
|
+
columns: ResponsiveColumn<T>[];
|
|
16
|
+
data: T[];
|
|
17
|
+
keyExtractor: (row: T) => string;
|
|
18
|
+
emptyState?: ReactNode;
|
|
19
|
+
/** Optional row actions rendered in the last table column and on each card. */
|
|
20
|
+
renderActions?: (row: T) => ReactNode;
|
|
21
|
+
onRowClick?: (row: T) => void;
|
|
22
|
+
/** Force horizontal scroll wrapper instead of cards on mobile. */
|
|
23
|
+
mode?: 'auto' | 'table-scroll';
|
|
24
|
+
}
|
|
25
|
+
export declare function ResponsiveTable<T>(props: ResponsiveTableProps<T>): ReactNode;
|
|
26
|
+
//# sourceMappingURL=ResponsiveTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResponsiveTable.d.ts","sourceRoot":"","sources":["../../src/components/ResponsiveTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAWvC,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,SAAS,CAAC;IAClB,iFAAiF;IACjF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,wEAAwE;IACxE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,SAAS,CAAC;IAC9B,yDAAyD;IACzD,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,SAAS,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB,CAAC,CAAC;IACrC,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/B,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,YAAY,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,CAAC;IACjC,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,+EAA+E;IAC/E,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,SAAS,CAAC;IACtC,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC;IAC9B,kEAAkE;IAClE,IAAI,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC;CAChC;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,SAAS,CA4G5E"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from '../ui/table.js';
|
|
3
|
+
import { useViewportTier } from './hooks/useViewportTier.js';
|
|
4
|
+
export function ResponsiveTable(props) {
|
|
5
|
+
const { columns, data, keyExtractor, emptyState = null, renderActions, onRowClick, mode = 'auto', } = props;
|
|
6
|
+
const tier = useViewportTier();
|
|
7
|
+
const primaryColumns = columns.filter((c) => c.primary);
|
|
8
|
+
const displayColumns = primaryColumns.length > 0
|
|
9
|
+
? primaryColumns
|
|
10
|
+
: columns[0] != null
|
|
11
|
+
? [columns[0]]
|
|
12
|
+
: [];
|
|
13
|
+
if (data.length === 0) {
|
|
14
|
+
return emptyState;
|
|
15
|
+
}
|
|
16
|
+
if (tier === 'desktop' || mode === 'table-scroll') {
|
|
17
|
+
const table = (_jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [columns.map((col) => (_jsx(TableHead, { className: col.className, children: col.header }, col.id))), renderActions ? _jsx(TableHead, { className: "w-[1%]" }) : null] }) }), _jsx(TableBody, { children: data.map((row) => (_jsxs(TableRow, { className: onRowClick ? 'cursor-pointer' : undefined, onClick: onRowClick ? () => onRowClick(row) : undefined, children: [columns.map((col) => (_jsx(TableCell, { className: col.className, children: col.render(row) }, col.id))), renderActions ? _jsx(TableCell, { children: renderActions(row) }) : null] }, keyExtractor(row)))) })] }));
|
|
18
|
+
if (mode === 'table-scroll') {
|
|
19
|
+
return _jsx("div", { className: "b2b-table-scroll", children: table });
|
|
20
|
+
}
|
|
21
|
+
return table;
|
|
22
|
+
}
|
|
23
|
+
return (_jsx("div", { className: "flex flex-col gap-3", children: data.map((row) => (_jsxs("div", { className: "b2b-responsive-card", role: onRowClick ? 'button' : undefined, tabIndex: onRowClick ? 0 : undefined, onClick: onRowClick ? () => onRowClick(row) : undefined, onKeyDown: onRowClick
|
|
24
|
+
? (e) => {
|
|
25
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
26
|
+
e.preventDefault();
|
|
27
|
+
onRowClick(row);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
: undefined, children: [_jsx("div", { className: "b2b-responsive-card__headline", children: displayColumns.map((col) => (_jsx("span", { children: col.render(row) }, col.id))) }), displayColumns.some((col) => col.meta) ? (_jsx("div", { className: "b2b-responsive-card__meta", children: displayColumns.map((col) => col.meta ? _jsx("span", { children: col.meta(row) }, col.id) : null) })) : null, columns
|
|
31
|
+
.filter((c) => !c.primary && !c.hideOnMobile)
|
|
32
|
+
.map((col) => (_jsxs("div", { className: "text-sm text-muted-foreground", children: [_jsxs("span", { className: "font-medium text-foreground", children: [col.header, ": "] }), col.render(row)] }, col.id))), renderActions ? (_jsx("div", { className: "b2b-responsive-card__actions", children: renderActions(row) })) : null] }, keyExtractor(row)))) }));
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=ResponsiveTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResponsiveTable.js","sourceRoot":"","sources":["../../src/components/ResponsiveTable.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,KAAK,EACL,SAAS,EACT,SAAS,EACT,SAAS,EACT,WAAW,EACX,QAAQ,GACT,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AA2B7D,MAAM,UAAU,eAAe,CAAI,KAA8B;IAC/D,MAAM,EACJ,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,UAAU,GAAG,IAAI,EACjB,aAAa,EACb,UAAU,EACV,IAAI,GAAG,MAAM,GACd,GAAG,KAAK,CAAC;IACV,MAAM,IAAI,GAAG,eAAe,EAAE,CAAC;IAC/B,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IACxD,MAAM,cAAc,GAClB,cAAc,CAAC,MAAM,GAAG,CAAC;QACvB,CAAC,CAAC,cAAc;QAChB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,IAAI;YAClB,CAAC,CAAC,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I,CAAC,CAAC,CAAC,yBAAoB,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAtB,GAAG,CAAC,EAAE,CAAwB,CAAC,CAAC,CAAC,IAAI,CAC5D,GACG,CACP,CAAC,CAAC,CAAC,IAAI,EACP,OAAO;qBACL,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC;qBAC5C,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACZ,eAAkB,SAAS,EAAC,+BAA+B,aACzD,gBAAM,SAAS,EAAC,6BAA6B,aAAE,GAAG,CAAC,MAAM,UAAU,EAClE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,KAFR,GAAG,CAAC,EAAE,CAGV,CACP,CAAC,EACH,aAAa,CAAC,CAAC,CAAC,CACf,cAAK,SAAS,EAAC,8BAA8B,YAAE,aAAa,CAAC,GAAG,CAAC,GAAO,CACzE,CAAC,CAAC,CAAC,IAAI,KAtCH,YAAY,CAAC,GAAG,CAAC,CAuClB,CACP,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The overflow ("…") menu on a table row.
|
|
4
|
+
*
|
|
5
|
+
* Every admin list needs the same thing — a few secondary actions that would
|
|
6
|
+
* crowd the row if they were buttons — and every hand-rolled version of it has
|
|
7
|
+
* the same two bugs: it is clipped by the table's `overflow-x: auto`, and it
|
|
8
|
+
* answers to the mouse but not the keyboard. Both are solved once here.
|
|
9
|
+
*
|
|
10
|
+
* The trigger is an icon button with a real accessible name (`label`): "⋮" on
|
|
11
|
+
* its own tells a screen-reader user nothing, and a `title` alone is not a name
|
|
12
|
+
* on every platform (WCAG 2.2 AA, 4.1.2).
|
|
13
|
+
*/
|
|
14
|
+
export interface RowActionMenuProps {
|
|
15
|
+
/** Accessible name for the trigger — say what it opens, e.g. "Actions for Winter feed". */
|
|
16
|
+
label: string;
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
/** Disables the trigger outright; pair with `title` to say why. */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
title?: string | undefined;
|
|
21
|
+
}
|
|
22
|
+
export declare function RowActionMenu({ label, children, disabled, title, }: RowActionMenuProps): ReactNode;
|
|
23
|
+
export interface RowActionMenuItemProps {
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
onSelect?: (() => void) | undefined;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
title?: string | undefined;
|
|
28
|
+
/** Irreversible actions (delete, revoke). Renders in the destructive colour. */
|
|
29
|
+
destructive?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Render as something other than a button — a `<Link>` or an `<a download>`.
|
|
32
|
+
* Radix forwards its item behaviour onto the child, so navigation entries
|
|
33
|
+
* keep working with middle-click and "open in new tab" instead of being
|
|
34
|
+
* buttons that call `navigate()`.
|
|
35
|
+
*/
|
|
36
|
+
asChild?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export declare function RowActionMenuItem({ children, onSelect, disabled, title, destructive, asChild, }: RowActionMenuItemProps): ReactNode;
|
|
39
|
+
export declare function RowActionMenuSeparator(): ReactNode;
|
|
40
|
+
//# sourceMappingURL=RowActionMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RowActionMenu.d.ts","sourceRoot":"","sources":["../../src/components/RowActionMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAWvC;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,kBAAkB;IACjC,2FAA2F;IAC3F,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;IACpB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B;AAED,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,QAAQ,EACR,QAAgB,EAChB,KAAK,GACN,EAAE,kBAAkB,GAAG,SAAS,CAmBhC;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,gFAAgF;IAChF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,QAAQ,EACR,QAAgB,EAChB,KAAK,EACL,WAAmB,EACnB,OAAe,GAChB,EAAE,sBAAsB,GAAG,SAAS,CAYpC;AAED,wBAAgB,sBAAsB,IAAI,SAAS,CAElD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import {} from 'react';
|
|
3
|
+
import { MoreVertical } from 'lucide-react';
|
|
4
|
+
import { Button } from '../ui/button.js';
|
|
5
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from '../ui/dropdown-menu.js';
|
|
6
|
+
export function RowActionMenu({ label, children, disabled = false, title, }) {
|
|
7
|
+
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { type: "button", size: "icon", variant: "ghost", className: "h-8 w-8", "aria-label": label, disabled: disabled, ...(title === undefined ? {} : { title }), children: _jsx(MoreVertical, { size: 16, "aria-hidden": "true" }) }) }), _jsx(DropdownMenuContent, { align: "end", children: children })] }));
|
|
8
|
+
}
|
|
9
|
+
export function RowActionMenuItem({ children, onSelect, disabled = false, title, destructive = false, asChild = false, }) {
|
|
10
|
+
return (_jsx(DropdownMenuItem, { asChild: asChild, destructive: destructive, disabled: disabled, ...(title === undefined ? {} : { title }), ...(onSelect === undefined ? {} : { onSelect: () => onSelect() }), children: children }));
|
|
11
|
+
}
|
|
12
|
+
export function RowActionMenuSeparator() {
|
|
13
|
+
return _jsx(DropdownMenuSeparator, {});
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=RowActionMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RowActionMenu.js","sourceRoot":"","sources":["../../src/components/RowActionMenu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAwBhC,MAAM,UAAU,aAAa,CAAC,EAC5B,KAAK,EACL,QAAQ,EACR,QAAQ,GAAG,KAAK,EAChB,KAAK,GACc;IACnB,OAAO,CACL,MAAC,YAAY,eACX,KAAC,mBAAmB,IAAC,OAAO,kBAC1B,KAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,MAAM,EACX,OAAO,EAAC,OAAO,EACf,SAAS,EAAC,SAAS,gBACP,KAAK,EACjB,QAAQ,EAAE,QAAQ,KACd,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,YAE1C,KAAC,YAAY,IAAC,IAAI,EAAE,EAAE,iBAAc,MAAM,GAAG,GACtC,GACW,EACtB,KAAC,mBAAmB,IAAC,KAAK,EAAC,KAAK,YAAE,QAAQ,GAAuB,IACpD,CAChB,CAAC;AACJ,CAAC;AAkBD,MAAM,UAAU,iBAAiB,CAAC,EAChC,QAAQ,EACR,QAAQ,EACR,QAAQ,GAAG,KAAK,EAChB,KAAK,EACL,WAAW,GAAG,KAAK,EACnB,OAAO,GAAG,KAAK,GACQ;IACvB,OAAO,CACL,KAAC,gBAAgB,IACf,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,KACd,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,KACtC,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,YAEjE,QAAQ,GACQ,CACpB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,sBAAsB;IACpC,OAAO,KAAC,qBAAqB,KAAG,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface StickyFormActionsProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Primary form actions — fixed to the bottom on mobile, inline on desktop.
|
|
8
|
+
*/
|
|
9
|
+
export declare function StickyFormActions(props: StickyFormActionsProps): ReactNode;
|
|
10
|
+
//# sourceMappingURL=StickyFormActions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StickyFormActions.d.ts","sourceRoot":"","sources":["../../src/components/StickyFormActions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,SAAS,CAG1E"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../lib/utils.js';
|
|
3
|
+
/**
|
|
4
|
+
* Primary form actions — fixed to the bottom on mobile, inline on desktop.
|
|
5
|
+
*/
|
|
6
|
+
export function StickyFormActions(props) {
|
|
7
|
+
const { children, className } = props;
|
|
8
|
+
return _jsx("div", { className: cn('b2b-sticky-form-actions', className), children: children });
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=StickyFormActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StickyFormActions.js","sourceRoot":"","sources":["../../src/components/StickyFormActions.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAOrC;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAA6B;IAC7D,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IACtC,OAAO,cAAK,SAAS,EAAE,EAAE,CAAC,yBAAyB,EAAE,SAAS,CAAC,YAAG,QAAQ,GAAO,CAAC;AACpF,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface TouchReorderButtonsProps {
|
|
3
|
+
onMoveUp: () => void;
|
|
4
|
+
onMoveDown: () => void;
|
|
5
|
+
disableUp?: boolean;
|
|
6
|
+
disableDown?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Touch-friendly alternative to HTML5 drag-and-drop (feature 029).
|
|
11
|
+
*/
|
|
12
|
+
export declare function TouchReorderButtons(props: TouchReorderButtonsProps): ReactNode;
|
|
13
|
+
//# sourceMappingURL=TouchReorderButtons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TouchReorderButtons.d.ts","sourceRoot":"","sources":["../../src/components/TouchReorderButtons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,GAAG,SAAS,CA0B9E"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronDown, ChevronUp } from 'lucide-react';
|
|
3
|
+
import { useTranslation } from '../i18n/useTranslation.js';
|
|
4
|
+
/**
|
|
5
|
+
* Touch-friendly alternative to HTML5 drag-and-drop (feature 029).
|
|
6
|
+
*/
|
|
7
|
+
export function TouchReorderButtons(props) {
|
|
8
|
+
const { onMoveUp, onMoveDown, disableUp, disableDown, disabled } = props;
|
|
9
|
+
const t = useTranslation('core');
|
|
10
|
+
return (_jsxs("div", { className: "b2b-touch-reorder", role: "group", "aria-label": t('reorder.groupLabel'), children: [_jsx("button", { type: "button", className: "b2b-touch-reorder__btn", onClick: onMoveUp, disabled: disabled || disableUp, "aria-label": t('reorder.moveUp'), children: _jsx(ChevronUp, { size: 18 }) }), _jsx("button", { type: "button", className: "b2b-touch-reorder__btn", onClick: onMoveDown, disabled: disabled || disableDown, "aria-label": t('reorder.moveDown'), children: _jsx(ChevronDown, { size: 18 }) })] }));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=TouchReorderButtons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TouchReorderButtons.js","sourceRoot":"","sources":["../../src/components/TouchReorderButtons.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAU3D;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAA+B;IACjE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACzE,MAAM,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IAEjC,OAAO,CACL,eAAK,SAAS,EAAC,mBAAmB,EAAC,IAAI,EAAC,OAAO,gBAAa,CAAC,CAAC,oBAAoB,CAAC,aACjF,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,wBAAwB,EAClC,OAAO,EAAE,QAAQ,EACjB,QAAQ,EAAE,QAAQ,IAAI,SAAS,gBACnB,CAAC,CAAC,gBAAgB,CAAC,YAE/B,KAAC,SAAS,IAAC,IAAI,EAAE,EAAE,GAAI,GAChB,EACT,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,wBAAwB,EAClC,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,QAAQ,IAAI,WAAW,gBACrB,CAAC,CAAC,kBAAkB,CAAC,YAEjC,KAAC,WAAW,IAAC,IAAI,EAAE,EAAE,GAAI,GAClB,IACL,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface AdminUserPickerProps {
|
|
3
|
+
value: string | null;
|
|
4
|
+
onChange: (adminUserId: string | null) => void;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
emptyMessage?: string;
|
|
7
|
+
clearable?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
ariaLabel?: string;
|
|
10
|
+
id?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function AdminUserPicker(props: AdminUserPickerProps): ReactNode;
|
|
14
|
+
//# sourceMappingURL=AdminUserPicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdminUserPicker.d.ts","sourceRoot":"","sources":["../../../src/components/admin-user-picker/AdminUserPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAyB1F,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAKD,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,SAAS,CA6EtE"}
|