@industry-theme/github-panels 0.1.21 → 0.1.23

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/index.d.ts CHANGED
@@ -21,7 +21,7 @@ export { OwnerRepositoriesPanel } from './panels/OwnerRepositoriesPanel';
21
21
  export { RecentRepositoriesPanel, addRecentRepository, addRecentOwner } from './panels/RecentRepositoriesPanel';
22
22
  export type { OwnerInfo } from './panels/RecentRepositoriesPanel';
23
23
  export { WelcomePanel } from './panels/WelcomePanel';
24
- export type { WelcomePanelProps, HighlightedProject } from './panels/WelcomePanel';
24
+ export type { WelcomePanelProps, HighlightedProject, FeaturedOrganization } from './panels/WelcomePanel';
25
25
  export type { GitHubOwner, GitHubRepository, GitHubOrganization, GitHubRepositoriesSliceData, RepositorySelectedEventPayload, RepositoryPreviewEventPayload, GitHubPanelEventType, } from './types/github';
26
26
  export { githubTools, githubToolsMetadata, listRepositoriesTool, selectRepositoryTool, previewRepositoryTool, searchRepositoriesTool, openRepositorySwitcherTool, requestGitHubLoginTool, } from './tools';
27
27
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAgC,MAAM,SAAS,CAAC;AAG7E;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,eAAe,EAgFnC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,qBAGzB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,qBAG3B,CAAC;AAGF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO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AAiB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAGzG,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,2BAA2B,EAC3B,8BAA8B,EAC9B,6BAA6B,EAC7B,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,SAAS,CAAC"}
@@ -8,12 +8,21 @@ export interface HighlightedProject {
8
8
  repo: string;
9
9
  label?: string;
10
10
  }
11
+ /**
12
+ * Featured organization for the organizations section
13
+ */
14
+ export interface FeaturedOrganization {
15
+ login: string;
16
+ description?: string;
17
+ }
11
18
  /**
12
19
  * Props for the WelcomePanel
13
20
  */
14
21
  export interface WelcomePanelProps extends PanelComponentProps {
15
22
  onNavigate?: (owner: string, repo: string) => void;
16
23
  highlightedProjects?: HighlightedProject[];
24
+ featuredOrganizations?: FeaturedOrganization[];
25
+ onOrganizationClick?: (org: string) => void;
17
26
  }
18
27
  /**
19
28
  * WelcomePanel - A landing panel with branding and repo search
@@ -1 +1 @@
1
- {"version":3,"file":"WelcomePanel.d.ts","sourceRoot":"","sources":["../../src/panels/WelcomePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAYrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,mBAAmB;IAC5D,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAC5C;AA4HD;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAyQpD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;CAQhC,CAAC"}
1
+ {"version":3,"file":"WelcomePanel.d.ts","sourceRoot":"","sources":["../../src/panels/WelcomePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAYrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,mBAAmB;IAC5D,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC3C,qBAAqB,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAC/C,mBAAmB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AA+MD;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA6TpD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;CAQhC,CAAC"}
@@ -0,0 +1,59 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ declare const meta: {
3
+ title: string;
4
+ component: import("react").FC<import("./WelcomePanel").WelcomePanelProps>;
5
+ parameters: {
6
+ layout: string;
7
+ docs: {
8
+ description: {
9
+ component: string;
10
+ };
11
+ };
12
+ };
13
+ tags: string[];
14
+ decorators: ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react").ReactRenderer, {
15
+ onNavigate?: ((owner: string, repo: string) => void) | undefined;
16
+ highlightedProjects?: import("./WelcomePanel").HighlightedProject[] | undefined;
17
+ featuredOrganizations?: import("./WelcomePanel").FeaturedOrganization[] | undefined;
18
+ onOrganizationClick?: ((org: string) => void) | undefined;
19
+ context: import("@principal-ade/panel-framework-core").PanelContextValue;
20
+ actions: import("@principal-ade/panel-framework-core").PanelActions;
21
+ events: import("@principal-ade/panel-framework-core").PanelEventEmitter;
22
+ }>) => import("react/jsx-runtime").JSX.Element)[];
23
+ args: {
24
+ context: import("@principal-ade/panel-framework-core").PanelContextValue;
25
+ events: import("@principal-ade/panel-framework-core").PanelEventEmitter;
26
+ actions: import("@principal-ade/panel-framework-core").PanelActions;
27
+ };
28
+ };
29
+ export default meta;
30
+ type Story = StoryObj<typeof meta>;
31
+ /**
32
+ * Default state with no featured organizations
33
+ */
34
+ export declare const Default: Story;
35
+ /**
36
+ * With highlighted projects (legacy feature)
37
+ */
38
+ export declare const WithHighlightedProjects: Story;
39
+ /**
40
+ * With featured organizations - the main use case
41
+ */
42
+ export declare const WithFeaturedOrganizations: Story;
43
+ /**
44
+ * With both organizations and highlighted projects
45
+ */
46
+ export declare const WithOrganizationsAndProjects: Story;
47
+ /**
48
+ * Single organization
49
+ */
50
+ export declare const SingleOrganization: Story;
51
+ /**
52
+ * Organizations without descriptions
53
+ */
54
+ export declare const OrganizationsNoDescriptions: Story;
55
+ /**
56
+ * Interactive with navigation handler
57
+ */
58
+ export declare const Interactive: Story;
59
+ //# sourceMappingURL=WelcomePanel.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WelcomePanel.stories.d.ts","sourceRoot":"","sources":["../../src/panels/WelcomePanel.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAKvD,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;CA0B2B,CAAC;AAEtC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,KAQrC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,KASvC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,4BAA4B,EAAE,KAY1C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAOhC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,KASzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,KAkBzB,CAAC"}
@@ -3098,9 +3098,93 @@ const defaultHighlightedProjects = [
3098
3098
  { owner: "facebook", repo: "react" },
3099
3099
  { owner: "vercel", repo: "next.js" }
3100
3100
  ];
3101
+ const defaultFeaturedOrganizations = [];
3102
+ const OrganizationCard = ({ org, theme, onClick }) => {
3103
+ return /* @__PURE__ */ jsxs(
3104
+ "button",
3105
+ {
3106
+ onClick,
3107
+ style: {
3108
+ padding: "16px 20px",
3109
+ borderRadius: "12px",
3110
+ backgroundColor: theme.colors.surface,
3111
+ border: `1px solid ${theme.colors.border}`,
3112
+ display: "flex",
3113
+ alignItems: "center",
3114
+ gap: "12px",
3115
+ cursor: "pointer",
3116
+ transition: "all 0.2s ease",
3117
+ minWidth: "240px",
3118
+ textAlign: "left"
3119
+ },
3120
+ onMouseEnter: (e) => {
3121
+ e.currentTarget.style.borderColor = theme.colors.primary;
3122
+ e.currentTarget.style.transform = "translateY(-2px)";
3123
+ },
3124
+ onMouseLeave: (e) => {
3125
+ e.currentTarget.style.borderColor = theme.colors.border;
3126
+ e.currentTarget.style.transform = "translateY(0)";
3127
+ },
3128
+ children: [
3129
+ /* @__PURE__ */ jsx(
3130
+ "img",
3131
+ {
3132
+ src: `https://github.com/${org.login}.png?size=64`,
3133
+ alt: org.login,
3134
+ style: {
3135
+ width: 40,
3136
+ height: 40,
3137
+ borderRadius: "8px",
3138
+ flexShrink: 0
3139
+ }
3140
+ }
3141
+ ),
3142
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
3143
+ /* @__PURE__ */ jsx(
3144
+ "div",
3145
+ {
3146
+ style: {
3147
+ fontSize: `${theme.fontSizes[2]}px`,
3148
+ fontWeight: theme.fontWeights.semibold,
3149
+ color: theme.colors.text,
3150
+ marginBottom: org.description ? "2px" : 0
3151
+ },
3152
+ children: org.login
3153
+ }
3154
+ ),
3155
+ org.description && /* @__PURE__ */ jsx(
3156
+ "div",
3157
+ {
3158
+ style: {
3159
+ fontSize: `${theme.fontSizes[1]}px`,
3160
+ color: theme.colors.textSecondary,
3161
+ overflow: "hidden",
3162
+ textOverflow: "ellipsis",
3163
+ whiteSpace: "nowrap"
3164
+ },
3165
+ children: org.description
3166
+ }
3167
+ )
3168
+ ] }),
3169
+ /* @__PURE__ */ jsx(
3170
+ ExternalLink,
3171
+ {
3172
+ size: 16,
3173
+ style: {
3174
+ color: theme.colors.textSecondary,
3175
+ flexShrink: 0
3176
+ }
3177
+ }
3178
+ )
3179
+ ]
3180
+ }
3181
+ );
3182
+ };
3101
3183
  const WelcomePanel = ({
3102
3184
  onNavigate,
3103
- highlightedProjects = defaultHighlightedProjects
3185
+ highlightedProjects = defaultHighlightedProjects,
3186
+ featuredOrganizations = defaultFeaturedOrganizations,
3187
+ onOrganizationClick
3104
3188
  }) => {
3105
3189
  const { theme } = useTheme();
3106
3190
  const [repoInput, setRepoInput] = useState("");
@@ -3126,6 +3210,13 @@ const WelcomePanel = ({
3126
3210
  window.location.href = `/${project.owner}/${project.repo}`;
3127
3211
  }
3128
3212
  }, [onNavigate]);
3213
+ const handleOrganizationClick = useCallback((org) => {
3214
+ if (onOrganizationClick) {
3215
+ onOrganizationClick(org.login);
3216
+ } else {
3217
+ window.open(`https://github.com/${org.login}`, "_blank");
3218
+ }
3219
+ }, [onOrganizationClick]);
3129
3220
  return /* @__PURE__ */ jsxs(
3130
3221
  "div",
3131
3222
  {
@@ -3359,6 +3450,52 @@ const WelcomePanel = ({
3359
3450
  )
3360
3451
  }
3361
3452
  ),
3453
+ featuredOrganizations.length > 0 && /* @__PURE__ */ jsxs(
3454
+ "div",
3455
+ {
3456
+ style: {
3457
+ padding: "24px 32px 48px",
3458
+ display: "flex",
3459
+ flexDirection: "column",
3460
+ alignItems: "center",
3461
+ gap: "20px"
3462
+ },
3463
+ children: [
3464
+ /* @__PURE__ */ jsx(
3465
+ "h2",
3466
+ {
3467
+ style: {
3468
+ margin: 0,
3469
+ fontSize: `${theme.fontSizes[3]}px`,
3470
+ fontWeight: theme.fontWeights.semibold,
3471
+ color: theme.colors.textSecondary
3472
+ },
3473
+ children: "Explore Our Organizations"
3474
+ }
3475
+ ),
3476
+ /* @__PURE__ */ jsx(
3477
+ "div",
3478
+ {
3479
+ style: {
3480
+ display: "flex",
3481
+ gap: "16px",
3482
+ flexWrap: "wrap",
3483
+ justifyContent: "center"
3484
+ },
3485
+ children: featuredOrganizations.map((org) => /* @__PURE__ */ jsx(
3486
+ OrganizationCard,
3487
+ {
3488
+ org,
3489
+ theme,
3490
+ onClick: () => handleOrganizationClick(org)
3491
+ },
3492
+ org.login
3493
+ ))
3494
+ }
3495
+ )
3496
+ ]
3497
+ }
3498
+ ),
3362
3499
  highlightedProjects.length > 0 && /* @__PURE__ */ jsx(
3363
3500
  "div",
3364
3501
  {
@@ -3376,7 +3513,7 @@ const WelcomePanel = ({
3376
3513
  color: theme.colors.textSecondary
3377
3514
  },
3378
3515
  children: [
3379
- "Try it with",
3516
+ "Check out our forks of popular repos:",
3380
3517
  " ",
3381
3518
  highlightedProjects.map((project, index) => /* @__PURE__ */ jsxs(React2.Fragment, { children: [
3382
3519
  index > 0 && (index === highlightedProjects.length - 1 ? " or " : ", "),