@descope/web-components-ui 1.0.44 → 1.0.46

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,57 @@
1
+ import {
2
+ getComponentName,
3
+ createStyleMixin,
4
+ draggableMixin,
5
+ compose,
6
+ componentNameValidationMixin
7
+ } from '../../componentsHelpers';
8
+
9
+ export const componentName = getComponentName('logo');
10
+
11
+ let style
12
+ const getStyle = () => style;
13
+
14
+ class RawLogo extends HTMLElement {
15
+ static get componentName() {
16
+ return componentName;
17
+ }
18
+ constructor() {
19
+ super();
20
+ const template = document.createElement('template');
21
+ template.innerHTML = `
22
+ <style>
23
+ ${getStyle()}
24
+ </style>
25
+ <div></div>`;
26
+
27
+ this.attachShadow({ mode: 'open' });
28
+ this.shadowRoot.appendChild(template.content.cloneNode(true));
29
+
30
+ this.baseSelector = ':host > div';
31
+ }
32
+ }
33
+
34
+ const Logo = compose(
35
+ createStyleMixin({
36
+ mappings: {
37
+ height: {},
38
+ width: {},
39
+ url: {},
40
+ fallbackUrl: {},
41
+ }
42
+ }),
43
+ draggableMixin,
44
+ componentNameValidationMixin
45
+ )(RawLogo);
46
+
47
+ style = `
48
+ :host {
49
+ display: inline-block;
50
+ }
51
+ :host > div {
52
+ display: inline-block;
53
+ content: var(${Logo.cssVarList.url}, var(${Logo.cssVarList.fallbackUrl}));
54
+ }
55
+ `
56
+
57
+ export default Logo;
@@ -0,0 +1,5 @@
1
+ import Logo, { componentName } from './Logo';
2
+
3
+ customElements.define(componentName, Logo);
4
+
5
+ export { Logo };
package/src/dev/index.js CHANGED
@@ -1,7 +1,2 @@
1
- import theme from '../theme';
2
- import { themeToStyle } from '../themeHelpers';
3
-
4
- // this file is used for exposing stuff to the dev env only
5
-
6
- export const getDefaultThemeStyles = (themeName) =>
7
- themeToStyle(theme, themeName);
1
+ export {default as defaultTheme} from '../theme';
2
+ export { themeToStyle } from '../themeHelpers';
@@ -7,6 +7,7 @@ import textArea from './textArea';
7
7
  import checkbox from './checkbox';
8
8
  import switchToggle from './switchToggle';
9
9
  import container from './container';
10
+ import logo from './logo';
10
11
 
11
12
  export default {
12
13
  button,
@@ -17,5 +18,6 @@ export default {
17
18
  textArea,
18
19
  checkbox,
19
20
  switchToggle,
20
- container
21
+ container,
22
+ logo
21
23
  };
@@ -0,0 +1,9 @@
1
+ import Logo from "../../components/descope-logo/Logo";
2
+
3
+ const vars = Logo.cssVarList
4
+
5
+ const logo = {
6
+ [vars.fallbackUrl]: 'url(https://content.app.descope.com/assets/flows/noLogoPlaceholder.svg)'
7
+ };
8
+
9
+ export default logo;
@@ -46,7 +46,7 @@ export const textField = (vars) => ({
46
46
  [vars.borderWidthReadOnly]: '0',
47
47
  [vars.borderRadius]: globalRefs.radius.sm,
48
48
 
49
- _borderoffset: {
49
+ _borderOffset: {
50
50
  [vars.outlineOffset]: '2px'
51
51
  },
52
52