xplode-ui 0.1.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 +21 -0
- package/README.md +71 -0
- package/dist/components/Button/Button.d.ts +16 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/index.cjs.js +2 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +43 -0
- package/dist/index.es.js.map +1 -0
- package/dist/styles.css +2 -0
- package/dist/theme.css +25 -0
- package/dist/utils/cn.d.ts +2 -0
- package/package.json +100 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 George Fernandez
|
|
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,71 @@
|
|
|
1
|
+
# Xplode UI
|
|
2
|
+
|
|
3
|
+
A personal React component library built with **TypeScript**, **Tailwind CSS v4**, and **CVA** (class-variance-authority).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install xplode-ui
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
`react` and `react-dom` (v18 or v19) are peer dependencies, so make sure they are installed in your project.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
Import the component and the prebuilt stylesheet once at your app's entry point:
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { Button } from "xplode-ui";
|
|
19
|
+
import "xplode-ui/styles.css";
|
|
20
|
+
|
|
21
|
+
export function App() {
|
|
22
|
+
return (
|
|
23
|
+
<Button variant="primary" size="md">
|
|
24
|
+
Click me
|
|
25
|
+
</Button>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The bundled `xplode-ui/styles.css` is self-contained — **you do not need Tailwind CSS installed** to use the components.
|
|
31
|
+
|
|
32
|
+
## Components
|
|
33
|
+
|
|
34
|
+
### Button
|
|
35
|
+
|
|
36
|
+
| Prop | Type | Default |
|
|
37
|
+
| --------- | ----------------------------------------------- | ----------- |
|
|
38
|
+
| `variant` | `"default" \| "secondary" \| "ghost" \| "danger"` | `"default"` |
|
|
39
|
+
| `size` | `"sm" \| "md" \| "lg"` | `"md"` |
|
|
40
|
+
|
|
41
|
+
All standard `<button>` attributes are forwarded, and a `ref` is forwarded to the underlying element.
|
|
42
|
+
|
|
43
|
+
## Theming (Tailwind v4 consumers)
|
|
44
|
+
|
|
45
|
+
If your app already uses Tailwind v4, you can pull in Xplode UI's design tokens and override them in your own `@theme`:
|
|
46
|
+
|
|
47
|
+
```css
|
|
48
|
+
/* your app.css */
|
|
49
|
+
@import "tailwindcss";
|
|
50
|
+
@import "xplode-ui/theme.css";
|
|
51
|
+
|
|
52
|
+
/* make Tailwind scan the library's classes */
|
|
53
|
+
@source "../node_modules/xplode-ui/dist";
|
|
54
|
+
|
|
55
|
+
@theme {
|
|
56
|
+
/* override any token, e.g. the brand color */
|
|
57
|
+
--color-brand-600: oklch(0.55 0.2 150);
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Development
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npm run storybook # component playground + docs
|
|
65
|
+
npm run test # run unit/component tests (Vitest + Testing Library)
|
|
66
|
+
npm run build # build the library into dist/
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## License
|
|
70
|
+
|
|
71
|
+
[MIT](./LICENSE)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "secondary" | "ghost" | "danger" | null | undefined;
|
|
5
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<typeof buttonVariants> & {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export declare const Button: import('react').ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<(props?: ({
|
|
11
|
+
variant?: "default" | "secondary" | "ghost" | "danger" | null | undefined;
|
|
12
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
13
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string> & {
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
} & import('react').RefAttributes<HTMLButtonElement>>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react"),t=require("class-variance-authority"),n=require("clsx"),r=require("tailwind-merge"),i=require("react/jsx-runtime");function a(...e){return(0,r.twMerge)((0,n.clsx)(e))}var o=(0,t.cva)(`inline-flex items-center justify-center rounded-md font-sans text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`,{variants:{variant:{default:`bg-black text-white hover:bg-neutral-800`,secondary:`bg-neutral-100 text-neutral-900 hover:bg-neutral-200`,ghost:`bg-transparent text-neutral-900 hover:bg-neutral-100`,danger:`bg-red-600 text-white hover:bg-red-700`},size:{sm:`h-8 px-3`,md:`h-10 px-4`,lg:`h-12 px-6`}},defaultVariants:{variant:`default`,size:`md`}}),s=(0,e.forwardRef)(({className:e,variant:t,size:n,children:r,...s},c)=>(0,i.jsx)(`button`,{ref:c,className:a(o({variant:t,size:n}),e),...s,children:r}));s.displayName=`Button`,exports.Button=s;
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","names":[],"sources":["../src/utils/cn.ts","../src/components/Button/Button.tsx"],"sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\r\nimport { twMerge } from \"tailwind-merge\";\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n return twMerge(clsx(inputs));\r\n}\r\n","import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../utils/cn\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center rounded-md font-sans text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default: \"bg-black text-white hover:bg-neutral-800\",\n secondary: \"bg-neutral-100 text-neutral-900 hover:bg-neutral-200\",\n ghost: \"bg-transparent text-neutral-900 hover:bg-neutral-100\",\n danger: \"bg-red-600 text-white hover:bg-red-700\",\n },\n size: {\n sm: \"h-8 px-3\",\n md: \"h-10 px-4\",\n lg: \"h-12 px-6\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n }\n);\n\nexport type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> &\n VariantProps<typeof buttonVariants> & {\n children: ReactNode;\n };\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, children, ...props }, ref) => {\n return (\n <button\n ref={ref}\n className={cn(buttonVariants({ variant, size }), className)}\n {...props}\n >\n {children}\n </button>\n );\n }\n);\n\nButton.displayName = \"Button\";\n"],"mappings":"6MAGA,SAAgB,EAAG,GAAG,EAAsB,CAC1C,OAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAoB,CAAM,CAAC,CAC7B,CCDA,IAAM,GAAA,EAAA,EAAA,KACJ,kOACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,2CACT,UAAW,uDACX,MAAO,uDACP,OAAQ,wCACV,EACA,KAAM,CACJ,GAAI,WACJ,GAAI,YACJ,GAAI,WACN,CACF,EACA,gBAAiB,CACf,QAAS,UACT,KAAM,IACR,CACF,CACF,EAOa,GAAA,EAAA,EAAA,aACV,CAAE,YAAW,UAAS,OAAM,WAAU,GAAG,GAAS,KAE/C,EAAA,EAAA,KAAC,SAAD,CACO,MACL,UAAW,EAAG,EAAe,CAAE,UAAS,MAAK,CAAC,EAAG,CAAS,EAC1D,GAAI,EAEH,UACK,CAAA,CAGd,EAEA,EAAO,YAAc"}
|
package/dist/index.d.ts
ADDED
package/dist/index.es.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { forwardRef as e } from "react";
|
|
2
|
+
import { cva as t } from "class-variance-authority";
|
|
3
|
+
import { clsx as n } from "clsx";
|
|
4
|
+
import { twMerge as r } from "tailwind-merge";
|
|
5
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
6
|
+
//#region src/utils/cn.ts
|
|
7
|
+
function a(...e) {
|
|
8
|
+
return r(n(e));
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/components/Button/Button.tsx
|
|
12
|
+
var o = t("inline-flex items-center justify-center rounded-md font-sans text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", {
|
|
13
|
+
variants: {
|
|
14
|
+
variant: {
|
|
15
|
+
default: "bg-black text-white hover:bg-neutral-800",
|
|
16
|
+
secondary: "bg-neutral-100 text-neutral-900 hover:bg-neutral-200",
|
|
17
|
+
ghost: "bg-transparent text-neutral-900 hover:bg-neutral-100",
|
|
18
|
+
danger: "bg-red-600 text-white hover:bg-red-700"
|
|
19
|
+
},
|
|
20
|
+
size: {
|
|
21
|
+
sm: "h-8 px-3",
|
|
22
|
+
md: "h-10 px-4",
|
|
23
|
+
lg: "h-12 px-6"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
variant: "default",
|
|
28
|
+
size: "md"
|
|
29
|
+
}
|
|
30
|
+
}), s = e(({ className: e, variant: t, size: n, children: r, ...s }, c) => /* @__PURE__ */ i("button", {
|
|
31
|
+
ref: c,
|
|
32
|
+
className: a(o({
|
|
33
|
+
variant: t,
|
|
34
|
+
size: n
|
|
35
|
+
}), e),
|
|
36
|
+
...s,
|
|
37
|
+
children: r
|
|
38
|
+
}));
|
|
39
|
+
s.displayName = "Button";
|
|
40
|
+
//#endregion
|
|
41
|
+
export { s as Button };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","names":[],"sources":["../src/utils/cn.ts","../src/components/Button/Button.tsx"],"sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\r\nimport { twMerge } from \"tailwind-merge\";\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n return twMerge(clsx(inputs));\r\n}\r\n","import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../utils/cn\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center rounded-md font-sans text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default: \"bg-black text-white hover:bg-neutral-800\",\n secondary: \"bg-neutral-100 text-neutral-900 hover:bg-neutral-200\",\n ghost: \"bg-transparent text-neutral-900 hover:bg-neutral-100\",\n danger: \"bg-red-600 text-white hover:bg-red-700\",\n },\n size: {\n sm: \"h-8 px-3\",\n md: \"h-10 px-4\",\n lg: \"h-12 px-6\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n }\n);\n\nexport type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> &\n VariantProps<typeof buttonVariants> & {\n children: ReactNode;\n };\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, children, ...props }, ref) => {\n return (\n <button\n ref={ref}\n className={cn(buttonVariants({ variant, size }), className)}\n {...props}\n >\n {children}\n </button>\n );\n }\n);\n\nButton.displayName = \"Button\";\n"],"mappings":";;;;;;AAGA,SAAgB,EAAG,GAAG,GAAsB;CAC1C,OAAO,EAAQ,EAAK,CAAM,CAAC;AAC7B;;;ACDA,IAAM,IAAiB,EACrB,mOACA;CACE,UAAU;EACR,SAAS;GACP,SAAS;GACT,WAAW;GACX,OAAO;GACP,QAAQ;EACV;EACA,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;CACF;CACA,iBAAiB;EACf,SAAS;EACT,MAAM;CACR;AACF,CACF,GAOa,IAAS,GACnB,EAAE,cAAW,YAAS,SAAM,aAAU,GAAG,KAAS,MAE/C,kBAAC,UAAD;CACO;CACL,WAAW,EAAG,EAAe;EAAE;EAAS;CAAK,CAAC,GAAG,CAAS;CAC1D,GAAI;CAEH;AACK,CAAA,CAGd;AAEA,EAAO,cAAc"}
|
package/dist/styles.css
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@import "https://fonts.googleapis.com/css2?family=Instrument+Sans:ital,wght@0,400..700;1,400..700&display=swap";@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:root,:host{--font-sans:"Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-neutral-100:oklch(97% 0 0);--color-neutral-200:oklch(92.2% 0 0);--color-neutral-800:oklch(26.9% 0 0);--color-neutral-900:oklch(20.5% 0 0);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--font-weight-medium:500;--radius-md:.375rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-brand-600:oklch(51% .2 264)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.flex{display:flex}.inline-flex{display:inline-flex}.h-8{height:calc(var(--spacing) * 8)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.gap-3{gap:calc(var(--spacing) * 3)}.rounded-md{border-radius:var(--radius-md)}.bg-black{background-color:var(--color-black)}.bg-neutral-100{background-color:var(--color-neutral-100)}.bg-red-600{background-color:var(--color-red-600)}.bg-transparent{background-color:#0000}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.font-sans{font-family:var(--font-sans)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.text-neutral-900{color:var(--color-neutral-900)}.text-white{color:var(--color-white)}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}@media (hover:hover){.hover\:bg-neutral-100:hover{background-color:var(--color-neutral-100)}.hover\:bg-neutral-200:hover{background-color:var(--color-neutral-200)}.hover\:bg-neutral-800:hover{background-color:var(--color-neutral-800)}.hover\:bg-red-700:hover{background-color:var(--color-red-700)}}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:opacity-50:disabled{opacity:.5}}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}
|
package/dist/theme.css
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* xplode-ui design tokens.
|
|
3
|
+
*
|
|
4
|
+
* Shipped as `xplode-ui/theme.css`. Tailwind v4 consumers can `@import` this to
|
|
5
|
+
* pick up the library's tokens and override any of them in their own `@theme`.
|
|
6
|
+
* This file intentionally does NOT `@import "tailwindcss"` so it can be composed
|
|
7
|
+
* into a consumer's existing Tailwind setup without duplicating the framework.
|
|
8
|
+
*/
|
|
9
|
+
@theme {
|
|
10
|
+
--font-sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system,
|
|
11
|
+
"Segoe UI", sans-serif;
|
|
12
|
+
|
|
13
|
+
--color-brand-50: oklch(0.97 0.01 264);
|
|
14
|
+
--color-brand-100: oklch(0.93 0.03 264);
|
|
15
|
+
--color-brand-200: oklch(0.86 0.06 264);
|
|
16
|
+
--color-brand-300: oklch(0.76 0.1 264);
|
|
17
|
+
--color-brand-400: oklch(0.66 0.15 264);
|
|
18
|
+
--color-brand-500: oklch(0.58 0.19 264);
|
|
19
|
+
--color-brand-600: oklch(0.51 0.2 264);
|
|
20
|
+
--color-brand-700: oklch(0.45 0.18 264);
|
|
21
|
+
--color-brand-800: oklch(0.39 0.15 264);
|
|
22
|
+
--color-brand-900: oklch(0.34 0.11 264);
|
|
23
|
+
|
|
24
|
+
--radius-button: 0.375rem;
|
|
25
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "xplode-ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Xplode UI - A React component library built with TypeScript, Tailwind CSS and CVA.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "George Fernandez <georgfdz@gmail.com>",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"react",
|
|
10
|
+
"react-component",
|
|
11
|
+
"component-library",
|
|
12
|
+
"ui",
|
|
13
|
+
"tailwindcss",
|
|
14
|
+
"tailwind",
|
|
15
|
+
"cva",
|
|
16
|
+
"design-system",
|
|
17
|
+
"typescript"
|
|
18
|
+
],
|
|
19
|
+
"homepage": "https://github.com/georgefdz/xplode-ui#readme",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/georgefdz/xplode-ui.git"
|
|
23
|
+
},
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/georgefdz/xplode-ui/issues"
|
|
26
|
+
},
|
|
27
|
+
"sideEffects": [
|
|
28
|
+
"**/*.css"
|
|
29
|
+
],
|
|
30
|
+
"main": "./dist/index.cjs.js",
|
|
31
|
+
"module": "./dist/index.es.js",
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"import": "./dist/index.es.js",
|
|
37
|
+
"require": "./dist/index.cjs.js"
|
|
38
|
+
},
|
|
39
|
+
"./styles.css": "./dist/styles.css",
|
|
40
|
+
"./theme.css": "./dist/theme.css"
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"dist"
|
|
44
|
+
],
|
|
45
|
+
"scripts": {
|
|
46
|
+
"build": "tsc -b && vite build && npm run build:css",
|
|
47
|
+
"build:css": "tailwindcss -i src/styles/index.css -o dist/styles.css --minify && node scripts/copy-theme.mjs",
|
|
48
|
+
"lint": "eslint .",
|
|
49
|
+
"test": "vitest run",
|
|
50
|
+
"test:watch": "vitest",
|
|
51
|
+
"storybook": "storybook dev -p 6006",
|
|
52
|
+
"build-storybook": "storybook build",
|
|
53
|
+
"prepublishOnly": "npm run build"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"react": ">=18",
|
|
57
|
+
"react-dom": ">=18"
|
|
58
|
+
},
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"class-variance-authority": "^0.7.1",
|
|
61
|
+
"clsx": "^2.1.1",
|
|
62
|
+
"tailwind-merge": "^3.6.0"
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@chromatic-com/storybook": "^5.2.1",
|
|
66
|
+
"@eslint/js": "^10.0.1",
|
|
67
|
+
"@storybook/addon-a11y": "^10.4.1",
|
|
68
|
+
"@storybook/addon-docs": "^10.4.1",
|
|
69
|
+
"@storybook/addon-mcp": "^0.6.0",
|
|
70
|
+
"@storybook/addon-vitest": "^10.4.1",
|
|
71
|
+
"@storybook/react-vite": "^10.4.1",
|
|
72
|
+
"@tailwindcss/cli": "^4.3.0",
|
|
73
|
+
"@tailwindcss/vite": "^4.3.0",
|
|
74
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
75
|
+
"@testing-library/react": "^16.3.2",
|
|
76
|
+
"@testing-library/user-event": "^14.6.1",
|
|
77
|
+
"@types/node": "^24.12.3",
|
|
78
|
+
"@types/react": "^19.2.14",
|
|
79
|
+
"@types/react-dom": "^19.2.3",
|
|
80
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
81
|
+
"@vitest/browser-playwright": "^4.1.7",
|
|
82
|
+
"@vitest/coverage-v8": "^4.1.7",
|
|
83
|
+
"eslint": "^10.3.0",
|
|
84
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
85
|
+
"eslint-plugin-react-refresh": "^0.5.2",
|
|
86
|
+
"eslint-plugin-storybook": "^10.4.1",
|
|
87
|
+
"globals": "^17.6.0",
|
|
88
|
+
"jsdom": "^29.1.1",
|
|
89
|
+
"playwright": "^1.60.0",
|
|
90
|
+
"react": "^19.2.6",
|
|
91
|
+
"react-dom": "^19.2.6",
|
|
92
|
+
"storybook": "^10.4.1",
|
|
93
|
+
"tailwindcss": "^4.3.0",
|
|
94
|
+
"typescript": "~6.0.2",
|
|
95
|
+
"typescript-eslint": "^8.59.2",
|
|
96
|
+
"vite": "^8.0.12",
|
|
97
|
+
"vite-plugin-dts": "^5.0.1",
|
|
98
|
+
"vitest": "^4.1.7"
|
|
99
|
+
}
|
|
100
|
+
}
|