Skip to content

Commit

Permalink
storybook fixes (#146)
Browse files Browse the repository at this point in the history
* storybook fixes

* Update react/ui-components/src/atoms/stories/Accordion.stories.js

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Jagankumar <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 6, 2024
1 parent 61454c7 commit 104b863
Show file tree
Hide file tree
Showing 33 changed files with 1,524 additions and 984 deletions.
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.40",
"version": "0.0.2-beta.41",
"license": "MIT",
"main": "dist/index.css",
"author": "Jagankumar <[email protected]>",
Expand Down
8 changes: 6 additions & 2 deletions react/css/src/digitv2/components/accordionV2.scss
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
}

&.withDivider {
.digit-accordion-content {
.digit-accordion-content.open{
border-top: 1px solid theme(digitv2.lightTheme.generic-divider);
}
}
Expand All @@ -149,7 +149,11 @@
}

&.cardBg {
background-color: theme(digitv2.lightTheme.paper-secondary);
background-color: theme(digitv2.lightTheme.paper-primary);

&.nested {
background-color: theme(digitv2.lightTheme.paper-secondary);
}
}
}

Expand Down
1 change: 1 addition & 0 deletions react/css/src/digitv2/components/bottomSheetV2.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
overflow-y: scroll;
display: flex;
flex-direction: column;
height: 100%;

@media (max-aspect-ratio: 9/16) {
gap: theme(digitv2.spacers.spacer4);
Expand Down
2 changes: 1 addition & 1 deletion react/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"build": "webpack --mode production"
},
"dependencies": {
"@egovernments/digit-ui-components": "0.0.2-beta.50",
"@egovernments/digit-ui-components": "0.0.2-beta.51",
"@egovernments/digit-ui-libraries": "1.8.2-beta.1",
"@egovernments/digit-ui-module-common": "1.7.10",
"@egovernments/digit-ui-module-core": "1.8.1-beta.6",
Expand Down
2 changes: 1 addition & 1 deletion react/example/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
rel='stylesheet' type='text/css'>
<link
rel="stylesheet"
href="https://unpkg.com/@egovernments/[email protected].40/dist/index.css"
href="https://unpkg.com/@egovernments/[email protected].41/dist/index.css"
/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#00bcd1" />
Expand Down
2 changes: 1 addition & 1 deletion react/modules/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"prepublish": "yarn build"
},
"dependencies": {
"@egovernments/digit-ui-components": "0.0.2-beta.50",
"@egovernments/digit-ui-components": "0.0.2-beta.51",
"@egovernments/digit-ui-react-components": "1.8.1-beta.4",
"react": "17.0.2",
"react-dom": "17.0.2",
Expand Down
2 changes: 1 addition & 1 deletion react/modules/sample/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"dependencies": {
"@egovernments/digit-ui-react-components": "1.8.1-beta.4",
"@egovernments/digit-ui-components": "0.0.2-beta.50",
"@egovernments/digit-ui-components": "0.0.2-beta.51",
"react": "17.0.2",
"react-date-range": "^1.4.0",
"react-dom": "17.0.2",
Expand Down
4 changes: 2 additions & 2 deletions react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@
"@babel/plugin-syntax-jsx": "^7.24.1",
"@babel/preset-react": "^7.24.1",
"@egovernments/digit-ui-libraries": "1.8.2-beta.1",
"@egovernments/digit-ui-components-css":"0.0.2-beta.40",
"@egovernments/digit-ui-components-css":"0.0.2-beta.41",
"@egovernments/digit-ui-module-core": "1.8.1-beta.6",
"@egovernments/digit-ui-module-project": "0.3.4",
"@egovernments/digit-ui-module-sample": "0.0.1",
"@egovernments/digit-ui-react-components": "1.7.10",
"@egovernments/digit-ui-svg-components": "1.0.12",
"@egovernments/digit-ui-components": "0.0.2-beta.50",
"@egovernments/digit-ui-components": "0.0.2-beta.51",
"babel-loader": "8.1.0",
"clean-webpack-plugin": "4.0.0",
"css-loader": "5.2.6",
Expand Down
2 changes: 1 addition & 1 deletion react/ui-components/.storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<head>
<!-- .storybook/preview-head.html -->
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected].40/dist/index.css"/>
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected].41/dist/index.css"/>
<!-- Pull in static files served from your Static directory or the internet -->
<!-- Example: `main.js|ts` is configured with staticDirs: ['../public'] and your font is located in the `fonts` directory inside your `public` directory -->
<link rel="preload" href="/fonts/my-font.woff2" />
Expand Down
4 changes: 4 additions & 0 deletions react/ui-components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.0.2-beta.51] - 2024-11-06
### New Changes
- ButtonsGroup has been renamed as ButtonGroup

## [0.0.2-beta.50] - 2024-10-29
### New Changes
- Updated Breadcrumb crumb.path property to crumb.internalLink or crumb.externalLink
Expand Down
2 changes: 1 addition & 1 deletion react/ui-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-components",
"version": "0.0.2-beta.50",
"version": "0.0.2-beta.51",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.modern.js",
Expand Down
2 changes: 1 addition & 1 deletion react/ui-components/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Web site created using create-react-app" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected].40/dist/index.css"/>
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected].41/dist/index.css"/>
<link rel="icon" href="https://egov-dev-assets.s3.ap-south-1.amazonaws.com/browser-icon.png" />
<style>
.custom-class path {
Expand Down
5 changes: 4 additions & 1 deletion react/ui-components/src/atoms/Accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const Accordion = ({
hideDivider,
hideCardBg,
hideBorderRadius,
isClosed
isClosed,
isChild
}) => {
const [isOpen, setIsOpen] = useState(isOpenInitially);

Expand All @@ -50,6 +51,8 @@ const Accordion = ({
!hideCardBg ? "cardBg" : ""
} ${!hideDivider && isOpen ? "withDivider" : ""} ${
hideDivider && isOpen ? "no-divider" : ""
} ${
isChild ? "nested" : ""
}`}
style={customStyles}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useRef, useEffect, useState } from "react";
import PropTypes from "prop-types";
import Button from "./Button";

const ButtonsGroup = ({ buttonsArray ,sortButtons}) => {
const ButtonGroup = ({ buttonsArray ,sortButtons}) => {
const [isMobileView, setIsMobileView] = React.useState(
window.innerWidth <= 480
);
Expand Down Expand Up @@ -32,13 +32,13 @@ const ButtonsGroup = ({ buttonsArray ,sortButtons}) => {
...buttonsArray.map((button) => button.props.label.length * 14.9)
);

const updatedButtonsArray = buttonsArray.map((button) => {
const updatedButtonsArray = buttonsArray && buttonsArray.length > 1 ? buttonsArray.map((button) => {
const buttonProps = {
...button.props,
style: { ...(button.props.style || {}), width: `${maxWidth}px` },
};
return <Button key={buttonProps.key} {...buttonProps} />;
});
}) : buttonsArray;

const resultArray = isMobileView ? buttonsArray : updatedButtonsArray;

Expand All @@ -63,10 +63,10 @@ const ButtonsGroup = ({ buttonsArray ,sortButtons}) => {
);
};

ButtonsGroup.propTypes = {
ButtonGroup.propTypes = {
buttonsArray: PropTypes.arrayOf(PropTypes.element).isRequired,
sortButtons:PropTypes.bool
};

export default ButtonsGroup;
export default ButtonGroup;

4 changes: 2 additions & 2 deletions react/ui-components/src/atoms/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ import TextBlock from "./TextBlock";
import Panels from "./Panels";
import Animation from "./Animation";
import ViewCardFieldPair from "./ViewCardFieldPair";
import ButtonsGroup from "./ButtonsGroup";
import ButtonGroup from "./ButtonGroup";
import Divider from "./Divider";
import TopBar from "./TopBar";
import Hamburger from "./Hamburger";
Expand Down Expand Up @@ -180,7 +180,7 @@ export {
Timeline,
ViewCardFieldPair,
Divider,
ButtonsGroup,
ButtonGroup,
StringManipulator,
InfoButton,
Uploader,
Expand Down
Loading

0 comments on commit 104b863

Please sign in to comment.