@youversion/design-system-components 0.0.1 → 0.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/CHANGELOG.md +19 -0
- package/dist/index.es.js +626 -386
- package/dist/index.umd.js +10 -10
- package/package.json +3 -3
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(E,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("clsx"),require("react")):typeof define=="function"&&define.amd?define(["exports","clsx","react"],c):(E=typeof globalThis<"u"?globalThis:E||self,c(E["design-system-components"]={},E.clsx,E.React))})(this,function(E,c,y){"use strict";const re=n=>{if(n){if(typeof n!="string"&&n)return c(n.lightMode,n.darkMode);if(typeof n=="string")return n}},pe=n=>{if(n){if(typeof n!="string"&&n)return c(n.block,n.blockEnd,n.blockStart,n.inline,n.inlineEnd,n.inlineStart);if(typeof n=="string")return n}},et=({background:n,borderColor:l,borderRadius:u,borderWidth:d,className:b,component:C="div",color:T,elevation:x=0,height:v,margin:_,padding:p,width:S,...P},I)=>{const k={0:"",1:"shadow-light-1 dark:shadow-dark-1",2:"shadow-light-2 dark:shadow-dark-2",4:"shadow-light-4 dark:shadow-dark-4",8:"shadow-light-8 dark:shadow-dark-8",12:"shadow-light-12 dark:shadow-dark-12"},U=re(T),L=re(n),j=re(l),g=pe(p),q=pe(_),A=c(u,d,k[x],q,g,U,L,j,S,v,b);return y.createElement(C,{className:A,...P,ref:I})},ne=y.forwardRef(et);ne.displayName="Box";var H={},tt={get exports(){return H},set exports(n){H=n}},$={};/**
|
|
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 me;function rt(){if(me)return $;me=1;var n=y,l=Symbol.for("react.element"),u=Symbol.for("react.fragment"),d=Object.prototype.hasOwnProperty,b=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,C={key:!0,ref:!0,__self:!0,__source:!0};function T(x,v,_){var p,S={},P=null,I=null;_!==void 0&&(P=""+_),v.key!==void 0&&(P=""+v.key),v.ref!==void 0&&(I=v.ref);for(p in v)d.call(v,p)&&!C.hasOwnProperty(p)&&(S[p]=v[p]);if(x&&x.defaultProps)for(p in v=x.defaultProps,v)S[p]===void 0&&(S[p]=v[p]);return{$$typeof:l,type:x,key:P,ref:I,props:S,_owner:b.current}}return $.Fragment=u,$.jsx=T,$.jsxs=T,$}var Y={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,14 +14,14 @@
|
|
|
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
|
-
`+
|
|
17
|
+
*/var ge;function nt(){return ge||(ge=1,process.env.NODE_ENV!=="production"&&function(){var n=y,l=Symbol.for("react.element"),u=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),x=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),k=Symbol.iterator,U="@@iterator";function L(e){if(e===null||typeof e!="object")return null;var t=k&&e[k]||e[U];return typeof t=="function"?t:null}var j=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(e){{for(var t=arguments.length,r=new Array(t>1?t-1:0),a=1;a<t;a++)r[a-1]=arguments[a];q("error",e,r)}}function q(e,t,r){{var a=j.ReactDebugCurrentFrame,s=a.getStackAddendum();s!==""&&(t+="%s",r=r.concat([s]));var f=r.map(function(i){return String(i)});f.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,f)}}var A=!1,oe=!1,B=!1,X=!1,mt=!1,Pe;Pe=Symbol.for("react.module.reference");function gt(e){return!!(typeof e=="string"||typeof e=="function"||e===d||e===C||mt||e===b||e===_||e===p||X||e===I||A||oe||B||typeof e=="object"&&e!==null&&(e.$$typeof===P||e.$$typeof===S||e.$$typeof===T||e.$$typeof===x||e.$$typeof===v||e.$$typeof===Pe||e.getModuleId!==void 0))}function ht(e,t,r){var a=e.displayName;if(a)return a;var s=t.displayName||t.name||"";return s!==""?r+"("+s+")":r}function je(e){return e.displayName||"Context"}function N(e){if(e==null)return null;if(typeof e.tag=="number"&&g("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 d:return"Fragment";case u:return"Portal";case C:return"Profiler";case b:return"StrictMode";case _:return"Suspense";case p:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case x:var t=e;return je(t)+".Consumer";case T:var r=e;return je(r._context)+".Provider";case v:return ht(e,e.render,"ForwardRef");case S:var a=e.displayName||null;return a!==null?a:N(e.type)||"Memo";case P:{var s=e,f=s._payload,i=s._init;try{return N(i(f))}catch{return null}}}return null}var D=Object.assign,J=0,Ne,Fe,Ie,De,Le,Ae,Be;function Ve(){}Ve.__reactDisabledLog=!0;function bt(){{if(J===0){Ne=console.log,Fe=console.info,Ie=console.warn,De=console.error,Le=console.group,Ae=console.groupCollapsed,Be=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Ve,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}J++}}function yt(){{if(J--,J===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},e,{value:Ne}),info:D({},e,{value:Fe}),warn:D({},e,{value:Ie}),error:D({},e,{value:De}),group:D({},e,{value:Le}),groupCollapsed:D({},e,{value:Ae}),groupEnd:D({},e,{value:Be})})}J<0&&g("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ie=j.ReactCurrentDispatcher,se;function Z(e,t,r){{if(se===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);se=a&&a[1]||""}return`
|
|
18
|
+
`+se+e}}var le=!1,Q;{var xt=typeof WeakMap=="function"?WeakMap:Map;Q=new xt}function We(e,t){if(!e||le)return"";{var r=Q.get(e);if(r!==void 0)return r}var a;le=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var f;f=ie.current,ie.current=null,bt();try{if(t){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(F){a=F}Reflect.construct(e,[],i)}else{try{i.call()}catch(F){a=F}e.call(i.prototype)}}else{try{throw Error()}catch(F){a=F}e()}}catch(F){if(F&&a&&typeof F.stack=="string"){for(var o=F.stack.split(`
|
|
19
|
+
`),w=a.stack.split(`
|
|
20
|
+
`),m=o.length-1,h=w.length-1;m>=1&&h>=0&&o[m]!==w[h];)h--;for(;m>=1&&h>=0;m--,h--)if(o[m]!==w[h]){if(m!==1||h!==1)do if(m--,h--,h<0||o[m]!==w[h]){var O=`
|
|
21
|
+
`+o[m].replace(" at new "," at ");return e.displayName&&O.includes("<anonymous>")&&(O=O.replace("<anonymous>",e.displayName)),typeof e=="function"&&Q.set(e,O),O}while(m>=1&&h>=0);break}}}finally{le=!1,ie.current=f,yt(),Error.prepareStackTrace=s}var W=e?e.displayName||e.name:"",ze=W?Z(W):"";return typeof e=="function"&&Q.set(e,ze),ze}function Et(e,t,r){return We(e,!1)}function _t(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function z(e,t,r){if(e==null)return"";if(typeof e=="function")return We(e,_t(e));if(typeof e=="string")return Z(e);switch(e){case _:return Z("Suspense");case p:return Z("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case v:return Et(e.render);case S:return z(e.type,t,r);case P:{var a=e,s=a._payload,f=a._init;try{return z(f(s),t,r)}catch{}}}return""}var ee=Object.prototype.hasOwnProperty,$e={},Ye=j.ReactDebugCurrentFrame;function te(e){if(e){var t=e._owner,r=z(e.type,e._source,t?t.type:null);Ye.setExtraStackFrame(r)}else Ye.setExtraStackFrame(null)}function kt(e,t,r,a,s){{var f=Function.call.bind(ee);for(var i in e)if(f(e,i)){var o=void 0;try{if(typeof e[i]!="function"){var w=Error((a||"React class")+": "+r+" 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 w.name="Invariant Violation",w}o=e[i](t,i,a,r,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(m){o=m}o&&!(o instanceof Error)&&(te(s),g("%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).",a||"React class",r,i,typeof o),te(null)),o instanceof Error&&!(o.message in $e)&&($e[o.message]=!0,te(s),g("Failed %s type: %s",r,o.message),te(null))}}}var wt=Array.isArray;function ue(e){return wt(e)}function Rt(e){{var t=typeof Symbol=="function"&&Symbol.toStringTag,r=t&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r}}function Tt(e){try{return Me(e),!1}catch{return!0}}function Me(e){return""+e}function Ue(e){if(Tt(e))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Rt(e)),Me(e)}var G=j.ReactCurrentOwner,Ct={key:!0,ref:!0,__self:!0,__source:!0},qe,Je,fe;fe={};function St(e){if(ee.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return e.ref!==void 0}function Ot(e){if(ee.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){if(typeof e.ref=="string"&&G.current&&t&&G.current.stateNode!==t){var r=N(G.current.type);fe[r]||(g('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',N(G.current.type),e.ref),fe[r]=!0)}}function jt(e,t){{var r=function(){qe||(qe=!0,g("%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))};r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}}function Nt(e,t){{var r=function(){Je||(Je=!0,g("%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))};r.isReactWarning=!0,Object.defineProperty(e,"ref",{get:r,configurable:!0})}}var Ft=function(e,t,r,a,s,f,i){var o={$$typeof:l,type:e,key:t,ref:r,props:i,_owner:f};return o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(o,"_self",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.defineProperty(o,"_source",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o};function It(e,t,r,a,s){{var f,i={},o=null,w=null;r!==void 0&&(Ue(r),o=""+r),Ot(t)&&(Ue(t.key),o=""+t.key),St(t)&&(w=t.ref,Pt(t,s));for(f in t)ee.call(t,f)&&!Ct.hasOwnProperty(f)&&(i[f]=t[f]);if(e&&e.defaultProps){var m=e.defaultProps;for(f in m)i[f]===void 0&&(i[f]=m[f])}if(o||w){var h=typeof e=="function"?e.displayName||e.name||"Unknown":e;o&&jt(i,h),w&&Nt(i,h)}return Ft(e,o,w,s,a,G.current,i)}}var ce=j.ReactCurrentOwner,Ge=j.ReactDebugCurrentFrame;function V(e){if(e){var t=e._owner,r=z(e.type,e._source,t?t.type:null);Ge.setExtraStackFrame(r)}else Ge.setExtraStackFrame(null)}var de;de=!1;function ve(e){return typeof e=="object"&&e!==null&&e.$$typeof===l}function He(){{if(ce.current){var e=N(ce.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 Dt(e){{if(e!==void 0){var t=e.fileName.replace(/^.*[\\\/]/,""),r=e.lineNumber;return`
|
|
24
24
|
|
|
25
|
-
Check your code at `+
|
|
25
|
+
Check your code at `+t+":"+r+"."}return""}}var Ke={};function Lt(e){{var t=He();if(!t){var r=typeof e=="string"?e:e.displayName||e.name;r&&(t=`
|
|
26
26
|
|
|
27
|
-
Check the top-level render call using <`+
|
|
27
|
+
Check the top-level render call using <`+r+">.")}return t}}function Xe(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var r=Lt(t);if(Ke[r])return;Ke[r]=!0;var a="";e&&e._owner&&e._owner!==ce.current&&(a=" It was passed a child from "+N(e._owner.type)+"."),V(e),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',r,a),V(null)}}function Ze(e,t){{if(typeof e!="object")return;if(ue(e))for(var r=0;r<e.length;r++){var a=e[r];ve(a)&&Xe(a,t)}else if(ve(e))e._store&&(e._store.validated=!0);else if(e){var s=L(e);if(typeof s=="function"&&s!==e.entries)for(var f=s.call(e),i;!(i=f.next()).done;)ve(i.value)&&Xe(i.value,t)}}}function At(e){{var t=e.type;if(t==null||typeof t=="string")return;var r;if(typeof t=="function")r=t.propTypes;else if(typeof t=="object"&&(t.$$typeof===v||t.$$typeof===S))r=t.propTypes;else return;if(r){var a=N(t);kt(r,e.props,"prop",a,e)}else if(t.PropTypes!==void 0&&!de){de=!0;var s=N(t);g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",s||"Unknown")}typeof t.getDefaultProps=="function"&&!t.getDefaultProps.isReactClassApproved&&g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Bt(e){{for(var t=Object.keys(e.props),r=0;r<t.length;r++){var a=t[r];if(a!=="children"&&a!=="key"){V(e),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",a),V(null);break}}e.ref!==null&&(V(e),g("Invalid attribute `ref` supplied to `React.Fragment`."),V(null))}}function Qe(e,t,r,a,s,f){{var i=gt(e);if(!i){var o="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(o+=" 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 w=Dt(s);w?o+=w:o+=He();var m;e===null?m="null":ue(e)?m="array":e!==void 0&&e.$$typeof===l?(m="<"+(N(e.type)||"Unknown")+" />",o=" Did you accidentally export a JSX literal instead of a component?"):m=typeof e,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",m,o)}var h=It(e,t,r,s,f);if(h==null)return h;if(i){var O=t.children;if(O!==void 0)if(a)if(ue(O)){for(var W=0;W<O.length;W++)Ze(O[W],e);Object.freeze&&Object.freeze(O)}else g("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 Ze(O,e)}return e===d?Bt(h):At(h),h}}function Vt(e,t,r){return Qe(e,t,r,!0)}function Wt(e,t,r){return Qe(e,t,r,!1)}var $t=Wt,Yt=Vt;Y.Fragment=d,Y.jsx=$t,Y.jsxs=Yt}()),Y}(function(n){process.env.NODE_ENV==="production"?n.exports=rt():n.exports=nt()})(tt);const R=H.jsx,M=H.jsxs,at=({children:n,className:l,disabled:u,...d},b)=>R("button",{className:c(["rounded-full hover:bg-gray-10 dark:hover:bg-gray-40 text-text-light dark:text-white inline-flex justify-center items-center p-1 focus-visible:outline-2 focus-visible:outline focus-visible:outline-info dark:focus-visible:outline-info-dark outline-offset-0 disabled:text-text-muted-light dark:disabled:text-text-muted-dark",l]),disabled:u,ref:b,...d,children:n}),he=y.forwardRef(at);he.displayName="IconButton";const ot=({className:n,children:l,component:u="a",...d},b)=>y.createElement(u,{...d,className:c(["rounded-full hover:bg-gray-10 dark:hover:bg-gray-40 text-text-light dark:text-white inline-flex justify-center items-center p-1 focus-visible:outline-2 focus-visible:outline focus-visible:outline-info dark:focus-visible:outline-info-dark outline-offset-0",n]),ref:b},l),be=y.forwardRef(ot);be.displayName="IconLinkButton";const it=({innerRef:n,forwardedRef:l})=>(y.useEffect(()=>{[n,l].forEach(u=>{u&&(typeof u=="function"?u(n.current||null):u.current=n.current||null)})},[n,l]),n),st=({className:n,disabled:l,endIcon:u,error:d,hint:b,label:C,name:T,onChange:x,placeholder:v,startIcon:_,value:p,...S},P)=>{const I=y.useRef(null),k=it({forwardedRef:P,innerRef:I}),[U,L]=y.useState(Boolean(p)),[j,g]=y.useState(!1);y.useEffect(()=>{var B;L(Boolean((B=k==null?void 0:k.current)==null?void 0:B.value)||Boolean(p||v))},[p,v,k]);const q=B=>{var X;L(Boolean((X=k==null?void 0:k.current)==null?void 0:X.value)||Boolean(p||v)),x&&x(B)},A=()=>{l||!k.current||(k.current.focus(),g(!0))},oe=()=>{g(!1)};return M("div",{className:"flex items-start flex-col gap-0.5",children:[M("div",{className:c(["items-center self-stretch rounded-1 border-small border-solid cursor-text flex flex-row relative focus-within:border-transparent focus-within:outline-2 focus-within:outline-info focus-within:outline focus-within:dark:border-transparent focus-within:dark:outline-info-dark",l?"bg-gray-10 dark:bg-gray-40":null,d?"border-alert dark:border-alert-dark":"border-tertiary-light dark:border-tertiary-dark"]),onClick:A,onFocus:A,children:[_?R("div",{className:"text-text-muted-light dark:text-text-muted-dark pis-1.5",children:_}):null,M("span",{className:"relative flex flex-1 overflow-hidden",children:[R("input",{className:c(["self-stretch bg-transparent flex-auto outline-none overflow-hidden pbs-3 pbe-1",_?"pis-1":"pis-2",u?"pie-1":"pie-2",n]),disabled:l,id:T,onBlur:oe,onChange:q,placeholder:v,ref:k,value:p,...S}),R("label",{className:c("items-center text-text-muted-light dark:text-text-muted-dark flex font-regular leading-loose pointer-events-none absolute top-2 select-none",_?"left-1 rtl:right-1":"left-2 rtl:right-2",j||U?"text-13 -translate-y-1.5":"text-16"),htmlFor:T,children:C})]}),u?R("div",{className:"text-text-muted-light dark:text-text-muted-dark pie-1.5",children:u}):null]}),d||b?M("div",{className:"flex flex-col",children:[d?R("span",{className:"text-alert dark:text-alert-dark",children:d}):null,b?R("span",{className:"text-text-muted-light dark:text-text-muted-dark text-13 leading-default",children:b}):null]}):null]})},ye=y.forwardRef(st);ye.displayName="Input";const lt=({children:n,className:l,...u},d)=>R("ul",{className:c(["w-fit bg-canvas-light dark:bg-canvas-dark shadow-light-8 dark:shadow-dark-8 rounded-1 py-0.5",l]),ref:d,...u,children:n}),xe=y.forwardRef(lt);xe.displayName="List";const ut=({children:n,className:l,divider:u,endIcon:d,onClick:b,startIcon:C,...T},x)=>M("li",{className:c(["flex items-center gap-x-2 px-2 py-2 box-border relative",u?"after:last:content-none after:absolute after:inset-x-0 after:bottom-0 after:mx-2 after:bg-gray-10 after:dark:bg-gray-40 after:h-px":null,b?"cursor-pointer hover:bg-gray-10 hover:dark:bg-gray-40":null,l]),onClick:b,ref:x,...T,children:[C?R("div",{children:C}):null,n,d?R("div",{children:d}):null]}),Ee=y.forwardRef(ut);Ee.displayName="ListItem";const _e={base:"font-bold",xs:"text-16 md:text-19 leading-default",sm:"text-19 md:text-23 leading-default md:leading-comfy",md:"text-23 md:text-28 leading-comfy",lg:"text-28 md:text-33 leading-comfy",xl:"text-33 md:text-40 leading-comfy",xxl:"text-33 md:text-57 leading-comfy"},K={base:"font-medium leading-default",default:"text-16 md:text-19",xs:"text-11",sm:"text-13",md:"text-16",lg:"text-19",xl:"text-23 md:text-28 tracking-tight"},ae={...K,base:"font-regular leading-loose",xl:"text-23 md:text-28"},ke={base:"font-medium leading-default tracking-wider uppercase text-text-muted-light dark:text-text-muted-dark",xs:"text-11",sm:"text-13",md:"text-16",lg:"text-19",xl:"text-23"},we={base:"font-regular leading-default text-text-muted-light dark:text-text-muted-dark",sm:"text-11",md:"text-13",lg:"text-16"},Re={base:"font-bold leading-default",xs:"text-11",sm:"text-13",md:"text-16",lg:"text-19"},Te={base:"font-medium leading-default text-text-muted-light dark:text-text-muted-dark",sm:"text-11",md:"text-13",lg:"text-16"},Ce={base:"font-regular leading-loose",md:"text-16",lg:"text-19"},ft=({size:n,variant:l})=>{switch(l){case"headline":return c(_e.base,_e[n]);case"label":return c(K.base,n?K[n]:K.default);case"paragraph":return c(ae.base,n?ae[n]:ae.default);case"eyebrow":return c(ke.base,ke[n]);case"caption":return c(we.base,we[n]);case"buttonLabel":return c(Re.base,Re[n]);case"fieldLabel":return c(Te.base,Te[n]);case"fieldTextInput":return c(Ce.base,Ce[n]);default:return n}},ct={primary:"font-aktiv-grotesk",secondary:"font-untitled-serif"},dt=({className:n,component:l="p",children:u,font:d="primary",size:b,variant:C,...T},x)=>{const v="text-text-light dark:text-text-dark",_=ct[d],p=ft({size:b,variant:C});return R(ne,{className:c(v,p,_,n),component:l,ref:x,...T,children:u})},Se=y.forwardRef(dt);Se.displayName="Text";const vt=({children:n,className:l,size:u="sm"})=>R(Se,{className:c(["flex-grow",l]),size:u,variant:"label",children:n}),Oe={tooltipWrapper:"_tooltipWrapper_qu88w_1",tooltipContent:"_tooltipContent_qu88w_18"},pt=({content:n,className:l,...u})=>R("div",{className:c(Oe.tooltipWrapper,l),...u,children:R("span",{className:Oe.tooltipContent,children:n})});E.Box=ne,E.IconButton=he,E.IconLinkButton=be,E.Input=ye,E.List=xe,E.ListItem=Ee,E.ListItemText=vt,E.Tooltip=pt,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@youversion/design-system-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"main": "./dist/index.umd.js",
|
|
5
5
|
"module": "./dist/index.es.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"dist/**"
|
|
11
11
|
],
|
|
12
12
|
"scripts": {
|
|
13
|
-
"generate:css-types": "tcm -p '**/*.module.css' src
|
|
13
|
+
"generate:css-types": "tcm -p '**/*.module.css' src",
|
|
14
14
|
"dev": "yarn generate:css-types -w",
|
|
15
15
|
"build": "vite build",
|
|
16
16
|
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@youversion/design-system-core": "0.0.1",
|
|
25
25
|
"@youversion/design-system-icons": "0.0.1",
|
|
26
|
-
"@youversion/design-system-tokens": "0.0.
|
|
26
|
+
"@youversion/design-system-tokens": "0.0.2",
|
|
27
27
|
"clsx": "1.2.1",
|
|
28
28
|
"react": "18.2.0"
|
|
29
29
|
},
|