-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update test suite for twig 3 compatibility
- Loading branch information
Showing
9 changed files
with
218 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
--- | ||
id: accordion | ||
title: Accordion | ||
sidebar_label: Accordion | ||
--- | ||
|
||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
|
||
Show and hide sections of content. | ||
|
||
<div className="d-example"> | ||
<div id="accordionGroup" className="accordion"> | ||
<div className="accordion__panel"> | ||
<button type="button" aria-expanded="true" className="accordion__trigger" aria-controls="sect1" id="accordion1id" title="expand"></button> | ||
<h2 className="accordion__title" id="accordion1title">Section One</h2> | ||
<div id="sect1" role="region" aria-labelledby="accordion1title" className="accordion__content"> | ||
Content One | ||
</div> | ||
</div> | ||
<div className="accordion__panel"> | ||
<button type="button" className="accordion__trigger" aria-controls="sect2" id="accordion2id"></button> | ||
<h2 className="accordion__title" id="accordion2title">Section Two</h2> | ||
<div id="sect2" role="region" aria-labelledby="accordion2title" className="accordion__content"> | ||
Content Two | ||
</div> | ||
</div> | ||
<div className="accordion__panel"> | ||
<button type="button" className="accordion__trigger" aria-controls="sect3" id="accordion3id"></button> | ||
<h2 className="accordion__title" id="accordion3title">Section Three</h2> | ||
<div id="sect3" role="region" aria-labelledby="accordion3title" className="accordion__content"> | ||
Content Three | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
## Basic usage | ||
|
||
<Tabs | ||
groupID="example" | ||
defaultValue="html" | ||
values={[ | ||
{ label: 'HTML', value: 'html', }, | ||
] | ||
}> | ||
<TabItem value="html"> | ||
|
||
```html | ||
<div id="accordionGroup" className="accordion"> | ||
<div className="accordion__panel"> | ||
<button type="button" aria-expanded="true" className="accordion__trigger" aria-controls="sect1" id="accordion1id" title="expand"></button> | ||
<h2 className="accordion__title" id="accordion1title">Section One</h2> | ||
<div id="sect1" role="region" aria-labelledby="accordion1title" className="accordion__content"> | ||
Content One | ||
</div> | ||
</div> | ||
<div className="accordion__panel"> | ||
<button type="button" className="accordion__trigger" aria-controls="sect2" id="accordion2id"></button> | ||
<h2 className="accordion__title" id="accordion2title">Section Two</h2> | ||
<div id="sect2" role="region" aria-labelledby="accordion2title" className="accordion__content"> | ||
Content Two | ||
</div> | ||
</div> | ||
<div className="accordion__panel"> | ||
<button type="button" className="accordion__trigger" aria-controls="sect3" id="accordion3id"></button> | ||
<h2 className="accordion__title" id="accordion3title">Section Three</h2> | ||
<div id="sect3" role="region" aria-labelledby="accordion3title" className="accordion__content"> | ||
Content Three | ||
</div> | ||
</div> | ||
</div> | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
## Style variations | ||
|
||
### Bordered | ||
|
||
`.accordion--bordered` | ||
|
||
<div className="d-example"> | ||
<div id="accordionGroup" className="accordion accordion--bordered"> | ||
<div className="accordion__panel"> | ||
<button type="button" aria-expanded="true" className="accordion__trigger" aria-controls="sect4" id="accordion4id" title="expand"></button> | ||
<h2 className="accordion__title" id="accordion1title">Section One</h2> | ||
<div id="sect4" role="region" aria-labelledby="accordion4title" className="accordion__content"> | ||
<p>Content One</p> | ||
</div> | ||
</div> | ||
<div className="accordion__panel"> | ||
<button type="button" className="accordion__trigger" aria-controls="sect5" id="accordion5id"></button> | ||
<h2 className="accordion__title" id="accordion5title">Section Two</h2> | ||
<div id="sect5" role="region" aria-labelledby="accordion5title" className="accordion__content"> | ||
<p>Content Two</p> | ||
</div> | ||
</div> | ||
<div className="accordion__panel"> | ||
<button type="button" className="accordion__trigger" aria-controls="sect6" id="accordion6id"></button> | ||
<h2 className="accordion__title" id="accordion6title">Section Three</h2> | ||
<div id="sect6" role="region" aria-labelledby="accordion6title" className="accordion__content"> | ||
<p>Content Three</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* stylelint-disable docusaurus/copyright-header */ | ||
/** | ||
* Any CSS included here will be global. The classic template | ||
* bundles Infima by default. Infima is a CSS framework designed to | ||
* work well for content-centric websites. | ||
*/ | ||
|
||
$theme: 'dark' !default; | ||
|
||
.d-example, | ||
.d-example-inline, | ||
.d-guidelines { | ||
@import '../../../stylesheets/mixin.media-queries'; | ||
@import '../../../stylesheets/mixin.mixins-to-organise'; | ||
|
||
// Functions | ||
@import '../../../stylesheets/function.math'; | ||
@import '../../../stylesheets/function.color-luminance'; | ||
@import '../../../stylesheets/function.pick-best-color'; | ||
@import '../../../stylesheets/function.color'; | ||
|
||
// Config | ||
@import '../../../stylesheets/config.variables'; | ||
@import '../../../stylesheets/config.branding'; | ||
|
||
// Functions | ||
@import '../../../stylesheets/function.math'; | ||
@import '../../../stylesheets/function.color-luminance'; | ||
@import '../../../stylesheets/function.pick-best-color'; | ||
@import '../../../stylesheets/function.color'; | ||
|
||
// Base colour palette | ||
@import '../../../stylesheets/palette.base'; | ||
@import '../../../stylesheets/palette.dark'; | ||
@import '../../../stylesheets/palette.maps'; | ||
@import '../../../stylesheets/config.theme'; | ||
|
||
.bg--dark { | ||
background-color: color(background); | ||
|
||
code { | ||
background-color: color(background, light); | ||
border-color: rgba(255, 255, 255, .2); | ||
color: color(text); | ||
} | ||
} | ||
|
||
.swatch { | ||
@each $name, $palette in $colors { | ||
@each $variant, $value in $palette { | ||
&--#{'' + $name}-#{$variant} .swatch__chip--dark { | ||
background-color: color($name, $variant); | ||
color: pick_best_color(color($name, $variant), (#fff, #000)); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// /** | ||
// * Pulsar | ||
// * | ||
// * Core UI components that should always be present. | ||
// * | ||
// * Jadu Ltd. | ||
// */ | ||
|
||
// // Fixes issue with dependencies that expect both $ and jQuery to be set | ||
// window.jQuery = window.$ = require('jquery'); | ||
|
||
// // Global UI components | ||
// var $ = require('jquery'), | ||
// AccordionComponent = require('..//AccordionComponent'); | ||
|
||
// module.exports = { | ||
// AccordionComponent | ||
// }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
(function ($) { | ||
|
||
// Protect IE8 from any erroneous console.log uses which would break everything | ||
if (!window.console) { | ||
console = { log: function() {} } | ||
}; | ||
|
||
var $html = $('html'), | ||
lt10 = $html.hasClass('lt-ie10'); | ||
|
||
$html.removeClass('no-js'); | ||
|
||
pulsar.accordion = new pulsar.AccordionComponent($html); | ||
|
||
$(function () { | ||
console.log(pulsar); | ||
pulsar.accordion.init(); | ||
}); | ||
|
||
}(jQuery)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters