@nidhi_kumari/component-library 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/main.ts +16 -0
- package/.storybook/preview.tsx +21 -0
- package/README.md +75 -0
- package/eslint.config.js +22 -0
- package/index.html +13 -0
- package/nidhi_kumari-component-library-1.0.0.tgz +0 -0
- package/nidhigupta-component-library-1.0.0.tgz +0 -0
- package/package.json +46 -0
- package/public/favicon.svg +1 -0
- package/public/icons.svg +24 -0
- package/src/App.css +184 -0
- package/src/App.tsx +122 -0
- package/src/assets/hero.png +0 -0
- package/src/assets/react.svg +1 -0
- package/src/assets/vite.svg +1 -0
- package/src/components/Button/Button.css +20 -0
- package/src/components/Button/Button.stories.tsx +32 -0
- package/src/components/Button/Button.test.tsx +8 -0
- package/src/components/Button/Button.tsx +19 -0
- package/src/components/Button/Button.types.ts +8 -0
- package/src/components/Button/index.ts +2 -0
- package/src/components/EmptyState/EmptyState.css +0 -0
- package/src/components/EmptyState/EmptyState.stories.tsx +0 -0
- package/src/components/EmptyState/EmptyState.tsx +0 -0
- package/src/components/EmptyState/EmptyState.types.ts +0 -0
- package/src/components/EmptyState/index.ts +0 -0
- package/src/components/Header/Header.css +17 -0
- package/src/components/Header/Header.stories.tsx +24 -0
- package/src/components/Header/Header.tsx +12 -0
- package/src/components/Header/Header.types.ts +4 -0
- package/src/components/Header/index.ts +2 -0
- package/src/components/Input/Input.css +26 -0
- package/src/components/Input/Input.stories.tsx +47 -0
- package/src/components/Input/Input.tsx +14 -0
- package/src/components/Input/Input.types.ts +6 -0
- package/src/components/Input/index.ts +2 -0
- package/src/components/ListItem/ListItem.css +0 -0
- package/src/components/ListItem/ListItem.stories.tsx +0 -0
- package/src/components/ListItem/ListItem.tsx +0 -0
- package/src/components/ListItem/ListItem.types.ts +0 -0
- package/src/components/ListItem/index.ts +0 -0
- package/src/components/Loader/Loader.css +0 -0
- package/src/components/Loader/Loader.stories.tsx +0 -0
- package/src/components/Loader/Loader.tsx +0 -0
- package/src/components/Loader/Loader.types.ts +0 -0
- package/src/components/Loader/index.ts +0 -0
- package/src/components/SearchInput/SearchInput.css +20 -0
- package/src/components/SearchInput/SearchInput.stories.tsx +29 -0
- package/src/components/SearchInput/SearchInput.tsx +30 -0
- package/src/components/SearchInput/SearchInput.types.ts +6 -0
- package/src/components/SearchInput/index.ts +2 -0
- package/src/components/SearchList/SearchList.css +0 -0
- package/src/components/SearchList/SearchList.stories.tsx +0 -0
- package/src/components/SearchList/SearchList.tsx +0 -0
- package/src/components/SearchList/SearchList.types.ts +0 -0
- package/src/components/SearchList/index.ts +0 -0
- package/src/components/SlotManagement/SlotManagement.css +223 -0
- package/src/components/SlotManagement/SlotManagement.md +0 -0
- package/src/components/SlotManagement/SlotManagement.stories.tsx +12 -0
- package/src/components/SlotManagement/SlotManagement.tsx +217 -0
- package/src/components/SlotManagement/SlotManagement.types.ts +22 -0
- package/src/components/SlotManagement/slots.json +40 -0
- package/src/index.css +111 -0
- package/src/index.ts +0 -0
- package/src/main.tsx +10 -0
- package/src/stories/Button.stories.ts +54 -0
- package/src/stories/Button.tsx +39 -0
- package/src/stories/Configure.mdx +388 -0
- package/src/stories/Header.stories.ts +34 -0
- package/src/stories/Header.tsx +69 -0
- package/src/stories/Page.stories.ts +33 -0
- package/src/stories/Page.tsx +73 -0
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +1 -0
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +1 -0
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +1 -0
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +1 -0
- package/src/stories/assets/youtube.svg +1 -0
- package/src/stories/button.css +30 -0
- package/src/stories/header.css +32 -0
- package/src/stories/page.css +68 -0
- package/tsconfig.app.json +26 -0
- package/tsconfig.json +7 -0
- package/tsconfig.node.json +23 -0
- package/vite.config.ts +37 -0
- package/vitest.shims.d.ts +1 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.storybook-button {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
cursor: pointer;
|
|
4
|
+
border: 0;
|
|
5
|
+
border-radius: 3em;
|
|
6
|
+
font-weight: 700;
|
|
7
|
+
line-height: 1;
|
|
8
|
+
font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
9
|
+
}
|
|
10
|
+
.storybook-button--primary {
|
|
11
|
+
background-color: #555ab9;
|
|
12
|
+
color: white;
|
|
13
|
+
}
|
|
14
|
+
.storybook-button--secondary {
|
|
15
|
+
box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
|
|
16
|
+
background-color: transparent;
|
|
17
|
+
color: #333;
|
|
18
|
+
}
|
|
19
|
+
.storybook-button--small {
|
|
20
|
+
padding: 10px 16px;
|
|
21
|
+
font-size: 12px;
|
|
22
|
+
}
|
|
23
|
+
.storybook-button--medium {
|
|
24
|
+
padding: 11px 20px;
|
|
25
|
+
font-size: 14px;
|
|
26
|
+
}
|
|
27
|
+
.storybook-button--large {
|
|
28
|
+
padding: 12px 24px;
|
|
29
|
+
font-size: 16px;
|
|
30
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.storybook-header {
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: space-between;
|
|
4
|
+
align-items: center;
|
|
5
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
|
6
|
+
padding: 15px 20px;
|
|
7
|
+
font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.storybook-header svg {
|
|
11
|
+
display: inline-block;
|
|
12
|
+
vertical-align: top;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.storybook-header h1 {
|
|
16
|
+
display: inline-block;
|
|
17
|
+
vertical-align: top;
|
|
18
|
+
margin: 6px 0 6px 10px;
|
|
19
|
+
font-weight: 700;
|
|
20
|
+
font-size: 20px;
|
|
21
|
+
line-height: 1;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.storybook-header button + button {
|
|
25
|
+
margin-left: 10px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.storybook-header .welcome {
|
|
29
|
+
margin-right: 10px;
|
|
30
|
+
color: #333;
|
|
31
|
+
font-size: 14px;
|
|
32
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
.storybook-page {
|
|
2
|
+
margin: 0 auto;
|
|
3
|
+
padding: 48px 20px;
|
|
4
|
+
max-width: 600px;
|
|
5
|
+
color: #333;
|
|
6
|
+
font-size: 14px;
|
|
7
|
+
line-height: 24px;
|
|
8
|
+
font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.storybook-page h2 {
|
|
12
|
+
display: inline-block;
|
|
13
|
+
vertical-align: top;
|
|
14
|
+
margin: 0 0 4px;
|
|
15
|
+
font-weight: 700;
|
|
16
|
+
font-size: 32px;
|
|
17
|
+
line-height: 1;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.storybook-page p {
|
|
21
|
+
margin: 1em 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.storybook-page a {
|
|
25
|
+
color: inherit;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.storybook-page ul {
|
|
29
|
+
margin: 1em 0;
|
|
30
|
+
padding-left: 30px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.storybook-page li {
|
|
34
|
+
margin-bottom: 8px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.storybook-page .tip {
|
|
38
|
+
display: inline-block;
|
|
39
|
+
vertical-align: top;
|
|
40
|
+
margin-right: 10px;
|
|
41
|
+
border-radius: 1em;
|
|
42
|
+
background: #e7fdd8;
|
|
43
|
+
padding: 4px 12px;
|
|
44
|
+
color: #357a14;
|
|
45
|
+
font-weight: 700;
|
|
46
|
+
font-size: 11px;
|
|
47
|
+
line-height: 12px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.storybook-page .tip-wrapper {
|
|
51
|
+
margin-top: 40px;
|
|
52
|
+
margin-bottom: 40px;
|
|
53
|
+
font-size: 13px;
|
|
54
|
+
line-height: 20px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.storybook-page .tip-wrapper svg {
|
|
58
|
+
display: inline-block;
|
|
59
|
+
vertical-align: top;
|
|
60
|
+
margin-top: 3px;
|
|
61
|
+
margin-right: 4px;
|
|
62
|
+
width: 12px;
|
|
63
|
+
height: 12px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.storybook-page .tip-wrapper svg path {
|
|
67
|
+
fill: #1ea7fd;
|
|
68
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
4
|
+
"target": "es2023",
|
|
5
|
+
"lib": ["ES2023", "DOM"],
|
|
6
|
+
"module": "esnext",
|
|
7
|
+
"types": ["vite/client"],
|
|
8
|
+
"allowArbitraryExtensions": true,
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
|
|
11
|
+
/* Bundler mode */
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"allowImportingTsExtensions": true,
|
|
14
|
+
"verbatimModuleSyntax": true,
|
|
15
|
+
"moduleDetection": "force",
|
|
16
|
+
"noEmit": true,
|
|
17
|
+
"jsx": "react-jsx",
|
|
18
|
+
|
|
19
|
+
/* Linting */
|
|
20
|
+
"noUnusedLocals": true,
|
|
21
|
+
"noUnusedParameters": true,
|
|
22
|
+
"erasableSyntaxOnly": true,
|
|
23
|
+
"noFallthroughCasesInSwitch": true
|
|
24
|
+
},
|
|
25
|
+
"include": ["src"]
|
|
26
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
4
|
+
"target": "es2023",
|
|
5
|
+
"lib": ["ES2023"],
|
|
6
|
+
"types": ["node"],
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
|
|
9
|
+
/* Bundler mode */
|
|
10
|
+
"module": "nodenext",
|
|
11
|
+
"allowImportingTsExtensions": true,
|
|
12
|
+
"verbatimModuleSyntax": true,
|
|
13
|
+
"moduleDetection": "force",
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
|
|
16
|
+
/* Linting */
|
|
17
|
+
"noUnusedLocals": true,
|
|
18
|
+
"noUnusedParameters": true,
|
|
19
|
+
"erasableSyntaxOnly": true,
|
|
20
|
+
"noFallthroughCasesInSwitch": true
|
|
21
|
+
},
|
|
22
|
+
"include": ["vite.config.ts"]
|
|
23
|
+
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/// <reference types="vitest/config" />
|
|
2
|
+
import { defineConfig } from 'vite';
|
|
3
|
+
import react from '@vitejs/plugin-react';
|
|
4
|
+
|
|
5
|
+
// https://vite.dev/config/
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
import { storybookTest } from '@storybook/addon-vitest/vitest-plugin';
|
|
9
|
+
import { playwright } from '@vitest/browser-playwright';
|
|
10
|
+
const dirname = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url));
|
|
11
|
+
|
|
12
|
+
// More info at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon
|
|
13
|
+
export default defineConfig({
|
|
14
|
+
plugins: [react()],
|
|
15
|
+
test: {
|
|
16
|
+
projects: [{
|
|
17
|
+
extends: true,
|
|
18
|
+
plugins: [
|
|
19
|
+
// The plugin will run tests for the stories defined in your Storybook config
|
|
20
|
+
// See options at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon#storybooktest
|
|
21
|
+
storybookTest({
|
|
22
|
+
configDir: path.join(dirname, '.storybook')
|
|
23
|
+
})],
|
|
24
|
+
test: {
|
|
25
|
+
name: 'storybook',
|
|
26
|
+
browser: {
|
|
27
|
+
enabled: true,
|
|
28
|
+
headless: true,
|
|
29
|
+
provider: playwright({}),
|
|
30
|
+
instances: [{
|
|
31
|
+
browser: 'chromium'
|
|
32
|
+
}]
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}]
|
|
36
|
+
}
|
|
37
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="@vitest/browser-playwright" />
|