@darthcharles/greda 0.0.0-stage → 0.2.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) 2026 Carlos Contreras
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 CHANGED
@@ -1,3 +1,125 @@
1
- # Temporary Holding Version
1
+ # Greda
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Composable React components with a neutral base theme and CSS tokens you control.
4
+ Built from shadcn/ui New York and Radix primitives, with compiled styles and
5
+ TypeScript declarations. Supports React 18 and 19; no Tailwind setup required.
6
+
7
+ **[Explore Storybook](https://elegant-hotteok-cbb834.netlify.app/)** ·
8
+ [Theming guide](https://elegant-hotteok-cbb834.netlify.app/?path=/docs/introduction-overview--theming) ·
9
+ [Design tokens](https://elegant-hotteok-cbb834.netlify.app/?path=/story/design-tokens--overview)
10
+
11
+ ## Quick start
12
+
13
+ Install into an existing React application with React and React DOM 18.2+ or 19:
14
+
15
+ ```bash
16
+ npm install @darthcharles/greda
17
+ ```
18
+
19
+ Import the stylesheet once at your application's entry point:
20
+
21
+ ```tsx
22
+ import "@darthcharles/greda/styles.css";
23
+ ```
24
+
25
+ Then import the components you need:
26
+
27
+ ```tsx
28
+ import { Button } from "@darthcharles/greda";
29
+
30
+ export function Example() {
31
+ return <Button>Continue</Button>;
32
+ }
33
+ ```
34
+
35
+ The stylesheet includes a ready-to-use base theme, CSS tokens, and scoped
36
+ component styles. No custom theme or additional CSS is required to use Greda.
37
+ Your application controls its own page layout, backgrounds, and fonts. React
38
+ and React DOM remain peer dependencies outside the ESM bundle.
39
+
40
+ Visit [Storybook](https://elegant-hotteok-cbb834.netlify.app/) for component APIs,
41
+ variants, interaction examples, and accessibility guidance.
42
+
43
+ Greda and application markup share unprefixed utility classes such as
44
+ `bg-primary`, `text-foreground`, and `border-primary`. Pass them through
45
+ `className` to override component defaults. See the theming guide for supported
46
+ utilities and migration from `ds-*` classes.
47
+
48
+ ## With Tailwind 4
49
+
50
+ Import Greda's tokens in your app's Tailwind CSS entry point. This registers the
51
+ theme so Tailwind can generate utilities without a preset or manual mappings:
52
+
53
+ ```css
54
+ @import "tailwindcss";
55
+ @import "@darthcharles/greda/tokens.css";
56
+ ```
57
+
58
+ ```tsx
59
+ <div className="bg-primary p-4 text-primary-foreground hover:bg-primary-hover">
60
+ Your content
61
+ </div>
62
+ ```
63
+
64
+ To use Greda components too, add
65
+ `@import "@darthcharles/greda/styles.css" layer(components);` between those two
66
+ imports, instead of importing `styles.css` again in JavaScript. The layer lets
67
+ your generated utilities override component styles, including responsive variants.
68
+ The import-only theme integration requires Tailwind 4; Greda's precompiled
69
+ component styles also work without Tailwind.
70
+
71
+ ## Theming
72
+
73
+ Customization is optional. To change the default theme, import your own
74
+ `theme.css` after the package stylesheet and override only the tokens you need.
75
+ Unspecified values keep their base defaults, and components and color utilities
76
+ automatically use your overrides:
77
+
78
+ ```css
79
+ /* theme.css */
80
+ :root {
81
+ --primary: 9.500 55.556% 42.353%;
82
+ --primary-hover: 9.714 56.150% 36.667%;
83
+ --primary-foreground: 0 0% 100%;
84
+ --ring: 9.500 55.556% 42.353%;
85
+ --radius: 0.75rem;
86
+ }
87
+ ```
88
+
89
+ Colors use space-separated HSL channels without an `hsl()` wrapper;
90
+ `--overlay` also includes alpha. Other tokens accept ordinary CSS values.
91
+
92
+ Spacing tokens such as `--space-4` are shared distances for padding, margin, and
93
+ gap. Use them directly in your own CSS when needed; layout rules are optional
94
+ examples, not theme setup. If you only need tokens, import
95
+ `@darthcharles/greda/tokens.css` instead of `styles.css`.
96
+
97
+ Set `data-color-scheme="dark"` on `<html>` for the base dark palette. Brand
98
+ overrides need matching dark colors. Apply themes to `<html>` so portaled
99
+ content inherits them; scoped themes use the content component's `container` prop.
100
+
101
+ The [theming guide](https://elegant-hotteok-cbb834.netlify.app/?path=/docs/introduction-overview--theming)
102
+ covers fonts, dark mode, and scoped portals. Browse the
103
+ [interactive token catalog](https://elegant-hotteok-cbb834.netlify.app/?path=/story/design-tokens--overview)
104
+ or read the defaults in [tokens.css](src/styles/tokens.css).
105
+
106
+ ## Development
107
+
108
+ Use Node 24 and the committed npm lockfile:
109
+
110
+ ```bash
111
+ nvm use
112
+ npm ci
113
+ npm run storybook
114
+ ```
115
+
116
+ Storybook runs at [localhost:6006](http://localhost:6006). Run `npm run check`
117
+ for project validation, then `npm run test:browser` for Playwright checks.
118
+
119
+ See [Contributing](CONTRIBUTING.md) for build commands, Netlify hosting, upstream
120
+ sources, and release guidance.
121
+
122
+ ## License
123
+
124
+ [MIT](LICENSE) © 2026 Carlos Contreras. See
125
+ [Third-party notices](THIRD_PARTY_NOTICES.md) for upstream attribution.
@@ -0,0 +1,19 @@
1
+ # Third-party notices
2
+
3
+ The components in `src/components/ui/` are adapted from shadcn/ui's official
4
+ New York registry, distributed under the MIT license.
5
+
6
+ - Source: https://github.com/shadcn-ui/ui
7
+ - Registry: https://ui.shadcn.com/r/styles/new-york/{component}.json
8
+ - Original copyright and license: `upstream/shadcn-ui/LICENSE.md` (included in the package)
9
+ - Exact downloaded source, retrieval date, and hashes: `upstream/shadcn-ui/`
10
+
11
+ This project uses the React 18-compatible New York component sources and
12
+ Tailwind 3.4. Radix dependencies remain because they are used by those shadcn
13
+ components. The upstream Toast is maintained here as the explicit primitive API
14
+ requested for the initial component set.
15
+
16
+ Local adaptations: relative imports; shared semantic color utilities; a scoped CSS baseline;
17
+ consumer token mapping; optional portal containers; button loading, 1px press feedback from the current Nova style, and a default
18
+ non-submit type; viewport bounds on dialogs; invalid-field styles; an accessible
19
+ toast close name; and a distinct indeterminate checkbox icon.
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const badgeVariants: (props?: ({
4
+ variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
7
+ }
8
+ declare function Badge({ className, variant, ...props }: BadgeProps): React.JSX.Element;
9
+ export { Badge, badgeVariants };
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
5
+ size?: "default" | "sm" | "lg" | "icon" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
8
+ loading?: boolean;
9
+ asChild?: boolean;
10
+ }
11
+ declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
12
+ export { Button, buttonVariants };
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
3
+ declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
4
+ declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
5
+ declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
6
+ declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
7
+ declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
8
+ export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent, };
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
3
+ declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
4
+ export { Checkbox };
@@ -0,0 +1,24 @@
1
+ import * as React from "react";
2
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
3
+ declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
4
+ declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
+ declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
6
+ declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
7
+ declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
+ export type DialogContentProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {
9
+ container?: React.ComponentPropsWithoutRef<typeof DialogPrimitive.Portal>["container"];
10
+ };
11
+ declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
12
+ container?: React.ComponentPropsWithoutRef<typeof DialogPrimitive.Portal>["container"];
13
+ } & React.RefAttributes<HTMLDivElement>>;
14
+ declare const DialogHeader: {
15
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
16
+ displayName: string;
17
+ };
18
+ declare const DialogFooter: {
19
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
20
+ displayName: string;
21
+ };
22
+ declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
23
+ declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
24
+ export { Dialog, DialogPortal, DialogOverlay, DialogTrigger, DialogClose, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ declare const Input: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
3
+ export { Input };
@@ -0,0 +1,5 @@
1
+ import * as React from "react";
2
+ import * as LabelPrimitive from "@radix-ui/react-label";
3
+ import { type VariantProps } from "class-variance-authority";
4
+ declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: import("class-variance-authority/types").ClassProp | undefined) => string> & React.RefAttributes<HTMLLabelElement>>;
5
+ export { Label };
@@ -0,0 +1,18 @@
1
+ import * as React from "react";
2
+ import * as SelectPrimitive from "@radix-ui/react-select";
3
+ declare const Select: React.FC<SelectPrimitive.SelectProps>;
4
+ declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
5
+ declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
6
+ declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
7
+ declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
+ declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
+ export type SelectContentProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> & {
10
+ container?: React.ComponentPropsWithoutRef<typeof SelectPrimitive.Portal>["container"];
11
+ };
12
+ declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
13
+ container?: React.ComponentPropsWithoutRef<typeof SelectPrimitive.Portal>["container"];
14
+ } & React.RefAttributes<HTMLDivElement>>;
15
+ declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
16
+ declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
17
+ declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
18
+ export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, };
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import * as TabsPrimitive from "@radix-ui/react-tabs";
3
+ declare const Tabs: React.ForwardRefExoticComponent<TabsPrimitive.TabsProps & React.RefAttributes<HTMLDivElement>>;
4
+ declare const TabsList: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
+ declare const TabsTrigger: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
6
+ declare const TabsContent: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
7
+ export { Tabs, TabsList, TabsTrigger, TabsContent };
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ declare const Textarea: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
3
+ export { Textarea };
@@ -0,0 +1,15 @@
1
+ import * as React from "react";
2
+ import * as ToastPrimitives from "@radix-ui/react-toast";
3
+ import { type VariantProps } from "class-variance-authority";
4
+ declare const ToastProvider: React.FC<ToastPrimitives.ToastProviderProps>;
5
+ declare const ToastViewport: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastViewportProps & React.RefAttributes<HTMLOListElement>, "ref"> & React.RefAttributes<HTMLOListElement>>;
6
+ declare const Toast: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastProps & React.RefAttributes<HTMLLIElement>, "ref"> & VariantProps<(props?: ({
7
+ variant?: "default" | "destructive" | null | undefined;
8
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLLIElement>>;
9
+ declare const ToastAction: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastActionProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
10
+ declare const ToastClose: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastCloseProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
11
+ declare const ToastTitle: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastTitleProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
+ declare const ToastDescription: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastDescriptionProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
+ type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;
14
+ type ToastActionElement = React.ReactElement<typeof ToastAction>;
15
+ export { type ToastProps, type ToastActionElement, ToastProvider, ToastViewport, Toast, ToastTitle, ToastDescription, ToastClose, ToastAction, };
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ import * as TooltipPrimitive from "@radix-ui/react-tooltip";
3
+ declare const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps>;
4
+ declare const Tooltip: React.FC<TooltipPrimitive.TooltipProps>;
5
+ declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
6
+ export type TooltipContentProps = React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {
7
+ container?: React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Portal>["container"];
8
+ };
9
+ declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
10
+ container?: React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Portal>["container"];
11
+ } & React.RefAttributes<HTMLDivElement>>;
12
+ export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
@@ -0,0 +1,13 @@
1
+ export * from "./components/ui/button";
2
+ export * from "./components/ui/input";
3
+ export * from "./components/ui/textarea";
4
+ export * from "./components/ui/label";
5
+ export * from "./components/ui/select";
6
+ export * from "./components/ui/dialog";
7
+ export * from "./components/ui/card";
8
+ export * from "./components/ui/badge";
9
+ export * from "./components/ui/checkbox";
10
+ export * from "./components/ui/tabs";
11
+ export * from "./components/ui/toast";
12
+ export * from "./components/ui/tooltip";
13
+ export { cn } from "./lib/utils";