@hanzogui/button 7.3.1 → 8.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/dist/cjs/Button.cjs +82 -18
- package/dist/cjs/Button.native.js +88 -20
- package/dist/cjs/Button.native.js.map +1 -1
- package/dist/esm/Button.mjs +82 -18
- package/dist/esm/Button.mjs.map +1 -1
- package/dist/esm/Button.native.js +88 -20
- package/dist/esm/Button.native.js.map +1 -1
- package/dist/jsx/Button.mjs +82 -18
- package/dist/jsx/Button.mjs.map +1 -1
- package/dist/jsx/Button.native.js +88 -20
- package/dist/jsx/Button.native.js.map +1 -1
- package/package.json +18 -22
- package/src/Button.tsx +115 -24
- package/types/Button.d.ts +140 -40
- package/types/Button.d.ts.map +1 -1
- package/LICENSE +0 -42
- package/dist/cjs/v1/Button.cjs +0 -262
- package/dist/cjs/v1/Button.native.js +0 -267
- package/dist/cjs/v1/Button.native.js.map +0 -1
- package/dist/cjs/v1/Button.test.cjs +0 -9
- package/dist/cjs/v1/Button.test.native.js +0 -12
- package/dist/cjs/v1/Button.test.native.js.map +0 -1
- package/dist/cjs/v1/index.cjs +0 -20
- package/dist/cjs/v1/index.native.js +0 -23
- package/dist/cjs/v1/index.native.js.map +0 -1
- package/dist/esm/v1/Button.mjs +0 -232
- package/dist/esm/v1/Button.mjs.map +0 -1
- package/dist/esm/v1/Button.native.js +0 -234
- package/dist/esm/v1/Button.native.js.map +0 -1
- package/dist/esm/v1/Button.test.mjs +0 -10
- package/dist/esm/v1/Button.test.mjs.map +0 -1
- package/dist/esm/v1/Button.test.native.js +0 -10
- package/dist/esm/v1/Button.test.native.js.map +0 -1
- package/dist/esm/v1/index.mjs +0 -2
- package/dist/esm/v1/index.mjs.map +0 -1
- package/dist/esm/v1/index.native.js +0 -2
- package/dist/esm/v1/index.native.js.map +0 -1
- package/dist/jsx/v1/Button.mjs +0 -232
- package/dist/jsx/v1/Button.mjs.map +0 -1
- package/dist/jsx/v1/Button.native.js +0 -267
- package/dist/jsx/v1/Button.native.js.map +0 -1
- package/dist/jsx/v1/Button.test.mjs +0 -10
- package/dist/jsx/v1/Button.test.mjs.map +0 -1
- package/dist/jsx/v1/Button.test.native.js +0 -12
- package/dist/jsx/v1/Button.test.native.js.map +0 -1
- package/dist/jsx/v1/index.mjs +0 -2
- package/dist/jsx/v1/index.mjs.map +0 -1
- package/dist/jsx/v1/index.native.js +0 -23
- package/dist/jsx/v1/index.native.js.map +0 -1
- package/src/v1/Button.test.tsx +0 -21
- package/src/v1/Button.tsx +0 -336
- package/src/v1/index.ts +0 -1
- package/types/v1/Button.d.ts +0 -302
- package/types/v1/Button.d.ts.map +0 -1
- package/types/v1/Button.test.d.ts +0 -2
- package/types/v1/Button.test.d.ts.map +0 -1
- package/types/v1/index.d.ts +0 -2
- package/types/v1/index.d.ts.map +0 -1
package/LICENSE
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
BSD 3-Clause License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026-present, Hanzo AI, Inc.
|
|
4
|
-
|
|
5
|
-
Portions of this software are derived from upstream code originally licensed under
|
|
6
|
-
the MIT License, with the following copyright notices retained per its terms:
|
|
7
|
-
|
|
8
|
-
Copyright (c) 2020 Nate Wienert
|
|
9
|
-
Copyright (c) 2015-present, Nicolas Gallagher.
|
|
10
|
-
Copyright (c) 2015-present, Facebook, Inc.
|
|
11
|
-
Copyright (c) 2021 Radix
|
|
12
|
-
Copyright (c) 2017 Carmelo Pullara
|
|
13
|
-
Copyright (c) 2018 Framer B.V.
|
|
14
|
-
Copyright (c) 2022 WorkOS
|
|
15
|
-
|
|
16
|
-
All rights reserved.
|
|
17
|
-
|
|
18
|
-
Redistribution and use in source and binary forms, with or without
|
|
19
|
-
modification, are permitted provided that the following conditions are met:
|
|
20
|
-
|
|
21
|
-
1. Redistributions of source code must retain the above copyright notice, this
|
|
22
|
-
list of conditions and the following disclaimer.
|
|
23
|
-
|
|
24
|
-
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
25
|
-
this list of conditions and the following disclaimer in the documentation
|
|
26
|
-
and/or other materials provided with the distribution.
|
|
27
|
-
|
|
28
|
-
3. Neither the name of the copyright holder nor the names of its contributors
|
|
29
|
-
may be used to endorse or promote products derived from this software
|
|
30
|
-
without specific prior written permission.
|
|
31
|
-
|
|
32
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
33
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
34
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
35
|
-
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
36
|
-
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
37
|
-
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
38
|
-
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
39
|
-
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
40
|
-
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
41
|
-
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
42
|
-
POSSIBILITY OF SUCH DAMAGE.
|
package/dist/cjs/v1/Button.cjs
DELETED
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all) __defProp(target, name, {
|
|
7
|
-
get: all[name],
|
|
8
|
-
enumerable: true
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
-
get: () => from[key],
|
|
15
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value: true
|
|
22
|
-
}), mod);
|
|
23
|
-
var Button_exports = {};
|
|
24
|
-
__export(Button_exports, {
|
|
25
|
-
Button: () => Button2,
|
|
26
|
-
ButtonContext: () => ButtonContext,
|
|
27
|
-
ButtonFrame: () => ButtonFrame,
|
|
28
|
-
ButtonIcon: () => ButtonIcon,
|
|
29
|
-
ButtonText: () => ButtonText,
|
|
30
|
-
useButton: () => useButton
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(Button_exports);
|
|
33
|
-
var import_font_size = require("@hanzogui/font-size");
|
|
34
|
-
var import_get_button_sized = require("@hanzogui/get-button-sized");
|
|
35
|
-
var import_helpers = require("@hanzogui/helpers");
|
|
36
|
-
var import_component_helpers = require("@hanzogui/component-helpers");
|
|
37
|
-
var import_stacks = require("@hanzogui/stacks");
|
|
38
|
-
var import_text = require("@hanzogui/text");
|
|
39
|
-
var import_web = require("@hanzogui/web");
|
|
40
|
-
var import_react = require("react");
|
|
41
|
-
var import_spacer = require("@hanzogui/spacer");
|
|
42
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
43
|
-
const ButtonContext = (0, import_web.createStyledContext)({
|
|
44
|
-
// keeping these here means they work with styled() passing down color to text
|
|
45
|
-
color: void 0,
|
|
46
|
-
ellipsis: void 0,
|
|
47
|
-
fontFamily: void 0,
|
|
48
|
-
fontSize: void 0,
|
|
49
|
-
fontStyle: void 0,
|
|
50
|
-
fontWeight: void 0,
|
|
51
|
-
letterSpacing: void 0,
|
|
52
|
-
maxFontSizeMultiplier: void 0,
|
|
53
|
-
size: void 0,
|
|
54
|
-
textAlign: void 0,
|
|
55
|
-
variant: void 0
|
|
56
|
-
});
|
|
57
|
-
const BUTTON_NAME = "Button";
|
|
58
|
-
const ButtonFrame = (0, import_web.styled)(import_stacks.ThemeableStack, {
|
|
59
|
-
name: BUTTON_NAME,
|
|
60
|
-
render: "button",
|
|
61
|
-
context: ButtonContext,
|
|
62
|
-
role: "button",
|
|
63
|
-
focusable: true,
|
|
64
|
-
variants: {
|
|
65
|
-
unstyled: {
|
|
66
|
-
false: {
|
|
67
|
-
size: "$true",
|
|
68
|
-
justifyContent: "center",
|
|
69
|
-
alignItems: "center",
|
|
70
|
-
flexWrap: "nowrap",
|
|
71
|
-
flexDirection: "row",
|
|
72
|
-
cursor: "pointer",
|
|
73
|
-
hoverTheme: true,
|
|
74
|
-
pressTheme: true,
|
|
75
|
-
backgroundColor: "$background",
|
|
76
|
-
borderWidth: 1,
|
|
77
|
-
borderColor: "transparent",
|
|
78
|
-
focusVisibleStyle: {
|
|
79
|
-
outlineColor: "$outlineColor",
|
|
80
|
-
outlineStyle: "solid",
|
|
81
|
-
outlineWidth: 2
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
variant: {
|
|
86
|
-
outlined: {
|
|
87
|
-
backgroundColor: "transparent",
|
|
88
|
-
borderWidth: 2,
|
|
89
|
-
borderColor: "$borderColor",
|
|
90
|
-
hoverStyle: {
|
|
91
|
-
backgroundColor: "transparent",
|
|
92
|
-
borderColor: "$borderColorHover"
|
|
93
|
-
},
|
|
94
|
-
pressStyle: {
|
|
95
|
-
backgroundColor: "transparent",
|
|
96
|
-
borderColor: "$borderColorPress"
|
|
97
|
-
},
|
|
98
|
-
focusVisibleStyle: {
|
|
99
|
-
backgroundColor: "transparent",
|
|
100
|
-
borderColor: "$borderColorFocus"
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
size: {
|
|
105
|
-
"...size": import_get_button_sized.getButtonSized,
|
|
106
|
-
":number": import_get_button_sized.getButtonSized
|
|
107
|
-
},
|
|
108
|
-
disabled: {
|
|
109
|
-
true: {
|
|
110
|
-
pointerEvents: "none"
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
defaultVariants: {
|
|
115
|
-
unstyled: process.env.GUI_HEADLESS === "1"
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
const ButtonText = (0, import_web.styled)(import_text.SizableText, {
|
|
119
|
-
name: "Button",
|
|
120
|
-
context: ButtonContext,
|
|
121
|
-
variants: {
|
|
122
|
-
unstyled: {
|
|
123
|
-
false: {
|
|
124
|
-
userSelect: "none",
|
|
125
|
-
cursor: "pointer",
|
|
126
|
-
// flexGrow 1 leads to inconsistent native style where text pushes to start of view
|
|
127
|
-
flexGrow: 0,
|
|
128
|
-
flexShrink: 1,
|
|
129
|
-
ellipsis: true,
|
|
130
|
-
color: "$color"
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
defaultVariants: {
|
|
135
|
-
unstyled: process.env.GUI_HEADLESS === "1"
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
const ButtonIcon = props => {
|
|
139
|
-
const {
|
|
140
|
-
children,
|
|
141
|
-
scaleIcon = 1
|
|
142
|
-
} = props;
|
|
143
|
-
const {
|
|
144
|
-
size,
|
|
145
|
-
color
|
|
146
|
-
} = (0, import_react.useContext)(ButtonContext);
|
|
147
|
-
const iconSize = (typeof size === "number" ? size * 0.5 : (0, import_font_size.getFontSize)(size)) * scaleIcon;
|
|
148
|
-
const getThemedIcon = (0, import_component_helpers.useGetThemedIcon)({
|
|
149
|
-
size: iconSize,
|
|
150
|
-
color
|
|
151
|
-
});
|
|
152
|
-
return getThemedIcon(children);
|
|
153
|
-
};
|
|
154
|
-
const ButtonComponent = ButtonFrame.styleable(function Button(props, ref) {
|
|
155
|
-
const {
|
|
156
|
-
props: buttonProps
|
|
157
|
-
} = useButton(props);
|
|
158
|
-
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(ButtonFrame, {
|
|
159
|
-
"data-disable-theme": true,
|
|
160
|
-
...buttonProps,
|
|
161
|
-
ref
|
|
162
|
-
});
|
|
163
|
-
});
|
|
164
|
-
const Button2 = (0, import_helpers.withStaticProperties)(ButtonComponent, {
|
|
165
|
-
Text: ButtonText,
|
|
166
|
-
Icon: ButtonIcon
|
|
167
|
-
});
|
|
168
|
-
function useButton({
|
|
169
|
-
textProps,
|
|
170
|
-
...propsIn
|
|
171
|
-
}, {
|
|
172
|
-
Text = Button2.Text
|
|
173
|
-
} = {
|
|
174
|
-
Text: Button2.Text
|
|
175
|
-
}) {
|
|
176
|
-
const isNested = (0, import_react.useContext)(import_stacks.ButtonNestingContext);
|
|
177
|
-
const propsActive = (0, import_web.useProps)(propsIn, {
|
|
178
|
-
noNormalize: true,
|
|
179
|
-
noExpand: true
|
|
180
|
-
});
|
|
181
|
-
const {
|
|
182
|
-
icon,
|
|
183
|
-
iconAfter,
|
|
184
|
-
gap,
|
|
185
|
-
spaceFlex,
|
|
186
|
-
scaleIcon = 1,
|
|
187
|
-
scaleSpace = 0.66,
|
|
188
|
-
noTextWrap,
|
|
189
|
-
fontFamily,
|
|
190
|
-
fontSize,
|
|
191
|
-
fontWeight,
|
|
192
|
-
fontStyle,
|
|
193
|
-
letterSpacing,
|
|
194
|
-
render,
|
|
195
|
-
ellipsis,
|
|
196
|
-
maxFontSizeMultiplier,
|
|
197
|
-
...restProps
|
|
198
|
-
} = propsActive;
|
|
199
|
-
const size = propsActive.size || (propsActive.unstyled ? void 0 : "$true");
|
|
200
|
-
const color = propsActive.color;
|
|
201
|
-
const iconSize = (typeof size === "number" ? size * 0.5 : (0, import_font_size.getFontSize)(size, {
|
|
202
|
-
font: fontFamily?.[0] === "$" ? fontFamily : void 0
|
|
203
|
-
})) * scaleIcon;
|
|
204
|
-
const getThemedIcon = (0, import_component_helpers.useGetThemedIcon)({
|
|
205
|
-
size: iconSize,
|
|
206
|
-
color
|
|
207
|
-
});
|
|
208
|
-
const [themedIcon, themedIconAfter] = [icon, iconAfter].map(getThemedIcon);
|
|
209
|
-
const spaceSize = gap ?? (0, import_web.getVariableValue)(iconSize) * scaleSpace;
|
|
210
|
-
const contents = noTextWrap ? [propsIn.children] : (0, import_text.wrapChildrenInText)(Text, {
|
|
211
|
-
children: propsIn.children,
|
|
212
|
-
fontFamily,
|
|
213
|
-
fontSize,
|
|
214
|
-
textProps,
|
|
215
|
-
fontWeight,
|
|
216
|
-
fontStyle,
|
|
217
|
-
letterSpacing,
|
|
218
|
-
ellipsis,
|
|
219
|
-
maxFontSizeMultiplier
|
|
220
|
-
}, Text === ButtonText && propsActive.unstyled !== true ? {
|
|
221
|
-
unstyled: process.env.GUI_HEADLESS === "1",
|
|
222
|
-
size
|
|
223
|
-
} : void 0);
|
|
224
|
-
const inner = (0, import_spacer.spacedChildren)({
|
|
225
|
-
// a bit arbitrary but scaling to font size is necessary so long as button does
|
|
226
|
-
space: spaceSize,
|
|
227
|
-
spaceFlex,
|
|
228
|
-
ensureKeys: true,
|
|
229
|
-
direction: propsActive.flexDirection === "column" || propsActive.flexDirection === "column-reverse" ? "vertical" : "horizontal",
|
|
230
|
-
// for keys to stay the same we keep indices as similar a possible
|
|
231
|
-
// so even if icons are undefined we still pass them
|
|
232
|
-
children: [themedIcon, ...contents, themedIconAfter]
|
|
233
|
-
});
|
|
234
|
-
const props = {
|
|
235
|
-
size,
|
|
236
|
-
...(propsIn.disabled && {
|
|
237
|
-
// in rnw - false still has keyboard tabIndex, undefined = not actually focusable
|
|
238
|
-
focusable: void 0,
|
|
239
|
-
// even with tabIndex unset, it will keep focusVisibleStyle on web so disable it here
|
|
240
|
-
focusVisibleStyle: {
|
|
241
|
-
borderColor: "$background"
|
|
242
|
-
}
|
|
243
|
-
}),
|
|
244
|
-
// fixes SSR issue + DOM nesting issue of not allowing button in button
|
|
245
|
-
render: render ?? (isNested ? "span" :
|
|
246
|
-
// defaults to <a /> when accessibilityRole = link
|
|
247
|
-
// see https://github.com/hanzoai/gui/issues/505
|
|
248
|
-
propsActive.accessibilityRole === "link" || propsActive.role === "link" ? "a" : "button"),
|
|
249
|
-
...restProps,
|
|
250
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_stacks.ButtonNestingContext.Provider, {
|
|
251
|
-
value: true,
|
|
252
|
-
children: inner
|
|
253
|
-
}),
|
|
254
|
-
// forces it to be a runtime pressStyle so it passes through context text colors
|
|
255
|
-
disableClassName: true
|
|
256
|
-
};
|
|
257
|
-
return {
|
|
258
|
-
spaceSize,
|
|
259
|
-
isNested,
|
|
260
|
-
props
|
|
261
|
-
};
|
|
262
|
-
}
|
|
@@ -1,267 +0,0 @@
|
|
|
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: true
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
-
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
-
get: () => from[key],
|
|
17
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
-
value: true
|
|
24
|
-
}), mod);
|
|
25
|
-
var Button_exports = {};
|
|
26
|
-
__export(Button_exports, {
|
|
27
|
-
Button: () => Button2,
|
|
28
|
-
ButtonContext: () => ButtonContext,
|
|
29
|
-
ButtonFrame: () => ButtonFrame,
|
|
30
|
-
ButtonIcon: () => ButtonIcon,
|
|
31
|
-
ButtonText: () => ButtonText,
|
|
32
|
-
useButton: () => useButton
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(Button_exports);
|
|
35
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
-
var import_font_size = require("@hanzogui/font-size");
|
|
37
|
-
var import_get_button_sized = require("@hanzogui/get-button-sized");
|
|
38
|
-
var import_helpers = require("@hanzogui/helpers");
|
|
39
|
-
var import_component_helpers = require("@hanzogui/component-helpers");
|
|
40
|
-
var import_stacks = require("@hanzogui/stacks");
|
|
41
|
-
var import_text = require("@hanzogui/text");
|
|
42
|
-
var import_web = require("@hanzogui/web");
|
|
43
|
-
var import_react = require("react");
|
|
44
|
-
var import_spacer = require("@hanzogui/spacer");
|
|
45
|
-
var ButtonContext = (0, import_web.createStyledContext)({
|
|
46
|
-
// keeping these here means they work with styled() passing down color to text
|
|
47
|
-
color: void 0,
|
|
48
|
-
ellipsis: void 0,
|
|
49
|
-
fontFamily: void 0,
|
|
50
|
-
fontSize: void 0,
|
|
51
|
-
fontStyle: void 0,
|
|
52
|
-
fontWeight: void 0,
|
|
53
|
-
letterSpacing: void 0,
|
|
54
|
-
maxFontSizeMultiplier: void 0,
|
|
55
|
-
size: void 0,
|
|
56
|
-
textAlign: void 0,
|
|
57
|
-
variant: void 0
|
|
58
|
-
});
|
|
59
|
-
var BUTTON_NAME = "Button";
|
|
60
|
-
var ButtonFrame = (0, import_web.styled)(import_stacks.ThemeableStack, {
|
|
61
|
-
name: BUTTON_NAME,
|
|
62
|
-
render: "button",
|
|
63
|
-
context: ButtonContext,
|
|
64
|
-
role: "button",
|
|
65
|
-
focusable: true,
|
|
66
|
-
variants: {
|
|
67
|
-
unstyled: {
|
|
68
|
-
false: {
|
|
69
|
-
size: "$true",
|
|
70
|
-
justifyContent: "center",
|
|
71
|
-
alignItems: "center",
|
|
72
|
-
flexWrap: "nowrap",
|
|
73
|
-
flexDirection: "row",
|
|
74
|
-
cursor: "pointer",
|
|
75
|
-
hoverTheme: true,
|
|
76
|
-
pressTheme: true,
|
|
77
|
-
backgroundColor: "$background",
|
|
78
|
-
borderWidth: 1,
|
|
79
|
-
borderColor: "transparent",
|
|
80
|
-
focusVisibleStyle: {
|
|
81
|
-
outlineColor: "$outlineColor",
|
|
82
|
-
outlineStyle: "solid",
|
|
83
|
-
outlineWidth: 2
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
variant: {
|
|
88
|
-
outlined: {
|
|
89
|
-
backgroundColor: "transparent",
|
|
90
|
-
borderWidth: 2,
|
|
91
|
-
borderColor: "$borderColor",
|
|
92
|
-
hoverStyle: {
|
|
93
|
-
backgroundColor: "transparent",
|
|
94
|
-
borderColor: "$borderColorHover"
|
|
95
|
-
},
|
|
96
|
-
pressStyle: {
|
|
97
|
-
backgroundColor: "transparent",
|
|
98
|
-
borderColor: "$borderColorPress"
|
|
99
|
-
},
|
|
100
|
-
focusVisibleStyle: {
|
|
101
|
-
backgroundColor: "transparent",
|
|
102
|
-
borderColor: "$borderColorFocus"
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
size: {
|
|
107
|
-
"...size": import_get_button_sized.getButtonSized,
|
|
108
|
-
":number": import_get_button_sized.getButtonSized
|
|
109
|
-
},
|
|
110
|
-
disabled: {
|
|
111
|
-
true: {
|
|
112
|
-
pointerEvents: "none"
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
defaultVariants: {
|
|
117
|
-
unstyled: process.env.GUI_HEADLESS === "1"
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
var ButtonText = (0, import_web.styled)(import_text.SizableText, {
|
|
121
|
-
name: "Button",
|
|
122
|
-
context: ButtonContext,
|
|
123
|
-
variants: {
|
|
124
|
-
unstyled: {
|
|
125
|
-
false: {
|
|
126
|
-
userSelect: "none",
|
|
127
|
-
cursor: "pointer",
|
|
128
|
-
// flexGrow 1 leads to inconsistent native style where text pushes to start of view
|
|
129
|
-
flexGrow: 0,
|
|
130
|
-
flexShrink: 1,
|
|
131
|
-
ellipsis: true,
|
|
132
|
-
color: "$color"
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
defaultVariants: {
|
|
137
|
-
unstyled: process.env.GUI_HEADLESS === "1"
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
var ButtonIcon = function (props) {
|
|
141
|
-
var {
|
|
142
|
-
children,
|
|
143
|
-
scaleIcon = 1
|
|
144
|
-
} = props;
|
|
145
|
-
var {
|
|
146
|
-
size,
|
|
147
|
-
color
|
|
148
|
-
} = (0, import_react.useContext)(ButtonContext);
|
|
149
|
-
var iconSize = (typeof size === "number" ? size * 0.5 : (0, import_font_size.getFontSize)(size)) * scaleIcon;
|
|
150
|
-
var getThemedIcon = (0, import_component_helpers.useGetThemedIcon)({
|
|
151
|
-
size: iconSize,
|
|
152
|
-
color
|
|
153
|
-
});
|
|
154
|
-
return getThemedIcon(children);
|
|
155
|
-
};
|
|
156
|
-
var ButtonComponent = ButtonFrame.styleable(function Button(props, ref) {
|
|
157
|
-
var {
|
|
158
|
-
props: buttonProps
|
|
159
|
-
} = useButton(props);
|
|
160
|
-
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(ButtonFrame, {
|
|
161
|
-
"data-disable-theme": true,
|
|
162
|
-
...buttonProps,
|
|
163
|
-
ref
|
|
164
|
-
});
|
|
165
|
-
});
|
|
166
|
-
var Button2 = (0, import_helpers.withStaticProperties)(ButtonComponent, {
|
|
167
|
-
Text: ButtonText,
|
|
168
|
-
Icon: ButtonIcon
|
|
169
|
-
});
|
|
170
|
-
function useButton(param) {
|
|
171
|
-
var {
|
|
172
|
-
textProps,
|
|
173
|
-
...propsIn
|
|
174
|
-
} = param,
|
|
175
|
-
{
|
|
176
|
-
Text = Button2.Text
|
|
177
|
-
} = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
178
|
-
Text: Button2.Text
|
|
179
|
-
};
|
|
180
|
-
var isNested = (0, import_react.useContext)(import_stacks.ButtonNestingContext);
|
|
181
|
-
var propsActive = (0, import_web.useProps)(propsIn, {
|
|
182
|
-
noNormalize: true,
|
|
183
|
-
noExpand: true
|
|
184
|
-
});
|
|
185
|
-
var {
|
|
186
|
-
icon,
|
|
187
|
-
iconAfter,
|
|
188
|
-
gap,
|
|
189
|
-
spaceFlex,
|
|
190
|
-
scaleIcon = 1,
|
|
191
|
-
scaleSpace = 0.66,
|
|
192
|
-
noTextWrap,
|
|
193
|
-
fontFamily,
|
|
194
|
-
fontSize,
|
|
195
|
-
fontWeight,
|
|
196
|
-
fontStyle,
|
|
197
|
-
letterSpacing,
|
|
198
|
-
render,
|
|
199
|
-
ellipsis,
|
|
200
|
-
maxFontSizeMultiplier,
|
|
201
|
-
...restProps
|
|
202
|
-
} = propsActive;
|
|
203
|
-
var size = propsActive.size || (propsActive.unstyled ? void 0 : "$true");
|
|
204
|
-
var color = propsActive.color;
|
|
205
|
-
var iconSize = (typeof size === "number" ? size * 0.5 : (0, import_font_size.getFontSize)(size, {
|
|
206
|
-
font: (fontFamily === null || fontFamily === void 0 ? void 0 : fontFamily[0]) === "$" ? fontFamily : void 0
|
|
207
|
-
})) * scaleIcon;
|
|
208
|
-
var getThemedIcon = (0, import_component_helpers.useGetThemedIcon)({
|
|
209
|
-
size: iconSize,
|
|
210
|
-
color
|
|
211
|
-
});
|
|
212
|
-
var [themedIcon, themedIconAfter] = [icon, iconAfter].map(getThemedIcon);
|
|
213
|
-
var spaceSize = gap !== null && gap !== void 0 ? gap : (0, import_web.getVariableValue)(iconSize) * scaleSpace;
|
|
214
|
-
var contents = noTextWrap ? [propsIn.children] : (0, import_text.wrapChildrenInText)(Text, {
|
|
215
|
-
children: propsIn.children,
|
|
216
|
-
fontFamily,
|
|
217
|
-
fontSize,
|
|
218
|
-
textProps,
|
|
219
|
-
fontWeight,
|
|
220
|
-
fontStyle,
|
|
221
|
-
letterSpacing,
|
|
222
|
-
ellipsis,
|
|
223
|
-
maxFontSizeMultiplier
|
|
224
|
-
}, Text === ButtonText && propsActive.unstyled !== true ? {
|
|
225
|
-
unstyled: process.env.GUI_HEADLESS === "1",
|
|
226
|
-
size
|
|
227
|
-
} : void 0);
|
|
228
|
-
var inner = (0, import_spacer.spacedChildren)({
|
|
229
|
-
// a bit arbitrary but scaling to font size is necessary so long as button does
|
|
230
|
-
space: spaceSize,
|
|
231
|
-
spaceFlex,
|
|
232
|
-
ensureKeys: true,
|
|
233
|
-
direction: propsActive.flexDirection === "column" || propsActive.flexDirection === "column-reverse" ? "vertical" : "horizontal",
|
|
234
|
-
// for keys to stay the same we keep indices as similar a possible
|
|
235
|
-
// so even if icons are undefined we still pass them
|
|
236
|
-
children: [themedIcon, ...contents, themedIconAfter]
|
|
237
|
-
});
|
|
238
|
-
var props = {
|
|
239
|
-
size,
|
|
240
|
-
...(propsIn.disabled && {
|
|
241
|
-
// in rnw - false still has keyboard tabIndex, undefined = not actually focusable
|
|
242
|
-
focusable: void 0,
|
|
243
|
-
// even with tabIndex unset, it will keep focusVisibleStyle on web so disable it here
|
|
244
|
-
focusVisibleStyle: {
|
|
245
|
-
borderColor: "$background"
|
|
246
|
-
}
|
|
247
|
-
}),
|
|
248
|
-
// fixes SSR issue + DOM nesting issue of not allowing button in button
|
|
249
|
-
render: render !== null && render !== void 0 ? render : isNested ? "span" :
|
|
250
|
-
// defaults to <a /> when accessibilityRole = link
|
|
251
|
-
// see https://github.com/hanzoai/gui/issues/505
|
|
252
|
-
propsActive.accessibilityRole === "link" || propsActive.role === "link" ? "a" : "button",
|
|
253
|
-
...restProps,
|
|
254
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_stacks.ButtonNestingContext.Provider, {
|
|
255
|
-
value: true,
|
|
256
|
-
children: inner
|
|
257
|
-
}),
|
|
258
|
-
// forces it to be a runtime pressStyle so it passes through context text colors
|
|
259
|
-
disableClassName: true
|
|
260
|
-
};
|
|
261
|
-
return {
|
|
262
|
-
spaceSize,
|
|
263
|
-
isNested,
|
|
264
|
-
props
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
|
-
//# sourceMappingURL=Button.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","Button_exports","__export","Button","Button2","ButtonContext","ButtonFrame","ButtonIcon","ButtonText","useButton","module","exports","import_jsx_runtime","require","import_font_size","import_get_button_sized","import_helpers","import_component_helpers","import_stacks","import_text","import_web","import_react","import_spacer","createStyledContext","color","ellipsis","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","maxFontSizeMultiplier","size","textAlign","variant","BUTTON_NAME","styled","ThemeableStack","name","render","context","role","focusable","variants","unstyled","false","justifyContent","alignItems","flexWrap","flexDirection","cursor","hoverTheme","pressTheme","backgroundColor","borderWidth","borderColor","focusVisibleStyle","outlineColor","outlineStyle","outlineWidth","outlined","hoverStyle","pressStyle","getButtonSized","disabled","true","pointerEvents","defaultVariants","process","env","GUI_HEADLESS","SizableText","userSelect","flexGrow","flexShrink","props","children","scaleIcon","useContext","iconSize","getFontSize","getThemedIcon","useGetThemedIcon","ButtonComponent","styleable","ref","buttonProps","jsx","withStaticProperties","Text","Icon","param","textProps","propsIn","arguments","length","isNested","ButtonNestingContext","propsActive","useProps","noNormalize","noExpand","icon","iconAfter","gap","spaceFlex","scaleSpace","noTextWrap","restProps","font","themedIcon","themedIconAfter","map","spaceSize","getVariableValue","contents","wrapChildrenInText","inner","spacedChildren","space","ensureKeys","direction","accessibilityRole","Provider","disableClassName"],"sources":["../../../src/v1/Button.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,cAAA;AAAAC,QAAA,CAAAD,cAAA;EAAAE,MAAA,EAAAA,CAAA,KAAAC,OAAA;EAAAC,aAAA,EAAAA,CAAA,KAAAA,aAAA;EAAAC,WAAA,EAAAA,CAAA,KAAAA,WAAA;EAAAC,UAAA,EAAAA,CAAA,KAAAA,UAAA;EAAAC,UAAA,EAAAA,CAAA,KAAAA,UAAA;EAAAC,SAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAf,YAA4B,CAAAK,cAAA;AAC5B,IAAAW,kBAAA,GAAAC,OAA+B;AAC/B,IAAAC,gBAAA,GAAqCD,OAAA;AACrC,IAAAE,uBAAA,GAAAF,OAAiC;AACjC,IAAAG,cAAA,GAAqDH,OAAA;AAErD,IAAAI,wBAAgD,GAAAJ,OAAA;AAEhD,IAAAK,aAAwE,GAAAL,OAAA;AAExE,IAAAM,WAAA,GAAAN,OAA2B;AAC3B,IAAAO,UAAA,GAAAP,OAA+B;AAiLpB,IAAAQ,YAAA,GAAAR,OAAA;AA7KJ,IAAAS,aAAM,GAAAT,OAAgB;AAO3B,IAAAR,aAAA,OAAAe,UAAA,CAAAG,mBAAA;EAEA;EACAC,KAAA,OAAU;EACVC,QAAA,OAAY;EACZC,UAAU;EACVC,QAAA,OAAW;EACXC,SAAA,OAAY;EACZC,UAAA,OAAe;EACfC,aAAA;EACAC,qBAAM;EACNC,IAAA,OAAW;EACXC,SAAS;EACVC,OAAA;AAyCD;AAEA,IAAAC,WAAM,WAAc;AAAuB,IACzC7B,WAAM,OAAAc,UAAA,CAAAgB,MAAA,EAAAlB,aAAA,CA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AAA,CAAAgG,cAAA;IACF;IACAC,KAAA,EAAAN,SAAS;IACLR,SACE;IAAuCe,UACvC;IACFC,SACA,EAAAvB,WAAA,CAAAjD,aAAA,iBAAAiD,WAAA,CAAAjD,aAAA;IACN;IAEJ;IAA6B2B,QAAA,GAE3BkC,UAAO,EACP,GAAAK,QAAA,EACAJ,eAAY;EAKN;EAAA,IAAApC,KAAA;IAGN3C,IAAA;IACD,IAAA6D,OAAA,CAAA7B,QAAA;MAED;MACEtB,SAAA;MACA;MAAwBc,iBAAA;QAEtBD,WAAW;MAAA;IAAA;IAEQ;IACJhB,MACf,EAAAA,MAAA,aAAAA,MAAA,cAAAA,MAAA,GAAAyD,QAAA;IACF;IAAA;IAEAE,WACE,CAAAwB,iBAEI,eAAAxB,WAAA,CAAAzD,IAAA;IAAA,GAAAmE,SAAA;IAAAhC,QAGA,iBAAY,IAAAhE,kBAAgC,CAAA2E,GAAA,EAAArE,aAAqB,CAAA+E,oBAE/D,CAAA0B,QAAA;MAAA3H,KAAA;MAER4E,QAAG,EAAAyC;IAEH;IACqD;IAGrDO,gBAAA,EAAkB;EACpB;EAEA,OAAO;IACLX,SAAA;IACAjB,QAAA;IACArB;EACF;AACF","ignoreList":[]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
var import_config_default = require("@hanzogui/config-default");
|
|
2
|
-
var import_core = require("@hanzogui/core");
|
|
3
|
-
var import_vitest = require("vitest");
|
|
4
|
-
const conf = (0, import_core.createGui)((0, import_config_default.getDefaultGuiConfig)());
|
|
5
|
-
(0, import_vitest.describe)("Button", () => {
|
|
6
|
-
(0, import_vitest.test)(`123`, () => {
|
|
7
|
-
(0, import_vitest.expect)(true).toBeTruthy();
|
|
8
|
-
});
|
|
9
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var import_config_default = require("@hanzogui/config-default");
|
|
4
|
-
var import_core = require("@hanzogui/core");
|
|
5
|
-
var import_vitest = require("vitest");
|
|
6
|
-
var conf = (0, import_core.createGui)((0, import_config_default.getDefaultGuiConfig)());
|
|
7
|
-
(0, import_vitest.describe)("Button", function () {
|
|
8
|
-
(0, import_vitest.test)(`123`, function () {
|
|
9
|
-
(0, import_vitest.expect)(true).toBeTruthy();
|
|
10
|
-
});
|
|
11
|
-
});
|
|
12
|
-
//# sourceMappingURL=Button.test.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["import_config_default","require","import_core","import_vitest","conf","createGui","getDefaultGuiConfig","describe","test","expect","toBeTruthy"],"sources":["../../../src/v1/Button.test.tsx"],"sourcesContent":[null],"mappings":"AAAA;;AACA,IAAAA,qBAA0B,GAAAC,OAAA;AAC1B,IAAAC,WAAA,GAAAD,OAAuC;AAEvC,IAAAE,aAAa,GAAAF,OAAA;AAA+B,IAE5CG,IAAA,OAAAF,WAAA,CAAAG,SAAS,EAAU,IAAAL,qBAAM,CAAAM,mBAAA;AACvB,IAAAH,aAAA,CAAAI,QAAK,UAAO,cAAM;EAChB,IAAAJ,aAAA,CAAAK,IAAA,OAAO,cAAM;IACd,IAAAL,aAAA,CAAAM,MAAA,QAAAC,UAAA;EAWF","ignoreList":[]}
|
package/dist/cjs/v1/index.cjs
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
-
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
8
|
-
get: () => from[key],
|
|
9
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
16
|
-
value: true
|
|
17
|
-
}), mod);
|
|
18
|
-
var v1_exports = {};
|
|
19
|
-
module.exports = __toCommonJS(v1_exports);
|
|
20
|
-
__reExport(v1_exports, require("./Button.cjs"), module.exports);
|
|
@@ -1,23 +0,0 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
8
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
-
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
10
|
-
get: () => from[key],
|
|
11
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
return to;
|
|
15
|
-
};
|
|
16
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
17
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
18
|
-
value: true
|
|
19
|
-
}), mod);
|
|
20
|
-
var v1_exports = {};
|
|
21
|
-
module.exports = __toCommonJS(v1_exports);
|
|
22
|
-
__reExport(v1_exports, require("./Button.native.js"), module.exports);
|
|
23
|
-
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","v1_exports","module","exports"],"sources":["../../../src/v1/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,UAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,UAAA","ignoreList":[]}
|