@dataif/cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -0
- package/bin/dataif.js +623 -0
- package/package.json +26 -0
- package/scripts/build-template.mjs +72 -0
- package/templates/dataif/README.md +157 -0
- package/templates/dataif/infra/.env.example +119 -0
- package/templates/dataif/infra/.env.stg.example +119 -0
- package/templates/dataif/infra/airflow/Dockerfile +11 -0
- package/templates/dataif/infra/airflow/Dockerfile.release +17 -0
- package/templates/dataif/infra/airflow/requirements.txt +3 -0
- package/templates/dataif/infra/docker-compose.yml +306 -0
- package/templates/dataif/infra/init-db/01-init-dataif.sh +129 -0
- package/templates/dataif/infra/init-db/pnp-curated-views.sqlinc +444 -0
- package/templates/dataif/infra/init-db/pnp-raw-staging-curated.sqlinc +701 -0
- package/templates/dataif/infra/keycloak/Dockerfile +4 -0
- package/templates/dataif/infra/keycloak/realm-dataif.json +73 -0
- package/templates/dataif/infra/ollama/Dockerfile +9 -0
- package/templates/dataif/infra/ollama/bootstrap-model.sh +100 -0
- package/templates/dataif/infra/ollama/sabia-7b.Modelfile +14 -0
- package/templates/dataif/infra/postgres/Dockerfile +4 -0
- package/templates/dataif/pipelines/airflow/dags/generated/.gitkeep +1 -0
- package/templates/dataif/pipelines/airflow/dags/generated/2020_financeiro_fcc6f1f3_sync.py +9 -0
- package/templates/dataif/pipelines/dataif_pipelines/__init__.py +1 -0
- package/templates/dataif/pipelines/dataif_pipelines/airflow/__init__.py +1 -0
- package/templates/dataif/pipelines/dataif_pipelines/airflow/pnp_pipeline_factory.py +167 -0
- package/templates/dataif/pipelines/dataif_pipelines/connectors/__init__.py +1 -0
- package/templates/dataif/pipelines/dataif_pipelines/connectors/base/__init__.py +1 -0
- package/templates/dataif/pipelines/dataif_pipelines/connectors/base/connector.py +28 -0
- package/templates/dataif/pipelines/dataif_pipelines/connectors/base/types.py +14 -0
- package/templates/dataif/pipelines/dataif_pipelines/connectors/nilo_pecanha/__init__.py +1 -0
- package/templates/dataif/pipelines/dataif_pipelines/connectors/nilo_pecanha/config.py +19 -0
- package/templates/dataif/pipelines/dataif_pipelines/connectors/nilo_pecanha/connector.py +558 -0
- package/templates/dataif/pipelines/dataif_pipelines/connectors/nilo_pecanha/powerbi_microdados.py +728 -0
- package/templates/dataif/pipelines/dataif_pipelines/connectors/nilo_pecanha/transform.py +296 -0
- package/templates/dataif/pipelines/dataif_pipelines/jobs/__init__.py +1 -0
- package/templates/dataif/pipelines/dataif_pipelines/jobs/nilo_pipeline.py +112 -0
- package/templates/dataif/pipelines/dataif_pipelines/orchestration/__init__.py +21 -0
- package/templates/dataif/pipelines/dataif_pipelines/orchestration/pnp_workflow.py +783 -0
- package/templates/dataif/pipelines/dataif_pipelines/repositories/__init__.py +1 -0
- package/templates/dataif/pipelines/dataif_pipelines/repositories/pnp_raw_repository.py +860 -0
- package/templates/dataif/pipelines/dataif_pipelines/services/__init__.py +19 -0
- package/templates/dataif/pipelines/dataif_pipelines/services/pnp_curated_service.py +66 -0
- package/templates/dataif/pipelines/dataif_pipelines/services/pnp_download_service.py +534 -0
- package/templates/dataif/pipelines/dataif_pipelines/services/pnp_quality_service.py +9 -0
- package/templates/dataif/pipelines/dataif_pipelines/services/pnp_raw_ingestion_service.py +124 -0
- package/templates/dataif/pipelines/dataif_pipelines/services/pnp_staging_service.py +271 -0
- package/templates/dataif/pipelines/dataif_pipelines/services/powerbi_catalog_service.py +159 -0
- package/templates/dataif/pipelines/sql/staging/020_pnp_matriculas.sql +112 -0
- package/templates/dataif/pipelines/sql/staging/030_pnp_eficiencia_academica.sql +83 -0
- package/templates/dataif/pipelines/sql/staging/040_pnp_servidores.sql +90 -0
- package/templates/dataif/pipelines/sql/staging/050_pnp_financeiro.sql +72 -0
- package/templates/dataif/pipelines/sql/views_curated/004_mv_pnp_dashboard_fast.sql +204 -0
- package/templates/dataif/pipelines/sql/views_curated/010_vw_pnp_admin_ingestao.sql +51 -0
- package/templates/dataif/pipelines/sql/views_curated/020_vw_pnp_qualidade_dados.sql +114 -0
- package/templates/dataif/pipelines/sql/views_curated/030_vw_pnp_matriculas.sql +67 -0
- package/templates/dataif/pipelines/sql/views_curated/040_vw_pnp_eficiencia.sql +33 -0
- package/templates/dataif/pipelines/sql/views_curated/050_vw_pnp_servidores.sql +30 -0
- package/templates/dataif/pipelines/sql/views_curated/060_vw_pnp_financeiro.sql +22 -0
- package/templates/dataif/pipelines/sql/views_curated/070_vw_pnp_vanna.sql +115 -0
- package/templates/dataif/scripts/configure-env.sh +149 -0
- package/templates/dataif/scripts/create_metabase_pnp_dashboard.py +943 -0
- package/templates/dataif/scripts/create_metabase_pnp_matriculas_dashboard.py +580 -0
- package/templates/dataif/scripts/deploy.sh +79 -0
- package/templates/dataif/scripts/fix_metabase_template_tag_ids.py +91 -0
- package/templates/dataif/scripts/pnp_powerbi_microdados_probe.py +14 -0
- package/templates/dataif/scripts/pnp_validate_raw_run.py +330 -0
- package/templates/dataif/scripts/publish-images.sh +31 -0
- package/templates/dataif/scripts/sync_metabase_dashboard_field_filters.py +241 -0
- package/templates/dataif/scripts/use-vanna-ollama.sh +139 -0
- package/templates/dataif/services/api/.dockerignore +18 -0
- package/templates/dataif/services/api/Dockerfile +12 -0
- package/templates/dataif/services/api/app/__init__.py +1 -0
- package/templates/dataif/services/api/app/auth.py +48 -0
- package/templates/dataif/services/api/app/config.py +59 -0
- package/templates/dataif/services/api/app/keycloak_admin.py +215 -0
- package/templates/dataif/services/api/app/main.py +2432 -0
- package/templates/dataif/services/api/app/metabase_admin.py +191 -0
- package/templates/dataif/services/api/app/metabase_bootstrap.py +44 -0
- package/templates/dataif/services/api/app/metabase_embed.py +15 -0
- package/templates/dataif/services/api/app/pnp_dag_provisioner.py +113 -0
- package/templates/dataif/services/api/app/pnp_instance_repository.py +951 -0
- package/templates/dataif/services/api/app/pnp_powerbi.py +438 -0
- package/templates/dataif/services/api/app/vanna_client.py +32 -0
- package/templates/dataif/services/api/requirements.txt +9 -0
- package/templates/dataif/services/vanna/.dockerignore +18 -0
- package/templates/dataif/services/vanna/Dockerfile +12 -0
- package/templates/dataif/services/vanna/app/config.py +57 -0
- package/templates/dataif/services/vanna/app/main.py +108 -0
- package/templates/dataif/services/vanna/app/runtime_config.py +114 -0
- package/templates/dataif/services/vanna/app/sql_guard.py +123 -0
- package/templates/dataif/services/vanna/app/vanna_engine.py +382 -0
- package/templates/dataif/services/vanna/requirements.txt +8 -0
- package/templates/dataif/services/web/.dockerignore +13 -0
- package/templates/dataif/services/web/Dockerfile +16 -0
- package/templates/dataif/services/web/index.html +12 -0
- package/templates/dataif/services/web/nginx.conf +74 -0
- package/templates/dataif/services/web/package-lock.json +4397 -0
- package/templates/dataif/services/web/package.json +32 -0
- package/templates/dataif/services/web/postcss.config.mjs +5 -0
- package/templates/dataif/services/web/src/App.jsx +2817 -0
- package/templates/dataif/services/web/src/adminAuth.js +245 -0
- package/templates/dataif/services/web/src/assets/avatar_placeholder.png +0 -0
- package/templates/dataif/services/web/src/assets/github_logo_icon_229278.svg +1 -0
- package/templates/dataif/services/web/src/assets/if-logo.png +0 -0
- package/templates/dataif/services/web/src/assets/if.svg +0 -0
- package/templates/dataif/services/web/src/assets/pnp-horizontal.svg +1 -0
- package/templates/dataif/services/web/src/components/AppHeader.jsx +233 -0
- package/templates/dataif/services/web/src/components/application/app-navigation/base-components/mobile-header.tsx +56 -0
- package/templates/dataif/services/web/src/components/application/app-navigation/base-components/nav-account-card.tsx +209 -0
- package/templates/dataif/services/web/src/components/application/app-navigation/base-components/nav-item-button.tsx +67 -0
- package/templates/dataif/services/web/src/components/application/app-navigation/base-components/nav-item.tsx +108 -0
- package/templates/dataif/services/web/src/components/application/app-navigation/base-components/nav-list.tsx +83 -0
- package/templates/dataif/services/web/src/components/application/app-navigation/config.ts +23 -0
- package/templates/dataif/services/web/src/components/application/app-navigation/header-navigation.tsx +240 -0
- package/templates/dataif/services/web/src/components/application/pagination/pagination-base.tsx +376 -0
- package/templates/dataif/services/web/src/components/application/pagination/pagination-dot.tsx +52 -0
- package/templates/dataif/services/web/src/components/application/pagination/pagination-line.tsx +48 -0
- package/templates/dataif/services/web/src/components/application/pagination/pagination.tsx +328 -0
- package/templates/dataif/services/web/src/components/application/tabs/tabs.tsx +223 -0
- package/templates/dataif/services/web/src/components/base/avatar/avatar-label-group.tsx +28 -0
- package/templates/dataif/services/web/src/components/base/avatar/avatar.tsx +129 -0
- package/templates/dataif/services/web/src/components/base/avatar/base-components/avatar-add-button.tsx +32 -0
- package/templates/dataif/services/web/src/components/base/avatar/base-components/avatar-company-icon.tsx +24 -0
- package/templates/dataif/services/web/src/components/base/avatar/base-components/avatar-online-indicator.tsx +29 -0
- package/templates/dataif/services/web/src/components/base/avatar/base-components/index.tsx +4 -0
- package/templates/dataif/services/web/src/components/base/avatar/base-components/verified-tick.tsx +32 -0
- package/templates/dataif/services/web/src/components/base/badges/badge-types.ts +264 -0
- package/templates/dataif/services/web/src/components/base/badges/badges.tsx +415 -0
- package/templates/dataif/services/web/src/components/base/button-group/button-group.tsx +104 -0
- package/templates/dataif/services/web/src/components/base/buttons/button.tsx +267 -0
- package/templates/dataif/services/web/src/components/base/input/hint-text.tsx +31 -0
- package/templates/dataif/services/web/src/components/base/input/input.tsx +269 -0
- package/templates/dataif/services/web/src/components/base/input/label.tsx +48 -0
- package/templates/dataif/services/web/src/components/base/radio-buttons/radio-buttons.tsx +127 -0
- package/templates/dataif/services/web/src/components/base/select/combobox.tsx +150 -0
- package/templates/dataif/services/web/src/components/base/select/multi-select.tsx +361 -0
- package/templates/dataif/services/web/src/components/base/select/popover.tsx +32 -0
- package/templates/dataif/services/web/src/components/base/select/select-item.tsx +95 -0
- package/templates/dataif/services/web/src/components/base/select/select-native.tsx +67 -0
- package/templates/dataif/services/web/src/components/base/select/select.tsx +144 -0
- package/templates/dataif/services/web/src/components/base/tags/base-components/tag-close-x.tsx +32 -0
- package/templates/dataif/services/web/src/components/base/tooltip/tooltip.tsx +107 -0
- package/templates/dataif/services/web/src/components/foundations/dot-icon.tsx +22 -0
- package/templates/dataif/services/web/src/components/foundations/logo/untitledui-logo-minimal.tsx +170 -0
- package/templates/dataif/services/web/src/components/foundations/logo/untitledui-logo.tsx +58 -0
- package/templates/dataif/services/web/src/hooks/use-breakpoint.ts +34 -0
- package/templates/dataif/services/web/src/hooks/use-resize-observer.ts +67 -0
- package/templates/dataif/services/web/src/main.jsx +14 -0
- package/templates/dataif/services/web/src/providers/theme-provider.jsx +62 -0
- package/templates/dataif/services/web/src/styles/globals.css +60 -0
- package/templates/dataif/services/web/src/styles/theme.css +1326 -0
- package/templates/dataif/services/web/src/styles/typography.css +430 -0
- package/templates/dataif/services/web/src/styles.css +1287 -0
- package/templates/dataif/services/web/src/utils/cx.ts +24 -0
- package/templates/dataif/services/web/src/utils/is-react-component.ts +33 -0
- package/templates/dataif/services/web/vite.config.js +14 -0
- package/templates/dataif/sql/ddl/001_schemas.sql +6 -0
- package/templates/dataif/sql/ddl/003_pnp_raw_staging_curated.sql +699 -0
- package/templates/dataif/sql/migrations/001_pnp_phase1_backfill.sql +3 -0
- package/templates/dataif/sql/migrations/002_pnp_phase2_admin_config_backfill.sql +184 -0
- package/templates/dataif/sql/migrations/003_pnp_phase3_raw_tabular_backfill.sql +3 -0
- package/templates/dataif/sql/migrations/004_pnp_phase3_raw_backfill_support_index.sql +3 -0
- package/templates/dataif/sql/migrations/005_pnp_phase7_staging_support_indexes.sql +2 -0
- package/templates/dataif/sql/migrations/006_pnp_phase7_staging_autovacuum_tuning.sql +2 -0
- package/templates/dataif/sql/migrations/007_pnp_phase7b_run_packages.sql +20 -0
- package/templates/dataif/sql/migrations/008_pnp_phase7a_pipeline_endpoints.sql +169 -0
- package/templates/dataif/sql/migrations/009_pnp_phase8_curated.sql +35 -0
- package/templates/dataif/sql/migrations/010_pnp_phase10_staging_incremental_upsert.sql +3 -0
- package/templates/dataif/sql/migrations/010_pnp_pipeline_uuid.sql +51 -0
- package/templates/dataif/sql/migrations/011_app_settings.sql +7 -0
- package/templates/dataif/sql/staging/020_pnp_matriculas.sql +112 -0
- package/templates/dataif/sql/staging/030_pnp_eficiencia_academica.sql +83 -0
- package/templates/dataif/sql/staging/040_pnp_servidores.sql +90 -0
- package/templates/dataif/sql/staging/050_pnp_financeiro.sql +72 -0
- package/templates/dataif/sql/views_curated/003_vw_pnp_microdados_admin.sql +160 -0
- package/templates/dataif/sql/views_curated/004_mv_pnp_dashboard_fast.sql +204 -0
- package/templates/dataif/sql/views_curated/010_vw_pnp_admin_ingestao.sql +51 -0
- package/templates/dataif/sql/views_curated/020_vw_pnp_qualidade_dados.sql +114 -0
- package/templates/dataif/sql/views_curated/030_vw_pnp_matriculas.sql +67 -0
- package/templates/dataif/sql/views_curated/040_vw_pnp_eficiencia.sql +33 -0
- package/templates/dataif/sql/views_curated/050_vw_pnp_servidores.sql +30 -0
- package/templates/dataif/sql/views_curated/060_vw_pnp_financeiro.sql +22 -0
- package/templates/dataif/sql/views_curated/070_vw_pnp_vanna.sql +115 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { type FC, type ReactNode, useState } from "react";
|
|
2
|
+
import { User01 } from "@untitledui/icons";
|
|
3
|
+
import { cx } from "@/utils/cx";
|
|
4
|
+
import { AvatarOnlineIndicator, VerifiedTick } from "./base-components";
|
|
5
|
+
|
|
6
|
+
type AvatarSize = "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
7
|
+
|
|
8
|
+
export interface AvatarProps {
|
|
9
|
+
size?: AvatarSize;
|
|
10
|
+
className?: string;
|
|
11
|
+
src?: string | null;
|
|
12
|
+
alt?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Display a contrast border around the avatar.
|
|
15
|
+
*/
|
|
16
|
+
contrastBorder?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Display a badge (i.e. company logo).
|
|
19
|
+
*/
|
|
20
|
+
badge?: ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Display a status indicator.
|
|
23
|
+
*/
|
|
24
|
+
status?: "online" | "offline";
|
|
25
|
+
/**
|
|
26
|
+
* Display a verified tick icon.
|
|
27
|
+
*
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
verified?: boolean;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The initials of the user to display if no image is available.
|
|
34
|
+
*/
|
|
35
|
+
initials?: string;
|
|
36
|
+
/**
|
|
37
|
+
* An icon to display if no image is available.
|
|
38
|
+
*/
|
|
39
|
+
placeholderIcon?: FC<{ className?: string }>;
|
|
40
|
+
/**
|
|
41
|
+
* A placeholder to display if no image is available.
|
|
42
|
+
*/
|
|
43
|
+
placeholder?: ReactNode;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Whether the avatar should show a focus ring when the parent group is in focus.
|
|
47
|
+
* For example, when the avatar is wrapped inside a link.
|
|
48
|
+
*
|
|
49
|
+
* @default false
|
|
50
|
+
*/
|
|
51
|
+
focusable?: boolean;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const styles = {
|
|
55
|
+
xxs: { root: "size-4 outline-[0.5px] -outline-offset-[0.5px]", initials: "text-xs font-semibold", icon: "size-3" },
|
|
56
|
+
xs: { root: "size-6 outline-[0.5px] -outline-offset-[0.5px]", initials: "text-xs font-semibold", icon: "size-4" },
|
|
57
|
+
sm: { root: "size-8 outline-[0.75px] -outline-offset-[0.75px]", initials: "text-sm font-semibold", icon: "size-5" },
|
|
58
|
+
md: { root: "size-10 outline-1 -outline-offset-1", initials: "text-md font-semibold", icon: "size-6" },
|
|
59
|
+
lg: { root: "size-12 outline-1 -outline-offset-1", initials: "text-lg font-semibold", icon: "size-7" },
|
|
60
|
+
xl: { root: "size-14 outline-1 -outline-offset-1", initials: "text-xl font-semibold", icon: "size-8" },
|
|
61
|
+
"2xl": { root: "size-16 outline-1 -outline-offset-1", initials: "text-display-xs font-semibold", icon: "size-8" },
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const Avatar = ({
|
|
65
|
+
contrastBorder = true,
|
|
66
|
+
size = "md",
|
|
67
|
+
src,
|
|
68
|
+
alt,
|
|
69
|
+
initials,
|
|
70
|
+
placeholder,
|
|
71
|
+
placeholderIcon: PlaceholderIcon,
|
|
72
|
+
badge,
|
|
73
|
+
status,
|
|
74
|
+
verified,
|
|
75
|
+
focusable = false,
|
|
76
|
+
className,
|
|
77
|
+
}: AvatarProps) => {
|
|
78
|
+
const [isFailed, setIsFailed] = useState(false);
|
|
79
|
+
|
|
80
|
+
const renderMainContent = () => {
|
|
81
|
+
if (src && !isFailed) {
|
|
82
|
+
return <img data-avatar-img className="size-full rounded-full object-cover" src={src} alt={alt} onError={() => setIsFailed(true)} />;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (initials) {
|
|
86
|
+
return <span className={cx("text-quaternary", styles[size].initials)}>{initials}</span>;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (PlaceholderIcon) {
|
|
90
|
+
return <PlaceholderIcon className={cx("text-fg-quaternary", styles[size].icon)} />;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return placeholder || <User01 className={cx("text-fg-quaternary", styles[size].icon)} />;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const renderBadgeContent = () => {
|
|
97
|
+
if (status) {
|
|
98
|
+
return <AvatarOnlineIndicator status={status} size={size === "xxs" ? "xs" : size} />;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (verified) {
|
|
102
|
+
return (
|
|
103
|
+
<VerifiedTick
|
|
104
|
+
size={size === "xxs" ? "xs" : size}
|
|
105
|
+
className={cx("absolute right-0 bottom-0", (size === "xxs" || size === "xs") && "-right-px -bottom-px")}
|
|
106
|
+
/>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return badge;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
return (
|
|
114
|
+
<div
|
|
115
|
+
data-avatar
|
|
116
|
+
className={cx(
|
|
117
|
+
"relative inline-flex shrink-0 items-center justify-center rounded-full bg-avatar-bg outline-transparent",
|
|
118
|
+
// Focus styles
|
|
119
|
+
focusable && "group-outline-focus-ring group-focus-visible:outline-2 group-focus-visible:outline-offset-2",
|
|
120
|
+
contrastBorder && "outline outline-avatar-contrast-border",
|
|
121
|
+
styles[size].root,
|
|
122
|
+
className,
|
|
123
|
+
)}
|
|
124
|
+
>
|
|
125
|
+
{renderMainContent()}
|
|
126
|
+
{renderBadgeContent()}
|
|
127
|
+
</div>
|
|
128
|
+
);
|
|
129
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Plus } from "@untitledui/icons";
|
|
2
|
+
import type { ButtonProps as AriaButtonProps } from "react-aria-components";
|
|
3
|
+
import { Tooltip as AriaTooltip, TooltipTrigger as AriaTooltipTrigger } from "@/components/base/tooltip/tooltip";
|
|
4
|
+
import { cx } from "@/utils/cx";
|
|
5
|
+
|
|
6
|
+
const sizes = {
|
|
7
|
+
xs: { root: "size-6", icon: "size-4" },
|
|
8
|
+
sm: { root: "size-8", icon: "size-4" },
|
|
9
|
+
md: { root: "size-10", icon: "size-5" },
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
interface AvatarAddButtonProps extends AriaButtonProps {
|
|
13
|
+
size: "xs" | "sm" | "md";
|
|
14
|
+
title?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const AvatarAddButton = ({ size, className, title = "Add user", ...props }: AvatarAddButtonProps) => (
|
|
19
|
+
<AriaTooltip title={title}>
|
|
20
|
+
<AriaTooltipTrigger
|
|
21
|
+
{...props}
|
|
22
|
+
aria-label={title}
|
|
23
|
+
className={cx(
|
|
24
|
+
"flex cursor-pointer items-center justify-center rounded-full border border-dashed border-primary bg-primary text-fg-quaternary outline-focus-ring transition duration-100 ease-linear hover:bg-primary_hover hover:text-fg-quaternary_hover focus-visible:outline-2 focus-visible:outline-offset-2 disabled:border-gray-200 disabled:bg-secondary disabled:text-gray-200",
|
|
25
|
+
sizes[size].root,
|
|
26
|
+
className,
|
|
27
|
+
)}
|
|
28
|
+
>
|
|
29
|
+
<Plus className={cx("text-current transition-inherit-all", sizes[size].icon)} />
|
|
30
|
+
</AriaTooltipTrigger>
|
|
31
|
+
</AriaTooltip>
|
|
32
|
+
);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { cx } from "@/utils/cx";
|
|
2
|
+
|
|
3
|
+
const sizes = {
|
|
4
|
+
xs: "size-2",
|
|
5
|
+
sm: "size-3",
|
|
6
|
+
md: "size-3.5",
|
|
7
|
+
lg: "size-4",
|
|
8
|
+
xl: "size-4.5",
|
|
9
|
+
"2xl": "size-5 ring-[1.67px]",
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
interface AvatarCompanyIconProps {
|
|
13
|
+
size: "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
14
|
+
src: string;
|
|
15
|
+
alt?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const AvatarCompanyIcon = ({ size, src, alt }: AvatarCompanyIconProps) => (
|
|
19
|
+
<img
|
|
20
|
+
src={src}
|
|
21
|
+
alt={alt}
|
|
22
|
+
className={cx("bg-primary-25 absolute -right-0.5 -bottom-0.5 rounded-full object-cover ring-[1.5px] ring-bg-primary", sizes[size])}
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { cx } from "@/utils/cx";
|
|
2
|
+
|
|
3
|
+
const sizes = {
|
|
4
|
+
xs: "size-1.5",
|
|
5
|
+
sm: "size-2",
|
|
6
|
+
md: "size-2.5",
|
|
7
|
+
lg: "size-3",
|
|
8
|
+
xl: "size-3.5",
|
|
9
|
+
"2xl": "size-4",
|
|
10
|
+
"3xl": "size-4.5",
|
|
11
|
+
"4xl": "size-5",
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
interface AvatarOnlineIndicatorProps {
|
|
15
|
+
size: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
|
|
16
|
+
status: "online" | "offline";
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const AvatarOnlineIndicator = ({ size, status, className }: AvatarOnlineIndicatorProps) => (
|
|
21
|
+
<span
|
|
22
|
+
className={cx(
|
|
23
|
+
"absolute right-0 bottom-0 rounded-full ring-[1.5px] ring-bg-primary",
|
|
24
|
+
status === "online" ? "bg-fg-success-secondary" : "bg-fg-disabled_subtle",
|
|
25
|
+
sizes[size],
|
|
26
|
+
className,
|
|
27
|
+
)}
|
|
28
|
+
/>
|
|
29
|
+
);
|
package/templates/dataif/services/web/src/components/base/avatar/base-components/verified-tick.tsx
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { cx } from "@/utils/cx";
|
|
2
|
+
|
|
3
|
+
const sizes = {
|
|
4
|
+
xs: { root: "size-2.5", tick: "size-[4.38px" },
|
|
5
|
+
sm: { root: "size-3", tick: "size-[5.25px]" },
|
|
6
|
+
md: { root: "size-3.5", tick: "size-[6.13px]" },
|
|
7
|
+
lg: { root: "size-4", tick: "size-[7px]" },
|
|
8
|
+
xl: { root: "size-4.5", tick: "size-[7.88px]" },
|
|
9
|
+
"2xl": { root: "size-5", tick: "size-[8.75px]" },
|
|
10
|
+
"3xl": { root: "size-6", tick: "size-[10.5px]" },
|
|
11
|
+
"4xl": { root: "size-8", tick: "size-[14px]" },
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
interface VerifiedTickProps {
|
|
15
|
+
size: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const VerifiedTick = ({ size, className }: VerifiedTickProps) => (
|
|
20
|
+
<svg data-verified className={cx("z-10 text-utility-blue-500", sizes[size].root, className)} viewBox="0 0 10 10" fill="none">
|
|
21
|
+
<path
|
|
22
|
+
d="M7.72237 1.77098C7.81734 2.00068 7.99965 2.18326 8.2292 2.27858L9.03413 2.61199C9.26384 2.70714 9.44635 2.88965 9.5415 3.11936C9.63665 3.34908 9.63665 3.60718 9.5415 3.83689L9.20833 4.64125C9.11313 4.87106 9.113 5.12943 9.20863 5.35913L9.54122 6.16325C9.58839 6.27702 9.61268 6.39897 9.6127 6.52214C9.61272 6.6453 9.58847 6.76726 9.54134 6.88105C9.4942 6.99484 9.42511 7.09823 9.33801 7.18531C9.2509 7.27238 9.14749 7.34144 9.03369 7.38854L8.22934 7.72171C7.99964 7.81669 7.81706 7.99899 7.72174 8.22855L7.38833 9.03348C7.29318 9.26319 7.11067 9.4457 6.88096 9.54085C6.65124 9.636 6.39314 9.636 6.16343 9.54085L5.35907 9.20767C5.12935 9.11276 4.87134 9.11295 4.64177 9.20821L3.83684 9.54115C3.60725 9.63608 3.34937 9.636 3.11984 9.54092C2.89032 9.44585 2.70791 9.26356 2.6127 9.03409L2.27918 8.22892C2.18421 7.99923 2.0019 7.81665 1.77235 7.72133L0.967421 7.38792C0.737807 7.29281 0.555355 7.11041 0.460169 6.88083C0.364983 6.65125 0.364854 6.39327 0.45981 6.16359L0.792984 5.35924C0.8879 5.12952 0.887707 4.87151 0.792445 4.64193L0.459749 3.83642C0.41258 3.72265 0.388291 3.60069 0.388272 3.47753C0.388252 3.35436 0.412501 3.2324 0.459634 3.11861C0.506767 3.00482 0.57586 2.90144 0.662965 2.81436C0.75007 2.72728 0.853479 2.65822 0.967283 2.61113L1.77164 2.27795C2.00113 2.18306 2.1836 2.00099 2.27899 1.7717L2.6124 0.966768C2.70755 0.737054 2.89006 0.554547 3.11978 0.459397C3.34949 0.364246 3.60759 0.364246 3.83731 0.459397L4.64166 0.792571C4.87138 0.887487 5.12939 0.887293 5.35897 0.792031L6.16424 0.459913C6.39392 0.364816 6.65197 0.364836 6.88164 0.459968C7.11131 0.555099 7.29379 0.737554 7.38895 0.967208L7.72247 1.77238L7.72237 1.77098Z"
|
|
23
|
+
className="fill-current"
|
|
24
|
+
/>
|
|
25
|
+
<path
|
|
26
|
+
fillRule="evenodd"
|
|
27
|
+
clipRule="evenodd"
|
|
28
|
+
d="M6.95829 3.68932C7.02509 3.58439 7.04747 3.45723 7.02051 3.3358C6.99356 3.21437 6.91946 3.10862 6.81454 3.04182C6.70961 2.97502 6.58245 2.95264 6.46102 2.97959C6.33959 3.00655 6.23384 3.08064 6.16704 3.18557L4.33141 6.06995L3.49141 5.01995C3.41375 4.92281 3.30069 4.8605 3.17709 4.84673C3.05349 4.83296 2.92949 4.86885 2.83235 4.94651C2.73522 5.02417 2.67291 5.13723 2.65914 5.26083C2.64536 5.38443 2.68125 5.50843 2.75891 5.60557L4.00891 7.16807C4.0555 7.22638 4.11533 7.27271 4.18344 7.30323C4.25154 7.33375 4.32595 7.34757 4.40047 7.34353C4.47499 7.3395 4.54747 7.31773 4.61188 7.28004C4.67629 7.24234 4.73077 7.18981 4.77079 7.12682L6.95829 3.68932Z"
|
|
29
|
+
fill="white"
|
|
30
|
+
/>
|
|
31
|
+
</svg>
|
|
32
|
+
);
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
export type IconComponentType = React.FunctionComponent<{ className?: string; strokeWidth?: string | number }>;
|
|
2
|
+
|
|
3
|
+
export type Sizes = "sm" | "md" | "lg";
|
|
4
|
+
|
|
5
|
+
export type BadgeColors = "gray" | "brand" | "error" | "warning" | "success" | "gray-blue" | "blue-light" | "blue" | "indigo" | "purple" | "pink" | "orange";
|
|
6
|
+
|
|
7
|
+
export type FlagTypes =
|
|
8
|
+
| "AD"
|
|
9
|
+
| "AE"
|
|
10
|
+
| "AF"
|
|
11
|
+
| "AG"
|
|
12
|
+
| "AI"
|
|
13
|
+
| "AL"
|
|
14
|
+
| "AM"
|
|
15
|
+
| "AO"
|
|
16
|
+
| "AR"
|
|
17
|
+
| "AS"
|
|
18
|
+
| "AT"
|
|
19
|
+
| "AU"
|
|
20
|
+
| "AW"
|
|
21
|
+
| "AX"
|
|
22
|
+
| "AZ"
|
|
23
|
+
| "BA"
|
|
24
|
+
| "BB"
|
|
25
|
+
| "BD"
|
|
26
|
+
| "BE"
|
|
27
|
+
| "BF"
|
|
28
|
+
| "BG"
|
|
29
|
+
| "BH"
|
|
30
|
+
| "BI"
|
|
31
|
+
| "BJ"
|
|
32
|
+
| "BL"
|
|
33
|
+
| "BM"
|
|
34
|
+
| "BN"
|
|
35
|
+
| "BO"
|
|
36
|
+
| "BQ-1"
|
|
37
|
+
| "BQ-2"
|
|
38
|
+
| "BQ"
|
|
39
|
+
| "BR"
|
|
40
|
+
| "BS"
|
|
41
|
+
| "BT"
|
|
42
|
+
| "BW"
|
|
43
|
+
| "BY"
|
|
44
|
+
| "BZ"
|
|
45
|
+
| "CA"
|
|
46
|
+
| "CC"
|
|
47
|
+
| "CD-1"
|
|
48
|
+
| "CD"
|
|
49
|
+
| "CF"
|
|
50
|
+
| "CH"
|
|
51
|
+
| "CK"
|
|
52
|
+
| "CL"
|
|
53
|
+
| "CM"
|
|
54
|
+
| "CN"
|
|
55
|
+
| "CO"
|
|
56
|
+
| "CR"
|
|
57
|
+
| "CU"
|
|
58
|
+
| "CW"
|
|
59
|
+
| "CX"
|
|
60
|
+
| "CY"
|
|
61
|
+
| "CZ"
|
|
62
|
+
| "DE"
|
|
63
|
+
| "DJ"
|
|
64
|
+
| "DK"
|
|
65
|
+
| "DM"
|
|
66
|
+
| "DO"
|
|
67
|
+
| "DS"
|
|
68
|
+
| "DZ"
|
|
69
|
+
| "earth"
|
|
70
|
+
| "EC"
|
|
71
|
+
| "EE"
|
|
72
|
+
| "EG"
|
|
73
|
+
| "EH"
|
|
74
|
+
| "ER"
|
|
75
|
+
| "ES"
|
|
76
|
+
| "ET"
|
|
77
|
+
| "FI"
|
|
78
|
+
| "FJ"
|
|
79
|
+
| "FK"
|
|
80
|
+
| "FM"
|
|
81
|
+
| "FO"
|
|
82
|
+
| "FR"
|
|
83
|
+
| "GA"
|
|
84
|
+
| "GB-2"
|
|
85
|
+
| "GB"
|
|
86
|
+
| "GD"
|
|
87
|
+
| "GE"
|
|
88
|
+
| "GG"
|
|
89
|
+
| "GH"
|
|
90
|
+
| "GI"
|
|
91
|
+
| "GL"
|
|
92
|
+
| "GM"
|
|
93
|
+
| "GN"
|
|
94
|
+
| "GQ"
|
|
95
|
+
| "GR"
|
|
96
|
+
| "GT"
|
|
97
|
+
| "GU"
|
|
98
|
+
| "GW"
|
|
99
|
+
| "GY"
|
|
100
|
+
| "HK"
|
|
101
|
+
| "HN"
|
|
102
|
+
| "HR"
|
|
103
|
+
| "HT"
|
|
104
|
+
| "HU"
|
|
105
|
+
| "ID"
|
|
106
|
+
| "IE"
|
|
107
|
+
| "IL"
|
|
108
|
+
| "IM"
|
|
109
|
+
| "IN"
|
|
110
|
+
| "IO"
|
|
111
|
+
| "IQ"
|
|
112
|
+
| "IR"
|
|
113
|
+
| "IS"
|
|
114
|
+
| "IT"
|
|
115
|
+
| "JE"
|
|
116
|
+
| "JM"
|
|
117
|
+
| "JO"
|
|
118
|
+
| "JP"
|
|
119
|
+
| "KE"
|
|
120
|
+
| "KG"
|
|
121
|
+
| "KH"
|
|
122
|
+
| "KI"
|
|
123
|
+
| "KM"
|
|
124
|
+
| "KN"
|
|
125
|
+
| "KP"
|
|
126
|
+
| "KR"
|
|
127
|
+
| "KW"
|
|
128
|
+
| "KY"
|
|
129
|
+
| "KZ"
|
|
130
|
+
| "LA"
|
|
131
|
+
| "LB"
|
|
132
|
+
| "LC"
|
|
133
|
+
| "LI"
|
|
134
|
+
| "LK"
|
|
135
|
+
| "LR"
|
|
136
|
+
| "LS"
|
|
137
|
+
| "LT"
|
|
138
|
+
| "LU"
|
|
139
|
+
| "LV"
|
|
140
|
+
| "LY"
|
|
141
|
+
| "MA"
|
|
142
|
+
| "MC"
|
|
143
|
+
| "MD"
|
|
144
|
+
| "ME"
|
|
145
|
+
| "MG"
|
|
146
|
+
| "MH"
|
|
147
|
+
| "MK"
|
|
148
|
+
| "ML"
|
|
149
|
+
| "MM"
|
|
150
|
+
| "MN"
|
|
151
|
+
| "MO"
|
|
152
|
+
| "MP"
|
|
153
|
+
| "MQ"
|
|
154
|
+
| "MR"
|
|
155
|
+
| "MS"
|
|
156
|
+
| "MT"
|
|
157
|
+
| "MU"
|
|
158
|
+
| "MV"
|
|
159
|
+
| "MW"
|
|
160
|
+
| "MX"
|
|
161
|
+
| "MY"
|
|
162
|
+
| "MZ"
|
|
163
|
+
| "NA"
|
|
164
|
+
| "NE"
|
|
165
|
+
| "NF"
|
|
166
|
+
| "NG"
|
|
167
|
+
| "NI"
|
|
168
|
+
| "NL"
|
|
169
|
+
| "NO"
|
|
170
|
+
| "NP"
|
|
171
|
+
| "NR"
|
|
172
|
+
| "NU"
|
|
173
|
+
| "NZ"
|
|
174
|
+
| "OM"
|
|
175
|
+
| "PA"
|
|
176
|
+
| "PE"
|
|
177
|
+
| "PF"
|
|
178
|
+
| "PG"
|
|
179
|
+
| "PH"
|
|
180
|
+
| "PK"
|
|
181
|
+
| "PL"
|
|
182
|
+
| "PM"
|
|
183
|
+
| "PN"
|
|
184
|
+
| "PR"
|
|
185
|
+
| "PT"
|
|
186
|
+
| "PW"
|
|
187
|
+
| "PY"
|
|
188
|
+
| "QA"
|
|
189
|
+
| "RE"
|
|
190
|
+
| "RO"
|
|
191
|
+
| "RS"
|
|
192
|
+
| "RU"
|
|
193
|
+
| "RW"
|
|
194
|
+
| "SA"
|
|
195
|
+
| "SB"
|
|
196
|
+
| "SC"
|
|
197
|
+
| "SD"
|
|
198
|
+
| "SE"
|
|
199
|
+
| "SG"
|
|
200
|
+
| "SH"
|
|
201
|
+
| "SI"
|
|
202
|
+
| "SJ"
|
|
203
|
+
| "SK"
|
|
204
|
+
| "SL"
|
|
205
|
+
| "SM"
|
|
206
|
+
| "SN"
|
|
207
|
+
| "SO"
|
|
208
|
+
| "SR"
|
|
209
|
+
| "SS"
|
|
210
|
+
| "ST"
|
|
211
|
+
| "SV"
|
|
212
|
+
| "SX"
|
|
213
|
+
| "SY"
|
|
214
|
+
| "SZ"
|
|
215
|
+
| "TC"
|
|
216
|
+
| "TD"
|
|
217
|
+
| "TF"
|
|
218
|
+
| "TG"
|
|
219
|
+
| "TH"
|
|
220
|
+
| "TJ"
|
|
221
|
+
| "TK"
|
|
222
|
+
| "TL"
|
|
223
|
+
| "TM"
|
|
224
|
+
| "TN"
|
|
225
|
+
| "TO"
|
|
226
|
+
| "TR"
|
|
227
|
+
| "TT"
|
|
228
|
+
| "TV"
|
|
229
|
+
| "TZ"
|
|
230
|
+
| "UA"
|
|
231
|
+
| "UG"
|
|
232
|
+
| "UM"
|
|
233
|
+
| "US"
|
|
234
|
+
| "UY"
|
|
235
|
+
| "UZ"
|
|
236
|
+
| "VA"
|
|
237
|
+
| "VC"
|
|
238
|
+
| "VE"
|
|
239
|
+
| "VG"
|
|
240
|
+
| "VI"
|
|
241
|
+
| "VN"
|
|
242
|
+
| "VU"
|
|
243
|
+
| "WF"
|
|
244
|
+
| "WS"
|
|
245
|
+
| "YE"
|
|
246
|
+
| "YT"
|
|
247
|
+
| "ZA"
|
|
248
|
+
| "ZM"
|
|
249
|
+
| "ZW";
|
|
250
|
+
|
|
251
|
+
export type ExtractColorKeys<T> = T extends { styles: infer C } ? keyof C : never;
|
|
252
|
+
export type ExtractBadgeKeys<T> = keyof T;
|
|
253
|
+
export type BadgeTypeToColorMap<T> = {
|
|
254
|
+
[K in ExtractBadgeKeys<T>]: ExtractColorKeys<T[K]>;
|
|
255
|
+
};
|
|
256
|
+
export type BadgeTypeColors<T> = ExtractColorKeys<T[keyof T]>;
|
|
257
|
+
|
|
258
|
+
export const badgeTypes = {
|
|
259
|
+
pillColor: "pill-color",
|
|
260
|
+
badgeColor: "color",
|
|
261
|
+
badgeModern: "modern",
|
|
262
|
+
} as const;
|
|
263
|
+
|
|
264
|
+
export type BadgeTypes = (typeof badgeTypes)[keyof typeof badgeTypes];
|