@planningcenter/tapestry-react 4.11.3 → 4.11.4-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +1 -1
- package/dist/Select/Select.d.ts +2 -0
- package/dist/Select/Select.d.ts.map +1 -1
- package/dist/Select/Select.js +1 -1
- package/dist/designTokens/index.d.ts +1 -1
- package/dist/system/colors/colors.d.ts +5 -5
- package/dist/system/colors/colors.js +1 -1
- package/dist/system/default-theme.d.ts +5 -3
- package/dist/system/default-theme.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,IAAI,MAAM,SAAS,CAAA;AAG1B,OAAO,EAAa,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAE9D,OAAO,OAAO,MAAM,YAAY,CAAA;AAChC,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAE1E,OAAO,KAAK,MAAM,SAAS,CAAA;AAE3B,UAAU,KAAK;IAIb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAKlB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAKlB,YAAY,CAAC,EAAE,MAAM,CAAA;IAKrB,IAAI,CAAC,EAAE,MAAM,CAAA;IAMb,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,CAAA;IAKjD,QAAQ,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,CAAA;IAKrD,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,CAAA;IA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iBAAiB,GAAG,KAAK,GAAG,IAAI,CAAC,oBAAoB,EAAE,MAAM,KAAK,CAAC,CAAA;AACxE,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,EAAE,GAAG,QAAQ,GAAG,GAAG,IAAI,OAAO,CAC9D,CAAC,EACD,iBAAiB,CAClB,GACC,YAAY,CAAC,OAAO,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAA;AAEtC,wBAAgB,MAAM,CAAC,CAAC,SAAS,EAAE,GAAG,QAAQ,GAAG,GAAG,EAAE,EACpD,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,OAAO,EACP,SAAS,EACT,IAAI,EACJ,OAAO,EACP,MAAM,EACN,KAAiB,EACjB,KAAK,EACL,EAAE,EACF,OAAO,EAAE,kBAAkB,EAC3B,IAAe,EACf,OAAO,EACP,YAAY,EAAE,oBAAoB,EAClC,GAAG,SAAS,EACb,EAAE,WAAW,CAAC,CAAC,CAAC,eAsRhB;yBA1Se,MAAM;;;;;;;;;;;;;;;AA8StB,MAAM,WAAW,MAAM,CAAC,CAAC,SAAS,EAAE,GAAG,QAAQ,GAAG,GAAG,CACnD,SAAQ,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/D,KAAK,EAAE,OAAO,KAAK,CAAA;CACpB"}
|
package/dist/Button/Button.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as e,__assign as t}from'./../ext/tslib/tslib.es6.js';import o from"react";import{designTokens as i}from"../designTokens/index.js";import{useAccessibilityViolation as n}from"../hooks/use-accessibility-violation.js";import r from"../Icon/Icon.js";import{Link as a}from"../Link/Link.js";import{Spinner as l}from"../Spinner/Spinner.js";import{StackView as s}from"../StackView/StackView.js";import{useThemeValue as c,useBoxSize as p}from"../system/utils.js";import d from"../Tooltip/Tooltip.js";import{mergeProps as u}from"../utils.js";import f from"./Input.js";function m(f){var m,h=f.children,g=f.disabled,b=f.external,y=f.icon,v=f.iconLeft,k=f.iconRight,z=f.onClick,w=f.onKeyDown,x=f.size,E=f.spinner,j=f.square,V=f.theme,D=void 0===V?"default":V,C=f.title,I=f.to,R=f.tooltip,S=f.type,T=void 0===S?"button":S,H=f.variant,L=f.focusVisible,P=e(f,["children","disabled","external","icon","iconLeft","iconRight","onClick","onKeyDown","size","spinner","square","theme","title","to","tooltip","type","variant","focusVisible"]),K=c("button.themes"),W=p(x),A
|
|
1
|
+
import{__rest as e,__assign as t}from'./../ext/tslib/tslib.es6.js';import o from"react";import{designTokens as i}from"../designTokens/index.js";import{useAccessibilityViolation as n}from"../hooks/use-accessibility-violation.js";import r from"../Icon/Icon.js";import{Link as a}from"../Link/Link.js";import{Spinner as l}from"../Spinner/Spinner.js";import{StackView as s}from"../StackView/StackView.js";import{useThemeValue as c,useBoxSize as p}from"../system/utils.js";import d from"../Tooltip/Tooltip.js";import{mergeProps as u}from"../utils.js";import f from"./Input.js";function m(f){var m,h=f.children,g=f.disabled,b=f.external,y=f.icon,v=f.iconLeft,k=f.iconRight,z=f.onClick,w=f.onKeyDown,x=f.size,E=f.spinner,j=f.square,V=f.theme,D=void 0===V?"default":V,C=f.title,I=f.to,R=f.tooltip,S=f.type,T=void 0===S?"button":S,H=f.variant,L=f.focusVisible,P=e(f,["children","disabled","external","icon","iconLeft","iconRight","onClick","onKeyDown","size","spinner","square","theme","title","to","tooltip","type","variant","focusVisible"]),K=c("button.themes"),W=H||"fill",A=p(x),_=A.boxSize,q=A.fontSize,B=A.lineHeight,N=A.paddingHorizontal,F=A.paddingHorizontalDense,O=A.paddingVertical,G={alignment:"center",as:P.href||I?"a":"button",axis:"horizontal",distribution:"center",focusVisible:L,fontSize:q,fontWeight:700,inline:!0,lineHeight:B,position:"relative",radius:i.button.borderRadius,strokeAlign:"inside",strokeWeight:1,type:T,userSelect:"none",zIndex:1};if(D&&"boolean"!=typeof D){var J=K[D];if(J){var M=J[W];if(M){M.disabled;var Q=e(M,["disabled"]);G=t(t({},G),Q)}else console.warn('Could not find "'.concat(W,'" in "').concat(D,'" theme. Check your ThemeProvider and make sure "').concat(W,'" variant exists in "').concat(D,'".'))}else"false"===D?console.warn('The string "false" is not a valid theme. Please pass a boolean %cfalse%c instead.',"color:red","color:inherit"):console.warn('Could not find "'.concat(D,'" in button.themes. Check your ThemeProvider and make sure "').concat(D,'" exists.'))}"string"==typeof y&&(y={name:y}),"string"==typeof v&&(v={name:v}),"string"==typeof k&&(k={name:k});var U="string"==typeof R?{title:R}:R;if(y&&(N=F,G["aria-label"]=U?U.title:C),j?(G.width=_,G.height=_):y&&(G.minWidth=_,G.minHeight=_),"pill"===P.radius?G.paddingHorizontal=1.25*N:"pill-left"===P.radius?(G.paddingLeft=1.25*N,G.paddingRight=N):"pill-right"===P.radius?(G.paddingLeft=N,G.paddingRight=1.25*N):(!y||v||k)&&(G.paddingHorizontal=N,G.paddingVertical=O),E&&(m=G.color,G.color="transparent",y&&(y.color="transparent"),v&&(v.color="transparent"),k&&(k.color="transparent")),g&&"boolean"!=typeof D){var X=K[D];if(X){var Y=X[W];Y&&Y.disabled?G=t(t({},G),Y.disabled):G.opacity=.65}G["aria-disabled"]=!0,G.cursor="not-allowed",G.onClick=function(e){return e.preventDefault()},G.onKeyDown=function(e){"Enter"!==e.key&&" "!==e.key||e.preventDefault()}}if(g||E?(G.hover=void 0,G.active=void 0):(G.focus=t({zIndex:5},G.focus),G.cursor="pointer",G.touchAction="manipulation",G.onClick=z,G.onKeyDown=function(e){!z||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),z(e)),w&&w(e)}),b&&(G.rel="noopener noreferrer",G.target="_blank"),I&&(P.href=I),(I||P.href)&&(G=t(t({},G),{type:null})),"outline"===W&&(G=t(t({},G),{hover:t({strokeAlign:"inside",strokeWeight:1,zIndex:2},G.hover)})),P.as&&(G.to=I,"button"!==P.as&&(G=t(t({},G),{type:null}))),"production"!==process.env.NODE_ENV){if(y&&!(C||U&&U.title)){var Z=n(o.createElement(o.Fragment,null,"Icon only buttons must define either a"," ",o.createElement(a,{external:!0,to:"https://planningcenter.github.io/tapestry-react/button#tooltip",weight:700},"tooltip")," ","or"," ",o.createElement(a,{external:!0,to:"https://planningcenter.github.io/tapestry-react/button#title",weight:700},"title")," ","prop."),'Tapestry-React: <Button/> icon only buttons must define either a "tooltip" or "title" prop for proper accessibility.'),$=Z.tooltipProps,ee=Z.wrapperProps;U=$,P=u(P,ee)}G.type&&P.as&&"button"!==P.as&&console.log("Tapestry-React: <Button/> type prop is only supported by <button> and not <".concat(P.as,">."))}var te=G.focusVisible,oe=e(G,["focusVisible"]);return o.createElement(d,t({},U),o.createElement(s,t({},oe,P,{css:t(t({},P.css),{"&:focus-visible":te})}),v&&o.createElement(r,t({size:x,color:G.color,marginRight:F},v)),y?o.createElement(r,t({size:x,color:G.color},y)):C||h,k&&o.createElement(r,t({size:x,color:G.color,marginLeft:F},k)),E&&o.createElement(l,t({size:x,color:m},E,{center:!0}))))}m.Input=f;export{m as Button};
|
|
2
2
|
//# sourceMappingURL=Button.js.map
|
package/dist/Select/Select.d.ts
CHANGED
|
@@ -66,6 +66,7 @@ declare class Select<V extends Value | Value[] = Value | Value[], IsMultiple ext
|
|
|
66
66
|
itemList: ItemList;
|
|
67
67
|
id: string;
|
|
68
68
|
canCallFocus: boolean;
|
|
69
|
+
private mounted;
|
|
69
70
|
contextValue: {
|
|
70
71
|
canSelectOption: {
|
|
71
72
|
current: boolean;
|
|
@@ -78,6 +79,7 @@ declare class Select<V extends Value | Value[] = Value | Value[], IsMultiple ext
|
|
|
78
79
|
selectedOptions: any[];
|
|
79
80
|
uncontrolledValue: any[] | (IsMultiple extends true ? V[] : V);
|
|
80
81
|
};
|
|
82
|
+
safeSetState: (state: any, callback?: any) => void;
|
|
81
83
|
componentDidMount(): void;
|
|
82
84
|
componentDidUpdate(): void;
|
|
83
85
|
componentWillUnmount(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AA;IACvB,OAAO,EAAE,OAAO,QAAQ,CAAA;IACxB,QAAQ,EAAE,QAAQ,CAAA;IAElB,EAAE,SAAuB;IAEzB,YAAY,UAAO;IACnB,OAAO,CAAC,OAAO,CAAQ;IAEvB,YAAY;;;;;MAKX;IAED,KAAK;;;;;MAUJ;IAED,YAAY,uCAIX;IAED,iBAAiB;IAQjB,kBAAkB;IAMlB,oBAAoB;IAQpB,kBAAkB,aAEjB;IAED,oBAAoB,aAEnB;IAED,YAAY;IAIZ,WAAW,kCAiBV;IAED,YAAY,aAMX;IAED,aAAa,aAUZ;IAED,kBAAkB;IAmBlB,wBAAwB,CAAC,KAAK,KAAA;IAM9B,QAAQ,YAaP;IAED,oBAAoB,sBAQnB;IAED,WAAW,yBAYV;IAED,YAAY,sBAuBX;IAED,4BAA4B,aAO3B;IAED,2BAA2B,aAS1B;IAED,UAAU,aAQT;IAED,MAAM;CA8PP;AAQD,eAAe,MAAM,CAAA"}
|
package/dist/Select/Select.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__extends as e,__spreadArray as t,__rest as n,__assign as o}from'./../ext/tslib/tslib.es6.js';import r from"lodash/isEqual";import i,{Component as l}from"react";import a from"../FocusGroup/FocusGroup.js";import u from"../Icon/Icon.js";import c from"../Input/Input.js";import p from"../ItemList/ItemList.js";import s from"../ItemList/ItemListController.js";import"../ItemList/ItemListItem.js";import d from"../Menu/Menu.js";import{Popover as f}from"../Popover/Popover.js";import m from"../Tooltip/Tooltip.js";import{joinChildren as b,generateId as v,isArray as g,isValueInArray as h,shallowEqual as O}from"../utils.js";import{SELECT_DISPLAY_NAME as y}from"./constants.js";import P from"./Context.js";import S from"./Inline.js";import w from"./Option.js";import j from"./OptionGroup.js";import{toggleValue as V,optionsToElements as I,getSelectedOptions as x,renderOptions as C}from"./utils.js";import L from"./Value.js";function k(e){return i.createElement(d,o({},e,{as:"ul"}))}var E=function(l){function d(){var e=null!==l&&l.apply(this,arguments)||this;return Object.defineProperty(e,"input",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(e,"popover",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(e,"itemList",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(e,"id",{enumerable:!0,configurable:!0,writable:!0,value:v("select")}),Object.defineProperty(e,"canCallFocus",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(e,"contextValue",{enumerable:!0,configurable:!0,writable:!0,value:{canSelectOption:{current:!1},multiple:e.props.multiple}}),Object.defineProperty(e,"state",{enumerable:!0,configurable:!0,writable:!0,value:{isPopoverOpen:e.props.defaultOpen,isPopoverVisible:!1,selectedOptions:[],uncontrolledValue:void 0===e.props.defaultValue?e.props.multiple?[]:null:e.props.defaultValue}}),Object.defineProperty(e,"addUserSelectStyle",{enumerable:!0,configurable:!0,writable:!0,value:function(){document.body.style.webkitUserSelect="none"}}),Object.defineProperty(e,"clearUserSelectStyle",{enumerable:!0,configurable:!0,writable:!0,value:function(){document.body.style.webkitUserSelect=""}}),Object.defineProperty(e,"openPopover",{enumerable:!0,configurable:!0,writable:!0,value:function(t){t&&(setTimeout((function(){e.contextValue.canSelectOption.current=!0}),300),setTimeout((function(){var t=e.state.selectedOptions;t.length>0&&e.itemList.scrollItemIntoViewByIndex(t[0].index)}))),e.setState({isPopoverOpen:!0,isPopoverVisible:t})}}),Object.defineProperty(e,"closePopover",{enumerable:!0,configurable:!0,writable:!0,value:function(){e.contextValue.canSelectOption.current=!1,e.setState({isPopoverOpen:!1,isPopoverVisible:!1}),e.itemList&&e.itemList.clearHighlightedIndex()}}),Object.defineProperty(e,"togglePopover",{enumerable:!0,configurable:!0,writable:!0,value:function(){e.state.isPopoverVisible&&e.state.isPopoverOpen?e.closePopover():e.openPopover(!0)}}),Object.defineProperty(e,"getValue",{enumerable:!0,configurable:!0,writable:!0,value:function(){if(e.state.selectedOptions.length>0){var t=e.isControlled()?e.props.value:e.state.uncontrolledValue;return e.props.renderValue(g(t)?e.getSortedSelectedOptions(t):e.state.selectedOptions)}return e.props.emptyValue}}),Object.defineProperty(e,"getHiddenInputValues",{enumerable:!0,configurable:!0,writable:!0,value:function(){var t=e.props.name,n=e.state.selectedOptions;return t&&n.length>0?n.map((function(e,n){return i.createElement("input",{key:n,name:t,type:"hidden",value:e.value})})):null}}),Object.defineProperty(e,"getSelected",{enumerable:!0,configurable:!0,writable:!0,value:function(t){var n=e.props.value,o=e.state.uncontrolledValue;return e.isControlled()?"function"==typeof n?n(t):g(n)?h(n,t)>-1:n===t:g(o)?h(o,t)>-1:o===t}}),Object.defineProperty(e,"handleSelect",{enumerable:!0,configurable:!0,writable:!0,value:function(t){var n=e.props,o=n.multiple,r=n.value,i=t;e.isControlled()?g(r)&&(i=d.toggleValue(e.props.value,t)):(o&&(i=d.toggleValue(e.state.uncontrolledValue,t)),e.setState({uncontrolledValue:i},e.setSelectedOptions)),e.props.onChange&&e.props.onChange({selectedValue:t,value:i}),!o&&e.state.isPopoverVisible&&e.focusInput()}}),Object.defineProperty(e,"highlightFirstSelectedOption",{enumerable:!0,configurable:!0,writable:!0,value:function(){var t=e.state.selectedOptions;t.length>0?e.itemList.setHighlightedIndex(t[0].index):e.itemList.moveHighlightedIndex(1,{contain:!0})}}),Object.defineProperty(e,"highlightLastSelectedOption",{enumerable:!0,configurable:!0,writable:!0,value:function(){var t=e.state.selectedOptions;t.length>0?e.itemList.setHighlightedIndex(t[Math.max(0,t.length-1)].index):e.itemList.moveHighlightedIndex(-1,{contain:!0})}}),Object.defineProperty(e,"focusInput",{enumerable:!0,configurable:!0,writable:!0,value:function(){e.input&&(e.contextValue.canSelectOption.current=!1,e.setState({isPopoverVisible:!1}),e.canCallFocus=!1,e.input.focus(),e.canCallFocus=!0)}}),e}return e(d,l),Object.defineProperty(d.prototype,"componentDidMount",{enumerable:!1,configurable:!0,writable:!0,value:function(){"undefined"!=typeof document&&document.addEventListener("mouseup",this.clearUserSelectStyle),this.setSelectedOptions()}}),Object.defineProperty(d.prototype,"componentDidUpdate",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isControlled()&&this.setSelectedOptions()}}),Object.defineProperty(d.prototype,"componentWillUnmount",{enumerable:!1,configurable:!0,writable:!0,value:function(){"undefined"!=typeof document&&(document.removeEventListener("mouseup",this.clearUserSelectStyle),this.clearUserSelectStyle())}}),Object.defineProperty(d.prototype,"isControlled",{enumerable:!1,configurable:!0,writable:!0,value:function(){return void 0!==this.props.value}}),Object.defineProperty(d.prototype,"setSelectedOptions",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.props.options?I(this.props.options):this.props.children,t=x(e,this.getSelected);O(this.state.selectedOptions.map((function(e){return e.value})),t.map((function(e){return e.value})))&&r(this.state.selectedOptions.map((function(e){return e.children})),t.map((function(e){return e.children})))||this.setState({selectedOptions:t})}}),Object.defineProperty(d.prototype,"getSortedSelectedOptions",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return t([],this.state.selectedOptions,!0).sort((function(t,n){return h(e,t.value)-h(e,n.value)}))}}),Object.defineProperty(d.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=this.props,r=t.children;t.defaultValue;var l=t.disabled;t.emptyValue;var d=t.innerRef;t.defaultOpen;var b=t.keepInView,v=t.lockScrollWhileOpen,g=t.matchWidths,h=t.multiple;t.name;var O=t.onBlur;t.onChange,t.onClick;var y=t.onFocus,S=t.onKeyDown,w=t.onMouseDown,j=t.onMouseUp,V=t.options,x=t.placement,L=t.popoverProps,E=t.renderTo;t.renderValue;var D=t.tooltip;t.value;var F=n(t,["children","defaultValue","disabled","emptyValue","innerRef","defaultOpen","keepInView","lockScrollWhileOpen","matchWidths","multiple","name","onBlur","onChange","onClick","onFocus","onKeyDown","onMouseDown","onMouseUp","options","placement","popoverProps","renderTo","renderValue","tooltip","value"]),U=this.state,H=U.isPopoverOpen,R=U.isPopoverVisible;return i.createElement(P.Provider,{value:this.contextValue},i.createElement(a,{onBlur:this.closePopover},(function(t){var n=t.requestBlur,a=t.setRef;return i.createElement(p,{ref:function(t){return e.itemList=t},selected:e.getSelected,onSelect:e.handleSelect},(function(t){var p=t.getItemByText,P=t.getHighlightedIndex,U=t.moveHighlightedIndex,T=t.selectHighlightedItem,B=t.setHighlightedIndex,M=t.selectItemByIndex,W=t.stringSearch;return i.createElement(f,o({},L,{ref:function(t){e.popover=t},innerRef:function(t){a("".concat(e.id,"-popover"))(t)},as:k,tabIndex:-1,"aria-labelledby":e.id,"aria-multiselectable":h,role:"listbox",display:R?void 0:"none",minWidth:16,padding:0,elevation:2,matchWidths:g,lockScrollWhileOpen:!!R&&v,keepInView:b,placement:x,renderTo:E,open:H,onRequestClose:function(){return e.setState({isPopoverVisible:!1})},onBlur:n,onKeyDown:function(t){switch(t.key){case"ArrowUp":t.preventDefault(),R?U(-1,{contain:!0}):(e.openPopover(!0),setTimeout((function(){e.highlightLastSelectedOption()})));break;case"ArrowDown":t.preventDefault(),R?U(1,{contain:!0}):(e.openPopover(!0),setTimeout((function(){e.highlightFirstSelectedOption()})));break;case"Enter":R&&(t.preventDefault(),T());break;case"Escape":H&&!R&&(t.preventDefault(),e.closePopover());break;case" ":t.preventDefault(),null===P()?(e.togglePopover(),setTimeout((function(){e.highlightFirstSelectedOption()}))):R?T():e.openPopover(!0);break;default:W(t).then((function(e){var t=p(e);t&&(R?B(t.props.index):M(t.props.index))}))}},anchorElement:function(t){var r=l?{}:{onBlur:function(e){n(e),O&&O(e)},onFocus:function(t){e.canCallFocus&&e.openPopover(!1),y&&y(t)},onKeyDown:function(e){t.onKeyDown(e),S&&S(e)},onMouseDown:function(t){0===t.button&&(e.addUserSelectStyle(),e.canCallFocus=!1,e.togglePopover()),w&&w(t)},onMouseUp:function(t){e.canCallFocus=!0,j&&j(t)}};return i.createElement(s,null,(function(n){var p=n.getHighlightedItemId;return i.createElement(m,o({triggerOnHover:!R,triggerOnFocus:!R},D),i.createElement(c.InputBox,o({innerRef:function(n){"function"==typeof t.innerRef?t.innerRef(n):t.innerRef&&t.innerRef.current&&(t.innerRef.current=n),e.input=n,a("".concat(e.id,"-button"))(n),d&&d(n)},id:e.id,tabIndex:0,role:"combobox",disabled:l,"aria-disabled":l,"aria-haspopup":R,"aria-expanded":R,"aria-activedescendant":p(),cursor:"pointer",userSelect:"none",touchAction:"manipulation",focusChildrenOnFocus:!1,renderRight:i.createElement(u,{name:R?"general.upCaret":"general.downCaret"})},F,r),e.getValue(),e.getHiddenInputValues()))}))}}),C(V?I(V):r))}))})))}}),Object.defineProperty(d,"displayName",{enumerable:!0,configurable:!0,writable:!0,value:y}),Object.defineProperty(d,"defaultProps",{enumerable:!0,configurable:!0,writable:!0,value:{defaultOpen:!1,emptyValue:i.createElement(L,null,"Select an item"),lockScrollWhileOpen:!0,matchWidths:"minimum",renderValue:function(e){return i.createElement(L,null,b(e.map((function(e){return e.children}))))}}}),d}(l);E.Inline=S,E.Option=w,E.OptionGroup=j,E.Value=L,E.toggleValue=V;export{E as default};
|
|
1
|
+
import{__extends as e,__spreadArray as t,__rest as n,__assign as o}from'./../ext/tslib/tslib.es6.js';import r from"lodash/isEqual";import i,{Component as l}from"react";import a from"../FocusGroup/FocusGroup.js";import u from"../Icon/Icon.js";import c from"../Input/Input.js";import p from"../ItemList/ItemList.js";import s from"../ItemList/ItemListController.js";import"../ItemList/ItemListItem.js";import d from"../Menu/Menu.js";import{Popover as f}from"../Popover/Popover.js";import m from"../Tooltip/Tooltip.js";import{joinChildren as b,generateId as v,isArray as g,isValueInArray as h,shallowEqual as O}from"../utils.js";import{SELECT_DISPLAY_NAME as y}from"./constants.js";import P from"./Context.js";import S from"./Inline.js";import w from"./Option.js";import j from"./OptionGroup.js";import{toggleValue as V,optionsToElements as I,getSelectedOptions as x,renderOptions as C}from"./utils.js";import L from"./Value.js";function k(e){return i.createElement(d,o({},e,{as:"ul"}))}var E=function(l){function d(){var e=null!==l&&l.apply(this,arguments)||this;return Object.defineProperty(e,"input",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(e,"popover",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(e,"itemList",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(e,"id",{enumerable:!0,configurable:!0,writable:!0,value:v("select")}),Object.defineProperty(e,"canCallFocus",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(e,"mounted",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(e,"contextValue",{enumerable:!0,configurable:!0,writable:!0,value:{canSelectOption:{current:!1},multiple:e.props.multiple}}),Object.defineProperty(e,"state",{enumerable:!0,configurable:!0,writable:!0,value:{isPopoverOpen:e.props.defaultOpen,isPopoverVisible:!1,selectedOptions:[],uncontrolledValue:void 0===e.props.defaultValue?e.props.multiple?[]:null:e.props.defaultValue}}),Object.defineProperty(e,"safeSetState",{enumerable:!0,configurable:!0,writable:!0,value:function(t,n){e.mounted&&e.setState(t,n)}}),Object.defineProperty(e,"addUserSelectStyle",{enumerable:!0,configurable:!0,writable:!0,value:function(){document.body.style.webkitUserSelect="none"}}),Object.defineProperty(e,"clearUserSelectStyle",{enumerable:!0,configurable:!0,writable:!0,value:function(){document.body.style.webkitUserSelect=""}}),Object.defineProperty(e,"openPopover",{enumerable:!0,configurable:!0,writable:!0,value:function(t){t&&(setTimeout((function(){e.contextValue.canSelectOption.current=!0}),300),setTimeout((function(){var t=e.state.selectedOptions;t.length>0&&e.itemList.scrollItemIntoViewByIndex(t[0].index)}))),e.setState({isPopoverOpen:!0,isPopoverVisible:t})}}),Object.defineProperty(e,"closePopover",{enumerable:!0,configurable:!0,writable:!0,value:function(){e.contextValue.canSelectOption.current=!1,e.safeSetState({isPopoverOpen:!1,isPopoverVisible:!1}),e.itemList&&e.itemList.clearHighlightedIndex()}}),Object.defineProperty(e,"togglePopover",{enumerable:!0,configurable:!0,writable:!0,value:function(){e.state.isPopoverVisible&&e.state.isPopoverOpen?e.closePopover():e.openPopover(!0)}}),Object.defineProperty(e,"getValue",{enumerable:!0,configurable:!0,writable:!0,value:function(){if(e.state.selectedOptions.length>0){var t=e.isControlled()?e.props.value:e.state.uncontrolledValue;return e.props.renderValue(g(t)?e.getSortedSelectedOptions(t):e.state.selectedOptions)}return e.props.emptyValue}}),Object.defineProperty(e,"getHiddenInputValues",{enumerable:!0,configurable:!0,writable:!0,value:function(){var t=e.props.name,n=e.state.selectedOptions;return t&&n.length>0?n.map((function(e,n){return i.createElement("input",{key:n,name:t,type:"hidden",value:e.value})})):null}}),Object.defineProperty(e,"getSelected",{enumerable:!0,configurable:!0,writable:!0,value:function(t){var n=e.props.value,o=e.state.uncontrolledValue;return e.isControlled()?"function"==typeof n?n(t):g(n)?h(n,t)>-1:n===t:g(o)?h(o,t)>-1:o===t}}),Object.defineProperty(e,"handleSelect",{enumerable:!0,configurable:!0,writable:!0,value:function(t){var n=e.props,o=n.multiple,r=n.value,i=t;e.isControlled()?g(r)&&(i=d.toggleValue(e.props.value,t)):(o&&(i=d.toggleValue(e.state.uncontrolledValue,t)),e.setState({uncontrolledValue:i},e.setSelectedOptions)),e.props.onChange&&e.props.onChange({selectedValue:t,value:i}),!o&&e.state.isPopoverVisible&&e.focusInput()}}),Object.defineProperty(e,"highlightFirstSelectedOption",{enumerable:!0,configurable:!0,writable:!0,value:function(){var t=e.state.selectedOptions;t.length>0?e.itemList.setHighlightedIndex(t[0].index):e.itemList.moveHighlightedIndex(1,{contain:!0})}}),Object.defineProperty(e,"highlightLastSelectedOption",{enumerable:!0,configurable:!0,writable:!0,value:function(){var t=e.state.selectedOptions;t.length>0?e.itemList.setHighlightedIndex(t[Math.max(0,t.length-1)].index):e.itemList.moveHighlightedIndex(-1,{contain:!0})}}),Object.defineProperty(e,"focusInput",{enumerable:!0,configurable:!0,writable:!0,value:function(){e.input&&(e.contextValue.canSelectOption.current=!1,e.setState({isPopoverVisible:!1}),e.canCallFocus=!1,e.input.focus(),e.canCallFocus=!0)}}),e}return e(d,l),Object.defineProperty(d.prototype,"componentDidMount",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.mounted=!0,"undefined"!=typeof document&&document.addEventListener("mouseup",this.clearUserSelectStyle),this.setSelectedOptions()}}),Object.defineProperty(d.prototype,"componentDidUpdate",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isControlled()&&this.setSelectedOptions()}}),Object.defineProperty(d.prototype,"componentWillUnmount",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.mounted=!1,"undefined"!=typeof document&&(document.removeEventListener("mouseup",this.clearUserSelectStyle),this.clearUserSelectStyle())}}),Object.defineProperty(d.prototype,"isControlled",{enumerable:!1,configurable:!0,writable:!0,value:function(){return void 0!==this.props.value}}),Object.defineProperty(d.prototype,"setSelectedOptions",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.props.options?I(this.props.options):this.props.children,t=x(e,this.getSelected);O(this.state.selectedOptions.map((function(e){return e.value})),t.map((function(e){return e.value})))&&r(this.state.selectedOptions.map((function(e){return e.children})),t.map((function(e){return e.children})))||this.setState({selectedOptions:t})}}),Object.defineProperty(d.prototype,"getSortedSelectedOptions",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return t([],this.state.selectedOptions,!0).sort((function(t,n){return h(e,t.value)-h(e,n.value)}))}}),Object.defineProperty(d.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=this.props,r=t.children;t.defaultValue;var l=t.disabled;t.emptyValue;var d=t.innerRef;t.defaultOpen;var b=t.keepInView,v=t.lockScrollWhileOpen,g=t.matchWidths,h=t.multiple;t.name;var O=t.onBlur;t.onChange,t.onClick;var y=t.onFocus,S=t.onKeyDown,w=t.onMouseDown,j=t.onMouseUp,V=t.options,x=t.placement,L=t.popoverProps,E=t.renderTo;t.renderValue;var D=t.tooltip;t.value;var F=n(t,["children","defaultValue","disabled","emptyValue","innerRef","defaultOpen","keepInView","lockScrollWhileOpen","matchWidths","multiple","name","onBlur","onChange","onClick","onFocus","onKeyDown","onMouseDown","onMouseUp","options","placement","popoverProps","renderTo","renderValue","tooltip","value"]),U=this.state,H=U.isPopoverOpen,R=U.isPopoverVisible;return i.createElement(P.Provider,{value:this.contextValue},i.createElement(a,{onBlur:this.closePopover},(function(t){var n=t.requestBlur,a=t.setRef;return i.createElement(p,{ref:function(t){return e.itemList=t},selected:e.getSelected,onSelect:e.handleSelect},(function(t){var p=t.getItemByText,P=t.getHighlightedIndex,U=t.moveHighlightedIndex,T=t.selectHighlightedItem,B=t.setHighlightedIndex,M=t.selectItemByIndex,W=t.stringSearch;return i.createElement(f,o({},L,{ref:function(t){e.popover=t},innerRef:function(t){a("".concat(e.id,"-popover"))(t)},as:k,tabIndex:-1,"aria-labelledby":e.id,"aria-multiselectable":h,role:"listbox",display:R?void 0:"none",minWidth:16,padding:0,elevation:2,matchWidths:g,lockScrollWhileOpen:!!R&&v,keepInView:b,placement:x,renderTo:E,open:H,onRequestClose:function(){return e.setState({isPopoverVisible:!1})},onBlur:n,onKeyDown:function(t){switch(t.key){case"ArrowUp":t.preventDefault(),R?U(-1,{contain:!0}):(e.openPopover(!0),setTimeout((function(){e.highlightLastSelectedOption()})));break;case"ArrowDown":t.preventDefault(),R?U(1,{contain:!0}):(e.openPopover(!0),setTimeout((function(){e.highlightFirstSelectedOption()})));break;case"Enter":R&&(t.preventDefault(),T());break;case"Escape":H&&!R&&(t.preventDefault(),e.closePopover());break;case" ":t.preventDefault(),null===P()?(e.togglePopover(),setTimeout((function(){e.highlightFirstSelectedOption()}))):R?T():e.openPopover(!0);break;default:W(t).then((function(e){var t=p(e);t&&(R?B(t.props.index):M(t.props.index))}))}},anchorElement:function(t){var r=l?{}:{onBlur:function(e){n(e),O&&O(e)},onFocus:function(t){e.canCallFocus&&e.openPopover(!1),y&&y(t)},onKeyDown:function(e){t.onKeyDown(e),S&&S(e)},onMouseDown:function(t){0===t.button&&(e.addUserSelectStyle(),e.canCallFocus=!1,e.togglePopover()),w&&w(t)},onMouseUp:function(t){e.canCallFocus=!0,j&&j(t)}};return i.createElement(s,null,(function(n){var p=n.getHighlightedItemId;return i.createElement(m,o({triggerOnHover:!R,triggerOnFocus:!R},D),i.createElement(c.InputBox,o({innerRef:function(n){"function"==typeof t.innerRef?t.innerRef(n):t.innerRef&&t.innerRef.current&&(t.innerRef.current=n),e.input=n,a("".concat(e.id,"-button"))(n),d&&d(n)},id:e.id,tabIndex:0,role:"combobox",disabled:l,"aria-disabled":l,"aria-haspopup":R,"aria-expanded":R,"aria-activedescendant":p(),cursor:"pointer",userSelect:"none",touchAction:"manipulation",focusChildrenOnFocus:!1,renderRight:i.createElement(u,{name:R?"general.upCaret":"general.downCaret"})},F,r),e.getValue(),e.getHiddenInputValues()))}))}}),C(V?I(V):r))}))})))}}),Object.defineProperty(d,"displayName",{enumerable:!0,configurable:!0,writable:!0,value:y}),Object.defineProperty(d,"defaultProps",{enumerable:!0,configurable:!0,writable:!0,value:{defaultOpen:!1,emptyValue:i.createElement(L,null,"Select an item"),lockScrollWhileOpen:!0,matchWidths:"minimum",renderValue:function(e){return i.createElement(L,null,b(e.map((function(e){return e.children}))))}}}),d}(l);E.Inline=S,E.Option=w,E.OptionGroup=j,E.Value=L,E.toggleValue=V;export{E as default};
|
|
2
2
|
//# sourceMappingURL=Select.js.map
|
|
@@ -19,7 +19,7 @@ export declare const designTokens: {
|
|
|
19
19
|
checkedColor: "hsl(0, 0%, 81%)";
|
|
20
20
|
checkedFillColor: "hsl(0, 0%, 100%)";
|
|
21
21
|
fillColor: "hsl(0, 0%, 95%)";
|
|
22
|
-
labelColor: "hsl(0, 0%,
|
|
22
|
+
labelColor: "hsl(0, 0%, 42%)";
|
|
23
23
|
};
|
|
24
24
|
errorColor: "hsl(8, 60%, 47%)";
|
|
25
25
|
fillColor: "hsl(0, 0%, 100%)";
|
|
@@ -39,11 +39,11 @@ export declare const palette: {
|
|
|
39
39
|
};
|
|
40
40
|
foreground: {
|
|
41
41
|
foreground: "hsl(0, 0%, 24%)";
|
|
42
|
-
foregroundSecondary: "hsl(0, 0%,
|
|
42
|
+
foregroundSecondary: "hsl(0, 0%, 42%)";
|
|
43
43
|
foregroundTertiary: string;
|
|
44
44
|
};
|
|
45
45
|
green: string[];
|
|
46
|
-
grey: ("hsl(0, 0%, 24%)" | "hsl(0, 0%,
|
|
46
|
+
grey: ("hsl(0, 0%, 24%)" | "hsl(0, 0%, 42%)" | "hsl(0, 0%, 50%)" | "hsl(0, 0%, 58%)" | "hsl(0, 0%, 81%)" | "hsl(0, 0%, 88%)" | "hsl(0, 0%, 93%)" | "hsl(0, 0%, 95%)" | "hsl(0, 0%, 97%)" | "hsl(0, 0%, 98%)")[];
|
|
47
47
|
highlight: {
|
|
48
48
|
highlight: "hsl(0, 0%, 95%)";
|
|
49
49
|
highlightSecondary: "hsl(0, 0%, 93%)";
|
|
@@ -99,7 +99,7 @@ export declare const palette: {
|
|
|
99
99
|
};
|
|
100
100
|
grays: {
|
|
101
101
|
light: {
|
|
102
|
-
neutral62: "hsl(0, 0%,
|
|
102
|
+
neutral62: "hsl(0, 0%, 58%)";
|
|
103
103
|
neutral81: "hsl(0, 0%, 81%)";
|
|
104
104
|
};
|
|
105
105
|
};
|
|
@@ -121,7 +121,7 @@ export declare const colors: Partial<import("../../types").Colors> & Record<stri
|
|
|
121
121
|
};
|
|
122
122
|
grays: {
|
|
123
123
|
light: {
|
|
124
|
-
neutral62: "hsl(0, 0%,
|
|
124
|
+
neutral62: "hsl(0, 0%, 58%)";
|
|
125
125
|
neutral81: "hsl(0, 0%, 81%)";
|
|
126
126
|
};
|
|
127
127
|
};
|
|
@@ -133,7 +133,7 @@ export declare function getColor(key: string): string | [string, string, string,
|
|
|
133
133
|
};
|
|
134
134
|
grays: {
|
|
135
135
|
light: {
|
|
136
|
-
neutral62: "hsl(0, 0%,
|
|
136
|
+
neutral62: "hsl(0, 0%, 58%)";
|
|
137
137
|
neutral81: "hsl(0, 0%, 81%)";
|
|
138
138
|
};
|
|
139
139
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{computedToken as l}from"@planningcenter/tapestry";import{flattenPalette as r}from"./utils.js";var t={create:{create35:l("--t-fill-color-control-secondary")},grays:{light:{neutral62:l("--t-fill-color-neutral-030"),neutral81:l("--t-fill-color-neutral-040")}},interaction66:l("--t-fill-color-control-primary")},o={apps:{calendar:l("--t-fill-color-product-calendar-
|
|
1
|
+
import{computedToken as l}from"@planningcenter/tapestry";import{flattenPalette as r}from"./utils.js";var t={create:{create35:l("--t-fill-color-control-secondary")},grays:{light:{neutral62:l("--t-fill-color-neutral-030"),neutral81:l("--t-fill-color-neutral-040")}},interaction66:l("--t-fill-color-control-primary")},o={apps:{calendar:l("--t-fill-color-product-calendar-050"),"check-ins":l("--t-fill-color-product-checkins-050"),giving:l("--t-fill-color-product-giving-050"),groups:l("--t-fill-color-product-groups-050"),home:l("--t-fill-color-product-home-050"),"music-stand":"#4984c4",pco:"#3565cf",people:l("--t-fill-color-product-people-050"),"planning-center":"#2266f7",projector:"#f19900",registrations:l("--t-fill-color-product-registrations-050"),services:l("--t-fill-color-product-services-050")},background:{background:l("--t-surface-color-card"),backgroundSecondary:l("--t-surface-color-canvas"),backgroundTertiary:l("--t-fill-color-neutral-070")},blue:["hsl(197, 56%, 92%)","hsl(197, 56%, 88%)","hsl(197, 56%, 72%)","hsl(197, 56%, 64%)","hsl(197, 56%, 52%)","hsl(197, 56%, 44%)","hsl(197, 56%, 40%)","hsl(197, 56%, 32%)","hsl(197, 56%, 24%)","hsl(197, 56%, 20%)"],dark:["hsla(0,0%,0%,0.04)","hsla(0,0%,0%,0.08)",l("--t-fill-color-transparency-dark-010"),l("--t-fill-color-transparency-dark-020"),l("--t-fill-color-transparency-dark-020"),l("--t-fill-color-transparency-dark-030"),l("--t-fill-color-transparency-dark-040"),l("--t-fill-color-transparency-dark-050"),l("--t-fill-color-transparency-dark-060"),l("--t-fill-color-transparency-dark-070")],days:{friday:"#F69688",monday:"#789FF8",saturday:"#66BEEB",sunday:"#7DC156",thursday:"#FA7EA4",tuesday:"#A193FD",wednesday:"#D18CF6"},error:{base:l("--t-fill-color-button-delete-solid-default"),dark:l("--t-fill-color-button-delete-solid-hover"),darker:l("--t-fill-color-button-delete-solid-active"),light:"hsl(8, 60%, 85%)",lighter:l("--t-fill-color-status-error-ghost"),lightest:l("--t-fill-color-status-error-dim")},foreground:{foreground:l("--t-text-color-default-primary"),foregroundSecondary:l("--t-text-color-default-secondary"),foregroundTertiary:"hsl(0, 0%, 58%)"},green:["hsl(96, 24%, 92%)","hsl(96, 30%, 84%)","hsl(96, 32%, 76%)","hsl(96, 34%, 72%)","hsl(96, 36%, 64%)","hsl(96, 40%, 58%)","hsl(96, 44%, 50%)","hsl(96, 48%, 40%)","hsl(96, 52%, 30%)","hsl(96, 60%, 20%)"],grey:[l("--t-fill-color-neutral-090"),l("--t-fill-color-neutral-080"),l("--t-fill-color-neutral-070"),l("--t-fill-color-neutral-060"),l("--t-fill-color-neutral-050"),l("--t-fill-color-neutral-040"),l("--t-fill-color-neutral-030"),l("--t-fill-color-neutral-025"),l("--t-fill-color-neutral-020"),l("--t-fill-color-neutral-010")],highlight:{highlight:l("--t-fill-color-neutral-070"),highlightSecondary:l("--t-fill-color-neutral-060")},interaction:{base:l("--t-fill-color-interaction-default"),dark:l("--t-fill-color-interaction-hover"),darker:l("--t-fill-color-interaction-active"),darkest:"hsl(221, 90%, 31%)",light:"hsl(221, 91%, 70%)",lighter:"hsl(0, 0%, 81%);",lightest:l("--t-fill-color-interaction-disabled")},light:[l("--t-fill-color-transparency-light-010"),l("--t-fill-color-transparency-light-020"),l("--t-fill-color-transparency-light-030"),l("--t-fill-color-transparency-light-040"),l("--t-fill-color-transparency-light-050"),l("--t-fill-color-transparency-light-060"),l("--t-fill-color-transparency-light-070"),l("--t-fill-color-transparency-light-080"),l("--t-fill-color-transparency-light-090"),"hsla(0,0%,100%,0.96)"],link:{linkBackground:l("--t-fill-color-neutral-090"),linkForeground:"primary"},primary:{base:"hsl(88, 44%, 40%)",dark:"hsl(88, 46%, 36%)",darker:"hsl(88, 52%, 32%)",darkest:"hsl(88, 72%, 20%)",light:"hsl(88, 40%, 54%)",lighter:"hsl(88, 32%, 86%)",lightest:"hsl(88, 24%, 92%)"},red:["hsl(8, 73%, 96%)","hsl(8, 74%, 92%)","hsl(8, 75%, 88%)","hsl(8, 76%, 68%)","hsl(8, 77%, 60%)","hsl(8, 78%, 56%)","hsl(8, 79%, 52%)","hsl(8, 80%, 48%)","hsl(8, 81%, 40%)","hsl(8, 82%, 30%)"],separator:{separator:l("--t-fill-color-neutral-040"),separatorFocus:"primary",separatorFocusSecondary:l("--t-fill-color-neutral-050"),separatorHover:l("--t-fill-color-neutral-040"),separatorSecondary:l("--t-fill-color-neutral-050"),separatorTertiary:l("--t-fill-color-neutral-050")},success:{base:l("--t-fill-color-status-success-solid"),dark:l("--t-text-color-status-success"),darker:"hsl(86, 91%, 23%)",light:l("--t-border-color-control-success"),lighter:l("--t-fill-color-status-success-ghost"),lightest:l("--t-fill-color-status-success-dim")},surface:{surface:l("--t-surface-color-card"),surfaceSecondary:l("--t-surface-color-canvas"),surfaceTertiary:l("--t-fill-color-neutral-070")},tapestry:t,warning:{base:l("--t-fill-color-status-warning-solid"),dark:l("--t-fill-color-status-warning-solid"),darker:l("--t-icon-color-status-warning-primary"),light:"hsl(42, 87%, 90%)",lighter:l("--t-fill-color-status-warning-ghost"),lightest:l("--t-fill-color-status-warning-dim")},yellow:["hsl(50, 89%, 90%)","hsl(50, 90%, 86%)","hsl(50, 91%, 74%)","hsl(50, 92%, 68%)","hsl(50, 93%, 62%)","hsl(50, 94%, 56%)","hsl(50, 95%, 48%)","hsl(50, 96%, 40%)","hsl(50, 97%, 32%)","hsl(50, 98%, 26%)"]},a=r(o);function s(l){return l?a[l]:a}export{a as colors,s as getColor,o as palette};
|
|
2
2
|
//# sourceMappingURL=colors.js.map
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as general from '@planningcenter/icons/paths/general';
|
|
2
|
+
import * as tapestry from '@planningcenter/icons/paths/tapestry';
|
|
1
3
|
declare const defaultTheme: {
|
|
2
4
|
pageBody: {
|
|
3
5
|
backgroundColor: "var(--t-surface-color-card)";
|
|
@@ -309,7 +311,7 @@ declare const defaultTheme: {
|
|
|
309
311
|
};
|
|
310
312
|
grays: {
|
|
311
313
|
light: {
|
|
312
|
-
neutral62: "hsl(0, 0%,
|
|
314
|
+
neutral62: "hsl(0, 0%, 58%)";
|
|
313
315
|
neutral81: "hsl(0, 0%, 81%)";
|
|
314
316
|
};
|
|
315
317
|
};
|
|
@@ -321,8 +323,8 @@ declare const defaultTheme: {
|
|
|
321
323
|
radius: number;
|
|
322
324
|
};
|
|
323
325
|
icons: {
|
|
324
|
-
general:
|
|
325
|
-
tapestry:
|
|
326
|
+
general: typeof general;
|
|
327
|
+
tapestry: typeof tapestry;
|
|
326
328
|
};
|
|
327
329
|
id: string;
|
|
328
330
|
lineHeights: number[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-theme.d.ts","sourceRoot":"","sources":["../../src/system/default-theme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"default-theme.d.ts","sourceRoot":"","sources":["../../src/system/default-theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAA;AAC9D,OAAO,KAAK,QAAQ,MAAM,sCAAsC,CAAA;AAgBhE,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCjB,CAAA;AAED,eAAe,YAAY,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planningcenter/tapestry-react",
|
|
3
|
-
"version": "4.11.
|
|
3
|
+
"version": "4.11.4-rc.0",
|
|
4
4
|
"description": "A collection of flexible React components to help you build resilient, accessible user interfaces quickly and effectively.",
|
|
5
5
|
"author": "Front End Systems Engineering <frontend@pco.bz>",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -76,9 +76,9 @@
|
|
|
76
76
|
"typescript": "^5.3.3"
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"@planningcenter/icons": "^15.
|
|
79
|
+
"@planningcenter/icons": "^15.25.3",
|
|
80
80
|
"@planningcenter/react-beautiful-dnd": "^13.4.0",
|
|
81
|
-
"@planningcenter/tapestry": "^
|
|
81
|
+
"@planningcenter/tapestry": "^1.4.1",
|
|
82
82
|
"@popmotion/popcorn": "^0.4.4",
|
|
83
83
|
"@popperjs/core": "^2.11.6",
|
|
84
84
|
"@react-hook/window-size": "^3.1.1",
|