@stella-source/stellasource-dsl 1.4.3 → 1.5.3
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/cjs/index.js +14 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/Tabs/Styles.d.ts +2 -0
- package/dist/cjs/types/components/Tabs/Tab.d.ts +10 -0
- package/dist/cjs/types/components/Tabs/Tabs.d.ts +4 -0
- package/dist/cjs/types/components/Tabs/Tabs.stories.d.ts +11 -0
- package/dist/cjs/types/components/Tabs/types.d.ts +9 -0
- package/dist/cjs/types/index.d.ts +2 -1
- package/dist/esm/index.esm.js +14 -1
- package/dist/esm/index.esm.js.map +1 -1
- package/dist/esm/types/components/Tabs/Styles.d.ts +2 -0
- package/dist/esm/types/components/Tabs/Tab.d.ts +10 -0
- package/dist/esm/types/components/Tabs/Tabs.d.ts +4 -0
- package/dist/esm/types/components/Tabs/Tabs.stories.d.ts +11 -0
- package/dist/esm/types/components/Tabs/types.d.ts +9 -0
- package/dist/esm/types/index.d.ts +2 -1
- package/dist/index.d.ts +12 -1
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from "react";
|
|
2
|
+
interface TabProps {
|
|
3
|
+
id?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
onClick?: (tabLabel: string) => void;
|
|
6
|
+
label: string;
|
|
7
|
+
htmlProps?: HTMLAttributes<HTMLButtonElement>;
|
|
8
|
+
}
|
|
9
|
+
declare const Tab: ({ id, className, onClick, htmlProps, label }: TabProps) => React.JSX.Element;
|
|
10
|
+
export default Tab;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TabsProps } from "./types";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ id, className, tabs, activeTab, htmlProps, onTabClick, }: TabsProps) => import("react").JSX.Element;
|
|
5
|
+
tags: string[];
|
|
6
|
+
parameters: {};
|
|
7
|
+
argTypes: {};
|
|
8
|
+
args: TabsProps;
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
11
|
+
export declare const Tabs: {};
|
|
@@ -15,6 +15,7 @@ import Pagination from "./components/Pagination/Pagination";
|
|
|
15
15
|
import Sync from "./components/Sync/Sync";
|
|
16
16
|
import TableUnitsAndTotals from "./components/TableUnitsAndTotals/TableUnitsAndTotals";
|
|
17
17
|
import PaymentStatus from "./components/PaymentStatus/PaymentStatus";
|
|
18
|
+
import Tabs from "./components/Tabs/Tabs";
|
|
18
19
|
/** Types */
|
|
19
20
|
import { StellaButtonVariant } from "./components/StellaButton/types";
|
|
20
21
|
/** Tokens */
|
|
@@ -22,4 +23,4 @@ import { Styles } from "./shared/tokens";
|
|
|
22
23
|
import "./shared/tokens/tokens.css";
|
|
23
24
|
/**Exports */
|
|
24
25
|
export type { StellaIconDefinition } from "./components/StellaIcon/types";
|
|
25
|
-
export { Label, StellaButton, IconButton, Loader, HelperText, Tooltip, StellaIcon, TextInput, PasswordInput, NumberInput, Table, Pagination, Sync, TableUnitsAndTotals, StellaButtonVariant, PaymentStatus, Styles, };
|
|
26
|
+
export { Tabs, Label, StellaButton, IconButton, Loader, HelperText, Tooltip, StellaIcon, TextInput, PasswordInput, NumberInput, Table, Pagination, Sync, TableUnitsAndTotals, StellaButtonVariant, PaymentStatus, Styles, };
|
package/dist/esm/index.esm.js
CHANGED
|
@@ -21925,5 +21925,18 @@ const PaymentStatus = ({ variant, id, className }) => {
|
|
|
21925
21925
|
a__default.createElement(PaymentStatusLabel, null, label)));
|
|
21926
21926
|
};
|
|
21927
21927
|
|
|
21928
|
-
|
|
21928
|
+
const Tab = ({ id, className, onClick, htmlProps, label }) => {
|
|
21929
|
+
return (a__default.createElement("button", { id: id, className: className, onClick: () => onClick?.(label), ...htmlProps }, label));
|
|
21930
|
+
};
|
|
21931
|
+
|
|
21932
|
+
const TabsBar = styled.nav `
|
|
21933
|
+
display: flex;
|
|
21934
|
+
gap: 2px;
|
|
21935
|
+
`;
|
|
21936
|
+
|
|
21937
|
+
const Tabs = ({ id, className, tabs, activeTab, htmlProps, onTabClick, }) => {
|
|
21938
|
+
return (a__default.createElement(TabsBar, { id: id, className: className, ...htmlProps }, tabs.map((tab) => (a__default.createElement(Tab, { key: `${id}-${tab}`, id: `${id}-${tab}`, label: tab, onClick: () => onTabClick(tab) })))));
|
|
21939
|
+
};
|
|
21940
|
+
|
|
21941
|
+
export { HelperText, IconButton, Label, Loader, NumberInput, Pagination, PasswordInput, PaymentStatus, StellaButton, StellaButtonVariant, StellaIcon, Styles, Sync, Table, TableUnitsAndTotals, Tabs, TextInput, Tooltip };
|
|
21929
21942
|
//# sourceMappingURL=index.esm.js.map
|