Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Commit 3d07722

Browse files
authored
Add Block definition for convenience. (#142)
1 parent 5269852 commit 3d07722

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/components.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ export const Alert: ComponentWithText = {
99
textQuery: 'div.alert',
1010
};
1111

12+
/// Fork of Block with identical styling & similar behavior, used by
13+
/// some projects that have adopted Gears. Included here as a convenience.
14+
export const Block: ComponentWithText = {
15+
name: 'Block',
16+
query: '.card',
17+
textQuery: '.card .card-title',
18+
traverseViaText: ($el: JQuery) => $el.closest('.card'),
19+
};
20+
21+
/// Canonical component from Gears design system.
1222
export const BlockPanel: ComponentWithText = {
1323
name: 'BlockPanel',
1424
query: '.card',
@@ -22,6 +32,8 @@ export const Button: ComponentWithText = {
2232
textQuery: 'button,a.btn',
2333
};
2434

35+
/// Functionally identical to Block, but semantically different according to
36+
/// the gears design system.
2537
export const Card: ComponentWithText = {
2638
name: 'Card',
2739
query: '.card',

0 commit comments

Comments
 (0)