@hanzo/gui 2.0.0-rc.29
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/bundle-native.mjs +20 -0
- package/dist/cjs/createGui.cjs +69 -0
- package/dist/cjs/createGui.native.js +77 -0
- package/dist/cjs/createGui.native.js.map +1 -0
- package/dist/cjs/index.cjs +102 -0
- package/dist/cjs/index.native.js +105 -0
- package/dist/cjs/index.native.js.map +1 -0
- package/dist/cjs/setup.cjs +26 -0
- package/dist/cjs/setup.native.js +31 -0
- package/dist/cjs/setup.native.js.map +1 -0
- package/dist/cjs/viewTypes.cjs +16 -0
- package/dist/cjs/viewTypes.native.js +19 -0
- package/dist/cjs/viewTypes.native.js.map +1 -0
- package/dist/cjs/views/EnsureFlexed.cjs +36 -0
- package/dist/cjs/views/EnsureFlexed.native.js +39 -0
- package/dist/cjs/views/EnsureFlexed.native.js.map +1 -0
- package/dist/cjs/views/GuiProvider.cjs +27 -0
- package/dist/cjs/views/GuiProvider.native.js +30 -0
- package/dist/cjs/views/GuiProvider.native.js.map +1 -0
- package/dist/cjs/views/Text.cjs +38 -0
- package/dist/cjs/views/Text.native.js +41 -0
- package/dist/cjs/views/Text.native.js.map +1 -0
- package/dist/cjs/views/VisuallyHidden.cjs +58 -0
- package/dist/cjs/views/VisuallyHidden.native.js +61 -0
- package/dist/cjs/views/VisuallyHidden.native.js.map +1 -0
- package/dist/esm/createGui.mjs +46 -0
- package/dist/esm/createGui.mjs.map +1 -0
- package/dist/esm/createGui.native.js +51 -0
- package/dist/esm/createGui.native.js.map +1 -0
- package/dist/esm/index.js +19 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/index.mjs +19 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/index.native.js +19 -0
- package/dist/esm/index.native.js.map +1 -0
- package/dist/esm/setup.mjs +4 -0
- package/dist/esm/setup.mjs.map +1 -0
- package/dist/esm/setup.native.js +5 -0
- package/dist/esm/setup.native.js.map +1 -0
- package/dist/esm/viewTypes.mjs +2 -0
- package/dist/esm/viewTypes.mjs.map +1 -0
- package/dist/esm/viewTypes.native.js +2 -0
- package/dist/esm/viewTypes.native.js.map +1 -0
- package/dist/esm/views/EnsureFlexed.mjs +13 -0
- package/dist/esm/views/EnsureFlexed.mjs.map +1 -0
- package/dist/esm/views/EnsureFlexed.native.js +13 -0
- package/dist/esm/views/EnsureFlexed.native.js.map +1 -0
- package/dist/esm/views/GuiProvider.mjs +4 -0
- package/dist/esm/views/GuiProvider.mjs.map +1 -0
- package/dist/esm/views/GuiProvider.native.js +4 -0
- package/dist/esm/views/GuiProvider.native.js.map +1 -0
- package/dist/esm/views/Text.mjs +15 -0
- package/dist/esm/views/Text.mjs.map +1 -0
- package/dist/esm/views/Text.native.js +15 -0
- package/dist/esm/views/Text.native.js.map +1 -0
- package/dist/esm/views/VisuallyHidden.mjs +35 -0
- package/dist/esm/views/VisuallyHidden.mjs.map +1 -0
- package/dist/esm/views/VisuallyHidden.native.js +35 -0
- package/dist/esm/views/VisuallyHidden.native.js.map +1 -0
- package/dist/jsx/createGui.mjs +46 -0
- package/dist/jsx/createGui.mjs.map +1 -0
- package/dist/jsx/createGui.native.js +77 -0
- package/dist/jsx/createGui.native.js.map +1 -0
- package/dist/jsx/index.js +19 -0
- package/dist/jsx/index.js.map +1 -0
- package/dist/jsx/index.mjs +19 -0
- package/dist/jsx/index.mjs.map +1 -0
- package/dist/jsx/index.native.js +105 -0
- package/dist/jsx/index.native.js.map +1 -0
- package/dist/jsx/setup.mjs +4 -0
- package/dist/jsx/setup.mjs.map +1 -0
- package/dist/jsx/setup.native.js +31 -0
- package/dist/jsx/setup.native.js.map +1 -0
- package/dist/jsx/viewTypes.mjs +2 -0
- package/dist/jsx/viewTypes.mjs.map +1 -0
- package/dist/jsx/viewTypes.native.js +19 -0
- package/dist/jsx/viewTypes.native.js.map +1 -0
- package/dist/jsx/views/EnsureFlexed.mjs +13 -0
- package/dist/jsx/views/EnsureFlexed.mjs.map +1 -0
- package/dist/jsx/views/EnsureFlexed.native.js +39 -0
- package/dist/jsx/views/EnsureFlexed.native.js.map +1 -0
- package/dist/jsx/views/GuiProvider.mjs +4 -0
- package/dist/jsx/views/GuiProvider.mjs.map +1 -0
- package/dist/jsx/views/GuiProvider.native.js +30 -0
- package/dist/jsx/views/GuiProvider.native.js.map +1 -0
- package/dist/jsx/views/Text.mjs +15 -0
- package/dist/jsx/views/Text.mjs.map +1 -0
- package/dist/jsx/views/Text.native.js +41 -0
- package/dist/jsx/views/Text.native.js.map +1 -0
- package/dist/jsx/views/VisuallyHidden.mjs +35 -0
- package/dist/jsx/views/VisuallyHidden.mjs.map +1 -0
- package/dist/jsx/views/VisuallyHidden.native.js +61 -0
- package/dist/jsx/views/VisuallyHidden.native.js.map +1 -0
- package/gui.config.ts +4 -0
- package/linear-gradient/index.cjs +2 -0
- package/linear-gradient/index.d.ts +1 -0
- package/linear-gradient/index.js +2 -0
- package/linear-gradient/index.native.cjs +2 -0
- package/linear-gradient/index.native.js +2 -0
- package/native/index.cjs +2 -0
- package/native/index.js +2 -0
- package/native-test/index.cjs +2 -0
- package/native-test/index.js +2 -0
- package/native-test/index.native.cjs +2 -0
- package/native-test/index.native.js +2 -0
- package/native-test.cjs +1 -0
- package/native-test.d.ts +1 -0
- package/native.cjs +1 -0
- package/native.d.ts +1 -0
- package/package.json +111 -0
- package/react-native-web/index.cjs +2 -0
- package/react-native-web/index.js +2 -0
- package/react-native-web/index.native.cjs +2 -0
- package/react-native-web/index.native.js +2 -0
- package/react-native-web.cjs +1 -0
- package/src/createGui.ts +72 -0
- package/src/index.ts +157 -0
- package/src/setup.ts +13 -0
- package/src/viewTypes.tsx +50 -0
- package/src/views/EnsureFlexed.tsx +17 -0
- package/src/views/GuiProvider.tsx +5 -0
- package/src/views/Text.tsx +15 -0
- package/src/views/VisuallyHidden.tsx +38 -0
- package/tsconfig.json +171 -0
- package/types/createGui.d.ts +6 -0
- package/types/createGui.d.ts.map +1 -0
- package/types/index.d.ts +20 -0
- package/types/index.d.ts.map +1 -0
- package/types/setup.d.ts +2 -0
- package/types/setup.d.ts.map +1 -0
- package/types/viewTypes.d.ts +43 -0
- package/types/viewTypes.d.ts.map +1 -0
- package/types/views/EnsureFlexed.d.ts +2 -0
- package/types/views/EnsureFlexed.d.ts.map +1 -0
- package/types/views/GuiProvider.d.ts +4 -0
- package/types/views/GuiProvider.d.ts.map +1 -0
- package/types/views/Text.d.ts +4 -0
- package/types/views/Text.d.ts.map +1 -0
- package/types/views/VisuallyHidden.d.ts +5 -0
- package/types/views/VisuallyHidden.d.ts.map +1 -0
- package/web/index.cjs +2 -0
- package/web/index.js +2 -0
- package/web/index.native.cjs +2 -0
- package/web/index.native.js +2 -0
- package/web.cjs +1 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { View, styled } from "@hanzo/gui-core";
|
|
2
|
+
const VisuallyHidden = styled(View, {
|
|
3
|
+
position: "absolute",
|
|
4
|
+
width: 1,
|
|
5
|
+
height: 1,
|
|
6
|
+
margin: -1,
|
|
7
|
+
zIndex: -1e4,
|
|
8
|
+
overflow: "hidden",
|
|
9
|
+
opacity: 1e-8,
|
|
10
|
+
pointerEvents: "none",
|
|
11
|
+
variants: {
|
|
12
|
+
preserveDimensions: {
|
|
13
|
+
true: {
|
|
14
|
+
position: "relative",
|
|
15
|
+
width: "auto",
|
|
16
|
+
height: "auto"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
visible: {
|
|
20
|
+
true: {
|
|
21
|
+
position: "relative",
|
|
22
|
+
width: "auto",
|
|
23
|
+
height: "auto",
|
|
24
|
+
margin: 0,
|
|
25
|
+
zIndex: 1,
|
|
26
|
+
overflow: "visible",
|
|
27
|
+
opacity: 1,
|
|
28
|
+
pointerEvents: "auto"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
VisuallyHidden.isVisuallyHidden = !0;
|
|
34
|
+
export { VisuallyHidden };
|
|
35
|
+
//# sourceMappingURL=VisuallyHidden.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["View","styled","VisuallyHidden","position","width","height","margin","zIndex","overflow","opacity","pointerEvents","variants","preserveDimensions","true","visible","isVisuallyHidden"],"sources":["../../../src/views/VisuallyHidden.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,IAAA,EAAMC,MAAA,QAAc;AAEtB,MAAMC,cAAA,GAAiBD,MAAA,CAAOD,IAAA,EAAM;EACzCG,QAAA,EAAU;EACVC,KAAA,EAAO;EACPC,MAAA,EAAQ;EACRC,MAAA,EAAQ;EACRC,MAAA,EAAQ;EACRC,QAAA,EAAU;EACVC,OAAA,EAAS;EACTC,aAAA,EAAe;EAEfC,QAAA,EAAU;IACRC,kBAAA,EAAoB;MAClBC,IAAA,EAAM;QACJV,QAAA,EAAU;QACVC,KAAA,EAAO;QACPC,MAAA,EAAQ;MACV;IACF;IAEAS,OAAA,EAAS;MACPD,IAAA,EAAM;QACJV,QAAA,EAAU;QACVC,KAAA,EAAO;QACPC,MAAA,EAAQ;QACRC,MAAA,EAAQ;QACRC,MAAA,EAAQ;QACRC,QAAA,EAAU;QACVC,OAAA,EAAS;QACTC,aAAA,EAAe;MACjB;IACF;EACF;AACF,CAAC;AAGDR,cAAA,CAAea,gBAAA,GAAsB","ignoreList":[]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: !0
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
__copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
+
value: !0
|
|
22
|
+
}), mod);
|
|
23
|
+
var VisuallyHidden_exports = {};
|
|
24
|
+
__export(VisuallyHidden_exports, {
|
|
25
|
+
VisuallyHidden: () => VisuallyHidden
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(VisuallyHidden_exports);
|
|
28
|
+
var import_gui_core = require("@hanzo/gui-core"),
|
|
29
|
+
VisuallyHidden = (0, import_gui_core.styled)(import_gui_core.View, {
|
|
30
|
+
position: "absolute",
|
|
31
|
+
width: 1,
|
|
32
|
+
height: 1,
|
|
33
|
+
margin: -1,
|
|
34
|
+
zIndex: -1e4,
|
|
35
|
+
overflow: "hidden",
|
|
36
|
+
opacity: 1e-8,
|
|
37
|
+
pointerEvents: "none",
|
|
38
|
+
variants: {
|
|
39
|
+
preserveDimensions: {
|
|
40
|
+
true: {
|
|
41
|
+
position: "relative",
|
|
42
|
+
width: "auto",
|
|
43
|
+
height: "auto"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
visible: {
|
|
47
|
+
true: {
|
|
48
|
+
position: "relative",
|
|
49
|
+
width: "auto",
|
|
50
|
+
height: "auto",
|
|
51
|
+
margin: 0,
|
|
52
|
+
zIndex: 1,
|
|
53
|
+
overflow: "visible",
|
|
54
|
+
opacity: 1,
|
|
55
|
+
pointerEvents: "auto"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
VisuallyHidden.isVisuallyHidden = !0;
|
|
61
|
+
//# sourceMappingURL=VisuallyHidden.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","VisuallyHidden_exports","VisuallyHidden","module","exports","import_gui_core","require","styled","View","position","width","height","margin","zIndex","overflow","opacity","pointerEvents","variants","preserveDimensions","true"],"sources":["../../../src/views/VisuallyHidden.tsx"],"sourcesContent":[null],"mappings":"AAAA,YAAS;;AAEF,IAAAA,SAAM,GAAAC,MAAA,CAAiBC,cAAa;AAAA,IACzCC,gBAAU,GAAAF,MAAA,CAAAG,wBAAA;AAAA,IACVC,iBAAO,GAAAJ,MAAA,CAAAK,mBAAA;AAAA,IACPC,YAAQ,GAAAN,MAAA,CAAAO,SAAA,CAAAC,cAAA;AAAA,IACRC,QAAQ,GAAAA,CAAAC,MAAA,EAAAC,GAAA;IACR,SAAQC,IAAA,IAAAD,GAAA,EACRZ,SAAU,CAAAW,MAAA,EAAAE,IAAA;MAAAC,GAAA,EAAAF,GAAA,CAAAC,IAAA;MAAAE,UAAA;IAAA;EAAA;EACVC,WAAS,GAAAA,CAAAC,EAAA,EAAAC,IAAA,EAAAC,MAAA,EAAAC,IAAA;IACT,IAAAF,IAAA,WAAeA,IAAA,uBAAAA,IAAA,gBAEf,SAAUG,GAAA,IAAAhB,iBAAA,CAAAa,IAAA,GACR,CAAAX,YAAA,CAAAe,IAAoB,CAAAL,EAAA,EAAAI,GAAA,KAAAA,GAAA,KAAAF,MAAA,IAAAnB,SAAA,CAAAiB,EAAA,EAAAI,GAAA;MAAAP,GAAA,EAAAA,CAAA,KAAAI,IAAA,CAAAG,GAAA;MAAAN,UAAA,IAAAK,IAAA,GAAAjB,gBAAA,CAAAe,IAAA,EAAAG,GAAA,MAAAD,IAAA,CAAAL;IAAA;IAAA,OAClBE,EAAA;EAAM;AACM,IAAAM,YACH,GAAAC,GAAA,IAAAR,WAAA,CAAAhB,SAAA;EAAAyB,KAAA;AAAA,IAAAD,GAAA;AAAA,IAAAE,sBACC;AAAAhB,QACV,CAAAgB,sBAAA;EAAAC,cACF,EAAAA,CAAA,KAAAA;AAAA;AAESC,MACP,CAAAC,OAAM,GAAAN,YAAA,CAAAG,sBAAA;AAAA,IAAAI,eACM,GAAAC,OAAA;EAAAJ,cAAA,OAAAG,eAAA,CAAAE,MAAA,EAAAF,eAAA,CAAAG,IAAA;IAAAC,QACV,YAAO;IAAAC,KAAA,EACP;IAAQC,MACR;IAAQC,MACR;IAAQC,MACR;IAAUC,QACV,UAAS;IAAAC,OACT;IAAeC,aACjB;IAAAC,QACF;MACFC,kBAAA;QACDC,IAAA;UAGDV,QAAe","ignoreList":[]}
|
package/gui.config.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../src/linear-gradient'
|
package/native/index.cjs
ADDED
package/native/index.js
ADDED
package/native-test.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.assign(module.exports, require('./dist/test'))
|
package/native-test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './types'
|
package/native.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.assign(module.exports, require('./dist/native'))
|
package/native.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './types'
|
package/package.json
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hanzo/gui",
|
|
3
|
+
"version": "2.0.0-rc.29",
|
|
4
|
+
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
|
|
5
|
+
"description": "Style and UI for React (web and native) meet an optimizing compiler",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/hanzoai/gui.git",
|
|
9
|
+
"directory": "code/ui/gui"
|
|
10
|
+
},
|
|
11
|
+
"source": "src/index.ts",
|
|
12
|
+
"type": "module",
|
|
13
|
+
"sideEffects": [
|
|
14
|
+
"setup.js"
|
|
15
|
+
],
|
|
16
|
+
"main": "dist/cjs",
|
|
17
|
+
"module": "dist/esm",
|
|
18
|
+
"types": "./types/index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
"./package.json": "./package.json",
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./types/index.d.ts",
|
|
23
|
+
"react-native": "./dist/esm/index.native.js",
|
|
24
|
+
"browser": "./dist/esm/index.mjs",
|
|
25
|
+
"module": "./dist/esm/index.mjs",
|
|
26
|
+
"import": "./dist/esm/index.mjs",
|
|
27
|
+
"require": "./dist/cjs/index.cjs",
|
|
28
|
+
"default": "./dist/esm/index.mjs"
|
|
29
|
+
},
|
|
30
|
+
"./react-native-web": {
|
|
31
|
+
"types": "./types/index.d.ts",
|
|
32
|
+
"react-native": "./dist/esm/react-native-web.native.js",
|
|
33
|
+
"browser": "./dist/esm/react-native-web.mjs",
|
|
34
|
+
"module": "./dist/esm/react-native-web.mjs",
|
|
35
|
+
"import": "./dist/esm/react-native-web.mjs",
|
|
36
|
+
"require": "./dist/cjs/react-native-web.cjs",
|
|
37
|
+
"default": "./dist/esm/react-native-web.mjs"
|
|
38
|
+
},
|
|
39
|
+
"./web": {
|
|
40
|
+
"types": "./types/index.d.ts",
|
|
41
|
+
"react-native": "./dist/esm/index.native.js",
|
|
42
|
+
"browser": "./dist/esm/index.mjs",
|
|
43
|
+
"module": "./dist/esm/index.mjs",
|
|
44
|
+
"import": "./dist/esm/index.mjs",
|
|
45
|
+
"require": "./dist/cjs/index.cjs",
|
|
46
|
+
"default": "./dist/esm/index.mjs"
|
|
47
|
+
},
|
|
48
|
+
"./native": {
|
|
49
|
+
"types": "./types/index.d.ts",
|
|
50
|
+
"react-native": "./dist/native.cjs",
|
|
51
|
+
"require": "./dist/native.cjs",
|
|
52
|
+
"default": "./dist/native.cjs"
|
|
53
|
+
},
|
|
54
|
+
"./native-test": {
|
|
55
|
+
"types": "./types/index.d.ts",
|
|
56
|
+
"react-native": "./dist/test.native.js",
|
|
57
|
+
"require": "./dist/test.cjs",
|
|
58
|
+
"default": "./dist/test.cjs"
|
|
59
|
+
},
|
|
60
|
+
"./linear-gradient": {
|
|
61
|
+
"types": "./types/linear-gradient.d.ts",
|
|
62
|
+
"react-native": "./dist/esm/linear-gradient.native.js",
|
|
63
|
+
"browser": "./dist/esm/linear-gradient.mjs",
|
|
64
|
+
"module": "./dist/esm/linear-gradient.mjs",
|
|
65
|
+
"import": "./dist/esm/linear-gradient.mjs",
|
|
66
|
+
"require": "./dist/cjs/linear-gradient.cjs",
|
|
67
|
+
"default": "./dist/esm/linear-gradient.mjs"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"scripts": {
|
|
71
|
+
"build": "hanzo-gui-build",
|
|
72
|
+
"afterBuild": "echo 'native bundle skipped - UI packages moved to hanzo/ui'",
|
|
73
|
+
"watch": "hanzo-gui-build --watch",
|
|
74
|
+
"clean": "hanzo-gui-build clean",
|
|
75
|
+
"clean:build": "hanzo-gui-build clean:build",
|
|
76
|
+
"check": "bun run check-circular-deps",
|
|
77
|
+
"check-circular-deps": "npx madge --circular ./src/index.ts"
|
|
78
|
+
},
|
|
79
|
+
"dependencies": {
|
|
80
|
+
"@hanzo/gui-compose-refs": "2.0.0-rc.29",
|
|
81
|
+
"@hanzo/gui-constants": "2.0.0-rc.29",
|
|
82
|
+
"@hanzo/gui-core": "2.0.0-rc.29",
|
|
83
|
+
"@hanzo/gui-create-context": "2.0.0-rc.29",
|
|
84
|
+
"@hanzo/gui-element": "2.0.0-rc.29",
|
|
85
|
+
"@hanzo/gui-fake-react-native": "2.0.0-rc.29",
|
|
86
|
+
"@hanzo/gui-get-button-sized": "2.0.0-rc.29",
|
|
87
|
+
"@hanzo/gui-get-font-sized": "2.0.0-rc.29",
|
|
88
|
+
"@hanzo/gui-get-token": "2.0.0-rc.29",
|
|
89
|
+
"@hanzo/gui-helpers": "2.0.0-rc.29",
|
|
90
|
+
"@hanzo/gui-polyfill-dev": "2.0.0-rc.29",
|
|
91
|
+
"@hanzo/gui-react-native-media-driver": "2.0.0-rc.29",
|
|
92
|
+
"@hanzo/gui-theme": "2.0.0-rc.29",
|
|
93
|
+
"@hanzo/gui-use-controllable-state": "2.0.0-rc.29",
|
|
94
|
+
"@hanzo/gui-use-debounce": "2.0.0-rc.29",
|
|
95
|
+
"@hanzo/gui-use-force-update": "2.0.0-rc.29",
|
|
96
|
+
"@hanzo/gui-use-window-dimensions": "2.0.0-rc.29",
|
|
97
|
+
"@hanzo/gui-font-size": "2.0.0-rc.29"
|
|
98
|
+
},
|
|
99
|
+
"devDependencies": {
|
|
100
|
+
"@hanzo/gui-build": "2.0.0-rc.29",
|
|
101
|
+
"react": ">=19",
|
|
102
|
+
"react-native": "0.83.2",
|
|
103
|
+
"react-native-web": "^0.21.0"
|
|
104
|
+
},
|
|
105
|
+
"peerDependencies": {
|
|
106
|
+
"react": ">=19",
|
|
107
|
+
"react-native": "*"
|
|
108
|
+
},
|
|
109
|
+
"module:jsx": "dist/jsx",
|
|
110
|
+
"removeSideEffects": true
|
|
111
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.assign(module.exports, require('./dist/cjs/react-native-web.cjs'))
|
package/src/createGui.ts
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { createGui as createGuiCore } from '@hanzo/gui-core'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Adds some helpful validation at dev time only for `gui` specifically
|
|
5
|
+
**/
|
|
6
|
+
|
|
7
|
+
export const createGui: typeof createGuiCore =
|
|
8
|
+
process.env.NODE_ENV !== 'development'
|
|
9
|
+
? createGuiCore
|
|
10
|
+
: (conf) => {
|
|
11
|
+
const sizeTokenKeys = ['$true']
|
|
12
|
+
|
|
13
|
+
const hasKeys = (expectedKeys: string[], obj: Record<any, any>) => {
|
|
14
|
+
return expectedKeys.every((k) => typeof obj[k] !== 'undefined')
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const guiConfig = createGuiCore(conf)
|
|
18
|
+
|
|
19
|
+
// size and space should be fully defined
|
|
20
|
+
for (const name of ['size', 'space'] as const) {
|
|
21
|
+
const tokenSet = guiConfig.tokensParsed[name]
|
|
22
|
+
if (!tokenSet) {
|
|
23
|
+
throw new Error(
|
|
24
|
+
`Expected tokens for "${name}" in ${Object.keys(
|
|
25
|
+
guiConfig.tokensParsed
|
|
26
|
+
).join(', ')}`
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
if (!hasKeys(sizeTokenKeys, tokenSet)) {
|
|
30
|
+
throw new Error(`
|
|
31
|
+
createGui() missing expected tokens.${name}:
|
|
32
|
+
|
|
33
|
+
Received: ${Object.keys(tokenSet).join(', ')}
|
|
34
|
+
|
|
35
|
+
Expected: ${sizeTokenKeys.join(', ')}
|
|
36
|
+
|
|
37
|
+
Hanzo GUI expects a "true" key that is the same value as your default size. This is so
|
|
38
|
+
it can size things up or down from the defaults without assuming which keys you use.
|
|
39
|
+
|
|
40
|
+
Please define a "true" or "$true" key on your size and space tokens like so (example):
|
|
41
|
+
|
|
42
|
+
size: {
|
|
43
|
+
sm: 2,
|
|
44
|
+
md: 10,
|
|
45
|
+
true: 10, // this means "md" is your default size
|
|
46
|
+
lg: 20,
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
`)
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// others must define subset of size tokens
|
|
54
|
+
const expected = Object.keys(guiConfig.tokensParsed.size)
|
|
55
|
+
for (const name of ['radius', 'zIndex'] as const) {
|
|
56
|
+
const tokenSet = guiConfig.tokensParsed[name]
|
|
57
|
+
const received = Object.keys(tokenSet)
|
|
58
|
+
const hasSomeOverlap = received.some((rk) => expected.includes(rk))
|
|
59
|
+
if (!hasSomeOverlap) {
|
|
60
|
+
throw new Error(`
|
|
61
|
+
createGui() invalid tokens.${name}:
|
|
62
|
+
|
|
63
|
+
Received: ${received.join(', ')}
|
|
64
|
+
|
|
65
|
+
Expected a subset of: ${expected.join(', ')}
|
|
66
|
+
|
|
67
|
+
`)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return guiConfig
|
|
72
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import './setup'
|
|
2
|
+
|
|
3
|
+
export * from '@hanzo/gui-compose-refs'
|
|
4
|
+
export * from '@hanzo/gui-create-context'
|
|
5
|
+
export * from '@hanzo/gui-font-size'
|
|
6
|
+
export * from '@hanzo/gui-react-native-media-driver'
|
|
7
|
+
export * from '@hanzo/gui-helpers'
|
|
8
|
+
export * from '@hanzo/gui-theme'
|
|
9
|
+
export * from '@hanzo/gui-use-controllable-state'
|
|
10
|
+
export * from '@hanzo/gui-use-debounce'
|
|
11
|
+
export * from '@hanzo/gui-use-force-update'
|
|
12
|
+
export * from '@hanzo/gui-element'
|
|
13
|
+
export * from '@hanzo/gui-use-window-dimensions'
|
|
14
|
+
|
|
15
|
+
export * from './createGui'
|
|
16
|
+
|
|
17
|
+
export * from './viewTypes'
|
|
18
|
+
export * from './views/GuiProvider'
|
|
19
|
+
|
|
20
|
+
export * from './views/EnsureFlexed'
|
|
21
|
+
export * from './views/Text'
|
|
22
|
+
|
|
23
|
+
// since we overlap with ViewProps and potentially others
|
|
24
|
+
// lets be explicit on what gets exported
|
|
25
|
+
export type {
|
|
26
|
+
TransitionKeys,
|
|
27
|
+
TransitionProp,
|
|
28
|
+
ColorTokens,
|
|
29
|
+
CreateGuiConfig,
|
|
30
|
+
CreateGuiProps,
|
|
31
|
+
FontColorTokens,
|
|
32
|
+
FontLanguages,
|
|
33
|
+
FontLetterSpacingTokens,
|
|
34
|
+
FontLineHeightTokens,
|
|
35
|
+
FontFamilyTokens,
|
|
36
|
+
FontSizeTokens,
|
|
37
|
+
FontStyleTokens,
|
|
38
|
+
FontTokens,
|
|
39
|
+
FontTransformTokens,
|
|
40
|
+
FontWeightTokens,
|
|
41
|
+
GenericFont,
|
|
42
|
+
GenericStackVariants,
|
|
43
|
+
GenericGuiConfig,
|
|
44
|
+
GenericTextVariants,
|
|
45
|
+
GetAnimationKeys,
|
|
46
|
+
GetProps,
|
|
47
|
+
GetRef,
|
|
48
|
+
GetThemeValueForKey,
|
|
49
|
+
GroupNames,
|
|
50
|
+
Longhands,
|
|
51
|
+
Media,
|
|
52
|
+
MediaPropKeys,
|
|
53
|
+
MediaQueries,
|
|
54
|
+
MediaQueryState,
|
|
55
|
+
RadiusTokens,
|
|
56
|
+
Shorthands,
|
|
57
|
+
SizeTokens,
|
|
58
|
+
SpaceTokens,
|
|
59
|
+
SpecificTokens,
|
|
60
|
+
StackNonStyleProps,
|
|
61
|
+
ViewProps,
|
|
62
|
+
StaticConfig,
|
|
63
|
+
Styleable,
|
|
64
|
+
GuiBaseTheme,
|
|
65
|
+
GuiBuildOptions,
|
|
66
|
+
GuiComponent,
|
|
67
|
+
GuiConfig,
|
|
68
|
+
GuiCustomConfig,
|
|
69
|
+
GuiElement,
|
|
70
|
+
GuiInternalConfig,
|
|
71
|
+
GuiProviderProps,
|
|
72
|
+
GuiSettings,
|
|
73
|
+
GuiTextElement,
|
|
74
|
+
TextNonStyleProps,
|
|
75
|
+
TextProps,
|
|
76
|
+
ThemeKeys,
|
|
77
|
+
ThemeName,
|
|
78
|
+
ThemeParsed,
|
|
79
|
+
ThemeProps,
|
|
80
|
+
Themes,
|
|
81
|
+
ThemeTokens,
|
|
82
|
+
ThemeValueFallback,
|
|
83
|
+
Token,
|
|
84
|
+
Tokens,
|
|
85
|
+
TypeOverride,
|
|
86
|
+
Variable,
|
|
87
|
+
VariantSpreadExtras,
|
|
88
|
+
VariantSpreadFunction,
|
|
89
|
+
ZIndexTokens,
|
|
90
|
+
ViewStyle,
|
|
91
|
+
TextStyle,
|
|
92
|
+
} from '@hanzo/gui-core'
|
|
93
|
+
|
|
94
|
+
export {
|
|
95
|
+
ClientOnly,
|
|
96
|
+
Configuration,
|
|
97
|
+
ComponentContext,
|
|
98
|
+
GroupContext,
|
|
99
|
+
FontLanguage,
|
|
100
|
+
// components
|
|
101
|
+
Theme,
|
|
102
|
+
View,
|
|
103
|
+
createComponent,
|
|
104
|
+
createFont,
|
|
105
|
+
createShorthands,
|
|
106
|
+
createStyledContext,
|
|
107
|
+
createTokens,
|
|
108
|
+
createVariable,
|
|
109
|
+
getConfig,
|
|
110
|
+
getMedia,
|
|
111
|
+
getCSSStylesAtomic,
|
|
112
|
+
getThemes,
|
|
113
|
+
getToken,
|
|
114
|
+
getTokenValue,
|
|
115
|
+
getTokens,
|
|
116
|
+
getVariable,
|
|
117
|
+
getVariableName,
|
|
118
|
+
getVariableValue,
|
|
119
|
+
insertFont,
|
|
120
|
+
setConfig,
|
|
121
|
+
setupDev,
|
|
122
|
+
_withStableStyle,
|
|
123
|
+
// constants
|
|
124
|
+
isBrowser,
|
|
125
|
+
isChrome,
|
|
126
|
+
isClient,
|
|
127
|
+
isServer,
|
|
128
|
+
isGuiComponent,
|
|
129
|
+
isGuiElement,
|
|
130
|
+
isTouchable,
|
|
131
|
+
isVariable,
|
|
132
|
+
isWeb,
|
|
133
|
+
isWebTouchable,
|
|
134
|
+
matchMedia,
|
|
135
|
+
mediaObjectToString,
|
|
136
|
+
mediaQueryConfig,
|
|
137
|
+
mediaState,
|
|
138
|
+
setOnLayoutStrategy,
|
|
139
|
+
styled,
|
|
140
|
+
themeable,
|
|
141
|
+
// hooks
|
|
142
|
+
useClientValue,
|
|
143
|
+
useDidFinishSSR,
|
|
144
|
+
useEvent,
|
|
145
|
+
useGet,
|
|
146
|
+
useIsTouchDevice,
|
|
147
|
+
useIsomorphicLayoutEffect,
|
|
148
|
+
useMedia,
|
|
149
|
+
useProps,
|
|
150
|
+
usePropsAndStyle,
|
|
151
|
+
useStyle,
|
|
152
|
+
useConfiguration,
|
|
153
|
+
useTheme,
|
|
154
|
+
useThemeName,
|
|
155
|
+
variableToString,
|
|
156
|
+
withStaticProperties,
|
|
157
|
+
} from '@hanzo/gui-core'
|
package/src/setup.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import '@hanzo/gui-polyfill-dev'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
|
|
5
|
+
// this fixes various issues people run into (storybook, etc in discord)
|
|
6
|
+
// React doesn't really tree shake so not much danger here...
|
|
7
|
+
globalThis['React'] ||= React
|
|
8
|
+
|
|
9
|
+
// for SSR
|
|
10
|
+
if (typeof requestAnimationFrame === 'undefined') {
|
|
11
|
+
globalThis['requestAnimationFrame'] =
|
|
12
|
+
typeof setImmediate === 'undefined' ? setTimeout : setImmediate
|
|
13
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { TextStyle, ViewStyle } from 'react-native'
|
|
2
|
+
|
|
3
|
+
export type ShorthandViewStyleProps = {
|
|
4
|
+
w?: ViewStyle['width']
|
|
5
|
+
h?: ViewStyle['height']
|
|
6
|
+
|
|
7
|
+
p?: ViewStyle['padding']
|
|
8
|
+
pt?: ViewStyle['paddingTop']
|
|
9
|
+
pb?: ViewStyle['paddingBottom']
|
|
10
|
+
pl?: ViewStyle['paddingLeft']
|
|
11
|
+
pr?: ViewStyle['paddingRight']
|
|
12
|
+
px?: ViewStyle['paddingHorizontal']
|
|
13
|
+
py?: ViewStyle['paddingVertical']
|
|
14
|
+
m?: ViewStyle['margin']
|
|
15
|
+
mt?: ViewStyle['marginTop']
|
|
16
|
+
mb?: ViewStyle['marginBottom']
|
|
17
|
+
ml?: ViewStyle['marginLeft']
|
|
18
|
+
mr?: ViewStyle['marginRight']
|
|
19
|
+
mx?: ViewStyle['marginHorizontal']
|
|
20
|
+
my?: ViewStyle['marginVertical']
|
|
21
|
+
|
|
22
|
+
f?: ViewStyle['flex']
|
|
23
|
+
fd?: ViewStyle['flexDirection']
|
|
24
|
+
fw?: ViewStyle['flexWrap']
|
|
25
|
+
fg?: ViewStyle['flexGrow']
|
|
26
|
+
fs?: ViewStyle['flexShrink']
|
|
27
|
+
fb?: ViewStyle['flexBasis']
|
|
28
|
+
|
|
29
|
+
ai?: ViewStyle['alignItems']
|
|
30
|
+
ac?: ViewStyle['alignContent']
|
|
31
|
+
jc?: ViewStyle['justifyContent']
|
|
32
|
+
als?: ViewStyle['alignSelf']
|
|
33
|
+
|
|
34
|
+
bc?: ViewStyle['backgroundColor']
|
|
35
|
+
|
|
36
|
+
br?: ViewStyle['borderRadius']
|
|
37
|
+
btrr?: ViewStyle['borderTopRightRadius']
|
|
38
|
+
bbrr?: ViewStyle['borderBottomRightRadius']
|
|
39
|
+
bblr?: ViewStyle['borderBottomLeftRadius']
|
|
40
|
+
btlr?: ViewStyle['borderTopLeftRadius']
|
|
41
|
+
|
|
42
|
+
pe?: 'box-none' | 'none' | 'box-only' | 'auto'
|
|
43
|
+
zi?: ViewStyle['zIndex']
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type ShorthandTextStyleProps = ShorthandViewStyleProps & {
|
|
47
|
+
ta?: TextStyle['textAlign']
|
|
48
|
+
fs?: TextStyle['fontSize']
|
|
49
|
+
lh?: TextStyle['lineHeight']
|
|
50
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Text, styled } from '@hanzo/gui-core'
|
|
2
|
+
|
|
3
|
+
// expands flex elements when they should push a far as they "want" naturally
|
|
4
|
+
|
|
5
|
+
export const EnsureFlexed = styled(Text, {
|
|
6
|
+
opacity: 0,
|
|
7
|
+
lineHeight: 0,
|
|
8
|
+
height: 0,
|
|
9
|
+
display: 'flex',
|
|
10
|
+
fontSize: 200,
|
|
11
|
+
children: 'wwwwwwwwwwwwwwwwwww',
|
|
12
|
+
pointerEvents: 'none',
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
// @tamgui/core checks for this in spacing
|
|
16
|
+
// @ts-ignore its ok some type setups dont like this
|
|
17
|
+
EnsureFlexed['isVisuallyHidden'] = true
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Text as GuiText, styled } from '@hanzo/gui-core'
|
|
2
|
+
|
|
3
|
+
export const Text = styled(GuiText, {
|
|
4
|
+
variants: {
|
|
5
|
+
unstyled: {
|
|
6
|
+
false: {
|
|
7
|
+
color: '$color',
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
} as const,
|
|
11
|
+
|
|
12
|
+
defaultVariants: {
|
|
13
|
+
unstyled: process.env.HANZO_GUI_HEADLESS === '1',
|
|
14
|
+
},
|
|
15
|
+
})
|