@tangible/ui 0.0.13 → 0.0.15

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.
@@ -8,4 +8,4 @@ import type { AvatarProps } from './types';
8
8
  * - Shows placeholder icon if neither `src` nor `name` provided
9
9
  * - Colors for initials are derived from the name hash for consistency
10
10
  */
11
- export declare const Avatar: React.NamedExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>>;
11
+ export declare const Avatar: React.MemoExoticComponent<React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>>>;
@@ -19,4 +19,4 @@ export interface IconProps {
19
19
  * - Decorative icons (no label): automatically hidden from screen readers
20
20
  * - Informative icons: provide a `label` prop for screen reader announcement
21
21
  */
22
- export declare const Icon: React.NamedExoticComponent<IconProps & React.RefAttributes<HTMLSpanElement>>;
22
+ export declare const Icon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<HTMLSpanElement>>>;
@@ -1,2 +1,2 @@
1
1
  import type { MoveHandleProps } from './types';
2
- export declare const MoveHandle: import("react").NamedExoticComponent<MoveHandleProps & import("react").RefAttributes<HTMLElement>>;
2
+ export declare const MoveHandle: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<MoveHandleProps & import("react").RefAttributes<HTMLElement>>>;
@@ -18,6 +18,10 @@ import { Icon } from '../Icon/index.js';
18
18
  // Modes:
19
19
  // full — Background panel with arrows, index, lock (default)
20
20
  // handle — Bare drag icon button, no chrome
21
+ // arrows — Panel with up/down chevrons only, no drag handle or index.
22
+ // For items reordered exclusively by explicit moves (e.g.
23
+ // top-level containers that aren't drag targets). Locked renders
24
+ // as disabled chevrons (described via aria-describedby), no icon.
21
25
  //
22
26
  // CSS token API (never defined, read via fallback):
23
27
  // --tui-move-handle-size Override container size
@@ -85,11 +89,15 @@ export const MoveHandle = memo(forwardRef(function MoveHandle({ mode = 'full', s
85
89
  if (mode === 'handle') {
86
90
  return (_jsx("button", { ref: ref, type: "button", className: cx('tui-move-handle', 'is-handle', `is-size-${size}`, className), "aria-label": resolvedDragLabel, ...restDragProps, children: _jsx(Icon, { name: "system/drag" }) }));
87
91
  }
88
- // ----- Full mode -----
89
- const hasIndex = index != null;
92
+ // ----- Full / arrows mode -----
93
+ const isArrows = mode === 'arrows';
94
+ const hasIndex = !isArrows && index != null;
90
95
  const hasArrows = !!(onMoveUp || onMoveDown);
91
96
  const resolvedLockedDesc = locked
92
97
  ? (labels?.locked ?? 'This item is locked and cannot be reordered')
93
98
  : undefined;
94
- return (_jsxs("div", { ref: mergedRef, role: "group", "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": locked ? lockedDescId : undefined, "aria-disabled": locked || undefined, className: cx('tui-move-handle', `is-size-${size}`, locked && 'is-locked', hasIndex && 'has-index', className), children: [locked && (_jsx("span", { id: lockedDescId, className: "tui-visually-hidden", children: resolvedLockedDesc })), onMoveUp && (_jsx("button", { type: "button", className: "tui-move-handle__up", "data-direction": "up", "aria-label": labels?.moveUp ?? 'Move up', disabled: locked || !canMoveUp, onClick: onMoveUp, children: _jsx(Icon, { name: "system/chevron-up" }) })), _jsx("div", { className: "tui-move-handle__center", children: showLockIcon ? (_jsx("span", { className: "tui-move-handle__lock", "aria-hidden": "true", children: _jsx(Icon, { name: "system/lock" }) })) : (_jsxs(_Fragment, { children: [hasIndex && (_jsx("span", { className: "tui-move-handle__index", "aria-hidden": "true", children: index })), _jsx("button", { type: "button", className: "tui-move-handle__handle", "data-role": "drag-handle", "aria-label": resolvedDragLabel, tabIndex: hasArrows ? -1 : 0, ...restDragProps, children: _jsx(Icon, { name: "system/handle-alt" }) })] })) }), onMoveDown && (_jsx("button", { type: "button", className: "tui-move-handle__down", "data-direction": "down", "aria-label": labels?.moveDown ?? 'Move down', disabled: locked || !canMoveDown, onClick: onMoveDown, children: _jsx(Icon, { name: "system/chevron-down" }) }))] }));
99
+ // Arrows mode has no center — locked reads as disabled chevrons (plus the
100
+ // aria-describedby explanation), not a lock icon swap.
101
+ const showCenter = !isArrows;
102
+ return (_jsxs("div", { ref: mergedRef, role: "group", "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": locked ? lockedDescId : undefined, "aria-disabled": locked || undefined, className: cx('tui-move-handle', `is-size-${size}`, isArrows && 'is-arrows', locked && 'is-locked', hasIndex && 'has-index', className), children: [locked && (_jsx("span", { id: lockedDescId, className: "tui-visually-hidden", children: resolvedLockedDesc })), onMoveUp && (_jsx("button", { type: "button", className: "tui-move-handle__up", "data-direction": "up", "aria-label": labels?.moveUp ?? 'Move up', disabled: locked || !canMoveUp, onClick: onMoveUp, children: _jsx(Icon, { name: "system/chevron-up" }) })), showCenter && (_jsx("div", { className: "tui-move-handle__center", children: showLockIcon ? (_jsx("span", { className: "tui-move-handle__lock", "aria-hidden": "true", children: _jsx(Icon, { name: "system/lock" }) })) : (_jsxs(_Fragment, { children: [hasIndex && (_jsx("span", { className: "tui-move-handle__index", "aria-hidden": "true", children: index })), _jsx("button", { type: "button", className: "tui-move-handle__handle", "data-role": "drag-handle", "aria-label": resolvedDragLabel, tabIndex: hasArrows ? -1 : 0, ...restDragProps, children: _jsx(Icon, { name: "system/handle-alt" }) })] })) })), onMoveDown && (_jsx("button", { type: "button", className: "tui-move-handle__down", "data-direction": "down", "aria-label": labels?.moveDown ?? 'Move down', disabled: locked || !canMoveDown, onClick: onMoveDown, children: _jsx(Icon, { name: "system/chevron-down" }) }))] }));
95
103
  }));
@@ -1,6 +1,6 @@
1
1
  import type { HTMLAttributes } from 'react';
2
2
  export type MoveHandleSize = 'sm' | 'md';
3
- export type MoveHandleMode = 'full' | 'handle';
3
+ export type MoveHandleMode = 'full' | 'handle' | 'arrows';
4
4
  export interface MoveHandleLabels {
5
5
  /** Label for the move-up button. Include item name for clear AT context, e.g. "Move Introduction up". Default: "Move up" */
6
6
  moveUp?: string;
@@ -15,11 +15,16 @@ export interface MoveHandleLabels {
15
15
  locked?: string;
16
16
  }
17
17
  export interface MoveHandleProps {
18
- /** Structural mode. 'full' (default) shows background panel with arrows/index. 'handle' shows only the bare drag icon button. */
18
+ /**
19
+ * Structural mode. 'full' (default) shows background panel with arrows/index.
20
+ * 'handle' shows only the bare drag icon button. 'arrows' shows the panel
21
+ * with only the up/down chevron buttons — no drag handle or index — for
22
+ * items reordered exclusively by explicit moves (e.g. top-level containers).
23
+ */
19
24
  mode?: MoveHandleMode;
20
25
  /** Component scale. Full mode: sm = 32px, md = 40px. Handle mode: sm = 24px, md = 32px. */
21
26
  size?: MoveHandleSize;
22
- /** Position index. When provided, shows number at rest, drag handle on hover. */
27
+ /** Position index. When provided, shows number at rest, drag handle on hover. Ignored in 'arrows' mode. */
23
28
  index?: number;
24
29
  /** When true, shows lock icon and disables all interaction. */
25
30
  locked?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangible/ui",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "description": "Tangible Design System",
5
5
  "type": "module",
6
6
  "main": "./components/index.js",
@@ -46,53 +46,155 @@
46
46
  "./icons/manifest": "./icons/manifest.json",
47
47
  "./icons/*": "./icons/*",
48
48
  "./manifest.json": "./tui-manifest.json",
49
- "./components/Icon": {
50
- "import": "./components/Icon/Icon.js",
51
- "types": "./components/Icon/Icon.d.ts"
49
+ "./components/Accordion": {
50
+ "import": "./components/Accordion/index.js",
51
+ "types": "./components/Accordion/index.d.ts"
52
+ },
53
+ "./components/Avatar": {
54
+ "import": "./components/Avatar/index.js",
55
+ "types": "./components/Avatar/index.d.ts"
52
56
  },
53
57
  "./components/Button": {
54
- "import": "./components/Button/Button.js",
55
- "types": "./components/Button/Button.d.ts"
58
+ "import": "./components/Button/index.js",
59
+ "types": "./components/Button/index.d.ts"
60
+ },
61
+ "./components/Card": {
62
+ "import": "./components/Card/index.js",
63
+ "types": "./components/Card/index.d.ts"
64
+ },
65
+ "./components/Checkbox": {
66
+ "import": "./components/Checkbox/index.js",
67
+ "types": "./components/Checkbox/index.d.ts"
68
+ },
69
+ "./components/Chip": {
70
+ "import": "./components/Chip/index.js",
71
+ "types": "./components/Chip/index.d.ts"
72
+ },
73
+ "./components/ChipGroup": {
74
+ "import": "./components/ChipGroup/index.js",
75
+ "types": "./components/ChipGroup/index.d.ts"
76
+ },
77
+ "./components/Chips": {
78
+ "import": "./components/Chips/index.js",
79
+ "types": "./components/Chips/index.d.ts"
80
+ },
81
+ "./components/Combobox": {
82
+ "import": "./components/Combobox/index.js",
83
+ "types": "./components/Combobox/index.d.ts"
84
+ },
85
+ "./components/ContentIndicator": {
86
+ "import": "./components/ContentIndicator/index.js",
87
+ "types": "./components/ContentIndicator/index.d.ts"
88
+ },
89
+ "./components/Dropdown": {
90
+ "import": "./components/Dropdown/index.js",
91
+ "types": "./components/Dropdown/index.d.ts"
92
+ },
93
+ "./components/Field": {
94
+ "import": "./components/Field/index.js",
95
+ "types": "./components/Field/index.d.ts"
96
+ },
97
+ "./components/Icon": {
98
+ "import": "./components/Icon/index.js",
99
+ "types": "./components/Icon/index.d.ts"
56
100
  },
57
101
  "./components/IconButton": {
58
- "import": "./components/IconButton/IconButton.js",
59
- "types": "./components/IconButton/IconButton.d.ts"
102
+ "import": "./components/IconButton/index.js",
103
+ "types": "./components/IconButton/index.d.ts"
60
104
  },
61
105
  "./components/Modal": {
62
- "import": "./components/Modal/Modal.js",
63
- "types": "./components/Modal/Modal.d.ts"
106
+ "import": "./components/Modal/index.js",
107
+ "types": "./components/Modal/index.d.ts"
64
108
  },
65
- "./components/SegmentedControl": {
66
- "import": "./components/SegmentedControl/SegmentedControl.js",
67
- "types": "./components/SegmentedControl/SegmentedControl.d.ts"
109
+ "./components/MoveHandle": {
110
+ "import": "./components/MoveHandle/index.js",
111
+ "types": "./components/MoveHandle/index.d.ts"
112
+ },
113
+ "./components/MultiSelect": {
114
+ "import": "./components/MultiSelect/index.js",
115
+ "types": "./components/MultiSelect/index.d.ts"
116
+ },
117
+ "./components/Notice": {
118
+ "import": "./components/Notice/index.js",
119
+ "types": "./components/Notice/index.d.ts"
68
120
  },
69
121
  "./components/OverlapStack": {
70
- "import": "./components/OverlapStack/OverlapStack.js",
71
- "types": "./components/OverlapStack/OverlapStack.d.ts"
122
+ "import": "./components/OverlapStack/index.js",
123
+ "types": "./components/OverlapStack/index.d.ts"
72
124
  },
73
- "./components/Tooltip": {
74
- "import": "./components/Tooltip/Tooltip.js",
75
- "types": "./components/Tooltip/Tooltip.d.ts"
125
+ "./components/Pager": {
126
+ "import": "./components/Pager/index.js",
127
+ "types": "./components/Pager/index.d.ts"
76
128
  },
77
- "./components/Dropdown": {
78
- "import": "./components/Dropdown/Dropdown.js",
79
- "types": "./components/Dropdown/Dropdown.d.ts"
129
+ "./components/Progress": {
130
+ "import": "./components/Progress/index.js",
131
+ "types": "./components/Progress/index.d.ts"
132
+ },
133
+ "./components/Radio": {
134
+ "import": "./components/Radio/index.js",
135
+ "types": "./components/Radio/index.d.ts"
136
+ },
137
+ "./components/Rating": {
138
+ "import": "./components/Rating/index.js",
139
+ "types": "./components/Rating/index.d.ts"
140
+ },
141
+ "./components/SegmentedControl": {
142
+ "import": "./components/SegmentedControl/index.js",
143
+ "types": "./components/SegmentedControl/index.d.ts"
144
+ },
145
+ "./components/Select": {
146
+ "import": "./components/Select/index.js",
147
+ "types": "./components/Select/index.d.ts"
148
+ },
149
+ "./components/Sidebar": {
150
+ "import": "./components/Sidebar/index.js",
151
+ "types": "./components/Sidebar/index.d.ts"
152
+ },
153
+ "./components/StepIndicator": {
154
+ "import": "./components/StepIndicator/index.js",
155
+ "types": "./components/StepIndicator/index.d.ts"
156
+ },
157
+ "./components/StepList": {
158
+ "import": "./components/StepList/index.js",
159
+ "types": "./components/StepList/index.d.ts"
160
+ },
161
+ "./components/Switch": {
162
+ "import": "./components/Switch/index.js",
163
+ "types": "./components/Switch/index.d.ts"
164
+ },
165
+ "./components/Table": {
166
+ "import": "./components/Table/index.js",
167
+ "types": "./components/Table/index.d.ts"
168
+ },
169
+ "./components/Tabs": {
170
+ "import": "./components/Tabs/index.js",
171
+ "types": "./components/Tabs/index.d.ts"
172
+ },
173
+ "./components/TextInput": {
174
+ "import": "./components/TextInput/index.js",
175
+ "types": "./components/TextInput/index.d.ts"
176
+ },
177
+ "./components/Textarea": {
178
+ "import": "./components/Textarea/index.js",
179
+ "types": "./components/Textarea/index.d.ts"
180
+ },
181
+ "./components/Toolbar": {
182
+ "import": "./components/Toolbar/index.js",
183
+ "types": "./components/Toolbar/index.d.ts"
184
+ },
185
+ "./components/Tooltip": {
186
+ "import": "./components/Tooltip/index.js",
187
+ "types": "./components/Tooltip/index.d.ts"
80
188
  }
81
189
  },
190
+ "dependencies": {
191
+ "@floating-ui/react": "^0.27.16",
192
+ "@tanstack/react-table": "^8.21.3"
193
+ },
82
194
  "peerDependencies": {
83
- "@floating-ui/react": ">=0.27.0",
84
- "@tanstack/react-table": ">=8.0.0",
85
195
  "react": ">=18.0.0",
86
196
  "react-dom": ">=18.0.0"
87
197
  },
88
- "peerDependenciesMeta": {
89
- "@floating-ui/react": {
90
- "optional": true
91
- },
92
- "@tanstack/react-table": {
93
- "optional": true
94
- }
95
- },
96
198
  "homepage": "https://github.com/tangibleinc/tangible-ui",
97
199
  "repository": {
98
200
  "url": "git+ssh://git@github.com/tangibleinc/tangible-ui.git"