get-elementa-ui 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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 deriva
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,39 @@
1
+ deriva-ui/
2
+ ├── .storybook/ # Storybook config (for dev & documentation)
3
+ │ ├── main.ts
4
+ │ └── preview.tsx
5
+
6
+ ├── src/ # SOURCE CODE
7
+ │ ├── components/ # Base Shadcn Components (Atoms)
8
+ │ │ ├── ui/ # The actual components
9
+ │ │ │ ├── button.tsx
10
+ │ │ │ ├── input.tsx
11
+ │ │ │ ├── ...
12
+ │ │ │ └── index.ts # Barrel file for UI components
13
+ │ │
14
+ │ ├── patterns/ # "Deriva Specials" (Molecules/Organisms)
15
+ │ │ ├── DerivaGlowCard.tsx # The cool neon card
16
+ │ │ ├── EnergyToggle.tsx # Theme switcher
17
+ │ │ ├── NeonChart.tsx # Recharts wrapper
18
+ │ │ └── index.ts
19
+ │ │
20
+ │ ├── theme/ # Theming Engine
21
+ │ │ ├── colors.ts # The raw hex codes (100-1100 scale)
22
+ │ │ ├── preset.ts # The Tailwind Preset (Critical!)
23
+ │ │ ├── plugin.ts # Tailwind plugin for CSS vars
24
+ │ │ └── ThemeProvider.tsx # React Context for switching energies
25
+ │ │
26
+ │ ├── lib/ # Utilities
27
+ │ │ └── utils.ts # standard cn() helper
28
+ │ │
29
+ │ ├── styles/ # Global CSS
30
+ │ │ └── globals.css # Base Tailwind directives (@tailwind base...)
31
+ │ │
32
+ │ └── index.ts # MAIN ENTRY POINT (Exports everything)
33
+
34
+ ├── dist/ # Build output (Generated by tsup)
35
+ │ ├── index.js
36
+ │ ├── index.d.ts
37
+ │ └── index.css
38
+
39
+ └── tsup.config.ts # Builder config (Best for libraries)
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cva } from 'class-variance-authority';
3
+ import { Slot } from 'radix-ui';
4
+ import { cn } from '@/src/lib/utils';
5
+ const buttonVariants = cva("focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none", {
6
+ variants: {
7
+ variant: {
8
+ default: 'bg-primary text-primary-foreground [a]:hover:bg-primary/80',
9
+ outline: 'border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground',
10
+ secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground',
11
+ ghost: 'hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground',
12
+ destructive: 'bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30',
13
+ link: 'text-primary underline-offset-4 hover:underline'
14
+ },
15
+ size: {
16
+ default: 'h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
17
+ xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
18
+ sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
19
+ lg: 'h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3',
20
+ icon: 'size-8',
21
+ 'icon-xs': "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
22
+ 'icon-sm': 'size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg',
23
+ 'icon-lg': 'size-9'
24
+ }
25
+ },
26
+ defaultVariants: {
27
+ variant: 'default',
28
+ size: 'default'
29
+ }
30
+ });
31
+ function Button({ className, variant = 'default', size = 'default', asChild = false, ...props }) {
32
+ const Comp = asChild ? Slot.Root : 'button';
33
+ return (_jsx(Comp, { "data-slot": "button", "data-variant": variant, "data-size": size, className: cn(buttonVariants({ variant, size, className })), ...props }));
34
+ }
35
+ export { Button, buttonVariants };
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{cva as r}from"class-variance-authority";import{Slot as i}from"radix-ui";import{clsx as a}from"clsx";import{twMerge as t}from"tailwind-merge";function n(...e){return t(a(e))}const d=r("focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",destructive:"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function o({className:r,variant:a="default",size:t="default",asChild:o=!1,...s}){const u=o?i.Root:"button";return e(u,{"data-slot":"button","data-variant":a,"data-size":t,className:n(d({variant:a,size:t,className:r})),...s})}export{o as Button};
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ import { Button } from '@/src/components/button';
2
+ export { Button };
@@ -0,0 +1,5 @@
1
+ import { clsx } from 'clsx';
2
+ import { twMerge } from 'tailwind-merge';
3
+ export function cn(...inputs) {
4
+ return twMerge(clsx(inputs));
5
+ }
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { type VariantProps } from 'class-variance-authority';
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" | "link" | null | undefined;
5
+ size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
6
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
7
+ declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
8
+ asChild?: boolean;
9
+ }): import("react/jsx-runtime").JSX.Element;
10
+ export { Button, buttonVariants };
@@ -0,0 +1,2 @@
1
+ import { Button } from '@/src/components/button';
2
+ export { Button };
@@ -0,0 +1,2 @@
1
+ import { type ClassValue } from 'clsx';
2
+ export declare function cn(...inputs: ClassValue[]): string;
package/package.json ADDED
@@ -0,0 +1,94 @@
1
+ {
2
+ "name": "get-elementa-ui",
3
+ "version": "1.0.0",
4
+ "description": "Elementa UI components library.",
5
+ "homepage": "https://deriva.xyz/branding",
6
+ "main": "dist/index.js",
7
+ "module": "dist/index.esm.js",
8
+ "types": "dist/types/index.d.ts",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/deriva-inc/elementa-ui.git"
12
+ },
13
+ "author": "Aayush Goyal <aayushgoyal.mps@gmail.com>",
14
+ "license": "MIT",
15
+ "private": false,
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "files": [
20
+ "dist/**/*",
21
+ "src/index.ts",
22
+ "README.md",
23
+ "LICENSE"
24
+ ],
25
+ "keywords": [
26
+ "react",
27
+ "library",
28
+ "nodejs",
29
+ "shadcn-ui",
30
+ "shadcnui",
31
+ "javascript",
32
+ "typescript",
33
+ "component-library",
34
+ "elementa",
35
+ "elementa-ui"
36
+ ],
37
+ "scripts": {
38
+ "build": "rollup -c && tsc",
39
+ "build:watch": "rollup -c -w",
40
+ "prepublishOnly": "npm run build",
41
+ "publish:npm": "npm publish --access public",
42
+ "svgr": "svgr src/icons/*.svg --stdin-filepath .prettierrc --template src/lib/template.js --expand-props none --ignore-existing"
43
+ },
44
+ "peerDependencies": {
45
+ "react": "^19.1.0"
46
+ },
47
+ "devDependencies": {
48
+ "@babel/core": "^7.27.4",
49
+ "@babel/preset-react": "^7.27.1",
50
+ "@babel/preset-typescript": "^7.27.1",
51
+ "@babel/template": "^7.27.2",
52
+ "@rollup/plugin-babel": "^6.0.4",
53
+ "@rollup/plugin-commonjs": "^28.0.6",
54
+ "@rollup/plugin-json": "^6.1.0",
55
+ "@rollup/plugin-node-resolve": "^16.0.1",
56
+ "@rollup/plugin-typescript": "^12.1.3",
57
+ "@svgr/cli": "^8.1.0",
58
+ "@types/babel__core": "^7.20.5",
59
+ "@types/babel__template": "^7.4.4",
60
+ "@types/node": "^20.12.2",
61
+ "@types/react": "^19.1.8",
62
+ "@typescript-eslint/eslint-plugin": "^7.5.0",
63
+ "@typescript-eslint/parser": "^7.5.0",
64
+ "autoprefixer": "^10.4.19",
65
+ "eslint": "^8.57.0",
66
+ "eslint-config-airbnb": "^19.0.4",
67
+ "eslint-config-prettier": "^9.1.0",
68
+ "eslint-plugin-import": "^2.29.1",
69
+ "eslint-plugin-jsx-a11y": "^6.8.0",
70
+ "eslint-plugin-prettier": "^5.1.3",
71
+ "eslint-plugin-react": "^7.34.1",
72
+ "eslint-plugin-react-hooks": "^4.6.0",
73
+ "husky": "^9.0.11",
74
+ "prettier": "^3.2.4",
75
+ "prettier-plugin-tailwind": "^2.2.12",
76
+ "prettier-plugin-tailwindcss": "^0.6.14",
77
+ "rollup": "^4.44.0",
78
+ "rollup-plugin-dts": "^6.2.1",
79
+ "rollup-plugin-terser": "^7.0.2",
80
+ "tailwindcss": "^4.2.1",
81
+ "tslib": "^2.8.1",
82
+ "typescript": "^5.8.3"
83
+ },
84
+ "dependencies": {
85
+ "class-variance-authority": "^0.7.1",
86
+ "clsx": "^2.1.1",
87
+ "lucide-react": "^0.575.0",
88
+ "radix-ui": "^1.4.3",
89
+ "shadcn": "^3.8.5",
90
+ "tailwind-merge": "^3.5.0",
91
+ "ts-node": "^10.9.2",
92
+ "tw-animate-css": "^1.4.0"
93
+ }
94
+ }
package/src/index.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { Button } from '@/src/components/button';
2
+
3
+ export { Button };