@lindle/linoardo 1.0.39 → 1.0.41

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 (76) hide show
  1. package/dist/{ExpansionPanelItem-CFm8a8R_.d.ts → ExpansionPanelItem-C4-2nlhq.d.ts} +1 -1
  2. package/dist/{ExpansionPanelItem-ufS2RIZf.d.cts → ExpansionPanelItem-CEhDj2Uw.d.cts} +1 -1
  3. package/dist/badge.d.cts +1 -1
  4. package/dist/badge.d.ts +1 -1
  5. package/dist/block.d.cts +1 -1
  6. package/dist/block.d.ts +1 -1
  7. package/dist/button.d.cts +1 -1
  8. package/dist/button.d.ts +1 -1
  9. package/dist/card.d.cts +1 -1
  10. package/dist/card.d.ts +1 -1
  11. package/dist/chip.d.cts +12 -12
  12. package/dist/chip.d.ts +12 -12
  13. package/dist/chip.js +2 -1
  14. package/dist/chunk-4J3SRVOS.js +217 -0
  15. package/dist/chunk-4J3SRVOS.js.map +1 -0
  16. package/dist/chunk-HT5XBHWN.js +119 -0
  17. package/dist/chunk-HT5XBHWN.js.map +1 -0
  18. package/dist/{chunk-BDN4EDJQ.js → chunk-LULQOD2K.js} +12 -6
  19. package/dist/chunk-LULQOD2K.js.map +1 -0
  20. package/dist/{chunk-P3ESW6KM.js → chunk-OBGYXMZ3.js} +74 -28
  21. package/dist/chunk-OBGYXMZ3.js.map +1 -0
  22. package/dist/{chunk-HJFHZNOV.js → chunk-PSMGRUU5.js} +3 -116
  23. package/dist/chunk-PSMGRUU5.js.map +1 -0
  24. package/dist/expansion-panel/item.d.cts +2 -2
  25. package/dist/expansion-panel/item.d.ts +2 -2
  26. package/dist/expansion-panel.d.cts +3 -3
  27. package/dist/expansion-panel.d.ts +3 -3
  28. package/dist/{global.types-D-o85tuX.d.cts → global.types-gx9A7mUe.d.cts} +1 -1
  29. package/dist/{global.types-D-o85tuX.d.ts → global.types-gx9A7mUe.d.ts} +1 -1
  30. package/dist/hero.d.cts +1 -1
  31. package/dist/hero.d.ts +1 -1
  32. package/dist/icon.d.cts +1 -1
  33. package/dist/icon.d.ts +1 -1
  34. package/dist/{index-B7xZzSwm.d.cts → index-BDrBOeFI.d.cts} +1 -1
  35. package/dist/{index-BhfThlf0.d.ts → index-CNwl6vmH.d.ts} +1 -1
  36. package/dist/index.cjs +700 -38
  37. package/dist/index.cjs.map +1 -1
  38. package/dist/index.d.cts +61 -6
  39. package/dist/index.d.ts +61 -6
  40. package/dist/index.js +409 -5
  41. package/dist/index.js.map +1 -1
  42. package/dist/input.cjs +71 -25
  43. package/dist/input.cjs.map +1 -1
  44. package/dist/input.d.cts +4 -2
  45. package/dist/input.d.ts +4 -2
  46. package/dist/input.js +1 -1
  47. package/dist/list/item.d.cts +2 -2
  48. package/dist/list/item.d.ts +2 -2
  49. package/dist/list.d.cts +3 -3
  50. package/dist/list.d.ts +3 -3
  51. package/dist/notification.d.cts +1 -1
  52. package/dist/notification.d.ts +1 -1
  53. package/dist/profileCard.d.cts +1 -1
  54. package/dist/profileCard.d.ts +1 -1
  55. package/dist/select.cjs +14 -4
  56. package/dist/select.cjs.map +1 -1
  57. package/dist/select.d.cts +5 -4
  58. package/dist/select.d.ts +5 -4
  59. package/dist/select.js +1 -1
  60. package/dist/slider.d.cts +1 -1
  61. package/dist/slider.d.ts +1 -1
  62. package/dist/styles.css +166 -5
  63. package/dist/switch.d.cts +1 -1
  64. package/dist/switch.d.ts +1 -1
  65. package/dist/timeline.cjs +274 -0
  66. package/dist/timeline.cjs.map +1 -0
  67. package/dist/timeline.d.cts +54 -0
  68. package/dist/timeline.d.ts +54 -0
  69. package/dist/timeline.js +5 -0
  70. package/dist/timeline.js.map +1 -0
  71. package/dist/{types-DqPSePni.d.cts → types-CJ0zqPXF.d.cts} +1 -1
  72. package/dist/{types-CbQEphC3.d.ts → types-DaTHYIPO.d.ts} +1 -1
  73. package/package.json +13 -1
  74. package/dist/chunk-BDN4EDJQ.js.map +0 -1
  75. package/dist/chunk-HJFHZNOV.js.map +0 -1
  76. package/dist/chunk-P3ESW6KM.js.map +0 -1
package/dist/index.d.cts CHANGED
@@ -10,6 +10,8 @@ export { default as ToolTip, ToolTipPlacement, ToolTipProps } from './tooltip.cj
10
10
  export { default as Card, CardMediaProps, CardOverflow, CardProps, CardSectionProps, CardTextProps } from './card.cjs';
11
11
  export { default as Block, BlockBlur, BlockProps } from './block.cjs';
12
12
  export { default as Masonry, MasonryProps, MasonryRenderItem } from './masonry.cjs';
13
+ import * as react from 'react';
14
+ import { P as PropIcon, G as GlobalSize, a as Palette } from './global.types-gx9A7mUe.cjs';
13
15
  export { default as AppBar, AppBarNavItem, AppBarProps } from './app-bar.cjs';
14
16
  export { default as Hero, HeroProps } from './hero.cjs';
15
17
  export { Avatar, default as ProfileCard, ProfileCardLayout, ProfileCardProps, SocialLink } from './profileCard.cjs';
@@ -22,15 +24,68 @@ export { default as Icon } from './icon.cjs';
22
24
  import { NotificationArgs } from './notification.cjs';
23
25
  export { default as Notification, NotificationPlacement, NotificationProps, NotificationType, NotificationVariant } from './notification.cjs';
24
26
  export { default as Progress, ProgressProps, ProgressStatus, ProgressType } from './progress.cjs';
25
- export { E as ExpansionPanelDensity, a as ExpansionPanelItem, b as ExpansionPanelItemProps, c as ExpansionPanelProps, d as ExpansionPanelRounded, e as ExpansionPanelValue, f as ExpansionPanelVariant } from './ExpansionPanelItem-ufS2RIZf.cjs';
26
- export { L as ListDensity, a as ListItem, b as ListItemProps, c as ListLines, d as ListRounded, e as ListVariant } from './index-B7xZzSwm.cjs';
27
- import 'react';
28
- import './global.types-D-o85tuX.cjs';
29
- import './types-DqPSePni.cjs';
27
+ export { default as TimeLine, TimeLineAlign, TimeLineDensity, TimeLineDotSize, TimeLineDotVariant, TimeLineItem, TimeLineItemProps, TimeLineProps, TimeLineSide } from './timeline.cjs';
28
+ export { E as ExpansionPanelDensity, a as ExpansionPanelItem, b as ExpansionPanelItemProps, c as ExpansionPanelProps, d as ExpansionPanelRounded, e as ExpansionPanelValue, f as ExpansionPanelVariant } from './ExpansionPanelItem-CEhDj2Uw.cjs';
29
+ export { L as ListDensity, a as ListItem, b as ListItemProps, c as ListLines, d as ListRounded, e as ListVariant } from './index-BDrBOeFI.cjs';
30
+ import './types-CJ0zqPXF.cjs';
31
+
32
+ type TabsValue = string | number;
33
+ type TabsVariant = 'line' | 'card' | 'pill';
34
+ type TabsSize = GlobalSize;
35
+ type TabsExtraContent = react.ReactNode | {
36
+ left?: react.ReactNode;
37
+ right?: react.ReactNode;
38
+ };
39
+ interface TabsProps extends Omit<react.HTMLAttributes<HTMLDivElement>, 'onChange'> {
40
+ activeKey?: TabsValue;
41
+ defaultActiveKey?: TabsValue;
42
+ onChange?: (activeKey: TabsValue) => void;
43
+ variant?: TabsVariant;
44
+ size?: TabsSize;
45
+ color?: Palette;
46
+ align?: 'start' | 'center' | 'end';
47
+ tabBarGutter?: number;
48
+ tabBarExtraContent?: TabsExtraContent;
49
+ tabBarClassName?: string;
50
+ destroyInactiveTabPane?: boolean;
51
+ keepMounted?: boolean;
52
+ }
53
+ interface TabProps extends react.HTMLAttributes<HTMLDivElement> {
54
+ label: react.ReactNode;
55
+ value?: TabsValue;
56
+ disabled?: boolean;
57
+ icon?: PropIcon;
58
+ badge?: react.ReactNode;
59
+ forceRender?: boolean;
60
+ tabClassName?: string;
61
+ panelClassName?: string;
62
+ }
63
+ interface TabsContextValue {
64
+ activeKey?: TabsValue;
65
+ onChange?: (activeKey: TabsValue) => void;
66
+ variant: TabsVariant;
67
+ size: TabsSize;
68
+ color: Palette;
69
+ destroyInactiveTabPane: boolean;
70
+ keepMounted: boolean;
71
+ }
72
+ interface TabsInternalProps {
73
+ __tabsContext?: TabsContextValue;
74
+ __tabsValue?: TabsValue;
75
+ __tabsIndex?: number;
76
+ __tabsTabId?: string;
77
+ __tabsPanelId?: string;
78
+ }
79
+
80
+ /**
81
+ * Tabbed container inspired by Ant Design with line, card, and pill styles.
82
+ */
83
+ declare const Tabs: react.ForwardRefExoticComponent<TabsProps & react.RefAttributes<HTMLDivElement>>;
84
+ declare const Tab: react.ForwardRefExoticComponent<TabProps & TabsInternalProps & react.RefAttributes<HTMLDivElement>>;
30
85
 
31
86
  declare const useNotification: (defaultMessage?: NotificationArgs) => {
32
87
  messages: NotificationArgs[];
33
88
  showNotification: (notification: NotificationArgs) => void;
34
89
  };
35
90
 
36
- export { NotificationArgs, useNotification };
91
+ export { NotificationArgs, Tab, type TabProps, Tabs, type TabsProps, type TabsSize, type TabsValue, type TabsVariant, useNotification };
package/dist/index.d.ts CHANGED
@@ -10,6 +10,8 @@ export { default as ToolTip, ToolTipPlacement, ToolTipProps } from './tooltip.js
10
10
  export { default as Card, CardMediaProps, CardOverflow, CardProps, CardSectionProps, CardTextProps } from './card.js';
11
11
  export { default as Block, BlockBlur, BlockProps } from './block.js';
12
12
  export { default as Masonry, MasonryProps, MasonryRenderItem } from './masonry.js';
13
+ import * as react from 'react';
14
+ import { P as PropIcon, G as GlobalSize, a as Palette } from './global.types-gx9A7mUe.js';
13
15
  export { default as AppBar, AppBarNavItem, AppBarProps } from './app-bar.js';
14
16
  export { default as Hero, HeroProps } from './hero.js';
15
17
  export { Avatar, default as ProfileCard, ProfileCardLayout, ProfileCardProps, SocialLink } from './profileCard.js';
@@ -22,15 +24,68 @@ export { default as Icon } from './icon.js';
22
24
  import { NotificationArgs } from './notification.js';
23
25
  export { default as Notification, NotificationPlacement, NotificationProps, NotificationType, NotificationVariant } from './notification.js';
24
26
  export { default as Progress, ProgressProps, ProgressStatus, ProgressType } from './progress.js';
25
- export { E as ExpansionPanelDensity, a as ExpansionPanelItem, b as ExpansionPanelItemProps, c as ExpansionPanelProps, d as ExpansionPanelRounded, e as ExpansionPanelValue, f as ExpansionPanelVariant } from './ExpansionPanelItem-CFm8a8R_.js';
26
- export { L as ListDensity, a as ListItem, b as ListItemProps, c as ListLines, d as ListRounded, e as ListVariant } from './index-BhfThlf0.js';
27
- import 'react';
28
- import './global.types-D-o85tuX.js';
29
- import './types-CbQEphC3.js';
27
+ export { default as TimeLine, TimeLineAlign, TimeLineDensity, TimeLineDotSize, TimeLineDotVariant, TimeLineItem, TimeLineItemProps, TimeLineProps, TimeLineSide } from './timeline.js';
28
+ export { E as ExpansionPanelDensity, a as ExpansionPanelItem, b as ExpansionPanelItemProps, c as ExpansionPanelProps, d as ExpansionPanelRounded, e as ExpansionPanelValue, f as ExpansionPanelVariant } from './ExpansionPanelItem-C4-2nlhq.js';
29
+ export { L as ListDensity, a as ListItem, b as ListItemProps, c as ListLines, d as ListRounded, e as ListVariant } from './index-CNwl6vmH.js';
30
+ import './types-DaTHYIPO.js';
31
+
32
+ type TabsValue = string | number;
33
+ type TabsVariant = 'line' | 'card' | 'pill';
34
+ type TabsSize = GlobalSize;
35
+ type TabsExtraContent = react.ReactNode | {
36
+ left?: react.ReactNode;
37
+ right?: react.ReactNode;
38
+ };
39
+ interface TabsProps extends Omit<react.HTMLAttributes<HTMLDivElement>, 'onChange'> {
40
+ activeKey?: TabsValue;
41
+ defaultActiveKey?: TabsValue;
42
+ onChange?: (activeKey: TabsValue) => void;
43
+ variant?: TabsVariant;
44
+ size?: TabsSize;
45
+ color?: Palette;
46
+ align?: 'start' | 'center' | 'end';
47
+ tabBarGutter?: number;
48
+ tabBarExtraContent?: TabsExtraContent;
49
+ tabBarClassName?: string;
50
+ destroyInactiveTabPane?: boolean;
51
+ keepMounted?: boolean;
52
+ }
53
+ interface TabProps extends react.HTMLAttributes<HTMLDivElement> {
54
+ label: react.ReactNode;
55
+ value?: TabsValue;
56
+ disabled?: boolean;
57
+ icon?: PropIcon;
58
+ badge?: react.ReactNode;
59
+ forceRender?: boolean;
60
+ tabClassName?: string;
61
+ panelClassName?: string;
62
+ }
63
+ interface TabsContextValue {
64
+ activeKey?: TabsValue;
65
+ onChange?: (activeKey: TabsValue) => void;
66
+ variant: TabsVariant;
67
+ size: TabsSize;
68
+ color: Palette;
69
+ destroyInactiveTabPane: boolean;
70
+ keepMounted: boolean;
71
+ }
72
+ interface TabsInternalProps {
73
+ __tabsContext?: TabsContextValue;
74
+ __tabsValue?: TabsValue;
75
+ __tabsIndex?: number;
76
+ __tabsTabId?: string;
77
+ __tabsPanelId?: string;
78
+ }
79
+
80
+ /**
81
+ * Tabbed container inspired by Ant Design with line, card, and pill styles.
82
+ */
83
+ declare const Tabs: react.ForwardRefExoticComponent<TabsProps & react.RefAttributes<HTMLDivElement>>;
84
+ declare const Tab: react.ForwardRefExoticComponent<TabProps & TabsInternalProps & react.RefAttributes<HTMLDivElement>>;
30
85
 
31
86
  declare const useNotification: (defaultMessage?: NotificationArgs) => {
32
87
  messages: NotificationArgs[];
33
88
  showNotification: (notification: NotificationArgs) => void;
34
89
  };
35
90
 
36
- export { NotificationArgs, useNotification };
91
+ export { NotificationArgs, Tab, type TabProps, Tabs, type TabsProps, type TabsSize, type TabsValue, type TabsVariant, useNotification };
package/dist/index.js CHANGED
@@ -1,10 +1,11 @@
1
1
  export { Notification_default as Notification } from './chunk-S7VLFCLP.js';
2
2
  export { Progress_default as Progress } from './chunk-Z5A2OIDI.js';
3
- export { Input_default as Input } from './chunk-P3ESW6KM.js';
3
+ export { TimeLine_default as TimeLine, TimeLineItem } from './chunk-4J3SRVOS.js';
4
+ export { Input_default as Input } from './chunk-OBGYXMZ3.js';
4
5
  export { TextArea_default as TextArea } from './chunk-SCJMH5VE.js';
5
6
  export { Slider_default as Slider } from './chunk-GMDNSU26.js';
6
7
  export { Switch_default as Switch } from './chunk-5LWU5T2C.js';
7
- export { Select_default as Select } from './chunk-BDN4EDJQ.js';
8
+ export { Select_default as Select } from './chunk-LULQOD2K.js';
8
9
  import './chunk-6SKW43XI.js';
9
10
  export { Icon_default as Icon } from './chunk-HEXJCQRO.js';
10
11
  export { Hero_default as Hero } from './chunk-VPF7M2PB.js';
@@ -18,15 +19,418 @@ export { Block_default as Block } from './chunk-5GT6L4BE.js';
18
19
  export { AppBar_default as AppBar } from './chunk-67BAO35I.js';
19
20
  export { Masonry_default as Masonry } from './chunk-HAXGOTZO.js';
20
21
  export { Button_default as Button } from './chunk-DIWGVTWO.js';
21
- export { Chip_default as Chip } from './chunk-HJFHZNOV.js';
22
+ export { Chip_default as Chip } from './chunk-HT5XBHWN.js';
23
+ import { resolveIconClassName } from './chunk-PSMGRUU5.js';
22
24
  import './chunk-IEILIKS2.js';
23
25
  export { Badge_default as Badge } from './chunk-HIRPMCQJ.js';
24
26
  export { Alert_default as Alert } from './chunk-KQOR3C7E.js';
25
27
  export { List_default as List } from './chunk-NADLY6LM.js';
26
28
  export { Item_default as ListItem } from './chunk-L4UUC4EF.js';
27
29
  export { Menu_default as Menu } from './chunk-ZTP2JSQ6.js';
28
- import { useState } from 'react';
30
+ import * as React from 'react';
31
+ import { isValidElement, useState } from 'react';
32
+ import { twMerge } from 'tailwind-merge';
33
+ import { jsxs, jsx } from 'react/jsx-runtime';
29
34
 
35
+ var TABS_TAB_MARKER = "__isTabsTab";
36
+ var hasMarker = (type) => {
37
+ if (!type || typeof type !== "function" && typeof type !== "object") {
38
+ return false;
39
+ }
40
+ if (type[TABS_TAB_MARKER]) {
41
+ return true;
42
+ }
43
+ const innerType = type.type;
44
+ if (innerType && innerType !== type) {
45
+ return hasMarker(innerType);
46
+ }
47
+ return false;
48
+ };
49
+ var isTabsTabElement = (element) => {
50
+ if (!isValidElement(element)) {
51
+ return false;
52
+ }
53
+ return hasMarker(element.type);
54
+ };
55
+ var markTabsTab = (component) => {
56
+ if (typeof component !== "function" && (typeof component !== "object" || component === null)) {
57
+ return;
58
+ }
59
+ component[TABS_TAB_MARKER] = true;
60
+ };
61
+ var sizeClasses = {
62
+ "x-small": { tab: "h-7 px-2 text-xs", icon: "text-sm" },
63
+ small: { tab: "h-8 px-2.5 text-sm", icon: "text-base" },
64
+ medium: { tab: "h-9 px-3 text-sm", icon: "text-base" },
65
+ large: { tab: "h-10 px-3.5 text-base", icon: "text-lg" },
66
+ "x-large": { tab: "h-11 px-4 text-base", icon: "text-lg" }
67
+ };
68
+ var variantListClasses = {
69
+ line: "border-b border-gray-200",
70
+ card: "rounded-xl bg-gray-100 p-1",
71
+ pill: "rounded-full bg-gray-100/80 p-1"
72
+ };
73
+ var variantTabBaseClasses = {
74
+ line: "border-b-2 border-transparent -mb-px",
75
+ card: "rounded-lg border border-transparent bg-white/70",
76
+ pill: "rounded-full"
77
+ };
78
+ var paletteClasses = {
79
+ primary: {
80
+ text: "text-primary",
81
+ border: "border-primary",
82
+ bg: "bg-primary/10",
83
+ ring: "ring-primary/30",
84
+ ink: "bg-primary"
85
+ },
86
+ neutral: {
87
+ text: "text-gray-900",
88
+ border: "border-gray-900",
89
+ bg: "bg-gray-100",
90
+ ring: "ring-gray-900/20",
91
+ ink: "bg-gray-900"
92
+ },
93
+ info: {
94
+ text: "text-sky-600",
95
+ border: "border-sky-500",
96
+ bg: "bg-sky-50",
97
+ ring: "ring-sky-500/20",
98
+ ink: "bg-sky-500"
99
+ },
100
+ success: {
101
+ text: "text-emerald-600",
102
+ border: "border-emerald-500",
103
+ bg: "bg-emerald-50",
104
+ ring: "ring-emerald-500/20",
105
+ ink: "bg-emerald-500"
106
+ },
107
+ warning: {
108
+ text: "text-amber-600",
109
+ border: "border-amber-500",
110
+ bg: "bg-amber-50",
111
+ ring: "ring-amber-500/20",
112
+ ink: "bg-amber-500"
113
+ },
114
+ danger: {
115
+ text: "text-red-600",
116
+ border: "border-red-500",
117
+ bg: "bg-red-50",
118
+ ring: "ring-red-500/20",
119
+ ink: "bg-red-500"
120
+ },
121
+ surface: {
122
+ text: "text-gray-900",
123
+ border: "border-gray-300",
124
+ bg: "bg-white",
125
+ ring: "ring-gray-300/30",
126
+ ink: "bg-gray-400"
127
+ },
128
+ bw: {
129
+ text: "text-black",
130
+ border: "border-black",
131
+ bg: "bg-black/10",
132
+ ring: "ring-black/20",
133
+ ink: "bg-black"
134
+ }
135
+ };
136
+ var panelVariantClasses = {
137
+ line: "pt-4",
138
+ card: "mt-3 rounded-xl border border-gray-200 bg-white p-4 shadow-sm",
139
+ pill: "mt-3 rounded-2xl border border-gray-200 bg-white/90 p-4"
140
+ };
141
+ var isExtraContentObject = (value) => {
142
+ return !!value && typeof value === "object" && !React.isValidElement(value) && ("left" in value || "right" in value);
143
+ };
144
+ var resolveFirstEnabledTab = (tabs) => tabs.find((tab) => !tab.disabled)?.value;
145
+ var clampActive = (value, tabs) => {
146
+ if (value === void 0) {
147
+ return resolveFirstEnabledTab(tabs);
148
+ }
149
+ const match = tabs.find((tab) => tab.value === value);
150
+ if (!match || match.disabled) {
151
+ return resolveFirstEnabledTab(tabs);
152
+ }
153
+ return value;
154
+ };
155
+ var resolveIconNode = (icon, size) => {
156
+ if (!icon) return null;
157
+ const iconClass = resolveIconClassName(icon);
158
+ return iconClass ? /* @__PURE__ */ jsx("i", { className: twMerge(iconClass, size ? sizeClasses[size].icon : void 0), "aria-hidden": true }) : null;
159
+ };
160
+ var collectTabs = (children, tabsId) => {
161
+ const tabs = [];
162
+ let index = 0;
163
+ const walk = (node) => {
164
+ if (Array.isArray(node)) {
165
+ node.forEach(walk);
166
+ return;
167
+ }
168
+ if (!isTabsTabElement(node)) {
169
+ if (React.isValidElement(node)) {
170
+ const props = node.props;
171
+ if (props && Object.prototype.hasOwnProperty.call(props, "children")) {
172
+ walk(props.children);
173
+ }
174
+ }
175
+ return;
176
+ }
177
+ const tabIndex = index++;
178
+ const value = node.props.value ?? tabIndex;
179
+ const tabId = `${tabsId}-tab-${tabIndex}`;
180
+ const panelId = `${tabsId}-panel-${tabIndex}`;
181
+ tabs.push({
182
+ element: node,
183
+ index: tabIndex,
184
+ value,
185
+ label: node.props.label,
186
+ disabled: node.props.disabled,
187
+ icon: node.props.icon,
188
+ badge: node.props.badge,
189
+ tabClassName: node.props.tabClassName,
190
+ panelClassName: node.props.panelClassName,
191
+ tabId,
192
+ panelId,
193
+ forceRender: node.props.forceRender
194
+ });
195
+ };
196
+ walk(children);
197
+ return tabs;
198
+ };
199
+ var injectTabs = (children, context, tabs) => {
200
+ let index = 0;
201
+ const walk = (node) => {
202
+ if (Array.isArray(node)) {
203
+ let changed = false;
204
+ const next = node.map((child) => {
205
+ const mapped = walk(child);
206
+ if (mapped !== child) {
207
+ changed = true;
208
+ }
209
+ return mapped;
210
+ });
211
+ return changed ? next : node;
212
+ }
213
+ if (!React.isValidElement(node)) {
214
+ return node;
215
+ }
216
+ if (isTabsTabElement(node)) {
217
+ const tab = tabs[index++];
218
+ if (!tab) {
219
+ return node;
220
+ }
221
+ const injectedProps = {
222
+ value: tab.value,
223
+ __tabsContext: context,
224
+ __tabsValue: tab.value,
225
+ __tabsIndex: tab.index,
226
+ __tabsTabId: tab.tabId,
227
+ __tabsPanelId: tab.panelId
228
+ };
229
+ return React.cloneElement(node, injectedProps);
230
+ }
231
+ if (node.props) {
232
+ const props = node.props;
233
+ if (props && Object.prototype.hasOwnProperty.call(props, "children")) {
234
+ const mappedChildren = walk(props.children);
235
+ if (mappedChildren !== props.children) {
236
+ return React.cloneElement(node, void 0, mappedChildren);
237
+ }
238
+ }
239
+ }
240
+ return node;
241
+ };
242
+ return walk(children);
243
+ };
244
+ var handleTabListKeyDown = (event) => {
245
+ const { key } = event;
246
+ if (!["ArrowLeft", "ArrowRight", "Home", "End"].includes(key)) {
247
+ return;
248
+ }
249
+ const tabs = Array.from(event.currentTarget.querySelectorAll('[role="tab"]')).filter((tab) => !tab.disabled);
250
+ if (!tabs.length) {
251
+ return;
252
+ }
253
+ const currentIndex = tabs.findIndex((tab) => tab === document.activeElement);
254
+ let nextIndex = currentIndex;
255
+ if (key === "ArrowRight") {
256
+ nextIndex = currentIndex === -1 ? 0 : (currentIndex + 1) % tabs.length;
257
+ }
258
+ if (key === "ArrowLeft") {
259
+ nextIndex = currentIndex === -1 ? tabs.length - 1 : (currentIndex - 1 + tabs.length) % tabs.length;
260
+ }
261
+ if (key === "Home") {
262
+ nextIndex = 0;
263
+ }
264
+ if (key === "End") {
265
+ nextIndex = tabs.length - 1;
266
+ }
267
+ tabs[nextIndex]?.focus();
268
+ event.preventDefault();
269
+ };
270
+ var Tabs = React.forwardRef((props, ref) => {
271
+ const {
272
+ activeKey,
273
+ defaultActiveKey,
274
+ onChange,
275
+ variant = "line",
276
+ size = "medium",
277
+ color = "primary",
278
+ align = "start",
279
+ tabBarGutter = 8,
280
+ tabBarExtraContent,
281
+ tabBarClassName,
282
+ destroyInactiveTabPane = false,
283
+ keepMounted = false,
284
+ className,
285
+ children,
286
+ id,
287
+ ...rest
288
+ } = props;
289
+ const tabsId = typeof id === "string" && id.trim().length ? id : "tabs";
290
+ const tabs = collectTabs(children, tabsId);
291
+ const resolvedActive = clampActive(activeKey ?? defaultActiveKey, tabs);
292
+ const handleActivate = (value) => {
293
+ onChange?.(value);
294
+ };
295
+ const extraContent = tabBarExtraContent;
296
+ const extraLeft = isExtraContentObject(extraContent) ? extraContent.left : null;
297
+ const extraRight = isExtraContentObject(extraContent) ? extraContent.right : extraContent;
298
+ const palette = paletteClasses[color] ?? paletteClasses.primary;
299
+ const context = {
300
+ activeKey: resolvedActive,
301
+ onChange: handleActivate,
302
+ variant,
303
+ size,
304
+ color,
305
+ destroyInactiveTabPane,
306
+ keepMounted
307
+ };
308
+ const enhancedChildren = injectTabs(children, context, tabs);
309
+ return /* @__PURE__ */ jsxs(
310
+ "div",
311
+ {
312
+ ...rest,
313
+ id,
314
+ ref,
315
+ className: twMerge("tabs flex w-full flex-col text-gray-900", className),
316
+ children: [
317
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
318
+ extraLeft ? /* @__PURE__ */ jsx("div", { className: "flex items-center", children: extraLeft }) : null,
319
+ /* @__PURE__ */ jsx(
320
+ "div",
321
+ {
322
+ role: "tablist",
323
+ "aria-orientation": "horizontal",
324
+ onKeyDown: handleTabListKeyDown,
325
+ className: twMerge(
326
+ "flex min-w-0 flex-1 items-center gap-2 overflow-x-auto",
327
+ align === "center" ? "justify-center" : align === "end" ? "justify-end" : void 0,
328
+ variantListClasses[variant],
329
+ tabBarClassName
330
+ ),
331
+ style: { gap: tabBarGutter },
332
+ children: tabs.map((tab) => {
333
+ const isActive = tab.value === resolvedActive;
334
+ const sizeClass = sizeClasses[size] ?? sizeClasses.medium;
335
+ const iconNode = resolveIconNode(tab.icon, size);
336
+ const badgeNode = tab.badge ? /* @__PURE__ */ jsx("span", { className: "rounded-full bg-gray-200 px-1.5 py-0.5 text-[0.6rem] font-semibold text-gray-700", children: tab.badge }) : null;
337
+ const activeText = isActive ? palette.text : "text-gray-600";
338
+ const activeBorder = isActive ? palette.border : "border-transparent";
339
+ const activeBg = isActive ? palette.bg : void 0;
340
+ const activeRing = isActive ? palette.ring : void 0;
341
+ const variantClasses = {
342
+ line: twMerge(activeText, activeBorder),
343
+ card: twMerge(activeText, activeBg, activeBorder, isActive ? "shadow-sm" : void 0),
344
+ pill: twMerge(activeText, activeBg)
345
+ };
346
+ return /* @__PURE__ */ jsxs(
347
+ "button",
348
+ {
349
+ type: "button",
350
+ role: "tab",
351
+ id: tab.tabId,
352
+ "aria-selected": isActive,
353
+ "aria-controls": tab.panelId,
354
+ "aria-disabled": tab.disabled || void 0,
355
+ disabled: tab.disabled,
356
+ tabIndex: isActive ? 0 : -1,
357
+ onClick: () => {
358
+ if (!tab.disabled) {
359
+ handleActivate(tab.value);
360
+ }
361
+ },
362
+ className: twMerge(
363
+ "inline-flex items-center gap-2 whitespace-nowrap font-medium transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2",
364
+ sizeClass.tab,
365
+ variantTabBaseClasses[variant],
366
+ variantClasses[variant],
367
+ activeRing ? `ring-1 ${activeRing}` : void 0,
368
+ tab.disabled ? "cursor-not-allowed text-gray-400 opacity-60" : "hover:text-gray-900",
369
+ tab.tabClassName
370
+ ),
371
+ "data-state": isActive ? "active" : "inactive",
372
+ children: [
373
+ iconNode,
374
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: tab.label }),
375
+ badgeNode
376
+ ]
377
+ },
378
+ tab.value
379
+ );
380
+ })
381
+ }
382
+ ),
383
+ extraRight ? /* @__PURE__ */ jsx("div", { className: "flex items-center", children: extraRight }) : null
384
+ ] }),
385
+ /* @__PURE__ */ jsx("div", { className: twMerge("min-h-0", panelVariantClasses[variant]), children: enhancedChildren })
386
+ ]
387
+ }
388
+ );
389
+ });
390
+ Tabs.displayName = "Tabs";
391
+ var Tab = React.forwardRef((props, ref) => {
392
+ const {
393
+ label: _label,
394
+ value,
395
+ disabled,
396
+ forceRender,
397
+ tabClassName: _tabClassName,
398
+ panelClassName,
399
+ className,
400
+ children,
401
+ __tabsContext,
402
+ __tabsValue,
403
+ __tabsTabId,
404
+ __tabsPanelId,
405
+ ...rest
406
+ } = props;
407
+ const context = __tabsContext;
408
+ const resolvedValue = value ?? __tabsValue;
409
+ const isActive = context ? context.activeKey === resolvedValue : true;
410
+ const shouldRender = !context || isActive || context.keepMounted || !context.destroyInactiveTabPane || forceRender;
411
+ if (!shouldRender) {
412
+ return null;
413
+ }
414
+ return /* @__PURE__ */ jsx(
415
+ "div",
416
+ {
417
+ ...rest,
418
+ ref,
419
+ role: "tabpanel",
420
+ id: __tabsPanelId,
421
+ "aria-labelledby": __tabsTabId,
422
+ "aria-hidden": context ? !isActive : void 0,
423
+ hidden: context ? !isActive : void 0,
424
+ className: twMerge("tabs-panel text-gray-900", className, panelClassName),
425
+ "data-state": isActive ? "active" : "inactive",
426
+ "data-disabled": disabled || void 0,
427
+ children
428
+ }
429
+ );
430
+ });
431
+ Tab.displayName = "Tab";
432
+ markTabsTab(Tab);
433
+ var Tabs_default = Tabs;
30
434
  var useNotification = (defaultMessage) => {
31
435
  const [messages, setMessages] = useState([]);
32
436
  const clearNotifications = (key) => {
@@ -49,6 +453,6 @@ var useNotification = (defaultMessage) => {
49
453
  };
50
454
  var useNotification_default = useNotification;
51
455
 
52
- export { useNotification_default as useNotification };
456
+ export { Tab, Tabs_default as Tabs, useNotification_default as useNotification };
53
457
  //# sourceMappingURL=index.js.map
54
458
  //# sourceMappingURL=index.js.map