@hanzogui/button 7.0.0 → 7.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/LICENSE +40 -19
  2. package/dist/cjs/Button.cjs +225 -0
  3. package/dist/cjs/Button.native.js +229 -0
  4. package/dist/cjs/Button.native.js.map +1 -0
  5. package/dist/cjs/Button.test.cjs +37 -0
  6. package/dist/cjs/Button.test.native.js +40 -0
  7. package/dist/cjs/Button.test.native.js.map +1 -0
  8. package/dist/cjs/index.cjs +20 -0
  9. package/dist/cjs/index.native.js +23 -0
  10. package/dist/cjs/index.native.js.map +1 -0
  11. package/dist/cjs/v1/Button.cjs +262 -0
  12. package/dist/cjs/v1/Button.native.js +267 -0
  13. package/dist/cjs/v1/Button.native.js.map +1 -0
  14. package/dist/cjs/v1/Button.test.cjs +9 -0
  15. package/dist/cjs/v1/Button.test.native.js +12 -0
  16. package/dist/cjs/v1/Button.test.native.js.map +1 -0
  17. package/dist/cjs/v1/index.cjs +20 -0
  18. package/dist/cjs/v1/index.native.js +23 -0
  19. package/dist/cjs/v1/index.native.js.map +1 -0
  20. package/dist/esm/Button.mjs +199 -0
  21. package/dist/esm/Button.mjs.map +1 -0
  22. package/dist/esm/Button.native.js +200 -0
  23. package/dist/esm/Button.native.js.map +1 -0
  24. package/dist/esm/Button.test.mjs +38 -0
  25. package/dist/esm/Button.test.mjs.map +1 -0
  26. package/dist/esm/Button.test.native.js +38 -0
  27. package/dist/esm/Button.test.native.js.map +1 -0
  28. package/dist/esm/index.js +2 -0
  29. package/dist/esm/index.js.map +1 -0
  30. package/dist/esm/index.mjs +2 -0
  31. package/dist/esm/index.mjs.map +1 -0
  32. package/dist/esm/index.native.js +2 -0
  33. package/dist/esm/index.native.js.map +1 -0
  34. package/dist/esm/v1/Button.mjs +232 -0
  35. package/dist/esm/v1/Button.mjs.map +1 -0
  36. package/dist/esm/v1/Button.native.js +234 -0
  37. package/dist/esm/v1/Button.native.js.map +1 -0
  38. package/dist/esm/v1/Button.test.mjs +10 -0
  39. package/dist/esm/v1/Button.test.mjs.map +1 -0
  40. package/dist/esm/v1/Button.test.native.js +10 -0
  41. package/dist/esm/v1/Button.test.native.js.map +1 -0
  42. package/dist/esm/v1/index.mjs +2 -0
  43. package/dist/esm/v1/index.mjs.map +1 -0
  44. package/dist/esm/v1/index.native.js +2 -0
  45. package/dist/esm/v1/index.native.js.map +1 -0
  46. package/dist/jsx/Button.mjs +199 -0
  47. package/dist/jsx/Button.mjs.map +1 -0
  48. package/dist/jsx/Button.native.js +229 -0
  49. package/dist/jsx/Button.native.js.map +1 -0
  50. package/dist/jsx/Button.test.mjs +38 -0
  51. package/dist/jsx/Button.test.mjs.map +1 -0
  52. package/dist/jsx/Button.test.native.js +40 -0
  53. package/dist/jsx/Button.test.native.js.map +1 -0
  54. package/dist/jsx/index.js +2 -0
  55. package/dist/jsx/index.js.map +1 -0
  56. package/dist/jsx/index.mjs +2 -0
  57. package/dist/jsx/index.mjs.map +1 -0
  58. package/dist/jsx/index.native.js +23 -0
  59. package/dist/jsx/index.native.js.map +1 -0
  60. package/dist/jsx/v1/Button.mjs +232 -0
  61. package/dist/jsx/v1/Button.mjs.map +1 -0
  62. package/dist/jsx/v1/Button.native.js +267 -0
  63. package/dist/jsx/v1/Button.native.js.map +1 -0
  64. package/dist/jsx/v1/Button.test.mjs +10 -0
  65. package/dist/jsx/v1/Button.test.mjs.map +1 -0
  66. package/dist/jsx/v1/Button.test.native.js +12 -0
  67. package/dist/jsx/v1/Button.test.native.js.map +1 -0
  68. package/dist/jsx/v1/index.mjs +2 -0
  69. package/dist/jsx/v1/index.mjs.map +1 -0
  70. package/dist/jsx/v1/index.native.js +23 -0
  71. package/dist/jsx/v1/index.native.js.map +1 -0
  72. package/package.json +20 -18
  73. package/src/Button.test.tsx +5 -5
  74. package/src/Button.tsx +4 -4
  75. package/src/v1/Button.test.tsx +5 -5
  76. package/src/v1/Button.tsx +5 -5
  77. package/types/Button.d.ts +7 -7
  78. package/types/Button.d.ts.map +1 -0
  79. package/types/Button.test.d.ts.map +1 -0
  80. package/types/index.d.ts.map +1 -0
  81. package/types/v1/Button.d.ts +10 -10
  82. package/types/v1/Button.d.ts.map +1 -0
  83. package/types/v1/Button.test.d.ts.map +1 -0
  84. package/types/v1/index.d.ts.map +1 -0
@@ -0,0 +1,232 @@
1
+ import { getFontSize } from "@hanzogui/font-size";
2
+ import { getButtonSized } from "@hanzogui/get-button-sized";
3
+ import { withStaticProperties } from "@hanzogui/helpers";
4
+ import { useGetThemedIcon } from "@hanzogui/component-helpers";
5
+ import { ButtonNestingContext, ThemeableStack } from "@hanzogui/stacks";
6
+ import { SizableText, wrapChildrenInText } from "@hanzogui/text";
7
+ import { createStyledContext, getVariableValue, styled, useProps } from "@hanzogui/web";
8
+ import { useContext } from "react";
9
+ import { spacedChildren } from "@hanzogui/spacer";
10
+ import { jsx } from "react/jsx-runtime";
11
+ const ButtonContext = createStyledContext({
12
+ // keeping these here means they work with styled() passing down color to text
13
+ color: void 0,
14
+ ellipsis: void 0,
15
+ fontFamily: void 0,
16
+ fontSize: void 0,
17
+ fontStyle: void 0,
18
+ fontWeight: void 0,
19
+ letterSpacing: void 0,
20
+ maxFontSizeMultiplier: void 0,
21
+ size: void 0,
22
+ textAlign: void 0,
23
+ variant: void 0
24
+ });
25
+ const BUTTON_NAME = "Button";
26
+ const ButtonFrame = styled(ThemeableStack, {
27
+ name: BUTTON_NAME,
28
+ render: "button",
29
+ context: ButtonContext,
30
+ role: "button",
31
+ focusable: true,
32
+ variants: {
33
+ unstyled: {
34
+ false: {
35
+ size: "$true",
36
+ justifyContent: "center",
37
+ alignItems: "center",
38
+ flexWrap: "nowrap",
39
+ flexDirection: "row",
40
+ cursor: "pointer",
41
+ hoverTheme: true,
42
+ pressTheme: true,
43
+ backgroundColor: "$background",
44
+ borderWidth: 1,
45
+ borderColor: "transparent",
46
+ focusVisibleStyle: {
47
+ outlineColor: "$outlineColor",
48
+ outlineStyle: "solid",
49
+ outlineWidth: 2
50
+ }
51
+ }
52
+ },
53
+ variant: {
54
+ outlined: {
55
+ backgroundColor: "transparent",
56
+ borderWidth: 2,
57
+ borderColor: "$borderColor",
58
+ hoverStyle: {
59
+ backgroundColor: "transparent",
60
+ borderColor: "$borderColorHover"
61
+ },
62
+ pressStyle: {
63
+ backgroundColor: "transparent",
64
+ borderColor: "$borderColorPress"
65
+ },
66
+ focusVisibleStyle: {
67
+ backgroundColor: "transparent",
68
+ borderColor: "$borderColorFocus"
69
+ }
70
+ }
71
+ },
72
+ size: {
73
+ "...size": getButtonSized,
74
+ ":number": getButtonSized
75
+ },
76
+ disabled: {
77
+ true: {
78
+ pointerEvents: "none"
79
+ }
80
+ }
81
+ },
82
+ defaultVariants: {
83
+ unstyled: process.env.GUI_HEADLESS === "1"
84
+ }
85
+ });
86
+ const ButtonText = styled(SizableText, {
87
+ name: "Button",
88
+ context: ButtonContext,
89
+ variants: {
90
+ unstyled: {
91
+ false: {
92
+ userSelect: "none",
93
+ cursor: "pointer",
94
+ // flexGrow 1 leads to inconsistent native style where text pushes to start of view
95
+ flexGrow: 0,
96
+ flexShrink: 1,
97
+ ellipsis: true,
98
+ color: "$color"
99
+ }
100
+ }
101
+ },
102
+ defaultVariants: {
103
+ unstyled: process.env.GUI_HEADLESS === "1"
104
+ }
105
+ });
106
+ const ButtonIcon = props => {
107
+ const {
108
+ children,
109
+ scaleIcon = 1
110
+ } = props;
111
+ const {
112
+ size,
113
+ color
114
+ } = useContext(ButtonContext);
115
+ const iconSize = (typeof size === "number" ? size * 0.5 : getFontSize(size)) * scaleIcon;
116
+ const getThemedIcon = useGetThemedIcon({
117
+ size: iconSize,
118
+ color
119
+ });
120
+ return getThemedIcon(children);
121
+ };
122
+ const ButtonComponent = ButtonFrame.styleable(function Button(props, ref) {
123
+ const {
124
+ props: buttonProps
125
+ } = useButton(props);
126
+ return /* @__PURE__ */jsx(ButtonFrame, {
127
+ "data-disable-theme": true,
128
+ ...buttonProps,
129
+ ref
130
+ });
131
+ });
132
+ const Button2 = withStaticProperties(ButtonComponent, {
133
+ Text: ButtonText,
134
+ Icon: ButtonIcon
135
+ });
136
+ function useButton({
137
+ textProps,
138
+ ...propsIn
139
+ }, {
140
+ Text = Button2.Text
141
+ } = {
142
+ Text: Button2.Text
143
+ }) {
144
+ const isNested = useContext(ButtonNestingContext);
145
+ const propsActive = useProps(propsIn, {
146
+ noNormalize: true,
147
+ noExpand: true
148
+ });
149
+ const {
150
+ icon,
151
+ iconAfter,
152
+ gap,
153
+ spaceFlex,
154
+ scaleIcon = 1,
155
+ scaleSpace = 0.66,
156
+ noTextWrap,
157
+ fontFamily,
158
+ fontSize,
159
+ fontWeight,
160
+ fontStyle,
161
+ letterSpacing,
162
+ render,
163
+ ellipsis,
164
+ maxFontSizeMultiplier,
165
+ ...restProps
166
+ } = propsActive;
167
+ const size = propsActive.size || (propsActive.unstyled ? void 0 : "$true");
168
+ const color = propsActive.color;
169
+ const iconSize = (typeof size === "number" ? size * 0.5 : getFontSize(size, {
170
+ font: fontFamily?.[0] === "$" ? fontFamily : void 0
171
+ })) * scaleIcon;
172
+ const getThemedIcon = useGetThemedIcon({
173
+ size: iconSize,
174
+ color
175
+ });
176
+ const [themedIcon, themedIconAfter] = [icon, iconAfter].map(getThemedIcon);
177
+ const spaceSize = gap ?? getVariableValue(iconSize) * scaleSpace;
178
+ const contents = noTextWrap ? [propsIn.children] : wrapChildrenInText(Text, {
179
+ children: propsIn.children,
180
+ fontFamily,
181
+ fontSize,
182
+ textProps,
183
+ fontWeight,
184
+ fontStyle,
185
+ letterSpacing,
186
+ ellipsis,
187
+ maxFontSizeMultiplier
188
+ }, Text === ButtonText && propsActive.unstyled !== true ? {
189
+ unstyled: process.env.GUI_HEADLESS === "1",
190
+ size
191
+ } : void 0);
192
+ const inner = spacedChildren({
193
+ // a bit arbitrary but scaling to font size is necessary so long as button does
194
+ space: spaceSize,
195
+ spaceFlex,
196
+ ensureKeys: true,
197
+ direction: propsActive.flexDirection === "column" || propsActive.flexDirection === "column-reverse" ? "vertical" : "horizontal",
198
+ // for keys to stay the same we keep indices as similar a possible
199
+ // so even if icons are undefined we still pass them
200
+ children: [themedIcon, ...contents, themedIconAfter]
201
+ });
202
+ const props = {
203
+ size,
204
+ ...(propsIn.disabled && {
205
+ // in rnw - false still has keyboard tabIndex, undefined = not actually focusable
206
+ focusable: void 0,
207
+ // even with tabIndex unset, it will keep focusVisibleStyle on web so disable it here
208
+ focusVisibleStyle: {
209
+ borderColor: "$background"
210
+ }
211
+ }),
212
+ // fixes SSR issue + DOM nesting issue of not allowing button in button
213
+ render: render ?? (isNested ? "span" :
214
+ // defaults to <a /> when accessibilityRole = link
215
+ // see https://github.com/hanzoai/gui/issues/505
216
+ propsActive.accessibilityRole === "link" || propsActive.role === "link" ? "a" : "button"),
217
+ ...restProps,
218
+ children: /* @__PURE__ */jsx(ButtonNestingContext.Provider, {
219
+ value: true,
220
+ children: inner
221
+ }),
222
+ // forces it to be a runtime pressStyle so it passes through context text colors
223
+ disableClassName: true
224
+ };
225
+ return {
226
+ spaceSize,
227
+ isNested,
228
+ props
229
+ };
230
+ }
231
+ export { Button2 as Button, ButtonContext, ButtonFrame, ButtonIcon, ButtonText, useButton };
232
+ //# sourceMappingURL=Button.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getFontSize","getButtonSized","withStaticProperties","useGetThemedIcon","ButtonNestingContext","ThemeableStack","SizableText","wrapChildrenInText","createStyledContext","getVariableValue","styled","useProps","useContext","spacedChildren","jsx","ButtonContext","color","ellipsis","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","maxFontSizeMultiplier","size","textAlign","variant","BUTTON_NAME","ButtonFrame","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","disabled","true","pointerEvents","defaultVariants","process","env","GUI_HEADLESS","ButtonText","userSelect","flexGrow","flexShrink","ButtonIcon","props","children","scaleIcon","iconSize","getThemedIcon","ButtonComponent","styleable","Button","ref","buttonProps","useButton","Text","Icon","textProps","propsIn","Button2","isNested","propsActive","noNormalize","noExpand","icon","iconAfter","gap","spaceFlex","scaleSpace","noTextWrap","restProps","font","themedIcon","themedIconAfter","map","spaceSize","contents","inner","space","ensureKeys","direction","accessibilityRole","Provider","value","disableClassName"],"sources":["../../../src/v1/Button.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,WAAA,QAAmB;AAC5B,SAASC,cAAA,QAAsB;AAC/B,SAASC,oBAAA,QAA4B;AACrC,SAASC,gBAAA,QAAwB;AACjC,SAASC,oBAAA,EAAsBC,cAAA,QAAsB;AAErD,SAASC,WAAA,EAAaC,kBAAA,QAA0B;AAEhD,SAASC,mBAAA,EAAqBC,gBAAA,EAAkBC,MAAA,EAAQC,QAAA,QAAgB;AAExE,SAASC,UAAA,QAAkB;AAC3B,SAASC,cAAA,QAAsB;AAiLpB,SAAAC,GAAA;AA7KJ,MAAMC,aAAA,GAAgBP,mBAAA,CAO3B;EAAA;EAEAQ,KAAA,EAAO;EACPC,QAAA,EAAU;EACVC,UAAA,EAAY;EACZC,QAAA,EAAU;EACVC,SAAA,EAAW;EACXC,UAAA,EAAY;EACZC,aAAA,EAAe;EACfC,qBAAA,EAAuB;EACvBC,IAAA,EAAM;EACNC,SAAA,EAAW;EACXC,OAAA,EAAS;AACX,CAAC;AAyCD,MAAMC,WAAA,GAAc;AAEpB,MAAMC,WAAA,GAAclB,MAAA,CAAOL,cAAA,EAAgB;EACzCwB,IAAA,EAAMF,WAAA;EACNG,MAAA,EAAQ;EACRC,OAAA,EAAShB,aAAA;EACTiB,IAAA,EAAM;EACNC,SAAA,EAAW;EAEXC,QAAA,EAAU;IACRC,QAAA,EAAU;MACRC,KAAA,EAAO;QACLZ,IAAA,EAAM;QACNa,cAAA,EAAgB;QA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BAC1B,aACA;IAAA;IAAA;IAGN2B,QAAA,EAAU,CAAC2B,UAAA,EAAY,GAAGI,QAAA,EAAUH,eAAe;EACrD,CAAC;EAED,MAAM7B,KAAA,GAAQ;IACZ1C,IAAA;IACA,IAAIwD,OAAA,CAAQ1B,QAAA,IAAY;MAAA;MAEtBrB,SAAA,EAAW;MAAA;MAEXc,iBAAA,EAAmB;QACjBD,WAAA,EAAa;MACf;IACF;IAAA;IAEAhB,MAAA,EACEA,MAAA,KACCoD,QAAA,GACG;IAAA;IAAA;IAGAC,WAAA,CAAYoB,iBAAA,KAAsB,UAAUpB,WAAA,CAAYnD,IAAA,KAAS,SAC/D,MACA;IAER,GAAG4D,SAAA;IAEHzB,QAAA,EACE,eAAArD,GAAA,CAACV,oBAAA,CAAqBoG,QAAA,EAArB;MAA8BC,KAAA,EAAO;MAAOtC,QAAA,EAAAgC;IAAA,CAAM;IAAA;IAGrDO,gBAAA,EAAkB;EACpB;EAEA,OAAO;IACLT,SAAA;IACAf,QAAA;IACAhB;EACF;AACF","ignoreList":[]}
@@ -0,0 +1,267 @@
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
@@ -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","Button_exports","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","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"],"sources":["../../../src/v1/Button.tsx"],"sourcesContent":[null],"mappings":"AAAA,YAAS;;AACT,IAAAA,SAAS,GAAAC,MAAA,CAAAC,cAAsB;AAC/B,IAAAC,gBAAS,GAAAF,MAAA,CAAAG,wBAA4B;AACrC,IAAAC,iBAAS,GAAAJ,MAAA,CAAAK,mBAAwB;AACjC,IAAAC,YAAS,GAAAN,MAAA,CAAAO,SAAsB,CAAAC,cAAA;AAE/B,IAAAC,QAAS,GAAAA,CAAAC,MAAa,EAAAC,GAAA;EAEtB,SAASC,IAAA,IAAAD,GAAA,EAETZ,SAAS,CAAAW,MAAA,EAAAE,IAAA,EAAkB;IAAAC,GAAA,EAAAF,GAAA,CAAAC,IAAA;IAAAE,UAAA;EAAA;AAC3B;AAiLW,IAAAC,WAAA,GAAAA,CAAAC,EAAA,EAAAC,IA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AAA,CAAAjB,QAAA;IAGNjD,UAAU;IACXC,QAAA;IAEDgE,SAAM;IACJ9D,UAAA;IACAD,SAAI;IAAoBE,aAAA;IAAAL,QAEtB;IAAWM;EAAA,GAAAyD,IAEX,KAAAhF,UAAA,IAAmByF,WAAA,CAAAtD,QAAA;IAAAA,QACjB,EAAAwB,OAAa,CAAAC,GAAA,CAAAC,YAAA;IAAArC;EACf,IACF;EAAA,IAAAoF,KAAA,OAAA9F,aAAA,CAAA+F,cAAA;IAEA;IAGMC,KAAA,EAAAN,SAAA;IAAAR,SAAA;IAAAe,UAGA,MAAY;IAEVC,SAAA,EAAAvB,WAAA,CAAAjD,aAAA,iBAAAiD,WAAA,CAAAjD,aAAA;IAER;IAEA;IACqD2B,QAAA,GAGrDkC,UAAA,EACF,GAAAK,QAAA,EAEAJ,eAAO;EACL,EACA;EAAA,IACApC,KAAA;IACF1C,IAAA;IACF,IAAA4D,OAAA,CAAA7B,QAAA","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ import { getDefaultGuiConfig } from "@hanzogui/config-default";
2
+ import { createGui } from "@hanzogui/core";
3
+ import { describe, expect, test } from "vitest";
4
+ const conf = createGui(getDefaultGuiConfig());
5
+ describe("Button", () => {
6
+ test(`123`, () => {
7
+ expect(true).toBeTruthy();
8
+ });
9
+ });
10
+ //# sourceMappingURL=Button.test.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getDefaultGuiConfig","createGui","describe","expect","test","conf","toBeTruthy"],"sources":["../../../src/v1/Button.test.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,mBAAA,QAA2B;AACpC,SAASC,SAAA,QAAiB;AAC1B,SAASC,QAAA,EAAUC,MAAA,EAAQC,IAAA,QAAY;AAEvC,MAAMC,IAAA,GAAOJ,SAAA,CAAUD,mBAAA,CAAoB,CAAC;AAE5CE,QAAA,CAAS,UAAU,MAAM;EACvBE,IAAA,CAAK,OAAO,MAAM;IAChBD,MAAA,CAAO,IAAI,EAAEG,UAAA,CAAW;EAC1B,CAAC;AAWH,CAAC","ignoreList":[]}
@@ -0,0 +1,12 @@
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
@@ -0,0 +1 @@
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,YAAS;;AACT,IAAAA,qBAAS,GAAiBC,OAAA;AAC1B,IAAAC,WAAS,GAAAD,OAAU,iBAAoB;AAEvC,IAAAE,aAAa,GAAAF,OAAU;AAEvB,IAAAG,IAAA,GAAS,IAAAF,WAAgB,CAAAG,SAAA,MAAAL,qBAAA,CAAAM,mBAAA;AACvB,IAAAH,aAAY,CAAAI,QAAM;EAChB,IAAAJ,aAAa,CAAAK,IAAA,OAAW;IACzB,IAAAL,aAAA,CAAAM,MAAA,QAAAC,UAAA;EAWF","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export * from "./Button.mjs";
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["../../../src/v1/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
@@ -0,0 +1,23 @@
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
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["../../../src/v1/index.ts"],"sourcesContent":[null],"mappings":"AAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzogui/button",
3
- "version": "7.0.0",
3
+ "version": "7.3.0",
4
4
  "gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
5
5
  "source": "src/index.ts",
6
6
  "files": [
@@ -31,30 +31,32 @@
31
31
  "access": "public"
32
32
  },
33
33
  "scripts": {
34
- "build": "hanzogui-build",
35
- "watch": "hanzogui-build --watch",
36
- "clean": "hanzogui-build clean",
37
- "clean:build": "hanzogui-build clean:build"
34
+ "build": "gui-build",
35
+ "watch": "gui-build --watch",
36
+ "clean": "gui-build clean",
37
+ "clean:build": "gui-build clean:build"
38
38
  },
39
39
  "dependencies": {
40
- "@hanzogui/config-default": "^7.0.0",
41
- "@hanzogui/core": "^7.0.0",
42
- "@hanzogui/get-button-sized": "^7.0.0",
43
- "@hanzogui/helpers": "^7.0.0",
44
- "@hanzogui/component-helpers": "^7.0.0",
45
- "@hanzogui/spacer": "^7.0.0",
46
- "@hanzogui/stacks": "^7.0.0",
47
- "@hanzogui/text": "^7.0.0",
48
- "@hanzogui/font-size": "^7.0.0",
49
- "@hanzogui/web": "^7.0.0"
40
+ "@hanzogui/config-default": "7.3.0",
41
+ "@hanzogui/core": "7.3.0",
42
+ "@hanzogui/get-button-sized": "7.3.0",
43
+ "@hanzogui/helpers": "7.3.0",
44
+ "@hanzogui/component-helpers": "7.3.0",
45
+ "@hanzogui/spacer": "7.3.0",
46
+ "@hanzogui/stacks": "7.3.0",
47
+ "@hanzogui/text": "7.3.0",
48
+ "@hanzogui/font-size": "7.3.0",
49
+ "@hanzogui/web": "7.3.0"
50
50
  },
51
51
  "devDependencies": {
52
- "@hanzogui/build": "^7.0.0",
52
+ "@hanzogui/build": "7.3.0",
53
53
  "react": ">=19",
54
54
  "vitest": "4.0.4"
55
55
  },
56
56
  "peerDependencies": {
57
57
  "react": ">=19"
58
58
  },
59
- "module:jsx": "dist/jsx"
60
- }
59
+ "module:jsx": "dist/jsx",
60
+ "license": "BSD-3-Clause",
61
+ "author": "Hanzo AI <dev@hanzo.ai>"
62
+ }