@emporix/component-library 1.3.1 → 1.3.3

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,30 @@
1
+ (function(B,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],b):(B=typeof globalThis<"u"?globalThis:B||self,b(B.EmporixComponentLibrary={},B.React))})(this,(function(B,b){"use strict";var le={exports:{}},Z={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Fe;function at(){if(Fe)return Z;Fe=1;var r=b,a=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,_=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0};function R(w,c,F){var C,N={},$=null,H=null;F!==void 0&&($=""+F),c.key!==void 0&&($=""+c.key),c.ref!==void 0&&(H=c.ref);for(C in c)s.call(c,C)&&!m.hasOwnProperty(C)&&(N[C]=c[C]);if(w&&w.defaultProps)for(C in c=w.defaultProps,c)N[C]===void 0&&(N[C]=c[C]);return{$$typeof:a,type:w,key:$,ref:H,props:N,_owner:_.current}}return Z.Fragment=i,Z.jsx=R,Z.jsxs=R,Z}var Q={};/**
10
+ * @license React
11
+ * react-jsx-runtime.development.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Ae;function it(){return Ae||(Ae=1,process.env.NODE_ENV!=="production"&&(function(){var r=b,a=Symbol.for("react.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),w=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),H=Symbol.for("react.offscreen"),D=Symbol.iterator,T="@@iterator";function q(e){if(e===null||typeof e!="object")return null;var t=D&&e[D]||e[T];return typeof t=="function"?t:null}var k=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function O(e){{for(var t=arguments.length,n=new Array(t>1?t-1:0),l=1;l<t;l++)n[l-1]=arguments[l];de("error",e,n)}}function de(e,t,n){{var l=k.ReactDebugCurrentFrame,d=l.getStackAddendum();d!==""&&(t+="%s",n=n.concat([d]));var v=n.map(function(f){return String(f)});v.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,v)}}var pe=!1,K=!1,W=!1,ee=!1,Pe=!1,te;te=Symbol.for("react.module.reference");function ve(e){return!!(typeof e=="string"||typeof e=="function"||e===s||e===m||Pe||e===_||e===F||e===C||ee||e===H||pe||K||W||typeof e=="object"&&e!==null&&(e.$$typeof===$||e.$$typeof===N||e.$$typeof===R||e.$$typeof===w||e.$$typeof===c||e.$$typeof===te||e.getModuleId!==void 0))}function re(e,t,n){var l=e.displayName;if(l)return l;var d=t.displayName||t.name||"";return d!==""?n+"("+d+")":n}function ne(e){return e.displayName||"Context"}function A(e){if(e==null)return null;if(typeof e.tag=="number"&&O("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 s:return"Fragment";case i:return"Portal";case m:return"Profiler";case _:return"StrictMode";case F:return"Suspense";case C:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case w:var t=e;return ne(t)+".Consumer";case R:var n=e;return ne(n._context)+".Provider";case c:return re(e,e.render,"ForwardRef");case N:var l=e.displayName||null;return l!==null?l:A(e.type)||"Memo";case $:{var d=e,v=d._payload,f=d._init;try{return A(f(v))}catch{return null}}}return null}var M=Object.assign,x=0,J,be,_e,ae,me,ye,ge;function he(){}he.__reactDisabledLog=!0;function ie(){{if(x===0){J=console.log,be=console.info,_e=console.warn,ae=console.error,me=console.group,ye=console.groupCollapsed,ge=console.groupEnd;var e={configurable:!0,enumerable:!0,value:he,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}x++}}function Ee(){{if(x--,x===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:M({},e,{value:J}),info:M({},e,{value:be}),warn:M({},e,{value:_e}),error:M({},e,{value:ae}),group:M({},e,{value:me}),groupCollapsed:M({},e,{value:ye}),groupEnd:M({},e,{value:ge})})}x<0&&O("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var o=k.ReactCurrentDispatcher,p;function g(e,t,n){{if(p===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);p=l&&l[1]||""}return`
18
+ `+p+e}}var Y=!1,V;{var we=typeof WeakMap=="function"?WeakMap:Map;V=new we}function oe(e,t){if(!e||Y)return"";{var n=V.get(e);if(n!==void 0)return n}var l;Y=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var v;v=o.current,o.current=null,ie();try{if(t){var f=function(){throw Error()};if(Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(S){l=S}Reflect.construct(e,[],f)}else{try{f.call()}catch(S){l=S}e.call(f.prototype)}}else{try{throw Error()}catch(S){l=S}e()}}catch(S){if(S&&l&&typeof S.stack=="string"){for(var u=S.stack.split(`
19
+ `),P=l.stack.split(`
20
+ `),E=u.length-1,j=P.length-1;E>=1&&j>=0&&u[E]!==P[j];)j--;for(;E>=1&&j>=0;E--,j--)if(u[E]!==P[j]){if(E!==1||j!==1)do if(E--,j--,j<0||u[E]!==P[j]){var I=`
21
+ `+u[E].replace(" at new "," at ");return e.displayName&&I.includes("<anonymous>")&&(I=I.replace("<anonymous>",e.displayName)),typeof e=="function"&&V.set(e,I),I}while(E>=1&&j>=0);break}}}finally{Y=!1,o.current=v,Ee(),Error.prepareStackTrace=d}var X=e?e.displayName||e.name:"",U=X?g(X):"";return typeof e=="function"&&V.set(e,U),U}function Se(e,t,n){return oe(e,!1)}function Te(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function Ce(e,t,n){if(e==null)return"";if(typeof e=="function")return oe(e,Te(e));if(typeof e=="string")return g(e);switch(e){case F:return g("Suspense");case C:return g("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case c:return Se(e.render);case N:return Ce(e.type,t,n);case $:{var l=e,d=l._payload,v=l._init;try{return Ce(v(d),t,n)}catch{}}}return""}var se=Object.prototype.hasOwnProperty,ze={},Ue=k.ReactDebugCurrentFrame;function je(e){if(e){var t=e._owner,n=Ce(e.type,e._source,t?t.type:null);Ue.setExtraStackFrame(n)}else Ue.setExtraStackFrame(null)}function Et(e,t,n,l,d){{var v=Function.call.bind(se);for(var f in e)if(v(e,f)){var u=void 0;try{if(typeof e[f]!="function"){var P=Error((l||"React class")+": "+n+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw P.name="Invariant Violation",P}u=e[f](t,f,l,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(E){u=E}u&&!(u instanceof Error)&&(je(d),O("%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).",l||"React class",n,f,typeof u),je(null)),u instanceof Error&&!(u.message in ze)&&(ze[u.message]=!0,je(d),O("Failed %s type: %s",n,u.message),je(null))}}}var wt=Array.isArray;function ke(e){return wt(e)}function Ct(e){{var t=typeof Symbol=="function"&&Symbol.toStringTag,n=t&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n}}function jt(e){try{return He(e),!1}catch{return!0}}function He(e){return""+e}function qe(e){if(jt(e))return O("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ct(e)),He(e)}var Ke=k.ReactCurrentOwner,Ot={key:!0,ref:!0,__self:!0,__source:!0},Je,Ge;function xt(e){if(se.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return e.ref!==void 0}function Rt(e){if(se.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function Pt(e,t){typeof e.ref=="string"&&Ke.current}function St(e,t){{var n=function(){Je||(Je=!0,O("%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)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}}function Tt(e,t){{var n=function(){Ge||(Ge=!0,O("%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)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}}var kt=function(e,t,n,l,d,v,f){var u={$$typeof:a,type:e,key:t,ref:n,props:f,_owner:v};return u._store={},Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(u,"_self",{configurable:!1,enumerable:!1,writable:!1,value:l}),Object.defineProperty(u,"_source",{configurable:!1,enumerable:!1,writable:!1,value:d}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u};function Dt(e,t,n,l,d){{var v,f={},u=null,P=null;n!==void 0&&(qe(n),u=""+n),Rt(t)&&(qe(t.key),u=""+t.key),xt(t)&&(P=t.ref,Pt(t,d));for(v in t)se.call(t,v)&&!Ot.hasOwnProperty(v)&&(f[v]=t[v]);if(e&&e.defaultProps){var E=e.defaultProps;for(v in E)f[v]===void 0&&(f[v]=E[v])}if(u||P){var j=typeof e=="function"?e.displayName||e.name||"Unknown":e;u&&St(f,j),P&&Tt(f,j)}return kt(e,u,P,d,l,Ke.current,f)}}var De=k.ReactCurrentOwner,Xe=k.ReactDebugCurrentFrame;function G(e){if(e){var t=e._owner,n=Ce(e.type,e._source,t?t.type:null);Xe.setExtraStackFrame(n)}else Xe.setExtraStackFrame(null)}var Ie;Ie=!1;function Ne(e){return typeof e=="object"&&e!==null&&e.$$typeof===a}function Ze(){{if(De.current){var e=A(De.current.type);if(e)return`
22
+
23
+ Check the render method of \``+e+"`."}return""}}function It(e){return""}var Qe={};function Nt(e){{var t=Ze();if(!t){var n=typeof e=="string"?e:e.displayName||e.name;n&&(t=`
24
+
25
+ Check the top-level render call using <`+n+">.")}return t}}function et(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var n=Nt(t);if(Qe[n])return;Qe[n]=!0;var l="";e&&e._owner&&e._owner!==De.current&&(l=" It was passed a child from "+A(e._owner.type)+"."),G(e),O('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,l),G(null)}}function tt(e,t){{if(typeof e!="object")return;if(ke(e))for(var n=0;n<e.length;n++){var l=e[n];Ne(l)&&et(l,t)}else if(Ne(e))e._store&&(e._store.validated=!0);else if(e){var d=q(e);if(typeof d=="function"&&d!==e.entries)for(var v=d.call(e),f;!(f=v.next()).done;)Ne(f.value)&&et(f.value,t)}}}function Bt(e){{var t=e.type;if(t==null||typeof t=="string")return;var n;if(typeof t=="function")n=t.propTypes;else if(typeof t=="object"&&(t.$$typeof===c||t.$$typeof===N))n=t.propTypes;else return;if(n){var l=A(t);Et(n,e.props,"prop",l,e)}else if(t.PropTypes!==void 0&&!Ie){Ie=!0;var d=A(t);O("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",d||"Unknown")}typeof t.getDefaultProps=="function"&&!t.getDefaultProps.isReactClassApproved&&O("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ft(e){{for(var t=Object.keys(e.props),n=0;n<t.length;n++){var l=t[n];if(l!=="children"&&l!=="key"){G(e),O("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",l),G(null);break}}e.ref!==null&&(G(e),O("Invalid attribute `ref` supplied to `React.Fragment`."),G(null))}}var rt={};function nt(e,t,n,l,d,v){{var f=ve(e);if(!f){var u="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(u+=" 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 P=It();P?u+=P:u+=Ze();var E;e===null?E="null":ke(e)?E="array":e!==void 0&&e.$$typeof===a?(E="<"+(A(e.type)||"Unknown")+" />",u=" Did you accidentally export a JSX literal instead of a component?"):E=typeof e,O("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",E,u)}var j=Dt(e,t,n,d,v);if(j==null)return j;if(f){var I=t.children;if(I!==void 0)if(l)if(ke(I)){for(var X=0;X<I.length;X++)tt(I[X],e);Object.freeze&&Object.freeze(I)}else O("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 tt(I,e)}if(se.call(t,"key")){var U=A(e),S=Object.keys(t).filter(function(Mt){return Mt!=="key"}),Be=S.length>0?"{key: someKey, "+S.join(": ..., ")+": ...}":"{key: someKey}";if(!rt[U+Be]){var Yt=S.length>0?"{"+S.join(": ..., ")+": ...}":"{}";O(`A props object containing a "key" prop is being spread into JSX:
26
+ let props = %s;
27
+ <%s {...props} />
28
+ React keys must be passed directly to JSX without using spread:
29
+ let props = %s;
30
+ <%s key={someKey} {...props} />`,Be,U,Yt,U),rt[U+Be]=!0}}return e===s?Ft(j):Bt(j),j}}function At(e,t,n){return nt(e,t,n,!0)}function Lt(e,t,n){return nt(e,t,n,!1)}var $t=Lt,Wt=At;Q.Fragment=s,Q.jsx=$t,Q.jsxs=Wt})()),Q}var Le;function ot(){return Le||(Le=1,process.env.NODE_ENV==="production"?le.exports=at():le.exports=it()),le.exports}var y=ot();const Oe={primaryButton:"_primaryButton_uyzzr_1",primaryButtonDisabled:"_primaryButtonDisabled_uyzzr_34",spinner:"_spinner_uyzzr_42"};var $e={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},We=b.createContext&&b.createContext($e),st=["attr","size","title"];function lt(r,a){if(r==null)return{};var i=ut(r,a),s,_;if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(r);for(_=0;_<m.length;_++)s=m[_],!(a.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(r,s)&&(i[s]=r[s])}return i}function ut(r,a){if(r==null)return{};var i={};for(var s in r)if(Object.prototype.hasOwnProperty.call(r,s)){if(a.indexOf(s)>=0)continue;i[s]=r[s]}return i}function ue(){return ue=Object.assign?Object.assign.bind():function(r){for(var a=1;a<arguments.length;a++){var i=arguments[a];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])}return r},ue.apply(this,arguments)}function Ye(r,a){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);a&&(s=s.filter(function(_){return Object.getOwnPropertyDescriptor(r,_).enumerable})),i.push.apply(i,s)}return i}function ce(r){for(var a=1;a<arguments.length;a++){var i=arguments[a]!=null?arguments[a]:{};a%2?Ye(Object(i),!0).forEach(function(s){ct(r,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):Ye(Object(i)).forEach(function(s){Object.defineProperty(r,s,Object.getOwnPropertyDescriptor(i,s))})}return r}function ct(r,a,i){return a=ft(a),a in r?Object.defineProperty(r,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[a]=i,r}function ft(r){var a=dt(r,"string");return typeof a=="symbol"?a:a+""}function dt(r,a){if(typeof r!="object"||!r)return r;var i=r[Symbol.toPrimitive];if(i!==void 0){var s=i.call(r,a);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(r)}function Me(r){return r&&r.map((a,i)=>b.createElement(a.tag,ce({key:i},a.attr),Me(a.child)))}function xe(r){return a=>b.createElement(pt,ue({attr:ce({},r.attr)},a),Me(r.child))}function pt(r){var a=i=>{var{attr:s,size:_,title:m}=r,R=lt(r,st),w=_||i.size||"1em",c;return i.className&&(c=i.className),r.className&&(c=(c?c+" ":"")+r.className),b.createElement("svg",ue({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},i.attr,s,R,{className:c,style:ce(ce({color:r.color||i.color},i.style),r.style),height:w,width:w,xmlns:"http://www.w3.org/2000/svg"}),m&&b.createElement("title",null,m),r.children)};return We!==void 0?b.createElement(We.Consumer,null,i=>a(i)):a($e)}function vt(r){return xe({attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{opacity:"0.2",fillRule:"evenodd",clipRule:"evenodd",d:"M12 19C15.866 19 19 15.866 19 12C19 8.13401 15.866 5 12 5C8.13401 5 5 8.13401 5 12C5 15.866 8.13401 19 12 19ZM12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z",fill:"currentColor"},child:[]},{tag:"path",attr:{d:"M2 12C2 6.47715 6.47715 2 12 2V5C8.13401 5 5 8.13401 5 12H2Z",fill:"currentColor"},child:[]}]})(r)}const bt=({children:r,disabled:a=!1,loading:i=!1,onClick:s,className:_="","data-testid":m,...R})=>{const w=[Oe.primaryButton,a?Oe.primaryButtonDisabled:"",_].filter(Boolean).join(" ");return y.jsxs("button",{type:"button",className:w,disabled:a||i,onClick:s,"data-testid":m,...R,children:[i&&y.jsx(vt,{className:Oe.spinner,size:12}),r]})},Ve={secondaryButton:"_secondaryButton_1s7ft_1",secondaryButtonDisabled:"_secondaryButtonDisabled_1s7ft_33"},_t=({children:r,disabled:a=!1,onClick:i,className:s="","data-testid":_,...m})=>{const R=[Ve.secondaryButton,a?Ve.secondaryButtonDisabled:"",s].filter(Boolean).join(" ");return y.jsx("button",{type:"button",className:R,disabled:a,onClick:i,"data-testid":_,...m,children:r})},L={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"},mt=({tabs:r,activeTabId:a,onTabChange:i,className:s="","data-testid":_,...m})=>{var w;const R=[L.tabsContainer,s].filter(Boolean).join(" ");return y.jsxs("div",{className:R,"data-testid":_,...m,children:[y.jsx("div",{className:L.tabsHeader,children:r.map(c=>{const F=c.id===a,C=[L.tabItem,F?L.active:L.inactive].filter(Boolean).join(" ");return y.jsxs("button",{type:"button",className:C,onClick:()=>i(c.id),"data-testid":`${_}-tab-${c.id}`,children:[y.jsx("div",{className:L.tabContent,children:y.jsx("span",{className:L.tabLabel,children:c.label})}),y.jsx("div",{className:L.tabLine})]},c.id)})}),y.jsx("div",{className:L.tabPanels,children:(w=r.find(c=>c.id===a))==null?void 0:w.content})]})};function yt(r){return xe({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"6 9 12 15 18 9"},child:[]}]})(r)}function gt(r){return xe({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"11",cy:"11",r:"8"},child:[]},{tag:"line",attr:{x1:"21",y1:"21",x2:"16.65",y2:"16.65"},child:[]}]})(r)}const h={dropdown:"_dropdown_1tw6u_1",label:"_label_1tw6u_9",required:"_required_1tw6u_18",trigger:"_trigger_1tw6u_23",triggerDisabled:"_triggerDisabled_1tw6u_47",value:"_value_1tw6u_56",placeholder:"_placeholder_1tw6u_64",chevron:"_chevron_1tw6u_68",open:"_open_1tw6u_75",panel:"_panel_1tw6u_99",panelClosing:"_panelClosing_1tw6u_116",filterWrapper:"_filterWrapper_1tw6u_120",filterInput:"_filterInput_1tw6u_127",filterIcon:"_filterIcon_1tw6u_146",list:"_list_1tw6u_157",option:"_option_1tw6u_166",optionSelected:"_optionSelected_1tw6u_178",optionHighlighted:"_optionHighlighted_1tw6u_182",optionDisabled:"_optionDisabled_1tw6u_186",empty:"_empty_1tw6u_195",disabled:"_disabled_1tw6u_202"},Re=(r,a)=>{const s=r[a];return s!=null?String(s):""},fe=(r,a)=>r[a],z=(r,a)=>a==null?!1:!!r[a],ht=({value:r,onChange:a,options:i,optionLabel:s="label",optionValue:_="value",optionDisabled:m,placeholder:R="Select",filter:w=!1,disabled:c=!1,required:F=!1,label:C,inputId:N,className:$="",panelClassName:H="","data-testid":D})=>{const[T,q]=b.useState(!1),[k,O]=b.useState(!1),[de,pe]=b.useState(""),[K,W]=b.useState(0),ee=b.useRef(null),Pe=b.useRef(null),te=b.useRef(null),ve=b.useRef(null),re=b.useRef(!1),ne=i.find(o=>fe(o,_)===r),A=ne?Re(ne,s):"",x=w?i.filter(o=>Re(o,s).toLowerCase().includes(de.toLowerCase())):i;b.useEffect(()=>{T&&w&&(pe(""),W(0),setTimeout(()=>{var o;return(o=te.current)==null?void 0:o.focus()},0))},[T,w]),b.useEffect(()=>{if(!T)return;const o=x.findIndex(Y=>fe(Y,_)===r),p=x.findIndex(Y=>!z(Y,m)),g=o>=0&&!z(x[o],m);W(g?o:p>=0?p:0)},[T,r,x,_,m]),b.useEffect(()=>{const o=ve.current;o!=null&&o.scrollIntoView&&typeof o.scrollIntoView=="function"&&o.scrollIntoView({block:"nearest"})},[K]);const J=()=>{re.current=!0,O(!0)},be=o=>{var p;(re.current||(p=o.animationName)!=null&&p.includes("menuOut"))&&(re.current=!1,q(!1),O(!1))};b.useEffect(()=>{if(!T&&!k)return;const o=p=>{ee.current&&!ee.current.contains(p.target)&&J()};return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[T,k]);const _e=()=>{c||q(o=>!o)},ae=(o,p)=>{if(z(o,m))return;const g=fe(o,_);a==null||a({value:g??null,originalEvent:p}),J()},me=o=>{if(!T){(o.key==="Enter"||o.key===" "||o.key==="ArrowDown")&&(o.preventDefault(),q(!0));return}if(o.key==="Escape"){o.preventDefault(),J();return}if(o.key==="ArrowDown"){o.preventDefault(),W(p=>{for(let g=p+1;g<x.length;g++)if(!z(x[g],m))return g;return p});return}if(o.key==="ArrowUp"){o.preventDefault(),W(p=>{for(let g=p-1;g>=0;g--)if(!z(x[g],m))return g;return p});return}if(o.key==="Enter"&&x[K]){o.preventDefault();const p=x[K];z(p,m)||ae(p,o)}},ye=[h.dropdown,c?h.disabled:"",T?h.open:"",$].filter(Boolean).join(" "),ge=[h.trigger,c?h.triggerDisabled:""].filter(Boolean).join(" "),he=[h.panel,k?h.panelClosing:"",H].filter(Boolean).join(" "),ie=N??`dropdown-${Math.random().toString(36).slice(2,9)}`,Ee=`${ie}-panel`;return y.jsxs("div",{className:ye,ref:ee,"data-testid":D,children:[C!=null&&y.jsxs("label",{htmlFor:ie,className:h.label,children:[C,F&&y.jsx("span",{className:h.required,children:"*"})]}),y.jsxs("div",{id:ie,role:"combobox","aria-expanded":T||k,"aria-haspopup":"listbox","aria-controls":T||k?Ee:void 0,"aria-disabled":c,"aria-label":typeof C=="string"?C:void 0,tabIndex:c?-1:0,className:ge,onClick:_e,onKeyDown:me,"data-testid":D?`${D}-trigger`:void 0,children:[y.jsx("span",{className:h.value,children:A||y.jsx("span",{className:h.placeholder,children:R})}),y.jsx(yt,{className:h.chevron,"aria-hidden":!0})]}),(T||k)&&y.jsxs("div",{ref:Pe,id:Ee,className:he,role:"presentation",onAnimationEnd:be,"data-testid":D?`${D}-panel`:void 0,children:[w&&y.jsxs("div",{className:h.filterWrapper,children:[y.jsx("input",{ref:te,type:"text",className:h.filterInput,value:de,onChange:o=>{pe(o.target.value),W(0)},onKeyDown:o=>{o.key==="Escape"&&q(!1),o.stopPropagation()},placeholder:"Search...","aria-label":"Filter options",title:"Filter options","data-testid":D?`${D}-filter`:void 0}),y.jsx(gt,{className:h.filterIcon,"aria-hidden":!0})]}),y.jsx("ul",{className:h.list,role:"listbox","aria-label":"Options",children:x.length===0?y.jsx("li",{className:h.empty,children:"No results"}):x.map((o,p)=>{const g=fe(o,_),Y=Re(o,s),V=z(o,m),we=r===g,oe=p===K,Se=g!=null?String(g):`option-${p}`;return y.jsx("li",{ref:oe?ve:void 0,role:"option","aria-selected":we,"aria-disabled":V,className:[h.option,we?h.optionSelected:"",oe?h.optionHighlighted:"",V?h.optionDisabled:""].filter(Boolean).join(" "),onMouseEnter:()=>!V&&W(p),onClick:Te=>ae(o,Te),"data-testid":D?`${D}-option-${p}`:void 0,children:Y},Se)})})]})]})};B.Dropdown=ht,B.PrimaryButton=bt,B.SecondaryButton=_t,B.Tabs=mt,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"})}));
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ ._primaryButton_uyzzr_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_uyzzr_1:focus{outline:0;box-shadow:0 0 0 .2rem #007bff40}._primaryButton_uyzzr_1:disabled{cursor:not-allowed;color:#9cbbe3;border:1px solid var(--color-primary-hover);background:var(--color-primary-hover);opacity:.8}._primaryButton_uyzzr_1:hover{border:1px solid var(--color-primary-hover);background:var(--color-primary-hover)}._primaryButtonDisabled_uyzzr_34{cursor:not-allowed;opacity:.8}._primaryButtonDisabled_uyzzr_34:hover{transform:none}._spinner_uyzzr_42{animation:_spin_uyzzr_42 1s linear infinite;margin-right:.5rem}@keyframes _spin_uyzzr_42{0%{transform:rotate(0)}to{transform:rotate(360deg)}}._secondaryButton_1s7ft_1{background:transparent;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:var(--color-primary);padding:0 1.5rem;cursor:pointer;height:34px;transition:background-color .3s ease,border-color .3s ease,color .3s ease}._secondaryButton_1s7ft_1:focus{outline:0;box-shadow:0 0 0 .2rem #007bff40}._secondaryButton_1s7ft_1:disabled{cursor:not-allowed;color:#9cbbe3;border:1px solid #9cbbe3;background:transparent;opacity:.5}._secondaryButton_1s7ft_1:hover{background:#efefef}._secondaryButtonDisabled_1s7ft_33{cursor:not-allowed;opacity:.65}._secondaryButtonDisabled_1s7ft_33:hover{transform:none;background:transparent;color:#9cbbe3}._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}._dropdown_1tw6u_1{position:relative;display:block;min-width:200px;width:100%;box-sizing:border-box}._label_1tw6u_9{display:block;font-weight:var(--font-weight-bold);color:var(--color-text-primary);margin-bottom:var(--spacing-sm);font-size:.875rem;line-height:var(--line-height-base)}._required_1tw6u_18{color:var(--color-text-secondary);margin-left:2px}._trigger_1tw6u_23{display:flex;align-items:center;justify-content:space-between;height:34px;padding:0 .75rem;background:var(--color-bg-primary);border:1px solid var(--color-input-border);border-radius:4px;cursor:pointer;transition:border-color .2s ease,box-shadow .2s ease;font-size:var(--font-size-base);color:var(--color-text-primary);gap:.5rem}._trigger_1tw6u_23:hover:not(:focus){border-color:var(--color-primary)}._trigger_1tw6u_23:focus{outline:0;border-color:var(--color-input-focus);box-shadow:0 0 0 2px #2665b733}._triggerDisabled_1tw6u_47{cursor:not-allowed;opacity:.7;background:var(--color-bg-secondary)}._triggerDisabled_1tw6u_47:hover{border-color:var(--color-input-border)}._value_1tw6u_56{flex:1;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._placeholder_1tw6u_64{color:var(--color-text-secondary)}._chevron_1tw6u_68{flex-shrink:0;color:var(--color-text-secondary);width:1.25rem;height:1.25rem}._open_1tw6u_75 ._chevron_1tw6u_68{transform:rotate(180deg)}@keyframes _menuIn_1tw6u_1{0%{transform:translateY(-10px);opacity:.2}to{transform:translateY(0);opacity:1}}@keyframes _menuOut_1tw6u_1{0%{transform:translateY(0);opacity:1}to{transform:translateY(-10px);opacity:.2}}._panel_1tw6u_99{position:absolute;top:calc(100% + 4px);left:0;right:0;width:100%;min-width:100%;box-sizing:border-box;z-index:1000;background:var(--color-bg-primary);border:1px solid var(--color-border-light);border-radius:4px;box-shadow:0 4px 12px #00000026;overflow-x:hidden;animation:_menuIn_1tw6u_1 .25s ease-out forwards}._panelClosing_1tw6u_116{animation:_menuOut_1tw6u_1 .15s ease-in forwards}._filterWrapper_1tw6u_120{position:relative;padding:4px 8px;border-bottom:1px solid var(--color-border-light);box-sizing:border-box}._filterInput_1tw6u_127{width:100%;box-sizing:border-box;padding:4px 28px 4px 8px;border:1px solid var(--color-input-border);border-radius:4px;font-size:var(--font-size-base);color:var(--color-text-primary);background:var(--color-bg-primary)}._filterInput_1tw6u_127:focus{outline:0;border-color:var(--color-primary);box-shadow:0 0 0 2px #2665b733}._filterInput_1tw6u_127::placeholder{color:var(--color-text-secondary)}._filterIcon_1tw6u_146{position:absolute;right:16px;top:50%;transform:translateY(-50%);color:var(--color-text-secondary);width:1rem;height:1rem;pointer-events:none}._list_1tw6u_157{line-height:1rem;list-style:none;margin:0;padding:.25rem 0;max-height:240px;overflow-y:auto}._option_1tw6u_166{padding:.5rem .75rem;cursor:pointer;font-size:var(--font-size-base);color:var(--color-text-primary);transition:background-color .15s ease;margin-bottom:0}._option_1tw6u_166:hover,._option_1tw6u_166:focus-visible{background:var(--color-bg-secondary)}._optionSelected_1tw6u_178{background:var(--color-dropdown-option-highlight)}._optionHighlighted_1tw6u_182{background:var(--color-bg-secondary)}._optionDisabled_1tw6u_186{cursor:not-allowed;opacity:.6;color:var(--color-text-secondary)}._optionDisabled_1tw6u_186:hover{background:transparent}._empty_1tw6u_195{padding:.75rem 1rem;color:var(--color-text-secondary);font-size:var(--font-size-sm);cursor:default}._disabled_1tw6u_202 ._trigger_1tw6u_23:hover{border-color:var(--color-input-border)}: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;--line-height-base: 1rem;--color-input-border: #e9ecef;--color-input-focus: #4285f4;--color-dropdown-option-highlight: #e6f0ff;--color-dropdown-filter-border: #8b7eff}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}
@@ -0,0 +1,4 @@
1
+ declare module '@emporix/component-library/styles' {
2
+ const styles: string;
3
+ export default styles;
4
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emporix/component-library",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "description": "A React component library for Emporix projects",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.js",
@@ -28,10 +28,6 @@
28
28
  "files": [
29
29
  "dist"
30
30
  ],
31
- "sideEffects": [
32
- "**/*.css",
33
- "dist/style.css"
34
- ],
35
31
  "scripts": {
36
32
  "dev": "vite",
37
33
  "build": "tsc && vite build",