keystone-design-bootstrap 1.0.103 → 1.0.105-dev.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 +4 -4
- package/dist/blog-post-vWzW8yFb.d.ts +50 -0
- package/dist/contexts/index.d.ts +13 -0
- package/dist/contexts/index.js +173 -0
- package/dist/contexts/index.js.map +1 -0
- package/dist/design_system/components/DynamicFormFields.d.ts +15 -0
- package/dist/design_system/components/DynamicFormFields.js +5176 -0
- package/dist/design_system/components/DynamicFormFields.js.map +1 -0
- package/dist/design_system/elements/index.d.ts +383 -0
- package/dist/design_system/elements/index.js +4007 -0
- package/dist/design_system/elements/index.js.map +1 -0
- package/dist/design_system/logo/keystone-logo.d.ts +6 -0
- package/dist/design_system/logo/keystone-logo.js +145 -0
- package/dist/design_system/logo/keystone-logo.js.map +1 -0
- package/dist/design_system/sections/index.d.ts +233 -0
- package/dist/design_system/sections/index.js +20048 -0
- package/dist/design_system/sections/index.js.map +1 -0
- package/dist/form-C94A_PX_.d.ts +36 -0
- package/dist/index.d.ts +86 -0
- package/dist/index.js +20646 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/component-registry.d.ts +13 -0
- package/dist/lib/component-registry.js +36 -0
- package/dist/lib/component-registry.js.map +1 -0
- package/dist/lib/hooks/index.d.ts +83 -0
- package/dist/lib/hooks/index.js +182 -0
- package/dist/lib/hooks/index.js.map +1 -0
- package/dist/lib/server-api.d.ts +67 -0
- package/dist/lib/server-api.js +195 -0
- package/dist/lib/server-api.js.map +1 -0
- package/dist/package-DeHKpQp7.d.ts +121 -0
- package/dist/photos-CmBdWiuZ.d.ts +27 -0
- package/dist/themes/index.d.ts +17 -0
- package/dist/themes/index.js +29 -0
- package/dist/themes/index.js.map +1 -0
- package/dist/tracking/index.d.ts +254 -0
- package/dist/tracking/index.js +587 -0
- package/dist/tracking/index.js.map +1 -0
- package/dist/types/index.d.ts +313 -0
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/cx.d.ts +15 -0
- package/dist/utils/cx.js +18 -0
- package/dist/utils/cx.js.map +1 -0
- package/dist/utils/gradient-placeholder.d.ts +7 -0
- package/dist/utils/gradient-placeholder.js +59 -0
- package/dist/utils/gradient-placeholder.js.map +1 -0
- package/dist/utils/is-react-component.d.ts +21 -0
- package/dist/utils/is-react-component.js +20 -0
- package/dist/utils/is-react-component.js.map +1 -0
- package/dist/utils/markdown-toc.d.ts +14 -0
- package/dist/utils/markdown-toc.js +29 -0
- package/dist/utils/markdown-toc.js.map +1 -0
- package/dist/utils/phone-helpers.d.ts +24 -0
- package/dist/utils/phone-helpers.js +26 -0
- package/dist/utils/phone-helpers.js.map +1 -0
- package/dist/utils/photo-helpers.d.ts +38 -0
- package/dist/utils/photo-helpers.js +41 -0
- package/dist/utils/photo-helpers.js.map +1 -0
- package/dist/website-photos-Cl1YqAno.d.ts +21 -0
- package/package.json +1 -1
- package/src/design_system/components/ChatWidget.tsx +66 -10
- package/src/design_system/portal/LoginForm.tsx +1 -24
- package/src/lib/chat-backend.ts +36 -0
- package/src/lib/consumer-session.ts +3 -1
- package/src/next/layouts/root-layout.tsx +5 -0
- package/src/next/routes/chat.ts +215 -18
- package/src/next/routes/consumer-auth.ts +49 -124
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Form definition from API (GET /public/forms/:form_type).
|
|
3
|
+
* fields is an ordered array; each item is a single field or an array of fields (inline row). Max depth 2.
|
|
4
|
+
*/
|
|
5
|
+
interface FormFieldOption {
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}
|
|
9
|
+
interface FormFieldDefinition {
|
|
10
|
+
name: string;
|
|
11
|
+
type: string;
|
|
12
|
+
label: string;
|
|
13
|
+
required?: boolean;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
/** For hidden fields, optional value to submit. */
|
|
16
|
+
value?: string;
|
|
17
|
+
/** For checkbox_group fields: the selectable options. */
|
|
18
|
+
options?: FormFieldOption[];
|
|
19
|
+
}
|
|
20
|
+
/** One item in the fields array: either a single field or a row of fields (inline). */
|
|
21
|
+
type FormFieldItem = FormFieldDefinition | FormFieldDefinition[];
|
|
22
|
+
interface FormDefinition {
|
|
23
|
+
id: number;
|
|
24
|
+
name: string;
|
|
25
|
+
form_type: string;
|
|
26
|
+
/** Ordered array; each element is a field or an array of fields (inline row). */
|
|
27
|
+
fields: FormFieldItem[];
|
|
28
|
+
settings?: Record<string, unknown>;
|
|
29
|
+
/** Business name for consent copy (e.g. "{{company_name}}" in checkbox labels). */
|
|
30
|
+
company_name?: string;
|
|
31
|
+
created_at?: string;
|
|
32
|
+
updated_at?: string;
|
|
33
|
+
}
|
|
34
|
+
type FormType = 'lead' | 'job_application' | 'marketing_list_signup';
|
|
35
|
+
|
|
36
|
+
export type { FormDefinition as F, FormFieldDefinition as a, FormFieldItem as b, FormFieldOption as c, FormType as d };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export { AboutHome, BlogCardFullWidthHorizontal, BlogCardFullWidthHorizontalAlt, BlogCardFullWidthHorizontalCompact, BlogCardFullWidthHorizontalMinimal, BlogCardFullWidthVertical, BlogCardFullWidthVerticalAlt, BlogCardFullWidthVerticalCompact, BlogCardFullWidthVerticalMinimal, BlogCardHorizontal, BlogCardHorizontalBadge, BlogCardHorizontalCompact, BlogCardHorizontalMinimal, BlogCardVertical, BlogCardVerticalBadge, BlogCardVerticalCompact, BlogCardVerticalMinimal, BlogGallery, BlogHome, BlogPostSection, BlogSection, ContactHome, ContactSection, EmailSignupSection, EmailSignupSectionProps, FAQGrid, FAQHero, FAQHome, FeatureTabHorizontal, FeatureTabVertical, FeatureTextCentered, FeatureTextFeaturedIconBox, FeatureTextFeaturedIconCard, FeatureTextFeaturedIconLeft, FeatureTextFeaturedIconTopCentered, FeatureTextFeaturedIconTopCenteredBrand, FeatureTextFeaturedIconTopLeft, FeatureTextFeaturedIconTopLeftBrand, FeatureTextIconCard, FeatureTextIconLeft, FeatureTextIconTopCentered, FeatureTextIconTopLeft, FeatureTextIntegrationIconBox, FeatureTextIntegrationIconLeft, FeatureTextIntegrationIconTopCentered, FeatureTextIntegrationIconTopLeft, FeatureTextLeft, FeatureTextLeftBrand, FooterHome, GenericHeaderComponent, GenericTextHero, HeaderNavigation, HeroHome, HomeHeroComponent, JobApplicationForm, JobDetailHero, JobDetailSection, JobGallery, LocationDetailHero, LocationDetailsSection, LocationGrid, PackageForMenu, PolicyDocumentSection, ServiceDetailContent, ServiceDetailHero, ServiceMenuSection, ServiceMenuSectionProps, ServicesGrid, ServicesHome, SocialMediaGrid, SocialMediaHero, StatisticsSection, TeamGrid, TestimonialsGrid, TestimonialsHero, TestimonialsHome, ValuesSection, getBlogPostData } from './design_system/sections/index.js';
|
|
2
|
+
export { Avatar, AvatarLabelGroup, Badge, BadgeGroup, BadgeWithDot, Breadcrumb, Button, ButtonGroup, Carousel, CarouselContext, CarouselSectionWrapper, ComboBox, FeaturedIcon, Form, FormContainer, GoogleMap, HintText, Input, InputBase, InputGroup, Label, MarkdownRenderer, Modal, ModalProps, NativeSelect, Pagination, PaginationPageDefault, PaginationPageMinimalCenter, PhotoWithFallback, PrivacyCheckbox, RatingBadge, RatingStars, RoundButton, Select, SelectItem, SocialIcon, StarIcon, Textarea, Tooltip, VerifiedTick, VideoModal, VideoPlayButton, Wreath, getSocialIcon, getStarProgress, useCarousel } from './design_system/elements/index.js';
|
|
3
|
+
import { C as CompanyInformation } from './package-DeHKpQp7.js';
|
|
4
|
+
export { ThemeProvider, useTheme } from './contexts/index.js';
|
|
5
|
+
import React__default from 'react';
|
|
6
|
+
export { Theme } from './themes/index.js';
|
|
7
|
+
import './blog-post-vWzW8yFb.js';
|
|
8
|
+
import './photos-CmBdWiuZ.js';
|
|
9
|
+
import './form-C94A_PX_.js';
|
|
10
|
+
import './website-photos-Cl1YqAno.js';
|
|
11
|
+
import 'react-aria-components';
|
|
12
|
+
import 'embla-carousel-react';
|
|
13
|
+
|
|
14
|
+
interface ContactFormResult {
|
|
15
|
+
success: boolean;
|
|
16
|
+
message?: string;
|
|
17
|
+
error?: string;
|
|
18
|
+
/** Present on lead form success; use for Meta Pixel dedup: fbq('track', 'Lead', {}, { eventID: eventId }) */
|
|
19
|
+
eventId?: string;
|
|
20
|
+
}
|
|
21
|
+
declare function submitContactFormAction(formData: FormData): Promise<ContactFormResult>;
|
|
22
|
+
declare function submitLeadFormAction(formData: FormData): Promise<ContactFormResult>;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Resolves the primary and secondary CTA hrefs used across the site.
|
|
26
|
+
*
|
|
27
|
+
* Resolution order for primaryHref:
|
|
28
|
+
* 1. portal_url — set by backend when account has consumer portal enabled
|
|
29
|
+
* 2. external_management_url — booking platform URL from the API
|
|
30
|
+
* 3. /contact — final fallback
|
|
31
|
+
*
|
|
32
|
+
* No per-site configuration needed. Enable the portal in the admin console and
|
|
33
|
+
* every CTA across the site automatically routes to the portal.
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
/** True when the href is absolute (external); use for target="_blank" and rel="noopener noreferrer". */
|
|
37
|
+
declare function isExternalCtaUrl(href: string): boolean;
|
|
38
|
+
interface ResolvedCtaUrls {
|
|
39
|
+
primaryHref: string;
|
|
40
|
+
secondaryHref: string;
|
|
41
|
+
hasSecondary: boolean;
|
|
42
|
+
}
|
|
43
|
+
declare function resolveCtaUrls(companyInformation?: CompanyInformation | null): ResolvedCtaUrls;
|
|
44
|
+
|
|
45
|
+
declare const RAILS_BACKEND: "rails";
|
|
46
|
+
declare const SOR_BACKEND: "sor";
|
|
47
|
+
type ChatBackend = typeof RAILS_BACKEND | typeof SOR_BACKEND;
|
|
48
|
+
|
|
49
|
+
interface TeamMember {
|
|
50
|
+
id: number;
|
|
51
|
+
name: string;
|
|
52
|
+
position?: string;
|
|
53
|
+
photo_url?: string;
|
|
54
|
+
}
|
|
55
|
+
interface ChatWidgetProps {
|
|
56
|
+
position?: 'bottom-right' | 'bottom-left';
|
|
57
|
+
/**
|
|
58
|
+
* Which backend the site's `/api/chat` proxy talks to. The two backends have
|
|
59
|
+
* architecturally different reply delivery: 'rails' (keystone-mono-proto)
|
|
60
|
+
* pushes replies over ActionCable realtime; 'sor' (sor-service) has no
|
|
61
|
+
* realtime channel and the widget polls for the reply instead. The paths are
|
|
62
|
+
* mutually exclusive — a 'sor' widget never probes/subscribes realtime, a
|
|
63
|
+
* 'rails' widget never polls.
|
|
64
|
+
*
|
|
65
|
+
* TODO(webchat): default is 'rails' while keystone-mono-proto is still a live
|
|
66
|
+
* backend; flip the default to 'sor' once the Rails backend is scrapped.
|
|
67
|
+
*/
|
|
68
|
+
chatBackend?: ChatBackend;
|
|
69
|
+
primaryColor?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Anonymous session identifier. Used when the visitor is not authenticated.
|
|
72
|
+
* Mutually exclusive with `contactId` — if both are provided, `contactId` wins.
|
|
73
|
+
*/
|
|
74
|
+
sessionId?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Authenticated contact ID. When provided, messages are loaded and sent using
|
|
77
|
+
* the contact-driven flow instead of the anonymous session flow.
|
|
78
|
+
* The `/api/chat` route must support `contact_id` (see `createChatRouteHandlers`).
|
|
79
|
+
*/
|
|
80
|
+
contactId?: number;
|
|
81
|
+
displayName?: string;
|
|
82
|
+
teamMembers?: TeamMember[];
|
|
83
|
+
}
|
|
84
|
+
declare function ChatWidget({ position, primaryColor, chatBackend, sessionId: providedSessionId, contactId, displayName: providedDisplayName, teamMembers }: ChatWidgetProps): React__default.JSX.Element;
|
|
85
|
+
|
|
86
|
+
export { ChatWidget, type ResolvedCtaUrls, isExternalCtaUrl, resolveCtaUrls, submitContactFormAction, submitLeadFormAction };
|