@selfcommunity/react-theme-default 0.1.32 → 0.1.33-alpha.1

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.
Files changed (30) hide show
  1. package/lib/cjs/components/SCContributionActionsMenu.d.ts +53 -2
  2. package/lib/cjs/components/SCContributionActionsMenu.js +54 -2
  3. package/lib/cjs/components/SCNavigationMenuIconButton.d.ts +3 -0
  4. package/lib/cjs/components/SCNavigationMenuIconButton.js +4 -0
  5. package/lib/cjs/components/SCSearchAutocomplete.d.ts +14 -0
  6. package/lib/cjs/components/SCSearchAutocomplete.js +15 -0
  7. package/lib/cjs/components/SCUserActionIconButton.d.ts +3 -0
  8. package/lib/cjs/components/SCUserActionIconButton.js +3 -0
  9. package/lib/cjs/components/SCVoteButton.d.ts +3 -0
  10. package/lib/cjs/components/SCVoteButton.js +5 -1
  11. package/lib/cjs/components/SCWidget.d.ts +1 -1
  12. package/lib/cjs/components/SCWidget.js +2 -1
  13. package/lib/cjs/index.d.ts +77 -3
  14. package/lib/esm/components/SCContributionActionsMenu.d.ts +53 -2
  15. package/lib/esm/components/SCContributionActionsMenu.js +54 -2
  16. package/lib/esm/components/SCNavigationMenuIconButton.d.ts +3 -0
  17. package/lib/esm/components/SCNavigationMenuIconButton.js +4 -0
  18. package/lib/esm/components/SCSearchAutocomplete.d.ts +14 -0
  19. package/lib/esm/components/SCSearchAutocomplete.js +15 -0
  20. package/lib/esm/components/SCUserActionIconButton.d.ts +3 -0
  21. package/lib/esm/components/SCUserActionIconButton.js +3 -0
  22. package/lib/esm/components/SCVoteButton.d.ts +3 -0
  23. package/lib/esm/components/SCVoteButton.js +5 -1
  24. package/lib/esm/components/SCWidget.d.ts +1 -1
  25. package/lib/esm/components/SCWidget.js +2 -1
  26. package/lib/esm/index.d.ts +77 -3
  27. package/lib/umd/850.js +2 -0
  28. package/lib/umd/850.js.LICENSE.txt +16 -0
  29. package/lib/umd/react-theme-default.js +2 -2
  30. package/package.json +10 -4
@@ -1,3 +1,4 @@
1
+ import { hexToCSSFilter } from 'hex-to-css-filter';
1
2
  const Component = {
2
3
  styleOverrides: {
3
4
  root: ({ theme }) => ({
@@ -8,7 +9,10 @@ const Component = {
8
9
  padding: theme.spacing(1.5),
9
10
  minWidth: 0,
10
11
  '& .MuiIcon-root': {
11
- fontSize: '1.57rem'
12
+ fontSize: '1.57rem',
13
+ '& img': {
14
+ filter: hexToCSSFilter(theme.palette.primary.main).filter
15
+ }
12
16
  },
13
17
  '&.MuiButton-sizeSmall': {
14
18
  padding: theme.spacing(0.5),
@@ -34,7 +34,7 @@ declare const Component: {
34
34
  '& h5': {
35
35
  fontFamily: any;
36
36
  fontWeight: any;
37
- color: any;
37
+ color: string;
38
38
  fontSize: string;
39
39
  };
40
40
  '& .MuiList-root': {
@@ -1,3 +1,4 @@
1
+ import { darken } from '@mui/system';
1
2
  const Component = {
2
3
  variants: [
3
4
  {
@@ -31,7 +32,7 @@ const Component = {
31
32
  '& h5': {
32
33
  fontFamily: theme.typography.fontFamily,
33
34
  fontWeight: theme.typography.fontWeightBold,
34
- color: theme.palette.common.black,
35
+ color: darken(theme.palette.text.primary, 0.5),
35
36
  fontSize: '1.143rem'
36
37
  },
37
38
  '& .MuiList-root': {
@@ -1293,15 +1293,66 @@ declare const theme: {
1293
1293
  };
1294
1294
  SCContributionActionsMenu: {
1295
1295
  styleOverrides: {
1296
- root: () => {
1296
+ root: ({ theme }: any) => {
1297
+ '& .SCContributionActionsMenu-button': {
1298
+ color: any;
1299
+ '&:hover': {
1300
+ backgroundColor: string;
1301
+ };
1302
+ };
1297
1303
  '& .SCContributionActionsMenu-visibility-icons': {
1298
- color: string;
1304
+ color: any;
1299
1305
  '& > span: nth-of-type(2)': {
1300
1306
  position: string;
1301
1307
  top: number;
1302
1308
  };
1303
1309
  };
1304
1310
  };
1311
+ popperRoot: ({ theme }: any) => {
1312
+ zIndex: number;
1313
+ '& .SCContributionActionsMenu-popper-root': {
1314
+ overflow: string;
1315
+ filter: string;
1316
+ mt: number;
1317
+ };
1318
+ '& .SCContributionActionsMenu-paper': {
1319
+ width: number;
1320
+ '& .SCContributionActionsMenu-sub-item': {
1321
+ '& .MuiListItemIcon-root': {
1322
+ color: any;
1323
+ };
1324
+ '&:hover': {
1325
+ backgroundColor: string;
1326
+ };
1327
+ };
1328
+ };
1329
+ '& .SCContributionActionsMenu-footer-sub-items': {
1330
+ margin: string;
1331
+ border: string;
1332
+ padding: number;
1333
+ borderRadius: number;
1334
+ fontSize: number;
1335
+ };
1336
+ '& .SCContributionActionsMenu-selected-icon': {
1337
+ marginLeft: number;
1338
+ '&.MuiListItemIcon-root': {
1339
+ width: string;
1340
+ };
1341
+ '& svg': {
1342
+ fontSize: string;
1343
+ };
1344
+ };
1345
+ '& .SCContributionActionsMenu-section-badge': {
1346
+ padding: number;
1347
+ minWidth: number;
1348
+ height: number;
1349
+ top: number;
1350
+ };
1351
+ '& .SCContributionActionsMenu-section-with-selection-icon': {
1352
+ fontSize: number;
1353
+ color: any;
1354
+ };
1355
+ };
1305
1356
  };
1306
1357
  };
1307
1358
  SCCustomSnackMessage: {
@@ -3987,6 +4038,20 @@ declare const theme: {
3987
4038
  padding: any;
3988
4039
  };
3989
4040
  };
4041
+ '& .MuiInputBase-root': {
4042
+ '& fieldset': {
4043
+ borderColor: string;
4044
+ };
4045
+ '&:hover fieldset': {
4046
+ borderColor: any;
4047
+ };
4048
+ '&.Mui-focused fieldset': {
4049
+ borderColor: any;
4050
+ };
4051
+ '&.Mui-focused .SCSearchAutocomplete-icon': {
4052
+ color: any;
4053
+ };
4054
+ };
3990
4055
  };
3991
4056
  };
3992
4057
  };
@@ -4119,6 +4184,9 @@ declare const theme: {
4119
4184
  };
4120
4185
  SCUserActionIconButton: {
4121
4186
  styleOverrides: {
4187
+ root: ({ theme }: any) => {
4188
+ color: any;
4189
+ };
4122
4190
  menuRoot: ({ theme }: any) => {};
4123
4191
  };
4124
4192
  };
@@ -4425,6 +4493,9 @@ declare const theme: {
4425
4493
  minWidth: number;
4426
4494
  '& .MuiIcon-root': {
4427
4495
  fontSize: string;
4496
+ '& img': {
4497
+ filter: string;
4498
+ };
4428
4499
  };
4429
4500
  '&.MuiButton-sizeSmall': {
4430
4501
  padding: any;
@@ -4507,7 +4578,7 @@ declare const theme: {
4507
4578
  '& h5': {
4508
4579
  fontFamily: any;
4509
4580
  fontWeight: any;
4510
- color: any;
4581
+ color: string;
4511
4582
  fontSize: string;
4512
4583
  };
4513
4584
  '& .MuiList-root': {
@@ -5262,6 +5333,9 @@ declare const theme: {
5262
5333
  '& MuiButton-root': {
5263
5334
  padding: any;
5264
5335
  };
5336
+ '& span:first-of-type': {
5337
+ color: string;
5338
+ };
5265
5339
  };
5266
5340
  };
5267
5341
  };
package/lib/umd/850.js ADDED
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 850.js.LICENSE.txt */
2
+ (self.webpackChunkSelfCommunityReactThemeDefault=self.webpackChunkSelfCommunityReactThemeDefault||[]).push([[850],{2609:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r="",n=void 0!==e[5];return e[4]&&(r+="@supports (".concat(e[4],") {")),e[2]&&(r+="@media ".concat(e[2]," {")),n&&(r+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),r+=t(e),n&&(r+="}"),e[2]&&(r+="}"),e[4]&&(r+="}"),r})).join("")},e.i=function(t,r,n,s,a){"string"==typeof t&&(t=[[null,t,void 0]]);var o={};if(n)for(var i=0;i<this.length;i++){var c=this[i][0];null!=c&&(o[c]=!0)}for(var u=0;u<t.length;u++){var l=[].concat(t[u]);n&&o[l[0]]||(void 0!==a&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=a),r&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=r):l[2]=r),s&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=s):l[4]="".concat(s)),e.push(l))}},e}},8991:t=>{"use strict";t.exports=function(t,e){return e||(e={}),t?(t=String(t.__esModule?t.default:t),/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),e.hash&&(t+=e.hash),/["'() \t\n]|(%20)/.test(t)||e.needQuotes?'"'.concat(t.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):t):t}},272:t=>{"use strict";t.exports=function(t){var e=t[1],r=t[3];if(!r)return e;if("function"==typeof btoa){var n=btoa(unescape(encodeURIComponent(JSON.stringify(r)))),s="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n),a="/*# ".concat(s," */"),o=r.sources.map((function(t){return"/*# sourceURL=".concat(r.sourceRoot||"").concat(t," */")}));return[e].concat(o).concat([a]).join("\n")}return[e].join("\n")}},9968:function(t,e){!function(t){"use strict";var e=function(){function t(t,e,r){this.r=0,this.g=0,this.b=0,this.set(t,e,r)}return t.prototype.set=function(t,e,r){this.r=this.clamp(t),this.g=this.clamp(e),this.b=this.clamp(r)},t.prototype.hueRotate=function(t){void 0===t&&(t=0),t=t/180*Math.PI;var e=Math.sin(t),r=Math.cos(t);this.multiply([.213+.787*r-.213*e,.715-.715*r-.715*e,.072-.072*r+.928*e,.213-.213*r+.143*e,.715+.285*r+.14*e,.072-.072*r-.283*e,.213-.213*r-.787*e,.715-.715*r+.715*e,.072+.928*r+.072*e])},t.prototype.grayscale=function(t){void 0===t&&(t=1),this.multiply([.2126+.7874*(1-t),.7152-.7152*(1-t),.0722-.0722*(1-t),.2126-.2126*(1-t),.7152+.2848*(1-t),.0722-.0722*(1-t),.2126-.2126*(1-t),.7152-.7152*(1-t),.0722+.9278*(1-t)])},t.prototype.sepia=function(t){void 0===t&&(t=1),this.multiply([.393+.607*(1-t),.769-.769*(1-t),.189-.189*(1-t),.349-.349*(1-t),.686+.314*(1-t),.168-.168*(1-t),.272-.272*(1-t),.534-.534*(1-t),.131+.869*(1-t)])},t.prototype.saturate=function(t){void 0===t&&(t=1),this.multiply([.213+.787*t,.715-.715*t,.072-.072*t,.213-.213*t,.715+.285*t,.072-.072*t,.213-.213*t,.715-.715*t,.072+.928*t])},t.prototype.multiply=function(t){var e=this.clamp(this.r*t[0]+this.g*t[1]+this.b*t[2]),r=this.clamp(this.r*t[3]+this.g*t[4]+this.b*t[5]),n=this.clamp(this.r*t[6]+this.g*t[7]+this.b*t[8]);this.r=e,this.g=r,this.b=n},t.prototype.brightness=function(t){void 0===t&&(t=1),this.linear(t)},t.prototype.contrast=function(t){void 0===t&&(t=1),this.linear(t,-.5*t+.5)},t.prototype.linear=function(t,e){void 0===t&&(t=1),void 0===e&&(e=0),this.r=this.clamp(this.r*t+255*e),this.g=this.clamp(this.g*t+255*e),this.b=this.clamp(this.b*t+255*e)},t.prototype.invert=function(t){void 0===t&&(t=1),this.r=this.clamp(255*(t+this.r/255*(1-2*t))),this.g=this.clamp(255*(t+this.g/255*(1-2*t))),this.b=this.clamp(255*(t+this.b/255*(1-2*t)))},t.prototype.hsl=function(){var t=this.r/255,e=this.g/255,r=this.b/255,n=Math.max(t,e,r),s=Math.min(t,e,r),a=0,o=(n+s)/2;if(n===s)return{h:0,s:0,l:100*o};var i=n-s;return n===t?a=(e-r)/i+(e<r?6:0):n===e?a=(r-t)/i+2:n===r&&(a=(t-e)/i+4),{h:100*(a/=6),s:100*(o>.5?i/(2-n-s):i/(n+s)),l:100*o}},t.prototype.clamp=function(t){return Math.min(Math.max(t,0),255)},t}(),r=function(){function t(t,r){this.target=t,this.targetHSL=t.hsl(),this.options=Object.assign({},{acceptanceLossPercentage:5,maxChecks:15},r),this.reusedColor=new e(0,0,0)}return t.prototype.solve=function(){var t=this.solveNarrow(this.solveWide());return{values:t.values,called:t.called,loss:t.loss,filter:this.css(t.values)}},t.prototype.solveWide=function(){for(var t=[60,180,18e3,600,1.2,1.2],e={loss:1/0},r=0;e.loss>this.options.acceptanceLossPercentage;){var n=this.spsa({A:5,a:t,c:15,values:[50,20,3750,50,100,100],maxTriesInLoop:1e3});if(n.loss<e.loss&&(e=n),(r+=1)>=this.options.maxChecks)break}return Object.assign({},e,{called:r})},t.prototype.solveNarrow=function(t){var e=t.loss,r=e+1,n=[.25*r,.25*r,r,.25*r,.2*r,.2*r];return this.spsa({A:e,a:n,c:2,values:t.values,maxTriesInLoop:500,called:t.called})},t.prototype.fixValueByFilterIDX=function(t,e){var r=100;return 2===e?r=7500:4!==e&&5!==e||(r=200),3===e?t>r?t%=r:t<0&&(t=r+t%r):t<0?t=0:t>r&&(t=r),t},t.prototype.spsa=function(t){for(var e=t.A,r=t.a,n=t.c,s=t.values,a=t.maxTriesInLoop,o=void 0===a?500:a,i=t.called,c=void 0===i?0:i,u=null,l=1/0,h=new Array(6),p=new Array(6),f=new Array(6),v=0;v<o;v++){for(var d=n/Math.pow(v+1,.16666666666666666),m=0;m<6;m++)h[m]=Math.random()>.5?1:-1,p[m]=s[m]+d*h[m],f[m]=s[m]-d*h[m];var y=this.loss(p)-this.loss(f);for(m=0;m<6;m++){var g=y/(2*d)*h[m],b=r[m]/Math.pow(e+v+1,1);s[m]=this.fixValueByFilterIDX(s[m]-b*g,m)}var x=this.loss(s);x<l&&(u=s.slice(0),l=x)}return{values:u,loss:l,called:c}},t.prototype.loss=function(t){var e=this.reusedColor;e.set(0,0,0),e.invert(t[0]/100),e.sepia(t[1]/100),e.saturate(t[2]/100),e.hueRotate(3.6*t[3]),e.brightness(t[4]/100),e.contrast(t[5]/100);var r=e.hsl();return Math.abs(e.r-this.target.r)+Math.abs(e.g-this.target.g)+Math.abs(e.b-this.target.b)+Math.abs(r.h-this.targetHSL.h)+Math.abs(r.s-this.targetHSL.s)+Math.abs(r.l-this.targetHSL.l)},t.prototype.css=function(t){var e=function(e,r){return void 0===r&&(r=1),Math.round(t[e]*r)};return["invert("+e(0)+"%)","sepia("+e(1)+"%)","saturate("+e(2)+"%)","hue-rotate("+e(3,3.6)+"deg)","brightness("+e(4)+"%)","contrast("+e(5)+"%);"].join(" ")},t}(),n=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},s={};t.clearCache=function(t){t?s[t]&&delete s[t]:s={}},t.hexToCSSFilter=function(t,a){var o,i,c,u,l,h;if(void 0===a&&(a={}),s[t]&&!a.forceFilterRecalculation)return Object.assign({},s[t],{cache:!0});try{if(i=(o=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,s,a=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(t){s={error:t}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(s)throw s.error}}return o}((h=t,4===h.length?[parseInt("0x"+h[1]+h[1]),parseInt("0x"+h[2]+h[2]),parseInt("0x"+h[3]+h[3])]:7===h.length?[parseInt("0x"+h[1]+h[2]),parseInt("0x"+h[3]+h[4]),parseInt("0x"+h[5]+h[6])]:[]),3))[0],c=o[1],u=o[2],!n(i)||!n(c)||!n(u))throw new Error("hextToRgb returned an invalid value for '"+t+"'");l=new e(Number(i),Number(c),Number(u))}catch(t){throw new Error("Color value should be in HEX format. "+t)}var p=new r(l,Object.assign({},{acceptanceLossPercentage:5,maxChecks:30,forceFilterRecalculation:!1},a));return s[t]=Object.assign({},p.solve(),{hex:t,rgb:[i,c,u],cache:!1})},Object.defineProperty(t,"__esModule",{value:!0})}(e)},6062:t=>{"use strict";var e=[];function r(t){for(var r=-1,n=0;n<e.length;n++)if(e[n].identifier===t){r=n;break}return r}function n(t,n){for(var a={},o=[],i=0;i<t.length;i++){var c=t[i],u=n.base?c[0]+n.base:c[0],l=a[u]||0,h="".concat(u," ").concat(l);a[u]=l+1;var p=r(h),f={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==p)e[p].references++,e[p].updater(f);else{var v=s(f,n);n.byIndex=i,e.splice(i,0,{identifier:h,updater:v,references:1})}o.push(h)}return o}function s(t,e){var r=e.domAPI(e);return r.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;r.update(t=e)}else r.remove()}}t.exports=function(t,s){var a=n(t=t||[],s=s||{});return function(t){t=t||[];for(var o=0;o<a.length;o++){var i=r(a[o]);e[i].references--}for(var c=n(t,s),u=0;u<a.length;u++){var l=r(a[u]);0===e[l].references&&(e[l].updater(),e.splice(l,1))}a=c}}},6793:t=>{"use strict";var e={};t.exports=function(t,r){var n=function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[t]=r}return e[t]}(t);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(r)}},1173:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},7892:(t,e,r)=>{"use strict";t.exports=function(t){var e=r.nc;e&&t.setAttribute("nonce",e)}},4036:t=>{"use strict";t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(r){!function(t,e,r){var n="";r.supports&&(n+="@supports (".concat(r.supports,") {")),r.media&&(n+="@media ".concat(r.media," {"));var s=void 0!==r.layer;s&&(n+="@layer".concat(r.layer.length>0?" ".concat(r.layer):""," {")),n+=r.css,s&&(n+="}"),r.media&&(n+="}"),r.supports&&(n+="}");var a=r.sourceMap;a&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleTagTransform(n,t,e.options)}(e,t,r)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},2464:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}}}]);
@@ -0,0 +1,16 @@
1
+ /*! (c) 2023 - present: Quentral Srl | https://github.com/selfcommunity/community-js/blob/master/LICENSE.md */
2
+
3
+ /*! *****************************************************************************
4
+ Copyright (c) Microsoft Corporation.
5
+
6
+ Permission to use, copy, modify, and/or distribute this software for any
7
+ purpose with or without fee is hereby granted.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
+ PERFORMANCE OF THIS SOFTWARE.
16
+ ***************************************************************************** */