retail-design-system 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/.github/workflows/release.yml +46 -0
- package/.oxfmtrc.json +17 -0
- package/.oxlintrc.json +132 -0
- package/.vscode/extensions.json +3 -0
- package/.vscode/settings.json +13 -0
- package/README.md +56 -0
- package/apps/storybook/.storybook/main.ts +8 -0
- package/apps/storybook/.storybook/preview.css +9 -0
- package/apps/storybook/.storybook/preview.ts +6 -0
- package/apps/storybook/package.json +24 -0
- package/apps/storybook/stories/button.stories.ts +118 -0
- package/apps/storybook/stories/input.stories.ts +127 -0
- package/apps/storybook/stories/label.stories.ts +98 -0
- package/apps/storybook/tsconfig.app.json +24 -0
- package/apps/storybook/tsconfig.json +4 -0
- package/apps/storybook/tsconfig.node.json +22 -0
- package/apps/storybook/vite.config.ts +15 -0
- package/apps/web/app/(sidebar)/components/[...slugs]/get-child-block.ts +17 -0
- package/apps/web/app/(sidebar)/components/[...slugs]/get-component-page-match.ts +56 -0
- package/apps/web/app/(sidebar)/components/[...slugs]/get-direct-child-block.ts +22 -0
- package/apps/web/app/(sidebar)/components/[...slugs]/layout.tsx +25 -0
- package/apps/web/app/(sidebar)/components/[...slugs]/page.tsx +32 -0
- package/apps/web/app/(sidebar)/components/[...slugs]/pascal-to-kebab-case.ts +9 -0
- package/apps/web/app/(sidebar)/components/button2/page.tsx +154 -0
- package/apps/web/app/(sidebar)/components/input/page.tsx +98 -0
- package/apps/web/app/(sidebar)/experiments/2025-10-22/mayhem-mode-card-badge.tsx +9 -0
- package/apps/web/app/(sidebar)/experiments/2025-10-22/mayhem-mode-coin-active-badge.tsx +14 -0
- package/apps/web/app/(sidebar)/experiments/2025-10-22/mayhem-mode-coin-inactive-badge.tsx +12 -0
- package/apps/web/app/(sidebar)/experiments/2025-10-22/mayhem-mode-create-coin.tsx +44 -0
- package/apps/web/app/(sidebar)/experiments/2025-10-22/mayhem-mode-dialog-icon.tsx +47 -0
- package/apps/web/app/(sidebar)/experiments/2025-10-22/page.tsx +167 -0
- package/apps/web/app/(sidebar)/experiments/2025-11-04/filters.tsx +90 -0
- package/apps/web/app/(sidebar)/experiments/2025-11-04/page.tsx +18 -0
- package/apps/web/app/(sidebar)/layout.tsx +17 -0
- package/apps/web/app/(sidebar)/primitives/colors/page.tsx +49 -0
- package/apps/web/app/favicon.ico +0 -0
- package/apps/web/app/layout.tsx +39 -0
- package/apps/web/app/page.tsx +14 -0
- package/apps/web/app/providers.tsx +15 -0
- package/apps/web/components/dialog.tsx +21 -0
- package/apps/web/components/logo.tsx +11 -0
- package/apps/web/components/logomark.tsx +21 -0
- package/apps/web/components/logotype.tsx +25 -0
- package/apps/web/components/notion/notion-block-content.tsx +401 -0
- package/apps/web/components/notion/notion-docs-blocks.tsx +18 -0
- package/apps/web/components/notion/notion-docs-code-page.tsx +20 -0
- package/apps/web/components/notion/notion-docs-layout.tsx +52 -0
- package/apps/web/components/notion/notion-revalidate-button-client.tsx +14 -0
- package/apps/web/components/notion/notion-revalidate-button.tsx +20 -0
- package/apps/web/components/notion/notion-rich-text-segments.tsx +55 -0
- package/apps/web/components/notion/notion-tabs.tsx +38 -0
- package/apps/web/components/notion/notion.ts +223 -0
- package/apps/web/components/sidebar-client.tsx +60 -0
- package/apps/web/components/sidebar-server.tsx +185 -0
- package/apps/web/components/tooltip.tsx +53 -0
- package/apps/web/components/topbar.tsx +14 -0
- package/apps/web/next.config.ts +10 -0
- package/apps/web/package.json +42 -0
- package/apps/web/postcss.config.mjs +5 -0
- package/apps/web/public/2025-10-22-dialog-banner.png +0 -0
- package/apps/web/public/pump-logomark.svg +7 -0
- package/apps/web/styles/custom.css +31 -0
- package/apps/web/styles/font.css +8 -0
- package/apps/web/styles/global.css +5 -0
- package/apps/web/styles/tailwind-reset.css +102 -0
- package/apps/web/styles/tailwind.css +140 -0
- package/apps/web/tsconfig.json +34 -0
- package/bun.lock +1249 -0
- package/bunfig.toml +2 -0
- package/package.json +41 -0
- package/packages/ui/global.d.ts +4 -0
- package/packages/ui/package.json +49 -0
- package/packages/ui/src/components/button/button-spinner.module.css +95 -0
- package/packages/ui/src/components/button/button-spinner.tsx +18 -0
- package/packages/ui/src/components/button/button.module.css +144 -0
- package/packages/ui/src/components/button/button.tsx +102 -0
- package/packages/ui/src/components/button-link/button-link.tsx +46 -0
- package/packages/ui/src/components/column/column.module.css +4 -0
- package/packages/ui/src/components/column/column.tsx +65 -0
- package/packages/ui/src/components/row/row.module.css +4 -0
- package/packages/ui/src/components/row/row.tsx +65 -0
- package/packages/ui/src/components/spacer/spacer.module.css +3 -0
- package/packages/ui/src/components/spacer/spacer.tsx +30 -0
- package/packages/ui/src/components/switch/switch.module.css +62 -0
- package/packages/ui/src/components/switch/switch.tsx +58 -0
- package/packages/ui/src/components/tabs/tabs-panel.module.css +4 -0
- package/packages/ui/src/components/tabs/tabs-panel.tsx +21 -0
- package/packages/ui/src/components/tabs/tabs.module.css +5 -0
- package/packages/ui/src/components/tabs/tabs.tsx +21 -0
- package/packages/ui/src/components/tabs-underline/tabs-underline-indicator.module.css +10 -0
- package/packages/ui/src/components/tabs-underline/tabs-underline-indicator.tsx +33 -0
- package/packages/ui/src/components/tabs-underline/tabs-underline-list.module.css +8 -0
- package/packages/ui/src/components/tabs-underline/tabs-underline-list.tsx +27 -0
- package/packages/ui/src/components/tabs-underline/tabs-underline-tab.module.css +24 -0
- package/packages/ui/src/components/tabs-underline/tabs-underline-tab.tsx +30 -0
- package/packages/ui/src/foundations/colors/colors.ts +475 -0
- package/packages/ui/src/foundations/colors/generate-css.ts +34 -0
- package/packages/ui/src/foundations/colors/retail-design-system.css +116 -0
- package/packages/ui/src/foundations/colors/tailwind-v3.ts +18 -0
- package/packages/ui/src/foundations/colors/tailwind-v4.css +116 -0
- package/packages/ui/src/index.ts +34 -0
- package/packages/ui/src/input.module.css +57 -0
- package/packages/ui/src/input.tsx +49 -0
- package/packages/ui/src/label.module.css +8 -0
- package/packages/ui/src/label.tsx +23 -0
- package/packages/ui/tsconfig.json +14 -0
- package/packages/ui/tsup.config.ts +31 -0
- package/scripts/clean.sh +69 -0
- package/scripts/sort-package-json.sh +30 -0
- package/turbo.json +15 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches:
|
|
5
|
+
- main
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read # for checkout
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
release:
|
|
13
|
+
name: Release
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
permissions:
|
|
16
|
+
contents: write # to be able to publish a GitHub release
|
|
17
|
+
issues: write # to be able to comment on released issues
|
|
18
|
+
pull-requests: write # to be able to comment on released pull requests
|
|
19
|
+
id-token: write # to enable use of OIDC for npm provenance
|
|
20
|
+
steps:
|
|
21
|
+
- name: Checkout
|
|
22
|
+
uses: actions/checkout@v4
|
|
23
|
+
with:
|
|
24
|
+
fetch-depth: 0
|
|
25
|
+
- name: Setup Bun
|
|
26
|
+
uses: oven-sh/setup-bun@v2
|
|
27
|
+
with:
|
|
28
|
+
bun-version-file: package.json
|
|
29
|
+
- name: Setup Node.js for release tooling
|
|
30
|
+
uses: actions/setup-node@v4
|
|
31
|
+
with:
|
|
32
|
+
node-version: "lts/*"
|
|
33
|
+
- name: Configure npm for private packages and publish
|
|
34
|
+
run: |
|
|
35
|
+
echo "//registry.npmjs.org/:_authToken=${{ secrets.SECURITY_BATON_NPMJS_PUBLISH_TOKEN }}" > .npmrc
|
|
36
|
+
- name: Install dependencies
|
|
37
|
+
run: bun install --frozen-lockfile
|
|
38
|
+
- name: Audit dependencies
|
|
39
|
+
run: bun audit
|
|
40
|
+
- name: Build
|
|
41
|
+
run: bun run build
|
|
42
|
+
- name: Release
|
|
43
|
+
env:
|
|
44
|
+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
|
45
|
+
NPM_TOKEN: ${{ secrets.SECURITY_BATON_NPMJS_PUBLISH_TOKEN }}
|
|
46
|
+
run: bunx semantic-release
|
package/.oxfmtrc.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
|
|
3
|
+
"experimentalTailwindcss": {
|
|
4
|
+
"attributes": ["className"]
|
|
5
|
+
},
|
|
6
|
+
"experimentalSortImports": {
|
|
7
|
+
"newlinesBetween": false
|
|
8
|
+
},
|
|
9
|
+
"experimentalSortPackageJson": {
|
|
10
|
+
"sortScripts": true
|
|
11
|
+
},
|
|
12
|
+
"ignorePatterns": [
|
|
13
|
+
"packages/ui/src/foundations/colors/retail-design-system.css",
|
|
14
|
+
"packages/ui/src/foundations/colors/tailwind-v4.css"
|
|
15
|
+
],
|
|
16
|
+
"semi": false
|
|
17
|
+
}
|
package/.oxlintrc.json
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
|
3
|
+
"plugins": [
|
|
4
|
+
"eslint",
|
|
5
|
+
"import",
|
|
6
|
+
"jsdoc",
|
|
7
|
+
"jsx-a11y",
|
|
8
|
+
"nextjs",
|
|
9
|
+
"oxc",
|
|
10
|
+
"react",
|
|
11
|
+
"react-perf",
|
|
12
|
+
"typescript",
|
|
13
|
+
"unicorn"
|
|
14
|
+
],
|
|
15
|
+
"jsPlugins": [
|
|
16
|
+
{
|
|
17
|
+
"name": "unused-imports",
|
|
18
|
+
"specifier": "eslint-plugin-unused-imports"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "perfectionist",
|
|
22
|
+
"specifier": "eslint-plugin-perfectionist"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"categories": {
|
|
26
|
+
"correctness": "error",
|
|
27
|
+
"nursery": "error",
|
|
28
|
+
"pedantic": "error",
|
|
29
|
+
"perf": "error",
|
|
30
|
+
"restriction": "error",
|
|
31
|
+
"style": "error",
|
|
32
|
+
"suspicious": "error"
|
|
33
|
+
},
|
|
34
|
+
"rules": {
|
|
35
|
+
"eslint-plugin-import/consistent-type-specifier-style": "allow",
|
|
36
|
+
"eslint-plugin-import/exports-last": "allow",
|
|
37
|
+
"eslint-plugin-import/group-exports": "allow",
|
|
38
|
+
"eslint-plugin-import/no-default-export": "allow",
|
|
39
|
+
"eslint-plugin-import/no-named-export": "allow",
|
|
40
|
+
"eslint-plugin-import/no-unassigned-import": "allow",
|
|
41
|
+
"eslint-plugin-import/prefer-default-export": "allow",
|
|
42
|
+
"eslint-plugin-import/unambiguous": "allow",
|
|
43
|
+
"eslint-plugin-react-perf/jsx-no-jsx-as-prop": "allow",
|
|
44
|
+
"eslint-plugin-react-perf/jsx-no-new-array-as-prop": "allow",
|
|
45
|
+
"eslint-plugin-react-perf/jsx-no-new-function-as-prop": "allow",
|
|
46
|
+
"eslint-plugin-react-perf/jsx-no-new-object-as-prop": "allow",
|
|
47
|
+
"eslint-plugin-react/button-has-type": "allow",
|
|
48
|
+
"eslint-plugin-react/jsx-filename-extension": "allow",
|
|
49
|
+
"eslint-plugin-react/jsx-max-depth": "allow",
|
|
50
|
+
"eslint-plugin-react/jsx-props-no-spreading": "allow",
|
|
51
|
+
"eslint-plugin-react/no-array-index-key": "allow",
|
|
52
|
+
"eslint-plugin-react/only-export-components": "allow",
|
|
53
|
+
"eslint-plugin-react/react-in-jsx-scope": "allow",
|
|
54
|
+
"eslint-plugin-unicorn/consistent-function-scoping": "allow",
|
|
55
|
+
"eslint-plugin-unicorn/no-nested-ternary": "allow",
|
|
56
|
+
"eslint/complexity": "allow",
|
|
57
|
+
"eslint/func-style": ["error", "declaration"],
|
|
58
|
+
"eslint/id-length": ["error", { "exceptions": ["_"] }],
|
|
59
|
+
"eslint/max-lines-per-function": "allow",
|
|
60
|
+
"eslint/no-inline-comments": "allow",
|
|
61
|
+
"eslint/no-magic-numbers": "allow",
|
|
62
|
+
"eslint/no-nested-ternary": "allow",
|
|
63
|
+
"eslint/no-ternary": "allow",
|
|
64
|
+
"eslint/no-undefined": "allow",
|
|
65
|
+
"eslint/sort-imports": "allow",
|
|
66
|
+
"max-lines": "allow",
|
|
67
|
+
"max-statements": "allow",
|
|
68
|
+
"nextjs/no-img-element": "allow",
|
|
69
|
+
"no-console": "allow",
|
|
70
|
+
"no-undef": "allow",
|
|
71
|
+
"oxc/no-async-await": "allow",
|
|
72
|
+
"oxc/no-rest-spread-properties": "allow",
|
|
73
|
+
"perfectionist/sort-array-includes": "error",
|
|
74
|
+
"perfectionist/sort-classes": "error",
|
|
75
|
+
"perfectionist/sort-decorators": "error",
|
|
76
|
+
"perfectionist/sort-enums": "error",
|
|
77
|
+
"perfectionist/sort-export-attributes": "error",
|
|
78
|
+
"perfectionist/sort-exports": "error",
|
|
79
|
+
"perfectionist/sort-heritage-clauses": "error",
|
|
80
|
+
"perfectionist/sort-interfaces": "error",
|
|
81
|
+
"perfectionist/sort-intersection-types": "error",
|
|
82
|
+
"perfectionist/sort-jsx-props": "error",
|
|
83
|
+
"perfectionist/sort-maps": "error",
|
|
84
|
+
"perfectionist/sort-modules": "error",
|
|
85
|
+
"perfectionist/sort-named-exports": "error",
|
|
86
|
+
"perfectionist/sort-object-types": "error",
|
|
87
|
+
"perfectionist/sort-sets": "error",
|
|
88
|
+
"perfectionist/sort-switch-case": "error",
|
|
89
|
+
"perfectionist/sort-union-types": "error",
|
|
90
|
+
"perfectionist/sort-variable-declarations": "error",
|
|
91
|
+
"typescript/explicit-function-return-type": "allow",
|
|
92
|
+
"typescript/explicit-module-boundary-types": "allow",
|
|
93
|
+
"typescript/no-empty-interface": "allow",
|
|
94
|
+
"typescript/no-empty-object-type": "allow",
|
|
95
|
+
"typescript/no-use-before-define": "allow",
|
|
96
|
+
"unused-imports/no-unused-imports": "error"
|
|
97
|
+
},
|
|
98
|
+
"settings": {
|
|
99
|
+
"jsx-a11y": {
|
|
100
|
+
"polymorphicPropName": null,
|
|
101
|
+
"components": {},
|
|
102
|
+
"attributes": {}
|
|
103
|
+
},
|
|
104
|
+
"next": {
|
|
105
|
+
"rootDir": []
|
|
106
|
+
},
|
|
107
|
+
"react": {
|
|
108
|
+
"formComponents": [],
|
|
109
|
+
"linkComponents": [],
|
|
110
|
+
"version": null,
|
|
111
|
+
"componentWrapperFunctions": []
|
|
112
|
+
},
|
|
113
|
+
"jsdoc": {
|
|
114
|
+
"ignorePrivate": false,
|
|
115
|
+
"ignoreInternal": false,
|
|
116
|
+
"ignoreReplacesDocs": true,
|
|
117
|
+
"overrideReplacesDocs": true,
|
|
118
|
+
"augmentsExtendsReplacesDocs": false,
|
|
119
|
+
"implementsReplacesDocs": false,
|
|
120
|
+
"exemptDestructuredRootsFromChecks": false,
|
|
121
|
+
"tagNamePreference": {}
|
|
122
|
+
},
|
|
123
|
+
"vitest": {
|
|
124
|
+
"typecheck": false
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"env": {
|
|
128
|
+
"builtin": true
|
|
129
|
+
},
|
|
130
|
+
"globals": {},
|
|
131
|
+
"ignorePatterns": []
|
|
132
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"editor.codeActionsOnSave": {
|
|
3
|
+
"source.fixAll.oxc": "always"
|
|
4
|
+
},
|
|
5
|
+
"editor.defaultFormatter": "oxc.oxc-vscode",
|
|
6
|
+
"editor.formatOnPaste": true,
|
|
7
|
+
"editor.formatOnSave": true,
|
|
8
|
+
"oxc.fixKind": "all",
|
|
9
|
+
"oxc.fmt.configPath": ".oxfmtrc.json",
|
|
10
|
+
"peacock.color": "#61dafb",
|
|
11
|
+
"tailwindCSS.experimental.configFile": "apps/web/styles/tailwind.css",
|
|
12
|
+
"tailwindCSS.rootFontSize": 10
|
|
13
|
+
}
|
package/README.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# @pump-fun/retail-design-system
|
|
2
|
+
|
|
3
|
+
A collection of reusable React components built with TypeScript and CSS Modules.
|
|
4
|
+
|
|
5
|
+
> [!WARNING]
|
|
6
|
+
> This project is currently a work in progress. Forked from https://github.com/nattstack/react-components
|
|
7
|
+
|
|
8
|
+
## Get Started
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
bun install
|
|
12
|
+
bun run dev
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Links
|
|
16
|
+
|
|
17
|
+
- Website: https://retail-design-system-web.preview.pump.fun
|
|
18
|
+
- Storybook: https://retail-design-system-storybook.preview.pump.fun
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
bun add @pump-fun/retail-design-system
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
import { Button } from "@pump-fun/retail-design-system"
|
|
30
|
+
|
|
31
|
+
function App() {
|
|
32
|
+
return <Button onClick={() => console.log("Clicked!")}>Click me</Button>
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Development
|
|
37
|
+
|
|
38
|
+
### Project Structure
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
src/
|
|
42
|
+
├── index.ts # Main export file
|
|
43
|
+
├── button.tsx # Button component
|
|
44
|
+
├── button.module.css # Button styles
|
|
45
|
+
└── global.d.ts # TypeScript declarations
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Build Configuration
|
|
49
|
+
|
|
50
|
+
The project uses [tsup](https://tsup.egoist.dev/) for building:
|
|
51
|
+
|
|
52
|
+
- **Output formats:** ESM and CommonJS
|
|
53
|
+
- **TypeScript declarations:** Generated automatically
|
|
54
|
+
- **CSS handling:** CSS files are copied to the dist folder
|
|
55
|
+
- **Tree shaking:** Enabled for optimal bundle size
|
|
56
|
+
- **Source maps:** Generated for debugging
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");
|
|
2
|
+
@import "@pump-fun/retail-design-system/tailwind-v4/colors.css";
|
|
3
|
+
@import "@pump-fun/retail-design-system/retail-design-system.css";
|
|
4
|
+
|
|
5
|
+
body {
|
|
6
|
+
font-family: "Inter", sans-serif;
|
|
7
|
+
color: var(--color-zinc-50);
|
|
8
|
+
background-color: var(--color-zinc-950);
|
|
9
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "storybook",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"build": "storybook build",
|
|
6
|
+
"dev": "storybook dev --no-open --port 6006"
|
|
7
|
+
},
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@pump-fun/icons-filled": "catalog:",
|
|
10
|
+
"@pump-fun/icons-line": "catalog:",
|
|
11
|
+
"@pump-fun/retail-design-system": "workspace:*",
|
|
12
|
+
"react": "catalog:",
|
|
13
|
+
"react-dom": "catalog:"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@storybook/react-vite": "10.2.19",
|
|
17
|
+
"@types/react": "catalog:",
|
|
18
|
+
"@types/react-dom": "catalog:",
|
|
19
|
+
"@vitejs/plugin-react": "5.2.0",
|
|
20
|
+
"storybook": "10.2.19",
|
|
21
|
+
"typescript": "catalog:",
|
|
22
|
+
"vite": "7.3.1"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { Button } from "@pump-fun/retail-design-system"
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite"
|
|
3
|
+
import { fn } from "storybook/test"
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
argTypes: {
|
|
7
|
+
isDisabled: { control: "boolean" },
|
|
8
|
+
isFullWidth: { control: "boolean" },
|
|
9
|
+
isLoading: { control: "boolean" },
|
|
10
|
+
isRounded: { control: "boolean" },
|
|
11
|
+
size: { control: "select", options: [32, 36, 40, 48] },
|
|
12
|
+
variant: {
|
|
13
|
+
control: "select",
|
|
14
|
+
options: ["accent", "primary", "secondary", "ghost"],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
args: { onClick: fn() },
|
|
18
|
+
component: Button,
|
|
19
|
+
parameters: {
|
|
20
|
+
layout: "centered",
|
|
21
|
+
},
|
|
22
|
+
tags: ["autodocs"],
|
|
23
|
+
title: "Components/Button",
|
|
24
|
+
} satisfies Meta<typeof Button>
|
|
25
|
+
|
|
26
|
+
export default meta
|
|
27
|
+
type Story = StoryObj<typeof meta>
|
|
28
|
+
|
|
29
|
+
export const Default: Story = {
|
|
30
|
+
args: {
|
|
31
|
+
children: "Button",
|
|
32
|
+
},
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const Primary: Story = {
|
|
36
|
+
args: {
|
|
37
|
+
children: "Primary Button",
|
|
38
|
+
variant: "primary",
|
|
39
|
+
},
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const Accent: Story = {
|
|
43
|
+
args: {
|
|
44
|
+
children: "Accent Button",
|
|
45
|
+
variant: "accent",
|
|
46
|
+
},
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const Secondary: Story = {
|
|
50
|
+
args: {
|
|
51
|
+
children: "Secondary Button",
|
|
52
|
+
variant: "secondary",
|
|
53
|
+
},
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const Ghost: Story = {
|
|
57
|
+
args: {
|
|
58
|
+
children: "Ghost Button",
|
|
59
|
+
variant: "ghost",
|
|
60
|
+
},
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export const Large: Story = {
|
|
64
|
+
args: {
|
|
65
|
+
children: "Large Button",
|
|
66
|
+
size: 44,
|
|
67
|
+
},
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const Small: Story = {
|
|
71
|
+
args: {
|
|
72
|
+
children: "Small Button",
|
|
73
|
+
size: 32,
|
|
74
|
+
},
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export const Loading: Story = {
|
|
78
|
+
args: {
|
|
79
|
+
children: "Loading...",
|
|
80
|
+
isLoading: true,
|
|
81
|
+
},
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export const Disabled: Story = {
|
|
85
|
+
args: {
|
|
86
|
+
children: "Disabled Button",
|
|
87
|
+
isDisabled: true,
|
|
88
|
+
},
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export const Rounded: Story = {
|
|
92
|
+
args: {
|
|
93
|
+
children: "Rounded Button",
|
|
94
|
+
isRounded: true,
|
|
95
|
+
},
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export const FullWidth: Story = {
|
|
99
|
+
args: {
|
|
100
|
+
children: "Full Width Button",
|
|
101
|
+
isFullWidth: true,
|
|
102
|
+
},
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export const IconOnly: Story = {
|
|
106
|
+
args: {
|
|
107
|
+
children: "🚀",
|
|
108
|
+
isIconOnly: true,
|
|
109
|
+
},
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export const WithIcons: Story = {
|
|
113
|
+
args: {
|
|
114
|
+
children: "Button with Icons",
|
|
115
|
+
iconEnd: "✨",
|
|
116
|
+
iconStart: "🚀",
|
|
117
|
+
},
|
|
118
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { Input } from "@pump-fun/retail-design-system"
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite"
|
|
3
|
+
import { fn } from "storybook/test"
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
argTypes: {
|
|
7
|
+
isActive: { control: "boolean" },
|
|
8
|
+
isDisabled: { control: "boolean" },
|
|
9
|
+
placeholder: { control: "text" },
|
|
10
|
+
type: {
|
|
11
|
+
control: "select",
|
|
12
|
+
options: ["text", "email", "password", "number", "tel", "url", "search"],
|
|
13
|
+
},
|
|
14
|
+
value: { control: "text" },
|
|
15
|
+
},
|
|
16
|
+
args: {
|
|
17
|
+
onBlur: fn(),
|
|
18
|
+
onChange: fn(),
|
|
19
|
+
onFocus: fn(),
|
|
20
|
+
},
|
|
21
|
+
component: Input,
|
|
22
|
+
parameters: {
|
|
23
|
+
layout: "centered",
|
|
24
|
+
},
|
|
25
|
+
tags: ["autodocs"],
|
|
26
|
+
title: "Components/Input",
|
|
27
|
+
} satisfies Meta<typeof Input>
|
|
28
|
+
|
|
29
|
+
export default meta
|
|
30
|
+
type Story = StoryObj<typeof meta>
|
|
31
|
+
|
|
32
|
+
export const Default: Story = {
|
|
33
|
+
args: {
|
|
34
|
+
placeholder: "Enter text...",
|
|
35
|
+
},
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const WithValue: Story = {
|
|
39
|
+
args: {
|
|
40
|
+
placeholder: "Enter text...",
|
|
41
|
+
value: "Sample text",
|
|
42
|
+
},
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const Email: Story = {
|
|
46
|
+
args: {
|
|
47
|
+
placeholder: "Enter your email...",
|
|
48
|
+
type: "email",
|
|
49
|
+
},
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const Password: Story = {
|
|
53
|
+
args: {
|
|
54
|
+
placeholder: "Enter your password...",
|
|
55
|
+
type: "password",
|
|
56
|
+
},
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export const Number: Story = {
|
|
60
|
+
args: {
|
|
61
|
+
placeholder: "Enter a number...",
|
|
62
|
+
type: "number",
|
|
63
|
+
},
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const Search: Story = {
|
|
67
|
+
args: {
|
|
68
|
+
placeholder: "Search...",
|
|
69
|
+
type: "search",
|
|
70
|
+
},
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export const Tel: Story = {
|
|
74
|
+
args: {
|
|
75
|
+
placeholder: "Enter phone number...",
|
|
76
|
+
type: "tel",
|
|
77
|
+
},
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export const URL: Story = {
|
|
81
|
+
args: {
|
|
82
|
+
placeholder: "Enter URL...",
|
|
83
|
+
type: "url",
|
|
84
|
+
},
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export const Active: Story = {
|
|
88
|
+
args: {
|
|
89
|
+
isActive: true,
|
|
90
|
+
placeholder: "Active input",
|
|
91
|
+
},
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export const Disabled: Story = {
|
|
95
|
+
args: {
|
|
96
|
+
isDisabled: true,
|
|
97
|
+
placeholder: "Disabled input",
|
|
98
|
+
},
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export const DisabledWithValue: Story = {
|
|
102
|
+
args: {
|
|
103
|
+
isDisabled: true,
|
|
104
|
+
value: "Cannot edit this",
|
|
105
|
+
},
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export const Required: Story = {
|
|
109
|
+
args: {
|
|
110
|
+
isRequired: true,
|
|
111
|
+
placeholder: "Required field",
|
|
112
|
+
},
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export const WithMaxLength: Story = {
|
|
116
|
+
args: {
|
|
117
|
+
maxLength: 10,
|
|
118
|
+
placeholder: "Max 10 characters",
|
|
119
|
+
},
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export const ReadOnly: Story = {
|
|
123
|
+
args: {
|
|
124
|
+
isReadOnly: true,
|
|
125
|
+
value: "Read-only value",
|
|
126
|
+
},
|
|
127
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { Label } from "@pump-fun/retail-design-system"
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite"
|
|
3
|
+
import { fn } from "storybook/test"
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
argTypes: {
|
|
7
|
+
children: { control: "text" },
|
|
8
|
+
htmlFor: { control: "text" },
|
|
9
|
+
},
|
|
10
|
+
args: {
|
|
11
|
+
onClick: fn(),
|
|
12
|
+
},
|
|
13
|
+
component: Label,
|
|
14
|
+
parameters: {
|
|
15
|
+
layout: "centered",
|
|
16
|
+
},
|
|
17
|
+
tags: ["autodocs"],
|
|
18
|
+
title: "Components/Label",
|
|
19
|
+
} satisfies Meta<typeof Label>
|
|
20
|
+
|
|
21
|
+
export default meta
|
|
22
|
+
type Story = StoryObj<typeof meta>
|
|
23
|
+
|
|
24
|
+
export const Default: Story = {
|
|
25
|
+
args: {
|
|
26
|
+
children: "Label",
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const WithText: Story = {
|
|
31
|
+
args: {
|
|
32
|
+
children: "Username",
|
|
33
|
+
},
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const ForInput: Story = {
|
|
37
|
+
args: {
|
|
38
|
+
children: "Email Address",
|
|
39
|
+
htmlFor: "email-input",
|
|
40
|
+
},
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const Required: Story = {
|
|
44
|
+
args: {
|
|
45
|
+
children: "Password *",
|
|
46
|
+
htmlFor: "password-input",
|
|
47
|
+
},
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const LongText: Story = {
|
|
51
|
+
args: {
|
|
52
|
+
children:
|
|
53
|
+
"This is a longer label text that might wrap to multiple lines depending on the container width",
|
|
54
|
+
htmlFor: "description-input",
|
|
55
|
+
},
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export const WithSpecialCharacters: Story = {
|
|
59
|
+
args: {
|
|
60
|
+
children: "Full Name (First & Last)",
|
|
61
|
+
htmlFor: "fullname-input",
|
|
62
|
+
},
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const Clickable: Story = {
|
|
66
|
+
args: {
|
|
67
|
+
children: "Click me to focus input",
|
|
68
|
+
htmlFor: "clickable-input",
|
|
69
|
+
style: { cursor: "pointer" },
|
|
70
|
+
},
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export const WithCustomStyling: Story = {
|
|
74
|
+
args: {
|
|
75
|
+
children: "Custom Styled Label",
|
|
76
|
+
htmlFor: "custom-input",
|
|
77
|
+
style: {
|
|
78
|
+
color: "#0066cc",
|
|
79
|
+
fontWeight: "bold",
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export const FormLabel: Story = {
|
|
85
|
+
args: {
|
|
86
|
+
children: "Phone Number",
|
|
87
|
+
htmlFor: "phone-input",
|
|
88
|
+
title: "Enter your phone number including area code",
|
|
89
|
+
},
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export const AccessibilityLabel: Story = {
|
|
93
|
+
args: {
|
|
94
|
+
"aria-label": "Search through available options",
|
|
95
|
+
children: "Search",
|
|
96
|
+
htmlFor: "search-input",
|
|
97
|
+
},
|
|
98
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"allowImportingTsExtensions": true,
|
|
4
|
+
"erasableSyntaxOnly": true,
|
|
5
|
+
"jsx": "react-jsx",
|
|
6
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
7
|
+
"module": "ESNext",
|
|
8
|
+
"moduleDetection": "force",
|
|
9
|
+
"moduleResolution": "bundler",
|
|
10
|
+
"noEmit": true,
|
|
11
|
+
"noFallthroughCasesInSwitch": true,
|
|
12
|
+
"noUncheckedSideEffectImports": true,
|
|
13
|
+
"noUnusedLocals": true,
|
|
14
|
+
"noUnusedParameters": true,
|
|
15
|
+
"skipLibCheck": true,
|
|
16
|
+
"strict": true,
|
|
17
|
+
"target": "ES2022",
|
|
18
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
19
|
+
"types": ["vite/client"],
|
|
20
|
+
"useDefineForClassFields": true,
|
|
21
|
+
"verbatimModuleSyntax": true
|
|
22
|
+
},
|
|
23
|
+
"include": ["stories"]
|
|
24
|
+
}
|