7onic 0.1.17 → 0.1.19

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.
Files changed (2) hide show
  1. package/dist/index.js +56 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -11505,7 +11505,7 @@ function ChartTooltipContent({
11505
11505
  )}
11506
11506
  <div
11507
11507
  className={cn(
11508
- 'flex flex-1 justify-between leading-none',
11508
+ 'flex flex-1 justify-between gap-4 leading-none',
11509
11509
  nestLabel ? 'items-end' : 'items-center'
11510
11510
  )}
11511
11511
  >
@@ -13677,7 +13677,7 @@ const DropdownMenuContent = React.forwardRef<
13677
13677
  onCloseAutoFocus?.(e)
13678
13678
  }}
13679
13679
  className={cn(
13680
- 'z-dropdown min-w-[8rem] overflow-hidden border border-border bg-background text-foreground shadow-lg',
13680
+ 'z-popover min-w-[8rem] overflow-hidden border border-border bg-background text-foreground shadow-lg',
13681
13681
  flush ? 'py-1' : 'p-1',
13682
13682
  contentRadiusMap[radius],
13683
13683
  className
@@ -13869,7 +13869,7 @@ const DropdownMenuSubContent = React.forwardRef<
13869
13869
  <DropdownMenuPrimitive.SubContent
13870
13870
  ref={ref}
13871
13871
  className={cn(
13872
- 'z-dropdown min-w-[8rem] overflow-hidden border border-border bg-background text-foreground shadow-lg',
13872
+ 'z-popover min-w-[8rem] overflow-hidden border border-border bg-background text-foreground shadow-lg',
13873
13873
  flush ? 'py-1' : 'p-1',
13874
13874
  contentRadiusMap[radius],
13875
13875
  className
@@ -16556,7 +16556,7 @@ const ANIMATION_CLASSES: Record<PopoverSide, string> = {
16556
16556
 
16557
16557
  // \u2500\u2500\u2500 Content variants \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
16558
16558
  const popoverContentVariants = cva(
16559
- 'relative z-popover font-normal select-none w-auto max-w-[calc(100vw-16px)] outline-none',
16559
+ 'relative z-popover flex flex-col font-normal select-none w-auto max-w-[calc(100vw-16px)] max-h-[var(--radix-popover-content-available-height)] outline-none',
16560
16560
  {
16561
16561
  variants: {
16562
16562
  variant: {
@@ -16652,7 +16652,11 @@ const PopoverContent = React.forwardRef<
16652
16652
  {closeIcon || <DefaultCloseIcon className="icon-sm" />}
16653
16653
  </PopoverPrimitive.Close>
16654
16654
  )}
16655
- {children}
16655
+ {/* Scrolls when taller than the viewport space; lives inside Content so the arrow is not clipped.
16656
+ -m-1 p-1 keeps children's focus rings inside the scroll area */}
16657
+ <div className="min-h-0 overflow-y-auto -m-1 p-1">
16658
+ {children}
16659
+ </div>
16656
16660
  {showArrow && variant === 'default' && (
16657
16661
  <div
16658
16662
  className={cn(
@@ -17854,7 +17858,7 @@ const SelectContent = React.forwardRef<
17854
17858
  onCloseAutoFocus?.(e)
17855
17859
  }}
17856
17860
  className={cn(
17857
- 'relative z-dropdown min-w-[var(--radix-select-trigger-width)] overflow-hidden border border-border bg-background text-foreground shadow-lg',
17861
+ 'relative z-popover min-w-[var(--radix-select-trigger-width)] overflow-hidden border border-border bg-background text-foreground shadow-lg',
17858
17862
  flush ? 'py-1' : 'p-1',
17859
17863
  contentRadiusMap[contentRadius],
17860
17864
  position === 'popper' &&
@@ -19593,7 +19597,8 @@ const tabsTriggerVariants = cva(
19593
19597
  [
19594
19598
  'inline-flex items-center justify-center gap-2 whitespace-nowrap',
19595
19599
  'transition-all duration-micro ease-out cursor-pointer',
19596
- 'focus-visible:focus-ring',
19600
+ // Keyboard-only focus ring: see pointer tracking in TabsTrigger
19601
+ '[&:focus-visible:not([data-pointer-focus])]:focus-ring',
19597
19602
  'disabled:pointer-events-none disabled:text-text-subtle disabled:opacity-50',
19598
19603
  ].join(' '),
19599
19604
  {
@@ -19707,9 +19712,12 @@ const pillItemRadiusClasses = {
19707
19712
  const TabsTrigger = React.forwardRef<
19708
19713
  React.ElementRef<typeof TabsPrimitive.Trigger>,
19709
19714
  TabsTriggerProps
19710
- >(({ className, children, ...props }, ref) => {
19715
+ >(({ className, children, onPointerDown, onKeyDown, onBlur, ...props }, ref) => {
19711
19716
  const { variant, size, fitted, color, radius } = useTabsStyleContext()
19712
19717
  const resolvedSize = size || 'default'
19718
+ // Radix Tabs 1.2+ calls focus() on mouse down, so :focus-visible matches after any
19719
+ // earlier keyboard input. Mark pointer-initiated focus to keep the ring keyboard-only.
19720
+ const [pointerFocus, setPointerFocus] = React.useState(false)
19713
19721
 
19714
19722
  return (
19715
19723
  <TabsPrimitive.Trigger
@@ -19722,6 +19730,19 @@ const TabsTrigger = React.forwardRef<
19722
19730
  variant === 'pill' && pillItemRadiusClasses[radius || 'md'],
19723
19731
  className
19724
19732
  )}
19733
+ data-pointer-focus={pointerFocus ? '' : undefined}
19734
+ onPointerDown={(event) => {
19735
+ setPointerFocus(true)
19736
+ onPointerDown?.(event)
19737
+ }}
19738
+ onKeyDown={(event) => {
19739
+ setPointerFocus(false)
19740
+ onKeyDown?.(event)
19741
+ }}
19742
+ onBlur={(event) => {
19743
+ setPointerFocus(false)
19744
+ onBlur?.(event)
19745
+ }}
19725
19746
  {...props}
19726
19747
  >
19727
19748
  {children}
@@ -21610,8 +21631,34 @@ function findSimilar(input, candidates) {
21610
21631
  best = name;
21611
21632
  }
21612
21633
  }
21634
+ if (best) return best;
21635
+ let bestDistance = Infinity;
21636
+ for (const name of candidates) {
21637
+ const distance = editDistance(input.toLowerCase(), name.toLowerCase());
21638
+ const limit = Math.min(2, Math.floor(name.length / 3));
21639
+ if (distance <= limit && distance < bestDistance) {
21640
+ bestDistance = distance;
21641
+ best = name;
21642
+ }
21643
+ }
21613
21644
  return best;
21614
21645
  }
21646
+ function editDistance(a, b) {
21647
+ const d3 = Array.from(
21648
+ { length: a.length + 1 },
21649
+ (_2, i) => Array.from({ length: b.length + 1 }, (_3, j2) => i === 0 ? j2 : j2 === 0 ? i : 0)
21650
+ );
21651
+ for (let i = 1; i <= a.length; i++) {
21652
+ for (let j2 = 1; j2 <= b.length; j2++) {
21653
+ const cost = a[i - 1] === b[j2 - 1] ? 0 : 1;
21654
+ d3[i][j2] = Math.min(d3[i - 1][j2] + 1, d3[i][j2 - 1] + 1, d3[i - 1][j2 - 1] + cost);
21655
+ if (i > 1 && j2 > 1 && a[i - 1] === b[j2 - 2] && a[i - 2] === b[j2 - 1]) {
21656
+ d3[i][j2] = Math.min(d3[i][j2], d3[i - 2][j2 - 2] + 1);
21657
+ }
21658
+ }
21659
+ }
21660
+ return d3[a.length][b.length];
21661
+ }
21615
21662
  function similarity(a, b) {
21616
21663
  if (a === b) return 1;
21617
21664
  if (a.length < 2 || b.length < 2) return 0;
@@ -21680,7 +21727,7 @@ function showCompanionHints(names) {
21680
21727
 
21681
21728
  // cli/src/index.ts
21682
21729
  var import_picocolors4 = __toESM(require_picocolors());
21683
- var VERSION = "0.1.17";
21730
+ var VERSION = "0.1.19";
21684
21731
  var HELP = `
21685
21732
  ${import_picocolors4.default.bold("7onic")} \u2014 Add 7onic design system components to your project
21686
21733
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "7onic",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "description": "CLI for adding 7onic design system components to your project",
5
5
  "bin": {
6
6
  "7onic": "./dist/index.js"