@blimu/react 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +552 -0
- package/dist/_virtual/index.cjs +2 -0
- package/dist/_virtual/index.cjs.map +1 -0
- package/dist/_virtual/index.js +6 -0
- package/dist/_virtual/index.js.map +1 -0
- package/dist/_virtual/index2.cjs +2 -0
- package/dist/_virtual/index2.cjs.map +1 -0
- package/dist/_virtual/index2.js +5 -0
- package/dist/_virtual/index2.js.map +1 -0
- package/dist/_virtual/use-sync-external-store-shim.development.cjs +2 -0
- package/dist/_virtual/use-sync-external-store-shim.development.cjs.map +1 -0
- package/dist/_virtual/use-sync-external-store-shim.development.js +5 -0
- package/dist/_virtual/use-sync-external-store-shim.development.js.map +1 -0
- package/dist/_virtual/use-sync-external-store-shim.production.cjs +2 -0
- package/dist/_virtual/use-sync-external-store-shim.production.cjs.map +1 -0
- package/dist/_virtual/use-sync-external-store-shim.production.js +5 -0
- package/dist/_virtual/use-sync-external-store-shim.production.js.map +1 -0
- package/dist/client/auth.service.cjs +2 -0
- package/dist/client/auth.service.cjs.map +1 -0
- package/dist/client/auth.service.d.ts +50 -0
- package/dist/client/auth.service.d.ts.map +1 -0
- package/dist/client/auth.service.js +153 -0
- package/dist/client/auth.service.js.map +1 -0
- package/dist/client/auth.service.test-service.d.ts +39 -0
- package/dist/client/auth.service.test-service.d.ts.map +1 -0
- package/dist/client/external-store.cjs +2 -0
- package/dist/client/external-store.cjs.map +1 -0
- package/dist/client/external-store.d.ts +20 -0
- package/dist/client/external-store.d.ts.map +1 -0
- package/dist/client/external-store.js +13 -0
- package/dist/client/external-store.js.map +1 -0
- package/dist/client/runtime-client.cjs +2 -0
- package/dist/client/runtime-client.cjs.map +1 -0
- package/dist/client/runtime-client.d.ts +49 -0
- package/dist/client/runtime-client.d.ts.map +1 -0
- package/dist/client/runtime-client.js +103 -0
- package/dist/client/runtime-client.js.map +1 -0
- package/dist/components/index.d.ts +11 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/members-list.cjs +2 -0
- package/dist/components/members-list.cjs.map +1 -0
- package/dist/components/members-list.d.ts +70 -0
- package/dist/components/members-list.d.ts.map +1 -0
- package/dist/components/members-list.js +111 -0
- package/dist/components/members-list.js.map +1 -0
- package/dist/components/redirect-to-sign-in.cjs +2 -0
- package/dist/components/redirect-to-sign-in.cjs.map +1 -0
- package/dist/components/redirect-to-sign-in.d.ts +39 -0
- package/dist/components/redirect-to-sign-in.d.ts.map +1 -0
- package/dist/components/redirect-to-sign-in.js +27 -0
- package/dist/components/redirect-to-sign-in.js.map +1 -0
- package/dist/components/sign-in-button/styles.d.ts +7 -0
- package/dist/components/sign-in-button/styles.d.ts.map +1 -0
- package/dist/components/sign-in-button.cjs +2 -0
- package/dist/components/sign-in-button.cjs.map +1 -0
- package/dist/components/sign-in-button.d.ts +47 -0
- package/dist/components/sign-in-button.d.ts.map +1 -0
- package/dist/components/sign-in-button.js +33 -0
- package/dist/components/sign-in-button.js.map +1 -0
- package/dist/components/ui/avatar.cjs +2 -0
- package/dist/components/ui/avatar.cjs.map +1 -0
- package/dist/components/ui/avatar.d.ts +7 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar.js +43 -0
- package/dist/components/ui/avatar.js.map +1 -0
- package/dist/components/ui/badge.d.ts +10 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.cjs +2 -0
- package/dist/components/ui/dropdown-menu.cjs.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +28 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.js +130 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/popover.d.ts +8 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/user-avatar/styles.d.ts +7 -0
- package/dist/components/user-avatar/styles.d.ts.map +1 -0
- package/dist/components/user-avatar.cjs +2 -0
- package/dist/components/user-avatar.cjs.map +1 -0
- package/dist/components/user-avatar.d.ts +41 -0
- package/dist/components/user-avatar.d.ts.map +1 -0
- package/dist/components/user-avatar.js +23 -0
- package/dist/components/user-avatar.js.map +1 -0
- package/dist/components/user-button/styles.cjs +2 -0
- package/dist/components/user-button/styles.cjs.map +1 -0
- package/dist/components/user-button/styles.d.ts +17 -0
- package/dist/components/user-button/styles.d.ts.map +1 -0
- package/dist/components/user-button/styles.js +39 -0
- package/dist/components/user-button/styles.js.map +1 -0
- package/dist/components/user-button/user-button.cjs +2 -0
- package/dist/components/user-button/user-button.cjs.map +1 -0
- package/dist/components/user-button/user-button.d.ts +15 -0
- package/dist/components/user-button/user-button.d.ts.map +1 -0
- package/dist/components/user-button/user-button.js +93 -0
- package/dist/components/user-button/user-button.js.map +1 -0
- package/dist/components.cjs +2 -0
- package/dist/components.cjs.map +1 -0
- package/dist/components.js +13 -0
- package/dist/components.js.map +1 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/use-auth.cjs +2 -0
- package/dist/hooks/use-auth.cjs.map +1 -0
- package/dist/hooks/use-auth.d.ts +92 -0
- package/dist/hooks/use-auth.d.ts.map +1 -0
- package/dist/hooks/use-auth.js +41 -0
- package/dist/hooks/use-auth.js.map +1 -0
- package/dist/hooks/use-client.cjs +2 -0
- package/dist/hooks/use-client.cjs.map +1 -0
- package/dist/hooks/use-client.d.ts +27 -0
- package/dist/hooks/use-client.d.ts.map +1 -0
- package/dist/hooks/use-client.js +9 -0
- package/dist/hooks/use-client.js.map +1 -0
- package/dist/hooks/use-members.cjs +2 -0
- package/dist/hooks/use-members.cjs.map +1 -0
- package/dist/hooks/use-members.d.ts +50 -0
- package/dist/hooks/use-members.d.ts.map +1 -0
- package/dist/hooks/use-members.js +49 -0
- package/dist/hooks/use-members.js.map +1 -0
- package/dist/hooks/use-store.cjs +2 -0
- package/dist/hooks/use-store.cjs.map +1 -0
- package/dist/hooks/use-store.d.ts +24 -0
- package/dist/hooks/use-store.d.ts.map +1 -0
- package/dist/hooks/use-store.js +18 -0
- package/dist/hooks/use-store.js.map +1 -0
- package/dist/hooks.cjs +2 -0
- package/dist/hooks.cjs.map +1 -0
- package/dist/hooks.js +14 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/utils.cjs +2 -0
- package/dist/lib/utils.cjs.map +1 -0
- package/dist/lib/utils.d.ts +7 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +9 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/variants.cjs +2 -0
- package/dist/lib/variants.cjs.map +1 -0
- package/dist/lib/variants.d.ts +37 -0
- package/dist/lib/variants.d.ts.map +1 -0
- package/dist/lib/variants.js +46 -0
- package/dist/lib/variants.js.map +1 -0
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.cjs +2 -0
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.cjs.map +1 -0
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +528 -0
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js.map +1 -0
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.cjs +2 -0
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.cjs.map +1 -0
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +403 -0
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js.map +1 -0
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs +2 -0
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs.map +1 -0
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +209 -0
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js.map +1 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.cjs +2 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.cjs.map +1 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.cjs +2 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.cjs.map +1 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +137 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +1 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +131 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js.map +1 -0
- package/dist/node_modules/@radix-ui/primitive/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/primitive/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/primitive/dist/index.js +10 -0
- package/dist/node_modules/@radix-ui/primitive/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +25 -0
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-avatar/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-avatar/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +76 -0
- package/dist/node_modules/@radix-ui/react-avatar/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-context/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-context/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-context/dist/index.js +56 -0
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-context/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-primitive/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-primitive/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-primitive/dist/index.js +33 -0
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-primitive/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-slot/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-slot/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-slot/dist/index.js +59 -0
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-collection/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-collection/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-collection/dist/index.js +51 -0
- package/dist/node_modules/@radix-ui/react-collection/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +30 -0
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-context/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-context/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-context/dist/index.js +54 -0
- package/dist/node_modules/@radix-ui/react-context/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-direction/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-direction/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-direction/dist/index.js +11 -0
- package/dist/node_modules/@radix-ui/react-direction/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +128 -0
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +215 -0
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +18 -0
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +137 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-id/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-id/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-id/dist/index.js +14 -0
- package/dist/node_modules/@radix-ui/react-id/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-menu/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-menu/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-menu/dist/index.js +609 -0
- package/dist/node_modules/@radix-ui/react-menu/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-popper/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-popper/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js +220 -0
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-portal/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-portal/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-portal/dist/index.js +16 -0
- package/dist/node_modules/@radix-ui/react-portal/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-presence/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-presence/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js +71 -0
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +37 -0
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +184 -0
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-slot/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-slot/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +11 -0
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +53 -0
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +15 -0
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +16 -0
- package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +7 -0
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +28 -0
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.js.map +1 -0
- package/dist/node_modules/aria-hidden/dist/es2015/index.cjs +2 -0
- package/dist/node_modules/aria-hidden/dist/es2015/index.cjs.map +1 -0
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +53 -0
- package/dist/node_modules/aria-hidden/dist/es2015/index.js.map +1 -0
- package/dist/node_modules/class-variance-authority/dist/index.cjs +2 -0
- package/dist/node_modules/class-variance-authority/dist/index.cjs.map +1 -0
- package/dist/node_modules/class-variance-authority/dist/index.js +36 -0
- package/dist/node_modules/class-variance-authority/dist/index.js.map +1 -0
- package/dist/node_modules/clsx/dist/clsx.cjs +2 -0
- package/dist/node_modules/clsx/dist/clsx.cjs.map +1 -0
- package/dist/node_modules/clsx/dist/clsx.js +18 -0
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
- package/dist/node_modules/get-nonce/dist/es2015/index.cjs +2 -0
- package/dist/node_modules/get-nonce/dist/es2015/index.cjs.map +1 -0
- package/dist/node_modules/get-nonce/dist/es2015/index.js +8 -0
- package/dist/node_modules/get-nonce/dist/es2015/index.js.map +1 -0
- package/dist/node_modules/js-cookie/dist/js.cookie.cjs +2 -0
- package/dist/node_modules/js-cookie/dist/js.cookie.cjs.map +1 -0
- package/dist/node_modules/js-cookie/dist/js.cookie.js +74 -0
- package/dist/node_modules/js-cookie/dist/js.cookie.js.map +1 -0
- package/dist/node_modules/jwt-decode/build/esm/index.cjs +2 -0
- package/dist/node_modules/jwt-decode/build/esm/index.cjs.map +1 -0
- package/dist/node_modules/jwt-decode/build/esm/index.js +53 -0
- package/dist/node_modules/jwt-decode/build/esm/index.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/Icon.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/Icon.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/Icon.js +36 -0
- package/dist/node_modules/lucide-react/dist/esm/Icon.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +22 -0
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/check.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/check.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/check.js +7 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/check.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.js +7 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle.js +7 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/log-out.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/log-out.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/log-out.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/log-out.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +19 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js.map +1 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.cjs +2 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.cjs.map +1 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +12 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js.map +1 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.cjs +5 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.cjs.map +1 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +116 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js.map +1 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.cjs +2 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.cjs.map +1 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +32 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js.map +1 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.cjs +2 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.cjs.map +1 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +17 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js.map +1 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.cjs +2 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.cjs.map +1 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +69 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js.map +1 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/medium.cjs +2 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/medium.cjs.map +1 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +6 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js.map +1 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.cjs +2 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.cjs.map +1 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +8 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js.map +1 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.cjs +39 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.cjs.map +1 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +72 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js.map +1 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.cjs +2 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.cjs.map +1 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +8 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js.map +1 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.cjs +2 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.cjs.map +1 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +26 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js.map +1 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/component.cjs +2 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/component.cjs.map +1 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/component.js +12 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/component.js.map +1 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.cjs +2 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.cjs.map +1 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +16 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.js.map +1 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.cjs +2 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.cjs.map +1 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +31 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js.map +1 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.cjs +2 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.cjs.map +1 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +2766 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
- package/dist/node_modules/tailwindcss/dist/plugin.cjs +2 -0
- package/dist/node_modules/tailwindcss/dist/plugin.cjs.map +1 -0
- package/dist/node_modules/tailwindcss/dist/plugin.js +14 -0
- package/dist/node_modules/tailwindcss/dist/plugin.js.map +1 -0
- package/dist/node_modules/tslib/tslib.es6.cjs +2 -0
- package/dist/node_modules/tslib/tslib.es6.cjs.map +1 -0
- package/dist/node_modules/tslib/tslib.es6.js +28 -0
- package/dist/node_modules/tslib/tslib.es6.js.map +1 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.cjs +2 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.cjs.map +1 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +7 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js.map +1 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.cjs +2 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.cjs.map +1 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +27 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js.map +1 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.cjs +2 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.cjs.map +1 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +26 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js.map +1 -0
- package/dist/node_modules/use-sidecar/dist/es2015/exports.cjs +2 -0
- package/dist/node_modules/use-sidecar/dist/es2015/exports.cjs.map +1 -0
- package/dist/node_modules/use-sidecar/dist/es2015/exports.js +19 -0
- package/dist/node_modules/use-sidecar/dist/es2015/exports.js.map +1 -0
- package/dist/node_modules/use-sidecar/dist/es2015/medium.cjs +2 -0
- package/dist/node_modules/use-sidecar/dist/es2015/medium.cjs.map +1 -0
- package/dist/node_modules/use-sidecar/dist/es2015/medium.js +68 -0
- package/dist/node_modules/use-sidecar/dist/es2015/medium.js.map +1 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.cjs +2 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.cjs.map +1 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +59 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +1 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.cjs +2 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.cjs.map +1 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +47 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +1 -0
- package/dist/node_modules/use-sync-external-store/shim/index.cjs +2 -0
- package/dist/node_modules/use-sync-external-store/shim/index.cjs.map +1 -0
- package/dist/node_modules/use-sync-external-store/shim/index.js +11 -0
- package/dist/node_modules/use-sync-external-store/shim/index.js.map +1 -0
- package/dist/providers/auth/auth.context.cjs +2 -0
- package/dist/providers/auth/auth.context.cjs.map +1 -0
- package/dist/providers/auth/auth.context.d.ts +3 -0
- package/dist/providers/auth/auth.context.d.ts.map +1 -0
- package/dist/providers/auth/auth.context.js +6 -0
- package/dist/providers/auth/auth.context.js.map +1 -0
- package/dist/providers/auth/auth.hook.cjs +2 -0
- package/dist/providers/auth/auth.hook.cjs.map +1 -0
- package/dist/providers/auth/auth.hook.d.ts +7 -0
- package/dist/providers/auth/auth.hook.d.ts.map +1 -0
- package/dist/providers/auth/auth.hook.js +12 -0
- package/dist/providers/auth/auth.hook.js.map +1 -0
- package/dist/providers/auth/auth.provider.cjs +2 -0
- package/dist/providers/auth/auth.provider.cjs.map +1 -0
- package/dist/providers/auth/auth.provider.d.ts +7 -0
- package/dist/providers/auth/auth.provider.d.ts.map +1 -0
- package/dist/providers/auth/auth.provider.js +29 -0
- package/dist/providers/auth/auth.provider.js.map +1 -0
- package/dist/providers/blimu/blimu.context.cjs +2 -0
- package/dist/providers/blimu/blimu.context.cjs.map +1 -0
- package/dist/providers/blimu/blimu.context.d.ts +27 -0
- package/dist/providers/blimu/blimu.context.d.ts.map +1 -0
- package/dist/providers/blimu/blimu.context.js +6 -0
- package/dist/providers/blimu/blimu.context.js.map +1 -0
- package/dist/providers/blimu/blimu.hook.cjs +2 -0
- package/dist/providers/blimu/blimu.hook.cjs.map +1 -0
- package/dist/providers/blimu/blimu.hook.d.ts +19 -0
- package/dist/providers/blimu/blimu.hook.d.ts.map +1 -0
- package/dist/providers/blimu/blimu.hook.js +12 -0
- package/dist/providers/blimu/blimu.hook.js.map +1 -0
- package/dist/providers/blimu/blimu.provider.cjs +2 -0
- package/dist/providers/blimu/blimu.provider.cjs.map +1 -0
- package/dist/providers/blimu/blimu.provider.d.ts +47 -0
- package/dist/providers/blimu/blimu.provider.d.ts.map +1 -0
- package/dist/providers/blimu/blimu.provider.js +67 -0
- package/dist/providers/blimu/blimu.provider.js.map +1 -0
- package/dist/providers/index.d.ts +7 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/theme/index.d.ts +4 -0
- package/dist/providers/theme/index.d.ts.map +1 -0
- package/dist/providers/theme/theme.context.cjs +2 -0
- package/dist/providers/theme/theme.context.cjs.map +1 -0
- package/dist/providers/theme/theme.context.d.ts +8 -0
- package/dist/providers/theme/theme.context.d.ts.map +1 -0
- package/dist/providers/theme/theme.context.js +6 -0
- package/dist/providers/theme/theme.context.js.map +1 -0
- package/dist/providers/theme/theme.hook.cjs +2 -0
- package/dist/providers/theme/theme.hook.cjs.map +1 -0
- package/dist/providers/theme/theme.hook.d.ts +18 -0
- package/dist/providers/theme/theme.hook.d.ts.map +1 -0
- package/dist/providers/theme/theme.hook.js +12 -0
- package/dist/providers/theme/theme.hook.js.map +1 -0
- package/dist/providers/theme/theme.provider.cjs +2 -0
- package/dist/providers/theme/theme.provider.cjs.map +1 -0
- package/dist/providers/theme/theme.provider.d.ts +28 -0
- package/dist/providers/theme/theme.provider.d.ts.map +1 -0
- package/dist/providers/theme/theme.provider.js +68 -0
- package/dist/providers/theme/theme.provider.js.map +1 -0
- package/dist/providers.cjs +2 -0
- package/dist/providers.cjs.map +1 -0
- package/dist/providers.js +13 -0
- package/dist/providers.js.map +1 -0
- package/dist/styles/styles.css +1351 -0
- package/dist/styles/tw-styles.css +120 -0
- package/dist/tailwind.plugin.cjs +2 -0
- package/dist/tailwind.plugin.cjs.map +1 -0
- package/dist/tailwind.plugin.d.ts +19 -0
- package/dist/tailwind.plugin.d.ts.map +1 -0
- package/dist/tailwind.plugin.js +200 -0
- package/dist/tailwind.plugin.js.map +1 -0
- package/dist/types/index.cjs +2 -0
- package/dist/types/index.cjs.map +1 -0
- package/dist/types/index.d.ts +128 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +12 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/publishable-key.cjs +2 -0
- package/dist/utils/publishable-key.cjs.map +1 -0
- package/dist/utils/publishable-key.d.ts +38 -0
- package/dist/utils/publishable-key.d.ts.map +1 -0
- package/dist/utils/publishable-key.js +38 -0
- package/dist/utils/publishable-key.js.map +1 -0
- package/package.json +128 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { BlimuRuntimeClientWrapper } from '../../client/runtime-client';
|
|
2
|
+
import type { AuthState, BlimuConfig } from '../../types';
|
|
3
|
+
import type { Theme } from '../theme/theme.context';
|
|
4
|
+
export interface AppearanceConfig {
|
|
5
|
+
/**
|
|
6
|
+
* Base theme (light, dark, or system)
|
|
7
|
+
* @default "system"
|
|
8
|
+
*/
|
|
9
|
+
baseTheme?: Theme;
|
|
10
|
+
/**
|
|
11
|
+
* CSS variable overrides
|
|
12
|
+
*/
|
|
13
|
+
variables?: Record<string, string>;
|
|
14
|
+
/**
|
|
15
|
+
* Whether to inherit theme from parent app (e.g., next-themes)
|
|
16
|
+
* @default true
|
|
17
|
+
*/
|
|
18
|
+
inheritTheme?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface BlimuContextValue {
|
|
21
|
+
client: BlimuRuntimeClientWrapper;
|
|
22
|
+
config: BlimuConfig;
|
|
23
|
+
state: AuthState;
|
|
24
|
+
appearance?: AppearanceConfig;
|
|
25
|
+
}
|
|
26
|
+
export declare const BlimuContext: import("react").Context<BlimuContextValue | null>;
|
|
27
|
+
//# sourceMappingURL=blimu.context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blimu.context.d.ts","sourceRoot":"","sources":["../../../src/providers/blimu/blimu.context.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAEpD,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,yBAAyB,CAAC;IAClC,MAAM,EAAE,WAAW,CAAC;IACpB,KAAK,EAAE,SAAS,CAAC;IACjB,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC/B;AAED,eAAO,MAAM,YAAY,mDAAgD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blimu.context.js","sources":["../../../src/providers/blimu/blimu.context.tsx"],"sourcesContent":["import { createContext } from 'react';\n\nimport type { BlimuRuntimeClientWrapper } from '../../client/runtime-client';\nimport type { AuthState, BlimuConfig } from '../../types';\nimport type { Theme } from '../theme/theme.context';\n\nexport interface AppearanceConfig {\n /**\n * Base theme (light, dark, or system)\n * @default \"system\"\n */\n baseTheme?: Theme;\n /**\n * CSS variable overrides\n */\n variables?: Record<string, string>;\n /**\n * Whether to inherit theme from parent app (e.g., next-themes)\n * @default true\n */\n inheritTheme?: boolean;\n}\n\nexport interface BlimuContextValue {\n client: BlimuRuntimeClientWrapper;\n config: BlimuConfig;\n state: AuthState;\n appearance?: AppearanceConfig;\n}\n\nexport const BlimuContext = createContext<BlimuContextValue | null>(null);\n"],"names":["BlimuContext","createContext"],"mappings":";AA8BO,MAAMA,IAAeC,EAAwC,IAAI;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),u=require("./blimu.context.cjs");function i(){const e=t.useContext(u.BlimuContext);if(!e)throw new Error("useBlimu must be used within a BlimuProvider");return e}exports.useBlimu=i;
|
|
2
|
+
//# sourceMappingURL=blimu.hook.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blimu.hook.cjs","sources":["../../../src/providers/blimu/blimu.hook.ts"],"sourcesContent":["import { useContext } from 'react';\n\nimport { BlimuContext } from './blimu.context';\n\n/**\n * Hook for accessing Blimu client and configuration\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const { client, config } = useBlimu();\n *\n * // Use client to make API calls\n * const handleAction = async () => {\n * const result = await client.getClient().someMethod();\n * };\n *\n * return <div>Publishable Key: {config.publishableKey}</div>;\n * }\n * ```\n */\nexport function useBlimu() {\n const context = useContext(BlimuContext);\n if (!context) {\n throw new Error('useBlimu must be used within a BlimuProvider');\n }\n return context;\n}\n"],"names":["useBlimu","context","useContext","BlimuContext"],"mappings":"0IAqBO,SAASA,GAAW,CACzB,MAAMC,EAAUC,EAAAA,WAAWC,cAAY,EACvC,GAAI,CAACF,EACH,MAAM,IAAI,MAAM,8CAA8C,EAEhE,OAAOA,CACT"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook for accessing Blimu client and configuration
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```tsx
|
|
6
|
+
* function MyComponent() {
|
|
7
|
+
* const { client, config } = useBlimu();
|
|
8
|
+
*
|
|
9
|
+
* // Use client to make API calls
|
|
10
|
+
* const handleAction = async () => {
|
|
11
|
+
* const result = await client.getClient().someMethod();
|
|
12
|
+
* };
|
|
13
|
+
*
|
|
14
|
+
* return <div>Publishable Key: {config.publishableKey}</div>;
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function useBlimu(): import("./blimu.context").BlimuContextValue;
|
|
19
|
+
//# sourceMappingURL=blimu.hook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blimu.hook.d.ts","sourceRoot":"","sources":["../../../src/providers/blimu/blimu.hook.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,QAAQ,gDAMvB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useContext as o } from "react";
|
|
2
|
+
import { BlimuContext as r } from "./blimu.context.js";
|
|
3
|
+
function u() {
|
|
4
|
+
const t = o(r);
|
|
5
|
+
if (!t)
|
|
6
|
+
throw new Error("useBlimu must be used within a BlimuProvider");
|
|
7
|
+
return t;
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
u as useBlimu
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=blimu.hook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blimu.hook.js","sources":["../../../src/providers/blimu/blimu.hook.ts"],"sourcesContent":["import { useContext } from 'react';\n\nimport { BlimuContext } from './blimu.context';\n\n/**\n * Hook for accessing Blimu client and configuration\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const { client, config } = useBlimu();\n *\n * // Use client to make API calls\n * const handleAction = async () => {\n * const result = await client.getClient().someMethod();\n * };\n *\n * return <div>Publishable Key: {config.publishableKey}</div>;\n * }\n * ```\n */\nexport function useBlimu() {\n const context = useContext(BlimuContext);\n if (!context) {\n throw new Error('useBlimu must be used within a BlimuProvider');\n }\n return context;\n}\n"],"names":["useBlimu","context","useContext","BlimuContext"],"mappings":";;AAqBO,SAASA,IAAW;AACzB,QAAMC,IAAUC,EAAWC,CAAY;AACvC,MAAI,CAACF;AACH,UAAM,IAAI,MAAM,8CAA8C;AAEhE,SAAOA;AACT;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),d=require("react"),s=require("../../client/runtime-client.cjs"),m=require("../../hooks/use-store.cjs"),l=require("../auth/auth.provider.cjs"),a=require("./blimu.context.cjs");function b(r){if(!r)return{};const e={};if(r.colors){const o={background:"--blimu-background",foreground:"--blimu-foreground",card:"--blimu-card",cardForeground:"--blimu-card-foreground",popover:"--blimu-popover",popoverForeground:"--blimu-popover-foreground",primary:"--blimu-primary",primaryForeground:"--blimu-primary-foreground",secondary:"--blimu-secondary",secondaryForeground:"--blimu-secondary-foreground",muted:"--blimu-muted",mutedForeground:"--blimu-muted-foreground",accent:"--blimu-accent",accentForeground:"--blimu-accent-foreground",destructive:"--blimu-destructive",destructiveForeground:"--blimu-destructive-foreground",border:"--blimu-border",input:"--blimu-input",ring:"--blimu-ring"};Object.entries(r.colors).forEach(([u,i])=>{if(i){const n=o[u];n&&(e[n]=i)}})}if(r.radius){const o={none:"0",sm:"0.25rem",md:"0.5rem",lg:"0.75rem",xl:"1rem",full:"9999px"};e["--blimu-radius"]=o[r.radius]??r.radius}return e}function g({publishableKey:r,children:e,theme:o}){const u=d.useMemo(()=>new s.BlimuRuntimeClientWrapper({publishableKey:r}),[r]),i=m.useStore(u.store),n=d.useMemo(()=>b(o),[o]),c={client:u,state:i,config:{publishableKey:r,redirectUri:window.location.origin,theme:o}};return t.jsx("div",{"data-blimu":!0,style:n,children:t.jsx(a.BlimuContext.Provider,{value:c,children:t.jsx(l.AuthProvider,{children:e})})})}exports.BlimuProvider=g;
|
|
2
|
+
//# sourceMappingURL=blimu.provider.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blimu.provider.cjs","sources":["../../../src/providers/blimu/blimu.provider.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\n\nimport { BlimuRuntimeClientWrapper } from '../../client/runtime-client';\nimport { useStore } from '../../hooks/use-store';\nimport type { BlimuRadiusPreset, BlimuTheme } from '../../types';\nimport { AuthProvider } from '../auth/auth.provider';\nimport { BlimuContext } from './blimu.context';\n\ninterface BlimuProviderProps {\n publishableKey: string;\n children: React.ReactNode;\n theme?: BlimuTheme;\n}\n\n/**\n * Convert theme configuration to CSS custom properties\n */\nfunction themeToStyleVars(theme?: BlimuTheme): React.CSSProperties {\n if (!theme) return {};\n\n const vars: Record<string, string> = {};\n\n // Map colors to CSS variables\n if (theme.colors) {\n const colorMap: Record<keyof typeof theme.colors, string> = {\n background: '--blimu-background',\n foreground: '--blimu-foreground',\n card: '--blimu-card',\n cardForeground: '--blimu-card-foreground',\n popover: '--blimu-popover',\n popoverForeground: '--blimu-popover-foreground',\n primary: '--blimu-primary',\n primaryForeground: '--blimu-primary-foreground',\n secondary: '--blimu-secondary',\n secondaryForeground: '--blimu-secondary-foreground',\n muted: '--blimu-muted',\n mutedForeground: '--blimu-muted-foreground',\n accent: '--blimu-accent',\n accentForeground: '--blimu-accent-foreground',\n destructive: '--blimu-destructive',\n destructiveForeground: '--blimu-destructive-foreground',\n border: '--blimu-border',\n input: '--blimu-input',\n ring: '--blimu-ring',\n };\n\n Object.entries(theme.colors).forEach(([key, value]) => {\n if (value) {\n const varName = colorMap[key as keyof typeof theme.colors];\n if (varName) {\n vars[varName] = value;\n }\n }\n });\n }\n\n // Map radius to CSS variable\n if (theme.radius) {\n const radiusMap: Record<BlimuRadiusPreset, string> = {\n none: '0',\n sm: '0.25rem',\n md: '0.5rem',\n lg: '0.75rem',\n xl: '1rem',\n full: '9999px',\n };\n\n vars['--blimu-radius'] = radiusMap[theme.radius as BlimuRadiusPreset] ?? theme.radius;\n }\n\n return vars as React.CSSProperties;\n}\n\n/**\n * Provider component that initializes Blimu SDK and wraps the application\n *\n * This provider must be at the root of your application to enable authentication\n * and authorization features.\n *\n * @example\n * ```tsx\n * function App() {\n * return (\n * <BlimuProvider publishableKey=\"pk_...\">\n * <YourApp />\n * </BlimuProvider>\n * );\n * }\n * ```\n *\n * @example With theme customization\n * ```tsx\n * function App() {\n * return (\n * <BlimuProvider\n * publishableKey=\"pk_...\"\n * theme={{\n * colors: {\n * primary: 'oklch(0.5 0.2 250)',\n * background: '#ffffff',\n * },\n * radius: 'lg',\n * }}\n * >\n * <YourApp />\n * </BlimuProvider>\n * );\n * }\n * ```\n */\nexport function BlimuProvider({ publishableKey, children, theme }: BlimuProviderProps) {\n const client = useMemo(() => new BlimuRuntimeClientWrapper({ publishableKey }), [publishableKey]);\n const state = useStore(client.store);\n const themeVars = useMemo(() => themeToStyleVars(theme), [theme]);\n\n const value = {\n client,\n state,\n config: {\n publishableKey,\n redirectUri: window.location.origin,\n theme,\n },\n };\n\n return (\n <div data-blimu style={themeVars}>\n <BlimuContext.Provider value={value}>\n <AuthProvider>{children}</AuthProvider>\n </BlimuContext.Provider>\n </div>\n );\n}\n"],"names":["themeToStyleVars","theme","vars","colorMap","key","value","varName","radiusMap","BlimuProvider","publishableKey","children","client","useMemo","BlimuRuntimeClientWrapper","state","useStore","themeVars","jsx","BlimuContext","AuthProvider"],"mappings":"oSAiBA,SAASA,EAAiBC,EAAyC,CACjE,GAAI,CAACA,EAAO,MAAO,CAAA,EAEnB,MAAMC,EAA+B,CAAA,EAGrC,GAAID,EAAM,OAAQ,CAChB,MAAME,EAAsD,CAC1D,WAAY,qBACZ,WAAY,qBACZ,KAAM,eACN,eAAgB,0BAChB,QAAS,kBACT,kBAAmB,6BACnB,QAAS,kBACT,kBAAmB,6BACnB,UAAW,oBACX,oBAAqB,+BACrB,MAAO,gBACP,gBAAiB,2BACjB,OAAQ,iBACR,iBAAkB,4BAClB,YAAa,sBACb,sBAAuB,iCACvB,OAAQ,iBACR,MAAO,gBACP,KAAM,cAAA,EAGR,OAAO,QAAQF,EAAM,MAAM,EAAE,QAAQ,CAAC,CAACG,EAAKC,CAAK,IAAM,CACrD,GAAIA,EAAO,CACT,MAAMC,EAAUH,EAASC,CAAgC,EACrDE,IACFJ,EAAKI,CAAO,EAAID,EAEpB,CACF,CAAC,CACH,CAGA,GAAIJ,EAAM,OAAQ,CAChB,MAAMM,EAA+C,CACnD,KAAM,IACN,GAAI,UACJ,GAAI,SACJ,GAAI,UACJ,GAAI,OACJ,KAAM,QAAA,EAGRL,EAAK,gBAAgB,EAAIK,EAAUN,EAAM,MAA2B,GAAKA,EAAM,MACjF,CAEA,OAAOC,CACT,CAuCO,SAASM,EAAc,CAAE,eAAAC,EAAgB,SAAAC,EAAU,MAAAT,GAA6B,CACrF,MAAMU,EAASC,EAAAA,QAAQ,IAAM,IAAIC,EAAAA,0BAA0B,CAAE,eAAAJ,CAAA,CAAgB,EAAG,CAACA,CAAc,CAAC,EAC1FK,EAAQC,EAAAA,SAASJ,EAAO,KAAK,EAC7BK,EAAYJ,EAAAA,QAAQ,IAAMZ,EAAiBC,CAAK,EAAG,CAACA,CAAK,CAAC,EAE1DI,EAAQ,CACZ,OAAAM,EACA,MAAAG,EACA,OAAQ,CACN,eAAAL,EACA,YAAa,OAAO,SAAS,OAC7B,MAAAR,CAAA,CACF,EAGF,OACEgB,EAAAA,IAAC,MAAA,CAAI,aAAU,GAAC,MAAOD,EACrB,SAAAC,MAACC,EAAAA,aAAa,SAAb,CAAsB,MAAAb,EACrB,SAAAY,EAAAA,IAACE,EAAAA,aAAA,CAAc,SAAAT,CAAA,CAAS,EAC1B,EACF,CAEJ"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { BlimuTheme } from '../../types';
|
|
3
|
+
interface BlimuProviderProps {
|
|
4
|
+
publishableKey: string;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
theme?: BlimuTheme;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Provider component that initializes Blimu SDK and wraps the application
|
|
10
|
+
*
|
|
11
|
+
* This provider must be at the root of your application to enable authentication
|
|
12
|
+
* and authorization features.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* function App() {
|
|
17
|
+
* return (
|
|
18
|
+
* <BlimuProvider publishableKey="pk_...">
|
|
19
|
+
* <YourApp />
|
|
20
|
+
* </BlimuProvider>
|
|
21
|
+
* );
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @example With theme customization
|
|
26
|
+
* ```tsx
|
|
27
|
+
* function App() {
|
|
28
|
+
* return (
|
|
29
|
+
* <BlimuProvider
|
|
30
|
+
* publishableKey="pk_..."
|
|
31
|
+
* theme={{
|
|
32
|
+
* colors: {
|
|
33
|
+
* primary: 'oklch(0.5 0.2 250)',
|
|
34
|
+
* background: '#ffffff',
|
|
35
|
+
* },
|
|
36
|
+
* radius: 'lg',
|
|
37
|
+
* }}
|
|
38
|
+
* >
|
|
39
|
+
* <YourApp />
|
|
40
|
+
* </BlimuProvider>
|
|
41
|
+
* );
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare function BlimuProvider({ publishableKey, children, theme }: BlimuProviderProps): React.JSX.Element;
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=blimu.provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blimu.provider.d.ts","sourceRoot":"","sources":["../../../src/providers/blimu/blimu.provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EAAqB,UAAU,EAAE,MAAM,aAAa,CAAC;AAIjE,UAAU,kBAAkB;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AA6DD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,aAAa,CAAC,EAAE,cAAc,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,kBAAkB,qBAsBpF"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as t } from "react";
|
|
3
|
+
import { BlimuRuntimeClientWrapper as c } from "../../client/runtime-client.js";
|
|
4
|
+
import { useStore as a } from "../../hooks/use-store.js";
|
|
5
|
+
import { AuthProvider as l } from "../auth/auth.provider.js";
|
|
6
|
+
import { BlimuContext as s } from "./blimu.context.js";
|
|
7
|
+
function f(r) {
|
|
8
|
+
if (!r) return {};
|
|
9
|
+
const i = {};
|
|
10
|
+
if (r.colors) {
|
|
11
|
+
const o = {
|
|
12
|
+
background: "--blimu-background",
|
|
13
|
+
foreground: "--blimu-foreground",
|
|
14
|
+
card: "--blimu-card",
|
|
15
|
+
cardForeground: "--blimu-card-foreground",
|
|
16
|
+
popover: "--blimu-popover",
|
|
17
|
+
popoverForeground: "--blimu-popover-foreground",
|
|
18
|
+
primary: "--blimu-primary",
|
|
19
|
+
primaryForeground: "--blimu-primary-foreground",
|
|
20
|
+
secondary: "--blimu-secondary",
|
|
21
|
+
secondaryForeground: "--blimu-secondary-foreground",
|
|
22
|
+
muted: "--blimu-muted",
|
|
23
|
+
mutedForeground: "--blimu-muted-foreground",
|
|
24
|
+
accent: "--blimu-accent",
|
|
25
|
+
accentForeground: "--blimu-accent-foreground",
|
|
26
|
+
destructive: "--blimu-destructive",
|
|
27
|
+
destructiveForeground: "--blimu-destructive-foreground",
|
|
28
|
+
border: "--blimu-border",
|
|
29
|
+
input: "--blimu-input",
|
|
30
|
+
ring: "--blimu-ring"
|
|
31
|
+
};
|
|
32
|
+
Object.entries(r.colors).forEach(([u, e]) => {
|
|
33
|
+
if (e) {
|
|
34
|
+
const n = o[u];
|
|
35
|
+
n && (i[n] = e);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
if (r.radius) {
|
|
40
|
+
const o = {
|
|
41
|
+
none: "0",
|
|
42
|
+
sm: "0.25rem",
|
|
43
|
+
md: "0.5rem",
|
|
44
|
+
lg: "0.75rem",
|
|
45
|
+
xl: "1rem",
|
|
46
|
+
full: "9999px"
|
|
47
|
+
};
|
|
48
|
+
i["--blimu-radius"] = o[r.radius] ?? r.radius;
|
|
49
|
+
}
|
|
50
|
+
return i;
|
|
51
|
+
}
|
|
52
|
+
function x({ publishableKey: r, children: i, theme: o }) {
|
|
53
|
+
const u = t(() => new c({ publishableKey: r }), [r]), e = a(u.store), n = t(() => f(o), [o]), m = {
|
|
54
|
+
client: u,
|
|
55
|
+
state: e,
|
|
56
|
+
config: {
|
|
57
|
+
publishableKey: r,
|
|
58
|
+
redirectUri: window.location.origin,
|
|
59
|
+
theme: o
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
return /* @__PURE__ */ d("div", { "data-blimu": !0, style: n, children: /* @__PURE__ */ d(s.Provider, { value: m, children: /* @__PURE__ */ d(l, { children: i }) }) });
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
x as BlimuProvider
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=blimu.provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blimu.provider.js","sources":["../../../src/providers/blimu/blimu.provider.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\n\nimport { BlimuRuntimeClientWrapper } from '../../client/runtime-client';\nimport { useStore } from '../../hooks/use-store';\nimport type { BlimuRadiusPreset, BlimuTheme } from '../../types';\nimport { AuthProvider } from '../auth/auth.provider';\nimport { BlimuContext } from './blimu.context';\n\ninterface BlimuProviderProps {\n publishableKey: string;\n children: React.ReactNode;\n theme?: BlimuTheme;\n}\n\n/**\n * Convert theme configuration to CSS custom properties\n */\nfunction themeToStyleVars(theme?: BlimuTheme): React.CSSProperties {\n if (!theme) return {};\n\n const vars: Record<string, string> = {};\n\n // Map colors to CSS variables\n if (theme.colors) {\n const colorMap: Record<keyof typeof theme.colors, string> = {\n background: '--blimu-background',\n foreground: '--blimu-foreground',\n card: '--blimu-card',\n cardForeground: '--blimu-card-foreground',\n popover: '--blimu-popover',\n popoverForeground: '--blimu-popover-foreground',\n primary: '--blimu-primary',\n primaryForeground: '--blimu-primary-foreground',\n secondary: '--blimu-secondary',\n secondaryForeground: '--blimu-secondary-foreground',\n muted: '--blimu-muted',\n mutedForeground: '--blimu-muted-foreground',\n accent: '--blimu-accent',\n accentForeground: '--blimu-accent-foreground',\n destructive: '--blimu-destructive',\n destructiveForeground: '--blimu-destructive-foreground',\n border: '--blimu-border',\n input: '--blimu-input',\n ring: '--blimu-ring',\n };\n\n Object.entries(theme.colors).forEach(([key, value]) => {\n if (value) {\n const varName = colorMap[key as keyof typeof theme.colors];\n if (varName) {\n vars[varName] = value;\n }\n }\n });\n }\n\n // Map radius to CSS variable\n if (theme.radius) {\n const radiusMap: Record<BlimuRadiusPreset, string> = {\n none: '0',\n sm: '0.25rem',\n md: '0.5rem',\n lg: '0.75rem',\n xl: '1rem',\n full: '9999px',\n };\n\n vars['--blimu-radius'] = radiusMap[theme.radius as BlimuRadiusPreset] ?? theme.radius;\n }\n\n return vars as React.CSSProperties;\n}\n\n/**\n * Provider component that initializes Blimu SDK and wraps the application\n *\n * This provider must be at the root of your application to enable authentication\n * and authorization features.\n *\n * @example\n * ```tsx\n * function App() {\n * return (\n * <BlimuProvider publishableKey=\"pk_...\">\n * <YourApp />\n * </BlimuProvider>\n * );\n * }\n * ```\n *\n * @example With theme customization\n * ```tsx\n * function App() {\n * return (\n * <BlimuProvider\n * publishableKey=\"pk_...\"\n * theme={{\n * colors: {\n * primary: 'oklch(0.5 0.2 250)',\n * background: '#ffffff',\n * },\n * radius: 'lg',\n * }}\n * >\n * <YourApp />\n * </BlimuProvider>\n * );\n * }\n * ```\n */\nexport function BlimuProvider({ publishableKey, children, theme }: BlimuProviderProps) {\n const client = useMemo(() => new BlimuRuntimeClientWrapper({ publishableKey }), [publishableKey]);\n const state = useStore(client.store);\n const themeVars = useMemo(() => themeToStyleVars(theme), [theme]);\n\n const value = {\n client,\n state,\n config: {\n publishableKey,\n redirectUri: window.location.origin,\n theme,\n },\n };\n\n return (\n <div data-blimu style={themeVars}>\n <BlimuContext.Provider value={value}>\n <AuthProvider>{children}</AuthProvider>\n </BlimuContext.Provider>\n </div>\n );\n}\n"],"names":["themeToStyleVars","theme","vars","colorMap","key","value","varName","radiusMap","BlimuProvider","publishableKey","children","client","useMemo","BlimuRuntimeClientWrapper","state","useStore","themeVars","jsx","BlimuContext","AuthProvider"],"mappings":";;;;;;AAiBA,SAASA,EAAiBC,GAAyC;AACjE,MAAI,CAACA,EAAO,QAAO,CAAA;AAEnB,QAAMC,IAA+B,CAAA;AAGrC,MAAID,EAAM,QAAQ;AAChB,UAAME,IAAsD;AAAA,MAC1D,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,SAAS;AAAA,MACT,mBAAmB;AAAA,MACnB,SAAS;AAAA,MACT,mBAAmB;AAAA,MACnB,WAAW;AAAA,MACX,qBAAqB;AAAA,MACrB,OAAO;AAAA,MACP,iBAAiB;AAAA,MACjB,QAAQ;AAAA,MACR,kBAAkB;AAAA,MAClB,aAAa;AAAA,MACb,uBAAuB;AAAA,MACvB,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,MAAM;AAAA,IAAA;AAGR,WAAO,QAAQF,EAAM,MAAM,EAAE,QAAQ,CAAC,CAACG,GAAKC,CAAK,MAAM;AACrD,UAAIA,GAAO;AACT,cAAMC,IAAUH,EAASC,CAAgC;AACzD,QAAIE,MACFJ,EAAKI,CAAO,IAAID;AAAA,MAEpB;AAAA,IACF,CAAC;AAAA,EACH;AAGA,MAAIJ,EAAM,QAAQ;AAChB,UAAMM,IAA+C;AAAA,MACnD,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,MAAM;AAAA,IAAA;AAGR,IAAAL,EAAK,gBAAgB,IAAIK,EAAUN,EAAM,MAA2B,KAAKA,EAAM;AAAA,EACjF;AAEA,SAAOC;AACT;AAuCO,SAASM,EAAc,EAAE,gBAAAC,GAAgB,UAAAC,GAAU,OAAAT,KAA6B;AACrF,QAAMU,IAASC,EAAQ,MAAM,IAAIC,EAA0B,EAAE,gBAAAJ,EAAA,CAAgB,GAAG,CAACA,CAAc,CAAC,GAC1FK,IAAQC,EAASJ,EAAO,KAAK,GAC7BK,IAAYJ,EAAQ,MAAMZ,EAAiBC,CAAK,GAAG,CAACA,CAAK,CAAC,GAE1DI,IAAQ;AAAA,IACZ,QAAAM;AAAA,IACA,OAAAG;AAAA,IACA,QAAQ;AAAA,MACN,gBAAAL;AAAA,MACA,aAAa,OAAO,SAAS;AAAA,MAC7B,OAAAR;AAAA,IAAA;AAAA,EACF;AAGF,SACE,gBAAAgB,EAAC,OAAA,EAAI,cAAU,IAAC,OAAOD,GACrB,UAAA,gBAAAC,EAACC,EAAa,UAAb,EAAsB,OAAAb,GACrB,UAAA,gBAAAY,EAACE,GAAA,EAAc,UAAAT,EAAA,CAAS,GAC1B,GACF;AAEJ;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { useBlimu } from './blimu/blimu.hook';
|
|
2
|
+
export { BlimuProvider } from './blimu/blimu.provider';
|
|
3
|
+
export { AuthProvider } from './auth/auth.provider';
|
|
4
|
+
export { ThemeProvider, useTheme } from './theme';
|
|
5
|
+
export type { Theme, ThemeContextValue } from './theme';
|
|
6
|
+
export type { AppearanceConfig } from './blimu/blimu.context';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAClD,YAAY,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACxD,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,YAAY,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.context.cjs","sources":["../../../src/providers/theme/theme.context.tsx"],"sourcesContent":["import { createContext } from 'react';\n\nexport type Theme = 'light' | 'dark' | 'system';\n\nexport interface ThemeContextValue {\n theme: Theme;\n setTheme: (theme: Theme) => void;\n resolvedTheme: 'light' | 'dark';\n}\n\nexport const ThemeContext = createContext<ThemeContextValue | null>(null);\n"],"names":["ThemeContext","createContext"],"mappings":"yGAUaA,EAAeC,EAAAA,cAAwC,IAAI"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type Theme = 'light' | 'dark' | 'system';
|
|
2
|
+
export interface ThemeContextValue {
|
|
3
|
+
theme: Theme;
|
|
4
|
+
setTheme: (theme: Theme) => void;
|
|
5
|
+
resolvedTheme: 'light' | 'dark';
|
|
6
|
+
}
|
|
7
|
+
export declare const ThemeContext: import("react").Context<ThemeContextValue | null>;
|
|
8
|
+
//# sourceMappingURL=theme.context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.context.d.ts","sourceRoot":"","sources":["../../../src/providers/theme/theme.context.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEhD,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,aAAa,EAAE,OAAO,GAAG,MAAM,CAAC;CACjC;AAED,eAAO,MAAM,YAAY,mDAAgD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.context.js","sources":["../../../src/providers/theme/theme.context.tsx"],"sourcesContent":["import { createContext } from 'react';\n\nexport type Theme = 'light' | 'dark' | 'system';\n\nexport interface ThemeContextValue {\n theme: Theme;\n setTheme: (theme: Theme) => void;\n resolvedTheme: 'light' | 'dark';\n}\n\nexport const ThemeContext = createContext<ThemeContextValue | null>(null);\n"],"names":["ThemeContext","createContext"],"mappings":";AAUO,MAAMA,IAAeC,EAAwC,IAAI;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),r=require("./theme.context.cjs");function o(){const e=t.useContext(r.ThemeContext);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e}exports.useTheme=o;
|
|
2
|
+
//# sourceMappingURL=theme.hook.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.hook.cjs","sources":["../../../src/providers/theme/theme.hook.ts"],"sourcesContent":["import { useContext } from 'react';\n\nimport { ThemeContext } from './theme.context';\n\n/**\n * Hook for accessing and controlling the theme\n *\n * @example\n * ```tsx\n * function ThemeToggle() {\n * const { theme, setTheme, resolvedTheme } = useTheme();\n *\n * return (\n * <button onClick={() => setTheme(theme === 'light' ? 'dark' : 'light')}>\n * Current theme: {resolvedTheme}\n * </button>\n * );\n * }\n * ```\n */\nexport function useTheme() {\n const context = useContext(ThemeContext);\n if (!context) {\n throw new Error('useTheme must be used within a ThemeProvider');\n }\n return context;\n}\n"],"names":["useTheme","context","useContext","ThemeContext"],"mappings":"0IAoBO,SAASA,GAAW,CACzB,MAAMC,EAAUC,EAAAA,WAAWC,cAAY,EACvC,GAAI,CAACF,EACH,MAAM,IAAI,MAAM,8CAA8C,EAEhE,OAAOA,CACT"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook for accessing and controlling the theme
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```tsx
|
|
6
|
+
* function ThemeToggle() {
|
|
7
|
+
* const { theme, setTheme, resolvedTheme } = useTheme();
|
|
8
|
+
*
|
|
9
|
+
* return (
|
|
10
|
+
* <button onClick={() => setTheme(theme === 'light' ? 'dark' : 'light')}>
|
|
11
|
+
* Current theme: {resolvedTheme}
|
|
12
|
+
* </button>
|
|
13
|
+
* );
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare function useTheme(): import("./theme.context").ThemeContextValue;
|
|
18
|
+
//# sourceMappingURL=theme.hook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.hook.d.ts","sourceRoot":"","sources":["../../../src/providers/theme/theme.hook.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,QAAQ,gDAMvB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useContext as t } from "react";
|
|
2
|
+
import { ThemeContext as o } from "./theme.context.js";
|
|
3
|
+
function n() {
|
|
4
|
+
const e = t(o);
|
|
5
|
+
if (!e)
|
|
6
|
+
throw new Error("useTheme must be used within a ThemeProvider");
|
|
7
|
+
return e;
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
n as useTheme
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=theme.hook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.hook.js","sources":["../../../src/providers/theme/theme.hook.ts"],"sourcesContent":["import { useContext } from 'react';\n\nimport { ThemeContext } from './theme.context';\n\n/**\n * Hook for accessing and controlling the theme\n *\n * @example\n * ```tsx\n * function ThemeToggle() {\n * const { theme, setTheme, resolvedTheme } = useTheme();\n *\n * return (\n * <button onClick={() => setTheme(theme === 'light' ? 'dark' : 'light')}>\n * Current theme: {resolvedTheme}\n * </button>\n * );\n * }\n * ```\n */\nexport function useTheme() {\n const context = useContext(ThemeContext);\n if (!context) {\n throw new Error('useTheme must be used within a ThemeProvider');\n }\n return context;\n}\n"],"names":["useTheme","context","useContext","ThemeContext"],"mappings":";;AAoBO,SAASA,IAAW;AACzB,QAAMC,IAAUC,EAAWC,CAAY;AACvC,MAAI,CAACF;AACH,UAAM,IAAI,MAAM,8CAA8C;AAEhE,SAAOA;AACT;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react/jsx-runtime"),s=require("react"),v=require("./theme.context.cjs");function y({children:o,defaultTheme:m="system",storageKey:u="blimu-theme",autoDetect:f=!0}){const[e,h]=s.useState(()=>typeof window>"u"?m:localStorage.getItem(u)||m),[i,d]=s.useState(()=>typeof window>"u"?"light":E(e));s.useEffect(()=>{if(typeof window>"u")return;const t=window.document.documentElement;if(t.classList.remove("light","dark"),e==="system"){const n=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";t.classList.add(n),d(n);return}t.classList.add(e),d(e)},[e]),s.useEffect(()=>{typeof window>"u"||localStorage.setItem(u,e)},[e,u]),s.useEffect(()=>{if(!f||typeof window>"u")return;const t=new MutationObserver(n=>{n.forEach(a=>{if(a.attributeName==="class"){const r=document.documentElement.classList.contains("dark"),c=document.documentElement.classList.contains("light");if(r||c){const l=r?"dark":"light";i!==l&&d(l)}}})});return t.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>t.disconnect()},[f,i]),s.useEffect(()=>{if(e!=="system"||typeof window>"u")return;const t=window.matchMedia("(prefers-color-scheme: dark)"),n=a=>{const r=window.document.documentElement;r.classList.remove("light","dark");const c=a.matches?"dark":"light";r.classList.add(c),d(c)};return t.addEventListener("change",n),()=>t.removeEventListener("change",n)},[e]);const w=s.useMemo(()=>({theme:e,setTheme:h,resolvedTheme:i}),[e,i]);return g.jsx(v.ThemeContext.Provider,{value:w,children:o})}function E(o){return o==="system"?typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":o}exports.ThemeProvider=y;
|
|
2
|
+
//# sourceMappingURL=theme.provider.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.provider.cjs","sources":["../../../src/providers/theme/theme.provider.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from 'react';\n\nimport type { Theme, ThemeContextValue } from './theme.context';\nimport { ThemeContext } from './theme.context';\n\ninterface ThemeProviderProps {\n children: React.ReactNode;\n defaultTheme?: Theme;\n storageKey?: string;\n /**\n * Whether to automatically detect and sync with parent app's theme\n * @default true\n */\n autoDetect?: boolean;\n}\n\n/**\n * ThemeProvider component that manages theme state and syncs with system preferences\n *\n * Supports automatic detection of parent app's theme (e.g., next-themes) via\n * MutationObserver watching for class changes on the document element.\n *\n * @example\n * ```tsx\n * <ThemeProvider defaultTheme=\"system\" storageKey=\"my-app-theme\">\n * <App />\n * </ThemeProvider>\n * ```\n */\nexport function ThemeProvider({\n children,\n defaultTheme = 'system',\n storageKey = 'blimu-theme',\n autoDetect = true,\n}: ThemeProviderProps) {\n const [theme, setTheme] = useState<Theme>(() => {\n if (typeof window === 'undefined') {\n return defaultTheme;\n }\n const stored = localStorage.getItem(storageKey) as Theme | null;\n return stored || defaultTheme;\n });\n\n const [resolvedTheme, setResolvedTheme] = useState<'light' | 'dark'>(() => {\n if (typeof window === 'undefined') {\n return 'light';\n }\n return getResolvedTheme(theme);\n });\n\n // Apply theme to document\n useEffect(() => {\n if (typeof window === 'undefined') {\n return;\n }\n\n const root = window.document.documentElement;\n root.classList.remove('light', 'dark');\n\n if (theme === 'system') {\n const systemTheme = window.matchMedia('(prefers-color-scheme: dark)').matches\n ? 'dark'\n : 'light';\n root.classList.add(systemTheme);\n setResolvedTheme(systemTheme);\n return;\n }\n\n root.classList.add(theme);\n setResolvedTheme(theme);\n }, [theme]);\n\n // Persist theme to localStorage\n useEffect(() => {\n if (typeof window === 'undefined') {\n return;\n }\n localStorage.setItem(storageKey, theme);\n }, [theme, storageKey]);\n\n // Auto-detect parent app's theme changes (e.g., next-themes)\n useEffect(() => {\n if (!autoDetect || typeof window === 'undefined') {\n return;\n }\n\n const observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n if (mutation.attributeName === 'class') {\n const isDark = document.documentElement.classList.contains('dark');\n const isLight = document.documentElement.classList.contains('light');\n\n // Only sync if parent app has explicitly set a theme class\n if (isDark || isLight) {\n const detectedTheme = isDark ? 'dark' : 'light';\n if (resolvedTheme !== detectedTheme) {\n setResolvedTheme(detectedTheme);\n }\n }\n }\n });\n });\n\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['class'],\n });\n\n return () => observer.disconnect();\n }, [autoDetect, resolvedTheme]);\n\n // Listen to system theme changes when theme is 'system'\n useEffect(() => {\n if (theme !== 'system' || typeof window === 'undefined') {\n return;\n }\n\n const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');\n const handleChange = (e: MediaQueryListEvent) => {\n const root = window.document.documentElement;\n root.classList.remove('light', 'dark');\n const systemTheme = e.matches ? 'dark' : 'light';\n root.classList.add(systemTheme);\n setResolvedTheme(systemTheme);\n };\n\n mediaQuery.addEventListener('change', handleChange);\n return () => mediaQuery.removeEventListener('change', handleChange);\n }, [theme]);\n\n const value = useMemo<ThemeContextValue>(\n () => ({\n theme,\n setTheme,\n resolvedTheme,\n }),\n [theme, resolvedTheme],\n );\n\n return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>;\n}\n\n/**\n * Get the resolved theme (light or dark) from a Theme value\n */\nfunction getResolvedTheme(theme: Theme): 'light' | 'dark' {\n if (theme === 'system') {\n if (typeof window === 'undefined') {\n return 'light';\n }\n return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n }\n return theme;\n}\n"],"names":["ThemeProvider","children","defaultTheme","storageKey","autoDetect","theme","setTheme","useState","resolvedTheme","setResolvedTheme","getResolvedTheme","useEffect","root","systemTheme","observer","mutations","mutation","isDark","isLight","detectedTheme","mediaQuery","handleChange","e","value","useMemo","jsx","ThemeContext"],"mappings":"yKA6BO,SAASA,EAAc,CAC5B,SAAAC,EACA,aAAAC,EAAe,SACf,WAAAC,EAAa,cACb,WAAAC,EAAa,EACf,EAAuB,CACrB,KAAM,CAACC,EAAOC,CAAQ,EAAIC,EAAAA,SAAgB,IACpC,OAAO,OAAW,IACbL,EAEM,aAAa,QAAQC,CAAU,GAC7BD,CAClB,EAEK,CAACM,EAAeC,CAAgB,EAAIF,EAAAA,SAA2B,IAC/D,OAAO,OAAW,IACb,QAEFG,EAAiBL,CAAK,CAC9B,EAGDM,EAAAA,UAAU,IAAM,CACd,GAAI,OAAO,OAAW,IACpB,OAGF,MAAMC,EAAO,OAAO,SAAS,gBAG7B,GAFAA,EAAK,UAAU,OAAO,QAAS,MAAM,EAEjCP,IAAU,SAAU,CACtB,MAAMQ,EAAc,OAAO,WAAW,8BAA8B,EAAE,QAClE,OACA,QACJD,EAAK,UAAU,IAAIC,CAAW,EAC9BJ,EAAiBI,CAAW,EAC5B,MACF,CAEAD,EAAK,UAAU,IAAIP,CAAK,EACxBI,EAAiBJ,CAAK,CACxB,EAAG,CAACA,CAAK,CAAC,EAGVM,EAAAA,UAAU,IAAM,CACV,OAAO,OAAW,KAGtB,aAAa,QAAQR,EAAYE,CAAK,CACxC,EAAG,CAACA,EAAOF,CAAU,CAAC,EAGtBQ,EAAAA,UAAU,IAAM,CACd,GAAI,CAACP,GAAc,OAAO,OAAW,IACnC,OAGF,MAAMU,EAAW,IAAI,iBAAkBC,GAAc,CACnDA,EAAU,QAASC,GAAa,CAC9B,GAAIA,EAAS,gBAAkB,QAAS,CACtC,MAAMC,EAAS,SAAS,gBAAgB,UAAU,SAAS,MAAM,EAC3DC,EAAU,SAAS,gBAAgB,UAAU,SAAS,OAAO,EAGnE,GAAID,GAAUC,EAAS,CACrB,MAAMC,EAAgBF,EAAS,OAAS,QACpCT,IAAkBW,GACpBV,EAAiBU,CAAa,CAElC,CACF,CACF,CAAC,CACH,CAAC,EAED,OAAAL,EAAS,QAAQ,SAAS,gBAAiB,CACzC,WAAY,GACZ,gBAAiB,CAAC,OAAO,CAAA,CAC1B,EAEM,IAAMA,EAAS,WAAA,CACxB,EAAG,CAACV,EAAYI,CAAa,CAAC,EAG9BG,EAAAA,UAAU,IAAM,CACd,GAAIN,IAAU,UAAY,OAAO,OAAW,IAC1C,OAGF,MAAMe,EAAa,OAAO,WAAW,8BAA8B,EAC7DC,EAAgBC,GAA2B,CAC/C,MAAMV,EAAO,OAAO,SAAS,gBAC7BA,EAAK,UAAU,OAAO,QAAS,MAAM,EACrC,MAAMC,EAAcS,EAAE,QAAU,OAAS,QACzCV,EAAK,UAAU,IAAIC,CAAW,EAC9BJ,EAAiBI,CAAW,CAC9B,EAEA,OAAAO,EAAW,iBAAiB,SAAUC,CAAY,EAC3C,IAAMD,EAAW,oBAAoB,SAAUC,CAAY,CACpE,EAAG,CAAChB,CAAK,CAAC,EAEV,MAAMkB,EAAQC,EAAAA,QACZ,KAAO,CACL,MAAAnB,EACA,SAAAC,EACA,cAAAE,CAAA,GAEF,CAACH,EAAOG,CAAa,CAAA,EAGvB,OAAOiB,EAAAA,IAACC,EAAAA,aAAa,SAAb,CAAsB,MAAAH,EAAe,SAAAtB,CAAA,CAAS,CACxD,CAKA,SAASS,EAAiBL,EAAgC,CACxD,OAAIA,IAAU,SACR,OAAO,OAAW,IACb,QAEF,OAAO,WAAW,8BAA8B,EAAE,QAAU,OAAS,QAEvEA,CACT"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Theme } from './theme.context';
|
|
3
|
+
interface ThemeProviderProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
defaultTheme?: Theme;
|
|
6
|
+
storageKey?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Whether to automatically detect and sync with parent app's theme
|
|
9
|
+
* @default true
|
|
10
|
+
*/
|
|
11
|
+
autoDetect?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* ThemeProvider component that manages theme state and syncs with system preferences
|
|
15
|
+
*
|
|
16
|
+
* Supports automatic detection of parent app's theme (e.g., next-themes) via
|
|
17
|
+
* MutationObserver watching for class changes on the document element.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <ThemeProvider defaultTheme="system" storageKey="my-app-theme">
|
|
22
|
+
* <App />
|
|
23
|
+
* </ThemeProvider>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare function ThemeProvider({ children, defaultTheme, storageKey, autoDetect, }: ThemeProviderProps): React.JSX.Element;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=theme.provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.provider.d.ts","sourceRoot":"","sources":["../../../src/providers/theme/theme.provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAE5D,OAAO,KAAK,EAAE,KAAK,EAAqB,MAAM,iBAAiB,CAAC;AAGhE,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,YAAuB,EACvB,UAA0B,EAC1B,UAAiB,GAClB,EAAE,kBAAkB,qBA0GpB"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { useState as h, useEffect as c, useMemo as v } from "react";
|
|
3
|
+
import { ThemeContext as y } from "./theme.context.js";
|
|
4
|
+
function b({
|
|
5
|
+
children: o,
|
|
6
|
+
defaultTheme: u = "system",
|
|
7
|
+
storageKey: m = "blimu-theme",
|
|
8
|
+
autoDetect: f = !0
|
|
9
|
+
}) {
|
|
10
|
+
const [e, w] = h(() => typeof window > "u" ? u : localStorage.getItem(m) || u), [s, i] = h(() => typeof window > "u" ? "light" : k(e));
|
|
11
|
+
c(() => {
|
|
12
|
+
if (typeof window > "u")
|
|
13
|
+
return;
|
|
14
|
+
const t = window.document.documentElement;
|
|
15
|
+
if (t.classList.remove("light", "dark"), e === "system") {
|
|
16
|
+
const n = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
17
|
+
t.classList.add(n), i(n);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
t.classList.add(e), i(e);
|
|
21
|
+
}, [e]), c(() => {
|
|
22
|
+
typeof window > "u" || localStorage.setItem(m, e);
|
|
23
|
+
}, [e, m]), c(() => {
|
|
24
|
+
if (!f || typeof window > "u")
|
|
25
|
+
return;
|
|
26
|
+
const t = new MutationObserver((n) => {
|
|
27
|
+
n.forEach((a) => {
|
|
28
|
+
if (a.attributeName === "class") {
|
|
29
|
+
const r = document.documentElement.classList.contains("dark"), d = document.documentElement.classList.contains("light");
|
|
30
|
+
if (r || d) {
|
|
31
|
+
const l = r ? "dark" : "light";
|
|
32
|
+
s !== l && i(l);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
return t.observe(document.documentElement, {
|
|
38
|
+
attributes: !0,
|
|
39
|
+
attributeFilter: ["class"]
|
|
40
|
+
}), () => t.disconnect();
|
|
41
|
+
}, [f, s]), c(() => {
|
|
42
|
+
if (e !== "system" || typeof window > "u")
|
|
43
|
+
return;
|
|
44
|
+
const t = window.matchMedia("(prefers-color-scheme: dark)"), n = (a) => {
|
|
45
|
+
const r = window.document.documentElement;
|
|
46
|
+
r.classList.remove("light", "dark");
|
|
47
|
+
const d = a.matches ? "dark" : "light";
|
|
48
|
+
r.classList.add(d), i(d);
|
|
49
|
+
};
|
|
50
|
+
return t.addEventListener("change", n), () => t.removeEventListener("change", n);
|
|
51
|
+
}, [e]);
|
|
52
|
+
const g = v(
|
|
53
|
+
() => ({
|
|
54
|
+
theme: e,
|
|
55
|
+
setTheme: w,
|
|
56
|
+
resolvedTheme: s
|
|
57
|
+
}),
|
|
58
|
+
[e, s]
|
|
59
|
+
);
|
|
60
|
+
return /* @__PURE__ */ p(y.Provider, { value: g, children: o });
|
|
61
|
+
}
|
|
62
|
+
function k(o) {
|
|
63
|
+
return o === "system" ? typeof window > "u" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : o;
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
b as ThemeProvider
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=theme.provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.provider.js","sources":["../../../src/providers/theme/theme.provider.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from 'react';\n\nimport type { Theme, ThemeContextValue } from './theme.context';\nimport { ThemeContext } from './theme.context';\n\ninterface ThemeProviderProps {\n children: React.ReactNode;\n defaultTheme?: Theme;\n storageKey?: string;\n /**\n * Whether to automatically detect and sync with parent app's theme\n * @default true\n */\n autoDetect?: boolean;\n}\n\n/**\n * ThemeProvider component that manages theme state and syncs with system preferences\n *\n * Supports automatic detection of parent app's theme (e.g., next-themes) via\n * MutationObserver watching for class changes on the document element.\n *\n * @example\n * ```tsx\n * <ThemeProvider defaultTheme=\"system\" storageKey=\"my-app-theme\">\n * <App />\n * </ThemeProvider>\n * ```\n */\nexport function ThemeProvider({\n children,\n defaultTheme = 'system',\n storageKey = 'blimu-theme',\n autoDetect = true,\n}: ThemeProviderProps) {\n const [theme, setTheme] = useState<Theme>(() => {\n if (typeof window === 'undefined') {\n return defaultTheme;\n }\n const stored = localStorage.getItem(storageKey) as Theme | null;\n return stored || defaultTheme;\n });\n\n const [resolvedTheme, setResolvedTheme] = useState<'light' | 'dark'>(() => {\n if (typeof window === 'undefined') {\n return 'light';\n }\n return getResolvedTheme(theme);\n });\n\n // Apply theme to document\n useEffect(() => {\n if (typeof window === 'undefined') {\n return;\n }\n\n const root = window.document.documentElement;\n root.classList.remove('light', 'dark');\n\n if (theme === 'system') {\n const systemTheme = window.matchMedia('(prefers-color-scheme: dark)').matches\n ? 'dark'\n : 'light';\n root.classList.add(systemTheme);\n setResolvedTheme(systemTheme);\n return;\n }\n\n root.classList.add(theme);\n setResolvedTheme(theme);\n }, [theme]);\n\n // Persist theme to localStorage\n useEffect(() => {\n if (typeof window === 'undefined') {\n return;\n }\n localStorage.setItem(storageKey, theme);\n }, [theme, storageKey]);\n\n // Auto-detect parent app's theme changes (e.g., next-themes)\n useEffect(() => {\n if (!autoDetect || typeof window === 'undefined') {\n return;\n }\n\n const observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n if (mutation.attributeName === 'class') {\n const isDark = document.documentElement.classList.contains('dark');\n const isLight = document.documentElement.classList.contains('light');\n\n // Only sync if parent app has explicitly set a theme class\n if (isDark || isLight) {\n const detectedTheme = isDark ? 'dark' : 'light';\n if (resolvedTheme !== detectedTheme) {\n setResolvedTheme(detectedTheme);\n }\n }\n }\n });\n });\n\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['class'],\n });\n\n return () => observer.disconnect();\n }, [autoDetect, resolvedTheme]);\n\n // Listen to system theme changes when theme is 'system'\n useEffect(() => {\n if (theme !== 'system' || typeof window === 'undefined') {\n return;\n }\n\n const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');\n const handleChange = (e: MediaQueryListEvent) => {\n const root = window.document.documentElement;\n root.classList.remove('light', 'dark');\n const systemTheme = e.matches ? 'dark' : 'light';\n root.classList.add(systemTheme);\n setResolvedTheme(systemTheme);\n };\n\n mediaQuery.addEventListener('change', handleChange);\n return () => mediaQuery.removeEventListener('change', handleChange);\n }, [theme]);\n\n const value = useMemo<ThemeContextValue>(\n () => ({\n theme,\n setTheme,\n resolvedTheme,\n }),\n [theme, resolvedTheme],\n );\n\n return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>;\n}\n\n/**\n * Get the resolved theme (light or dark) from a Theme value\n */\nfunction getResolvedTheme(theme: Theme): 'light' | 'dark' {\n if (theme === 'system') {\n if (typeof window === 'undefined') {\n return 'light';\n }\n return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n }\n return theme;\n}\n"],"names":["ThemeProvider","children","defaultTheme","storageKey","autoDetect","theme","setTheme","useState","resolvedTheme","setResolvedTheme","getResolvedTheme","useEffect","root","systemTheme","observer","mutations","mutation","isDark","isLight","detectedTheme","mediaQuery","handleChange","e","value","useMemo","jsx","ThemeContext"],"mappings":";;;AA6BO,SAASA,EAAc;AAAA,EAC5B,UAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,YAAAC,IAAa;AAAA,EACb,YAAAC,IAAa;AACf,GAAuB;AACrB,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAgB,MACpC,OAAO,SAAW,MACbL,IAEM,aAAa,QAAQC,CAAU,KAC7BD,CAClB,GAEK,CAACM,GAAeC,CAAgB,IAAIF,EAA2B,MAC/D,OAAO,SAAW,MACb,UAEFG,EAAiBL,CAAK,CAC9B;AAGD,EAAAM,EAAU,MAAM;AACd,QAAI,OAAO,SAAW;AACpB;AAGF,UAAMC,IAAO,OAAO,SAAS;AAG7B,QAFAA,EAAK,UAAU,OAAO,SAAS,MAAM,GAEjCP,MAAU,UAAU;AACtB,YAAMQ,IAAc,OAAO,WAAW,8BAA8B,EAAE,UAClE,SACA;AACJ,MAAAD,EAAK,UAAU,IAAIC,CAAW,GAC9BJ,EAAiBI,CAAW;AAC5B;AAAA,IACF;AAEA,IAAAD,EAAK,UAAU,IAAIP,CAAK,GACxBI,EAAiBJ,CAAK;AAAA,EACxB,GAAG,CAACA,CAAK,CAAC,GAGVM,EAAU,MAAM;AACd,IAAI,OAAO,SAAW,OAGtB,aAAa,QAAQR,GAAYE,CAAK;AAAA,EACxC,GAAG,CAACA,GAAOF,CAAU,CAAC,GAGtBQ,EAAU,MAAM;AACd,QAAI,CAACP,KAAc,OAAO,SAAW;AACnC;AAGF,UAAMU,IAAW,IAAI,iBAAiB,CAACC,MAAc;AACnD,MAAAA,EAAU,QAAQ,CAACC,MAAa;AAC9B,YAAIA,EAAS,kBAAkB,SAAS;AACtC,gBAAMC,IAAS,SAAS,gBAAgB,UAAU,SAAS,MAAM,GAC3DC,IAAU,SAAS,gBAAgB,UAAU,SAAS,OAAO;AAGnE,cAAID,KAAUC,GAAS;AACrB,kBAAMC,IAAgBF,IAAS,SAAS;AACxC,YAAIT,MAAkBW,KACpBV,EAAiBU,CAAa;AAAA,UAElC;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAED,WAAAL,EAAS,QAAQ,SAAS,iBAAiB;AAAA,MACzC,YAAY;AAAA,MACZ,iBAAiB,CAAC,OAAO;AAAA,IAAA,CAC1B,GAEM,MAAMA,EAAS,WAAA;AAAA,EACxB,GAAG,CAACV,GAAYI,CAAa,CAAC,GAG9BG,EAAU,MAAM;AACd,QAAIN,MAAU,YAAY,OAAO,SAAW;AAC1C;AAGF,UAAMe,IAAa,OAAO,WAAW,8BAA8B,GAC7DC,IAAe,CAACC,MAA2B;AAC/C,YAAMV,IAAO,OAAO,SAAS;AAC7B,MAAAA,EAAK,UAAU,OAAO,SAAS,MAAM;AACrC,YAAMC,IAAcS,EAAE,UAAU,SAAS;AACzC,MAAAV,EAAK,UAAU,IAAIC,CAAW,GAC9BJ,EAAiBI,CAAW;AAAA,IAC9B;AAEA,WAAAO,EAAW,iBAAiB,UAAUC,CAAY,GAC3C,MAAMD,EAAW,oBAAoB,UAAUC,CAAY;AAAA,EACpE,GAAG,CAAChB,CAAK,CAAC;AAEV,QAAMkB,IAAQC;AAAA,IACZ,OAAO;AAAA,MACL,OAAAnB;AAAA,MACA,UAAAC;AAAA,MACA,eAAAE;AAAA,IAAA;AAAA,IAEF,CAACH,GAAOG,CAAa;AAAA,EAAA;AAGvB,SAAO,gBAAAiB,EAACC,EAAa,UAAb,EAAsB,OAAAH,GAAe,UAAAtB,EAAA,CAAS;AACxD;AAKA,SAASS,EAAiBL,GAAgC;AACxD,SAAIA,MAAU,WACR,OAAO,SAAW,MACb,UAEF,OAAO,WAAW,8BAA8B,EAAE,UAAU,SAAS,UAEvEA;AACT;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./providers/blimu/blimu.hook.cjs"),r=require("./providers/blimu/blimu.provider.cjs"),i=require("./providers/auth/auth.provider.cjs"),o=require("./providers/theme/theme.provider.cjs"),u=require("./providers/theme/theme.hook.cjs");exports.useBlimu=e.useBlimu;exports.BlimuProvider=r.BlimuProvider;exports.AuthProvider=i.AuthProvider;exports.ThemeProvider=o.ThemeProvider;exports.useTheme=u.useTheme;
|
|
2
|
+
//# sourceMappingURL=providers.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"providers.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useBlimu as o } from "./providers/blimu/blimu.hook.js";
|
|
2
|
+
import { BlimuProvider as t } from "./providers/blimu/blimu.provider.js";
|
|
3
|
+
import { AuthProvider as i } from "./providers/auth/auth.provider.js";
|
|
4
|
+
import { ThemeProvider as u } from "./providers/theme/theme.provider.js";
|
|
5
|
+
import { useTheme as d } from "./providers/theme/theme.hook.js";
|
|
6
|
+
export {
|
|
7
|
+
i as AuthProvider,
|
|
8
|
+
t as BlimuProvider,
|
|
9
|
+
u as ThemeProvider,
|
|
10
|
+
o as useBlimu,
|
|
11
|
+
d as useTheme
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=providers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"providers.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|