@hanzo/gui 4.7.3 → 7.0.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/hanzogui.config.ts +4 -0
- package/linear-gradient/index.cjs +1 -1
- package/linear-gradient/index.native.cjs +1 -1
- package/native/index.cjs +1 -1
- package/native-test/index.cjs +1 -1
- package/native-test/index.native.cjs +1 -1
- package/package.json +80 -87
- package/react-native-web/index.cjs +1 -1
- package/react-native-web/index.native.cjs +1 -1
- package/src/{createGui.ts → createHanzogui.ts} +13 -13
- package/src/index.ts +181 -39
- package/src/linear-gradient.ts +1 -0
- package/src/views/Anchor.tsx +38 -4
- package/src/views/Fieldset.tsx +22 -0
- package/src/views/HanzoguiProvider.tsx +14 -0
- package/src/views/Text.tsx +3 -3
- package/tsconfig.json +2 -2
- package/types/createHanzogui.d.ts +6 -0
- package/types/index.d.ts +47 -28
- package/types/linear-gradient.d.ts +2 -0
- package/types/views/Anchor.d.ts +14 -2
- package/types/views/EnsureFlexed.d.ts +1 -1
- package/types/views/Fieldset.d.ts +8 -0
- package/types/views/HanzoguiProvider.d.ts +3 -0
- package/types/views/Text.d.ts +1 -1
- package/types/views/VisuallyHidden.d.ts +1 -1
- package/web/index.cjs +1 -1
- package/web/index.native.cjs +1 -1
- package/dist/cjs/createGui.cjs +0 -80
- package/dist/cjs/createGui.native.js +0 -89
- package/dist/cjs/createGui.native.js.map +0 -1
- package/dist/cjs/index.cjs +0 -77
- package/dist/cjs/index.native.js +0 -80
- package/dist/cjs/index.native.js.map +0 -1
- package/dist/cjs/setup.cjs +0 -30
- package/dist/cjs/setup.native.js +0 -35
- package/dist/cjs/setup.native.js.map +0 -1
- package/dist/cjs/viewTypes.cjs +0 -18
- package/dist/cjs/viewTypes.native.js +0 -21
- package/dist/cjs/viewTypes.native.js.map +0 -1
- package/dist/cjs/views/Anchor.cjs +0 -34
- package/dist/cjs/views/Anchor.native.js +0 -37
- package/dist/cjs/views/Anchor.native.js.map +0 -1
- package/dist/cjs/views/EnsureFlexed.cjs +0 -38
- package/dist/cjs/views/EnsureFlexed.native.js +0 -41
- package/dist/cjs/views/EnsureFlexed.native.js.map +0 -1
- package/dist/cjs/views/GuiProvider.cjs +0 -29
- package/dist/cjs/views/GuiProvider.native.js +0 -32
- package/dist/cjs/views/GuiProvider.native.js.map +0 -1
- package/dist/cjs/views/Text.cjs +0 -40
- package/dist/cjs/views/Text.native.js +0 -43
- package/dist/cjs/views/Text.native.js.map +0 -1
- package/dist/cjs/views/VisuallyHidden.cjs +0 -60
- package/dist/cjs/views/VisuallyHidden.native.js +0 -63
- package/dist/cjs/views/VisuallyHidden.native.js.map +0 -1
- package/dist/esm/createGui.mjs +0 -55
- package/dist/esm/createGui.mjs.map +0 -1
- package/dist/esm/createGui.native.js +0 -61
- package/dist/esm/createGui.native.js.map +0 -1
- package/dist/esm/index.js +0 -44
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.mjs +0 -44
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js +0 -44
- package/dist/esm/index.native.js.map +0 -1
- package/dist/esm/setup.mjs +0 -6
- package/dist/esm/setup.mjs.map +0 -1
- package/dist/esm/setup.native.js +0 -8
- package/dist/esm/setup.native.js.map +0 -1
- package/dist/esm/viewTypes.mjs +0 -2
- package/dist/esm/viewTypes.mjs.map +0 -1
- package/dist/esm/viewTypes.native.js +0 -2
- package/dist/esm/viewTypes.native.js.map +0 -1
- package/dist/esm/views/Anchor.mjs +0 -9
- package/dist/esm/views/Anchor.mjs.map +0 -1
- package/dist/esm/views/Anchor.native.js +0 -9
- package/dist/esm/views/Anchor.native.js.map +0 -1
- package/dist/esm/views/EnsureFlexed.mjs +0 -13
- package/dist/esm/views/EnsureFlexed.mjs.map +0 -1
- package/dist/esm/views/EnsureFlexed.native.js +0 -13
- package/dist/esm/views/EnsureFlexed.native.js.map +0 -1
- package/dist/esm/views/GuiProvider.mjs +0 -4
- package/dist/esm/views/GuiProvider.mjs.map +0 -1
- package/dist/esm/views/GuiProvider.native.js +0 -4
- package/dist/esm/views/GuiProvider.native.js.map +0 -1
- package/dist/esm/views/Text.mjs +0 -15
- package/dist/esm/views/Text.mjs.map +0 -1
- package/dist/esm/views/Text.native.js +0 -15
- package/dist/esm/views/Text.native.js.map +0 -1
- package/dist/esm/views/VisuallyHidden.mjs +0 -35
- package/dist/esm/views/VisuallyHidden.mjs.map +0 -1
- package/dist/esm/views/VisuallyHidden.native.js +0 -35
- package/dist/esm/views/VisuallyHidden.native.js.map +0 -1
- package/dist/jsx/createGui.mjs +0 -55
- package/dist/jsx/createGui.mjs.map +0 -1
- package/dist/jsx/createGui.native.js +0 -89
- package/dist/jsx/createGui.native.js.map +0 -1
- package/dist/jsx/index.js +0 -44
- package/dist/jsx/index.js.map +0 -1
- package/dist/jsx/index.mjs +0 -44
- package/dist/jsx/index.mjs.map +0 -1
- package/dist/jsx/index.native.js +0 -80
- package/dist/jsx/index.native.js.map +0 -1
- package/dist/jsx/setup.mjs +0 -6
- package/dist/jsx/setup.mjs.map +0 -1
- package/dist/jsx/setup.native.js +0 -35
- package/dist/jsx/setup.native.js.map +0 -1
- package/dist/jsx/viewTypes.mjs +0 -2
- package/dist/jsx/viewTypes.mjs.map +0 -1
- package/dist/jsx/viewTypes.native.js +0 -21
- package/dist/jsx/viewTypes.native.js.map +0 -1
- package/dist/jsx/views/Anchor.mjs +0 -9
- package/dist/jsx/views/Anchor.mjs.map +0 -1
- package/dist/jsx/views/Anchor.native.js +0 -37
- package/dist/jsx/views/Anchor.native.js.map +0 -1
- package/dist/jsx/views/EnsureFlexed.mjs +0 -13
- package/dist/jsx/views/EnsureFlexed.mjs.map +0 -1
- package/dist/jsx/views/EnsureFlexed.native.js +0 -41
- package/dist/jsx/views/EnsureFlexed.native.js.map +0 -1
- package/dist/jsx/views/GuiProvider.mjs +0 -4
- package/dist/jsx/views/GuiProvider.mjs.map +0 -1
- package/dist/jsx/views/GuiProvider.native.js +0 -32
- package/dist/jsx/views/GuiProvider.native.js.map +0 -1
- package/dist/jsx/views/Text.mjs +0 -15
- package/dist/jsx/views/Text.mjs.map +0 -1
- package/dist/jsx/views/Text.native.js +0 -43
- package/dist/jsx/views/Text.native.js.map +0 -1
- package/dist/jsx/views/VisuallyHidden.mjs +0 -35
- package/dist/jsx/views/VisuallyHidden.mjs.map +0 -1
- package/dist/jsx/views/VisuallyHidden.native.js +0 -63
- package/dist/jsx/views/VisuallyHidden.native.js.map +0 -1
- package/gui.config.ts +0 -4
- package/scripts/publish.sh +0 -61
- package/src/views/GuiProvider.tsx +0 -5
- package/types/createGui.d.ts +0 -6
- package/types/views/GuiProvider.d.ts +0 -4
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// compat with
|
|
1
|
+
// compat with hanzogui static compiler
|
|
2
2
|
Object.assign(module.exports, require('../dist/cjs/linear-gradient.cjs'))
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// compat with
|
|
1
|
+
// compat with hanzogui static compiler
|
|
2
2
|
Object.assign(module.exports, require('../dist/cjs/linear-gradient.native.js'))
|
package/native/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// compat with
|
|
1
|
+
// compat with hanzogui static compiler
|
|
2
2
|
Object.assign(module.exports, require('../dist/native.cjs'))
|
package/native-test/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// compat with
|
|
1
|
+
// compat with hanzogui static compiler
|
|
2
2
|
Object.assign(module.exports, require('../dist/test.cjs'))
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// compat with
|
|
1
|
+
// compat with hanzogui static compiler
|
|
2
2
|
Object.assign(module.exports, require('../dist/test.cjs'))
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/gui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
|
|
5
5
|
"description": "Style and UI for React (web and native) meet an optimizing compiler",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/hanzoai/gui.git",
|
|
9
|
-
"directory": "code/ui/
|
|
9
|
+
"directory": "code/ui/hanzogui"
|
|
10
10
|
},
|
|
11
11
|
"source": "src/index.ts",
|
|
12
12
|
"type": "module",
|
|
@@ -68,94 +68,81 @@
|
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
70
|
"scripts": {
|
|
71
|
-
"build": "
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"clean": "
|
|
76
|
-
"clean:build": "hanzo-gui-build clean:build",
|
|
71
|
+
"build": "hanzogui-build",
|
|
72
|
+
"afterBuild": "node bundle-native.mjs",
|
|
73
|
+
"watch": "hanzogui-build --watch",
|
|
74
|
+
"clean": "hanzogui-build clean",
|
|
75
|
+
"clean:build": "hanzogui-build clean:build",
|
|
77
76
|
"check": "bun run check-circular-deps",
|
|
78
|
-
"check-circular-deps": "npx madge --circular ./src/index.ts"
|
|
79
|
-
"pub": "./scripts/publish.sh"
|
|
77
|
+
"check-circular-deps": "npx madge --circular ./src/index.ts"
|
|
80
78
|
},
|
|
81
79
|
"dependencies": {
|
|
82
|
-
"@hanzogui/
|
|
83
|
-
"@hanzogui/
|
|
84
|
-
"@hanzogui/
|
|
85
|
-
"@hanzogui/
|
|
86
|
-
"@hanzogui/
|
|
87
|
-
"@hanzogui/
|
|
88
|
-
"@hanzogui/
|
|
89
|
-
"@hanzogui/
|
|
90
|
-
"@hanzogui/
|
|
91
|
-
"@hanzogui/
|
|
92
|
-
"@hanzogui/
|
|
93
|
-
"@hanzogui/
|
|
94
|
-
"@hanzogui/
|
|
95
|
-
"@hanzogui/
|
|
96
|
-
"@hanzogui/
|
|
97
|
-
"@hanzogui/
|
|
98
|
-
"@hanzogui/
|
|
99
|
-
"@hanzogui/
|
|
100
|
-
"@hanzogui/
|
|
101
|
-
"@hanzogui/
|
|
102
|
-
"@hanzogui/
|
|
103
|
-
"@hanzogui/
|
|
104
|
-
"@hanzogui/
|
|
105
|
-
"@hanzogui/
|
|
106
|
-
"@hanzogui/
|
|
107
|
-
"@hanzogui/
|
|
108
|
-
"@hanzogui/
|
|
109
|
-
"@hanzogui/
|
|
110
|
-
"@hanzogui/
|
|
111
|
-
"@hanzogui/
|
|
112
|
-
"@hanzogui/
|
|
113
|
-
"@hanzogui/
|
|
114
|
-
"@hanzogui/
|
|
115
|
-
"@hanzogui/
|
|
116
|
-
"@hanzogui/
|
|
117
|
-
"@hanzogui/
|
|
118
|
-
"@hanzogui/
|
|
119
|
-
"@hanzogui/
|
|
120
|
-
"@hanzogui/
|
|
121
|
-
"@hanzogui/
|
|
122
|
-
"@hanzogui/
|
|
123
|
-
"@hanzogui/
|
|
124
|
-
"@hanzogui/
|
|
125
|
-
"@hanzogui/
|
|
126
|
-
"@hanzogui/
|
|
127
|
-
"@hanzogui/
|
|
128
|
-
"@hanzogui/
|
|
129
|
-
"@hanzogui/
|
|
130
|
-
"@hanzogui/
|
|
131
|
-
"@hanzogui/
|
|
132
|
-
"@hanzogui/
|
|
133
|
-
"@hanzogui/
|
|
134
|
-
"@hanzogui/
|
|
135
|
-
"@hanzogui/toast": "
|
|
136
|
-
"@hanzogui/
|
|
137
|
-
"@hanzogui/
|
|
138
|
-
"@hanzogui/
|
|
139
|
-
"@hanzogui/
|
|
140
|
-
"@hanzogui/
|
|
141
|
-
"@hanzogui/
|
|
142
|
-
"@hanzogui/
|
|
143
|
-
"@hanzogui/
|
|
144
|
-
"@hanzogui/
|
|
145
|
-
"@hanzogui/popper": "3.0.2",
|
|
146
|
-
"@hanzogui/animate": "3.0.2",
|
|
147
|
-
"@hanzogui/context-menu": "3.0.2",
|
|
148
|
-
"@hanzogui/create-menu": "3.0.2",
|
|
149
|
-
"@hanzogui/elements": "3.0.2",
|
|
150
|
-
"@hanzogui/menu": "3.0.2",
|
|
151
|
-
"@hanzogui/checkbox-headless": "3.0.2",
|
|
152
|
-
"@hanzogui/radio-headless": "3.0.2",
|
|
153
|
-
"@hanzogui/switch-headless": "3.0.2",
|
|
154
|
-
"@hanzogui/tabs-headless": "3.0.2",
|
|
155
|
-
"@hanzogui/theme-builder": "workspace:*"
|
|
80
|
+
"@hanzogui/accordion": "^7.0.0",
|
|
81
|
+
"@hanzogui/adapt": "^7.0.0",
|
|
82
|
+
"@hanzogui/alert-dialog": "^7.0.0",
|
|
83
|
+
"@hanzogui/animate": "^7.0.0",
|
|
84
|
+
"@hanzogui/animate-presence": "^7.0.0",
|
|
85
|
+
"@hanzogui/avatar": "^7.0.0",
|
|
86
|
+
"@hanzogui/button": "^7.0.0",
|
|
87
|
+
"@hanzogui/card": "^7.0.0",
|
|
88
|
+
"@hanzogui/checkbox": "^7.0.0",
|
|
89
|
+
"@hanzogui/collapsible": "^7.0.0",
|
|
90
|
+
"@hanzogui/compose-refs": "^7.0.0",
|
|
91
|
+
"@hanzogui/constants": "^7.0.0",
|
|
92
|
+
"@hanzogui/context-menu": "^7.0.0",
|
|
93
|
+
"@hanzogui/core": "^7.0.0",
|
|
94
|
+
"@hanzogui/create-context": "^7.0.0",
|
|
95
|
+
"@hanzogui/create-menu": "^7.0.0",
|
|
96
|
+
"@hanzogui/dialog": "^7.0.0",
|
|
97
|
+
"@hanzogui/element": "^7.0.0",
|
|
98
|
+
"@hanzogui/elements": "^7.0.0",
|
|
99
|
+
"@hanzogui/fake-react-native": "^7.0.0",
|
|
100
|
+
"@hanzogui/focusable": "^7.0.0",
|
|
101
|
+
"@hanzogui/form": "^7.0.0",
|
|
102
|
+
"@hanzogui/get-button-sized": "^7.0.0",
|
|
103
|
+
"@hanzogui/get-font-sized": "^7.0.0",
|
|
104
|
+
"@hanzogui/get-token": "^7.0.0",
|
|
105
|
+
"@hanzogui/group": "^7.0.0",
|
|
106
|
+
"@hanzogui/component-helpers": "^7.0.0",
|
|
107
|
+
"@hanzogui/image": "^7.0.0",
|
|
108
|
+
"@hanzogui/input": "^7.0.0",
|
|
109
|
+
"@hanzogui/label": "^7.0.0",
|
|
110
|
+
"@hanzogui/linear-gradient": "^7.0.0",
|
|
111
|
+
"@hanzogui/list-item": "^7.0.0",
|
|
112
|
+
"@hanzogui/menu": "^7.0.0",
|
|
113
|
+
"@hanzogui/polyfill-dev": "^7.0.0",
|
|
114
|
+
"@hanzogui/popover": "^7.0.0",
|
|
115
|
+
"@hanzogui/popper": "^7.0.0",
|
|
116
|
+
"@hanzogui/portal": "^7.0.0",
|
|
117
|
+
"@hanzogui/progress": "^7.0.0",
|
|
118
|
+
"@hanzogui/radio-group": "^7.0.0",
|
|
119
|
+
"@hanzogui/react-native-media-driver": "^7.0.0",
|
|
120
|
+
"@hanzogui/scroll-view": "^7.0.0",
|
|
121
|
+
"@hanzogui/select": "^7.0.0",
|
|
122
|
+
"@hanzogui/separator": "^7.0.0",
|
|
123
|
+
"@hanzogui/shapes": "^7.0.0",
|
|
124
|
+
"@hanzogui/sheet": "^7.0.0",
|
|
125
|
+
"@hanzogui/slider": "^7.0.0",
|
|
126
|
+
"@hanzogui/spacer": "^7.0.0",
|
|
127
|
+
"@hanzogui/spinner": "^7.0.0",
|
|
128
|
+
"@hanzogui/stacks": "^7.0.0",
|
|
129
|
+
"@hanzogui/switch": "^7.0.0",
|
|
130
|
+
"@hanzogui/tabs": "^7.0.0",
|
|
131
|
+
"@hanzogui/text": "^7.0.0",
|
|
132
|
+
"@hanzogui/theme": "^7.0.0",
|
|
133
|
+
"@hanzogui/toast": "^7.0.0",
|
|
134
|
+
"@hanzogui/toggle-group": "^7.0.0",
|
|
135
|
+
"@hanzogui/tooltip": "^7.0.0",
|
|
136
|
+
"@hanzogui/use-controllable-state": "^7.0.0",
|
|
137
|
+
"@hanzogui/use-debounce": "^7.0.0",
|
|
138
|
+
"@hanzogui/use-force-update": "^7.0.0",
|
|
139
|
+
"@hanzogui/use-window-dimensions": "^7.0.0",
|
|
140
|
+
"@hanzogui/visually-hidden": "^7.0.0",
|
|
141
|
+
"@hanzogui/font-size": "^7.0.0",
|
|
142
|
+
"@hanzogui/z-index-stack": "^7.0.0"
|
|
156
143
|
},
|
|
157
144
|
"devDependencies": {
|
|
158
|
-
"@hanzogui/build": "
|
|
145
|
+
"@hanzogui/build": "^7.0.0",
|
|
159
146
|
"react": ">=19",
|
|
160
147
|
"react-native": "0.83.2",
|
|
161
148
|
"react-native-web": "^0.21.0"
|
|
@@ -164,6 +151,12 @@
|
|
|
164
151
|
"react": ">=19",
|
|
165
152
|
"react-native": "*"
|
|
166
153
|
},
|
|
154
|
+
"alsoPublishAs_disabled": [
|
|
155
|
+
"@hanzogui/ui"
|
|
156
|
+
],
|
|
167
157
|
"module:jsx": "dist/jsx",
|
|
168
|
-
"removeSideEffects": true
|
|
169
|
-
|
|
158
|
+
"removeSideEffects": true,
|
|
159
|
+
"publishConfig": {
|
|
160
|
+
"access": "public"
|
|
161
|
+
}
|
|
162
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// compat with
|
|
1
|
+
// compat with hanzogui static compiler
|
|
2
2
|
Object.assign(module.exports, require('../dist/cjs/react-native-web.cjs'))
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// compat with
|
|
1
|
+
// compat with hanzogui static compiler
|
|
2
2
|
Object.assign(module.exports, require('../dist/cjs/react-native-web.cjs'))
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createHanzogui as createHanzoguiCore } from '@hanzogui/core'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Adds some helpful validation at dev time only for `
|
|
4
|
+
* Adds some helpful validation at dev time only for `hanzogui` specifically
|
|
5
5
|
**/
|
|
6
6
|
|
|
7
|
-
export const
|
|
7
|
+
export const createHanzogui: typeof createHanzoguiCore =
|
|
8
8
|
process.env.NODE_ENV !== 'development'
|
|
9
|
-
?
|
|
9
|
+
? createHanzoguiCore
|
|
10
10
|
: (conf) => {
|
|
11
11
|
const sizeTokenKeys = ['$true']
|
|
12
12
|
|
|
@@ -14,27 +14,27 @@ export const createGui: typeof createGuiCore =
|
|
|
14
14
|
return expectedKeys.every((k) => typeof obj[k] !== 'undefined')
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
const
|
|
17
|
+
const hanzoguiConfig = createHanzoguiCore(conf)
|
|
18
18
|
|
|
19
19
|
// size and space should be fully defined
|
|
20
20
|
for (const name of ['size', 'space'] as const) {
|
|
21
|
-
const tokenSet =
|
|
21
|
+
const tokenSet = hanzoguiConfig.tokensParsed[name]
|
|
22
22
|
if (!tokenSet) {
|
|
23
23
|
throw new Error(
|
|
24
24
|
`Expected tokens for "${name}" in ${Object.keys(
|
|
25
|
-
|
|
25
|
+
hanzoguiConfig.tokensParsed
|
|
26
26
|
).join(', ')}`
|
|
27
27
|
)
|
|
28
28
|
}
|
|
29
29
|
if (!hasKeys(sizeTokenKeys, tokenSet)) {
|
|
30
30
|
throw new Error(`
|
|
31
|
-
|
|
31
|
+
createHanzogui() missing expected tokens.${name}:
|
|
32
32
|
|
|
33
33
|
Received: ${Object.keys(tokenSet).join(', ')}
|
|
34
34
|
|
|
35
35
|
Expected: ${sizeTokenKeys.join(', ')}
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
Hanzogui expects a "true" key that is the same value as your default size. This is so
|
|
38
38
|
it can size things up or down from the defaults without assuming which keys you use.
|
|
39
39
|
|
|
40
40
|
Please define a "true" or "$true" key on your size and space tokens like so (example):
|
|
@@ -51,14 +51,14 @@ size: {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
// others must define subset of size tokens
|
|
54
|
-
const expected = Object.keys(
|
|
54
|
+
const expected = Object.keys(hanzoguiConfig.tokensParsed.size)
|
|
55
55
|
for (const name of ['radius', 'zIndex'] as const) {
|
|
56
|
-
const tokenSet =
|
|
56
|
+
const tokenSet = hanzoguiConfig.tokensParsed[name]
|
|
57
57
|
const received = Object.keys(tokenSet)
|
|
58
58
|
const hasSomeOverlap = received.some((rk) => expected.includes(rk))
|
|
59
59
|
if (!hasSomeOverlap) {
|
|
60
60
|
throw new Error(`
|
|
61
|
-
|
|
61
|
+
createHanzogui() invalid tokens.${name}:
|
|
62
62
|
|
|
63
63
|
Received: ${received.join(', ')}
|
|
64
64
|
|
|
@@ -68,5 +68,5 @@ Expected a subset of: ${expected.join(', ')}
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
return
|
|
71
|
+
return hanzoguiConfig
|
|
72
72
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,59 +1,201 @@
|
|
|
1
1
|
import './setup'
|
|
2
2
|
|
|
3
|
-
// Core styling engine
|
|
4
|
-
export * from '@hanzogui/core'
|
|
5
|
-
|
|
6
|
-
// Stack components
|
|
7
|
-
export * from '@hanzogui/stacks'
|
|
8
|
-
|
|
9
|
-
// Shape primitives (Square, Circle)
|
|
10
|
-
export * from '@hanzogui/shapes'
|
|
11
|
-
|
|
12
|
-
// UI Components
|
|
13
3
|
export * from '@hanzogui/spacer'
|
|
4
|
+
export * from '@hanzogui/accordion'
|
|
5
|
+
export * from '@hanzogui/adapt'
|
|
6
|
+
export * from '@hanzogui/alert-dialog'
|
|
7
|
+
export * from '@hanzogui/animate'
|
|
14
8
|
export * from '@hanzogui/animate-presence'
|
|
9
|
+
export * from '@hanzogui/avatar'
|
|
15
10
|
export * from '@hanzogui/button'
|
|
16
|
-
export * from '@hanzogui/
|
|
17
|
-
export * from '@hanzogui/radio-group'
|
|
18
|
-
export * from '@hanzogui/tooltip'
|
|
19
|
-
export * from '@hanzogui/switch'
|
|
11
|
+
export * from '@hanzogui/card'
|
|
20
12
|
export * from '@hanzogui/checkbox'
|
|
13
|
+
export * from '@hanzogui/collapsible'
|
|
14
|
+
export * from '@hanzogui/compose-refs'
|
|
15
|
+
export * from '@hanzogui/create-context'
|
|
21
16
|
export * from '@hanzogui/dialog'
|
|
22
|
-
export * from '@hanzogui/
|
|
23
|
-
export * from '@hanzogui/adapt'
|
|
24
|
-
export * from '@hanzogui/label'
|
|
25
|
-
export * from '@hanzogui/input'
|
|
26
|
-
export * from '@hanzogui/select'
|
|
27
|
-
export * from '@hanzogui/separator'
|
|
28
|
-
export * from '@hanzogui/slider'
|
|
29
|
-
export * from '@hanzogui/tabs'
|
|
30
|
-
export * from '@hanzogui/toggle-group'
|
|
31
|
-
export * from '@hanzogui/accordion'
|
|
32
|
-
export * from '@hanzogui/avatar'
|
|
33
|
-
export * from '@hanzogui/card'
|
|
17
|
+
export * from '@hanzogui/font-size'
|
|
34
18
|
export * from '@hanzogui/form'
|
|
35
19
|
export * from '@hanzogui/group'
|
|
20
|
+
export * from '@hanzogui/react-native-media-driver'
|
|
21
|
+
export * from '@hanzogui/elements'
|
|
22
|
+
export * from '@hanzogui/component-helpers'
|
|
36
23
|
export * from '@hanzogui/image'
|
|
24
|
+
export * from '@hanzogui/label'
|
|
37
25
|
export * from '@hanzogui/list-item'
|
|
26
|
+
export * from '@hanzogui/menu'
|
|
27
|
+
export * from '@hanzogui/context-menu'
|
|
28
|
+
export * from '@hanzogui/create-menu'
|
|
29
|
+
export * from '@hanzogui/popover'
|
|
30
|
+
export * from '@hanzogui/popper'
|
|
38
31
|
export * from '@hanzogui/portal'
|
|
39
32
|
export * from '@hanzogui/progress'
|
|
33
|
+
export * from '@hanzogui/radio-group'
|
|
40
34
|
export * from '@hanzogui/scroll-view'
|
|
41
|
-
export * from '@hanzogui/
|
|
35
|
+
export * from '@hanzogui/select'
|
|
36
|
+
export * from '@hanzogui/separator'
|
|
37
|
+
export * from '@hanzogui/shapes'
|
|
38
|
+
export * from '@hanzogui/sheet'
|
|
39
|
+
export * from '@hanzogui/slider'
|
|
40
|
+
export * from '@hanzogui/stacks'
|
|
41
|
+
export * from '@hanzogui/switch'
|
|
42
|
+
export * from '@hanzogui/tabs'
|
|
42
43
|
export * from '@hanzogui/text'
|
|
44
|
+
export * from '@hanzogui/theme'
|
|
43
45
|
export * from '@hanzogui/toast'
|
|
46
|
+
export * from '@hanzogui/toggle-group'
|
|
47
|
+
export * from '@hanzogui/tooltip'
|
|
48
|
+
export * from '@hanzogui/use-controllable-state'
|
|
49
|
+
export * from '@hanzogui/use-debounce'
|
|
50
|
+
export * from '@hanzogui/use-force-update'
|
|
51
|
+
export * from '@hanzogui/element'
|
|
52
|
+
export * from '@hanzogui/use-window-dimensions'
|
|
44
53
|
export * from '@hanzogui/visually-hidden'
|
|
45
|
-
export * from '@hanzogui/focusable'
|
|
46
|
-
export * from '@hanzogui/elements'
|
|
47
54
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
export
|
|
51
|
-
export
|
|
55
|
+
export * from './createHanzogui'
|
|
56
|
+
|
|
57
|
+
export * from './viewTypes'
|
|
58
|
+
export * from './views/HanzoguiProvider'
|
|
59
|
+
|
|
60
|
+
export * from './views/Anchor'
|
|
61
|
+
export * from './views/EnsureFlexed'
|
|
62
|
+
export * from './views/Fieldset'
|
|
63
|
+
export * from '@hanzogui/input'
|
|
64
|
+
export * from '@hanzogui/spinner'
|
|
65
|
+
export * from './views/Text'
|
|
52
66
|
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
export {
|
|
56
|
-
|
|
67
|
+
// since we overlap with ViewProps and potentially others
|
|
68
|
+
// lets be explicit on what gets exported
|
|
69
|
+
export type {
|
|
70
|
+
TransitionKeys,
|
|
71
|
+
TransitionProp,
|
|
72
|
+
ColorTokens,
|
|
73
|
+
CreateHanzoguiConfig,
|
|
74
|
+
CreateHanzoguiProps,
|
|
75
|
+
FontColorTokens,
|
|
76
|
+
FontLanguages,
|
|
77
|
+
FontLetterSpacingTokens,
|
|
78
|
+
FontLineHeightTokens,
|
|
79
|
+
FontFamilyTokens,
|
|
80
|
+
FontSizeTokens,
|
|
81
|
+
FontStyleTokens,
|
|
82
|
+
FontTokens,
|
|
83
|
+
FontTransformTokens,
|
|
84
|
+
FontWeightTokens,
|
|
85
|
+
GenericFont,
|
|
86
|
+
GenericStackVariants,
|
|
87
|
+
GenericHanzoguiConfig,
|
|
88
|
+
GenericTextVariants,
|
|
89
|
+
GetAnimationKeys,
|
|
90
|
+
GetProps,
|
|
91
|
+
GetRef,
|
|
92
|
+
GetThemeValueForKey,
|
|
93
|
+
GroupNames,
|
|
94
|
+
Longhands,
|
|
95
|
+
Media,
|
|
96
|
+
MediaPropKeys,
|
|
97
|
+
MediaQueries,
|
|
98
|
+
MediaQueryState,
|
|
99
|
+
RadiusTokens,
|
|
100
|
+
Shorthands,
|
|
101
|
+
SizeTokens,
|
|
102
|
+
SpaceTokens,
|
|
103
|
+
SpecificTokens,
|
|
104
|
+
StackNonStyleProps,
|
|
105
|
+
ViewProps,
|
|
106
|
+
StaticConfig,
|
|
107
|
+
Styleable,
|
|
108
|
+
HanzoguiBaseTheme,
|
|
109
|
+
HanzoguiBuildOptions,
|
|
110
|
+
HanzoguiComponent,
|
|
111
|
+
HanzoguiConfig,
|
|
112
|
+
HanzoguiCustomConfig,
|
|
113
|
+
HanzoguiElement,
|
|
114
|
+
HanzoguiInternalConfig,
|
|
115
|
+
HanzoguiProviderProps,
|
|
116
|
+
HanzoguiSettings,
|
|
117
|
+
HanzoguiTextElement,
|
|
118
|
+
TextNonStyleProps,
|
|
119
|
+
TextProps,
|
|
120
|
+
ThemeKeys,
|
|
121
|
+
ThemeName,
|
|
122
|
+
ThemeParsed,
|
|
123
|
+
ThemeProps,
|
|
124
|
+
Themes,
|
|
125
|
+
ThemeTokens,
|
|
126
|
+
ThemeValueFallback,
|
|
127
|
+
Token,
|
|
128
|
+
Tokens,
|
|
129
|
+
TypeOverride,
|
|
130
|
+
Variable,
|
|
131
|
+
VariantSpreadExtras,
|
|
132
|
+
VariantSpreadFunction,
|
|
133
|
+
ZIndexTokens,
|
|
134
|
+
ViewStyle,
|
|
135
|
+
TextStyle,
|
|
136
|
+
} from '@hanzogui/core'
|
|
57
137
|
|
|
58
|
-
|
|
59
|
-
|
|
138
|
+
export {
|
|
139
|
+
ClientOnly,
|
|
140
|
+
Configuration,
|
|
141
|
+
ComponentContext,
|
|
142
|
+
GroupContext,
|
|
143
|
+
FontLanguage,
|
|
144
|
+
// components
|
|
145
|
+
Theme,
|
|
146
|
+
View,
|
|
147
|
+
createComponent,
|
|
148
|
+
createFont,
|
|
149
|
+
createShorthands,
|
|
150
|
+
createStyledContext,
|
|
151
|
+
createTokens,
|
|
152
|
+
createVariable,
|
|
153
|
+
getConfig,
|
|
154
|
+
getMedia,
|
|
155
|
+
getCSSStylesAtomic,
|
|
156
|
+
getThemes,
|
|
157
|
+
getToken,
|
|
158
|
+
getTokenValue,
|
|
159
|
+
getTokens,
|
|
160
|
+
getVariable,
|
|
161
|
+
getVariableName,
|
|
162
|
+
getVariableValue,
|
|
163
|
+
insertFont,
|
|
164
|
+
setConfig,
|
|
165
|
+
setupDev,
|
|
166
|
+
_withStableStyle,
|
|
167
|
+
// constants
|
|
168
|
+
isBrowser,
|
|
169
|
+
isChrome,
|
|
170
|
+
isClient,
|
|
171
|
+
isServer,
|
|
172
|
+
isHanzoguiComponent,
|
|
173
|
+
isHanzoguiElement,
|
|
174
|
+
isTouchable,
|
|
175
|
+
isVariable,
|
|
176
|
+
isWeb,
|
|
177
|
+
isWebTouchable,
|
|
178
|
+
matchMedia,
|
|
179
|
+
mediaObjectToString,
|
|
180
|
+
mediaQueryConfig,
|
|
181
|
+
mediaState,
|
|
182
|
+
setOnLayoutStrategy,
|
|
183
|
+
styled,
|
|
184
|
+
themeable,
|
|
185
|
+
// hooks
|
|
186
|
+
useClientValue,
|
|
187
|
+
useDidFinishSSR,
|
|
188
|
+
useEvent,
|
|
189
|
+
useGet,
|
|
190
|
+
useIsTouchDevice,
|
|
191
|
+
useIsomorphicLayoutEffect,
|
|
192
|
+
useMedia,
|
|
193
|
+
useProps,
|
|
194
|
+
usePropsAndStyle,
|
|
195
|
+
useStyle,
|
|
196
|
+
useConfiguration,
|
|
197
|
+
useTheme,
|
|
198
|
+
useThemeName,
|
|
199
|
+
variableToString,
|
|
200
|
+
withStaticProperties,
|
|
201
|
+
} from '@hanzogui/core'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LinearGradient, type LinearGradientProps } from '@hanzogui/linear-gradient'
|
package/src/views/Anchor.tsx
CHANGED
|
@@ -1,10 +1,44 @@
|
|
|
1
|
+
import { isWeb } from '@hanzogui/constants'
|
|
1
2
|
import { styled } from '@hanzogui/core'
|
|
3
|
+
import type { SizableTextProps } from '@hanzogui/text'
|
|
2
4
|
import { SizableText } from '@hanzogui/text'
|
|
5
|
+
import { Linking } from 'react-native'
|
|
3
6
|
|
|
4
|
-
export
|
|
7
|
+
export interface AnchorExtraProps {
|
|
8
|
+
href?: string
|
|
9
|
+
target?: string
|
|
10
|
+
rel?: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type AnchorProps = SizableTextProps & AnchorExtraProps
|
|
14
|
+
|
|
15
|
+
const AnchorFrame = styled(SizableText, {
|
|
5
16
|
name: 'Anchor',
|
|
6
|
-
|
|
7
|
-
|
|
17
|
+
render: 'a',
|
|
18
|
+
role: 'link',
|
|
8
19
|
})
|
|
9
20
|
|
|
10
|
-
export
|
|
21
|
+
export const Anchor = AnchorFrame.styleable<AnchorExtraProps>(
|
|
22
|
+
({ href, target, rel, ...props }, ref) => {
|
|
23
|
+
return (
|
|
24
|
+
<AnchorFrame
|
|
25
|
+
{...props}
|
|
26
|
+
{...(isWeb
|
|
27
|
+
? {
|
|
28
|
+
href,
|
|
29
|
+
target,
|
|
30
|
+
rel,
|
|
31
|
+
}
|
|
32
|
+
: {
|
|
33
|
+
onPress: (event) => {
|
|
34
|
+
props.onPress?.(event)
|
|
35
|
+
if (href !== undefined) {
|
|
36
|
+
Linking.openURL(href)
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
})}
|
|
40
|
+
ref={ref as any}
|
|
41
|
+
/>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { GetProps } from '@hanzogui/core'
|
|
2
|
+
import { styled } from '@hanzogui/core'
|
|
3
|
+
import { YStack } from '@hanzogui/stacks'
|
|
4
|
+
|
|
5
|
+
export const Fieldset = styled(YStack, {
|
|
6
|
+
name: 'Fieldset',
|
|
7
|
+
render: 'fieldset',
|
|
8
|
+
|
|
9
|
+
// remove browser default styling
|
|
10
|
+
borderWidth: 0,
|
|
11
|
+
|
|
12
|
+
variants: {
|
|
13
|
+
horizontal: {
|
|
14
|
+
true: {
|
|
15
|
+
flexDirection: 'row',
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
} as const,
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
export type FieldsetProps = GetProps<typeof Fieldset>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { HanzoguiProviderProps } from '@hanzogui/core'
|
|
2
|
+
import { HanzoguiProvider as OGProvider } from '@hanzogui/core'
|
|
3
|
+
import { PortalProvider } from '@hanzogui/portal'
|
|
4
|
+
import { ZIndexStackContext } from '@hanzogui/z-index-stack'
|
|
5
|
+
|
|
6
|
+
export const HanzoguiProvider = ({ children, ...props }: HanzoguiProviderProps) => {
|
|
7
|
+
return (
|
|
8
|
+
<OGProvider {...props}>
|
|
9
|
+
<ZIndexStackContext.Provider value={1}>
|
|
10
|
+
<PortalProvider shouldAddRootHost>{children}</PortalProvider>
|
|
11
|
+
</ZIndexStackContext.Provider>
|
|
12
|
+
</OGProvider>
|
|
13
|
+
)
|
|
14
|
+
}
|