@capillarytech/blaze-ui 5.1.11 → 5.1.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capillarytech/blaze-ui",
3
- "version": "5.1.11",
3
+ "version": "5.1.12",
4
4
  "description": "Capillary UI component library with Ant Design v6",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -1,170 +0,0 @@
1
- # CapTimePicker Migration Guide
2
-
3
- ## Overview
4
-
5
- CapTimePicker has been migrated to support Ant Design v6 APIs while maintaining backward compatibility with deprecated props from v3-v5.
6
-
7
- ## Breaking Changes
8
-
9
- ### API Changes (v3 → v6)
10
-
11
- | Old API (v3-v5) | New API (v6) | Migration |
12
- |----------------|--------------|-----------|
13
- | `allowEmpty` | `allowClear` | Use `allowClear` prop |
14
- | `addon` | `renderExtraFooter` | Use `renderExtraFooter` prop |
15
- | `dropdownClassName` | `classNames.popup.root` or `popupClassName` | Use `popupClassName` or `classNames.popup.root` |
16
- | `popupStyle` (v5) | `styles.popup.root` or `popupStyle` | Use `popupStyle` or `styles.popup.root` |
17
- | `bordered` | `variant` | Use `variant` prop (`'outlined'`, `'borderless'`, or `'filled'`) |
18
-
19
- ## Deprecated Props
20
-
21
- The following props are deprecated but still supported for backward compatibility. They will be removed in the next major version.
22
-
23
- | Deprecated Prop | Replacement | Notes |
24
- |----------------|-------------|-------|
25
- | `allowEmpty` | `allowClear` | Maps to `allowClear` internally |
26
- | `addon` | `renderExtraFooter` | Maps to `renderExtraFooter` internally |
27
- | `dropdownClassName` | `popupClassName` or `classNames.popup.root` | Merged with `popupClassName` |
28
- | `dropdownStyle` | `popupStyle` or `styles.popup.root` | Merged with `popupStyle` |
29
- | `bordered` | `variant` | `bordered={false}` → `variant="borderless"`, `bordered={true}` → `variant="outlined"` |
30
-
31
- ## Migration Examples
32
-
33
- ### Example 1: Basic Usage
34
-
35
- **Before (v3-v5):**
36
- ```tsx
37
- import CapTimePicker from '@capillarytech/blaze-ui/components/CapTimePicker';
38
-
39
- <CapTimePicker
40
- value={moment('12:00:00', 'HH:mm:ss')}
41
- onChange={(time) => console.log(time)}
42
- allowEmpty={false}
43
- bordered={true}
44
- />
45
- ```
46
-
47
- **After (v6):**
48
- ```tsx
49
- import CapTimePicker from '@capillarytech/blaze-ui/components/CapTimePicker';
50
- import dayjs from 'dayjs';
51
-
52
- <CapTimePicker
53
- value={dayjs('12:00:00', 'HH:mm:ss')}
54
- onChange={(time) => console.log(time)}
55
- allowClear={false}
56
- variant="outlined"
57
- />
58
- ```
59
-
60
- ### Example 2: Custom Popup Styling
61
-
62
- **Before (v5):**
63
- ```tsx
64
- <CapTimePicker
65
- dropdownClassName="custom-popup"
66
- dropdownStyle={{ zIndex: 1000 }}
67
- />
68
- ```
69
-
70
- **After (v6) - Option 1 (Direct props):**
71
- ```tsx
72
- <CapTimePicker
73
- popupClassName="custom-popup"
74
- popupStyle={{ zIndex: 1000 }}
75
- />
76
- ```
77
-
78
- **After (v6) - Option 2 (Object-based API):**
79
- ```tsx
80
- <CapTimePicker
81
- classNames={{
82
- popup: {
83
- root: 'custom-popup'
84
- }
85
- }}
86
- styles={{
87
- popup: {
88
- root: { zIndex: 1000 }
89
- }
90
- }}
91
- />
92
- ```
93
-
94
- ### Example 3: Custom Footer
95
-
96
- **Before (v5):**
97
- ```tsx
98
- <CapTimePicker
99
- addon={() => <div>Custom Footer</div>}
100
- />
101
- ```
102
-
103
- **After (v6):**
104
- ```tsx
105
- <CapTimePicker
106
- renderExtraFooter={() => <div>Custom Footer</div>}
107
- />
108
- ```
109
-
110
- ## Backward Compatibility
111
-
112
- All deprecated props are automatically mapped to their new equivalents:
113
-
114
- - `allowEmpty` → `allowClear`
115
- - `addon` → `renderExtraFooter`
116
- - `dropdownClassName` → merged with `popupClassName`
117
- - `dropdownStyle` → merged with `popupStyle`
118
- - `bordered` → converted to `variant` (`false` → `'borderless'`, `true` → `'outlined'`)
119
-
120
- **Note:** Deprecated props will log warnings in development mode when used.
121
-
122
- ## Moment.js → Day.js Migration
123
-
124
- CapTimePicker supports both Moment.js and Day.js for backward compatibility:
125
-
126
- ```tsx
127
- // Both work:
128
- <CapTimePicker value={moment('12:00:00', 'HH:mm:ss')} />
129
- <CapTimePicker value={dayjs('12:00:00', 'HH:mm:ss')} />
130
- ```
131
-
132
- However, **Day.js is recommended** as Moment.js is deprecated. The component automatically detects and converts Moment objects to Day.js internally.
133
-
134
- ## Theme Customization
135
-
136
- CapTimePicker styling is now handled via design tokens in `getCapThemeConfig.ts`:
137
-
138
- ```typescript
139
- components: {
140
- TimePicker: {
141
- controlHeight: 40, // Input height
142
- colorIcon: '#091e42', // Icon color
143
- },
144
- }
145
- ```
146
-
147
- All previous SCSS overrides have been migrated to design tokens. No `:global` overrides are needed.
148
-
149
- ## TypeScript Support
150
-
151
- Full TypeScript support is available:
152
-
153
- ```tsx
154
- import CapTimePicker, { CapTimePickerProps } from '@capillarytech/blaze-ui/components/CapTimePicker';
155
-
156
- const props: CapTimePickerProps = {
157
- value: dayjs('12:00:00', 'HH:mm:ss'),
158
- onChange: (time, timeString) => {},
159
- };
160
- ```
161
-
162
- ## Validation
163
-
164
- This migration has been validated against:
165
-
166
- - ✅ **SCSS File Content**: No `:global` or `.ant-` overrides without comments
167
- - ✅ **Theme Config Update**: `getCapThemeConfig.ts` updated with TimePicker tokens
168
- - ✅ **TypeScript Compilation**: Zero compilation errors
169
- - ✅ **Backward Compatibility**: All deprecated props supported with warnings
170
- - ✅ **CSS Modules**: Component uses CSS Modules pattern
@@ -1,11 +0,0 @@
1
- /**
2
- *
3
- * CapTimePicker
4
- *
5
- */
6
- import React from 'react';
7
- import type { CapTimePickerProps } from './types';
8
- declare const CapTimePicker: React.FC<CapTimePickerProps>;
9
- export default CapTimePicker;
10
- export type { CapTimePickerProps } from './types';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/CapTimePicker/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAIlD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAwF/C,CAAC;AAEF,eAAe,aAAa,CAAC;AAC7B,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC"}
@@ -1,71 +0,0 @@
1
- import type { TimePickerProps } from 'antd-v5';
2
- import type { Dayjs } from 'dayjs';
3
- import type { Moment } from 'moment';
4
- import React from 'react';
5
- export interface CapTimePickerProps extends Omit<TimePickerProps, 'value' | 'defaultValue' | 'defaultOpenValue' | 'onChange' | 'popupClassName' | 'popupStyle' | 'classNames' | 'styles' | 'variant'> {
6
- /**
7
- * Selected time value (Dayjs object)
8
- */
9
- value?: Dayjs | null;
10
- /**
11
- * Default selected time value (Dayjs object)
12
- */
13
- defaultValue?: Dayjs | null;
14
- /**
15
- * Default open time value (Dayjs object)
16
- */
17
- defaultOpenValue?: Dayjs | null;
18
- /**
19
- * Callback when time changes
20
- * @param time - Dayjs or Moment object (matches input type) or null
21
- * @param timeString - Formatted time string or null
22
- */
23
- onChange?: (time: Dayjs | Moment | null, timeString: string | null) => void;
24
- /**
25
- * Custom class names for different parts of the component (v6 API)
26
- */
27
- classNames?: TimePickerProps['classNames'];
28
- /**
29
- * Custom styles for different parts of the component (v6 API)
30
- */
31
- styles?: TimePickerProps['styles'];
32
- /**
33
- * Variant of the picker (v6 API)
34
- * @default 'outlined'
35
- */
36
- variant?: 'outlined' | 'borderless' | 'filled';
37
- /**
38
- * Custom class name for the popup/dropdown (v6 API)
39
- */
40
- popupClassName?: string;
41
- /**
42
- * Custom style for the popup/dropdown (v6 API)
43
- */
44
- popupStyle?: React.CSSProperties;
45
- /**
46
- * Whether to show clear button
47
- * @deprecated Use `allowClear` instead. Will be removed in next major version.
48
- */
49
- allowEmpty?: boolean;
50
- /**
51
- * Render extra footer in time picker panel
52
- * @deprecated Use `renderExtraFooter` instead. Will be removed in next major version.
53
- */
54
- addon?: () => React.ReactNode;
55
- /**
56
- * Custom class name for the popup/dropdown
57
- * @deprecated Use `classNames.popup.root` or `popupClassName` instead. Will be removed in next major version.
58
- */
59
- dropdownClassName?: string;
60
- /**
61
- * Custom style for the popup/dropdown
62
- * @deprecated Use `styles.popup.root` or `popupStyle` instead. Will be removed in next major version.
63
- */
64
- dropdownStyle?: React.CSSProperties;
65
- /**
66
- * Whether to show border
67
- * @deprecated Use `variant` instead. Will be removed in next major version.
68
- */
69
- bordered?: boolean;
70
- }
71
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../components/CapTimePicker/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,kBACf,SAAQ,IAAI,CACV,eAAe,EACb,OAAO,GACP,cAAc,GACd,kBAAkB,GAClB,UAAU,GACV,gBAAgB,GAChB,YAAY,GACZ,YAAY,GACZ,QAAQ,GACR,SAAS,CACZ;IACD;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAErB;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAE5B;;OAEG;IACH,gBAAgB,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAEhC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,GAAG,MAAM,GAAG,IAAI,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAE5E;;OAEG;IACH,UAAU,CAAC,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;IAE3C;;OAEG;IACH,MAAM,CAAC,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC;IAEnC;;;OAGG;IACH,OAAO,CAAC,EAAE,UAAU,GAAG,YAAY,GAAG,QAAQ,CAAC;IAE/C;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAEjC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IAE9B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;OAGG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAEpC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}