@arcfusionz/arc-primitive-ui 0.3.3 → 0.3.5
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/components/Breadcrumb/Breadcrumb.d.ts +5 -1
- package/dist/components/Breadcrumb/Breadcrumb.js +5 -1
- package/dist/components/Combobox/Combobox.d.ts +14 -0
- package/dist/components/Combobox/Combobox.js +16 -3
- package/dist/components/Select/Select.d.ts +7 -0
- package/dist/components/Select/Select.js +8 -2
- package/package.json +1 -1
|
@@ -31,7 +31,11 @@ interface BreadcrumbItemProps extends Omit<ComponentPropsWithoutRef<"li">, "clas
|
|
|
31
31
|
/** Additional classes merged after the item recipe. */
|
|
32
32
|
className?: string;
|
|
33
33
|
}
|
|
34
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* One entry in the trail: wraps a link, the current page, or a composed
|
|
36
|
+
* control. Supporting metadata such as a `Badge` belongs beside that primary
|
|
37
|
+
* crumb content in the same item, keeping it outside the link's click target.
|
|
38
|
+
*/
|
|
35
39
|
declare const BreadcrumbItem: import("react").ForwardRefExoticComponent<BreadcrumbItemProps & import("react").RefAttributes<HTMLLIElement>>;
|
|
36
40
|
interface BreadcrumbLinkVariantsOptions {
|
|
37
41
|
className?: string;
|
|
@@ -81,7 +81,11 @@ const BreadcrumbList = forwardRef(({ render, className, ...rest }, ref) => useRe
|
|
|
81
81
|
}
|
|
82
82
|
}));
|
|
83
83
|
BreadcrumbList.displayName = "BreadcrumbList";
|
|
84
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* One entry in the trail: wraps a link, the current page, or a composed
|
|
86
|
+
* control. Supporting metadata such as a `Badge` belongs beside that primary
|
|
87
|
+
* crumb content in the same item, keeping it outside the link's click target.
|
|
88
|
+
*/
|
|
85
89
|
const BreadcrumbItem = forwardRef(({ render, className, ...rest }, ref) => useRender({
|
|
86
90
|
defaultTagName: "li",
|
|
87
91
|
render,
|
|
@@ -55,6 +55,13 @@ interface ComboboxInputGroupProps extends Omit<ComponentPropsWithoutRef<typeof C
|
|
|
55
55
|
clearLabel?: string;
|
|
56
56
|
/** Accessible name for the folded chevron button — override with localized copy. */
|
|
57
57
|
triggerLabel?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Leading static badge before the input. Pass the existing `<Badge>`
|
|
60
|
+
* component to use its variants, appearances, sizes, icons, dots, and
|
|
61
|
+
* custom classes. Keep it non-interactive so clicking the adornment can
|
|
62
|
+
* continue to focus the input.
|
|
63
|
+
*/
|
|
64
|
+
badge?: ReactNode;
|
|
58
65
|
className?: string;
|
|
59
66
|
}
|
|
60
67
|
/**
|
|
@@ -107,6 +114,13 @@ interface ComboboxTriggerProps extends Omit<BaseTriggerProps, "className"> {
|
|
|
107
114
|
* convenience prop.
|
|
108
115
|
*/
|
|
109
116
|
anchorWidth?: CSSProperties["width"];
|
|
117
|
+
/**
|
|
118
|
+
* Leading static badge before the selected value. Pass the existing
|
|
119
|
+
* `<Badge>` component to use its variants, appearances, sizes, icons, dots,
|
|
120
|
+
* and custom classes. Keep it non-interactive: links and delete buttons
|
|
121
|
+
* cannot be nested inside the trigger button.
|
|
122
|
+
*/
|
|
123
|
+
badge?: ReactNode;
|
|
110
124
|
/** Replaces the up-down carets. Decorative — hidden from assistive technology. */
|
|
111
125
|
icon?: ReactNode;
|
|
112
126
|
className?: string;
|
|
@@ -112,13 +112,17 @@ function comboboxInputGroupVariants({ size = "md", className } = {}) {
|
|
|
112
112
|
* this frame. Give the input an accessible name: a native `<label htmlFor>`,
|
|
113
113
|
* a composed `FieldLabel`, or `aria-label` on `ComboboxInput`.
|
|
114
114
|
*/
|
|
115
|
-
const ComboboxInputGroup = forwardRef(({ size = "md", showTrigger = true, showClear = false, clearLabel = "Clear selection", triggerLabel = "Show options", className, children, ...rest }, ref) => /* @__PURE__ */ jsx(ComboboxInputGroupContext.Provider, {
|
|
115
|
+
const ComboboxInputGroup = forwardRef(({ size = "md", showTrigger = true, showClear = false, clearLabel = "Clear selection", triggerLabel = "Show options", badge, className, children, ...rest }, ref) => /* @__PURE__ */ jsx(ComboboxInputGroupContext.Provider, {
|
|
116
116
|
value: size,
|
|
117
117
|
children: /* @__PURE__ */ jsxs(Combobox.InputGroup, {
|
|
118
118
|
ref,
|
|
119
119
|
className: cn(comboboxInputGroupVariants({ size }), className),
|
|
120
120
|
...rest,
|
|
121
121
|
children: [
|
|
122
|
+
badge != null && /* @__PURE__ */ jsx("span", {
|
|
123
|
+
className: "flex shrink-0",
|
|
124
|
+
children: badge
|
|
125
|
+
}),
|
|
122
126
|
children,
|
|
123
127
|
showClear && /* @__PURE__ */ jsx(ComboboxClear, {
|
|
124
128
|
"aria-label": clearLabel,
|
|
@@ -186,7 +190,7 @@ function mergeAnchorWidth(anchorWidth, style) {
|
|
|
186
190
|
* `ComboboxLabel` (or a composed `FieldLabel`); without one, pass
|
|
187
191
|
* `aria-label`.
|
|
188
192
|
*/
|
|
189
|
-
const ComboboxTrigger = forwardRef(({ variant = "outline", size = "md", fullWidth = false, anchorWidth, icon, style, className, children, ...rest }, ref) => /* @__PURE__ */ jsxs(Combobox.Trigger, {
|
|
193
|
+
const ComboboxTrigger = forwardRef(({ variant = "outline", size = "md", fullWidth = false, anchorWidth, badge, icon, style, className, children, ...rest }, ref) => /* @__PURE__ */ jsxs(Combobox.Trigger, {
|
|
190
194
|
ref,
|
|
191
195
|
className: cn("group/combobox-trigger", selectTriggerVariants({
|
|
192
196
|
variant,
|
|
@@ -195,7 +199,16 @@ const ComboboxTrigger = forwardRef(({ variant = "outline", size = "md", fullWidt
|
|
|
195
199
|
}), className),
|
|
196
200
|
style: mergeAnchorWidth(anchorWidth, style),
|
|
197
201
|
...rest,
|
|
198
|
-
children: [/* @__PURE__ */
|
|
202
|
+
children: [badge != null ? /* @__PURE__ */ jsxs("span", {
|
|
203
|
+
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
204
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
205
|
+
className: "flex shrink-0",
|
|
206
|
+
children: badge
|
|
207
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
208
|
+
className: "min-w-0 truncate text-primary group-data-placeholder/combobox-trigger:text-muted-foreground",
|
|
209
|
+
children
|
|
210
|
+
})]
|
|
211
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
199
212
|
className: "min-w-0 truncate text-primary group-data-placeholder/combobox-trigger:text-muted-foreground",
|
|
200
213
|
children
|
|
201
214
|
}), /* @__PURE__ */ jsx(Combobox.Icon, {
|
|
@@ -51,6 +51,13 @@ interface SelectTriggerProps extends Omit<BaseTriggerProps, "className"> {
|
|
|
51
51
|
* A consumer `style.width` can override this convenience prop.
|
|
52
52
|
*/
|
|
53
53
|
anchorWidth?: CSSProperties["width"];
|
|
54
|
+
/**
|
|
55
|
+
* Leading static badge before the selected value. Pass the existing
|
|
56
|
+
* `<Badge>` component to use its variants, appearances, sizes, icons, dots,
|
|
57
|
+
* and custom classes. Keep it non-interactive: links and delete buttons
|
|
58
|
+
* cannot be nested inside the trigger button.
|
|
59
|
+
*/
|
|
60
|
+
badge?: ReactNode;
|
|
54
61
|
/** Replaces the dropdown chevron. Decorative — hidden from assistive technology. */
|
|
55
62
|
icon?: ReactNode;
|
|
56
63
|
className?: string;
|
|
@@ -99,7 +99,7 @@ function mergeAnchorWidth(anchorWidth, style) {
|
|
|
99
99
|
* `SelectLabel` (or a composed `Field.Label`); without one, pass
|
|
100
100
|
* `aria-label`.
|
|
101
101
|
*/
|
|
102
|
-
const SelectTrigger = forwardRef(({ variant = "outline", size = "md", fullWidth = false, anchorWidth, icon, style, className, children, ...rest }, ref) => /* @__PURE__ */ jsxs(Select.Trigger, {
|
|
102
|
+
const SelectTrigger = forwardRef(({ variant = "outline", size = "md", fullWidth = false, anchorWidth, badge, icon, style, className, children, ...rest }, ref) => /* @__PURE__ */ jsxs(Select.Trigger, {
|
|
103
103
|
ref,
|
|
104
104
|
className: cn(selectTriggerVariants({
|
|
105
105
|
variant,
|
|
@@ -108,7 +108,13 @@ const SelectTrigger = forwardRef(({ variant = "outline", size = "md", fullWidth
|
|
|
108
108
|
}), className),
|
|
109
109
|
style: mergeAnchorWidth(anchorWidth, style),
|
|
110
110
|
...rest,
|
|
111
|
-
children: [
|
|
111
|
+
children: [badge != null ? /* @__PURE__ */ jsxs("span", {
|
|
112
|
+
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
113
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
114
|
+
className: "flex shrink-0",
|
|
115
|
+
children: badge
|
|
116
|
+
}), children]
|
|
117
|
+
}) : children, /* @__PURE__ */ jsx(Select.Icon, {
|
|
112
118
|
"aria-hidden": "true",
|
|
113
119
|
className: "flex text-muted-foreground",
|
|
114
120
|
children: icon ?? /* @__PURE__ */ jsx(ChevronDownIcon, {})
|