@okam/next-component 0.1.1 → 0.3.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/index.esm.js +112 -10
- package/package.json +9 -2
- package/src/index.d.ts +2 -1
- package/index.esm.css +0 -7
package/index.esm.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { useThemeContext } from '@okam/stack-ui';
|
|
2
|
+
import Image from 'next/image';
|
|
3
|
+
|
|
1
4
|
var jsxRuntime = {
|
|
2
5
|
exports: {}
|
|
3
6
|
};
|
|
@@ -3782,15 +3785,114 @@ if (process.env.NODE_ENV === 'production') {
|
|
|
3782
3785
|
|
|
3783
3786
|
var jsxRuntimeExports = jsxRuntime.exports;
|
|
3784
3787
|
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
})
|
|
3793
|
-
}
|
|
3788
|
+
function _define_property(obj, key, value) {
|
|
3789
|
+
if (key in obj) {
|
|
3790
|
+
Object.defineProperty(obj, key, {
|
|
3791
|
+
value: value,
|
|
3792
|
+
enumerable: true,
|
|
3793
|
+
configurable: true,
|
|
3794
|
+
writable: true
|
|
3795
|
+
});
|
|
3796
|
+
} else {
|
|
3797
|
+
obj[key] = value;
|
|
3798
|
+
}
|
|
3799
|
+
return obj;
|
|
3800
|
+
}
|
|
3801
|
+
function _object_spread(target) {
|
|
3802
|
+
for(var i = 1; i < arguments.length; i++){
|
|
3803
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
3804
|
+
var ownKeys = Object.keys(source);
|
|
3805
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
3806
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
3807
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
3808
|
+
}));
|
|
3809
|
+
}
|
|
3810
|
+
ownKeys.forEach(function(key) {
|
|
3811
|
+
_define_property(target, key, source[key]);
|
|
3812
|
+
});
|
|
3813
|
+
}
|
|
3814
|
+
return target;
|
|
3815
|
+
}
|
|
3816
|
+
function ownKeys(object, enumerableOnly) {
|
|
3817
|
+
var keys = Object.keys(object);
|
|
3818
|
+
if (Object.getOwnPropertySymbols) {
|
|
3819
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
3820
|
+
keys.push.apply(keys, symbols);
|
|
3821
|
+
}
|
|
3822
|
+
return keys;
|
|
3794
3823
|
}
|
|
3824
|
+
function _object_spread_props(target, source) {
|
|
3825
|
+
source = source != null ? source : {};
|
|
3826
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
3827
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
3828
|
+
} else {
|
|
3829
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
3830
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
3831
|
+
});
|
|
3832
|
+
}
|
|
3833
|
+
return target;
|
|
3834
|
+
}
|
|
3835
|
+
function _object_without_properties(source, excluded) {
|
|
3836
|
+
if (source == null) return {};
|
|
3837
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
3838
|
+
var key, i;
|
|
3839
|
+
if (Object.getOwnPropertySymbols) {
|
|
3840
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
3841
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
3842
|
+
key = sourceSymbolKeys[i];
|
|
3843
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
3844
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
3845
|
+
target[key] = source[key];
|
|
3846
|
+
}
|
|
3847
|
+
}
|
|
3848
|
+
return target;
|
|
3849
|
+
}
|
|
3850
|
+
function _object_without_properties_loose(source, excluded) {
|
|
3851
|
+
if (source == null) return {};
|
|
3852
|
+
var target = {};
|
|
3853
|
+
var sourceKeys = Object.keys(source);
|
|
3854
|
+
var key, i;
|
|
3855
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
3856
|
+
key = sourceKeys[i];
|
|
3857
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
3858
|
+
target[key] = source[key];
|
|
3859
|
+
}
|
|
3860
|
+
return target;
|
|
3861
|
+
}
|
|
3862
|
+
var Img = function(props) {
|
|
3863
|
+
var src = props.src, width = props.width, height = props.height, _props_themeName = props.themeName, themeName = _props_themeName === void 0 ? 'img' : _props_themeName, tokens = props.tokens, customTheme = props.customTheme, rest = _object_without_properties(props, [
|
|
3864
|
+
"src",
|
|
3865
|
+
"width",
|
|
3866
|
+
"height",
|
|
3867
|
+
"themeName",
|
|
3868
|
+
"tokens",
|
|
3869
|
+
"customTheme"
|
|
3870
|
+
]);
|
|
3871
|
+
var theme = useThemeContext(themeName, tokens, customTheme);
|
|
3872
|
+
if (typeof src === 'object') {
|
|
3873
|
+
var blurWidth = src.blurWidth, blurHeight = src.blurHeight, srcWidth = src.width, srcHeight = src.height, withoutBlurDimensions = _object_without_properties(src, [
|
|
3874
|
+
"blurWidth",
|
|
3875
|
+
"blurHeight",
|
|
3876
|
+
"width",
|
|
3877
|
+
"height"
|
|
3878
|
+
]);
|
|
3879
|
+
var blur = {
|
|
3880
|
+
blurwidth: blurWidth,
|
|
3881
|
+
blurheight: blurHeight
|
|
3882
|
+
};
|
|
3883
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(Image, _object_spread_props(_object_spread({
|
|
3884
|
+
className: theme
|
|
3885
|
+
}, withoutBlurDimensions, rest, blur), {
|
|
3886
|
+
width: srcWidth !== null && srcWidth !== void 0 ? srcWidth : width,
|
|
3887
|
+
height: srcHeight !== null && srcHeight !== void 0 ? srcHeight : height
|
|
3888
|
+
}));
|
|
3889
|
+
}
|
|
3890
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(Image, _object_spread({
|
|
3891
|
+
width: width,
|
|
3892
|
+
height: height,
|
|
3893
|
+
className: theme,
|
|
3894
|
+
src: src
|
|
3895
|
+
}, rest));
|
|
3896
|
+
};
|
|
3795
3897
|
|
|
3796
|
-
export {
|
|
3898
|
+
export { Img };
|
package/package.json
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@okam/next-component",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"repository": {
|
|
8
|
+
"url": "https://github.com/OKAMca/stack.git"
|
|
9
|
+
},
|
|
4
10
|
"module": "./index.esm.js",
|
|
5
11
|
"type": "module",
|
|
6
|
-
"main": "./index.esm.js"
|
|
12
|
+
"main": "./index.esm.js",
|
|
13
|
+
"types": "./index.esm.d.ts"
|
|
7
14
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { default as Img } from './components/Img';
|
|
2
|
+
export type { default as TImgProps } from './components/Img/interface';
|