@capillarytech/blaze-ui 2.4.1-beta.1 → 2.6.1-beta.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/CapButton/index.js +43 -1
- package/dist/CapButton/index.js.map +1 -1
- package/dist/CapIcon/CapIcon.d.ts.map +1 -1
- package/dist/CapIcon/index.js +43 -1
- package/dist/CapIcon/index.js.map +1 -1
- package/dist/CapImage/CapImage.d.ts +0 -1
- package/dist/CapImage/CapImage.d.ts.map +1 -1
- package/dist/CapImage/index.js +2 -2
- package/dist/CapImage/index.js.map +1 -1
- package/dist/CapSlideBox/CapSlideBox.d.ts +5 -0
- package/dist/CapSlideBox/CapSlideBox.d.ts.map +1 -0
- package/dist/CapSlideBox/CapSlideBox.interfaces.d.ts +15 -0
- package/dist/CapSlideBox/CapSlideBox.interfaces.d.ts.map +1 -0
- package/dist/CapSlideBox/README.md +68 -0
- package/dist/CapSlideBox/index.d.ts +3 -0
- package/dist/CapSlideBox/index.d.ts.map +1 -0
- package/dist/CapSlideBox/index.js +18456 -0
- package/dist/CapSlideBox/index.js.map +1 -0
- package/dist/CapSlideBox/tests/CapSlideBox.mockData.d.ts +16 -0
- package/dist/CapSlideBox/tests/CapSlideBox.mockData.d.ts.map +1 -0
- package/dist/CapSlideBox/tests/CapSlideBox.test.d.ts +2 -0
- package/dist/CapSlideBox/tests/CapSlideBox.test.d.ts.map +1 -0
- package/dist/CapSlideBox/tests/__snapshots__/CapSlideBox.test.tsx.snap +637 -0
- package/dist/CapTooltipWithInfo/index.js +43 -1
- package/dist/CapTooltipWithInfo/index.js.map +1 -1
- package/dist/CapUnifiedSelect/index.js +43 -1
- package/dist/CapUnifiedSelect/index.js.map +1 -1
- package/dist/assets/Icons/Back.d.ts +7 -0
- package/dist/assets/Icons/Back.d.ts.map +1 -0
- package/dist/assets/Icons/index.d.ts +2 -0
- package/dist/assets/Icons/index.d.ts.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +300 -216
- package/dist/index.js.map +1 -1
- package/dist/styled/variables.scss +2 -0
- package/package.json +6 -6
- package/dist/CapSelectFilter/CapSelectFilter.d.ts +0 -12
- package/dist/CapSelectFilter/CapSelectFilter.d.ts.map +0 -1
- package/dist/CapSelectFilter/CapSelectFilter.interfaces.d.ts +0 -22
- package/dist/CapSelectFilter/CapSelectFilter.interfaces.d.ts.map +0 -1
- package/dist/CapSelectFilter/README.md +0 -121
- package/dist/CapSelectFilter/index.d.ts +0 -3
- package/dist/CapSelectFilter/index.d.ts.map +0 -1
- package/dist/CapSelectFilter/index.js +0 -1635
- package/dist/CapSelectFilter/index.js.map +0 -1
- package/dist/CapSelectFilter/tests/CapSelectFilter.mockData.d.ts +0 -7
- package/dist/CapSelectFilter/tests/CapSelectFilter.mockData.d.ts.map +0 -1
- package/dist/CapSelectFilter/tests/CapSelectFilter.test.d.ts +0 -2
- package/dist/CapSelectFilter/tests/CapSelectFilter.test.d.ts.map +0 -1
|
@@ -65,6 +65,8 @@ $cap-white-overlay: rgba(255, 255, 255, 0.8);
|
|
|
65
65
|
$cap-black: #000000;
|
|
66
66
|
$cap-black-alpha01: #00000022;
|
|
67
67
|
$cap-black-alpha02: #000000de;
|
|
68
|
+
$cap-black-overlay: rgba(0, 0, 0, 0.56);
|
|
69
|
+
$cap-shadow-color: rgba(0, 0, 0, 0.12);
|
|
68
70
|
|
|
69
71
|
// Semantic colors
|
|
70
72
|
$color-error: #ff4d4f;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capillarytech/blaze-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.1-beta.0",
|
|
4
4
|
"description": "Capillary UI component library with Ant Design v6",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -230,16 +230,16 @@
|
|
|
230
230
|
"require": "./dist/CapRow/index.js",
|
|
231
231
|
"types": "./dist/CapRow/index.d.ts"
|
|
232
232
|
},
|
|
233
|
-
"./CapSelectFilter": {
|
|
234
|
-
"import": "./dist/CapSelectFilter/index.js",
|
|
235
|
-
"require": "./dist/CapSelectFilter/index.js",
|
|
236
|
-
"types": "./dist/CapSelectFilter/index.d.ts"
|
|
237
|
-
},
|
|
238
233
|
"./CapSkeleton": {
|
|
239
234
|
"import": "./dist/CapSkeleton/index.js",
|
|
240
235
|
"require": "./dist/CapSkeleton/index.js",
|
|
241
236
|
"types": "./dist/CapSkeleton/index.d.ts"
|
|
242
237
|
},
|
|
238
|
+
"./CapSlideBox": {
|
|
239
|
+
"import": "./dist/CapSlideBox/index.js",
|
|
240
|
+
"require": "./dist/CapSlideBox/index.js",
|
|
241
|
+
"types": "./dist/CapSlideBox/index.d.ts"
|
|
242
|
+
},
|
|
243
243
|
"./CapSpin": {
|
|
244
244
|
"import": "./dist/CapSpin/index.js",
|
|
245
245
|
"require": "./dist/CapSpin/index.js",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { CapSelectFilterMenuItem, CapSelectFilterProps } from './CapSelectFilter.interfaces';
|
|
3
|
-
export declare const renderMenuItem: (items: CapSelectFilterMenuItem[], selectedValue?: string) => {
|
|
4
|
-
key: string;
|
|
5
|
-
label: import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
className: string;
|
|
7
|
-
'data-value': string;
|
|
8
|
-
}[];
|
|
9
|
-
export declare const renderDropdownMenu: (menu: React.ReactNode, dropdownMaxHeight?: string, dropdownWidth?: string) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
declare const CapSelectFilter: React.FC<CapSelectFilterProps>;
|
|
11
|
-
export default CapSelectFilter;
|
|
12
|
-
//# sourceMappingURL=CapSelectFilter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CapSelectFilter.d.ts","sourceRoot":"","sources":["../../components/CapSelectFilter/CapSelectFilter.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,KAAK,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAOlG,eAAO,MAAM,cAAc,GAAI,OAAO,uBAAuB,EAAE,EAAE,gBAAgB,MAAM;;;;;GAStF,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,MAAM,KAAK,CAAC,SAAS,EACrB,oBAAoB,MAAM,EAC1B,gBAAgB,MAAM,4CAcvB,CAAC;AAEF,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA0DnD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { DropdownProps } from 'antd-v5';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export interface CapSelectFilterMenuItem {
|
|
4
|
-
key: string;
|
|
5
|
-
value: string;
|
|
6
|
-
label: string | React.ReactNode;
|
|
7
|
-
}
|
|
8
|
-
export interface CapSelectFilterProps extends Omit<DropdownProps, 'menu' | 'overlay' | 'overlayStyle' | 'onOpenChange'> {
|
|
9
|
-
className?: string;
|
|
10
|
-
overlayClassName?: string;
|
|
11
|
-
onSelect?: (event: React.MouseEvent<HTMLElement>) => void;
|
|
12
|
-
onOpenChange?: (open: boolean) => void;
|
|
13
|
-
selectedValue?: string;
|
|
14
|
-
placeholder?: string | React.ReactNode;
|
|
15
|
-
placement?: 'bottomLeft' | 'bottom' | 'bottomRight' | 'topLeft' | 'top' | 'topRight';
|
|
16
|
-
width?: string;
|
|
17
|
-
dropdownMaxHeight?: string;
|
|
18
|
-
dropdownWidth?: string;
|
|
19
|
-
data?: CapSelectFilterMenuItem[];
|
|
20
|
-
showBadge?: boolean;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=CapSelectFilter.interfaces.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CapSelectFilter.interfaces.d.ts","sourceRoot":"","sources":["../../components/CapSelectFilter/CapSelectFilter.interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,uBAAuB;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;CACjC;AAED,MAAM,WAAW,oBACf,SAAQ,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,cAAc,GAAG,cAAc,CAAC;IACjF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC1D,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACvC,SAAS,CAAC,EAAE,YAAY,GAAG,QAAQ,GAAG,aAAa,GAAG,SAAS,GAAG,KAAK,GAAG,UAAU,CAAC;IACrF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,uBAAuB,EAAE,CAAC;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
# CapSelectFilter
|
|
2
|
-
|
|
3
|
-
A dropdown select filter component with badge support.
|
|
4
|
-
|
|
5
|
-
## Migration from cap-ui-library to blaze-ui
|
|
6
|
-
|
|
7
|
-
### Summary of Changes
|
|
8
|
-
|
|
9
|
-
This component has been migrated from `cap-ui-library` to `blaze-ui` with the following updates:
|
|
10
|
-
|
|
11
|
-
1. **Converted to TypeScript** - Full type safety with proper interfaces
|
|
12
|
-
2. **Functional Component** - Migrated from functional component (no changes needed)
|
|
13
|
-
3. **SCSS Modules** - Replaced styled-components with SCSS modules
|
|
14
|
-
4. **Ant Design v6** - Updated to use Ant Design v6 compatible APIs:
|
|
15
|
-
- Changed from `overlay` prop to `menu={{ items }}` API
|
|
16
|
-
- Used `dropdownRender` to wrap menu with custom styling
|
|
17
|
-
- Removed direct usage of `CapMenu` components in favor of menu items array
|
|
18
|
-
5. **CSS Units** - Converted all pixel values to rem units (base: 14px = 1rem)
|
|
19
|
-
6. **SCSS Variables** - Replaced hardcoded colors/spacing with SCSS variables
|
|
20
|
-
7. **React Hooks** - Added `useMemo` to optimize menu items generation
|
|
21
|
-
|
|
22
|
-
### Breaking Changes
|
|
23
|
-
|
|
24
|
-
**No breaking changes from cap-ui-library v8.x**
|
|
25
|
-
|
|
26
|
-
All props remain the same and work identically to the cap-ui-library version.
|
|
27
|
-
|
|
28
|
-
### Props
|
|
29
|
-
|
|
30
|
-
| Prop | Type | Default | Description |
|
|
31
|
-
|------|------|---------|-------------|
|
|
32
|
-
| `className` | `string` | - | Additional CSS class for the dropdown wrapper |
|
|
33
|
-
| `overlayClassName` | `string` | - | Additional CSS class for the dropdown overlay |
|
|
34
|
-
| `onSelect` | `(event: React.MouseEvent<HTMLElement>) => void` | - | Callback when a menu item is selected |
|
|
35
|
-
| `selectedValue` | `string` | - | Currently selected value |
|
|
36
|
-
| `placeholder` | `React.ReactNode` | - | Placeholder text or node |
|
|
37
|
-
| `placement` | `'bottomLeft' \| 'bottom' \| 'bottomRight' \| 'topLeft' \| 'top' \| 'topRight'` | `'bottomLeft'` | Dropdown placement |
|
|
38
|
-
| `width` | `string` | `'80px'` | Width of the trigger element |
|
|
39
|
-
| `dropdownMaxHeight` | `string` | `'320px'` | Maximum height of dropdown menu |
|
|
40
|
-
| `dropdownWidth` | `string` | `'228px'` | Width of dropdown menu |
|
|
41
|
-
| `data` | `CapSelectFilterMenuItem[]` | `[]` | Array of menu items |
|
|
42
|
-
| `showBadge` | `boolean` | `false` | Whether to show a badge with count |
|
|
43
|
-
|
|
44
|
-
### Data Item Structure
|
|
45
|
-
|
|
46
|
-
```typescript
|
|
47
|
-
interface CapSelectFilterMenuItem {
|
|
48
|
-
key: string; // Unique key for React
|
|
49
|
-
value: string; // Value to match against selectedValue
|
|
50
|
-
label: React.ReactNode; // Display label
|
|
51
|
-
}
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### API Changes
|
|
55
|
-
|
|
56
|
-
None - all APIs remain backward compatible.
|
|
57
|
-
|
|
58
|
-
### Behavioral Changes
|
|
59
|
-
|
|
60
|
-
None - component behaves identically to cap-ui-library version.
|
|
61
|
-
|
|
62
|
-
### Migration Guide for Consumers
|
|
63
|
-
|
|
64
|
-
No migration needed! Simply update your import path:
|
|
65
|
-
|
|
66
|
-
**Before (cap-ui-library):**
|
|
67
|
-
```javascript
|
|
68
|
-
import CapSelectFilter from '@capillarytech/cap-ui-library/components/CapSelectFilter';
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
**After (blaze-ui):**
|
|
72
|
-
```javascript
|
|
73
|
-
import CapSelectFilter from '@capillarytech/blaze-ui/components/CapSelectFilter';
|
|
74
|
-
// Or from the main export
|
|
75
|
-
import { CapSelectFilter } from '@capillarytech/blaze-ui';
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### Usage Example
|
|
79
|
-
|
|
80
|
-
```tsx
|
|
81
|
-
import React, { useState } from 'react';
|
|
82
|
-
import CapSelectFilter from '@capillarytech/blaze-ui/components/CapSelectFilter';
|
|
83
|
-
|
|
84
|
-
const MyComponent = () => {
|
|
85
|
-
const [selectedValue, setSelectedValue] = useState('option1');
|
|
86
|
-
|
|
87
|
-
const data = [
|
|
88
|
-
{ key: '1', value: 'option1', label: 'Option 1' },
|
|
89
|
-
{ key: '2', value: 'option2', label: 'Option 2' },
|
|
90
|
-
{ key: '3', value: 'option3', label: 'Option 3' },
|
|
91
|
-
];
|
|
92
|
-
|
|
93
|
-
const handleSelect = (e: React.MouseEvent<HTMLElement>) => {
|
|
94
|
-
const target = e.currentTarget;
|
|
95
|
-
const value = target.getAttribute('value');
|
|
96
|
-
if (value) {
|
|
97
|
-
setSelectedValue(value);
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
return (
|
|
102
|
-
<CapSelectFilter
|
|
103
|
-
placeholder="Select an option"
|
|
104
|
-
data={data}
|
|
105
|
-
selectedValue={selectedValue}
|
|
106
|
-
onSelect={handleSelect}
|
|
107
|
-
showBadge
|
|
108
|
-
/>
|
|
109
|
-
);
|
|
110
|
-
};
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
### Internal Implementation Notes
|
|
114
|
-
|
|
115
|
-
- Uses `CapDropdown` with Ant Design v6 `menu` API (not the old `overlay` API)
|
|
116
|
-
- Menu items are generated as an array of objects with `key`, `label`, `className`, and `onClick`
|
|
117
|
-
- Uses `dropdownRender` to wrap the menu with custom styling (border and scrolling)
|
|
118
|
-
- Styled with SCSS modules instead of styled-components
|
|
119
|
-
- All spacing and colors use SCSS variables from `components/styled/variables.scss`
|
|
120
|
-
- Badge count is calculated as `[selectedValue].length` (always shows 1 for single selection)
|
|
121
|
-
- Uses `useMemo` to optimize menu items generation and prevent unnecessary re-renders
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/CapSelectFilter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,YAAY,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC"}
|