Socket
Socket
Sign inDemoInstall

@lion/switch

Package Overview
Dependencies
14
Maintainers
1
Versions
132
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.19.0 to 0.20.0

42

docs/overview.md

@@ -1,2 +0,2 @@

# Interaction >> Switch >> Overview ||10
# Switch >> Overview ||10

@@ -45,30 +45,30 @@ <p class="lion-paragraph--emphasis">The Switch is used to toggle a property or feature on or off.</p>

```bash
npm i --save @lion/switch
```
```bash
npm i --save @lion/switch
```
2. Use scoped registry
```js
import { html, LitElement, ScopedElementsMixin } from '@lion/core';
import { LionSwitch } from '@lion/switch';
```js
import { html, LitElement, ScopedElementsMixin } from '@lion/core';
import { LionSwitch } from '@lion/switch';
class MyComponent extends ScopedElementsMixin(LitElement) {
static get scopedElements() {
return { 'lion-switch': LionSwitch };
}
render() {
return html`<lion-switch></lion-switch>`;
}
class MyComponent extends ScopedElementsMixin(LitElement) {
static get scopedElements() {
return { 'lion-switch': LionSwitch };
}
```
render() {
return html`<lion-switch></lion-switch>`;
}
}
```
3. Use html
```html
<script type="module">
import '@lion/switch/define-switch';
</script>
```html
<script type="module">
import '@lion/switch/define-switch';
</script>
<lion-switch></lion-switch>
```
<lion-switch></lion-switch>
```

@@ -1,2 +0,2 @@

# Interaction >> Switch >> Reference ||30
# Switch >> Reference ||30

@@ -3,0 +3,0 @@ <p class="lion-paragraph--emphasis">Everything you need to re-use the switch.</p>

@@ -1,2 +0,2 @@

# Interaction >> Switch >> Use Cases ||20
# Switch >> Use Cases ||20

@@ -3,0 +3,0 @@ ```js script

{
"name": "@lion/switch",
"version": "0.19.0",
"version": "0.20.0",
"description": "A Switch is used for switching a property or feature on and off",

@@ -41,5 +41,5 @@ "license": "MIT",

"dependencies": {
"@lion/core": "^0.21.0",
"@lion/form-core": "^0.16.0",
"@lion/helpers": "^0.10.0"
"@lion/core": "^0.22.0",
"@lion/form-core": "^0.17.0",
"@lion/helpers": "^0.11.0"
},

@@ -46,0 +46,0 @@ "keywords": [

@@ -1,2 +0,2 @@

# Interaction >> Switch >> Overview ||10
# Switch >> Overview ||10

@@ -45,30 +45,30 @@ <p class="lion-paragraph--emphasis">The Switch is used to toggle a property or feature on or off.</p>

```bash
npm i --save @lion/switch
```
```bash
npm i --save @lion/switch
```
2. Use scoped registry
```js
import { html, LitElement, ScopedElementsMixin } from '@lion/core';
import { LionSwitch } from '@lion/switch';
```js
import { html, LitElement, ScopedElementsMixin } from '@lion/core';
import { LionSwitch } from '@lion/switch';
class MyComponent extends ScopedElementsMixin(LitElement) {
static get scopedElements() {
return { 'lion-switch': LionSwitch };
}
render() {
return html`<lion-switch></lion-switch>`;
}
class MyComponent extends ScopedElementsMixin(LitElement) {
static get scopedElements() {
return { 'lion-switch': LionSwitch };
}
```
render() {
return html`<lion-switch></lion-switch>`;
}
}
```
3. Use html
```html
<script type="module">
import '@lion/switch/define-switch';
</script>
```html
<script type="module">
import '@lion/switch/define-switch';
</script>
<lion-switch></lion-switch>
```
<lion-switch></lion-switch>
```

@@ -1,2 +0,2 @@

declare const LionSwitch_base: typeof LionField & import("@open-wc/dedupe-mixin").Constructor<import("@lion/form-core/types/choice-group/ChoiceInputMixinTypes").ChoiceInputHost> & Pick<typeof import("@lion/form-core/types/choice-group/ChoiceInputMixinTypes").ChoiceInputHost, "prototype" | "styles"> & import("@open-wc/dedupe-mixin").Constructor<import("@lion/form-core/types/FormatMixinTypes").FormatHost> & Pick<typeof import("@lion/form-core/types/FormatMixinTypes").FormatHost, "prototype"> & Pick<typeof import("@lion/core").LitElement, "prototype" | "_$litElement$" | "enabledWarnings" | "enableWarning" | "disableWarning" | "addInitializer" | "_initializers" | "elementProperties" | "properties" | "elementStyles" | "styles" | "observedAttributes" | "createProperty" | "shadowRootOptions"> & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types/src/types").ScopedElementsHost>;
declare const LionSwitch_base: typeof LionField & import("@open-wc/dedupe-mixin").Constructor<import("@lion/form-core/types").ChoiceInputHost> & Pick<typeof import("@lion/form-core/types").ChoiceInputHost, "prototype" | "styles"> & import("@open-wc/dedupe-mixin").Constructor<import("@lion/form-core/types").FormatHost> & Pick<typeof import("@lion/form-core/types").FormatHost, "prototype"> & Pick<typeof import("@lion/core").LitElement, "prototype" | "_$litElement$" | "enabledWarnings" | "enableWarning" | "disableWarning" | "addInitializer" | "_initializers" | "elementProperties" | "properties" | "elementStyles" | "styles" | "observedAttributes" | "createProperty" | "shadowRootOptions"> & import("@open-wc/dedupe-mixin").Constructor<import("@lion/core/node_modules/@open-wc/scoped-elements/types/src/types").ScopedElementsHost>;
export class LionSwitch extends LionSwitch_base {

@@ -3,0 +3,0 @@ static get styles(): (import("lit").CSSResultOrNative | import("@lion/core").CSSResultArray)[];

@@ -45,4 +45,3 @@ import { css, html, ScopedElementsMixin } from '@lion/core';

input: () => {
// @ts-ignore we load a polyfill to support createElement on shadowRoot
const btnEl = this.shadowRoot.createElement('lion-switch-button');
const btnEl = this.createScopedElement('lion-switch-button');
btnEl.setAttribute('data-tag-name', 'lion-switch-button');

@@ -49,0 +48,0 @@ return btnEl;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc