@tangible/ui 0.0.4 → 0.0.6

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.
@@ -104,7 +104,7 @@ function TabsRoot({ variant = 'underline', activationMode = 'auto', value: contr
104
104
  }, [registryVersion, activeValue, focusedValue, isControlled, onValueChange, getOrderedTabs]);
105
105
  // Dev-only: Tab-Panel pairing validation
106
106
  useEffect(() => {
107
- if (import.meta.env.DEV) {
107
+ if (isDev()) {
108
108
  // Defer validation to next microtask so all tabs/panels have registered
109
109
  queueMicrotask(() => {
110
110
  const tabValues = new Set(Array.from(tabsRef.current.keys()));
@@ -167,7 +167,7 @@ function TabsList({ 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy,
167
167
  const { orientation, activationMode, activeValue, focusedValue, getOrderedTabs, onSelect, setFocusedValue, tabsRef, } = useTabsContext();
168
168
  // Dev-only: Warn if missing accessible name
169
169
  useEffect(() => {
170
- if (import.meta.env.DEV) {
170
+ if (isDev()) {
171
171
  if (!ariaLabel && !ariaLabelledBy) {
172
172
  console.warn('Tabs.List: Missing accessible name. Provide aria-label or aria-labelledby.');
173
173
  }
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import React, { useCallback, useEffect, useRef, cloneElement, isValidElement, } from 'react';
3
3
  import { cx } from '../../utils/cx.js';
4
+ import { isDev } from '../../utils/is-dev.js';
4
5
  // =============================================================================
5
6
  // Toolbar Component
6
7
  // =============================================================================
@@ -66,7 +67,7 @@ function ToolbarRoot({ 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledB
66
67
  const originalTabIndexMapRef = useRef(new WeakMap());
67
68
  // Dev warning for missing accessible name
68
69
  useEffect(() => {
69
- if (import.meta.env?.DEV && !ariaLabel && !ariaLabelledBy) {
70
+ if (isDev() && !ariaLabel && !ariaLabelledBy) {
70
71
  console.warn('[Toolbar] aria-label or aria-labelledby is required for accessibility.');
71
72
  }
72
73
  }, [ariaLabel, ariaLabelledBy]);
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React, { useCallback, useEffect, useId, useMemo, useRef, useState, cloneElement, isValidElement, } from 'react';
3
+ import { isDev } from '../../utils/is-dev.js';
3
4
  import { useFloating, offset, flip, shift, arrow, autoUpdate, FloatingPortal, FloatingArrow, } from '@floating-ui/react';
4
5
  import { cx } from '../../utils/cx.js';
5
6
  import { getPortalRootFor } from '../../utils/portal.js';
@@ -165,7 +166,7 @@ function TooltipContentComponent({ side = 'top', align = 'center', sideOffset =
165
166
  // Dev warning: tooltips should not contain interactive content (WCAG 1.4.13)
166
167
  // Use Popover for interactive overlays instead
167
168
  useEffect(() => {
168
- if (import.meta.env?.DEV && open && refs.floating.current) {
169
+ if (isDev() && open && refs.floating.current) {
169
170
  const interactive = refs.floating.current.querySelectorAll('a, button, input, select, textarea, [tabindex]:not([tabindex="-1"])');
170
171
  if (interactive.length > 0) {
171
172
  console.warn('[Tooltip] Contains interactive elements which violates WCAG 1.4.13. ' +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangible/ui",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "Tangible Design System",
5
5
  "type": "module",
6
6
  "main": "./components/index.js",
@@ -79,20 +79,18 @@
79
79
  "types": "./components/Dropdown/Dropdown.d.ts"
80
80
  }
81
81
  },
82
- "dependencies": {
83
- "@floating-ui/react": "^0.27.16",
84
- "@tanstack/react-table": "^8.21.3"
85
- },
86
82
  "peerDependencies": {
83
+ "@floating-ui/react": ">=0.27.0",
84
+ "@tanstack/react-table": ">=8.0.0",
87
85
  "react": ">=18.0.0",
88
86
  "react-dom": ">=18.0.0"
89
87
  },
90
88
  "peerDependenciesMeta": {
91
- "react": {
92
- "optional": false
89
+ "@floating-ui/react": {
90
+ "optional": true
93
91
  },
94
- "react-dom": {
95
- "optional": false
92
+ "@tanstack/react-table": {
93
+ "optional": true
96
94
  }
97
95
  },
98
96
  "homepage": "https://github.com/tangibleinc/tangible-ui",