Skip to content

Commit

Permalink
Start HTML and React examples for all components
Browse files Browse the repository at this point in the history
  • Loading branch information
eliot-akira committed Sep 26, 2024
1 parent 6456d1c commit b80904f
Show file tree
Hide file tree
Showing 136 changed files with 2,510 additions and 238 deletions.
14 changes: 14 additions & 0 deletions components/breadcrumb.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
.#{$class-prefix}breadcrumb-item {
// The separator between breadcrumbs (by default, a forward-slash: "/")
+ .#{$class-prefix}breadcrumb-item {
margin-top: 0;
padding-left: var(--#{$prefix}breadcrumb-item-padding-x);

&::before {
Expand All @@ -38,3 +39,16 @@
color: var(--#{$prefix}breadcrumb-item-active-color);
}
}

@if $enable-dark-mode {

$breadcrumb-divider-color-dark: $gray-600 !default;

@include color-mode(dark) {
.#{$class-prefix}breadcrumb-item
// The separator between breadcrumbs (by default, a forward-slash: "/")
+ .#{$class-prefix}breadcrumb-item::before {
color: $breadcrumb-divider-color-dark;
}
}
}
7 changes: 6 additions & 1 deletion components/forms/form-check.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@
// Check/radio
//

$form-check-margin-right: .35rem !default;

.#{$class-prefix}form-check {
display: block;
display: flex; // block;
min-height: $form-check-min-height;
padding-left: $form-check-padding-start;
margin-bottom: $form-check-margin-bottom;
align-items: center;

.#{$class-prefix}form-check-input {
float: left;
margin-left: $form-check-padding-start * -1;
margin-right: $form-check-margin-right;
}
}

Expand Down Expand Up @@ -51,6 +55,7 @@
&[type="radio"] {
// stylelint-disable-next-line property-disallowed-list
border-radius: $form-check-radio-border-radius;
margin-top: 0;
}

&:active {
Expand Down
110 changes: 0 additions & 110 deletions docs/generate.ts

This file was deleted.

38 changes: 38 additions & 0 deletions docs/lib/accordion.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<div class="accordion" id="accordionExample">
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
Accordion Item #1
</button>
</h2>
<div id="collapseOne" class="accordion-collapse collapse show" data-bs-parent="#accordionExample">
<div class="accordion-body">
<strong>This is the first item's accordion body.</strong> It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the <code>.accordion-body</code>, though the transition does limit overflow.
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
Accordion Item #2
</button>
</h2>
<div id="collapseTwo" class="accordion-collapse collapse" data-bs-parent="#accordionExample">
<div class="accordion-body">
<strong>This is the second item's accordion body.</strong> It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the <code>.accordion-body</code>, though the transition does limit overflow.
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
Accordion Item #3
</button>
</h2>
<div id="collapseThree" class="accordion-collapse collapse" data-bs-parent="#accordionExample">
<div class="accordion-body">
<strong>This is the third item's accordion body.</strong> It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the <code>.accordion-body</code>, though the transition does limit overflow.
</div>
</div>
</div>
</div>
98 changes: 98 additions & 0 deletions docs/lib/accordion.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
export default function AccordionExample({
prefix = 't-' // or ''
}) {
return (
<div className={`${prefix}accordion`} id='accordionExample'>
<div className={`${prefix}accordion-item`}>
<h2 className={`${prefix}accordion-header`}>
<button
className={`${prefix}accordion-button`}
type='button'
data-t-toggle='collapse'
data-t-target='#collapseOne'
aria-expanded='true'
aria-controls='collapseOne'
>
Accordion Item #1
</button>
</h2>
<div
id='collapseOne'
className={`${prefix}accordion-collapse ${prefix}collapse ${prefix}show`}
data-t-parent='#accordionExample'
>
<div className={`${prefix}accordion-body`}>
<strong>This is the first item's accordion body.</strong> It is
shown by default, until the collapse plugin adds the appropriate
classes that we use to style each element. These classes control the
overall appearance, as well as the showing and hiding via CSS
transitions. You can modify any of this with custom CSS or
overriding our default variables. It's also worth noting that just
about any HTML can go within the <code>.accordion-body</code>,
though the transition does limit overflow.
</div>
</div>
</div>
<div className={`${prefix}accordion-item`}>
<h2 className={`${prefix}accordion-header`}>
<button
className={`${prefix}accordion-button ${prefix}collapsed`}
type='button'
data-t-toggle='collapse'
data-t-target='#collapseTwo'
aria-expanded='false'
aria-controls='collapseTwo'
>
Accordion Item #2
</button>
</h2>
<div
id='collapseTwo'
className={`${prefix}accordion-collapse ${prefix}collapse`}
data-t-parent='#accordionExample'
>
<div className={`${prefix}accordion-body`}>
<strong>This is the second item's accordion body.</strong> It is
hidden by default, until the collapse plugin adds the appropriate
classes that we use to style each element. These classes control the
overall appearance, as well as the showing and hiding via CSS
transitions. You can modify any of this with custom CSS or
overriding our default variables. It's also worth noting that just
about any HTML can go within the <code>.accordion-body</code>,
though the transition does limit overflow.
</div>
</div>
</div>
<div className={`${prefix}accordion-item`}>
<h2 className={`${prefix}accordion-header`}>
<button
className={`${prefix}accordion-button ${prefix}collapsed`}
type='button'
data-t-toggle='collapse'
data-t-target='#collapseThree'
aria-expanded='false'
aria-controls='collapseThree'
>
Accordion Item #3
</button>
</h2>
<div
id='collapseThree'
className={`${prefix}accordion-collapse ${prefix}collapse`}
data-t-parent='#accordionExample'
>
<div className={`${prefix}accordion-body`}>
<strong>This is the third item's accordion body.</strong> It is
hidden by default, until the collapse plugin adds the appropriate
classes that we use to style each element. These classes control the
overall appearance, as well as the showing and hiding via CSS
transitions. You can modify any of this with custom CSS or
overriding our default variables. It's also worth noting that just
about any HTML can go within the <code>.accordion-body</code>,
though the transition does limit overflow.
</div>
</div>
</div>
</div>
)
}
24 changes: 24 additions & 0 deletions docs/lib/alerts.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<div class="alert alert-primary" role="alert">
A simple primary alert—check it out!
</div>
<div class="alert alert-secondary" role="alert">
A simple secondary alert—check it out!
</div>
<div class="alert alert-success" role="alert">
A simple success alert—check it out!
</div>
<div class="alert alert-danger" role="alert">
A simple danger alert—check it out!
</div>
<div class="alert alert-warning" role="alert">
A simple warning alert—check it out!
</div>
<div class="alert alert-info" role="alert">
A simple info alert—check it out!
</div>
<div class="alert alert-light" role="alert">
A simple light alert—check it out!
</div>
<div class="alert alert-dark" role="alert">
A simple dark alert—check it out!
</div>
32 changes: 32 additions & 0 deletions docs/lib/alerts.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
export default function AlertsExample({
prefix = 't-' // or ''
}) {
return (
<>
<div className={`${prefix}alert ${prefix}alert-primary`} role='alert'>
A simple primary alert—check it out!
</div>
<div className={`${prefix}alert ${prefix}alert-secondary`} role='alert'>
A simple secondary alert—check it out!
</div>
<div className={`${prefix}alert ${prefix}alert-success`} role='alert'>
A simple success alert—check it out!
</div>
<div className={`${prefix}alert ${prefix}alert-danger`} role='alert'>
A simple danger alert—check it out!
</div>
<div className={`${prefix}alert ${prefix}alert-warning`} role='alert'>
A simple warning alert—check it out!
</div>
<div className={`${prefix}alert ${prefix}alert-info`} role='alert'>
A simple info alert—check it out!
</div>
<div className={`${prefix}alert ${prefix}alert-light`} role='alert'>
A simple light alert—check it out!
</div>
<div className={`${prefix}alert ${prefix}alert-dark`} role='alert'>
A simple dark alert—check it out!
</div>
</>
)
}
8 changes: 8 additions & 0 deletions docs/lib/badge.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<span class="badge text-bg-primary">Primary</span>
<span class="badge text-bg-secondary">Secondary</span>
<span class="badge text-bg-success">Success</span>
<span class="badge text-bg-danger">Danger</span>
<span class="badge text-bg-warning">Warning</span>
<span class="badge text-bg-info">Info</span>
<span class="badge text-bg-light">Light</span>
<span class="badge text-bg-dark">Dark</span>
16 changes: 16 additions & 0 deletions docs/lib/badge.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export default function BadgesExample({
prefix = 't-' // or ''
}) {
return (
<>
<span className={`${prefix}badge ${prefix}text-bg-primary`}>Primary</span>
<span className={`${prefix}badge ${prefix}text-bg-secondary`}>Secondary</span>
<span className={`${prefix}badge ${prefix}text-bg-success`}>Success</span>
<span className={`${prefix}badge ${prefix}text-bg-danger`}>Danger</span>
<span className={`${prefix}badge ${prefix}text-bg-warning`}>Warning</span>
<span className={`${prefix}badge ${prefix}text-bg-info`}>Info</span>
<span className={`${prefix}badge ${prefix}text-bg-light`}>Light</span>
<span className={`${prefix}badge ${prefix}text-bg-dark`}>Dark</span>
</>
)
}
Loading

0 comments on commit b80904f

Please sign in to comment.