@cloudfour/patterns
Version:
Front-end patterns for cloudfour.com
256 lines (250 loc) • 8.04 kB
TypeScript
declare const initCommentReplyForm: (comment: HTMLElement) => {
destroy: () => void;
};
declare namespace defaultArgs {
const alternate: boolean;
const feature_count: number;
const feature_one_title: string;
const feature_one_content: string;
const feature_two_title: string;
const feature_two_content: string;
const organizationName: string;
const organizationStreetAddress: string;
const organizationAddressLocality: string;
const organizationAddressRegion: string;
const organizationPostalCode: string;
const organizationAddressCountry: string;
const organizationEmail: string;
const organizationTelephone: string;
const organizationUrl: string;
const organizationFoundingDate: string;
}
declare namespace defaultArgTypes {
export namespace alternate_1 {
namespace control {
const type: string;
}
}
export { alternate_1 as alternate };
export namespace feature_count_1 {
export namespace control_1 {
const type_1: string;
export { type_1 as type };
export const min: number;
export const max: number;
}
export { control_1 as control };
}
export { feature_count_1 as feature_count };
export namespace feature_one_title_1 {
export namespace type_2 {
const name: string;
}
export { type_2 as type };
}
export { feature_one_title_1 as feature_one_title };
export namespace feature_one_content_1 {
export namespace type_3 {
const name_1: string;
export { name_1 as name };
}
export { type_3 as type };
}
export { feature_one_content_1 as feature_one_content };
export namespace feature_two_title_1 {
export namespace type_4 {
const name_2: string;
export { name_2 as name };
}
export { type_4 as type };
}
export { feature_two_title_1 as feature_two_title };
export namespace feature_two_content_1 {
export namespace type_5 {
const name_3: string;
export { name_3 as name };
}
export { type_5 as type };
}
export { feature_two_content_1 as feature_two_content };
export namespace organizationName_1 {
export namespace type_6 {
const name_4: string;
export { name_4 as name };
}
export { type_6 as type };
}
export { organizationName_1 as organizationName };
export namespace organizationStreetAddress_1 {
export namespace type_7 {
const name_5: string;
export { name_5 as name };
}
export { type_7 as type };
}
export { organizationStreetAddress_1 as organizationStreetAddress };
export namespace organizationAddressLocality_1 {
export namespace type_8 {
const name_6: string;
export { name_6 as name };
}
export { type_8 as type };
}
export { organizationAddressLocality_1 as organizationAddressLocality };
export namespace organizationAddressRegion_1 {
export namespace type_9 {
const name_7: string;
export { name_7 as name };
}
export { type_9 as type };
}
export { organizationAddressRegion_1 as organizationAddressRegion };
export namespace organizationPostalCode_1 {
export namespace type_10 {
const name_8: string;
export { name_8 as name };
}
export { type_10 as type };
}
export { organizationPostalCode_1 as organizationPostalCode };
export namespace organizationAddressCountry_1 {
export namespace type_11 {
const name_9: string;
export { name_9 as name };
}
export { type_11 as type };
}
export { organizationAddressCountry_1 as organizationAddressCountry };
export namespace organizationEmail_1 {
export namespace type_12 {
const name_10: string;
export { name_10 as name };
}
export { type_12 as type };
}
export { organizationEmail_1 as organizationEmail };
export namespace organizationTelephone_1 {
export namespace type_13 {
const name_11: string;
export { name_11 as name };
}
export { type_13 as type };
}
export { organizationTelephone_1 as organizationTelephone };
export namespace organizationUrl_1 {
export namespace type_14 {
const name_12: string;
export { name_12 as name };
}
export { type_14 as type };
}
export { organizationUrl_1 as organizationUrl };
export namespace organizationFoundingDate_1 {
export namespace type_15 {
const name_13: string;
export { name_13 as name };
}
export { type_15 as type };
}
export { organizationFoundingDate_1 as organizationFoundingDate };
}
declare function generateGroundNavProps(args: {
alternate: boolean;
feature_count: number;
feature_one_title: string;
feature_one_content: string;
feature_two_title: string;
feature_two_content: string;
organizationName: string;
organizationStreetAddress: string;
organizationAddressLocality: string;
organizationAddressRegion: string;
organizationPostalCode: string;
organizationAddressCountry: string;
organizationEmail: string;
organizationTelephone: string;
organizationUrl: string;
organizationFoundingDate: string;
}): {
menu: {
items: {
link: string;
title: string;
}[];
};
social: {
items: {
link: string;
title: string;
icon: string;
}[];
};
topics: {
items: {
link: string;
title: string;
}[];
};
alternate: boolean;
feature_count: number;
feature_one_title: string;
feature_one_content: string;
feature_two_title: string;
feature_two_content: string;
organization: {
name: string;
address: {
street_address: string;
address_locality: string;
address_region: string;
postal_code: string;
address_country: string;
};
email: string;
telephone: string;
url: string;
founding_date: string;
};
};
/**
* Create Elastic TextArea
*
* Adds an event listener to a `textarea` elment that responds to input events
* by either increasing or decreasing the `rows` attribute based on whether the
* `textarea` is scrolling or not. Returns an object containing a `destroy()`
* method to remove the event listener.
*
* @param textarea - the target `textarea` element
*/
declare const createElasticTextArea: (textarea: HTMLTextAreaElement) => {
destroy: () => void;
};
/**
* Create Sky Nav Menu
*
* Adds an event listener to the toggle button of a Sky Nav component for click
* events, which runs the toggle command to show or hide the menu with animation.
* Responds to breakpoint changes to show or hide the nav for large and small
* screens. Returns an object containing a `destroy()` method to remove the
* event listener.
*
* @param navButton - the toggle button for the navigation
*/
declare const initSkyNav: (navButton: HTMLButtonElement) => {
destroy: () => void;
};
/**
* Subscribe
*
* Progressively enhances the UX for the Subscribe component.
*
* Enhancements include:
* - A one second form hide delay is added when `:focus` is moved away from the
* Subscribe component elements
* - The form can be hidden by pressing the `Escape` key
*/
declare const createSubscribe: (containerEl: HTMLElement) => {
init: () => void;
destroy: () => void;
} | undefined;
export { createElasticTextArea, createSubscribe, defaultArgTypes, defaultArgs, generateGroundNavProps, initCommentReplyForm, initSkyNav };