@dododog/ui 0.16.0 → 0.17.0
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/{chunk-R4G5LFPN.js → chunk-2NMA3AXV.js} +37 -8
- package/dist/{chunk-Z7CF7EQJ.mjs → chunk-52M2KUC4.mjs} +37 -8
- package/dist/chunk-DUCRCDLI.mjs +78 -0
- package/dist/{chunk-HH4X2JYO.js → chunk-EKOGDJUT.js} +32 -4
- package/dist/{chunk-QWDKSY6Y.js → chunk-OZ4RJDDZ.js} +46 -2
- package/dist/{chunk-762LQMWP.js → chunk-RAXPJ7VC.js} +66 -8
- package/dist/{chunk-N5ZNXNCO.mjs → chunk-UYOPZZBN.mjs} +32 -4
- package/dist/chunk-YGAWCP65.mjs +109 -0
- package/dist/components/Modal/index.d.mts +42 -1
- package/dist/components/Modal/index.d.ts +42 -1
- package/dist/components/Modal/index.js +2 -2
- package/dist/components/Modal/index.mjs +1 -1
- package/dist/components/SegmentedControl/index.d.mts +16 -0
- package/dist/components/SegmentedControl/index.d.ts +16 -0
- package/dist/components/SegmentedControl/index.js +2 -2
- package/dist/components/SegmentedControl/index.mjs +1 -1
- package/dist/components/Tabs/index.d.mts +21 -0
- package/dist/components/Tabs/index.d.ts +21 -0
- package/dist/components/Tabs/index.js +2 -2
- package/dist/components/Tabs/index.mjs +1 -1
- package/dist/components/Textarea/index.js +3 -3
- package/dist/components/Textarea/index.mjs +1 -1
- package/dist/index.d.mts +16 -3
- package/dist/index.d.ts +16 -3
- package/dist/index.js +112 -110
- package/dist/index.mjs +23 -21
- package/package.json +11 -11
- package/dist/chunk-36Y7UU32.mjs +0 -34
- package/dist/chunk-VOZPGXQD.mjs +0 -51
package/dist/chunk-VOZPGXQD.mjs
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { cn } from './chunk-IMKLN273.mjs';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
|
-
var Tabs = React.forwardRef(
|
|
6
|
-
({ tabs, defaultTab, value, onChange, className }, ref) => {
|
|
7
|
-
const [internalValue, setInternalValue] = React.useState(
|
|
8
|
-
defaultTab || tabs[0]?.key || ""
|
|
9
|
-
);
|
|
10
|
-
const activeKey = value ?? internalValue;
|
|
11
|
-
const handleChange = (key) => {
|
|
12
|
-
if (onChange) {
|
|
13
|
-
onChange(key);
|
|
14
|
-
} else {
|
|
15
|
-
setInternalValue(key);
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
const activeTab = tabs.find((t) => t.key === activeKey);
|
|
19
|
-
return /* @__PURE__ */ jsxs("div", { ref, className: cn("w-full", className), children: [
|
|
20
|
-
/* @__PURE__ */ jsx(
|
|
21
|
-
"div",
|
|
22
|
-
{
|
|
23
|
-
role: "tablist",
|
|
24
|
-
className: "flex border-b border-gray-200 gap-1 overflow-x-auto",
|
|
25
|
-
children: tabs.map((tab) => /* @__PURE__ */ jsxs(
|
|
26
|
-
"button",
|
|
27
|
-
{
|
|
28
|
-
role: "tab",
|
|
29
|
-
type: "button",
|
|
30
|
-
"aria-selected": tab.key === activeKey,
|
|
31
|
-
onClick: () => handleChange(tab.key),
|
|
32
|
-
className: cn(
|
|
33
|
-
"flex items-center gap-2 px-4 py-3 text-sm font-medium whitespace-nowrap border-b-2 transition-colors -mb-px",
|
|
34
|
-
tab.key === activeKey ? "border-secondary text-secondary" : "border-transparent text-text-secondary hover:text-primary hover:border-gray-300"
|
|
35
|
-
),
|
|
36
|
-
children: [
|
|
37
|
-
tab.icon && /* @__PURE__ */ jsx("span", { className: "shrink-0", children: tab.icon }),
|
|
38
|
-
tab.label
|
|
39
|
-
]
|
|
40
|
-
},
|
|
41
|
-
tab.key
|
|
42
|
-
))
|
|
43
|
-
}
|
|
44
|
-
),
|
|
45
|
-
/* @__PURE__ */ jsx("div", { role: "tabpanel", className: "py-4", children: activeTab?.content })
|
|
46
|
-
] });
|
|
47
|
-
}
|
|
48
|
-
);
|
|
49
|
-
Tabs.displayName = "Tabs";
|
|
50
|
-
|
|
51
|
-
export { Tabs };
|