gd-design-library 0.6.0 → 0.7.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.
Files changed (157) hide show
  1. package/ai/codegen.d.ts +10 -0
  2. package/ai/codegen.js +51 -0
  3. package/ai/index.d.ts +3 -0
  4. package/ai/prompts.d.ts +14 -0
  5. package/ai/prompts.js +23 -0
  6. package/ai/schemas/components/Accordion.d.ts +35 -0
  7. package/ai/schemas/components/Accordion.js +37 -0
  8. package/ai/schemas/components/Avatar.d.ts +41 -0
  9. package/ai/schemas/components/Avatar.js +67 -0
  10. package/ai/schemas/components/Breadcrumbs.d.ts +35 -0
  11. package/ai/schemas/components/Breadcrumbs.js +51 -0
  12. package/ai/schemas/components/Button.d.ts +60 -0
  13. package/ai/schemas/components/Button.js +92 -0
  14. package/ai/schemas/components/Card.d.ts +46 -0
  15. package/ai/schemas/components/Card.js +74 -0
  16. package/ai/schemas/components/Carousel.d.ts +60 -0
  17. package/ai/schemas/components/Carousel.js +108 -0
  18. package/ai/schemas/components/ChatBubble.d.ts +39 -0
  19. package/ai/schemas/components/ChatBubble.js +34 -0
  20. package/ai/schemas/components/ChatContainer.d.ts +29 -0
  21. package/ai/schemas/components/ChatContainer.js +48 -0
  22. package/ai/schemas/components/Column.d.ts +41 -0
  23. package/ai/schemas/components/Column.js +69 -0
  24. package/ai/schemas/components/ContentCarousel.d.ts +47 -0
  25. package/ai/schemas/components/ContentCarousel.js +72 -0
  26. package/ai/schemas/components/Counter.d.ts +26 -0
  27. package/ai/schemas/components/Counter.js +37 -0
  28. package/ai/schemas/components/DragAndDropFiles.d.ts +21 -0
  29. package/ai/schemas/components/DragAndDropFiles.js +50 -0
  30. package/ai/schemas/components/FlexContainer.d.ts +35 -0
  31. package/ai/schemas/components/FlexContainer.js +133 -0
  32. package/ai/schemas/components/Form.d.ts +35 -0
  33. package/ai/schemas/components/Form.js +36 -0
  34. package/ai/schemas/components/Icon.d.ts +39 -0
  35. package/ai/schemas/components/Icon.js +41 -0
  36. package/ai/schemas/components/Image.d.ts +21 -0
  37. package/ai/schemas/components/Image.js +55 -0
  38. package/ai/schemas/components/InlineNotification.d.ts +23 -0
  39. package/ai/schemas/components/InlineNotification.js +23 -0
  40. package/ai/schemas/components/Input.d.ts +47 -0
  41. package/ai/schemas/components/Input.js +142 -0
  42. package/ai/schemas/components/InputFile.d.ts +41 -0
  43. package/ai/schemas/components/InputFile.js +55 -0
  44. package/ai/schemas/components/Label.d.ts +26 -0
  45. package/ai/schemas/components/Label.js +43 -0
  46. package/ai/schemas/components/Link.d.ts +60 -0
  47. package/ai/schemas/components/Link.js +58 -0
  48. package/ai/schemas/components/List.d.ts +39 -0
  49. package/ai/schemas/components/List.js +35 -0
  50. package/ai/schemas/components/Loader.d.ts +41 -0
  51. package/ai/schemas/components/Loader.js +55 -0
  52. package/ai/schemas/components/Modal.d.ts +41 -0
  53. package/ai/schemas/components/Modal.js +51 -0
  54. package/ai/schemas/components/Portal.d.ts +46 -0
  55. package/ai/schemas/components/Portal.js +49 -0
  56. package/ai/schemas/components/Price.d.ts +15 -0
  57. package/ai/schemas/components/Price.js +25 -0
  58. package/ai/schemas/components/ProgressBar.d.ts +31 -0
  59. package/ai/schemas/components/ProgressBar.js +53 -0
  60. package/ai/schemas/components/RadioGroup.d.ts +46 -0
  61. package/ai/schemas/components/RadioGroup.js +80 -0
  62. package/ai/schemas/components/Rating.d.ts +47 -0
  63. package/ai/schemas/components/Rating.js +64 -0
  64. package/ai/schemas/components/Row.d.ts +21 -0
  65. package/ai/schemas/components/Row.js +61 -0
  66. package/ai/schemas/components/Scroll.d.ts +32 -0
  67. package/ai/schemas/components/Scroll.js +35 -0
  68. package/ai/schemas/components/Search.d.ts +31 -0
  69. package/ai/schemas/components/Search.js +72 -0
  70. package/ai/schemas/components/Select.d.ts +35 -0
  71. package/ai/schemas/components/Select.js +84 -0
  72. package/ai/schemas/components/Separator.d.ts +35 -0
  73. package/ai/schemas/components/Separator.js +62 -0
  74. package/ai/schemas/components/Skeleton.d.ts +35 -0
  75. package/ai/schemas/components/Skeleton.js +48 -0
  76. package/ai/schemas/components/Slider.d.ts +31 -0
  77. package/ai/schemas/components/Slider.js +42 -0
  78. package/ai/schemas/components/Snackbar.d.ts +46 -0
  79. package/ai/schemas/components/Snackbar.js +57 -0
  80. package/ai/schemas/components/SnackbarManager.d.ts +11 -0
  81. package/ai/schemas/components/SnackbarManager.js +13 -0
  82. package/ai/schemas/components/Stepper.d.ts +41 -0
  83. package/ai/schemas/components/Stepper.js +38 -0
  84. package/ai/schemas/components/Switch.d.ts +47 -0
  85. package/ai/schemas/components/Switch.js +64 -0
  86. package/ai/schemas/components/Tabs.d.ts +35 -0
  87. package/ai/schemas/components/Tabs.js +37 -0
  88. package/ai/schemas/components/Textarea.d.ts +35 -0
  89. package/ai/schemas/components/Textarea.js +88 -0
  90. package/ai/schemas/components/Toggle.d.ts +35 -0
  91. package/ai/schemas/components/Toggle.js +41 -0
  92. package/ai/schemas/components/Tooltip.d.ts +53 -0
  93. package/ai/schemas/components/Tooltip.js +61 -0
  94. package/ai/schemas/components/Typography.d.ts +53 -0
  95. package/ai/schemas/components/Typography.js +56 -0
  96. package/ai/schemas/components/Wrapper.d.ts +35 -0
  97. package/ai/schemas/components/Wrapper.js +46 -0
  98. package/ai/schemas/components.d.ts +22 -0
  99. package/ai/schemas/components.js +56 -0
  100. package/ai/schemas/hooks/useTheme.d.ts +47 -0
  101. package/ai/schemas/hooks/useTheme.js +48 -0
  102. package/assets/icons/thumb-down-filled.d.ts +5 -0
  103. package/assets/icons/thumb-down-filled.js +10 -0
  104. package/assets/icons/thumb-down.d.ts +1 -3
  105. package/assets/icons/thumb-down.js +6 -13
  106. package/assets/icons/thumb-up-filled.d.ts +5 -0
  107. package/assets/icons/thumb-up-filled.js +10 -0
  108. package/assets/icons/thumb-up.d.ts +1 -3
  109. package/assets/icons/thumb-up.js +6 -13
  110. package/assets/index.d.ts +2 -0
  111. package/components/core/Dropdown/Dropdown.types.d.ts +1 -3
  112. package/components/core/Dropdown/DropdownStyled.d.ts +1 -1
  113. package/components/core/Dropdown/DropdownStyled.js +8 -11
  114. package/components/core/Form/utils.js +1 -1
  115. package/components/core/Icon/constants.d.ts +12 -6
  116. package/components/core/Icon/constants.js +98 -94
  117. package/components/core/Input/Input.d.ts +1 -1
  118. package/components/core/Modal/Modal.js +16 -16
  119. package/components/core/Portal/Portal.js +19 -13
  120. package/components/core/Portal/Portal.types.d.ts +1 -0
  121. package/components/core/Select/Select.js +150 -100
  122. package/components/core/Select/Select.types.d.ts +3 -0
  123. package/components/core/Select/SelectStyled.d.ts +1 -1
  124. package/components/core/Select/SelectStyled.js +29 -32
  125. package/components/core/Snackbar/SnackbarStyled.js +6 -6
  126. package/components/core/Switch/Switch.d.ts +2 -2
  127. package/components/core/Switch/Switch.js +34 -24
  128. package/components/core/Switch/Switch.types.d.ts +4 -4
  129. package/components/core/Switch/SwitchStyled.d.ts +3 -3
  130. package/components/core/Switch/SwitchStyled.js +8 -8
  131. package/components/core/Tooltip/Tooltip.js +34 -34
  132. package/components/core/Tooltip/Tooltip.types.d.ts +1 -1
  133. package/components/core/Typography/Typography.types.d.ts +4 -4
  134. package/components/domainSpecific/Avatar/Avatar.types.d.ts +6 -7
  135. package/constants/positioning.js +0 -1
  136. package/hooks/useTheme/index.d.ts +1 -0
  137. package/hooks/useTheme/useTheme.types.d.ts +1 -1
  138. package/hooks/useTheme/utils.d.ts +2 -0
  139. package/hooks/useTheme/utils.js +10 -0
  140. package/index.d.ts +1 -0
  141. package/index.js +319 -302
  142. package/package.json +1 -1
  143. package/tokens/defaultTheme.d.ts +35 -17
  144. package/tokens/index.d.ts +33 -17
  145. package/tokens/modal.d.ts +2 -0
  146. package/tokens/modal.js +10 -8
  147. package/tokens/select.d.ts +13 -6
  148. package/tokens/select.js +44 -37
  149. package/tokens/snackbar.d.ts +10 -2
  150. package/tokens/snackbar.js +43 -35
  151. package/tokens/switch.d.ts +7 -8
  152. package/tokens/switch.js +17 -18
  153. package/tokens/textarea.d.ts +3 -1
  154. package/tokens/textarea.js +3 -1
  155. package/utils/helpers.d.ts +1 -1
  156. package/utils/helpers.js +40 -33
  157. package/components/layout/FlexContainer/utils.js +0 -18
@@ -0,0 +1,10 @@
1
+ export type AIIntent = 'login';
2
+ export interface GenerateOptions {
3
+ componentName?: string;
4
+ }
5
+ /**
6
+ * Returns a TSX string for a classic Login page composed with gd-design-library components.
7
+ * The output is intentionally framework-agnostic TSX that can be pasted into a React project.
8
+ */
9
+ export declare function generateLoginPageTSX(options?: GenerateOptions): string;
10
+ export declare function generateUIFromIntent(intent: AIIntent, options?: GenerateOptions): string;
package/ai/codegen.js ADDED
@@ -0,0 +1,51 @@
1
+ function n(e = {}) {
2
+ return `import React, { useState } from 'react';
3
+ import { Form, Input, Button, Typography, FlexContainer, Column, Card, Link } from 'gd-design-library';
4
+
5
+ export default function ${e.componentName || "LoginPage"}() {
6
+ const [form, setForm] = useState({ email: '', password: '', remember: false });
7
+
8
+ const handleSubmit = ({ formData }: any) => {
9
+ console.log('Login submit', formData);
10
+ };
11
+
12
+ return (
13
+ <FlexContainer alignItems="center" justifyContent="center" minHeight="100vh" padding="24px">
14
+ <Card width="360px" padding="24px">
15
+ <Column gap="16px">
16
+ <Typography as="h1" variant="h2">Sign in</Typography>
17
+ <Form onSubmit={handleSubmit}>
18
+ <Column gap="12px">
19
+ <Input variant="email" label="Email" name="email" placeholder="you@example.com" value={form.email} onChange={(e: any) => setForm({ ...form, email: e.target.value })} />
20
+ <Input variant="password" label="Password" name="password" placeholder="••••••••" value={form.password} onChange={(e: any) => setForm({ ...form, password: e.target.value })} />
21
+ <FlexContainer alignItems="center" justifyContent="space-between">
22
+ <FlexContainer alignItems="center" gap="8px">
23
+ <Input variant="checkbox" name="remember" aria-label="Remember me" onChange={(e: any) => setForm({ ...form, remember: !!e.target?.checked })} />
24
+ <Typography variant="small">Remember me</Typography>
25
+ </FlexContainer>
26
+ <Link href="#">Forgot password?</Link>
27
+ </FlexContainer>
28
+ <Button type="submit" fullWidth>Sign in</Button>
29
+ </Column>
30
+ </Form>
31
+ <Typography variant="small">
32
+ Don’t have an account? <Link href="#">Sign up</Link>
33
+ </Typography>
34
+ </Column>
35
+ </Card>
36
+ </FlexContainer>
37
+ );
38
+ }
39
+ `;
40
+ }
41
+ function t(e, a) {
42
+ switch (e) {
43
+ case "login":
44
+ default:
45
+ return n(a);
46
+ }
47
+ }
48
+ export {
49
+ n as generateLoginPageTSX,
50
+ t as generateUIFromIntent
51
+ };
package/ai/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from './prompts';
2
+ export * from './codegen';
3
+ export * from './schemas/components';
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Claude Code – System Prompt for generating React/TSX with gd-design-library (GridKit)
3
+ * This constant is intended as the "system" instruction for the LLM.
4
+ */
5
+ export declare const CLAUDE_GRIDKIT_SYSTEM_PROMPT: string;
6
+ /**
7
+ * Builds a task-specific instruction for Claude Code appended after the system prompt.
8
+ */
9
+ export declare function buildClaudeSystemPrompt(userRequest: string): string;
10
+ /**
11
+ * Legacy/basic builder retained for compatibility.
12
+ */
13
+ export declare function buildGDLibraryPrompt(userRequest: string): string;
14
+ export declare const defaultAIPromptIntro: string;
package/ai/prompts.js ADDED
@@ -0,0 +1,23 @@
1
+ import { aiComponentsSchema as n, aiPromptGuidelines as i } from "./schemas/components.js";
2
+ const a = (() => {
3
+ const o = n.components.map((e) => `- ${e.name}: ${e.description}`).join(`
4
+ `), r = n.compositionTips.map((e) => `- ${e}`).join(`
5
+ `), t = i.map((e) => `- ${e}`).join(`
6
+ `);
7
+ return ['You are Claude Code acting as a senior React UI engineer. Your job is to output production-grade TSX using the GridKit UI package named "gd-design-library".', "", "Hard requirements:", "- Output ONLY valid TSX/TypeScript React code. Do NOT include markdown fences or extra commentary.", "- Import UI primitives exclusively from 'gd-design-library' (e.g., import { Form, Input, Button, Typography, FlexContainer, Column, Card, Link } from 'gd-design-library').", "- Prefer composition using ALL 46 available components over custom CSS or HTML elements.", "- Always use the appropriate component from the library: FlexContainer, Column, Row, Search, Select, ChatContainer, ChatBubble, Typography, Input, Button, Link, Card, Icon, Image, Breadcrumbs, InlineNotification, InputFile, Form, Label, List, Loader, Modal, Portal, Scroll, Separator, Skeleton, Slider, Snackbar, SnackbarManager, Switch, Toggle, Textarea, Tooltip, Wrapper, Accordion, Avatar, Carousel, ContentCarousel, Counter, Tabs, Stepper, Price, ProgressBar, Rating, DragAndDropFiles, RadioGroup.", "- Ensure accessibility: use Label components for all form controls, aria attributes, keyboard focus order, and sensible defaults.", "- Keep code self-contained as a single React component file where feasible.", "", "Available components (all 46 must be considered for composition):", o, "", "Composition tips:", r, "", "General guidelines:", t, "", "Output rules:", "- No markdown backticks.", "- No external CSS files unless strictly necessary; prefer component props and layout primitives.", "- Keep imports minimal and from one source: gd-design-library.", "- If state is needed, use React useState inside the component.", "- Handle forms with <Form> and Input variants (email, password, checkbox, etc.).", "- Add basic error placeholders and comments where integration points are expected (e.g., TODO: submit handler)."].join(`
8
+ `);
9
+ })();
10
+ function s(o) {
11
+ return [a, "", "Task:", o].join(`
12
+ `);
13
+ }
14
+ function p(o) {
15
+ return s(o);
16
+ }
17
+ const c = "Use gd-design-library for all UI components. Utilize the full range of 46 components including layout primitives (FlexContainer, Column, Grid, Stack), form controls (Form, Input, Select, Checkbox, Radio, Toggle, Label), feedback components (Alert, InlineNotification, Toast, Tooltip), navigation (Link, Tabs, Breadcrumb, Pagination), display components (Card, Table, List, Avatar, Badge, Icon), interactive elements (Button, ButtonGroup, Dropdown, Modal, Drawer, Popover), data visualization (ProgressBar, Spinner, Skeleton), and typography (Typography, Heading). Prefer composition using these primitives over custom CSS. Always ensure proper accessibility with Label components for form controls.";
18
+ export {
19
+ a as CLAUDE_GRIDKIT_SYSTEM_PROMPT,
20
+ s as buildClaudeSystemPrompt,
21
+ p as buildGDLibraryPrompt,
22
+ c as defaultAIPromptIntro
23
+ };
@@ -0,0 +1,35 @@
1
+ declare const _default: {
2
+ component: {
3
+ name: string;
4
+ import: string;
5
+ description: string;
6
+ props: ({
7
+ name: string;
8
+ type: string;
9
+ description: string;
10
+ default: never[];
11
+ required?: undefined;
12
+ } | {
13
+ name: string;
14
+ type: string;
15
+ description: string;
16
+ default?: undefined;
17
+ required?: undefined;
18
+ } | {
19
+ name: string;
20
+ type: string;
21
+ description: string;
22
+ default: boolean;
23
+ required?: undefined;
24
+ } | {
25
+ name: string;
26
+ type: string;
27
+ description: string;
28
+ required: boolean;
29
+ default?: undefined;
30
+ })[];
31
+ examples: string[];
32
+ };
33
+ compositionTips: string[];
34
+ };
35
+ export default _default;
@@ -0,0 +1,37 @@
1
+ const e = {
2
+ name: "Accordion",
3
+ import: "import { Accordion } from 'gd-design-library'",
4
+ description: "Expandable/collapsible content panels component for organizing and displaying hierarchical information with support for single or multiple expanded items, controlled and uncontrolled modes.",
5
+ props: [{
6
+ name: "value",
7
+ type: "string[]",
8
+ description: "Controls which accordion items are expanded (controlled mode)",
9
+ default: []
10
+ }, {
11
+ name: "defaultValue",
12
+ type: "string[]",
13
+ description: "Sets initially expanded items (uncontrolled mode)",
14
+ default: []
15
+ }, {
16
+ name: "onChange",
17
+ type: "(value: string[]) => void",
18
+ description: "Callback when expanded items change"
19
+ }, {
20
+ name: "allowMultipleExpand",
21
+ type: "boolean",
22
+ description: "Allows multiple items to be expanded simultaneously",
23
+ default: !1
24
+ }, {
25
+ name: "children",
26
+ type: "ReactNode",
27
+ description: "Accordion items to be rendered, typically AccordionItem components",
28
+ required: !0
29
+ }],
30
+ examples: ['<Accordion defaultValue={["item1"]} allowMultipleExpand={false}><AccordionItem value="item1" title="Section 1">Content 1</AccordionItem></Accordion>', "<Accordion value={expandedItems} onChange={setExpandedItems} allowMultipleExpand={true}>{accordionItems}</Accordion>", '<Accordion><AccordionItem value="faq1" title="Question 1">Answer 1</AccordionItem><AccordionItem value="faq2" title="Question 2">Answer 2</AccordionItem></Accordion>']
31
+ }, o = ["Use controlled value for syncing expanded state with URL or external state.", "Enable allowMultipleExpand for settings panels where multiple sections can be open.", "Keep titles concise and descriptive; use custom views for rich headers.", "Defer heavy content rendering until expanded for performance.", 'Use Accordion for FAQ sections with defaultValue={["first-question"]} to show the most important question expanded.', "Apply Accordion allowMultipleExpand={true} for content where users might want to compare multiple sections.", "Set Accordion value with controlled mode when expansion state needs to be managed externally or synced with URL.", "Use Accordion onChange to track analytics events for which sections users are most interested in.", "Apply Accordion with single expanded item (allowMultipleExpand={false}) for step-by-step guides or wizards.", "Combine Accordion with Icon components in item titles for visual category indicators.", "Use Accordion defaultValue with multiple items for showing important sections expanded on page load.", "Apply Accordion within Card components for organized settings or preference sections.", "Set Accordion with consistent spacing between items using Column or gap styles.", "Use Accordion for progressive disclosure of complex forms or detailed information.", "Apply Accordion onChange with localStorage to persist user expansion preferences.", "Combine Accordion with InlineNotification inside items for contextual alerts or warnings.", "Use Accordion for nested categorization with Accordion components inside AccordionItem content.", "Apply Accordion with keyboard navigation support (arrow keys) for accessibility.", "Set Accordion value={[]} to programmatically collapse all items when needed.", "Use Accordion with loading skeletons inside items while fetching content.", "Apply Accordion allowMultipleExpand={false} for mobile interfaces to save screen space.", "Combine Accordion with search/filter to highlight and expand matching sections.", "Use Accordion for documentation sections with code examples in expandable items.", "Apply Accordion with smooth height animations for polished expand/collapse transitions.", "Set Accordion with aria-expanded attributes on items for screen reader compatibility.", "Use Accordion in sidebars for collapsible navigation menu categories.", "Apply Accordion with consistent chevron or plus/minus icons for expand indicators.", "Combine Accordion with Badge components in titles to show item counts or status.", "Use Accordion defaultValue based on user role or permissions for personalized experience.", "Apply Accordion with max-height and scroll inside items for very long content.", "Set Accordion onChange to update URL hash for deep-linkable expanded sections.", "Use Accordion for comparison tables where each item contains detailed specifications.", "Apply Accordion with disabled items for locked or premium content sections.", "Combine Accordion with Form components inside items for multi-step form workflows.", "Use Accordion value with useEffect to expand specific items based on route or query params.", "Apply Accordion with consistent title styling using Typography components.", "Set Accordion with print styles to show all content expanded when printing.", "Use Accordion for changelog or release notes with versions as expandable items.", "Apply Accordion allowMultipleExpand based on viewport size (true on desktop, false on mobile).", "Combine Accordion with Tooltip on item titles for additional context without expanding.", "Use Accordion for product features list with detailed descriptions in expandable content.", "Apply Accordion with focus management to move focus to content when item expands.", "Set Accordion with custom expand/collapse icons via AccordionItem props.", "Use Accordion in help centers with categories and subcategories as nested accordions.", "Apply Accordion onChange to trigger animations or lazy-load content when items expand.", "Combine Accordion with tabs for multi-dimensional content organization.", "Use Accordion for terms and conditions with sections as expandable items.", "Apply Accordion with highlighting or scrollIntoView when expanding items programmatically.", "Set Accordion with responsive layout adjusting item padding and font size on mobile.", "Use Accordion for data tables with expandable rows showing detailed information.", "Apply Accordion with consistent animation duration across all expanding/collapsing items.", "Combine Accordion with router integration to maintain expansion state during navigation.", "Use Accordion for configuration panels with grouped settings in expandable sections."], n = {
32
+ component: e,
33
+ compositionTips: o
34
+ };
35
+ export {
36
+ n as default
37
+ };
@@ -0,0 +1,41 @@
1
+ declare const _default: {
2
+ component: {
3
+ name: string;
4
+ import: string;
5
+ description: string;
6
+ props: ({
7
+ name: string;
8
+ type: string;
9
+ description: string;
10
+ default?: undefined;
11
+ enum?: undefined;
12
+ } | {
13
+ name: string;
14
+ type: string;
15
+ description: string;
16
+ default: string;
17
+ enum?: undefined;
18
+ } | {
19
+ name: string;
20
+ type: string;
21
+ description: string;
22
+ default: string;
23
+ enum: string[];
24
+ } | {
25
+ name: string;
26
+ type: string;
27
+ description: string;
28
+ default: boolean;
29
+ enum?: undefined;
30
+ } | {
31
+ name: string;
32
+ type: string;
33
+ description: string;
34
+ default: {};
35
+ enum?: undefined;
36
+ })[];
37
+ examples: string[];
38
+ };
39
+ compositionTips: string[];
40
+ };
41
+ export default _default;
@@ -0,0 +1,67 @@
1
+ const e = {
2
+ name: "Avatar",
3
+ import: "import { Avatar } from 'gd-design-library'",
4
+ description: "User avatar component for displaying profile pictures, initials, or icons with support for badges, fallback content, and various size options. Ideal for user profiles, comment sections, and navigation headers.",
5
+ props: [{
6
+ name: "src",
7
+ type: "string",
8
+ description: "The URL of the image to display in the avatar. If no src is provided or the image fails to load, the fallback content will be rendered"
9
+ }, {
10
+ name: "alt",
11
+ type: "string",
12
+ description: "Alternative text for the avatar image, important for accessibility. This will be used as the aria-label for the avatar",
13
+ default: ""
14
+ }, {
15
+ name: "sizeVariant",
16
+ type: "SizeVariant",
17
+ description: "Defines the predefined size of the avatar",
18
+ default: "md",
19
+ enum: ["xs", "sm", "md", "lg", "xl", "xxl"]
20
+ }, {
21
+ name: "withBadge",
22
+ type: "boolean",
23
+ description: "If true, a small badge will be displayed at the top-right corner of the avatar, often indicating online status or notifications",
24
+ default: !1
25
+ }, {
26
+ name: "badgeColor",
27
+ type: "string",
28
+ description: "The color of the badge when withBadge is true. Accepts CSS color values (e.g., hex, named colors). Also supports theme colors (e.g. primary.default)",
29
+ default: "#34A853"
30
+ }, {
31
+ name: "backgroundColor",
32
+ type: "string",
33
+ description: "The background color of the avatar when no image is loaded, or when the image fails. Also used for the fallback content container. Accepts CSS color values (e.g., hex, named colors) and supports theme colors (e.g. primary.default)"
34
+ }, {
35
+ name: "fallbackComponent",
36
+ type: "ReactNode",
37
+ description: "Content to display when src is not provided or the image fails to load. Can be a string, number, or any ReactNode (e.g., an icon, initials, or a custom component)"
38
+ }, {
39
+ name: "onClick",
40
+ type: "() => void",
41
+ description: "Callback function triggered when the avatar is clicked"
42
+ }, {
43
+ name: "id",
44
+ type: "string",
45
+ description: "A unique identifier for the avatar element"
46
+ }, {
47
+ name: "className",
48
+ type: "string",
49
+ description: "Additional CSS class names to apply to the avatar component"
50
+ }, {
51
+ name: "placeholder",
52
+ type: "string",
53
+ description: "Passed to the internal Image component"
54
+ }, {
55
+ name: "styles",
56
+ type: "CSSObject",
57
+ description: "Custom CSS-in-JS styles to apply to the top-level container of the Avatar",
58
+ default: {}
59
+ }],
60
+ examples: ['<Avatar src="/user-photo.jpg" alt="John Doe" sizeVariant="lg" />', '<Avatar fallbackComponent="JD" backgroundColor="#6366F1" sizeVariant="md" onClick={handleProfileClick} />', '<Avatar src={userImage} alt={userName} withBadge badgeColor="#34A853" sizeVariant="sm" />', '<Avatar fallbackComponent={<Icon name="user" />} backgroundColor="primary.default" sizeVariant="xl" />', '<Avatar src="/avatar.png" alt="User" withBadge={isOnline} badgeColor={isOnline ? "#34A853" : "#EA4335"} />']
61
+ }, a = ["Use meaningful alt text or aria-labels for accessibility when using avatars as buttons.", "Show withBadge to indicate online status; customize badgeColor for different states.", "Provide fallbackComponent with initials or an icon when images fail to load.", "Use size variants consistently across lists, headers, and cards for uniformity.", "Use Avatar with src prop for user profile pictures ensuring proper alt text for accessibility.", 'Apply Avatar sizeVariant="xs" or "sm" for compact UI elements like comment threads or user lists.', 'Set Avatar sizeVariant="lg" or "xl" for profile pages and user detail views.', "Use Avatar fallbackComponent with user initials when profile image is unavailable.", 'Apply Avatar withBadge={true} and badgeColor="#34A853" to indicate online status.', "Combine Avatar with Typography for user name display in consistent layouts.", "Use Avatar backgroundColor with theme colors for consistent fallback appearance.", 'Apply Avatar fallbackComponent with Icon name="user" for anonymous or guest users.', "Set Avatar onClick handler for navigating to user profiles or opening user menus.", "Use Avatar in ChatContainer headers or message lists for conversation participants.", "Apply Avatar with consistent sizeVariant across similar UI contexts for visual harmony.", "Combine multiple Avatar components with negative margins for overlapping group avatars.", "Use Avatar withBadge and different badgeColor values for various status indicators (online, away, busy).", "Apply Avatar in Card components for user cards or team member displays.", "Set Avatar with Tooltip showing user name or role on hover for additional context.", "Use Avatar fallbackComponent with first letters of first and last name for professional appearance.", "Apply Avatar in navigation headers with dropdown menus for user account access.", "Combine Avatar with Badge component nearby for notification counts or user levels.", 'Use Avatar sizeVariant="md" as default for most UI contexts for optimal visibility.', "Apply Avatar with border styles via className for highlighted or selected users.", "Set Avatar with loading skeleton while user data is being fetched.", "Use Avatar in Select options with renderOption for user selection dropdowns.", "Apply Avatar placeholder prop for loading state text while image loads.", "Combine Avatar with presence indicators using withBadge for real-time collaboration.", "Use Avatar with consistent aspect ratio (1:1) maintained across all size variants.", "Apply Avatar in List items for user directories or contact lists.", "Set Avatar with error handling to gracefully show fallback when image fails.", "Use Avatar backgroundColor with user-specific colors for unique identification.", "Apply Avatar with responsive sizeVariant adjusting based on viewport size.", "Combine Avatar with user role badges or verification checkmarks for status display.", 'Use Avatar in comment sections with sizeVariant="sm" for space-efficient layouts.', "Apply Avatar with animation classes for smooth entrance effects in user lists.", "Set Avatar with high-contrast backgroundColor for better visibility of fallback content.", "Use Avatar in Table rows for user management interfaces or team rosters.", "Apply Avatar with consistent margins/padding for aligned layouts in forms.", "Combine Avatar with FlexContainer for user info cards with proper spacing.", "Use Avatar fallbackComponent with generated avatars or identicons for unique visuals.", "Apply Avatar in search results with user name and role information.", "Set Avatar with keyboard navigation support when onClick is provided.", "Use Avatar with lazy loading for performance in user-heavy interfaces.", "Apply Avatar withBadge={false} for static displays where status is not relevant.", "Combine Avatar with hover effects via styles or className for interactive feedback.", "Use Avatar in dropdown headers showing current logged-in user information.", "Apply Avatar with data attributes for analytics tracking of profile interactions.", "Set Avatar with proper ARIA labels for screen reader accessibility.", "Use Avatar in testimonials or review sections with customer photos.", "Apply Avatar with CDN image URLs for optimized delivery and caching.", "Combine Avatar with Modal for full-size profile photo viewing on click.", "Use Avatar consistently in all user-related UI elements for familiar user experience."], t = {
62
+ component: e,
63
+ compositionTips: a
64
+ };
65
+ export {
66
+ t as default
67
+ };
@@ -0,0 +1,35 @@
1
+ declare const _default: {
2
+ component: {
3
+ name: string;
4
+ import: string;
5
+ description: string;
6
+ props: ({
7
+ name: string;
8
+ type: string;
9
+ description: string;
10
+ required: boolean;
11
+ default: never[];
12
+ } | {
13
+ name: string;
14
+ type: string;
15
+ description: string;
16
+ default: string;
17
+ required?: undefined;
18
+ } | {
19
+ name: string;
20
+ type: string;
21
+ description: string;
22
+ required?: undefined;
23
+ default?: undefined;
24
+ } | {
25
+ name: string;
26
+ type: string;
27
+ description: string;
28
+ default: boolean;
29
+ required?: undefined;
30
+ })[];
31
+ examples: string[];
32
+ };
33
+ compositionTips: string[];
34
+ };
35
+ export default _default;
@@ -0,0 +1,51 @@
1
+ const e = {
2
+ name: "Breadcrumbs",
3
+ import: "import { Breadcrumbs } from 'gd-design-library'",
4
+ description: "Navigation component that displays the current page location within a hierarchical structure, providing users with a trail of links to navigate back to parent pages.",
5
+ props: [{
6
+ name: "items",
7
+ type: "Array<{label: string, href?: string, onClick?: () => void}>",
8
+ description: "Array of breadcrumb items to be displayed",
9
+ required: !0,
10
+ default: []
11
+ }, {
12
+ name: "separator",
13
+ type: "string | ReactNode",
14
+ description: "Custom separator between breadcrumb items",
15
+ default: "/"
16
+ }, {
17
+ name: "itemStart",
18
+ type: "ReactNode",
19
+ description: "Custom component to be displayed before the first item"
20
+ }, {
21
+ name: "itemEnd",
22
+ type: "ReactNode",
23
+ description: "Custom component to be displayed after the last item"
24
+ }, {
25
+ name: "separatorAfterLastItem",
26
+ type: "boolean",
27
+ description: "Controls whether to show separator after the last item",
28
+ default: !1
29
+ }, {
30
+ name: "bordered",
31
+ type: "boolean",
32
+ description: "Adds border styling to the breadcrumbs",
33
+ default: !1
34
+ }, {
35
+ name: "className",
36
+ type: "string",
37
+ description: "Additional CSS class name"
38
+ }, {
39
+ name: "ariaLabel",
40
+ type: "string",
41
+ description: "Accessibility label for the breadcrumbs navigation",
42
+ default: "breadcrumb"
43
+ }],
44
+ examples: ['<Breadcrumbs items={[{label: "Home", href: "/"}, {label: "Products", href: "/products"}, {label: "Detail"}]} />', '<Breadcrumbs items={breadcrumbItems} separator={<Icon name="chevron-right" />} bordered />', '<Breadcrumbs items={paths} itemStart={<Icon name="home" />} ariaLabel="Page navigation" />']
45
+ }, t = ["Use Breadcrumbs at the top of content pages to show hierarchical navigation path.", "Set Breadcrumbs items with href for all parent pages and no href for current page.", "Apply Breadcrumbs separator with Icon component for visual separators like chevron-right.", "Use Breadcrumbs itemStart with home icon for clear navigation starting point.", "Set Breadcrumbs bordered={true} to visually separate from page content.", "Apply Breadcrumbs with consistent positioning across all pages for user orientation.", "Use Breadcrumbs items onClick instead of href for client-side routing in SPAs.", 'Combine Breadcrumbs with Typography variant="caption" for items in compact layouts.', "Apply Breadcrumbs ariaLabel with descriptive text for screen reader context.", "Use Breadcrumbs at the top of content pages to show hierarchical navigation path.", "Set Breadcrumbs items with href for all parent pages and no href for current page.", "Apply Breadcrumbs separator with Icon component for visual separators like chevron-right.", "Use Breadcrumbs itemStart with home icon for clear navigation starting point.", "Set Breadcrumbs bordered={true} to visually separate from page content.", "Apply Breadcrumbs with consistent positioning across all pages for user orientation.", "Use Breadcrumbs items onClick instead of href for client-side routing in SPAs.", 'Combine Breadcrumbs with Typography variant="caption" for items in compact layouts.', "Set Breadcrumbs separatorAfterLastItem={false} (default) for clean ending.", "Apply Breadcrumbs ariaLabel with descriptive text for screen reader context.", "Use Breadcrumbs itemEnd with status icons or badges for additional context.", "Keep Breadcrumbs items concise with truncation for long labels in deep hierarchies.", "Apply Breadcrumbs className for consistent styling across the application.", "Use Breadcrumbs with responsive design hiding middle items on mobile with ellipsis.", "Set Breadcrumbs items dynamically based on route parameters and page hierarchy.", "Apply Breadcrumbs with Link component styling for consistent link appearance.", 'Use Breadcrumbs separator=">" for simple text separators without icons.', "Combine Breadcrumbs with page title Typography for complete page context.", "Apply Breadcrumbs with schema.org structured data for SEO benefits.", "Use Breadcrumbs items with conditional rendering based on user permissions.", "Set Breadcrumbs with max-width and overflow for very long paths.", "Apply Breadcrumbs consistently below header and above main content.", "Use Breadcrumbs with tooltip on truncated items to show full path.", "Combine Breadcrumbs with router hooks to automatically generate items.", "Apply Breadcrumbs with keyboard navigation support for accessibility.", "Use Breadcrumbs items with icons for visual category identification.", "Set Breadcrumbs with appropriate font size using Typography for readability.", "Apply Breadcrumbs with home link as first item for consistent navigation.", "Use Breadcrumbs separator with custom spacing for better visual rhythm.", "Combine Breadcrumbs with loading state while fetching dynamic path data.", "Apply Breadcrumbs with proper contrast ratios for accessibility compliance.", "Use Breadcrumbs items array built from URL path segments for automation.", "Set Breadcrumbs with sticky positioning for long scrolling pages.", "Apply Breadcrumbs with breadcrumb microdata for search engine rich snippets.", "Use Breadcrumbs with last item as plain text (no href) to indicate current page.", "Combine Breadcrumbs with animation for smooth transitions between pages.", "Apply Breadcrumbs with consistent separator style throughout the application.", "Use Breadcrumbs with collapsible middle items for mobile-friendly navigation.", "Set Breadcrumbs items with proper capitalization for professional appearance.", "Apply Breadcrumbs with hover states on clickable items for better UX."], r = {
46
+ component: e,
47
+ compositionTips: t
48
+ };
49
+ export {
50
+ r as default
51
+ };
@@ -0,0 +1,60 @@
1
+ declare const _default: {
2
+ component: {
3
+ name: string;
4
+ import: string;
5
+ description: string;
6
+ props: ({
7
+ name: string;
8
+ type: string;
9
+ description: string;
10
+ default: string;
11
+ enum: string[];
12
+ required?: undefined;
13
+ } | {
14
+ name: string;
15
+ type: string;
16
+ description: string;
17
+ default: string;
18
+ enum?: undefined;
19
+ required?: undefined;
20
+ } | {
21
+ name: string;
22
+ type: string;
23
+ description: string;
24
+ default?: undefined;
25
+ enum?: undefined;
26
+ required?: undefined;
27
+ } | {
28
+ name: string;
29
+ type: string;
30
+ description: string;
31
+ default: boolean;
32
+ enum?: undefined;
33
+ required?: undefined;
34
+ } | {
35
+ name: string;
36
+ type: string;
37
+ description: string;
38
+ required: boolean;
39
+ default?: undefined;
40
+ enum?: undefined;
41
+ } | {
42
+ name: string;
43
+ type: string;
44
+ description: string;
45
+ default: {};
46
+ enum?: undefined;
47
+ required?: undefined;
48
+ } | {
49
+ name: string;
50
+ type: string;
51
+ description: string;
52
+ default: number;
53
+ enum?: undefined;
54
+ required?: undefined;
55
+ })[];
56
+ examples: string[];
57
+ };
58
+ compositionTips: string[];
59
+ };
60
+ export default _default;
@@ -0,0 +1,92 @@
1
+ const t = {
2
+ name: "Button",
3
+ import: "import { Button } from 'gd-design-library'",
4
+ description: "Interactive button component with multiple style variants, colors, and icon support for triggering actions.",
5
+ props: [{
6
+ name: "type",
7
+ type: "ButtonTypes",
8
+ description: "HTML button type attribute (submit, button, reset)",
9
+ default: "ButtonTypes.Button",
10
+ enum: ["submit", "button", "reset"]
11
+ }, {
12
+ name: "color",
13
+ type: "ButtonColorVariant",
14
+ description: "Color variant of the button",
15
+ default: "ButtonColorVariant.Primary",
16
+ enum: ["primary", "secondary", "success", "warning", "error", "info"]
17
+ }, {
18
+ name: "variant",
19
+ type: "ButtonVariant",
20
+ description: "Visual style variant of the button",
21
+ default: "ButtonVariant.Contained",
22
+ enum: ["contained", "outlined", "text"]
23
+ }, {
24
+ name: "role",
25
+ type: "ButtonRole",
26
+ description: "ARIA role for the button element",
27
+ default: "ButtonRole.Button",
28
+ enum: ["button", "link", "menuitem", "tab"]
29
+ }, {
30
+ name: "ariaLabel",
31
+ type: "ButtonAriaLabel",
32
+ description: "Accessibility label for screen readers",
33
+ default: "ButtonAriaLabel.Button"
34
+ }, {
35
+ name: "onClick",
36
+ type: "(event: MouseEvent<HTMLButtonElement>) => void",
37
+ description: "Click event handler triggered when button is clicked"
38
+ }, {
39
+ name: "disabled",
40
+ type: "boolean",
41
+ description: "Disables the button preventing interaction",
42
+ default: !1
43
+ }, {
44
+ name: "isIcon",
45
+ type: "boolean",
46
+ description: "Renders button in icon-only mode with equal width and height",
47
+ default: !1
48
+ }, {
49
+ name: "iconStart",
50
+ type: "ReactNode",
51
+ description: "Icon element to display at the start of the button content"
52
+ }, {
53
+ name: "iconEnd",
54
+ type: "ReactNode",
55
+ description: "Icon element to display at the end of the button content"
56
+ }, {
57
+ name: "children",
58
+ type: "ReactNode",
59
+ description: "Button content, typically text or elements",
60
+ required: !0
61
+ }, {
62
+ name: "styles",
63
+ type: "BoxCssComponentProps<HTMLButtonElement>",
64
+ description: "Custom styles object for the button",
65
+ default: {}
66
+ }, {
67
+ name: "className",
68
+ type: "string | string[]",
69
+ description: "Custom CSS class names to apply to the button"
70
+ }, {
71
+ name: "fullWidth",
72
+ type: "boolean",
73
+ description: "Makes button take full width of its container",
74
+ default: !1
75
+ }, {
76
+ name: "tabIndex",
77
+ type: "number",
78
+ description: "Tab index for keyboard navigation order",
79
+ default: 0
80
+ }, {
81
+ name: "ariaPressed",
82
+ type: "boolean",
83
+ description: "Indicates the pressed state for toggle buttons"
84
+ }],
85
+ examples: ['<Button variant="contained" color="primary" onClick={handleSubmit}>Submit</Button>', '<Button variant="outlined" iconStart={<Icon name="add" />}>Add Item</Button>', '<Button variant="text" color="error" onClick={handleCancel}>Cancel</Button>', '<Button isIcon aria-label="Settings"><Icon name="settings" /></Button>', '<Button type="submit" fullWidth disabled={isSubmitting}>Save Changes</Button>']
86
+ }, n = ['Use Button variant="contained" for primary actions and variant="outlined" for secondary actions.', "Apply Button fullWidth in forms on mobile views for better touch targets.", "Set Button disabled={true} during Input validation or async form submission.", "Use Button iconStart with Input adornmentEnd for inline actions like password visibility toggle.", 'Apply Button color="error" for destructive actions paired with confirmation Input fields.', 'Use Button variant="text" for tertiary actions like "Cancel" or "Skip" in forms.', "Group Input fields with Button using FlexContainer for inline form layouts.", 'Set Button type="submit" for forms and type="button" for non-submitting actions.', "Use Button isIcon for compact icon-only actions within Input adornmentEnd.", "Apply consistent Button color variants matching Input validation states (error, success).", "Use Button with loading state indicator when processing Input form data.", "Pair Input required fields with Button disabled until all validations pass.", "Apply Button ariaPressed for toggle buttons controlling Input field visibility or state.", "Use Button iconEnd for dropdown indicators in custom Input select implementations.", "Set Button tabIndex to control focus flow from Input fields to action buttons.", 'Apply Button variant="outlined" for reset actions clearing Input field values.', "Use multiple Button components with different variants for primary/secondary form actions.", "Combine Input onChange validation with Button disabled state for real-time form validation.", "Apply Button fullWidth={false} with specific width for consistent form button sizing.", 'Use Button role="link" styled as button for navigation after Input form completion.', "Set Button ariaLabel for icon-only buttons used with Input fields for accessibility.", "Apply Button styles prop to match custom Input field styling in themed forms.", "Use Button with preventDefault in onClick when handling Input form submission manually."], e = {
87
+ component: t,
88
+ compositionTips: n
89
+ };
90
+ export {
91
+ e as default
92
+ };
@@ -0,0 +1,46 @@
1
+ declare const _default: {
2
+ component: {
3
+ name: string;
4
+ import: string;
5
+ description: string;
6
+ props: ({
7
+ name: string;
8
+ type: string;
9
+ description: string;
10
+ default: string;
11
+ enum: string[];
12
+ required?: undefined;
13
+ } | {
14
+ name: string;
15
+ type: string;
16
+ description: string;
17
+ default: boolean;
18
+ enum?: undefined;
19
+ required?: undefined;
20
+ } | {
21
+ name: string;
22
+ type: string;
23
+ description: string;
24
+ default: string;
25
+ enum?: undefined;
26
+ required?: undefined;
27
+ } | {
28
+ name: string;
29
+ type: string;
30
+ description: string;
31
+ default?: undefined;
32
+ enum?: undefined;
33
+ required?: undefined;
34
+ } | {
35
+ name: string;
36
+ type: string;
37
+ description: string;
38
+ required: boolean;
39
+ default?: undefined;
40
+ enum?: undefined;
41
+ })[];
42
+ examples: string[];
43
+ };
44
+ compositionTips: string[];
45
+ };
46
+ export default _default;