listpage-next 0.0.216 → 0.0.219

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.
@@ -1,8 +1,9 @@
1
- import { ReactNode } from 'react';
1
+ import { CSSProperties, ReactNode } from 'react';
2
2
  export interface CardProps {
3
3
  title: string;
4
4
  extra?: ReactNode;
5
5
  bordered?: boolean;
6
6
  children?: ReactNode;
7
+ style?: CSSProperties;
7
8
  }
8
9
  export declare const Card: (props: CardProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,9 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import styled_components from "styled-components";
3
3
  const Card = (props)=>{
4
- const { title, extra, bordered, children } = props;
4
+ const { title, extra, bordered, children, style } = props;
5
5
  return /*#__PURE__*/ jsxs(CardContainer, {
6
+ style: style,
6
7
  bordered: bordered,
7
8
  children: [
8
9
  /*#__PURE__*/ jsxs(CardHeader, {
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  export interface TabProps {
3
- tabs: {
3
+ items: {
4
4
  icon?: ReactNode;
5
5
  label: string;
6
6
  value: string;
@@ -9,4 +9,4 @@ export interface TabProps {
9
9
  value?: string;
10
10
  onChange?: (tab: string) => void;
11
11
  }
12
- export declare const Tab: (props: TabProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const Tabs: (props: TabProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,13 +1,16 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useControllableValue } from "ahooks";
3
3
  import { styled } from "styled-components";
4
- const Tab = (props)=>{
5
- const { tabs } = props;
6
- const [activeTab, setActiveTab] = useControllableValue(props);
4
+ const Tabs = (props)=>{
5
+ const { items } = props;
6
+ const defaultActiveTab = items[0]?.value;
7
+ const [activeTab, setActiveTab] = useControllableValue(props, {
8
+ defaultValue: defaultActiveTab
9
+ });
7
10
  return /*#__PURE__*/ jsxs(TabContainer, {
8
11
  children: [
9
12
  /*#__PURE__*/ jsx(TabHeader, {
10
- children: tabs.map((tab)=>/*#__PURE__*/ jsxs(TabItem, {
13
+ children: items.map((tab)=>/*#__PURE__*/ jsxs(TabItem, {
11
14
  $active: tab.value === activeTab,
12
15
  onClick: ()=>setActiveTab(tab.value),
13
16
  children: [
@@ -19,7 +22,7 @@ const Tab = (props)=>{
19
22
  }, tab.value))
20
23
  }),
21
24
  /*#__PURE__*/ jsx(TabContent, {
22
- children: tabs.find((t)=>t.value === activeTab)?.children
25
+ children: items.find((t)=>t.value === activeTab)?.children
23
26
  })
24
27
  ]
25
28
  });
@@ -74,4 +77,4 @@ const TabContent = styled.div`
74
77
  const IconContainer = styled.span`
75
78
  margin-right: 4px;
76
79
  `;
77
- export { Tab };
80
+ export { Tabs };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "listpage-next",
3
- "version": "0.0.216",
3
+ "version": "0.0.219",
4
4
  "description": "A React component library for creating filter forms with Ant Design",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",