@blimu/react 1.1.0 → 1.1.1
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/dist/_virtual/index.cjs +5 -1
- package/dist/_virtual/index.cjs.map +1 -1
- package/dist/_virtual/index.js +3 -3
- package/dist/_virtual/index2.cjs +4 -1
- package/dist/_virtual/index2.cjs.map +1 -1
- package/dist/_virtual/index2.js +2 -2
- package/dist/_virtual/use-sync-external-store-shim.development.cjs +4 -1
- package/dist/_virtual/use-sync-external-store-shim.development.cjs.map +1 -1
- package/dist/_virtual/use-sync-external-store-shim.development.js +2 -2
- package/dist/_virtual/use-sync-external-store-shim.production.cjs +4 -1
- package/dist/_virtual/use-sync-external-store-shim.production.cjs.map +1 -1
- package/dist/_virtual/use-sync-external-store-shim.production.js +2 -2
- package/dist/client/auth.service.cjs +249 -1
- package/dist/client/auth.service.cjs.map +1 -1
- package/dist/client/auth.service.js +194 -96
- package/dist/client/auth.service.js.map +1 -1
- package/dist/client/external-store.cjs +26 -1
- package/dist/client/external-store.cjs.map +1 -1
- package/dist/client/external-store.js +22 -8
- package/dist/client/external-store.js.map +1 -1
- package/dist/client/runtime-client.cjs +136 -1
- package/dist/client/runtime-client.cjs.map +1 -1
- package/dist/client/runtime-client.js +85 -51
- package/dist/client/runtime-client.js.map +1 -1
- package/dist/components/index.cjs +13 -0
- package/dist/components/index.cjs.map +1 -0
- package/dist/components/index.js +13 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/members-list.cjs +132 -1
- package/dist/components/members-list.cjs.map +1 -1
- package/dist/components/members-list.js +69 -64
- package/dist/components/members-list.js.map +1 -1
- package/dist/components/redirect-to-sign-in.cjs +34 -1
- package/dist/components/redirect-to-sign-in.cjs.map +1 -1
- package/dist/components/redirect-to-sign-in.js +28 -20
- package/dist/components/redirect-to-sign-in.js.map +1 -1
- package/dist/components/sign-in-button.cjs +36 -1
- package/dist/components/sign-in-button.cjs.map +1 -1
- package/dist/components/sign-in-button.js +25 -21
- package/dist/components/sign-in-button.js.map +1 -1
- package/dist/components/ui/avatar.cjs +42 -1
- package/dist/components/ui/avatar.cjs.map +1 -1
- package/dist/components/ui/avatar.js +23 -23
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/dropdown-menu.cjs +148 -1
- package/dist/components/ui/dropdown-menu.cjs.map +1 -1
- package/dist/components/ui/dropdown-menu.js +83 -81
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/user-avatar.cjs +22 -1
- package/dist/components/user-avatar.cjs.map +1 -1
- package/dist/components/user-avatar.js +16 -16
- package/dist/components/user-avatar.js.map +1 -1
- package/dist/components/user-button/styles.cjs +39 -1
- package/dist/components/user-button/styles.cjs.map +1 -1
- package/dist/components/user-button/styles.js +6 -5
- package/dist/components/user-button/styles.js.map +1 -1
- package/dist/components/user-button/user-button.cjs +98 -1
- package/dist/components/user-button/user-button.cjs.map +1 -1
- package/dist/components/user-button/user-button.js +64 -58
- package/dist/components/user-button/user-button.js.map +1 -1
- package/dist/hooks/index.cjs +14 -0
- package/dist/hooks/index.cjs.map +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +14 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/use-auth.cjs +44 -1
- package/dist/hooks/use-auth.cjs.map +1 -1
- package/dist/hooks/use-auth.d.ts +13 -15
- package/dist/hooks/use-auth.d.ts.map +1 -1
- package/dist/hooks/use-auth.js +30 -26
- package/dist/hooks/use-auth.js.map +1 -1
- package/dist/hooks/use-client.cjs +9 -1
- package/dist/hooks/use-client.cjs.map +1 -1
- package/dist/hooks/use-client.d.ts +1 -1
- package/dist/hooks/use-client.d.ts.map +1 -1
- package/dist/hooks/use-client.js +6 -5
- package/dist/hooks/use-client.js.map +1 -1
- package/dist/hooks/use-members.cjs +60 -1
- package/dist/hooks/use-members.cjs.map +1 -1
- package/dist/hooks/use-members.js +53 -41
- package/dist/hooks/use-members.js.map +1 -1
- package/dist/hooks/use-store.cjs +17 -1
- package/dist/hooks/use-store.cjs.map +1 -1
- package/dist/hooks/use-store.js +7 -7
- package/dist/hooks/use-store.js.map +1 -1
- package/dist/index.cjs +37 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +35 -35
- package/dist/lib/utils.cjs +8 -1
- package/dist/lib/utils.cjs.map +1 -1
- package/dist/lib/utils.js +5 -5
- package/dist/lib/utils.js.map +1 -1
- package/dist/lib/variants.cjs +46 -1
- package/dist/lib/variants.cjs.map +1 -1
- package/dist/lib/variants.js +6 -5
- package/dist/lib/variants.js.map +1 -1
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.cjs +721 -1
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.cjs.map +1 -1
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +571 -377
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js.map +1 -1
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.cjs +625 -1
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.cjs.map +1 -1
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +539 -316
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js.map +1 -1
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs +313 -1
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs.map +1 -1
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +261 -172
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js.map +1 -1
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.cjs +154 -1
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.cjs.map +1 -1
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.cjs +173 -1
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.cjs.map +1 -1
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +144 -107
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +1 -1
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +111 -87
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js.map +1 -1
- package/dist/node_modules/@radix-ui/primitive/dist/index.cjs +11 -1
- package/dist/node_modules/@radix-ui/primitive/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/primitive/dist/index.js +7 -5
- package/dist/node_modules/@radix-ui/primitive/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.cjs +42 -1
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +17 -16
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-avatar/dist/index.cjs +140 -1
- package/dist/node_modules/@radix-ui/react-avatar/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +105 -57
- package/dist/node_modules/@radix-ui/react-avatar/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-context/dist/index.cjs +80 -1
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-context/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-context/dist/index.js +49 -41
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-context/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-primitive/dist/index.cjs +56 -1
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-primitive/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-primitive/dist/index.js +17 -10
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-primitive/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-slot/dist/index.cjs +119 -1
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-slot/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-slot/dist/index.js +86 -42
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-collection/dist/index.cjs +70 -1
- package/dist/node_modules/@radix-ui/react-collection/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-collection/dist/index.js +57 -37
- package/dist/node_modules/@radix-ui/react-collection/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.cjs +56 -1
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +29 -19
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-context/dist/index.cjs +79 -1
- package/dist/node_modules/@radix-ui/react-context/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-context/dist/index.js +48 -39
- package/dist/node_modules/@radix-ui/react-context/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-direction/dist/index.cjs +27 -1
- package/dist/node_modules/@radix-ui/react-direction/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-direction/dist/index.js +6 -6
- package/dist/node_modules/@radix-ui/react-direction/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs +229 -1
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +182 -97
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.cjs +296 -1
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +232 -167
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.cjs +46 -1
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +23 -11
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.cjs +224 -1
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +169 -98
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-id/dist/index.cjs +31 -1
- package/dist/node_modules/@radix-ui/react-id/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-id/dist/index.js +11 -10
- package/dist/node_modules/@radix-ui/react-id/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-menu/dist/index.cjs +845 -1
- package/dist/node_modules/@radix-ui/react-menu/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-menu/dist/index.js +662 -442
- package/dist/node_modules/@radix-ui/react-menu/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-popper/dist/index.cjs +308 -1
- package/dist/node_modules/@radix-ui/react-popper/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js +209 -137
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-portal/dist/index.cjs +34 -1
- package/dist/node_modules/@radix-ui/react-portal/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-portal/dist/index.js +14 -12
- package/dist/node_modules/@radix-ui/react-portal/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-presence/dist/index.cjs +145 -1
- package/dist/node_modules/@radix-ui/react-presence/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js +103 -45
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.cjs +61 -1
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +21 -14
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.cjs +244 -1
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +179 -135
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-slot/dist/index.cjs +105 -1
- package/dist/node_modules/@radix-ui/react-slot/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +74 -35
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs +28 -1
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +8 -7
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs +86 -1
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +57 -40
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.cjs +34 -1
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +13 -10
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.cjs +15 -1
- package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +8 -8
- package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.cjs +23 -1
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +3 -3
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.cjs +56 -1
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +34 -22
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.js.map +1 -1
- package/dist/node_modules/aria-hidden/dist/es2015/index.cjs +122 -1
- package/dist/node_modules/aria-hidden/dist/es2015/index.cjs.map +1 -1
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +111 -41
- package/dist/node_modules/aria-hidden/dist/es2015/index.js.map +1 -1
- package/dist/node_modules/class-variance-authority/dist/index.cjs +45 -1
- package/dist/node_modules/class-variance-authority/dist/index.cjs.map +1 -1
- package/dist/node_modules/class-variance-authority/dist/index.js +40 -30
- package/dist/node_modules/class-variance-authority/dist/index.js.map +1 -1
- package/dist/node_modules/clsx/dist/clsx.cjs +17 -1
- package/dist/node_modules/clsx/dist/clsx.cjs.map +1 -1
- package/dist/node_modules/clsx/dist/clsx.js +13 -13
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
- package/dist/node_modules/get-nonce/dist/es2015/index.cjs +9 -1
- package/dist/node_modules/get-nonce/dist/es2015/index.cjs.map +1 -1
- package/dist/node_modules/get-nonce/dist/es2015/index.js +5 -3
- package/dist/node_modules/get-nonce/dist/es2015/index.js.map +1 -1
- package/dist/node_modules/js-cookie/dist/js.cookie.cjs +98 -1
- package/dist/node_modules/js-cookie/dist/js.cookie.cjs.map +1 -1
- package/dist/node_modules/js-cookie/dist/js.cookie.js +69 -43
- package/dist/node_modules/js-cookie/dist/js.cookie.js.map +1 -1
- package/dist/node_modules/jwt-decode/build/esm/index.cjs +58 -1
- package/dist/node_modules/jwt-decode/build/esm/index.cjs.map +1 -1
- package/dist/node_modules/jwt-decode/build/esm/index.js +36 -30
- package/dist/node_modules/jwt-decode/build/esm/index.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/Icon.cjs +34 -1
- package/dist/node_modules/lucide-react/dist/esm/Icon.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/Icon.js +25 -25
- package/dist/node_modules/lucide-react/dist/esm/Icon.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.cjs +21 -1
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +16 -15
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.cjs +13 -1
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +2 -2
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/check.cjs +7 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/check.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/check.js +5 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/check.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.cjs +7 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.js +5 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/circle.cjs +7 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/circle.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/circle.js +5 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/circle.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/log-out.cjs +11 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/log-out.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/log-out.js +6 -5
- package/dist/node_modules/lucide-react/dist/esm/icons/log-out.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.cjs +26 -1
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +22 -14
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js.map +1 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.cjs +27 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.cjs.map +1 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +8 -8
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js.map +1 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.cjs +197 -4
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.cjs.map +1 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +163 -98
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js.map +1 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.cjs +55 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.cjs.map +1 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +31 -24
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js.map +1 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.cjs +19 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.cjs.map +1 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +12 -9
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js.map +1 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.cjs +102 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.cjs.map +1 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +85 -51
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js.map +1 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/medium.cjs +5 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/medium.cjs.map +1 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +3 -3
- package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js.map +1 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.cjs +6 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.cjs.map +1 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +5 -5
- package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js.map +1 -1
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.cjs +62 -36
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.cjs.map +1 -1
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +41 -65
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js.map +1 -1
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.cjs +10 -1
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.cjs.map +1 -1
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +8 -5
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js.map +1 -1
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.cjs +37 -1
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.cjs.map +1 -1
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +28 -16
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js.map +1 -1
- package/dist/node_modules/react-style-singleton/dist/es2015/component.cjs +13 -1
- package/dist/node_modules/react-style-singleton/dist/es2015/component.cjs.map +1 -1
- package/dist/node_modules/react-style-singleton/dist/es2015/component.js +9 -7
- package/dist/node_modules/react-style-singleton/dist/es2015/component.js.map +1 -1
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.cjs +33 -1
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.cjs.map +1 -1
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +11 -10
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.js.map +1 -1
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.cjs +48 -1
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.cjs.map +1 -1
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +35 -17
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js.map +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.cjs +3014 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.cjs.map +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +804 -555
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
- package/dist/node_modules/tailwindcss/dist/plugin.cjs +12 -1
- package/dist/node_modules/tailwindcss/dist/plugin.cjs.map +1 -1
- package/dist/node_modules/tailwindcss/dist/plugin.js +8 -8
- package/dist/node_modules/tailwindcss/dist/plugin.js.map +1 -1
- package/dist/node_modules/tslib/tslib.es6.cjs +38 -1
- package/dist/node_modules/tslib/tslib.es6.cjs.map +1 -1
- package/dist/node_modules/tslib/tslib.es6.js +33 -21
- package/dist/node_modules/tslib/tslib.es6.js.map +1 -1
- package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.cjs +11 -1
- package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.cjs.map +1 -1
- package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +8 -3
- package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js.map +1 -1
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.cjs +52 -1
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.cjs.map +1 -1
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +28 -19
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js.map +1 -1
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.cjs +29 -1
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.cjs.map +1 -1
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +15 -11
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js.map +1 -1
- package/dist/node_modules/use-sidecar/dist/es2015/exports.cjs +38 -1
- package/dist/node_modules/use-sidecar/dist/es2015/exports.cjs.map +1 -1
- package/dist/node_modules/use-sidecar/dist/es2015/exports.js +15 -12
- package/dist/node_modules/use-sidecar/dist/es2015/exports.js.map +1 -1
- package/dist/node_modules/use-sidecar/dist/es2015/medium.cjs +88 -1
- package/dist/node_modules/use-sidecar/dist/es2015/medium.cjs.map +1 -1
- package/dist/node_modules/use-sidecar/dist/es2015/medium.js +64 -43
- package/dist/node_modules/use-sidecar/dist/es2015/medium.js.map +1 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.cjs +68 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.cjs.map +1 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +49 -39
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +1 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.cjs +53 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.cjs.map +1 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +39 -32
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +1 -1
- package/dist/node_modules/use-sync-external-store/shim/index.cjs +17 -1
- package/dist/node_modules/use-sync-external-store/shim/index.cjs.map +1 -1
- package/dist/node_modules/use-sync-external-store/shim/index.js +14 -7
- package/dist/node_modules/use-sync-external-store/shim/index.js.map +1 -1
- package/dist/providers/auth/auth.context.cjs +5 -1
- package/dist/providers/auth/auth.context.cjs.map +1 -1
- package/dist/providers/auth/auth.context.js +3 -3
- package/dist/providers/auth/auth.context.js.map +1 -1
- package/dist/providers/auth/auth.hook.cjs +12 -1
- package/dist/providers/auth/auth.hook.cjs.map +1 -1
- package/dist/providers/auth/auth.hook.js +8 -7
- package/dist/providers/auth/auth.hook.js.map +1 -1
- package/dist/providers/auth/auth.provider.cjs +37 -1
- package/dist/providers/auth/auth.provider.cjs.map +1 -1
- package/dist/providers/auth/auth.provider.js +31 -22
- package/dist/providers/auth/auth.provider.js.map +1 -1
- package/dist/providers/blimu/blimu.context.cjs +5 -1
- package/dist/providers/blimu/blimu.context.cjs.map +1 -1
- package/dist/providers/blimu/blimu.context.js +3 -3
- package/dist/providers/blimu/blimu.context.js.map +1 -1
- package/dist/providers/blimu/blimu.hook.cjs +12 -1
- package/dist/providers/blimu/blimu.hook.cjs.map +1 -1
- package/dist/providers/blimu/blimu.hook.js +8 -7
- package/dist/providers/blimu/blimu.hook.js.map +1 -1
- package/dist/providers/blimu/blimu.provider.cjs +71 -1
- package/dist/providers/blimu/blimu.provider.cjs.map +1 -1
- package/dist/providers/blimu/blimu.provider.js +32 -27
- package/dist/providers/blimu/blimu.provider.js.map +1 -1
- package/dist/providers/index.cjs +13 -0
- package/dist/providers/index.cjs.map +1 -0
- package/dist/providers/index.js +13 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/theme/theme.context.cjs +5 -1
- package/dist/providers/theme/theme.context.cjs.map +1 -1
- package/dist/providers/theme/theme.context.js +3 -3
- package/dist/providers/theme/theme.context.js.map +1 -1
- package/dist/providers/theme/theme.hook.cjs +12 -1
- package/dist/providers/theme/theme.hook.cjs.map +1 -1
- package/dist/providers/theme/theme.hook.js +8 -7
- package/dist/providers/theme/theme.hook.js.map +1 -1
- package/dist/providers/theme/theme.provider.cjs +104 -1
- package/dist/providers/theme/theme.provider.cjs.map +1 -1
- package/dist/providers/theme/theme.provider.js +85 -48
- package/dist/providers/theme/theme.provider.js.map +1 -1
- package/dist/tailwind.cjs +200 -0
- package/dist/tailwind.cjs.map +1 -0
- package/dist/{tailwind.plugin.js → tailwind.js} +6 -6
- package/dist/tailwind.js.map +1 -0
- package/dist/types/index.cjs +11 -1
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.js +8 -8
- package/dist/types/index.js.map +1 -1
- package/dist/utils/publishable-key.cjs +62 -1
- package/dist/utils/publishable-key.cjs.map +1 -1
- package/dist/utils/publishable-key.js +52 -27
- package/dist/utils/publishable-key.js.map +1 -1
- package/package.json +41 -42
- package/dist/components.cjs +0 -2
- package/dist/components.cjs.map +0 -1
- package/dist/components.js +0 -13
- package/dist/components.js.map +0 -1
- package/dist/hooks.cjs +0 -2
- package/dist/hooks.cjs.map +0 -1
- package/dist/hooks.js +0 -14
- package/dist/hooks.js.map +0 -1
- package/dist/providers.cjs +0 -2
- package/dist/providers.cjs.map +0 -1
- package/dist/providers.js +0 -13
- package/dist/providers.js.map +0 -1
- package/dist/tailwind.plugin.cjs +0 -2
- package/dist/tailwind.plugin.cjs.map +0 -1
- package/dist/tailwind.plugin.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"members-list.cjs","sources":["../../src/components/members-list.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { UserAvatar } from './user-avatar';\nimport { cn } from '../lib/utils';\n\nimport { useMembers, type ResourceMember } from '../hooks/use-members';\n\nexport interface MembersListProps {\n /**\n * Resource type (e.g., 'organization', 'workspace')\n */\n resourceType: string;\n\n /**\n * Resource ID\n */\n resourceId: string;\n\n /**\n * Initial page number\n * @default 1\n */\n initialPage?: number;\n\n /**\n * Items per page\n * @default 20\n */\n pageSize?: number;\n\n /**\n * Search query\n */\n search?: string;\n\n /**\n * Custom render function for each member\n */\n renderMember?: (member: ResourceMember) => React.ReactNode;\n\n /**\n * Custom className\n */\n className?: string;\n\n /**\n * Show pagination controls\n * @default true\n */\n showPagination?: boolean;\n}\n\n/**\n * Paginated list of organization/resource members\n *\n * @example\n * ```tsx\n * <MembersList\n * resourceType=\"organization\"\n * resourceId=\"org_123\"\n * />\n * ```\n *\n * @example With custom rendering\n * ```tsx\n * <MembersList\n * resourceType=\"workspace\"\n * resourceId=\"ws_456\"\n * renderMember={(member) => (\n * <div className=\"flex items-center gap-2\">\n * <UserAvatar src={member.user.avatarUrl} alt={member.user.email} />\n * <div>\n * <p>{member.user.firstName} {member.user.lastName}</p>\n * <p className=\"text-sm text-muted-foreground\">{member.user.email}</p>\n * </div>\n * <Badge>{member.role}</Badge>\n * </div>\n * )}\n * />\n * ```\n */\nexport function MembersList({\n resourceType,\n resourceId,\n initialPage = 1,\n pageSize = 20,\n search,\n renderMember,\n className,\n showPagination = true,\n}: MembersListProps) {\n const [page, setPage] = React.useState(initialPage);\n const { members, total, isLoading, error, hasNextPage, hasPreviousPage, refetch } = useMembers({\n resourceType,\n resourceId,\n page,\n limit: pageSize,\n search,\n });\n\n const defaultRenderMember = (member: ResourceMember) => {\n const displayName =\n member.user.firstName && member.user.lastName\n ? `${member.user.firstName} ${member.user.lastName}`\n : member.user.firstName || member.user.email?.split('@')[0] || 'User';\n\n return (\n <div className=\"flex items-center justify-between p-3 rounded-blimu hover:bg-blimu-accent transition-colors\">\n <div className=\"flex items-center gap-3\">\n <UserAvatar\n src={member.user.avatarUrl || undefined}\n alt={member.user.email}\n fallback={displayName}\n size=\"default\"\n />\n <div className=\"flex flex-col\">\n <p className=\"text-sm font-medium text-blimu-foreground\">{displayName}</p>\n <p className=\"text-xs text-blimu-muted-foreground\">{member.user.email}</p>\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n {member.inherited && (\n <span className=\"text-xs text-blimu-muted-foreground\">(inherited)</span>\n )}\n <span className=\"text-xs font-medium text-blimu-foreground bg-blimu-muted px-2 py-1 rounded-blimu-sm\">\n {member.role}\n </span>\n </div>\n </div>\n );\n };\n\n if (error) {\n return (\n <div className={cn('p-4 text-center', className)}>\n <p className=\"text-sm text-blimu-destructive\">Error loading members: {error.message}</p>\n <button\n onClick={() => refetch()}\n className=\"mt-2 text-sm text-blimu-primary hover:underline\"\n >\n Retry\n </button>\n </div>\n );\n }\n\n if (isLoading && members.length === 0) {\n return (\n <div className={cn('p-4 text-center', className)}>\n <p className=\"text-sm text-blimu-muted-foreground\">Loading members...</p>\n </div>\n );\n }\n\n if (members.length === 0) {\n return (\n <div className={cn('p-4 text-center', className)}>\n <p className=\"text-sm text-blimu-muted-foreground\">No members found</p>\n </div>\n );\n }\n\n const totalPages = Math.ceil(total / pageSize);\n\n return (\n <div className={cn('flex flex-col', className)}>\n <div className=\"flex flex-col divide-y divide-blimu-border\">\n {members.map((member) => (\n <div key={member.userId}>\n {renderMember ? renderMember(member) : defaultRenderMember(member)}\n </div>\n ))}\n </div>\n\n {showPagination && totalPages > 1 && (\n <div className=\"flex items-center justify-between mt-4 pt-4 border-t border-blimu-border\">\n <div className=\"text-sm text-blimu-muted-foreground\">\n Showing {(page - 1) * pageSize + 1} to {Math.min(page * pageSize, total)} of {total}{' '}\n members\n </div>\n <div className=\"flex items-center gap-2\">\n <button\n onClick={() => setPage((p) => Math.max(1, p - 1))}\n disabled={!hasPreviousPage || isLoading}\n className=\"px-3 py-1 text-sm rounded-blimu border border-blimu-input bg-blimu-background hover:bg-blimu-accent disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n Previous\n </button>\n <span className=\"text-sm text-blimu-foreground\">\n Page {page} of {totalPages}\n </span>\n <button\n onClick={() => setPage((p) => Math.min(totalPages, p + 1))}\n disabled={!hasNextPage || isLoading}\n className=\"px-3 py-1 text-sm rounded-blimu border border-blimu-input bg-blimu-background hover:bg-blimu-accent disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n Next\n </button>\n </div>\n </div>\n )}\n </div>\n );\n}\n"],"names":["
|
|
1
|
+
{"version":3,"file":"members-list.cjs","sources":["../../src/components/members-list.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { UserAvatar } from './user-avatar';\nimport { cn } from '../lib/utils';\n\nimport { useMembers, type ResourceMember } from '../hooks/use-members';\n\nexport interface MembersListProps {\n /**\n * Resource type (e.g., 'organization', 'workspace')\n */\n resourceType: string;\n\n /**\n * Resource ID\n */\n resourceId: string;\n\n /**\n * Initial page number\n * @default 1\n */\n initialPage?: number;\n\n /**\n * Items per page\n * @default 20\n */\n pageSize?: number;\n\n /**\n * Search query\n */\n search?: string;\n\n /**\n * Custom render function for each member\n */\n renderMember?: (member: ResourceMember) => React.ReactNode;\n\n /**\n * Custom className\n */\n className?: string;\n\n /**\n * Show pagination controls\n * @default true\n */\n showPagination?: boolean;\n}\n\n/**\n * Paginated list of organization/resource members\n *\n * @example\n * ```tsx\n * <MembersList\n * resourceType=\"organization\"\n * resourceId=\"org_123\"\n * />\n * ```\n *\n * @example With custom rendering\n * ```tsx\n * <MembersList\n * resourceType=\"workspace\"\n * resourceId=\"ws_456\"\n * renderMember={(member) => (\n * <div className=\"flex items-center gap-2\">\n * <UserAvatar src={member.user.avatarUrl} alt={member.user.email} />\n * <div>\n * <p>{member.user.firstName} {member.user.lastName}</p>\n * <p className=\"text-sm text-muted-foreground\">{member.user.email}</p>\n * </div>\n * <Badge>{member.role}</Badge>\n * </div>\n * )}\n * />\n * ```\n */\nexport function MembersList({\n resourceType,\n resourceId,\n initialPage = 1,\n pageSize = 20,\n search,\n renderMember,\n className,\n showPagination = true,\n}: MembersListProps) {\n const [page, setPage] = React.useState(initialPage);\n const { members, total, isLoading, error, hasNextPage, hasPreviousPage, refetch } = useMembers({\n resourceType,\n resourceId,\n page,\n limit: pageSize,\n search,\n });\n\n const defaultRenderMember = (member: ResourceMember) => {\n const displayName =\n member.user.firstName && member.user.lastName\n ? `${member.user.firstName} ${member.user.lastName}`\n : member.user.firstName || member.user.email?.split('@')[0] || 'User';\n\n return (\n <div className=\"flex items-center justify-between p-3 rounded-blimu hover:bg-blimu-accent transition-colors\">\n <div className=\"flex items-center gap-3\">\n <UserAvatar\n src={member.user.avatarUrl || undefined}\n alt={member.user.email}\n fallback={displayName}\n size=\"default\"\n />\n <div className=\"flex flex-col\">\n <p className=\"text-sm font-medium text-blimu-foreground\">{displayName}</p>\n <p className=\"text-xs text-blimu-muted-foreground\">{member.user.email}</p>\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n {member.inherited && (\n <span className=\"text-xs text-blimu-muted-foreground\">(inherited)</span>\n )}\n <span className=\"text-xs font-medium text-blimu-foreground bg-blimu-muted px-2 py-1 rounded-blimu-sm\">\n {member.role}\n </span>\n </div>\n </div>\n );\n };\n\n if (error) {\n return (\n <div className={cn('p-4 text-center', className)}>\n <p className=\"text-sm text-blimu-destructive\">Error loading members: {error.message}</p>\n <button\n onClick={() => refetch()}\n className=\"mt-2 text-sm text-blimu-primary hover:underline\"\n >\n Retry\n </button>\n </div>\n );\n }\n\n if (isLoading && members.length === 0) {\n return (\n <div className={cn('p-4 text-center', className)}>\n <p className=\"text-sm text-blimu-muted-foreground\">Loading members...</p>\n </div>\n );\n }\n\n if (members.length === 0) {\n return (\n <div className={cn('p-4 text-center', className)}>\n <p className=\"text-sm text-blimu-muted-foreground\">No members found</p>\n </div>\n );\n }\n\n const totalPages = Math.ceil(total / pageSize);\n\n return (\n <div className={cn('flex flex-col', className)}>\n <div className=\"flex flex-col divide-y divide-blimu-border\">\n {members.map((member) => (\n <div key={member.userId}>\n {renderMember ? renderMember(member) : defaultRenderMember(member)}\n </div>\n ))}\n </div>\n\n {showPagination && totalPages > 1 && (\n <div className=\"flex items-center justify-between mt-4 pt-4 border-t border-blimu-border\">\n <div className=\"text-sm text-blimu-muted-foreground\">\n Showing {(page - 1) * pageSize + 1} to {Math.min(page * pageSize, total)} of {total}{' '}\n members\n </div>\n <div className=\"flex items-center gap-2\">\n <button\n onClick={() => setPage((p) => Math.max(1, p - 1))}\n disabled={!hasPreviousPage || isLoading}\n className=\"px-3 py-1 text-sm rounded-blimu border border-blimu-input bg-blimu-background hover:bg-blimu-accent disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n Previous\n </button>\n <span className=\"text-sm text-blimu-foreground\">\n Page {page} of {totalPages}\n </span>\n <button\n onClick={() => setPage((p) => Math.min(totalPages, p + 1))}\n disabled={!hasNextPage || isLoading}\n className=\"px-3 py-1 text-sm rounded-blimu border border-blimu-input bg-blimu-background hover:bg-blimu-accent disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n Next\n </button>\n </div>\n </div>\n )}\n </div>\n );\n}\n"],"names":["React","useMembers","jsxs","jsx","UserAvatar","cn"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAiFO,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA,iBAAiB;AACnB,GAAqB;AACnB,QAAM,CAAC,MAAM,OAAO,IAAIA,iBAAM,SAAS,WAAW;AAClD,QAAM,EAAE,SAAS,OAAO,WAAW,OAAO,aAAa,iBAAiB,QAAA,IAAYC,sBAAW;AAAA,IAC7F;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP;AAAA,EAAA,CACD;AAED,QAAM,sBAAsB,CAAC,WAA2B;AACtD,UAAM,cACJ,OAAO,KAAK,aAAa,OAAO,KAAK,WACjC,GAAG,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,QAAQ,KAChD,OAAO,KAAK,aAAa,OAAO,KAAK,OAAO,MAAM,GAAG,EAAE,CAAC,KAAK;AAEnE,WACEC,2BAAAA,KAAC,OAAA,EAAI,WAAU,+FACb,UAAA;AAAA,MAAAA,2BAAAA,KAAC,OAAA,EAAI,WAAU,2BACb,UAAA;AAAA,QAAAC,2BAAAA;AAAAA,UAACC,WAAAA;AAAAA,UAAA;AAAA,YACC,KAAK,OAAO,KAAK,aAAa;AAAA,YAC9B,KAAK,OAAO,KAAK;AAAA,YACjB,UAAU;AAAA,YACV,MAAK;AAAA,UAAA;AAAA,QAAA;AAAA,QAEPF,2BAAAA,KAAC,OAAA,EAAI,WAAU,iBACb,UAAA;AAAA,UAAAC,2BAAAA,IAAC,KAAA,EAAE,WAAU,6CAA6C,UAAA,aAAY;AAAA,yCACrE,KAAA,EAAE,WAAU,uCAAuC,UAAA,OAAO,KAAK,MAAA,CAAM;AAAA,QAAA,EAAA,CACxE;AAAA,MAAA,GACF;AAAA,MACAD,2BAAAA,KAAC,OAAA,EAAI,WAAU,2BACZ,UAAA;AAAA,QAAA,OAAO,aACNC,2BAAAA,IAAC,QAAA,EAAK,WAAU,uCAAsC,UAAA,eAAW;AAAA,QAEnEA,2BAAAA,IAAC,QAAA,EAAK,WAAU,uFACb,iBAAO,KAAA,CACV;AAAA,MAAA,EAAA,CACF;AAAA,IAAA,GACF;AAAA,EAEJ;AAEA,MAAI,OAAO;AACT,2CACG,OAAA,EAAI,WAAWE,MAAAA,GAAG,mBAAmB,SAAS,GAC7C,UAAA;AAAA,MAAAH,2BAAAA,KAAC,KAAA,EAAE,WAAU,kCAAiC,UAAA;AAAA,QAAA;AAAA,QAAwB,MAAM;AAAA,MAAA,GAAQ;AAAA,MACpFC,2BAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC,SAAS,MAAM,QAAA;AAAA,UACf,WAAU;AAAA,UACX,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAED,GACF;AAAA,EAEJ;AAEA,MAAI,aAAa,QAAQ,WAAW,GAAG;AACrC,WACEA,2BAAAA,IAAC,OAAA,EAAI,WAAWE,MAAAA,GAAG,mBAAmB,SAAS,GAC7C,UAAAF,2BAAAA,IAAC,KAAA,EAAE,WAAU,uCAAsC,UAAA,qBAAA,CAAkB,GACvE;AAAA,EAEJ;AAEA,MAAI,QAAQ,WAAW,GAAG;AACxB,WACEA,2BAAAA,IAAC,OAAA,EAAI,WAAWE,MAAAA,GAAG,mBAAmB,SAAS,GAC7C,UAAAF,2BAAAA,IAAC,KAAA,EAAE,WAAU,uCAAsC,UAAA,mBAAA,CAAgB,GACrE;AAAA,EAEJ;AAEA,QAAM,aAAa,KAAK,KAAK,QAAQ,QAAQ;AAE7C,yCACG,OAAA,EAAI,WAAWE,MAAAA,GAAG,iBAAiB,SAAS,GAC3C,UAAA;AAAA,IAAAF,2BAAAA,IAAC,SAAI,WAAU,8CACZ,kBAAQ,IAAI,CAAC,WACZA,2BAAAA,IAAC,OAAA,EACE,yBAAe,aAAa,MAAM,IAAI,oBAAoB,MAAM,KADzD,OAAO,MAEjB,CACD,GACH;AAAA,IAEC,kBAAkB,aAAa,KAC9BD,2BAAAA,KAAC,OAAA,EAAI,WAAU,4EACb,UAAA;AAAA,MAAAA,2BAAAA,KAAC,OAAA,EAAI,WAAU,uCAAsC,UAAA;AAAA,QAAA;AAAA,SACzC,OAAO,KAAK,WAAW;AAAA,QAAE;AAAA,QAAK,KAAK,IAAI,OAAO,UAAU,KAAK;AAAA,QAAE;AAAA,QAAK;AAAA,QAAO;AAAA,QAAI;AAAA,MAAA,GAE3F;AAAA,MACAA,2BAAAA,KAAC,OAAA,EAAI,WAAU,2BACb,UAAA;AAAA,QAAAC,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,SAAS,MAAM,QAAQ,CAAC,MAAM,KAAK,IAAI,GAAG,IAAI,CAAC,CAAC;AAAA,YAChD,UAAU,CAAC,mBAAmB;AAAA,YAC9B,WAAU;AAAA,YACX,UAAA;AAAA,UAAA;AAAA,QAAA;AAAA,QAGDD,2BAAAA,KAAC,QAAA,EAAK,WAAU,iCAAgC,UAAA;AAAA,UAAA;AAAA,UACxC;AAAA,UAAK;AAAA,UAAK;AAAA,QAAA,GAClB;AAAA,QACAC,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,SAAS,MAAM,QAAQ,CAAC,MAAM,KAAK,IAAI,YAAY,IAAI,CAAC,CAAC;AAAA,YACzD,UAAU,CAAC,eAAe;AAAA,YAC1B,WAAU;AAAA,YACX,UAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAED,EAAA,CACF;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GAEJ;AAEJ;;"}
|
|
@@ -1,102 +1,107 @@
|
|
|
1
|
-
import { jsxs
|
|
2
|
-
import * as
|
|
3
|
-
import { UserAvatar
|
|
4
|
-
import { cn
|
|
5
|
-
import { useMembers
|
|
6
|
-
function
|
|
7
|
-
resourceType
|
|
8
|
-
resourceId
|
|
9
|
-
initialPage
|
|
10
|
-
pageSize
|
|
11
|
-
search
|
|
12
|
-
renderMember
|
|
13
|
-
className
|
|
14
|
-
showPagination
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { UserAvatar } from "./user-avatar.js";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
import { useMembers } from "../hooks/use-members.js";
|
|
6
|
+
function MembersList({
|
|
7
|
+
resourceType,
|
|
8
|
+
resourceId,
|
|
9
|
+
initialPage = 1,
|
|
10
|
+
pageSize = 20,
|
|
11
|
+
search,
|
|
12
|
+
renderMember,
|
|
13
|
+
className,
|
|
14
|
+
showPagination = true
|
|
15
15
|
}) {
|
|
16
|
-
const [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
const [page, setPage] = React.useState(initialPage);
|
|
17
|
+
const { members, total, isLoading, error, hasNextPage, hasPreviousPage, refetch } = useMembers({
|
|
18
|
+
resourceType,
|
|
19
|
+
resourceId,
|
|
20
|
+
page,
|
|
21
|
+
limit: pageSize,
|
|
22
|
+
search
|
|
23
|
+
});
|
|
24
|
+
const defaultRenderMember = (member) => {
|
|
25
|
+
const displayName = member.user.firstName && member.user.lastName ? `${member.user.firstName} ${member.user.lastName}` : member.user.firstName || member.user.email?.split("@")[0] || "User";
|
|
26
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between p-3 rounded-blimu hover:bg-blimu-accent transition-colors", children: [
|
|
27
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
28
|
+
/* @__PURE__ */ jsx(
|
|
29
|
+
UserAvatar,
|
|
28
30
|
{
|
|
29
|
-
src:
|
|
30
|
-
alt:
|
|
31
|
-
fallback:
|
|
31
|
+
src: member.user.avatarUrl || void 0,
|
|
32
|
+
alt: member.user.email,
|
|
33
|
+
fallback: displayName,
|
|
32
34
|
size: "default"
|
|
33
35
|
}
|
|
34
36
|
),
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
|
|
38
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-blimu-foreground", children: displayName }),
|
|
39
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-blimu-muted-foreground", children: member.user.email })
|
|
38
40
|
] })
|
|
39
41
|
] }),
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
|
|
42
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
43
|
+
member.inherited && /* @__PURE__ */ jsx("span", { className: "text-xs text-blimu-muted-foreground", children: "(inherited)" }),
|
|
44
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-blimu-foreground bg-blimu-muted px-2 py-1 rounded-blimu-sm", children: member.role })
|
|
43
45
|
] })
|
|
44
46
|
] });
|
|
45
47
|
};
|
|
46
|
-
if (
|
|
47
|
-
return /* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */
|
|
48
|
+
if (error) {
|
|
49
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("p-4 text-center", className), children: [
|
|
50
|
+
/* @__PURE__ */ jsxs("p", { className: "text-sm text-blimu-destructive", children: [
|
|
49
51
|
"Error loading members: ",
|
|
50
|
-
|
|
52
|
+
error.message
|
|
51
53
|
] }),
|
|
52
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ jsx(
|
|
53
55
|
"button",
|
|
54
56
|
{
|
|
55
|
-
onClick: () =>
|
|
57
|
+
onClick: () => refetch(),
|
|
56
58
|
className: "mt-2 text-sm text-blimu-primary hover:underline",
|
|
57
59
|
children: "Retry"
|
|
58
60
|
}
|
|
59
61
|
)
|
|
60
62
|
] });
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
}
|
|
64
|
+
if (isLoading && members.length === 0) {
|
|
65
|
+
return /* @__PURE__ */ jsx("div", { className: cn("p-4 text-center", className), children: /* @__PURE__ */ jsx("p", { className: "text-sm text-blimu-muted-foreground", children: "Loading members..." }) });
|
|
66
|
+
}
|
|
67
|
+
if (members.length === 0) {
|
|
68
|
+
return /* @__PURE__ */ jsx("div", { className: cn("p-4 text-center", className), children: /* @__PURE__ */ jsx("p", { className: "text-sm text-blimu-muted-foreground", children: "No members found" }) });
|
|
69
|
+
}
|
|
70
|
+
const totalPages = Math.ceil(total / pageSize);
|
|
71
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col", className), children: [
|
|
72
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-col divide-y divide-blimu-border", children: members.map((member) => /* @__PURE__ */ jsx("div", { children: renderMember ? renderMember(member) : defaultRenderMember(member) }, member.userId)) }),
|
|
73
|
+
showPagination && totalPages > 1 && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mt-4 pt-4 border-t border-blimu-border", children: [
|
|
74
|
+
/* @__PURE__ */ jsxs("div", { className: "text-sm text-blimu-muted-foreground", children: [
|
|
70
75
|
"Showing ",
|
|
71
|
-
(
|
|
76
|
+
(page - 1) * pageSize + 1,
|
|
72
77
|
" to ",
|
|
73
|
-
Math.min(
|
|
78
|
+
Math.min(page * pageSize, total),
|
|
74
79
|
" of ",
|
|
75
|
-
|
|
80
|
+
total,
|
|
76
81
|
" ",
|
|
77
82
|
"members"
|
|
78
83
|
] }),
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
85
|
+
/* @__PURE__ */ jsx(
|
|
81
86
|
"button",
|
|
82
87
|
{
|
|
83
|
-
onClick: () =>
|
|
84
|
-
disabled: !
|
|
88
|
+
onClick: () => setPage((p) => Math.max(1, p - 1)),
|
|
89
|
+
disabled: !hasPreviousPage || isLoading,
|
|
85
90
|
className: "px-3 py-1 text-sm rounded-blimu border border-blimu-input bg-blimu-background hover:bg-blimu-accent disabled:opacity-50 disabled:cursor-not-allowed",
|
|
86
91
|
children: "Previous"
|
|
87
92
|
}
|
|
88
93
|
),
|
|
89
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ jsxs("span", { className: "text-sm text-blimu-foreground", children: [
|
|
90
95
|
"Page ",
|
|
91
|
-
|
|
96
|
+
page,
|
|
92
97
|
" of ",
|
|
93
|
-
|
|
98
|
+
totalPages
|
|
94
99
|
] }),
|
|
95
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ jsx(
|
|
96
101
|
"button",
|
|
97
102
|
{
|
|
98
|
-
onClick: () =>
|
|
99
|
-
disabled: !
|
|
103
|
+
onClick: () => setPage((p) => Math.min(totalPages, p + 1)),
|
|
104
|
+
disabled: !hasNextPage || isLoading,
|
|
100
105
|
className: "px-3 py-1 text-sm rounded-blimu border border-blimu-input bg-blimu-background hover:bg-blimu-accent disabled:opacity-50 disabled:cursor-not-allowed",
|
|
101
106
|
children: "Next"
|
|
102
107
|
}
|
|
@@ -106,6 +111,6 @@ function $({
|
|
|
106
111
|
] });
|
|
107
112
|
}
|
|
108
113
|
export {
|
|
109
|
-
|
|
114
|
+
MembersList
|
|
110
115
|
};
|
|
111
116
|
//# sourceMappingURL=members-list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"members-list.js","sources":["../../src/components/members-list.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { UserAvatar } from './user-avatar';\nimport { cn } from '../lib/utils';\n\nimport { useMembers, type ResourceMember } from '../hooks/use-members';\n\nexport interface MembersListProps {\n /**\n * Resource type (e.g., 'organization', 'workspace')\n */\n resourceType: string;\n\n /**\n * Resource ID\n */\n resourceId: string;\n\n /**\n * Initial page number\n * @default 1\n */\n initialPage?: number;\n\n /**\n * Items per page\n * @default 20\n */\n pageSize?: number;\n\n /**\n * Search query\n */\n search?: string;\n\n /**\n * Custom render function for each member\n */\n renderMember?: (member: ResourceMember) => React.ReactNode;\n\n /**\n * Custom className\n */\n className?: string;\n\n /**\n * Show pagination controls\n * @default true\n */\n showPagination?: boolean;\n}\n\n/**\n * Paginated list of organization/resource members\n *\n * @example\n * ```tsx\n * <MembersList\n * resourceType=\"organization\"\n * resourceId=\"org_123\"\n * />\n * ```\n *\n * @example With custom rendering\n * ```tsx\n * <MembersList\n * resourceType=\"workspace\"\n * resourceId=\"ws_456\"\n * renderMember={(member) => (\n * <div className=\"flex items-center gap-2\">\n * <UserAvatar src={member.user.avatarUrl} alt={member.user.email} />\n * <div>\n * <p>{member.user.firstName} {member.user.lastName}</p>\n * <p className=\"text-sm text-muted-foreground\">{member.user.email}</p>\n * </div>\n * <Badge>{member.role}</Badge>\n * </div>\n * )}\n * />\n * ```\n */\nexport function MembersList({\n resourceType,\n resourceId,\n initialPage = 1,\n pageSize = 20,\n search,\n renderMember,\n className,\n showPagination = true,\n}: MembersListProps) {\n const [page, setPage] = React.useState(initialPage);\n const { members, total, isLoading, error, hasNextPage, hasPreviousPage, refetch } = useMembers({\n resourceType,\n resourceId,\n page,\n limit: pageSize,\n search,\n });\n\n const defaultRenderMember = (member: ResourceMember) => {\n const displayName =\n member.user.firstName && member.user.lastName\n ? `${member.user.firstName} ${member.user.lastName}`\n : member.user.firstName || member.user.email?.split('@')[0] || 'User';\n\n return (\n <div className=\"flex items-center justify-between p-3 rounded-blimu hover:bg-blimu-accent transition-colors\">\n <div className=\"flex items-center gap-3\">\n <UserAvatar\n src={member.user.avatarUrl || undefined}\n alt={member.user.email}\n fallback={displayName}\n size=\"default\"\n />\n <div className=\"flex flex-col\">\n <p className=\"text-sm font-medium text-blimu-foreground\">{displayName}</p>\n <p className=\"text-xs text-blimu-muted-foreground\">{member.user.email}</p>\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n {member.inherited && (\n <span className=\"text-xs text-blimu-muted-foreground\">(inherited)</span>\n )}\n <span className=\"text-xs font-medium text-blimu-foreground bg-blimu-muted px-2 py-1 rounded-blimu-sm\">\n {member.role}\n </span>\n </div>\n </div>\n );\n };\n\n if (error) {\n return (\n <div className={cn('p-4 text-center', className)}>\n <p className=\"text-sm text-blimu-destructive\">Error loading members: {error.message}</p>\n <button\n onClick={() => refetch()}\n className=\"mt-2 text-sm text-blimu-primary hover:underline\"\n >\n Retry\n </button>\n </div>\n );\n }\n\n if (isLoading && members.length === 0) {\n return (\n <div className={cn('p-4 text-center', className)}>\n <p className=\"text-sm text-blimu-muted-foreground\">Loading members...</p>\n </div>\n );\n }\n\n if (members.length === 0) {\n return (\n <div className={cn('p-4 text-center', className)}>\n <p className=\"text-sm text-blimu-muted-foreground\">No members found</p>\n </div>\n );\n }\n\n const totalPages = Math.ceil(total / pageSize);\n\n return (\n <div className={cn('flex flex-col', className)}>\n <div className=\"flex flex-col divide-y divide-blimu-border\">\n {members.map((member) => (\n <div key={member.userId}>\n {renderMember ? renderMember(member) : defaultRenderMember(member)}\n </div>\n ))}\n </div>\n\n {showPagination && totalPages > 1 && (\n <div className=\"flex items-center justify-between mt-4 pt-4 border-t border-blimu-border\">\n <div className=\"text-sm text-blimu-muted-foreground\">\n Showing {(page - 1) * pageSize + 1} to {Math.min(page * pageSize, total)} of {total}{' '}\n members\n </div>\n <div className=\"flex items-center gap-2\">\n <button\n onClick={() => setPage((p) => Math.max(1, p - 1))}\n disabled={!hasPreviousPage || isLoading}\n className=\"px-3 py-1 text-sm rounded-blimu border border-blimu-input bg-blimu-background hover:bg-blimu-accent disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n Previous\n </button>\n <span className=\"text-sm text-blimu-foreground\">\n Page {page} of {totalPages}\n </span>\n <button\n onClick={() => setPage((p) => Math.min(totalPages, p + 1))}\n disabled={!hasNextPage || isLoading}\n className=\"px-3 py-1 text-sm rounded-blimu border border-blimu-input bg-blimu-background hover:bg-blimu-accent disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n Next\n </button>\n </div>\n </div>\n )}\n </div>\n );\n}\n"],"names":[
|
|
1
|
+
{"version":3,"file":"members-list.js","sources":["../../src/components/members-list.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { UserAvatar } from './user-avatar';\nimport { cn } from '../lib/utils';\n\nimport { useMembers, type ResourceMember } from '../hooks/use-members';\n\nexport interface MembersListProps {\n /**\n * Resource type (e.g., 'organization', 'workspace')\n */\n resourceType: string;\n\n /**\n * Resource ID\n */\n resourceId: string;\n\n /**\n * Initial page number\n * @default 1\n */\n initialPage?: number;\n\n /**\n * Items per page\n * @default 20\n */\n pageSize?: number;\n\n /**\n * Search query\n */\n search?: string;\n\n /**\n * Custom render function for each member\n */\n renderMember?: (member: ResourceMember) => React.ReactNode;\n\n /**\n * Custom className\n */\n className?: string;\n\n /**\n * Show pagination controls\n * @default true\n */\n showPagination?: boolean;\n}\n\n/**\n * Paginated list of organization/resource members\n *\n * @example\n * ```tsx\n * <MembersList\n * resourceType=\"organization\"\n * resourceId=\"org_123\"\n * />\n * ```\n *\n * @example With custom rendering\n * ```tsx\n * <MembersList\n * resourceType=\"workspace\"\n * resourceId=\"ws_456\"\n * renderMember={(member) => (\n * <div className=\"flex items-center gap-2\">\n * <UserAvatar src={member.user.avatarUrl} alt={member.user.email} />\n * <div>\n * <p>{member.user.firstName} {member.user.lastName}</p>\n * <p className=\"text-sm text-muted-foreground\">{member.user.email}</p>\n * </div>\n * <Badge>{member.role}</Badge>\n * </div>\n * )}\n * />\n * ```\n */\nexport function MembersList({\n resourceType,\n resourceId,\n initialPage = 1,\n pageSize = 20,\n search,\n renderMember,\n className,\n showPagination = true,\n}: MembersListProps) {\n const [page, setPage] = React.useState(initialPage);\n const { members, total, isLoading, error, hasNextPage, hasPreviousPage, refetch } = useMembers({\n resourceType,\n resourceId,\n page,\n limit: pageSize,\n search,\n });\n\n const defaultRenderMember = (member: ResourceMember) => {\n const displayName =\n member.user.firstName && member.user.lastName\n ? `${member.user.firstName} ${member.user.lastName}`\n : member.user.firstName || member.user.email?.split('@')[0] || 'User';\n\n return (\n <div className=\"flex items-center justify-between p-3 rounded-blimu hover:bg-blimu-accent transition-colors\">\n <div className=\"flex items-center gap-3\">\n <UserAvatar\n src={member.user.avatarUrl || undefined}\n alt={member.user.email}\n fallback={displayName}\n size=\"default\"\n />\n <div className=\"flex flex-col\">\n <p className=\"text-sm font-medium text-blimu-foreground\">{displayName}</p>\n <p className=\"text-xs text-blimu-muted-foreground\">{member.user.email}</p>\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n {member.inherited && (\n <span className=\"text-xs text-blimu-muted-foreground\">(inherited)</span>\n )}\n <span className=\"text-xs font-medium text-blimu-foreground bg-blimu-muted px-2 py-1 rounded-blimu-sm\">\n {member.role}\n </span>\n </div>\n </div>\n );\n };\n\n if (error) {\n return (\n <div className={cn('p-4 text-center', className)}>\n <p className=\"text-sm text-blimu-destructive\">Error loading members: {error.message}</p>\n <button\n onClick={() => refetch()}\n className=\"mt-2 text-sm text-blimu-primary hover:underline\"\n >\n Retry\n </button>\n </div>\n );\n }\n\n if (isLoading && members.length === 0) {\n return (\n <div className={cn('p-4 text-center', className)}>\n <p className=\"text-sm text-blimu-muted-foreground\">Loading members...</p>\n </div>\n );\n }\n\n if (members.length === 0) {\n return (\n <div className={cn('p-4 text-center', className)}>\n <p className=\"text-sm text-blimu-muted-foreground\">No members found</p>\n </div>\n );\n }\n\n const totalPages = Math.ceil(total / pageSize);\n\n return (\n <div className={cn('flex flex-col', className)}>\n <div className=\"flex flex-col divide-y divide-blimu-border\">\n {members.map((member) => (\n <div key={member.userId}>\n {renderMember ? renderMember(member) : defaultRenderMember(member)}\n </div>\n ))}\n </div>\n\n {showPagination && totalPages > 1 && (\n <div className=\"flex items-center justify-between mt-4 pt-4 border-t border-blimu-border\">\n <div className=\"text-sm text-blimu-muted-foreground\">\n Showing {(page - 1) * pageSize + 1} to {Math.min(page * pageSize, total)} of {total}{' '}\n members\n </div>\n <div className=\"flex items-center gap-2\">\n <button\n onClick={() => setPage((p) => Math.max(1, p - 1))}\n disabled={!hasPreviousPage || isLoading}\n className=\"px-3 py-1 text-sm rounded-blimu border border-blimu-input bg-blimu-background hover:bg-blimu-accent disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n Previous\n </button>\n <span className=\"text-sm text-blimu-foreground\">\n Page {page} of {totalPages}\n </span>\n <button\n onClick={() => setPage((p) => Math.min(totalPages, p + 1))}\n disabled={!hasNextPage || isLoading}\n className=\"px-3 py-1 text-sm rounded-blimu border border-blimu-input bg-blimu-background hover:bg-blimu-accent disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n Next\n </button>\n </div>\n </div>\n )}\n </div>\n );\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -1,2 +1,35 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const React = require("react");
|
|
4
|
+
const useAuth = require("../hooks/use-auth.cjs");
|
|
5
|
+
function RedirectToSignIn({
|
|
6
|
+
signUpFallbackRedirectUrl,
|
|
7
|
+
signInFallbackRedirectUrl,
|
|
8
|
+
forceRedirect = false
|
|
9
|
+
}) {
|
|
10
|
+
const { login, isAuthenticated, isLoading, isIdle } = useAuth.useAuth();
|
|
11
|
+
React.useEffect(() => {
|
|
12
|
+
const isReady = !isIdle;
|
|
13
|
+
if (!isReady || isLoading) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (!isAuthenticated || forceRedirect) {
|
|
17
|
+
let returnUrl = signInFallbackRedirectUrl || signUpFallbackRedirectUrl || window.location.href;
|
|
18
|
+
if (!returnUrl.startsWith("http")) {
|
|
19
|
+
returnUrl = `${window.location.origin}${returnUrl}`;
|
|
20
|
+
}
|
|
21
|
+
login(returnUrl);
|
|
22
|
+
}
|
|
23
|
+
}, [
|
|
24
|
+
isIdle,
|
|
25
|
+
isLoading,
|
|
26
|
+
isAuthenticated,
|
|
27
|
+
forceRedirect,
|
|
28
|
+
signInFallbackRedirectUrl,
|
|
29
|
+
signUpFallbackRedirectUrl,
|
|
30
|
+
login
|
|
31
|
+
]);
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
exports.RedirectToSignIn = RedirectToSignIn;
|
|
2
35
|
//# sourceMappingURL=redirect-to-sign-in.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redirect-to-sign-in.cjs","sources":["../../src/components/redirect-to-sign-in.tsx"],"sourcesContent":["import { useEffect } from 'react';\n\nimport { useAuth } from '../hooks/use-auth';\n\nexport interface RedirectToSignInProps {\n /**\n * URL to redirect to after sign up\n * Note: In Blimu, this is used as the return URL after authentication\n */\n signUpFallbackRedirectUrl?: string;\n /**\n * URL to redirect to after sign in\n * Note: In Blimu, this is used as the return URL after authentication\n */\n signInFallbackRedirectUrl?: string;\n /**\n * Force redirect even if already authenticated\n * @default false\n */\n forceRedirect?: boolean;\n}\n\n/**\n * Component that redirects unauthenticated users to the sign-in page\n *\n * This component automatically redirects users to the authentication page\n * when they are not authenticated. It matches Clerk's RedirectToSignIn API\n * for easier migration.\n *\n * @example\n * ```tsx\n * function ProtectedRoute() {\n * const { isAuthenticated } = useAuth();\n *\n * if (!isAuthenticated) {\n * return <RedirectToSignIn signInFallbackRedirectUrl=\"/dashboard\" />;\n * }\n *\n * return <ProtectedContent />;\n * }\n * ```\n */\nexport function RedirectToSignIn({\n signUpFallbackRedirectUrl,\n signInFallbackRedirectUrl,\n forceRedirect = false,\n}: RedirectToSignInProps) {\n const { login, isAuthenticated, isLoading, isIdle } = useAuth();\n\n useEffect(() => {\n // Wait for auth to be ready (not idle) and not loading\n const isReady = !isIdle;\n if (!isReady || isLoading) {\n return;\n }\n\n // Redirect if not authenticated or if force redirect is enabled\n if (!isAuthenticated || forceRedirect) {\n // Use signInFallbackRedirectUrl if provided, otherwise signUpFallbackRedirectUrl, otherwise current URL\n let returnUrl =\n signInFallbackRedirectUrl || signUpFallbackRedirectUrl || window.location.href;\n\n // if it's not a full URL, add the current origin\n if (!returnUrl.startsWith('http')) {\n returnUrl = `${window.location.origin}${returnUrl}`;\n }\n\n login(returnUrl);\n }\n }, [\n isIdle,\n isLoading,\n isAuthenticated,\n forceRedirect,\n signInFallbackRedirectUrl,\n signUpFallbackRedirectUrl,\n login,\n ]);\n\n // Return null while redirecting (component will unmount after redirect)\n return null;\n}\n"],"names":["
|
|
1
|
+
{"version":3,"file":"redirect-to-sign-in.cjs","sources":["../../src/components/redirect-to-sign-in.tsx"],"sourcesContent":["import { useEffect } from 'react';\n\nimport { useAuth } from '../hooks/use-auth';\n\nexport interface RedirectToSignInProps {\n /**\n * URL to redirect to after sign up\n * Note: In Blimu, this is used as the return URL after authentication\n */\n signUpFallbackRedirectUrl?: string;\n /**\n * URL to redirect to after sign in\n * Note: In Blimu, this is used as the return URL after authentication\n */\n signInFallbackRedirectUrl?: string;\n /**\n * Force redirect even if already authenticated\n * @default false\n */\n forceRedirect?: boolean;\n}\n\n/**\n * Component that redirects unauthenticated users to the sign-in page\n *\n * This component automatically redirects users to the authentication page\n * when they are not authenticated. It matches Clerk's RedirectToSignIn API\n * for easier migration.\n *\n * @example\n * ```tsx\n * function ProtectedRoute() {\n * const { isAuthenticated } = useAuth();\n *\n * if (!isAuthenticated) {\n * return <RedirectToSignIn signInFallbackRedirectUrl=\"/dashboard\" />;\n * }\n *\n * return <ProtectedContent />;\n * }\n * ```\n */\nexport function RedirectToSignIn({\n signUpFallbackRedirectUrl,\n signInFallbackRedirectUrl,\n forceRedirect = false,\n}: RedirectToSignInProps) {\n const { login, isAuthenticated, isLoading, isIdle } = useAuth();\n\n useEffect(() => {\n // Wait for auth to be ready (not idle) and not loading\n const isReady = !isIdle;\n if (!isReady || isLoading) {\n return;\n }\n\n // Redirect if not authenticated or if force redirect is enabled\n if (!isAuthenticated || forceRedirect) {\n // Use signInFallbackRedirectUrl if provided, otherwise signUpFallbackRedirectUrl, otherwise current URL\n let returnUrl =\n signInFallbackRedirectUrl || signUpFallbackRedirectUrl || window.location.href;\n\n // if it's not a full URL, add the current origin\n if (!returnUrl.startsWith('http')) {\n returnUrl = `${window.location.origin}${returnUrl}`;\n }\n\n login(returnUrl);\n }\n }, [\n isIdle,\n isLoading,\n isAuthenticated,\n forceRedirect,\n signInFallbackRedirectUrl,\n signUpFallbackRedirectUrl,\n login,\n ]);\n\n // Return null while redirecting (component will unmount after redirect)\n return null;\n}\n"],"names":["useAuth","useEffect"],"mappings":";;;;AA0CO,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA,gBAAgB;AAClB,GAA0B;AACxB,QAAM,EAAE,OAAO,iBAAiB,WAAW,OAAA,IAAWA,QAAAA,QAAA;AAEtDC,QAAAA,UAAU,MAAM;AAEd,UAAM,UAAU,CAAC;AACjB,QAAI,CAAC,WAAW,WAAW;AACzB;AAAA,IACF;AAGA,QAAI,CAAC,mBAAmB,eAAe;AAErC,UAAI,YACF,6BAA6B,6BAA6B,OAAO,SAAS;AAG5E,UAAI,CAAC,UAAU,WAAW,MAAM,GAAG;AACjC,oBAAY,GAAG,OAAO,SAAS,MAAM,GAAG,SAAS;AAAA,MACnD;AAEA,YAAM,SAAS;AAAA,IACjB;AAAA,EACF,GAAG;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,CACD;AAGD,SAAO;AACT;;"}
|
|
@@ -1,27 +1,35 @@
|
|
|
1
|
-
import { useEffect
|
|
2
|
-
import { useAuth
|
|
3
|
-
function
|
|
4
|
-
signUpFallbackRedirectUrl
|
|
5
|
-
signInFallbackRedirectUrl
|
|
6
|
-
forceRedirect
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import { useAuth } from "../hooks/use-auth.js";
|
|
3
|
+
function RedirectToSignIn({
|
|
4
|
+
signUpFallbackRedirectUrl,
|
|
5
|
+
signInFallbackRedirectUrl,
|
|
6
|
+
forceRedirect = false
|
|
7
7
|
}) {
|
|
8
|
-
const { login
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
const { login, isAuthenticated, isLoading, isIdle } = useAuth();
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
const isReady = !isIdle;
|
|
11
|
+
if (!isReady || isLoading) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
if (!isAuthenticated || forceRedirect) {
|
|
15
|
+
let returnUrl = signInFallbackRedirectUrl || signUpFallbackRedirectUrl || window.location.href;
|
|
16
|
+
if (!returnUrl.startsWith("http")) {
|
|
17
|
+
returnUrl = `${window.location.origin}${returnUrl}`;
|
|
18
|
+
}
|
|
19
|
+
login(returnUrl);
|
|
13
20
|
}
|
|
14
21
|
}, [
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
])
|
|
22
|
+
isIdle,
|
|
23
|
+
isLoading,
|
|
24
|
+
isAuthenticated,
|
|
25
|
+
forceRedirect,
|
|
26
|
+
signInFallbackRedirectUrl,
|
|
27
|
+
signUpFallbackRedirectUrl,
|
|
28
|
+
login
|
|
29
|
+
]);
|
|
30
|
+
return null;
|
|
23
31
|
}
|
|
24
32
|
export {
|
|
25
|
-
|
|
33
|
+
RedirectToSignIn
|
|
26
34
|
};
|
|
27
35
|
//# sourceMappingURL=redirect-to-sign-in.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redirect-to-sign-in.js","sources":["../../src/components/redirect-to-sign-in.tsx"],"sourcesContent":["import { useEffect } from 'react';\n\nimport { useAuth } from '../hooks/use-auth';\n\nexport interface RedirectToSignInProps {\n /**\n * URL to redirect to after sign up\n * Note: In Blimu, this is used as the return URL after authentication\n */\n signUpFallbackRedirectUrl?: string;\n /**\n * URL to redirect to after sign in\n * Note: In Blimu, this is used as the return URL after authentication\n */\n signInFallbackRedirectUrl?: string;\n /**\n * Force redirect even if already authenticated\n * @default false\n */\n forceRedirect?: boolean;\n}\n\n/**\n * Component that redirects unauthenticated users to the sign-in page\n *\n * This component automatically redirects users to the authentication page\n * when they are not authenticated. It matches Clerk's RedirectToSignIn API\n * for easier migration.\n *\n * @example\n * ```tsx\n * function ProtectedRoute() {\n * const { isAuthenticated } = useAuth();\n *\n * if (!isAuthenticated) {\n * return <RedirectToSignIn signInFallbackRedirectUrl=\"/dashboard\" />;\n * }\n *\n * return <ProtectedContent />;\n * }\n * ```\n */\nexport function RedirectToSignIn({\n signUpFallbackRedirectUrl,\n signInFallbackRedirectUrl,\n forceRedirect = false,\n}: RedirectToSignInProps) {\n const { login, isAuthenticated, isLoading, isIdle } = useAuth();\n\n useEffect(() => {\n // Wait for auth to be ready (not idle) and not loading\n const isReady = !isIdle;\n if (!isReady || isLoading) {\n return;\n }\n\n // Redirect if not authenticated or if force redirect is enabled\n if (!isAuthenticated || forceRedirect) {\n // Use signInFallbackRedirectUrl if provided, otherwise signUpFallbackRedirectUrl, otherwise current URL\n let returnUrl =\n signInFallbackRedirectUrl || signUpFallbackRedirectUrl || window.location.href;\n\n // if it's not a full URL, add the current origin\n if (!returnUrl.startsWith('http')) {\n returnUrl = `${window.location.origin}${returnUrl}`;\n }\n\n login(returnUrl);\n }\n }, [\n isIdle,\n isLoading,\n isAuthenticated,\n forceRedirect,\n signInFallbackRedirectUrl,\n signUpFallbackRedirectUrl,\n login,\n ]);\n\n // Return null while redirecting (component will unmount after redirect)\n return null;\n}\n"],"names":[
|
|
1
|
+
{"version":3,"file":"redirect-to-sign-in.js","sources":["../../src/components/redirect-to-sign-in.tsx"],"sourcesContent":["import { useEffect } from 'react';\n\nimport { useAuth } from '../hooks/use-auth';\n\nexport interface RedirectToSignInProps {\n /**\n * URL to redirect to after sign up\n * Note: In Blimu, this is used as the return URL after authentication\n */\n signUpFallbackRedirectUrl?: string;\n /**\n * URL to redirect to after sign in\n * Note: In Blimu, this is used as the return URL after authentication\n */\n signInFallbackRedirectUrl?: string;\n /**\n * Force redirect even if already authenticated\n * @default false\n */\n forceRedirect?: boolean;\n}\n\n/**\n * Component that redirects unauthenticated users to the sign-in page\n *\n * This component automatically redirects users to the authentication page\n * when they are not authenticated. It matches Clerk's RedirectToSignIn API\n * for easier migration.\n *\n * @example\n * ```tsx\n * function ProtectedRoute() {\n * const { isAuthenticated } = useAuth();\n *\n * if (!isAuthenticated) {\n * return <RedirectToSignIn signInFallbackRedirectUrl=\"/dashboard\" />;\n * }\n *\n * return <ProtectedContent />;\n * }\n * ```\n */\nexport function RedirectToSignIn({\n signUpFallbackRedirectUrl,\n signInFallbackRedirectUrl,\n forceRedirect = false,\n}: RedirectToSignInProps) {\n const { login, isAuthenticated, isLoading, isIdle } = useAuth();\n\n useEffect(() => {\n // Wait for auth to be ready (not idle) and not loading\n const isReady = !isIdle;\n if (!isReady || isLoading) {\n return;\n }\n\n // Redirect if not authenticated or if force redirect is enabled\n if (!isAuthenticated || forceRedirect) {\n // Use signInFallbackRedirectUrl if provided, otherwise signUpFallbackRedirectUrl, otherwise current URL\n let returnUrl =\n signInFallbackRedirectUrl || signUpFallbackRedirectUrl || window.location.href;\n\n // if it's not a full URL, add the current origin\n if (!returnUrl.startsWith('http')) {\n returnUrl = `${window.location.origin}${returnUrl}`;\n }\n\n login(returnUrl);\n }\n }, [\n isIdle,\n isLoading,\n isAuthenticated,\n forceRedirect,\n signInFallbackRedirectUrl,\n signUpFallbackRedirectUrl,\n login,\n ]);\n\n // Return null while redirecting (component will unmount after redirect)\n return null;\n}\n"],"names":[],"mappings":";;AA0CO,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA,gBAAgB;AAClB,GAA0B;AACxB,QAAM,EAAE,OAAO,iBAAiB,WAAW,OAAA,IAAW,QAAA;AAEtD,YAAU,MAAM;AAEd,UAAM,UAAU,CAAC;AACjB,QAAI,CAAC,WAAW,WAAW;AACzB;AAAA,IACF;AAGA,QAAI,CAAC,mBAAmB,eAAe;AAErC,UAAI,YACF,6BAA6B,6BAA6B,OAAO,SAAS;AAG5E,UAAI,CAAC,UAAU,WAAW,MAAM,GAAG;AACjC,oBAAY,GAAG,OAAO,SAAS,MAAM,GAAG,SAAS;AAAA,MACnD;AAEA,YAAM,SAAS;AAAA,IACjB;AAAA,EACF,GAAG;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,CACD;AAGD,SAAO;AACT;"}
|
|
@@ -1,2 +1,37 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
require("react");
|
|
5
|
+
const utils = require("../lib/utils.cjs");
|
|
6
|
+
const variants = require("../lib/variants.cjs");
|
|
7
|
+
const useAuth = require("../hooks/use-auth.cjs");
|
|
8
|
+
function SignInButton({
|
|
9
|
+
variant = "default",
|
|
10
|
+
size = "default",
|
|
11
|
+
redirectUrl,
|
|
12
|
+
className,
|
|
13
|
+
children = "Sign In",
|
|
14
|
+
...props
|
|
15
|
+
}) {
|
|
16
|
+
const { login, isAuthenticated } = useAuth.useAuth();
|
|
17
|
+
const handleClick = (e) => {
|
|
18
|
+
if (props.onClick) {
|
|
19
|
+
props.onClick(e);
|
|
20
|
+
}
|
|
21
|
+
if (!isAuthenticated) {
|
|
22
|
+
const returnUrl = redirectUrl || window.location.href;
|
|
23
|
+
login(returnUrl);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
27
|
+
"button",
|
|
28
|
+
{
|
|
29
|
+
className: utils.cn(variants.buttonVariants({ variant, size }), className),
|
|
30
|
+
onClick: handleClick,
|
|
31
|
+
...props,
|
|
32
|
+
children
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
exports.SignInButton = SignInButton;
|
|
2
37
|
//# sourceMappingURL=sign-in-button.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sign-in-button.cjs","sources":["../../src/components/sign-in-button.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '../lib/utils';\nimport { buttonVariants, type ButtonVariants } from '../lib/variants';\n\nimport { useAuth } from '../hooks/use-auth';\n\nexport interface SignInButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * Variant style\n * @default \"default\"\n */\n variant?: ButtonVariants['variant'];\n\n /**\n * Size variant\n * @default \"default\"\n */\n size?: ButtonVariants['size'];\n\n /**\n * URL to redirect to after sign-in\n */\n redirectUrl?: string;\n\n /**\n * Custom className\n */\n className?: string;\n\n /**\n * Button content\n */\n children?: React.ReactNode;\n}\n\n/**\n * Button component that triggers the authentication flow\n *\n * @example\n * ```tsx\n * <SignInButton>Sign In</SignInButton>\n * ```\n *\n * @example With custom variant and redirect\n * ```tsx\n * <SignInButton\n * variant=\"outline\"\n * size=\"lg\"\n * redirectUrl=\"/dashboard\"\n * >\n * Sign In to Dashboard\n * </SignInButton>\n * ```\n */\nexport function SignInButton({\n variant = 'default',\n size = 'default',\n redirectUrl,\n className,\n children = 'Sign In',\n ...props\n}: SignInButtonProps) {\n const { login, isAuthenticated } = useAuth();\n\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n if (props.onClick) {\n props.onClick(e);\n }\n\n if (!isAuthenticated) {\n const returnUrl = redirectUrl || window.location.href;\n login(returnUrl);\n }\n };\n\n return (\n <button\n className={cn(buttonVariants({ variant, size }), className)}\n onClick={handleClick}\n {...props}\n >\n {children}\n </button>\n );\n}\n"],"names":["
|
|
1
|
+
{"version":3,"file":"sign-in-button.cjs","sources":["../../src/components/sign-in-button.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '../lib/utils';\nimport { buttonVariants, type ButtonVariants } from '../lib/variants';\n\nimport { useAuth } from '../hooks/use-auth';\n\nexport interface SignInButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * Variant style\n * @default \"default\"\n */\n variant?: ButtonVariants['variant'];\n\n /**\n * Size variant\n * @default \"default\"\n */\n size?: ButtonVariants['size'];\n\n /**\n * URL to redirect to after sign-in\n */\n redirectUrl?: string;\n\n /**\n * Custom className\n */\n className?: string;\n\n /**\n * Button content\n */\n children?: React.ReactNode;\n}\n\n/**\n * Button component that triggers the authentication flow\n *\n * @example\n * ```tsx\n * <SignInButton>Sign In</SignInButton>\n * ```\n *\n * @example With custom variant and redirect\n * ```tsx\n * <SignInButton\n * variant=\"outline\"\n * size=\"lg\"\n * redirectUrl=\"/dashboard\"\n * >\n * Sign In to Dashboard\n * </SignInButton>\n * ```\n */\nexport function SignInButton({\n variant = 'default',\n size = 'default',\n redirectUrl,\n className,\n children = 'Sign In',\n ...props\n}: SignInButtonProps) {\n const { login, isAuthenticated } = useAuth();\n\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n if (props.onClick) {\n props.onClick(e);\n }\n\n if (!isAuthenticated) {\n const returnUrl = redirectUrl || window.location.href;\n login(returnUrl);\n }\n };\n\n return (\n <button\n className={cn(buttonVariants({ variant, size }), className)}\n onClick={handleClick}\n {...props}\n >\n {children}\n </button>\n );\n}\n"],"names":["useAuth","jsx","cn","buttonVariants"],"mappings":";;;;;;;AAuDO,SAAS,aAAa;AAAA,EAC3B,UAAU;AAAA,EACV,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,GAAG;AACL,GAAsB;AACpB,QAAM,EAAE,OAAO,gBAAA,IAAoBA,gBAAA;AAEnC,QAAM,cAAc,CAAC,MAA2C;AAC9D,QAAI,MAAM,SAAS;AACjB,YAAM,QAAQ,CAAC;AAAA,IACjB;AAEA,QAAI,CAAC,iBAAiB;AACpB,YAAM,YAAY,eAAe,OAAO,SAAS;AACjD,YAAM,SAAS;AAAA,IACjB;AAAA,EACF;AAEA,SACEC,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,MAAAA,GAAGC,wBAAe,EAAE,SAAS,KAAA,CAAM,GAAG,SAAS;AAAA,MAC1D,SAAS;AAAA,MACR,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EAAA;AAGP;;"}
|
|
@@ -1,33 +1,37 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { cn
|
|
4
|
-
import { buttonVariants
|
|
5
|
-
import { useAuth
|
|
6
|
-
function
|
|
7
|
-
variant
|
|
8
|
-
size
|
|
9
|
-
redirectUrl
|
|
10
|
-
className
|
|
11
|
-
children
|
|
12
|
-
...
|
|
3
|
+
import { cn } from "../lib/utils.js";
|
|
4
|
+
import { buttonVariants } from "../lib/variants.js";
|
|
5
|
+
import { useAuth } from "../hooks/use-auth.js";
|
|
6
|
+
function SignInButton({
|
|
7
|
+
variant = "default",
|
|
8
|
+
size = "default",
|
|
9
|
+
redirectUrl,
|
|
10
|
+
className,
|
|
11
|
+
children = "Sign In",
|
|
12
|
+
...props
|
|
13
13
|
}) {
|
|
14
|
-
const { login
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
e
|
|
14
|
+
const { login, isAuthenticated } = useAuth();
|
|
15
|
+
const handleClick = (e) => {
|
|
16
|
+
if (props.onClick) {
|
|
17
|
+
props.onClick(e);
|
|
18
|
+
}
|
|
19
|
+
if (!isAuthenticated) {
|
|
20
|
+
const returnUrl = redirectUrl || window.location.href;
|
|
21
|
+
login(returnUrl);
|
|
18
22
|
}
|
|
19
23
|
};
|
|
20
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ jsx(
|
|
21
25
|
"button",
|
|
22
26
|
{
|
|
23
|
-
className:
|
|
24
|
-
onClick:
|
|
25
|
-
...
|
|
26
|
-
children
|
|
27
|
+
className: cn(buttonVariants({ variant, size }), className),
|
|
28
|
+
onClick: handleClick,
|
|
29
|
+
...props,
|
|
30
|
+
children
|
|
27
31
|
}
|
|
28
32
|
);
|
|
29
33
|
}
|
|
30
34
|
export {
|
|
31
|
-
|
|
35
|
+
SignInButton
|
|
32
36
|
};
|
|
33
37
|
//# sourceMappingURL=sign-in-button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sign-in-button.js","sources":["../../src/components/sign-in-button.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '../lib/utils';\nimport { buttonVariants, type ButtonVariants } from '../lib/variants';\n\nimport { useAuth } from '../hooks/use-auth';\n\nexport interface SignInButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * Variant style\n * @default \"default\"\n */\n variant?: ButtonVariants['variant'];\n\n /**\n * Size variant\n * @default \"default\"\n */\n size?: ButtonVariants['size'];\n\n /**\n * URL to redirect to after sign-in\n */\n redirectUrl?: string;\n\n /**\n * Custom className\n */\n className?: string;\n\n /**\n * Button content\n */\n children?: React.ReactNode;\n}\n\n/**\n * Button component that triggers the authentication flow\n *\n * @example\n * ```tsx\n * <SignInButton>Sign In</SignInButton>\n * ```\n *\n * @example With custom variant and redirect\n * ```tsx\n * <SignInButton\n * variant=\"outline\"\n * size=\"lg\"\n * redirectUrl=\"/dashboard\"\n * >\n * Sign In to Dashboard\n * </SignInButton>\n * ```\n */\nexport function SignInButton({\n variant = 'default',\n size = 'default',\n redirectUrl,\n className,\n children = 'Sign In',\n ...props\n}: SignInButtonProps) {\n const { login, isAuthenticated } = useAuth();\n\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n if (props.onClick) {\n props.onClick(e);\n }\n\n if (!isAuthenticated) {\n const returnUrl = redirectUrl || window.location.href;\n login(returnUrl);\n }\n };\n\n return (\n <button\n className={cn(buttonVariants({ variant, size }), className)}\n onClick={handleClick}\n {...props}\n >\n {children}\n </button>\n );\n}\n"],"names":[
|
|
1
|
+
{"version":3,"file":"sign-in-button.js","sources":["../../src/components/sign-in-button.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '../lib/utils';\nimport { buttonVariants, type ButtonVariants } from '../lib/variants';\n\nimport { useAuth } from '../hooks/use-auth';\n\nexport interface SignInButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * Variant style\n * @default \"default\"\n */\n variant?: ButtonVariants['variant'];\n\n /**\n * Size variant\n * @default \"default\"\n */\n size?: ButtonVariants['size'];\n\n /**\n * URL to redirect to after sign-in\n */\n redirectUrl?: string;\n\n /**\n * Custom className\n */\n className?: string;\n\n /**\n * Button content\n */\n children?: React.ReactNode;\n}\n\n/**\n * Button component that triggers the authentication flow\n *\n * @example\n * ```tsx\n * <SignInButton>Sign In</SignInButton>\n * ```\n *\n * @example With custom variant and redirect\n * ```tsx\n * <SignInButton\n * variant=\"outline\"\n * size=\"lg\"\n * redirectUrl=\"/dashboard\"\n * >\n * Sign In to Dashboard\n * </SignInButton>\n * ```\n */\nexport function SignInButton({\n variant = 'default',\n size = 'default',\n redirectUrl,\n className,\n children = 'Sign In',\n ...props\n}: SignInButtonProps) {\n const { login, isAuthenticated } = useAuth();\n\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n if (props.onClick) {\n props.onClick(e);\n }\n\n if (!isAuthenticated) {\n const returnUrl = redirectUrl || window.location.href;\n login(returnUrl);\n }\n };\n\n return (\n <button\n className={cn(buttonVariants({ variant, size }), className)}\n onClick={handleClick}\n {...props}\n >\n {children}\n </button>\n );\n}\n"],"names":[],"mappings":";;;;;AAuDO,SAAS,aAAa;AAAA,EAC3B,UAAU;AAAA,EACV,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,GAAG;AACL,GAAsB;AACpB,QAAM,EAAE,OAAO,gBAAA,IAAoB,QAAA;AAEnC,QAAM,cAAc,CAAC,MAA2C;AAC9D,QAAI,MAAM,SAAS;AACjB,YAAM,QAAQ,CAAC;AAAA,IACjB;AAEA,QAAI,CAAC,iBAAiB;AACpB,YAAM,YAAY,eAAe,OAAO,SAAS;AACjD,YAAM,SAAS;AAAA,IACjB;AAAA,EACF;AAEA,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,GAAG,eAAe,EAAE,SAAS,KAAA,CAAM,GAAG,SAAS;AAAA,MAC1D,SAAS;AAAA,MACR,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|