@kinetixui/ui 0.21.0 → 0.22.1

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.d.ts CHANGED
@@ -114,7 +114,7 @@ declare const AccordionContent: React$1.ForwardRefExoticComponent<Omit<Accordion
114
114
  declare const Alert: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
115
115
  variant?: "default" | "destructive" | "success" | "warning" | "info" | null | undefined;
116
116
  } & class_variance_authority_types.ClassProp) | undefined) => string> & React$1.RefAttributes<HTMLDivElement>>;
117
- declare const AlertTitle: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLHeadingElement> & React$1.RefAttributes<HTMLParagraphElement>>;
117
+ declare const AlertTitle: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
118
118
  declare const AlertDescription: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLParagraphElement> & React$1.RefAttributes<HTMLParagraphElement>>;
119
119
 
120
120
  declare const AlertDialog: React$1.FC<AlertDialogPrimitive.AlertDialogProps>;
package/dist/index.js CHANGED
@@ -284,7 +284,7 @@ var alertVariants = cva4(
284
284
  var Alert = React5.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx5("div", { ref, role: "alert", className: cn(alertVariants({ variant }), className), ...props }));
285
285
  Alert.displayName = "Alert";
286
286
  var AlertTitle = React5.forwardRef(
287
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx5("h5", { ref, className: cn("mb-1 font-medium leading-none tracking-tight", className), ...props })
287
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx5("div", { ref, className: cn("mb-1 font-medium leading-none tracking-tight", className), ...props })
288
288
  );
289
289
  AlertTitle.displayName = "AlertTitle";
290
290
  var AlertDescription = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx5("div", { ref, className: cn("text-sm [&_p]:leading-relaxed", className), ...props }));
@@ -1716,7 +1716,7 @@ function ChartSrTable({
1716
1716
  ] });
1717
1717
  }
1718
1718
  var cssIdent = (s) => String(s).replace(/[^\w-]/g, "");
1719
- var cssValue = (s) => /[<>{}\[\];@]|\/\*|\*\//.test(s) ? "" : s.trim();
1719
+ var cssValue = (s) => /[<>{}[\];@]|\/\*|\*\//.test(s) ? "" : s.trim();
1720
1720
  var ChartStyle = ({ id, config }) => {
1721
1721
  const colorConfig = Object.entries(config).filter(([, c]) => c.theme || c.color);
1722
1722
  if (!colorConfig.length) return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kinetixui/ui",
3
- "version": "0.21.0",
3
+ "version": "0.22.1",
4
4
  "private": false,
5
5
  "description": "KinetixUI React components — CVA + Radix + Tailwind on the KinetixUI token contract. Also distributed via the kinetixui CLI as a component registry.",
6
6
  "keywords": [
@@ -44,7 +44,7 @@
44
44
  "@dnd-kit/sortable": "^10.0.0",
45
45
  "@dnd-kit/utilities": "^3.2.2",
46
46
  "@hookform/resolvers": "^5.9.1",
47
- "@kinetixui/tokens": "0.21.0",
47
+ "@kinetixui/tokens": "0.22.1",
48
48
  "@radix-ui/react-accordion": "^1.2.20",
49
49
  "@radix-ui/react-alert-dialog": "^1.1.23",
50
50
  "@radix-ui/react-aspect-ratio": "^1.1.15",
@@ -79,7 +79,7 @@
79
79
  "date-fns": "^4.4.0",
80
80
  "embla-carousel-react": "^8.6.0",
81
81
  "input-otp": "^1.5.0",
82
- "lucide-react": "^1.46.0",
82
+ "lucide-react": "^1.47.0",
83
83
  "react-day-picker": "^10.0.1",
84
84
  "react-hook-form": "^7.88.0",
85
85
  "react-resizable-panels": "^4.12.4",
@@ -95,6 +95,7 @@
95
95
  "react-dom": ">=18"
96
96
  },
97
97
  "devDependencies": {
98
+ "@eslint/js": "^9.39.5",
98
99
  "@testing-library/jest-dom": "^7.0.1",
99
100
  "@testing-library/react": "^16.3.3",
100
101
  "@testing-library/user-event": "^14.6.7",
@@ -102,12 +103,15 @@
102
103
  "@types/react-dom": "^19.3.0",
103
104
  "@vitejs/plugin-react": "^6.1.1",
104
105
  "axe-core": "4.13.0",
105
- "jsdom": "^30.0.1",
106
+ "eslint": "^9.39.5",
107
+ "eslint-plugin-react-hooks": "^5.2.0",
108
+ "jsdom": "^30.1.0",
106
109
  "react": "^19.3.0",
107
110
  "react-dom": "^19.3.0",
108
111
  "tailwindcss": "^3.4.19",
109
112
  "tsup": "^8.5.1",
110
113
  "typescript": "^5.9.3",
114
+ "typescript-eslint": "^8.70.0",
111
115
  "vitest": "^5.0.1"
112
116
  },
113
117
  "scripts": {
@@ -29,9 +29,12 @@ const Alert = React.forwardRef<
29
29
  ));
30
30
  Alert.displayName = "Alert";
31
31
 
32
- const AlertTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(
32
+ // A plain block, not a heading: the component does not know where it sits in the page's outline, so a hardcoded
33
+ // <h5> skipped heading levels under any <h2> (WCAG 1.3.1 / axe heading-order). `role="alert"` on Alert carries the
34
+ // semantics. Pass `role="heading" aria-level={n}` if a specific level is wanted.
35
+ const AlertTitle = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
33
36
  ({ className, ...props }, ref) => (
34
- <h5 ref={ref} className={cn("mb-1 font-medium leading-none tracking-tight", className)} {...props} />
37
+ <div ref={ref} className={cn("mb-1 font-medium leading-none tracking-tight", className)} {...props} />
35
38
  ),
36
39
  );
37
40
  AlertTitle.displayName = "AlertTitle";
@@ -201,7 +201,7 @@ function ChartSrTable({
201
201
  const cssIdent = (s: string) => String(s).replace(/[^\w-]/g, "");
202
202
  // keep parens (hsl(), var(), color-mix()…); reject only what can end the
203
203
  // declaration, close the rule, open an at-rule, a comment, or the <style>.
204
- const cssValue = (s: string) => (/[<>{}\[\];@]|\/\*|\*\//.test(s) ? "" : s.trim());
204
+ const cssValue = (s: string) => (/[<>{}[\];@]|\/\*|\*\//.test(s) ? "" : s.trim());
205
205
 
206
206
  const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
207
207
  const colorConfig = Object.entries(config).filter(([, c]) => c.theme || c.color);
@@ -112,40 +112,16 @@ export const CrossPlatformUsage: Story = {
112
112
  "/* ── Web · React (@kinetixui/ui) ────────────────────────────── */",
113
113
  '<Button variant="Primary" size="md">Save</Button>',
114
114
  "",
115
- "/* ── Web · HTML + CSS (token contract) ───────────────────── */",
116
- '<button class="kx-btn kx-btn--primary kx-btn--md">Save</button>',
117
- "/* uses --primary / --primary-foreground / --radius from globals.css */",
115
+ "/* The native libraries mirror the React API — wrap a screen in KinetixTheme once. */",
118
116
  "",
119
- "/* ── Angular (kx-button) ─────────────────────────────── */",
120
- '<button kx-button variant="primary" size="md">Save</button>',
117
+ "/* ── iOS · SwiftUI (KinetixUI) ─────────────────────────────── */",
118
+ 'KinetixButton(variant: .primary, action: save) { Text("Save") }',
121
119
  "",
122
- "/* ── Flutter (AppTheme) ──────────────────────────────────── */",
123
- "FilledButton(",
124
- " style: FilledButton.styleFrom(",
125
- " backgroundColor: AppColors.primary,",
126
- " foregroundColor: AppColors.primaryForeground,",
127
- " shape: RoundedRectangleBorder(",
128
- " borderRadius: BorderRadius.circular(AppTheme.radius)),",
129
- " ),",
130
- " onPressed: onSave,",
131
- " child: const Text('Save'),",
132
- ")",
120
+ "/* ── Android · Jetpack Compose (com.kinetixui:ui-compose) ──── */",
121
+ 'KinetixButton(onClick = ::save, variant = KinetixButtonVariant.Primary) { Text("Save") }',
133
122
  "",
134
- "/* ── iOS · SwiftUI (KinetixTheme) ─────────────────────────── */",
135
- "Button('Save', action: save)",
136
- " .padding(.horizontal, 16).padding(.vertical, 12)",
137
- " .background(KinetixTheme.light.primary)",
138
- " .foregroundStyle(KinetixTheme.light.primaryForeground)",
139
- " .clipShape(RoundedRectangle(cornerRadius: KinetixTheme.light.radius))",
140
- "",
141
- "/* ── Android · Jetpack Compose (KinetixTheme) ─────────────── */",
142
- "Button(",
143
- " onClick = onSave,",
144
- " colors = ButtonDefaults.buttonColors(",
145
- " containerColor = KinetixTheme.primary,",
146
- " contentColor = KinetixTheme.primaryForeground),",
147
- " shape = RoundedCornerShape(KinetixTheme.radius),",
148
- ") { Text(\"Save\") }",
123
+ "/* ── Flutter (kinetix_ui) ───────────────────────────────────── */",
124
+ "KinetixButton(onPressed: save, child: const Text('Save'))",
149
125
  ].join("\n"),
150
126
  language: "tsx",
151
127
  },
@@ -112,6 +112,12 @@ export default {
112
112
  xl: "var(--radius-xl)",
113
113
  "2xl": "calc(var(--radius-lg) + 8px)",
114
114
  full: "var(--radius-full)",
115
+ // Role aliases (tokens/primitives/dimension.json) — theme one role without touching the size steps.
116
+ // Additive: components still use the size utilities above and move to these incrementally.
117
+ field: "var(--radius-field)",
118
+ control: "var(--radius-control)",
119
+ container: "var(--radius-container)",
120
+ surface: "var(--radius-surface)",
115
121
  },
116
122
  // Motion + scale — tokens/primitives/{motion,opacity,z-index}.json.
117
123
  // Added alongside Tailwind's own numeric scales (z-10, opacity-50, …),