@landtrustinc/design-system 1.2.21 → 1.2.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/helpers.ts +34 -0
- package/dist/index.d.ts +148 -20
- package/dist/index.js +858 -146
- package/dist/index.js.map +1 -1
- package/dist/index.ts +1 -0
- package/package.json +4 -2
package/dist/helpers.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { elementScrollIntoView } from 'seamless-scroll-polyfill';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Detect if the browser is Safari
|
|
5
|
+
*/
|
|
6
|
+
export const isSafari = (): boolean => {
|
|
7
|
+
if (typeof window === 'undefined') return false;
|
|
8
|
+
return /^((?!chrome|android).)*safari/i.test(window.navigator.userAgent);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Scroll an element into view with smooth behavior
|
|
13
|
+
* Chrome seems to only work sporadically if not in a timeout
|
|
14
|
+
* Safari's built-in el.scrollIntoView doesn't support the options so use the polyfill directly
|
|
15
|
+
*/
|
|
16
|
+
export const scrollTo = (
|
|
17
|
+
el: HTMLElement,
|
|
18
|
+
config: ScrollIntoViewOptions,
|
|
19
|
+
parent?: HTMLElement | null
|
|
20
|
+
): void => {
|
|
21
|
+
setTimeout(() => {
|
|
22
|
+
if (isSafari()) {
|
|
23
|
+
elementScrollIntoView(el, config);
|
|
24
|
+
} else {
|
|
25
|
+
// In certain scenarios there can be many carousels embedded in each other, so we need to
|
|
26
|
+
// have the parent explicitly scroll to the given element's position
|
|
27
|
+
if (parent) {
|
|
28
|
+
parent.scroll({ left: el.offsetLeft, behavior: 'smooth' });
|
|
29
|
+
} else {
|
|
30
|
+
el.scrollIntoView(config);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1818,9 +1818,9 @@ type IconLabelProps = {
|
|
|
1818
1818
|
*/
|
|
1819
1819
|
variant: IconVariantTypes$1;
|
|
1820
1820
|
/**
|
|
1821
|
-
* Text label to display next to the icon
|
|
1821
|
+
* Text label or React node to display next to the icon
|
|
1822
1822
|
*/
|
|
1823
|
-
label:
|
|
1823
|
+
label: React__default.ReactNode;
|
|
1824
1824
|
/**
|
|
1825
1825
|
* Size of the label text
|
|
1826
1826
|
*/
|
|
@@ -2022,6 +2022,20 @@ type NavigationProps = {
|
|
|
2022
2022
|
};
|
|
2023
2023
|
declare const Navigation: ({ onMenuToggle, className, logoVariant, logoTheme, navLinks, onAvatarClick, ...rest }: NavigationProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
2024
2024
|
|
|
2025
|
+
type PackageCardBadge = {
|
|
2026
|
+
/**
|
|
2027
|
+
* Icon variant for the badge
|
|
2028
|
+
*/
|
|
2029
|
+
variant: IconVariantTypes$1;
|
|
2030
|
+
/**
|
|
2031
|
+
* Label text or React node for the badge
|
|
2032
|
+
*/
|
|
2033
|
+
label: React__default.ReactNode;
|
|
2034
|
+
/**
|
|
2035
|
+
* Icon size for the badge
|
|
2036
|
+
*/
|
|
2037
|
+
iconSize?: IconLabelProps['iconSize'];
|
|
2038
|
+
};
|
|
2025
2039
|
type PackageCardProps = {
|
|
2026
2040
|
/**
|
|
2027
2041
|
* Array of image URLs to display
|
|
@@ -2034,15 +2048,11 @@ type PackageCardProps = {
|
|
|
2034
2048
|
/**
|
|
2035
2049
|
* Subtitle or description
|
|
2036
2050
|
*/
|
|
2037
|
-
subtitle:
|
|
2051
|
+
subtitle: React__default.ReactNode;
|
|
2038
2052
|
/**
|
|
2039
2053
|
* Starting price text
|
|
2040
2054
|
*/
|
|
2041
2055
|
startingPrice: string;
|
|
2042
|
-
/**
|
|
2043
|
-
* Number of trips remaining
|
|
2044
|
-
*/
|
|
2045
|
-
tripsLeft?: number;
|
|
2046
2056
|
/**
|
|
2047
2057
|
* Whether the package is favorited
|
|
2048
2058
|
*/
|
|
@@ -2060,27 +2070,45 @@ type PackageCardProps = {
|
|
|
2060
2070
|
*/
|
|
2061
2071
|
className?: string;
|
|
2062
2072
|
/**
|
|
2063
|
-
*
|
|
2073
|
+
* Array of badges to display (features/amenities)
|
|
2064
2074
|
*/
|
|
2065
|
-
|
|
2075
|
+
badges?: PackageCardBadge[];
|
|
2066
2076
|
/**
|
|
2067
|
-
*
|
|
2077
|
+
* Optional badge element to display
|
|
2068
2078
|
*/
|
|
2069
|
-
|
|
2079
|
+
badge?: React__default.ReactNode;
|
|
2070
2080
|
/**
|
|
2071
|
-
*
|
|
2072
|
-
*/
|
|
2073
|
-
|
|
2081
|
+
* Array of availability badges to display (can include both top-left and bottom-right badges)
|
|
2082
|
+
*/
|
|
2083
|
+
availabilityBadges?: Array<{
|
|
2084
|
+
/**
|
|
2085
|
+
* Variant of the availability badge
|
|
2086
|
+
*/
|
|
2087
|
+
variant: AvailabilityBadgeVariant;
|
|
2088
|
+
/**
|
|
2089
|
+
* Text to display in the badge
|
|
2090
|
+
*/
|
|
2091
|
+
text: React__default.ReactNode;
|
|
2092
|
+
/**
|
|
2093
|
+
* Position of the badge
|
|
2094
|
+
*/
|
|
2095
|
+
position: 'top-left' | 'bottom-right';
|
|
2096
|
+
/**
|
|
2097
|
+
* Whether this badge should trigger the overlay (for sold out or unavailable states)
|
|
2098
|
+
*/
|
|
2099
|
+
showOverlay?: boolean;
|
|
2100
|
+
}>;
|
|
2074
2101
|
/**
|
|
2075
|
-
* Optional
|
|
2102
|
+
* Optional ID for the carousel (for accessibility and tracking)
|
|
2076
2103
|
*/
|
|
2077
|
-
|
|
2104
|
+
id?: string;
|
|
2078
2105
|
/**
|
|
2079
|
-
*
|
|
2106
|
+
* Whether to show white background and full padding on content area (default: true)
|
|
2107
|
+
* When false, only shows top padding without background
|
|
2080
2108
|
*/
|
|
2081
|
-
|
|
2109
|
+
hasContentBackground?: boolean;
|
|
2082
2110
|
};
|
|
2083
|
-
declare const PackageCard: ({ images, title, subtitle, startingPrice,
|
|
2111
|
+
declare const PackageCard: ({ images, title, subtitle, startingPrice, isFavorited, onFavoriteClick, onClick, className, badges, availabilityBadges, id, hasContentBackground, ...rest }: PackageCardProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
2084
2112
|
|
|
2085
2113
|
type PackageHeaderProps = {
|
|
2086
2114
|
/**
|
|
@@ -2160,6 +2188,106 @@ declare const Reviews: FC<ReviewsProps>;
|
|
|
2160
2188
|
|
|
2161
2189
|
declare const ReviewsShowcase: FC;
|
|
2162
2190
|
|
|
2191
|
+
type CarouselPositions = 'bottom' | 'left-right' | 'top-right' | 'inner-bottom';
|
|
2192
|
+
type DotsColors = 'light' | 'dark' | 'neutral';
|
|
2193
|
+
type ScrollingCarouselStepProps = {
|
|
2194
|
+
/**
|
|
2195
|
+
* Child elements to display in the carousel step
|
|
2196
|
+
*/
|
|
2197
|
+
children: ReactNode;
|
|
2198
|
+
/**
|
|
2199
|
+
* Additional CSS class name
|
|
2200
|
+
*/
|
|
2201
|
+
className?: string;
|
|
2202
|
+
/**
|
|
2203
|
+
* Index of the step (automatically provided by parent)
|
|
2204
|
+
*/
|
|
2205
|
+
index?: number;
|
|
2206
|
+
/**
|
|
2207
|
+
* ID of the parent carousel (must match the id of the ScrollingCarousel)
|
|
2208
|
+
*/
|
|
2209
|
+
parentId: string;
|
|
2210
|
+
/**
|
|
2211
|
+
* Click handler for the step
|
|
2212
|
+
*/
|
|
2213
|
+
onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
2214
|
+
};
|
|
2215
|
+
type ScrollingCarouselProps = {
|
|
2216
|
+
/**
|
|
2217
|
+
* Additional CSS class name
|
|
2218
|
+
*/
|
|
2219
|
+
className?: string;
|
|
2220
|
+
/**
|
|
2221
|
+
* Child carousel steps
|
|
2222
|
+
*/
|
|
2223
|
+
children: ReactNode;
|
|
2224
|
+
/**
|
|
2225
|
+
* Use custom left button styling
|
|
2226
|
+
*/
|
|
2227
|
+
customLeftButton?: boolean;
|
|
2228
|
+
/**
|
|
2229
|
+
* Show navigation buttons
|
|
2230
|
+
* @default true
|
|
2231
|
+
*/
|
|
2232
|
+
showButtons?: boolean;
|
|
2233
|
+
/**
|
|
2234
|
+
* Show navigation dots
|
|
2235
|
+
* @default false
|
|
2236
|
+
*/
|
|
2237
|
+
showDots?: boolean;
|
|
2238
|
+
/**
|
|
2239
|
+
* Color scheme for dots
|
|
2240
|
+
* @default 'light'
|
|
2241
|
+
*/
|
|
2242
|
+
dotsColor?: DotsColors;
|
|
2243
|
+
/**
|
|
2244
|
+
* Number of dots to display at once
|
|
2245
|
+
* @default 5
|
|
2246
|
+
*/
|
|
2247
|
+
numberOfDots?: number;
|
|
2248
|
+
/**
|
|
2249
|
+
* Enable infinite scrolling
|
|
2250
|
+
* @default false
|
|
2251
|
+
*/
|
|
2252
|
+
infiniteScroll?: boolean;
|
|
2253
|
+
/**
|
|
2254
|
+
* Position of navigation buttons
|
|
2255
|
+
* @default 'left-right'
|
|
2256
|
+
*/
|
|
2257
|
+
buttonsPosition?: CarouselPositions;
|
|
2258
|
+
/**
|
|
2259
|
+
* Custom back button icon
|
|
2260
|
+
*/
|
|
2261
|
+
customBackIcon?: ReactNode;
|
|
2262
|
+
/**
|
|
2263
|
+
* Custom next button icon
|
|
2264
|
+
*/
|
|
2265
|
+
customNextIcon?: ReactNode;
|
|
2266
|
+
/**
|
|
2267
|
+
* Only show navigation on hover
|
|
2268
|
+
* @default false
|
|
2269
|
+
*/
|
|
2270
|
+
showNavigationOnHover?: boolean;
|
|
2271
|
+
/**
|
|
2272
|
+
* Current active slide index (for controlled mode)
|
|
2273
|
+
*/
|
|
2274
|
+
current?: number;
|
|
2275
|
+
/**
|
|
2276
|
+
* Unique identifier for the carousel (required for DOM queries)
|
|
2277
|
+
*/
|
|
2278
|
+
id: string;
|
|
2279
|
+
};
|
|
2280
|
+
|
|
2281
|
+
declare const ScrollingCarouselStep: {
|
|
2282
|
+
({ children, index, className, parentId, onClick, }: ScrollingCarouselStepProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
2283
|
+
displayName: string;
|
|
2284
|
+
};
|
|
2285
|
+
|
|
2286
|
+
declare const ScrollingCarousel: {
|
|
2287
|
+
({ className, children, showButtons, showDots, dotsColor, numberOfDots, buttonsPosition, customLeftButton, infiniteScroll, customBackIcon, customNextIcon, showNavigationOnHover, id, current, }: ScrollingCarouselProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
2288
|
+
displayName: string;
|
|
2289
|
+
};
|
|
2290
|
+
|
|
2163
2291
|
type SpinnerProps = {
|
|
2164
2292
|
/**
|
|
2165
2293
|
* Size of the spinner using IconSize tokens
|
|
@@ -2293,4 +2421,4 @@ declare const Widget: React__default.FC<WidgetProps> & {
|
|
|
2293
2421
|
}>;
|
|
2294
2422
|
};
|
|
2295
2423
|
|
|
2296
|
-
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, FeatureListItem, type FeatureListItemProps, 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, LandownerProfile, type LandownerProfileProps, 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 };
|
|
2424
|
+
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, type CarouselPositions, ChatWidget, type ChatWidgetMessage, type ChatWidgetProps, Column, type ColumnProps, Container, Divider, type DividerProps, type DotsColors, type FeatureItem, FeatureList, FeatureListItem, type FeatureListItemProps, 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, LandownerProfile, type LandownerProfileProps, LayoutTokens, ListingChat, type ListingChatProps, Logo, type LogoProps, type LogoTheme, type LogoVariant, MarkdownContent, type MarkdownContentProps, MessageBubble, type MessageBubbleProps, type NavLink, Navigation, type NavigationProps, PackageCard, type PackageCardBadge, type PackageCardProps, PackageHeader, type PackageHeaderProps, type ResponsiveValue, ReviewCard, type ReviewCardProps, Reviews, type ReviewsProps, ReviewsShowcase, ScrollingCarousel, type ScrollingCarouselProps, ScrollingCarouselStep, type ScrollingCarouselStepProps, 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 };
|