@jamsrui/label 0.0.9 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +1 -1
- package/dist/label-config.d.mts +18 -0
- package/dist/label-config.mjs +1 -0
- package/dist/label.mjs +1 -1
- package/dist/styles.d.mts +5 -0
- package/dist/styles.mjs +1 -0
- package/dist/use-label.mjs +1 -1
- package/package.json +5 -4
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{Label as r}from"./label.mjs";export{r as Label};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { WithGlobalConfig } from '@jamsrui/core';
|
|
3
|
+
import { Label } from './label.mjs';
|
|
4
|
+
import 'react';
|
|
5
|
+
import './use-label.mjs';
|
|
6
|
+
import '@jamsrui/utils';
|
|
7
|
+
|
|
8
|
+
declare const useLabelConfig: () => LabelConfig.Props;
|
|
9
|
+
declare const LabelConfig: (props: Omit<Partial<LabelConfig.Props>, "children"> & {
|
|
10
|
+
merge?: boolean;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
13
|
+
declare namespace LabelConfig {
|
|
14
|
+
interface Props extends WithGlobalConfig<Label.Props> {
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { LabelConfig, useLabelConfig };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{createConfigContext as e}from"@jamsrui/utils";const[a,r]=e({displayName:"LabelConfigContext"});export{a as LabelConfig,r as useLabelConfig};
|
package/dist/label.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useRenderElement as
|
|
1
|
+
"use client";import{useRenderElement as n}from"@jamsrui/hooks";import{mergeConfigProps as s}from"@jamsrui/utils";import{useLabelConfig as a}from"./label-config.mjs";import{labelVariants as l}from"./styles.mjs";import{useLabel as p}from"./use-label.mjs";const d=e=>{const r=a(),o=s(l.defaultVariants,r,e),t=p(o);return n("label",{props:[t]})};export{d as Label};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as _jamsrui_utils from '@jamsrui/utils';
|
|
2
|
+
|
|
3
|
+
declare const labelVariants: _jamsrui_utils.TVReturnType<{} | {} | {}, undefined, "label cursor-default shrink-0 text-sm font-normal text-foreground group-data-invalid:text-danger group-data-disabled:cursor-not-allowed", {} | {}, undefined, _jamsrui_utils.TVReturnType<unknown, undefined, "label cursor-default shrink-0 text-sm font-normal text-foreground group-data-invalid:text-danger group-data-disabled:cursor-not-allowed", unknown, unknown, undefined>>;
|
|
4
|
+
|
|
5
|
+
export { labelVariants };
|
package/dist/styles.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{tv as t}from"@jamsrui/utils";const r=t({base:"label cursor-default shrink-0 text-sm font-normal text-foreground group-data-invalid:text-danger group-data-disabled:cursor-not-allowed"});export{r as labelVariants};
|
package/dist/use-label.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as
|
|
1
|
+
"use client";import{useCallback as u}from"react";import{useFieldA11yContext as m}from"@jamsrui/context";import{useMergeRefs as i}from"@jamsrui/hooks";import{labelVariants as c}from"./styles.mjs";const P=s=>{const{onMouseDown:t,className:o,ref:a,...l}=s,r=m(),n=i([a,r?.setLabelRef]),p=u(e=>{e.target.closest("input, button, textarea, select")||(t?.(e),document.activeElement?.nodeName==="INPUT"&&e.preventDefault(),e.detail>1&&e.preventDefault())},[t]);return{ref:n,onMouseDown:p,className:c({className:o}),...r?.getLabelProps(),...l}};export{P as useLabel};
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jamsrui/label",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"react": ">=19"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@jamsrui/
|
|
9
|
-
"@jamsrui/context": "^0.0.
|
|
10
|
-
"@jamsrui/
|
|
8
|
+
"@jamsrui/core": "^0.0.14",
|
|
9
|
+
"@jamsrui/context": "^0.0.7",
|
|
10
|
+
"@jamsrui/utils": "^0.0.18",
|
|
11
|
+
"@jamsrui/hooks": "^0.0.18"
|
|
11
12
|
},
|
|
12
13
|
"exports": {
|
|
13
14
|
".": {
|