@capillarytech/blaze-ui 2.0.5 → 2.1.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/CapImage/CapImage.d.ts +6 -0
- package/dist/CapImage/CapImage.d.ts.map +1 -0
- package/dist/CapImage/CapImage.interfaces.d.ts +7 -0
- package/dist/CapImage/CapImage.interfaces.d.ts.map +1 -0
- package/dist/CapImage/README.md +50 -0
- package/dist/CapImage/index.d.ts +3 -0
- package/dist/CapImage/index.d.ts.map +1 -0
- package/dist/CapImage/index.js +690 -0
- package/dist/CapImage/index.js.map +1 -0
- package/dist/CapImage/tests/CapImage.mockData.d.ts +59 -0
- package/dist/CapImage/tests/CapImage.mockData.d.ts.map +1 -0
- package/dist/CapImage/tests/CapImage.test.d.ts +2 -0
- package/dist/CapImage/tests/CapImage.test.d.ts.map +1 -0
- package/dist/assets/cap-ui-library-sample.svg +13 -0
- package/dist/assets/penguin.svg +13 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +126 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CapImage.d.ts","sourceRoot":"","sources":["../../components/CapImage/CapImage.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,eAAe,CAAC;AAIvB,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAOrC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CapImage.interfaces.d.ts","sourceRoot":"","sources":["../../components/CapImage/CapImage.interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1C,MAAM,WAAW,aAAc,SAAQ,iBAAiB,CAAC,gBAAgB,CAAC;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# CapImage Component
|
|
2
|
+
|
|
3
|
+
A simple image component with conditional rendering support.
|
|
4
|
+
|
|
5
|
+
## Migration from cap-ui-library to blaze-ui
|
|
6
|
+
|
|
7
|
+
### Summary of Changes
|
|
8
|
+
|
|
9
|
+
This component has been migrated from JavaScript to TypeScript with the following improvements:
|
|
10
|
+
|
|
11
|
+
1. **TypeScript Conversion**
|
|
12
|
+
- Converted from JavaScript to TypeScript
|
|
13
|
+
- Added comprehensive TypeScript interfaces
|
|
14
|
+
- Replaced PropTypes with TypeScript types
|
|
15
|
+
|
|
16
|
+
2. **Modern React Patterns**
|
|
17
|
+
- Maintained as functional component (already was functional in cap-ui-library)
|
|
18
|
+
- Better type safety with TypeScript
|
|
19
|
+
- Cleaner code structure
|
|
20
|
+
|
|
21
|
+
3. **Styling**
|
|
22
|
+
- Converted to SCSS modules
|
|
23
|
+
- Uses `classNames` library for conditional class handling
|
|
24
|
+
- Removed Fragment wrapper (not needed for single element return)
|
|
25
|
+
|
|
26
|
+
### Breaking Changes
|
|
27
|
+
|
|
28
|
+
**No breaking changes from cap-ui-library v8.x**
|
|
29
|
+
|
|
30
|
+
All props remain backward compatible. The component maintains the same API and behavior as the cap-ui-library version.
|
|
31
|
+
|
|
32
|
+
### Props
|
|
33
|
+
|
|
34
|
+
| Prop Name | Type | Default | Description |
|
|
35
|
+
|-----------|------|---------|-------------|
|
|
36
|
+
| `className` | `string` | `undefined` | Additional CSS class name for the image |
|
|
37
|
+
| `src` | `string` | `undefined` | Source URL of the image (required for rendering) |
|
|
38
|
+
| `alt` | `string` | `undefined` | Alternative text for the image |
|
|
39
|
+
| `...rest` | `ImgHTMLAttributes` | - | All standard HTML img element attributes |
|
|
40
|
+
|
|
41
|
+
### Behavioral Changes
|
|
42
|
+
|
|
43
|
+
- The component returns `null` instead of an empty `Fragment` when `src` is not provided (no visual change)
|
|
44
|
+
- All standard HTML image attributes are supported through spread props
|
|
45
|
+
|
|
46
|
+
### Notes
|
|
47
|
+
|
|
48
|
+
- The component only renders when a valid `src` prop is provided
|
|
49
|
+
- All standard HTML image attributes are supported (width, height, loading, onLoad, onError, etc.)
|
|
50
|
+
- The component uses SCSS modules for styling to avoid style conflicts
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/CapImage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC"}
|