Skip to content
This repository has been archived by the owner on Aug 4, 2023. It is now read-only.

Commit

Permalink
Digit Components-core created
Browse files Browse the repository at this point in the history
  • Loading branch information
jagankumar-egov committed Jul 18, 2023
1 parent ca71819 commit 2a0a3ba
Show file tree
Hide file tree
Showing 15 changed files with 1,894 additions and 0 deletions.
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',
};

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;
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)
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
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;
}
}
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"]
}
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>
Loading

0 comments on commit 2a0a3ba

Please sign in to comment.