@owlmeans/web-panel 0.1.18-rc.9 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +510 -143
- package/THIRD-PARTY-NOTICES.txt +24 -0
- package/agent-meta/manifest.json +163 -4
- package/agent-meta/skills/web-panel/SKILL.md +136 -83
- package/agent-meta/skills/web-panel/parts/consent.md +114 -0
- package/agent-meta/skills/web-panel/parts/editor.md +47 -0
- package/agent-meta/skills/web-panel/parts/forms.md +85 -0
- package/agent-meta/skills/web-panel/parts/navigation.md +203 -0
- package/agent-meta/skills/web-panel/parts/picker.md +164 -0
- package/agent-meta/skills/web-panel/parts/reload.md +46 -0
- package/agent-meta/skills/web-panel/parts/sign-in.md +65 -0
- package/agent-meta/skills/web-panel/parts/theme.md +74 -0
- package/build/@/components/ui/alert-dialog.d.ts +15 -0
- package/build/@/components/ui/alert-dialog.d.ts.map +1 -0
- package/build/@/components/ui/alert-dialog.js +39 -0
- package/build/@/components/ui/alert-dialog.js.map +1 -0
- package/build/@/components/ui/alert.js +1 -1
- package/build/@/components/ui/alert.js.map +1 -1
- package/build/@/components/ui/button.js +1 -1
- package/build/@/components/ui/button.js.map +1 -1
- package/build/@/components/ui/card.js +1 -1
- package/build/@/components/ui/card.js.map +1 -1
- package/build/@/components/ui/input.js +1 -1
- package/build/@/components/ui/input.js.map +1 -1
- package/build/@/components/ui/label.js +1 -1
- package/build/@/components/ui/label.js.map +1 -1
- package/build/@/components/ui/navigation-menu.js +1 -1
- package/build/@/components/ui/navigation-menu.js.map +1 -1
- package/build/@/components/ui/popover.d.ts +8 -0
- package/build/@/components/ui/popover.d.ts.map +1 -0
- package/build/@/components/ui/popover.js +17 -0
- package/build/@/components/ui/popover.js.map +1 -0
- package/build/@/components/ui/progress.js +1 -1
- package/build/@/components/ui/progress.js.map +1 -1
- package/build/@/components/ui/separator.js +1 -1
- package/build/@/components/ui/separator.js.map +1 -1
- package/build/@/components/ui/sheet.d.ts +15 -0
- package/build/@/components/ui/sheet.d.ts.map +1 -0
- package/build/@/components/ui/sheet.js +40 -0
- package/build/@/components/ui/sheet.js.map +1 -0
- package/build/auth/context.d.ts.map +1 -1
- package/build/auth/context.js +0 -1
- package/build/auth/context.js.map +1 -1
- package/build/auth/entrypoints.d.ts +10 -0
- package/build/auth/entrypoints.d.ts.map +1 -0
- package/build/auth/entrypoints.js +4 -0
- package/build/auth/entrypoints.js.map +1 -0
- package/build/auth/exports.d.ts +4 -4
- package/build/auth/exports.d.ts.map +1 -1
- package/build/auth/exports.js +3 -3
- package/build/auth/exports.js.map +1 -1
- package/build/auth/modules.d.ts +1 -1
- package/build/auth/modules.d.ts.map +1 -1
- package/build/auth/plugins/basic-ed25519.js +4 -4
- package/build/auth/plugins/basic-ed25519.js.map +1 -1
- package/build/auth/plugins/re-captcha.js +3 -3
- package/build/auth/plugins/re-captcha.js.map +1 -1
- package/build/auth/plugins/tunnel-consumer.js +1 -1
- package/build/auth/plugins/tunnel-consumer.js.map +1 -1
- package/build/components/block.js +2 -2
- package/build/components/block.js.map +1 -1
- package/build/components/consts.local.d.ts +14 -0
- package/build/components/consts.local.d.ts.map +1 -0
- package/build/components/consts.local.js +26 -0
- package/build/components/consts.local.js.map +1 -0
- package/build/components/footer/component.d.ts +19 -1
- package/build/components/footer/component.d.ts.map +1 -1
- package/build/components/footer/component.js +38 -11
- package/build/components/footer/component.js.map +1 -1
- package/build/components/footer/credit.d.ts +27 -0
- package/build/components/footer/credit.d.ts.map +1 -0
- package/build/components/footer/credit.js +42 -0
- package/build/components/footer/credit.js.map +1 -0
- package/build/components/footer/index.d.ts +1 -0
- package/build/components/footer/index.d.ts.map +1 -1
- package/build/components/footer/index.js +1 -0
- package/build/components/footer/index.js.map +1 -1
- package/build/components/footer/types.d.ts +22 -1
- package/build/components/footer/types.d.ts.map +1 -1
- package/build/components/form/button/component.d.ts.map +1 -1
- package/build/components/form/button/component.js +5 -3
- package/build/components/form/button/component.js.map +1 -1
- package/build/components/form/component.js +2 -2
- package/build/components/form/component.js.map +1 -1
- package/build/components/form/text/component.js +2 -2
- package/build/components/form/text/component.js.map +1 -1
- package/build/components/helper.d.ts.map +1 -1
- package/build/components/helper.js +1 -12
- package/build/components/helper.js.map +1 -1
- package/build/components/index.d.ts +4 -0
- package/build/components/index.d.ts.map +1 -1
- package/build/components/index.js +4 -0
- package/build/components/index.js.map +1 -1
- package/build/components/link.js +3 -3
- package/build/components/link.js.map +1 -1
- package/build/components/login/append.d.ts +15 -0
- package/build/components/login/append.d.ts.map +1 -0
- package/build/components/login/append.js +26 -0
- package/build/components/login/append.js.map +1 -0
- package/build/components/login/consts.d.ts +3 -0
- package/build/components/login/consts.d.ts.map +1 -0
- package/build/components/login/consts.js +3 -0
- package/build/components/login/consts.js.map +1 -0
- package/build/components/login/consts.local.d.ts +4 -0
- package/build/components/login/consts.local.d.ts.map +1 -0
- package/build/components/login/consts.local.js +8 -0
- package/build/components/login/consts.local.js.map +1 -0
- package/build/components/login/credit.d.ts +12 -0
- package/build/components/login/credit.d.ts.map +1 -0
- package/build/components/login/credit.js +18 -0
- package/build/components/login/credit.js.map +1 -0
- package/build/components/login/i18n/be.json +10 -0
- package/build/components/login/i18n/de.json +10 -0
- package/build/components/login/i18n/en.json +10 -0
- package/build/components/login/i18n/es.json +10 -0
- package/build/components/login/i18n/fr.json +10 -0
- package/build/components/login/i18n/pl.json +10 -0
- package/build/components/login/i18n/ru.json +10 -0
- package/build/components/login/i18n/uk.json +10 -0
- package/build/components/login/i18n.d.ts +2 -0
- package/build/components/login/i18n.d.ts.map +1 -0
- package/build/components/login/i18n.js +28 -0
- package/build/components/login/i18n.js.map +1 -0
- package/build/components/login/icons.d.ts +14 -0
- package/build/components/login/icons.d.ts.map +1 -0
- package/build/components/login/icons.js +29 -0
- package/build/components/login/icons.js.map +1 -0
- package/build/components/login/index.d.ts +11 -0
- package/build/components/login/index.d.ts.map +1 -0
- package/build/components/login/index.js +10 -0
- package/build/components/login/index.js.map +1 -0
- package/build/components/login/notify.d.ts +18 -0
- package/build/components/login/notify.d.ts.map +1 -0
- package/build/components/login/notify.js +41 -0
- package/build/components/login/notify.js.map +1 -0
- package/build/components/login/provider.d.ts +20 -0
- package/build/components/login/provider.d.ts.map +1 -0
- package/build/components/login/provider.js +31 -0
- package/build/components/login/provider.js.map +1 -0
- package/build/components/login/screen.d.ts +24 -0
- package/build/components/login/screen.d.ts.map +1 -0
- package/build/components/login/screen.js +92 -0
- package/build/components/login/screen.js.map +1 -0
- package/build/components/login/terms.d.ts +19 -0
- package/build/components/login/terms.d.ts.map +1 -0
- package/build/components/login/terms.js +32 -0
- package/build/components/login/terms.js.map +1 -0
- package/build/components/login/types.d.ts +28 -0
- package/build/components/login/types.d.ts.map +1 -0
- package/build/components/login/types.js +2 -0
- package/build/components/login/types.js.map +1 -0
- package/build/components/nav/consts.local.d.ts +41 -0
- package/build/components/nav/consts.local.d.ts.map +1 -0
- package/build/components/nav/consts.local.js +60 -0
- package/build/components/nav/consts.local.js.map +1 -0
- package/build/components/nav/index.d.ts +1 -0
- package/build/components/nav/index.d.ts.map +1 -1
- package/build/components/nav/index.js +1 -0
- package/build/components/nav/index.js.map +1 -1
- package/build/components/nav/layout.d.ts +9 -2
- package/build/components/nav/layout.d.ts.map +1 -1
- package/build/components/nav/layout.js +48 -7
- package/build/components/nav/layout.js.map +1 -1
- package/build/components/nav/mobile.d.ts +21 -0
- package/build/components/nav/mobile.d.ts.map +1 -0
- package/build/components/nav/mobile.js +55 -0
- package/build/components/nav/mobile.js.map +1 -0
- package/build/components/nav/side.d.ts.map +1 -1
- package/build/components/nav/side.js +10 -10
- package/build/components/nav/side.js.map +1 -1
- package/build/components/nav/top.d.ts.map +1 -1
- package/build/components/nav/top.js +12 -8
- package/build/components/nav/top.js.map +1 -1
- package/build/components/nav/types.d.ts +64 -1
- package/build/components/nav/types.d.ts.map +1 -1
- package/build/components/nav/viewport.d.ts +3 -0
- package/build/components/nav/viewport.d.ts.map +1 -0
- package/build/components/nav/viewport.js +14 -0
- package/build/components/nav/viewport.js.map +1 -0
- package/build/components/panel-app/component.d.ts.map +1 -1
- package/build/components/panel-app/component.js +4 -3
- package/build/components/panel-app/component.js.map +1 -1
- package/build/components/picker/color-picker.d.ts +9 -0
- package/build/components/picker/color-picker.d.ts.map +1 -0
- package/build/components/picker/color-picker.js +9 -0
- package/build/components/picker/color-picker.js.map +1 -0
- package/build/components/picker/consts.local.d.ts +76 -0
- package/build/components/picker/consts.local.d.ts.map +1 -0
- package/build/components/picker/consts.local.js +214 -0
- package/build/components/picker/consts.local.js.map +1 -0
- package/build/components/picker/dot.d.ts +8 -0
- package/build/components/picker/dot.d.ts.map +1 -0
- package/build/components/picker/dot.js +10 -0
- package/build/components/picker/dot.js.map +1 -0
- package/build/components/picker/grid.d.ts +17 -0
- package/build/components/picker/grid.d.ts.map +1 -0
- package/build/components/picker/grid.js +73 -0
- package/build/components/picker/grid.js.map +1 -0
- package/build/components/picker/i18n/be.json +60 -0
- package/build/components/picker/i18n/de.json +60 -0
- package/build/components/picker/i18n/en.json +60 -0
- package/build/components/picker/i18n/es.json +60 -0
- package/build/components/picker/i18n/fr.json +60 -0
- package/build/components/picker/i18n/pl.json +60 -0
- package/build/components/picker/i18n/ru.json +60 -0
- package/build/components/picker/i18n/uk.json +60 -0
- package/build/components/picker/i18n.d.ts +2 -0
- package/build/components/picker/i18n.d.ts.map +1 -0
- package/build/components/picker/i18n.js +18 -0
- package/build/components/picker/i18n.js.map +1 -0
- package/build/components/picker/icon-color-picker.d.ts +14 -0
- package/build/components/picker/icon-color-picker.d.ts.map +1 -0
- package/build/components/picker/icon-color-picker.js +15 -0
- package/build/components/picker/icon-color-picker.js.map +1 -0
- package/build/components/picker/icon-picker.d.ts +8 -0
- package/build/components/picker/icon-picker.d.ts.map +1 -0
- package/build/components/picker/icon-picker.js +8 -0
- package/build/components/picker/icon-picker.js.map +1 -0
- package/build/components/picker/index.d.ts +11 -0
- package/build/components/picker/index.d.ts.map +1 -0
- package/build/components/picker/index.js +10 -0
- package/build/components/picker/index.js.map +1 -0
- package/build/components/picker/panel.d.ts +9 -0
- package/build/components/picker/panel.d.ts.map +1 -0
- package/build/components/picker/panel.js +23 -0
- package/build/components/picker/panel.js.map +1 -0
- package/build/components/picker/root.d.ts +13 -0
- package/build/components/picker/root.d.ts.map +1 -0
- package/build/components/picker/root.js +55 -0
- package/build/components/picker/root.js.map +1 -0
- package/build/components/picker/roving.d.ts +8 -0
- package/build/components/picker/roving.d.ts.map +1 -0
- package/build/components/picker/roving.js +62 -0
- package/build/components/picker/roving.js.map +1 -0
- package/build/components/picker/surface.d.ts +18 -0
- package/build/components/picker/surface.d.ts.map +1 -0
- package/build/components/picker/surface.js +36 -0
- package/build/components/picker/surface.js.map +1 -0
- package/build/components/picker/swatches/custom.d.ts +10 -0
- package/build/components/picker/swatches/custom.d.ts.map +1 -0
- package/build/components/picker/swatches/custom.js +65 -0
- package/build/components/picker/swatches/custom.js.map +1 -0
- package/build/components/picker/swatches.d.ts +16 -0
- package/build/components/picker/swatches.d.ts.map +1 -0
- package/build/components/picker/swatches.js +35 -0
- package/build/components/picker/swatches.js.map +1 -0
- package/build/components/picker/text.d.ts +5 -0
- package/build/components/picker/text.d.ts.map +1 -0
- package/build/components/picker/text.js +29 -0
- package/build/components/picker/text.js.map +1 -0
- package/build/components/picker/tile.d.ts +11 -0
- package/build/components/picker/tile.d.ts.map +1 -0
- package/build/components/picker/tile.js +19 -0
- package/build/components/picker/tile.js.map +1 -0
- package/build/components/picker/translate.d.ts +9 -0
- package/build/components/picker/translate.d.ts.map +1 -0
- package/build/components/picker/translate.js +13 -0
- package/build/components/picker/translate.js.map +1 -0
- package/build/components/picker/trigger.d.ts +12 -0
- package/build/components/picker/trigger.d.ts.map +1 -0
- package/build/components/picker/trigger.js +29 -0
- package/build/components/picker/trigger.js.map +1 -0
- package/build/components/picker/types.d.ts +114 -0
- package/build/components/picker/types.d.ts.map +1 -0
- package/build/components/picker/types.js +2 -0
- package/build/components/picker/types.js.map +1 -0
- package/build/components/picker/types.local.d.ts +143 -0
- package/build/components/picker/types.local.d.ts.map +1 -0
- package/build/components/picker/types.local.js +2 -0
- package/build/components/picker/types.local.js.map +1 -0
- package/build/components/scheme/consts.local.d.ts +8 -0
- package/build/components/scheme/consts.local.d.ts.map +1 -0
- package/build/components/scheme/consts.local.js +13 -0
- package/build/components/scheme/consts.local.js.map +1 -0
- package/build/components/scheme/hook.d.ts +16 -0
- package/build/components/scheme/hook.d.ts.map +1 -0
- package/build/components/scheme/hook.js +52 -0
- package/build/components/scheme/hook.js.map +1 -0
- package/build/components/scheme/index.d.ts +4 -0
- package/build/components/scheme/index.d.ts.map +1 -0
- package/build/components/scheme/index.js +3 -0
- package/build/components/scheme/index.js.map +1 -0
- package/build/components/scheme/toggle.d.ts +14 -0
- package/build/components/scheme/toggle.d.ts.map +1 -0
- package/build/components/scheme/toggle.js +24 -0
- package/build/components/scheme/toggle.js.map +1 -0
- package/build/components/scheme/types.d.ts +21 -0
- package/build/components/scheme/types.d.ts.map +1 -0
- package/build/components/scheme/types.js +2 -0
- package/build/components/scheme/types.js.map +1 -0
- package/build/components/socket/i18n/be.json +9 -0
- package/build/components/socket/i18n/de.json +9 -0
- package/build/components/socket/i18n/en.json +9 -0
- package/build/components/socket/i18n/es.json +9 -0
- package/build/components/socket/i18n/fr.json +9 -0
- package/build/components/socket/i18n/pl.json +9 -0
- package/build/components/socket/i18n/ru.json +9 -0
- package/build/components/socket/i18n/uk.json +9 -0
- package/build/components/socket/i18n.d.ts +2 -0
- package/build/components/socket/i18n.d.ts.map +1 -0
- package/build/components/socket/i18n.js +18 -0
- package/build/components/socket/i18n.js.map +1 -0
- package/build/components/socket/index.d.ts +3 -0
- package/build/components/socket/index.d.ts.map +1 -0
- package/build/components/socket/index.js +3 -0
- package/build/components/socket/index.js.map +1 -0
- package/build/components/socket/reload-dialog.d.ts +22 -0
- package/build/components/socket/reload-dialog.d.ts.map +1 -0
- package/build/components/socket/reload-dialog.js +34 -0
- package/build/components/socket/reload-dialog.js.map +1 -0
- package/build/components/status.js +1 -1
- package/build/components/status.js.map +1 -1
- package/build/components/text.d.ts.map +1 -1
- package/build/components/text.js +2 -13
- package/build/components/text.js.map +1 -1
- package/build/components/toaster.d.ts +16 -0
- package/build/components/toaster.d.ts.map +1 -0
- package/build/components/toaster.js +52 -0
- package/build/components/toaster.js.map +1 -0
- package/build/components/uploader/consts.local.d.ts +4 -0
- package/build/components/uploader/consts.local.d.ts.map +1 -0
- package/build/components/uploader/consts.local.js +6 -0
- package/build/components/uploader/consts.local.js.map +1 -0
- package/build/components/uploader/image.d.ts.map +1 -1
- package/build/components/uploader/image.js +2 -6
- package/build/components/uploader/image.js.map +1 -1
- package/build/consent/component.d.ts +27 -0
- package/build/consent/component.d.ts.map +1 -0
- package/build/consent/component.js +60 -0
- package/build/consent/component.js.map +1 -0
- package/build/consent/consts.d.ts +2 -0
- package/build/consent/consts.d.ts.map +1 -0
- package/build/consent/consts.js +2 -0
- package/build/consent/consts.js.map +1 -0
- package/build/consent/consts.local.d.ts +9 -0
- package/build/consent/consts.local.d.ts.map +1 -0
- package/build/consent/consts.local.js +9 -0
- package/build/consent/consts.local.js.map +1 -0
- package/build/consent/geo.d.ts +17 -0
- package/build/consent/geo.d.ts.map +1 -0
- package/build/consent/geo.js +19 -0
- package/build/consent/geo.js.map +1 -0
- package/build/consent/index.d.ts +11 -0
- package/build/consent/index.d.ts.map +1 -0
- package/build/consent/index.js +9 -0
- package/build/consent/index.js.map +1 -0
- package/build/consent/language.d.ts +12 -0
- package/build/consent/language.d.ts.map +1 -0
- package/build/consent/language.js +11 -0
- package/build/consent/language.js.map +1 -0
- package/build/consent/menu-widget.d.ts +13 -0
- package/build/consent/menu-widget.d.ts.map +1 -0
- package/build/consent/menu-widget.js +20 -0
- package/build/consent/menu-widget.js.map +1 -0
- package/build/consent/presence.d.ts +30 -0
- package/build/consent/presence.d.ts.map +1 -0
- package/build/consent/presence.js +40 -0
- package/build/consent/presence.js.map +1 -0
- package/build/consent/service.d.ts +18 -0
- package/build/consent/service.d.ts.map +1 -0
- package/build/consent/service.js +53 -0
- package/build/consent/service.js.map +1 -0
- package/build/consent/translate.d.ts +14 -0
- package/build/consent/translate.d.ts.map +1 -0
- package/build/consent/translate.js +28 -0
- package/build/consent/translate.js.map +1 -0
- package/build/consent/types.d.ts +39 -0
- package/build/consent/types.d.ts.map +1 -0
- package/build/consent/types.js +2 -0
- package/build/consent/types.js.map +1 -0
- package/build/consent/types.local.d.ts +6 -0
- package/build/consent/types.local.d.ts.map +1 -0
- package/build/consent/types.local.js +2 -0
- package/build/consent/types.local.js.map +1 -0
- package/build/context.d.ts.map +1 -1
- package/build/context.js +10 -0
- package/build/context.js.map +1 -1
- package/build/editor/component.d.ts +4 -0
- package/build/editor/component.d.ts.map +1 -0
- package/build/editor/component.js +103 -0
- package/build/editor/component.js.map +1 -0
- package/build/editor/consts.local.d.ts +6 -0
- package/build/editor/consts.local.d.ts.map +1 -0
- package/build/editor/consts.local.js +58 -0
- package/build/editor/consts.local.js.map +1 -0
- package/build/editor/index.d.ts +3 -0
- package/build/editor/index.d.ts.map +1 -0
- package/build/editor/index.js +2 -0
- package/build/editor/index.js.map +1 -0
- package/build/editor/types.d.ts +24 -0
- package/build/editor/types.d.ts.map +1 -0
- package/build/editor/types.js +2 -0
- package/build/editor/types.js.map +1 -0
- package/build/entrypoints.d.ts +8 -0
- package/build/entrypoints.d.ts.map +1 -0
- package/build/entrypoints.js +4 -0
- package/build/entrypoints.js.map +1 -0
- package/build/exports.d.ts +6 -5
- package/build/exports.d.ts.map +1 -1
- package/build/exports.js +5 -5
- package/build/exports.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/main.d.ts +1 -4
- package/build/main.d.ts.map +1 -1
- package/build/main.js.map +1 -1
- package/build/modules.d.ts +1 -1
- package/build/modules.d.ts.map +1 -1
- package/build/permission/i18n/be.json +13 -0
- package/build/permission/i18n/de.json +13 -0
- package/build/permission/i18n/en.json +13 -0
- package/build/permission/i18n/es.json +13 -0
- package/build/permission/i18n/fr.json +13 -0
- package/build/permission/i18n/pl.json +13 -0
- package/build/permission/i18n/ru.json +13 -0
- package/build/permission/i18n/uk.json +13 -0
- package/build/permission/i18n.d.ts +2 -0
- package/build/permission/i18n.d.ts.map +1 -0
- package/build/permission/i18n.js +13 -0
- package/build/permission/i18n.js.map +1 -0
- package/build/permission/index.d.ts +6 -0
- package/build/permission/index.d.ts.map +1 -0
- package/build/permission/index.js +27 -0
- package/build/permission/index.js.map +1 -0
- package/build/permission/toast.d.ts +5 -0
- package/build/permission/toast.d.ts.map +1 -0
- package/build/permission/toast.js +8 -0
- package/build/permission/toast.js.map +1 -0
- package/build/permission/types.d.ts +6 -0
- package/build/permission/types.d.ts.map +1 -0
- package/build/permission/types.js +2 -0
- package/build/permission/types.js.map +1 -0
- package/build/picker/icons/consts.d.ts +9 -0
- package/build/picker/icons/consts.d.ts.map +1 -0
- package/build/picker/icons/consts.js +264 -0
- package/build/picker/icons/consts.js.map +1 -0
- package/build/picker/icons/types.d.ts +18 -0
- package/build/picker/icons/types.d.ts.map +1 -0
- package/build/picker/icons/types.js +2 -0
- package/build/picker/icons/types.js.map +1 -0
- package/build/picker/icons.d.ts +4 -0
- package/build/picker/icons.d.ts.map +1 -0
- package/build/picker/icons.js +54 -0
- package/build/picker/icons.js.map +1 -0
- package/build/picker/index.d.ts +11 -0
- package/build/picker/index.d.ts.map +1 -0
- package/build/picker/index.js +10 -0
- package/build/picker/index.js.map +1 -0
- package/build/picker/utils/color/types.d.ts +35 -0
- package/build/picker/utils/color/types.d.ts.map +1 -0
- package/build/picker/utils/color/types.js +2 -0
- package/build/picker/utils/color/types.js.map +1 -0
- package/build/picker/utils/color.d.ts +4 -0
- package/build/picker/utils/color.d.ts.map +1 -0
- package/build/picker/utils/color.js +96 -0
- package/build/picker/utils/color.js.map +1 -0
- package/build/picker/vocabulary/consts.d.ts +26 -0
- package/build/picker/vocabulary/consts.d.ts.map +1 -0
- package/build/picker/vocabulary/consts.js +336 -0
- package/build/picker/vocabulary/consts.js.map +1 -0
- package/build/picker/vocabulary/types.d.ts +67 -0
- package/build/picker/vocabulary/types.d.ts.map +1 -0
- package/build/picker/vocabulary/types.js +2 -0
- package/build/picker/vocabulary/types.js.map +1 -0
- package/build/picker/vocabulary.d.ts +11 -0
- package/build/picker/vocabulary.d.ts.map +1 -0
- package/build/picker/vocabulary.js +83 -0
- package/build/picker/vocabulary.js.map +1 -0
- package/build/scheme/consts.d.ts +8 -0
- package/build/scheme/consts.d.ts.map +1 -0
- package/build/scheme/consts.js +8 -0
- package/build/scheme/consts.js.map +1 -0
- package/build/scheme/index.d.ts +4 -0
- package/build/scheme/index.d.ts.map +1 -0
- package/build/scheme/index.js +3 -0
- package/build/scheme/index.js.map +1 -0
- package/build/scheme/scheme.d.ts +16 -0
- package/build/scheme/scheme.d.ts.map +1 -0
- package/build/scheme/scheme.js +58 -0
- package/build/scheme/scheme.js.map +1 -0
- package/build/scheme/types.d.ts +30 -0
- package/build/scheme/types.d.ts.map +1 -0
- package/build/scheme/types.js +2 -0
- package/build/scheme/types.js.map +1 -0
- package/build/types.d.ts +18 -2
- package/build/types.d.ts.map +1 -1
- package/package.json +107 -52
- package/src/@/components/ui/alert-dialog.tsx +156 -0
- package/src/@/components/ui/alert.tsx +1 -1
- package/src/@/components/ui/button.tsx +1 -1
- package/src/@/components/ui/card.tsx +1 -1
- package/src/@/components/ui/input.tsx +1 -1
- package/src/@/components/ui/label.tsx +1 -1
- package/src/@/components/ui/navigation-menu.tsx +1 -1
- package/src/@/components/ui/popover.tsx +47 -0
- package/src/@/components/ui/progress.tsx +1 -1
- package/src/@/components/ui/separator.tsx +1 -1
- package/src/@/components/ui/sheet.tsx +142 -0
- package/src/auth/context.ts +0 -2
- package/src/auth/entrypoints.ts +5 -0
- package/src/auth/exports.ts +4 -4
- package/src/auth/plugins/basic-ed25519.tsx +4 -4
- package/src/auth/plugins/re-captcha.tsx +3 -3
- package/src/auth/plugins/tunnel-consumer.tsx +1 -1
- package/src/components/block.tsx +2 -2
- package/src/components/consts.local.ts +29 -0
- package/src/components/footer/component.tsx +58 -16
- package/src/components/footer/credit.tsx +61 -0
- package/src/components/footer/index.ts +1 -0
- package/src/components/footer/types.ts +22 -1
- package/src/components/form/button/component.tsx +7 -4
- package/src/components/form/component.tsx +2 -2
- package/src/components/form/text/component.tsx +2 -2
- package/src/components/helper.ts +1 -13
- package/src/components/index.ts +4 -0
- package/src/components/link.tsx +3 -3
- package/src/components/login/append.ts +34 -0
- package/src/components/login/consts.local.ts +10 -0
- package/src/components/login/consts.ts +2 -0
- package/src/components/login/credit.tsx +33 -0
- package/src/components/login/i18n/be.json +10 -0
- package/src/components/login/i18n/de.json +10 -0
- package/src/components/login/i18n/en.json +10 -0
- package/src/components/login/i18n/es.json +10 -0
- package/src/components/login/i18n/fr.json +10 -0
- package/src/components/login/i18n/pl.json +10 -0
- package/src/components/login/i18n/ru.json +10 -0
- package/src/components/login/i18n/uk.json +10 -0
- package/src/components/login/i18n.ts +29 -0
- package/src/components/login/icons.tsx +39 -0
- package/src/components/login/index.ts +11 -0
- package/src/components/login/notify.ts +48 -0
- package/src/components/login/provider.tsx +57 -0
- package/src/components/login/screen.tsx +178 -0
- package/src/components/login/terms.tsx +75 -0
- package/src/components/login/types.ts +30 -0
- package/src/components/nav/consts.local.ts +64 -0
- package/src/components/nav/index.ts +1 -0
- package/src/components/nav/layout.tsx +184 -26
- package/src/components/nav/mobile.tsx +165 -0
- package/src/components/nav/side.tsx +43 -27
- package/src/components/nav/top.tsx +44 -22
- package/src/components/nav/types.ts +65 -2
- package/src/components/nav/viewport.ts +16 -0
- package/src/components/panel-app/component.tsx +9 -1
- package/src/components/picker/color-picker.tsx +15 -0
- package/src/components/picker/consts.local.ts +267 -0
- package/src/components/picker/dot.tsx +21 -0
- package/src/components/picker/grid.tsx +138 -0
- package/src/components/picker/i18n/be.json +60 -0
- package/src/components/picker/i18n/de.json +60 -0
- package/src/components/picker/i18n/en.json +60 -0
- package/src/components/picker/i18n/es.json +60 -0
- package/src/components/picker/i18n/fr.json +60 -0
- package/src/components/picker/i18n/pl.json +60 -0
- package/src/components/picker/i18n/ru.json +60 -0
- package/src/components/picker/i18n/uk.json +60 -0
- package/src/components/picker/i18n.ts +19 -0
- package/src/components/picker/icon-color-picker.tsx +25 -0
- package/src/components/picker/icon-picker.tsx +13 -0
- package/src/components/picker/index.ts +11 -0
- package/src/components/picker/panel.tsx +61 -0
- package/src/components/picker/root.tsx +81 -0
- package/src/components/picker/roving.ts +70 -0
- package/src/components/picker/surface.tsx +62 -0
- package/src/components/picker/swatches/custom.tsx +110 -0
- package/src/components/picker/swatches.tsx +67 -0
- package/src/components/picker/text.ts +46 -0
- package/src/components/picker/tile.tsx +35 -0
- package/src/components/picker/translate.ts +15 -0
- package/src/components/picker/trigger.tsx +54 -0
- package/src/components/picker/types.local.ts +154 -0
- package/src/components/picker/types.ts +125 -0
- package/src/components/scheme/consts.local.ts +13 -0
- package/src/components/scheme/hook.ts +62 -0
- package/src/components/scheme/index.ts +4 -0
- package/src/components/scheme/toggle.tsx +32 -0
- package/src/components/scheme/types.ts +23 -0
- package/src/components/socket/i18n/be.json +9 -0
- package/src/components/socket/i18n/de.json +9 -0
- package/src/components/socket/i18n/en.json +9 -0
- package/src/components/socket/i18n/es.json +9 -0
- package/src/components/socket/i18n/fr.json +9 -0
- package/src/components/socket/i18n/pl.json +9 -0
- package/src/components/socket/i18n/ru.json +9 -0
- package/src/components/socket/i18n/uk.json +9 -0
- package/src/components/socket/i18n.ts +19 -0
- package/src/components/socket/index.ts +2 -0
- package/src/components/socket/reload-dialog.tsx +61 -0
- package/src/components/status.tsx +1 -1
- package/src/components/text.tsx +2 -14
- package/src/components/toaster.tsx +65 -0
- package/src/components/uploader/consts.local.ts +7 -0
- package/src/components/uploader/image.tsx +2 -6
- package/src/consent/component.tsx +84 -0
- package/src/consent/consts.local.ts +10 -0
- package/src/consent/consts.ts +1 -0
- package/src/consent/geo.ts +26 -0
- package/src/consent/index.ts +24 -0
- package/src/consent/language.ts +12 -0
- package/src/consent/menu-widget.tsx +22 -0
- package/src/consent/presence.ts +45 -0
- package/src/consent/service.ts +75 -0
- package/src/consent/translate.ts +31 -0
- package/src/consent/types.local.ts +6 -0
- package/src/consent/types.ts +43 -0
- package/src/context.ts +12 -0
- package/src/editor/component.tsx +172 -0
- package/src/editor/consts.local.ts +62 -0
- package/src/editor/index.ts +2 -0
- package/src/editor/types.ts +24 -0
- package/src/entrypoints.ts +5 -0
- package/src/exports.ts +6 -5
- package/src/index.ts +1 -1
- package/src/main.tsx +2 -6
- package/src/permission/i18n/be.json +13 -0
- package/src/permission/i18n/de.json +13 -0
- package/src/permission/i18n/en.json +13 -0
- package/src/permission/i18n/es.json +13 -0
- package/src/permission/i18n/fr.json +13 -0
- package/src/permission/i18n/pl.json +13 -0
- package/src/permission/i18n/ru.json +13 -0
- package/src/permission/i18n/uk.json +13 -0
- package/src/permission/i18n.ts +13 -0
- package/src/permission/index.ts +27 -0
- package/src/permission/toast.tsx +20 -0
- package/src/permission/types.ts +5 -0
- package/src/picker/icons/consts.ts +309 -0
- package/src/picker/icons/types.ts +18 -0
- package/src/picker/icons.ts +70 -0
- package/src/picker/index.ts +11 -0
- package/src/picker/utils/color/types.ts +37 -0
- package/src/picker/utils/color.ts +119 -0
- package/src/picker/vocabulary/consts.ts +347 -0
- package/src/picker/vocabulary/types.ts +72 -0
- package/src/picker/vocabulary.ts +111 -0
- package/src/scheme/consts.ts +8 -0
- package/src/scheme/index.ts +3 -0
- package/src/scheme/scheme.ts +66 -0
- package/src/scheme/types.ts +30 -0
- package/src/types.ts +19 -2
- package/tests/consent-language.spec.ts +31 -0
- package/tests/consent.spec.ts +112 -0
- package/tests/context.ts +4 -0
- package/tests/editor.spec.ts +58 -0
- package/tests/harness/editor.tsx +32 -0
- package/tests/harness/index.html +1 -0
- package/tests/harness/lazy-screen.tsx +9 -0
- package/tests/harness/mount.tsx +370 -29
- package/tests/harness/picker.tsx +110 -0
- package/tests/lazy.spec.ts +104 -0
- package/tests/login-provider.spec.ts +114 -0
- package/tests/login.spec.ts +447 -0
- package/tests/nav.spec.ts +449 -3
- package/tests/package-boundary.spec.ts +19 -0
- package/tests/picker-shots.spec.ts +174 -0
- package/tests/picker-vocabulary.spec.ts +217 -0
- package/tests/picker.spec.ts +333 -0
- package/tests/scheme.spec.ts +149 -0
- package/tests/smoke.spec.ts +2 -2
- package/tests/socket-dialog.spec.ts +154 -0
- package/tests/toaster.spec.ts +59 -0
- package/zz-tw.d.mts +2 -0
- package/zz-tw.d.mts.map +1 -0
- package/build/.gitkeep +0 -0
- package/src/auth/modules.ts +0 -5
- package/src/modules.ts +0 -5
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { isValidElement } from 'react';
|
|
3
|
+
import { Loader2 } from 'lucide-react';
|
|
4
|
+
import { Button } from '../../@/components/ui/button.js';
|
|
5
|
+
import { Card, CardContent, CardHeader, CardTitle, CardDescription } from '../../@/components/ui/card.js';
|
|
6
|
+
import { cn } from '../../@/lib/utils.js';
|
|
7
|
+
import { useI18nLib, useLanguage } from '@owlmeans/client-i18n';
|
|
8
|
+
import { loginProviderHelper, useLoginMethods } from '@owlmeans/client-panel/auth';
|
|
9
|
+
import { loginResumeHelper } from '@owlmeans/client-auth/login';
|
|
10
|
+
import { LoginMethodIcon } from './icons.js';
|
|
11
|
+
import { LoginPrivacyNotice, LoginTerms } from './terms.js';
|
|
12
|
+
import { LoginCredit } from './credit.js';
|
|
13
|
+
import { LoginProviderNote } from './provider.js';
|
|
14
|
+
import { VARIANT } from './consts.local.js';
|
|
15
|
+
import './i18n.js';
|
|
16
|
+
/**
|
|
17
|
+
* The sign-in screen: which identity provider, confirmed against which documents.
|
|
18
|
+
*
|
|
19
|
+
* It never starts anything by itself. Every flow leaves from a click — which is the requirement,
|
|
20
|
+
* and also what makes framed sign-in work at all, because the window a framed application has to
|
|
21
|
+
* open can only be opened inside a user gesture.
|
|
22
|
+
*
|
|
23
|
+
* Pure with respect to i18n: `translate` is a prop. {@link LocalizedLoginScreen} is the wrapper
|
|
24
|
+
* that binds it to the app's own resources, so an application mounted without an i18n provider can
|
|
25
|
+
* still render this one with a resolver of its own.
|
|
26
|
+
*/
|
|
27
|
+
export const LoginScreen = props => {
|
|
28
|
+
const t = props.translate ?? ((_key, defaultValue) => defaultValue);
|
|
29
|
+
const model = useLoginMethods({
|
|
30
|
+
...(props.config != null ? { config: props.config } : {}),
|
|
31
|
+
...(props.terms !== undefined ? { terms: props.terms } : {}),
|
|
32
|
+
...(props.methods != null ? { methods: props.methods } : {}),
|
|
33
|
+
});
|
|
34
|
+
const Logo = props.Logo;
|
|
35
|
+
const attemptError = model.busy == null ? loginResumeHelper.loginAttemptError(model.outcome) : null;
|
|
36
|
+
const provider = model.provider;
|
|
37
|
+
const title = props.title ?? (provider != null
|
|
38
|
+
? loginProviderHelper.fill(t('login.provider.title', 'Sign in to {{product}}'), provider)
|
|
39
|
+
: t('login.title', 'Sign in'));
|
|
40
|
+
const card = _jsxs(Card, { className: cn('w-full max-w-sm', props.containerClassName), children: [_jsxs(CardHeader, { className: "items-center gap-2 text-center", children: [Logo != null && _jsx("div", { className: "flex justify-center pb-2", children: isValidElement(Logo) ? Logo : typeof Logo === 'function'
|
|
41
|
+
? _jsx(Logo, { className: "h-10 w-auto" }) : Logo }), _jsx(CardTitle, { className: "text-xl", children: title }), _jsx(CardDescription, { children: props.subtitle ?? t('login.subtitle', 'Choose how you would like to continue.') })] }), _jsxs(CardContent, { className: "flex flex-col gap-4", children: [model.methods.length < 1
|
|
42
|
+
? _jsx("p", { role: "status", className: "text-sm text-muted-foreground text-center", children: t('login.empty', 'No sign-in method is configured for this application.') })
|
|
43
|
+
: _jsx("div", { className: "flex flex-col gap-2", children: model.methods.map((method) => _jsxs(Button, { type: "button", "data-login-method": method.id, variant: VARIANT[method.emphasis ?? 'secondary'] ?? 'outline', "aria-disabled": model.blocked || undefined, "data-blocked": model.blocked ? 'true' : undefined,
|
|
44
|
+
// `cursor-pointer` explicitly: the package's private shadcn button stays compatible
|
|
45
|
+
// with the older primitive style too. Stating it here keeps the sign-in control
|
|
46
|
+
// visibly actionable independently of a consumer's shadcn setup.
|
|
47
|
+
className: cn('w-full justify-center gap-2 cursor-pointer', model.blocked && 'opacity-60'), autoFocus: method.id === model.primary?.id, onClick: () => model.select(method), children: [model.busy === method.id
|
|
48
|
+
? _jsx(Loader2, { className: "size-4 animate-spin" })
|
|
49
|
+
: _jsx(LoginMethodIcon, { name: method.icon, className: "size-4" }), method.label ?? t(`login.method.${method.i18nKey ?? method.id}`, method.id)] }, method.id)) }), provider?.placement === 'inline' && _jsx(LoginProviderNote, { model: provider, translate: t }), model.terms.required && (model.terms.deferred
|
|
50
|
+
? _jsx(LoginPrivacyNotice, { model: model.terms, translate: t, locale: props.locale })
|
|
51
|
+
: _jsx(LoginTerms, { model: model.terms, translate: t, locale: props.locale })), (model.error ?? attemptError) != null
|
|
52
|
+
&& _jsx("p", { role: "alert", "data-login-error": true, className: "text-sm text-destructive text-center", children: model.error ?? t(attemptError, 'Sign-in did not complete. Please try again.') })] }), _jsx("div", { className: "px-6", children: props.footer ?? _jsx(LoginCredit, { model: model.credit, translate: t }) })] });
|
|
53
|
+
// The viewport height is set INLINE, and deliberately.
|
|
54
|
+
//
|
|
55
|
+
// A percentage minimum (`min-h-full`) resolves against a parent that has a height, and this
|
|
56
|
+
// screen is rendered straight out of the dispatcher into whatever the app has around it — which
|
|
57
|
+
// almost never carries one, so the box collapsed to its content and the card sat at the top of
|
|
58
|
+
// an empty page. The fix is a viewport unit; the reason it is not a utility class is that this
|
|
59
|
+
// package's classes reach a consuming app's stylesheet only through a `@source` scan of its
|
|
60
|
+
// `src`, and a class NEW to that stylesheet is the one thing the scan can be stale about. Every
|
|
61
|
+
// other utility here already exists in any app that renders anything; a missing `min-h-dvh`
|
|
62
|
+
// rule, by contrast, is invisible — the screen looks nearly right and is silently uncentred.
|
|
63
|
+
//
|
|
64
|
+
// `props.style` still wins, because a class-based override no longer can.
|
|
65
|
+
//
|
|
66
|
+
// The platform's own hosts put the provider disclosure in a strip across the top of the page —
|
|
67
|
+
// the FIRST child of the screen — and centre the card in a stage that takes the rest of the
|
|
68
|
+
// height. Every layout-bearing property of that variant is inline too, for the same reason.
|
|
69
|
+
if (provider?.placement === 'top') {
|
|
70
|
+
return _jsxs("div", { "data-login-screen": true, style: {
|
|
71
|
+
minHeight: '100dvh', display: 'flex', flexDirection: 'column', alignItems: 'stretch',
|
|
72
|
+
justifyContent: 'flex-start', padding: 0, ...props.style,
|
|
73
|
+
}, className: cn('w-full', props.className), children: [_jsx(LoginProviderNote, { model: provider, translate: t }), _jsx("div", { "data-login-stage": true, style: {
|
|
74
|
+
display: 'flex', flex: '1 1 auto', alignItems: 'center', justifyContent: 'center',
|
|
75
|
+
width: '100%', padding: '1rem', boxSizing: 'border-box',
|
|
76
|
+
}, children: card })] });
|
|
77
|
+
}
|
|
78
|
+
return _jsx("div", { "data-login-screen": true, style: { minHeight: '100dvh', ...props.style }, className: cn('flex w-full items-center justify-center p-4', props.className), children: card });
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* {@link LoginScreen} bound to the application's own translations.
|
|
82
|
+
*
|
|
83
|
+
* The split exists because the house rule is that a reusable component takes `translate` as a prop
|
|
84
|
+
* and never reaches for a context — but the ordinary case is an app that has one, and making every
|
|
85
|
+
* app write the resolver would guarantee some of them ship English.
|
|
86
|
+
*/
|
|
87
|
+
export const LocalizedLoginScreen = props => {
|
|
88
|
+
const t = useI18nLib('auth');
|
|
89
|
+
const [lng] = useLanguage();
|
|
90
|
+
return _jsx(LoginScreen, { ...props, translate: props.translate ?? ((key, defaultValue) => t(key, { defaultValue })), locale: props.locale ?? lng });
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=screen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screen.js","sourceRoot":"","sources":["../../../src/components/login/screen.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAW,MAAM,OAAO,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AACzG,OAAO,EAAE,EAAE,EAAE,MAAM,sBAAsB,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAClF,OAAO,EAA2C,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AACxG,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,WAAW,CAAA;AAElB;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,WAAW,GAAyB,KAAK,CAAC,EAAE;IACvD,MAAM,CAAC,GAAG,KAAK,CAAC,SAAS,IAAI,CAAC,CAAC,IAAY,EAAE,YAAoB,EAAE,EAAE,CAAC,YAAY,CAAC,CAAA;IACnF,MAAM,KAAK,GAAG,eAAe,CAAC;QAC5B,GAAG,CAAC,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC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AAE,EAAE,YAAY,EAAE,CAAC,CAAC,EAC/E,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,GAAG,GAC3B,CAAA;AACJ,CAAC,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { LoginPrivacyNoticeProps, LoginTermsProps } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* The privacy disclosure alone — `notices` (privacy, plus cookies per its own rule), never
|
|
5
|
+
* consented to and never nested inside a checkbox's `<label>`.
|
|
6
|
+
*
|
|
7
|
+
* Split out of {@link LoginTerms} so a sign-in screen whose Terms confirmation has moved to a
|
|
8
|
+
* post-login step (`termsDeferred`, `@owlmeans/client-auth/login`) can still show this line on its
|
|
9
|
+
* own — the disclosure does not move just because the confirmation did.
|
|
10
|
+
*/
|
|
11
|
+
export declare const LoginPrivacyNotice: FC<LoginPrivacyNoticeProps>;
|
|
12
|
+
/**
|
|
13
|
+
* The sign-in screen's terms confirmation: one consented checkbox for `documents` (terms, plus
|
|
14
|
+
* billing/product/custom when configured), and a SEPARATE, non-consented disclosure line for
|
|
15
|
+
* `notices` (privacy, plus cookies per its own rule) — never nested inside the checkbox's label,
|
|
16
|
+
* because nothing is being agreed to there.
|
|
17
|
+
*/
|
|
18
|
+
export declare const LoginTerms: FC<LoginTermsProps>;
|
|
19
|
+
//# sourceMappingURL=terms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terms.d.ts","sourceRoot":"","sources":["../../../src/components/login/terms.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAa,MAAM,OAAO,CAAA;AAG1C,OAAO,KAAK,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAS1E;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CAM1D,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAwC1C,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../../@/lib/utils.js';
|
|
3
|
+
import { loginTermsHelper } from '@owlmeans/client-auth/login';
|
|
4
|
+
const renderParts = (parts) => parts.map((part, index) => part.href != null
|
|
5
|
+
? _jsx("a", { href: part.href, target: "_blank", rel: "noreferrer noopener", "data-login-document": part.documentKey, className: "underline underline-offset-2 hover:text-foreground", children: part.text }, index)
|
|
6
|
+
: _jsx("span", { children: part.text }, index));
|
|
7
|
+
/**
|
|
8
|
+
* The privacy disclosure alone — `notices` (privacy, plus cookies per its own rule), never
|
|
9
|
+
* consented to and never nested inside a checkbox's `<label>`.
|
|
10
|
+
*
|
|
11
|
+
* Split out of {@link LoginTerms} so a sign-in screen whose Terms confirmation has moved to a
|
|
12
|
+
* post-login step (`termsDeferred`, `@owlmeans/client-auth/login`) can still show this line on its
|
|
13
|
+
* own — the disclosure does not move just because the confirmation did.
|
|
14
|
+
*/
|
|
15
|
+
export const LoginPrivacyNotice = ({ model, translate, locale, className }) => {
|
|
16
|
+
const resolveLabel = loginTermsHelper.termsLabelResolver(translate, locale);
|
|
17
|
+
return _jsx("p", { "data-login-privacy": true, className: cn('text-xs text-muted-foreground', className), children: renderParts(loginTermsHelper.termsSentence(translate('login.terms.notice', 'How we handle your personal data: {{notices}}.'), model, locale, resolveLabel)) });
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* The sign-in screen's terms confirmation: one consented checkbox for `documents` (terms, plus
|
|
21
|
+
* billing/product/custom when configured), and a SEPARATE, non-consented disclosure line for
|
|
22
|
+
* `notices` (privacy, plus cookies per its own rule) — never nested inside the checkbox's label,
|
|
23
|
+
* because nothing is being agreed to there.
|
|
24
|
+
*/
|
|
25
|
+
export const LoginTerms = ({ model, translate, locale, className }) => {
|
|
26
|
+
const resolveLabel = loginTermsHelper.termsLabelResolver(translate, locale);
|
|
27
|
+
// Centred, like every other row in the card. The checkbox stays at the start of the sentence
|
|
28
|
+
// rather than above it, so `justify-center` centres the pair and `text-center` centres the
|
|
29
|
+
// wrapped lines within it.
|
|
30
|
+
return _jsxs("div", { className: cn('flex flex-col items-center gap-1.5 text-center', className), children: [_jsxs("label", { className: "flex items-start justify-center gap-2 text-sm text-muted-foreground cursor-pointer", children: [_jsx("input", { type: "checkbox", "data-login-terms": true, className: "mt-0.5 size-4 shrink-0 accent-primary", checked: model.accepted, "aria-invalid": model.attempted && !model.accepted, onChange: event => model.accept(event.target.checked) }), _jsx("span", { children: renderParts(loginTermsHelper.termsSentence(translate('login.terms.accept', 'I have read and agree to the {{documents}}.'), model, locale, resolveLabel)) })] }), model.revisedAt != null && _jsx("p", { "data-login-revised": true, className: "text-xs text-muted-foreground", children: translate('login.terms.revised', 'Last updated: {{date}}').split('{{date}}').join(model.revisedAt) }), _jsx(LoginPrivacyNotice, { model: model, translate: translate, locale: locale }), model.attempted && !model.accepted && _jsx("p", { role: "alert", className: "text-sm text-destructive", children: renderParts(loginTermsHelper.termsSentence(translate('login.terms.required', 'Please confirm the {{documents}} to continue.'), model, locale, resolveLabel)) })] });
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=terms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terms.js","sourceRoot":"","sources":["../../../src/components/login/terms.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,sBAAsB,CAAA;AACzC,OAAO,EAA0B,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAGtF,MAAM,WAAW,GAAG,CAAC,KAA0B,EAAa,EAAE,CAC5D,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI;IAC1C,CAAC,CAAC,YAAe,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,E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CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GACrD,EACF,yBACG,WAAW,CAAC,gBAAgB,CAAC,aAAa,CAAC,SAAS,CAAC,oBAAoB,EAAE,6CAA6C,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,GACpJ,IACD,EAEP,KAAK,CAAC,SAAS,IAAI,IAAI,IAAI,wCAAsB,SAAS,EAAC,+BAA+B,YACxF,SAAS,CAAC,qBAAqB,EAAE,wBAAwB,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,GACjG,EAEJ,KAAC,kBAAkB,IAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAI,EAEzE,KAAK,CAAC,SAAS,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,YAAG,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,0BAA0B,YACxF,WAAW,CAAC,gBAAgB,CAAC,aAAa,CAAC,SAAS,CAAC,sBAAsB,EAAE,+CAA+C,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,GAC3J,IACA,CAAA;AACR,CAAC,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { LoginScreenProps } from '@owlmeans/client-auth/login';
|
|
2
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
3
|
+
import type { LoginCreditModel, LoginProviderModel, LoginTermsModel } from '@owlmeans/client-panel/auth';
|
|
4
|
+
export interface LoginScreenSetup extends Omit<LoginScreenProps, 'translate'> {
|
|
5
|
+
/** The one thing an application is expected to supply. */
|
|
6
|
+
Logo?: ComponentType<{
|
|
7
|
+
className?: string;
|
|
8
|
+
}> | ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export interface LoginCreditProps {
|
|
11
|
+
model: LoginCreditModel;
|
|
12
|
+
translate: (key: string, defaultValue: string) => string;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface LoginTermsProps {
|
|
16
|
+
model: LoginTermsModel;
|
|
17
|
+
translate: (key: string, defaultValue: string) => string;
|
|
18
|
+
/** The current language, for `Intl.ListFormat`, document labels and explicit translated hrefs. */
|
|
19
|
+
locale?: string;
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
export type LoginPrivacyNoticeProps = LoginTermsProps;
|
|
23
|
+
export interface LoginProviderNoteProps {
|
|
24
|
+
model: LoginProviderModel;
|
|
25
|
+
translate: (key: string, defaultValue: string) => string;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/login/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAExG,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,gBAAgB,EAAE,WAAW,CAAC;IAC3E,0DAA0D;IAC1D,IAAI,CAAC,EAAE,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,SAAS,CAAA;CACzD;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,gBAAgB,CAAA;IACvB,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,MAAM,CAAA;IACxD,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,eAAe,CAAA;IACtB,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,MAAM,CAAA;IACxD,kGAAkG;IAClG,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,MAAM,uBAAuB,GAAG,eAAe,CAAA;AAErD,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,kBAAkB,CAAA;IACzB,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,MAAM,CAAA;IACxD,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/login/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The horizontal rhythm of the whole page, applied identically to the header row, the content
|
|
3
|
+
* and the footer row.
|
|
4
|
+
*
|
|
5
|
+
* It lives in ONE constant because the three regions have to agree: a content area with its own
|
|
6
|
+
* width sits visibly inset from a full-width header, which reads as a mistake rather than as a
|
|
7
|
+
* design. Adjust it through `containerClassName`, which is MERGED over this — never by giving
|
|
8
|
+
* the content a width of its own.
|
|
9
|
+
*/
|
|
10
|
+
export declare const CONTAINER = "mx-auto w-full max-w-6xl px-4";
|
|
11
|
+
/**
|
|
12
|
+
* A 44px target and a ring that is actually visible: the shadcn button draws its focus ring at
|
|
13
|
+
* half the ring colour's alpha, which on a white header is close to nothing, and a menu button is
|
|
14
|
+
* the one control a keyboard user on a narrow window has to find before anything else.
|
|
15
|
+
*/
|
|
16
|
+
export declare const TARGET = "size-11 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background";
|
|
17
|
+
export declare const ENTRY_ACTIVE = "bg-accent text-accent-foreground";
|
|
18
|
+
/**
|
|
19
|
+
* Section entries are LINKS, not buttons.
|
|
20
|
+
*
|
|
21
|
+
* The shadcn primitive styles its links as menu tiles — a filled hover/active background, a
|
|
22
|
+
* radius and tile padding — which reads as a row of buttons across the top of an application.
|
|
23
|
+
* These classes land after the primitive's, so `cn`'s tailwind-merge drops the conflicting
|
|
24
|
+
* ones; every neutralised utility here has a counterpart in the primitive, and removing one
|
|
25
|
+
* brings the tile back.
|
|
26
|
+
*/
|
|
27
|
+
export declare const SECTION_LINK: string;
|
|
28
|
+
/**
|
|
29
|
+
* Invisible until it takes focus, then a pill in the top-left corner above everything — the
|
|
30
|
+
* inverse of the page's own surface (`bg-foreground text-background`), so it reads on any theme.
|
|
31
|
+
*
|
|
32
|
+
* The padding is focus-only: `sr-only` zeroes padding, but a plain `px-4` sorts after it and wins,
|
|
33
|
+
* which leaves a 32px box behind the clip instead of the 1px one assistive tech expects.
|
|
34
|
+
*/
|
|
35
|
+
export declare const SKIP_LINK: string;
|
|
36
|
+
/**
|
|
37
|
+
* Sheet entries are LINKS, exactly as the section menu's are — a real `href` keeps each one
|
|
38
|
+
* focusable, openable in a new tab and announced as a link — and each row is a 44px touch target.
|
|
39
|
+
*/
|
|
40
|
+
export declare const ENTRY: string;
|
|
41
|
+
//# sourceMappingURL=consts.local.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.local.d.ts","sourceRoot":"","sources":["../../../src/components/nav/consts.local.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,kCAAkC,CAAA;AAExD;;;;GAIG;AACH,eAAO,MAAM,MAAM,qGAAqG,CAAA;AAExH,eAAO,MAAM,YAAY,qCAAqC,CAAA;AAE9D;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,QAUd,CAAA;AAEX;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,QAKX,CAAA;AAEX;;;GAGG;AACH,eAAO,MAAM,KAAK,QAIP,CAAA"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The horizontal rhythm of the whole page, applied identically to the header row, the content
|
|
3
|
+
* and the footer row.
|
|
4
|
+
*
|
|
5
|
+
* It lives in ONE constant because the three regions have to agree: a content area with its own
|
|
6
|
+
* width sits visibly inset from a full-width header, which reads as a mistake rather than as a
|
|
7
|
+
* design. Adjust it through `containerClassName`, which is MERGED over this — never by giving
|
|
8
|
+
* the content a width of its own.
|
|
9
|
+
*/
|
|
10
|
+
export const CONTAINER = 'mx-auto w-full max-w-6xl px-4';
|
|
11
|
+
/**
|
|
12
|
+
* A 44px target and a ring that is actually visible: the shadcn button draws its focus ring at
|
|
13
|
+
* half the ring colour's alpha, which on a white header is close to nothing, and a menu button is
|
|
14
|
+
* the one control a keyboard user on a narrow window has to find before anything else.
|
|
15
|
+
*/
|
|
16
|
+
export const TARGET = 'size-11 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background';
|
|
17
|
+
export const ENTRY_ACTIVE = 'bg-accent text-accent-foreground';
|
|
18
|
+
/**
|
|
19
|
+
* Section entries are LINKS, not buttons.
|
|
20
|
+
*
|
|
21
|
+
* The shadcn primitive styles its links as menu tiles — a filled hover/active background, a
|
|
22
|
+
* radius and tile padding — which reads as a row of buttons across the top of an application.
|
|
23
|
+
* These classes land after the primitive's, so `cn`'s tailwind-merge drops the conflicting
|
|
24
|
+
* ones; every neutralised utility here has a counterpart in the primitive, and removing one
|
|
25
|
+
* brings the tile back.
|
|
26
|
+
*/
|
|
27
|
+
export const SECTION_LINK = [
|
|
28
|
+
'bg-transparent hover:bg-transparent focus:bg-transparent',
|
|
29
|
+
'rounded-none px-0 py-1',
|
|
30
|
+
'text-sm font-medium text-muted-foreground',
|
|
31
|
+
'hover:text-foreground hover:underline underline-offset-4',
|
|
32
|
+
// Radix marks the active link with a VALUELESS `data-active`, so the state has to be matched
|
|
33
|
+
// on the attribute's presence. `data-[active=true]` — which the shadcn primitive itself uses —
|
|
34
|
+
// matches nothing here, which is why its own active styling never showed either.
|
|
35
|
+
'data-[active]:text-foreground data-[active]:underline data-[active]:bg-transparent',
|
|
36
|
+
'cursor-pointer',
|
|
37
|
+
].join(' ');
|
|
38
|
+
/**
|
|
39
|
+
* Invisible until it takes focus, then a pill in the top-left corner above everything — the
|
|
40
|
+
* inverse of the page's own surface (`bg-foreground text-background`), so it reads on any theme.
|
|
41
|
+
*
|
|
42
|
+
* The padding is focus-only: `sr-only` zeroes padding, but a plain `px-4` sorts after it and wins,
|
|
43
|
+
* which leaves a 32px box behind the clip instead of the 1px one assistive tech expects.
|
|
44
|
+
*/
|
|
45
|
+
export const SKIP_LINK = [
|
|
46
|
+
'sr-only focus:not-sr-only focus:fixed focus:top-4 focus:left-4 focus:z-50 focus:px-4 focus:py-3',
|
|
47
|
+
'rounded-full bg-foreground text-sm font-semibold text-background',
|
|
48
|
+
'outline-none focus-visible:ring-[3px] focus-visible:ring-ring focus-visible:ring-offset-2',
|
|
49
|
+
'focus-visible:ring-offset-background',
|
|
50
|
+
].join(' ');
|
|
51
|
+
/**
|
|
52
|
+
* Sheet entries are LINKS, exactly as the section menu's are — a real `href` keeps each one
|
|
53
|
+
* focusable, openable in a new tab and announced as a link — and each row is a 44px touch target.
|
|
54
|
+
*/
|
|
55
|
+
export const ENTRY = [
|
|
56
|
+
'flex min-h-11 items-center gap-2 rounded-md px-3 text-sm font-medium text-foreground',
|
|
57
|
+
'hover:bg-accent hover:text-accent-foreground',
|
|
58
|
+
'outline-none focus-visible:ring-[3px] focus-visible:ring-ring',
|
|
59
|
+
].join(' ');
|
|
60
|
+
//# sourceMappingURL=consts.local.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.local.js","sourceRoot":"","sources":["../../../src/components/nav/consts.local.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,+BAA+B,CAAA;AAExD;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,kGAAkG,CAAA;AAExH,MAAM,CAAC,MAAM,YAAY,GAAG,kCAAkC,CAAA;AAE9D;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,0DAA0D;IAC1D,wBAAwB;IACxB,2CAA2C;IAC3C,0DAA0D;IAC1D,6FAA6F;IAC7F,+FAA+F;IAC/F,iFAAiF;IACjF,oFAAoF;IACpF,gBAAgB;CACjB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAEX;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iGAAiG;IACjG,kEAAkE;IAClE,2FAA2F;IAC3F,sCAAsC;CACvC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,sFAAsF;IACtF,8CAA8C;IAC9C,+DAA+D;CAChE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/nav/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,YAAY,CAAA;AAE/B,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/nav/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,YAAY,CAAA;AAE/B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/nav/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/nav/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA"}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type FC } from 'react';
|
|
2
2
|
import type { NavLayoutProps } from './types.js';
|
|
3
3
|
/**
|
|
4
4
|
* The standard two-layer application shell.
|
|
5
5
|
*
|
|
6
|
-
* A layout entrypoint
|
|
6
|
+
* A layout entrypoint binds a component that renders this and nothing else — the screen
|
|
7
7
|
* arrives as `children`. The side menu is mounted twice on purpose: one column for wide
|
|
8
8
|
* viewports and one strip for narrow ones. Both render only when the active section has
|
|
9
9
|
* more than one screen, so the single-screen case costs nothing but the elements' absence.
|
|
10
|
+
*
|
|
11
|
+
* `mobileMenu` swaps the narrow viewport's navigation for a menu button and a sheet holding
|
|
12
|
+
* both levels: the section menu hides below `md`, and the strip is not mounted at all, because
|
|
13
|
+
* the sheet already lists the screens it would show. Wide viewports are unaffected either way.
|
|
14
|
+
*
|
|
15
|
+
* The skip link comes FIRST in the root, ahead of the header — the first thing a keyboard reaches
|
|
16
|
+
* — and moves focus to `<main id="main">`, past the brand, the menus and the actions.
|
|
10
17
|
*/
|
|
11
18
|
export declare const NavLayout: FC<NavLayoutProps>;
|
|
12
19
|
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../src/components/nav/layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../src/components/nav/layout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,EAAE,EAAmB,MAAM,OAAO,CAAA;AAUxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAGhD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAgLxC,CAAA"}
|
|
@@ -1,22 +1,63 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from 'react';
|
|
2
3
|
import { useNavigate } from '@owlmeans/client';
|
|
3
|
-
import {
|
|
4
|
+
import { navLabelHelper } from '@owlmeans/client-panel';
|
|
5
|
+
import { cn } from '../../@/lib/utils.js';
|
|
4
6
|
import { Footer } from '../footer/component.js';
|
|
7
|
+
import { useWideNav } from './viewport.js';
|
|
8
|
+
import { MobileNav } from './mobile.js';
|
|
5
9
|
import { SideNav } from './side.js';
|
|
6
10
|
import { TopNav } from './top.js';
|
|
11
|
+
import { CONTAINER, SKIP_LINK } from './consts.local.js';
|
|
7
12
|
/**
|
|
8
13
|
* The standard two-layer application shell.
|
|
9
14
|
*
|
|
10
|
-
* A layout entrypoint
|
|
15
|
+
* A layout entrypoint binds a component that renders this and nothing else — the screen
|
|
11
16
|
* arrives as `children`. The side menu is mounted twice on purpose: one column for wide
|
|
12
17
|
* viewports and one strip for narrow ones. Both render only when the active section has
|
|
13
18
|
* more than one screen, so the single-screen case costs nothing but the elements' absence.
|
|
19
|
+
*
|
|
20
|
+
* `mobileMenu` swaps the narrow viewport's navigation for a menu button and a sheet holding
|
|
21
|
+
* both levels: the section menu hides below `md`, and the strip is not mounted at all, because
|
|
22
|
+
* the sheet already lists the screens it would show. Wide viewports are unaffected either way.
|
|
23
|
+
*
|
|
24
|
+
* The skip link comes FIRST in the root, ahead of the header — the first thing a keyboard reaches
|
|
25
|
+
* — and moves focus to `<main id="main">`, past the brand, the menus and the actions.
|
|
14
26
|
*/
|
|
15
|
-
export const NavLayout = ({ nav, translate, title, home, actions, footer, children, className, style, contentClassName }) => {
|
|
27
|
+
export const NavLayout = ({ nav, translate = navLabelHelper.defaultNavTranslate, title, home, actions, footer, children, className, style, headerClassName, contentClassName, containerClassName, mobileMenu = false, skipLinkLabel, themeToggle, navTestId }) => {
|
|
16
28
|
const navigator = useNavigate();
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
29
|
+
const wide = useWideNav();
|
|
30
|
+
// The switcher's names go through `translate` like every other shell string, with the caller's
|
|
31
|
+
// own labels winning; `false`/absent stays absent, so the footer renders exactly as it did.
|
|
32
|
+
const toggle = themeToggle == null || themeToggle === false
|
|
33
|
+
? undefined
|
|
34
|
+
: {
|
|
35
|
+
labels: {
|
|
36
|
+
toLight: (themeToggle === true ? undefined : themeToggle.labels?.toLight) ??
|
|
37
|
+
translate('shell.toLight', 'Switch to light mode'),
|
|
38
|
+
toDark: (themeToggle === true ? undefined : themeToggle.labels?.toDark) ??
|
|
39
|
+
translate('shell.toDark', 'Switch to dark mode')
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const toggleProp = toggle != null ? { themeToggle: toggle } : {};
|
|
43
|
+
const main = useRef(null);
|
|
44
|
+
const skipLabel = skipLinkLabel === false ? null : (skipLinkLabel ?? translate('shell.skip', 'Skip to content'));
|
|
45
|
+
// Focus is moved by hand rather than left to the fragment navigation `href="#main"` would
|
|
46
|
+
// perform: that changes the location, and the router reads a location change as navigation.
|
|
47
|
+
// The `href` stays so the link is a link — focusable, announced, and working without script.
|
|
48
|
+
const skip = (event) => {
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
main.current?.focus();
|
|
51
|
+
};
|
|
52
|
+
const brandAlias = home ?? nav.sections.find((section) => section.items.length > 0)?.items[0]?.alias;
|
|
53
|
+
// MERGED over the default, never substituted for it. `containerClassName` is how a design
|
|
54
|
+
// adjusts ONE aspect of the rhythm — almost always the width — and a caller passing
|
|
55
|
+
// `max-w-[1280px]` means "wider", not "no padding and no centring". Substituting dropped
|
|
56
|
+
// `px-4` and `mx-auto` along with the width it replaced, which is a page whose header,
|
|
57
|
+
// content and footer all run flush to the window edge. tailwind-merge keeps the override
|
|
58
|
+
// winning on the utility it names and leaves the rest of the rhythm standing, so a width-only
|
|
59
|
+
// value stays a width-only change; `px-8` still overrides the padding when that is the intent.
|
|
60
|
+
const container = cn(CONTAINER, containerClassName);
|
|
61
|
+
return (_jsxs("div", { className: cn('flex min-h-screen flex-col bg-background text-foreground', className), style: style, children: [skipLabel != null && (_jsx("a", { href: "#main", onClick: skip, "data-skip-link": true, className: SKIP_LINK, children: skipLabel })), _jsxs("header", { className: cn('sticky top-0 z-40 isolate border-b bg-background text-foreground', headerClassName), children: [_jsxs("div", { className: cn('flex h-14 items-center gap-6', container), children: [title != null ? (_jsx("a", { onClick: brandAlias != null ? navigator.press(brandAlias) : undefined, className: cn('brand flex items-center gap-2 text-lg font-semibold', brandAlias != null && 'cursor-pointer'), children: title })) : null, (!mobileMenu || wide) && (_jsx(TopNav, { config: nav, translate: translate, ariaLabel: "Sections", testId: navTestId, className: mobileMenu ? 'hidden md:flex' : undefined })), _jsxs("div", { className: "ml-auto flex items-center gap-2", children: [actions, mobileMenu && !wide && (_jsx(MobileNav, { config: nav, translate: translate, ariaLabel: "Sections", className: "md:hidden" }))] })] }), !mobileMenu && (_jsx(SideNav, { config: nav, translate: translate, variant: "bar", ariaLabel: "Screens", className: "md:hidden" })), _jsx("div", { "aria-hidden": "true", "data-nav-backdrop": true, className: "absolute inset-0 -z-10 bg-background pointer-events-none" })] }), _jsxs("div", { className: "flex flex-1", children: [_jsx(SideNav, { config: nav, translate: translate, variant: "side", ariaLabel: "Screens", className: "hidden md:block" }), _jsx("main", { ref: main, ...(skipLabel != null ? { id: 'main', tabIndex: -1 } : {}), className: cn('flex-1 py-8 outline-none', contentClassName), children: _jsx("div", { className: cn(container), children: children }) })] }), Array.isArray(footer) ? (_jsx(Footer, { links: footer, translate: translate, containerClassName: container, ...toggleProp })) : footer != null ? (_jsx(Footer, { containerClassName: container, content: footer, ...toggleProp })) : (_jsx(Footer, { containerClassName: container, ...toggleProp }))] }));
|
|
21
62
|
};
|
|
22
63
|
//# sourceMappingURL=layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../src/components/nav/layout.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../src/components/nav/layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAA4B,MAAM,OAAO,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,EAAE,EAAE,EAAE,MAAM,sBAAsB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAExD;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,SAAS,GAAuB,CAAC,EAC5C,GAAG,EACH,SAAS,GAAG,cAAc,CAAC,mBAAmB,EAC9C,KAAK,EACL,IAAI,EACJ,OAAO,EACP,MAAM,EACN,QAAQ,EACR,SAAS,EACT,KAAK,EACL,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,GAAG,KAAK,EAClB,aAAa,EACb,WAAW,EACX,SAAS,EACV,EAAE,EAAE;IACH,MAAM,SAAS,GAAG,WAAW,EAAE,CAAA;IAC/B,MAAM,IAAI,GAAG,UAAU,EAAE,CAAA;IACzB,+FAA+F;IAC/F,4FAA4F;IAC5F,MAAM,MAAM,GACV,WAAW,IAAI,IAAI,IAAI,WAAW,KAAK,KAAK;QAC1C,CAAC,CAAC,SAAS;QACX,CAAC,CAAC;YACE,MAAM,EAAE;gBACN,OAAO,EACL,CAAC,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CA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6BACc,MAAM,6BAElB,SAAS,EAAC,0DAA0D,GACpE,IACK,EACT,eAAK,SAAS,EAAC,aAAa,aAC1B,KAAC,OAAO,IAAC,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAC,MAAM,EAAC,SAAS,EAAC,SAAS,EAAC,SAAS,EAAC,iBAAiB,GAAG,EAM7G,eACE,GAAG,EAAE,IAAI,KACL,CAAC,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAC3D,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,gBAAgB,CAAC,YAE3D,cAAK,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,YAAG,QAAQ,GAAO,GAC1C,IACH,EAWL,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CACvB,KAAC,MAAM,IAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,kBAAkB,EAAE,SAAS,KAAM,UAAU,GAAI,CAC/F,CAAC,CAAC,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,CACnB,KAAC,MAAM,IAAC,kBAAkB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,KAAM,UAAU,GAAI,CAC3E,CAAC,CAAC,CAAC,CACF,KAAC,MAAM,IAAC,kBAAkB,EAAE,SAAS,KAAM,UAAU,GAAI,CAC1D,IACG,CACP,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import type { MobileNavProps } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Both navigation levels behind one menu button — what a narrow viewport gets instead of the
|
|
5
|
+
* section menu.
|
|
6
|
+
*
|
|
7
|
+
* The sheet lists every section; a section holding more than one screen lists its screens under
|
|
8
|
+
* the section's name, and a single-screen section is one link carrying the section's own label —
|
|
9
|
+
* the same rule the side menu follows, so a destination never appears twice. Labels resolve
|
|
10
|
+
* exactly as `TopNav` and `SideNav` resolve theirs (`nav.<section>`, `modules.<alias>`), through
|
|
11
|
+
* the same `translate` prop.
|
|
12
|
+
*
|
|
13
|
+
* Pressing an entry navigates in-app AND closes the sheet. Both happen in the anchor's own click
|
|
14
|
+
* handler: the `preventDefault()` that stops a full page load is not something a dialog notices,
|
|
15
|
+
* so a sheet left to close itself would stay open over the screen it just navigated to.
|
|
16
|
+
*
|
|
17
|
+
* `className` and `style` land on the TRIGGER — the only element the sheet places in the host's
|
|
18
|
+
* flow; the sheet itself is portalled to the document body.
|
|
19
|
+
*/
|
|
20
|
+
export declare const MobileNav: FC<MobileNavProps>;
|
|
21
|
+
//# sourceMappingURL=mobile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobile.d.ts","sourceRoot":"","sources":["../../../src/components/nav/mobile.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,EAAE,EAAmB,MAAM,OAAO,CAAA;AAOjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAGhD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAyIxC,CAAA"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId, useState } from 'react';
|
|
3
|
+
import { MenuIcon, XIcon } from 'lucide-react';
|
|
4
|
+
import { usePanelNav, navLabelHelper } from '@owlmeans/client-panel';
|
|
5
|
+
import { cn } from '../../@/lib/utils.js';
|
|
6
|
+
import { Button } from '../../@/components/ui/button.js';
|
|
7
|
+
import { Sheet, SheetClose, SheetContent, SheetTitle, SheetTrigger } from '../../@/components/ui/sheet.js';
|
|
8
|
+
import { ENTRY_ACTIVE, TARGET, ENTRY } from './consts.local.js';
|
|
9
|
+
/**
|
|
10
|
+
* Both navigation levels behind one menu button — what a narrow viewport gets instead of the
|
|
11
|
+
* section menu.
|
|
12
|
+
*
|
|
13
|
+
* The sheet lists every section; a section holding more than one screen lists its screens under
|
|
14
|
+
* the section's name, and a single-screen section is one link carrying the section's own label —
|
|
15
|
+
* the same rule the side menu follows, so a destination never appears twice. Labels resolve
|
|
16
|
+
* exactly as `TopNav` and `SideNav` resolve theirs (`nav.<section>`, `modules.<alias>`), through
|
|
17
|
+
* the same `translate` prop.
|
|
18
|
+
*
|
|
19
|
+
* Pressing an entry navigates in-app AND closes the sheet. Both happen in the anchor's own click
|
|
20
|
+
* handler: the `preventDefault()` that stops a full page load is not something a dialog notices,
|
|
21
|
+
* so a sheet left to close itself would stay open over the screen it just navigated to.
|
|
22
|
+
*
|
|
23
|
+
* `className` and `style` land on the TRIGGER — the only element the sheet places in the host's
|
|
24
|
+
* flow; the sheet itself is portalled to the document body.
|
|
25
|
+
*/
|
|
26
|
+
export const MobileNav = ({ config, translate = navLabelHelper.defaultNavTranslate, ariaLabel, className, style }) => {
|
|
27
|
+
const model = usePanelNav(config);
|
|
28
|
+
const [open, setOpen] = useState(false);
|
|
29
|
+
const id = useId();
|
|
30
|
+
if (model.sections.length < 1) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
// Keys outside the `nav.` family on purpose: `nav.<name>` addresses a SECTION, and an
|
|
34
|
+
// application is free to have a section called `menu`.
|
|
35
|
+
const label = translate('shell.menu', 'Menu');
|
|
36
|
+
const closeLabel = translate('shell.close', 'Close');
|
|
37
|
+
const follow = (go) => (event) => {
|
|
38
|
+
event.preventDefault();
|
|
39
|
+
setOpen(false);
|
|
40
|
+
go();
|
|
41
|
+
};
|
|
42
|
+
return (_jsxs(Sheet, { open: open, onOpenChange: setOpen, children: [_jsx(SheetTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon", "aria-label": label, "data-nav-menu-trigger": true, className: cn(TARGET, className), style: style, children: _jsx(MenuIcon, { className: "size-6", "aria-hidden": "true" }) }) }), _jsxs(SheetContent, { side: "right", showCloseButton: false, "aria-describedby": undefined, "data-nav-sheet": true, className: "gap-0 p-0 text-foreground", children: [_jsxs("div", { className: "flex h-14 shrink-0 items-center justify-between border-b pl-4 pr-2", children: [_jsx(SheetTitle, { className: "text-base", children: label }), _jsx(SheetClose, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon", "aria-label": closeLabel, className: TARGET, children: _jsx(XIcon, { className: "size-5", "aria-hidden": "true" }) }) })] }), _jsx("nav", { "aria-label": ariaLabel, className: "flex-1 overflow-y-auto p-2", children: _jsx("ul", { className: "flex flex-col gap-1", children: model.sections.map((section) => {
|
|
43
|
+
const sectionLabel = navLabelHelper.resolveNavLabel(translate, section.label, `nav.${section.name}`, section.name);
|
|
44
|
+
if (section.items.length > 1) {
|
|
45
|
+
const heading = `${id}-${section.name}`;
|
|
46
|
+
return (_jsxs("li", { className: "pt-2", children: [_jsx("p", { id: heading, className: cn('px-3 pb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground', model.isSectionActive(section) && 'text-foreground'), children: sectionLabel }), _jsx("ul", { "aria-labelledby": heading, className: "flex flex-col gap-1", children: section.items.map((item) => {
|
|
47
|
+
const active = model.isItemActive(item);
|
|
48
|
+
return (_jsx("li", { children: _jsxs("a", { "data-testid": item.testId, href: model.hrefOf(item), onClick: follow(model.goItem(item)), "aria-current": active ? 'page' : undefined, className: cn(ENTRY, active && ENTRY_ACTIVE), children: [item.Icon != null ? _jsx(item.Icon, { className: "size-4" }) : null, navLabelHelper.resolveNavLabel(translate, item.label, `modules.${item.alias}`, item.alias)] }) }, item.alias));
|
|
49
|
+
}) })] }, section.name));
|
|
50
|
+
}
|
|
51
|
+
const active = model.isSectionActive(section);
|
|
52
|
+
return (_jsx("li", { children: _jsx("a", { "data-testid": section.testId, href: model.hrefOf(section), onClick: follow(model.goSection(section)), "aria-current": active ? 'page' : undefined, className: cn(ENTRY, active && ENTRY_ACTIVE), children: sectionLabel }) }, section.name));
|
|
53
|
+
}) }) })] })] }));
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=mobile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobile.js","sourceRoot":"","sources":["../../../src/components/nav/mobile.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAA4B,MAAM,OAAO,CAAA;AACjE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACpE,OAAO,EAAE,EAAE,EAAE,MAAM,sBAAsB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AACxD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAG1G,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE/D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,SAAS,GAAuB,CAAC,EAC5C,MAAM,EACN,SAAS,GAAG,cAAc,CAAC,mBAAmB,EAC9C,SAAS,EACT,SAAS,EACT,KAAK,EACN,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC,CAAA;IACjC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IACvC,MAAM,EAAE,GAAG,KAAK,EAAE,CAAA;IAElB,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAA;IACb,CAAC;IAED,sFAAsF;IACtF,uDAAuD;IACvD,MAAM,KAAK,GAAG,SAAS,CAAC,YAAY,EAAE,MAAM,CAAC,C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CE,OAAO,CAAC,IAAI,CAmChB,CACN,CAAA;gCACH,CAAC;gCAED,MAAM,MAAM,GAAG,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,CAAA;gCAE7C,OAAO,CACL,uBACE,2BACe,OAAO,CAAC,MAAM,EAC3B,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,EAC3B,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,kBAC3B,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EACzC,SAAS,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,IAAI,YAAY,CAAC,YAE3C,YAAY,GACX,IATG,OAAO,CAAC,IAAI,CAUhB,CACN,CAAA;4BACH,CAAC,CAAC,GACC,GACD,IACO,IACT,CACT,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"side.d.ts","sourceRoot":"","sources":["../../../src/components/nav/side.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"side.d.ts","sourceRoot":"","sources":["../../../src/components/nav/side.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAM/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CAoDpC,CAAA"}
|