saafe-redirection-flow 2.0.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/.github/workflows/build-and-deploy.yml +41 -0
- package/.gitlab-ci.yml +108 -0
- package/.releaserc.json +18 -0
- package/.storybook/main.ts +28 -0
- package/.storybook/preview.ts +16 -0
- package/.storybook/vitest.setup.ts +9 -0
- package/.vite/deps/@radix-ui_react-avatar.js +230 -0
- package/.vite/deps/@radix-ui_react-avatar.js.map +7 -0
- package/.vite/deps/@radix-ui_react-slot.js +12 -0
- package/.vite/deps/@radix-ui_react-slot.js.map +7 -0
- package/.vite/deps/_metadata.json +79 -0
- package/.vite/deps/chunk-5VGQBUCU.js +597 -0
- package/.vite/deps/chunk-5VGQBUCU.js.map +7 -0
- package/.vite/deps/chunk-DC5AMYBS.js +38 -0
- package/.vite/deps/chunk-DC5AMYBS.js.map +7 -0
- package/.vite/deps/chunk-HUIEPYH7.js +11265 -0
- package/.vite/deps/chunk-HUIEPYH7.js.map +7 -0
- package/.vite/deps/chunk-TKHB4QMX.js +281 -0
- package/.vite/deps/chunk-TKHB4QMX.js.map +7 -0
- package/.vite/deps/chunk-YLDSBLSF.js +1139 -0
- package/.vite/deps/chunk-YLDSBLSF.js.map +7 -0
- package/.vite/deps/class-variance-authority.js +63 -0
- package/.vite/deps/class-variance-authority.js.map +7 -0
- package/.vite/deps/lucide-react.js +36984 -0
- package/.vite/deps/lucide-react.js.map +7 -0
- package/.vite/deps/package.json +3 -0
- package/.vite/deps/react-dom_client.js +17917 -0
- package/.vite/deps/react-dom_client.js.map +7 -0
- package/.vite/deps/react-router-dom.js +452 -0
- package/.vite/deps/react-router-dom.js.map +7 -0
- package/.vite/deps/react-router.js +234 -0
- package/.vite/deps/react-router.js.map +7 -0
- package/.vite/deps/react.js +5 -0
- package/.vite/deps/react.js.map +7 -0
- package/.vite/deps/react_jsx-dev-runtime.js +470 -0
- package/.vite/deps/react_jsx-dev-runtime.js.map +7 -0
- package/CHANGELOG.md +420 -0
- package/LICENSE +21 -0
- package/README.md +129 -0
- package/RELEASE_CHEATSHEET.md +93 -0
- package/RELEASE_NOTES.md +120 -0
- package/components.json +21 -0
- package/docs/DEPLOYMENT_WORKFLOW.md +262 -0
- package/docs/RELEASE_GUIDE.md +591 -0
- package/docs/architecture.md +432 -0
- package/docs/components.md +199 -0
- package/docs/index.md +69 -0
- package/docs/local-release-workflow.md +234 -0
- package/docs/routes.md +118 -0
- package/docs/sdk-integration.md +325 -0
- package/docs/semantic-release.md +124 -0
- package/docs/user-flow.md +206 -0
- package/eslint.config.js +28 -0
- package/index.html +19 -0
- package/install.sh +198 -0
- package/package.json +115 -0
- package/public/images/bank-logo.png +0 -0
- package/public/saafe-icon.svg +9 -0
- package/src/App.tsx +171 -0
- package/src/__tests__/url-parameters.test.ts +82 -0
- package/src/assets/brand/applestore.svg +13 -0
- package/src/assets/brand/playstore.svg +23 -0
- package/src/assets/brand/saafe-color-white-logo.svg +14 -0
- package/src/assets/brand/saafe-icon.svg +9 -0
- package/src/assets/brand/saafe-logo.svg +18 -0
- package/src/assets/icons/check-icon-dark.svg +27 -0
- package/src/assets/icons/check-icon.svg +23 -0
- package/src/components/ErrorBoundary.tsx +132 -0
- package/src/components/alert/alert.tsx +27 -0
- package/src/components/auth/AuthGuard.tsx +76 -0
- package/src/components/cards/BankCard.stories.tsx +69 -0
- package/src/components/cards/BankCard.tsx +227 -0
- package/src/components/cards/OuterCard.tsx +109 -0
- package/src/components/cards/WrapperCard.tsx +64 -0
- package/src/components/documents/PrivacyContent.tsx +1 -0
- package/src/components/dummyFooter.tsx +29 -0
- package/src/components/icons/github.tsx +12 -0
- package/src/components/language/LanguageSwitcher.tsx +44 -0
- package/src/components/layouts/FrostedLayout.stories.tsx +42 -0
- package/src/components/layouts/FrostedLayout.tsx +333 -0
- package/src/components/layouts/MobileLayout.tsx +403 -0
- package/src/components/mobile-background.tsx +136 -0
- package/src/components/mobileAppDownload.tsx +30 -0
- package/src/components/modal/ModalComp.tsx +27 -0
- package/src/components/mode-toggle.tsx +36 -0
- package/src/components/page-header.tsx +50 -0
- package/src/components/session/SessionTimeoutScreen.tsx +134 -0
- package/src/components/session/SessionTimer.tsx +173 -0
- package/src/components/step-navigation.tsx +87 -0
- package/src/components/title/AppBar.stories.tsx +50 -0
- package/src/components/title/AppBar.tsx +150 -0
- package/src/components/title/SectionTitle.tsx +31 -0
- package/src/components/ui/AnimatedButton.module.css +13 -0
- package/src/components/ui/alert.tsx +66 -0
- package/src/components/ui/animatedButton.tsx +111 -0
- package/src/components/ui/avatar.tsx +51 -0
- package/src/components/ui/badge.tsx +36 -0
- package/src/components/ui/bottom-sheet.tsx +122 -0
- package/src/components/ui/button.tsx +59 -0
- package/src/components/ui/calendar.tsx +86 -0
- package/src/components/ui/card.tsx +92 -0
- package/src/components/ui/checkbox.stories.tsx +49 -0
- package/src/components/ui/checkbox.tsx +67 -0
- package/src/components/ui/collapsible.tsx +45 -0
- package/src/components/ui/dialog.tsx +134 -0
- package/src/components/ui/document-link.tsx +26 -0
- package/src/components/ui/dot-stepper.tsx +57 -0
- package/src/components/ui/dropdown-menu.tsx +255 -0
- package/src/components/ui/form.tsx +165 -0
- package/src/components/ui/frosted-panel.stories.tsx +86 -0
- package/src/components/ui/frosted-panel.tsx +276 -0
- package/src/components/ui/input.tsx +39 -0
- package/src/components/ui/label.stories.tsx +67 -0
- package/src/components/ui/label.tsx +23 -0
- package/src/components/ui/mobile-footer.tsx +54 -0
- package/src/components/ui/modal.tsx +90 -0
- package/src/components/ui/otp-input.stories.tsx +62 -0
- package/src/components/ui/otp-input.tsx +221 -0
- package/src/components/ui/platform-specific-behavior.tsx +28 -0
- package/src/components/ui/popover.tsx +46 -0
- package/src/components/ui/progress.tsx +103 -0
- package/src/components/ui/radio-group.tsx +45 -0
- package/src/components/ui/scroll-area.tsx +56 -0
- package/src/components/ui/sdk-params-docs.tsx +53 -0
- package/src/components/ui/select.tsx +159 -0
- package/src/components/ui/separator.tsx +28 -0
- package/src/components/ui/sheet.tsx +137 -0
- package/src/components/ui/sidebar.tsx +724 -0
- package/src/components/ui/skeleton.stories.tsx +50 -0
- package/src/components/ui/skeleton.tsx +15 -0
- package/src/components/ui/sonner.tsx +23 -0
- package/src/components/ui/step.stories.tsx +132 -0
- package/src/components/ui/step.tsx +234 -0
- package/src/components/ui/stepper-progress.tsx +136 -0
- package/src/components/ui/stepper.tsx +259 -0
- package/src/components/ui/tabs.tsx +55 -0
- package/src/components/ui/tooltip.tsx +61 -0
- package/src/components/ui/url-decode-loader.tsx +36 -0
- package/src/components/ui/version-display.tsx +104 -0
- package/src/components/ui/web-footer.tsx +36 -0
- package/src/config/environments.ts +99 -0
- package/src/config/urls.ts +53 -0
- package/src/const/fiTypeCategoryMap.ts +19 -0
- package/src/contexts/LanguageContext.tsx +41 -0
- package/src/contexts/RTLContext.tsx +42 -0
- package/src/contexts/ThemeContext.tsx +93 -0
- package/src/hooks/use-account-discovery.ts +205 -0
- package/src/hooks/use-auth-query.ts +141 -0
- package/src/hooks/use-fip-query.ts +72 -0
- package/src/hooks/use-media-query.ts +32 -0
- package/src/hooks/use-mobile.ts +24 -0
- package/src/hooks/use-page-title.tsx +48 -0
- package/src/hooks/use-platform.ts +52 -0
- package/src/hooks/use-trusted-count.ts +21 -0
- package/src/hooks/use-url-decode.ts +90 -0
- package/src/hooks/useStep.ts +170 -0
- package/src/index.css +154 -0
- package/src/interfaces/app.interfaces.ts +39 -0
- package/src/interfaces/services.interfaces.ts +65 -0
- package/src/lib/i18n.ts +68 -0
- package/src/lib/utils.ts +6 -0
- package/src/locales/en/common.json +167 -0
- package/src/locales/hi/common.json +137 -0
- package/src/locales/kn/common.json +137 -0
- package/src/locales/ml/common.json +137 -0
- package/src/locales/ta/common.json +137 -0
- package/src/locales/te/common.json +137 -0
- package/src/locales/ur/common.json +138 -0
- package/src/main.tsx +46 -0
- package/src/pages/Login.tsx +363 -0
- package/src/pages/accounts/AccountsToProceed.tsx +396 -0
- package/src/pages/accounts/Discover.tsx +76 -0
- package/src/pages/accounts/DiscoverAccount.tsx +751 -0
- package/src/pages/accounts/LinkSelectedAccounts.tsx +638 -0
- package/src/pages/accounts/OldUser.tsx +329 -0
- package/src/pages/accounts/link-accounts.tsx +913 -0
- package/src/pages/consent/ReviewConsent.tsx +836 -0
- package/src/pages/consent/rejected.tsx +253 -0
- package/src/pages/consent/success.tsx +220 -0
- package/src/providers/query-provider.tsx +24 -0
- package/src/providers/toast-provider.tsx +26 -0
- package/src/services/api/account.service.ts +296 -0
- package/src/services/api/auth.service.ts +206 -0
- package/src/services/api/axios.ts +138 -0
- package/src/services/api/consent.service.ts +142 -0
- package/src/services/api/decode.service.ts +53 -0
- package/src/services/api/feedback.service.ts +34 -0
- package/src/services/api/fip.service.ts +187 -0
- package/src/services/api/index.ts +9 -0
- package/src/services/api/public.service.ts +18 -0
- package/src/services/api.ts +2 -0
- package/src/services/postMessage.service.ts +179 -0
- package/src/store/NavigationBlockContext.tsx +34 -0
- package/src/store/auth.store.ts +79 -0
- package/src/store/fip.store.ts +396 -0
- package/src/store/mandatoryConsent.store.ts +24 -0
- package/src/store/redirect.store.ts +73 -0
- package/src/store/step.store.ts +124 -0
- package/src/stories/Button.stories.ts +53 -0
- package/src/stories/Button.tsx +37 -0
- package/src/stories/Configure.mdx +364 -0
- package/src/stories/Header.stories.ts +33 -0
- package/src/stories/Header.tsx +56 -0
- package/src/stories/Page.stories.ts +32 -0
- package/src/stories/Page.tsx +73 -0
- package/src/stories/button.css +30 -0
- package/src/stories/header.css +32 -0
- package/src/stories/page.css +68 -0
- package/src/styles/rtl-utils.css +90 -0
- package/src/styles/rtl.css +105 -0
- package/src/utils/api-error.ts +26 -0
- package/src/utils/cn.ts +10 -0
- package/src/utils/error-callback.ts +116 -0
- package/src/utils/formatAccountNumber.ts +9 -0
- package/src/utils/handleIdentifiers.ts +90 -0
- package/src/utils/posthog.ts +67 -0
- package/src/utils/toast-helpers.ts +61 -0
- package/src/vite-env.d.ts +1 -0
- package/stage-aa-2506251021.zip +0 -0
- package/tsconfig.app.json +33 -0
- package/tsconfig.json +13 -0
- package/tsconfig.node.json +24 -0
- package/vite.config.ts +45 -0
- package/vitest.shims.d.ts +1 -0
- package/vitest.workspace.ts +46 -0
@@ -0,0 +1,41 @@
|
|
1
|
+
name: Build & Deploy
|
2
|
+
|
3
|
+
on:
|
4
|
+
workflow_dispatch:
|
5
|
+
# on:
|
6
|
+
# push:
|
7
|
+
# branches: ["main"]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
deploy:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
|
13
|
+
permissions:
|
14
|
+
contents: write
|
15
|
+
|
16
|
+
strategy:
|
17
|
+
matrix:
|
18
|
+
node-version: ["20.9.0"]
|
19
|
+
|
20
|
+
steps:
|
21
|
+
- name: Checkout
|
22
|
+
uses: actions/checkout@v3
|
23
|
+
|
24
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
25
|
+
uses: actions/setup-node@v3
|
26
|
+
with:
|
27
|
+
node-version: ${{ matrix.node-version }}
|
28
|
+
cache: "npm"
|
29
|
+
|
30
|
+
- name: Install packages
|
31
|
+
run: npm i
|
32
|
+
|
33
|
+
- name: Run npm build
|
34
|
+
run: npm run build:gh
|
35
|
+
|
36
|
+
- name: Deploy to gh-pages
|
37
|
+
uses: peaceiris/actions-gh-pages@v3
|
38
|
+
with:
|
39
|
+
publish_dir: dist
|
40
|
+
publish_branch: gh-pages
|
41
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
package/.gitlab-ci.yml
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
variables:
|
2
|
+
AWS_DEFAULT_REGION: "$AWS_REGION"
|
3
|
+
S3_BUCKET_NAME: "$S3_BUCKET"
|
4
|
+
STAGE_AWS_WEB_IDENTITY_TOKEN_FILE: "/tmp/web-identity-token"
|
5
|
+
STAGE_AWS_ROLE_ARN: "arn:aws:iam::654654223083:role/gitlab-s3-bucket-stage"
|
6
|
+
STAGE_S3_BUCKET_NAME: "stage-redirection"
|
7
|
+
# CLOUDFRONT_ID_PROD: 'E2KZWZFH59FNGP'
|
8
|
+
stages:
|
9
|
+
- build
|
10
|
+
- deploy
|
11
|
+
|
12
|
+
stage-build:
|
13
|
+
image: node:18.18.2
|
14
|
+
stage: build
|
15
|
+
only:
|
16
|
+
# - stage
|
17
|
+
- develop
|
18
|
+
script:
|
19
|
+
- npm install
|
20
|
+
- npx vite build
|
21
|
+
artifacts:
|
22
|
+
paths:
|
23
|
+
- dist
|
24
|
+
|
25
|
+
prod-build:
|
26
|
+
image: node:18.18.2
|
27
|
+
stage: build
|
28
|
+
only:
|
29
|
+
- prod
|
30
|
+
script:
|
31
|
+
- npm install
|
32
|
+
- npx vite build
|
33
|
+
artifacts:
|
34
|
+
paths:
|
35
|
+
- dist
|
36
|
+
|
37
|
+
stage-deploy:
|
38
|
+
stage: deploy
|
39
|
+
image: ruby:3.1
|
40
|
+
#image: amazon/aws-cli:2.13.25
|
41
|
+
dependencies:
|
42
|
+
- stage-build
|
43
|
+
id_tokens:
|
44
|
+
STAGE_ID_TOKEN:
|
45
|
+
aud: https://sts.amazonaws.com
|
46
|
+
before_script:
|
47
|
+
- apt-get update && apt-get install -y unzip curl jq python3 python3-pip python3-venv groff less
|
48
|
+
- curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
|
49
|
+
- unzip awscliv2.zip
|
50
|
+
- ./aws/install
|
51
|
+
- aws --version
|
52
|
+
script:
|
53
|
+
- echo "Writing OIDC token to file"
|
54
|
+
# - if [ -z "$STAGE_AWS_WEB_IDENTITY_TOKEN_FILE" ]; then echo "Variable NOT set"; else echo "Variable is: $STAGE_AWS_WEB_IDENTITY_TOKEN_FILE"; fi
|
55
|
+
- echo "$STAGE_ID_TOKEN" > "$STAGE_AWS_WEB_IDENTITY_TOKEN_FILE"
|
56
|
+
# - export STAGE_AWS_WEB_IDENTITY_TOKEN_FILE=${STAGE_AWS_WEB_IDENTITY_TOKEN_FILE:-/tmp/aws_web_identity_token}
|
57
|
+
# - echo "$CI_JOB_JWT_V2" > "$STAGE_AWS_WEB_IDENTITY_TOKEN_FILE"
|
58
|
+
- |
|
59
|
+
aws sts assume-role-with-web-identity \
|
60
|
+
--role-arn "$STAGE_AWS_ROLE_ARN" \
|
61
|
+
--role-session-name gitlab-ci-session \
|
62
|
+
--web-identity-token file://$STAGE_AWS_WEB_IDENTITY_TOKEN_FILE \
|
63
|
+
> /tmp/assumed-role-output.json
|
64
|
+
- export AWS_ACCESS_KEY_ID=$(jq -r .Credentials.AccessKeyId /tmp/assumed-role-output.json)
|
65
|
+
- export AWS_SECRET_ACCESS_KEY=$(jq -r .Credentials.SecretAccessKey /tmp/assumed-role-output.json)
|
66
|
+
- export AWS_SESSION_TOKEN=$(jq -r .Credentials.SessionToken /tmp/assumed-role-output.json)
|
67
|
+
- aws sts get-caller-identity
|
68
|
+
- export COMMIT_ID=$CI_COMMIT_SHORT_SHA
|
69
|
+
- mkdir -p /tmp/$COMMIT_ID
|
70
|
+
- cp -r ./dist/* /tmp/$COMMIT_ID/
|
71
|
+
- aws s3 cp /tmp/$COMMIT_ID/ s3://STAGE_S3_BUCKET_NAME/stage-redirection/ --recursive
|
72
|
+
only:
|
73
|
+
# - stage
|
74
|
+
- develop
|
75
|
+
|
76
|
+
prod-deploy:
|
77
|
+
stage: deploy
|
78
|
+
image: alpine:latest
|
79
|
+
dependencies:
|
80
|
+
- prod-build
|
81
|
+
script:
|
82
|
+
- apk add --update jq curl unzip python3 py3-pip
|
83
|
+
- pip3 install awscli
|
84
|
+
# - curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
|
85
|
+
# - unzip awscliv2.zip
|
86
|
+
# - ./aws/install
|
87
|
+
- echo $AWS_ROLE_ARN
|
88
|
+
- echo $AWS_WEB_IDENTITY_TOKEN_FILE
|
89
|
+
- |
|
90
|
+
CREDS_JSON=$(aws sts assume-role-with-web-identity \
|
91
|
+
--role-arn "$AWS_ROLE_ARN" \
|
92
|
+
--role-session-name "GitLabPipelineSession" \
|
93
|
+
--web-identity-token file://$AWS_WEB_IDENTITY_TOKEN_FILE \
|
94
|
+
--duration-seconds 3600)
|
95
|
+
- export AWS_ACCESS_KEY_ID=$(echo "$CREDS_JSON" | jq -r '.Credentials.AccessKeyId')
|
96
|
+
- export AWS_SECRET_ACCESS_KEY=$(echo "$CREDS_JSON" | jq -r '.Credentials.SecretAccessKey')
|
97
|
+
- export AWS_SESSION_TOKEN=$(echo "$CREDS_JSON" | jq -r '.Credentials.SessionToken')
|
98
|
+
- echo "AWS credentials assumed successfully."
|
99
|
+
- export VERSION="v${CI_COMMIT_SHORT_SHA}"
|
100
|
+
- aws s3 sync dist/ s3://$S3_BUCKET/$VERSION/ --region $AWS_REGION
|
101
|
+
# - aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_ID_PROD --paths "/*"
|
102
|
+
|
103
|
+
only:
|
104
|
+
- prod
|
105
|
+
# when: manual
|
106
|
+
|
107
|
+
|
108
|
+
|
package/.releaserc.json
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"branches": [
|
3
|
+
"prod"
|
4
|
+
],
|
5
|
+
"plugins": [
|
6
|
+
"@semantic-release/commit-analyzer",
|
7
|
+
"@semantic-release/release-notes-generator",
|
8
|
+
"@semantic-release/changelog",
|
9
|
+
"@semantic-release/npm",
|
10
|
+
[
|
11
|
+
"@semantic-release/git",
|
12
|
+
{
|
13
|
+
"assets": ["package.json", "package-lock.json", "CHANGELOG.md"],
|
14
|
+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
15
|
+
}
|
16
|
+
]
|
17
|
+
]
|
18
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import type { StorybookConfig } from '@storybook/react-vite';
|
2
|
+
|
3
|
+
const config: StorybookConfig = {
|
4
|
+
"stories": [
|
5
|
+
"../src/**/*.mdx",
|
6
|
+
"../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"
|
7
|
+
],
|
8
|
+
"addons": [
|
9
|
+
"@storybook/addon-essentials",
|
10
|
+
"@storybook/addon-onboarding",
|
11
|
+
"@chromatic-com/storybook",
|
12
|
+
"@storybook/experimental-addon-test"
|
13
|
+
],
|
14
|
+
"framework": {
|
15
|
+
"name": "@storybook/react-vite",
|
16
|
+
"options": {}
|
17
|
+
},
|
18
|
+
viteFinal: async (config) => {
|
19
|
+
if (config.resolve) {
|
20
|
+
config.resolve.alias = {
|
21
|
+
...config.resolve.alias,
|
22
|
+
"@": "/src",
|
23
|
+
};
|
24
|
+
}
|
25
|
+
return config;
|
26
|
+
},
|
27
|
+
};
|
28
|
+
export default config;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import type { Preview } from '@storybook/react'
|
2
|
+
import '../src/index.css'
|
3
|
+
|
4
|
+
const preview: Preview = {
|
5
|
+
parameters: {
|
6
|
+
actions: { argTypesRegex: '^on[A-Z].*' },
|
7
|
+
controls: {
|
8
|
+
matchers: {
|
9
|
+
color: /(background|color)$/i,
|
10
|
+
date: /Date$/i,
|
11
|
+
},
|
12
|
+
},
|
13
|
+
},
|
14
|
+
};
|
15
|
+
|
16
|
+
export default preview;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { beforeAll } from 'vitest';
|
2
|
+
import { setProjectAnnotations } from '@storybook/react';
|
3
|
+
import * as projectAnnotations from './preview';
|
4
|
+
|
5
|
+
// This is an important step to apply the right configuration when testing your stories.
|
6
|
+
// More info at: https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations
|
7
|
+
const project = setProjectAnnotations([projectAnnotations]);
|
8
|
+
|
9
|
+
beforeAll(project.beforeAll);
|
@@ -0,0 +1,230 @@
|
|
1
|
+
"use client";
|
2
|
+
import {
|
3
|
+
require_react_dom
|
4
|
+
} from "./chunk-TKHB4QMX.js";
|
5
|
+
import {
|
6
|
+
Slot,
|
7
|
+
require_jsx_runtime
|
8
|
+
} from "./chunk-5VGQBUCU.js";
|
9
|
+
import {
|
10
|
+
require_react
|
11
|
+
} from "./chunk-YLDSBLSF.js";
|
12
|
+
import {
|
13
|
+
__toESM
|
14
|
+
} from "./chunk-DC5AMYBS.js";
|
15
|
+
|
16
|
+
// node_modules/@radix-ui/react-avatar/dist/index.mjs
|
17
|
+
var React5 = __toESM(require_react(), 1);
|
18
|
+
|
19
|
+
// node_modules/@radix-ui/react-context/dist/index.mjs
|
20
|
+
var React = __toESM(require_react(), 1);
|
21
|
+
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
22
|
+
function createContextScope(scopeName, createContextScopeDeps = []) {
|
23
|
+
let defaultContexts = [];
|
24
|
+
function createContext3(rootComponentName, defaultContext) {
|
25
|
+
const BaseContext = React.createContext(defaultContext);
|
26
|
+
const index = defaultContexts.length;
|
27
|
+
defaultContexts = [...defaultContexts, defaultContext];
|
28
|
+
const Provider = (props) => {
|
29
|
+
var _a;
|
30
|
+
const { scope, children, ...context } = props;
|
31
|
+
const Context = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index]) || BaseContext;
|
32
|
+
const value = React.useMemo(() => context, Object.values(context));
|
33
|
+
return (0, import_jsx_runtime.jsx)(Context.Provider, { value, children });
|
34
|
+
};
|
35
|
+
Provider.displayName = rootComponentName + "Provider";
|
36
|
+
function useContext2(consumerName, scope) {
|
37
|
+
var _a;
|
38
|
+
const Context = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index]) || BaseContext;
|
39
|
+
const context = React.useContext(Context);
|
40
|
+
if (context) return context;
|
41
|
+
if (defaultContext !== void 0) return defaultContext;
|
42
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
43
|
+
}
|
44
|
+
return [Provider, useContext2];
|
45
|
+
}
|
46
|
+
const createScope = () => {
|
47
|
+
const scopeContexts = defaultContexts.map((defaultContext) => {
|
48
|
+
return React.createContext(defaultContext);
|
49
|
+
});
|
50
|
+
return function useScope(scope) {
|
51
|
+
const contexts = (scope == null ? void 0 : scope[scopeName]) || scopeContexts;
|
52
|
+
return React.useMemo(
|
53
|
+
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
54
|
+
[scope, contexts]
|
55
|
+
);
|
56
|
+
};
|
57
|
+
};
|
58
|
+
createScope.scopeName = scopeName;
|
59
|
+
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
60
|
+
}
|
61
|
+
function composeContextScopes(...scopes) {
|
62
|
+
const baseScope = scopes[0];
|
63
|
+
if (scopes.length === 1) return baseScope;
|
64
|
+
const createScope = () => {
|
65
|
+
const scopeHooks = scopes.map((createScope2) => ({
|
66
|
+
useScope: createScope2(),
|
67
|
+
scopeName: createScope2.scopeName
|
68
|
+
}));
|
69
|
+
return function useComposedScopes(overrideScopes) {
|
70
|
+
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
71
|
+
const scopeProps = useScope(overrideScopes);
|
72
|
+
const currentScope = scopeProps[`__scope${scopeName}`];
|
73
|
+
return { ...nextScopes2, ...currentScope };
|
74
|
+
}, {});
|
75
|
+
return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
76
|
+
};
|
77
|
+
};
|
78
|
+
createScope.scopeName = baseScope.scopeName;
|
79
|
+
return createScope;
|
80
|
+
}
|
81
|
+
|
82
|
+
// node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
|
83
|
+
var React2 = __toESM(require_react(), 1);
|
84
|
+
function useCallbackRef(callback) {
|
85
|
+
const callbackRef = React2.useRef(callback);
|
86
|
+
React2.useEffect(() => {
|
87
|
+
callbackRef.current = callback;
|
88
|
+
});
|
89
|
+
return React2.useMemo(() => (...args) => {
|
90
|
+
var _a;
|
91
|
+
return (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef, ...args);
|
92
|
+
}, []);
|
93
|
+
}
|
94
|
+
|
95
|
+
// node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
96
|
+
var React3 = __toESM(require_react(), 1);
|
97
|
+
var useLayoutEffect2 = Boolean(globalThis == null ? void 0 : globalThis.document) ? React3.useLayoutEffect : () => {
|
98
|
+
};
|
99
|
+
|
100
|
+
// node_modules/@radix-ui/react-primitive/dist/index.mjs
|
101
|
+
var React4 = __toESM(require_react(), 1);
|
102
|
+
var ReactDOM = __toESM(require_react_dom(), 1);
|
103
|
+
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
|
104
|
+
var NODES = [
|
105
|
+
"a",
|
106
|
+
"button",
|
107
|
+
"div",
|
108
|
+
"form",
|
109
|
+
"h2",
|
110
|
+
"h3",
|
111
|
+
"img",
|
112
|
+
"input",
|
113
|
+
"label",
|
114
|
+
"li",
|
115
|
+
"nav",
|
116
|
+
"ol",
|
117
|
+
"p",
|
118
|
+
"span",
|
119
|
+
"svg",
|
120
|
+
"ul"
|
121
|
+
];
|
122
|
+
var Primitive = NODES.reduce((primitive, node) => {
|
123
|
+
const Node = React4.forwardRef((props, forwardedRef) => {
|
124
|
+
const { asChild, ...primitiveProps } = props;
|
125
|
+
const Comp = asChild ? Slot : node;
|
126
|
+
if (typeof window !== "undefined") {
|
127
|
+
window[Symbol.for("radix-ui")] = true;
|
128
|
+
}
|
129
|
+
return (0, import_jsx_runtime2.jsx)(Comp, { ...primitiveProps, ref: forwardedRef });
|
130
|
+
});
|
131
|
+
Node.displayName = `Primitive.${node}`;
|
132
|
+
return { ...primitive, [node]: Node };
|
133
|
+
}, {});
|
134
|
+
|
135
|
+
// node_modules/@radix-ui/react-avatar/dist/index.mjs
|
136
|
+
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
|
137
|
+
var AVATAR_NAME = "Avatar";
|
138
|
+
var [createAvatarContext, createAvatarScope] = createContextScope(AVATAR_NAME);
|
139
|
+
var [AvatarProvider, useAvatarContext] = createAvatarContext(AVATAR_NAME);
|
140
|
+
var Avatar = React5.forwardRef(
|
141
|
+
(props, forwardedRef) => {
|
142
|
+
const { __scopeAvatar, ...avatarProps } = props;
|
143
|
+
const [imageLoadingStatus, setImageLoadingStatus] = React5.useState("idle");
|
144
|
+
return (0, import_jsx_runtime3.jsx)(
|
145
|
+
AvatarProvider,
|
146
|
+
{
|
147
|
+
scope: __scopeAvatar,
|
148
|
+
imageLoadingStatus,
|
149
|
+
onImageLoadingStatusChange: setImageLoadingStatus,
|
150
|
+
children: (0, import_jsx_runtime3.jsx)(Primitive.span, { ...avatarProps, ref: forwardedRef })
|
151
|
+
}
|
152
|
+
);
|
153
|
+
}
|
154
|
+
);
|
155
|
+
Avatar.displayName = AVATAR_NAME;
|
156
|
+
var IMAGE_NAME = "AvatarImage";
|
157
|
+
var AvatarImage = React5.forwardRef(
|
158
|
+
(props, forwardedRef) => {
|
159
|
+
const { __scopeAvatar, src, onLoadingStatusChange = () => {
|
160
|
+
}, ...imageProps } = props;
|
161
|
+
const context = useAvatarContext(IMAGE_NAME, __scopeAvatar);
|
162
|
+
const imageLoadingStatus = useImageLoadingStatus(src, imageProps.referrerPolicy);
|
163
|
+
const handleLoadingStatusChange = useCallbackRef((status) => {
|
164
|
+
onLoadingStatusChange(status);
|
165
|
+
context.onImageLoadingStatusChange(status);
|
166
|
+
});
|
167
|
+
useLayoutEffect2(() => {
|
168
|
+
if (imageLoadingStatus !== "idle") {
|
169
|
+
handleLoadingStatusChange(imageLoadingStatus);
|
170
|
+
}
|
171
|
+
}, [imageLoadingStatus, handleLoadingStatusChange]);
|
172
|
+
return imageLoadingStatus === "loaded" ? (0, import_jsx_runtime3.jsx)(Primitive.img, { ...imageProps, ref: forwardedRef, src }) : null;
|
173
|
+
}
|
174
|
+
);
|
175
|
+
AvatarImage.displayName = IMAGE_NAME;
|
176
|
+
var FALLBACK_NAME = "AvatarFallback";
|
177
|
+
var AvatarFallback = React5.forwardRef(
|
178
|
+
(props, forwardedRef) => {
|
179
|
+
const { __scopeAvatar, delayMs, ...fallbackProps } = props;
|
180
|
+
const context = useAvatarContext(FALLBACK_NAME, __scopeAvatar);
|
181
|
+
const [canRender, setCanRender] = React5.useState(delayMs === void 0);
|
182
|
+
React5.useEffect(() => {
|
183
|
+
if (delayMs !== void 0) {
|
184
|
+
const timerId = window.setTimeout(() => setCanRender(true), delayMs);
|
185
|
+
return () => window.clearTimeout(timerId);
|
186
|
+
}
|
187
|
+
}, [delayMs]);
|
188
|
+
return canRender && context.imageLoadingStatus !== "loaded" ? (0, import_jsx_runtime3.jsx)(Primitive.span, { ...fallbackProps, ref: forwardedRef }) : null;
|
189
|
+
}
|
190
|
+
);
|
191
|
+
AvatarFallback.displayName = FALLBACK_NAME;
|
192
|
+
function useImageLoadingStatus(src, referrerPolicy) {
|
193
|
+
const [loadingStatus, setLoadingStatus] = React5.useState("idle");
|
194
|
+
useLayoutEffect2(() => {
|
195
|
+
if (!src) {
|
196
|
+
setLoadingStatus("error");
|
197
|
+
return;
|
198
|
+
}
|
199
|
+
let isMounted = true;
|
200
|
+
const image = new window.Image();
|
201
|
+
const updateStatus = (status) => () => {
|
202
|
+
if (!isMounted) return;
|
203
|
+
setLoadingStatus(status);
|
204
|
+
};
|
205
|
+
setLoadingStatus("loading");
|
206
|
+
image.onload = updateStatus("loaded");
|
207
|
+
image.onerror = updateStatus("error");
|
208
|
+
image.src = src;
|
209
|
+
if (referrerPolicy) {
|
210
|
+
image.referrerPolicy = referrerPolicy;
|
211
|
+
}
|
212
|
+
return () => {
|
213
|
+
isMounted = false;
|
214
|
+
};
|
215
|
+
}, [src, referrerPolicy]);
|
216
|
+
return loadingStatus;
|
217
|
+
}
|
218
|
+
var Root = Avatar;
|
219
|
+
var Image = AvatarImage;
|
220
|
+
var Fallback = AvatarFallback;
|
221
|
+
export {
|
222
|
+
Avatar,
|
223
|
+
AvatarFallback,
|
224
|
+
AvatarImage,
|
225
|
+
Fallback,
|
226
|
+
Image,
|
227
|
+
Root,
|
228
|
+
createAvatarScope
|
229
|
+
};
|
230
|
+
//# sourceMappingURL=@radix-ui_react-avatar.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../node_modules/@radix-ui/react-avatar/src/avatar.tsx", "../../node_modules/@radix-ui/react-context/src/createContext.tsx", "../../node_modules/@radix-ui/react-use-callback-ref/src/useCallbackRef.tsx", "../../node_modules/@radix-ui/react-use-layout-effect/src/useLayoutEffect.tsx", "../../node_modules/@radix-ui/react-primitive/src/primitive.tsx"],
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Avatar\n * -----------------------------------------------------------------------------------------------*/\n\nconst AVATAR_NAME = 'Avatar';\n\ntype ScopedProps<P> = P & { __scopeAvatar?: Scope };\nconst [createAvatarContext, createAvatarScope] = createContextScope(AVATAR_NAME);\n\ntype ImageLoadingStatus = 'idle' | 'loading' | 'loaded' | 'error';\n\ntype AvatarContextValue = {\n imageLoadingStatus: ImageLoadingStatus;\n onImageLoadingStatusChange(status: ImageLoadingStatus): void;\n};\n\nconst [AvatarProvider, useAvatarContext] = createAvatarContext<AvatarContextValue>(AVATAR_NAME);\n\ntype AvatarElement = React.ElementRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;\ninterface AvatarProps extends PrimitiveSpanProps {}\n\nconst Avatar = React.forwardRef<AvatarElement, AvatarProps>(\n (props: ScopedProps<AvatarProps>, forwardedRef) => {\n const { __scopeAvatar, ...avatarProps } = props;\n const [imageLoadingStatus, setImageLoadingStatus] = React.useState<ImageLoadingStatus>('idle');\n return (\n <AvatarProvider\n scope={__scopeAvatar}\n imageLoadingStatus={imageLoadingStatus}\n onImageLoadingStatusChange={setImageLoadingStatus}\n >\n <Primitive.span {...avatarProps} ref={forwardedRef} />\n </AvatarProvider>\n );\n }\n);\n\nAvatar.displayName = AVATAR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AvatarImage\n * -----------------------------------------------------------------------------------------------*/\n\nconst IMAGE_NAME = 'AvatarImage';\n\ntype AvatarImageElement = React.ElementRef<typeof Primitive.img>;\ntype PrimitiveImageProps = React.ComponentPropsWithoutRef<typeof Primitive.img>;\ninterface AvatarImageProps extends PrimitiveImageProps {\n onLoadingStatusChange?: (status: ImageLoadingStatus) => void;\n}\n\nconst AvatarImage = React.forwardRef<AvatarImageElement, AvatarImageProps>(\n (props: ScopedProps<AvatarImageProps>, forwardedRef) => {\n const { __scopeAvatar, src, onLoadingStatusChange = () => {}, ...imageProps } = props;\n const context = useAvatarContext(IMAGE_NAME, __scopeAvatar);\n const imageLoadingStatus = useImageLoadingStatus(src, imageProps.referrerPolicy);\n const handleLoadingStatusChange = useCallbackRef((status: ImageLoadingStatus) => {\n onLoadingStatusChange(status);\n context.onImageLoadingStatusChange(status);\n });\n\n useLayoutEffect(() => {\n if (imageLoadingStatus !== 'idle') {\n handleLoadingStatusChange(imageLoadingStatus);\n }\n }, [imageLoadingStatus, handleLoadingStatusChange]);\n\n return imageLoadingStatus === 'loaded' ? (\n <Primitive.img {...imageProps} ref={forwardedRef} src={src} />\n ) : null;\n }\n);\n\nAvatarImage.displayName = IMAGE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AvatarFallback\n * -----------------------------------------------------------------------------------------------*/\n\nconst FALLBACK_NAME = 'AvatarFallback';\n\ntype AvatarFallbackElement = React.ElementRef<typeof Primitive.span>;\ninterface AvatarFallbackProps extends PrimitiveSpanProps {\n delayMs?: number;\n}\n\nconst AvatarFallback = React.forwardRef<AvatarFallbackElement, AvatarFallbackProps>(\n (props: ScopedProps<AvatarFallbackProps>, forwardedRef) => {\n const { __scopeAvatar, delayMs, ...fallbackProps } = props;\n const context = useAvatarContext(FALLBACK_NAME, __scopeAvatar);\n const [canRender, setCanRender] = React.useState(delayMs === undefined);\n\n React.useEffect(() => {\n if (delayMs !== undefined) {\n const timerId = window.setTimeout(() => setCanRender(true), delayMs);\n return () => window.clearTimeout(timerId);\n }\n }, [delayMs]);\n\n return canRender && context.imageLoadingStatus !== 'loaded' ? (\n <Primitive.span {...fallbackProps} ref={forwardedRef} />\n ) : null;\n }\n);\n\nAvatarFallback.displayName = FALLBACK_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction useImageLoadingStatus(src?: string, referrerPolicy?: React.HTMLAttributeReferrerPolicy) {\n const [loadingStatus, setLoadingStatus] = React.useState<ImageLoadingStatus>('idle');\n\n useLayoutEffect(() => {\n if (!src) {\n setLoadingStatus('error');\n return;\n }\n\n let isMounted = true;\n const image = new window.Image();\n\n const updateStatus = (status: ImageLoadingStatus) => () => {\n if (!isMounted) return;\n setLoadingStatus(status);\n };\n\n setLoadingStatus('loading');\n image.onload = updateStatus('loaded');\n image.onerror = updateStatus('error');\n image.src = src;\n if (referrerPolicy) {\n image.referrerPolicy = referrerPolicy;\n }\n\n return () => {\n isMounted = false;\n };\n }, [src, referrerPolicy]);\n\n return loadingStatus;\n}\nconst Root = Avatar;\nconst Image = AvatarImage;\nconst Fallback = AvatarFallback;\n\nexport {\n createAvatarScope,\n //\n Avatar,\n AvatarImage,\n AvatarFallback,\n //\n Root,\n Image,\n Fallback,\n};\nexport type { AvatarProps, AvatarImageProps, AvatarFallbackProps };\n", "import * as React from 'react';\n\nfunction createContext<ContextValueType extends object | null>(\n rootComponentName: string,\n defaultContext?: ContextValueType\n) {\n const Context = React.createContext<ContextValueType | undefined>(defaultContext);\n\n const Provider: React.FC<ContextValueType & { children: React.ReactNode }> = (props) => {\n const { children, ...context } = props;\n // Only re-memoize when prop values change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const value = React.useMemo(() => context, Object.values(context)) as ContextValueType;\n return <Context.Provider value={value}>{children}</Context.Provider>;\n };\n\n Provider.displayName = rootComponentName + 'Provider';\n\n function useContext(consumerName: string) {\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== undefined) return defaultContext;\n // if a defaultContext wasn't specified, it's a required context.\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n\n return [Provider, useContext] as const;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * createContextScope\n * -----------------------------------------------------------------------------------------------*/\n\ntype Scope<C = any> = { [scopeName: string]: React.Context<C>[] } | undefined;\ntype ScopeHook = (scope: Scope) => { [__scopeProp: string]: Scope };\ninterface CreateScope {\n scopeName: string;\n (): ScopeHook;\n}\n\nfunction createContextScope(scopeName: string, createContextScopeDeps: CreateScope[] = []) {\n let defaultContexts: any[] = [];\n\n /* -----------------------------------------------------------------------------------------------\n * createContext\n * ---------------------------------------------------------------------------------------------*/\n\n function createContext<ContextValueType extends object | null>(\n rootComponentName: string,\n defaultContext?: ContextValueType\n ) {\n const BaseContext = React.createContext<ContextValueType | undefined>(defaultContext);\n const index = defaultContexts.length;\n defaultContexts = [...defaultContexts, defaultContext];\n\n const Provider: React.FC<\n ContextValueType & { scope: Scope<ContextValueType>; children: React.ReactNode }\n > = (props) => {\n const { scope, children, ...context } = props;\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n // Only re-memoize when prop values change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const value = React.useMemo(() => context, Object.values(context)) as ContextValueType;\n return <Context.Provider value={value}>{children}</Context.Provider>;\n };\n\n Provider.displayName = rootComponentName + 'Provider';\n\n function useContext(consumerName: string, scope: Scope<ContextValueType | undefined>) {\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== undefined) return defaultContext;\n // if a defaultContext wasn't specified, it's a required context.\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n\n return [Provider, useContext] as const;\n }\n\n /* -----------------------------------------------------------------------------------------------\n * createScope\n * ---------------------------------------------------------------------------------------------*/\n\n const createScope: CreateScope = () => {\n const scopeContexts = defaultContexts.map((defaultContext) => {\n return React.createContext(defaultContext);\n });\n return function useScope(scope: Scope) {\n const contexts = scope?.[scopeName] || scopeContexts;\n return React.useMemo(\n () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),\n [scope, contexts]\n );\n };\n };\n\n createScope.scopeName = scopeName;\n return [createContext, composeContextScopes(createScope, ...createContextScopeDeps)] as const;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * composeContextScopes\n * -----------------------------------------------------------------------------------------------*/\n\nfunction composeContextScopes(...scopes: CreateScope[]) {\n const baseScope = scopes[0];\n if (scopes.length === 1) return baseScope;\n\n const createScope: CreateScope = () => {\n const scopeHooks = scopes.map((createScope) => ({\n useScope: createScope(),\n scopeName: createScope.scopeName,\n }));\n\n return function useComposedScopes(overrideScopes) {\n const nextScopes = scopeHooks.reduce((nextScopes, { useScope, scopeName }) => {\n // We are calling a hook inside a callback which React warns against to avoid inconsistent\n // renders, however, scoping doesn't have render side effects so we ignore the rule.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const scopeProps = useScope(overrideScopes);\n const currentScope = scopeProps[`__scope${scopeName}`];\n return { ...nextScopes, ...currentScope };\n }, {});\n\n return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);\n };\n };\n\n createScope.scopeName = baseScope.scopeName;\n return createScope;\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nexport { createContext, createContextScope };\nexport type { CreateScope, Scope };\n", "import * as React from 'react';\n\n/**\n * A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a\n * prop or avoid re-executing effects when passed as a dependency\n */\nfunction useCallbackRef<T extends (...args: any[]) => any>(callback: T | undefined): T {\n const callbackRef = React.useRef(callback);\n\n React.useEffect(() => {\n callbackRef.current = callback;\n });\n\n // https://github.com/facebook/react/issues/19240\n return React.useMemo(() => ((...args) => callbackRef.current?.(...args)) as T, []);\n}\n\nexport { useCallbackRef };\n", "import * as React from 'react';\n\n/**\n * On the server, React emits a warning when calling `useLayoutEffect`.\n * This is because neither `useLayoutEffect` nor `useEffect` run on the server.\n * We use this safe version which suppresses the warning by replacing it with a noop on the server.\n *\n * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect\n */\nconst useLayoutEffect = Boolean(globalThis?.document) ? React.useLayoutEffect : () => {};\n\nexport { useLayoutEffect };\n", "import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { Slot } from '@radix-ui/react-slot';\n\nconst NODES = [\n 'a',\n 'button',\n 'div',\n 'form',\n 'h2',\n 'h3',\n 'img',\n 'input',\n 'label',\n 'li',\n 'nav',\n 'ol',\n 'p',\n 'span',\n 'svg',\n 'ul',\n] as const;\n\ntype Primitives = { [E in (typeof NODES)[number]]: PrimitiveForwardRefComponent<E> };\ntype PrimitivePropsWithRef<E extends React.ElementType> = React.ComponentPropsWithRef<E> & {\n asChild?: boolean;\n};\n\ninterface PrimitiveForwardRefComponent<E extends React.ElementType>\n extends React.ForwardRefExoticComponent<PrimitivePropsWithRef<E>> {}\n\n/* -------------------------------------------------------------------------------------------------\n * Primitive\n * -----------------------------------------------------------------------------------------------*/\n\nconst Primitive = NODES.reduce((primitive, node) => {\n const Node = React.forwardRef((props: PrimitivePropsWithRef<typeof node>, forwardedRef: any) => {\n const { asChild, ...primitiveProps } = props;\n const Comp: any = asChild ? Slot : node;\n\n if (typeof window !== 'undefined') {\n (window as any)[Symbol.for('radix-ui')] = true;\n }\n\n return <Comp {...primitiveProps} ref={forwardedRef} />;\n });\n\n Node.displayName = `Primitive.${node}`;\n\n return { ...primitive, [node]: Node };\n}, {} as Primitives);\n\n/* -------------------------------------------------------------------------------------------------\n * Utils\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * Flush custom event dispatch\n * https://github.com/radix-ui/primitives/pull/1378\n *\n * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.\n *\n * Internally, React prioritises events in the following order:\n * - discrete\n * - continuous\n * - default\n *\n * https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350\n *\n * `discrete` is an important distinction as updates within these events are applied immediately.\n * React however, is not able to infer the priority of custom event types due to how they are detected internally.\n * Because of this, it's possible for updates from custom events to be unexpectedly batched when\n * dispatched by another `discrete` event.\n *\n * In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.\n * This utility should be used when dispatching a custom event from within another `discrete` event, this utility\n * is not necessary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.\n * For example:\n *\n * dispatching a known click \uD83D\uDC4E\n * target.dispatchEvent(new Event(\u2018click\u2019))\n *\n * dispatching a custom type within a non-discrete event \uD83D\uDC4E\n * onScroll={(event) => event.target.dispatchEvent(new CustomEvent(\u2018customType\u2019))}\n *\n * dispatching a custom type within a `discrete` event \uD83D\uDC4D\n * onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(\u2018customType\u2019))}\n *\n * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use\n * this utility with them. This is because it's possible for those handlers to be called implicitly during render\n * e.g. when focus is within a component as it is unmounted, or when managing focus on mount.\n */\n\nfunction dispatchDiscreteCustomEvent<E extends CustomEvent>(target: E['target'], event: E) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Primitive;\n\nexport {\n Primitive,\n //\n Root,\n //\n dispatchDiscreteCustomEvent,\n};\nexport type { PrimitivePropsWithRef };\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA,IAAAA,SAAuB;;;ACAvB,YAAuB;AAaZ,yBAAA;AA2BX,SAAS,mBAAmB,WAAmB,yBAAwC,CAAC,GAAG;AACzF,MAAI,kBAAyB,CAAC;AAM9B,WAASC,eACP,mBACA,gBACA;AACA,UAAM,cAA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,iBAAiB;AACzD,UAAM,EAAE,eAAe,SAAS,GAAG,cAAc,IAAI;AACrD,UAAM,UAAU,iBAAiB,eAAe,aAAa;AAC7D,UAAM,CAAC,WAAW,YAAY,IAAU,gBAAS,YAAY,MAAS;AAEhE,IAAA,iBAAU,MAAM;AACpB,UAAI,YAAY,QAAW;AACzB,cAAM,UAAU,OAAO,WAAW,MAAM,aAAa,IAAI,GAAG,OAAO;AACnE,eAAO,MAAM,OAAO,aAAa,OAAO;MAC1C;IACF,GAAG,CAAC,OAAO,CAAC;AAEZ,WAAO,aAAa,QAAQ,uBAAuB,eACjD,yBAAC,UAAU,MAAV,EAAgB,GAAG,eAAe,KAAK,aAAA,CAAc,IACpD;EACN;AACF;AAEA,eAAe,cAAc;AAI7B,SAAS,sBAAsB,KAAc,gBAAoD;AAC/F,QAAM,CAAC,eAAe,gBAAgB,IAAU,gBAA6B,MAAM;AAEnF,mBAAgB,MAAM;AACpB,QAAI,CAAC,KAAK;AACR,uBAAiB,OAAO;AACxB;IACF;AAEA,QAAI,YAAY;AAChB,UAAM,QAAQ,IAAI,OAAO,MAAM;AAE/B,UAAM,eAAe,CAAC,WAA+B,MAAM;AACzD,UAAI,CAAC,UAAW;AAChB,uBAAiB,MAAM;IACzB;AAEA,qBAAiB,SAAS;AAC1B,UAAM,SAAS,aAAa,QAAQ;AACpC,UAAM,UAAU,aAAa,OAAO;AACpC,UAAM,MAAM;AACZ,QAAI,gBAAgB;AAClB,YAAM,iBAAiB;IACzB;AAEA,WAAO,MAAM;AACX,kBAAY;IACd;EACF,GAAG,CAAC,KAAK,cAAc,CAAC;AAExB,SAAO;AACT;AACA,IAAM,OAAO;AACb,IAAM,QAAQ;AACd,IAAM,WAAW;",
|
6
|
+
"names": ["React", "createContext", "useContext", "createScope", "nextScopes", "React", "React", "useLayoutEffect", "React", "import_jsx_runtime", "import_jsx_runtime"]
|
7
|
+
}
|
@@ -0,0 +1,79 @@
|
|
1
|
+
{
|
2
|
+
"hash": "2aa70fa7",
|
3
|
+
"configHash": "bac33138",
|
4
|
+
"lockfileHash": "f2a7930b",
|
5
|
+
"browserHash": "cc8a4a28",
|
6
|
+
"optimized": {
|
7
|
+
"react/jsx-dev-runtime": {
|
8
|
+
"src": "../../node_modules/react/jsx-dev-runtime.js",
|
9
|
+
"file": "react_jsx-dev-runtime.js",
|
10
|
+
"fileHash": "5d07f67a",
|
11
|
+
"needsInterop": true
|
12
|
+
},
|
13
|
+
"react": {
|
14
|
+
"src": "../../node_modules/react/index.js",
|
15
|
+
"file": "react.js",
|
16
|
+
"fileHash": "ccca6a86",
|
17
|
+
"needsInterop": true
|
18
|
+
},
|
19
|
+
"react-dom/client": {
|
20
|
+
"src": "../../node_modules/react-dom/client.js",
|
21
|
+
"file": "react-dom_client.js",
|
22
|
+
"fileHash": "a2cac1c8",
|
23
|
+
"needsInterop": true
|
24
|
+
},
|
25
|
+
"react-router": {
|
26
|
+
"src": "../../node_modules/react-router/dist/development/index.mjs",
|
27
|
+
"file": "react-router.js",
|
28
|
+
"fileHash": "48c160e9",
|
29
|
+
"needsInterop": false
|
30
|
+
},
|
31
|
+
"react-router-dom": {
|
32
|
+
"src": "../../node_modules/react-router-dom/dist/index.mjs",
|
33
|
+
"file": "react-router-dom.js",
|
34
|
+
"fileHash": "8d41e786",
|
35
|
+
"needsInterop": false
|
36
|
+
},
|
37
|
+
"lucide-react": {
|
38
|
+
"src": "../../node_modules/lucide-react/dist/esm/lucide-react.js",
|
39
|
+
"file": "lucide-react.js",
|
40
|
+
"fileHash": "f0c03a15",
|
41
|
+
"needsInterop": false
|
42
|
+
},
|
43
|
+
"@radix-ui/react-avatar": {
|
44
|
+
"src": "../../node_modules/@radix-ui/react-avatar/dist/index.mjs",
|
45
|
+
"file": "@radix-ui_react-avatar.js",
|
46
|
+
"fileHash": "5c903874",
|
47
|
+
"needsInterop": false
|
48
|
+
},
|
49
|
+
"@radix-ui/react-slot": {
|
50
|
+
"src": "../../node_modules/@radix-ui/react-slot/dist/index.mjs",
|
51
|
+
"file": "@radix-ui_react-slot.js",
|
52
|
+
"fileHash": "17c2cf7f",
|
53
|
+
"needsInterop": false
|
54
|
+
},
|
55
|
+
"class-variance-authority": {
|
56
|
+
"src": "../../node_modules/class-variance-authority/dist/index.mjs",
|
57
|
+
"file": "class-variance-authority.js",
|
58
|
+
"fileHash": "23ed64a5",
|
59
|
+
"needsInterop": false
|
60
|
+
}
|
61
|
+
},
|
62
|
+
"chunks": {
|
63
|
+
"chunk-HUIEPYH7": {
|
64
|
+
"file": "chunk-HUIEPYH7.js"
|
65
|
+
},
|
66
|
+
"chunk-TKHB4QMX": {
|
67
|
+
"file": "chunk-TKHB4QMX.js"
|
68
|
+
},
|
69
|
+
"chunk-5VGQBUCU": {
|
70
|
+
"file": "chunk-5VGQBUCU.js"
|
71
|
+
},
|
72
|
+
"chunk-YLDSBLSF": {
|
73
|
+
"file": "chunk-YLDSBLSF.js"
|
74
|
+
},
|
75
|
+
"chunk-DC5AMYBS": {
|
76
|
+
"file": "chunk-DC5AMYBS.js"
|
77
|
+
}
|
78
|
+
}
|
79
|
+
}
|