@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 @@
|
|
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../../src/components/picker/text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAKjE,MAAM,OAAO,GAAoB,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAA;AAE7D,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAU,EAAE;IACxC,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IAErC,OAAO,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACtE,CAAC,CAAA;AAED,yGAAyG;AACzG,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,SAAS,GAAoB,OAAO,EAAc,EAAE;IACjF,MAAM,IAAI,GAAG,CAAC,GAAW,EAAE,QAAgB,EAAU,EAAE,CAAC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AAI,KAAK,MAAM,IAAI,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI;SAC7D,CAAC,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,IAAI,IAAI,IAAI,CAAC,CAAA;QAEhD,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IACpD,CAAC,CAAA;IAED,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAA;AAC/D,CAAC,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { IconTileProps } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* A stored mark rendered — the way a list, a chip or a header shows what a person chose.
|
|
5
|
+
*
|
|
6
|
+
* `tile` puts the icon in the colour's ink on the colour's ground; `plain` is the ink alone. Both
|
|
7
|
+
* follow the page's scheme on their own (`.dark`, or the system's dark unless `.light`). An unknown
|
|
8
|
+
* icon renders the fallback circle and an unknown colour slate — a stored value never breaks a page.
|
|
9
|
+
*/
|
|
10
|
+
export declare const IconTile: FC<IconTileProps>;
|
|
11
|
+
//# sourceMappingURL=tile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tile.d.ts","sourceRoot":"","sources":["../../../src/components/picker/tile.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAK/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAG/C;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAmBtC,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../../@/lib/utils.js';
|
|
3
|
+
import { pickerIconHelper } from '../../picker/icons.js';
|
|
4
|
+
import { pickerColorHelper } from '../../picker/vocabulary.js';
|
|
5
|
+
import { PICKER_FALLBACK_ICON } from '../../picker/vocabulary/consts.js';
|
|
6
|
+
import { PICK_SCOPE, PLAIN, PLAIN_SIZE, TILE, TILE_SIZE } from './consts.local.js';
|
|
7
|
+
/**
|
|
8
|
+
* A stored mark rendered — the way a list, a chip or a header shows what a person chose.
|
|
9
|
+
*
|
|
10
|
+
* `tile` puts the icon in the colour's ink on the colour's ground; `plain` is the ink alone. Both
|
|
11
|
+
* follow the page's scheme on their own (`.dark`, or the system's dark unless `.light`). An unknown
|
|
12
|
+
* icon renders the fallback circle and an unknown colour slate — a stored value never breaks a page.
|
|
13
|
+
*/
|
|
14
|
+
export const IconTile = ({ icon, color, colors, size = 'md', variant = 'tile', label, className, style }) => {
|
|
15
|
+
const Icon = pickerIconHelper.iconOf(icon);
|
|
16
|
+
const resolved = pickerColorHelper.resolve(color, colors);
|
|
17
|
+
return _jsx("span", { "data-icon-tile": variant, "data-icon": pickerIconHelper.has(icon) ? icon : PICKER_FALLBACK_ICON, "data-color": resolved?.key, role: label != null ? 'img' : undefined, "aria-label": label, "aria-hidden": label != null ? undefined : true, title: label, style: { ...pickerColorHelper.styleOf(color, colors), ...style }, className: cn(PICK_SCOPE, variant === 'tile' ? TILE : PLAIN, variant === 'tile' ? TILE_SIZE[size] : PLAIN_SIZE[size], className), children: _jsx(Icon, { "aria-hidden": "true" }) });
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=tile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tile.js","sourceRoot":"","sources":["../../../src/components/picker/tile.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,sBAAsB,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE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IAAI,CAAC,EAAE,SAAS,CAAC,YAEhI,KAAC,IAAI,mBAAa,MAAM,GAAG,GACtB,CAAA;AACT,CAAC,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PickerTranslate } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* A `translate` reading the picker's own library bundle (`lib:picker`, eight languages) in the
|
|
4
|
+
* current language — what an application rendered by `PanelApp` / `render()` passes to every picker
|
|
5
|
+
* part. It needs that i18n instance: called anywhere without one it throws inside render, which is
|
|
6
|
+
* exactly why no picker part calls it by itself. Missing keys fall back to the English text.
|
|
7
|
+
*/
|
|
8
|
+
export declare const usePickerTranslate: () => PickerTranslate;
|
|
9
|
+
//# sourceMappingURL=translate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translate.d.ts","sourceRoot":"","sources":["../../../src/components/picker/translate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,QAAO,eAIrC,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { useI18nLib } from '@owlmeans/client-i18n';
|
|
3
|
+
/**
|
|
4
|
+
* A `translate` reading the picker's own library bundle (`lib:picker`, eight languages) in the
|
|
5
|
+
* current language — what an application rendered by `PanelApp` / `render()` passes to every picker
|
|
6
|
+
* part. It needs that i18n instance: called anywhere without one it throws inside render, which is
|
|
7
|
+
* exactly why no picker part calls it by itself. Missing keys fall back to the English text.
|
|
8
|
+
*/
|
|
9
|
+
export const usePickerTranslate = () => {
|
|
10
|
+
const t = useI18nLib('picker');
|
|
11
|
+
return useCallback((key, fallback) => t(key, { defaultValue: fallback }), [t]);
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=translate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translate.js","sourceRoot":"","sources":["../../../src/components/picker/translate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAGlD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAoB,EAAE;IACtD,MAAM,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAA;IAE9B,OAAO,WAAW,CAAkB,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;AACjG,CAAC,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { PickerTriggerProps } from './types.local.js';
|
|
3
|
+
/**
|
|
4
|
+
* What opens a picker: a field-like button (the mark, its names, a chevron) or the mark alone.
|
|
5
|
+
*
|
|
6
|
+
* It is the popover's anchor and stays mounted in one place whichever surface opens, so focus has
|
|
7
|
+
* one element to return to. Its accessible name is the label and the current choice ("Mark:
|
|
8
|
+
* Rocket · Indigo"); it carries `data-picker-trigger`, never `data-slot="button"` or `data-tone`.
|
|
9
|
+
* Extra props — the popover anchor's — land on the button.
|
|
10
|
+
*/
|
|
11
|
+
export declare const PickerTrigger: FC<PickerTriggerProps>;
|
|
12
|
+
//# sourceMappingURL=trigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger.d.ts","sourceRoot":"","sources":["../../../src/components/picker/trigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAI/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAM1D;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAmChD,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronDownIcon, PlusIcon } from 'lucide-react';
|
|
3
|
+
import { cn } from '../../@/lib/utils.js';
|
|
4
|
+
import { pickerColorHelper } from '../../picker/vocabulary.js';
|
|
5
|
+
import { IconTile } from './tile.js';
|
|
6
|
+
import { CHEVRON, HAIRLINE, TRIGGER_BUTTON, TRIGGER_COMPACT, TRIGGER_DISC, TRIGGER_DOT, TRIGGER_EMPTY, } from './consts.local.js';
|
|
7
|
+
/**
|
|
8
|
+
* What opens a picker: a field-like button (the mark, its names, a chevron) or the mark alone.
|
|
9
|
+
*
|
|
10
|
+
* It is the popover's anchor and stays mounted in one place whichever surface opens, so focus has
|
|
11
|
+
* one element to return to. Its accessible name is the label and the current choice ("Mark:
|
|
12
|
+
* Rocket · Indigo"); it carries `data-picker-trigger`, never `data-slot="button"` or `data-tone`.
|
|
13
|
+
* Extra props — the popover anchor's — land on the button.
|
|
14
|
+
*/
|
|
15
|
+
export const PickerTrigger = ({ ref, mode, variant, icon, color, colors, text, label, placeholder, open, disabled, id, className, onOpen, ...anchor }) => {
|
|
16
|
+
const resolved = pickerColorHelper.resolve(color, colors);
|
|
17
|
+
const summary = text.summary(icon, resolved, mode);
|
|
18
|
+
const name = label != null && label !== '' ? `${label}: ${summary ?? placeholder}` : summary ?? placeholder;
|
|
19
|
+
const empty = summary == null;
|
|
20
|
+
const mark = mode === 'color'
|
|
21
|
+
? empty
|
|
22
|
+
? _jsx("span", { "aria-hidden": "true", className: cn(TRIGGER_EMPTY, 'rounded-full', variant === 'dot' && 'size-5') })
|
|
23
|
+
: _jsx("span", { "aria-hidden": "true", style: pickerColorHelper.styleOf(color, colors), className: cn(TRIGGER_DISC, HAIRLINE, variant === 'dot' && 'size-5') })
|
|
24
|
+
: empty
|
|
25
|
+
? _jsx("span", { "aria-hidden": "true", className: cn(TRIGGER_EMPTY, variant === 'tile' && 'size-full rounded-lg'), children: _jsx(PlusIcon, {}) })
|
|
26
|
+
: _jsx(IconTile, { icon: icon, color: color, colors: colors, size: variant === 'tile' ? 'md' : 'sm', className: variant === 'tile' ? 'size-full' : undefined });
|
|
27
|
+
return _jsxs("button", { ...anchor, ref: ref, type: "button", id: id, disabled: disabled, "data-picker-trigger": variant, "aria-haspopup": "dialog", "aria-expanded": open, "aria-label": name, title: variant === 'button' ? undefined : name, onClick: onOpen, className: cn(variant === 'button' ? TRIGGER_BUTTON : TRIGGER_COMPACT, variant === 'dot' && TRIGGER_DOT, className), children: [variant === 'button' && mode === 'color' ? _jsx("span", { className: "inline-flex size-7 shrink-0 items-center justify-center", children: mark }) : mark, variant === 'button' && _jsxs(_Fragment, { children: [_jsx("span", { className: cn('min-w-0 flex-1 truncate', empty && 'text-muted-foreground'), children: summary ?? placeholder }), _jsx(ChevronDownIcon, { "aria-hidden": "true", className: CHEVRON })] })] });
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=trigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger.js","sourceRoot":"","sources":["../../../src/components/picker/trigger.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,EAAE,EAAE,EAAE,MAAM,sBAAsB,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAE9D,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EACL,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,GAC7F,MAAM,mBAAmB,CAAA;AAE1B;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GAA2B,CAAC,EACpD,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,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,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,GAAI,CAAA;IAE7J,OAAO,qBACD,MAAM,EACV,GAAG,EAAE,GAAG,EAAE,IAAI,EAAC,QAAQ,EAAC,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,yBAC7B,OAAO,mBAAgB,QAAQ,mBAAgB,IAAI,gBAAc,IAAI,EAC1F,KAAK,EAAE,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,EAC9C,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,EAAE,CACX,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,eAAe,EAAE,OAAO,KAAK,KAAK,IAAI,WAAW,EAAE,SAAS,CACrG,aAEA,OAAO,KAAK,QAAQ,IAAI,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,yDAAyD,YAAE,IAAI,GAAQ,CAAC,CAAC,CAAC,IAAI,EACzI,OAAO,KAAK,QAAQ,IAAI,8BACvB,eAAM,SAAS,EAAE,EAAE,CAAC,yBAAyB,EAAE,KAAK,IAAI,uBAAuB,CAAC,YAAG,OAAO,IAAI,WAAW,GAAQ,EACjH,KAAC,eAAe,mBAAa,MAAM,EAAC,SAAS,EAAE,OAAO,GAAI,IACzD,IACI,CAAA;AACX,CAAC,CAAA"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import type { PickerColor } from '../../picker/vocabulary/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves a picker string: the key (`done`, `colors.indigo`, `categories.work` …) and the English
|
|
5
|
+
* text to show without a translation. `usePickerTranslate()` gives one reading the packaged
|
|
6
|
+
* eight-language bundle; without one the parts render English.
|
|
7
|
+
*/
|
|
8
|
+
export interface PickerTranslate {
|
|
9
|
+
(key: string, fallback: string): string;
|
|
10
|
+
}
|
|
11
|
+
/** Where a picker opens: `auto` — a popover from 768px up, a bottom sheet below (decided when it opens). */
|
|
12
|
+
export type PickerSurfaceChoice = 'auto' | 'popover' | 'sheet';
|
|
13
|
+
/** What the three pickers share. */
|
|
14
|
+
export interface PickerBaseProps {
|
|
15
|
+
/** The trigger's accessible name and the surface's title. */
|
|
16
|
+
label?: string;
|
|
17
|
+
/** The trigger's text while nothing is chosen. */
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
surface?: PickerSurfaceChoice;
|
|
21
|
+
/** Strings; English without it. Never an implicit i18n read — the parts render without a provider. */
|
|
22
|
+
translate?: PickerTranslate;
|
|
23
|
+
/** Merged over the trigger's classes. */
|
|
24
|
+
className?: string;
|
|
25
|
+
/** Lands on the trigger button, so a `<label htmlFor>` names it. */
|
|
26
|
+
id?: string;
|
|
27
|
+
}
|
|
28
|
+
/** A stored mark: a palette key or `#rrggbb`, and a kebab-case lucide name. Either may be missing. */
|
|
29
|
+
export interface IconColorValue {
|
|
30
|
+
icon?: string | null;
|
|
31
|
+
color?: string | null;
|
|
32
|
+
}
|
|
33
|
+
/** What `IconColorPicker` emits: both halves as they now stand; an unset half stays `undefined`, never `null`. */
|
|
34
|
+
export interface IconColorChange {
|
|
35
|
+
icon?: string;
|
|
36
|
+
color?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface IconColorPickerProps extends PickerBaseProps {
|
|
39
|
+
value?: IconColorValue | null;
|
|
40
|
+
onChange: (next: IconColorChange) => void;
|
|
41
|
+
/** The palette offered; default the 24 colours. */
|
|
42
|
+
colors?: readonly PickerColor[];
|
|
43
|
+
/** Narrows the icon catalogue (and orders it). */
|
|
44
|
+
icons?: readonly string[];
|
|
45
|
+
/** Adds the full colour wheel and a hex field; the value is then a palette key or `#rrggbb`. */
|
|
46
|
+
customColors?: boolean;
|
|
47
|
+
/** `button` (default) — tile, names and a chevron; `tile` — the tile alone. */
|
|
48
|
+
trigger?: 'button' | 'tile';
|
|
49
|
+
}
|
|
50
|
+
export interface IconPickerProps extends PickerBaseProps {
|
|
51
|
+
value?: string | null;
|
|
52
|
+
onChange: (icon: string) => void;
|
|
53
|
+
/** The colour the icons are tinted in. */
|
|
54
|
+
color?: string | null;
|
|
55
|
+
colors?: readonly PickerColor[];
|
|
56
|
+
icons?: readonly string[];
|
|
57
|
+
trigger?: 'button' | 'tile';
|
|
58
|
+
}
|
|
59
|
+
export interface ColorPickerProps extends PickerBaseProps {
|
|
60
|
+
value?: string | null;
|
|
61
|
+
onChange: (color: string) => void;
|
|
62
|
+
colors?: readonly PickerColor[];
|
|
63
|
+
customColors?: boolean;
|
|
64
|
+
/** `button` (default) — dot, name and a chevron; `dot` — the dot alone. */
|
|
65
|
+
trigger?: 'button' | 'dot';
|
|
66
|
+
}
|
|
67
|
+
/** The swatch grid on its own, for a dialog or sheet the application already owns. */
|
|
68
|
+
export interface ColorSwatchesProps {
|
|
69
|
+
value?: string | null;
|
|
70
|
+
onChange: (color: string) => void;
|
|
71
|
+
colors?: readonly PickerColor[];
|
|
72
|
+
customColors?: boolean;
|
|
73
|
+
translate?: PickerTranslate;
|
|
74
|
+
/** The group's accessible name; default "Colour". */
|
|
75
|
+
label?: string;
|
|
76
|
+
className?: string;
|
|
77
|
+
}
|
|
78
|
+
/** The searchable icon grid on its own, for a dialog or sheet the application already owns. */
|
|
79
|
+
export interface IconGridProps {
|
|
80
|
+
value?: string | null;
|
|
81
|
+
onChange: (icon: string) => void;
|
|
82
|
+
/** The colour the icons are tinted in. */
|
|
83
|
+
color?: string | null;
|
|
84
|
+
colors?: readonly PickerColor[];
|
|
85
|
+
icons?: readonly string[];
|
|
86
|
+
translate?: PickerTranslate;
|
|
87
|
+
/** The grid's accessible name; default "Icon". */
|
|
88
|
+
label?: string;
|
|
89
|
+
className?: string;
|
|
90
|
+
}
|
|
91
|
+
export type PickerTileSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
92
|
+
/** A stored mark rendered: the icon in the colour's ink on its ground (`tile`), or the ink alone (`plain`). */
|
|
93
|
+
export interface IconTileProps {
|
|
94
|
+
icon?: string | null;
|
|
95
|
+
color?: string | null;
|
|
96
|
+
colors?: readonly PickerColor[];
|
|
97
|
+
size?: PickerTileSize;
|
|
98
|
+
variant?: 'tile' | 'plain';
|
|
99
|
+
/** Present — an image with this name; absent — decorative (`aria-hidden`). */
|
|
100
|
+
label?: string;
|
|
101
|
+
className?: string;
|
|
102
|
+
style?: CSSProperties;
|
|
103
|
+
}
|
|
104
|
+
export type PickerDotSize = 'xs' | 'sm' | 'md';
|
|
105
|
+
/** A stored colour rendered as a dot in its ink. */
|
|
106
|
+
export interface ColorDotProps {
|
|
107
|
+
color?: string | null;
|
|
108
|
+
colors?: readonly PickerColor[];
|
|
109
|
+
size?: PickerDotSize;
|
|
110
|
+
/** Present — an image with this name; absent — decorative (`aria-hidden`). */
|
|
111
|
+
label?: string;
|
|
112
|
+
className?: string;
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/picker/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAEnE;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAAG,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE;AAE5E,4GAA4G;AAC5G,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAA;AAE9D,oCAAoC;AACpC,MAAM,WAAW,eAAe;IAC9B,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kDAAkD;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IAAI,CAAA;AAEtD,+GAA+G;AAC/G,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,MAAM,CAAC,EAAE,SAAS,WAAW,EAAE,CAAA;IAC/B,IAAI,CAAC,EAAE,cAAc,CAAA;IACrB,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IAC1B,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB;AAED,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAE9C,oDAAoD;AACpD,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,MAAM,CAAC,EAAE,SAAS,WAAW,EAAE,CAAA;IAC/B,IAAI,CAAC,EAAE,aAAa,CAAA;IACpB,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/picker/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import type { ComponentProps, KeyboardEvent, ReactElement, ReactNode, Ref, RefObject } from 'react';
|
|
2
|
+
import type { PickerColor, PickerIconCategory, ResolvedPickerColor } from '../../picker/vocabulary/types.js';
|
|
3
|
+
import type { PickerTranslate } from './types.js';
|
|
4
|
+
/** Where a panel is laid out — it decides cell sizes and paddings. */
|
|
5
|
+
export type PickerLayout = 'popover' | 'sheet' | 'inline';
|
|
6
|
+
/** Which halves a picker edits. */
|
|
7
|
+
export type PickerMode = 'both' | 'icon' | 'color';
|
|
8
|
+
/** Every string a picker shows, resolved through one `translate`. */
|
|
9
|
+
export interface PickerText {
|
|
10
|
+
/** A chrome string by key, English fallback. */
|
|
11
|
+
text: (key: string, fallback: string) => string;
|
|
12
|
+
/** A colour's name: a palette name through `colors.<key>`, a custom colour's hex as is. */
|
|
13
|
+
color: (color: ResolvedPickerColor) => string;
|
|
14
|
+
/** An icon's name — the kebab name humanized; icon names are never translated. */
|
|
15
|
+
icon: (name: string) => string;
|
|
16
|
+
category: (category: PickerIconCategory) => string;
|
|
17
|
+
/** "Icons found: 12" for the live region. */
|
|
18
|
+
count: (count: number) => string;
|
|
19
|
+
/** "No icons match …". */
|
|
20
|
+
empty: (query: string) => string;
|
|
21
|
+
/** "Rocket · Indigo", or `null` while nothing is chosen. */
|
|
22
|
+
summary: (icon: string | null | undefined, color: ResolvedPickerColor | null, mode: PickerMode) => string | null;
|
|
23
|
+
}
|
|
24
|
+
/** Arrow-key focus across a grid of buttons; only one of them is in the tab order. */
|
|
25
|
+
export interface RovingGrid {
|
|
26
|
+
ref: RefObject<HTMLDivElement | null>;
|
|
27
|
+
onKeyDown: (event: KeyboardEvent<HTMLElement>) => void;
|
|
28
|
+
/** `0` for the one item in the tab order, `-1` for the rest. */
|
|
29
|
+
tabIndexOf: (index: number) => number;
|
|
30
|
+
/** Remember an item as the current one (it took focus). */
|
|
31
|
+
setCurrent: (index: number) => void;
|
|
32
|
+
/** Focus the current item. */
|
|
33
|
+
focusCurrent: () => void;
|
|
34
|
+
}
|
|
35
|
+
export interface RovingGridOptions {
|
|
36
|
+
count: number;
|
|
37
|
+
/** The item that starts in the tab order — the selected one. */
|
|
38
|
+
selected: number;
|
|
39
|
+
/** ArrowUp from the first row: hand focus back (the search field above a grid). */
|
|
40
|
+
onExitUp?: () => void;
|
|
41
|
+
/** `false` — one row, Left/Right only. */
|
|
42
|
+
grid?: boolean;
|
|
43
|
+
}
|
|
44
|
+
export interface SwatchGridProps {
|
|
45
|
+
value?: string | null;
|
|
46
|
+
/** A swatch was pressed. */
|
|
47
|
+
onChange: (color: string) => void;
|
|
48
|
+
/** The custom wheel or hex field changed; default `onChange`. A picker that closes on a pick keeps this open. */
|
|
49
|
+
onCustomChange?: (color: string) => void;
|
|
50
|
+
colors: readonly PickerColor[];
|
|
51
|
+
customColors: boolean;
|
|
52
|
+
text: PickerText;
|
|
53
|
+
layout: PickerLayout;
|
|
54
|
+
label: string;
|
|
55
|
+
className?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface CustomColorProps {
|
|
58
|
+
/** The current value when it is a custom colour, else `null`. */
|
|
59
|
+
value: ResolvedPickerColor | null;
|
|
60
|
+
onChange: (color: string) => void;
|
|
61
|
+
text: PickerText;
|
|
62
|
+
}
|
|
63
|
+
export interface IconBrowserProps {
|
|
64
|
+
value?: string | null;
|
|
65
|
+
onChange: (icon: string) => void;
|
|
66
|
+
color?: string | null;
|
|
67
|
+
colors: readonly PickerColor[];
|
|
68
|
+
icons?: readonly string[];
|
|
69
|
+
text: PickerText;
|
|
70
|
+
layout: PickerLayout;
|
|
71
|
+
label: string;
|
|
72
|
+
/** The search field — the surface focuses it on open for a fine pointer. */
|
|
73
|
+
searchRef?: Ref<HTMLInputElement>;
|
|
74
|
+
className?: string;
|
|
75
|
+
}
|
|
76
|
+
export interface PickerPanelProps {
|
|
77
|
+
mode: PickerMode;
|
|
78
|
+
icon?: string | null;
|
|
79
|
+
color?: string | null;
|
|
80
|
+
onIcon: (icon: string) => void;
|
|
81
|
+
/** A swatch was pressed. */
|
|
82
|
+
onColor: (color: string) => void;
|
|
83
|
+
/** The custom wheel or hex field changed. */
|
|
84
|
+
onCustomColor: (color: string) => void;
|
|
85
|
+
colors: readonly PickerColor[];
|
|
86
|
+
icons?: readonly string[];
|
|
87
|
+
customColors: boolean;
|
|
88
|
+
text: PickerText;
|
|
89
|
+
layout: 'popover' | 'sheet';
|
|
90
|
+
title: string;
|
|
91
|
+
/** The sheet's Done button; the popover has none. */
|
|
92
|
+
onDone?: () => void;
|
|
93
|
+
searchRef: Ref<HTMLInputElement>;
|
|
94
|
+
}
|
|
95
|
+
export interface PickerSurfaceProps {
|
|
96
|
+
open: boolean;
|
|
97
|
+
onOpenChange: (open: boolean) => void;
|
|
98
|
+
kind: 'popover' | 'sheet';
|
|
99
|
+
/** Holds an icon grid — keep one height so filtering never makes the surface jump. */
|
|
100
|
+
tall: boolean;
|
|
101
|
+
/** The trigger — the popover's anchor, kept in the same place in the tree for both surfaces. */
|
|
102
|
+
anchor: ReactElement;
|
|
103
|
+
title: string;
|
|
104
|
+
/** Focus on open (the search field for a fine pointer, the selected cell otherwise). */
|
|
105
|
+
onOpenFocus: (content: HTMLElement) => void;
|
|
106
|
+
/** Focus back on the trigger once closed. */
|
|
107
|
+
onCloseFocus: () => void;
|
|
108
|
+
children: ReactNode;
|
|
109
|
+
}
|
|
110
|
+
/** The trigger's own props; anything else (the popover anchor's) lands on the button. */
|
|
111
|
+
export interface PickerTriggerProps extends Omit<ComponentProps<'button'>, 'color' | 'onClick' | 'type' | 'children'> {
|
|
112
|
+
mode: PickerMode;
|
|
113
|
+
variant: 'button' | 'tile' | 'dot';
|
|
114
|
+
icon?: string | null;
|
|
115
|
+
color?: string | null;
|
|
116
|
+
colors: readonly PickerColor[];
|
|
117
|
+
text: PickerText;
|
|
118
|
+
label?: string;
|
|
119
|
+
placeholder: string;
|
|
120
|
+
open: boolean;
|
|
121
|
+
onOpen: () => void;
|
|
122
|
+
}
|
|
123
|
+
export interface PickerRootProps {
|
|
124
|
+
mode: PickerMode;
|
|
125
|
+
icon?: string | null;
|
|
126
|
+
color?: string | null;
|
|
127
|
+
onIcon: (icon: string) => void;
|
|
128
|
+
onColor: (color: string) => void;
|
|
129
|
+
colors?: readonly PickerColor[];
|
|
130
|
+
icons?: readonly string[];
|
|
131
|
+
customColors?: boolean;
|
|
132
|
+
trigger: 'button' | 'tile' | 'dot';
|
|
133
|
+
/** A single-purpose picker closes once something is picked; the composite stays for the other half. */
|
|
134
|
+
closeOnPick: boolean;
|
|
135
|
+
label?: string;
|
|
136
|
+
placeholder?: string;
|
|
137
|
+
disabled?: boolean;
|
|
138
|
+
surface?: 'auto' | 'popover' | 'sheet';
|
|
139
|
+
translate?: PickerTranslate;
|
|
140
|
+
className?: string;
|
|
141
|
+
id?: string;
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=types.local.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.local.d.ts","sourceRoot":"","sources":["../../../src/components/picker/types.local.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACnG,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AAC5G,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD,sEAAsE;AACtE,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAA;AAEzD,mCAAmC;AACnC,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;AAElD,qEAAqE;AACrE,MAAM,WAAW,UAAU;IACzB,gDAAgD;IAChD,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAA;IAC/C,2FAA2F;IAC3F,KAAK,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,MAAM,CAAA;IAC7C,kFAAkF;IAClF,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;IAC9B,QAAQ,EAAE,CAAC,QAAQ,EAAE,kBAAkB,KAAK,MAAM,CAAA;IAClD,6CAA6C;IAC7C,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IAChC,0BAA0B;IAC1B,KAAK,EAAE,CAAC,KAAK,EAAE,MAA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,GAAG,IAAI,CAAA;IACrB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9B,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,MAAM,CAAC,EAAE,SAAS,WAAW,EAAE,CAAA;IAC/B,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACzB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,OAAO,EAAE,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAA;IAClC,uGAAuG;IACvG,WAAW,EAAE,OAAO,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAA;IACtC,SAAS,CAAC,EAAE,eAAe,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.local.js","sourceRoot":"","sources":["../../../src/components/picker/types.local.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const DARK_QUERY = "(prefers-color-scheme: dark)";
|
|
2
|
+
/**
|
|
3
|
+
* A 44px round target in the page's own tokens — muted at rest, the foreground on hover — with
|
|
4
|
+
* the 3px ring every interactive element shows on keyboard focus. No fill, border, gradient or
|
|
5
|
+
* shadow: it sits in a footer's bottom row beside the credit and must read as part of it.
|
|
6
|
+
*/
|
|
7
|
+
export declare const TOGGLE: string;
|
|
8
|
+
//# sourceMappingURL=consts.local.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.local.d.ts","sourceRoot":"","sources":["../../../src/components/scheme/consts.local.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,iCAAiC,CAAA;AAExD;;;;GAIG;AACH,eAAO,MAAM,MAAM,QAKR,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const DARK_QUERY = '(prefers-color-scheme: dark)';
|
|
2
|
+
/**
|
|
3
|
+
* A 44px round target in the page's own tokens — muted at rest, the foreground on hover — with
|
|
4
|
+
* the 3px ring every interactive element shows on keyboard focus. No fill, border, gradient or
|
|
5
|
+
* shadow: it sits in a footer's bottom row beside the credit and must read as part of it.
|
|
6
|
+
*/
|
|
7
|
+
export const TOGGLE = [
|
|
8
|
+
'inline-flex size-11 shrink-0 cursor-pointer items-center justify-center rounded-full',
|
|
9
|
+
'bg-transparent text-muted-foreground transition-colors hover:text-foreground',
|
|
10
|
+
'outline-none focus-visible:ring-[3px] focus-visible:ring-ring focus-visible:ring-offset-2',
|
|
11
|
+
'focus-visible:ring-offset-background',
|
|
12
|
+
].join(' ');
|
|
13
|
+
//# sourceMappingURL=consts.local.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.local.js","sourceRoot":"","sources":["../../../src/components/scheme/consts.local.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,8BAA8B,CAAA;AAExD;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,sFAAsF;IACtF,8EAA8E;IAC9E,2FAA2F;IAC3F,sCAAsC;CACvC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ColorSchemeModel } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The page's colour scheme, and the way to choose one.
|
|
4
|
+
*
|
|
5
|
+
* Both halves are read synchronously on the first render — the stored choice from storage, the
|
|
6
|
+
* system preference from `matchMedia` — so a toggle never renders the wrong icon for a frame.
|
|
7
|
+
* Afterwards it follows three sources: `applyColorScheme` anywhere in this document (its event),
|
|
8
|
+
* another tab changing the stored key (`storage`), and the operating system switching while no
|
|
9
|
+
* choice is stored.
|
|
10
|
+
*
|
|
11
|
+
* Mounting also re-applies a stored choice's class. The head bootstrap has normally done that
|
|
12
|
+
* before the first paint; an application without it still ends up on the right scheme, one frame
|
|
13
|
+
* late rather than never.
|
|
14
|
+
*/
|
|
15
|
+
export declare const useColorScheme: () => ColorSchemeModel;
|
|
16
|
+
//# sourceMappingURL=hook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/components/scheme/hook.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAOlD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc,QAAO,gBAqCjC,CAAA"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import { colorSchemeHelper } from '../../scheme/scheme.js';
|
|
3
|
+
import { COLOR_SCHEME_EVENT, COLOR_SCHEME_KEY } from '../../scheme/consts.js';
|
|
4
|
+
import { DARK_QUERY } from './consts.local.js';
|
|
5
|
+
const systemDark = () => typeof window !== 'undefined' && typeof window.matchMedia === 'function'
|
|
6
|
+
&& window.matchMedia(DARK_QUERY).matches;
|
|
7
|
+
/**
|
|
8
|
+
* The page's colour scheme, and the way to choose one.
|
|
9
|
+
*
|
|
10
|
+
* Both halves are read synchronously on the first render — the stored choice from storage, the
|
|
11
|
+
* system preference from `matchMedia` — so a toggle never renders the wrong icon for a frame.
|
|
12
|
+
* Afterwards it follows three sources: `applyColorScheme` anywhere in this document (its event),
|
|
13
|
+
* another tab changing the stored key (`storage`), and the operating system switching while no
|
|
14
|
+
* choice is stored.
|
|
15
|
+
*
|
|
16
|
+
* Mounting also re-applies a stored choice's class. The head bootstrap has normally done that
|
|
17
|
+
* before the first paint; an application without it still ends up on the right scheme, one frame
|
|
18
|
+
* late rather than never.
|
|
19
|
+
*/
|
|
20
|
+
export const useColorScheme = () => {
|
|
21
|
+
const [choice, setState] = useState(colorSchemeHelper.readColorScheme);
|
|
22
|
+
const [dark, setDark] = useState(systemDark);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
const stored = colorSchemeHelper.readColorScheme();
|
|
25
|
+
if (stored != null) {
|
|
26
|
+
colorSchemeHelper.setColorSchemeClass(stored);
|
|
27
|
+
}
|
|
28
|
+
setState(stored);
|
|
29
|
+
const onChoice = () => setState(colorSchemeHelper.readColorScheme());
|
|
30
|
+
const onStorage = (event) => {
|
|
31
|
+
if (event.key === COLOR_SCHEME_KEY || event.key == null) {
|
|
32
|
+
const next = colorSchemeHelper.readColorScheme();
|
|
33
|
+
colorSchemeHelper.setColorSchemeClass(next);
|
|
34
|
+
setState(next);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
window.addEventListener(COLOR_SCHEME_EVENT, onChoice);
|
|
38
|
+
window.addEventListener('storage', onStorage);
|
|
39
|
+
const media = typeof window.matchMedia === 'function' ? window.matchMedia(DARK_QUERY) : null;
|
|
40
|
+
const onSystem = () => setDark(media?.matches === true);
|
|
41
|
+
media?.addEventListener('change', onSystem);
|
|
42
|
+
onSystem();
|
|
43
|
+
return () => {
|
|
44
|
+
window.removeEventListener(COLOR_SCHEME_EVENT, onChoice);
|
|
45
|
+
window.removeEventListener('storage', onStorage);
|
|
46
|
+
media?.removeEventListener('change', onSystem);
|
|
47
|
+
};
|
|
48
|
+
}, []);
|
|
49
|
+
const setChoice = useCallback((next) => colorSchemeHelper.applyColorScheme(next), []);
|
|
50
|
+
return { scheme: choice ?? (dark ? 'dark' : 'light'), choice, setChoice };
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=hook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook.js","sourceRoot":"","sources":["../../../src/components/scheme/hook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM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CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/scheme/index.ts"],"names":[],"mappings":"AAEA,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { ThemeToggleProps } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* The light/dark switcher.
|
|
5
|
+
*
|
|
6
|
+
* It flips the RESOLVED scheme, not the stored choice: on a system that prefers dark and with no
|
|
7
|
+
* choice stored, the page is dark, so the first press means "light" — a toggle keyed on the
|
|
8
|
+
* choice alone would answer that press with "dark", which changes nothing the visitor can see.
|
|
9
|
+
* The icon is the scheme the page is in (a sun while light, a moon while dark), chosen in script
|
|
10
|
+
* from the same state rather than by a `dark:` variant, so it is right whatever the app's CSS
|
|
11
|
+
* calls dark. The accessible name says what pressing does, from `labels` or the English default.
|
|
12
|
+
*/
|
|
13
|
+
export declare const ThemeToggle: FC<ThemeToggleProps>;
|
|
14
|
+
//# sourceMappingURL=toggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../../src/components/scheme/toggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAI/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAGlD;;;;;;;;;GASG;AACH,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAc5C,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Moon, Sun } from 'lucide-react';
|
|
3
|
+
import { cn } from '../../@/lib/utils.js';
|
|
4
|
+
import { useColorScheme } from './hook.js';
|
|
5
|
+
import { TOGGLE } from './consts.local.js';
|
|
6
|
+
/**
|
|
7
|
+
* The light/dark switcher.
|
|
8
|
+
*
|
|
9
|
+
* It flips the RESOLVED scheme, not the stored choice: on a system that prefers dark and with no
|
|
10
|
+
* choice stored, the page is dark, so the first press means "light" — a toggle keyed on the
|
|
11
|
+
* choice alone would answer that press with "dark", which changes nothing the visitor can see.
|
|
12
|
+
* The icon is the scheme the page is in (a sun while light, a moon while dark), chosen in script
|
|
13
|
+
* from the same state rather than by a `dark:` variant, so it is right whatever the app's CSS
|
|
14
|
+
* calls dark. The accessible name says what pressing does, from `labels` or the English default.
|
|
15
|
+
*/
|
|
16
|
+
export const ThemeToggle = ({ labels, className, style }) => {
|
|
17
|
+
const { scheme, setChoice } = useColorScheme();
|
|
18
|
+
const dark = scheme === 'dark';
|
|
19
|
+
const label = dark
|
|
20
|
+
? labels?.toLight ?? 'Switch to light mode'
|
|
21
|
+
: labels?.toDark ?? 'Switch to dark mode';
|
|
22
|
+
return _jsx("button", { type: "button", "data-theme-toggle": true, "data-scheme": scheme, "aria-label": label, title: label, onClick: () => setChoice(dark ? 'light' : 'dark'), className: cn(TOGGLE, className), style: style, children: dark ? _jsx(Moon, { className: "size-5", "aria-hidden": "true" }) : _jsx(Sun, { className: "size-5", "aria-hidden": "true" }) });
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=toggle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle.js","sourceRoot":"","sources":["../../../src/components/scheme/toggle.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,EAAE,EAAE,MAAM,sBAAsB,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAE1C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE1C;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,WAAW,GAAyB,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE;IAChF,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,cAAc,EAAE,CAAA;IAC9C,MAAM,IAAI,GAAG,MAAM,KAAK,MAAM,CAAA;IAC9B,MAAM,KAAK,GAAG,IAAI;QAChB,CAAC,CAAC,MAAM,EAAE,OAAO,IAAI,sBAAsB;QAC3C,CAAC,CAAC,MAAM,EAAE,MAAM,IAAI,qBAAqB,CAAA;IAE3C,OAAO,iBACL,IAAI,EAAC,QAAQ,4CAAgC,MAAM,gBAAc,KAAK,EAAE,KAAK,EAAE,KAAK,EACpF,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,EACjD,SAAS,EAAE,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,YAE7C,IAAI,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,SAAS,EAAC,QAAQ,iBAAa,MAAM,GAAG,CAAC,CAAC,CAAC,KAAC,GAAG,IAAC,SAAS,EAAC,QAAQ,iBAAa,MAAM,GAAG,GAC/F,CAAA;AACX,CAAC,CAAA"}
|