@alexgorbatchev/shadcn 0.0.102 → 0.0.104
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/{chunk-519826kj.js → chunk-77k07x58.js} +1 -1
- package/dist/{chunk-9n0axzd5.js → chunk-bfv4qesg.js} +14 -2
- package/dist/{chunk-pn35mpc0.js → chunk-che2mtt5.js} +1 -1
- package/dist/{chunk-g4s1f61z.js → chunk-e1hkq1mw.js} +507 -383
- package/dist/{chunk-x9p6qh9d.js → chunk-r4r4qcyx.js} +1 -1
- package/dist/{chunk-rpjkf15t.js → chunk-sdkk4n8d.js} +1 -1
- package/dist/components/DescriptionList.d.ts +18 -0
- package/dist/components/Field.d.ts +8 -2
- package/dist/components/FilterChip.d.ts +17 -0
- package/dist/components/Message.d.ts +14 -1
- package/dist/components/assistant-ui/elements/EditMessage.js +2 -2
- package/dist/components/assistant-ui/elements/ElicitationForm.js +2 -2
- package/dist/components/assistant-ui/elements/FeedbackDialog.js +2 -2
- package/dist/components/assistant-ui/elements/ModelPicker.js +2 -2
- package/dist/components/assistant-ui/index.js +5 -5
- package/dist/components/event-calendar/index.js +1 -1
- package/dist/components/image-viewer/index.js +1 -1
- package/dist/components/input-otp/index.js +1 -1
- package/dist/components/json-render/index.js +2 -2
- package/dist/index.d.ts +5 -1
- package/dist/index.js +18 -2
- package/dist/prototype.js +1 -1
- package/llms/components/data-display/DescriptionList.md +56 -0
- package/llms/components/forms/Field.md +25 -0
- package/llms/components/forms/FilterChip.md +95 -0
- package/llms/components/messaging/Message.md +47 -1
- package/llms.txt +2 -0
- package/package.json +1 -1
|
@@ -68,11 +68,23 @@ function FieldContent2({ density, className, ...props }) {
|
|
|
68
68
|
...props
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function hasSelectionWithin(element) {
|
|
72
|
+
const selection = element.ownerDocument.getSelection();
|
|
73
|
+
if (!selection || selection.isCollapsed || selection.rangeCount === 0)
|
|
74
|
+
return false;
|
|
75
|
+
return selection.getRangeAt(0).intersectsNode(element);
|
|
76
|
+
}
|
|
77
|
+
function FieldLabel2({ density, className, selectable = false, onClick, ...props }) {
|
|
72
78
|
return /* @__PURE__ */ jsx(Label2, {
|
|
73
79
|
"data-density": density,
|
|
74
80
|
"data-slot": "field-label",
|
|
75
|
-
|
|
81
|
+
"data-selectable": selectable || undefined,
|
|
82
|
+
className: cn2("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-sm has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring *:data-[slot=field]:p-2.5", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col", selectable && "select-text", className),
|
|
83
|
+
onClick: (event) => {
|
|
84
|
+
if (selectable && hasSelectionWithin(event.currentTarget))
|
|
85
|
+
event.preventDefault();
|
|
86
|
+
onClick?.(event);
|
|
87
|
+
},
|
|
76
88
|
...props
|
|
77
89
|
});
|
|
78
90
|
}
|