@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.
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { CapImageProps } from './CapImage.interfaces';
3
+ import './styles.scss';
4
+ declare const CapImage: React.FC<CapImageProps>;
5
+ export default CapImage;
6
+ //# sourceMappingURL=CapImage.d.ts.map
@@ -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,7 @@
1
+ import { ImgHTMLAttributes } from 'react';
2
+ export interface CapImageProps extends ImgHTMLAttributes<HTMLImageElement> {
3
+ className?: string;
4
+ src?: string;
5
+ alt?: string;
6
+ }
7
+ //# sourceMappingURL=CapImage.interfaces.d.ts.map
@@ -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,3 @@
1
+ export { default } from './CapImage';
2
+ export type { CapImageProps } from './CapImage.interfaces';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -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"}