@emporix/component-library 1.0.0 → 1.0.2
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/README.md +225 -65
- package/dist/components/buttons/PrimaryButton.d.ts +25 -0
- package/dist/components/buttons/PrimaryButton.d.ts.map +1 -0
- package/dist/components/tabs/Tabs.d.ts +39 -0
- package/dist/components/tabs/Tabs.d.ts.map +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +330 -292
- package/dist/index.umd.js +10 -10
- package/dist/style.css +1 -1
- package/dist/styles.d.ts +4 -0
- package/package.json +29 -18
- package/dist/App.d.ts +0 -4
- package/dist/App.d.ts.map +0 -1
- package/dist/components/Button/Button.d.ts +0 -38
- package/dist/components/Button/Button.d.ts.map +0 -1
- package/dist/components/Button/Button.stories.d.ts +0 -47
- package/dist/components/Button/Button.stories.d.ts.map +0 -1
- package/dist/components/Button/Button.test.d.ts +0 -2
- package/dist/components/Button/Button.test.d.ts.map +0 -1
- package/dist/main.d.ts +0 -2
- package/dist/main.d.ts.map +0 -1
- package/dist/test/setup.d.ts +0 -2
- package/dist/test/setup.d.ts.map +0 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(T,F){typeof exports=="object"&&typeof module<"u"?F(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],F):(T=typeof globalThis<"u"?globalThis:T||self,F(T.EmporixComponentLibrary={},T.React))})(this,(function(T,F){"use strict";var N={exports:{}},B={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var re;function ke(){if(re)return B;re=1;var P=F,_=Symbol.for("react.element"),x=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,g=P.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,O={key:!0,ref:!0,__self:!0,__source:!0};function E(y,u,j){var f,R={},w=null,M=null;j!==void 0&&(w=""+j),u.key!==void 0&&(w=""+u.key),u.ref!==void 0&&(M=u.ref);for(f in u)m.call(u,f)&&!O.hasOwnProperty(f)&&(R[f]=u[f]);if(y&&y.defaultProps)for(f in u=y.defaultProps,u)R[f]===void 0&&(R[f]=u[f]);return{$$typeof:_,type:y,key:w,ref:M,props:R,_owner:g.current}}return B.Fragment=x,B.jsx=E,B.jsxs=E,B}var $={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,17 +14,17 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
`+
|
|
19
|
-
`),
|
|
20
|
-
`),
|
|
21
|
-
`+a[
|
|
17
|
+
*/var te;function De(){return te||(te=1,process.env.NODE_ENV!=="production"&&(function(){var P=F,_=Symbol.for("react.element"),x=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),E=Symbol.for("react.provider"),y=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),M=Symbol.for("react.offscreen"),ie=Symbol.iterator,Le="@@iterator";function Be(e){if(e===null||typeof e!="object")return null;var r=ie&&e[ie]||e[Le];return typeof r=="function"?r:null}var A=P.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function d(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];$e("error",e,t)}}function $e(e,r,t){{var n=A.ReactDebugCurrentFrame,o=n.getStackAddendum();o!==""&&(r+="%s",t=t.concat([o]));var s=t.map(function(i){return String(i)});s.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,s)}}var We=!1,Ye=!1,Ne=!1,Me=!1,Ve=!1,oe;oe=Symbol.for("react.module.reference");function Ue(e){return!!(typeof e=="string"||typeof e=="function"||e===m||e===O||Ve||e===g||e===j||e===f||Me||e===M||We||Ye||Ne||typeof e=="object"&&e!==null&&(e.$$typeof===w||e.$$typeof===R||e.$$typeof===E||e.$$typeof===y||e.$$typeof===u||e.$$typeof===oe||e.getModuleId!==void 0))}function Je(e,r,t){var n=e.displayName;if(n)return n;var o=r.displayName||r.name||"";return o!==""?t+"("+o+")":t}function se(e){return e.displayName||"Context"}function S(e){if(e==null)return null;if(typeof e.tag=="number"&&d("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case m:return"Fragment";case x:return"Portal";case O:return"Profiler";case g:return"StrictMode";case j:return"Suspense";case f:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case y:var r=e;return se(r)+".Consumer";case E:var t=e;return se(t._context)+".Provider";case u:return Je(e,e.render,"ForwardRef");case R:var n=e.displayName||null;return n!==null?n:S(e.type)||"Memo";case w:{var o=e,s=o._payload,i=o._init;try{return S(i(s))}catch{return null}}}return null}var k=Object.assign,W=0,ue,le,ce,fe,de,ve,pe;function be(){}be.__reactDisabledLog=!0;function qe(){{if(W===0){ue=console.log,le=console.info,ce=console.warn,fe=console.error,de=console.group,ve=console.groupCollapsed,pe=console.groupEnd;var e={configurable:!0,enumerable:!0,value:be,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}W++}}function He(){{if(W--,W===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:k({},e,{value:ue}),info:k({},e,{value:le}),warn:k({},e,{value:ce}),error:k({},e,{value:fe}),group:k({},e,{value:de}),groupCollapsed:k({},e,{value:ve}),groupEnd:k({},e,{value:pe})})}W<0&&d("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var H=A.ReactCurrentDispatcher,K;function V(e,r,t){{if(K===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);K=n&&n[1]||""}return`
|
|
18
|
+
`+K+e}}var G=!1,U;{var Ke=typeof WeakMap=="function"?WeakMap:Map;U=new Ke}function _e(e,r){if(!e||G)return"";{var t=U.get(e);if(t!==void 0)return t}var n;G=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=H.current,H.current=null,qe();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(p){n=p}Reflect.construct(e,[],i)}else{try{i.call()}catch(p){n=p}e.call(i.prototype)}}else{try{throw Error()}catch(p){n=p}e()}}catch(p){if(p&&n&&typeof p.stack=="string"){for(var a=p.stack.split(`
|
|
19
|
+
`),v=n.stack.split(`
|
|
20
|
+
`),l=a.length-1,c=v.length-1;l>=1&&c>=0&&a[l]!==v[c];)c--;for(;l>=1&&c>=0;l--,c--)if(a[l]!==v[c]){if(l!==1||c!==1)do if(l--,c--,c<0||a[l]!==v[c]){var b=`
|
|
21
|
+
`+a[l].replace(" at new "," at ");return e.displayName&&b.includes("<anonymous>")&&(b=b.replace("<anonymous>",e.displayName)),typeof e=="function"&&U.set(e,b),b}while(l>=1&&c>=0);break}}}finally{G=!1,H.current=s,He(),Error.prepareStackTrace=o}var L=e?e.displayName||e.name:"",D=L?V(L):"";return typeof e=="function"&&U.set(e,D),D}function Ge(e,r,t){return _e(e,!1)}function ze(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function J(e,r,t){if(e==null)return"";if(typeof e=="function")return _e(e,ze(e));if(typeof e=="string")return V(e);switch(e){case j:return V("Suspense");case f:return V("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case u:return Ge(e.render);case R:return J(e.type,r,t);case w:{var n=e,o=n._payload,s=n._init;try{return J(s(o),r,t)}catch{}}}return""}var Y=Object.prototype.hasOwnProperty,me={},ye=A.ReactDebugCurrentFrame;function q(e){if(e){var r=e._owner,t=J(e.type,e._source,r?r.type:null);ye.setExtraStackFrame(t)}else ye.setExtraStackFrame(null)}function Xe(e,r,t,n,o){{var s=Function.call.bind(Y);for(var i in e)if(s(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var v=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw v.name="Invariant Violation",v}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(l){a=l}a&&!(a instanceof Error)&&(q(o),d("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof a),q(null)),a instanceof Error&&!(a.message in me)&&(me[a.message]=!0,q(o),d("Failed %s type: %s",t,a.message),q(null))}}}var Ze=Array.isArray;function z(e){return Ze(e)}function Qe(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function er(e){try{return he(e),!1}catch{return!0}}function he(e){return""+e}function ge(e){if(er(e))return d("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Qe(e)),he(e)}var Ee=A.ReactCurrentOwner,rr={key:!0,ref:!0,__self:!0,__source:!0},Re,Te;function tr(e){if(Y.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function nr(e){if(Y.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function ar(e,r){typeof e.ref=="string"&&Ee.current}function ir(e,r){{var t=function(){Re||(Re=!0,d("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function or(e,r){{var t=function(){Te||(Te=!0,d("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var sr=function(e,r,t,n,o,s,i){var a={$$typeof:_,type:e,key:r,ref:t,props:i,_owner:s};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function ur(e,r,t,n,o){{var s,i={},a=null,v=null;t!==void 0&&(ge(t),a=""+t),nr(r)&&(ge(r.key),a=""+r.key),tr(r)&&(v=r.ref,ar(r,o));for(s in r)Y.call(r,s)&&!rr.hasOwnProperty(s)&&(i[s]=r[s]);if(e&&e.defaultProps){var l=e.defaultProps;for(s in l)i[s]===void 0&&(i[s]=l[s])}if(a||v){var c=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&ir(i,c),v&&or(i,c)}return sr(e,a,v,o,n,Ee.current,i)}}var X=A.ReactCurrentOwner,Ce=A.ReactDebugCurrentFrame;function I(e){if(e){var r=e._owner,t=J(e.type,e._source,r?r.type:null);Ce.setExtraStackFrame(t)}else Ce.setExtraStackFrame(null)}var Z;Z=!1;function Q(e){return typeof e=="object"&&e!==null&&e.$$typeof===_}function Pe(){{if(X.current){var e=S(X.current.type);if(e)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function lr(e){return""}var Oe={};function cr(e){{var r=Pe();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+t+">.")}return r}}function
|
|
25
|
+
Check the top-level render call using <`+t+">.")}return r}}function je(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=cr(r);if(Oe[t])return;Oe[t]=!0;var n="";e&&e._owner&&e._owner!==X.current&&(n=" It was passed a child from "+S(e._owner.type)+"."),I(e),d('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),I(null)}}function Se(e,r){{if(typeof e!="object")return;if(z(e))for(var t=0;t<e.length;t++){var n=e[t];Q(n)&&je(n,r)}else if(Q(e))e._store&&(e._store.validated=!0);else if(e){var o=Be(e);if(typeof o=="function"&&o!==e.entries)for(var s=o.call(e),i;!(i=s.next()).done;)Q(i.value)&&je(i.value,r)}}}function fr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===u||r.$$typeof===R))t=r.propTypes;else return;if(t){var n=S(r);Xe(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!Z){Z=!0;var o=S(r);d("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&d("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function dr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){I(e),d("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),I(null);break}}e.ref!==null&&(I(e),d("Invalid attribute `ref` supplied to `React.Fragment`."),I(null))}}var xe={};function we(e,r,t,n,o,s){{var i=Ue(e);if(!i){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var v=lr();v?a+=v:a+=Pe();var l;e===null?l="null":z(e)?l="array":e!==void 0&&e.$$typeof===_?(l="<"+(S(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):l=typeof e,d("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",l,a)}var c=ur(e,r,t,o,s);if(c==null)return c;if(i){var b=r.children;if(b!==void 0)if(n)if(z(b)){for(var L=0;L<b.length;L++)Se(b[L],e);Object.freeze&&Object.freeze(b)}else d("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Se(b,e)}if(Y.call(r,"key")){var D=S(e),p=Object.keys(r).filter(function(yr){return yr!=="key"}),ee=p.length>0?"{key: someKey, "+p.join(": ..., ")+": ...}":"{key: someKey}";if(!xe[D+ee]){var mr=p.length>0?"{"+p.join(": ..., ")+": ...}":"{}";d(`A props object containing a "key" prop is being spread into JSX:
|
|
26
26
|
let props = %s;
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,
|
|
30
|
+
<%s key={someKey} {...props} />`,ee,D,mr,D),xe[D+ee]=!0}}return e===m?dr(c):fr(c),c}}function vr(e,r,t){return we(e,r,t,!0)}function pr(e,r,t){return we(e,r,t,!1)}var br=pr,_r=vr;$.Fragment=m,$.jsx=br,$.jsxs=_r})()),$}var ne;function Fe(){return ne||(ne=1,process.env.NODE_ENV==="production"?N.exports=ke():N.exports=De()),N.exports}var C=Fe();const ae={primaryButton:"_primaryButton_131re_1",primaryButtonDisabled:"_primaryButtonDisabled_131re_33"},Ae=({children:P,disabled:_=!1,onClick:x,className:m="","data-testid":g,...O})=>{const E=[ae.primaryButton,_?ae.primaryButtonDisabled:"",m].filter(Boolean).join(" ");return C.jsx("button",{type:"button",className:E,disabled:_,onClick:x,"data-testid":g,...O,children:P})},h={tabsContainer:"_tabsContainer_m3c4e_1",tabsHeader:"_tabsHeader_m3c4e_7",tabItem:"_tabItem_m3c4e_13",tabContent:"_tabContent_m3c4e_29",tabLabel:"_tabLabel_m3c4e_51",tabLine:"_tabLine_m3c4e_61",active:"_active_m3c4e_68",inactive:"_inactive_m3c4e_76",tabPanels:"_tabPanels_m3c4e_84"},Ie=({tabs:P,activeTabId:_,onTabChange:x,className:m="","data-testid":g,...O})=>{var y;const E=[h.tabsContainer,m].filter(Boolean).join(" ");return C.jsxs("div",{className:E,"data-testid":g,...O,children:[C.jsx("div",{className:h.tabsHeader,children:P.map(u=>{const j=u.id===_,f=[h.tabItem,j?h.active:h.inactive].filter(Boolean).join(" ");return C.jsxs("button",{type:"button",className:f,onClick:()=>x(u.id),"data-testid":`${g}-tab-${u.id}`,children:[C.jsx("div",{className:h.tabContent,children:C.jsx("span",{className:h.tabLabel,children:u.label})}),C.jsx("div",{className:h.tabLine})]},u.id)})}),C.jsx("div",{className:h.tabPanels,children:(y=P.find(u=>u.id===_))==null?void 0:y.content})]})};T.PrimaryButton=Ae,T.Tabs=Ie,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})}));
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._primaryButton_131re_1{background:var(--color-primary);border:1px solid var(--color-primary);align-items:center;border-radius:4px;font-family:Lato,sans-serif;font-style:normal;font-weight:700;font-size:12px;line-height:1.5;text-transform:uppercase;color:#fff;padding:0 1.5rem;cursor:pointer;height:34px;transition:background-color .3s ease}._primaryButton_131re_1:focus{outline:0;box-shadow:0 0 0 .2rem #007bff40}._primaryButton_131re_1:disabled{cursor:not-allowed;color:#9cbbe3;border:1px solid #d6e3f5;background:#d6e3f5;opacity:.5}._primaryButton_131re_1:hover{background:var(--color-primary-hover)}._primaryButtonDisabled_131re_33{cursor:not-allowed;opacity:.65}._primaryButtonDisabled_131re_33:hover{transform:none}._tabsContainer_m3c4e_1{display:flex;flex-direction:column;width:100%}._tabsHeader_m3c4e_7{display:flex;align-items:center;gap:0}._tabItem_m3c4e_13{display:flex;flex-direction:column;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;transition:all .2s ease;background:none;border:none;padding:0;margin:0;font-family:inherit;font-size:inherit;color:inherit}._tabItem_m3c4e_13:hover ._tabContent_m3c4e_29{background-color:#128afb0d}._tabItem_m3c4e_13:focus{outline:none}._tabItem_m3c4e_13:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}._tabContent_m3c4e_29{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:10px;padding:var(--spacing-sm) var(--spacing-md);border-radius:var(--border-radius-sm) var(--border-radius-sm) 0 0;transition:background-color .2s ease}._tabLabel_m3c4e_51{font-family:Lato,sans-serif;font-size:var(--font-size-base);line-height:1.5em;text-align:center;font-weight:var(--font-weight-normal);color:var(--color-text-secondary);transition:color .2s ease}._tabLine_m3c4e_61{width:100%;height:2px;background-color:transparent;transition:background-color .2s ease}._active_m3c4e_68 ._tabLabel_m3c4e_51{font-weight:var(--font-weight-bold);color:var(--color-text-primary)}._active_m3c4e_68 ._tabLine_m3c4e_61{background-color:var(--color-primary)}._inactive_m3c4e_76 ._tabLabel_m3c4e_51{font-weight:var(--font-weight-normal);color:var(--color-text-secondary)}._inactive_m3c4e_76 ._tabLine_m3c4e_61{background-color:var(--color-border-light)}._tabPanels_m3c4e_84{padding:var(--spacing-md) 0;background-color:transparent}*{box-sizing:border-box}:root{--color-primary: #3b73bb;--color-primary-hover: #2665b7;--color-dark: #3e4759;--color-text-primary: #212529;--color-text-secondary: #6c757d;--color-bg-primary: #ffffff;--color-bg-secondary: #f8f9fa;--color-border-light: #e9ecef;--spacing-sm: .5rem;--spacing-md: 1rem;--spacing-lg: 1.5rem;--spacing-xl: 3rem;--border-radius-sm: .25rem;--border-radius-md: .375rem;--border-radius-lg: .5rem;--font-size-sm: .875rem;--font-size-base: 1rem;--font-size-lg: 1.125rem;--font-weight-normal: 400;--font-weight-bold: 700}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:var(--color-text-primary);background-color:var(--color-bg-primary);margin:0;padding:0}
|
package/dist/styles.d.ts
ADDED
package/package.json
CHANGED
|
@@ -1,19 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emporix/component-library",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "A React component library for Emporix projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.umd.js",
|
|
7
7
|
"module": "./dist/index.es.js",
|
|
8
8
|
"browser": "./dist/index.umd.js",
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/emporix/component-library.git"
|
|
13
|
+
},
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public"
|
|
16
|
+
},
|
|
10
17
|
"exports": {
|
|
11
18
|
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
12
20
|
"import": "./dist/index.es.js",
|
|
13
|
-
"require": "./dist/index.umd.js"
|
|
14
|
-
"types": "./dist/index.d.ts"
|
|
21
|
+
"require": "./dist/index.umd.js"
|
|
15
22
|
},
|
|
16
|
-
"./styles":
|
|
23
|
+
"./styles": {
|
|
24
|
+
"types": "./dist/styles.d.ts",
|
|
25
|
+
"default": "./dist/style.css"
|
|
26
|
+
}
|
|
17
27
|
},
|
|
18
28
|
"files": [
|
|
19
29
|
"dist"
|
|
@@ -21,7 +31,7 @@
|
|
|
21
31
|
"scripts": {
|
|
22
32
|
"dev": "vite",
|
|
23
33
|
"build": "tsc && vite build",
|
|
24
|
-
"build:lib": "vite build --mode library",
|
|
34
|
+
"build:lib": "vite build --mode library && node -e \"require('fs').writeFileSync('dist/styles.d.ts', 'declare module \\'@emporix/component-library/styles\\' {\\n const styles: string;\\n export default styles;\\n}\\n')\"",
|
|
25
35
|
"preview": "vite preview",
|
|
26
36
|
"test": "vitest",
|
|
27
37
|
"test:ui": "vitest --ui",
|
|
@@ -34,7 +44,7 @@
|
|
|
34
44
|
"format": "prettier --write .",
|
|
35
45
|
"format:check": "prettier --check .",
|
|
36
46
|
"format:staged": "prettier --write",
|
|
37
|
-
"prepare": "husky
|
|
47
|
+
"prepare": "husky"
|
|
38
48
|
},
|
|
39
49
|
"keywords": [
|
|
40
50
|
"react",
|
|
@@ -50,18 +60,18 @@
|
|
|
50
60
|
"react-dom": "^18.0.0"
|
|
51
61
|
},
|
|
52
62
|
"devDependencies": {
|
|
53
|
-
"@storybook/addon-essentials": "^
|
|
54
|
-
"@storybook/addon-interactions": "^
|
|
55
|
-
"@storybook/addon-links": "^
|
|
56
|
-
"@storybook/blocks": "^
|
|
57
|
-
"@storybook/react": "^
|
|
58
|
-
"@storybook/react-vite": "^
|
|
59
|
-
"@storybook/test": "^
|
|
63
|
+
"@storybook/addon-essentials": "^8.6.14",
|
|
64
|
+
"@storybook/addon-interactions": "^8.6.14",
|
|
65
|
+
"@storybook/addon-links": "^8.6.14",
|
|
66
|
+
"@storybook/blocks": "^8.6.14",
|
|
67
|
+
"@storybook/react": "^8.6.14",
|
|
68
|
+
"@storybook/react-vite": "^8.6.14",
|
|
69
|
+
"@storybook/test": "^8.6.14",
|
|
60
70
|
"@types/react": "^18.2.66",
|
|
61
71
|
"@types/react-dom": "^18.2.22",
|
|
62
72
|
"@typescript-eslint/eslint-plugin": "^7.2.0",
|
|
63
73
|
"@typescript-eslint/parser": "^7.2.0",
|
|
64
|
-
"@vitejs/plugin-react": "^4.
|
|
74
|
+
"@vitejs/plugin-react": "^4.3.1",
|
|
65
75
|
"@vitest/coverage-v8": "^1.4.0",
|
|
66
76
|
"@vitest/ui": "^1.4.0",
|
|
67
77
|
"eslint": "^8.57.0",
|
|
@@ -76,15 +86,16 @@
|
|
|
76
86
|
"react": "^18.2.0",
|
|
77
87
|
"react-dom": "^18.2.0",
|
|
78
88
|
"sass": "^1.71.1",
|
|
79
|
-
"storybook": "^
|
|
89
|
+
"storybook": "^8.6.14",
|
|
80
90
|
"typescript": "^5.2.2",
|
|
81
|
-
"vite": "^
|
|
82
|
-
"vite-plugin-dts": "^
|
|
91
|
+
"vite": "^6.4.1",
|
|
92
|
+
"vite-plugin-dts": "^4.5.4",
|
|
83
93
|
"vitest": "^1.4.0"
|
|
84
94
|
},
|
|
85
95
|
"dependencies": {
|
|
86
96
|
"@testing-library/jest-dom": "^6.4.2",
|
|
87
97
|
"@testing-library/react": "^14.2.1",
|
|
88
|
-
"@testing-library/user-event": "^14.5.2"
|
|
98
|
+
"@testing-library/user-event": "^14.5.2",
|
|
99
|
+
"primereact": "^10.9.7"
|
|
89
100
|
}
|
|
90
101
|
}
|
package/dist/App.d.ts
DELETED
package/dist/App.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AAEA,OAAO,mCAAmC,CAAA;AAC1C,QAAA,MAAM,GAAG,+CAiGR,CAAA;AAED,eAAe,GAAG,CAAA"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
|
|
3
|
-
export interface ButtonProps {
|
|
4
|
-
/**
|
|
5
|
-
* The content of the button
|
|
6
|
-
*/
|
|
7
|
-
children: React.ReactNode;
|
|
8
|
-
/**
|
|
9
|
-
* The size of the button
|
|
10
|
-
*/
|
|
11
|
-
size?: 'sm' | 'md' | 'lg';
|
|
12
|
-
/**
|
|
13
|
-
* Whether the button is disabled
|
|
14
|
-
*/
|
|
15
|
-
disabled?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Whether the button should take full width
|
|
18
|
-
*/
|
|
19
|
-
fullWidth?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* The type of the button
|
|
22
|
-
*/
|
|
23
|
-
type?: 'button' | 'submit' | 'reset';
|
|
24
|
-
/**
|
|
25
|
-
* Click handler
|
|
26
|
-
*/
|
|
27
|
-
onClick?: () => void;
|
|
28
|
-
/**
|
|
29
|
-
* Additional CSS class name
|
|
30
|
-
*/
|
|
31
|
-
className?: string;
|
|
32
|
-
/**
|
|
33
|
-
* Test ID for testing
|
|
34
|
-
*/
|
|
35
|
-
'data-testid'?: string;
|
|
36
|
-
}
|
|
37
|
-
export declare const Button: ({ children, size, disabled, fullWidth, type, onClick, className, "data-testid": testId, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
-
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAA;IACpC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,eAAO,MAAM,MAAM,GAAI,oGAUpB,WAAW,4CAuBb,CAAA"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
declare const meta: {
|
|
4
|
-
title: string;
|
|
5
|
-
component: ({ children, size, disabled, fullWidth, type, onClick, className, "data-testid": testId, ...props }: import('./Button').ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
parameters: {
|
|
7
|
-
layout: string;
|
|
8
|
-
};
|
|
9
|
-
tags: string[];
|
|
10
|
-
argTypes: {
|
|
11
|
-
size: {
|
|
12
|
-
control: {
|
|
13
|
-
type: string;
|
|
14
|
-
};
|
|
15
|
-
options: string[];
|
|
16
|
-
};
|
|
17
|
-
disabled: {
|
|
18
|
-
control: {
|
|
19
|
-
type: string;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
fullWidth: {
|
|
23
|
-
control: {
|
|
24
|
-
type: string;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
type: {
|
|
28
|
-
control: {
|
|
29
|
-
type: string;
|
|
30
|
-
};
|
|
31
|
-
options: string[];
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
args: {
|
|
35
|
-
onClick: import('@vitest/spy').Mock<[], void>;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
export default meta;
|
|
39
|
-
type Story = StoryObj<typeof meta>;
|
|
40
|
-
export declare const Default: Story;
|
|
41
|
-
export declare const Small: Story;
|
|
42
|
-
export declare const Medium: Story;
|
|
43
|
-
export declare const Large: Story;
|
|
44
|
-
export declare const Disabled: Story;
|
|
45
|
-
export declare const FullWidth: Story;
|
|
46
|
-
export declare const AllSizes: Story;
|
|
47
|
-
//# sourceMappingURL=Button.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAItD,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwBqB,CAAA;AAE/B,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAKnB,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KAKpB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAKnB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAKtB,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAQvB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAWtB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.test.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.test.tsx"],"names":[],"mappings":""}
|
package/dist/main.d.ts
DELETED
package/dist/main.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.tsx"],"names":[],"mappings":"AAGA,OAAO,qBAAqB,CAAA"}
|
package/dist/test/setup.d.ts
DELETED
package/dist/test/setup.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/test/setup.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAA"}
|