@universityofmaryland/web-elements-library 1.2.0 → 1.3.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 +518 -0
- package/dist/__tests__/examples/component-test.example.d.ts +2 -0
- package/dist/__tests__/examples/component-test.example.d.ts.map +1 -0
- package/dist/__tests__/fixtures/content.d.ts +62 -0
- package/dist/__tests__/fixtures/content.d.ts.map +1 -0
- package/dist/__tests__/fixtures/elements.d.ts +48 -0
- package/dist/__tests__/fixtures/elements.d.ts.map +1 -0
- package/dist/__tests__/helpers/element.d.ts +23 -0
- package/dist/__tests__/helpers/element.d.ts.map +1 -0
- package/dist/__tests__/helpers/index.d.ts +2 -0
- package/dist/__tests__/helpers/index.d.ts.map +1 -0
- package/dist/__tests__/helpers/setup.d.ts +1 -0
- package/dist/__tests__/helpers/setup.d.ts.map +1 -0
- package/dist/__tests__/jest.setup.d.ts +6 -0
- package/dist/__tests__/jest.setup.d.ts.map +1 -0
- package/dist/__tests__/mocks/styles.d.ts +242 -0
- package/dist/__tests__/mocks/styles.d.ts.map +1 -0
- package/dist/__tests__/utils/assertions.d.ts +30 -0
- package/dist/__tests__/utils/assertions.d.ts.map +1 -0
- package/dist/__tests__/utils/events.d.ts +13 -0
- package/dist/__tests__/utils/events.d.ts.map +1 -0
- package/dist/__tests__/utils/index.d.ts +4 -0
- package/dist/__tests__/utils/index.d.ts.map +1 -0
- package/dist/__tests__/utils/timers.d.ts +20 -0
- package/dist/__tests__/utils/timers.d.ts.map +1 -0
- package/dist/_types.d.ts +193 -0
- package/dist/_types.d.ts.map +1 -0
- package/dist/atomic/animations/brand/chevron-flow.d.ts +2 -2
- package/dist/atomic/animations/brand/chevron-flow.d.ts.map +1 -1
- package/dist/atomic/assets/image/gif.d.ts +2 -1
- package/dist/atomic/assets/image/gif.d.ts.map +1 -1
- package/dist/atomic/assets/image/index.d.ts +2 -0
- package/dist/atomic/assets/image/index.d.ts.map +1 -1
- package/dist/atomic/assets/image/placeholder.d.ts +9 -0
- package/dist/atomic/assets/image/placeholder.d.ts.map +1 -0
- package/dist/atomic/assets/index.d.ts +1 -0
- package/dist/atomic/assets/index.d.ts.map +1 -1
- package/dist/atomic/assets/video/index.d.ts +3 -0
- package/dist/atomic/assets/video/index.d.ts.map +1 -0
- package/dist/atomic/assets/video/observed-auto-play.d.ts +17 -0
- package/dist/atomic/assets/video/observed-auto-play.d.ts.map +1 -0
- package/dist/atomic/assets/video/toggle.d.ts +17 -0
- package/dist/atomic/assets/video/toggle.d.ts.map +1 -0
- package/dist/atomic/text-lockup/date.d.ts.map +1 -1
- package/dist/atomic/text-lockup/index.d.ts +1 -0
- package/dist/atomic/text-lockup/index.d.ts.map +1 -1
- package/dist/atomic/text-lockup/large.d.ts +17 -0
- package/dist/atomic/text-lockup/large.d.ts.map +1 -0
- package/dist/atomic/text-lockup/medium.d.ts +17 -0
- package/dist/atomic/text-lockup/medium.d.ts.map +1 -0
- package/dist/atomic/text-lockup/small.d.ts +2 -1
- package/dist/atomic/text-lockup/small.d.ts.map +1 -1
- package/dist/composite/__tests__/card/block.test.d.ts +2 -0
- package/dist/composite/__tests__/card/block.test.d.ts.map +1 -0
- package/dist/composite/__tests__/card/list.test.d.ts +2 -0
- package/dist/composite/__tests__/card/list.test.d.ts.map +1 -0
- package/dist/composite/__tests__/card/overlay.test.d.ts +2 -0
- package/dist/composite/__tests__/card/overlay.test.d.ts.map +1 -0
- package/dist/composite/__tests__/hero/custom/expand.test.d.ts +2 -0
- package/dist/composite/__tests__/hero/custom/expand.test.d.ts.map +1 -0
- package/dist/composite/__tests__/hero/custom/grid.test.d.ts +2 -0
- package/dist/composite/__tests__/hero/custom/grid.test.d.ts.map +1 -0
- package/dist/composite/__tests__/hero/custom/video-arrow.test.d.ts +2 -0
- package/dist/composite/__tests__/hero/custom/video-arrow.test.d.ts.map +1 -0
- package/dist/composite/__tests__/hero/logo.test.d.ts +2 -0
- package/dist/composite/__tests__/hero/logo.test.d.ts.map +1 -0
- package/dist/composite/__tests__/hero/minimal.test.d.ts +2 -0
- package/dist/composite/__tests__/hero/minimal.test.d.ts.map +1 -0
- package/dist/composite/__tests__/hero/overlay.test.d.ts +2 -0
- package/dist/composite/__tests__/hero/overlay.test.d.ts.map +1 -0
- package/dist/composite/__tests__/hero/stacked.test.d.ts +2 -0
- package/dist/composite/__tests__/hero/stacked.test.d.ts.map +1 -0
- package/dist/composite/__tests__/hero/standard.test.d.ts +2 -0
- package/dist/composite/__tests__/hero/standard.test.d.ts.map +1 -0
- package/dist/composite/__tests__/test-helpers/element.d.ts +23 -0
- package/dist/composite/__tests__/test-helpers/element.d.ts.map +1 -0
- package/dist/composite/__tests__/test-helpers/setup.d.ts +1 -0
- package/dist/composite/__tests__/test-helpers/setup.d.ts.map +1 -0
- package/dist/composite/__tests__/types/card-types.test.d.ts +2 -0
- package/dist/composite/__tests__/types/card-types.test.d.ts.map +1 -0
- package/dist/composite/__tests__/types/hero-types.test.d.ts +2 -0
- package/dist/composite/__tests__/types/hero-types.test.d.ts.map +1 -0
- package/dist/composite/__tests__/types/type-compilation.test.d.ts +2 -0
- package/dist/composite/__tests__/types/type-compilation.test.d.ts.map +1 -0
- package/dist/composite/accordion/item.d.ts +2 -2
- package/dist/composite/accordion/item.d.ts.map +1 -1
- package/dist/composite/alert/elements/text.d.ts.map +1 -1
- package/dist/composite/alert/site.d.ts.map +1 -1
- package/dist/composite/banner/promo.d.ts.map +1 -1
- package/dist/composite/card/_types.d.ts +21 -17
- package/dist/composite/card/_types.d.ts.map +1 -1
- package/dist/composite/card/index.d.ts +1 -0
- package/dist/composite/card/index.d.ts.map +1 -1
- package/dist/composite/card/overlay/color.d.ts.map +1 -1
- package/dist/composite/card/overlay/image.d.ts.map +1 -1
- package/dist/composite/card/video/block.d.ts +15 -0
- package/dist/composite/card/video/block.d.ts.map +1 -0
- package/dist/composite/card/video/index.d.ts +3 -0
- package/dist/composite/card/video/index.d.ts.map +1 -0
- package/dist/composite/card/video/short.d.ts +10 -0
- package/dist/composite/card/video/short.d.ts.map +1 -0
- package/dist/composite/carousel/cards/index.d.ts +6 -8
- package/dist/composite/carousel/cards/index.d.ts.map +1 -1
- package/dist/composite/carousel/default/index.d.ts +6 -8
- package/dist/composite/carousel/default/index.d.ts.map +1 -1
- package/dist/composite/carousel/elements/blocks.d.ts.map +1 -1
- package/dist/composite/carousel/image/standard.d.ts.map +1 -1
- package/dist/composite/carousel/thumbnail/index.d.ts +6 -8
- package/dist/composite/carousel/thumbnail/index.d.ts.map +1 -1
- package/dist/composite/footer/_types.d.ts +7 -0
- package/dist/composite/footer/_types.d.ts.map +1 -0
- package/dist/composite/footer/elements/main-section/call-to-action.d.ts +8 -0
- package/dist/composite/footer/elements/main-section/call-to-action.d.ts.map +1 -0
- package/dist/composite/footer/elements/main-section/campaign.d.ts +8 -0
- package/dist/composite/footer/elements/main-section/campaign.d.ts.map +1 -0
- package/dist/composite/footer/elements/main-section/index.d.ts +10 -0
- package/dist/composite/footer/elements/main-section/index.d.ts.map +1 -0
- package/dist/composite/footer/elements/main-section/row-links/index.d.ts +10 -0
- package/dist/composite/footer/elements/main-section/row-links/index.d.ts.map +1 -0
- package/dist/composite/footer/elements/main-section/row-links/link-columns.d.ts +7 -0
- package/dist/composite/footer/elements/main-section/row-links/link-columns.d.ts.map +1 -0
- package/dist/composite/footer/elements/main-section/row-logo/contact.d.ts +16 -0
- package/dist/composite/footer/elements/main-section/row-logo/contact.d.ts.map +1 -0
- package/dist/composite/footer/elements/main-section/row-logo/index.d.ts +9 -0
- package/dist/composite/footer/elements/main-section/row-logo/index.d.ts.map +1 -0
- package/dist/composite/footer/elements/main-section/row-logo/logo.d.ts +9 -0
- package/dist/composite/footer/elements/main-section/row-logo/logo.d.ts.map +1 -0
- package/dist/composite/footer/elements/main-section/social.d.ts +11 -0
- package/dist/composite/footer/elements/main-section/social.d.ts.map +1 -0
- package/dist/composite/footer/elements/utility-section/index.d.ts +7 -0
- package/dist/composite/footer/elements/utility-section/index.d.ts.map +1 -0
- package/dist/composite/footer/globals.d.ts +38 -0
- package/dist/composite/footer/globals.d.ts.map +1 -0
- package/dist/composite/footer/index.d.ts +2 -0
- package/dist/composite/footer/index.d.ts.map +1 -0
- package/dist/composite/footer/options.d.ts +11 -0
- package/dist/composite/footer/options.d.ts.map +1 -0
- package/dist/composite/hero/_constants.d.ts +66 -0
- package/dist/composite/hero/_constants.d.ts.map +1 -0
- package/dist/composite/hero/_types.d.ts +70 -0
- package/dist/composite/hero/_types.d.ts.map +1 -0
- package/dist/composite/hero/_utils.d.ts +73 -0
- package/dist/composite/hero/_utils.d.ts.map +1 -0
- package/dist/composite/hero/brand/index.d.ts +1 -17
- package/dist/composite/hero/brand/index.d.ts.map +1 -1
- package/dist/composite/hero/brand/video.d.ts +15 -10
- package/dist/composite/hero/brand/video.d.ts.map +1 -1
- package/dist/composite/hero/custom/expand.d.ts +18 -0
- package/dist/composite/hero/custom/expand.d.ts.map +1 -0
- package/dist/composite/hero/custom/grid.d.ts +23 -0
- package/dist/composite/hero/custom/grid.d.ts.map +1 -0
- package/dist/composite/hero/custom/index.d.ts +4 -0
- package/dist/composite/hero/custom/index.d.ts.map +1 -0
- package/dist/composite/hero/custom/video-arrow.d.ts +15 -0
- package/dist/composite/hero/custom/video-arrow.d.ts.map +1 -0
- package/dist/composite/hero/custom/video.d.ts +22 -0
- package/dist/composite/hero/custom/video.d.ts.map +1 -0
- package/dist/composite/hero/expand.d.ts +14 -14
- package/dist/composite/hero/expand.d.ts.map +1 -1
- package/dist/composite/hero/grid.d.ts +26 -0
- package/dist/composite/hero/grid.d.ts.map +1 -0
- package/dist/composite/hero/index.d.ts +3 -4
- package/dist/composite/hero/index.d.ts.map +1 -1
- package/dist/composite/hero/logo.d.ts +4 -5
- package/dist/composite/hero/logo.d.ts.map +1 -1
- package/dist/composite/hero/minimal.d.ts +4 -9
- package/dist/composite/hero/minimal.d.ts.map +1 -1
- package/dist/composite/hero/overlay.d.ts +4 -8
- package/dist/composite/hero/overlay.d.ts.map +1 -1
- package/dist/composite/hero/stacked.d.ts +4 -11
- package/dist/composite/hero/stacked.d.ts.map +1 -1
- package/dist/composite/hero/standard.d.ts +4 -9
- package/dist/composite/hero/standard.d.ts.map +1 -1
- package/dist/composite/hero/types.d.ts +90 -0
- package/dist/composite/hero/types.d.ts.map +1 -0
- package/dist/composite/index.d.ts +1 -0
- package/dist/composite/index.d.ts.map +1 -1
- package/dist/composite/layout/box/logo.d.ts +4 -4
- package/dist/composite/layout/box/logo.d.ts.map +1 -1
- package/dist/composite/layout/image/expand.d.ts +3 -3
- package/dist/composite/layout/image/expand.d.ts.map +1 -1
- package/dist/composite/layout/image/index.d.ts +1 -10
- package/dist/composite/layout/image/index.d.ts.map +1 -1
- package/dist/composite/layout/index.d.ts +2 -2
- package/dist/composite/layout/index.d.ts.map +1 -1
- package/dist/composite/layout/scroll-top/index.d.ts +5 -7
- package/dist/composite/layout/scroll-top/index.d.ts.map +1 -1
- package/dist/composite/layout/section-intro/index.d.ts +2 -27
- package/dist/composite/layout/section-intro/index.d.ts.map +1 -1
- package/dist/composite/layout/section-intro/small.d.ts +5 -7
- package/dist/composite/layout/section-intro/small.d.ts.map +1 -1
- package/dist/composite/layout/section-intro/wide.d.ts +3 -3
- package/dist/composite/layout/section-intro/wide.d.ts.map +1 -1
- package/dist/composite/layout/sticky-columns/index.d.ts +7 -9
- package/dist/composite/layout/sticky-columns/index.d.ts.map +1 -1
- package/dist/composite/media/elements/caption.d.ts.map +1 -1
- package/dist/composite/navigation/elements/breadcrumb/index.d.ts +10 -0
- package/dist/composite/navigation/elements/breadcrumb/index.d.ts.map +1 -0
- package/dist/composite/navigation/elements/drawer/index.d.ts.map +1 -1
- package/dist/composite/navigation/elements/index.d.ts +6 -39
- package/dist/composite/navigation/elements/index.d.ts.map +1 -1
- package/dist/composite/navigation/elements/item/index.d.ts.map +1 -1
- package/dist/composite/navigation/elements/slider/action.d.ts.map +1 -1
- package/dist/composite/navigation/elements/slider/index.d.ts.map +1 -1
- package/dist/composite/navigation/elements/slider/slide-first.d.ts.map +1 -1
- package/dist/composite/navigation/elements/slider/slides.d.ts.map +1 -1
- package/dist/composite/navigation/elements/sticky/index.d.ts +6 -6
- package/dist/composite/navigation/elements/sticky/index.d.ts.map +1 -1
- package/dist/composite/navigation/header.d.ts.map +1 -1
- package/dist/composite/navigation/index.d.ts +1 -1
- package/dist/composite/navigation/index.d.ts.map +1 -1
- package/dist/composite/navigation/utility/alert.d.ts.map +1 -1
- package/dist/composite/navigation/utility/index.d.ts.map +1 -1
- package/dist/composite/pathway/elements/text.d.ts.map +1 -1
- package/dist/composite/pathway/hero.d.ts +1 -1
- package/dist/composite/pathway/hero.d.ts.map +1 -1
- package/dist/composite/pathway/highlight.d.ts.map +1 -1
- package/dist/composite/pathway/overlay.d.ts +1 -1
- package/dist/composite/pathway/overlay.d.ts.map +1 -1
- package/dist/composite/pathway/standard.d.ts +1 -1
- package/dist/composite/pathway/standard.d.ts.map +1 -1
- package/dist/composite/pathway/sticky.d.ts +1 -1
- package/dist/composite/pathway/sticky.d.ts.map +1 -1
- package/dist/composite/person/bio/full.d.ts +2 -1
- package/dist/composite/person/bio/full.d.ts.map +1 -1
- package/dist/composite/quote/elements/image.d.ts +5 -3
- package/dist/composite/quote/elements/image.d.ts.map +1 -1
- package/dist/composite/quote/elements/index.d.ts +11 -7
- package/dist/composite/quote/elements/index.d.ts.map +1 -1
- package/dist/composite/quote/elements/text.d.ts +5 -3
- package/dist/composite/quote/elements/text.d.ts.map +1 -1
- package/dist/composite/quote/featured.d.ts +3 -3
- package/dist/composite/quote/featured.d.ts.map +1 -1
- package/dist/composite/quote/inline.d.ts +3 -3
- package/dist/composite/quote/inline.d.ts.map +1 -1
- package/dist/composite/slider/events.d.ts +1 -1
- package/dist/composite/stat/display.d.ts +2 -2
- package/dist/composite/stat/display.d.ts.map +1 -1
- package/dist/composite/tabs/standard.d.ts +6 -8
- package/dist/composite/tabs/standard.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.LICENSE.txt +88 -400
- package/dist/layout/image.d.ts.map +1 -1
- package/dist/model/elements/actions.d.ts +5 -0
- package/dist/model/elements/actions.d.ts.map +1 -1
- package/dist/model/elements/headline.d.ts +10 -0
- package/dist/model/elements/headline.d.ts.map +1 -1
- package/dist/model/elements/index.d.ts +8 -2
- package/dist/model/elements/index.d.ts.map +1 -1
- package/dist/model/elements/layout.d.ts +15 -0
- package/dist/model/elements/layout.d.ts.map +1 -1
- package/dist/model/elements/rich-text.d.ts +5 -0
- package/dist/model/elements/rich-text.d.ts.map +1 -1
- package/dist/model/modifiers/_types.d.ts +7 -0
- package/dist/model/modifiers/_types.d.ts.map +1 -1
- package/dist/model/modifiers/index.d.ts.map +1 -1
- package/dist/model/test-composite.d.ts +7 -0
- package/dist/model/test-composite.d.ts.map +1 -0
- package/dist/utilities/index.d.ts +1 -1
- package/dist/utilities/index.d.ts.map +1 -1
- package/dist/utilities/markup/create.d.ts +5 -0
- package/dist/utilities/markup/create.d.ts.map +1 -1
- package/dist/utilities/styles/index.d.ts +2 -2
- package/dist/utilities/styles/index.d.ts.map +1 -1
- package/dist/utilities/styles/media.d.ts +6 -0
- package/dist/utilities/styles/media.d.ts.map +1 -0
- package/dist/utilities/theme/animations.d.ts +9 -0
- package/dist/utilities/theme/animations.d.ts.map +1 -0
- package/dist/utilities/theme/assets.d.ts +6 -0
- package/dist/utilities/theme/assets.d.ts.map +1 -0
- package/dist/utilities/theme/index.d.ts +11 -0
- package/dist/utilities/theme/index.d.ts.map +1 -0
- package/dist/utilities/theme/media.d.ts +6 -0
- package/dist/utilities/theme/media.d.ts.map +1 -0
- package/dist/utilities/theme/styles.d.ts +8 -0
- package/dist/utilities/theme/styles.d.ts.map +1 -0
- package/package.json +9 -4
- package/dist/composite/hero/elements/image.d.ts +0 -17
- package/dist/composite/hero/elements/image.d.ts.map +0 -1
- package/dist/composite/hero/elements/index.d.ts +0 -27
- package/dist/composite/hero/elements/index.d.ts.map +0 -1
- package/dist/composite/hero/elements/text.d.ts +0 -25
- package/dist/composite/hero/elements/text.d.ts.map +0 -1
- package/dist/composite/person/elements/contact.d.ts +0 -17
- package/dist/composite/person/elements/contact.d.ts.map +0 -1
- package/dist/composite/person/elements/image.d.ts +0 -11
- package/dist/composite/person/elements/image.d.ts.map +0 -1
- package/dist/composite/person/elements/text.d.ts +0 -27
- package/dist/composite/person/elements/text.d.ts.map +0 -1
- package/dist/layout/carousel-full-screen.d.ts +0 -16
- package/dist/layout/carousel-full-screen.d.ts.map +0 -1
- package/dist/layout/carousel-overlay.d.ts +0 -13
- package/dist/layout/carousel-overlay.d.ts.map +0 -1
- package/dist/layout/modal.d.ts +0 -17
- package/dist/layout/modal.d.ts.map +0 -1
- package/dist/macros/animations/carousel-blocks.d.ts +0 -42
- package/dist/macros/animations/carousel-blocks.d.ts.map +0 -1
- package/dist/macros/animations/carousel-image.d.ts +0 -20
- package/dist/macros/animations/carousel-image.d.ts.map +0 -1
- package/dist/macros/animations/indicator.d.ts +0 -15
- package/dist/macros/animations/indicator.d.ts.map +0 -1
- package/dist/macros/animations/overlay-brand.d.ts +0 -16
- package/dist/macros/animations/overlay-brand.d.ts.map +0 -1
- package/dist/macros/brand/fearless-scroll-chevrons.d.ts +0 -6
- package/dist/macros/brand/fearless-scroll-chevrons.d.ts.map +0 -1
- package/dist/macros/index.d.ts +0 -9
- package/dist/macros/index.d.ts.map +0 -1
- package/dist/macros/text-lockup/small.d.ts +0 -22
- package/dist/macros/text-lockup/small.d.ts.map +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,518 @@
|
|
|
1
|
+
# University of Maryland Web Elements Library
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@universityofmaryland/web-elements-library)
|
|
4
|
+
|
|
5
|
+
Foundational UI elements that make up the University of Maryland Components Library. This library provides the building blocks used to create more complex UI components while maintaining consistent design patterns across all UMD digital properties. Elements are crafted to be lightweight, accessible, and easily combinable into larger structures while adhering to UMD brand guidelines.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Using npm
|
|
11
|
+
npm install @universityofmaryland/web-elements-library
|
|
12
|
+
|
|
13
|
+
# Using yarn
|
|
14
|
+
yarn add @universityofmaryland/web-elements-library
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
Here's a simple example to get you started with the Elements library:
|
|
20
|
+
|
|
21
|
+
```javascript
|
|
22
|
+
import { Composite } from '@universityofmaryland/web-elements-library';
|
|
23
|
+
|
|
24
|
+
// Create a hero section
|
|
25
|
+
const hero = Composite.hero.standard({
|
|
26
|
+
headline: document.createElement('h1'),
|
|
27
|
+
text: document.createElement('p'),
|
|
28
|
+
image: document.querySelector('img'),
|
|
29
|
+
isThemeDark: true
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// Add the hero to your page
|
|
33
|
+
document.getElementById('hero-container').appendChild(hero.element);
|
|
34
|
+
|
|
35
|
+
// Inject the associated styles
|
|
36
|
+
const styleElement = document.createElement('style');
|
|
37
|
+
styleElement.textContent = hero.styles;
|
|
38
|
+
document.head.appendChild(styleElement);
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Usage
|
|
42
|
+
|
|
43
|
+
### Importing Elements
|
|
44
|
+
|
|
45
|
+
```javascript
|
|
46
|
+
// Import specific element categories
|
|
47
|
+
import { Atomic, Composite, Layout } from '@universityofmaryland/web-elements-library';
|
|
48
|
+
|
|
49
|
+
// Example: Using an atomic element
|
|
50
|
+
const buttonElement = Atomic.actions.text({
|
|
51
|
+
text: 'Click Me',
|
|
52
|
+
url: '#',
|
|
53
|
+
isStyled: true
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
// Add the element to the DOM
|
|
57
|
+
document.body.appendChild(buttonElement.element);
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Element Categories
|
|
61
|
+
|
|
62
|
+
The library organizes elements into several categories:
|
|
63
|
+
|
|
64
|
+
### Atomic Elements
|
|
65
|
+
|
|
66
|
+
Atomic elements are the most basic building blocks that cannot be broken down further:
|
|
67
|
+
|
|
68
|
+
```javascript
|
|
69
|
+
import { Atomic } from '@universityofmaryland/web-elements-library';
|
|
70
|
+
|
|
71
|
+
// Actions
|
|
72
|
+
const buttonElement = Atomic.actions.text({
|
|
73
|
+
text: 'Learn More',
|
|
74
|
+
url: '/learn-more',
|
|
75
|
+
isStyled: true
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// Assets
|
|
79
|
+
const imageElement = Atomic.assets.image.background({
|
|
80
|
+
image: document.querySelector('img'),
|
|
81
|
+
isScaled: true
|
|
82
|
+
});
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Available atomic elements:
|
|
86
|
+
- `actions` - Buttons and interactive elements
|
|
87
|
+
- `animations` - Animation elements
|
|
88
|
+
- `assets` - Images, icons, and media elements
|
|
89
|
+
- `buttons` - Button variations
|
|
90
|
+
- `events` - Event-related elements
|
|
91
|
+
- `layout` - Basic layout elements
|
|
92
|
+
- `textLockup` - Text grouping elements
|
|
93
|
+
|
|
94
|
+
### Composite Elements
|
|
95
|
+
|
|
96
|
+
Composite elements are combinations of atomic elements that form more complex UI patterns:
|
|
97
|
+
|
|
98
|
+
```javascript
|
|
99
|
+
import { Composite } from '@universityofmaryland/web-elements-library';
|
|
100
|
+
|
|
101
|
+
const cardElement = Composite.card.block({
|
|
102
|
+
headline: document.querySelector('h3'),
|
|
103
|
+
text: document.querySelector('p'),
|
|
104
|
+
image: document.querySelector('img'),
|
|
105
|
+
actions: document.querySelector('.actions')
|
|
106
|
+
});
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Available composite elements:
|
|
110
|
+
- `accordion` - Expandable content sections
|
|
111
|
+
- `alert` - Alert/notification elements
|
|
112
|
+
- `banner` - Banner elements
|
|
113
|
+
- `card` - Card elements (block, list, overlay)
|
|
114
|
+
- `carousel` - Carousel/slider elements
|
|
115
|
+
- `hero` - Hero section elements (see detailed section below)
|
|
116
|
+
- `layout` - Layout compositions
|
|
117
|
+
- `media` - Media display elements
|
|
118
|
+
- `navigation` - Navigation elements
|
|
119
|
+
- `pathway` - Pathway/journey elements
|
|
120
|
+
- `person` - Person/profile elements
|
|
121
|
+
- `quote` - Quote display elements
|
|
122
|
+
- `slider` - Slider elements
|
|
123
|
+
- `social` - Social media elements
|
|
124
|
+
- `tabs` - Tabbed interface elements
|
|
125
|
+
|
|
126
|
+
#### Hero Elements
|
|
127
|
+
|
|
128
|
+
The hero category provides multiple variations for creating impactful page headers and feature sections:
|
|
129
|
+
|
|
130
|
+
##### Standard Hero
|
|
131
|
+
The default hero pattern with flexible content and media options:
|
|
132
|
+
|
|
133
|
+
```javascript
|
|
134
|
+
const heroStandard = Composite.hero.standard({
|
|
135
|
+
headline: document.createElement('h1'),
|
|
136
|
+
eyebrow: document.createElement('span'),
|
|
137
|
+
text: document.createElement('p'),
|
|
138
|
+
actions: document.createElement('div'),
|
|
139
|
+
image: document.querySelector('img'),
|
|
140
|
+
video: document.querySelector('video'),
|
|
141
|
+
includesAnimation: true,
|
|
142
|
+
isHeightSmall: false,
|
|
143
|
+
isHeightFull: false,
|
|
144
|
+
isTextCenter: false,
|
|
145
|
+
isTextRight: false,
|
|
146
|
+
isThemeDark: true
|
|
147
|
+
});
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
##### Minimal Hero
|
|
151
|
+
A simplified hero with essential content only:
|
|
152
|
+
|
|
153
|
+
```javascript
|
|
154
|
+
const heroMinimal = Composite.hero.minimal({
|
|
155
|
+
headline: document.createElement('h1'),
|
|
156
|
+
text: document.createElement('p'),
|
|
157
|
+
eyebrow: document.createElement('span'),
|
|
158
|
+
isThemeDark: false
|
|
159
|
+
});
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
##### Stacked Hero
|
|
163
|
+
Hero with vertically stacked content and media:
|
|
164
|
+
|
|
165
|
+
```javascript
|
|
166
|
+
const heroStacked = Composite.hero.stacked({
|
|
167
|
+
headline: document.createElement('h1'),
|
|
168
|
+
text: document.createElement('p'),
|
|
169
|
+
image: document.querySelector('img'),
|
|
170
|
+
includesAnimation: true,
|
|
171
|
+
isHeightSmall: false,
|
|
172
|
+
isHeightFull: true,
|
|
173
|
+
isWidthLarge: true, // Stacked-specific property
|
|
174
|
+
isThemeDark: true
|
|
175
|
+
});
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
##### Overlay Hero
|
|
179
|
+
Hero with overlay effects and advanced styling options:
|
|
180
|
+
|
|
181
|
+
```javascript
|
|
182
|
+
const heroOverlay = Composite.hero.overlay({
|
|
183
|
+
headline: document.createElement('h1'),
|
|
184
|
+
text: document.createElement('p'),
|
|
185
|
+
image: document.querySelector('img'),
|
|
186
|
+
hasBorder: true,
|
|
187
|
+
isTransparent: false,
|
|
188
|
+
isSticky: false,
|
|
189
|
+
isTextCenter: true,
|
|
190
|
+
isThemeDark: true
|
|
191
|
+
});
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
##### Logo Hero
|
|
195
|
+
Hero featuring institutional branding:
|
|
196
|
+
|
|
197
|
+
```javascript
|
|
198
|
+
const heroLogo = Composite.hero.logo({
|
|
199
|
+
headline: document.createElement('h1'),
|
|
200
|
+
logo: document.createElement('div'), // Logo element
|
|
201
|
+
text: document.createElement('p'),
|
|
202
|
+
actions: document.createElement('div'),
|
|
203
|
+
image: document.querySelector('img'),
|
|
204
|
+
isThemeDark: true,
|
|
205
|
+
isThemeLight: false,
|
|
206
|
+
isThemeMaryland: false
|
|
207
|
+
});
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
##### Custom Hero Variations
|
|
211
|
+
|
|
212
|
+
The library also provides specialized hero patterns for specific use cases:
|
|
213
|
+
|
|
214
|
+
###### Expand Hero
|
|
215
|
+
Hero with expandable content sections:
|
|
216
|
+
|
|
217
|
+
```javascript
|
|
218
|
+
const heroExpand = Composite.hero.custom.expand({
|
|
219
|
+
headline: document.createElement('h1'),
|
|
220
|
+
text: document.createElement('p'),
|
|
221
|
+
expandedContent: document.createElement('div'), // Content revealed on expand
|
|
222
|
+
includesAnimation: true,
|
|
223
|
+
isThemeDark: true
|
|
224
|
+
});
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
###### Grid Hero
|
|
228
|
+
Hero with content blocks arranged in a grid:
|
|
229
|
+
|
|
230
|
+
```javascript
|
|
231
|
+
const heroGrid = Composite.hero.custom.grid({
|
|
232
|
+
headline: document.createElement('h1'),
|
|
233
|
+
text: document.createElement('p'),
|
|
234
|
+
blocks: [
|
|
235
|
+
document.createElement('div'), // Grid block 1
|
|
236
|
+
document.createElement('div'), // Grid block 2
|
|
237
|
+
document.createElement('div'), // Grid block 3
|
|
238
|
+
document.createElement('div') // Grid block 4
|
|
239
|
+
],
|
|
240
|
+
image: document.querySelector('img'),
|
|
241
|
+
isThemeDark: true
|
|
242
|
+
});
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
###### Video Arrow Hero
|
|
246
|
+
Hero with prominent video playback controls:
|
|
247
|
+
|
|
248
|
+
```javascript
|
|
249
|
+
const heroVideoArrow = Composite.hero.custom.videoArrow({
|
|
250
|
+
headline: document.createElement('h1'),
|
|
251
|
+
text: document.createElement('p'),
|
|
252
|
+
video: document.querySelector('video'),
|
|
253
|
+
image: document.querySelector('img'), // Poster image
|
|
254
|
+
videoControls: true,
|
|
255
|
+
includesAnimation: true,
|
|
256
|
+
isThemeDark: true
|
|
257
|
+
});
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
##### Hero Properties Reference
|
|
261
|
+
|
|
262
|
+
Common properties across hero variants:
|
|
263
|
+
- `headline` - Main heading element
|
|
264
|
+
- `eyebrow` - Small text above headline
|
|
265
|
+
- `text` - Descriptive paragraph text
|
|
266
|
+
- `actions` - CTA buttons or links
|
|
267
|
+
- `image` - Hero image element
|
|
268
|
+
- `video` - Hero video element
|
|
269
|
+
- `includesAnimation` - Enable entrance animations
|
|
270
|
+
- `isThemeDark` - Dark theme styling
|
|
271
|
+
|
|
272
|
+
Size properties (Standard, Stacked, Overlay):
|
|
273
|
+
- `isHeightSmall` - Reduced height variant
|
|
274
|
+
- `isHeightFull` - Full viewport height
|
|
275
|
+
|
|
276
|
+
Layout properties (Standard, Overlay):
|
|
277
|
+
- `isTextCenter` - Center-aligned text
|
|
278
|
+
- `isTextRight` - Right-aligned text
|
|
279
|
+
|
|
280
|
+
Theme properties (Logo):
|
|
281
|
+
- `isThemeLight` - Light theme variant
|
|
282
|
+
- `isThemeMaryland` - Maryland brand theme
|
|
283
|
+
|
|
284
|
+
Unique properties:
|
|
285
|
+
- `isWidthLarge` (Stacked) - Extended width layout
|
|
286
|
+
- `hasBorder`, `isTransparent`, `isSticky` (Overlay) - Styling options
|
|
287
|
+
- `expandedContent` (Expand) - Hidden content section
|
|
288
|
+
- `blocks` (Grid) - Array of content blocks
|
|
289
|
+
- `videoControls` (Video Arrow) - Show video controls
|
|
290
|
+
|
|
291
|
+
### Layout Elements
|
|
292
|
+
|
|
293
|
+
Elements specifically designed for controlling page layout:
|
|
294
|
+
|
|
295
|
+
```javascript
|
|
296
|
+
import { Layout } from '@universityofmaryland/web-elements-library';
|
|
297
|
+
|
|
298
|
+
const imageLayout = Layout.image({
|
|
299
|
+
image: document.querySelector('img'),
|
|
300
|
+
align: 'left'
|
|
301
|
+
});
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### Model Elements
|
|
305
|
+
|
|
306
|
+
Elements for creating and interacting with the component model:
|
|
307
|
+
|
|
308
|
+
```javascript
|
|
309
|
+
import { Model } from '@universityofmaryland/web-elements-library';
|
|
310
|
+
|
|
311
|
+
// Create model elements
|
|
312
|
+
const actionElement = Model.elements.actions({ url: '#', text: 'Click' });
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
### Utilities
|
|
316
|
+
|
|
317
|
+
Helper functions for working with elements:
|
|
318
|
+
|
|
319
|
+
```javascript
|
|
320
|
+
import { Utilities } from '@universityofmaryland/web-elements-library';
|
|
321
|
+
|
|
322
|
+
// Accessibility utilities
|
|
323
|
+
Utilities.accessibility.focusable(element);
|
|
324
|
+
|
|
325
|
+
// DOM manipulation
|
|
326
|
+
Utilities.markup.create.element('div', { class: 'container' });
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
## Element Structure
|
|
330
|
+
|
|
331
|
+
Most elements return an object with the following properties:
|
|
332
|
+
|
|
333
|
+
```javascript
|
|
334
|
+
{
|
|
335
|
+
element: HTMLElement, // The DOM element
|
|
336
|
+
styles: string, // CSS styles associated with the element
|
|
337
|
+
update: Function, // Method to update element properties
|
|
338
|
+
destroy: Function, // Method to clean up and remove element
|
|
339
|
+
// Other element-specific properties
|
|
340
|
+
}
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
Example of using the update method:
|
|
344
|
+
|
|
345
|
+
```javascript
|
|
346
|
+
const button = Atomic.buttons.primary({
|
|
347
|
+
text: 'Learn More',
|
|
348
|
+
url: '#'
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
// Update properties later
|
|
352
|
+
button.update({
|
|
353
|
+
text: 'View Details',
|
|
354
|
+
isDisabled: true
|
|
355
|
+
});
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
## Browser Support
|
|
359
|
+
|
|
360
|
+
This library supports all modern browsers, including:
|
|
361
|
+
- Chrome
|
|
362
|
+
- Firefox
|
|
363
|
+
- Safari
|
|
364
|
+
- Edge
|
|
365
|
+
|
|
366
|
+
## Performance Considerations
|
|
367
|
+
|
|
368
|
+
The Elements library is designed with performance in mind:
|
|
369
|
+
- Tree-shakable imports to reduce bundle size
|
|
370
|
+
- Optimized rendering through element reuse
|
|
371
|
+
- Minimal DOM operations for updates
|
|
372
|
+
- Efficient event handling patterns
|
|
373
|
+
|
|
374
|
+
## Accessibility
|
|
375
|
+
|
|
376
|
+
All elements are built with accessibility as a priority:
|
|
377
|
+
- WCAG 2.1 AA compliant
|
|
378
|
+
- Proper semantic markup
|
|
379
|
+
- ARIA attributes where appropriate
|
|
380
|
+
- Keyboard navigation support
|
|
381
|
+
- Focus management utilities
|
|
382
|
+
|
|
383
|
+
## Documentation
|
|
384
|
+
|
|
385
|
+
For complete documentation of all available elements and their options, see the [official UMD Design System documentation](https://umd-digital.github.io/design-system/).
|
|
386
|
+
|
|
387
|
+
## Testing
|
|
388
|
+
|
|
389
|
+
The Elements library includes comprehensive test coverage for all components. Tests are written using Jest and follow a consistent pattern:
|
|
390
|
+
|
|
391
|
+
### Running Tests
|
|
392
|
+
|
|
393
|
+
```bash
|
|
394
|
+
# Run all tests
|
|
395
|
+
npm test
|
|
396
|
+
|
|
397
|
+
# Run tests in watch mode
|
|
398
|
+
npm run test:watch
|
|
399
|
+
|
|
400
|
+
# Run tests with coverage
|
|
401
|
+
npm run test:coverage
|
|
402
|
+
|
|
403
|
+
# Run specific test file
|
|
404
|
+
npm test -- source/composite/__tests__/hero/standard.test.ts
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
### Test Structure
|
|
408
|
+
|
|
409
|
+
Tests are organized by component category and located in `__tests__` directories:
|
|
410
|
+
|
|
411
|
+
```
|
|
412
|
+
source/
|
|
413
|
+
├── composite/
|
|
414
|
+
│ └── __tests__/
|
|
415
|
+
│ ├── hero/
|
|
416
|
+
│ │ ├── standard.test.ts
|
|
417
|
+
│ │ ├── minimal.test.ts
|
|
418
|
+
│ │ ├── stacked.test.ts
|
|
419
|
+
│ │ ├── overlay.test.ts
|
|
420
|
+
│ │ ├── logo.test.ts
|
|
421
|
+
│ │ └── custom/
|
|
422
|
+
│ │ ├── expand.test.ts
|
|
423
|
+
│ │ ├── grid.test.ts
|
|
424
|
+
│ │ └── video-arrow.test.ts
|
|
425
|
+
│ ├── card/
|
|
426
|
+
│ │ ├── block.test.ts
|
|
427
|
+
│ │ ├── list.test.ts
|
|
428
|
+
│ │ └── overlay.test.ts
|
|
429
|
+
│ └── types/
|
|
430
|
+
│ ├── hero-types.test.ts
|
|
431
|
+
│ └── card-types.test.ts
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
### Writing Tests
|
|
435
|
+
|
|
436
|
+
When adding new elements, include tests that cover:
|
|
437
|
+
|
|
438
|
+
1. **Basic Structure** - Element creation with minimal props
|
|
439
|
+
2. **Content Properties** - All content variations
|
|
440
|
+
3. **Asset Properties** - Image and video handling
|
|
441
|
+
4. **Animation Properties** - Animation flags and behaviors
|
|
442
|
+
5. **Theme Properties** - Theme variations
|
|
443
|
+
6. **Edge Cases** - Null/undefined handling
|
|
444
|
+
7. **Type Safety** - TypeScript interface compliance
|
|
445
|
+
|
|
446
|
+
Example test pattern:
|
|
447
|
+
|
|
448
|
+
```javascript
|
|
449
|
+
import { Composite } from '@universityofmaryland/web-elements-library';
|
|
450
|
+
import type { HeroStandardProps } from '../../hero/_types';
|
|
451
|
+
|
|
452
|
+
describe('Hero Standard Component', () => {
|
|
453
|
+
beforeEach(() => {
|
|
454
|
+
jest.clearAllMocks();
|
|
455
|
+
});
|
|
456
|
+
|
|
457
|
+
it('should create a standard hero with minimal props', () => {
|
|
458
|
+
const props: HeroStandardProps = {
|
|
459
|
+
isThemeDark: true
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
const result = Composite.hero.standard(props);
|
|
463
|
+
|
|
464
|
+
expect(result).toBeDefined();
|
|
465
|
+
expect(result.element).toBeInstanceOf(HTMLElement);
|
|
466
|
+
expect(typeof result.styles).toBe('string');
|
|
467
|
+
});
|
|
468
|
+
});
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
## TypeScript Support
|
|
472
|
+
|
|
473
|
+
The library is written in TypeScript and provides comprehensive type definitions for all elements:
|
|
474
|
+
|
|
475
|
+
### Import Types
|
|
476
|
+
|
|
477
|
+
```typescript
|
|
478
|
+
import type {
|
|
479
|
+
HeroStandardProps,
|
|
480
|
+
HeroMinimalProps,
|
|
481
|
+
HeroStackedProps,
|
|
482
|
+
HeroOverlayProps,
|
|
483
|
+
HeroLogoProps,
|
|
484
|
+
HeroGridProps,
|
|
485
|
+
HeroExpandProps,
|
|
486
|
+
HeroVideoArrowProps,
|
|
487
|
+
CardBlockProps,
|
|
488
|
+
CardListProps,
|
|
489
|
+
CardOverlayProps
|
|
490
|
+
} from '@universityofmaryland/web-elements-library';
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
### Type Safety
|
|
494
|
+
|
|
495
|
+
All element functions are strictly typed to ensure proper usage:
|
|
496
|
+
|
|
497
|
+
```typescript
|
|
498
|
+
// TypeScript will enforce required properties
|
|
499
|
+
const hero: HeroStandardProps = {
|
|
500
|
+
headline: document.createElement('h1'),
|
|
501
|
+
// isThemeDark is optional with boolean type
|
|
502
|
+
isThemeDark: true
|
|
503
|
+
};
|
|
504
|
+
|
|
505
|
+
// Type error if invalid property is provided
|
|
506
|
+
const invalidHero: HeroStandardProps = {
|
|
507
|
+
headline: document.createElement('h1'),
|
|
508
|
+
invalidProp: true // TypeScript error
|
|
509
|
+
};
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
## Contributing
|
|
513
|
+
|
|
514
|
+
For contribution guidelines, please refer to the main repository README.
|
|
515
|
+
|
|
516
|
+
## License
|
|
517
|
+
|
|
518
|
+
This project is licensed under the University of Maryland license.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-test.example.d.ts","sourceRoot":"","sources":["../../../source/__tests__/examples/component-test.example.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export declare const testContent: {
|
|
2
|
+
text: {
|
|
3
|
+
headline: string;
|
|
4
|
+
subheadline: string;
|
|
5
|
+
eyebrow: string;
|
|
6
|
+
description: string;
|
|
7
|
+
longDescription: string;
|
|
8
|
+
cta: string;
|
|
9
|
+
};
|
|
10
|
+
urls: {
|
|
11
|
+
internal: string;
|
|
12
|
+
external: string;
|
|
13
|
+
anchor: string;
|
|
14
|
+
image: string;
|
|
15
|
+
video: string;
|
|
16
|
+
document: string;
|
|
17
|
+
};
|
|
18
|
+
media: {
|
|
19
|
+
image: {
|
|
20
|
+
src: string;
|
|
21
|
+
alt: string;
|
|
22
|
+
srcset: string;
|
|
23
|
+
};
|
|
24
|
+
video: {
|
|
25
|
+
src: string;
|
|
26
|
+
poster: string;
|
|
27
|
+
sources: {
|
|
28
|
+
src: string;
|
|
29
|
+
type: string;
|
|
30
|
+
}[];
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
person: {
|
|
34
|
+
name: string;
|
|
35
|
+
title: string;
|
|
36
|
+
description: string;
|
|
37
|
+
email: string;
|
|
38
|
+
phone: string;
|
|
39
|
+
image: string;
|
|
40
|
+
link: string;
|
|
41
|
+
};
|
|
42
|
+
event: {
|
|
43
|
+
title: string;
|
|
44
|
+
date: Date;
|
|
45
|
+
location: string;
|
|
46
|
+
description: string;
|
|
47
|
+
link: string;
|
|
48
|
+
};
|
|
49
|
+
lists: {
|
|
50
|
+
links: {
|
|
51
|
+
text: string;
|
|
52
|
+
url: string;
|
|
53
|
+
}[];
|
|
54
|
+
items: string[];
|
|
55
|
+
social: {
|
|
56
|
+
platform: string;
|
|
57
|
+
url: string;
|
|
58
|
+
}[];
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
export default testContent;
|
|
62
|
+
//# sourceMappingURL=content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../source/__tests__/fixtures/content.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwEvB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export declare function createContainer(className?: string): HTMLElement;
|
|
2
|
+
export declare function createCardStructure(): {
|
|
3
|
+
container: HTMLElement;
|
|
4
|
+
image: HTMLImageElement;
|
|
5
|
+
content: HTMLElement;
|
|
6
|
+
headline: HTMLElement;
|
|
7
|
+
description: HTMLElement;
|
|
8
|
+
link: HTMLAnchorElement;
|
|
9
|
+
};
|
|
10
|
+
export declare function createHeroStructure(): {
|
|
11
|
+
container: HTMLElement;
|
|
12
|
+
background: HTMLElement;
|
|
13
|
+
content: HTMLElement;
|
|
14
|
+
headline: HTMLElement;
|
|
15
|
+
subheadline: HTMLElement;
|
|
16
|
+
description: HTMLElement;
|
|
17
|
+
cta: HTMLAnchorElement;
|
|
18
|
+
};
|
|
19
|
+
export declare function createListStructure(itemCount?: number): {
|
|
20
|
+
container: HTMLElement;
|
|
21
|
+
items: HTMLElement[];
|
|
22
|
+
};
|
|
23
|
+
export declare function createMediaStructure(type?: 'image' | 'video'): {
|
|
24
|
+
container: HTMLElement;
|
|
25
|
+
media: HTMLImageElement | HTMLVideoElement;
|
|
26
|
+
caption: HTMLElement;
|
|
27
|
+
};
|
|
28
|
+
export declare function createNavStructure(): {
|
|
29
|
+
nav: HTMLElement;
|
|
30
|
+
list: HTMLElement;
|
|
31
|
+
items: HTMLCollection;
|
|
32
|
+
};
|
|
33
|
+
export declare function createFormStructure(): {
|
|
34
|
+
form: HTMLFormElement;
|
|
35
|
+
input: HTMLInputElement;
|
|
36
|
+
button: HTMLButtonElement;
|
|
37
|
+
};
|
|
38
|
+
declare const _default: {
|
|
39
|
+
createContainer: typeof createContainer;
|
|
40
|
+
createCardStructure: typeof createCardStructure;
|
|
41
|
+
createHeroStructure: typeof createHeroStructure;
|
|
42
|
+
createListStructure: typeof createListStructure;
|
|
43
|
+
createMediaStructure: typeof createMediaStructure;
|
|
44
|
+
createNavStructure: typeof createNavStructure;
|
|
45
|
+
createFormStructure: typeof createFormStructure;
|
|
46
|
+
};
|
|
47
|
+
export default _default;
|
|
48
|
+
//# sourceMappingURL=elements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../../source/__tests__/fixtures/elements.ts"],"names":[],"mappings":"AASA,wBAAgB,eAAe,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,WAAW,CAK/D;AAKD,wBAAgB,mBAAmB;;;;;;;EAgBlC;AAKD,wBAAgB,mBAAmB;;;;;;;;EAkBlC;AAKD,wBAAgB,mBAAmB,CAAC,SAAS,GAAE,MAAU;;;EAaxD;AAKD,wBAAgB,oBAAoB,CAAC,IAAI,GAAE,OAAO,GAAG,OAAiB;;;;EAWrE;AAKD,wBAAgB,kBAAkB;;;;EAmBjC;AAKD,wBAAgB,mBAAmB;;;;EAoBlC;;;;;;;;;;AAED,wBAQE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ContentElement, ElementModel } from '../../_types';
|
|
2
|
+
export interface TestElementConfig {
|
|
3
|
+
element?: HTMLElement;
|
|
4
|
+
className?: string;
|
|
5
|
+
styles?: string;
|
|
6
|
+
attributes?: Record<string, string>;
|
|
7
|
+
}
|
|
8
|
+
export declare function createElement(tagName?: string, content?: string, attributes?: Record<string, string>): HTMLElement;
|
|
9
|
+
export declare function createContentElement(tagName?: string, content?: string): ContentElement;
|
|
10
|
+
export declare function createImageElement(src?: string, alt?: string): HTMLImageElement;
|
|
11
|
+
export declare function createVideoElement(src?: string): HTMLVideoElement;
|
|
12
|
+
export declare function createLinkElement(href?: string, text?: string): HTMLAnchorElement;
|
|
13
|
+
export declare function validateElementStructure(result: any, expectedConfig: {
|
|
14
|
+
hasElement?: boolean;
|
|
15
|
+
hasStyles?: boolean;
|
|
16
|
+
className?: string;
|
|
17
|
+
tagName?: string;
|
|
18
|
+
}): void;
|
|
19
|
+
export declare function getChildByClass(parent: HTMLElement, className: string): HTMLElement | null;
|
|
20
|
+
export declare function countChildren(parent: HTMLElement): number;
|
|
21
|
+
export declare function containsText(element: HTMLElement, text: string): boolean;
|
|
22
|
+
export declare function createMockElementModel(config?: TestElementConfig): ElementModel;
|
|
23
|
+
//# sourceMappingURL=element.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../../../source/__tests__/helpers/element.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjE,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC;AAKD,wBAAgB,aAAa,CAC3B,OAAO,GAAE,MAAc,EACvB,OAAO,CAAC,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAClC,WAAW,CAcb;AAKD,wBAAgB,oBAAoB,CAClC,OAAO,GAAE,MAAY,EACrB,OAAO,CAAC,EAAE,MAAM,GACf,cAAc,CAGhB;AAKD,wBAAgB,kBAAkB,CAChC,GAAG,GAAE,MAAmB,EACxB,GAAG,GAAE,MAAqB,GACzB,gBAAgB,CAKlB;AAKD,wBAAgB,kBAAkB,CAAC,GAAG,GAAE,MAAmB,GAAG,gBAAgB,CAI7E;AAKD,wBAAgB,iBAAiB,CAC/B,IAAI,GAAE,MAAY,EAClB,IAAI,GAAE,MAAoB,GACzB,iBAAiB,CAKnB;AAKD,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,GAAG,EACX,cAAc,EAAE;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GACA,IAAI,CAsBN;AAKD,wBAAgB,eAAe,CAC7B,MAAM,EAAE,WAAW,EACnB,SAAS,EAAE,MAAM,GAChB,WAAW,GAAG,IAAI,CAEpB;AAKD,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAEzD;AAKD,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAExE;AAKD,wBAAgB,sBAAsB,CACpC,MAAM,GAAE,iBAAsB,GAC7B,YAAY,CAKd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/__tests__/helpers/index.ts"],"names":[],"mappings":"AAKA,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../source/__tests__/helpers/setup.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jest.setup.d.ts","sourceRoot":"","sources":["../../source/__tests__/jest.setup.ts"],"names":[],"mappings":"AAMA,OAAO,iBAAiB,CAAC;AAOzB,OAAO,CAAC,MAAM,CAAC;IACb,MAAM,SAAS,EAAE,cAAc,SAAS,CAAC,CAAC;IAC1C,MAAM,WAAW,EAAE,cAAc,WAAW,CAAC,CAAC;CAC/C"}
|