@josefinaestevez/ui 0.0.0-stage → 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 +187 -2
- package/dist/components/Button.d.ts +22 -0
- package/dist/components/Button.js +57 -0
- package/dist/components/Card.d.ts +29 -0
- package/dist/components/Card.js +45 -0
- package/dist/components/Disclosure.d.ts +31 -0
- package/dist/components/Disclosure.js +52 -0
- package/dist/components/Footer.d.ts +31 -0
- package/dist/components/Footer.js +44 -0
- package/dist/components/Header.d.ts +26 -0
- package/dist/components/Header.js +44 -0
- package/dist/components/LanguageSwitcher.d.ts +18 -0
- package/dist/components/LanguageSwitcher.js +33 -0
- package/dist/components/NavLink.d.ts +16 -0
- package/dist/components/NavLink.js +25 -0
- package/dist/components/Spinner.d.ts +15 -0
- package/dist/components/Spinner.js +24 -0
- package/dist/fonts.css +6 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +21 -0
- package/dist/theme.css +49 -0
- package/dist/types.d.ts +8 -0
- package/dist/types.js +0 -0
- package/package.json +88 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Josefina Estevez
|
|
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,188 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @josefinaestevez/ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The shared design system behind [Veyra](https://veyra-one.vercel.app) and [Phase](https://phase-sandy.vercel.app): theme tokens for Tailwind CSS 4 and a small set of accessible React 19 components. Both apps consume this package, so a change to a colour, a font or the header lands in both in one release.
|
|
4
|
+
|
|
5
|
+
What's inside:
|
|
6
|
+
|
|
7
|
+
- `theme.css`: the `arcana` colour palette, font stacks, animations and base styles as a Tailwind 4 `@theme`
|
|
8
|
+
- `fonts.css`: self-hosted Cormorant Garamond and Inter (optional)
|
|
9
|
+
- Components: `Button`, `Card`, `Disclosure`, `Header`, `NavLink`, `LanguageSwitcher`, `Footer`, `Spinner`
|
|
10
|
+
|
|
11
|
+
The components carry no routing, auth or data logic. Links are rendered through an injectable `linkComponent`, so the package works with Next.js without depending on it. `AUDIT.md` explains how the two apps were reconciled.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
npm install @josefinaestevez/ui
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Peer dependencies: `react` and `react-dom` 19, `tailwindcss` 4.
|
|
20
|
+
|
|
21
|
+
## Tailwind setup
|
|
22
|
+
|
|
23
|
+
In the app's global stylesheet, import the theme after Tailwind:
|
|
24
|
+
|
|
25
|
+
```css
|
|
26
|
+
@import "tailwindcss";
|
|
27
|
+
@import "@josefinaestevez/ui/theme.css";
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Tailwind does not scan `node_modules`, so the theme registers the package's compiled components as a source itself. If your setup ignores that, or you prefer to be explicit, add the path relative to the stylesheet (this example is for `app/globals.css`):
|
|
31
|
+
|
|
32
|
+
```css
|
|
33
|
+
@source "../node_modules/@josefinaestevez/ui/dist";
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Migrating an app that has its own `arcana` theme
|
|
37
|
+
|
|
38
|
+
Veyra and Phase define the palette themselves, with the accent called `arcana-gold`. In this package it is `arcana-accent` (the colour is purple). Tailwind silently skips utilities it doesn't know, so after removing the app's own `@theme` block, `bg-arcana-gold` and friends would render unstyled with no build error. Rename them first:
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
grep -rl arcana-gold src app components lib 2>/dev/null | xargs sed -i '' 's/arcana-gold/arcana-accent/g' # macOS sed
|
|
42
|
+
grep -rn arcana-gold . --include='*.ts*' --include='*.css' --exclude-dir=node_modules # should print nothing
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Fonts
|
|
46
|
+
|
|
47
|
+
The theme reads `--font-cormorant` and `--font-inter`, falling back to the family names `"Cormorant Garamond"` and `"Inter Variable"`.
|
|
48
|
+
|
|
49
|
+
**Next.js (recommended): keep `next/font`.** It preloads and subsets the fonts and avoids layout shift. Use the same variable names:
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
import { Cormorant_Garamond, Inter } from "next/font/google";
|
|
53
|
+
|
|
54
|
+
const cormorant = Cormorant_Garamond({ subsets: ["latin"], weight: ["300", "400", "500", "600", "700"], variable: "--font-cormorant" });
|
|
55
|
+
const inter = Inter({ subsets: ["latin"], variable: "--font-inter" });
|
|
56
|
+
|
|
57
|
+
// <html className={`${cormorant.variable} ${inter.variable}`}>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Anywhere else (Storybook, Vite):** install the optional peers and import the bundled stylesheet:
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
npm install @fontsource/cormorant-garamond @fontsource-variable/inter
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
import "@josefinaestevez/ui/fonts.css";
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The package is ESM-only. Bundlers (Next.js, Vite, Vitest) handle it as is; Jest in CommonJS mode needs it added to `transformIgnorePatterns` so it gets transformed.
|
|
71
|
+
|
|
72
|
+
## Usage with Next.js
|
|
73
|
+
|
|
74
|
+
`Header`, `NavLink`, `Footer`, `Button`, `Card`, `Disclosure` and `Spinner` have no client-side state and render in Server Components. `LanguageSwitcher` is marked `"use client"`.
|
|
75
|
+
|
|
76
|
+
```tsx
|
|
77
|
+
import Link from "next/link";
|
|
78
|
+
import { Button, Footer, Header, MORE_BY_JOSEFINA } from "@josefinaestevez/ui";
|
|
79
|
+
|
|
80
|
+
export default function Layout({ children }: { children: React.ReactNode }) {
|
|
81
|
+
return (
|
|
82
|
+
<>
|
|
83
|
+
<Header
|
|
84
|
+
brand="Veyra"
|
|
85
|
+
brandLabel="Veyra — return to home"
|
|
86
|
+
linkComponent={Link}
|
|
87
|
+
items={[
|
|
88
|
+
{ href: "/the-tarot", label: "The Tarot" },
|
|
89
|
+
{ href: "/journal", label: "Journal", active: true, linkProps: { prefetch: false } },
|
|
90
|
+
]}
|
|
91
|
+
actions={<Button variant="ghost" size="sm">Sign in</Button>}
|
|
92
|
+
/>
|
|
93
|
+
{children}
|
|
94
|
+
<Footer
|
|
95
|
+
linkComponent={Link}
|
|
96
|
+
links={[{ href: "/feedback", label: "Feedback" }]}
|
|
97
|
+
moreBy={MORE_BY_JOSEFINA.filter((project) => project.label !== "Veyra")}
|
|
98
|
+
/>
|
|
99
|
+
</>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
`NavLink` also accepts the link component's own props, so `<NavLink href="/journal" linkComponent={Link} prefetch={false}>` type-checks. Header items pass them through `linkProps`, typed from the `linkComponent` you give the Header.
|
|
105
|
+
|
|
106
|
+
The decorative animations (`animate-float-down`, `animate-pulse-glow`) loop forever. Add `motion-reduce:animate-none` where you use them, and smooth scrolling is already off for users who prefer reduced motion.
|
|
107
|
+
|
|
108
|
+
`Button` with `isLoading` stays focusable (`aria-disabled` and `aria-busy`) and ignores clicks and form submits, so keyboard users don't lose their place. Loading is client state: set `isLoading` (or pass `onClick`) from a Client Component. A plain `Button` renders in Server Components. `Spinner` is a labelled image, not a live region; to announce loading, update text in a persistent `role="status"` element in your app.
|
|
109
|
+
|
|
110
|
+
`LanguageSwitcher` is controlled, so it plugs into whatever i18n state the app has:
|
|
111
|
+
|
|
112
|
+
```tsx
|
|
113
|
+
"use client";
|
|
114
|
+
|
|
115
|
+
import { LanguageSwitcher } from "@josefinaestevez/ui";
|
|
116
|
+
import { useLanguage } from "@/contexts/LanguageContext";
|
|
117
|
+
|
|
118
|
+
const languages = [
|
|
119
|
+
{ code: "en", label: "EN", name: "English" },
|
|
120
|
+
{ code: "es", label: "ES", name: "Español" },
|
|
121
|
+
] as const;
|
|
122
|
+
|
|
123
|
+
export function Languages() {
|
|
124
|
+
const { language, setLanguage } = useLanguage();
|
|
125
|
+
return <LanguageSwitcher languages={languages} value={language} onChange={setLanguage} />;
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
To style a link as a button, use the exported variants: `<Link href="/transits" className={buttonVariants({ size: "lg" })}>`.
|
|
130
|
+
|
|
131
|
+
For a fully rounded button, pass `shape="pill"` (to `Button` or `buttonVariants`). It only changes the radius; padding still comes from `size`.
|
|
132
|
+
|
|
133
|
+
```tsx
|
|
134
|
+
<Button shape="pill">Calculate my transits</Button>
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Card and Disclosure
|
|
138
|
+
|
|
139
|
+
`Card` is the bordered surface used for content blocks. `variant` is `default` (ink, the usual card), `muted` (fainter, for secondary panels) or `accent` (tinted, for highlighted content). `as` renders a `div` (default), `section`, `article` or `li`. With a `title`, a `section` or `article` is labelled by it; `headingLevel` sets the heading (default `3`) and `eyebrow` adds a small label above it.
|
|
140
|
+
|
|
141
|
+
`Disclosure` is an expand/collapse built on `<details>`/`<summary>`, so it works without JavaScript. `defaultOpen` starts it expanded, and disclosures that share a `name` form an exclusive accordion (supported in current browsers; older ones let several stay open). `variant="card"` gives it the muted card surface.
|
|
142
|
+
|
|
143
|
+
```tsx
|
|
144
|
+
import { Card, Disclosure } from "@josefinaestevez/ui";
|
|
145
|
+
|
|
146
|
+
<Card as="article" eyebrow="Strong" title="Saturn square natal Sun">
|
|
147
|
+
<p className="text-sm text-arcana-mist">A period of testing structures.</p>
|
|
148
|
+
<Disclosure summary="Terms in this card" className="mt-4">
|
|
149
|
+
<dl>…</dl>
|
|
150
|
+
</Disclosure>
|
|
151
|
+
</Card>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
To make a whole card a link, style the link with `cardVariants`: `<Link href="/journal" className={cardVariants({ className: "block hover:border-arcana-accent/30" })}>`.
|
|
155
|
+
|
|
156
|
+
## Development
|
|
157
|
+
|
|
158
|
+
```sh
|
|
159
|
+
npm install
|
|
160
|
+
npm run storybook # http://localhost:6006
|
|
161
|
+
npm test # Vitest + Testing Library
|
|
162
|
+
npm run lint
|
|
163
|
+
npm run typecheck
|
|
164
|
+
npm run build # dist/ with .d.ts, "use client" preserved
|
|
165
|
+
npm run build-storybook
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Storybook has a story per component plus an **Introduction/Tokens** page with the palette, typography and motion.
|
|
169
|
+
|
|
170
|
+
## Releasing
|
|
171
|
+
|
|
172
|
+
Releases are automated with [Changesets](https://changesets.dev) and `.github/workflows/release.yml`:
|
|
173
|
+
|
|
174
|
+
1. In each PR that changes the package, run `npm run changeset`, pick patch, minor or major, and describe the change. Commit the generated file in `.changeset/`.
|
|
175
|
+
2. When changesets reach `main`, the Release workflow opens (or updates) a **Version Packages** PR that bumps the version in `package.json` and writes `CHANGELOG.md`.
|
|
176
|
+
3. Merging that PR runs the workflow again: it publishes the new version to npm, tags it and creates a GitHub release.
|
|
177
|
+
|
|
178
|
+
Publishing uses npm [trusted publishing](https://docs.npmjs.com/trusted-publishers) from GitHub Actions, so no npm token is stored in the repo. The repo is private, so the published package has no provenance attestation (npm only generates those for public repos); the package itself is public on npm. The trusted publisher is configured on npmjs.com under the package's settings (repository `josefinaestevez/ui`, workflow `release.yml`).
|
|
179
|
+
|
|
180
|
+
The Version Packages PR is opened with the workflow's own token, so GitHub doesn't run CI on it; the Release workflow runs lint, typecheck and tests before publishing instead.
|
|
181
|
+
|
|
182
|
+
## Consistency
|
|
183
|
+
|
|
184
|
+
Veyra and Phase both depend on this package. Changes to tokens or component styles here are the way to change the shared look; avoid overriding them in an app, so the two stay identical.
|
|
185
|
+
|
|
186
|
+
## License
|
|
187
|
+
|
|
188
|
+
MIT © 2026 Josefina Estevez
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ButtonHTMLAttributes } from 'react';
|
|
3
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
declare const buttonVariants: (props?: ({
|
|
7
|
+
variant?: "primary" | "ghost" | "danger" | null | undefined;
|
|
8
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
9
|
+
shape?: "rounded" | "pill" | null | undefined;
|
|
10
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
12
|
+
isLoading?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Renders in Server Components as long as `isLoading` is not set and no handler is passed:
|
|
16
|
+
* a handler is only attached while loading. Loading is client state, so set `isLoading`
|
|
17
|
+
* from a Client Component.
|
|
18
|
+
*/
|
|
19
|
+
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
20
|
+
|
|
21
|
+
export { Button, buttonVariants };
|
|
22
|
+
export type { ButtonProps };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { clsx } from "clsx";
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
import { Spinner } from "./Spinner.js";
|
|
6
|
+
const buttonVariants = cva(
|
|
7
|
+
"inline-flex items-center justify-center gap-2 font-sans font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-arcana-accent focus-visible:ring-offset-2 focus-visible:ring-offset-arcana-ink disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
primary: "bg-arcana-accent text-arcana-ink hover:bg-arcana-accent/90",
|
|
12
|
+
ghost: "border border-arcana-accent/40 text-arcana-parchment hover:bg-arcana-accent/10",
|
|
13
|
+
danger: "border border-red-500/40 text-red-400 hover:bg-red-500/10"
|
|
14
|
+
},
|
|
15
|
+
size: {
|
|
16
|
+
sm: "px-4 py-2 text-xs",
|
|
17
|
+
md: "px-6 py-3 text-sm",
|
|
18
|
+
lg: "px-8 py-4 text-base"
|
|
19
|
+
},
|
|
20
|
+
shape: {
|
|
21
|
+
rounded: "rounded-md",
|
|
22
|
+
pill: "rounded-full"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
variant: "primary",
|
|
27
|
+
size: "md",
|
|
28
|
+
shape: "rounded"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
function blockWhileLoading(event) {
|
|
33
|
+
event.preventDefault();
|
|
34
|
+
}
|
|
35
|
+
const Button = forwardRef(function Button2({ variant, size, shape, isLoading = false, disabled, className, children, type = "button", onClick, ...props }, ref) {
|
|
36
|
+
return /* @__PURE__ */ jsxs(
|
|
37
|
+
"button",
|
|
38
|
+
{
|
|
39
|
+
...props,
|
|
40
|
+
ref,
|
|
41
|
+
type,
|
|
42
|
+
disabled,
|
|
43
|
+
"aria-disabled": isLoading || props["aria-disabled"] || void 0,
|
|
44
|
+
"aria-busy": isLoading || props["aria-busy"] || void 0,
|
|
45
|
+
onClick: isLoading ? blockWhileLoading : onClick,
|
|
46
|
+
className: clsx(buttonVariants({ variant, size, shape }), className),
|
|
47
|
+
children: [
|
|
48
|
+
isLoading && /* @__PURE__ */ jsx(Spinner, { size: 16, "aria-hidden": true }),
|
|
49
|
+
children
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
});
|
|
54
|
+
export {
|
|
55
|
+
Button,
|
|
56
|
+
buttonVariants
|
|
57
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
declare const cardVariants: (props?: ({
|
|
7
|
+
variant?: "default" | "muted" | "accent" | null | undefined;
|
|
8
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
|
+
declare const headingTags: {
|
|
10
|
+
readonly 2: "h2";
|
|
11
|
+
readonly 3: "h3";
|
|
12
|
+
readonly 4: "h4";
|
|
13
|
+
readonly 5: "h5";
|
|
14
|
+
readonly 6: "h6";
|
|
15
|
+
};
|
|
16
|
+
interface CardProps extends Omit<HTMLAttributes<HTMLElement>, "title">, VariantProps<typeof cardVariants> {
|
|
17
|
+
/** Element to render. `section` and `article` with a `title` are labelled by it. */
|
|
18
|
+
as?: "div" | "section" | "article" | "li";
|
|
19
|
+
/** Small uppercase label above the title, e.g. a category or date. */
|
|
20
|
+
eyebrow?: ReactNode;
|
|
21
|
+
/** Rendered as a heading (`headingLevel`, default h3). */
|
|
22
|
+
title?: ReactNode;
|
|
23
|
+
headingLevel?: keyof typeof headingTags;
|
|
24
|
+
}
|
|
25
|
+
/** The bordered surface both apps use for content blocks. Renders in Server Components. */
|
|
26
|
+
declare const Card: react.ForwardRefExoticComponent<CardProps & react.RefAttributes<HTMLElement>>;
|
|
27
|
+
|
|
28
|
+
export { Card, cardVariants };
|
|
29
|
+
export type { CardProps };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { clsx } from "clsx";
|
|
4
|
+
import { forwardRef, useId } from "react";
|
|
5
|
+
const cardVariants = cva("rounded-xl border p-5 sm:p-6", {
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
default: "border-arcana-accent/15 bg-arcana-ink/80",
|
|
9
|
+
muted: "border-arcana-accent/10 bg-arcana-ink/40",
|
|
10
|
+
accent: "border-arcana-accent/25 bg-arcana-accent/5"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
defaultVariants: {
|
|
14
|
+
variant: "default"
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
function isPresent(node) {
|
|
18
|
+
return node !== void 0 && node !== null && node !== false && node !== "";
|
|
19
|
+
}
|
|
20
|
+
const headingTags = { 2: "h2", 3: "h3", 4: "h4", 5: "h5", 6: "h6" };
|
|
21
|
+
const Card = forwardRef(function Card2({ as = "div", variant, eyebrow, title, headingLevel = 3, className, children, ...props }, ref) {
|
|
22
|
+
const titleId = useId();
|
|
23
|
+
const Tag = as;
|
|
24
|
+
const Heading = headingTags[headingLevel];
|
|
25
|
+
const hasTitle = isPresent(title);
|
|
26
|
+
const labelled = hasTitle && (as === "section" || as === "article") && props["aria-label"] === void 0 && props["aria-labelledby"] === void 0;
|
|
27
|
+
return /* @__PURE__ */ jsxs(
|
|
28
|
+
Tag,
|
|
29
|
+
{
|
|
30
|
+
"aria-labelledby": labelled ? titleId : void 0,
|
|
31
|
+
...props,
|
|
32
|
+
ref,
|
|
33
|
+
className: clsx(cardVariants({ variant }), className),
|
|
34
|
+
children: [
|
|
35
|
+
isPresent(eyebrow) && /* @__PURE__ */ jsx("p", { className: "mb-2 font-sans text-xs font-medium uppercase tracking-widest text-arcana-accent", children: eyebrow }),
|
|
36
|
+
hasTitle && /* @__PURE__ */ jsx(Heading, { id: titleId, className: "mb-2 font-serif text-xl text-arcana-parchment", children: title }),
|
|
37
|
+
children
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
});
|
|
42
|
+
export {
|
|
43
|
+
Card,
|
|
44
|
+
cardVariants
|
|
45
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { DetailsHTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
declare const disclosureVariants: (props?: ({
|
|
7
|
+
variant?: "inline" | "card" | null | undefined;
|
|
8
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
|
+
interface DisclosureProps extends Omit<DetailsHTMLAttributes<HTMLDetailsElement>, "open">, VariantProps<typeof disclosureVariants> {
|
|
10
|
+
/**
|
|
11
|
+
* The always-visible toggle text. Keep it to text or inline content: it sits inside the
|
|
12
|
+
* native `<summary>`, which browsers expose as a button, so headings or links in it lose
|
|
13
|
+
* their meaning.
|
|
14
|
+
*/
|
|
15
|
+
summary: ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Start expanded. After that the browser tracks open/closed; React only re-applies it if
|
|
18
|
+
* this prop changes.
|
|
19
|
+
*/
|
|
20
|
+
defaultOpen?: boolean;
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Expand/collapse built on native `<details>`/`<summary>`: keyboard and screen-reader
|
|
25
|
+
* support come from the browser, it works without JavaScript and renders in Server
|
|
26
|
+
* Components. Give several the same `name` to make an exclusive accordion.
|
|
27
|
+
*/
|
|
28
|
+
declare const Disclosure: react.ForwardRefExoticComponent<DisclosureProps & react.RefAttributes<HTMLDetailsElement>>;
|
|
29
|
+
|
|
30
|
+
export { Disclosure };
|
|
31
|
+
export type { DisclosureProps };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { clsx } from "clsx";
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
const disclosureVariants = cva("font-sans text-sm", {
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
inline: "",
|
|
9
|
+
card: "rounded-xl border border-arcana-accent/10 bg-arcana-ink/40 px-5 py-4"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
defaultVariants: {
|
|
13
|
+
variant: "inline"
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
const Disclosure = forwardRef(function Disclosure2({ summary, defaultOpen = false, variant, className, children, ...props }, ref) {
|
|
17
|
+
return /* @__PURE__ */ jsxs(
|
|
18
|
+
"details",
|
|
19
|
+
{
|
|
20
|
+
...props,
|
|
21
|
+
ref,
|
|
22
|
+
open: defaultOpen || void 0,
|
|
23
|
+
suppressHydrationWarning: true,
|
|
24
|
+
className: clsx(disclosureVariants({ variant }), className),
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ jsxs("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-3 rounded-sm font-medium text-arcana-parchment/80 transition-colors hover:text-arcana-parchment focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-arcana-accent/60 focus-visible:ring-offset-2 focus-visible:ring-offset-arcana-ink [&::-webkit-details-marker]:hidden", children: [
|
|
27
|
+
/* @__PURE__ */ jsx("span", { children: summary }),
|
|
28
|
+
/* @__PURE__ */ jsx(
|
|
29
|
+
"svg",
|
|
30
|
+
{
|
|
31
|
+
"aria-hidden": true,
|
|
32
|
+
viewBox: "0 0 16 16",
|
|
33
|
+
width: 16,
|
|
34
|
+
height: 16,
|
|
35
|
+
fill: "none",
|
|
36
|
+
stroke: "currentColor",
|
|
37
|
+
strokeWidth: 1.5,
|
|
38
|
+
strokeLinecap: "round",
|
|
39
|
+
strokeLinejoin: "round",
|
|
40
|
+
className: "shrink-0 text-arcana-accent [details[open]>summary>&]:rotate-180 motion-safe:transition-transform motion-safe:duration-200",
|
|
41
|
+
children: /* @__PURE__ */ jsx("path", { d: "m4 6 4 4 4-4" })
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
] }),
|
|
45
|
+
/* @__PURE__ */ jsx("div", { className: "mt-3 leading-relaxed text-arcana-mist", children })
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
});
|
|
50
|
+
export {
|
|
51
|
+
Disclosure
|
|
52
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { LinkComponent } from '../types.js';
|
|
4
|
+
|
|
5
|
+
interface FooterLink {
|
|
6
|
+
href: string;
|
|
7
|
+
label: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare const MORE_BY_JOSEFINA: readonly [{
|
|
10
|
+
readonly href: "https://veyra-one.vercel.app";
|
|
11
|
+
readonly label: "Veyra";
|
|
12
|
+
}, {
|
|
13
|
+
readonly href: "https://phase-sandy.vercel.app";
|
|
14
|
+
readonly label: "Phase";
|
|
15
|
+
}, {
|
|
16
|
+
readonly href: "https://jochimusica.netlify.app";
|
|
17
|
+
readonly label: "JOCHI";
|
|
18
|
+
}];
|
|
19
|
+
interface FooterProps {
|
|
20
|
+
children?: ReactNode;
|
|
21
|
+
links?: readonly FooterLink[];
|
|
22
|
+
moreBy?: readonly FooterLink[];
|
|
23
|
+
moreByLabel?: string;
|
|
24
|
+
linkComponent?: LinkComponent;
|
|
25
|
+
fixed?: boolean;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
declare function Footer({ children, links, moreBy, moreByLabel, linkComponent: Link, fixed, className, }: FooterProps): react.JSX.Element;
|
|
29
|
+
|
|
30
|
+
export { Footer, MORE_BY_JOSEFINA };
|
|
31
|
+
export type { FooterLink, FooterProps };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { useId } from "react";
|
|
4
|
+
const MORE_BY_JOSEFINA = [
|
|
5
|
+
{ href: "https://veyra-one.vercel.app", label: "Veyra" },
|
|
6
|
+
{ href: "https://phase-sandy.vercel.app", label: "Phase" },
|
|
7
|
+
{ href: "https://jochimusica.netlify.app", label: "JOCHI" }
|
|
8
|
+
];
|
|
9
|
+
const linkClass = "rounded-sm font-sans text-xs uppercase tracking-widest transition-colors hover:text-arcana-mist focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-arcana-accent/60";
|
|
10
|
+
function Footer({
|
|
11
|
+
children,
|
|
12
|
+
links = [],
|
|
13
|
+
moreBy = [],
|
|
14
|
+
moreByLabel = "More by Josefina",
|
|
15
|
+
linkComponent: Link = "a",
|
|
16
|
+
fixed = false,
|
|
17
|
+
className
|
|
18
|
+
}) {
|
|
19
|
+
const moreById = useId();
|
|
20
|
+
return /* @__PURE__ */ jsxs(
|
|
21
|
+
"footer",
|
|
22
|
+
{
|
|
23
|
+
className: clsx(
|
|
24
|
+
"z-50 flex flex-wrap items-center justify-between gap-x-6 gap-y-2 border-t border-arcana-accent/10 bg-arcana-ink/80 px-6 py-4 text-arcana-mist/80 backdrop-blur-sm",
|
|
25
|
+
fixed && "fixed inset-x-0 bottom-0",
|
|
26
|
+
className
|
|
27
|
+
),
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-6", children }),
|
|
30
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-6", children: [
|
|
31
|
+
moreBy.length > 0 && /* @__PURE__ */ jsxs("nav", { "aria-labelledby": moreById, className: "flex items-center gap-3", children: [
|
|
32
|
+
/* @__PURE__ */ jsx("span", { id: moreById, className: "font-sans text-xs text-arcana-mist/80", children: moreByLabel }),
|
|
33
|
+
/* @__PURE__ */ jsx("ul", { className: "flex items-center gap-3", children: moreBy.map((link) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("a", { href: link.href, className: linkClass, children: link.label }) }, link.href)) })
|
|
34
|
+
] }),
|
|
35
|
+
links.map((link) => /* @__PURE__ */ jsx(Link, { href: link.href, className: linkClass, children: link.label }, link.href))
|
|
36
|
+
] })
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
Footer,
|
|
43
|
+
MORE_BY_JOSEFINA
|
|
44
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode, ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
import { LinkComponent } from '../types.js';
|
|
4
|
+
|
|
5
|
+
interface HeaderNavItem<C extends LinkComponent = "a"> {
|
|
6
|
+
href: string;
|
|
7
|
+
label: ReactNode;
|
|
8
|
+
active?: boolean;
|
|
9
|
+
/** Extra props for the link component, e.g. `{ prefetch: false }` for `next/link`. */
|
|
10
|
+
linkProps?: Partial<Omit<ComponentPropsWithoutRef<C>, "href" | "className" | "children">>;
|
|
11
|
+
}
|
|
12
|
+
interface HeaderProps<C extends LinkComponent = "a"> {
|
|
13
|
+
brand: ReactNode;
|
|
14
|
+
brandHref?: string;
|
|
15
|
+
brandLabel?: string;
|
|
16
|
+
items?: HeaderNavItem<C>[];
|
|
17
|
+
navLabel?: string;
|
|
18
|
+
actions?: ReactNode;
|
|
19
|
+
linkComponent?: C;
|
|
20
|
+
fixed?: boolean;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
declare function Header<C extends LinkComponent = "a">({ brand, brandHref, brandLabel, items, navLabel, actions, linkComponent, fixed, className, }: HeaderProps<C>): react.JSX.Element;
|
|
24
|
+
|
|
25
|
+
export { Header };
|
|
26
|
+
export type { HeaderNavItem, HeaderProps };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { NavLink } from "./NavLink.js";
|
|
4
|
+
function Header({
|
|
5
|
+
brand,
|
|
6
|
+
brandHref = "/",
|
|
7
|
+
brandLabel,
|
|
8
|
+
items = [],
|
|
9
|
+
navLabel = "Main",
|
|
10
|
+
actions,
|
|
11
|
+
linkComponent,
|
|
12
|
+
fixed = false,
|
|
13
|
+
className
|
|
14
|
+
}) {
|
|
15
|
+
const Link = linkComponent ?? "a";
|
|
16
|
+
return /* @__PURE__ */ jsxs(
|
|
17
|
+
"header",
|
|
18
|
+
{
|
|
19
|
+
className: clsx(
|
|
20
|
+
"z-50 flex items-center justify-between gap-6 border-b border-arcana-accent/10 bg-arcana-ink/80 px-6 py-4 backdrop-blur-sm",
|
|
21
|
+
fixed && "fixed inset-x-0 top-0",
|
|
22
|
+
className
|
|
23
|
+
),
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ jsx(
|
|
26
|
+
Link,
|
|
27
|
+
{
|
|
28
|
+
href: brandHref,
|
|
29
|
+
"aria-label": brandLabel,
|
|
30
|
+
className: "group flex items-center gap-2 font-serif text-xl tracking-wide text-arcana-parchment transition-colors hover:text-arcana-accent",
|
|
31
|
+
children: brand
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-6", children: [
|
|
35
|
+
items.length > 0 && /* @__PURE__ */ jsx("nav", { "aria-label": navLabel, children: /* @__PURE__ */ jsx("ul", { className: "flex items-center gap-6", children: items.map((item) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(NavLink, { ...item.linkProps, href: item.href, active: item.active, linkComponent: Link, children: item.label }) }, item.href)) }) }),
|
|
36
|
+
actions
|
|
37
|
+
] })
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
Header
|
|
44
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
interface Language<T extends string = string> {
|
|
4
|
+
code: T;
|
|
5
|
+
label: string;
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
interface LanguageSwitcherProps<T extends string = string> {
|
|
9
|
+
languages: readonly Language<T>[];
|
|
10
|
+
value: T;
|
|
11
|
+
onChange: (code: T) => void;
|
|
12
|
+
label?: string;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
declare function LanguageSwitcher<T extends string>({ languages, value, onChange, label, className, }: LanguageSwitcherProps<T>): react.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { LanguageSwitcher };
|
|
18
|
+
export type { Language, LanguageSwitcherProps };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { clsx } from "clsx";
|
|
4
|
+
import { Fragment } from "react";
|
|
5
|
+
function LanguageSwitcher({
|
|
6
|
+
languages,
|
|
7
|
+
value,
|
|
8
|
+
onChange,
|
|
9
|
+
label = "Language",
|
|
10
|
+
className
|
|
11
|
+
}) {
|
|
12
|
+
return /* @__PURE__ */ jsx("div", { role: "group", "aria-label": label, className: clsx("flex items-center gap-1", className), children: languages.map(({ code, label: short, name }, i) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
13
|
+
i > 0 && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "text-xs text-arcana-mist/20", children: "|" }),
|
|
14
|
+
/* @__PURE__ */ jsx(
|
|
15
|
+
"button",
|
|
16
|
+
{
|
|
17
|
+
type: "button",
|
|
18
|
+
lang: code,
|
|
19
|
+
"aria-label": name,
|
|
20
|
+
"aria-pressed": code === value,
|
|
21
|
+
onClick: () => onChange(code),
|
|
22
|
+
className: clsx(
|
|
23
|
+
"rounded-sm font-sans text-xs tracking-widest transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-arcana-accent/60",
|
|
24
|
+
code === value ? "text-arcana-accent" : "text-arcana-mist/80 hover:text-arcana-mist"
|
|
25
|
+
),
|
|
26
|
+
children: short
|
|
27
|
+
}
|
|
28
|
+
)
|
|
29
|
+
] }, code)) });
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
LanguageSwitcher
|
|
33
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
import { LinkComponent } from '../types.js';
|
|
4
|
+
|
|
5
|
+
type NavLinkOwnProps<C extends LinkComponent> = {
|
|
6
|
+
active?: boolean;
|
|
7
|
+
/** Router link to render, e.g. `next/link`. Its extra props (like `prefetch`) are accepted too. */
|
|
8
|
+
linkComponent?: C;
|
|
9
|
+
};
|
|
10
|
+
type NavLinkProps<C extends LinkComponent = "a"> = NavLinkOwnProps<C> & Omit<ComponentPropsWithoutRef<C>, keyof NavLinkOwnProps<C>> & {
|
|
11
|
+
href: string;
|
|
12
|
+
};
|
|
13
|
+
declare function NavLink<C extends LinkComponent = "a">({ active, linkComponent, className, ...props }: NavLinkProps<C>): react.JSX.Element;
|
|
14
|
+
|
|
15
|
+
export { NavLink };
|
|
16
|
+
export type { NavLinkProps };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
function NavLink({
|
|
4
|
+
active = false,
|
|
5
|
+
linkComponent,
|
|
6
|
+
className,
|
|
7
|
+
...props
|
|
8
|
+
}) {
|
|
9
|
+
const Link = linkComponent ?? "a";
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
Link,
|
|
12
|
+
{
|
|
13
|
+
"aria-current": active ? "page" : void 0,
|
|
14
|
+
className: clsx(
|
|
15
|
+
"rounded-sm font-sans text-xs uppercase tracking-widest transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-arcana-accent/60",
|
|
16
|
+
active ? "text-arcana-accent" : "text-arcana-mist/80 hover:text-arcana-mist",
|
|
17
|
+
className
|
|
18
|
+
),
|
|
19
|
+
...props
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
NavLink
|
|
25
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { SVGAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
interface SpinnerProps extends SVGAttributes<SVGSVGElement> {
|
|
5
|
+
size?: number;
|
|
6
|
+
label?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A labelled loading graphic. It is not a live region: to announce loading to screen
|
|
10
|
+
* readers, update text in a persistent `role="status"` element owned by the app.
|
|
11
|
+
*/
|
|
12
|
+
declare function Spinner({ size, label, className, ...props }: SpinnerProps): react.JSX.Element;
|
|
13
|
+
|
|
14
|
+
export { Spinner };
|
|
15
|
+
export type { SpinnerProps };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
function Spinner({ size = 24, label = "Loading", className, ...props }) {
|
|
4
|
+
return /* @__PURE__ */ jsxs(
|
|
5
|
+
"svg",
|
|
6
|
+
{
|
|
7
|
+
width: size,
|
|
8
|
+
height: size,
|
|
9
|
+
viewBox: "0 0 24 24",
|
|
10
|
+
fill: "none",
|
|
11
|
+
role: "img",
|
|
12
|
+
"aria-label": label,
|
|
13
|
+
className: clsx("animate-spin", className),
|
|
14
|
+
...props,
|
|
15
|
+
children: [
|
|
16
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2", strokeOpacity: "0.25" }),
|
|
17
|
+
/* @__PURE__ */ jsx("path", { d: "M12 2a10 10 0 0 1 10 10", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" })
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
Spinner
|
|
24
|
+
};
|
package/dist/fonts.css
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
@import "@fontsource/cormorant-garamond/300.css";
|
|
2
|
+
@import "@fontsource/cormorant-garamond/400.css";
|
|
3
|
+
@import "@fontsource/cormorant-garamond/500.css";
|
|
4
|
+
@import "@fontsource/cormorant-garamond/600.css";
|
|
5
|
+
@import "@fontsource/cormorant-garamond/700.css";
|
|
6
|
+
@import "@fontsource-variable/inter/index.css";
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { Button, ButtonProps, buttonVariants } from './components/Button.js';
|
|
2
|
+
export { Card, CardProps, cardVariants } from './components/Card.js';
|
|
3
|
+
export { Disclosure, DisclosureProps } from './components/Disclosure.js';
|
|
4
|
+
export { Footer, FooterLink, FooterProps, MORE_BY_JOSEFINA } from './components/Footer.js';
|
|
5
|
+
export { Header, HeaderNavItem, HeaderProps } from './components/Header.js';
|
|
6
|
+
export { Language, LanguageSwitcher, LanguageSwitcherProps } from './components/LanguageSwitcher.js';
|
|
7
|
+
export { NavLink, NavLinkProps } from './components/NavLink.js';
|
|
8
|
+
export { Spinner, SpinnerProps } from './components/Spinner.js';
|
|
9
|
+
export { LinkComponent, LinkProps } from './types.js';
|
|
10
|
+
import 'react';
|
|
11
|
+
import 'class-variance-authority/types';
|
|
12
|
+
import 'class-variance-authority';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Button, buttonVariants } from "./components/Button.js";
|
|
2
|
+
import { Card, cardVariants } from "./components/Card.js";
|
|
3
|
+
import { Disclosure } from "./components/Disclosure.js";
|
|
4
|
+
import { Footer, MORE_BY_JOSEFINA } from "./components/Footer.js";
|
|
5
|
+
import { Header } from "./components/Header.js";
|
|
6
|
+
import { LanguageSwitcher } from "./components/LanguageSwitcher.js";
|
|
7
|
+
import { NavLink } from "./components/NavLink.js";
|
|
8
|
+
import { Spinner } from "./components/Spinner.js";
|
|
9
|
+
export {
|
|
10
|
+
Button,
|
|
11
|
+
Card,
|
|
12
|
+
Disclosure,
|
|
13
|
+
Footer,
|
|
14
|
+
Header,
|
|
15
|
+
LanguageSwitcher,
|
|
16
|
+
MORE_BY_JOSEFINA,
|
|
17
|
+
NavLink,
|
|
18
|
+
Spinner,
|
|
19
|
+
buttonVariants,
|
|
20
|
+
cardVariants
|
|
21
|
+
};
|
package/dist/theme.css
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@source "./**/*.js";
|
|
2
|
+
|
|
3
|
+
@theme {
|
|
4
|
+
--color-arcana-accent: #a78bfa;
|
|
5
|
+
--color-arcana-ink: #0d0d0f;
|
|
6
|
+
--color-arcana-parchment: #f5ecd7;
|
|
7
|
+
--color-arcana-mist: #a89f94;
|
|
8
|
+
|
|
9
|
+
--animate-card-enter: card-enter 0.5s ease-out both;
|
|
10
|
+
--animate-float-down: float-down 4s ease-in-out infinite;
|
|
11
|
+
--animate-pulse-glow: pulse-glow 2s ease-in-out infinite;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@theme inline {
|
|
15
|
+
--font-serif: var(--font-cormorant, "Cormorant Garamond"), Georgia, serif;
|
|
16
|
+
--font-sans: var(--font-inter, "Inter Variable"), system-ui, sans-serif;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@keyframes card-enter {
|
|
20
|
+
from { transform: translateY(20px); opacity: 0; }
|
|
21
|
+
to { transform: translateY(0); opacity: 1; }
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@keyframes float-down {
|
|
25
|
+
0% { transform: translateY(0px) scale(0.4); opacity: 0; }
|
|
26
|
+
15% { opacity: 1; }
|
|
27
|
+
85% { opacity: 1; }
|
|
28
|
+
100% { transform: translateY(120px) scale(1); opacity: 0; }
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@keyframes pulse-glow {
|
|
32
|
+
0%, 100% { opacity: 0.4; transform: scale(1); }
|
|
33
|
+
50% { opacity: 1; transform: scale(1.15); }
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@layer base {
|
|
37
|
+
html,
|
|
38
|
+
body {
|
|
39
|
+
background-color: var(--color-arcana-ink);
|
|
40
|
+
color: var(--color-arcana-parchment);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* Inside the base layer so apps can still override it with utilities like scroll-auto. */
|
|
44
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
45
|
+
html {
|
|
46
|
+
scroll-behavior: smooth;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
package/dist/types.d.ts
ADDED
package/dist/types.js
ADDED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,90 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@josefinaestevez/ui",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Shared React + Tailwind CSS 4 design system for Veyra and Phase.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Josefina Estevez",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"sideEffects": [
|
|
9
|
+
"**/*.css"
|
|
10
|
+
],
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"main": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"default": "./dist/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./theme.css": "./dist/theme.css",
|
|
22
|
+
"./fonts.css": "./dist/fonts.css",
|
|
23
|
+
"./package.json": "./package.json"
|
|
24
|
+
},
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "tsup",
|
|
30
|
+
"dev": "tsup --watch",
|
|
31
|
+
"lint": "eslint .",
|
|
32
|
+
"typecheck": "tsc --noEmit",
|
|
33
|
+
"test": "vitest run",
|
|
34
|
+
"test:watch": "vitest",
|
|
35
|
+
"storybook": "storybook dev -p 6006",
|
|
36
|
+
"build-storybook": "storybook build",
|
|
37
|
+
"changeset": "changeset",
|
|
38
|
+
"release": "changeset publish",
|
|
39
|
+
"prepack": "npm run build"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"class-variance-authority": "0.7.1",
|
|
43
|
+
"clsx": "2.1.1"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"@fontsource-variable/inter": ">=5",
|
|
47
|
+
"@fontsource/cormorant-garamond": ">=5",
|
|
48
|
+
"react": "^19.0.0",
|
|
49
|
+
"react-dom": "^19.0.0",
|
|
50
|
+
"tailwindcss": "^4.0.0"
|
|
51
|
+
},
|
|
52
|
+
"peerDependenciesMeta": {
|
|
53
|
+
"@fontsource-variable/inter": {
|
|
54
|
+
"optional": true
|
|
55
|
+
},
|
|
56
|
+
"@fontsource/cormorant-garamond": {
|
|
57
|
+
"optional": true
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@changesets/cli": "3.0.3",
|
|
62
|
+
"@eslint/js": "10.0.1",
|
|
63
|
+
"@fontsource-variable/inter": "5.3.0",
|
|
64
|
+
"@fontsource/cormorant-garamond": "5.3.0",
|
|
65
|
+
"@storybook/addon-docs": "10.6.7",
|
|
66
|
+
"@storybook/react-vite": "10.6.7",
|
|
67
|
+
"@tailwindcss/vite": "4.3.5",
|
|
68
|
+
"@testing-library/jest-dom": "7.0.1",
|
|
69
|
+
"@testing-library/react": "16.3.3",
|
|
70
|
+
"@testing-library/user-event": "14.6.12",
|
|
71
|
+
"@types/node": "22.20.5",
|
|
72
|
+
"@types/react": "19.3.0",
|
|
73
|
+
"@types/react-dom": "19.3.0",
|
|
74
|
+
"@vitejs/plugin-react": "6.3.0",
|
|
75
|
+
"eslint": "10.15.0",
|
|
76
|
+
"eslint-plugin-react-hooks": "7.1.1",
|
|
77
|
+
"eslint-plugin-storybook": "10.6.7",
|
|
78
|
+
"globals": "17.14.0",
|
|
79
|
+
"jsdom": "31.0.1",
|
|
80
|
+
"react": "19.3.1",
|
|
81
|
+
"react-dom": "19.3.1",
|
|
82
|
+
"storybook": "10.6.7",
|
|
83
|
+
"tailwindcss": "4.3.5",
|
|
84
|
+
"tsup": "9.0.0",
|
|
85
|
+
"typescript": "6.0.3",
|
|
86
|
+
"typescript-eslint": "8.73.0",
|
|
87
|
+
"vite": "8.3.8",
|
|
88
|
+
"vitest": "5.1.0"
|
|
89
|
+
}
|
|
90
|
+
}
|