@raspberrypifoundation/design-system-react 2.7.0 → 2.7.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 +15 -3
- package/dist/design-system-react.js +949 -898
- package/dist/design-system-react.umd.cjs +41 -6
- package/dist/types/lib/main.d.ts +7 -0
- package/dist/types/lib/main.d.ts.map +1 -1
- package/dist/types/src/components/Form/Fieldset/FieldSet.types.d.ts +16 -0
- package/dist/types/src/components/Form/Fieldset/FieldSet.types.d.ts.map +1 -0
- package/dist/types/src/components/Form/Fieldset/Fieldset.spec.d.ts.map +1 -1
- package/dist/types/src/components/Form/Fieldset/index.d.ts +3 -19
- package/dist/types/src/components/Form/Fieldset/index.d.ts.map +1 -1
- package/dist/types/src/components/Form/InputField/InputField.types.d.ts +16 -0
- package/dist/types/src/components/Form/InputField/InputField.types.d.ts.map +1 -0
- package/dist/types/src/components/Form/InputField/index.d.ts +3 -19
- package/dist/types/src/components/Form/InputField/index.d.ts.map +1 -1
- package/dist/types/src/components/Form/InputLabel/InputLabel.spec.d.ts.map +1 -1
- package/dist/types/src/components/Form/InputLabel/InputLabel.types.d.ts +11 -0
- package/dist/types/src/components/Form/InputLabel/InputLabel.types.d.ts.map +1 -0
- package/dist/types/src/components/Form/InputLabel/index.d.ts +3 -15
- package/dist/types/src/components/Form/InputLabel/index.d.ts.map +1 -1
- package/dist/types/src/components/Form/RadioInput/RadioInput.spec.d.ts.map +1 -1
- package/dist/types/src/components/Form/RadioInput/RadioInput.types.d.ts +19 -0
- package/dist/types/src/components/Form/RadioInput/RadioInput.types.d.ts.map +1 -0
- package/dist/types/src/components/Form/RadioInput/index.d.ts +3 -23
- package/dist/types/src/components/Form/RadioInput/index.d.ts.map +1 -1
- package/dist/types/src/components/Form/SearchInput/SearchInput.types.d.ts +1 -1
- package/dist/types/src/components/Form/SearchInput/SearchInput.types.d.ts.map +1 -1
- package/dist/types/src/components/Form/SelectInput/SelectInput.spec.d.ts.map +1 -1
- package/dist/types/src/components/Form/SelectInput/SelectInput.types.d.ts +30 -0
- package/dist/types/src/components/Form/SelectInput/SelectInput.types.d.ts.map +1 -0
- package/dist/types/src/components/Form/SelectInput/index.d.ts +4 -29
- package/dist/types/src/components/Form/SelectInput/index.d.ts.map +1 -1
- package/dist/types/src/components/Form/TextInput/TextInput.spec.d.ts.map +1 -1
- package/dist/types/src/components/Form/TextInput/TextInput.types.d.ts +21 -0
- package/dist/types/src/components/Form/TextInput/TextInput.types.d.ts.map +1 -0
- package/dist/types/src/components/Form/TextInput/index.d.ts +4 -25
- package/dist/types/src/components/Form/TextInput/index.d.ts.map +1 -1
- package/dist/types/src/components/Form/TextareaInput/TextareaInput.spec.d.ts.map +1 -1
- package/dist/types/src/components/Form/TextareaInput/TextareaInput.types.d.ts +23 -0
- package/dist/types/src/components/Form/TextareaInput/TextareaInput.types.d.ts.map +1 -0
- package/dist/types/src/components/Form/TextareaInput/index.d.ts +3 -27
- package/dist/types/src/components/Form/TextareaInput/index.d.ts.map +1 -1
- package/dist/types/src/components/Table/BodyCell/BodyCell.spec.d.ts.map +1 -1
- package/dist/types/src/components/Table/HeaderCell/HeaderCell.helpers.d.ts +2 -0
- package/dist/types/src/components/Table/HeaderCell/HeaderCell.helpers.d.ts.map +1 -0
- package/dist/types/src/components/Table/HeaderCell/HeaderCell.spec.d.ts.map +1 -1
- package/dist/types/src/components/Table/HeaderCell/index.d.ts.map +1 -1
- package/dist/types/src/components/Table/Table/Table.spec.d.ts.map +1 -1
- package/dist/types/src/stories/forms/Fieldset.stories.d.ts +17 -55
- package/dist/types/src/stories/forms/Fieldset.stories.d.ts.map +1 -1
- package/dist/types/src/stories/forms/InputLabel.stories.d.ts +13 -24
- package/dist/types/src/stories/forms/InputLabel.stories.d.ts.map +1 -1
- package/dist/types/src/stories/forms/RadioInput.stories.d.ts +27 -49
- package/dist/types/src/stories/forms/RadioInput.stories.d.ts.map +1 -1
- package/dist/types/src/stories/forms/SelectInput.stories.d.ts +25 -51
- package/dist/types/src/stories/forms/SelectInput.stories.d.ts.map +1 -1
- package/dist/types/src/stories/forms/TextInput.stories.d.ts +17 -36
- package/dist/types/src/stories/forms/TextInput.stories.d.ts.map +1 -1
- package/dist/types/src/stories/forms/TextareaInput.stories.d.ts +25 -51
- package/dist/types/src/stories/forms/TextareaInput.stories.d.ts.map +1 -1
- package/dist/types/src/stories/table/Table.stories.d.ts.map +1 -1
- package/package.json +4 -2
|
@@ -1,24 +1,59 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(x,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],t):(x=typeof globalThis<"u"?globalThis:x||self,t(x["RPF Design System React"]={},x.jsxRuntime,x.React))})(this,function(x,t,F){"use strict";function be(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ee={exports:{}};/*!
|
|
2
2
|
Copyright (c) 2018 Jed Watson.
|
|
3
3
|
Licensed under the MIT License (MIT), see
|
|
4
4
|
http://jedwatson.github.io/classnames
|
|
5
|
-
*/var
|
|
5
|
+
*/var me;function Me(){return me||(me=1,function(e){(function(){var n={}.hasOwnProperty;function c(){for(var r="",l=0;l<arguments.length;l++){var i=arguments[l];i&&(r=o(r,a(i)))}return r}function a(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return c.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var l="";for(var i in r)n.call(r,i)&&r[i]&&(l=o(l,i));return l}function o(r,l){return l?r?r+" "+l:r+l:r}e.exports?(c.default=c,e.exports=c):window.classNames=c})()}(ee)),ee.exports}var qe=Me();const q=be(qe);var J={exports:{}},R={exports:{}},C={};/** @license React v16.13.1
|
|
6
6
|
* react-is.production.min.js
|
|
7
7
|
*
|
|
8
8
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
9
9
|
*
|
|
10
10
|
* This source code is licensed under the MIT license found in the
|
|
11
11
|
* LICENSE file in the root directory of this source tree.
|
|
12
|
-
*/var
|
|
12
|
+
*/var _e;function Le(){if(_e)return C;_e=1;var e=typeof Symbol=="function"&&Symbol.for,n=e?Symbol.for("react.element"):60103,c=e?Symbol.for("react.portal"):60106,a=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,r=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,i=e?Symbol.for("react.context"):60110,p=e?Symbol.for("react.async_mode"):60111,v=e?Symbol.for("react.concurrent_mode"):60111,y=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,A=e?Symbol.for("react.suspense_list"):60120,I=e?Symbol.for("react.memo"):60115,M=e?Symbol.for("react.lazy"):60116,N=e?Symbol.for("react.block"):60121,$=e?Symbol.for("react.fundamental"):60117,L=e?Symbol.for("react.responder"):60118,z=e?Symbol.for("react.scope"):60119;function k(f){if(typeof f=="object"&&f!==null){var D=f.$$typeof;switch(D){case n:switch(f=f.type,f){case p:case v:case a:case r:case o:case m:return f;default:switch(f=f&&f.$$typeof,f){case i:case y:case M:case I:case l:return f;default:return D}}case c:return D}}}function j(f){return k(f)===v}return C.AsyncMode=p,C.ConcurrentMode=v,C.ContextConsumer=i,C.ContextProvider=l,C.Element=n,C.ForwardRef=y,C.Fragment=a,C.Lazy=M,C.Memo=I,C.Portal=c,C.Profiler=r,C.StrictMode=o,C.Suspense=m,C.isAsyncMode=function(f){return j(f)||k(f)===p},C.isConcurrentMode=j,C.isContextConsumer=function(f){return k(f)===i},C.isContextProvider=function(f){return k(f)===l},C.isElement=function(f){return typeof f=="object"&&f!==null&&f.$$typeof===n},C.isForwardRef=function(f){return k(f)===y},C.isFragment=function(f){return k(f)===a},C.isLazy=function(f){return k(f)===M},C.isMemo=function(f){return k(f)===I},C.isPortal=function(f){return k(f)===c},C.isProfiler=function(f){return k(f)===r},C.isStrictMode=function(f){return k(f)===o},C.isSuspense=function(f){return k(f)===m},C.isValidElementType=function(f){return typeof f=="string"||typeof f=="function"||f===a||f===v||f===r||f===o||f===m||f===A||typeof f=="object"&&f!==null&&(f.$$typeof===M||f.$$typeof===I||f.$$typeof===l||f.$$typeof===i||f.$$typeof===y||f.$$typeof===$||f.$$typeof===L||f.$$typeof===z||f.$$typeof===N)},C.typeOf=k,C}var P={};/** @license React v16.13.1
|
|
13
13
|
* react-is.development.js
|
|
14
14
|
*
|
|
15
15
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
16
16
|
*
|
|
17
17
|
* This source code is licensed under the MIT license found in the
|
|
18
18
|
* LICENSE file in the root directory of this source tree.
|
|
19
|
-
*/var ge;function De(){return ge||(ge=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,
|
|
19
|
+
*/var ge;function De(){return ge||(ge=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,n=e?Symbol.for("react.element"):60103,c=e?Symbol.for("react.portal"):60106,a=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,r=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,i=e?Symbol.for("react.context"):60110,p=e?Symbol.for("react.async_mode"):60111,v=e?Symbol.for("react.concurrent_mode"):60111,y=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,A=e?Symbol.for("react.suspense_list"):60120,I=e?Symbol.for("react.memo"):60115,M=e?Symbol.for("react.lazy"):60116,N=e?Symbol.for("react.block"):60121,$=e?Symbol.for("react.fundamental"):60117,L=e?Symbol.for("react.responder"):60118,z=e?Symbol.for("react.scope"):60119;function k(u){return typeof u=="string"||typeof u=="function"||u===a||u===v||u===r||u===o||u===m||u===A||typeof u=="object"&&u!==null&&(u.$$typeof===M||u.$$typeof===I||u.$$typeof===l||u.$$typeof===i||u.$$typeof===y||u.$$typeof===$||u.$$typeof===L||u.$$typeof===z||u.$$typeof===N)}function j(u){if(typeof u=="object"&&u!==null){var U=u.$$typeof;switch(U){case n:var Q=u.type;switch(Q){case p:case v:case a:case r:case o:case m:return Q;default:var ke=Q&&Q.$$typeof;switch(ke){case i:case y:case M:case I:case l:return ke;default:return U}}case c:return U}}}var f=p,D=v,le=i,fe=l,ue=n,de=y,X=a,pe=M,ye=I,H=c,he=r,W=o,V=m,G=!1;function ve(u){return G||(G=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),s(u)||j(u)===p}function s(u){return j(u)===v}function d(u){return j(u)===i}function E(u){return j(u)===l}function _(u){return typeof u=="object"&&u!==null&&u.$$typeof===n}function h(u){return j(u)===y}function T(u){return j(u)===a}function b(u){return j(u)===M}function g(u){return j(u)===I}function w(u){return j(u)===c}function O(u){return j(u)===r}function S(u){return j(u)===o}function Y(u){return j(u)===m}P.AsyncMode=f,P.ConcurrentMode=D,P.ContextConsumer=le,P.ContextProvider=fe,P.Element=ue,P.ForwardRef=de,P.Fragment=X,P.Lazy=pe,P.Memo=ye,P.Portal=H,P.Profiler=he,P.StrictMode=W,P.Suspense=V,P.isAsyncMode=ve,P.isConcurrentMode=s,P.isContextConsumer=d,P.isContextProvider=E,P.isElement=_,P.isForwardRef=h,P.isFragment=T,P.isLazy=b,P.isMemo=g,P.isPortal=w,P.isProfiler=O,P.isStrictMode=S,P.isSuspense=Y,P.isValidElementType=k,P.typeOf=j}()),P}var Ee;function Te(){return Ee||(Ee=1,process.env.NODE_ENV==="production"?R.exports=Le():R.exports=De()),R.exports}/*
|
|
20
20
|
object-assign
|
|
21
21
|
(c) Sindre Sorhus
|
|
22
22
|
@license MIT
|
|
23
|
-
*/var re,
|
|
24
|
-
Valid keys: `+JSON.stringify(Object.keys(a),null," "));var u=R(_,C,y,S,v+"."+C,i);if(u)return u}return null}return $(p)}function H(a){switch(typeof a){case"number":case"string":case"undefined":return!0;case"boolean":return!a;case"object":if(Array.isArray(a))return a.every(H);if(a===null||c(a))return!0;var p=m(a);if(p){var E=p.call(a),g;if(p!==a.entries){for(;!(g=E.next()).done;)if(!H(g.value))return!1}else for(;!(g=E.next()).done;){var y=g.value;if(y&&!H(y[1]))return!1}}else return!1;return!0;default:return!1}}function ye(a,p){return a==="symbol"?!0:p?p["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&p instanceof Symbol:!1}function D(a){var p=typeof a;return Array.isArray(a)?"array":a instanceof RegExp?"object":ye(p,a)?"symbol":p}function B(a){if(typeof a>"u"||a===null)return""+a;var p=D(a);if(p==="object"){if(a instanceof Date)return"date";if(a instanceof RegExp)return"regexp"}return p}function Z(a){var p=B(a);switch(p){case"array":case"object":return"an "+p;case"boolean":case"date":case"regexp":return"a "+p;default:return p}}function he(a){return!a.constructor||!a.constructor.name?j:a.constructor.name}return I.checkPropTypes=n,I.resetWarningCache=n.resetWarningCache,I.PropTypes=I,I},oe}var ie,xe;function Be(){if(xe)return ie;xe=1;var e=ne();function l(){}function i(){}return i.resetWarningCache=l,ie=function(){function o(d,c,h,T,b,m){if(m!==e){var j=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw j.name="Invariant Violation",j}}o.isRequired=o;function n(){return o}var t={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:n,element:o,elementType:o,instanceOf:n,node:o,objectOf:n,oneOf:n,oneOfType:n,shape:n,exact:n,checkPropTypes:i,resetWarningCache:l};return t.PropTypes=t,t},ie}var Ne;function Ve(){if(Ne)return X.exports;if(Ne=1,process.env.NODE_ENV!=="production"){var e=Te(),l=!0;X.exports=Ue()(e.isElement,l)}else X.exports=Be()();return X.exports}var He=Ve();const s=be(He),Ae=({content:e,title:l,className:i,id:o="accordion"})=>{const n=Y("rpf-accordion",i);return r.jsxs("details",{className:n,id:`${o}`,children:[r.jsxs("summary",{className:"rpf-accordion__title",role:"button",children:[l,r.jsx("span",{className:"rpf-accordion__icon"})]}),r.jsx("p",{className:"rpf-accordion__text",children:e})]})};Ae.propTypes={content:s.string.isRequired,title:s.string.isRequired,id:s.string,className:s.string};const U=({text:e,href:l,title:i,className:o,type:n="primary",variant:t="",size:d="default",icon:c="",iconOnly:h=!1,iconPosition:T="left",fullWidth:b=!1,disabled:m=!1,onClick:j=()=>{},"aria-label":I="",linkComponent:k})=>{const N=c&&h,$=Y("rpf-button",{[`rpf-button--${n}`]:n,"rpf-button--danger":t==="danger","rpf-button--sm":d==="small","rpf-button--icon-only":N,"rpf-button--full-width":b,disabled:m},o);let F="rpf-button__icon";V.isValidElement(c)?(F+=" icon",console.warn("DEPRECATED: icons as React elements will not be supported in future releases")):F+=" material-symbols-sharp";const z=(f,L)=>!L||T!==f?null:typeof L=="string"?r.jsx("span",{className:F,children:L}):L,M=()=>e&&!N&&r.jsx("span",{className:"text",children:e}),q=r.jsxs(r.Fragment,{children:[z("left",c),M(),z("right",c)]});if(l){const f=k||"a",L=k?{to:l}:{href:l,role:"button"};return r.jsx(f,{className:$,...L,onClick:j,"aria-label":I,children:q})}return r.jsx("button",{className:$,title:i,onClick:j,disabled:m,"aria-label":I,children:q})},Je=({title:e,text:l,titleChildren:i,children:o,type:n,actions:t,onClose:d})=>r.jsxs("div",{className:`rpf-alert rpf-alert--${n}`,children:[r.jsxs("div",{className:"rpf-alert__header",children:[r.jsx("span",{className:"rpf-alert__icon material-symbols-sharp"}),i?r.jsx("div",{className:"rpf-alert__title",children:i}):e?r.jsx("p",{className:"rpf-alert__title",children:e}):null,!!d&&r.jsx("div",{className:"rpf-alert__close",children:r.jsx(U,{type:"tertiary",icon:"close",size:"small",iconOnly:!0,onClick:d})})]}),(l||o||t)&&r.jsxs("div",{className:"rpf-alert__body",children:[l?r.jsx("p",{children:l}):o?r.jsx("div",{children:o}):null,t&&t.length>0&&r.jsx("div",{className:"rpf-alert__actions",children:t.map((c,h)=>r.jsx(U,{text:c.label,size:"small",type:"tertiary",href:c.href,onClick:c.onClick},h))})]})]}),Xe=({id:e,label:l,name:i,checked:o=!1,disabled:n=!1,error:t="",onChange:d=()=>{},value:c="",className:h=""})=>r.jsxs(r.Fragment,{children:[r.jsxs("label",{className:Y("rpf-input-checkbox",{"rpf-input-checkbox--error":t,className:h}),children:[r.jsx("input",{checked:!!o,disabled:n,id:e,name:i,onChange:d,type:"checkbox",value:c}),l]}),t&&r.jsxs("div",{className:"rpf-error-message",children:[r.jsx("span",{className:"rpf-error-message__icon material-symbols-sharp",children:"error"}),t]})]}),je=({disabled:e=!1,errorText:l="",fullWidth:i=!1,legendText:o,legendHintText:n="",children:t})=>r.jsxs("fieldset",{className:Y("rpf-fieldset",{"rpf-fieldset--disabled":e,"rpf-fieldset--full-width":i,"rpf-fieldset--error":l}),disabled:e,children:[r.jsxs("legend",{className:"rpf-label",children:[o,n.length>0?r.jsx("small",{className:"rpf-label__hint",children:n}):null]}),r.jsx("div",{className:"rpf-fieldset__inputs",children:t}),l.length>0?r.jsxs("div",{className:"rpf-error-message",children:[r.jsx("span",{className:"rpf-error-message__icon material-symbols-sharp",children:"error"}),l]}):null]});je.propTypes={disabled:s.bool,errorText:s.string,fullWidth:s.bool,legendText:s.string.isRequired,legendHintText:s.string,children:s.node};const J=({id:e,label:l,children:i,disabled:o=!1,error:n="",hint:t=""})=>r.jsxs("div",{className:"rpf-input-field",children:[(l||t)&&r.jsxs("label",{htmlFor:e,className:Y("rpf-label",{"rpf-label--disabled":o}),children:[l,r.jsx("small",{className:"rpf-label__hint",children:t})]}),i,n&&r.jsxs("div",{className:"rpf-error-message",children:[r.jsx("span",{className:"rpf-error-message__icon material-symbols-sharp",children:"error"}),n]})]});J.propTypes={disabled:s.bool,error:s.string,hint:s.oneOfType([s.string,s.object]),label:s.oneOfType([s.string,s.object]).isRequired,id:s.string.isRequired,children:s.node};const Ie=({label:e,inputFieldId:l,disabled:i=!1,hint:o=""})=>r.jsx("div",{className:"rpf-label",children:r.jsxs("label",{htmlFor:l,className:Y("rpf-label",{"rpf-label--disabled":i}),children:[e,o&&r.jsx("div",{className:"rpf-label__hint",children:o})]})});Ie.propTypes={disabled:s.bool,hint:s.oneOfType([s.string,s.object]),label:s.oneOfType([s.string,s.object]).isRequired,inputFieldId:s.string.isRequired};const qe=({id:e,label:l,name:i,checked:o=!1,disabled:n=!1,fullWidth:t=!1,onChange:d=()=>{},value:c=""})=>r.jsx(r.Fragment,{children:r.jsxs("label",{className:Y("rpf-input-radio",{"rpf-input-radio--disabled":n,"rpf-input--full-width":t}),children:[r.jsx("input",{checked:!!o,disabled:n,id:e,name:i,onChange:d,type:"radio",value:c}),l]})});qe.propTypes={checked:s.bool,disabled:s.bool,fullWidth:s.bool,id:s.string.isRequired,label:s.oneOfType([s.string,s.object]).isRequired,name:s.string.isRequired,onChange:s.func,value:s.string};const Ge=({label:e,inputFieldId:l,disabled:i=!1,error:o="",hint:n="",placeholder:t="",defaultValue:d="",onClick:c=()=>{},onChange:h=()=>{}})=>r.jsx("search",{children:r.jsxs("form",{className:"rpf-input-field",onSubmit:c,children:[r.jsxs("label",{htmlFor:l,className:Y("rpf-label",{"rpf-label--disabled":i}),children:[e,n&&r.jsx("small",{className:"rpf-label__hint",children:n})]}),r.jsxs("div",{className:"rpf-input-search-container",children:[r.jsx("input",{className:Y("rpf-input rpf-input-search",{"rpf-input--disabled":i,"rpf-input--error":o}),disabled:i,id:l,name:"search",type:"search","aria-label":"Search",defaultValue:d,placeholder:t,onChange:h}),r.jsx("button",{type:"submit",className:Y("rpf-button rpf-button-search",{"rpf-button--disabled":i,"rpf-button--error":o}),disabled:i,onClick:c,children:r.jsx("span",{className:"rpf-button__icon material-symbols-sharp",children:"search"})})]}),o&&r.jsxs("div",{className:"rpf-error-message",children:[r.jsx("span",{className:"rpf-error-message__icon material-symbols-sharp",children:"info"}),o]})]})}),$e=({id:e,label:l,name:i,options:o,disabled:n=!1,error:t="",fullWidth:d=!1,hint:c="",onChange:h=()=>{},placeholder:T="",value:b=""})=>r.jsx(J,{id:e,disabled:n,error:t,hint:c,label:l,children:r.jsxs("select",{className:Y("rpf-input rpf-input-select",{"rpf-input--error":t,"rpf-input--full-width":d}),disabled:n,id:e,name:i,onChange:h,type:"text",value:b,children:[!b&&!!T&&r.jsx("option",{value:"",disabled:!0,children:T}),o.map(m=>r.jsx("option",{value:m.key,children:m.value},m.key))]})});$e.propTypes={disabled:s.bool,error:s.string,fullWidth:s.bool,hint:s.oneOfType([s.string,s.object]),label:s.oneOfType([s.string,s.object]).isRequired,id:s.string.isRequired,name:s.string.isRequired,onChange:s.func,options:s.array.isRequired,placeholder:s.string,value:s.string};const Me=({id:e,label:l,name:i,value:o,disabled:n=!1,readOnly:t=!1,error:d="",fullWidth:c=!1,hint:h="",onChange:T=()=>{}})=>r.jsx(J,{id:e,disabled:n,error:d,hint:h,label:l,children:r.jsx("textarea",{className:Y("rpf-input rpf-input-textarea",{"rpf-input--error":d,"rpf-input--full-width":c,"rpf-input--disabled":n}),disabled:n,readOnly:t,id:e,name:i,onChange:T,type:"text",value:o})});Me.propTypes={disabled:s.bool,readOnly:s.bool,error:s.string,fullWidth:s.bool,hint:s.oneOfType([s.string,s.object]),label:s.oneOfType([s.string,s.object]).isRequired,id:s.string.isRequired,name:s.string.isRequired,onChange:s.func,value:s.string.isRequired};const ke=({id:e,label:l,name:i,value:o,disabled:n=!1,error:t="",fullWidth:d=!1,hint:c="",onChange:h=()=>{}})=>r.jsx(J,{id:e,disabled:n,error:t,hint:c,label:l,children:r.jsx("input",{className:Y("rpf-input rpf-input-text",{"rpf-input--error":t,"rpf-input--full-width":d}),disabled:n,id:e,name:i,onChange:h,type:"text",value:o})});ke.propTypes={disabled:s.bool,error:s.string,fullWidth:s.bool,hint:s.oneOfType([s.string,s.object]),label:s.oneOfType([s.string,s.object]).isRequired,id:s.string.isRequired,name:s.string.isRequired,onChange:s.func,value:s.string.isRequired};function Ke(e,l){const i=V.useRef(null),o=V.useRef(null);return V.useEffect(()=>{const n=i.current;n&&(e&&!n.open?n.showModal():!e&&n.open&&n.close())},[e]),V.useEffect(()=>{const n=i.current;if(!n)return;const t=()=>l(!1),d=c=>{c.preventDefault(),l(!1)};return n.addEventListener("close",t),n.addEventListener("cancel",d),()=>{n.removeEventListener("close",t),n.removeEventListener("cancel",d)}},[l]),V.useEffect(()=>{const n=i.current,t=o.current;if(!n||!t)return;const d=c=>{e&&!t.contains(c.target)&&l(!1)};return n.addEventListener("mousedown",d),()=>n.removeEventListener("mousedown",d)},[e,l]),{dialogRef:i,contentRef:o}}const Ze=({isOpen:e,setIsOpen:l,heading:i,children:o,primaryButtonLink:n,primaryButtonText:t,onClickPrimaryButton:d,secondaryButtonText:c,secondaryButtonLink:h,onClickSecondaryButton:T,tertiaryButtonText:b,tertiaryButtonLink:m,onClickTertiaryButton:j,showCloseButton:I=!0})=>{const{dialogRef:k,contentRef:N}=Ke(e,l);return r.jsx("dialog",{ref:k,className:"rpf-modal","aria-labelledby":"modal-heading","aria-describedby":"modal-description",children:r.jsxs("div",{ref:N,className:"rpf-modal__wrapper",children:[r.jsxs("div",{className:"rpf-modal__header",children:[r.jsx("h2",{className:"rpf-modal__title",id:"modal-heading",children:i}),I&&r.jsx(U,{icon:"close",iconOnly:!0,"aria-label":"Close modal",type:"tertiary",onClick:()=>l(!1)})]}),r.jsx("div",{id:"modal-description",className:"rpf-modal__content",tabIndex:0,children:o}),r.jsxs("div",{className:"rpf-modal__buttons",children:[r.jsx(U,{text:t,href:n,onClick:d,type:"primary"}),c&&r.jsx(U,{text:c,href:h,onClick:T,type:"secondary"}),b&&r.jsx(U,{text:b,href:m,onClick:j,type:"tertiary"})]})]})})},Qe=({text:e="",percent:l,complete:i=!1,className:o})=>r.jsx("div",{className:Y("rpf-progress-bar",{"rpf-progress-bar--complete":i,className:o}),children:r.jsxs("label",{className:"rpf-progress-bar__label",children:[r.jsx("span",{children:e}),r.jsx("progress",{className:"rpf-progress-bar__bar",value:l,max:"100",children:`${l}%`})]})}),er=({children:e})=>r.jsx("td",{className:"rpf-table-cell rpf-table-cell--body",children:r.jsx("div",{className:"rpf-table-cell__content",children:e})}),rr=({sortDirection:e,children:l,onClick:i})=>{const o=e==="up"?"arrow_drop_up":e==="down"?"arrow_drop_down":null,n=e!==void 0?"rpf-table-cell--sortable-header":"rpf-table-cell--header";return r.jsx("th",{className:`rpf-table-cell ${n}`,"aria-sort":e==="up"?"ascending":e==="down"?"descending":"none",children:r.jsx("div",{className:"rpf-table-cell__content",children:e?r.jsxs("button",{className:"rpf-table-cell__sort-header",onClick:i,children:[l,r.jsx("span",{className:"material-symbols-sharp",children:o})]}):r.jsx(r.Fragment,{children:l})})})},tr=({headerRow:e,bodyRows:l,fullWidth:i})=>r.jsx("div",{"data-testid":"table-container",className:Y("rpf-table",{"rpf-table--full-width":i}),children:r.jsxs("table",{className:Y("rpf-table__table",{"rpf-table__table--full-width":i}),children:[r.jsx("thead",{children:r.jsx("tr",{className:"rpf-table-row",children:e})}),r.jsx("tbody",{children:l.map((o,n)=>r.jsx("tr",{className:"rpf-table-row",children:o},n))})]})}),nr=({text:e,variant:l,secondary:i,icon:o,iconPosition:n})=>{const t=o?r.jsx("span",{className:"rpf-tag__icon material-symbols-sharp",children:o}):null;o&&!n&&(n="left");const d=l&&l!=="default"?`rpf-tag--${l}`:null;return r.jsxs("span",{className:Y("rpf-tag",d,{"rpf-tag--secondary":i}),children:[n==="left"&&t,e,n==="right"&&t]})};A.Accordion=Ae,A.Alert=Je,A.Button=U,A.CheckboxInput=Xe,A.Fieldset=je,A.InputField=J,A.InputLabel=Ie,A.Modal=Ze,A.ProgressBar=Qe,A.RadioInput=qe,A.SearchInput=Ge,A.SelectInput=$e,A.Table=tr,A.TableBodyCell=er,A.TableHeaderCell=rr,A.Tag=nr,A.TextInput=ke,A.TextareaInput=Me,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
|
|
23
|
+
*/var re,we;function Ye(){if(we)return re;we=1;var e=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable;function a(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function o(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var l={},i=0;i<10;i++)l["_"+String.fromCharCode(i)]=i;var p=Object.getOwnPropertyNames(l).map(function(y){return l[y]});if(p.join("")!=="0123456789")return!1;var v={};return"abcdefghijklmnopqrst".split("").forEach(function(y){v[y]=y}),Object.keys(Object.assign({},v)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return re=o()?Object.assign:function(r,l){for(var i,p=a(r),v,y=1;y<arguments.length;y++){i=Object(arguments[y]);for(var m in i)n.call(i,m)&&(p[m]=i[m]);if(e){v=e(i);for(var A=0;A<v.length;A++)c.call(i,v[A])&&(p[v[A]]=i[v[A]])}}return p},re}var te,Se;function ne(){if(Se)return te;Se=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return te=e,te}var ae,Ce;function Pe(){return Ce||(Ce=1,ae=Function.call.bind(Object.prototype.hasOwnProperty)),ae}var oe,Oe;function Fe(){if(Oe)return oe;Oe=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var n=ne(),c={},a=Pe();e=function(r){var l="Warning: "+r;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}}}function o(r,l,i,p,v){if(process.env.NODE_ENV!=="production"){for(var y in r)if(a(r,y)){var m;try{if(typeof r[y]!="function"){var A=Error((p||"React class")+": "+i+" type `"+y+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[y]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw A.name="Invariant Violation",A}m=r[y](l,y,p,i,null,n)}catch(M){m=M}if(m&&!(m instanceof Error)&&e((p||"React class")+": type specification of "+i+" `"+y+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof m+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),m instanceof Error&&!(m.message in c)){c[m.message]=!0;var I=v?v():"";e("Failed "+i+" type: "+m.message+(I??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(c={})},oe=o,oe}var se,Ne;function We(){if(Ne)return se;Ne=1;var e=Te(),n=Ye(),c=ne(),a=Pe(),o=Fe(),r=function(){};process.env.NODE_ENV!=="production"&&(r=function(i){var p="Warning: "+i;typeof console<"u"&&console.error(p);try{throw new Error(p)}catch{}});function l(){return null}return se=function(i,p){var v=typeof Symbol=="function"&&Symbol.iterator,y="@@iterator";function m(s){var d=s&&(v&&s[v]||s[y]);if(typeof d=="function")return d}var A="<<anonymous>>",I={array:L("array"),bigint:L("bigint"),bool:L("boolean"),func:L("function"),number:L("number"),object:L("object"),string:L("string"),symbol:L("symbol"),any:z(),arrayOf:k,element:j(),elementType:f(),instanceOf:D,node:de(),objectOf:fe,oneOf:le,oneOfType:ue,shape:pe,exact:ye};function M(s,d){return s===d?s!==0||1/s===1/d:s!==s&&d!==d}function N(s,d){this.message=s,this.data=d&&typeof d=="object"?d:{},this.stack=""}N.prototype=Error.prototype;function $(s){if(process.env.NODE_ENV!=="production")var d={},E=0;function _(T,b,g,w,O,S,Y){if(w=w||A,S=S||g,Y!==c){if(p){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var U=w+":"+g;!d[U]&&E<3&&(r("You are manually calling a React.PropTypes validation function for the `"+S+"` prop on `"+w+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),d[U]=!0,E++)}}return b[g]==null?T?b[g]===null?new N("The "+O+" `"+S+"` is marked as required "+("in `"+w+"`, but its value is `null`.")):new N("The "+O+" `"+S+"` is marked as required in "+("`"+w+"`, but its value is `undefined`.")):null:s(b,g,w,O,S)}var h=_.bind(null,!1);return h.isRequired=_.bind(null,!0),h}function L(s){function d(E,_,h,T,b,g){var w=E[_],O=W(w);if(O!==s){var S=V(w);return new N("Invalid "+T+" `"+b+"` of type "+("`"+S+"` supplied to `"+h+"`, expected ")+("`"+s+"`."),{expectedType:s})}return null}return $(d)}function z(){return $(l)}function k(s){function d(E,_,h,T,b){if(typeof s!="function")return new N("Property `"+b+"` of component `"+h+"` has invalid PropType notation inside arrayOf.");var g=E[_];if(!Array.isArray(g)){var w=W(g);return new N("Invalid "+T+" `"+b+"` of type "+("`"+w+"` supplied to `"+h+"`, expected an array."))}for(var O=0;O<g.length;O++){var S=s(g,O,h,T,b+"["+O+"]",c);if(S instanceof Error)return S}return null}return $(d)}function j(){function s(d,E,_,h,T){var b=d[E];if(!i(b)){var g=W(b);return new N("Invalid "+h+" `"+T+"` of type "+("`"+g+"` supplied to `"+_+"`, expected a single ReactElement."))}return null}return $(s)}function f(){function s(d,E,_,h,T){var b=d[E];if(!e.isValidElementType(b)){var g=W(b);return new N("Invalid "+h+" `"+T+"` of type "+("`"+g+"` supplied to `"+_+"`, expected a single ReactElement type."))}return null}return $(s)}function D(s){function d(E,_,h,T,b){if(!(E[_]instanceof s)){var g=s.name||A,w=ve(E[_]);return new N("Invalid "+T+" `"+b+"` of type "+("`"+w+"` supplied to `"+h+"`, expected ")+("instance of `"+g+"`."))}return null}return $(d)}function le(s){if(!Array.isArray(s))return process.env.NODE_ENV!=="production"&&(arguments.length>1?r("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):r("Invalid argument supplied to oneOf, expected an array.")),l;function d(E,_,h,T,b){for(var g=E[_],w=0;w<s.length;w++)if(M(g,s[w]))return null;var O=JSON.stringify(s,function(Y,u){var U=V(u);return U==="symbol"?String(u):u});return new N("Invalid "+T+" `"+b+"` of value `"+String(g)+"` "+("supplied to `"+h+"`, expected one of "+O+"."))}return $(d)}function fe(s){function d(E,_,h,T,b){if(typeof s!="function")return new N("Property `"+b+"` of component `"+h+"` has invalid PropType notation inside objectOf.");var g=E[_],w=W(g);if(w!=="object")return new N("Invalid "+T+" `"+b+"` of type "+("`"+w+"` supplied to `"+h+"`, expected an object."));for(var O in g)if(a(g,O)){var S=s(g,O,h,T,b+"."+O,c);if(S instanceof Error)return S}return null}return $(d)}function ue(s){if(!Array.isArray(s))return process.env.NODE_ENV!=="production"&&r("Invalid argument supplied to oneOfType, expected an instance of array."),l;for(var d=0;d<s.length;d++){var E=s[d];if(typeof E!="function")return r("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+G(E)+" at index "+d+"."),l}function _(h,T,b,g,w){for(var O=[],S=0;S<s.length;S++){var Y=s[S],u=Y(h,T,b,g,w,c);if(u==null)return null;u.data&&a(u.data,"expectedType")&&O.push(u.data.expectedType)}var U=O.length>0?", expected one of type ["+O.join(", ")+"]":"";return new N("Invalid "+g+" `"+w+"` supplied to "+("`"+b+"`"+U+"."))}return $(_)}function de(){function s(d,E,_,h,T){return H(d[E])?null:new N("Invalid "+h+" `"+T+"` supplied to "+("`"+_+"`, expected a ReactNode."))}return $(s)}function X(s,d,E,_,h){return new N((s||"React class")+": "+d+" type `"+E+"."+_+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+h+"`.")}function pe(s){function d(E,_,h,T,b){var g=E[_],w=W(g);if(w!=="object")return new N("Invalid "+T+" `"+b+"` of type `"+w+"` "+("supplied to `"+h+"`, expected `object`."));for(var O in s){var S=s[O];if(typeof S!="function")return X(h,T,b,O,V(S));var Y=S(g,O,h,T,b+"."+O,c);if(Y)return Y}return null}return $(d)}function ye(s){function d(E,_,h,T,b){var g=E[_],w=W(g);if(w!=="object")return new N("Invalid "+T+" `"+b+"` of type `"+w+"` "+("supplied to `"+h+"`, expected `object`."));var O=n({},E[_],s);for(var S in O){var Y=s[S];if(a(s,S)&&typeof Y!="function")return X(h,T,b,S,V(Y));if(!Y)return new N("Invalid "+T+" `"+b+"` key `"+S+"` supplied to `"+h+"`.\nBad object: "+JSON.stringify(E[_],null," ")+`
|
|
24
|
+
Valid keys: `+JSON.stringify(Object.keys(s),null," "));var u=Y(g,S,h,T,b+"."+S,c);if(u)return u}return null}return $(d)}function H(s){switch(typeof s){case"number":case"string":case"undefined":return!0;case"boolean":return!s;case"object":if(Array.isArray(s))return s.every(H);if(s===null||i(s))return!0;var d=m(s);if(d){var E=d.call(s),_;if(d!==s.entries){for(;!(_=E.next()).done;)if(!H(_.value))return!1}else for(;!(_=E.next()).done;){var h=_.value;if(h&&!H(h[1]))return!1}}else return!1;return!0;default:return!1}}function he(s,d){return s==="symbol"?!0:d?d["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&d instanceof Symbol:!1}function W(s){var d=typeof s;return Array.isArray(s)?"array":s instanceof RegExp?"object":he(d,s)?"symbol":d}function V(s){if(typeof s>"u"||s===null)return""+s;var d=W(s);if(d==="object"){if(s instanceof Date)return"date";if(s instanceof RegExp)return"regexp"}return d}function G(s){var d=V(s);switch(d){case"array":case"object":return"an "+d;case"boolean":case"date":case"regexp":return"a "+d;default:return d}}function ve(s){return!s.constructor||!s.constructor.name?A:s.constructor.name}return I.checkPropTypes=o,I.resetWarningCache=o.resetWarningCache,I.PropTypes=I,I},se}var ce,xe;function Ue(){if(xe)return ce;xe=1;var e=ne();function n(){}function c(){}return c.resetWarningCache=n,ce=function(){function a(l,i,p,v,y,m){if(m!==e){var A=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw A.name="Invariant Violation",A}}a.isRequired=a;function o(){return a}var r={array:a,bigint:a,bool:a,func:a,number:a,object:a,string:a,symbol:a,any:a,arrayOf:o,element:a,elementType:a,instanceOf:o,node:a,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:c,resetWarningCache:n};return r.PropTypes=r,r},ce}var Ae;function ze(){if(Ae)return J.exports;if(Ae=1,process.env.NODE_ENV!=="production"){var e=Te(),n=!0;J.exports=We()(e.isElement,n)}else J.exports=Ue()();return J.exports}var Be=ze();const Z=be(Be),Ie=({content:e,title:n,className:c,id:a="accordion"})=>{const o=q("rpf-accordion",c);return t.jsxs("details",{className:o,id:`${a}`,children:[t.jsxs("summary",{className:"rpf-accordion__title",role:"button",children:[n,t.jsx("span",{className:"rpf-accordion__icon"})]}),t.jsx("p",{className:"rpf-accordion__text",children:e})]})};Ie.propTypes={content:Z.string.isRequired,title:Z.string.isRequired,id:Z.string,className:Z.string};const B=({text:e,href:n,title:c,className:a,type:o="primary",variant:r="",size:l="default",icon:i="",iconOnly:p=!1,iconPosition:v="left",fullWidth:y=!1,disabled:m=!1,onClick:A=()=>{},"aria-label":I="",linkComponent:M})=>{const N=i&&p,$=q("rpf-button",{[`rpf-button--${o}`]:o,"rpf-button--danger":r==="danger","rpf-button--sm":l==="small","rpf-button--icon-only":N,"rpf-button--full-width":y,disabled:m},a);let L="rpf-button__icon";F.isValidElement(i)?(L+=" icon",console.warn("DEPRECATED: icons as React elements will not be supported in future releases")):L+=" material-symbols-sharp";const z=(f,D)=>!D||v!==f?null:typeof D=="string"?t.jsx("span",{className:L,children:D}):D,k=()=>e&&!N&&t.jsx("span",{className:"text",children:e}),j=t.jsxs(t.Fragment,{children:[z("left",i),k(),z("right",i)]});if(n){const f=M||"a",D=M?{to:n}:{href:n,role:"button"};return t.jsx(f,{className:$,...D,onClick:A,"aria-label":I,children:j})}return t.jsx("button",{className:$,title:c,onClick:A,disabled:m,"aria-label":I,children:j})},Ve=({title:e,text:n,titleChildren:c,children:a,type:o,actions:r,onClose:l})=>t.jsxs("div",{className:`rpf-alert rpf-alert--${o}`,children:[t.jsxs("div",{className:"rpf-alert__header",children:[t.jsx("span",{className:"rpf-alert__icon material-symbols-sharp"}),c?t.jsx("div",{className:"rpf-alert__title",children:c}):e?t.jsx("p",{className:"rpf-alert__title",children:e}):null,!!l&&t.jsx("div",{className:"rpf-alert__close",children:t.jsx(B,{type:"tertiary",icon:"close",size:"small",iconOnly:!0,onClick:l})})]}),(n||a||r)&&t.jsxs("div",{className:"rpf-alert__body",children:[n?t.jsx("p",{children:n}):a?t.jsx("div",{children:a}):null,r&&r.length>0&&t.jsx("div",{className:"rpf-alert__actions",children:r.map((i,p)=>t.jsx(B,{text:i.label,size:"small",type:"tertiary",href:i.href,onClick:i.onClick},p))})]})]}),He=({id:e,label:n,name:c,checked:a=!1,disabled:o=!1,error:r="",onChange:l=()=>{},value:i="",className:p=""})=>t.jsxs(t.Fragment,{children:[t.jsxs("label",{className:q("rpf-input-checkbox",{"rpf-input-checkbox--error":r,className:p}),children:[t.jsx("input",{checked:!!a,disabled:o,id:e,name:c,onChange:l,type:"checkbox",value:i}),n]}),r&&t.jsxs("div",{className:"rpf-error-message",children:[t.jsx("span",{className:"rpf-error-message__icon material-symbols-sharp",children:"error"}),r]})]}),Je=({disabled:e=!1,errorText:n="",fullWidth:c=!1,legendText:a,legendHintText:o="",children:r})=>t.jsxs("fieldset",{className:q("rpf-fieldset",{"rpf-fieldset--disabled":e,"rpf-fieldset--full-width":c,"rpf-fieldset--error":n}),disabled:e,children:[t.jsxs("legend",{className:"rpf-label",children:[a,o.length>0?t.jsx("small",{className:"rpf-label__hint",children:o}):null]}),t.jsx("div",{className:"rpf-fieldset__inputs",children:r}),n.length>0?t.jsxs("div",{className:"rpf-error-message",children:[t.jsx("span",{className:"rpf-error-message__icon material-symbols-sharp",children:"error"}),n]}):null]}),K=({id:e,label:n,children:c,disabled:a=!1,error:o="",hint:r=""})=>t.jsxs("div",{className:"rpf-input-field",children:[(n||r)&&t.jsxs("label",{htmlFor:e,className:q("rpf-label",{"rpf-label--disabled":a}),children:[n,t.jsx("small",{className:"rpf-label__hint",children:r})]}),c,o&&t.jsxs("div",{className:"rpf-error-message",children:[t.jsx("span",{className:"rpf-error-message__icon material-symbols-sharp",children:"error"}),o]})]}),Re=({label:e,inputFieldId:n,disabled:c=!1,hint:a=""})=>t.jsx("div",{className:"rpf-label",children:t.jsxs("label",{htmlFor:n,className:q("rpf-label",{"rpf-label--disabled":c}),children:[e,a&&t.jsx("div",{className:"rpf-label__hint",children:a})]})}),Ze=({id:e,label:n,name:c,checked:a=!1,disabled:o=!1,fullWidth:r=!1,onChange:l=()=>{},value:i=""})=>t.jsxs("label",{className:q("rpf-input-radio",{"rpf-input-radio--disabled":o,"rpf-input--full-width":r}),children:[t.jsx("input",{checked:!!a,disabled:o,id:e,name:c,onChange:l,type:"radio",value:i}),n]}),Ke=({label:e,inputFieldId:n,disabled:c=!1,error:a="",hint:o="",placeholder:r="",defaultValue:l="",onClick:i=()=>{},onChange:p=()=>{}})=>t.jsx("search",{children:t.jsxs("form",{className:"rpf-input-field",onSubmit:i,children:[t.jsxs("label",{htmlFor:n,className:q("rpf-label",{"rpf-label--disabled":c}),children:[e,o&&t.jsx("small",{className:"rpf-label__hint",children:o})]}),t.jsxs("div",{className:"rpf-input-search-container",children:[t.jsx("input",{className:q("rpf-input rpf-input-search",{"rpf-input--disabled":c,"rpf-input--error":a}),disabled:c,id:n,name:"search",type:"search","aria-label":"Search",defaultValue:l,placeholder:r,onChange:p}),t.jsx("button",{type:"submit",className:q("rpf-button rpf-button-search",{"rpf-button--disabled":c,"rpf-button--error":a}),disabled:c,onClick:i,children:t.jsx("span",{className:"rpf-button__icon material-symbols-sharp",children:"search"})})]}),a&&t.jsxs("div",{className:"rpf-error-message",children:[t.jsx("span",{className:"rpf-error-message__icon material-symbols-sharp",children:"info"}),a]})]})}),Xe=({id:e,label:n,name:c,options:a,disabled:o=!1,error:r="",fullWidth:l=!1,hint:i="",onChange:p=()=>{},placeholder:v="",value:y=""})=>t.jsx(K,{id:e,disabled:o,error:r,hint:i,label:n,children:t.jsxs("select",{className:q("rpf-input rpf-input-select",{"rpf-input--error":r,"rpf-input--full-width":l}),disabled:o,id:e,name:c,onChange:p,value:y,children:[!y&&!!v&&t.jsx("option",{value:"",disabled:!0,children:v}),a.map(m=>t.jsx("option",{value:m.key,children:m.value},m.key))]})}),Ge=({id:e,label:n,name:c,value:a,disabled:o=!1,readOnly:r=!1,error:l="",fullWidth:i=!1,hint:p="",onChange:v=()=>{}})=>t.jsx(K,{id:e,disabled:o,error:l,hint:p,label:n,children:t.jsx("textarea",{className:q("rpf-input rpf-input-textarea",{"rpf-input--error":l,"rpf-input--full-width":i,"rpf-input--disabled":o}),disabled:o,readOnly:r,id:e,name:c,onChange:v,value:a})}),Qe=({id:e,label:n,name:c,value:a,disabled:o=!1,error:r="",fullWidth:l=!1,hint:i="",onChange:p=()=>{}})=>t.jsx(K,{id:e,disabled:o,error:r,hint:i,label:n,children:t.jsx("input",{className:q("rpf-input rpf-input-text",{"rpf-input--error":r,"rpf-input--full-width":l}),disabled:o,id:e,name:c,onChange:p,type:"text",value:a})});function er(e,n){const c=F.useRef(null),a=F.useRef(null);return F.useEffect(()=>{const o=c.current;o&&(e&&!o.open?o.showModal():!e&&o.open&&o.close())},[e]),F.useEffect(()=>{const o=c.current;if(!o)return;const r=()=>n(!1),l=i=>{i.preventDefault(),n(!1)};return o.addEventListener("close",r),o.addEventListener("cancel",l),()=>{o.removeEventListener("close",r),o.removeEventListener("cancel",l)}},[n]),F.useEffect(()=>{const o=c.current,r=a.current;if(!o||!r)return;const l=i=>{e&&!r.contains(i.target)&&n(!1)};return o.addEventListener("mousedown",l),()=>o.removeEventListener("mousedown",l)},[e,n]),{dialogRef:c,contentRef:a}}const rr=({isOpen:e,setIsOpen:n,heading:c,children:a,primaryButtonLink:o,primaryButtonText:r,onClickPrimaryButton:l,secondaryButtonText:i,secondaryButtonLink:p,onClickSecondaryButton:v,tertiaryButtonText:y,tertiaryButtonLink:m,onClickTertiaryButton:A,showCloseButton:I=!0})=>{const{dialogRef:M,contentRef:N}=er(e,n);return t.jsx("dialog",{ref:M,className:"rpf-modal","aria-labelledby":"modal-heading","aria-describedby":"modal-description",children:t.jsxs("div",{ref:N,className:"rpf-modal__wrapper",children:[t.jsxs("div",{className:"rpf-modal__header",children:[t.jsx("h2",{className:"rpf-modal__title",id:"modal-heading",children:c}),I&&t.jsx(B,{icon:"close",iconOnly:!0,"aria-label":"Close modal",type:"tertiary",onClick:()=>n(!1)})]}),t.jsx("div",{id:"modal-description",className:"rpf-modal__content",tabIndex:0,children:a}),t.jsxs("div",{className:"rpf-modal__buttons",children:[t.jsx(B,{text:r,href:o,onClick:l,type:"primary"}),i&&t.jsx(B,{text:i,href:p,onClick:v,type:"secondary"}),y&&t.jsx(B,{text:y,href:m,onClick:A,type:"tertiary"})]})]})})},tr=({text:e="",percent:n,complete:c=!1,className:a})=>t.jsx("div",{className:q("rpf-progress-bar",{"rpf-progress-bar--complete":c,className:a}),children:t.jsxs("label",{className:"rpf-progress-bar__label",children:[t.jsx("span",{children:e}),t.jsx("progress",{className:"rpf-progress-bar__bar",value:n,max:"100",children:`${n}%`})]})}),nr=({children:e})=>t.jsx("td",{className:"rpf-table-cell rpf-table-cell--body",children:t.jsx("div",{className:"rpf-table-cell__content",children:e})});/**
|
|
25
|
+
* @license lucide-react v0.553.0 - ISC
|
|
26
|
+
*
|
|
27
|
+
* This source code is licensed under the ISC license.
|
|
28
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
29
|
+
*/const ar=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),or=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,c,a)=>a?a.toUpperCase():c.toLowerCase()),je=e=>{const n=or(e);return n.charAt(0).toUpperCase()+n.slice(1)},$e=(...e)=>e.filter((n,c,a)=>!!n&&n.trim()!==""&&a.indexOf(n)===c).join(" ").trim(),sr=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0};/**
|
|
30
|
+
* @license lucide-react v0.553.0 - ISC
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the ISC license.
|
|
33
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/var cr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
35
|
+
* @license lucide-react v0.553.0 - ISC
|
|
36
|
+
*
|
|
37
|
+
* This source code is licensed under the ISC license.
|
|
38
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
39
|
+
*/const ir=F.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:c=2,absoluteStrokeWidth:a,className:o="",children:r,iconNode:l,...i},p)=>F.createElement("svg",{ref:p,...cr,width:n,height:n,stroke:e,strokeWidth:a?Number(c)*24/Number(n):c,className:$e("lucide",o),...!r&&!sr(i)&&{"aria-hidden":"true"},...i},[...l.map(([v,y])=>F.createElement(v,y)),...Array.isArray(r)?r:[r]]));/**
|
|
40
|
+
* @license lucide-react v0.553.0 - ISC
|
|
41
|
+
*
|
|
42
|
+
* This source code is licensed under the ISC license.
|
|
43
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
44
|
+
*/const ie=(e,n)=>{const c=F.forwardRef(({className:a,...o},r)=>F.createElement(ir,{ref:r,iconNode:n,className:$e(`lucide-${ar(je(e))}`,`lucide-${e}`,a),...o}));return c.displayName=je(e),c};/**
|
|
45
|
+
* @license lucide-react v0.553.0 - ISC
|
|
46
|
+
*
|
|
47
|
+
* This source code is licensed under the ISC license.
|
|
48
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
49
|
+
*/const lr=ie("arrow-down-up",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"m21 8-4-4-4 4",key:"1c9v7m"}],["path",{d:"M17 4v16",key:"7dpous"}]]);/**
|
|
50
|
+
* @license lucide-react v0.553.0 - ISC
|
|
51
|
+
*
|
|
52
|
+
* This source code is licensed under the ISC license.
|
|
53
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
+
*/const fr=ie("arrow-down-wide-narrow",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]]);/**
|
|
55
|
+
* @license lucide-react v0.553.0 - ISC
|
|
56
|
+
*
|
|
57
|
+
* This source code is licensed under the ISC license.
|
|
58
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
+
*/const ur=ie("arrow-up-narrow-wide",[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M11 12h4",key:"q8tih4"}],["path",{d:"M11 16h7",key:"uosisv"}],["path",{d:"M11 20h10",key:"jvxblo"}]]),dr=(e,n)=>{if(e)return n==="up"?"ascending":n==="down"?"descending":"none"},pr=({sortDirection:e,children:n,onClick:c})=>{const a=!!c,o=e==="up"?ur:e==="down"?fr:lr,r=dr(a,e),l=a?"rpf-table-cell--sortable-header":"rpf-table-cell--header";return t.jsx("th",{className:`rpf-table-cell ${l}`,"aria-sort":r,children:t.jsx("div",{className:"rpf-table-cell__content",children:a?t.jsxs("button",{className:"rpf-table-cell__sort-header",onClick:c,children:[n,t.jsx(o,{size:20})]}):t.jsx(t.Fragment,{children:n})})})},yr=({headerRow:e,bodyRows:n,fullWidth:c})=>t.jsx("div",{"data-testid":"table-container",className:q("rpf-table",{"rpf-table--full-width":c}),children:t.jsxs("table",{className:q("rpf-table__table",{"rpf-table__table--full-width":c}),children:[t.jsx("thead",{children:t.jsx("tr",{className:"rpf-table-row",children:e})}),t.jsx("tbody",{children:n.map((a,o)=>t.jsx("tr",{className:"rpf-table-row",children:a},o))})]})}),hr=({text:e,variant:n,secondary:c,icon:a,iconPosition:o})=>{const r=a?t.jsx("span",{className:"rpf-tag__icon material-symbols-sharp",children:a}):null;a&&!o&&(o="left");const l=n&&n!=="default"?`rpf-tag--${n}`:null;return t.jsxs("span",{className:q("rpf-tag",l,{"rpf-tag--secondary":c}),children:[o==="left"&&r,e,o==="right"&&r]})};x.Accordion=Ie,x.Alert=Ve,x.Button=B,x.CheckboxInput=He,x.Fieldset=Je,x.InputField=K,x.InputLabel=Re,x.Modal=rr,x.ProgressBar=tr,x.RadioInput=Ze,x.SearchInput=Ke,x.SelectInput=Xe,x.Table=yr,x.TableBodyCell=nr,x.TableHeaderCell=pr,x.Tag=hr,x.TextInput=Qe,x.TextareaInput=Ge,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
|
package/dist/types/lib/main.d.ts
CHANGED
|
@@ -6,14 +6,21 @@ export type { ButtonProps } from "../src/components/Button/Button.types";
|
|
|
6
6
|
export { default as CheckboxInput } from "../src/components/Form/CheckboxInput";
|
|
7
7
|
export type { CheckboxInputProps } from "../src/components/Form/CheckboxInput/CheckboxInput.types";
|
|
8
8
|
export { default as Fieldset } from "../src/components/Form/Fieldset";
|
|
9
|
+
export type { FieldSetProps } from "../src/components/Form/Fieldset/FieldSet.types";
|
|
9
10
|
export { default as InputField } from "../src/components/Form/InputField";
|
|
11
|
+
export type { InputFieldProps } from "../src/components/Form/InputField/InputField.types";
|
|
10
12
|
export { default as InputLabel } from "../src/components/Form/InputLabel";
|
|
13
|
+
export type { InputLabelProps } from "../src/components/Form/InputLabel/InputLabel.types";
|
|
11
14
|
export { default as RadioInput } from "../src/components/Form/RadioInput";
|
|
15
|
+
export type { RadioInputProps } from "../src/components/Form/RadioInput/RadioInput.types";
|
|
12
16
|
export { default as SearchInput } from "../src/components/Form/SearchInput";
|
|
13
17
|
export type { SearchInputProps } from "../src/components/Form/SearchInput/SearchInput.types";
|
|
14
18
|
export { default as SelectInput } from "../src/components/Form/SelectInput";
|
|
19
|
+
export type { SelectInputProps } from "../src/components/Form/SelectInput/SelectInput.types";
|
|
15
20
|
export { default as TextareaInput } from "../src/components/Form/TextareaInput";
|
|
21
|
+
export type { TextareaInputProps } from "../src/components/Form/TextareaInput/TextareaInput.types";
|
|
16
22
|
export { default as TextInput } from "../src/components/Form/TextInput";
|
|
23
|
+
export type { TextInputProps } from "../src/components/Form/TextInput/TextInput.types";
|
|
17
24
|
export { default as Modal } from "../src/components/Modal";
|
|
18
25
|
export type { ModalProps } from "../src/components/Modal/Modal.types";
|
|
19
26
|
export { default as ProgressBar } from "../src/components/ProgressBar";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../lib/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC3D,YAAY,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAC7D,YAAY,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAChF,YAAY,EAAE,kBAAkB,EAAE,MAAM,0DAA0D,CAAC;AACnG,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAC5E,YAAY,EAAE,gBAAgB,EAAE,MAAM,sDAAsD,CAAC;AAC7F,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC3D,YAAY,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACvE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iDAAiD,CAAC;AACxF,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAChF,YAAY,EAAE,eAAe,EAAE,MAAM,qDAAqD,CAAC;AAC3F,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACjE,YAAY,EAAE,UAAU,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,uBAAuB,CAAC;AACvD,YAAY,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC"}
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../lib/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC3D,YAAY,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAC7D,YAAY,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAChF,YAAY,EAAE,kBAAkB,EAAE,MAAM,0DAA0D,CAAC;AACnG,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AACtE,YAAY,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC1E,YAAY,EAAE,eAAe,EAAE,MAAM,oDAAoD,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC1E,YAAY,EAAE,eAAe,EAAE,MAAM,oDAAoD,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC1E,YAAY,EAAE,eAAe,EAAE,MAAM,oDAAoD,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAC5E,YAAY,EAAE,gBAAgB,EAAE,MAAM,sDAAsD,CAAC;AAC7F,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAC5E,YAAY,EAAE,gBAAgB,EAAE,MAAM,sDAAsD,CAAC;AAC7F,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAChF,YAAY,EAAE,kBAAkB,EAAE,MAAM,0DAA0D,CAAC;AACnG,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,kCAAkC,CAAC;AACxE,YAAY,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AACvF,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC3D,YAAY,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACvE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iDAAiD,CAAC;AACxF,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAChF,YAAY,EAAE,eAAe,EAAE,MAAM,qDAAqD,CAAC;AAC3F,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACjE,YAAY,EAAE,UAAU,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,uBAAuB,CAAC;AACvD,YAAY,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type FieldSetProps = {
|
|
3
|
+
/** Whether the fieldset is disabled */
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
/** Error message to display */
|
|
6
|
+
errorText?: string;
|
|
7
|
+
/** Whether the component should display at full width */
|
|
8
|
+
fullWidth?: boolean;
|
|
9
|
+
/** Non-optional title text to be displayed in the legend */
|
|
10
|
+
legendText: string;
|
|
11
|
+
/** Hint text to be displayed below the legend title */
|
|
12
|
+
legendHintText?: string;
|
|
13
|
+
/** The main content */
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=FieldSet.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldSet.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/Fieldset/FieldSet.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,aAAa,GAAG;IAC1B,uCAAuC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+BAA+B;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,4DAA4D;IAC5D,UAAU,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uBAAuB;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fieldset.spec.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/Fieldset/Fieldset.spec.
|
|
1
|
+
{"version":3,"file":"Fieldset.spec.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/Fieldset/Fieldset.spec.tsx"],"names":[],"mappings":""}
|
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
fullWidth?: boolean | undefined;
|
|
5
|
-
legendText: any;
|
|
6
|
-
legendHintText?: string | undefined;
|
|
7
|
-
children: any;
|
|
8
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export namespace Fieldset {
|
|
10
|
-
namespace propTypes {
|
|
11
|
-
let disabled: PropTypes.Requireable<boolean>;
|
|
12
|
-
let errorText: PropTypes.Requireable<string>;
|
|
13
|
-
let fullWidth: PropTypes.Requireable<boolean>;
|
|
14
|
-
let legendText: PropTypes.Validator<string>;
|
|
15
|
-
let legendHintText: PropTypes.Requireable<string>;
|
|
16
|
-
let children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
1
|
+
import "./Fieldset.scss";
|
|
2
|
+
import type { FieldSetProps } from "./FieldSet.types";
|
|
3
|
+
export declare const Fieldset: ({ disabled, errorText, fullWidth, legendText, legendHintText, children, }: FieldSetProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
4
|
export default Fieldset;
|
|
20
|
-
import PropTypes from "prop-types";
|
|
21
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/Fieldset/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/Fieldset/index.tsx"],"names":[],"mappings":"AAEA,OAAO,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,eAAO,MAAM,QAAQ,GAAI,2EAOtB,aAAa,4CA4Bf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type InputFieldProps = {
|
|
3
|
+
/** Whether the input field is disabled */
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
/** Error message to display */
|
|
6
|
+
error?: string;
|
|
7
|
+
/** Hint text to be displayed below the title */
|
|
8
|
+
hint?: string;
|
|
9
|
+
/** The label text for the input */
|
|
10
|
+
label: string;
|
|
11
|
+
/** The input field ID */
|
|
12
|
+
id: string;
|
|
13
|
+
/** Any children of the component */
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=InputField.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputField.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/InputField/InputField.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,eAAe,GAAG;IAC5B,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,yBAAyB;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,oCAAoC;IACpC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC"}
|
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
children: any;
|
|
5
|
-
disabled?: boolean | undefined;
|
|
6
|
-
error?: string | undefined;
|
|
7
|
-
hint?: string | undefined;
|
|
8
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export namespace InputField {
|
|
10
|
-
namespace propTypes {
|
|
11
|
-
let disabled: PropTypes.Requireable<boolean>;
|
|
12
|
-
let error: PropTypes.Requireable<string>;
|
|
13
|
-
let hint: PropTypes.Requireable<NonNullable<string | object | null | undefined>>;
|
|
14
|
-
let label: PropTypes.Validator<NonNullable<NonNullable<string | object | null | undefined>>>;
|
|
15
|
-
let id: PropTypes.Validator<string>;
|
|
16
|
-
let children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
1
|
+
import "@/components/MaterialSymbols";
|
|
2
|
+
import type { InputFieldProps } from "./InputField.types";
|
|
3
|
+
export declare const InputField: ({ id, label, children, disabled, error, hint, }: InputFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
4
|
export default InputField;
|
|
20
|
-
import PropTypes from "prop-types";
|
|
21
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/InputField/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/InputField/index.tsx"],"names":[],"mappings":"AAEA,OAAO,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,eAAO,MAAM,UAAU,GAAI,iDAOxB,eAAe,4CAuBjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputLabel.spec.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/InputLabel/InputLabel.spec.
|
|
1
|
+
{"version":3,"file":"InputLabel.spec.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/InputLabel/InputLabel.spec.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type InputLabelProps = {
|
|
2
|
+
/** Whether the InputLabel should show as disabled */
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
/** Optional hint text to display below main label */
|
|
5
|
+
hint?: string;
|
|
6
|
+
/** Text for main label */
|
|
7
|
+
label: string;
|
|
8
|
+
/** ID for the input field */
|
|
9
|
+
inputFieldId: string;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=InputLabel.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputLabel.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/InputLabel/InputLabel.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC5B,qDAAqD;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qDAAqD;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,6BAA6B;IAC7B,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
disabled?: boolean | undefined;
|
|
5
|
-
hint?: string | undefined;
|
|
6
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export namespace InputLabel {
|
|
8
|
-
namespace propTypes {
|
|
9
|
-
let disabled: PropTypes.Requireable<boolean>;
|
|
10
|
-
let hint: PropTypes.Requireable<NonNullable<string | object | null | undefined>>;
|
|
11
|
-
let label: PropTypes.Validator<NonNullable<NonNullable<string | object | null | undefined>>>;
|
|
12
|
-
let inputFieldId: PropTypes.Validator<string>;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
1
|
+
import "./InputLabel.scss";
|
|
2
|
+
import type { InputLabelProps } from "./InputLabel.types";
|
|
3
|
+
export declare const InputLabel: ({ label, inputFieldId, disabled, hint, }: InputLabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
4
|
export default InputLabel;
|
|
16
|
-
import PropTypes from "prop-types";
|
|
17
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/InputLabel/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/InputLabel/index.tsx"],"names":[],"mappings":"AAEA,OAAO,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,eAAO,MAAM,UAAU,GAAI,0CAKxB,eAAe,4CAYjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioInput.spec.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/RadioInput/RadioInput.spec.
|
|
1
|
+
{"version":3,"file":"RadioInput.spec.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/RadioInput/RadioInput.spec.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type RadioInputProps = {
|
|
2
|
+
/** Whether the radio input is checked or not */
|
|
3
|
+
checked?: boolean;
|
|
4
|
+
/** Whether the input is disabled */
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
/** Whether the radio input is full width */
|
|
7
|
+
fullWidth?: boolean;
|
|
8
|
+
/** The radio input id */
|
|
9
|
+
id: string;
|
|
10
|
+
/** The label text for the radio input */
|
|
11
|
+
label: string;
|
|
12
|
+
/** Name attribute for the radio input */
|
|
13
|
+
name: string;
|
|
14
|
+
/** On change handler */
|
|
15
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
16
|
+
/** Value attribute for the radio input */
|
|
17
|
+
value?: string;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=RadioInput.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioInput.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/RadioInput/RadioInput.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC5B,gDAAgD;IAChD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,yBAAyB;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,wBAAwB;IACxB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAChE,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
|
@@ -1,25 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
name: any;
|
|
5
|
-
checked?: boolean | undefined;
|
|
6
|
-
disabled?: boolean | undefined;
|
|
7
|
-
fullWidth?: boolean | undefined;
|
|
8
|
-
onChange?: (() => void) | undefined;
|
|
9
|
-
value?: string | undefined;
|
|
10
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export namespace RadioInput {
|
|
12
|
-
namespace propTypes {
|
|
13
|
-
let checked: PropTypes.Requireable<boolean>;
|
|
14
|
-
let disabled: PropTypes.Requireable<boolean>;
|
|
15
|
-
let fullWidth: PropTypes.Requireable<boolean>;
|
|
16
|
-
let id: PropTypes.Validator<string>;
|
|
17
|
-
let label: PropTypes.Validator<NonNullable<NonNullable<string | object | null | undefined>>>;
|
|
18
|
-
let name: PropTypes.Validator<string>;
|
|
19
|
-
let onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
20
|
-
let value: PropTypes.Requireable<string>;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
1
|
+
import "./RadioInput.scss";
|
|
2
|
+
import type { RadioInputProps } from "./RadioInput.types";
|
|
3
|
+
export declare const RadioInput: ({ id, label, name, checked, disabled, fullWidth, onChange, value, }: RadioInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
4
|
export default RadioInput;
|
|
24
|
-
import PropTypes from "prop-types";
|
|
25
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/RadioInput/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/RadioInput/index.tsx"],"names":[],"mappings":"AAEA,OAAO,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,eAAO,MAAM,UAAU,GAAI,qEASxB,eAAe,4CAkBjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -14,7 +14,7 @@ export type SearchInputProps = {
|
|
|
14
14
|
/** The default input value */
|
|
15
15
|
defaultValue?: string;
|
|
16
16
|
/** Click handler */
|
|
17
|
-
onClick: () => void;
|
|
17
|
+
onClick: (event?: React.MouseEvent<HTMLButtonElement> | React.FormEvent<HTMLFormElement>) => void;
|
|
18
18
|
/** On change handler */
|
|
19
19
|
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
20
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchInput.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/SearchInput/SearchInput.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchInput.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/SearchInput/SearchInput.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,yBAAyB;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8BAA8B;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB;IACpB,OAAO,EAAE,CACP,KAAK,CAAC,EACF,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,GACnC,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC,KACjC,IAAI,CAAC;IACV,wBAAwB;IACxB,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CAChE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInput.spec.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/SelectInput/SelectInput.spec.
|
|
1
|
+
{"version":3,"file":"SelectInput.spec.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/SelectInput/SelectInput.spec.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export type SelectInputProps = {
|
|
2
|
+
/** Whether the select input is disabled */
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
/** Error message to display */
|
|
5
|
+
error?: string;
|
|
6
|
+
/** Hint text to be displayed below the title */
|
|
7
|
+
hint?: string;
|
|
8
|
+
/** The label text for the select input */
|
|
9
|
+
label: string;
|
|
10
|
+
/** The select input field ID */
|
|
11
|
+
id: string;
|
|
12
|
+
/** Whether the select input is full width */
|
|
13
|
+
fullWidth?: boolean;
|
|
14
|
+
/** Name attribute for the select input */
|
|
15
|
+
name: string;
|
|
16
|
+
/** Callback function when input state changes */
|
|
17
|
+
onChange?: (e: React.ChangeEvent<HTMLSelectElement>) => void;
|
|
18
|
+
/** Options to populate the select input dropdown menu */
|
|
19
|
+
options: Array<SelectOption>;
|
|
20
|
+
/** Optional placeholder string to display when no input chosen */
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
/** Value attribute for the select input */
|
|
23
|
+
value?: string;
|
|
24
|
+
};
|
|
25
|
+
type SelectOption = {
|
|
26
|
+
key: string;
|
|
27
|
+
value: string;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=SelectInput.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectInput.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/SelectInput/SelectInput.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,6CAA6C;IAC7C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC7D,0DAA0D;IAC1D,OAAO,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;IAC7B,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
|