This repository has been archived by the owner on Aug 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ca71819
commit 2a0a3ba
Showing
15 changed files
with
1,894 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
...tors/frontend/micro-ui/web/micro-ui-internals/packages/components-core/.storybook/main.js
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,9 @@ | ||
module.exports = { | ||
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"], | ||
addons: ["@storybook/addon-links", "@storybook/addon-essentials"], | ||
docs: { | ||
autodocs: 'tag', | ||
}, | ||
titlePrefix: 'MyComponents', | ||
}; | ||
|
48 changes: 48 additions & 0 deletions
48
...s/frontend/micro-ui/web/micro-ui-internals/packages/components-core/.storybook/preview.js
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,48 @@ | ||
import '../src/index.css'; | ||
//👇 Configures Storybook to log the actions( onArchiveTask and onPinTask ) in the UI. | ||
/** @type { import('@storybook/react').Preview } */ | ||
|
||
|
||
export const globalTypes = { | ||
theme: { | ||
description: 'Global theme for components', | ||
defaultValue: 'light', | ||
toolbar: { | ||
// The label to show for this toolbar item | ||
title: 'Theme', | ||
icon: 'circlehollow', | ||
// Array of plain string values or MenuItem shape (see below) | ||
items: ['light', 'dark'], | ||
// Change title based on selected value | ||
dynamicTitle: true, | ||
}, | ||
}, | ||
}; | ||
|
||
const preview = { | ||
parameters: { | ||
actions: { argTypesRegex: "^on[A-Z].*" }, | ||
controls: { | ||
expanded: true , | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
backgrounds: { | ||
default: 'twitter', | ||
values: [ | ||
{ | ||
name: 'twitter', | ||
value: '#00aced', | ||
}, | ||
{ | ||
name: 'facebook', | ||
value: '#3b5998', | ||
}, | ||
], | ||
}, | ||
}, | ||
}; | ||
|
||
export default preview; |
79 changes: 79 additions & 0 deletions
79
...ors/frontend/micro-ui/web/micro-ui-internals/packages/components-core/README.md
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,79 @@ | ||
<!-- TODO: update this --> | ||
|
||
# digit-ui-components-core | ||
|
||
## Install | ||
|
||
```bash | ||
npm install --save @egovernments/digit-ui-components-core | ||
``` | ||
|
||
## Limitation | ||
|
||
```bash | ||
This Package is more specific to DIGIT-UI's can be used across mission's | ||
``` | ||
|
||
## Usage | ||
|
||
After adding the dependency make sure you have this dependency in | ||
|
||
```bash | ||
frontend/micro-ui/web/package.json | ||
``` | ||
|
||
```json | ||
"@egovernments/digit-ui-components-core":"0.0.1", | ||
``` | ||
|
||
then navigate to App.js | ||
|
||
```bash | ||
frontend/micro-ui/web/src/App.js | ||
``` | ||
|
||
# Syntax for importing any components | ||
|
||
```jsx | ||
import { SVG } from "@egovernments/digit-ui-components-core"; | ||
|
||
<SVG.Accessibility />; | ||
``` | ||
|
||
# Local Development | ||
Use Node 14 version | ||
|
||
Step 1 | ||
|
||
```bash | ||
yarn install | ||
``` | ||
|
||
Step 2 | ||
|
||
```bash | ||
yarn storybook | ||
``` | ||
|
||
|
||
# Changelog | ||
|
||
```bash | ||
0.0.1 base version | ||
``` | ||
|
||
## Published from DIGIT Core | ||
|
||
Digit Core Repo (https://github.com/egovernments/Core-Platform/tree/digit-ui-core) | ||
|
||
# Contributors | ||
|
||
[nabeelmd-egov] [anilsingha-eGov] [nipunarora-eGov] [jagankumar-egov] | ||
|
||
# Reference | ||
|
||
Home Page (https://unified-dev.digit.org/storybook/) | ||
|
||
## License | ||
|
||
MIT © [jagankumar-egov](https://github.com/jagankumar-egov) |
20 changes: 20 additions & 0 deletions
20
...ators/frontend/micro-ui/web/micro-ui-internals/packages/components-core/docker/Dockerfile
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 @@ | ||
FROM egovio/alpine-node-builder-14:yarn AS build | ||
RUN apk update && apk upgrade | ||
RUN apk add --no-cache git>2.30.0 | ||
ARG WORK_DIR | ||
WORKDIR /app | ||
ENV NODE_OPTIONS "--max-old-space-size=1792" | ||
|
||
COPY ${WORK_DIR} . | ||
|
||
#RUN node web/envs.js | ||
RUN yarn install \ | ||
&& yarn build-storybook | ||
|
||
FROM nginx:mainline-alpine | ||
ENV WORK_DIR=/var/storybook | ||
|
||
RUN mkdir -p ${WORK_DIR} | ||
|
||
COPY --from=build /app/dist-storybook ${WORK_DIR}/ | ||
COPY --from=build /app/docker/nginx.conf /etc/nginx/conf.d/default.conf |
12 changes: 12 additions & 0 deletions
12
...ators/frontend/micro-ui/web/micro-ui-internals/packages/components-core/docker/nginx.conf
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,12 @@ | ||
server | ||
{ | ||
listen 80; | ||
underscores_in_headers on; | ||
|
||
location /storybook | ||
{ | ||
root /var/; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /storybook/index.html; | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
accelerators/frontend/micro-ui/web/micro-ui-internals/packages/components-core/package.json
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,63 @@ | ||
{ | ||
"name": "@egovernments/digit-ui-components-core", | ||
"version": "0.0.1", | ||
"main": "dist/index.js", | ||
"module": "dist/index.modern.js", | ||
"source": "src/index.js", | ||
"engines": { | ||
"node": ">=14" | ||
}, | ||
"homepage": "https://unified-dev.digit.org/storybook/", | ||
"author": "Jagankumar <[email protected]>", | ||
"license": "MIT", | ||
"scripts": { | ||
"example": "cd example && npm run start", | ||
"build": "microbundle-crl --compress --no-sourcemap --format cjs", | ||
"start": "microbundle-crl watch --no-compress --format modern,cjs", | ||
"prepare": "yarn build", | ||
"predeploy": "cd example && yarn install && yarn run build", | ||
"deploy": "gh-pages -d example/build", | ||
"storybook": "start-storybook -p 6006 -s public", | ||
"build-storybook": "build-storybook -s public -o dist-storybook", | ||
"deploy-storybook": "npm run build-storybook && surge --project dist-storybook --domain svg-components-$npm_package_version.surge.sh" | ||
}, | ||
"peerDependencies": { | ||
"react": "17.0.2", | ||
"react-dom": "17.0.2" | ||
}, | ||
"devDependencies": { | ||
"@storybook/addon-actions": "6.4.20", | ||
"@storybook/addon-essentials": "6.4.20", | ||
"@storybook/addon-links": "6.4.20", | ||
"@storybook/node-logger": "6.4.20", | ||
"@storybook/preset-create-react-app": "3.2.0", | ||
"@storybook/react": "6.4.20", | ||
"babel-eslint": "10.1.0", | ||
"cross-env": "7.0.3", | ||
"husky": "7.0.4", | ||
"lint-staged": "12.3.7", | ||
"microbundle-crl": "0.13.11", | ||
"react": "17.0.2", | ||
"react-scripts": "^4.0.1", | ||
"react-dom": "17.0.2" | ||
}, | ||
"dependencies": { | ||
"@egovernments/digit-ui-svg-components":"0.0.2" | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"browserslist": { | ||
"production": [ | ||
">0.2%", | ||
"not dead", | ||
"not op_mini all" | ||
], | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] | ||
}, | ||
"keywords": ["digit","core","components","dpg"] | ||
} |
40 changes: 40 additions & 0 deletions
40
...ators/frontend/micro-ui/web/micro-ui-internals/packages/components-core/public/index.html
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,40 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
|
||
<meta charset="utf-8" /> | ||
<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="icon" href="https://egov-dev-assets.s3.ap-south-1.amazonaws.com/browser-icon.png" /> | ||
<style> | ||
.custom-class path { | ||
fill: orange; | ||
} | ||
|
||
.custom-class { | ||
border: 2px dotted blue; | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
<title>DIGIT Component StoryBook</title> | ||
</head> | ||
|
||
<body> | ||
<noscript>You need to enable JavaScript to run this app.</noscript> | ||
<div id="root"></div> | ||
<!-- | ||
This HTML file is a template. | ||
If you open it directly in the browser, you will see an empty page. | ||
You can add webfonts, meta tags, or analytics to this file. | ||
The build step will place the bundled scripts into the <body> tag. | ||
To begin the development, run `npm start` or `yarn start`. | ||
To create a production bundle, use `npm run build` or `yarn build`. | ||
--> | ||
</body> | ||
|
||
</html> |
Empty file.
Oops, something went wrong.