@glob-ui/label 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Kevin Martínez E
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,17 @@
1
- # Temporary Holding Version
1
+ # @glob-ui/label
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A styled `<label>`, with an optional required marker.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pnpm add @glob-ui/label
9
+ ```
10
+
11
+ ## Documentation
12
+
13
+ Full docs, examples and the accessibility table: [Label](https://github.com/kevin-martineze/GlobUI/tree/main/apps/docs/content/docs/components/label.mdx).
14
+
15
+ ## License
16
+
17
+ MIT. See [LICENSE](./LICENSE).
@@ -0,0 +1,13 @@
1
+ import * as react from 'react';
2
+ import * as class_variance_authority_types from 'class-variance-authority/types';
3
+ import { VariantProps } from 'class-variance-authority';
4
+
5
+ declare const labelVariants: (props?: ({
6
+ size?: "sm" | "md" | "lg" | null | undefined;
7
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
8
+ interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement>, VariantProps<typeof labelVariants> {
9
+ required?: boolean;
10
+ }
11
+ declare const Label: react.ForwardRefExoticComponent<LabelProps & react.RefAttributes<HTMLLabelElement>>;
12
+
13
+ export { Label, type LabelProps, labelVariants };
@@ -0,0 +1,13 @@
1
+ import * as react from 'react';
2
+ import * as class_variance_authority_types from 'class-variance-authority/types';
3
+ import { VariantProps } from 'class-variance-authority';
4
+
5
+ declare const labelVariants: (props?: ({
6
+ size?: "sm" | "md" | "lg" | null | undefined;
7
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
8
+ interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement>, VariantProps<typeof labelVariants> {
9
+ required?: boolean;
10
+ }
11
+ declare const Label: react.ForwardRefExoticComponent<LabelProps & react.RefAttributes<HTMLLabelElement>>;
12
+
13
+ export { Label, type LabelProps, labelVariants };
package/dist/index.js ADDED
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
10
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
+ var __spreadValues = (a, b) => {
12
+ for (var prop in b || (b = {}))
13
+ if (__hasOwnProp.call(b, prop))
14
+ __defNormalProp(a, prop, b[prop]);
15
+ if (__getOwnPropSymbols)
16
+ for (var prop of __getOwnPropSymbols(b)) {
17
+ if (__propIsEnum.call(b, prop))
18
+ __defNormalProp(a, prop, b[prop]);
19
+ }
20
+ return a;
21
+ };
22
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
23
+ var __objRest = (source, exclude) => {
24
+ var target = {};
25
+ for (var prop in source)
26
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
27
+ target[prop] = source[prop];
28
+ if (source != null && __getOwnPropSymbols)
29
+ for (var prop of __getOwnPropSymbols(source)) {
30
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
31
+ target[prop] = source[prop];
32
+ }
33
+ return target;
34
+ };
35
+ var __export = (target, all) => {
36
+ for (var name in all)
37
+ __defProp(target, name, { get: all[name], enumerable: true });
38
+ };
39
+ var __copyProps = (to, from, except, desc) => {
40
+ if (from && typeof from === "object" || typeof from === "function") {
41
+ for (let key of __getOwnPropNames(from))
42
+ if (!__hasOwnProp.call(to, key) && key !== except)
43
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
44
+ }
45
+ return to;
46
+ };
47
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
48
+
49
+ // src/index.ts
50
+ var index_exports = {};
51
+ __export(index_exports, {
52
+ Label: () => Label,
53
+ labelVariants: () => labelVariants
54
+ });
55
+ module.exports = __toCommonJS(index_exports);
56
+
57
+ // src/label.tsx
58
+ var import_react = require("react");
59
+ var import_class_variance_authority = require("class-variance-authority");
60
+ var import_utils = require("@glob-ui/utils");
61
+ var import_jsx_runtime = require("react/jsx-runtime");
62
+ var labelVariants = (0, import_class_variance_authority.cva)(
63
+ "inline-flex items-center gap-1 font-medium leading-none text-glob-text peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
64
+ {
65
+ variants: {
66
+ size: {
67
+ sm: "text-xs",
68
+ md: "text-sm",
69
+ lg: "text-base"
70
+ }
71
+ },
72
+ defaultVariants: {
73
+ size: "md"
74
+ }
75
+ }
76
+ );
77
+ var Label = (0, import_react.forwardRef)(
78
+ (_a, ref) => {
79
+ var _b = _a, { className, size, required, children } = _b, props = __objRest(_b, ["className", "size", "required", "children"]);
80
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", __spreadProps(__spreadValues({ ref, className: (0, import_utils.cn)(labelVariants({ size, className })) }, props), { children: [
81
+ children,
82
+ required && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "aria-hidden": "true", className: "text-glob-primary", children: "*" })
83
+ ] }));
84
+ }
85
+ );
86
+ Label.displayName = "Label";
87
+ // Annotate the CommonJS export names for ESM import in node:
88
+ 0 && (module.exports = {
89
+ Label,
90
+ labelVariants
91
+ });
92
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/label.tsx"],"sourcesContent":["export { Label, labelVariants } from \"./label\"\nexport type { LabelProps } from \"./label\"\n","import { forwardRef } from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"@glob-ui/utils\"\n\nconst labelVariants = cva(\n \"inline-flex items-center gap-1 font-medium leading-none text-glob-text peer-disabled:cursor-not-allowed peer-disabled:opacity-50\",\n {\n variants: {\n size: {\n sm: \"text-xs\",\n md: \"text-sm\",\n lg: \"text-base\",\n },\n },\n defaultVariants: {\n size: \"md\",\n },\n }\n)\n\nexport interface LabelProps\n extends React.LabelHTMLAttributes<HTMLLabelElement>,\n VariantProps<typeof labelVariants> {\n required?: boolean\n}\n\nconst Label = forwardRef<HTMLLabelElement, LabelProps>(\n ({ className, size, required, children, ...props }, ref) => {\n return (\n <label ref={ref} className={cn(labelVariants({ size, className }))} {...props}>\n {children}\n {required && (\n <span aria-hidden=\"true\" className=\"text-glob-primary\">\n *\n </span>\n )}\n </label>\n )\n }\n)\nLabel.displayName = \"Label\"\n\nexport { Label, labelVariants }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAA2B;AAC3B,sCAAuC;AACvC,mBAAmB;AA2Bb;AAzBN,IAAM,oBAAgB;AAAA,EACpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACN;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAQA,IAAM,YAAQ;AAAA,EACZ,CAAC,IAAmD,QAAQ;AAA3D,iBAAE,aAAW,MAAM,UAAU,SA3BhC,IA2BG,IAA0C,kBAA1C,IAA0C,CAAxC,aAAW,QAAM,YAAU;AAC5B,WACE,6CAAC,wCAAM,KAAU,eAAW,iBAAG,cAAc,EAAE,MAAM,UAAU,CAAC,CAAC,KAAO,QAAvE,EACE;AAAA;AAAA,MACA,YACC,4CAAC,UAAK,eAAY,QAAO,WAAU,qBAAoB,eAEvD;AAAA,QAEJ;AAAA,EAEJ;AACF;AACA,MAAM,cAAc;","names":[]}
package/dist/index.mjs ADDED
@@ -0,0 +1,67 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+
33
+ // src/label.tsx
34
+ import { forwardRef } from "react";
35
+ import { cva } from "class-variance-authority";
36
+ import { cn } from "@glob-ui/utils";
37
+ import { jsx, jsxs } from "react/jsx-runtime";
38
+ var labelVariants = cva(
39
+ "inline-flex items-center gap-1 font-medium leading-none text-glob-text peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
40
+ {
41
+ variants: {
42
+ size: {
43
+ sm: "text-xs",
44
+ md: "text-sm",
45
+ lg: "text-base"
46
+ }
47
+ },
48
+ defaultVariants: {
49
+ size: "md"
50
+ }
51
+ }
52
+ );
53
+ var Label = forwardRef(
54
+ (_a, ref) => {
55
+ var _b = _a, { className, size, required, children } = _b, props = __objRest(_b, ["className", "size", "required", "children"]);
56
+ return /* @__PURE__ */ jsxs("label", __spreadProps(__spreadValues({ ref, className: cn(labelVariants({ size, className })) }, props), { children: [
57
+ children,
58
+ required && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "text-glob-primary", children: "*" })
59
+ ] }));
60
+ }
61
+ );
62
+ Label.displayName = "Label";
63
+ export {
64
+ Label,
65
+ labelVariants
66
+ };
67
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/label.tsx"],"sourcesContent":["import { forwardRef } from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"@glob-ui/utils\"\n\nconst labelVariants = cva(\n \"inline-flex items-center gap-1 font-medium leading-none text-glob-text peer-disabled:cursor-not-allowed peer-disabled:opacity-50\",\n {\n variants: {\n size: {\n sm: \"text-xs\",\n md: \"text-sm\",\n lg: \"text-base\",\n },\n },\n defaultVariants: {\n size: \"md\",\n },\n }\n)\n\nexport interface LabelProps\n extends React.LabelHTMLAttributes<HTMLLabelElement>,\n VariantProps<typeof labelVariants> {\n required?: boolean\n}\n\nconst Label = forwardRef<HTMLLabelElement, LabelProps>(\n ({ className, size, required, children, ...props }, ref) => {\n return (\n <label ref={ref} className={cn(labelVariants({ size, className }))} {...props}>\n {children}\n {required && (\n <span aria-hidden=\"true\" className=\"text-glob-primary\">\n *\n </span>\n )}\n </label>\n )\n }\n)\nLabel.displayName = \"Label\"\n\nexport { Label, labelVariants }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,kBAAkB;AAC3B,SAAS,WAA8B;AACvC,SAAS,UAAU;AA2Bb,SAGI,KAHJ;AAzBN,IAAM,gBAAgB;AAAA,EACpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACN;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAQA,IAAM,QAAQ;AAAA,EACZ,CAAC,IAAmD,QAAQ;AAA3D,iBAAE,aAAW,MAAM,UAAU,SA3BhC,IA2BG,IAA0C,kBAA1C,IAA0C,CAAxC,aAAW,QAAM,YAAU;AAC5B,WACE,qBAAC,wCAAM,KAAU,WAAW,GAAG,cAAc,EAAE,MAAM,UAAU,CAAC,CAAC,KAAO,QAAvE,EACE;AAAA;AAAA,MACA,YACC,oBAAC,UAAK,eAAY,QAAO,WAAU,qBAAoB,eAEvD;AAAA,QAEJ;AAAA,EAEJ;AACF;AACA,MAAM,cAAc;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,68 @@
1
1
  {
2
2
  "name": "@glob-ui/label",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "main": "./dist/index.js",
5
+ "module": "./dist/index.mjs",
6
+ "types": "./dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "import": {
10
+ "types": "./dist/index.d.mts",
11
+ "default": "./dist/index.mjs"
12
+ },
13
+ "require": {
14
+ "types": "./dist/index.d.ts",
15
+ "default": "./dist/index.js"
16
+ }
17
+ },
18
+ "./package.json": "./package.json"
19
+ },
20
+ "files": [
21
+ "dist/",
22
+ "LICENSE",
23
+ "README.md"
24
+ ],
25
+ "peerDependencies": {
26
+ "react": "^19"
27
+ },
28
+ "dependencies": {
29
+ "@glob-ui/utils": "0.1.0",
30
+ "class-variance-authority": "^0.7.1"
31
+ },
32
+ "devDependencies": {
33
+ "tsup": "^8.5.1"
34
+ },
35
+ "description": "A styled `<label>`, with an optional required marker.",
36
+ "keywords": [
37
+ "react",
38
+ "glob-ui",
39
+ "components",
40
+ "accessible",
41
+ "tailwind",
42
+ "label"
43
+ ],
44
+ "license": "MIT",
45
+ "author": "Kevin Martínez E",
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "git+https://github.com/kevin-martineze/GlobUI.git",
49
+ "directory": "packages/label"
50
+ },
51
+ "homepage": "https://github.com/kevin-martineze/GlobUI#readme",
52
+ "bugs": {
53
+ "url": "https://github.com/kevin-martineze/GlobUI/issues"
54
+ },
55
+ "publishConfig": {
56
+ "access": "public",
57
+ "provenance": true
58
+ },
59
+ "sideEffects": false,
60
+ "type": "commonjs",
61
+ "engines": {
62
+ "node": ">=18.18"
63
+ },
64
+ "scripts": {
65
+ "build": "tsup",
66
+ "dev": "tsup --watch --no-clean"
67
+ }
6
68
  }