@code-sherpas/pharos-react 0.2.1 → 0.3.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/RULES.md +10 -2
- package/dist/components/Button.d.ts +35 -0
- package/dist/components/Button.d.ts.map +1 -0
- package/dist/components/PharosHello.d.ts +6 -0
- package/dist/components/PharosHello.d.ts.map +1 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +33 -1717
- package/dist/index.js.map +1 -1
- package/dist/lib/cn.d.ts +16 -0
- package/dist/lib/cn.d.ts.map +1 -0
- package/dist/styles.css +1 -2
- package/package.json +11 -11
package/RULES.md
CHANGED
|
@@ -38,8 +38,16 @@ canonical one — do not alias.
|
|
|
38
38
|
import '@code-sherpas/pharos-react/styles.css';
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
This loads the compiled
|
|
42
|
-
|
|
41
|
+
This loads the compiled CSS Modules output of every component (hashed class
|
|
42
|
+
names that the React components reference at runtime). Without it,
|
|
43
|
+
components render unstyled.
|
|
44
|
+
|
|
45
|
+
**You do not need Tailwind, PostCSS, or any other CSS framework to consume
|
|
46
|
+
pharos-react** (Decision D9). The published bundle is pure CSS — no
|
|
47
|
+
`@layer` directives, no preflight, no global resets, no class-name
|
|
48
|
+
collisions with your own utilities. It works the same in Next.js + Tailwind
|
|
49
|
+
v3, Next.js + Tailwind v4, Vite + plain CSS, Astro, Remix, or any other
|
|
50
|
+
React stack.
|
|
43
51
|
|
|
44
52
|
## 4. `pharos-tokens` is a peer dependency
|
|
45
53
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
/**
|
|
4
|
+
* Maps the two public variant axes (`intent`, `size`) to the per-class names
|
|
5
|
+
* inside `Button.module.css`. CVA stays as the typed-variants mechanism
|
|
6
|
+
* (Decision D9 keeps the authoring DX) but each value points at a hashed
|
|
7
|
+
* CSS Modules class instead of a Tailwind utility string. The base class
|
|
8
|
+
* carries layout, typography and the focus-visible ring — every variant
|
|
9
|
+
* stacks on top of it.
|
|
10
|
+
*/
|
|
11
|
+
declare const buttonVariants: (props?: ({
|
|
12
|
+
intent?: "primary" | "secondary" | "ghost" | "destructive" | null | undefined;
|
|
13
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
14
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
15
|
+
type ButtonVariantProps = VariantProps<typeof buttonVariants>;
|
|
16
|
+
/**
|
|
17
|
+
* Props accepted by `<Button>`. Extends Base UI's `useRender.ComponentProps<'button'>`,
|
|
18
|
+
* which means the component accepts every native `<button>` attribute plus the
|
|
19
|
+
* `render` prop for composition:
|
|
20
|
+
*
|
|
21
|
+
* ```tsx
|
|
22
|
+
* // Render as a router link (inherits all Button styles and behavior):
|
|
23
|
+
* <Button render={<Link to="/dashboard" />}>Dashboard</Button>
|
|
24
|
+
* // Or as a function receiving props + state:
|
|
25
|
+
* <Button render={(props) => <a {...props} href="/x" />}>External</Button>
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export interface ButtonProps extends useRender.ComponentProps<'button'>, ButtonVariantProps {
|
|
29
|
+
}
|
|
30
|
+
export declare function Button({ render, className, intent, size, type, ref, ...rest }: ButtonProps): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
|
|
31
|
+
export declare namespace Button {
|
|
32
|
+
var displayName: string;
|
|
33
|
+
}
|
|
34
|
+
export { buttonVariants };
|
|
35
|
+
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE;;;;;;;GAOG;AACH,QAAA,MAAM,cAAc;;;8EAwBlB,CAAC;AAEH,KAAK,kBAAkB,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC;AAE9D;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,WAAY,SAAQ,SAAS,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,kBAAkB;CAAG;AAE9F,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,SAAS,EACT,MAAM,EACN,IAAI,EACJ,IAAe,EACf,GAAG,EACH,GAAG,IAAI,EACR,EAAE,WAAW,8FAmBb;yBA3Be,MAAM;;;AA+BtB,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export interface PharosHelloProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
name?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function PharosHello({ name, className, ...rest }: PharosHelloProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=PharosHello.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PharosHello.d.ts","sourceRoot":"","sources":["../../src/components/PharosHello.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C,MAAM,WAAW,gBAAiB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACtE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,WAAW,CAAC,EAAE,IAAc,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,gBAAgB,2CAMnF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
export { }
|
|
1
|
+
export { Button, buttonVariants } from './components/Button';
|
|
2
|
+
export type { ButtonProps } from './components/Button';
|
|
3
|
+
export { PharosHello } from './components/PharosHello';
|
|
4
|
+
export type { PharosHelloProps } from './components/PharosHello';
|
|
5
|
+
export { cn } from './lib/cn';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC7D,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC"}
|