shared-lib-web 0.0.0-stage → 0.0.3
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/CODING_RULES.md +118 -0
- package/LICENSE +21 -0
- package/README.md +884 -2
- package/dist/components/app-brand.d.ts +9 -0
- package/dist/components/app-brand.d.ts.map +1 -0
- package/dist/components/app-brand.js +27 -0
- package/dist/components/app-brand.js.map +1 -0
- package/dist/components/branch-switcher.d.ts +7 -0
- package/dist/components/branch-switcher.d.ts.map +1 -0
- package/dist/components/branch-switcher.js +37 -0
- package/dist/components/branch-switcher.js.map +1 -0
- package/dist/components/coming-soon.d.ts +6 -0
- package/dist/components/coming-soon.d.ts.map +1 -0
- package/dist/components/coming-soon.js +20 -0
- package/dist/components/coming-soon.js.map +1 -0
- package/dist/components/empty-state.d.ts +15 -0
- package/dist/components/empty-state.d.ts.map +1 -0
- package/dist/components/empty-state.js +14 -0
- package/dist/components/empty-state.js.map +1 -0
- package/dist/components/language-switcher.d.ts +12 -0
- package/dist/components/language-switcher.d.ts.map +1 -0
- package/dist/components/language-switcher.js +61 -0
- package/dist/components/language-switcher.js.map +1 -0
- package/dist/components/page-loader.d.ts +2 -0
- package/dist/components/page-loader.d.ts.map +1 -0
- package/dist/components/page-loader.js +8 -0
- package/dist/components/page-loader.js.map +1 -0
- package/dist/components/page-not-found.d.ts +2 -0
- package/dist/components/page-not-found.d.ts.map +1 -0
- package/dist/components/page-not-found.js +18 -0
- package/dist/components/page-not-found.js.map +1 -0
- package/dist/components/permission-denied.d.ts +2 -0
- package/dist/components/permission-denied.d.ts.map +1 -0
- package/dist/components/permission-denied.js +12 -0
- package/dist/components/permission-denied.js.map +1 -0
- package/dist/components/require-access.d.ts +11 -0
- package/dist/components/require-access.d.ts.map +1 -0
- package/dist/components/require-access.js +15 -0
- package/dist/components/require-access.js.map +1 -0
- package/dist/components/scroll-to-top.d.ts +12 -0
- package/dist/components/scroll-to-top.d.ts.map +1 -0
- package/dist/components/scroll-to-top.js +42 -0
- package/dist/components/scroll-to-top.js.map +1 -0
- package/dist/components/settings-menu.d.ts +21 -0
- package/dist/components/settings-menu.d.ts.map +1 -0
- package/dist/components/settings-menu.js +115 -0
- package/dist/components/settings-menu.js.map +1 -0
- package/dist/components/theme-switcher.d.ts +5 -0
- package/dist/components/theme-switcher.d.ts.map +1 -0
- package/dist/components/theme-switcher.js +33 -0
- package/dist/components/theme-switcher.js.map +1 -0
- package/dist/components/toast-container.d.ts +5 -0
- package/dist/components/toast-container.d.ts.map +1 -0
- package/dist/components/toast-container.js +51 -0
- package/dist/components/toast-container.js.map +1 -0
- package/dist/components/top-progress.d.ts +2 -0
- package/dist/components/top-progress.d.ts.map +1 -0
- package/dist/components/top-progress.js +14 -0
- package/dist/components/top-progress.js.map +1 -0
- package/dist/components/user-menu.d.ts +26 -0
- package/dist/components/user-menu.d.ts.map +1 -0
- package/dist/components/user-menu.js +85 -0
- package/dist/components/user-menu.js.map +1 -0
- package/dist/context/ui-context.d.ts +5 -0
- package/dist/context/ui-context.d.ts.map +1 -0
- package/dist/context/ui-context.js +16 -0
- package/dist/context/ui-context.js.map +1 -0
- package/dist/context/use-ui.d.ts +3 -0
- package/dist/context/use-ui.d.ts.map +1 -0
- package/dist/context/use-ui.js +40 -0
- package/dist/context/use-ui.js.map +1 -0
- package/dist/i18n/browser-language.d.ts +9 -0
- package/dist/i18n/browser-language.d.ts.map +1 -0
- package/dist/i18n/browser-language.js +89 -0
- package/dist/i18n/browser-language.js.map +1 -0
- package/dist/i18n/default-messages.d.ts +5 -0
- package/dist/i18n/default-messages.d.ts.map +1 -0
- package/dist/i18n/default-messages.js +67 -0
- package/dist/i18n/default-messages.js.map +1 -0
- package/dist/i18n/direction.d.ts +10 -0
- package/dist/i18n/direction.d.ts.map +1 -0
- package/dist/i18n/direction.js +35 -0
- package/dist/i18n/direction.js.map +1 -0
- package/dist/i18n/locale-groups.d.ts +18 -0
- package/dist/i18n/locale-groups.d.ts.map +1 -0
- package/dist/i18n/locale-groups.js +74 -0
- package/dist/i18n/locale-groups.js.map +1 -0
- package/dist/i18n/locale-service.d.ts +54 -0
- package/dist/i18n/locale-service.d.ts.map +1 -0
- package/dist/i18n/locale-service.js +231 -0
- package/dist/i18n/locale-service.js.map +1 -0
- package/dist/i18n/locale-signal.d.ts +18 -0
- package/dist/i18n/locale-signal.d.ts.map +1 -0
- package/dist/i18n/locale-signal.js +142 -0
- package/dist/i18n/locale-signal.js.map +1 -0
- package/dist/i18n/translator.d.ts +21 -0
- package/dist/i18n/translator.d.ts.map +1 -0
- package/dist/i18n/translator.js +105 -0
- package/dist/i18n/translator.js.map +1 -0
- package/dist/index.d.ts +117 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +130 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/app-types.d.ts +143 -0
- package/dist/interfaces/app-types.d.ts.map +1 -0
- package/dist/interfaces/app-types.js +5 -0
- package/dist/interfaces/app-types.js.map +1 -0
- package/dist/interfaces/toast.d.ts +9 -0
- package/dist/interfaces/toast.d.ts.map +1 -0
- package/dist/interfaces/toast.js +4 -0
- package/dist/interfaces/toast.js.map +1 -0
- package/dist/interfaces/ui-config.d.ts +319 -0
- package/dist/interfaces/ui-config.d.ts.map +1 -0
- package/dist/interfaces/ui-config.js +6 -0
- package/dist/interfaces/ui-config.js.map +1 -0
- package/dist/interfaces/ui-context.d.ts +37 -0
- package/dist/interfaces/ui-context.d.ts.map +1 -0
- package/dist/interfaces/ui-context.js +4 -0
- package/dist/interfaces/ui-context.js.map +1 -0
- package/dist/layout.d.ts +10 -0
- package/dist/layout.d.ts.map +1 -0
- package/dist/layout.js +22 -0
- package/dist/layout.js.map +1 -0
- package/dist/layouts/app-layout.d.ts +23 -0
- package/dist/layouts/app-layout.d.ts.map +1 -0
- package/dist/layouts/app-layout.js +52 -0
- package/dist/layouts/app-layout.js.map +1 -0
- package/dist/layouts/article-layout.d.ts +7 -0
- package/dist/layouts/article-layout.d.ts.map +1 -0
- package/dist/layouts/article-layout.js +8 -0
- package/dist/layouts/article-layout.js.map +1 -0
- package/dist/layouts/aside-layout.d.ts +27 -0
- package/dist/layouts/aside-layout.d.ts.map +1 -0
- package/dist/layouts/aside-layout.js +70 -0
- package/dist/layouts/aside-layout.js.map +1 -0
- package/dist/layouts/auth-layout.d.ts +7 -0
- package/dist/layouts/auth-layout.d.ts.map +1 -0
- package/dist/layouts/auth-layout.js +20 -0
- package/dist/layouts/auth-layout.js.map +1 -0
- package/dist/layouts/content-layout.d.ts +3 -0
- package/dist/layouts/content-layout.d.ts.map +1 -0
- package/dist/layouts/content-layout.js +10 -0
- package/dist/layouts/content-layout.js.map +1 -0
- package/dist/layouts/float-layout.d.ts +3 -0
- package/dist/layouts/float-layout.d.ts.map +1 -0
- package/dist/layouts/float-layout.js +10 -0
- package/dist/layouts/float-layout.js.map +1 -0
- package/dist/layouts/grid-layout.d.ts +3 -0
- package/dist/layouts/grid-layout.d.ts.map +1 -0
- package/dist/layouts/grid-layout.js +10 -0
- package/dist/layouts/grid-layout.js.map +1 -0
- package/dist/layouts/head-layout.d.ts +16 -0
- package/dist/layouts/head-layout.d.ts.map +1 -0
- package/dist/layouts/head-layout.js +36 -0
- package/dist/layouts/head-layout.js.map +1 -0
- package/dist/layouts/header.d.ts +18 -0
- package/dist/layouts/header.d.ts.map +1 -0
- package/dist/layouts/header.js +26 -0
- package/dist/layouts/header.js.map +1 -0
- package/dist/layouts/layout-constants.d.ts +3 -0
- package/dist/layouts/layout-constants.d.ts.map +1 -0
- package/dist/layouts/layout-constants.js +5 -0
- package/dist/layouts/layout-constants.js.map +1 -0
- package/dist/layouts/mega-menu.d.ts +3 -0
- package/dist/layouts/mega-menu.d.ts.map +1 -0
- package/dist/layouts/mega-menu.js +104 -0
- package/dist/layouts/mega-menu.js.map +1 -0
- package/dist/layouts/navigation.d.ts +11 -0
- package/dist/layouts/navigation.d.ts.map +1 -0
- package/dist/layouts/navigation.js +41 -0
- package/dist/layouts/navigation.js.map +1 -0
- package/dist/layouts/rail-flyout.d.ts +5 -0
- package/dist/layouts/rail-flyout.d.ts.map +1 -0
- package/dist/layouts/rail-flyout.js +49 -0
- package/dist/layouts/rail-flyout.js.map +1 -0
- package/dist/layouts/rail-tooltip.d.ts +8 -0
- package/dist/layouts/rail-tooltip.d.ts.map +1 -0
- package/dist/layouts/rail-tooltip.js +60 -0
- package/dist/layouts/rail-tooltip.js.map +1 -0
- package/dist/layouts/sidebar.d.ts +38 -0
- package/dist/layouts/sidebar.d.ts.map +1 -0
- package/dist/layouts/sidebar.js +137 -0
- package/dist/layouts/sidebar.js.map +1 -0
- package/dist/markdown.d.ts +4 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/markdown.js +12 -0
- package/dist/markdown.js.map +1 -0
- package/dist/providers/provider-effects.d.ts +9 -0
- package/dist/providers/provider-effects.d.ts.map +1 -0
- package/dist/providers/provider-effects.js +29 -0
- package/dist/providers/provider-effects.js.map +1 -0
- package/dist/providers/register-config.d.ts +4 -0
- package/dist/providers/register-config.d.ts.map +1 -0
- package/dist/providers/register-config.js +30 -0
- package/dist/providers/register-config.js.map +1 -0
- package/dist/providers/shared-web-ui-provider.d.ts +19 -0
- package/dist/providers/shared-web-ui-provider.d.ts.map +1 -0
- package/dist/providers/shared-web-ui-provider.js +53 -0
- package/dist/providers/shared-web-ui-provider.js.map +1 -0
- package/dist/providers/theme-provider.d.ts +6 -0
- package/dist/providers/theme-provider.d.ts.map +1 -0
- package/dist/providers/theme-provider.js +11 -0
- package/dist/providers/theme-provider.js.map +1 -0
- package/dist/providers/translation-provider.d.ts +8 -0
- package/dist/providers/translation-provider.d.ts.map +1 -0
- package/dist/providers/translation-provider.js +21 -0
- package/dist/providers/translation-provider.js.map +1 -0
- package/dist/query/page-link.d.ts +20 -0
- package/dist/query/page-link.d.ts.map +1 -0
- package/dist/query/page-link.js +53 -0
- package/dist/query/page-link.js.map +1 -0
- package/dist/query/page-path.d.ts +5 -0
- package/dist/query/page-path.d.ts.map +1 -0
- package/dist/query/page-path.js +24 -0
- package/dist/query/page-path.js.map +1 -0
- package/dist/query/query-param.d.ts +66 -0
- package/dist/query/query-param.d.ts.map +1 -0
- package/dist/query/query-param.js +218 -0
- package/dist/query/query-param.js.map +1 -0
- package/dist/query/use-query-param.d.ts +5 -0
- package/dist/query/use-query-param.d.ts.map +1 -0
- package/dist/query/use-query-param.js +21 -0
- package/dist/query/use-query-param.js.map +1 -0
- package/dist/skeleton/skeleton-article.d.ts +2 -0
- package/dist/skeleton/skeleton-article.d.ts.map +1 -0
- package/dist/skeleton/skeleton-article.js +7 -0
- package/dist/skeleton/skeleton-article.js.map +1 -0
- package/dist/skeleton/skeleton-auth-form.d.ts +6 -0
- package/dist/skeleton/skeleton-auth-form.d.ts.map +1 -0
- package/dist/skeleton/skeleton-auth-form.js +9 -0
- package/dist/skeleton/skeleton-auth-form.js.map +1 -0
- package/dist/skeleton/skeleton-cards.d.ts +6 -0
- package/dist/skeleton/skeleton-cards.d.ts.map +1 -0
- package/dist/skeleton/skeleton-cards.js +16 -0
- package/dist/skeleton/skeleton-cards.js.map +1 -0
- package/dist/skeleton/skeleton-chat.d.ts +2 -0
- package/dist/skeleton/skeleton-chat.d.ts.map +1 -0
- package/dist/skeleton/skeleton-chat.js +17 -0
- package/dist/skeleton/skeleton-chat.js.map +1 -0
- package/dist/skeleton/skeleton-dashboard.d.ts +2 -0
- package/dist/skeleton/skeleton-dashboard.d.ts.map +1 -0
- package/dist/skeleton/skeleton-dashboard.js +16 -0
- package/dist/skeleton/skeleton-dashboard.js.map +1 -0
- package/dist/skeleton/skeleton-float.d.ts +2 -0
- package/dist/skeleton/skeleton-float.d.ts.map +1 -0
- package/dist/skeleton/skeleton-float.js +7 -0
- package/dist/skeleton/skeleton-float.js.map +1 -0
- package/dist/skeleton/skeleton-form.d.ts +10 -0
- package/dist/skeleton/skeleton-form.d.ts.map +1 -0
- package/dist/skeleton/skeleton-form.js +16 -0
- package/dist/skeleton/skeleton-form.js.map +1 -0
- package/dist/skeleton/skeleton-menu.d.ts +2 -0
- package/dist/skeleton/skeleton-menu.d.ts.map +1 -0
- package/dist/skeleton/skeleton-menu.js +16 -0
- package/dist/skeleton/skeleton-menu.js.map +1 -0
- package/dist/skeleton/skeleton-page.d.ts +2 -0
- package/dist/skeleton/skeleton-page.d.ts.map +1 -0
- package/dist/skeleton/skeleton-page.js +9 -0
- package/dist/skeleton/skeleton-page.js.map +1 -0
- package/dist/skeleton/skeleton-table.d.ts +2 -0
- package/dist/skeleton/skeleton-table.d.ts.map +1 -0
- package/dist/skeleton/skeleton-table.js +16 -0
- package/dist/skeleton/skeleton-table.js.map +1 -0
- package/dist/state/api-loader.d.ts +19 -0
- package/dist/state/api-loader.d.ts.map +1 -0
- package/dist/state/api-loader.js +187 -0
- package/dist/state/api-loader.js.map +1 -0
- package/dist/state/auth-service.d.ts +32 -0
- package/dist/state/auth-service.d.ts.map +1 -0
- package/dist/state/auth-service.js +136 -0
- package/dist/state/auth-service.js.map +1 -0
- package/dist/state/branch-service.d.ts +42 -0
- package/dist/state/branch-service.d.ts.map +1 -0
- package/dist/state/branch-service.js +193 -0
- package/dist/state/branch-service.js.map +1 -0
- package/dist/state/company-service.d.ts +16 -0
- package/dist/state/company-service.d.ts.map +1 -0
- package/dist/state/company-service.js +97 -0
- package/dist/state/company-service.js.map +1 -0
- package/dist/state/document-sync.d.ts +7 -0
- package/dist/state/document-sync.d.ts.map +1 -0
- package/dist/state/document-sync.js +39 -0
- package/dist/state/document-sync.js.map +1 -0
- package/dist/state/language-service.d.ts +19 -0
- package/dist/state/language-service.d.ts.map +1 -0
- package/dist/state/language-service.js +78 -0
- package/dist/state/language-service.js.map +1 -0
- package/dist/state/layout-choice-service.d.ts +10 -0
- package/dist/state/layout-choice-service.d.ts.map +1 -0
- package/dist/state/layout-choice-service.js +34 -0
- package/dist/state/layout-choice-service.js.map +1 -0
- package/dist/state/menu-service.d.ts +20 -0
- package/dist/state/menu-service.d.ts.map +1 -0
- package/dist/state/menu-service.js +59 -0
- package/dist/state/menu-service.js.map +1 -0
- package/dist/state/navigation-service.d.ts +37 -0
- package/dist/state/navigation-service.d.ts.map +1 -0
- package/dist/state/navigation-service.js +131 -0
- package/dist/state/navigation-service.js.map +1 -0
- package/dist/state/preference-sync.d.ts +15 -0
- package/dist/state/preference-sync.d.ts.map +1 -0
- package/dist/state/preference-sync.js +93 -0
- package/dist/state/preference-sync.js.map +1 -0
- package/dist/state/progress-service.d.ts +3 -0
- package/dist/state/progress-service.d.ts.map +1 -0
- package/dist/state/progress-service.js +17 -0
- package/dist/state/progress-service.js.map +1 -0
- package/dist/state/screen-access.d.ts +15 -0
- package/dist/state/screen-access.d.ts.map +1 -0
- package/dist/state/screen-access.js +60 -0
- package/dist/state/screen-access.js.map +1 -0
- package/dist/state/sidebar-service.d.ts +8 -0
- package/dist/state/sidebar-service.d.ts.map +1 -0
- package/dist/state/sidebar-service.js +18 -0
- package/dist/state/sidebar-service.js.map +1 -0
- package/dist/state/signals.d.ts +92 -0
- package/dist/state/signals.d.ts.map +1 -0
- package/dist/state/signals.js +161 -0
- package/dist/state/signals.js.map +1 -0
- package/dist/state/toast-service.d.ts +9 -0
- package/dist/state/toast-service.d.ts.map +1 -0
- package/dist/state/toast-service.js +36 -0
- package/dist/state/toast-service.js.map +1 -0
- package/dist/styles.css +15 -0
- package/dist/theme/custom-themes.d.ts +28 -0
- package/dist/theme/custom-themes.d.ts.map +1 -0
- package/dist/theme/custom-themes.js +218 -0
- package/dist/theme/custom-themes.js.map +1 -0
- package/dist/theme/dark-themes.d.ts +10 -0
- package/dist/theme/dark-themes.d.ts.map +1 -0
- package/dist/theme/dark-themes.js +92 -0
- package/dist/theme/dark-themes.js.map +1 -0
- package/dist/theme/logo.d.ts +7 -0
- package/dist/theme/logo.d.ts.map +1 -0
- package/dist/theme/logo.js +24 -0
- package/dist/theme/logo.js.map +1 -0
- package/dist/theme/theme-service.d.ts +32 -0
- package/dist/theme/theme-service.d.ts.map +1 -0
- package/dist/theme/theme-service.js +123 -0
- package/dist/theme/theme-service.js.map +1 -0
- package/dist/types/class-names.d.ts +9 -0
- package/dist/types/class-names.d.ts.map +1 -0
- package/dist/types/class-names.js +45 -0
- package/dist/types/class-names.js.map +1 -0
- package/dist/types/field-error.d.ts +5 -0
- package/dist/types/field-error.d.ts.map +1 -0
- package/dist/types/field-error.js +16 -0
- package/dist/types/field-error.js.map +1 -0
- package/dist/types/field-props.d.ts +20 -0
- package/dist/types/field-props.d.ts.map +1 -0
- package/dist/types/field-props.js +4 -0
- package/dist/types/field-props.js.map +1 -0
- package/dist/types/field-registry.d.ts +11 -0
- package/dist/types/field-registry.d.ts.map +1 -0
- package/dist/types/field-registry.js +18 -0
- package/dist/types/field-registry.js.map +1 -0
- package/dist/types/field-wrapper.d.ts +13 -0
- package/dist/types/field-wrapper.d.ts.map +1 -0
- package/dist/types/field-wrapper.js +16 -0
- package/dist/types/field-wrapper.js.map +1 -0
- package/dist/types/lang-field.d.ts +15 -0
- package/dist/types/lang-field.d.ts.map +1 -0
- package/dist/types/lang-field.js +68 -0
- package/dist/types/lang-field.js.map +1 -0
- package/dist/types/markdown-color-mode.d.ts +7 -0
- package/dist/types/markdown-color-mode.d.ts.map +1 -0
- package/dist/types/markdown-color-mode.js +11 -0
- package/dist/types/markdown-color-mode.js.map +1 -0
- package/dist/types/media-service.d.ts +24 -0
- package/dist/types/media-service.d.ts.map +1 -0
- package/dist/types/media-service.js +41 -0
- package/dist/types/media-service.js.map +1 -0
- package/dist/types/media-viewer.d.ts +2 -0
- package/dist/types/media-viewer.d.ts.map +1 -0
- package/dist/types/media-viewer.js +23 -0
- package/dist/types/media-viewer.js.map +1 -0
- package/dist/types/type.button.d.ts +36 -0
- package/dist/types/type.button.d.ts.map +1 -0
- package/dist/types/type.button.js +27 -0
- package/dist/types/type.button.js.map +1 -0
- package/dist/types/type.checkbox.d.ts +5 -0
- package/dist/types/type.checkbox.d.ts.map +1 -0
- package/dist/types/type.checkbox.js +26 -0
- package/dist/types/type.checkbox.js.map +1 -0
- package/dist/types/type.confirm.d.ts +19 -0
- package/dist/types/type.confirm.d.ts.map +1 -0
- package/dist/types/type.confirm.js +15 -0
- package/dist/types/type.confirm.js.map +1 -0
- package/dist/types/type.date.d.ts +16 -0
- package/dist/types/type.date.d.ts.map +1 -0
- package/dist/types/type.date.js +65 -0
- package/dist/types/type.date.js.map +1 -0
- package/dist/types/type.drawer.d.ts +20 -0
- package/dist/types/type.drawer.d.ts.map +1 -0
- package/dist/types/type.drawer.js +31 -0
- package/dist/types/type.drawer.js.map +1 -0
- package/dist/types/type.dropdown.d.ts +23 -0
- package/dist/types/type.dropdown.d.ts.map +1 -0
- package/dist/types/type.dropdown.js +34 -0
- package/dist/types/type.dropdown.js.map +1 -0
- package/dist/types/type.filter.d.ts +17 -0
- package/dist/types/type.filter.d.ts.map +1 -0
- package/dist/types/type.filter.js +28 -0
- package/dist/types/type.filter.js.map +1 -0
- package/dist/types/type.icon.d.ts +21 -0
- package/dist/types/type.icon.d.ts.map +1 -0
- package/dist/types/type.icon.js +24 -0
- package/dist/types/type.icon.js.map +1 -0
- package/dist/types/type.image.d.ts +34 -0
- package/dist/types/type.image.d.ts.map +1 -0
- package/dist/types/type.image.js +46 -0
- package/dist/types/type.image.js.map +1 -0
- package/dist/types/type.input.d.ts +13 -0
- package/dist/types/type.input.d.ts.map +1 -0
- package/dist/types/type.input.js +29 -0
- package/dist/types/type.input.js.map +1 -0
- package/dist/types/type.lang-md.d.ts +10 -0
- package/dist/types/type.lang-md.d.ts.map +1 -0
- package/dist/types/type.lang-md.js +56 -0
- package/dist/types/type.lang-md.js.map +1 -0
- package/dist/types/type.lang.d.ts +11 -0
- package/dist/types/type.lang.d.ts.map +1 -0
- package/dist/types/type.lang.js +56 -0
- package/dist/types/type.lang.js.map +1 -0
- package/dist/types/type.list.d.ts +13 -0
- package/dist/types/type.list.d.ts.map +1 -0
- package/dist/types/type.list.js +42 -0
- package/dist/types/type.list.js.map +1 -0
- package/dist/types/type.mdv.d.ts +10 -0
- package/dist/types/type.mdv.d.ts.map +1 -0
- package/dist/types/type.mdv.js +22 -0
- package/dist/types/type.mdv.js.map +1 -0
- package/dist/types/type.mdx.d.ts +10 -0
- package/dist/types/type.mdx.d.ts.map +1 -0
- package/dist/types/type.mdx.js +30 -0
- package/dist/types/type.mdx.js.map +1 -0
- package/dist/types/type.modal.d.ts +18 -0
- package/dist/types/type.modal.d.ts.map +1 -0
- package/dist/types/type.modal.js +30 -0
- package/dist/types/type.modal.js.map +1 -0
- package/dist/types/type.otp.d.ts +8 -0
- package/dist/types/type.otp.d.ts.map +1 -0
- package/dist/types/type.otp.js +48 -0
- package/dist/types/type.otp.js.map +1 -0
- package/dist/types/type.search.d.ts +16 -0
- package/dist/types/type.search.d.ts.map +1 -0
- package/dist/types/type.search.js +48 -0
- package/dist/types/type.search.js.map +1 -0
- package/dist/types/type.select.d.ts +14 -0
- package/dist/types/type.select.d.ts.map +1 -0
- package/dist/types/type.select.js +53 -0
- package/dist/types/type.select.js.map +1 -0
- package/dist/types/type.switch.d.ts +8 -0
- package/dist/types/type.switch.d.ts.map +1 -0
- package/dist/types/type.switch.js +26 -0
- package/dist/types/type.switch.js.map +1 -0
- package/dist/types/type.table.d.ts +28 -0
- package/dist/types/type.table.d.ts.map +1 -0
- package/dist/types/type.table.js +72 -0
- package/dist/types/type.table.js.map +1 -0
- package/dist/types/type.text-area.d.ts +9 -0
- package/dist/types/type.text-area.d.ts.map +1 -0
- package/dist/types/type.text-area.js +26 -0
- package/dist/types/type.text-area.js.map +1 -0
- package/dist/types/type.time.d.ts +9 -0
- package/dist/types/type.time.d.ts.map +1 -0
- package/dist/types/type.time.js +34 -0
- package/dist/types/type.time.js.map +1 -0
- package/dist/types/type.upload.d.ts +45 -0
- package/dist/types/type.upload.d.ts.map +1 -0
- package/dist/types/type.upload.js +90 -0
- package/dist/types/type.upload.js.map +1 -0
- package/dist/types/type.video.d.ts +19 -0
- package/dist/types/type.video.d.ts.map +1 -0
- package/dist/types/type.video.js +33 -0
- package/dist/types/type.video.js.map +1 -0
- package/dist/types/upload-service.d.ts +47 -0
- package/dist/types/upload-service.d.ts.map +1 -0
- package/dist/types/upload-service.js +191 -0
- package/dist/types/upload-service.js.map +1 -0
- package/dist/utils/app-config.d.ts +6 -0
- package/dist/utils/app-config.d.ts.map +1 -0
- package/dist/utils/app-config.js +17 -0
- package/dist/utils/app-config.js.map +1 -0
- package/dist/utils/app-http.d.ts +77 -0
- package/dist/utils/app-http.d.ts.map +1 -0
- package/dist/utils/app-http.js +331 -0
- package/dist/utils/app-http.js.map +1 -0
- package/dist/utils/app-storage.d.ts +56 -0
- package/dist/utils/app-storage.d.ts.map +1 -0
- package/dist/utils/app-storage.js +236 -0
- package/dist/utils/app-storage.js.map +1 -0
- package/dist/utils/content-util.d.ts +6 -0
- package/dist/utils/content-util.d.ts.map +1 -0
- package/dist/utils/content-util.js +45 -0
- package/dist/utils/content-util.js.map +1 -0
- package/dist/utils/crypto-util.d.ts +15 -0
- package/dist/utils/crypto-util.d.ts.map +1 -0
- package/dist/utils/crypto-util.js +76 -0
- package/dist/utils/crypto-util.js.map +1 -0
- package/dist/utils/error-util.d.ts +3 -0
- package/dist/utils/error-util.d.ts.map +1 -0
- package/dist/utils/error-util.js +58 -0
- package/dist/utils/error-util.js.map +1 -0
- package/dist/utils/event-util.d.ts +16 -0
- package/dist/utils/event-util.d.ts.map +1 -0
- package/dist/utils/event-util.js +51 -0
- package/dist/utils/event-util.js.map +1 -0
- package/dist/utils/file-util.d.ts +30 -0
- package/dist/utils/file-util.d.ts.map +1 -0
- package/dist/utils/file-util.js +165 -0
- package/dist/utils/file-util.js.map +1 -0
- package/dist/utils/lang-util.d.ts +12 -0
- package/dist/utils/lang-util.d.ts.map +1 -0
- package/dist/utils/lang-util.js +53 -0
- package/dist/utils/lang-util.js.map +1 -0
- package/dist/utils/language-util.d.ts +21 -0
- package/dist/utils/language-util.d.ts.map +1 -0
- package/dist/utils/language-util.js +96 -0
- package/dist/utils/language-util.js.map +1 -0
- package/dist/utils/leave-guard.d.ts +5 -0
- package/dist/utils/leave-guard.d.ts.map +1 -0
- package/dist/utils/leave-guard.js +24 -0
- package/dist/utils/leave-guard.js.map +1 -0
- package/dist/utils/lucide-icon.d.ts +10 -0
- package/dist/utils/lucide-icon.d.ts.map +1 -0
- package/dist/utils/lucide-icon.js +48 -0
- package/dist/utils/lucide-icon.js.map +1 -0
- package/dist/utils/menu-util.d.ts +33 -0
- package/dist/utils/menu-util.d.ts.map +1 -0
- package/dist/utils/menu-util.js +151 -0
- package/dist/utils/menu-util.js.map +1 -0
- package/dist/utils/option-util.d.ts +21 -0
- package/dist/utils/option-util.d.ts.map +1 -0
- package/dist/utils/option-util.js +101 -0
- package/dist/utils/option-util.js.map +1 -0
- package/dist/utils/session-id.d.ts +5 -0
- package/dist/utils/session-id.d.ts.map +1 -0
- package/dist/utils/session-id.js +44 -0
- package/dist/utils/session-id.js.map +1 -0
- package/dist/utils/shared-regexp.d.ts +31 -0
- package/dist/utils/shared-regexp.d.ts.map +1 -0
- package/dist/utils/shared-regexp.js +17 -0
- package/dist/utils/shared-regexp.js.map +1 -0
- package/dist/utils/signal-source.d.ts +4 -0
- package/dist/utils/signal-source.d.ts.map +1 -0
- package/dist/utils/signal-source.js +13 -0
- package/dist/utils/signal-source.js.map +1 -0
- package/dist/utils/storage-keys.d.ts +73 -0
- package/dist/utils/storage-keys.d.ts.map +1 -0
- package/dist/utils/storage-keys.js +80 -0
- package/dist/utils/storage-keys.js.map +1 -0
- package/package.json +101 -4
- package/src/components/app-brand.tsx +41 -0
- package/src/components/branch-switcher.tsx +74 -0
- package/src/components/coming-soon.tsx +36 -0
- package/src/components/empty-state.tsx +42 -0
- package/src/components/language-switcher.tsx +96 -0
- package/src/components/page-loader.tsx +11 -0
- package/src/components/page-not-found.tsx +42 -0
- package/src/components/permission-denied.tsx +21 -0
- package/src/components/require-access.tsx +30 -0
- package/src/components/scroll-to-top.tsx +62 -0
- package/src/components/settings-menu.tsx +250 -0
- package/src/components/theme-switcher.tsx +72 -0
- package/src/components/toast-container.tsx +73 -0
- package/src/components/top-progress.tsx +14 -0
- package/src/components/user-menu.tsx +179 -0
- package/src/context/ui-context.ts +20 -0
- package/src/context/use-ui.ts +43 -0
- package/src/i18n/browser-language.ts +98 -0
- package/src/i18n/default-messages.ts +70 -0
- package/src/i18n/direction.ts +43 -0
- package/src/i18n/locale-groups.ts +87 -0
- package/src/i18n/locale-service.ts +259 -0
- package/src/i18n/locale-signal.ts +173 -0
- package/src/i18n/translator.ts +114 -0
- package/src/index.ts +409 -0
- package/src/interfaces/app-types.ts +160 -0
- package/src/interfaces/toast.ts +12 -0
- package/src/interfaces/ui-config.ts +342 -0
- package/src/interfaces/ui-context.ts +43 -0
- package/src/layout.ts +29 -0
- package/src/layouts/app-layout.tsx +103 -0
- package/src/layouts/article-layout.tsx +16 -0
- package/src/layouts/aside-layout.tsx +118 -0
- package/src/layouts/auth-layout.tsx +41 -0
- package/src/layouts/content-layout.tsx +11 -0
- package/src/layouts/float-layout.tsx +11 -0
- package/src/layouts/grid-layout.tsx +11 -0
- package/src/layouts/head-layout.tsx +61 -0
- package/src/layouts/header.tsx +74 -0
- package/src/layouts/layout-constants.ts +5 -0
- package/src/layouts/mega-menu.tsx +203 -0
- package/src/layouts/navigation.ts +45 -0
- package/src/layouts/rail-flyout.tsx +77 -0
- package/src/layouts/rail-tooltip.tsx +77 -0
- package/src/layouts/sidebar.tsx +296 -0
- package/src/markdown.ts +12 -0
- package/src/providers/provider-effects.ts +33 -0
- package/src/providers/register-config.ts +32 -0
- package/src/providers/shared-web-ui-provider.tsx +81 -0
- package/src/providers/theme-provider.tsx +15 -0
- package/src/providers/translation-provider.tsx +28 -0
- package/src/query/page-link.tsx +84 -0
- package/src/query/page-path.ts +26 -0
- package/src/query/query-param.ts +267 -0
- package/src/query/use-query-param.ts +23 -0
- package/src/skeleton/skeleton-article.tsx +11 -0
- package/src/skeleton/skeleton-auth-form.tsx +20 -0
- package/src/skeleton/skeleton-cards.tsx +35 -0
- package/src/skeleton/skeleton-chat.tsx +34 -0
- package/src/skeleton/skeleton-dashboard.tsx +34 -0
- package/src/skeleton/skeleton-float.tsx +10 -0
- package/src/skeleton/skeleton-form.tsx +45 -0
- package/src/skeleton/skeleton-menu.tsx +30 -0
- package/src/skeleton/skeleton-page.tsx +18 -0
- package/src/skeleton/skeleton-table.tsx +25 -0
- package/src/state/api-loader.ts +205 -0
- package/src/state/auth-service.ts +159 -0
- package/src/state/branch-service.ts +217 -0
- package/src/state/company-service.ts +107 -0
- package/src/state/document-sync.ts +43 -0
- package/src/state/language-service.ts +85 -0
- package/src/state/layout-choice-service.ts +40 -0
- package/src/state/menu-service.ts +67 -0
- package/src/state/navigation-service.ts +160 -0
- package/src/state/preference-sync.ts +101 -0
- package/src/state/progress-service.ts +18 -0
- package/src/state/screen-access.ts +70 -0
- package/src/state/sidebar-service.ts +22 -0
- package/src/state/signals.ts +215 -0
- package/src/state/toast-service.ts +45 -0
- package/src/styles.css +15 -0
- package/src/theme/custom-themes.ts +236 -0
- package/src/theme/dark-themes.ts +97 -0
- package/src/theme/logo.ts +27 -0
- package/src/theme/org-themes.json +70 -0
- package/src/theme/theme-service.ts +142 -0
- package/src/types/class-names.ts +53 -0
- package/src/types/field-error.ts +19 -0
- package/src/types/field-props.ts +23 -0
- package/src/types/field-registry.ts +27 -0
- package/src/types/field-wrapper.tsx +42 -0
- package/src/types/lang-field.ts +71 -0
- package/src/types/markdown-color-mode.ts +13 -0
- package/src/types/media-service.ts +61 -0
- package/src/types/media-viewer.tsx +57 -0
- package/src/types/type.button.tsx +108 -0
- package/src/types/type.checkbox.tsx +49 -0
- package/src/types/type.confirm.tsx +50 -0
- package/src/types/type.date.tsx +97 -0
- package/src/types/type.drawer.tsx +86 -0
- package/src/types/type.dropdown.tsx +81 -0
- package/src/types/type.filter.tsx +64 -0
- package/src/types/type.icon.ts +53 -0
- package/src/types/type.image.tsx +115 -0
- package/src/types/type.input.tsx +57 -0
- package/src/types/type.lang-md.tsx +129 -0
- package/src/types/type.lang.tsx +156 -0
- package/src/types/type.list.tsx +97 -0
- package/src/types/type.mdv.tsx +35 -0
- package/src/types/type.mdx.tsx +54 -0
- package/src/types/type.modal.tsx +77 -0
- package/src/types/type.otp.tsx +82 -0
- package/src/types/type.search.tsx +87 -0
- package/src/types/type.select.tsx +87 -0
- package/src/types/type.switch.tsx +52 -0
- package/src/types/type.table.tsx +152 -0
- package/src/types/type.text-area.tsx +51 -0
- package/src/types/type.time.tsx +61 -0
- package/src/types/type.upload.tsx +294 -0
- package/src/types/type.video.tsx +119 -0
- package/src/types/upload-service.ts +229 -0
- package/src/utils/app-config.ts +21 -0
- package/src/utils/app-http.ts +369 -0
- package/src/utils/app-storage.ts +259 -0
- package/src/utils/content-util.ts +49 -0
- package/src/utils/crypto-util.ts +88 -0
- package/src/utils/error-util.ts +64 -0
- package/src/utils/event-util.ts +58 -0
- package/src/utils/file-util.ts +186 -0
- package/src/utils/lang-util.ts +60 -0
- package/src/utils/language-util.ts +107 -0
- package/src/utils/leave-guard.ts +26 -0
- package/src/utils/lucide-icon.ts +55 -0
- package/src/utils/menu-util.ts +165 -0
- package/src/utils/option-util.ts +108 -0
- package/src/utils/session-id.ts +48 -0
- package/src/utils/shared-regexp.ts +18 -0
- package/src/utils/signal-source.ts +15 -0
- package/src/utils/storage-keys.ts +86 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// translation-provider.tsx
|
|
2
|
+
// Loads the saved (or default) locale JSON file and shows a loader until it is ready.
|
|
3
|
+
// Used inside SharedWebUiProvider.
|
|
4
|
+
|
|
5
|
+
import { useSignals } from "@preact/signals-react/runtime";
|
|
6
|
+
import { useEffect, type ReactNode } from "react";
|
|
7
|
+
import { isTranslationReadySignal } from "../state/signals.ts";
|
|
8
|
+
import { PageLoader } from "../components/page-loader.tsx";
|
|
9
|
+
import { RUN_ONCE, initializeLanguageOnMount } from "./provider-effects.ts";
|
|
10
|
+
|
|
11
|
+
export interface TranslationProviderProps {
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
/** Shown while the first locale file loads. Default: a centred spinner. */
|
|
14
|
+
loadingFallback?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function TranslationProvider(props: TranslationProviderProps) {
|
|
18
|
+
useSignals();
|
|
19
|
+
const { children, loadingFallback } = props;
|
|
20
|
+
useEffect(initializeLanguageOnMount, RUN_ONCE);
|
|
21
|
+
|
|
22
|
+
const isReady = isTranslationReadySignal.value;
|
|
23
|
+
if (!isReady) {
|
|
24
|
+
const defaultFallback = <PageLoader />;
|
|
25
|
+
return <>{loadingFallback ?? defaultFallback}</>;
|
|
26
|
+
}
|
|
27
|
+
return <>{children}</>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// page-link.tsx
|
|
2
|
+
// A link that shows another page by setting ?page=<page> (no router, no redirect, no reload).
|
|
3
|
+
// Ctrl / Cmd click still opens the page in a new tab, because the href is a real URL.
|
|
4
|
+
//
|
|
5
|
+
// <PageLink page="/profiles">Profiles</PageLink>
|
|
6
|
+
// <PageLink page="/" isExact className="btn" activeClassName="btn-active">Home</PageLink>
|
|
7
|
+
|
|
8
|
+
import { useSignals } from "@preact/signals-react/runtime";
|
|
9
|
+
import type { MouseEvent, ReactNode } from "react";
|
|
10
|
+
import { isPathMatch } from "../layouts/navigation.ts";
|
|
11
|
+
import { currentPageSignal } from "../state/signals.ts";
|
|
12
|
+
import { joinClassNames } from "../types/class-names.ts";
|
|
13
|
+
import { buildPageHref, openPage } from "./query-param.ts";
|
|
14
|
+
|
|
15
|
+
export interface PageLinkProps {
|
|
16
|
+
/** Page to show, usually a menu href such as "/profiles". */
|
|
17
|
+
page: string;
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
className?: string;
|
|
20
|
+
/** Added when the link is the current page. */
|
|
21
|
+
activeClassName?: string;
|
|
22
|
+
/** Active only on the exact page (not on child pages). Default: true for "/", false otherwise. */
|
|
23
|
+
isExact?: boolean;
|
|
24
|
+
title?: string;
|
|
25
|
+
/** aria-label. */
|
|
26
|
+
label?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** true when the link page is the current page (or a parent of it, unless exact). */
|
|
30
|
+
export function isPageActive(page: string, currentPage: string, isExact: boolean): boolean {
|
|
31
|
+
if (isExact) {
|
|
32
|
+
return page === currentPage;
|
|
33
|
+
}
|
|
34
|
+
return isPathMatch(page, currentPage);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** true when the click should be left to the browser (new tab, other mouse button ...). */
|
|
38
|
+
function isSpecialClick(event: MouseEvent<HTMLAnchorElement>): boolean {
|
|
39
|
+
const hasModifier = event.metaKey || event.ctrlKey || event.shiftKey || event.altKey;
|
|
40
|
+
const isOtherButton = event.button !== 0;
|
|
41
|
+
const anchor = event.currentTarget;
|
|
42
|
+
const opensNewTab = anchor.target === "_blank";
|
|
43
|
+
return hasModifier || isOtherButton || opensNewTab;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Click on a PageLink: sets ?page from data-page without reloading. */
|
|
47
|
+
export function handlePageLinkClick(event: MouseEvent<HTMLAnchorElement>): void {
|
|
48
|
+
const isSpecial = isSpecialClick(event);
|
|
49
|
+
if (isSpecial) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const anchor = event.currentTarget;
|
|
53
|
+
const page = anchor.dataset.page;
|
|
54
|
+
if (!page) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
event.preventDefault();
|
|
58
|
+
openPage(page);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function PageLink(props: PageLinkProps) {
|
|
62
|
+
useSignals();
|
|
63
|
+
const { page, children, className, activeClassName, title, label } = props;
|
|
64
|
+
const isExact = props.isExact ?? page === "/";
|
|
65
|
+
const currentPage = currentPageSignal.value;
|
|
66
|
+
const isActive = isPageActive(page, currentPage, isExact);
|
|
67
|
+
const href = buildPageHref(page);
|
|
68
|
+
const classList = [className, isActive ? activeClassName : undefined];
|
|
69
|
+
const linkClassName = joinClassNames(classList);
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<a
|
|
73
|
+
href={href}
|
|
74
|
+
data-page={page}
|
|
75
|
+
className={linkClassName || undefined}
|
|
76
|
+
aria-current={isActive ? "page" : undefined}
|
|
77
|
+
title={title}
|
|
78
|
+
aria-label={label}
|
|
79
|
+
onClick={handlePageLinkClick}
|
|
80
|
+
>
|
|
81
|
+
{children}
|
|
82
|
+
</a>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// page-path.ts
|
|
2
|
+
// Page values in the address bar have no leading slash; inside the app a page is a menu href with one.
|
|
3
|
+
//
|
|
4
|
+
// address bar ?page=app-settings ?page=components/forms
|
|
5
|
+
// in the app "/app-settings" "/components/forms" (menu hrefs, currentPageSignal, openPage)
|
|
6
|
+
//
|
|
7
|
+
// Old links with a slash (?page=/app-settings) still open the same page.
|
|
8
|
+
|
|
9
|
+
import { ConstValue } from "dff-util";
|
|
10
|
+
|
|
11
|
+
/** "/app-settings" -> "app-settings" (only the leading slashes go; inner ones stay: "components/forms"). */
|
|
12
|
+
export function toPageParamValue(page: string): string {
|
|
13
|
+
let start = 0;
|
|
14
|
+
while (start < page.length && page.charAt(start) === ConstValue.SLASH) {
|
|
15
|
+
start = start + 1;
|
|
16
|
+
}
|
|
17
|
+
return page.slice(start);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** "app-settings" -> "/app-settings"; a value that already starts with "/" stays as it is. "" stays "". */
|
|
21
|
+
export function toPagePath(value: string): string {
|
|
22
|
+
if (!value || value.startsWith(ConstValue.SLASH)) {
|
|
23
|
+
return value;
|
|
24
|
+
}
|
|
25
|
+
return `${ConstValue.SLASH}${value}`;
|
|
26
|
+
}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
// query-param.ts
|
|
2
|
+
// Reads and changes query parameters of the address bar WITHOUT a redirect or page reload (no router).
|
|
3
|
+
//
|
|
4
|
+
// openPage("/profiles"); // ?page=profiles (pages are menu hrefs; the address bar has no leading slash)
|
|
5
|
+
// setQueryParam("id", "42"); // ?page=profiles&id=42 (adds or replaces, keeps the other params)
|
|
6
|
+
// readQueryParam("id"); // "42" (components re-render when it changes)
|
|
7
|
+
// removeQueryParam("id"); // ?page=profiles
|
|
8
|
+
//
|
|
9
|
+
// Back / forward buttons update the values too.
|
|
10
|
+
|
|
11
|
+
import { ConstValue } from "dff-util";
|
|
12
|
+
import {
|
|
13
|
+
DEFAULT_HOME_PAGE,
|
|
14
|
+
DEFAULT_PAGE_PARAM,
|
|
15
|
+
currentPageSignal,
|
|
16
|
+
isSidebarOpenSignal,
|
|
17
|
+
pathnameSignal,
|
|
18
|
+
toPageFromPath,
|
|
19
|
+
openMegaMenuIdSignal,
|
|
20
|
+
queryParamsSignal,
|
|
21
|
+
railFlyoutSignal,
|
|
22
|
+
readIsPathPageMode,
|
|
23
|
+
uiConfigSignal,
|
|
24
|
+
} from "../state/signals.ts";
|
|
25
|
+
import { toPagePath, toPageParamValue } from "./page-path.ts";
|
|
26
|
+
|
|
27
|
+
/** Values to set. undefined, null or "" removes the parameter. */
|
|
28
|
+
export type QueryParamValues = Record<string, string | number | boolean | null | undefined>;
|
|
29
|
+
|
|
30
|
+
export interface QueryParamOptions {
|
|
31
|
+
/** true replaces the browser history entry (back does not return to the old value). Default false. */
|
|
32
|
+
isReplace?: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface OpenPageOptions extends QueryParamOptions {
|
|
36
|
+
/** true keeps the other query parameters of the old page (for example ?userId). Default false: they are removed. */
|
|
37
|
+
isKeepingOtherParams?: boolean;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
let isQueryParamSyncStarted = false;
|
|
41
|
+
|
|
42
|
+
/** "/" is allowed in a query string, so ?page=components/forms stays readable (not components%2Fforms). */
|
|
43
|
+
const ENCODED_SLASH = "%2F";
|
|
44
|
+
|
|
45
|
+
/** Reads the query parameters from the address bar into a plain object. */
|
|
46
|
+
export function readAddressBarParams(): Record<string, string> {
|
|
47
|
+
const params: Record<string, string> = {};
|
|
48
|
+
const hasWindow = typeof window !== "undefined";
|
|
49
|
+
if (!hasWindow) {
|
|
50
|
+
return params;
|
|
51
|
+
}
|
|
52
|
+
const searchParams = new URLSearchParams(window.location.search);
|
|
53
|
+
for (const [key, value] of searchParams) {
|
|
54
|
+
params[key] = value;
|
|
55
|
+
}
|
|
56
|
+
return params;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Copies the address bar parameters (and path) into queryParamsSignal / pathnameSignal. */
|
|
60
|
+
export function syncQueryParams(): void {
|
|
61
|
+
queryParamsSignal.value = readAddressBarParams();
|
|
62
|
+
pathnameSignal.value = window.location.pathname;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** One query parameter, or undefined. Components that call it re-render when it changes. */
|
|
66
|
+
export function readQueryParam(key: string): string | undefined {
|
|
67
|
+
const params = queryParamsSignal.value;
|
|
68
|
+
return params[key];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** All query parameters as an object. */
|
|
72
|
+
export function readQueryParams(): Record<string, string> {
|
|
73
|
+
return queryParamsSignal.value;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** true when the value should remove the parameter. */
|
|
77
|
+
function isEmptyValue(value: QueryParamValues[string]): boolean {
|
|
78
|
+
return value === undefined || value === null || value === ConstValue.EMPTY;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Builds "?a=1&b=2" from the current parameters changed by values (the address bar is not changed). */
|
|
82
|
+
export function buildQueryString(values: QueryParamValues): string {
|
|
83
|
+
const currentParams = readAddressBarParams();
|
|
84
|
+
const searchParams = new URLSearchParams(currentParams);
|
|
85
|
+
for (const [key, value] of Object.entries(values)) {
|
|
86
|
+
const isEmpty = isEmptyValue(value);
|
|
87
|
+
if (isEmpty) {
|
|
88
|
+
searchParams.delete(key);
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
const text = String(value);
|
|
92
|
+
searchParams.set(key, text);
|
|
93
|
+
}
|
|
94
|
+
const encodedText = searchParams.toString();
|
|
95
|
+
const queryText = encodedText.replaceAll(ENCODED_SLASH, ConstValue.SLASH);
|
|
96
|
+
return queryText.length > 0 ? `?${queryText}` : ConstValue.EMPTY;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** Builds the full href (path + query + hash) for changed values, for links. pathname: another path (path mode). */
|
|
100
|
+
export function buildQueryHref(values: QueryParamValues, pathname: string = window.location.pathname): string {
|
|
101
|
+
const queryString = buildQueryString(values);
|
|
102
|
+
const hash = window.location.hash;
|
|
103
|
+
return `${pathname}${queryString}${hash}`;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** Sets several query parameters at once (no redirect). undefined / null / "" removes one. */
|
|
107
|
+
export function setQueryParams(values: QueryParamValues, options: QueryParamOptions = {}): void {
|
|
108
|
+
const href = buildQueryHref(values);
|
|
109
|
+
applyHref(href, options);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** Puts a new address in the bar (history entry, no reload) and updates the signals. */
|
|
113
|
+
function applyHref(href: string, options: QueryParamOptions): void {
|
|
114
|
+
const currentHref = buildQueryHref({});
|
|
115
|
+
if (href === currentHref) {
|
|
116
|
+
syncQueryParams();
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
if (options.isReplace) {
|
|
120
|
+
window.history.replaceState(window.history.state, ConstValue.EMPTY, href);
|
|
121
|
+
} else {
|
|
122
|
+
window.history.pushState(window.history.state, ConstValue.EMPTY, href);
|
|
123
|
+
}
|
|
124
|
+
syncQueryParams();
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** Adds or changes one query parameter (no redirect). undefined / null / "" removes it. */
|
|
128
|
+
export function setQueryParam(key: string, value: QueryParamValues[string], options: QueryParamOptions = {}): void {
|
|
129
|
+
const values: QueryParamValues = { [key]: value };
|
|
130
|
+
setQueryParams(values, options);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** Removes one query parameter (no redirect). */
|
|
134
|
+
export function removeQueryParam(key: string, options: QueryParamOptions = {}): void {
|
|
135
|
+
setQueryParam(key, undefined, options);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** Name of the query parameter that holds the current page (config.layout.pageParam, default "page"). */
|
|
139
|
+
export function readPageParam(): string {
|
|
140
|
+
const config = uiConfigSignal.peek();
|
|
141
|
+
return config?.layout?.pageParam ?? DEFAULT_PAGE_PARAM;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/** The home page (config.homePath, default "/"). */
|
|
145
|
+
export function readHomePage(): string {
|
|
146
|
+
const config = uiConfigSignal.peek();
|
|
147
|
+
return config?.homePath ?? DEFAULT_HOME_PAGE;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/** The current page (?page or the path, else the home page). */
|
|
151
|
+
export function readCurrentPage(): string {
|
|
152
|
+
return currentPageSignal.value;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* true when pages live in the path (/profiles) instead of ?page: config.layout.pageMode "path",
|
|
157
|
+
* or no pageMode and the app type "shell".
|
|
158
|
+
*/
|
|
159
|
+
export function isPathPageMode(): boolean {
|
|
160
|
+
const config = uiConfigSignal.peek();
|
|
161
|
+
return readIsPathPageMode(config);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* The page of any address, for code outside React (for example a single-spa activeWhen(location)):
|
|
166
|
+
* pageMode "query": ?page=profiles -> "/profiles" pageMode "path": /profiles -> "/profiles"
|
|
167
|
+
* No page -> the home page.
|
|
168
|
+
*/
|
|
169
|
+
export function readPageFromLocation(location: Location | URL): string {
|
|
170
|
+
const homePage = readHomePage();
|
|
171
|
+
if (isPathPageMode()) {
|
|
172
|
+
const pathPage = toPageFromPath(location.pathname);
|
|
173
|
+
return pathPage || homePage;
|
|
174
|
+
}
|
|
175
|
+
const params = new URLSearchParams(location.search);
|
|
176
|
+
const pageParam = readPageParam();
|
|
177
|
+
const pageValue = params.get(pageParam) ?? ConstValue.EMPTY;
|
|
178
|
+
const page = toPagePath(pageValue);
|
|
179
|
+
return page || homePage;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* The query values that open a page. The home page removes ?page, so the address stays clean.
|
|
184
|
+
* The value has no leading slash: "/profiles" -> ?page=profiles.
|
|
185
|
+
*/
|
|
186
|
+
export function buildPageValues(page: string): QueryParamValues {
|
|
187
|
+
const pageParam = readPageParam();
|
|
188
|
+
const homePage = readHomePage();
|
|
189
|
+
const pagePath = toPagePath(page);
|
|
190
|
+
const homePath = toPagePath(homePage);
|
|
191
|
+
const isHomePage = pagePath === homePath;
|
|
192
|
+
const paramValue = toPageParamValue(pagePath);
|
|
193
|
+
const pageValue = isHomePage ? undefined : paramValue;
|
|
194
|
+
return { [pageParam]: pageValue };
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/** The path of a page in path mode: "/profiles"; the home page -> "/". */
|
|
198
|
+
export function buildPagePath(page: string): string {
|
|
199
|
+
const pagePath = toPagePath(page);
|
|
200
|
+
return pagePath || ConstValue.SLASH;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/** href of a page link: "/?page=profiles" (query mode) or "/profiles" (path mode). */
|
|
204
|
+
export function buildPageHref(page: string): string {
|
|
205
|
+
if (isPathPageMode()) {
|
|
206
|
+
const pagePath = buildPagePath(page);
|
|
207
|
+
const clearValues = buildClearValues();
|
|
208
|
+
return buildQueryHref(clearValues, pagePath);
|
|
209
|
+
}
|
|
210
|
+
const values = buildPageValues(page);
|
|
211
|
+
return buildQueryHref(values);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/** Closes the drawer, mega menu and rail flyout. */
|
|
215
|
+
function closeOpenMenus(): void {
|
|
216
|
+
isSidebarOpenSignal.value = false;
|
|
217
|
+
openMegaMenuIdSignal.value = ConstValue.EMPTY;
|
|
218
|
+
railFlyoutSignal.value = { groupId: ConstValue.EMPTY, top: 0 };
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/** Values that remove every current query parameter (used when a new page opens). */
|
|
222
|
+
export function buildClearValues(): QueryParamValues {
|
|
223
|
+
const currentParams = readAddressBarParams();
|
|
224
|
+
const clearValues: QueryParamValues = {};
|
|
225
|
+
for (const key of Object.keys(currentParams)) {
|
|
226
|
+
clearValues[key] = undefined;
|
|
227
|
+
}
|
|
228
|
+
return clearValues;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Shows a page: sets ?page=<page> (or the path /<page> in pageMode "path"; no redirect), closes open menus and
|
|
233
|
+
* scrolls to the top.
|
|
234
|
+
* The old page's parameters are removed unless options.isKeepingOtherParams is true.
|
|
235
|
+
* Extra values are set in the same step, for example openPage("/profiles", { userId: "42" }).
|
|
236
|
+
*/
|
|
237
|
+
export function openPage(page: string, extraValues: QueryParamValues = {}, options: OpenPageOptions = {}): void {
|
|
238
|
+
const clearValues = options.isKeepingOtherParams ? {} : buildClearValues();
|
|
239
|
+
if (isPathPageMode()) {
|
|
240
|
+
const pagePath = buildPagePath(page);
|
|
241
|
+
const pathValues: QueryParamValues = { ...clearValues, ...extraValues };
|
|
242
|
+
const pathHref = buildQueryHref(pathValues, pagePath);
|
|
243
|
+
applyHref(pathHref, options);
|
|
244
|
+
} else {
|
|
245
|
+
const pageValues = buildPageValues(page);
|
|
246
|
+
const values: QueryParamValues = { ...clearValues, ...extraValues, ...pageValues };
|
|
247
|
+
setQueryParams(values, options);
|
|
248
|
+
}
|
|
249
|
+
closeOpenMenus();
|
|
250
|
+
window.scrollTo(0, 0);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/** Back / forward: read the parameters again and close open menus. */
|
|
254
|
+
function handlePopState(): void {
|
|
255
|
+
syncQueryParams();
|
|
256
|
+
closeOpenMenus();
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/** Reads the parameters and listens to back / forward (the listener is added only once). */
|
|
260
|
+
export function startQueryParamSync(): void {
|
|
261
|
+
syncQueryParams();
|
|
262
|
+
if (isQueryParamSyncStarted) {
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
isQueryParamSyncStarted = true;
|
|
266
|
+
window.addEventListener("popstate", handlePopState);
|
|
267
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// use-query-param.ts
|
|
2
|
+
// Hooks that re-render the component when a query parameter changes.
|
|
3
|
+
//
|
|
4
|
+
// const page = useCurrentPage(); // "/profiles" from ?page=profiles (or config.homePath)
|
|
5
|
+
// const userId = useQueryParam("userId"); // "42" from ?userId=42, or undefined
|
|
6
|
+
//
|
|
7
|
+
// Do not also call useSignals() or useUi() in the same component (both already subscribe).
|
|
8
|
+
|
|
9
|
+
import { useSignals } from "@preact/signals-react/runtime";
|
|
10
|
+
import { currentPageSignal, queryParamsSignal } from "../state/signals.ts";
|
|
11
|
+
|
|
12
|
+
/** The current page (?page, else config.homePath). Re-renders when it changes. */
|
|
13
|
+
export function useCurrentPage(): string {
|
|
14
|
+
useSignals();
|
|
15
|
+
return currentPageSignal.value;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** One query parameter, or undefined. Re-renders when it changes. */
|
|
19
|
+
export function useQueryParam(key: string): string | undefined {
|
|
20
|
+
useSignals();
|
|
21
|
+
const params = queryParamsSignal.value;
|
|
22
|
+
return params[key];
|
|
23
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// skeleton-article.tsx
|
|
2
|
+
// Placeholder shown while a page header (ArticleLayout) loads.
|
|
3
|
+
|
|
4
|
+
export function SkeletonArticle() {
|
|
5
|
+
return (
|
|
6
|
+
<div className="flex flex-col gap-3" aria-hidden="true">
|
|
7
|
+
<div className="skeleton h-8 w-1/3" />
|
|
8
|
+
<div className="skeleton h-4 w-2/3" />
|
|
9
|
+
</div>
|
|
10
|
+
);
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// skeleton-auth-form.tsx
|
|
2
|
+
// Placeholder for login / sign-up / forgot-password forms inside AuthLayout.
|
|
3
|
+
|
|
4
|
+
import { SkeletonForm } from "./skeleton-form.tsx";
|
|
5
|
+
|
|
6
|
+
export interface SkeletonAuthFormProps {
|
|
7
|
+
/** Number of fields. Default 2 (email + password). */
|
|
8
|
+
fields?: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function SkeletonAuthForm(props: SkeletonAuthFormProps) {
|
|
12
|
+
const { fields = 2 } = props;
|
|
13
|
+
return (
|
|
14
|
+
<div className="flex flex-col gap-4" aria-hidden="true">
|
|
15
|
+
<div className="skeleton mx-auto h-6 w-32" />
|
|
16
|
+
<SkeletonForm fields={fields} showTextArea={false} showSubmit={false} />
|
|
17
|
+
<div className="skeleton h-10 w-full" />
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// skeleton-cards.tsx
|
|
2
|
+
// Placeholder for a grid of cards (products, stores, articles ...).
|
|
3
|
+
|
|
4
|
+
import type { ReactElement } from "react";
|
|
5
|
+
|
|
6
|
+
export interface SkeletonCardsProps {
|
|
7
|
+
/** Number of cards. Default 6. */
|
|
8
|
+
count?: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Builds the card placeholders. */
|
|
12
|
+
function buildCards(cardCount: number): ReactElement[] {
|
|
13
|
+
const cards: ReactElement[] = [];
|
|
14
|
+
for (let cardIndex = 0; cardIndex < cardCount; cardIndex += 1) {
|
|
15
|
+
const card = (
|
|
16
|
+
<div key={cardIndex} className="flex flex-col gap-3 rounded-box bg-base-100 p-4 shadow-sm">
|
|
17
|
+
<div className="skeleton h-32 w-full" />
|
|
18
|
+
<div className="skeleton h-4 w-3/4" />
|
|
19
|
+
<div className="skeleton h-4 w-1/2" />
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
cards.push(card);
|
|
23
|
+
}
|
|
24
|
+
return cards;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function SkeletonCards(props: SkeletonCardsProps) {
|
|
28
|
+
const { count = 6 } = props;
|
|
29
|
+
const cards = buildCards(count);
|
|
30
|
+
return (
|
|
31
|
+
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3" aria-hidden="true">
|
|
32
|
+
{cards}
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// skeleton-chat.tsx
|
|
2
|
+
// Placeholder for a chat: message bubbles on both sides and an input bar.
|
|
3
|
+
|
|
4
|
+
import type { ReactElement } from "react";
|
|
5
|
+
|
|
6
|
+
const CHAT_BUBBLE_COUNT = 6;
|
|
7
|
+
|
|
8
|
+
/** Builds alternating chat bubble placeholders (start / end). */
|
|
9
|
+
function buildBubbles(bubbleCount: number): ReactElement[] {
|
|
10
|
+
const bubbles: ReactElement[] = [];
|
|
11
|
+
for (let bubbleIndex = 0; bubbleIndex < bubbleCount; bubbleIndex += 1) {
|
|
12
|
+
const isEnd = bubbleIndex % 2 === 1;
|
|
13
|
+
const bubble = (
|
|
14
|
+
<div key={bubbleIndex} className={isEnd ? "chat chat-end" : "chat chat-start"}>
|
|
15
|
+
<div className="chat-image">
|
|
16
|
+
<div className="skeleton size-10 rounded-full" />
|
|
17
|
+
</div>
|
|
18
|
+
<div className="skeleton h-10 w-48" />
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
bubbles.push(bubble);
|
|
22
|
+
}
|
|
23
|
+
return bubbles;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function SkeletonChat() {
|
|
27
|
+
const bubbles = buildBubbles(CHAT_BUBBLE_COUNT);
|
|
28
|
+
return (
|
|
29
|
+
<div className="flex flex-col gap-2" aria-hidden="true">
|
|
30
|
+
{bubbles}
|
|
31
|
+
<div className="skeleton mt-2 h-12 w-full" />
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// skeleton-dashboard.tsx
|
|
2
|
+
// Placeholder for a dashboard: four stat tiles and two chart blocks.
|
|
3
|
+
|
|
4
|
+
import type { ReactElement } from "react";
|
|
5
|
+
|
|
6
|
+
const STAT_TILE_COUNT = 4;
|
|
7
|
+
|
|
8
|
+
/** Builds the stat tile placeholders. */
|
|
9
|
+
function buildStatTiles(tileCount: number): ReactElement[] {
|
|
10
|
+
const tiles: ReactElement[] = [];
|
|
11
|
+
for (let tileIndex = 0; tileIndex < tileCount; tileIndex += 1) {
|
|
12
|
+
const tile = (
|
|
13
|
+
<div key={tileIndex} className="flex flex-col gap-2 rounded-box bg-base-100 p-4 shadow-sm">
|
|
14
|
+
<div className="skeleton h-4 w-24" />
|
|
15
|
+
<div className="skeleton h-8 w-16" />
|
|
16
|
+
</div>
|
|
17
|
+
);
|
|
18
|
+
tiles.push(tile);
|
|
19
|
+
}
|
|
20
|
+
return tiles;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function SkeletonDashboard() {
|
|
24
|
+
const tiles = buildStatTiles(STAT_TILE_COUNT);
|
|
25
|
+
return (
|
|
26
|
+
<div className="flex flex-col gap-4" aria-hidden="true">
|
|
27
|
+
<div className="grid grid-cols-2 gap-4 lg:grid-cols-4">{tiles}</div>
|
|
28
|
+
<div className="grid grid-cols-1 gap-4 lg:grid-cols-2">
|
|
29
|
+
<div className="skeleton h-64 w-full" />
|
|
30
|
+
<div className="skeleton h-64 w-full" />
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// skeleton-float.tsx
|
|
2
|
+
// Placeholder shown while the floating action buttons (FloatLayout) load.
|
|
3
|
+
|
|
4
|
+
export function SkeletonFloat() {
|
|
5
|
+
return (
|
|
6
|
+
<div className="flex gap-2" aria-hidden="true">
|
|
7
|
+
<div className="skeleton size-12 rounded-full" />
|
|
8
|
+
</div>
|
|
9
|
+
);
|
|
10
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// skeleton-form.tsx
|
|
2
|
+
// Placeholder for a form: label + input pairs in a responsive grid, a text area and a button.
|
|
3
|
+
|
|
4
|
+
import type { ReactElement } from "react";
|
|
5
|
+
|
|
6
|
+
export interface SkeletonFormProps {
|
|
7
|
+
/** Number of input fields. Default 6. */
|
|
8
|
+
fields?: number;
|
|
9
|
+
/** Show the big text area placeholder. Default true. */
|
|
10
|
+
showTextArea?: boolean;
|
|
11
|
+
/** Show the submit button placeholder. Default true. */
|
|
12
|
+
showSubmit?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Builds the label + input placeholders. */
|
|
16
|
+
function buildFieldRows(fieldCount: number): ReactElement[] {
|
|
17
|
+
const rows: ReactElement[] = [];
|
|
18
|
+
for (let fieldIndex = 0; fieldIndex < fieldCount; fieldIndex += 1) {
|
|
19
|
+
const row = (
|
|
20
|
+
<div key={fieldIndex} className="flex flex-col gap-2">
|
|
21
|
+
<div className="skeleton h-4 w-24" />
|
|
22
|
+
<div className="skeleton h-10 w-full" />
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
rows.push(row);
|
|
26
|
+
}
|
|
27
|
+
return rows;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function SkeletonForm(props: SkeletonFormProps) {
|
|
31
|
+
const { fields = 6, showTextArea = true, showSubmit = true } = props;
|
|
32
|
+
const rows = buildFieldRows(fields);
|
|
33
|
+
return (
|
|
34
|
+
<div className="flex flex-col gap-4" aria-hidden="true">
|
|
35
|
+
<div className="grid grid-cols-1 gap-4 md:grid-cols-2">{rows}</div>
|
|
36
|
+
{showTextArea ? (
|
|
37
|
+
<div className="flex flex-col gap-2">
|
|
38
|
+
<div className="skeleton h-4 w-32" />
|
|
39
|
+
<div className="skeleton h-28 w-full" />
|
|
40
|
+
</div>
|
|
41
|
+
) : null}
|
|
42
|
+
{showSubmit ? <div className="skeleton h-10 w-32 self-end" /> : null}
|
|
43
|
+
</div>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// skeleton-menu.tsx
|
|
2
|
+
// Placeholder rows shown in the sidebar while menus load.
|
|
3
|
+
|
|
4
|
+
import type { ReactElement } from "react";
|
|
5
|
+
|
|
6
|
+
const SKELETON_MENU_ROWS = 6;
|
|
7
|
+
|
|
8
|
+
/** Builds the placeholder rows. */
|
|
9
|
+
function buildMenuRows(rowCount: number): ReactElement[] {
|
|
10
|
+
const rows: ReactElement[] = [];
|
|
11
|
+
for (let rowIndex = 0; rowIndex < rowCount; rowIndex += 1) {
|
|
12
|
+
const row = (
|
|
13
|
+
<div key={rowIndex} className="flex items-center gap-3 px-3 py-2">
|
|
14
|
+
<div className="skeleton size-5 shrink-0 rounded" />
|
|
15
|
+
<div className="skeleton h-4 flex-1" />
|
|
16
|
+
</div>
|
|
17
|
+
);
|
|
18
|
+
rows.push(row);
|
|
19
|
+
}
|
|
20
|
+
return rows;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function SkeletonMenu() {
|
|
24
|
+
const rows = buildMenuRows(SKELETON_MENU_ROWS);
|
|
25
|
+
return (
|
|
26
|
+
<div className="flex flex-col gap-1 p-3" aria-hidden="true">
|
|
27
|
+
{rows}
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// skeleton-page.tsx
|
|
2
|
+
// Placeholder for a whole page: header card and a table card. Default page fallback of AppLayout.
|
|
3
|
+
|
|
4
|
+
import { SkeletonArticle } from "./skeleton-article.tsx";
|
|
5
|
+
import { SkeletonTable } from "./skeleton-table.tsx";
|
|
6
|
+
|
|
7
|
+
export function SkeletonPage() {
|
|
8
|
+
return (
|
|
9
|
+
<div className="flex flex-col gap-4" aria-hidden="true">
|
|
10
|
+
<div className="rounded-box bg-base-100 p-4 shadow-sm">
|
|
11
|
+
<SkeletonArticle />
|
|
12
|
+
</div>
|
|
13
|
+
<div className="rounded-box bg-base-100 shadow-sm">
|
|
14
|
+
<SkeletonTable />
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
);
|
|
18
|
+
}
|