Skip to content

Commit

Permalink
Table molecule (#131)
Browse files Browse the repository at this point in the history
* added table molecule

* updated versions

* review changes

* updated typography

* added review changes

* updated breadcrumb

* updated otpinput

* updated accordion

* added intermediate state for checkbox

* updated icon css in hamburger

* added metric card component

* updated table molecule props

* added accessor for headerData

* updated formcard

* added review changes
  • Loading branch information
Swathi-eGov authored Sep 26, 2024
1 parent 579ea81 commit 5e77e15
Show file tree
Hide file tree
Showing 64 changed files with 7,196 additions and 257 deletions.
4 changes: 4 additions & 0 deletions react/css/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [0.0.2-beta.36] - 2024-09-23
### Changed
- Added Table css

## [0.0.2-beta.35] - 2024-09-19
### Changed
- Added OTPInput css
Expand Down
2 changes: 1 addition & 1 deletion react/css/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-components-css",
"version": "0.0.2-beta.35",
"version": "0.0.2-beta.36",
"license": "MIT",
"main": "dist/index.css",
"author": "Jagankumar <jagan.kumar@egovernments.org>",
Expand Down
38 changes: 38 additions & 0 deletions react/css/src/digitv2/components/accordionV2.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,25 @@

.digit-accordion-number {
@extend .typography.heading-s;
font-family: theme(digitv2.fontFamily.sans);
font-style: theme(digitv2.fontStyle.normal);
font-weight: theme(digitv2.fontWeight.bold);
line-height: theme(digitv2.lineHeight.lineheight1);

@media (max-aspect-ratio: 9/16) {
/* Media query for mobile */
font-size: theme(digitv2.fontSize.heading-s.mobile);
}

@media (min-aspect-ratio: 9/16) and (max-aspect-ratio: 3/4) {
/* Media query for tablets */
font-size: theme(digitv2.fontSize.heading-s.tablet);
}

@media (min-aspect-ratio: 3/4) {
/* Media query for desktop */
font-size: theme(digitv2.fontSize.heading-s.desktop);
}
color: theme(digitv2.lightTheme.text-primary);
min-width: theme(digitv2.spacers.spacer6);
height: theme(digitv2.spacers.spacer6);
Expand All @@ -36,6 +55,25 @@

.digit-accordion-header-title {
@extend .typography.heading-s;
font-family: theme(digitv2.fontFamily.sans);
font-style: theme(digitv2.fontStyle.normal);
font-weight: theme(digitv2.fontWeight.bold);
line-height: theme(digitv2.lineHeight.lineheight1);

@media (max-aspect-ratio: 9/16) {
/* Media query for mobile */
font-size: theme(digitv2.fontSize.heading-s.mobile);
}

@media (min-aspect-ratio: 9/16) and (max-aspect-ratio: 3/4) {
/* Media query for tablets */
font-size: theme(digitv2.fontSize.heading-s.tablet);
}

@media (min-aspect-ratio: 3/4) {
/* Media query for desktop */
font-size: theme(digitv2.fontSize.heading-s.desktop);
}
color: theme(digitv2.lightTheme.text-primary);
margin-top: 0.18rem;
flex-grow: 1;
Expand Down
31 changes: 29 additions & 2 deletions react/css/src/digitv2/components/checkboxV2.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,18 @@
@apply opacity-0;
}

svg{
svg {
flex-shrink: 0;
}

&:hover {
@apply border-2 ;
@apply border-2;
border-color: theme(digitv2.lightTheme.primary-1);
}

&.intermediate {
border: 0.125rem solid theme(digitv2.lightTheme.primary-1);
}
}

.digit-custom-checkbox-emp {
Expand All @@ -45,6 +49,10 @@
border-color: theme(digitv2.lightTheme.primary-1);
}

input:hover~.digit-custom-checkbox.intermediate{
border: 0.125rem solid theme(digitv2.lightTheme.primary-1);
}

input:checked~.digit-custom-checkbox {
border: 0.125rem solid theme(digitv2.lightTheme.primary-1);
}
Expand All @@ -60,6 +68,13 @@
height: theme(digitv2.spacers.spacer4);
}

.intermediate-square {
width: theme(digitv2.spacers.spacer4);
height: theme(digitv2.spacers.spacer4);
background-color: theme(digitv2.lightTheme.primary-1);
display: block;
}

.label {
@extend .typography.body-s;
font-family: theme(digitv2.fontFamily.sans);
Expand All @@ -81,6 +96,7 @@
/* Media query for desktop */
font-size: theme(digitv2.fontSize.body-s.desktop);
}

@apply text-left;
word-break: break-word;
letter-spacing: theme(digitv2.spacers.spacer0);
Expand All @@ -97,5 +113,16 @@
input:checked~.digit-custom-checkbox {
border: 0.125rem solid theme(digitv2.lightTheme.text-disabled);
}

.digit-custom-checkbox.intermediate{
border: 0.125rem solid theme(digitv2.lightTheme.text-disabled);
}

.intermediate-square {
width: theme(digitv2.spacers.spacer4);
height: theme(digitv2.spacers.spacer4);
background-color: theme(digitv2.lightTheme.text-disabled);
display: block;
}
}
}
202 changes: 202 additions & 0 deletions react/css/src/digitv2/components/formCardV2.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
.digit-form-card{
width: 100%;
max-width: 100%;
height: fit-content;
background-color: theme(digitv2.lightTheme.paper-primary);
display: flex;
flex-direction: column;

.digit-form-card-header {
@apply flex-col;
display: flex !important;
gap: theme(digitv2.spacers.spacer4);

&.with-shadow {
box-shadow: theme(digitv2.spacers.spacer0) 0.063rem 0.125rem theme(digitv2.spacers.spacer0) #00000026;
}

@media (min-width: 48rem) {
padding: theme(digitv2.spacers.spacer6);
padding-bottom: theme(digitv2.spacers.spacer0);

&.with-shadow {
padding-bottom: theme(digitv2.spacers.spacer6);
}
}

@media (min-width: 30.063rem) and (max-width: 47.938rem) {
padding: theme(digitv2.spacers.spacer5);
padding-bottom: theme(digitv2.spacers.spacer0);

&.with-shadow {
padding-bottom: theme(digitv2.spacers.spacer5);
}
}

@media (max-width: 30rem) {
padding: theme(digitv2.spacers.spacer4);
padding-bottom: theme(digitv2.spacers.spacer0);

&.with-shadow {
padding-bottom: theme(digitv2.spacers.spacer4);
}
}

}

.digit-form-card-content {
@extend .typography.body-s;
position: relative;
font-family: theme(digitv2.fontFamily.sans);
font-style: theme(digitv2.fontStyle.normal);
font-weight: theme(digitv2.fontWeight.regular);
line-height: theme(digitv2.lineHeight.lineheight2);

@media (max-aspect-ratio: 9/16) {
/* Media query for mobile */
font-size: theme(digitv2.fontSize.body-s.mobile);
}

@media (min-aspect-ratio: 9/16) and (max-aspect-ratio: 3/4) {
/* Media query for tablets */
font-size: theme(digitv2.fontSize.body-s.tablet);
}

@media (min-aspect-ratio: 3/4) {
/* Media query for desktop */
font-size: theme(digitv2.fontSize.body-s.desktop);
}
@apply overflow-hidden overflow-y-auto flex-col;
display: flex;
flex: 1;
color: theme(digitv2.lightTheme.text-primary);

&.inline {
flex-direction: row;
}

@media (min-width: 48rem) {
gap: theme(digitv2.spacers.spacer6);
padding: theme(digitv2.spacers.spacer6) theme(digitv2.spacers.spacer6) theme(digitv2.spacers.spacer0) theme(digitv2.spacers.spacer6);

&.with-shadow,
&.without-footer{
padding: theme(digitv2.spacers.spacer6);
}

}

@media (min-width: 30.063rem) and (max-width: 47.938rem) {
gap: theme(digitv2.spacers.spacer5);
padding: theme(digitv2.spacers.spacer5) theme(digitv2.spacers.spacer5) theme(digitv2.spacers.spacer0) theme(digitv2.spacers.spacer5);

&.with-shadow,
&.without-footer{
padding: theme(digitv2.spacers.spacer5);
}

}

@media (max-width: 30rem) {
gap: theme(digitv2.spacers.spacer4);
padding: theme(digitv2.spacers.spacer4) theme(digitv2.spacers.spacer4) theme(digitv2.spacers.spacer0) theme(digitv2.spacers.spacer4);

&.with-shadow,
&.without-footer{
padding: theme(digitv2.spacers.spacer4);
}
}

.digit-label-field-pair {
margin-bottom: unset;
}

.digit-radio-options-wrap {
margin-bottom: unset;
}
}

.digit-form-card-footer {
@apply flex-wrap;
display: flex;
gap: theme(digitv2.spacers.spacer4);

&.with-shadow {
box-shadow: theme(digitv2.spacers.spacer0) -0.063rem 0.125rem theme(digitv2.spacers.spacer0) #00000026;
}

@media (min-width: 48rem) {
padding: theme(digitv2.spacers.spacer6);
}

@media (min-width: 30.063rem) and (max-width: 47.938rem) {
@apply w-full;
padding: theme(digitv2.spacers.spacer5);
}

@media (max-width: 30rem) {
@apply flex-col;
padding: theme(digitv2.spacers.spacer4);
}


.digit-form-card-buttons {
margin-left: auto;
display: flex;
gap: theme(digitv2.spacers.spacer4);
@apply max-w-full flex-wrap;

@media (min-width: 30.063rem) and (max-width: 47.938rem) {
@apply w-full;

button {
flex: 1;
}
}

@media (max-width: 30rem) {
@apply flex-col;
margin: theme(digitv2.spacers.spacer0);

button {
width: 100%;
}
}

&.equal-buttons{
width: 100%;

@media (min-width: 30.063rem) {

button {
flex: 1;
}
}
}
}
}

.vertical-formcard-divider{
position: absolute;

@media (max-aspect-ratio: 9/16) {
/* Media query for mobile */
top: theme(digitv2.spacers.spacer4);
height: calc(100% - 2rem);
}

@media (min-aspect-ratio: 9/16) and (max-aspect-ratio: 3/4) {
/* Media query for tablets */
top: theme(digitv2.spacers.spacer5);
height: calc(100% - 2.5rem);
}

@media (min-aspect-ratio: 3/4) {
/* Media query for desktop */
top: theme(digitv2.spacers.spacer6);
height: calc(100% - 3rem);
}
border: 0.063rem solid theme(digitv2.lightTheme.generic-divider);
z-index: 1;
}
}
Loading

0 comments on commit 5e77e15

Please sign in to comment.