@tamagui/label 3.0.0-beta.924.1 → 3.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.
@@ -36,7 +36,6 @@ var import_constants = require("@tamagui/constants");
36
36
  var import_create_context = require("@tamagui/create-context");
37
37
  var import_focusable = require("@tamagui/focusable");
38
38
  var import_get_font_sized = require("@tamagui/get-font-sized");
39
- var import_size = require("@tamagui/size");
40
39
  var import_text = require("@tamagui/text");
41
40
  var import_web = require("@tamagui/web");
42
41
  var React = __toESM(require("react"), 1);
@@ -46,20 +45,6 @@ const [LabelProvider, useLabelContextImpl] = (0, import_create_context.createCon
46
45
  id: void 0,
47
46
  controlRef: { current: null }
48
47
  });
49
- const labelSizeVariant = import_web.styled.dynamic((val, env) => {
50
- const fontStyle = (0, import_get_font_sized.getFontSized)(val, env);
51
- const sizeKey = (0, import_size.resolveSizeToken)(val, "size");
52
- return {
53
- color: fontStyle?.color,
54
- fontFamily: fontStyle?.fontFamily,
55
- fontSize: fontStyle?.fontSize,
56
- fontStyle: fontStyle?.fontStyle,
57
- fontWeight: fontStyle?.fontWeight,
58
- letterSpacing: fontStyle?.letterSpacing,
59
- lineHeight: typeof sizeKey === "number" ? sizeKey : env.tokens.size[sizeKey],
60
- textTransform: fontStyle?.textTransform
61
- };
62
- });
63
48
  const LabelFrame = (0, import_web.styled)(import_text.SizableText, {
64
49
  displayName: "Label",
65
50
  render: "label",
@@ -69,7 +54,7 @@ const LabelFrame = (0, import_web.styled)(import_text.SizableText, {
69
54
  alignItems: "center",
70
55
  userSelect: "none",
71
56
  cursor: "default",
72
- variants: { size: labelSizeVariant }
57
+ variants: { size: import_get_font_sized.getFontSized }
73
58
  });
74
59
  const Label = (0, import_web.createStyledHOC)(LabelFrame, function Label2(props, forwardedRef) {
75
60
  const { htmlFor, id: idProp, ...labelProps } = props;
@@ -39,7 +39,6 @@ var import_constants = require("@tamagui/constants");
39
39
  var import_create_context = require("@tamagui/create-context");
40
40
  var import_focusable = require("@tamagui/focusable");
41
41
  var import_get_font_sized = require("@tamagui/get-font-sized");
42
- var import_size = require("@tamagui/size");
43
42
  var import_text = require("@tamagui/text");
44
43
  var import_web = require("@tamagui/web");
45
44
  var React = __toESM(require("react"), 1);
@@ -48,20 +47,6 @@ var [LabelProvider, useLabelContextImpl] = (0, import_create_context.createConte
48
47
  id: void 0,
49
48
  controlRef: { current: null }
50
49
  });
51
- var labelSizeVariant = import_web.styled.dynamic(function(val, env) {
52
- var fontStyle = (0, import_get_font_sized.getFontSized)(val, env);
53
- var sizeKey = (0, import_size.resolveSizeToken)(val, "size");
54
- return {
55
- color: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.color,
56
- fontFamily: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontFamily,
57
- fontSize: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontSize,
58
- fontStyle: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontStyle,
59
- fontWeight: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontWeight,
60
- letterSpacing: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.letterSpacing,
61
- lineHeight: typeof sizeKey === "number" ? sizeKey : env.tokens.size[sizeKey],
62
- textTransform: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.textTransform
63
- };
64
- });
65
50
  var LabelFrame = (0, import_web.styled)(import_text.SizableText, {
66
51
  displayName: "Label",
67
52
  render: "label",
@@ -71,7 +56,7 @@ var LabelFrame = (0, import_web.styled)(import_text.SizableText, {
71
56
  alignItems: "center",
72
57
  userSelect: "none",
73
58
  cursor: "default",
74
- variants: { size: labelSizeVariant }
59
+ variants: { size: import_get_font_sized.getFontSized }
75
60
  });
76
61
  var Label = (0, import_web.createStyledHOC)(LabelFrame, function Label2(props, forwardedRef) {
77
62
  var { htmlFor, id: idProp, ...labelProps } = props;
@@ -39,7 +39,6 @@ var import_constants = require("@tamagui/constants");
39
39
  var import_create_context = require("@tamagui/create-context");
40
40
  var import_focusable = require("@tamagui/focusable");
41
41
  var import_get_font_sized = require("@tamagui/get-font-sized");
42
- var import_size = require("@tamagui/size");
43
42
  var import_text = require("@tamagui/text");
44
43
  var import_web = require("@tamagui/web");
45
44
  var React = __toESM(require("react"), 1);
@@ -48,20 +47,6 @@ var [LabelProvider, useLabelContextImpl] = (0, import_create_context.createConte
48
47
  id: void 0,
49
48
  controlRef: { current: null }
50
49
  });
51
- var labelSizeVariant = import_web.styled.dynamic(function(val, env) {
52
- var fontStyle = (0, import_get_font_sized.getFontSized)(val, env);
53
- var sizeKey = (0, import_size.resolveSizeToken)(val, "size");
54
- return {
55
- color: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.color,
56
- fontFamily: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontFamily,
57
- fontSize: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontSize,
58
- fontStyle: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontStyle,
59
- fontWeight: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontWeight,
60
- letterSpacing: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.letterSpacing,
61
- lineHeight: typeof sizeKey === "number" ? sizeKey : env.tokens.size[sizeKey],
62
- textTransform: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.textTransform
63
- };
64
- });
65
50
  var LabelFrame = (0, import_web.styled)(import_text.SizableText, {
66
51
  displayName: "Label",
67
52
  render: "label",
@@ -71,7 +56,7 @@ var LabelFrame = (0, import_web.styled)(import_text.SizableText, {
71
56
  alignItems: "center",
72
57
  userSelect: "none",
73
58
  cursor: "default",
74
- variants: { size: labelSizeVariant }
59
+ variants: { size: import_get_font_sized.getFontSized }
75
60
  });
76
61
  var Label = (0, import_web.createStyledHOC)(LabelFrame, function Label2(props, forwardedRef) {
77
62
  var { htmlFor, id: idProp, ...labelProps } = props;
@@ -1 +1 @@
1
- {"version":3,"file":"Label.native.js","names":[],"sources":["cjs/Label.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Label_exports = {};\n__export(Label_exports, {\n Label: () => Label,\n LabelFrame: () => LabelFrame,\n useLabelContext: () => useLabelContext\n});\nmodule.exports = __toCommonJS(Label_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_create_context = require(\"@tamagui/create-context\");\nvar import_focusable = require(\"@tamagui/focusable\");\nvar import_get_font_sized = require(\"@tamagui/get-font-sized\");\nvar import_size = require(\"@tamagui/size\");\nvar import_text = require(\"@tamagui/text\");\nvar import_web = require(\"@tamagui/web\");\nvar React = __toESM(require(\"react\"), 1);\nvar NAME = \"Label\";\nvar [LabelProvider, useLabelContextImpl] = (0, import_create_context.createContext)(NAME, {\n id: void 0,\n controlRef: {\n current: null\n }\n});\nvar labelSizeVariant = import_web.styled.dynamic(function(val, env) {\n var fontStyle = (0, import_get_font_sized.getFontSized)(val, env);\n var sizeKey = (0, import_size.resolveSizeToken)(val, \"size\");\n return {\n color: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.color,\n fontFamily: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontFamily,\n fontSize: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontSize,\n fontStyle: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontStyle,\n fontWeight: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontWeight,\n letterSpacing: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.letterSpacing,\n lineHeight: typeof sizeKey === \"number\" ? sizeKey : env.tokens.size[sizeKey],\n textTransform: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.textTransform\n };\n});\nvar LabelFrame = (0, import_web.styled)(import_text.SizableText, {\n displayName: \"Label\",\n render: \"label\",\n size: true,\n backgroundColor: \"transparent\",\n display: \"flex\",\n alignItems: \"center\",\n userSelect: \"none\",\n cursor: \"default\",\n variants: {\n size: labelSizeVariant\n }\n});\nvar Label = (0, import_web.createStyledHOC)(LabelFrame, function Label2(props, forwardedRef) {\n var { htmlFor, id: idProp, ...labelProps } = props;\n var controlRef = React.useRef(null);\n var ref = React.useRef(null);\n var composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref);\n var backupId = React.useId();\n var id = idProp !== null && idProp !== void 0 ? idProp : backupId;\n if (import_constants.isWeb) {\n (0, import_constants.useIsomorphicLayoutEffect)(function() {\n if (htmlFor) {\n var element = document.getElementById(htmlFor);\n var label = ref.current;\n if (label && element) {\n var getAriaLabel = function() {\n return element.getAttribute(\"aria-labelledby\");\n };\n var ariaLabelledBy = [\n id,\n getAriaLabel()\n ].filter(Boolean).join(\" \");\n element.setAttribute(\"aria-labelledby\", ariaLabelledBy);\n controlRef.current = element;\n return function() {\n var _getAriaLabel;\n if (!id) return;\n var ariaLabelledBy2 = (_getAriaLabel = getAriaLabel()) === null || _getAriaLabel === void 0 ? void 0 : _getAriaLabel.replace(id, \"\");\n if (ariaLabelledBy2 === \"\") {\n element.removeAttribute(\"aria-labelledby\");\n } else if (ariaLabelledBy2) {\n element.setAttribute(\"aria-labelledby\", ariaLabelledBy2);\n }\n };\n }\n }\n }, [\n id,\n htmlFor\n ]);\n }\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LabelProvider, {\n id,\n controlRef,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LabelFrame, {\n id,\n // @ts-ignore\n htmlFor,\n ...labelProps,\n ref: composedRefs,\n onMouseDown: function(event) {\n var _props_onMouseDown;\n (_props_onMouseDown = props.onMouseDown) === null || _props_onMouseDown === void 0 ? void 0 : _props_onMouseDown.call(props, event);\n if (!event.defaultPrevented && event.detail > 1) {\n event.preventDefault();\n }\n },\n onPress: function(event) {\n var _props_onPress;\n (_props_onPress = props.onPress) === null || _props_onPress === void 0 ? void 0 : _props_onPress.call(props, event);\n if (import_constants.isWeb) {\n if (htmlFor || !controlRef.current || event.defaultPrevented) return;\n var isClickingControl = controlRef.current.contains(event.target);\n var isUserClick = event.isTrusted === true;\n if (!isClickingControl && isUserClick) {\n controlRef.current.click();\n controlRef.current.focus();\n }\n } else {\n if (props.htmlFor) {\n (0, import_focusable.focusFocusable)(props.htmlFor);\n }\n }\n }\n })\n });\n});\nvar useLabelContext = function(element) {\n var context = useLabelContextImpl(\"LabelConsumer\");\n var { controlRef } = context;\n React.useEffect(function() {\n if (element) controlRef.current = element;\n }, [\n element,\n controlRef\n ]);\n return context.id;\n};\n//# sourceMappingURL=Label.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO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M,oBAAoB,MAAM,SAAS,GAAG;KAC/C,MAAM,eAAe;IACvB;GACF;GACA,SAAS,SAAS,OAAO;IACvB,IAAI;IACJ,CAAC,iBAAiB,MAAM,aAAa,QAAQ,mBAAmB,KAAK,IAAI,KAAK,IAAI,eAAe,KAAK,OAAO,KAAK;IAClH,IAAI,iBAAiB,OAAO;KAC1B,IAAI,WAAW,CAAC,WAAW,WAAW,MAAM,kBAAkB;KAC9D,IAAI,oBAAoB,WAAW,QAAQ,SAAS,MAAM,MAAM;KAChE,IAAI,cAAc,MAAM,cAAc;KACtC,IAAI,CAAC,qBAAqB,aAAa;MACrC,WAAW,QAAQ,MAAM;MACzB,WAAW,QAAQ,MAAM;KAC3B;IACF,OAAO;KACL,IAAI,MAAM,SAAS;MACjB,CAAC,GAAG,iBAAiB,eAAc,CAAE,MAAM,OAAO;KACpD;IACF;GACF;EACF,CAAC;CACH,CAAC;AACH,CAAC;AACD,IAAI,kBAAkB,SAAS,SAAS;CACtC,IAAI,UAAU,oBAAoB,eAAe;CACjD,IAAI,EAAE,eAAe;CACrB,MAAM,UAAU,WAAW;EACzB,IAAI,SAAS,WAAW,UAAU;CACpC,GAAG,CACD,SACA,UACF,CAAC;CACD,OAAO,QAAQ;AACjB"}
1
+ {"version":3,"file":"Label.native.js","names":[],"sources":["cjs/Label.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Label_exports = {};\n__export(Label_exports, {\n Label: () => Label,\n LabelFrame: () => LabelFrame,\n useLabelContext: () => useLabelContext\n});\nmodule.exports = __toCommonJS(Label_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_create_context = require(\"@tamagui/create-context\");\nvar import_focusable = require(\"@tamagui/focusable\");\nvar import_get_font_sized = require(\"@tamagui/get-font-sized\");\nvar import_text = require(\"@tamagui/text\");\nvar import_web = require(\"@tamagui/web\");\nvar React = __toESM(require(\"react\"), 1);\nvar NAME = \"Label\";\nvar [LabelProvider, useLabelContextImpl] = (0, import_create_context.createContext)(NAME, {\n id: void 0,\n controlRef: {\n current: null\n }\n});\nvar LabelFrame = (0, import_web.styled)(import_text.SizableText, {\n displayName: \"Label\",\n render: \"label\",\n size: true,\n backgroundColor: \"transparent\",\n display: \"flex\",\n alignItems: \"center\",\n userSelect: \"none\",\n cursor: \"default\",\n variants: {\n size: import_get_font_sized.getFontSized\n }\n});\nvar Label = (0, import_web.createStyledHOC)(LabelFrame, function Label2(props, forwardedRef) {\n var { htmlFor, id: idProp, ...labelProps } = props;\n var controlRef = React.useRef(null);\n var ref = React.useRef(null);\n var composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref);\n var backupId = React.useId();\n var id = idProp !== null && idProp !== void 0 ? idProp : backupId;\n if (import_constants.isWeb) {\n (0, import_constants.useIsomorphicLayoutEffect)(function() {\n if (htmlFor) {\n var element = document.getElementById(htmlFor);\n var label = ref.current;\n if (label && element) {\n var getAriaLabel = function() {\n return element.getAttribute(\"aria-labelledby\");\n };\n var ariaLabelledBy = [\n id,\n getAriaLabel()\n ].filter(Boolean).join(\" \");\n element.setAttribute(\"aria-labelledby\", ariaLabelledBy);\n controlRef.current = element;\n return function() {\n var _getAriaLabel;\n if (!id) return;\n var ariaLabelledBy2 = (_getAriaLabel = getAriaLabel()) === null || _getAriaLabel === void 0 ? void 0 : _getAriaLabel.replace(id, \"\");\n if (ariaLabelledBy2 === \"\") {\n element.removeAttribute(\"aria-labelledby\");\n } else if (ariaLabelledBy2) {\n element.setAttribute(\"aria-labelledby\", ariaLabelledBy2);\n }\n };\n }\n }\n }, [\n id,\n htmlFor\n ]);\n }\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LabelProvider, {\n id,\n controlRef,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LabelFrame, {\n id,\n // @ts-ignore\n htmlFor,\n ...labelProps,\n ref: composedRefs,\n onMouseDown: function(event) {\n var _props_onMouseDown;\n (_props_onMouseDown = props.onMouseDown) === null || _props_onMouseDown === void 0 ? void 0 : _props_onMouseDown.call(props, event);\n if (!event.defaultPrevented && event.detail > 1) {\n event.preventDefault();\n }\n },\n onPress: function(event) {\n var _props_onPress;\n (_props_onPress = props.onPress) === null || _props_onPress === void 0 ? void 0 : _props_onPress.call(props, event);\n if (import_constants.isWeb) {\n if (htmlFor || !controlRef.current || event.defaultPrevented) return;\n var isClickingControl = controlRef.current.contains(event.target);\n var isUserClick = event.isTrusted === true;\n if (!isClickingControl && isUserClick) {\n controlRef.current.click();\n controlRef.current.focus();\n }\n } else {\n if (props.htmlFor) {\n (0, import_focusable.focusFocusable)(props.htmlFor);\n }\n }\n }\n })\n });\n});\nvar useLabelContext = function(element) {\n var context = useLabelContextImpl(\"LabelConsumer\");\n var { controlRef } = context;\n React.useEffect(function() {\n if (element) controlRef.current = element;\n }, [\n element,\n controlRef\n ]);\n return context.id;\n};\n//# sourceMappingURL=Label.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,SAAS,eAAe;CACtB,aAAa;CACb,kBAAkB;CAClB,uBAAuB;AACzB,CAAC;AACD,OAAO,UAAU,aAAa,aAAa;AAC3C,IAAI,qBAAqB,QAAQ,mBAAmB;AACpD,IAAI,sBAAs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MACjB,CAAC,GAAG,iBAAiB,eAAc,CAAE,MAAM,OAAO;KACpD;IACF;GACF;EACF,CAAC;CACH,CAAC;AACH,CAAC;AACD,IAAI,kBAAkB,SAAS,SAAS;CACtC,IAAI,UAAU,oBAAoB,eAAe;CACjD,IAAI,EAAE,eAAe;CACrB,MAAM,UAAU,WAAW;EACzB,IAAI,SAAS,WAAW,UAAU;CACpC,GAAG,CACD,SACA,UACF,CAAC;CACD,OAAO,QAAQ;AACjB"}
@@ -3,7 +3,6 @@ import { isWeb, useIsomorphicLayoutEffect } from "@tamagui/constants";
3
3
  import { createContext } from "@tamagui/create-context";
4
4
  import { focusFocusable } from "@tamagui/focusable";
5
5
  import { getFontSized } from "@tamagui/get-font-sized";
6
- import { resolveSizeToken } from "@tamagui/size";
7
6
  import { SizableText } from "@tamagui/text";
8
7
  import { createStyledHOC, styled } from "@tamagui/web";
9
8
  import * as React from "react";
@@ -14,20 +13,6 @@ const [LabelProvider, useLabelContextImpl] = createContext(NAME, {
14
13
  id: void 0,
15
14
  controlRef: { current: null }
16
15
  });
17
- const labelSizeVariant = styled.dynamic((val, env) => {
18
- const fontStyle = getFontSized(val, env);
19
- const sizeKey = resolveSizeToken(val, "size");
20
- return {
21
- color: fontStyle?.color,
22
- fontFamily: fontStyle?.fontFamily,
23
- fontSize: fontStyle?.fontSize,
24
- fontStyle: fontStyle?.fontStyle,
25
- fontWeight: fontStyle?.fontWeight,
26
- letterSpacing: fontStyle?.letterSpacing,
27
- lineHeight: typeof sizeKey === "number" ? sizeKey : env.tokens.size[sizeKey],
28
- textTransform: fontStyle?.textTransform
29
- };
30
- });
31
16
  const LabelFrame = styled(SizableText, {
32
17
  displayName: "Label",
33
18
  render: "label",
@@ -37,7 +22,7 @@ const LabelFrame = styled(SizableText, {
37
22
  alignItems: "center",
38
23
  userSelect: "none",
39
24
  cursor: "default",
40
- variants: { size: labelSizeVariant }
25
+ variants: { size: getFontSized }
41
26
  });
42
27
  const Label = createStyledHOC(LabelFrame, function Label2(props, forwardedRef) {
43
28
  const { htmlFor, id: idProp, ...labelProps } = props;
@@ -1 +1 @@
1
- {"version":3,"file":"Label.js","names":[],"sources":["esm/Label.js"],"sourcesContent":["import { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { createContext } from \"@tamagui/create-context\";\nimport { focusFocusable } from \"@tamagui/focusable\";\nimport { getFontSized } from \"@tamagui/get-font-sized\";\nimport { resolveSizeToken } from \"@tamagui/size\";\nimport { SizableText } from \"@tamagui/text\";\nimport { createStyledHOC, styled } from \"@tamagui/web\";\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nconst NAME = \"Label\";\nconst [LabelProvider, useLabelContextImpl] = createContext(NAME, {\n id: void 0,\n controlRef: { current: null }\n});\nconst labelSizeVariant = styled.dynamic((val, env) => {\n const fontStyle = getFontSized(val, env);\n const sizeKey = resolveSizeToken(val, \"size\");\n return {\n color: fontStyle?.color,\n fontFamily: fontStyle?.fontFamily,\n fontSize: fontStyle?.fontSize,\n fontStyle: fontStyle?.fontStyle,\n fontWeight: fontStyle?.fontWeight,\n letterSpacing: fontStyle?.letterSpacing,\n lineHeight: typeof sizeKey === \"number\" ? sizeKey : env.tokens.size[sizeKey],\n textTransform: fontStyle?.textTransform\n };\n});\nconst LabelFrame = styled(SizableText, {\n displayName: \"Label\",\n render: \"label\",\n size: true,\n backgroundColor: \"transparent\",\n display: \"flex\",\n alignItems: \"center\",\n userSelect: \"none\",\n cursor: \"default\",\n variants: {\n size: labelSizeVariant\n }\n});\nconst Label = createStyledHOC(LabelFrame, function Label2(props, forwardedRef) {\n const { htmlFor, id: idProp, ...labelProps } = props;\n const controlRef = React.useRef(null);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const backupId = React.useId();\n const id = idProp ?? backupId;\n if (isWeb) {\n useIsomorphicLayoutEffect(() => {\n if (htmlFor) {\n const element = document.getElementById(htmlFor);\n const label = ref.current;\n if (label && element) {\n const getAriaLabel = () => element.getAttribute(\"aria-labelledby\");\n const ariaLabelledBy = [id, getAriaLabel()].filter(Boolean).join(\" \");\n element.setAttribute(\"aria-labelledby\", ariaLabelledBy);\n controlRef.current = element;\n return () => {\n if (!id) return;\n const ariaLabelledBy2 = getAriaLabel()?.replace(id, \"\");\n if (ariaLabelledBy2 === \"\") {\n element.removeAttribute(\"aria-labelledby\");\n } else if (ariaLabelledBy2) {\n element.setAttribute(\"aria-labelledby\", ariaLabelledBy2);\n }\n };\n }\n }\n }, [id, htmlFor]);\n }\n return /* @__PURE__ */ jsx(LabelProvider, { id, controlRef, children: /* @__PURE__ */ jsx(\n LabelFrame,\n {\n id,\n htmlFor,\n ...labelProps,\n ref: composedRefs,\n onMouseDown: (event) => {\n props.onMouseDown?.(event);\n if (!event.defaultPrevented && event.detail > 1) {\n event.preventDefault();\n }\n },\n onPress: (event) => {\n props.onPress?.(event);\n if (isWeb) {\n if (htmlFor || !controlRef.current || event.defaultPrevented) return;\n const isClickingControl = controlRef.current.contains(\n event.target\n );\n const isUserClick = event.isTrusted === true;\n if (!isClickingControl && isUserClick) {\n controlRef.current.click();\n controlRef.current.focus();\n }\n } else {\n if (props.htmlFor) {\n focusFocusable(props.htmlFor);\n }\n }\n }\n }\n ) });\n});\nconst useLabelContext = (element) => {\n const context = useLabelContextImpl(\"LabelConsumer\");\n const { controlRef } = context;\n React.useEffect(() => {\n if (element) controlRef.current = element;\n }, [element, controlRef]);\n return context.id;\n};\nexport {\n Label,\n LabelFrame,\n useLabelContext\n};\n//# sourceMappingURL=Label.js.map\n"],"mappings":";;;;;;;;;;;;AAUA,MAAM,OAAO;AACb,MAAM,CAAC,eAAe,uBAAuB,cAAc,MAAM;CAC/D,IAAI,KAAK;CACT,YAAY,EAAE,SAAS,KAAK;AAC9B,CAAC;AACD,MAAM,mBAAmB,OAAO,SAAS,KAAK,QAAQ;CACpD,MAAM,YAAY,aAAa,KAAK,GAAG;CACvC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F;GACF;EACF,GAAG,CAAC,IAAI,OAAO,CAAC;CAClB;CACA,OAAuB,oBAAI,eAAe;EAAE;EAAI;EAAY,UAA0B,oBACpF,YACA;GACE;GACA;GACA,GAAG;GACH,KAAK;GACL,cAAc,UAAU;IACtB,MAAM,cAAc,KAAK;IACzB,IAAI,CAAC,MAAM,oBAAoB,MAAM,SAAS,GAAG;KAC/C,MAAM,eAAe;IACvB;GACF;GACA,UAAU,UAAU;IAClB,MAAM,UAAU,KAAK;IACrB,IAAI,OAAO;KACT,IAAI,WAAW,CAAC,WAAW,WAAW,MAAM,kBAAkB;KAC9D,MAAM,oBAAoB,WAAW,QAAQ,SAC3C,MAAM,MACR;KACA,MAAM,cAAc,MAAM,cAAc;KACxC,IAAI,CAAC,qBAAqB,aAAa;MACrC,WAAW,QAAQ,MAAM;MACzB,WAAW,QAAQ,MAAM;KAC3B;IACF,OAAO;KACL,IAAI,MAAM,SAAS;MACjB,eAAe,MAAM,OAAO;KAC9B;IACF;GACF;EACF,CACF;CAAE,CAAC;AACL,CAAC;AACD,MAAM,mBAAmB,YAAY;CACnC,MAAM,UAAU,oBAAoB,eAAe;CACnD,MAAM,EAAE,eAAe;CACvB,MAAM,gBAAgB;EACpB,IAAI,SAAS,WAAW,UAAU;CACpC,GAAG,CAAC,SAAS,UAAU,CAAC;CACxB,OAAO,QAAQ;AACjB"}
1
+ {"version":3,"file":"Label.js","names":[],"sources":["esm/Label.js"],"sourcesContent":["import { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { createContext } from \"@tamagui/create-context\";\nimport { focusFocusable } from \"@tamagui/focusable\";\nimport { getFontSized } from \"@tamagui/get-font-sized\";\nimport { SizableText } from \"@tamagui/text\";\nimport { createStyledHOC, styled } from \"@tamagui/web\";\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nconst NAME = \"Label\";\nconst [LabelProvider, useLabelContextImpl] = createContext(NAME, {\n id: void 0,\n controlRef: { current: null }\n});\nconst LabelFrame = styled(SizableText, {\n displayName: \"Label\",\n render: \"label\",\n size: true,\n backgroundColor: \"transparent\",\n display: \"flex\",\n alignItems: \"center\",\n userSelect: \"none\",\n cursor: \"default\",\n variants: {\n size: getFontSized\n }\n});\nconst Label = createStyledHOC(LabelFrame, function Label2(props, forwardedRef) {\n const { htmlFor, id: idProp, ...labelProps } = props;\n const controlRef = React.useRef(null);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const backupId = React.useId();\n const id = idProp ?? backupId;\n if (isWeb) {\n useIsomorphicLayoutEffect(() => {\n if (htmlFor) {\n const element = document.getElementById(htmlFor);\n const label = ref.current;\n if (label && element) {\n const getAriaLabel = () => element.getAttribute(\"aria-labelledby\");\n const ariaLabelledBy = [id, getAriaLabel()].filter(Boolean).join(\" \");\n element.setAttribute(\"aria-labelledby\", ariaLabelledBy);\n controlRef.current = element;\n return () => {\n if (!id) return;\n const ariaLabelledBy2 = getAriaLabel()?.replace(id, \"\");\n if (ariaLabelledBy2 === \"\") {\n element.removeAttribute(\"aria-labelledby\");\n } else if (ariaLabelledBy2) {\n element.setAttribute(\"aria-labelledby\", ariaLabelledBy2);\n }\n };\n }\n }\n }, [id, htmlFor]);\n }\n return /* @__PURE__ */ jsx(LabelProvider, { id, controlRef, children: /* @__PURE__ */ jsx(\n LabelFrame,\n {\n id,\n htmlFor,\n ...labelProps,\n ref: composedRefs,\n onMouseDown: (event) => {\n props.onMouseDown?.(event);\n if (!event.defaultPrevented && event.detail > 1) {\n event.preventDefault();\n }\n },\n onPress: (event) => {\n props.onPress?.(event);\n if (isWeb) {\n if (htmlFor || !controlRef.current || event.defaultPrevented) return;\n const isClickingControl = controlRef.current.contains(\n event.target\n );\n const isUserClick = event.isTrusted === true;\n if (!isClickingControl && isUserClick) {\n controlRef.current.click();\n controlRef.current.focus();\n }\n } else {\n if (props.htmlFor) {\n focusFocusable(props.htmlFor);\n }\n }\n }\n }\n ) });\n});\nconst useLabelContext = (element) => {\n const context = useLabelContextImpl(\"LabelConsumer\");\n const { controlRef } = context;\n React.useEffect(() => {\n if (element) controlRef.current = element;\n }, [element, controlRef]);\n return context.id;\n};\nexport {\n Label,\n LabelFrame,\n useLabelContext\n};\n//# sourceMappingURL=Label.js.map\n"],"mappings":";;;;;;;;;;;AASA,MAAM,OAAO;AACb,MAAM,CAAC,eAAe,uBAAuB,cAAc,MAAM;CAC/D,IAAI,KAAK;CACT,YAAY,EAAE,SAAS,KAAK;AAC9B,CAAC;AACD,MAAM,aAAa,OAAO,aAAa;CACrC,aAAa;CACb,QAAQ;CACR,MAAM;CACN,iBAAiB;CACjB,SAAS;CACT,YAAY;CACZ,YAAY;CACZ,QAAQ;CACR,UAAU,EACR,MAAM,aACR;AACF,CAAC;AACD,MAAM,QAAQ,gBAAgB,YAAY,SAAS,OAAO,OAAO,cAAc;CAC7E,MAAM,EAAE,SAAS,IAAI,QAAQ,GAAG,eAAe;CAC/C,MAAM,aAAa,MAAM,OAAO,IAAI;CACpC,MAAM,MAAM,MAAM,OAAO,IAAI;CAC7B,MAAM,eAAe,gBAAgB,cAAc,GAAG;CACtD,MAAM,WAAW,MAAM,MAAM;CAC7B,MAAM,KAAK,UAAU;CACrB,IAAI,OAAO;EACT,gCAAgC;GAC9B,IAAI,SAAS;IACX,MAAM,UAAU,SAAS,eAAe,OAAO;IAC/C,MAAM,QAAQ,IAAI;IAClB,IAAI,SAAS,SAAS;KACpB,MAAM,qBAAqB,QAAQ,aAAa,iBAAiB;KACjE,MAAM,iBAAiB,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;KACpE,QAAQ,aAAa,mBAAmB,cAAc;KACtD,WAAW,UAAU;KACrB,aAAa;MACX,IAAI,CAAC,IAAI;MACT,MAAM,kBAAkB,aAAa,CAAC,EAAE,QAAQ,IAAI,EAAE;MACtD,IAAI,oBAAoB,IAAI;OAC1B,QAAQ,gBAAgB,iBAAiB;MAC3C,OAAO,IAAI,iBAAiB;OAC1B,QAAQ,aAAa,mBAAmB,eAAe;MACzD;KACF;IACF;GACF;EACF,GAAG,CAAC,IAAI,OAAO,CAAC;CAClB;CACA,OAAuB,oBAAI,eAAe;EAAE;EAAI;EAAY,UAA0B,oBACpF,YACA;GACE;GACA;GACA,GAAG;GACH,KAAK;GACL,cAAc,UAAU;IACtB,MAAM,cAAc,KAAK;IACzB,IAAI,CAAC,MAAM,oBAAoB,MAAM,SAAS,GAAG;KAC/C,MAAM,eAAe;IACvB;GACF;GACA,UAAU,UAAU;IAClB,MAAM,UAAU,KAAK;IACrB,IAAI,OAAO;KACT,IAAI,WAAW,CAAC,WAAW,WAAW,MAAM,kBAAkB;KAC9D,MAAM,oBAAoB,WAAW,QAAQ,SAC3C,MAAM,MACR;KACA,MAAM,cAAc,MAAM,cAAc;KACxC,IAAI,CAAC,qBAAqB,aAAa;MACrC,WAAW,QAAQ,MAAM;MACzB,WAAW,QAAQ,MAAM;KAC3B;IACF,OAAO;KACL,IAAI,MAAM,SAAS;MACjB,eAAe,MAAM,OAAO;KAC9B;IACF;GACF;EACF,CACF;CAAE,CAAC;AACL,CAAC;AACD,MAAM,mBAAmB,YAAY;CACnC,MAAM,UAAU,oBAAoB,eAAe;CACnD,MAAM,EAAE,eAAe;CACvB,MAAM,gBAAgB;EACpB,IAAI,SAAS,WAAW,UAAU;CACpC,GAAG,CAAC,SAAS,UAAU,CAAC;CACxB,OAAO,QAAQ;AACjB"}
@@ -4,7 +4,6 @@ import { isWeb, useIsomorphicLayoutEffect } from "@tamagui/constants";
4
4
  import { createContext } from "@tamagui/create-context";
5
5
  import { focusFocusable } from "@tamagui/focusable";
6
6
  import { getFontSized } from "@tamagui/get-font-sized";
7
- import { resolveSizeToken } from "@tamagui/size";
8
7
  import { SizableText } from "@tamagui/text";
9
8
  import { createStyledHOC, styled } from "@tamagui/web";
10
9
  import * as React from "react";
@@ -14,20 +13,6 @@ var [LabelProvider, useLabelContextImpl] = createContext(NAME, {
14
13
  id: void 0,
15
14
  controlRef: { current: null }
16
15
  });
17
- var labelSizeVariant = styled.dynamic(function(val, env) {
18
- var fontStyle = getFontSized(val, env);
19
- var sizeKey = resolveSizeToken(val, "size");
20
- return {
21
- color: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.color,
22
- fontFamily: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontFamily,
23
- fontSize: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontSize,
24
- fontStyle: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontStyle,
25
- fontWeight: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontWeight,
26
- letterSpacing: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.letterSpacing,
27
- lineHeight: typeof sizeKey === "number" ? sizeKey : env.tokens.size[sizeKey],
28
- textTransform: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.textTransform
29
- };
30
- });
31
16
  var LabelFrame = styled(SizableText, {
32
17
  displayName: "Label",
33
18
  render: "label",
@@ -37,7 +22,7 @@ var LabelFrame = styled(SizableText, {
37
22
  alignItems: "center",
38
23
  userSelect: "none",
39
24
  cursor: "default",
40
- variants: { size: labelSizeVariant }
25
+ variants: { size: getFontSized }
41
26
  });
42
27
  var Label = createStyledHOC(LabelFrame, function Label2(props, forwardedRef) {
43
28
  var { htmlFor, id: idProp, ...labelProps } = props;
@@ -1 +1 @@
1
- {"version":3,"file":"Label.native.js","names":[],"sources":["esm/Label.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { createContext } from \"@tamagui/create-context\";\nimport { focusFocusable } from \"@tamagui/focusable\";\nimport { getFontSized } from \"@tamagui/get-font-sized\";\nimport { resolveSizeToken } from \"@tamagui/size\";\nimport { SizableText } from \"@tamagui/text\";\nimport { createStyledHOC, styled } from \"@tamagui/web\";\nimport * as React from \"react\";\nvar NAME = \"Label\";\nvar [LabelProvider, useLabelContextImpl] = createContext(NAME, {\n id: void 0,\n controlRef: {\n current: null\n }\n});\nvar labelSizeVariant = styled.dynamic(function(val, env) {\n var fontStyle = getFontSized(val, env);\n var sizeKey = resolveSizeToken(val, \"size\");\n return {\n color: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.color,\n fontFamily: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontFamily,\n fontSize: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontSize,\n fontStyle: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontStyle,\n fontWeight: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontWeight,\n letterSpacing: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.letterSpacing,\n lineHeight: typeof sizeKey === \"number\" ? sizeKey : env.tokens.size[sizeKey],\n textTransform: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.textTransform\n };\n});\nvar LabelFrame = styled(SizableText, {\n displayName: \"Label\",\n render: \"label\",\n size: true,\n backgroundColor: \"transparent\",\n display: \"flex\",\n alignItems: \"center\",\n userSelect: \"none\",\n cursor: \"default\",\n variants: {\n size: labelSizeVariant\n }\n});\nvar Label = createStyledHOC(LabelFrame, function Label2(props, forwardedRef) {\n var { htmlFor, id: idProp, ...labelProps } = props;\n var controlRef = React.useRef(null);\n var ref = React.useRef(null);\n var composedRefs = useComposedRefs(forwardedRef, ref);\n var backupId = React.useId();\n var id = idProp !== null && idProp !== void 0 ? idProp : backupId;\n if (isWeb) {\n useIsomorphicLayoutEffect(function() {\n if (htmlFor) {\n var element = document.getElementById(htmlFor);\n var label = ref.current;\n if (label && element) {\n var getAriaLabel = function() {\n return element.getAttribute(\"aria-labelledby\");\n };\n var ariaLabelledBy = [\n id,\n getAriaLabel()\n ].filter(Boolean).join(\" \");\n element.setAttribute(\"aria-labelledby\", ariaLabelledBy);\n controlRef.current = element;\n return function() {\n var _getAriaLabel;\n if (!id) return;\n var ariaLabelledBy2 = (_getAriaLabel = getAriaLabel()) === null || _getAriaLabel === void 0 ? void 0 : _getAriaLabel.replace(id, \"\");\n if (ariaLabelledBy2 === \"\") {\n element.removeAttribute(\"aria-labelledby\");\n } else if (ariaLabelledBy2) {\n element.setAttribute(\"aria-labelledby\", ariaLabelledBy2);\n }\n };\n }\n }\n }, [\n id,\n htmlFor\n ]);\n }\n return /* @__PURE__ */ _jsx(LabelProvider, {\n id,\n controlRef,\n children: /* @__PURE__ */ _jsx(LabelFrame, {\n id,\n // @ts-ignore\n htmlFor,\n ...labelProps,\n ref: composedRefs,\n onMouseDown: function(event) {\n var _props_onMouseDown;\n (_props_onMouseDown = props.onMouseDown) === null || _props_onMouseDown === void 0 ? void 0 : _props_onMouseDown.call(props, event);\n if (!event.defaultPrevented && event.detail > 1) {\n event.preventDefault();\n }\n },\n onPress: function(event) {\n var _props_onPress;\n (_props_onPress = props.onPress) === null || _props_onPress === void 0 ? void 0 : _props_onPress.call(props, event);\n if (isWeb) {\n if (htmlFor || !controlRef.current || event.defaultPrevented) return;\n var isClickingControl = controlRef.current.contains(event.target);\n var isUserClick = event.isTrusted === true;\n if (!isClickingControl && isUserClick) {\n controlRef.current.click();\n controlRef.current.focus();\n }\n } else {\n if (props.htmlFor) {\n focusFocusable(props.htmlFor);\n }\n }\n }\n })\n });\n});\nvar useLabelContext = function(element) {\n var context = useLabelContextImpl(\"LabelConsumer\");\n var { controlRef } = context;\n React.useEffect(function() {\n if (element) controlRef.current = element;\n }, [\n element,\n controlRef\n ]);\n return context.id;\n};\nexport {\n Label,\n LabelFrame,\n useLabelContext\n};\n//# sourceMappingURL=Label.js.map\n"],"mappings":";;;;;;;;;;;;AAUA,IAAI,OAAO;AACX,IAAI,CAAC,eAAe,uBAAuB,cAAc,MAAM;CAC7D,IAAI,KAAK;CACT,YAAY,EACV,SAAS,KACX;AACF,CAAC;AAC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Q,MAAM;KAC3B;IACF,OAAO;KACL,IAAI,MAAM,SAAS;MACjB,eAAe,MAAM,OAAO;KAC9B;IACF;GACF;EACF,CAAC;CACH,CAAC;AACH,CAAC;AACD,IAAI,kBAAkB,SAAS,SAAS;CACtC,IAAI,UAAU,oBAAoB,eAAe;CACjD,IAAI,EAAE,eAAe;CACrB,MAAM,UAAU,WAAW;EACzB,IAAI,SAAS,WAAW,UAAU;CACpC,GAAG,CACD,SACA,UACF,CAAC;CACD,OAAO,QAAQ;AACjB"}
1
+ {"version":3,"file":"Label.native.js","names":[],"sources":["esm/Label.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { createContext } from \"@tamagui/create-context\";\nimport { focusFocusable } from \"@tamagui/focusable\";\nimport { getFontSized } from \"@tamagui/get-font-sized\";\nimport { SizableText } from \"@tamagui/text\";\nimport { createStyledHOC, styled } from \"@tamagui/web\";\nimport * as React from \"react\";\nvar NAME = \"Label\";\nvar [LabelProvider, useLabelContextImpl] = createContext(NAME, {\n id: void 0,\n controlRef: {\n current: null\n }\n});\nvar LabelFrame = styled(SizableText, {\n displayName: \"Label\",\n render: \"label\",\n size: true,\n backgroundColor: \"transparent\",\n display: \"flex\",\n alignItems: \"center\",\n userSelect: \"none\",\n cursor: \"default\",\n variants: {\n size: getFontSized\n }\n});\nvar Label = createStyledHOC(LabelFrame, function Label2(props, forwardedRef) {\n var { htmlFor, id: idProp, ...labelProps } = props;\n var controlRef = React.useRef(null);\n var ref = React.useRef(null);\n var composedRefs = useComposedRefs(forwardedRef, ref);\n var backupId = React.useId();\n var id = idProp !== null && idProp !== void 0 ? idProp : backupId;\n if (isWeb) {\n useIsomorphicLayoutEffect(function() {\n if (htmlFor) {\n var element = document.getElementById(htmlFor);\n var label = ref.current;\n if (label && element) {\n var getAriaLabel = function() {\n return element.getAttribute(\"aria-labelledby\");\n };\n var ariaLabelledBy = [\n id,\n getAriaLabel()\n ].filter(Boolean).join(\" \");\n element.setAttribute(\"aria-labelledby\", ariaLabelledBy);\n controlRef.current = element;\n return function() {\n var _getAriaLabel;\n if (!id) return;\n var ariaLabelledBy2 = (_getAriaLabel = getAriaLabel()) === null || _getAriaLabel === void 0 ? void 0 : _getAriaLabel.replace(id, \"\");\n if (ariaLabelledBy2 === \"\") {\n element.removeAttribute(\"aria-labelledby\");\n } else if (ariaLabelledBy2) {\n element.setAttribute(\"aria-labelledby\", ariaLabelledBy2);\n }\n };\n }\n }\n }, [\n id,\n htmlFor\n ]);\n }\n return /* @__PURE__ */ _jsx(LabelProvider, {\n id,\n controlRef,\n children: /* @__PURE__ */ _jsx(LabelFrame, {\n id,\n // @ts-ignore\n htmlFor,\n ...labelProps,\n ref: composedRefs,\n onMouseDown: function(event) {\n var _props_onMouseDown;\n (_props_onMouseDown = props.onMouseDown) === null || _props_onMouseDown === void 0 ? void 0 : _props_onMouseDown.call(props, event);\n if (!event.defaultPrevented && event.detail > 1) {\n event.preventDefault();\n }\n },\n onPress: function(event) {\n var _props_onPress;\n (_props_onPress = props.onPress) === null || _props_onPress === void 0 ? void 0 : _props_onPress.call(props, event);\n if (isWeb) {\n if (htmlFor || !controlRef.current || event.defaultPrevented) return;\n var isClickingControl = controlRef.current.contains(event.target);\n var isUserClick = event.isTrusted === true;\n if (!isClickingControl && isUserClick) {\n controlRef.current.click();\n controlRef.current.focus();\n }\n } else {\n if (props.htmlFor) {\n focusFocusable(props.htmlFor);\n }\n }\n }\n })\n });\n});\nvar useLabelContext = function(element) {\n var context = useLabelContextImpl(\"LabelConsumer\");\n var { controlRef } = context;\n React.useEffect(function() {\n if (element) controlRef.current = element;\n }, [\n element,\n controlRef\n ]);\n return context.id;\n};\nexport {\n Label,\n LabelFrame,\n useLabelContext\n};\n//# sourceMappingURL=Label.js.map\n"],"mappings":";;;;;;;;;;;AASA,IAAI,OAAO;AACX,IAAI,CAA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C;CACH;CACA,OAAuB,oBAAK,eAAe;EACzC;EACA;EACA,UAA0B,oBAAK,YAAY;GACzC;GAEA;GACA,GAAG;GACH,KAAK;GACL,aAAa,SAAS,OAAO;IAC3B,IAAI;IACJ,CAAC,qBAAqB,MAAM,iBAAiB,QAAQ,uBAAuB,KAAK,IAAI,KAAK,IAAI,mBAAmB,KAAK,OAAO,KAAK;IAClI,IAAI,CAAC,MAAM,oBAAoB,MAAM,SAAS,GAAG;KAC/C,MAAM,eAAe;IACvB;GACF;GACA,SAAS,SAAS,OAAO;IACvB,IAAI;IACJ,CAAC,iBAAiB,MAAM,aAAa,QAAQ,mBAAmB,KAAK,IAAI,KAAK,IAAI,eAAe,KAAK,OAAO,KAAK;IAClH,IAAI,OAAO;KACT,IAAI,WAAW,CAAC,WAAW,WAAW,MAAM,kBAAkB;KAC9D,IAAI,oBAAoB,WAAW,QAAQ,SAAS,MAAM,MAAM;KAChE,IAAI,cAAc,MAAM,cAAc;KACtC,IAAI,CAAC,qBAAqB,aAAa;MACrC,WAAW,QAAQ,MAAM;MACzB,WAAW,QAAQ,MAAM;KAC3B;IACF,OAAO;KACL,IAAI,MAAM,SAAS;MACjB,eAAe,MAAM,OAAO;KAC9B;IACF;GACF;EACF,CAAC;CACH,CAAC;AACH,CAAC;AACD,IAAI,kBAAkB,SAAS,SAAS;CACtC,IAAI,UAAU,oBAAoB,eAAe;CACjD,IAAI,EAAE,eAAe;CACrB,MAAM,UAAU,WAAW;EACzB,IAAI,SAAS,WAAW,UAAU;CACpC,GAAG,CACD,SACA,UACF,CAAC;CACD,OAAO,QAAQ;AACjB"}
@@ -3,7 +3,6 @@ import { isWeb, useIsomorphicLayoutEffect } from "@tamagui/constants";
3
3
  import { createContext } from "@tamagui/create-context";
4
4
  import { focusFocusable } from "@tamagui/focusable";
5
5
  import { getFontSized } from "@tamagui/get-font-sized";
6
- import { resolveSizeToken } from "@tamagui/size";
7
6
  import { SizableText } from "@tamagui/text";
8
7
  import { createStyledHOC, styled } from "@tamagui/web";
9
8
  import * as React from "react";
@@ -14,20 +13,6 @@ const [LabelProvider, useLabelContextImpl] = createContext(NAME, {
14
13
  id: void 0,
15
14
  controlRef: { current: null }
16
15
  });
17
- const labelSizeVariant = styled.dynamic((val, env) => {
18
- const fontStyle = getFontSized(val, env);
19
- const sizeKey = resolveSizeToken(val, "size");
20
- return {
21
- color: fontStyle?.color,
22
- fontFamily: fontStyle?.fontFamily,
23
- fontSize: fontStyle?.fontSize,
24
- fontStyle: fontStyle?.fontStyle,
25
- fontWeight: fontStyle?.fontWeight,
26
- letterSpacing: fontStyle?.letterSpacing,
27
- lineHeight: typeof sizeKey === "number" ? sizeKey : env.tokens.size[sizeKey],
28
- textTransform: fontStyle?.textTransform
29
- };
30
- });
31
16
  const LabelFrame = styled(SizableText, {
32
17
  displayName: "Label",
33
18
  render: "label",
@@ -37,7 +22,7 @@ const LabelFrame = styled(SizableText, {
37
22
  alignItems: "center",
38
23
  userSelect: "none",
39
24
  cursor: "default",
40
- variants: { size: labelSizeVariant }
25
+ variants: { size: getFontSized }
41
26
  });
42
27
  const Label = createStyledHOC(LabelFrame, function Label2(props, forwardedRef) {
43
28
  const { htmlFor, id: idProp, ...labelProps } = props;
@@ -1 +1 @@
1
- {"version":3,"file":"Label.js","names":[],"sources":["jsx/Label.js"],"sourcesContent":["import { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { createContext } from \"@tamagui/create-context\";\nimport { focusFocusable } from \"@tamagui/focusable\";\nimport { getFontSized } from \"@tamagui/get-font-sized\";\nimport { resolveSizeToken } from \"@tamagui/size\";\nimport { SizableText } from \"@tamagui/text\";\nimport { createStyledHOC, styled } from \"@tamagui/web\";\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nconst NAME = \"Label\";\nconst [LabelProvider, useLabelContextImpl] = createContext(NAME, {\n id: void 0,\n controlRef: { current: null }\n});\nconst labelSizeVariant = styled.dynamic((val, env) => {\n const fontStyle = getFontSized(val, env);\n const sizeKey = resolveSizeToken(val, \"size\");\n return {\n color: fontStyle?.color,\n fontFamily: fontStyle?.fontFamily,\n fontSize: fontStyle?.fontSize,\n fontStyle: fontStyle?.fontStyle,\n fontWeight: fontStyle?.fontWeight,\n letterSpacing: fontStyle?.letterSpacing,\n lineHeight: typeof sizeKey === \"number\" ? sizeKey : env.tokens.size[sizeKey],\n textTransform: fontStyle?.textTransform\n };\n});\nconst LabelFrame = styled(SizableText, {\n displayName: \"Label\",\n render: \"label\",\n size: true,\n backgroundColor: \"transparent\",\n display: \"flex\",\n alignItems: \"center\",\n userSelect: \"none\",\n cursor: \"default\",\n variants: {\n size: labelSizeVariant\n }\n});\nconst Label = createStyledHOC(LabelFrame, function Label2(props, forwardedRef) {\n const { htmlFor, id: idProp, ...labelProps } = props;\n const controlRef = React.useRef(null);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const backupId = React.useId();\n const id = idProp ?? backupId;\n if (isWeb) {\n useIsomorphicLayoutEffect(() => {\n if (htmlFor) {\n const element = document.getElementById(htmlFor);\n const label = ref.current;\n if (label && element) {\n const getAriaLabel = () => element.getAttribute(\"aria-labelledby\");\n const ariaLabelledBy = [id, getAriaLabel()].filter(Boolean).join(\" \");\n element.setAttribute(\"aria-labelledby\", ariaLabelledBy);\n controlRef.current = element;\n return () => {\n if (!id) return;\n const ariaLabelledBy2 = getAriaLabel()?.replace(id, \"\");\n if (ariaLabelledBy2 === \"\") {\n element.removeAttribute(\"aria-labelledby\");\n } else if (ariaLabelledBy2) {\n element.setAttribute(\"aria-labelledby\", ariaLabelledBy2);\n }\n };\n }\n }\n }, [id, htmlFor]);\n }\n return /* @__PURE__ */ jsx(LabelProvider, { id, controlRef, children: /* @__PURE__ */ jsx(\n LabelFrame,\n {\n id,\n htmlFor,\n ...labelProps,\n ref: composedRefs,\n onMouseDown: (event) => {\n props.onMouseDown?.(event);\n if (!event.defaultPrevented && event.detail > 1) {\n event.preventDefault();\n }\n },\n onPress: (event) => {\n props.onPress?.(event);\n if (isWeb) {\n if (htmlFor || !controlRef.current || event.defaultPrevented) return;\n const isClickingControl = controlRef.current.contains(\n event.target\n );\n const isUserClick = event.isTrusted === true;\n if (!isClickingControl && isUserClick) {\n controlRef.current.click();\n controlRef.current.focus();\n }\n } else {\n if (props.htmlFor) {\n focusFocusable(props.htmlFor);\n }\n }\n }\n }\n ) });\n});\nconst useLabelContext = (element) => {\n const context = useLabelContextImpl(\"LabelConsumer\");\n const { controlRef } = context;\n React.useEffect(() => {\n if (element) controlRef.current = element;\n }, [element, controlRef]);\n return context.id;\n};\nexport {\n Label,\n LabelFrame,\n useLabelContext\n};\n//# sourceMappingURL=Label.js.map\n"],"mappings":";;;;;;;;;;;;AAUA,MAAM,OAAO;AACb,MAAM,CAAC,eAAe,uBAAuB,cAAc,MAAM;CAC/D,IAAI,KAAK;CACT,YAAY,EAAE,SAAS,KAAK;AAC9B,CAAC;AACD,MAAM,mBAAmB,OAAO,SAAS,KAAK,QAAQ;CACpD,MAAM,YAAY,aAAa,KAAK,GAAG;CACvC,MAAM,UAAU,iBAAiB,KAAK,MAAM;CAC5C,OAAO;EACL,OAAO,WAAW;EAClB,YAAY,WAAW;EACvB,UAAU,WAAW;EACrB,WAAW,WAAW;EACtB,YAAY,WAAW;EACvB,eAAe,WAAW;EAC1B,YAAY,OAAO,YAAY,WAAW,UAAU,IAAI,OAAO,KAAK;EACpE,eAAe,WAAW;CAC5B;AACF,CAAC;AACD,MAAM,aAAa,OAAO,aAAa;CACrC,aAAa;CACb,QAAQ;CACR,MAAM;CACN,iBAAiB;CACjB,SAAS;CACT,YAAY;CACZ,YAAY;CACZ,QAAQ;CACR,UAAU,EACR,MAAM,iBACR;AACF,CAAC;AACD,MAAM,QAAQ,gBAAgB,YAAY,SAAS,OAAO,OAAO,cAAc;CAC7E,MAAM,EAAE,SAAS,IAAI,QAAQ,GAAG,eAAe;CAC/C,MAAM,a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MAAM;KAC3B;IACF,OAAO;KACL,IAAI,MAAM,SAAS;MACjB,eAAe,MAAM,OAAO;KAC9B;IACF;GACF;EACF,CACF;CAAE,CAAC;AACL,CAAC;AACD,MAAM,mBAAmB,YAAY;CACnC,MAAM,UAAU,oBAAoB,eAAe;CACnD,MAAM,EAAE,eAAe;CACvB,MAAM,gBAAgB;EACpB,IAAI,SAAS,WAAW,UAAU;CACpC,GAAG,CAAC,SAAS,UAAU,CAAC;CACxB,OAAO,QAAQ;AACjB"}
1
+ {"version":3,"file":"Label.js","names":[],"sources":["jsx/Label.js"],"sourcesContent":["import { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { createContext } from \"@tamagui/create-context\";\nimport { focusFocusable } from \"@tamagui/focusable\";\nimport { getFontSized } from \"@tamagui/get-font-sized\";\nimport { SizableText } from \"@tamagui/text\";\nimport { createStyledHOC, styled } from \"@tamagui/web\";\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nconst NAME = \"Label\";\nconst [LabelProvider, useLabelContextImpl] = createContext(NAME, {\n id: void 0,\n controlRef: { current: null }\n});\nconst LabelFrame = styled(SizableText, {\n displayName: \"Label\",\n render: \"label\",\n size: true,\n backgroundColor: \"transparent\",\n display: \"flex\",\n alignItems: \"center\",\n userSelect: \"none\",\n cursor: \"default\",\n variants: {\n size: getFontSized\n }\n});\nconst Label = createStyledHOC(LabelFrame, function Label2(props, forwardedRef) {\n const { htmlFor, id: idProp, ...labelProps } = props;\n const controlRef = React.useRef(null);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const backupId = React.useId();\n const id = idProp ?? backupId;\n if (isWeb) {\n useIsomorphicLayoutEffect(() => {\n if (htmlFor) {\n const element = document.getElementById(htmlFor);\n const label = ref.current;\n if (label && element) {\n const getAriaLabel = () => element.getAttribute(\"aria-labelledby\");\n const ariaLabelledBy = [id, getAriaLabel()].filter(Boolean).join(\" \");\n element.setAttribute(\"aria-labelledby\", ariaLabelledBy);\n controlRef.current = element;\n return () => {\n if (!id) return;\n const ariaLabelledBy2 = getAriaLabel()?.replace(id, \"\");\n if (ariaLabelledBy2 === \"\") {\n element.removeAttribute(\"aria-labelledby\");\n } else if (ariaLabelledBy2) {\n element.setAttribute(\"aria-labelledby\", ariaLabelledBy2);\n }\n };\n }\n }\n }, [id, htmlFor]);\n }\n return /* @__PURE__ */ jsx(LabelProvider, { id, controlRef, children: /* @__PURE__ */ jsx(\n LabelFrame,\n {\n id,\n htmlFor,\n ...labelProps,\n ref: composedRefs,\n onMouseDown: (event) => {\n props.onMouseDown?.(event);\n if (!event.defaultPrevented && event.detail > 1) {\n event.preventDefault();\n }\n },\n onPress: (event) => {\n props.onPress?.(event);\n if (isWeb) {\n if (htmlFor || !controlRef.current || event.defaultPrevented) return;\n const isClickingControl = controlRef.current.contains(\n event.target\n );\n const isUserClick = event.isTrusted === true;\n if (!isClickingControl && isUserClick) {\n controlRef.current.click();\n controlRef.current.focus();\n }\n } else {\n if (props.htmlFor) {\n focusFocusable(props.htmlFor);\n }\n }\n }\n }\n ) });\n});\nconst useLabelContext = (element) => {\n const context = useLabelContextImpl(\"LabelConsumer\");\n const { controlRef } = context;\n React.useEffect(() => {\n if (element) controlRef.current = element;\n }, [element, controlRef]);\n return context.id;\n};\nexport {\n Label,\n LabelFrame,\n useLabelContext\n};\n//# sourceMappingURL=Label.js.map\n"],"mappings":";;;;;;;;;;;AASA,MAAM,OAAO;AACb,MAAM,CAAC,eAAe,uBAAuB,cAAc,MAAM;CAC/D,IAAI,KAAK;CACT,YAAY,EAAE,SAAS,KAAK;AAC9B,CAAC;AACD,MAAM,aAAa,OAAO,aAAa;CACrC,aAAa;CACb,QAAQ;CACR,MAAM;CACN,iBAAiB;CACjB,SAAS;CACT,YAAY;CACZ,YAAY;CACZ,QAAQ;CACR,UAAU,EACR,MAAM,aACR;AACF,CAAC;AACD,MAAM,QAAQ,gBAAgB,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cAAc,MAAM,cAAc;KACxC,IAAI,CAAC,qBAAqB,aAAa;MACrC,WAAW,QAAQ,MAAM;MACzB,WAAW,QAAQ,MAAM;KAC3B;IACF,OAAO;KACL,IAAI,MAAM,SAAS;MACjB,eAAe,MAAM,OAAO;KAC9B;IACF;GACF;EACF,CACF;CAAE,CAAC;AACL,CAAC;AACD,MAAM,mBAAmB,YAAY;CACnC,MAAM,UAAU,oBAAoB,eAAe;CACnD,MAAM,EAAE,eAAe;CACvB,MAAM,gBAAgB;EACpB,IAAI,SAAS,WAAW,UAAU;CACpC,GAAG,CAAC,SAAS,UAAU,CAAC;CACxB,OAAO,QAAQ;AACjB"}
@@ -39,7 +39,6 @@ var import_constants = require("@tamagui/constants");
39
39
  var import_create_context = require("@tamagui/create-context");
40
40
  var import_focusable = require("@tamagui/focusable");
41
41
  var import_get_font_sized = require("@tamagui/get-font-sized");
42
- var import_size = require("@tamagui/size");
43
42
  var import_text = require("@tamagui/text");
44
43
  var import_web = require("@tamagui/web");
45
44
  var React = __toESM(require("react"), 1);
@@ -48,20 +47,6 @@ var [LabelProvider, useLabelContextImpl] = (0, import_create_context.createConte
48
47
  id: void 0,
49
48
  controlRef: { current: null }
50
49
  });
51
- var labelSizeVariant = import_web.styled.dynamic(function(val, env) {
52
- var fontStyle = (0, import_get_font_sized.getFontSized)(val, env);
53
- var sizeKey = (0, import_size.resolveSizeToken)(val, "size");
54
- return {
55
- color: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.color,
56
- fontFamily: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontFamily,
57
- fontSize: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontSize,
58
- fontStyle: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontStyle,
59
- fontWeight: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontWeight,
60
- letterSpacing: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.letterSpacing,
61
- lineHeight: typeof sizeKey === "number" ? sizeKey : env.tokens.size[sizeKey],
62
- textTransform: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.textTransform
63
- };
64
- });
65
50
  var LabelFrame = (0, import_web.styled)(import_text.SizableText, {
66
51
  displayName: "Label",
67
52
  render: "label",
@@ -71,7 +56,7 @@ var LabelFrame = (0, import_web.styled)(import_text.SizableText, {
71
56
  alignItems: "center",
72
57
  userSelect: "none",
73
58
  cursor: "default",
74
- variants: { size: labelSizeVariant }
59
+ variants: { size: import_get_font_sized.getFontSized }
75
60
  });
76
61
  var Label = (0, import_web.createStyledHOC)(LabelFrame, function Label2(props, forwardedRef) {
77
62
  var { htmlFor, id: idProp, ...labelProps } = props;
@@ -39,7 +39,6 @@ var import_constants = require("@tamagui/constants");
39
39
  var import_create_context = require("@tamagui/create-context");
40
40
  var import_focusable = require("@tamagui/focusable");
41
41
  var import_get_font_sized = require("@tamagui/get-font-sized");
42
- var import_size = require("@tamagui/size");
43
42
  var import_text = require("@tamagui/text");
44
43
  var import_web = require("@tamagui/web");
45
44
  var React = __toESM(require("react"), 1);
@@ -48,20 +47,6 @@ var [LabelProvider, useLabelContextImpl] = (0, import_create_context.createConte
48
47
  id: void 0,
49
48
  controlRef: { current: null }
50
49
  });
51
- var labelSizeVariant = import_web.styled.dynamic(function(val, env) {
52
- var fontStyle = (0, import_get_font_sized.getFontSized)(val, env);
53
- var sizeKey = (0, import_size.resolveSizeToken)(val, "size");
54
- return {
55
- color: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.color,
56
- fontFamily: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontFamily,
57
- fontSize: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontSize,
58
- fontStyle: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontStyle,
59
- fontWeight: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontWeight,
60
- letterSpacing: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.letterSpacing,
61
- lineHeight: typeof sizeKey === "number" ? sizeKey : env.tokens.size[sizeKey],
62
- textTransform: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.textTransform
63
- };
64
- });
65
50
  var LabelFrame = (0, import_web.styled)(import_text.SizableText, {
66
51
  displayName: "Label",
67
52
  render: "label",
@@ -71,7 +56,7 @@ var LabelFrame = (0, import_web.styled)(import_text.SizableText, {
71
56
  alignItems: "center",
72
57
  userSelect: "none",
73
58
  cursor: "default",
74
- variants: { size: labelSizeVariant }
59
+ variants: { size: import_get_font_sized.getFontSized }
75
60
  });
76
61
  var Label = (0, import_web.createStyledHOC)(LabelFrame, function Label2(props, forwardedRef) {
77
62
  var { htmlFor, id: idProp, ...labelProps } = props;
@@ -1 +1 @@
1
- {"version":3,"file":"Label.native.js","names":[],"sources":["jsx/Label.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Label_exports = {};\n__export(Label_exports, {\n Label: () => Label,\n LabelFrame: () => LabelFrame,\n useLabelContext: () => useLabelContext\n});\nmodule.exports = __toCommonJS(Label_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_create_context = require(\"@tamagui/create-context\");\nvar import_focusable = require(\"@tamagui/focusable\");\nvar import_get_font_sized = require(\"@tamagui/get-font-sized\");\nvar import_size = require(\"@tamagui/size\");\nvar import_text = require(\"@tamagui/text\");\nvar import_web = require(\"@tamagui/web\");\nvar React = __toESM(require(\"react\"), 1);\nvar NAME = \"Label\";\nvar [LabelProvider, useLabelContextImpl] = (0, import_create_context.createContext)(NAME, {\n id: void 0,\n controlRef: {\n current: null\n }\n});\nvar labelSizeVariant = import_web.styled.dynamic(function(val, env) {\n var fontStyle = (0, import_get_font_sized.getFontSized)(val, env);\n var sizeKey = (0, import_size.resolveSizeToken)(val, \"size\");\n return {\n color: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.color,\n fontFamily: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontFamily,\n fontSize: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontSize,\n fontStyle: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontStyle,\n fontWeight: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontWeight,\n letterSpacing: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.letterSpacing,\n lineHeight: typeof sizeKey === \"number\" ? sizeKey : env.tokens.size[sizeKey],\n textTransform: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.textTransform\n };\n});\nvar LabelFrame = (0, import_web.styled)(import_text.SizableText, {\n displayName: \"Label\",\n render: \"label\",\n size: true,\n backgroundColor: \"transparent\",\n display: \"flex\",\n alignItems: \"center\",\n userSelect: \"none\",\n cursor: \"default\",\n variants: {\n size: labelSizeVariant\n }\n});\nvar Label = (0, import_web.createStyledHOC)(LabelFrame, function Label2(props, forwardedRef) {\n var { htmlFor, id: idProp, ...labelProps } = props;\n var controlRef = React.useRef(null);\n var ref = React.useRef(null);\n var composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref);\n var backupId = React.useId();\n var id = idProp !== null && idProp !== void 0 ? idProp : backupId;\n if (import_constants.isWeb) {\n (0, import_constants.useIsomorphicLayoutEffect)(function() {\n if (htmlFor) {\n var element = document.getElementById(htmlFor);\n var label = ref.current;\n if (label && element) {\n var getAriaLabel = function() {\n return element.getAttribute(\"aria-labelledby\");\n };\n var ariaLabelledBy = [\n id,\n getAriaLabel()\n ].filter(Boolean).join(\" \");\n element.setAttribute(\"aria-labelledby\", ariaLabelledBy);\n controlRef.current = element;\n return function() {\n var _getAriaLabel;\n if (!id) return;\n var ariaLabelledBy2 = (_getAriaLabel = getAriaLabel()) === null || _getAriaLabel === void 0 ? void 0 : _getAriaLabel.replace(id, \"\");\n if (ariaLabelledBy2 === \"\") {\n element.removeAttribute(\"aria-labelledby\");\n } else if (ariaLabelledBy2) {\n element.setAttribute(\"aria-labelledby\", ariaLabelledBy2);\n }\n };\n }\n }\n }, [\n id,\n htmlFor\n ]);\n }\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LabelProvider, {\n id,\n controlRef,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LabelFrame, {\n id,\n // @ts-ignore\n htmlFor,\n ...labelProps,\n ref: composedRefs,\n onMouseDown: function(event) {\n var _props_onMouseDown;\n (_props_onMouseDown = props.onMouseDown) === null || _props_onMouseDown === void 0 ? void 0 : _props_onMouseDown.call(props, event);\n if (!event.defaultPrevented && event.detail > 1) {\n event.preventDefault();\n }\n },\n onPress: function(event) {\n var _props_onPress;\n (_props_onPress = props.onPress) === null || _props_onPress === void 0 ? void 0 : _props_onPress.call(props, event);\n if (import_constants.isWeb) {\n if (htmlFor || !controlRef.current || event.defaultPrevented) return;\n var isClickingControl = controlRef.current.contains(event.target);\n var isUserClick = event.isTrusted === true;\n if (!isClickingControl && isUserClick) {\n controlRef.current.click();\n controlRef.current.focus();\n }\n } else {\n if (props.htmlFor) {\n (0, import_focusable.focusFocusable)(props.htmlFor);\n }\n }\n }\n })\n });\n});\nvar useLabelContext = function(element) {\n var context = useLabelContextImpl(\"LabelConsumer\");\n var { controlRef } = context;\n React.useEffect(function() {\n if (element) controlRef.current = element;\n }, [\n element,\n controlRef\n ]);\n return context.id;\n};\n//# sourceMappingURL=Label.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,gBAAgB,QAAQ,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D,OAAO,QAAQ;AACjB"}
1
+ {"version":3,"file":"Label.native.js","names":[],"sources":["jsx/Label.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Label_exports = {};\n__export(Label_exports, {\n Label: () => Label,\n LabelFrame: () => LabelFrame,\n useLabelContext: () => useLabelContext\n});\nmodule.exports = __toCommonJS(Label_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_create_context = require(\"@tamagui/create-context\");\nvar import_focusable = require(\"@tamagui/focusable\");\nvar import_get_font_sized = require(\"@tamagui/get-font-sized\");\nvar import_text = require(\"@tamagui/text\");\nvar import_web = require(\"@tamagui/web\");\nvar React = __toESM(require(\"react\"), 1);\nvar NAME = \"Label\";\nvar [LabelProvider, useLabelContextImpl] = (0, import_create_context.createContext)(NAME, {\n id: void 0,\n controlRef: {\n current: null\n }\n});\nvar LabelFrame = (0, import_web.styled)(import_text.SizableText, {\n displayName: \"Label\",\n render: \"label\",\n size: true,\n backgroundColor: \"transparent\",\n display: \"flex\",\n alignItems: \"center\",\n userSelect: \"none\",\n cursor: \"default\",\n variants: {\n size: import_get_font_sized.getFontSized\n }\n});\nvar Label = (0, import_web.createStyledHOC)(LabelFrame, function Label2(props, forwardedRef) {\n var { htmlFor, id: idProp, ...labelProps } = props;\n var controlRef = React.useRef(null);\n var ref = React.useRef(null);\n var composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref);\n var backupId = React.useId();\n var id = idProp !== null && idProp !== void 0 ? idProp : backupId;\n if (import_constants.isWeb) {\n (0, import_constants.useIsomorphicLayoutEffect)(function() {\n if (htmlFor) {\n var element = document.getElementById(htmlFor);\n var label = ref.current;\n if (label && element) {\n var getAriaLabel = function() {\n return element.getAttribute(\"aria-labelledby\");\n };\n var ariaLabelledBy = [\n id,\n getAriaLabel()\n ].filter(Boolean).join(\" \");\n element.setAttribute(\"aria-labelledby\", ariaLabelledBy);\n controlRef.current = element;\n return function() {\n var _getAriaLabel;\n if (!id) return;\n var ariaLabelledBy2 = (_getAriaLabel = getAriaLabel()) === null || _getAriaLabel === void 0 ? void 0 : _getAriaLabel.replace(id, \"\");\n if (ariaLabelledBy2 === \"\") {\n element.removeAttribute(\"aria-labelledby\");\n } else if (ariaLabelledBy2) {\n element.setAttribute(\"aria-labelledby\", ariaLabelledBy2);\n }\n };\n }\n }\n }, [\n id,\n htmlFor\n ]);\n }\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LabelProvider, {\n id,\n controlRef,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LabelFrame, {\n id,\n // @ts-ignore\n htmlFor,\n ...labelProps,\n ref: composedRefs,\n onMouseDown: function(event) {\n var _props_onMouseDown;\n (_props_onMouseDown = props.onMouseDown) === null || _props_onMouseDown === void 0 ? void 0 : _props_onMouseDown.call(props, event);\n if (!event.defaultPrevented && event.detail > 1) {\n event.preventDefault();\n }\n },\n onPress: function(event) {\n var _props_onPress;\n (_props_onPress = props.onPress) === null || _props_onPress === void 0 ? void 0 : _props_onPress.call(props, event);\n if (import_constants.isWeb) {\n if (htmlFor || !controlRef.current || event.defaultPrevented) return;\n var isClickingControl = controlRef.current.contains(event.target);\n var isUserClick = event.isTrusted === true;\n if (!isClickingControl && isUserClick) {\n controlRef.current.click();\n controlRef.current.focus();\n }\n } else {\n if (props.htmlFor) {\n (0, import_focusable.focusFocusable)(props.htmlFor);\n }\n }\n }\n })\n });\n});\nvar useLabelContext = function(element) {\n var context = useLabelContextImpl(\"LabelConsumer\");\n var { controlRef } = context;\n React.useEffect(function() {\n if (element) controlRef.current = element;\n }, [\n element,\n controlRef\n ]);\n return context.id;\n};\n//# sourceMappingURL=Label.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AAC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C,MAAM,oBAAoB,MAAM,SAAS,GAAG;KAC/C,MAAM,eAAe;IACvB;GACF;GACA,SAAS,SAAS,OAAO;IACvB,IAAI;IACJ,CAAC,iBAAiB,MAAM,aAAa,QAAQ,mBAAmB,KAAK,IAAI,KAAK,IAAI,eAAe,KAAK,OAAO,KAAK;IAClH,IAAI,iBAAiB,OAAO;KAC1B,IAAI,WAAW,CAAC,WAAW,WAAW,MAAM,kBAAkB;KAC9D,IAAI,oBAAoB,WAAW,QAAQ,SAAS,MAAM,MAAM;KAChE,IAAI,cAAc,MAAM,cAAc;KACtC,IAAI,CAAC,qBAAqB,aAAa;MACrC,WAAW,QAAQ,MAAM;MACzB,WAAW,QAAQ,MAAM;KAC3B;IACF,OAAO;KACL,IAAI,MAAM,SAAS;MACjB,CAAC,GAAG,iBAAiB,eAAc,CAAE,MAAM,OAAO;KACpD;IACF;GACF;EACF,CAAC;CACH,CAAC;AACH,CAAC;AACD,IAAI,kBAAkB,SAAS,SAAS;CACtC,IAAI,UAAU,oBAAoB,eAAe;CACjD,IAAI,EAAE,eAAe;CACrB,MAAM,UAAU,WAAW;EACzB,IAAI,SAAS,WAAW,UAAU;CACpC,GAAG,CACD,SACA,UACF,CAAC;CACD,OAAO,QAAQ;AACjB"}
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@tamagui/label",
3
- "version": "3.0.0-beta.924.1",
3
+ "version": "3.0.0",
4
+ "license": "MIT",
4
5
  "source": "src/index.ts",
5
6
  "files": [
6
7
  "src",
@@ -34,19 +35,18 @@
34
35
  "clean:build": "tamagui-build clean:build"
35
36
  },
36
37
  "dependencies": {
37
- "@tamagui/compose-refs": "3.0.0-beta.924.1",
38
- "@tamagui/constants": "3.0.0-beta.924.1",
39
- "@tamagui/create-context": "3.0.0-beta.924.1",
40
- "@tamagui/focusable": "3.0.0-beta.924.1",
41
- "@tamagui/get-font-sized": "3.0.0-beta.924.1",
42
- "@tamagui/size": "3.0.0-beta.924.1",
43
- "@tamagui/text": "3.0.0-beta.924.1",
44
- "@tamagui/web": "3.0.0-beta.924.1"
38
+ "@tamagui/compose-refs": "3.0.0",
39
+ "@tamagui/constants": "3.0.0",
40
+ "@tamagui/create-context": "3.0.0",
41
+ "@tamagui/focusable": "3.0.0",
42
+ "@tamagui/get-font-sized": "3.0.0",
43
+ "@tamagui/text": "3.0.0",
44
+ "@tamagui/web": "3.0.0"
45
45
  },
46
46
  "devDependencies": {
47
- "@tamagui/build": "3.0.0-beta.924.1",
47
+ "@tamagui/build": "3.0.0",
48
48
  "react": "19.2.3",
49
- "react-native": "0.86.2"
49
+ "react-native": "0.87.1"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "react": ">=19"
@@ -56,5 +56,6 @@
56
56
  "type": "git",
57
57
  "url": "git+https://github.com/tamagui/tamagui.git",
58
58
  "directory": "code/ui/label"
59
- }
59
+ },
60
+ "releaseSourceCommit": "15fbca480b143f876f6975601e23a17d3f90d2ee"
60
61
  }
package/src/Label.tsx CHANGED
@@ -3,9 +3,8 @@ import { isWeb, useIsomorphicLayoutEffect } from '@tamagui/constants'
3
3
  import { createContext } from '@tamagui/create-context'
4
4
  import { focusFocusable } from '@tamagui/focusable'
5
5
  import { getFontSized } from '@tamagui/get-font-sized'
6
- import { resolveSizeToken } from '@tamagui/size'
7
6
  import { SizableText } from '@tamagui/text'
8
- import type { FontSizeTokens, GetProps, SizeTokens } from '@tamagui/web'
7
+ import type { GetProps } from '@tamagui/web'
9
8
  import { createStyledHOC, styled } from '@tamagui/web'
10
9
  import * as React from 'react'
11
10
 
@@ -21,23 +20,6 @@ const [LabelProvider, useLabelContextImpl] = createContext<LabelContextValue>(NA
21
20
  controlRef: { current: null },
22
21
  })
23
22
 
24
- const labelSizeVariant = styled.dynamic<SizeTokens | true>((val, env) => {
25
- const fontStyle = getFontSized(val as FontSizeTokens, env)
26
- // line-height matches the control height at the same size token, so a Label
27
- // sits flush next to the Input/Button it labels
28
- const sizeKey = resolveSizeToken(val, 'size')
29
- return {
30
- color: fontStyle?.color,
31
- fontFamily: fontStyle?.fontFamily,
32
- fontSize: fontStyle?.fontSize,
33
- fontStyle: fontStyle?.fontStyle,
34
- fontWeight: fontStyle?.fontWeight,
35
- letterSpacing: fontStyle?.letterSpacing,
36
- lineHeight: typeof sizeKey === 'number' ? sizeKey : env.tokens.size[sizeKey],
37
- textTransform: fontStyle?.textTransform,
38
- }
39
- })
40
-
41
23
  // Unstyled Label frame: structural layout (label element, flex alignment,
42
24
  // selection/cursor resets) + the size mechanism (size-derived font) only. The
43
25
  // theme text color + the press color feedback live in the tamagui skin
@@ -53,7 +35,7 @@ export const LabelFrame = styled(SizableText, {
53
35
  cursor: 'default',
54
36
 
55
37
  variants: {
56
- size: labelSizeVariant,
38
+ size: getFontSized,
57
39
  } as const,
58
40
  })
59
41
 
package/types/Label.d.ts CHANGED
@@ -1,21 +1,21 @@
1
1
  import type { GetProps } from '@tamagui/web';
2
2
  import * as React from 'react';
3
- export declare const LabelFrame: React.FunctionComponent<Omit<import("@tamagui/web").TextNonStyleProps, "size" | keyof import("@tamagui/web").TextStylePropsBase> & import("@tamagui/web").WithThemeValues<import("@tamagui/web").TextStylePropsBase> & import("@tamagui/web").WithFlatVariantValues<{
4
- size?: string | number | true | import("@tamagui/web").UnionableNumber | import("@tamagui/web").UnionableString | (string & {}) | undefined;
5
- }> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").TextStylePropsBase>> & {
3
+ export declare const LabelFrame: React.FunctionComponent<Omit<import("@tamagui/web").TextNonStyleProps, "size"> & Omit<import("@tamagui/web").WithThemeValues<Omit<import("@tamagui/web").TextStylePropsBase, "size">> & import("@tamagui/web").WithFlatVariantValues<{
4
+ size?: import("@tamagui/get-font-sized").GetFontSizedInput | undefined;
5
+ }> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").TextStylePropsBase>>, keyof import("@tamagui/web").TextNonStyleProps> & {
6
6
  ref?: React.Ref<import("@tamagui/web").TamaguiTextElement> | undefined;
7
7
  }> & import("@tamagui/web").StaticComponentObject<import("@tamagui/web").TamaDefer, import("@tamagui/web").TamaguiTextElement, import("@tamagui/web").TextNonStyleProps, import("@tamagui/web").TextStylePropsBase, {
8
- size?: string | number | true | import("@tamagui/web").UnionableNumber | import("@tamagui/web").UnionableString | (string & {}) | undefined;
8
+ size?: import("@tamagui/get-font-sized").GetFontSizedInput | undefined;
9
9
  }, import("@tamagui/web").StaticConfigPublic> & Omit<import("@tamagui/web").StaticConfigPublic, "staticConfig"> & {
10
10
  __tama: [import("@tamagui/web").TamaDefer, import("@tamagui/web").TamaguiTextElement, import("@tamagui/web").TextNonStyleProps, import("@tamagui/web").TextStylePropsBase, {
11
- size?: string | number | true | import("@tamagui/web").UnionableNumber | import("@tamagui/web").UnionableString | (string & {}) | undefined;
11
+ size?: import("@tamagui/get-font-sized").GetFontSizedInput | undefined;
12
12
  }, import("@tamagui/web").StaticConfigPublic];
13
13
  };
14
14
  export type LabelProps = GetProps<typeof LabelFrame> & {
15
15
  htmlFor?: string;
16
16
  };
17
17
  export declare const Label: import("@tamagui/web").TamaguiComponent<import("@tamagui/web").TamaDefer, import("@tamagui/web").TamaguiTextElement, import("@tamagui/web").TextNonStyleProps, import("@tamagui/web").TextStylePropsBase, {
18
- size?: string | number | true | import("@tamagui/web").UnionableNumber | import("@tamagui/web").UnionableString | (string & {}) | undefined;
18
+ size?: import("@tamagui/get-font-sized").GetFontSizedInput | undefined;
19
19
  }, import("@tamagui/web").StaticConfigPublic>;
20
20
  export declare const useLabelContext: (element?: HTMLElement | null) => string | undefined;
21
21
  //# sourceMappingURL=Label.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../src/Label.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAkB,QAAQ,EAAc,MAAM,cAAc,CAAA;AAExE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAmC9B,eAAO,MAAM,UAAU;;;;;;;;;;CAarB,CAAA;AAEF,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,GAAG;IACrD,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,KAAK;;6CAmFhB,CAAA;AAEF,eAAO,MAAM,eAAe,aAAc,WAAW,GAAG,IAAI,uBAS3D,CAAA"}
1
+ {"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../src/Label.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAE5C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAkB9B,eAAO,MAAM,UAAU;;;;;;;;;;CAarB,CAAA;AAEF,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,GAAG;IACrD,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,KAAK;;6CAmFhB,CAAA;AAEF,eAAO,MAAM,eAAe,aAAc,WAAW,GAAG,IAAI,uBAS3D,CAAA"}