@nadicodeai/ui 12.1.1 → 12.1.2

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.
@@ -4,7 +4,7 @@ import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader,
4
4
  import { Separator } from "./separator.js";
5
5
  import { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, } from "./field.js";
6
6
  function SettingsSection({ title, description, actions, footer, footerHint, children, className, surface = "resting", ...props }) {
7
- return (_jsxs(Card, { render: _jsx("section", { ...props, "data-slot": "settings-section" }), surface: surface, className: cn("min-w-0", className), children: [(title || description || actions) && (_jsxs(_Fragment, { children: [_jsxs(CardHeader, { children: [title && (_jsx(CardTitle, { children: _jsx("h2", { children: title }) })), description && _jsx(CardDescription, { children: description }), actions && _jsx(CardAction, { children: actions })] }), _jsx(Separator, {})] })), _jsx(CardContent, { children: _jsx(FieldGroup, { "data-slot": "settings-section-fields", children: children }) }), (footer || footerHint) && (_jsxs(CardFooter, { className: "flex-wrap gap-3 border-t border-border bg-recessed py-3", children: [footerHint && (_jsx("div", { "data-slot": "settings-section-hint", className: "min-w-0 flex-1 text-muted-foreground", children: footerHint })), footer && _jsx("div", { className: "ml-auto flex flex-wrap items-center gap-3", children: footer })] }))] }));
7
+ return (_jsxs(Card, { render: _jsx("section", { ...props, "data-slot": "settings-section" }), surface: surface, className: cn("min-w-0", className), children: [(title || description || actions) && (_jsxs(_Fragment, { children: [_jsxs(CardHeader, { children: [title && (_jsx(CardTitle, { children: _jsx("h2", { children: title }) })), description && _jsx(CardDescription, { children: description }), actions && _jsx(CardAction, { children: actions })] }), _jsx(Separator, {})] })), _jsx(CardContent, { children: _jsx(FieldGroup, { "data-slot": "settings-section-fields", children: children }) }), (footer || footerHint) && (_jsxs(CardFooter, { className: "mx-px mb-px flex-wrap gap-3 rounded-b-[calc(var(--radius-md)-1px)] border-t border-border bg-recessed py-3", children: [footerHint && (_jsx("div", { "data-slot": "settings-section-hint", className: "min-w-0 flex-1 text-muted-foreground", children: footerHint })), footer && _jsx("div", { className: "ml-auto flex flex-wrap items-center gap-3", children: footer })] }))] }));
8
8
  }
9
9
  function SettingsField({ id, label, description, error, invalid = Boolean(error), disabled, required, children, className, contentClassName, controlClassName, ...props }) {
10
10
  const descriptionId = description ? `${id}-description` : undefined;
@@ -25,7 +25,7 @@ function TabsList({ className, variant = "default", ...props }) {
25
25
  }
26
26
  const tabShape = "nc-transition-paint relative inline-flex h-control-height min-h-touch-target min-w-touch-target items-center justify-center gap-1.5 rounded-md px-3 text-sm font-medium whitespace-nowrap text-placeholder hover:text-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [@media(hover:hover)_and_(pointer:fine)]:min-h-0 [@media(hover:hover)_and_(pointer:fine)]:min-w-0 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";
27
27
  function TabsTrigger({ className, ...props }) {
28
- return (_jsx(TabsPrimitive.Tab, { "data-slot": "tabs-trigger", className: cn(tabShape, "group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start", "group-data-[variant=default]/tabs-list:data-active:bg-selection group-data-[variant=default]/tabs-list:data-active:text-selection-foreground", "group-data-[variant=line]/tabs-list:data-active:text-foreground", "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity after:duration-[var(--nc-duration-confirm)] after:ease-[var(--nc-ease-out-strong)] group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:-bottom-1 group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100", className), ...props }));
28
+ return (_jsx(TabsPrimitive.Tab, { "data-slot": "tabs-trigger", className: cn(tabShape, "group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start", "group-data-[variant=default]/tabs-list:data-active:bg-selection group-data-[variant=default]/tabs-list:data-active:text-selection-foreground", "group-data-[variant=line]/tabs-list:data-active:text-foreground", "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity after:duration-[var(--nc-duration-confirm)] after:ease-[var(--nc-ease-out-strong)] group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-0 group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:right-0 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100", className), ...props }));
29
29
  }
30
30
  function TabsContent({ className, ...props }) {
31
31
  return (_jsx(TabsPrimitive.Panel, { "data-slot": "tabs-content", className: cn("flex-1 text-sm outline-none", className), ...props }));
@@ -10,26 +10,64 @@
10
10
  * buttons in the card below them, because each caller picked `size="sm"`.
11
11
  *
12
12
  * What is read is a JSX element that is a control (a name ending in `Button`
13
- * or `Trigger`, or a `Toggle`/`ToggleGroupItem`) and its `size` attribute, plus
14
- * the `triggerSize` attribute a confirm form passes to the button it renders,
15
- * plus the `size` key of a `buttonVariants({ ... })` or `toggleVariants({ ... })`
16
- * call that styles a link as a button.
13
+ * or `Trigger`, or a `Toggle`/`ToggleGroupItem`/`NativeSelect`) and its `size`
14
+ * attribute and the heights its `className` sets (`h-7`, `min-h-7`, `size-7`,
15
+ * `h-[28px]`), plus the `triggerSize` attribute a confirm form passes to the
16
+ * button it renders, plus the `size` key of a `buttonVariants({ ... })` or
17
+ * `toggleVariants({ ... })` call that styles a link as a button.
17
18
  * A string literal is read directly and through both branches of a
18
19
  * conditional, so `size={compact ? "sm" : "default"}` is reported too.
19
20
  *
21
+ * Not read: `InputGroupButton`, a control nested inside an input group, where
22
+ * DESIGN.md allows the small sizes, and `SidebarMenuSubButton`, whose `size`
23
+ * sets its label, not its height.
24
+ *
20
25
  * Standard tool checked first: `no-restricted-syntax` can select
21
26
  * `JSXAttribute[name.name="size"][value.value="sm"]` but not the element names
22
27
  * that make it a control, nor the branches of a conditional value, without a
23
28
  * selector per combination.
24
29
  */
25
- import { jsxComponentName } from "./jsx-class-utility.js";
30
+ import { classUtilities, jsxComponentName } from "./jsx-class-utility.js";
26
31
 
27
32
  const SMALL_SIZES = new Set(["xs", "sm", "icon-xs", "icon-sm"]);
28
- const CONTROL_NAMES = new Set(["Toggle", "ToggleGroupItem"]);
33
+ const CONTROL_NAMES = new Set(["Toggle", "ToggleGroupItem", "NativeSelect"]);
34
+ const NESTED_CONTROL_NAMES = new Set(["InputGroupButton", "SidebarMenuSubButton"]);
29
35
  const VARIANT_FUNCTIONS = new Set(["buttonVariants", "toggleVariants"]);
36
+ const CONTROL_HEIGHT_PX = 32;
37
+ const SPACING_UNIT_PX = 4;
30
38
 
31
39
  function isControl(name) {
32
- return typeof name === "string" && (CONTROL_NAMES.has(name) || /(?:Button|Trigger)$/.test(name));
40
+ return (
41
+ typeof name === "string" &&
42
+ !NESTED_CONTROL_NAMES.has(name) &&
43
+ (CONTROL_NAMES.has(name) || /(?:Button|Trigger)$/.test(name))
44
+ );
45
+ }
46
+
47
+ function variantsAndUtility(className) {
48
+ const parts = [];
49
+ let depth = 0;
50
+ let start = 0;
51
+ for (let index = 0; index < className.length; index += 1) {
52
+ const character = className[index];
53
+ if (character === "[") depth += 1;
54
+ else if (character === "]") depth -= 1;
55
+ else if (character === ":" && depth === 0) {
56
+ parts.push(className.slice(start, index));
57
+ start = index + 1;
58
+ }
59
+ }
60
+ return { variants: parts, utility: className.slice(start).replace(/^!/, "") };
61
+ }
62
+
63
+ function smallHeight(className) {
64
+ const { variants, utility } = variantsAndUtility(className);
65
+ if (variants.some((variant) => variant.startsWith("[&") || /^\*{1,2}$/.test(variant)))
66
+ return false;
67
+ const match = /^(?:min-h|h|size)-(?:(\d+(?:\.\d+)?)|\[(\d+(?:\.\d+)?)px\])$/.exec(utility);
68
+ if (!match) return false;
69
+ const pixels = match[1] === undefined ? Number(match[2]) : Number(match[1]) * SPACING_UNIT_PX;
70
+ return pixels > 0 && pixels < CONTROL_HEIGHT_PX;
33
71
  }
34
72
 
35
73
  function literals(node) {
@@ -62,6 +100,8 @@ export const oneControlHeight = {
62
100
  messages: {
63
101
  smallControl:
64
102
  '{{attribute}}="{{size}}" renders this control below the 32px control height. Product chrome uses one control: drop the size for the default, or use "icon" for an icon-only control (DESIGN.md "Layout", rule/one-control-height).',
103
+ smallClassHeight:
104
+ '"{{utility}}" sets this control below the 32px control height. Product chrome uses one control: drop the height and let the control keep `h-control-height` (DESIGN.md "Layout", rule/one-control-height).',
65
105
  },
66
106
  },
67
107
  create(context) {
@@ -84,6 +124,14 @@ export const oneControlHeight = {
84
124
  },
85
125
  JSXAttribute(attribute) {
86
126
  const attributeName = attribute.name.type === "JSXIdentifier" ? attribute.name.name : "";
127
+ if (attributeName === "className") {
128
+ if (!isControl(jsxComponentName(attribute.parent, context))) return;
129
+ for (const utility of classUtilities(attribute, context)) {
130
+ if (smallHeight(utility))
131
+ context.report({ node: attribute, messageId: "smallClassHeight", data: { utility } });
132
+ }
133
+ return;
134
+ }
87
135
  if (attributeName !== "size" && attributeName !== "triggerSize") return;
88
136
  if (attributeName === "size" && !isControl(jsxComponentName(attribute.parent, context)))
89
137
  return;
package/dist/index.d.ts CHANGED
@@ -35,7 +35,6 @@ export * from "./components/chart-sparkline.js";
35
35
  export * from "./components/checkbox.js";
36
36
  export * from "./components/collapsible.js";
37
37
  export * from "./components/collection-filters.js";
38
- export * from "./components/collection-scope.js";
39
38
  export * from "./components/collection-toolbar.js";
40
39
  export * from "./components/combobox.js";
41
40
  export * from "./components/command.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC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C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mCAAmC,CAAC;AAClD,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kCAAkC,CAAC;AACjD,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC"}
package/dist/index.js CHANGED
@@ -35,7 +35,6 @@ export * from "./components/chart-sparkline.js";
35
35
  export * from "./components/checkbox.js";
36
36
  export * from "./components/collapsible.js";
37
37
  export * from "./components/collection-filters.js";
38
- export * from "./components/collection-scope.js";
39
38
  export * from "./components/collection-toolbar.js";
40
39
  export * from "./components/combobox.js";
41
40
  export * from "./components/command.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nadicodeai/ui",
3
- "version": "12.1.1",
3
+ "version": "12.1.2",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -71,7 +71,7 @@
71
71
  "@assistant-ui/react": "0.15.21",
72
72
  "@assistant-ui/react-markdown": "0.14.16",
73
73
  "@base-ui/react": "^1.8.0",
74
- "@nadicodeai/design-system": "12.1.1",
74
+ "@nadicodeai/design-system": "12.1.2",
75
75
  "class-variance-authority": "^0.7.1",
76
76
  "clsx": "^2.1.1",
77
77
  "cmdk": "^1.1.1",
@@ -1,15 +0,0 @@
1
- import type { ReactNode } from "react";
2
- export type CollectionScopeProps = {
3
- label: string;
4
- allLabel: string;
5
- value: string;
6
- options: readonly {
7
- value: string;
8
- label: string;
9
- icon?: ReactNode;
10
- }[];
11
- onValueChange: (value: string) => void;
12
- actions?: ReactNode;
13
- };
14
- export declare function CollectionScope({ label, allLabel, value, options, onValueChange, actions, }: CollectionScopeProps): import("react").JSX.Element;
15
- //# sourceMappingURL=collection-scope.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"collection-scope.d.ts","sourceRoot":"","sources":["../../src/components/collection-scope.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAWvC,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,SAAS;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,SAAS,CAAA;KAAE,EAAE,CAAC;IACvE,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,QAAQ,EACR,KAAK,EACL,OAAO,EACP,aAAa,EACb,OAAO,GACR,EAAE,oBAAoB,+BAyBtB"}
@@ -1,7 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue, } from "./select.js";
4
- export function CollectionScope({ label, allLabel, value, options, onValueChange, actions, }) {
5
- const items = [{ value: "", label: allLabel }, ...options];
6
- return (_jsxs("div", { "data-slot": "collection-scope", className: "flex min-w-0 flex-wrap items-center justify-between gap-3 pb-4", children: [_jsxs(Select, { items: items, value: value, onValueChange: (next) => onValueChange(next ?? ""), children: [_jsx(SelectTrigger, { "aria-label": label, className: "max-w-full", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { align: "start", children: _jsx(SelectGroup, { children: items.map((option) => (_jsxs(SelectItem, { value: option.value, children: ["icon" in option ? option.icon : null, option.label] }, option.value))) }) })] }), actions ? _jsx("div", { className: "flex shrink-0 items-center gap-2", children: actions }) : null] }));
7
- }