@multiplatform.one/forms 7.72.0 → 7.74.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/IconButtonGroup.cjs +32 -0
- package/dist/cjs/Button/IconButtonGroup.native.js +32 -0
- package/dist/cjs/Button/IconButtonGroup.native.js.map +1 -1
- package/dist/cjs/Button/circleGlyph.cjs +28 -0
- package/dist/cjs/Button/circleGlyph.native.js +31 -0
- package/dist/cjs/Button/circleGlyph.native.js.map +1 -0
- package/dist/cjs/Button/glass.cjs +4 -1
- package/dist/cjs/Button/iconButtonGroupContext.native.js.map +1 -1
- package/dist/cjs/Button/index.cjs +44 -15
- package/dist/cjs/Button/index.native.js +52 -17
- package/dist/cjs/Button/index.native.js.map +1 -1
- package/dist/cjs/Button/webGlass.cjs +62 -0
- package/dist/cjs/Button/webGlass.native.js +68 -0
- package/dist/cjs/Button/webGlass.native.js.map +1 -0
- package/dist/cjs/FloatingPanel/PanelHeader.cjs +49 -0
- package/dist/cjs/FloatingPanel/PanelHeader.native.js +53 -0
- package/dist/cjs/FloatingPanel/PanelHeader.native.js.map +1 -0
- package/dist/cjs/FloatingPanel/echoContext.cjs +28 -0
- package/dist/cjs/FloatingPanel/echoContext.native.js +29 -0
- package/dist/cjs/FloatingPanel/echoContext.native.js.map +1 -1
- package/dist/cjs/FloatingPanel/iconEcho.cjs +104 -0
- package/dist/cjs/FloatingPanel/iconEcho.native.js +114 -0
- package/dist/cjs/FloatingPanel/iconEcho.native.js.map +1 -0
- package/dist/cjs/FloatingPanel/index.cjs +168 -15
- package/dist/cjs/FloatingPanel/index.native.js +77 -8
- package/dist/cjs/FloatingPanel/index.native.js.map +1 -1
- package/dist/cjs/FloatingPanel/paintedBox.cjs +80 -0
- package/dist/cjs/FloatingPanel/paintedBox.native.js +85 -0
- package/dist/cjs/FloatingPanel/paintedBox.native.js.map +1 -0
- package/dist/cjs/FloatingPanel/pointAnchor.cjs +22 -3
- package/dist/cjs/FloatingPanel/pointAnchor.native.js +26 -7
- package/dist/cjs/FloatingPanel/pointAnchor.native.js.map +1 -1
- package/dist/cjs/FloatingPanel/useFloatingPanel.cjs +2 -1
- package/dist/cjs/FloatingPanel/useFloatingPanel.native.js +3 -1
- package/dist/cjs/FloatingPanel/useFloatingPanel.native.js.map +1 -1
- package/dist/cjs/fields/FileUpload/index.cjs +8 -3
- package/dist/cjs/fields/FileUpload/index.native.js +8 -3
- package/dist/cjs/fields/FileUpload/index.native.js.map +1 -1
- package/dist/cjs/index.cjs +2 -0
- package/dist/cjs/index.native.js +2 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/esm/Button/IconButtonGroup.mjs +32 -0
- package/dist/esm/Button/IconButtonGroup.mjs.map +1 -1
- package/dist/esm/Button/IconButtonGroup.native.js +32 -0
- package/dist/esm/Button/IconButtonGroup.native.js.map +1 -1
- package/dist/esm/Button/circleGlyph.mjs +3 -0
- package/dist/esm/Button/circleGlyph.mjs.map +1 -0
- package/dist/esm/Button/circleGlyph.native.js +3 -0
- package/dist/esm/Button/circleGlyph.native.js.map +1 -0
- package/dist/esm/Button/glass.mjs +4 -2
- package/dist/esm/Button/glass.mjs.map +1 -1
- package/dist/esm/Button/iconButtonGroupContext.mjs.map +1 -1
- package/dist/esm/Button/iconButtonGroupContext.native.js.map +1 -1
- package/dist/esm/Button/index.mjs +44 -16
- package/dist/esm/Button/index.mjs.map +1 -1
- package/dist/esm/Button/index.native.js +52 -18
- package/dist/esm/Button/index.native.js.map +1 -1
- package/dist/esm/Button/webGlass.mjs +36 -0
- package/dist/esm/Button/webGlass.mjs.map +1 -0
- package/dist/esm/Button/webGlass.native.js +39 -0
- package/dist/esm/Button/webGlass.native.js.map +1 -0
- package/dist/esm/FloatingPanel/PanelHeader.mjs +24 -0
- package/dist/esm/FloatingPanel/PanelHeader.mjs.map +1 -0
- package/dist/esm/FloatingPanel/PanelHeader.native.js +25 -0
- package/dist/esm/FloatingPanel/PanelHeader.native.js.map +1 -0
- package/dist/esm/FloatingPanel/echoContext.mjs +25 -1
- package/dist/esm/FloatingPanel/echoContext.mjs.map +1 -1
- package/dist/esm/FloatingPanel/echoContext.native.js +26 -1
- package/dist/esm/FloatingPanel/echoContext.native.js.map +1 -1
- package/dist/esm/FloatingPanel/iconEcho.mjs +77 -0
- package/dist/esm/FloatingPanel/iconEcho.mjs.map +1 -0
- package/dist/esm/FloatingPanel/iconEcho.native.js +84 -0
- package/dist/esm/FloatingPanel/iconEcho.native.js.map +1 -0
- package/dist/esm/FloatingPanel/index.mjs +169 -16
- package/dist/esm/FloatingPanel/index.mjs.map +1 -1
- package/dist/esm/FloatingPanel/index.native.js +79 -10
- package/dist/esm/FloatingPanel/index.native.js.map +1 -1
- package/dist/esm/FloatingPanel/paintedBox.mjs +52 -0
- package/dist/esm/FloatingPanel/paintedBox.mjs.map +1 -0
- package/dist/esm/FloatingPanel/paintedBox.native.js +54 -0
- package/dist/esm/FloatingPanel/paintedBox.native.js.map +1 -0
- package/dist/esm/FloatingPanel/pointAnchor.mjs +22 -3
- package/dist/esm/FloatingPanel/pointAnchor.mjs.map +1 -1
- package/dist/esm/FloatingPanel/pointAnchor.native.js +26 -7
- package/dist/esm/FloatingPanel/pointAnchor.native.js.map +1 -1
- package/dist/esm/FloatingPanel/useFloatingPanel.mjs +2 -1
- package/dist/esm/FloatingPanel/useFloatingPanel.mjs.map +1 -1
- package/dist/esm/FloatingPanel/useFloatingPanel.native.js +3 -1
- package/dist/esm/FloatingPanel/useFloatingPanel.native.js.map +1 -1
- package/dist/esm/fields/FileUpload/index.mjs +8 -3
- package/dist/esm/fields/FileUpload/index.mjs.map +1 -1
- package/dist/esm/fields/FileUpload/index.native.js +8 -3
- package/dist/esm/fields/FileUpload/index.native.js.map +1 -1
- package/dist/esm/index.mjs +2 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +2 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/jsx/Button/IconButtonGroup.mjs +32 -0
- package/dist/jsx/Button/IconButtonGroup.mjs.map +1 -1
- package/dist/jsx/Button/IconButtonGroup.native.js +32 -0
- package/dist/jsx/Button/IconButtonGroup.native.js.map +1 -1
- package/dist/jsx/Button/circleGlyph.mjs +3 -0
- package/dist/jsx/Button/circleGlyph.mjs.map +1 -0
- package/dist/jsx/Button/circleGlyph.native.js +31 -0
- package/dist/jsx/Button/circleGlyph.native.js.map +1 -0
- package/dist/jsx/Button/glass.mjs +4 -2
- package/dist/jsx/Button/glass.mjs.map +1 -1
- package/dist/jsx/Button/iconButtonGroupContext.mjs.map +1 -1
- package/dist/jsx/Button/iconButtonGroupContext.native.js.map +1 -1
- package/dist/jsx/Button/index.mjs +44 -16
- package/dist/jsx/Button/index.mjs.map +1 -1
- package/dist/jsx/Button/index.native.js +52 -17
- package/dist/jsx/Button/index.native.js.map +1 -1
- package/dist/jsx/Button/webGlass.mjs +36 -0
- package/dist/jsx/Button/webGlass.mjs.map +1 -0
- package/dist/jsx/Button/webGlass.native.js +68 -0
- package/dist/jsx/Button/webGlass.native.js.map +1 -0
- package/dist/jsx/FloatingPanel/PanelHeader.mjs +24 -0
- package/dist/jsx/FloatingPanel/PanelHeader.mjs.map +1 -0
- package/dist/jsx/FloatingPanel/PanelHeader.native.js +53 -0
- package/dist/jsx/FloatingPanel/PanelHeader.native.js.map +1 -0
- package/dist/jsx/FloatingPanel/echoContext.mjs +25 -1
- package/dist/jsx/FloatingPanel/echoContext.mjs.map +1 -1
- package/dist/jsx/FloatingPanel/echoContext.native.js +29 -0
- package/dist/jsx/FloatingPanel/echoContext.native.js.map +1 -1
- package/dist/jsx/FloatingPanel/iconEcho.mjs +77 -0
- package/dist/jsx/FloatingPanel/iconEcho.mjs.map +1 -0
- package/dist/jsx/FloatingPanel/iconEcho.native.js +114 -0
- package/dist/jsx/FloatingPanel/iconEcho.native.js.map +1 -0
- package/dist/jsx/FloatingPanel/index.mjs +169 -16
- package/dist/jsx/FloatingPanel/index.mjs.map +1 -1
- package/dist/jsx/FloatingPanel/index.native.js +77 -8
- package/dist/jsx/FloatingPanel/index.native.js.map +1 -1
- package/dist/jsx/FloatingPanel/paintedBox.mjs +52 -0
- package/dist/jsx/FloatingPanel/paintedBox.mjs.map +1 -0
- package/dist/jsx/FloatingPanel/paintedBox.native.js +85 -0
- package/dist/jsx/FloatingPanel/paintedBox.native.js.map +1 -0
- package/dist/jsx/FloatingPanel/pointAnchor.mjs +22 -3
- package/dist/jsx/FloatingPanel/pointAnchor.mjs.map +1 -1
- package/dist/jsx/FloatingPanel/pointAnchor.native.js +26 -7
- package/dist/jsx/FloatingPanel/pointAnchor.native.js.map +1 -1
- package/dist/jsx/FloatingPanel/useFloatingPanel.mjs +2 -1
- package/dist/jsx/FloatingPanel/useFloatingPanel.mjs.map +1 -1
- package/dist/jsx/FloatingPanel/useFloatingPanel.native.js +3 -1
- package/dist/jsx/FloatingPanel/useFloatingPanel.native.js.map +1 -1
- package/dist/jsx/fields/FileUpload/index.mjs +8 -3
- package/dist/jsx/fields/FileUpload/index.mjs.map +1 -1
- package/dist/jsx/fields/FileUpload/index.native.js +8 -3
- package/dist/jsx/fields/FileUpload/index.native.js.map +1 -1
- package/dist/jsx/index.js +2 -1
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +2 -1
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/index.native.js +2 -0
- package/dist/jsx/index.native.js.map +1 -1
- package/package.json +8 -8
- package/src/Button/Button.accentInk.spec.tsx +39 -8
- package/src/Button/Button.iconButton.spec.tsx +143 -3
- package/src/Button/Button.stories.tsx +55 -38
- package/src/Button/IconButtonGroup.spec.tsx +26 -0
- package/src/Button/IconButtonGroup.tsx +39 -0
- package/src/Button/circleGlyph.ts +6 -0
- package/src/Button/glass.spec.ts +73 -0
- package/src/Button/glass.ts +8 -3
- package/src/Button/iconButtonGroupContext.ts +2 -1
- package/src/Button/index.tsx +68 -17
- package/src/Button/webGlass.ts +42 -0
- package/src/FloatingPanel/FloatingPanel.iconEcho.spec.tsx +297 -0
- package/src/FloatingPanel/FloatingPanel.menuFace.native.spec.tsx +87 -1
- package/src/FloatingPanel/PanelHeader.tsx +26 -0
- package/src/FloatingPanel/echoContext.ts +45 -0
- package/src/FloatingPanel/iconEcho.tsx +118 -0
- package/src/FloatingPanel/index.native.tsx +115 -4
- package/src/FloatingPanel/index.tsx +238 -16
- package/src/FloatingPanel/paintedBox.spec.ts +95 -0
- package/src/FloatingPanel/paintedBox.ts +75 -0
- package/src/FloatingPanel/pointAnchor.spec.ts +47 -0
- package/src/FloatingPanel/pointAnchor.ts +28 -0
- package/src/FloatingPanel/useFloatingPanel.ts +6 -1
- package/src/fields/FileUpload/FileUpload.spec.tsx +8 -0
- package/src/fields/FileUpload/index.tsx +12 -4
- package/src/index.ts +2 -0
- package/types/Button/IconButtonGroup.d.ts.map +1 -1
- package/types/Button/circleGlyph.d.ts +7 -0
- package/types/Button/circleGlyph.d.ts.map +1 -0
- package/types/Button/glass.d.ts +5 -2
- package/types/Button/glass.d.ts.map +1 -1
- package/types/Button/iconButtonGroupContext.d.ts +2 -1
- package/types/Button/iconButtonGroupContext.d.ts.map +1 -1
- package/types/Button/index.d.ts +7 -4
- package/types/Button/index.d.ts.map +1 -1
- package/types/Button/webGlass.d.ts +32 -0
- package/types/Button/webGlass.d.ts.map +1 -0
- package/types/FloatingPanel/PanelHeader.d.ts +9 -0
- package/types/FloatingPanel/PanelHeader.d.ts.map +1 -0
- package/types/FloatingPanel/echoContext.d.ts +24 -0
- package/types/FloatingPanel/echoContext.d.ts.map +1 -1
- package/types/FloatingPanel/iconEcho.d.ts +29 -0
- package/types/FloatingPanel/iconEcho.d.ts.map +1 -0
- package/types/FloatingPanel/index.d.ts +10 -0
- package/types/FloatingPanel/index.d.ts.map +1 -1
- package/types/FloatingPanel/index.native.d.ts +1 -1
- package/types/FloatingPanel/index.native.d.ts.map +1 -1
- package/types/FloatingPanel/paintedBox.d.ts +29 -0
- package/types/FloatingPanel/paintedBox.d.ts.map +1 -0
- package/types/FloatingPanel/pointAnchor.d.ts +10 -1
- package/types/FloatingPanel/pointAnchor.d.ts.map +1 -1
- package/types/FloatingPanel/useFloatingPanel.d.ts.map +1 -1
- package/types/fields/FileUpload/index.d.ts.map +1 -1
- package/types/index.d.ts +2 -0
- package/types/index.d.ts.map +1 -1
|
@@ -31,6 +31,7 @@ var import_react = require("react");
|
|
|
31
31
|
var import_tamagui = require("tamagui");
|
|
32
32
|
var import_glass = require("./glass.cjs");
|
|
33
33
|
var import_mediaPlate = require("./mediaPlate.cjs");
|
|
34
|
+
var import_webGlass = require("./webGlass.cjs");
|
|
34
35
|
var import_iconButtonGroupContext = require("./iconButtonGroupContext.cjs");
|
|
35
36
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
37
|
const ICON_BUTTON_GLASS_MERGE_PX = 22;
|
|
@@ -68,6 +69,37 @@ function IconButtonGroup({
|
|
|
68
69
|
})
|
|
69
70
|
});
|
|
70
71
|
}
|
|
72
|
+
if (bar && import_tamagui.isWeb && (0, import_webGlass.isAppleTouchWeb)()) {
|
|
73
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_iconButtonGroupContext.IconButtonGroupRegistry.Provider, {
|
|
74
|
+
value: register,
|
|
75
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_iconButtonGroupContext.IconButtonGroupContext.Provider, {
|
|
76
|
+
value: "glass",
|
|
77
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.XStack, {
|
|
78
|
+
alignItems: "center",
|
|
79
|
+
"data-mp-icon-button-group": members > 0 ? "glass" : "bar",
|
|
80
|
+
...rest,
|
|
81
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.XStack, {
|
|
82
|
+
alignItems: "center",
|
|
83
|
+
position: "relative",
|
|
84
|
+
zIndex: 0,
|
|
85
|
+
paddingHorizontal: "$2",
|
|
86
|
+
gap: "$1",
|
|
87
|
+
"data-mp-glass-capsule": "",
|
|
88
|
+
children: [members > 0 ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_webGlass.WebGlassFace, {
|
|
89
|
+
style: {
|
|
90
|
+
position: "absolute",
|
|
91
|
+
top: 0,
|
|
92
|
+
right: 0,
|
|
93
|
+
bottom: 0,
|
|
94
|
+
left: 0,
|
|
95
|
+
borderRadius: 1e5
|
|
96
|
+
}
|
|
97
|
+
}) : null, children]
|
|
98
|
+
})
|
|
99
|
+
})
|
|
100
|
+
})
|
|
101
|
+
});
|
|
102
|
+
}
|
|
71
103
|
const GlassView = bar ? (0, import_glass.loadGlassView)() : null;
|
|
72
104
|
const row = /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.XStack, {
|
|
73
105
|
alignItems: "center",
|
|
@@ -34,6 +34,7 @@ var import_react = require("react");
|
|
|
34
34
|
var import_tamagui = require("tamagui");
|
|
35
35
|
var import_glass = require("./glass.native.js");
|
|
36
36
|
var import_mediaPlate = require("./mediaPlate.native.js");
|
|
37
|
+
var import_webGlass = require("./webGlass.native.js");
|
|
37
38
|
var import_iconButtonGroupContext = require("./iconButtonGroupContext.native.js");
|
|
38
39
|
var ICON_BUTTON_GLASS_MERGE_PX = 22;
|
|
39
40
|
function IconButtonGroup(param) {
|
|
@@ -77,6 +78,37 @@ function IconButtonGroup(param) {
|
|
|
77
78
|
})
|
|
78
79
|
});
|
|
79
80
|
}
|
|
81
|
+
if (bar && import_tamagui.isWeb && (0, import_webGlass.isAppleTouchWeb)()) {
|
|
82
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_iconButtonGroupContext.IconButtonGroupRegistry.Provider, {
|
|
83
|
+
value: register,
|
|
84
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_iconButtonGroupContext.IconButtonGroupContext.Provider, {
|
|
85
|
+
value: "glass",
|
|
86
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.XStack, {
|
|
87
|
+
alignItems: "center",
|
|
88
|
+
"data-mp-icon-button-group": members > 0 ? "glass" : "bar",
|
|
89
|
+
...rest,
|
|
90
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.XStack, {
|
|
91
|
+
alignItems: "center",
|
|
92
|
+
position: "relative",
|
|
93
|
+
zIndex: 0,
|
|
94
|
+
paddingHorizontal: "$2",
|
|
95
|
+
gap: "$1",
|
|
96
|
+
"data-mp-glass-capsule": "",
|
|
97
|
+
children: [members > 0 ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_webGlass.WebGlassFace, {
|
|
98
|
+
style: {
|
|
99
|
+
position: "absolute",
|
|
100
|
+
top: 0,
|
|
101
|
+
right: 0,
|
|
102
|
+
bottom: 0,
|
|
103
|
+
left: 0,
|
|
104
|
+
borderRadius: 1e5
|
|
105
|
+
}
|
|
106
|
+
}) : null, children]
|
|
107
|
+
})
|
|
108
|
+
})
|
|
109
|
+
})
|
|
110
|
+
});
|
|
111
|
+
}
|
|
80
112
|
var GlassView = bar ? (0, import_glass.loadGlassView)() : null;
|
|
81
113
|
var row = /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.XStack, {
|
|
82
114
|
alignItems: "center",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","IconButtonGroup_exports","__export","ICON_BUTTON_GLASS_MERGE_PX","IconButtonGroup","module","exports","import_jsx_runtime","require","import_theme","import_react","import_tamagui","import_glass","import_mediaPlate","import_iconButtonGroupContext","param","plate","children","rest","bar","useBarSurface","capsuleHeight","setCapsuleHeight","useState","members","setMembers","register","useCallback","count","jsx","IconButtonGroupContext","Provider","Theme","name","XStack","alignItems","alignSelf","borderRadius","backgroundColor","overflow","radiusClassProps","isWeb","style","MEDIA_PLATE_WEB_STYLE","
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","IconButtonGroup_exports","__export","ICON_BUTTON_GLASS_MERGE_PX","IconButtonGroup","module","exports","import_jsx_runtime","require","import_theme","import_react","import_tamagui","import_glass","import_mediaPlate","import_webGlass","import_iconButtonGroupContext","param","plate","children","rest","bar","useBarSurface","capsuleHeight","setCapsuleHeight","useState","members","setMembers","register","useCallback","count","jsx","IconButtonGroupContext","Provider","Theme","name","XStack","alignItems","alignSelf","borderRadius","backgroundColor","overflow","radiusClassProps","isWeb","style","MEDIA_PLATE_WEB_STYLE","isAppleTouchWeb","IconButtonGroupRegistry","jsxs","position","zIndex","paddingHorizontal","gap","WebGlassFace","top","right","bottom","left","GlassView","loadGlassView","row","View","flexShrink","minWidth","onLayout","event","nativeEvent","layout","height","glassEffectStyle","pointerEvents"],"sources":["../../../src/Button/IconButtonGroup.tsx"],"sourcesContent":[null],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
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 circleGlyph_exports = {};
|
|
24
|
+
__export(circleGlyph_exports, {
|
|
25
|
+
ICON_BUTTON_CIRCLE_GLYPH_RATIO: () => ICON_BUTTON_CIRCLE_GLYPH_RATIO
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(circleGlyph_exports);
|
|
28
|
+
const ICON_BUTTON_CIRCLE_GLYPH_RATIO = 0.58;
|
|
@@ -0,0 +1,31 @@
|
|
|
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 circleGlyph_exports = {};
|
|
26
|
+
__export(circleGlyph_exports, {
|
|
27
|
+
ICON_BUTTON_CIRCLE_GLYPH_RATIO: () => ICON_BUTTON_CIRCLE_GLYPH_RATIO
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(circleGlyph_exports);
|
|
30
|
+
var ICON_BUTTON_CIRCLE_GLYPH_RATIO = 0.58;
|
|
31
|
+
//# sourceMappingURL=circleGlyph.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","circleGlyph_exports","__export","ICON_BUTTON_CIRCLE_GLYPH_RATIO","module","exports"],"sources":["../../../src/Button/circleGlyph.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,mBAAA;AAAAC,QAAA,CAAAD,mBAAA;EAAAE,8BAAA,EAAAA,CAAA,KAAAA;AAAA;AAKOC,MAAM,CAAAC,OAAA,GAAAT,YAAA,CAAAK,mBAAiC","ignoreList":[]}
|
|
@@ -22,12 +22,15 @@ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
|
22
22
|
}), mod);
|
|
23
23
|
var glass_exports = {};
|
|
24
24
|
__export(glass_exports, {
|
|
25
|
+
isAppleTouchWeb: () => import_webGlass2.isAppleTouchWeb,
|
|
25
26
|
loadGlassContainer: () => loadGlassContainer,
|
|
26
27
|
loadGlassView: () => loadGlassView
|
|
27
28
|
});
|
|
28
29
|
module.exports = __toCommonJS(glass_exports);
|
|
30
|
+
var import_webGlass = require("./webGlass.cjs");
|
|
31
|
+
var import_webGlass2 = require("./webGlass.cjs");
|
|
29
32
|
function loadGlassView() {
|
|
30
|
-
return null;
|
|
33
|
+
return (0, import_webGlass.isAppleTouchWeb)() ? import_webGlass.WebGlassFace : null;
|
|
31
34
|
}
|
|
32
35
|
function loadGlassContainer() {
|
|
33
36
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","iconButtonGroupContext_exports","__export","IconButtonGroupContext","IconButtonGroupRegistry","useIconButtonGroupGround","useIconButtonGroupMember","module","exports","import_react","require","useIsomorphicLayoutEffect","window","useEffect","useLayoutEffect","createContext","useContext","iconOnly","register"],"sources":["../../../src/Button/iconButtonGroupContext.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,8BAAA;AAAAC,QAAA,CAAAD,8BAAA;EAAAE,sBAAA,EAAAA,CAAA,KAAAA,sBAAA;EAAAC,uBAAA,EAAAA,CAAA,KAAAA,uBAAA;EAAAC,wBAAA,EAAAA,CAAA,KAAAA,wBAAA;EAAAC,wBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAZ,YAAsE,CAAAK,8BAAA;AAEtE,IAAAQ,YAAM,GAAAC,OAAA,QAA4B;
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","iconButtonGroupContext_exports","__export","IconButtonGroupContext","IconButtonGroupRegistry","useIconButtonGroupGround","useIconButtonGroupMember","module","exports","import_react","require","useIsomorphicLayoutEffect","window","useEffect","useLayoutEffect","createContext","useContext","iconOnly","register"],"sources":["../../../src/Button/iconButtonGroupContext.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,8BAAA;AAAAC,QAAA,CAAAD,8BAAA;EAAAE,sBAAA,EAAAA,CAAA,KAAAA,sBAAA;EAAAC,uBAAA,EAAAA,CAAA,KAAAA,uBAAA;EAAAC,wBAAA,EAAAA,CAAA,KAAAA,wBAAA;EAAAC,wBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAZ,YAAsE,CAAAK,8BAAA;AAEtE,IAAAQ,YAAM,GAAAC,OAAA,QAA4B;AAU3B,IAAAC,yBAAM,UAAyBC,MAAA,mBAAqCH,YAAI,CAAAI,SAAA,GAAAJ,YAAA,CAAAK,eAAA;AAExE,IAAAX,sBAAS,OAAAM,YAAkD,CAAAM,aAAA;AAChE,SAAAV,wBAAOA,CAAA;EACT,WAAAI,YAAA,CAAAO,UAAA,EAAAb,sBAAA;AAOO;AAEA,IAAAC,uBAAS,OAAyBK,YAAyB,CAAAM,aAAA;AAChE,SAAMT,wBAAWA,CAAAW,QAAA;EACjB,IAAAC,QAAA,OAAAT,YAAA,CAAAO,UAAA,EAAAZ,uBAAA;EAAAO,yBACqB,aAAW;IAC9B,OAACM,QAAU,IAAQC,QAAA,GAAAA,QAAA;EACrB,IACFD,QAAA,E","ignoreList":[]}
|
|
@@ -24,7 +24,8 @@ var Button_exports = {};
|
|
|
24
24
|
__export(Button_exports, {
|
|
25
25
|
Button: () => Button,
|
|
26
26
|
ButtonFrame: () => ButtonFrame,
|
|
27
|
-
|
|
27
|
+
GLYPH_BOLD_STROKE_UNITS: () => GLYPH_BOLD_STROKE_UNITS,
|
|
28
|
+
ICON_BUTTON_CIRCLE_GLYPH_RATIO: () => import_circleGlyph.ICON_BUTTON_CIRCLE_GLYPH_RATIO,
|
|
28
29
|
ICON_BUTTON_GLASS_MERGE_PX: () => import_IconButtonGroup.ICON_BUTTON_GLASS_MERGE_PX,
|
|
29
30
|
ICON_BUTTON_GLYPH_PX: () => ICON_BUTTON_GLYPH_PX,
|
|
30
31
|
ICON_BUTTON_NEUTRAL_GLYPH_PX: () => ICON_BUTTON_NEUTRAL_GLYPH_PX,
|
|
@@ -57,6 +58,7 @@ var import_groupContext = require("../shared/groupContext.cjs");
|
|
|
57
58
|
var import_echoContext = require("../FloatingPanel/echoContext.cjs");
|
|
58
59
|
var import_glass = require("./glass.cjs");
|
|
59
60
|
var import_mediaPlate = require("./mediaPlate.cjs");
|
|
61
|
+
var import_circleGlyph = require("./circleGlyph.cjs");
|
|
60
62
|
var import_iconButtonGroupContext = require("./iconButtonGroupContext.cjs");
|
|
61
63
|
var import_IconButtonGroup = require("./IconButtonGroup.cjs");
|
|
62
64
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -231,24 +233,35 @@ function iconButtonGlyphPx(rowLinePx) {
|
|
|
231
233
|
if (rowLinePx === void 0) return ICON_BUTTON_GLYPH_PX;
|
|
232
234
|
return Math.max(ICON_BUTTON_GLYPH_PX, Math.round(rowLinePx / PHOSPHOR_INK_RATIO));
|
|
233
235
|
}
|
|
234
|
-
const ICON_BUTTON_CIRCLE_GLYPH_RATIO = 0.58;
|
|
235
236
|
const INLINE_GLYPH_RATIO = 1.2;
|
|
236
|
-
|
|
237
|
+
const GLYPH_BOLD_STROKE_UNITS = 8;
|
|
238
|
+
function boldStroke(weight, color = "currentColor") {
|
|
239
|
+
return weight === "bold" ? {
|
|
240
|
+
stroke: color,
|
|
241
|
+
strokeWidth: GLYPH_BOLD_STROKE_UNITS,
|
|
242
|
+
strokeLinejoin: "round"
|
|
243
|
+
} : void 0;
|
|
244
|
+
}
|
|
245
|
+
function withGlyphWeight(icon, size, weight, floor = false) {
|
|
237
246
|
if (icon == null || icon === false) return icon;
|
|
238
247
|
if ((0, import_react.isValidElement)(icon)) {
|
|
248
|
+
const resolved = icon.props.weight ?? weight;
|
|
249
|
+
const own = icon.props.size;
|
|
239
250
|
return (0, import_react.cloneElement)(icon, {
|
|
240
|
-
...(
|
|
251
|
+
...(own == null || floor && typeof own === "number" && own < size ? {
|
|
241
252
|
size
|
|
242
253
|
} : void 0),
|
|
243
254
|
...(icon.props.weight == null ? {
|
|
244
255
|
weight
|
|
245
|
-
} : void 0)
|
|
256
|
+
} : void 0),
|
|
257
|
+
...boldStroke(resolved, icon.props.color)
|
|
246
258
|
});
|
|
247
259
|
}
|
|
248
260
|
if (typeof icon === "function" || typeof icon === "object" && "$$typeof" in icon) {
|
|
249
261
|
return (0, import_react.createElement)(icon, {
|
|
250
262
|
size,
|
|
251
|
-
weight
|
|
263
|
+
weight,
|
|
264
|
+
...boldStroke(weight)
|
|
252
265
|
});
|
|
253
266
|
}
|
|
254
267
|
return icon;
|
|
@@ -354,7 +367,7 @@ function Button({
|
|
|
354
367
|
const parentScopeTheme = (0, import_tamagui.useTheme)();
|
|
355
368
|
const pageOutlineColor = parentScopeTheme.outlineColor?.val;
|
|
356
369
|
const hostAccentInk = (0, import_theme3.useAccentOnSurface)();
|
|
357
|
-
const
|
|
370
|
+
const glyphTint = (0, import_theme3.useGlyphTintOnSurface)();
|
|
358
371
|
const grouped = (0, import_groupContext.useControlGrouped)();
|
|
359
372
|
const labelled = verb != null || children != null && children !== false && children !== "";
|
|
360
373
|
const iconOnly = !labelled && Boolean(icon || iconAfter);
|
|
@@ -420,7 +433,7 @@ function Button({
|
|
|
420
433
|
e.currentTarget?.click?.();
|
|
421
434
|
};
|
|
422
435
|
const activeThemeName = theme ?? intent;
|
|
423
|
-
const tier = activeThemeName || chromeless || grouped ? void 0 : barSurface ? "plain" : knobProps.outlined ? void 0 : "tinted";
|
|
436
|
+
const tier = activeThemeName || chromeless || grouped || mediaPlate ? void 0 : barSurface ? "plain" : knobProps.outlined ? void 0 : "tinted";
|
|
424
437
|
const tierPaint = tier ? (0, import_theme3.controlTierPaint)(tier, darkScheme, elevatedGround) : void 0;
|
|
425
438
|
const tierDisabled = tier && disabledState.style !== "dimWhole" ? (0, import_theme3.controlTierDisabled)(tier) : void 0;
|
|
426
439
|
const hostScoped = fragment => Object.fromEntries(Object.entries(fragment).map(([key, value]) => [key, typeof value === "string" && value.startsWith("$") ? parentScopeTheme[value.slice(1)]?.val ?? value : value]));
|
|
@@ -472,7 +485,7 @@ function Button({
|
|
|
472
485
|
const ariaPressedProp = props["aria-pressed"];
|
|
473
486
|
const isSelected = selected ?? (ariaPressedProp === true || ariaPressedProp === "true" ? true : void 0);
|
|
474
487
|
const selectedFill = Boolean(isSelected) && !unavailable && !mediaPlate;
|
|
475
|
-
const barInk = accentInk && chromeless && !selectedFill && !unavailable ?
|
|
488
|
+
const barInk = accentInk && chromeless && !selectedFill && !unavailable ? labelled ? glyphTint.label : glyphTint.glyph : null;
|
|
476
489
|
const inlineGlyph = iconButton && inline === true && !nested;
|
|
477
490
|
const barGlyph = (iconButton || mediaPlate || confirmPlate) && !nested || labelled && chromeless && accentInk === true && edge === "start";
|
|
478
491
|
const labelLine = labelLinePx(knobProps.body.fontFamily);
|
|
@@ -480,12 +493,21 @@ function Button({
|
|
|
480
493
|
const glassGroup = groupGround === "glass";
|
|
481
494
|
const GlassView = iconButton && !inlineGlyph && !nested && accentInk && barSurface && !selectedFill && !glassGroup ? (0, import_glass.loadGlassView)() : null;
|
|
482
495
|
const framedCircle = iconOnly && Boolean(circular) && !nested && !mediaPlate && !confirmPlate;
|
|
496
|
+
const plateInk = unavailable || barInk || outlinedInk ? void 0 : mediaPlate || iconButton && groupGround === "media" ? "$color12" : framedCircle && !activeThemeName ? hostScoped({
|
|
497
|
+
color: "$color12"
|
|
498
|
+
}).color : void 0;
|
|
483
499
|
const framedCirclePx = touch && typeof sizeProp !== "number" ? Math.max(sizeTokenPx(resolvedSize), import_theme3.MIN_PRESS_TARGET) : sizeTokenPx(resolvedSize);
|
|
484
|
-
const iconSize = nested ? Math.min(recipe.iconSize, Math.max(12, Math.round(knobProps.nestedControl.px * 0.45))) : framedCircle ? Math.round(framedCirclePx * ICON_BUTTON_CIRCLE_GLYPH_RATIO) : inlineGlyph ? Math.round(recipe.fontSize * INLINE_GLYPH_RATIO) : barGlyph ? touch ? Math.max(glyphFloor, resolveButtonSizeRecipe("$6", recipeFamily, touch).iconSize) :
|
|
485
|
-
// A
|
|
486
|
-
// up to the
|
|
500
|
+
const iconSize = nested ? Math.min(recipe.iconSize, Math.max(12, Math.round(knobProps.nestedControl.px * 0.45))) : framedCircle ? Math.round(framedCirclePx * import_circleGlyph.ICON_BUTTON_CIRCLE_GLYPH_RATIO) : inlineGlyph ? Math.round(recipe.fontSize * INLINE_GLYPH_RATIO) : barGlyph ? touch ? Math.max(glyphFloor, resolveButtonSizeRecipe("$6", recipeFamily, touch).iconSize) : iconButton ?
|
|
501
|
+
// A bare glyph has no plate to inset from, so it takes its box
|
|
502
|
+
// less a 2pt optical margin, up to the row's glyph: the SHC
|
|
503
|
+
// "+" at $3 reaches the bar's glyph, a $2 copy beside mono
|
|
504
|
+
// text stays in proportion.
|
|
505
|
+
Math.max(recipe.iconSize, Math.min(glyphFloor, recipe.height - 4)) :
|
|
506
|
+
// A pointer toolbar keeps its token box (LC-54); the glyph fills
|
|
507
|
+
// it up to the same floor.
|
|
487
508
|
Math.max(recipe.iconSize, Math.min(glyphFloor, recipe.height - 8)) : recipe.iconSize;
|
|
488
|
-
const
|
|
509
|
+
const barGlyphFloor = barGlyph && !framedCircle && !inlineGlyph && !nested;
|
|
510
|
+
const glyph = barGlyph || inlineGlyph || framedCircle ? withGlyphWeight(icon, iconSize, resolvedGlyphWeight, barGlyphFloor) : icon;
|
|
489
511
|
const labelBoxPx = nested ? knobProps.nestedControl.px : recipe.height;
|
|
490
512
|
const labelMaxFontScale = Math.min((0, import_theme3.maxFontScaleToFit)(labelBoxPx, nested ? (0, import_tamagui.getFontSize)(knobProps.label.fontSize) : recipe.fontSize, import_theme3.dynamicTypeFit.controlLabelFill), labelLine === void 0 ? Number.POSITIVE_INFINITY : (0, import_theme3.maxFontScaleToFit)(labelBoxPx, labelLine, 1));
|
|
491
513
|
const renderLabelText = (label, key) => /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.SizableText, {
|
|
@@ -518,7 +540,7 @@ function Button({
|
|
|
518
540
|
const flattenedChildren = Array.isArray(resolvedChildren) ? import_react.Children.toArray(resolvedChildren) : null;
|
|
519
541
|
const labelContent = isBareTextChild(resolvedChildren) ? renderLabelText(resolvedChildren) : flattenedChildren?.some(isBareTextChild) ? wrapBareTextChildren(flattenedChildren, renderLabelText) : resolvedChildren;
|
|
520
542
|
const hasIcon = icon || iconAfter || loading;
|
|
521
|
-
const nativeIconColor = props.color ?? (unavailable ? disabledText.color : void 0) ?? barInk ?? (textColor ? outlinedOnHost ? hostScoped({
|
|
543
|
+
const nativeIconColor = props.color ?? (unavailable ? disabledText.color : void 0) ?? barInk ?? plateInk ?? (textColor ? outlinedOnHost ? hostScoped({
|
|
522
544
|
color: textColor
|
|
523
545
|
}).color : textColor : outlinedInk) ?? "$color";
|
|
524
546
|
const iconElement = loading ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
@@ -538,7 +560,7 @@ function Button({
|
|
|
538
560
|
color: nativeIconColor
|
|
539
561
|
})
|
|
540
562
|
}) : null;
|
|
541
|
-
const glyphAfter = iconAfter && (barGlyph || inlineGlyph || framedCircle) ? withGlyphWeight(iconAfter, iconSize, resolvedGlyphWeight) : iconAfter;
|
|
563
|
+
const glyphAfter = iconAfter && (barGlyph || inlineGlyph || framedCircle) ? withGlyphWeight(iconAfter, iconSize, resolvedGlyphWeight, barGlyphFloor) : iconAfter;
|
|
542
564
|
const iconAfterElement = glyphAfter ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
543
565
|
flexShrink: 0,
|
|
544
566
|
children: import_tamagui.isWeb ? normalizeButtonIcon(glyphAfter, iconSize) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(NativeButtonIcon, {
|
|
@@ -639,6 +661,10 @@ function Button({
|
|
|
639
661
|
...(GlassView ? {
|
|
640
662
|
borderRadius: 1e5
|
|
641
663
|
} : void 0),
|
|
664
|
+
...(GlassView && import_tamagui.isWeb ? {
|
|
665
|
+
position: "relative",
|
|
666
|
+
zIndex: 0
|
|
667
|
+
} : void 0),
|
|
642
668
|
...(confirmPlate ? {
|
|
643
669
|
borderRadius: 1e5
|
|
644
670
|
} : void 0),
|
|
@@ -663,6 +689,9 @@ function Button({
|
|
|
663
689
|
...(barInk ? {
|
|
664
690
|
color: barInk
|
|
665
691
|
} : void 0),
|
|
692
|
+
...(plateInk ? {
|
|
693
|
+
color: plateInk
|
|
694
|
+
} : void 0),
|
|
666
695
|
...(unavailable ? {
|
|
667
696
|
...disabledSurface,
|
|
668
697
|
...disabledText,
|
|
@@ -26,7 +26,8 @@ var Button_exports = {};
|
|
|
26
26
|
__export(Button_exports, {
|
|
27
27
|
Button: () => Button,
|
|
28
28
|
ButtonFrame: () => ButtonFrame,
|
|
29
|
-
|
|
29
|
+
GLYPH_BOLD_STROKE_UNITS: () => GLYPH_BOLD_STROKE_UNITS,
|
|
30
|
+
ICON_BUTTON_CIRCLE_GLYPH_RATIO: () => import_circleGlyph.ICON_BUTTON_CIRCLE_GLYPH_RATIO,
|
|
30
31
|
ICON_BUTTON_GLASS_MERGE_PX: () => import_IconButtonGroup.ICON_BUTTON_GLASS_MERGE_PX,
|
|
31
32
|
ICON_BUTTON_GLYPH_PX: () => ICON_BUTTON_GLYPH_PX,
|
|
32
33
|
ICON_BUTTON_NEUTRAL_GLYPH_PX: () => ICON_BUTTON_NEUTRAL_GLYPH_PX,
|
|
@@ -60,6 +61,7 @@ var import_groupContext = require("../shared/groupContext.native.js");
|
|
|
60
61
|
var import_echoContext = require("../FloatingPanel/echoContext.native.js");
|
|
61
62
|
var import_glass = require("./glass.native.js");
|
|
62
63
|
var import_mediaPlate = require("./mediaPlate.native.js");
|
|
64
|
+
var import_circleGlyph = require("./circleGlyph.native.js");
|
|
63
65
|
var import_iconButtonGroupContext = require("./iconButtonGroupContext.native.js");
|
|
64
66
|
var import_IconButtonGroup = require("./IconButtonGroup.native.js");
|
|
65
67
|
function _type_of(obj) {
|
|
@@ -266,24 +268,38 @@ function iconButtonGlyphPx(rowLinePx) {
|
|
|
266
268
|
if (rowLinePx === void 0) return ICON_BUTTON_GLYPH_PX;
|
|
267
269
|
return Math.max(ICON_BUTTON_GLYPH_PX, Math.round(rowLinePx / PHOSPHOR_INK_RATIO));
|
|
268
270
|
}
|
|
269
|
-
var ICON_BUTTON_CIRCLE_GLYPH_RATIO = 0.58;
|
|
270
271
|
var INLINE_GLYPH_RATIO = 1.2;
|
|
272
|
+
var GLYPH_BOLD_STROKE_UNITS = 8;
|
|
273
|
+
function boldStroke(weight) {
|
|
274
|
+
var color = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "currentColor";
|
|
275
|
+
return weight === "bold" ? {
|
|
276
|
+
stroke: color,
|
|
277
|
+
strokeWidth: GLYPH_BOLD_STROKE_UNITS,
|
|
278
|
+
strokeLinejoin: "round"
|
|
279
|
+
} : void 0;
|
|
280
|
+
}
|
|
271
281
|
function withGlyphWeight(icon, size, weight) {
|
|
282
|
+
var floor = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
|
|
272
283
|
if (icon == null || icon === false) return icon;
|
|
273
284
|
if (/* @__PURE__ */(0, import_react.isValidElement)(icon)) {
|
|
285
|
+
var _icon_props_weight;
|
|
286
|
+
var resolved = (_icon_props_weight = icon.props.weight) !== null && _icon_props_weight !== void 0 ? _icon_props_weight : weight;
|
|
287
|
+
var own = icon.props.size;
|
|
274
288
|
return /* @__PURE__ */(0, import_react.cloneElement)(icon, {
|
|
275
|
-
...(
|
|
289
|
+
...(own == null || floor && typeof own === "number" && own < size ? {
|
|
276
290
|
size
|
|
277
291
|
} : void 0),
|
|
278
292
|
...(icon.props.weight == null ? {
|
|
279
293
|
weight
|
|
280
|
-
} : void 0)
|
|
294
|
+
} : void 0),
|
|
295
|
+
...boldStroke(resolved, icon.props.color)
|
|
281
296
|
});
|
|
282
297
|
}
|
|
283
298
|
if (typeof icon === "function" || (typeof icon === "undefined" ? "undefined" : _type_of(icon)) === "object" && "$$typeof" in icon) {
|
|
284
299
|
return /* @__PURE__ */(0, import_react.createElement)(icon, {
|
|
285
300
|
size,
|
|
286
|
-
weight
|
|
301
|
+
weight,
|
|
302
|
+
...boldStroke(weight)
|
|
287
303
|
});
|
|
288
304
|
}
|
|
289
305
|
return icon;
|
|
@@ -327,7 +343,7 @@ function Button(param) {
|
|
|
327
343
|
paddingHorizontal: paddingHorizontalProp,
|
|
328
344
|
...props
|
|
329
345
|
} = param;
|
|
330
|
-
var _ref, _ref1, _ref2, _ref3, _props_color, _props_id;
|
|
346
|
+
var _ref, _ref1, _ref2, _ref3, _ref4, _props_color, _props_id;
|
|
331
347
|
var _parentScopeTheme_outlineColor;
|
|
332
348
|
var {
|
|
333
349
|
resolvedForm: formFromHook
|
|
@@ -395,7 +411,7 @@ function Button(param) {
|
|
|
395
411
|
var parentScopeTheme = (0, import_tamagui.useTheme)();
|
|
396
412
|
var pageOutlineColor = (_parentScopeTheme_outlineColor = parentScopeTheme.outlineColor) === null || _parentScopeTheme_outlineColor === void 0 ? void 0 : _parentScopeTheme_outlineColor.val;
|
|
397
413
|
var hostAccentInk = (0, import_theme3.useAccentOnSurface)();
|
|
398
|
-
var
|
|
414
|
+
var glyphTint = (0, import_theme3.useGlyphTintOnSurface)();
|
|
399
415
|
var grouped = (0, import_groupContext.useControlGrouped)();
|
|
400
416
|
var labelled = verb != null || children != null && children !== false && children !== "";
|
|
401
417
|
var iconOnly = !labelled && Boolean(icon || iconAfter);
|
|
@@ -462,15 +478,15 @@ function Button(param) {
|
|
|
462
478
|
(_e_currentTarget = e.currentTarget) === null || _e_currentTarget === void 0 ? void 0 : (_e_currentTarget_click = _e_currentTarget.click) === null || _e_currentTarget_click === void 0 ? void 0 : _e_currentTarget_click.call(_e_currentTarget);
|
|
463
479
|
};
|
|
464
480
|
var activeThemeName = theme !== null && theme !== void 0 ? theme : intent;
|
|
465
|
-
var tier = activeThemeName || chromeless || grouped ? void 0 : barSurface ? "plain" : knobProps.outlined ? void 0 : "tinted";
|
|
481
|
+
var tier = activeThemeName || chromeless || grouped || mediaPlate ? void 0 : barSurface ? "plain" : knobProps.outlined ? void 0 : "tinted";
|
|
466
482
|
var tierPaint = tier ? (0, import_theme3.controlTierPaint)(tier, darkScheme, elevatedGround) : void 0;
|
|
467
483
|
var tierDisabled = tier && disabledState.style !== "dimWhole" ? (0, import_theme3.controlTierDisabled)(tier) : void 0;
|
|
468
484
|
var hostScoped = function hostScoped2(fragment) {
|
|
469
485
|
return Object.fromEntries(Object.entries(fragment).map(function (param2) {
|
|
470
486
|
var [key, value] = param2;
|
|
471
|
-
var
|
|
487
|
+
var _ref5;
|
|
472
488
|
var _parentScopeTheme_value_slice;
|
|
473
|
-
return [key, typeof value === "string" && value.startsWith("$") ? (
|
|
489
|
+
return [key, typeof value === "string" && value.startsWith("$") ? (_ref5 = (_parentScopeTheme_value_slice = parentScopeTheme[value.slice(1)]) === null || _parentScopeTheme_value_slice === void 0 ? void 0 : _parentScopeTheme_value_slice.val) !== null && _ref5 !== void 0 ? _ref5 : value : value];
|
|
474
490
|
}));
|
|
475
491
|
};
|
|
476
492
|
var washOnHost = Boolean(unavailable && activeThemeName && import_theme3.solidPaletteThemes.has(activeThemeName));
|
|
@@ -525,7 +541,7 @@ function Button(param) {
|
|
|
525
541
|
var ariaPressedProp = props["aria-pressed"];
|
|
526
542
|
var isSelected = selected !== null && selected !== void 0 ? selected : ariaPressedProp === true || ariaPressedProp === "true" ? true : void 0;
|
|
527
543
|
var selectedFill = Boolean(isSelected) && !unavailable && !mediaPlate;
|
|
528
|
-
var barInk = accentInk && chromeless && !selectedFill && !unavailable ?
|
|
544
|
+
var barInk = accentInk && chromeless && !selectedFill && !unavailable ? labelled ? glyphTint.label : glyphTint.glyph : null;
|
|
529
545
|
var inlineGlyph = iconButton && inline === true && !nested;
|
|
530
546
|
var barGlyph = (iconButton || mediaPlate || confirmPlate) && !nested || labelled && chromeless && accentInk === true && edge === "start";
|
|
531
547
|
var labelLine = labelLinePx(knobProps.body.fontFamily);
|
|
@@ -533,12 +549,21 @@ function Button(param) {
|
|
|
533
549
|
var glassGroup = groupGround === "glass";
|
|
534
550
|
var GlassView = iconButton && !inlineGlyph && !nested && accentInk && barSurface && !selectedFill && !glassGroup ? (0, import_glass.loadGlassView)() : null;
|
|
535
551
|
var framedCircle = iconOnly && Boolean(circular) && !nested && !mediaPlate && !confirmPlate;
|
|
552
|
+
var plateInk = unavailable || barInk || outlinedInk ? void 0 : mediaPlate || iconButton && groupGround === "media" ? "$color12" : framedCircle && !activeThemeName ? hostScoped({
|
|
553
|
+
color: "$color12"
|
|
554
|
+
}).color : void 0;
|
|
536
555
|
var framedCirclePx = touch && typeof sizeProp !== "number" ? Math.max(sizeTokenPx(resolvedSize), import_theme3.MIN_PRESS_TARGET) : sizeTokenPx(resolvedSize);
|
|
537
|
-
var iconSize = nested ? Math.min(recipe.iconSize, Math.max(12, Math.round(knobProps.nestedControl.px * 0.45))) : framedCircle ? Math.round(framedCirclePx * ICON_BUTTON_CIRCLE_GLYPH_RATIO) : inlineGlyph ? Math.round(recipe.fontSize * INLINE_GLYPH_RATIO) : barGlyph ? touch ? Math.max(glyphFloor, resolveButtonSizeRecipe("$6", recipeFamily, touch).iconSize) :
|
|
538
|
-
// A
|
|
539
|
-
// up to the
|
|
556
|
+
var iconSize = nested ? Math.min(recipe.iconSize, Math.max(12, Math.round(knobProps.nestedControl.px * 0.45))) : framedCircle ? Math.round(framedCirclePx * import_circleGlyph.ICON_BUTTON_CIRCLE_GLYPH_RATIO) : inlineGlyph ? Math.round(recipe.fontSize * INLINE_GLYPH_RATIO) : barGlyph ? touch ? Math.max(glyphFloor, resolveButtonSizeRecipe("$6", recipeFamily, touch).iconSize) : iconButton ?
|
|
557
|
+
// A bare glyph has no plate to inset from, so it takes its box
|
|
558
|
+
// less a 2pt optical margin, up to the row's glyph: the SHC
|
|
559
|
+
// "+" at $3 reaches the bar's glyph, a $2 copy beside mono
|
|
560
|
+
// text stays in proportion.
|
|
561
|
+
Math.max(recipe.iconSize, Math.min(glyphFloor, recipe.height - 4)) :
|
|
562
|
+
// A pointer toolbar keeps its token box (LC-54); the glyph fills
|
|
563
|
+
// it up to the same floor.
|
|
540
564
|
Math.max(recipe.iconSize, Math.min(glyphFloor, recipe.height - 8)) : recipe.iconSize;
|
|
541
|
-
var
|
|
565
|
+
var barGlyphFloor = barGlyph && !framedCircle && !inlineGlyph && !nested;
|
|
566
|
+
var glyph = barGlyph || inlineGlyph || framedCircle ? withGlyphWeight(icon, iconSize, resolvedGlyphWeight, barGlyphFloor) : icon;
|
|
542
567
|
var labelBoxPx = nested ? knobProps.nestedControl.px : recipe.height;
|
|
543
568
|
var labelMaxFontScale = Math.min((0, import_theme3.maxFontScaleToFit)(labelBoxPx, nested ? (0, import_tamagui.getFontSize)(knobProps.label.fontSize) : recipe.fontSize, import_theme3.dynamicTypeFit.controlLabelFill), labelLine === void 0 ? Number.POSITIVE_INFINITY : (0, import_theme3.maxFontScaleToFit)(labelBoxPx, labelLine, 1));
|
|
544
569
|
var renderLabelText = function renderLabelText2(label, key) {
|
|
@@ -579,7 +604,7 @@ function Button(param) {
|
|
|
579
604
|
var flattenedChildren = Array.isArray(resolvedChildren) ? import_react.Children.toArray(resolvedChildren) : null;
|
|
580
605
|
var labelContent = isBareTextChild(resolvedChildren) ? renderLabelText(resolvedChildren) : (flattenedChildren === null || flattenedChildren === void 0 ? void 0 : flattenedChildren.some(isBareTextChild)) ? wrapBareTextChildren(flattenedChildren, renderLabelText) : resolvedChildren;
|
|
581
606
|
var hasIcon = icon || iconAfter || loading;
|
|
582
|
-
var nativeIconColor = (_ref1 = (_ref2 = (_ref3 = (_props_color = props.color) !== null && _props_color !== void 0 ? _props_color : unavailable ? disabledText.color : void 0) !== null && _ref3 !== void 0 ? _ref3 :
|
|
607
|
+
var nativeIconColor = (_ref1 = (_ref2 = (_ref3 = (_ref4 = (_props_color = props.color) !== null && _props_color !== void 0 ? _props_color : unavailable ? disabledText.color : void 0) !== null && _ref4 !== void 0 ? _ref4 : barInk) !== null && _ref3 !== void 0 ? _ref3 : plateInk) !== null && _ref2 !== void 0 ? _ref2 : textColor ? outlinedOnHost ? hostScoped({
|
|
583
608
|
color: textColor
|
|
584
609
|
}).color : textColor : outlinedInk) !== null && _ref1 !== void 0 ? _ref1 : "$color";
|
|
585
610
|
var iconElement = loading ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
@@ -599,7 +624,7 @@ function Button(param) {
|
|
|
599
624
|
color: nativeIconColor
|
|
600
625
|
})
|
|
601
626
|
}) : null;
|
|
602
|
-
var glyphAfter = iconAfter && (barGlyph || inlineGlyph || framedCircle) ? withGlyphWeight(iconAfter, iconSize, resolvedGlyphWeight) : iconAfter;
|
|
627
|
+
var glyphAfter = iconAfter && (barGlyph || inlineGlyph || framedCircle) ? withGlyphWeight(iconAfter, iconSize, resolvedGlyphWeight, barGlyphFloor) : iconAfter;
|
|
603
628
|
var iconAfterElement = glyphAfter ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
604
629
|
flexShrink: 0,
|
|
605
630
|
children: import_tamagui.isWeb ? normalizeButtonIcon(glyphAfter, iconSize) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(NativeButtonIcon, {
|
|
@@ -712,6 +737,13 @@ function Button(param) {
|
|
|
712
737
|
...(GlassView ? {
|
|
713
738
|
borderRadius: 1e5
|
|
714
739
|
} : void 0),
|
|
740
|
+
// On the web the absolute glass circle needs its button as the
|
|
741
|
+
// containing block and stacking context, or it fills the page and
|
|
742
|
+
// paints over the glyph.
|
|
743
|
+
...(GlassView && import_tamagui.isWeb ? {
|
|
744
|
+
position: "relative",
|
|
745
|
+
zIndex: 0
|
|
746
|
+
} : void 0),
|
|
715
747
|
...(confirmPlate ? {
|
|
716
748
|
borderRadius: 1e5
|
|
717
749
|
} : void 0),
|
|
@@ -739,6 +771,9 @@ function Button(param) {
|
|
|
739
771
|
...(barInk ? {
|
|
740
772
|
color: barInk
|
|
741
773
|
} : void 0),
|
|
774
|
+
...(plateInk ? {
|
|
775
|
+
color: plateInk
|
|
776
|
+
} : void 0),
|
|
742
777
|
// LC-40 DISABLED-VISIBLE: keepLabel washes the chrome (muted fill/
|
|
743
778
|
// border) while label/glyphs re-anchor to the lowest AA text tier
|
|
744
779
|
// (`color` inherits into currentColor icons); dimWhole dims the
|