@tidbcloud/uikit 2.0.9 → 2.0.11

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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @tidbcloud/uikit
2
2
 
3
+ ## 2.0.11
4
+
5
+ ### Patch Changes
6
+
7
+ - fix(FormTimeRangePickerProps): types ([#463](https://github.com/tidbcloud/tidbcloud-uikit/pull/463))
8
+ - tweak(TimeRangePicker): compatible types ([#462](https://github.com/tidbcloud/tidbcloud-uikit/pull/462))
9
+
10
+ ## 2.0.10
11
+
12
+ ### Patch Changes
13
+
14
+ - Feat/remove clear btn icon ([#460](https://github.com/tidbcloud/tidbcloud-uikit/pull/460))
15
+
3
16
  ## 2.0.9
4
17
 
5
18
  ### Patch Changes
@@ -1,7 +1,7 @@
1
1
  import { RegisterOptions } from 'react-hook-form';
2
2
  import { TimeRangePickerProps } from '../TimeRangePicker/index.cjs';
3
- export interface FormTimeRangePickerProps extends TimeRangePickerProps {
3
+ export type FormTimeRangePickerProps = TimeRangePickerProps & {
4
4
  name: string;
5
5
  rules?: RegisterOptions;
6
- }
6
+ };
7
7
  export declare const FormTimeRangePicker: ({ name, rules, onChange, ...rest }: FormTimeRangePickerProps) => import("react/jsx-runtime.js").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { RegisterOptions } from 'react-hook-form';
2
2
  import { TimeRangePickerProps } from '../TimeRangePicker/index.mjs';
3
- export interface FormTimeRangePickerProps extends TimeRangePickerProps {
3
+ export type FormTimeRangePickerProps = TimeRangePickerProps & {
4
4
  name: string;
5
5
  rules?: RegisterOptions;
6
- }
6
+ };
7
7
  export declare const FormTimeRangePicker: ({ name, rules, onChange, ...rest }: FormTimeRangePickerProps) => import("react/jsx-runtime.js").JSX.Element;
@@ -176,10 +176,7 @@ function SearchArea(props) {
176
176
  x.name
177
177
  )),
178
178
  /* @__PURE__ */ jsxRuntime.jsxs(Box.Box, { sx: SX_Y_MID, children: [
179
- /* @__PURE__ */ jsxRuntime.jsx(Box.Box, { sx: SX_Y_MID, children: /* @__PURE__ */ jsxRuntime.jsxs(index.Button, { variant: "subtle", onClick: handleReset, children: [
180
- /* @__PURE__ */ jsxRuntime.jsx(index$1.IconEraser, { size: 16, style: { marginRight: 4 } }),
181
- "Clear Filters"
182
- ] }) }),
179
+ /* @__PURE__ */ jsxRuntime.jsx(Box.Box, { sx: SX_Y_MID, children: /* @__PURE__ */ jsxRuntime.jsx(index.Button, { variant: "subtle", onClick: handleReset, children: "Clear Filters" }) }),
183
180
  onRefresh && /* @__PURE__ */ jsxRuntime.jsx(Box.Box, { ml: 16, sx: SX_Y_MID, children: /* @__PURE__ */ jsxRuntime.jsx(index.Button, { variant: "subtle", onClick: handleRefresh, children: /* @__PURE__ */ jsxRuntime.jsx(index$1.IconRefreshCw01, { size: 16 }) }) })
184
181
  ] })
185
182
  ] }) }),
@@ -2,7 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useState, useEffect } from "react";
3
3
  import { useForm } from "react-hook-form";
4
4
  import { useURLQueryState } from "../../hooks/useURLQueryState.mjs";
5
- import { IconEraser, IconRefreshCw01, IconXClose } from "../../icons/index.mjs";
5
+ import { IconRefreshCw01, IconXClose } from "../../icons/index.mjs";
6
6
  /* empty css */
7
7
  /* empty css */
8
8
  /* empty css */
@@ -174,10 +174,7 @@ function SearchArea(props) {
174
174
  x.name
175
175
  )),
176
176
  /* @__PURE__ */ jsxs(Box, { sx: SX_Y_MID, children: [
177
- /* @__PURE__ */ jsx(Box, { sx: SX_Y_MID, children: /* @__PURE__ */ jsxs(Button, { variant: "subtle", onClick: handleReset, children: [
178
- /* @__PURE__ */ jsx(IconEraser, { size: 16, style: { marginRight: 4 } }),
179
- "Clear Filters"
180
- ] }) }),
177
+ /* @__PURE__ */ jsx(Box, { sx: SX_Y_MID, children: /* @__PURE__ */ jsx(Button, { variant: "subtle", onClick: handleReset, children: "Clear Filters" }) }),
181
178
  onRefresh && /* @__PURE__ */ jsx(Box, { ml: 16, sx: SX_Y_MID, children: /* @__PURE__ */ jsx(Button, { variant: "subtle", onClick: handleRefresh, children: /* @__PURE__ */ jsx(IconRefreshCw01, { size: 16 }) }) })
182
179
  ] })
183
180
  ] }) }),
@@ -1,8 +1,15 @@
1
1
  import { ButtonProps } from '../../primitive/index.cjs';
2
2
  import { TimeRange } from './helpers.cjs';
3
- export interface TimeRangePickerProps extends ButtonProps {
3
+ export type TimeRangePickerProps = TimeRangePickerBaseProps & ({
4
+ clearable: true;
4
5
  value?: TimeRange;
5
6
  onChange?: (value?: TimeRange) => void;
7
+ } | {
8
+ clearable?: false;
9
+ value: TimeRange;
10
+ onChange?: (value: TimeRange) => void;
11
+ });
12
+ export interface TimeRangePickerBaseProps extends ButtonProps {
6
13
  loading?: boolean;
7
14
  placeholder?: string;
8
15
  clearable?: boolean;
@@ -1,8 +1,15 @@
1
1
  import { ButtonProps } from '../../primitive/index.mjs';
2
2
  import { TimeRange } from './helpers.mjs';
3
- export interface TimeRangePickerProps extends ButtonProps {
3
+ export type TimeRangePickerProps = TimeRangePickerBaseProps & ({
4
+ clearable: true;
4
5
  value?: TimeRange;
5
6
  onChange?: (value?: TimeRange) => void;
7
+ } | {
8
+ clearable?: false;
9
+ value: TimeRange;
10
+ onChange?: (value: TimeRange) => void;
11
+ });
12
+ export interface TimeRangePickerBaseProps extends ButtonProps {
6
13
  loading?: boolean;
7
14
  placeholder?: string;
8
15
  clearable?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tidbcloud/uikit",
3
- "version": "2.0.9",
3
+ "version": "2.0.11",
4
4
  "description": "tidbcloud uikit",
5
5
  "type": "module",
6
6
  "main": "dist/primitive/index.cjs",