@reactive-forge-studio/web-unstyled 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/README.md +20 -2
- package/dist/Button.d.ts +13 -0
- package/dist/Button.js +34 -0
- package/dist/Button.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/package.json +50 -4
package/README.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Reactive Forge Studio web-unstyled
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Unstyled React components used by Reactive Forge Studio and exported applications. The package has no runtime dependency on Studio. React 18 or 19 is supplied by the consuming application.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm install @reactive-forge-studio/web-unstyled react
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import {Button} from '@reactive-forge-studio/web-unstyled/Button'
|
|
11
|
+
|
|
12
|
+
export function SaveButton() {
|
|
13
|
+
return <Button onClick={() => console.log('Save')} style={{padding: 12}}>Save</Button>
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The root import also exports `Button` and `ButtonProps`. Button uses a native HTML button with browser appearance reset; customize it with `className` and `style`. It supports `children`, `disabled`, `onClick`, and `type` (defaults to `button`).
|
|
18
|
+
|
|
19
|
+
Build the publishable ESM JavaScript and TypeScript declarations with `yarn workspace @reactive-forge-studio/web-unstyled build`. The separate `bundle` script builds Studio library metadata; it is not the npm package build.
|
|
20
|
+
|
|
21
|
+
Run `yarn release:check` from the repository root before releasing. Use Changesets for versioning, then manually dispatch `publish.yml` from `master`, selecting `web-unstyled`. Publishing uses the `Production` environment and npm trusted publishing; configure this package's trusted publisher for `Niikelion/reactive-forge-studio`, workflow `publish.yml`, environment `Production`. A first npm publication may require an authenticated maintainer before trusted publishing can be configured. Never commit npm credentials.
|
package/dist/Button.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/Button.d.ts
|
|
3
|
+
export interface ButtonProps {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
type?: 'button' | 'submit' | 'reset';
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: Record<string, string | number>;
|
|
10
|
+
}
|
|
11
|
+
export declare const Button: ({ children, disabled, onClick, type, className, style }: ButtonProps) => import("react").JSX.Element;
|
|
12
|
+
//#endregion
|
|
13
|
+
//# sourceMappingURL=Button.d.ts.map
|
package/dist/Button.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
//#region src/Button.tsx
|
|
3
|
+
/** A native button with every browser style reset, so all appearance comes from the author. */
|
|
4
|
+
const reset = {
|
|
5
|
+
appearance: "none",
|
|
6
|
+
background: "none",
|
|
7
|
+
border: 0,
|
|
8
|
+
borderRadius: 0,
|
|
9
|
+
margin: 0,
|
|
10
|
+
padding: 0,
|
|
11
|
+
font: "inherit",
|
|
12
|
+
color: "inherit",
|
|
13
|
+
letterSpacing: "inherit",
|
|
14
|
+
textAlign: "inherit",
|
|
15
|
+
textTransform: "none",
|
|
16
|
+
lineHeight: "inherit",
|
|
17
|
+
boxSizing: "border-box",
|
|
18
|
+
cursor: "pointer"
|
|
19
|
+
};
|
|
20
|
+
const Button = ({ children, disabled, onClick, type = "button", className, style }) => /* @__PURE__ */ jsx("button", {
|
|
21
|
+
type,
|
|
22
|
+
disabled,
|
|
23
|
+
onClick,
|
|
24
|
+
className,
|
|
25
|
+
style: {
|
|
26
|
+
...reset,
|
|
27
|
+
...style
|
|
28
|
+
},
|
|
29
|
+
children
|
|
30
|
+
});
|
|
31
|
+
//#endregion
|
|
32
|
+
export { Button };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.js","names":[],"sources":["../src/Button.tsx"],"sourcesContent":["import type {CSSProperties, ReactNode} from 'react'\n\nexport interface ButtonProps {\n children?: ReactNode\n disabled?: boolean\n onClick?: () => void\n type?: 'button' | 'submit' | 'reset'\n className?: string\n style?: Record<string, string | number>\n}\n\n/** A native button with every browser style reset, so all appearance comes from the author. */\nconst reset: CSSProperties = {\n appearance: 'none',\n background: 'none',\n border: 0,\n borderRadius: 0,\n margin: 0,\n padding: 0,\n font: 'inherit',\n color: 'inherit',\n letterSpacing: 'inherit',\n textAlign: 'inherit',\n textTransform: 'none',\n lineHeight: 'inherit',\n boxSizing: 'border-box',\n cursor: 'pointer',\n}\n\nexport const Button = ({children, disabled, onClick, type = 'button', className, style}: ButtonProps) => (\n <button type={type} disabled={disabled} onClick={onClick} className={className} style={{...reset, ...style} as CSSProperties}>\n {children}\n </button>\n)\n"],"mappings":";;;AAYA,MAAM,QAAuB;CAC3B,YAAY;CACZ,YAAY;CACZ,QAAQ;CACR,cAAc;CACd,QAAQ;CACR,SAAS;CACT,MAAM;CACN,OAAO;CACP,eAAe;CACf,WAAW;CACX,eAAe;CACf,YAAY;CACZ,WAAW;CACX,QAAQ;AACV;AAEA,MAAa,UAAU,EAAC,UAAU,UAAU,SAAS,OAAO,UAAU,WAAW,YAC/E,oBAAC,UAAD;CAAc;CAAgB;CAAmB;CAAoB;CAAW,OAAO;EAAC,GAAG;EAAO,GAAG;CAAK;CACvG;AACK,CAAA"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,52 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reactive-forge-studio/web-unstyled",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Web - unstyled: the built-in component library of Reactive Forge Studio.",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/Niikelion/reactive-forge-studio.git",
|
|
9
|
+
"directory": "packages/web-unstyled"
|
|
10
|
+
},
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./Button": {
|
|
21
|
+
"types": "./dist/Button.d.ts",
|
|
22
|
+
"import": "./dist/Button.js"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "tsdown",
|
|
30
|
+
"prepack": "yarn build",
|
|
31
|
+
"codegen": "forge codegen",
|
|
32
|
+
"bundle": "studio-bundle build",
|
|
33
|
+
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"react": "^18.0.0 || ^19.0.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@reactive-forge-studio/bundle": "workspace:*",
|
|
40
|
+
"@reactive-forge/codegen": "2.1.0",
|
|
41
|
+
"@types/react": "^19",
|
|
42
|
+
"tsdown": "0.23.0",
|
|
43
|
+
"typescript": "^5"
|
|
44
|
+
},
|
|
45
|
+
"reactiveForgeStudio": {
|
|
46
|
+
"id": "web-unstyled",
|
|
47
|
+
"name": "Web - unstyled",
|
|
48
|
+
"exports": {
|
|
49
|
+
"Button": "./Button"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|