@landtrustinc/design-system 1.2.2 → 1.2.4
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 +36 -1
- package/dist/index.d.ts +141 -3
- package/dist/index.js +1212 -576
- package/dist/index.js.map +1 -1
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -4,6 +4,41 @@ Design system components for LandTrust applications.
|
|
|
4
4
|
|
|
5
5
|
[Storybook](https://662e7f123091ccbb08e021fe-lpduyfvtud.chromatic.com)
|
|
6
6
|
|
|
7
|
+
## 📦 Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @landtrustinc/design-system react-loading-skeleton
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## 🚀 Setup
|
|
14
|
+
|
|
15
|
+
### Required CSS Imports
|
|
16
|
+
|
|
17
|
+
⚠️ **Important:** You must import the following CSS files in your app's entry point (e.g., `_app.js` or `_app.tsx` for Next.js):
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
// pages/_app.tsx (Next.js) or main entry file
|
|
21
|
+
import '@landtrustinc/design-system/dist/variables.css';
|
|
22
|
+
import 'react-loading-skeleton/dist/skeleton.css';
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**Why?**
|
|
26
|
+
|
|
27
|
+
- The design system uses `react-loading-skeleton` for loading states in some components
|
|
28
|
+
- Next.js and other frameworks require global CSS to be imported in the app entry point, not from npm packages
|
|
29
|
+
- This prevents build errors and ensures proper styling
|
|
30
|
+
|
|
31
|
+
### Next.js Configuration
|
|
32
|
+
|
|
33
|
+
If you're using Next.js, make sure these imports are at the top of your `pages/_app.tsx` or `pages/_app.js`:
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
import 'react-loading-skeleton/dist/skeleton.css';
|
|
37
|
+
import '@landtrustinc/design-system/dist/variables.css';
|
|
38
|
+
|
|
39
|
+
// ... rest of your imports
|
|
40
|
+
```
|
|
41
|
+
|
|
7
42
|
## 📖 Usage
|
|
8
43
|
|
|
9
44
|
```tsx
|
|
@@ -19,7 +54,7 @@ function App() {
|
|
|
19
54
|
}
|
|
20
55
|
```
|
|
21
56
|
|
|
22
|
-
## Styling
|
|
57
|
+
## 🎨 Styling
|
|
23
58
|
|
|
24
59
|
Following Figma styles try to use tokens from variables.css. Avoid using colors from the theme (these are legacy).
|
|
25
60
|
|
package/dist/index.d.ts
CHANGED
|
@@ -524,6 +524,64 @@ declare namespace styles {
|
|
|
524
524
|
export { styles_ThemeTokens as ThemeTokens, styles_borderRadius as borderRadius, styles_boxShadow as boxShadow, styles_colors as colors, styles_fontSizes as fontSizes, styles_fontWeights as fontWeights, styles_fonts as fonts, styles_headingSizes as headingSizes, styles_lineHeights as lineHeights, styles_media as media, styles_opacity as opacity, styles_screens as screens, styles_sizes as sizes, styles_space as space, styles_textShadow as textShadow, styles_transition as transition, styles_zIndex as zIndex };
|
|
525
525
|
}
|
|
526
526
|
|
|
527
|
+
type TopMatchingFieldNoteProps = {
|
|
528
|
+
/**
|
|
529
|
+
* Name of the field note author(s)
|
|
530
|
+
*/
|
|
531
|
+
author: string;
|
|
532
|
+
/**
|
|
533
|
+
* Date the field note was posted (e.g., "1d ago")
|
|
534
|
+
*/
|
|
535
|
+
datePosted: string;
|
|
536
|
+
/**
|
|
537
|
+
* Field note content text
|
|
538
|
+
*/
|
|
539
|
+
content: string;
|
|
540
|
+
/**
|
|
541
|
+
* Array of image URLs to display
|
|
542
|
+
*/
|
|
543
|
+
images: string[];
|
|
544
|
+
/**
|
|
545
|
+
* Title for the top matching field note section
|
|
546
|
+
* @default "Top matching field note"
|
|
547
|
+
*/
|
|
548
|
+
title?: string;
|
|
549
|
+
/**
|
|
550
|
+
* Additional CSS class names
|
|
551
|
+
*/
|
|
552
|
+
className?: string;
|
|
553
|
+
};
|
|
554
|
+
|
|
555
|
+
type TopMatchingReviewProps = {
|
|
556
|
+
/**
|
|
557
|
+
* Name of the review author
|
|
558
|
+
*/
|
|
559
|
+
author: string;
|
|
560
|
+
/**
|
|
561
|
+
* Date the review was posted (e.g., "Aug 25, 2025")
|
|
562
|
+
*/
|
|
563
|
+
datePosted: string;
|
|
564
|
+
/**
|
|
565
|
+
* Rating from 1-5
|
|
566
|
+
*/
|
|
567
|
+
rating: number;
|
|
568
|
+
/**
|
|
569
|
+
* Review content text
|
|
570
|
+
*/
|
|
571
|
+
content: string;
|
|
572
|
+
/**
|
|
573
|
+
* Title for the top matching review section
|
|
574
|
+
* @default "Top matching review"
|
|
575
|
+
*/
|
|
576
|
+
title?: string;
|
|
577
|
+
/**
|
|
578
|
+
* Additional CSS class names
|
|
579
|
+
*/
|
|
580
|
+
className?: string;
|
|
581
|
+
};
|
|
582
|
+
|
|
583
|
+
type TopMatchingReview = Omit<TopMatchingReviewProps, 'title'>;
|
|
584
|
+
type TopMatchingFieldNote = Omit<TopMatchingFieldNoteProps, 'title'>;
|
|
527
585
|
type AIResponseProps = {
|
|
528
586
|
/**
|
|
529
587
|
* Optional title for the AI response
|
|
@@ -565,8 +623,47 @@ type AIResponseProps = {
|
|
|
565
623
|
* Debounce time for helpful feedback in milliseconds
|
|
566
624
|
*/
|
|
567
625
|
helpfulDebounceMs?: number;
|
|
626
|
+
/**
|
|
627
|
+
* Enable markdown rendering for children content.
|
|
628
|
+
* When true, children should be a string containing markdown.
|
|
629
|
+
* @default false
|
|
630
|
+
*/
|
|
631
|
+
markdown?: boolean;
|
|
632
|
+
/**
|
|
633
|
+
* Whether to enable code copy functionality in markdown code blocks
|
|
634
|
+
* @default true
|
|
635
|
+
*/
|
|
636
|
+
enableCodeCopy?: boolean;
|
|
637
|
+
/**
|
|
638
|
+
* Optional top matching review to display above the response
|
|
639
|
+
*/
|
|
640
|
+
topMatchingReview?: TopMatchingReview;
|
|
641
|
+
/**
|
|
642
|
+
* Title for the top matching review section
|
|
643
|
+
* @default "Top matching review"
|
|
644
|
+
*/
|
|
645
|
+
topMatchingReviewTitle?: string;
|
|
646
|
+
/**
|
|
647
|
+
* Optional top matching field note to display above the response
|
|
648
|
+
*/
|
|
649
|
+
topMatchingFieldNote?: TopMatchingFieldNote;
|
|
650
|
+
/**
|
|
651
|
+
* Title for the top matching field note section
|
|
652
|
+
* @default "Top matching field note"
|
|
653
|
+
*/
|
|
654
|
+
topMatchingFieldNoteTitle?: string;
|
|
655
|
+
/**
|
|
656
|
+
* URL for the Contact Landowner button link
|
|
657
|
+
* When provided, shows a "Contact Landowner" button inside the response
|
|
658
|
+
*/
|
|
659
|
+
contactLandownerUrl?: string;
|
|
660
|
+
/**
|
|
661
|
+
* Custom text for the Contact Landowner button
|
|
662
|
+
* @default "Contact Landowner"
|
|
663
|
+
*/
|
|
664
|
+
contactLandownerButtonText?: string;
|
|
568
665
|
};
|
|
569
|
-
declare const AIResponse: ({ title, showDisclaimer, showHelpfulQuestion, className, children, onHelpfulYes, onHelpfulNo, variant, onErrorRetry, helpfulDebounceMs, }: AIResponseProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
666
|
+
declare const AIResponse: ({ title, showDisclaimer, showHelpfulQuestion, className, children, onHelpfulYes, onHelpfulNo, variant, onErrorRetry, helpfulDebounceMs, markdown, enableCodeCopy, topMatchingReview, topMatchingReviewTitle, topMatchingFieldNote, topMatchingFieldNoteTitle, contactLandownerUrl, contactLandownerButtonText, }: AIResponseProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
570
667
|
|
|
571
668
|
type AvailabilityBadgeVariant = 'primary' | 'error' | 'action' | 'warning' | 'neutral';
|
|
572
669
|
|
|
@@ -1121,6 +1218,13 @@ type MessageBubbleProps = {
|
|
|
1121
1218
|
declare const MessageBubble: ({ variant, timestamp, className, children, }: MessageBubbleProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1122
1219
|
|
|
1123
1220
|
type ChatWidgetMessage = React__default.ReactElement<React__default.ComponentProps<typeof AIResponse>, typeof AIResponse> | React__default.ReactElement<React__default.ComponentProps<typeof MessageBubble>, typeof MessageBubble>;
|
|
1221
|
+
type SuggestedPrompt = {
|
|
1222
|
+
label: string;
|
|
1223
|
+
/**
|
|
1224
|
+
* Optional value to pass when clicked (defaults to label)
|
|
1225
|
+
*/
|
|
1226
|
+
value?: string;
|
|
1227
|
+
};
|
|
1124
1228
|
type ChatWidgetProps = {
|
|
1125
1229
|
/**
|
|
1126
1230
|
* Title displayed in the chat widget header
|
|
@@ -1178,8 +1282,21 @@ type ChatWidgetProps = {
|
|
|
1178
1282
|
* Additional props for the container
|
|
1179
1283
|
*/
|
|
1180
1284
|
containerProps?: BoxProps;
|
|
1285
|
+
/**
|
|
1286
|
+
* Suggested prompts to show above the input field
|
|
1287
|
+
*/
|
|
1288
|
+
suggestedPrompts?: SuggestedPrompt[];
|
|
1289
|
+
/**
|
|
1290
|
+
* Callback when a suggested prompt is clicked
|
|
1291
|
+
*/
|
|
1292
|
+
onPromptClick?: (prompt: string) => void;
|
|
1293
|
+
/**
|
|
1294
|
+
* Title for the suggested prompts section
|
|
1295
|
+
* @default "Other Helpful Topics"
|
|
1296
|
+
*/
|
|
1297
|
+
suggestedPromptsTitle?: string;
|
|
1181
1298
|
};
|
|
1182
|
-
declare const ChatWidget: ({ title, messages, onSubmit, placeholder, disabled, className, ariaLabel, panelWidth, expanded, defaultExpanded, onExpandedChange, isThinking, emptyState, containerProps, }: ChatWidgetProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1299
|
+
declare const ChatWidget: ({ title, messages, onSubmit, placeholder, disabled, className, ariaLabel, panelWidth, expanded, defaultExpanded, onExpandedChange, isThinking, emptyState, containerProps, suggestedPrompts, onPromptClick, suggestedPromptsTitle, }: ChatWidgetProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1183
1300
|
|
|
1184
1301
|
type DividerProps = React__default.HTMLAttributes<HTMLHRElement> & SpaceProps & {
|
|
1185
1302
|
/**
|
|
@@ -1210,6 +1327,10 @@ type FeatureListItemProps = {
|
|
|
1210
1327
|
* Optional subtitle/description text
|
|
1211
1328
|
*/
|
|
1212
1329
|
subtitle?: React__default.ReactNode;
|
|
1330
|
+
/**
|
|
1331
|
+
* Loading state - shows skeleton when true
|
|
1332
|
+
*/
|
|
1333
|
+
isLoading?: boolean;
|
|
1213
1334
|
/**
|
|
1214
1335
|
* Additional CSS class names
|
|
1215
1336
|
*/
|
|
@@ -1656,6 +1777,23 @@ type LogoProps = {
|
|
|
1656
1777
|
};
|
|
1657
1778
|
declare const Logo: ({ variant, theme, size, className, ...rest }: LogoProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1658
1779
|
|
|
1780
|
+
type MarkdownContentProps = {
|
|
1781
|
+
/**
|
|
1782
|
+
* The markdown content to render
|
|
1783
|
+
*/
|
|
1784
|
+
content: string;
|
|
1785
|
+
/**
|
|
1786
|
+
* Additional CSS class names
|
|
1787
|
+
*/
|
|
1788
|
+
className?: string;
|
|
1789
|
+
/**
|
|
1790
|
+
* Whether to enable code copy functionality
|
|
1791
|
+
* @default true
|
|
1792
|
+
*/
|
|
1793
|
+
enableCodeCopy?: boolean;
|
|
1794
|
+
};
|
|
1795
|
+
declare const MarkdownContent: React__default.FC<MarkdownContentProps>;
|
|
1796
|
+
|
|
1659
1797
|
type NavLink = {
|
|
1660
1798
|
/**
|
|
1661
1799
|
* Text label for the navigation link
|
|
@@ -2041,4 +2179,4 @@ declare const Widget: React__default.FC<WidgetProps> & {
|
|
|
2041
2179
|
}>;
|
|
2042
2180
|
};
|
|
2043
2181
|
|
|
2044
|
-
export { AIResponse, type AIResponseProps, AvailabilityBadge, type AvailabilityBadgeProps, type AvailabilityBadgeVariant, Avatar, type AvatarProps, type AvatarSize, type AvatarType, type BaseInputProps, Box, type BoxProps, Button, type ButtonProps, type ButtonVariants, ChatWidget, type ChatWidgetMessage, type ChatWidgetProps, Column, type ColumnProps, Container, Divider, type DividerProps, type FeatureItem, FeatureList, type FeatureListProps, type FeatureListSection, FieldNoteCard, type FieldNoteCardProps, FormField, type FormFieldProps, GlobalStyle, Grid, type GridBreakpoint, GridContainer, type GridContainerProps, type GridProps, Heading, type HeadingProps, HuntCard, type HuntCardProps, Icon, IconLabel, type IconLabelProps, type IconProps, type IconSize, IconSizeMap, type IconVariantTypes$1 as IconVariantTypes, InfoBox, type InfoBoxProps, Input, type InputProps, type InputSize, type InputVariant, LayoutTokens, ListingChat, type ListingChatProps, Logo, type LogoProps, type LogoTheme, type LogoVariant, MessageBubble, type MessageBubbleProps, type NavLink, Navigation, type NavigationProps, PackageCard, type PackageCardProps, PackageHeader, type PackageHeaderProps, type ResponsiveValue, ReviewCard, type ReviewCardProps, Reviews, type ReviewsProps, ReviewsShowcase, Select, type SelectOption, type SelectProps, Spinner, type SpinnerProps, StarRating, type StarRatingProps, type TFontWeight, type THeadingSize, type TTextAlign, type TTextSize, type TTextWrap, TagChip, type TagChipProps, type TagChipVariant, Text, TextArea, type TextProps, type TextareaProps, ThemeTokens, UserCard, type UserCardProps, Widget, WidgetPanel, type WidgetPanelProps, type WidgetProps, WidgetTrigger, type WidgetTriggerProps, globalStyles, styles };
|
|
2182
|
+
export { AIResponse, type AIResponseProps, AvailabilityBadge, type AvailabilityBadgeProps, type AvailabilityBadgeVariant, Avatar, type AvatarProps, type AvatarSize, type AvatarType, type BaseInputProps, Box, type BoxProps, Button, type ButtonProps, type ButtonVariants, ChatWidget, type ChatWidgetMessage, type ChatWidgetProps, Column, type ColumnProps, Container, Divider, type DividerProps, type FeatureItem, FeatureList, type FeatureListProps, type FeatureListSection, FieldNoteCard, type FieldNoteCardProps, FormField, type FormFieldProps, GlobalStyle, Grid, type GridBreakpoint, GridContainer, type GridContainerProps, type GridProps, Heading, type HeadingProps, HuntCard, type HuntCardProps, Icon, IconLabel, type IconLabelProps, type IconProps, type IconSize, IconSizeMap, type IconVariantTypes$1 as IconVariantTypes, InfoBox, type InfoBoxProps, Input, type InputProps, type InputSize, type InputVariant, LayoutTokens, ListingChat, type ListingChatProps, Logo, type LogoProps, type LogoTheme, type LogoVariant, MarkdownContent, type MarkdownContentProps, MessageBubble, type MessageBubbleProps, type NavLink, Navigation, type NavigationProps, PackageCard, type PackageCardProps, PackageHeader, type PackageHeaderProps, type ResponsiveValue, ReviewCard, type ReviewCardProps, Reviews, type ReviewsProps, ReviewsShowcase, Select, type SelectOption, type SelectProps, Spinner, type SpinnerProps, StarRating, type StarRatingProps, type SuggestedPrompt, type TFontWeight, type THeadingSize, type TTextAlign, type TTextSize, type TTextWrap, TagChip, type TagChipProps, type TagChipVariant, Text, TextArea, type TextProps, type TextareaProps, ThemeTokens, type TopMatchingFieldNote, type TopMatchingReview, UserCard, type UserCardProps, Widget, WidgetPanel, type WidgetPanelProps, type WidgetProps, WidgetTrigger, type WidgetTriggerProps, globalStyles, styles };
|