@trendyol/baklava 2.0.0-beta.59 → 2.0.0-beta.60
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/baklava-react.d.ts +2 -0
- package/dist/baklava-react.d.ts.map +1 -1
- package/dist/baklava-react.js +1 -1
- package/dist/baklava-react.js.map +3 -3
- package/dist/baklava.d.ts +1 -0
- package/dist/baklava.d.ts.map +1 -1
- package/dist/baklava.js +1 -1
- package/dist/chunk-K7ADOVTV.js +14 -0
- package/dist/chunk-K7ADOVTV.js.map +7 -0
- package/dist/components/switch/bl-switch.d.ts +30 -0
- package/dist/components/switch/bl-switch.d.ts.map +1 -0
- package/dist/components/switch/bl-switch.js +2 -0
- package/dist/components/switch/bl-switch.js.map +7 -0
- package/dist/components/switch/bl-switch.test.d.ts +2 -0
- package/dist/components/switch/bl-switch.test.d.ts.map +1 -0
- package/dist/components/tab-group/bl-tab-group.js +1 -1
- package/dist/custom-elements.json +80 -0
- package/package.json +1 -1
package/dist/baklava-react.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import type BlPaginationType from "./components/pagination/bl-pagination";
|
|
|
12
12
|
import type BlProgressIndicatorType from "./components/progress-indicator/bl-progress-indicator";
|
|
13
13
|
import type BlRadioGroupType from "./components/radio-group/bl-radio-group";
|
|
14
14
|
import type BlSelectType from "./components/select/bl-select";
|
|
15
|
+
import type BlSwitchType from "./components/switch/bl-switch";
|
|
15
16
|
import type BlTabGroupType from "./components/tab-group/bl-tab-group";
|
|
16
17
|
import type BlTooltipType from "./components/tooltip/bl-tooltip";
|
|
17
18
|
import type BlCheckboxType from "./components/checkbox-group/checkbox/bl-checkbox";
|
|
@@ -34,6 +35,7 @@ export declare const BlPagination: React.LazyExoticComponent<import("@lit-labs/r
|
|
|
34
35
|
export declare const BlProgressIndicator: React.LazyExoticComponent<import("@lit-labs/react").ReactWebComponent<BlProgressIndicatorType, {}>>;
|
|
35
36
|
export declare const BlRadioGroup: React.LazyExoticComponent<import("@lit-labs/react").ReactWebComponent<BlRadioGroupType, {}>>;
|
|
36
37
|
export declare const BlSelect: React.LazyExoticComponent<import("@lit-labs/react").ReactWebComponent<BlSelectType, {}>>;
|
|
38
|
+
export declare const BlSwitch: React.LazyExoticComponent<import("@lit-labs/react").ReactWebComponent<BlSwitchType, {}>>;
|
|
37
39
|
export declare const BlTabGroup: React.LazyExoticComponent<import("@lit-labs/react").ReactWebComponent<BlTabGroupType, {}>>;
|
|
38
40
|
export declare const BlTooltip: React.LazyExoticComponent<import("@lit-labs/react").ReactWebComponent<BlTooltipType, {}>>;
|
|
39
41
|
export declare const BlCheckbox: React.LazyExoticComponent<import("@lit-labs/react").ReactWebComponent<BlCheckboxType, {}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baklava-react.d.ts","sourceRoot":"","sources":["../src/baklava-react.ts"],"names":[],"mappings":"AAEI,OAAO,KAAK,MAAM,OAAO,CAAC;AAE9B,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,YAAY,MAAM,+BAA+B,CAAC;AAC9D,OAAO,KAAK,mBAAmB,MAAM,+CAA+C,CAAC;AACrF,OAAO,KAAK,YAAY,MAAM,+BAA+B,CAAC;AAC9D,OAAO,KAAK,YAAY,MAAM,+BAA+B,CAAC;AAC9D,OAAO,KAAK,cAAc,MAAM,mCAAmC,CAAC;AACpE,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,gBAAgB,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,uBAAuB,MAAM,uDAAuD,CAAC;AACjG,OAAO,KAAK,gBAAgB,MAAM,yCAAyC,CAAC;AAC5E,OAAO,KAAK,YAAY,MAAM,+BAA+B,CAAC;AAC9D,OAAO,KAAK,cAAc,MAAM,qC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,OAAO,yFAWnB,CAAC;AAIF,eAAO,MAAM,QAAQ,0FAWpB,CAAC;AAIF,eAAO,MAAM,eAAe,iGAW3B,CAAC;AAIF,eAAO,MAAM,QAAQ,0FAWpB,CAAC;AAIF,eAAO,MAAM,QAAQ,0FAWpB,CAAC;AAIF,eAAO,MAAM,UAAU,4FAWtB,CAAC;AAIF,eAAO,MAAM,MAAM,wFAWlB,CAAC;AAIF,eAAO,MAAM,OAAO,yFAWnB,CAAC;AAIF,eAAO,MAAM,YAAY,8FAWxB,CAAC;AAIF,eAAO,MAAM,mBAAmB,qGAW/B,CAAC;AAIF,eAAO,MAAM,YAAY,8FAWxB,CAAC;AAIF,eAAO,MAAM,QAAQ,0FAWpB,CAAC;AAIF,eAAO,MAAM,QAAQ,0FAWpB,CAAC;AAIF,eAAO,MAAM,UAAU,4FAWtB,CAAC;AAIF,eAAO,MAAM,SAAS,2FAWrB,CAAC;AAIF,eAAO,MAAM,UAAU,4FAWtB,CAAC;AAIF,eAAO,MAAM,eAAe,iGAW3B,CAAC;AAIF,eAAO,MAAM,cAAc,gGAW1B,CAAC;AAIF,eAAO,MAAM,OAAO,yFAWnB,CAAC;AAIF,eAAO,MAAM,cAAc,gGAW1B,CAAC;AAIF,eAAO,MAAM,KAAK,uFAWjB,CAAC;AAIF,eAAO,MAAM,UAAU,4FAWtB,CAAC"}
|
package/dist/baklava-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./chunk-NZ3RGSR6.js";import t from"react";var v=new Set(["children","localName","ref","style","className"]),C=new WeakMap,x=(e,m,u,h,y)=>{let p=y==null?void 0:y[m];p===void 0||u===h?u==null&&m in HTMLElement.prototype?e.removeAttribute(m):e[m]=u:((r,l,g)=>{let s=C.get(r);s===void 0&&C.set(r,s=new Map);let c=s.get(l);g!==void 0?c===void 0?(s.set(l,c={handleEvent:g}),r.addEventListener(l,c)):c.handleEvent=g:c!==void 0&&(s.delete(l),r.removeEventListener(l,c))})(e,p,u)};function o(e=window.React,m,u,h,y){let p,r,l;if(m===void 0){let d=e;({tagName:r,elementClass:l,events:h,displayName:y}=d),p=d.react}else p=e,l=u,r=m;let g=p.Component,s=p.createElement,c=new Set(Object.keys(h!=null?h:{}));class f extends g{constructor(){super(...arguments),this.o=null}t(a){if(this.o!==null)for(let i in this.i)x(this.o,i,this.props[i],a?a[i]:void 0,h)}componentDidMount(){this.t()}componentDidUpdate(a){this.t(a)}render(){var a;let i=(a=this.props._$Gl)!==null&&a!==void 0?a:null;this.h!==void 0&&this.u===i||(this.h=n=>{this.o===null&&(this.o=n),i!==null&&((b,T)=>{typeof b=="function"?b(T):b.current=T})(i,n),this.u=i});let B={ref:this.h};this.i={};for(let[n,b]of Object.entries(this.props))n!=="__forwardedRef"&&(v.has(n)?B[n==="className"?"class":n]=b:c.has(n)||n in l.prototype?this.i[n]=b:B[n]=b);return s(r,B)}}f.displayName=y!=null?y:l.name;let w=p.forwardRef((d,a)=>s(f,{...d,_$Gl:a},d==null?void 0:d.children));return w.displayName=f.displayName,w}var G=t.lazy(()=>customElements.whenDefined("bl-alert").then(e=>({default:o({react:t,tagName:"bl-alert",elementClass:e,events:{onClose:"bl-close"}})}))),I=t.lazy(()=>customElements.whenDefined("bl-badge").then(e=>({default:o({react:t,tagName:"bl-badge",elementClass:e,events:{}})}))),S=t.lazy(()=>customElements.whenDefined("bl-button").then(e=>({default:o({react:t,tagName:"bl-button",elementClass:e,events:{onClick:"bl-click"}})}))),R=t.lazy(()=>customElements.whenDefined("bl-checkbox-group").then(e=>({default:o({react:t,tagName:"bl-checkbox-group",elementClass:e,events:{onChange:"bl-checkbox-group-change"}})}))),O=t.lazy(()=>customElements.whenDefined("bl-dialog").then(e=>({default:o({react:t,tagName:"bl-dialog",elementClass:e,events:{onOpen:"bl-dialog-open",onClose:"bl-dialog-close"}})}))),P=t.lazy(()=>customElements.whenDefined("bl-drawer").then(e=>({default:o({react:t,tagName:"bl-drawer",elementClass:e,events:{onOpen:"bl-drawer-open",onClose:"bl-drawer-close"}})}))),A=t.lazy(()=>customElements.whenDefined("bl-dropdown").then(e=>({default:o({react:t,tagName:"bl-dropdown",elementClass:e,events:{onOpen:"bl-dropdown-open",onClose:"bl-dropdown-close"}})}))),L=t.lazy(()=>customElements.whenDefined("bl-icon").then(e=>({default:o({react:t,tagName:"bl-icon",elementClass:e,events:{onLoad:"bl-load",onError:"bl-error"}})}))),M=t.lazy(()=>customElements.whenDefined("bl-input").then(e=>({default:o({react:t,tagName:"bl-input",elementClass:e,events:{onChange:"bl-change",onInput:"bl-input",onInvalid:"bl-invalid"}})}))),_=t.lazy(()=>customElements.whenDefined("bl-pagination").then(e=>({default:o({react:t,tagName:"bl-pagination",elementClass:e,events:{onChange:"bl-change"}})}))),j=t.lazy(()=>customElements.whenDefined("bl-progress-indicator").then(e=>({default:o({react:t,tagName:"bl-progress-indicator",elementClass:e,events:{}})}))),F=t.lazy(()=>customElements.whenDefined("bl-radio-group").then(e=>({default:o({react:t,tagName:"bl-radio-group",elementClass:e,events:{onChange:"bl-radio-change"}})}))),H=t.lazy(()=>customElements.whenDefined("bl-select").then(e=>({default:o({react:t,tagName:"bl-select",elementClass:e,events:{onSelect:"bl-select"}})}))),$=t.lazy(()=>customElements.whenDefined("bl-tab-group").then(e=>({default:o({react:t,tagName:"bl-tab-group",elementClass:e,events:{}})}))),
|
|
1
|
+
import"./chunk-NZ3RGSR6.js";import t from"react";var v=new Set(["children","localName","ref","style","className"]),C=new WeakMap,x=(e,m,u,h,y)=>{let p=y==null?void 0:y[m];p===void 0||u===h?u==null&&m in HTMLElement.prototype?e.removeAttribute(m):e[m]=u:((r,l,g)=>{let s=C.get(r);s===void 0&&C.set(r,s=new Map);let c=s.get(l);g!==void 0?c===void 0?(s.set(l,c={handleEvent:g}),r.addEventListener(l,c)):c.handleEvent=g:c!==void 0&&(s.delete(l),r.removeEventListener(l,c))})(e,p,u)};function o(e=window.React,m,u,h,y){let p,r,l;if(m===void 0){let d=e;({tagName:r,elementClass:l,events:h,displayName:y}=d),p=d.react}else p=e,l=u,r=m;let g=p.Component,s=p.createElement,c=new Set(Object.keys(h!=null?h:{}));class f extends g{constructor(){super(...arguments),this.o=null}t(a){if(this.o!==null)for(let i in this.i)x(this.o,i,this.props[i],a?a[i]:void 0,h)}componentDidMount(){this.t()}componentDidUpdate(a){this.t(a)}render(){var a;let i=(a=this.props._$Gl)!==null&&a!==void 0?a:null;this.h!==void 0&&this.u===i||(this.h=n=>{this.o===null&&(this.o=n),i!==null&&((b,T)=>{typeof b=="function"?b(T):b.current=T})(i,n),this.u=i});let B={ref:this.h};this.i={};for(let[n,b]of Object.entries(this.props))n!=="__forwardedRef"&&(v.has(n)?B[n==="className"?"class":n]=b:c.has(n)||n in l.prototype?this.i[n]=b:B[n]=b);return s(r,B)}}f.displayName=y!=null?y:l.name;let w=p.forwardRef((d,a)=>s(f,{...d,_$Gl:a},d==null?void 0:d.children));return w.displayName=f.displayName,w}var G=t.lazy(()=>customElements.whenDefined("bl-alert").then(e=>({default:o({react:t,tagName:"bl-alert",elementClass:e,events:{onClose:"bl-close"}})}))),I=t.lazy(()=>customElements.whenDefined("bl-badge").then(e=>({default:o({react:t,tagName:"bl-badge",elementClass:e,events:{}})}))),S=t.lazy(()=>customElements.whenDefined("bl-button").then(e=>({default:o({react:t,tagName:"bl-button",elementClass:e,events:{onClick:"bl-click"}})}))),R=t.lazy(()=>customElements.whenDefined("bl-checkbox-group").then(e=>({default:o({react:t,tagName:"bl-checkbox-group",elementClass:e,events:{onChange:"bl-checkbox-group-change"}})}))),O=t.lazy(()=>customElements.whenDefined("bl-dialog").then(e=>({default:o({react:t,tagName:"bl-dialog",elementClass:e,events:{onOpen:"bl-dialog-open",onClose:"bl-dialog-close"}})}))),P=t.lazy(()=>customElements.whenDefined("bl-drawer").then(e=>({default:o({react:t,tagName:"bl-drawer",elementClass:e,events:{onOpen:"bl-drawer-open",onClose:"bl-drawer-close"}})}))),A=t.lazy(()=>customElements.whenDefined("bl-dropdown").then(e=>({default:o({react:t,tagName:"bl-dropdown",elementClass:e,events:{onOpen:"bl-dropdown-open",onClose:"bl-dropdown-close"}})}))),L=t.lazy(()=>customElements.whenDefined("bl-icon").then(e=>({default:o({react:t,tagName:"bl-icon",elementClass:e,events:{onLoad:"bl-load",onError:"bl-error"}})}))),M=t.lazy(()=>customElements.whenDefined("bl-input").then(e=>({default:o({react:t,tagName:"bl-input",elementClass:e,events:{onChange:"bl-change",onInput:"bl-input",onInvalid:"bl-invalid"}})}))),_=t.lazy(()=>customElements.whenDefined("bl-pagination").then(e=>({default:o({react:t,tagName:"bl-pagination",elementClass:e,events:{onChange:"bl-change"}})}))),j=t.lazy(()=>customElements.whenDefined("bl-progress-indicator").then(e=>({default:o({react:t,tagName:"bl-progress-indicator",elementClass:e,events:{}})}))),F=t.lazy(()=>customElements.whenDefined("bl-radio-group").then(e=>({default:o({react:t,tagName:"bl-radio-group",elementClass:e,events:{onChange:"bl-radio-change"}})}))),H=t.lazy(()=>customElements.whenDefined("bl-select").then(e=>({default:o({react:t,tagName:"bl-select",elementClass:e,events:{onSelect:"bl-select"}})}))),$=t.lazy(()=>customElements.whenDefined("bl-switch").then(e=>({default:o({react:t,tagName:"bl-switch",elementClass:e,events:{onToggle:"bl-switch-toggle"}})}))),U=t.lazy(()=>customElements.whenDefined("bl-tab-group").then(e=>({default:o({react:t,tagName:"bl-tab-group",elementClass:e,events:{}})}))),W=t.lazy(()=>customElements.whenDefined("bl-tooltip").then(e=>({default:o({react:t,tagName:"bl-tooltip",elementClass:e,events:{onShow:"bl-tooltip-show",onHide:"bl-tooltip-hide"}})}))),q=t.lazy(()=>customElements.whenDefined("bl-checkbox").then(e=>({default:o({react:t,tagName:"bl-checkbox",elementClass:e,events:{onChange:"bl-checkbox-change",onFocus:"bl-focus",onBlur:"bl-blur"}})}))),J=t.lazy(()=>customElements.whenDefined("bl-dropdown-group").then(e=>({default:o({react:t,tagName:"bl-dropdown-group",elementClass:e,events:{}})}))),K=t.lazy(()=>customElements.whenDefined("bl-dropdown-item").then(e=>({default:o({react:t,tagName:"bl-dropdown-item",elementClass:e,events:{onClick:"bl-dropdown-item-click"}})}))),Q=t.lazy(()=>customElements.whenDefined("bl-radio").then(e=>({default:o({react:t,tagName:"bl-radio",elementClass:e,events:{onChecked:"bl-checked",onFocus:"bl-focus",onBlur:"bl-blur"}})}))),V=t.lazy(()=>customElements.whenDefined("bl-select-option").then(e=>({default:o({react:t,tagName:"bl-select-option",elementClass:e,events:{onOption:"bl-select-option"}})}))),X=t.lazy(()=>customElements.whenDefined("bl-tab").then(e=>({default:o({react:t,tagName:"bl-tab",elementClass:e,events:{onSelected:"bl-tab-selected"}})}))),Y=t.lazy(()=>customElements.whenDefined("bl-tab-panel").then(e=>({default:o({react:t,tagName:"bl-tab-panel",elementClass:e,events:{}})})));export{G as BlAlert,I as BlBadge,S as BlButton,q as BlCheckbox,R as BlCheckboxGroup,O as BlDialog,P as BlDrawer,A as BlDropdown,J as BlDropdownGroup,K as BlDropdownItem,L as BlIcon,M as BlInput,_ as BlPagination,j as BlProgressIndicator,Q as BlRadio,F as BlRadioGroup,H as BlSelect,V as BlSelectOption,$ as BlSwitch,X as BlTab,U as BlTabGroup,Y as BlTabPanel,W as BlTooltip};
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2018 Google LLC
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/baklava-react.ts", "../node_modules/@lit-labs/react/src/create-component.ts"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable @typescript-eslint/ban-ts-comment */\n // @ts-nocheck\n import React from 'react';\nimport { createComponent } from '@lit-labs/react';\nimport type BlAlertType from \"./components/alert/bl-alert\";\nimport type BlBadgeType from \"./components/badge/bl-badge\";\nimport type BlButtonType from \"./components/button/bl-button\";\nimport type BlCheckboxGroupType from \"./components/checkbox-group/bl-checkbox-group\";\nimport type BlDialogType from \"./components/dialog/bl-dialog\";\nimport type BlDrawerType from \"./components/drawer/bl-drawer\";\nimport type BlDropdownType from \"./components/dropdown/bl-dropdown\";\nimport type BlIconType from \"./components/icon/bl-icon\";\nimport type BlInputType from \"./components/input/bl-input\";\nimport type BlPaginationType from \"./components/pagination/bl-pagination\";\nimport type BlProgressIndicatorType from \"./components/progress-indicator/bl-progress-indicator\";\nimport type BlRadioGroupType from \"./components/radio-group/bl-radio-group\";\nimport type BlSelectType from \"./components/select/bl-select\";\nimport type BlTabGroupType from \"./components/tab-group/bl-tab-group\";\nimport type BlTooltipType from \"./components/tooltip/bl-tooltip\";\nimport type BlCheckboxType from \"./components/checkbox-group/checkbox/bl-checkbox\";\nimport type BlDropdownGroupType from \"./components/dropdown/group/bl-dropdown-group\";\nimport type BlDropdownItemType from \"./components/dropdown/item/bl-dropdown-item\";\nimport type BlRadioType from \"./components/radio-group/radio/bl-radio\";\nimport type BlSelectOptionType from \"./components/select/option/bl-select-option\";\nimport type BlTabType from \"./components/tab-group/tab/bl-tab\";\nimport type BlTabPanelType from \"./components/tab-group/tab-panel/bl-tab-panel\";\n \n export const BlAlert = React.lazy(() =>\n customElements.whenDefined('bl-alert').then(elem => ({\n default: createComponent<BlAlertType>(\n {\n react: React,\n tagName: 'bl-alert',\n elementClass: elem,\n events:{\"onClose\":\"bl-close\"}\n }\n )\n })\n ));\n \n\n\n export const BlBadge = React.lazy(() =>\n customElements.whenDefined('bl-badge').then(elem => ({\n default: createComponent<BlBadgeType>(\n {\n react: React,\n tagName: 'bl-badge',\n elementClass: elem,\n events:{}\n }\n )\n })\n ));\n \n\n\n export const BlButton = React.lazy(() =>\n customElements.whenDefined('bl-button').then(elem => ({\n default: createComponent<BlButtonType>(\n {\n react: React,\n tagName: 'bl-button',\n elementClass: elem,\n events:{\"onClick\":\"bl-click\"}\n }\n )\n })\n ));\n \n\n\n export const BlCheckboxGroup = React.lazy(() =>\n customElements.whenDefined('bl-checkbox-group').then(elem => ({\n default: createComponent<BlCheckboxGroupType>(\n {\n react: React,\n tagName: 'bl-checkbox-group',\n elementClass: elem,\n events:{\"onChange\":\"bl-checkbox-group-change\"}\n }\n )\n })\n ));\n \n\n\n export const BlDialog = React.lazy(() =>\n customElements.whenDefined('bl-dialog').then(elem => ({\n default: createComponent<BlDialogType>(\n {\n react: React,\n tagName: 'bl-dialog',\n elementClass: elem,\n events:{\"onOpen\":\"bl-dialog-open\",\"onClose\":\"bl-dialog-close\"}\n }\n )\n })\n ));\n \n\n\n export const BlDrawer = React.lazy(() =>\n customElements.whenDefined('bl-drawer').then(elem => ({\n default: createComponent<BlDrawerType>(\n {\n react: React,\n tagName: 'bl-drawer',\n elementClass: elem,\n events:{\"onOpen\":\"bl-drawer-open\",\"onClose\":\"bl-drawer-close\"}\n }\n )\n })\n ));\n \n\n\n export const BlDropdown = React.lazy(() =>\n customElements.whenDefined('bl-dropdown').then(elem => ({\n default: createComponent<BlDropdownType>(\n {\n react: React,\n tagName: 'bl-dropdown',\n elementClass: elem,\n events:{\"onOpen\":\"bl-dropdown-open\",\"onClose\":\"bl-dropdown-close\"}\n }\n )\n })\n ));\n \n\n\n export const BlIcon = React.lazy(() =>\n customElements.whenDefined('bl-icon').then(elem => ({\n default: createComponent<BlIconType>(\n {\n react: React,\n tagName: 'bl-icon',\n elementClass: elem,\n events:{\"onLoad\":\"bl-load\",\"onError\":\"bl-error\"}\n }\n )\n })\n ));\n \n\n\n export const BlInput = React.lazy(() =>\n customElements.whenDefined('bl-input').then(elem => ({\n default: createComponent<BlInputType>(\n {\n react: React,\n tagName: 'bl-input',\n elementClass: elem,\n events:{\"onChange\":\"bl-change\",\"onInput\":\"bl-input\",\"onInvalid\":\"bl-invalid\"}\n }\n )\n })\n ));\n \n\n\n export const BlPagination = React.lazy(() =>\n customElements.whenDefined('bl-pagination').then(elem => ({\n default: createComponent<BlPaginationType>(\n {\n react: React,\n tagName: 'bl-pagination',\n elementClass: elem,\n events:{\"onChange\":\"bl-change\"}\n }\n )\n })\n ));\n \n\n\n export const BlProgressIndicator = React.lazy(() =>\n customElements.whenDefined('bl-progress-indicator').then(elem => ({\n default: createComponent<BlProgressIndicatorType>(\n {\n react: React,\n tagName: 'bl-progress-indicator',\n elementClass: elem,\n events:{}\n }\n )\n })\n ));\n \n\n\n export const BlRadioGroup = React.lazy(() =>\n customElements.whenDefined('bl-radio-group').then(elem => ({\n default: createComponent<BlRadioGroupType>(\n {\n react: React,\n tagName: 'bl-radio-group',\n elementClass: elem,\n events:{\"onChange\":\"bl-radio-change\"}\n }\n )\n })\n ));\n \n\n\n export const BlSelect = React.lazy(() =>\n customElements.whenDefined('bl-select').then(elem => ({\n default: createComponent<BlSelectType>(\n {\n react: React,\n tagName: 'bl-select',\n elementClass: elem,\n events:{\"onSelect\":\"bl-select\"}\n }\n )\n })\n ));\n \n\n\n export const BlTabGroup = React.lazy(() =>\n customElements.whenDefined('bl-tab-group').then(elem => ({\n default: createComponent<BlTabGroupType>(\n {\n react: React,\n tagName: 'bl-tab-group',\n elementClass: elem,\n events:{}\n }\n )\n })\n ));\n \n\n\n export const BlTooltip = React.lazy(() =>\n customElements.whenDefined('bl-tooltip').then(elem => ({\n default: createComponent<BlTooltipType>(\n {\n react: React,\n tagName: 'bl-tooltip',\n elementClass: elem,\n events:{\"onShow\":\"bl-tooltip-show\",\"onHide\":\"bl-tooltip-hide\"}\n }\n )\n })\n ));\n \n\n\n export const BlCheckbox = React.lazy(() =>\n customElements.whenDefined('bl-checkbox').then(elem => ({\n default: createComponent<BlCheckboxType>(\n {\n react: React,\n tagName: 'bl-checkbox',\n elementClass: elem,\n events:{\"onChange\":\"bl-checkbox-change\",\"onFocus\":\"bl-focus\",\"onBlur\":\"bl-blur\"}\n }\n )\n })\n ));\n \n\n\n export const BlDropdownGroup = React.lazy(() =>\n customElements.whenDefined('bl-dropdown-group').then(elem => ({\n default: createComponent<BlDropdownGroupType>(\n {\n react: React,\n tagName: 'bl-dropdown-group',\n elementClass: elem,\n events:{}\n }\n )\n })\n ));\n \n\n\n export const BlDropdownItem = React.lazy(() =>\n customElements.whenDefined('bl-dropdown-item').then(elem => ({\n default: createComponent<BlDropdownItemType>(\n {\n react: React,\n tagName: 'bl-dropdown-item',\n elementClass: elem,\n events:{\"onClick\":\"bl-dropdown-item-click\"}\n }\n )\n })\n ));\n \n\n\n export const BlRadio = React.lazy(() =>\n customElements.whenDefined('bl-radio').then(elem => ({\n default: createComponent<BlRadioType>(\n {\n react: React,\n tagName: 'bl-radio',\n elementClass: elem,\n events:{\"onChecked\":\"bl-checked\",\"onFocus\":\"bl-focus\",\"onBlur\":\"bl-blur\"}\n }\n )\n })\n ));\n \n\n\n export const BlSelectOption = React.lazy(() =>\n customElements.whenDefined('bl-select-option').then(elem => ({\n default: createComponent<BlSelectOptionType>(\n {\n react: React,\n tagName: 'bl-select-option',\n elementClass: elem,\n events:{\"onOption\":\"bl-select-option\"}\n }\n )\n })\n ));\n \n\n\n export const BlTab = React.lazy(() =>\n customElements.whenDefined('bl-tab').then(elem => ({\n default: createComponent<BlTabType>(\n {\n react: React,\n tagName: 'bl-tab',\n elementClass: elem,\n events:{\"onSelected\":\"bl-tab-selected\"}\n }\n )\n })\n ));\n \n\n\n export const BlTabPanel = React.lazy(() =>\n customElements.whenDefined('bl-tab-panel').then(elem => ({\n default: createComponent<BlTabPanelType>(\n {\n react: React,\n tagName: 'bl-tab-panel',\n elementClass: elem,\n events:{}\n }\n )\n })\n ));", "/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n// Match a prop name to a typed event callback by\n// adding an Event type as an expected property on a string.\nexport type EventName<T extends Event = Event> = string & {\n __event_type: T;\n};\n\n// A key value map matching React prop names to event names\ntype EventNames = Record<string, EventName | string>;\n\n// A map of expected event listener types based on EventNames\ntype EventListeners<R extends EventNames> = {\n [K in keyof R]: R[K] extends EventName\n ? (e: R[K]['__event_type']) => void\n : (e: Event) => void;\n};\n\ntype ReactProps<I, E> = Omit<React.HTMLAttributes<I>, keyof E>;\ntype ElementWithoutPropsOrEventListeners<I, E> = Omit<\n I,\n keyof E | keyof ReactProps<I, E>\n>;\n\n// Props the user is allowed to use, includes standard attributes, children,\n// ref, as well as special event and element properties.\nexport type WebComponentProps<\n I extends HTMLElement,\n E extends EventNames = {}\n> = Partial<\n ReactProps<I, E> &\n ElementWithoutPropsOrEventListeners<I, E> &\n EventListeners<E>\n>;\n\n// Props used by this component wrapper. This is the WebComponentProps and the\n// special `__forwardedRef` property. Note, this ref is special because\n// it's both needed in this component to get access to the rendered element\n// and must fulfill any ref passed by the user.\ntype ReactComponentProps<\n I extends HTMLElement,\n E extends EventNames = {}\n> = WebComponentProps<I, E> & {\n __forwardedRef?: React.Ref<I>;\n};\n\nexport type ReactWebComponent<\n I extends HTMLElement,\n E extends EventNames = {}\n> = React.ForwardRefExoticComponent<\n React.PropsWithoutRef<WebComponentProps<I, E>> & React.RefAttributes<I>\n>;\n\ninterface Options<I extends HTMLElement, E extends EventNames = {}> {\n tagName: string;\n elementClass: Constructor<I>;\n react: typeof window.React;\n events?: E;\n displayName?: string;\n}\n\ntype Constructor<T> = {new (): T};\n\nconst reservedReactProperties = new Set([\n 'children',\n 'localName',\n 'ref',\n 'style',\n 'className',\n]);\n\nconst listenedEvents: WeakMap<\n Element,\n Map<string, EventListenerObject>\n> = new WeakMap();\n\n/**\n * Adds an event listener for the specified event to the given node. In the\n * React setup, there should only ever be one event listener. Thus, for\n * efficiency only one listener is added and the handler for that listener is\n * updated to point to the given listener function.\n */\nconst addOrUpdateEventListener = (\n node: Element,\n event: string,\n listener: (event?: Event) => void\n) => {\n let events = listenedEvents.get(node);\n if (events === undefined) {\n listenedEvents.set(node, (events = new Map()));\n }\n let handler = events.get(event);\n if (listener !== undefined) {\n // If necessary, add listener and track handler\n if (handler === undefined) {\n events.set(event, (handler = {handleEvent: listener}));\n node.addEventListener(event, handler);\n // Otherwise just update the listener with new value\n } else {\n handler.handleEvent = listener;\n }\n // Remove listener if one exists and value is undefined\n } else if (handler !== undefined) {\n events.delete(event);\n node.removeEventListener(event, handler);\n }\n};\n\n/**\n * Sets properties and events on custom elements. These properties and events\n * have been pre-filtered so we know they should apply to the custom element.\n */\nconst setProperty = <E extends Element>(\n node: E,\n name: string,\n value: unknown,\n old: unknown,\n events?: EventNames\n) => {\n const event = events?.[name];\n if (event !== undefined && value !== old) {\n // Dirty check event value.\n addOrUpdateEventListener(node, event, value as (e?: Event) => void);\n return;\n }\n\n // Note, the attribute removal here for `undefined` and `null` values is done\n // to match React's behavior on non-custom elements. It needs special\n // handling because it does not match platform behavior. For example,\n // setting the `id` property to `undefined` sets the attribute to the string\n // \"undefined.\" React \"fixes\" that odd behavior and the code here matches\n // React's convention.\n if (\n (value === undefined || value === null) &&\n name in HTMLElement.prototype\n ) {\n node.removeAttribute(name);\n return;\n }\n\n // But don't dirty check properties; elements are assumed to do this.\n node[name as keyof E] = value as E[keyof E];\n};\n\n// Set a React ref. Note, there are 2 kinds of refs and there's no built in\n// React API to set a ref.\nconst setRef = (ref: React.Ref<unknown>, value: Element | null) => {\n if (typeof ref === 'function') {\n (ref as (e: Element | null) => void)(value);\n } else {\n (ref as {current: Element | null}).current = value;\n }\n};\n\n/**\n * Creates a React component for a custom element. Properties are distinguished\n * from attributes automatically, and events can be configured so they are\n * added to the custom element as event listeners.\n *\n * @param options An options bag containing the parameters needed to generate\n * a wrapped web component.\n *\n * @param options.react The React module, typically imported from the `react` npm\n * package.\n * @param options.tagName The custom element tag name registered via\n * `customElements.define`.\n * @param options.elementClass The custom element class registered via\n * `customElements.define`.\n * @param options.events An object listing events to which the component can listen. The\n * object keys are the event property names passed in via React props and the\n * object values are the names of the corresponding events generated by the\n * custom element. For example, given `{onactivate: 'activate'}` an event\n * function may be passed via the component's `onactivate` prop and will be\n * called when the custom element fires its `activate` event.\n * @param options.displayName A React component display name, used in debugging\n * messages. Default value is inferred from the name of custom element class\n * registered via `customElements.define`.\n */\nexport function createComponent<\n I extends HTMLElement,\n E extends EventNames = {}\n>(options: Options<I, E>): ReactWebComponent<I, E>;\n/**\n * @deprecated Use `createComponent(options)` instead of individual arguments.\n *\n * Creates a React component for a custom element. Properties are distinguished\n * from attributes automatically, and events can be configured so they are\n * added to the custom element as event listeners.\n *\n * @param React The React module, typically imported from the `react` npm\n * package.\n * @param tagName The custom element tag name registered via\n * `customElements.define`.\n * @param elementClass The custom element class registered via\n * `customElements.define`.\n * @param events An object listing events to which the component can listen. The\n * object keys are the event property names passed in via React props and the\n * object values are the names of the corresponding events generated by the\n * custom element. For example, given `{onactivate: 'activate'}` an event\n * function may be passed via the component's `onactivate` prop and will be\n * called when the custom element fires its `activate` event.\n * @param displayName A React component display name, used in debugging\n * messages. Default value is inferred from the name of custom element class\n * registered via `customElements.define`.\n */\nexport function createComponent<\n I extends HTMLElement,\n E extends EventNames = {}\n>(\n ReactOrOptions: typeof window.React,\n tagName: string,\n elementClass: Constructor<I>,\n events?: E,\n displayName?: string\n): ReactWebComponent<I, E>;\nexport function createComponent<\n I extends HTMLElement,\n E extends EventNames = {}\n>(\n ReactOrOptions: typeof window.React | Options<I, E> = window.React,\n tagName?: string,\n elementClass?: Constructor<I>,\n events?: E,\n displayName?: string\n): ReactWebComponent<I, E> {\n // digest overloaded parameters\n let React: typeof window.React;\n let tag: string;\n let element: Constructor<I>;\n if (tagName === undefined) {\n const options = ReactOrOptions as Options<I, E>;\n ({tagName: tag, elementClass: element, events, displayName} = options);\n React = options.react;\n } else {\n React = ReactOrOptions as typeof window.React;\n element = elementClass as Constructor<I>;\n tag = tagName;\n }\n\n const Component = React.Component;\n const createElement = React.createElement;\n const eventProps = new Set(Object.keys(events ?? {}));\n\n type Props = ReactComponentProps<I, E>;\n\n class ReactComponent extends Component<Props> {\n private _element: I | null = null;\n private _elementProps!: {[index: string]: unknown};\n private _userRef?: React.Ref<I>;\n private _ref?: React.RefCallback<I>;\n\n static displayName = displayName ?? element.name;\n\n private _updateElement(oldProps?: Props) {\n if (this._element === null) {\n return;\n }\n // Set element properties to the values in `this.props`\n for (const prop in this._elementProps) {\n setProperty(\n this._element,\n prop,\n this.props[prop],\n oldProps ? oldProps[prop] : undefined,\n events\n );\n }\n // Note, the spirit of React might be to \"unset\" any old values that\n // are no longer included; however, there's no reasonable value to set\n // them to so we just leave the previous state as is.\n }\n\n /**\n * Updates element properties correctly setting properties\n * on mount.\n */\n override componentDidMount() {\n this._updateElement();\n }\n\n /**\n * Updates element properties correctly setting properties\n * on every update. Note, this does not include mount.\n */\n override componentDidUpdate(old: Props) {\n this._updateElement(old);\n }\n\n /**\n * Renders the custom element with a `ref` prop which allows this\n * component to reference the custom element.\n *\n * Standard attributes are passed to React and element properties and events\n * are updated in componentDidMount/componentDidUpdate.\n *\n */\n override render() {\n // Since refs only get fulfilled once, pass a new one if the user's\n // ref changed. This allows refs to be fulfilled as expected, going from\n // having a value to null.\n const userRef = this.props.__forwardedRef ?? null;\n if (this._ref === undefined || this._userRef !== userRef) {\n this._ref = (value: I | null) => {\n if (this._element === null) {\n this._element = value;\n }\n if (userRef !== null) {\n setRef(userRef, value);\n }\n this._userRef = userRef;\n };\n }\n // Filters class properties out and passes the remaining\n // attributes to React. This allows attributes to use framework rules\n // for setting attributes and render correctly under SSR.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const props: any = {ref: this._ref};\n // Note, save element props while iterating to avoid the need to\n // iterate again when setting properties.\n this._elementProps = {};\n for (const [k, v] of Object.entries(this.props)) {\n if (k === '__forwardedRef') continue;\n\n if (reservedReactProperties.has(k)) {\n // React does *not* handle `className` for custom elements so\n // coerce it to `class` so it's handled correctly.\n props[k === 'className' ? 'class' : k] = v;\n continue;\n }\n\n if (eventProps.has(k) || k in element.prototype) {\n this._elementProps[k] = v;\n continue;\n }\n\n props[k] = v;\n }\n return createElement<React.HTMLAttributes<I>, I>(tag, props);\n }\n }\n\n const ForwardedComponent: ReactWebComponent<I, E> = React.forwardRef<\n I,\n WebComponentProps<I, E>\n >((props, ref) =>\n createElement<Props, ReactComponent, typeof ReactComponent>(\n ReactComponent,\n {...props, __forwardedRef: ref},\n props?.children\n )\n );\n\n // To ease debugging in the React Developer Tools\n ForwardedComponent.displayName = ReactComponent.displayName;\n\n return ForwardedComponent;\n}\n"],
|
|
5
|
-
"mappings": "4BAEI,OAAOA,MAAW,QCiEtB,IAAMC,EAA0B,IAAIC,IAAI,CACtC,WACA,YACA,MACA,QACA,WAAA,CAAA,EAGIC,EAGF,IAAIC,QAsCFC,EAAc,CAClBC,EACAC,EACAC,EACAC,EACAC,IAAAA,CAEA,IAAMC,EAAQD,GAAAA,KAAAA,OAAAA,EAASH,GACnBI,IADmBJ,QACIC,IAAUC,EAalCD,GAAD,MACAD,KAAQK,YAAYC,UAEpBP,EAAKQ,gBAAgBP,CAAAA,EAKvBD,EAAKC,GAAmBC,GA3DO,CAC/BF,EACAK,EACAI,IAAAA,CAEA,IAAIL,EAASP,EAAea,IAAIV,CAAAA,EAC5BI,IAD4BJ,QAE9BH,EAAec,IAAIX,EAAOI,EAAS,IAAIQ,GAAAA,EAEzC,IAAIC,EAAUT,EAAOM,IAAIL,CAAAA,EACrBI,IADqBJ,OAGnBQ,IAFFJ,QAGAL,EAAOO,IAAIN,EAAQQ,EAAU,CAACC,YAAaL,CAAAA,CAAAA,EAC3CT,EAAKe,iBAAiBV,EAAOQ,CAAAA,GAG7BA,EAAQC,YAAcL,EAGfI,IAHeJ,SAIxBL,EAAOY,OAAOX,CAAAA,EACdL,EAAKiB,oBAAoBZ,EAAOQ,CAAAA,EACjC,GAiB0Bb,EAAMK,EAAOH,CAAAA,CAmBG,EA0E7B,SAAAgB,EAIdC,EAAsDC,OAAOC,MAC7DC,EACAC,EACAnB,EACAoB,EAAAA,CAGA,IAAIH,EACAI,EACAC,EACJ,GAAIJ,IAAJ,OAA2B,CACzB,IAAMK,EAAUR,GAAAA,CACdG,QAASG,EAAKF,aAAcG,EAAStB,OAAAA,EAAQoB,YAAAA,CAAAA,EAAeG,GAC9DN,EAAQM,EAAQC,KACjB,MACCP,E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,GAAMA,KAAK3B,EAAQnB,UACpC6B,KAAKK,EAAcY,GAAKC,EAI1BZ,EAAMW,GAAKC,GAEb,OAAOxB,EAA0CL,EAAKiB,CAAAA,CACvD,CAAA,CAvFMR,EAAWV,YAAGA,GAAAA,KAAAA,EAAeE,EAAQzB,KA0F9C,IAAMwD,EAA8CpC,EAAMqC,WAGxD,CAAChB,EAAOS,IACRrB,EACEI,EACA,CAAA,GAAIQ,EAAOM,KAAgBG,CAAAA,EAC3BT,GAAAA,KAAAA,OAAAA,EAAOiB,QAAAA,CAAAA,EAOX,OAFAF,EAAmBjC,YAAcU,EAAeV,YAEzCiC,CACT,
|
|
6
|
-
"names": ["React", "reservedReactProperties", "Set", "listenedEvents", "WeakMap", "setProperty", "node", "name", "value", "old", "events", "event", "HTMLElement", "prototype", "removeAttribute", "listener", "get", "set", "Map", "handler", "handleEvent", "addEventListener", "delete", "removeEventListener", "createComponent", "ReactOrOptions", "window", "React", "tagName", "elementClass", "displayName", "tag", "element", "options", "react", "Component", "createElement", "eventProps", "Object", "keys", "ReactComponent", "constructor", "this", "_element", "_updateElement", "oldProps", "prop", "_elementProps", "props", "componentDidMount", "componentDidUpdate", "render", "userRef", "_a", "__forwardedRef", "_ref", "_userRef", "ref", "current", "k", "v", "entries", "has", "ForwardedComponent", "forwardRef", "children", "BlAlert", "React", "elem", "s", "BlBadge", "BlButton", "BlCheckboxGroup", "BlDialog", "BlDrawer", "BlDropdown", "BlIcon", "BlInput", "BlPagination", "BlProgressIndicator", "BlRadioGroup", "BlSelect", "BlTabGroup", "BlTooltip", "BlCheckbox", "BlDropdownGroup", "BlDropdownItem", "BlRadio", "BlSelectOption", "BlTab", "BlTabPanel"]
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/ban-ts-comment */\n // @ts-nocheck\n import React from 'react';\nimport { createComponent } from '@lit-labs/react';\nimport type BlAlertType from \"./components/alert/bl-alert\";\nimport type BlBadgeType from \"./components/badge/bl-badge\";\nimport type BlButtonType from \"./components/button/bl-button\";\nimport type BlCheckboxGroupType from \"./components/checkbox-group/bl-checkbox-group\";\nimport type BlDialogType from \"./components/dialog/bl-dialog\";\nimport type BlDrawerType from \"./components/drawer/bl-drawer\";\nimport type BlDropdownType from \"./components/dropdown/bl-dropdown\";\nimport type BlIconType from \"./components/icon/bl-icon\";\nimport type BlInputType from \"./components/input/bl-input\";\nimport type BlPaginationType from \"./components/pagination/bl-pagination\";\nimport type BlProgressIndicatorType from \"./components/progress-indicator/bl-progress-indicator\";\nimport type BlRadioGroupType from \"./components/radio-group/bl-radio-group\";\nimport type BlSelectType from \"./components/select/bl-select\";\nimport type BlSwitchType from \"./components/switch/bl-switch\";\nimport type BlTabGroupType from \"./components/tab-group/bl-tab-group\";\nimport type BlTooltipType from \"./components/tooltip/bl-tooltip\";\nimport type BlCheckboxType from \"./components/checkbox-group/checkbox/bl-checkbox\";\nimport type BlDropdownGroupType from \"./components/dropdown/group/bl-dropdown-group\";\nimport type BlDropdownItemType from \"./components/dropdown/item/bl-dropdown-item\";\nimport type BlRadioType from \"./components/radio-group/radio/bl-radio\";\nimport type BlSelectOptionType from \"./components/select/option/bl-select-option\";\nimport type BlTabType from \"./components/tab-group/tab/bl-tab\";\nimport type BlTabPanelType from \"./components/tab-group/tab-panel/bl-tab-panel\";\n \n export const BlAlert = React.lazy(() =>\n customElements.whenDefined('bl-alert').then(elem => ({\n default: createComponent<BlAlertType>(\n {\n react: React,\n tagName: 'bl-alert',\n elementClass: elem,\n events:{\"onClose\":\"bl-close\"}\n }\n )\n })\n ));\n \n\n\n export const BlBadge = React.lazy(() =>\n customElements.whenDefined('bl-badge').then(elem => ({\n default: createComponent<BlBadgeType>(\n {\n react: React,\n tagName: 'bl-badge',\n elementClass: elem,\n events:{}\n }\n )\n })\n ));\n \n\n\n export const BlButton = React.lazy(() =>\n customElements.whenDefined('bl-button').then(elem => ({\n default: createComponent<BlButtonType>(\n {\n react: React,\n tagName: 'bl-button',\n elementClass: elem,\n events:{\"onClick\":\"bl-click\"}\n }\n )\n })\n ));\n \n\n\n export const BlCheckboxGroup = React.lazy(() =>\n customElements.whenDefined('bl-checkbox-group').then(elem => ({\n default: createComponent<BlCheckboxGroupType>(\n {\n react: React,\n tagName: 'bl-checkbox-group',\n elementClass: elem,\n events:{\"onChange\":\"bl-checkbox-group-change\"}\n }\n )\n })\n ));\n \n\n\n export const BlDialog = React.lazy(() =>\n customElements.whenDefined('bl-dialog').then(elem => ({\n default: createComponent<BlDialogType>(\n {\n react: React,\n tagName: 'bl-dialog',\n elementClass: elem,\n events:{\"onOpen\":\"bl-dialog-open\",\"onClose\":\"bl-dialog-close\"}\n }\n )\n })\n ));\n \n\n\n export const BlDrawer = React.lazy(() =>\n customElements.whenDefined('bl-drawer').then(elem => ({\n default: createComponent<BlDrawerType>(\n {\n react: React,\n tagName: 'bl-drawer',\n elementClass: elem,\n events:{\"onOpen\":\"bl-drawer-open\",\"onClose\":\"bl-drawer-close\"}\n }\n )\n })\n ));\n \n\n\n export const BlDropdown = React.lazy(() =>\n customElements.whenDefined('bl-dropdown').then(elem => ({\n default: createComponent<BlDropdownType>(\n {\n react: React,\n tagName: 'bl-dropdown',\n elementClass: elem,\n events:{\"onOpen\":\"bl-dropdown-open\",\"onClose\":\"bl-dropdown-close\"}\n }\n )\n })\n ));\n \n\n\n export const BlIcon = React.lazy(() =>\n customElements.whenDefined('bl-icon').then(elem => ({\n default: createComponent<BlIconType>(\n {\n react: React,\n tagName: 'bl-icon',\n elementClass: elem,\n events:{\"onLoad\":\"bl-load\",\"onError\":\"bl-error\"}\n }\n )\n })\n ));\n \n\n\n export const BlInput = React.lazy(() =>\n customElements.whenDefined('bl-input').then(elem => ({\n default: createComponent<BlInputType>(\n {\n react: React,\n tagName: 'bl-input',\n elementClass: elem,\n events:{\"onChange\":\"bl-change\",\"onInput\":\"bl-input\",\"onInvalid\":\"bl-invalid\"}\n }\n )\n })\n ));\n \n\n\n export const BlPagination = React.lazy(() =>\n customElements.whenDefined('bl-pagination').then(elem => ({\n default: createComponent<BlPaginationType>(\n {\n react: React,\n tagName: 'bl-pagination',\n elementClass: elem,\n events:{\"onChange\":\"bl-change\"}\n }\n )\n })\n ));\n \n\n\n export const BlProgressIndicator = React.lazy(() =>\n customElements.whenDefined('bl-progress-indicator').then(elem => ({\n default: createComponent<BlProgressIndicatorType>(\n {\n react: React,\n tagName: 'bl-progress-indicator',\n elementClass: elem,\n events:{}\n }\n )\n })\n ));\n \n\n\n export const BlRadioGroup = React.lazy(() =>\n customElements.whenDefined('bl-radio-group').then(elem => ({\n default: createComponent<BlRadioGroupType>(\n {\n react: React,\n tagName: 'bl-radio-group',\n elementClass: elem,\n events:{\"onChange\":\"bl-radio-change\"}\n }\n )\n })\n ));\n \n\n\n export const BlSelect = React.lazy(() =>\n customElements.whenDefined('bl-select').then(elem => ({\n default: createComponent<BlSelectType>(\n {\n react: React,\n tagName: 'bl-select',\n elementClass: elem,\n events:{\"onSelect\":\"bl-select\"}\n }\n )\n })\n ));\n \n\n\n export const BlSwitch = React.lazy(() =>\n customElements.whenDefined('bl-switch').then(elem => ({\n default: createComponent<BlSwitchType>(\n {\n react: React,\n tagName: 'bl-switch',\n elementClass: elem,\n events:{\"onToggle\":\"bl-switch-toggle\"}\n }\n )\n })\n ));\n \n\n\n export const BlTabGroup = React.lazy(() =>\n customElements.whenDefined('bl-tab-group').then(elem => ({\n default: createComponent<BlTabGroupType>(\n {\n react: React,\n tagName: 'bl-tab-group',\n elementClass: elem,\n events:{}\n }\n )\n })\n ));\n \n\n\n export const BlTooltip = React.lazy(() =>\n customElements.whenDefined('bl-tooltip').then(elem => ({\n default: createComponent<BlTooltipType>(\n {\n react: React,\n tagName: 'bl-tooltip',\n elementClass: elem,\n events:{\"onShow\":\"bl-tooltip-show\",\"onHide\":\"bl-tooltip-hide\"}\n }\n )\n })\n ));\n \n\n\n export const BlCheckbox = React.lazy(() =>\n customElements.whenDefined('bl-checkbox').then(elem => ({\n default: createComponent<BlCheckboxType>(\n {\n react: React,\n tagName: 'bl-checkbox',\n elementClass: elem,\n events:{\"onChange\":\"bl-checkbox-change\",\"onFocus\":\"bl-focus\",\"onBlur\":\"bl-blur\"}\n }\n )\n })\n ));\n \n\n\n export const BlDropdownGroup = React.lazy(() =>\n customElements.whenDefined('bl-dropdown-group').then(elem => ({\n default: createComponent<BlDropdownGroupType>(\n {\n react: React,\n tagName: 'bl-dropdown-group',\n elementClass: elem,\n events:{}\n }\n )\n })\n ));\n \n\n\n export const BlDropdownItem = React.lazy(() =>\n customElements.whenDefined('bl-dropdown-item').then(elem => ({\n default: createComponent<BlDropdownItemType>(\n {\n react: React,\n tagName: 'bl-dropdown-item',\n elementClass: elem,\n events:{\"onClick\":\"bl-dropdown-item-click\"}\n }\n )\n })\n ));\n \n\n\n export const BlRadio = React.lazy(() =>\n customElements.whenDefined('bl-radio').then(elem => ({\n default: createComponent<BlRadioType>(\n {\n react: React,\n tagName: 'bl-radio',\n elementClass: elem,\n events:{\"onChecked\":\"bl-checked\",\"onFocus\":\"bl-focus\",\"onBlur\":\"bl-blur\"}\n }\n )\n })\n ));\n \n\n\n export const BlSelectOption = React.lazy(() =>\n customElements.whenDefined('bl-select-option').then(elem => ({\n default: createComponent<BlSelectOptionType>(\n {\n react: React,\n tagName: 'bl-select-option',\n elementClass: elem,\n events:{\"onOption\":\"bl-select-option\"}\n }\n )\n })\n ));\n \n\n\n export const BlTab = React.lazy(() =>\n customElements.whenDefined('bl-tab').then(elem => ({\n default: createComponent<BlTabType>(\n {\n react: React,\n tagName: 'bl-tab',\n elementClass: elem,\n events:{\"onSelected\":\"bl-tab-selected\"}\n }\n )\n })\n ));\n \n\n\n export const BlTabPanel = React.lazy(() =>\n customElements.whenDefined('bl-tab-panel').then(elem => ({\n default: createComponent<BlTabPanelType>(\n {\n react: React,\n tagName: 'bl-tab-panel',\n elementClass: elem,\n events:{}\n }\n )\n })\n ));", "/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n// Match a prop name to a typed event callback by\n// adding an Event type as an expected property on a string.\nexport type EventName<T extends Event = Event> = string & {\n __event_type: T;\n};\n\n// A key value map matching React prop names to event names\ntype EventNames = Record<string, EventName | string>;\n\n// A map of expected event listener types based on EventNames\ntype EventListeners<R extends EventNames> = {\n [K in keyof R]: R[K] extends EventName\n ? (e: R[K]['__event_type']) => void\n : (e: Event) => void;\n};\n\ntype ReactProps<I, E> = Omit<React.HTMLAttributes<I>, keyof E>;\ntype ElementWithoutPropsOrEventListeners<I, E> = Omit<\n I,\n keyof E | keyof ReactProps<I, E>\n>;\n\n// Props the user is allowed to use, includes standard attributes, children,\n// ref, as well as special event and element properties.\nexport type WebComponentProps<\n I extends HTMLElement,\n E extends EventNames = {}\n> = Partial<\n ReactProps<I, E> &\n ElementWithoutPropsOrEventListeners<I, E> &\n EventListeners<E>\n>;\n\n// Props used by this component wrapper. This is the WebComponentProps and the\n// special `__forwardedRef` property. Note, this ref is special because\n// it's both needed in this component to get access to the rendered element\n// and must fulfill any ref passed by the user.\ntype ReactComponentProps<\n I extends HTMLElement,\n E extends EventNames = {}\n> = WebComponentProps<I, E> & {\n __forwardedRef?: React.Ref<I>;\n};\n\nexport type ReactWebComponent<\n I extends HTMLElement,\n E extends EventNames = {}\n> = React.ForwardRefExoticComponent<\n React.PropsWithoutRef<WebComponentProps<I, E>> & React.RefAttributes<I>\n>;\n\ninterface Options<I extends HTMLElement, E extends EventNames = {}> {\n tagName: string;\n elementClass: Constructor<I>;\n react: typeof window.React;\n events?: E;\n displayName?: string;\n}\n\ntype Constructor<T> = {new (): T};\n\nconst reservedReactProperties = new Set([\n 'children',\n 'localName',\n 'ref',\n 'style',\n 'className',\n]);\n\nconst listenedEvents: WeakMap<\n Element,\n Map<string, EventListenerObject>\n> = new WeakMap();\n\n/**\n * Adds an event listener for the specified event to the given node. In the\n * React setup, there should only ever be one event listener. Thus, for\n * efficiency only one listener is added and the handler for that listener is\n * updated to point to the given listener function.\n */\nconst addOrUpdateEventListener = (\n node: Element,\n event: string,\n listener: (event?: Event) => void\n) => {\n let events = listenedEvents.get(node);\n if (events === undefined) {\n listenedEvents.set(node, (events = new Map()));\n }\n let handler = events.get(event);\n if (listener !== undefined) {\n // If necessary, add listener and track handler\n if (handler === undefined) {\n events.set(event, (handler = {handleEvent: listener}));\n node.addEventListener(event, handler);\n // Otherwise just update the listener with new value\n } else {\n handler.handleEvent = listener;\n }\n // Remove listener if one exists and value is undefined\n } else if (handler !== undefined) {\n events.delete(event);\n node.removeEventListener(event, handler);\n }\n};\n\n/**\n * Sets properties and events on custom elements. These properties and events\n * have been pre-filtered so we know they should apply to the custom element.\n */\nconst setProperty = <E extends Element>(\n node: E,\n name: string,\n value: unknown,\n old: unknown,\n events?: EventNames\n) => {\n const event = events?.[name];\n if (event !== undefined && value !== old) {\n // Dirty check event value.\n addOrUpdateEventListener(node, event, value as (e?: Event) => void);\n return;\n }\n\n // Note, the attribute removal here for `undefined` and `null` values is done\n // to match React's behavior on non-custom elements. It needs special\n // handling because it does not match platform behavior. For example,\n // setting the `id` property to `undefined` sets the attribute to the string\n // \"undefined.\" React \"fixes\" that odd behavior and the code here matches\n // React's convention.\n if (\n (value === undefined || value === null) &&\n name in HTMLElement.prototype\n ) {\n node.removeAttribute(name);\n return;\n }\n\n // But don't dirty check properties; elements are assumed to do this.\n node[name as keyof E] = value as E[keyof E];\n};\n\n// Set a React ref. Note, there are 2 kinds of refs and there's no built in\n// React API to set a ref.\nconst setRef = (ref: React.Ref<unknown>, value: Element | null) => {\n if (typeof ref === 'function') {\n (ref as (e: Element | null) => void)(value);\n } else {\n (ref as {current: Element | null}).current = value;\n }\n};\n\n/**\n * Creates a React component for a custom element. Properties are distinguished\n * from attributes automatically, and events can be configured so they are\n * added to the custom element as event listeners.\n *\n * @param options An options bag containing the parameters needed to generate\n * a wrapped web component.\n *\n * @param options.react The React module, typically imported from the `react` npm\n * package.\n * @param options.tagName The custom element tag name registered via\n * `customElements.define`.\n * @param options.elementClass The custom element class registered via\n * `customElements.define`.\n * @param options.events An object listing events to which the component can listen. The\n * object keys are the event property names passed in via React props and the\n * object values are the names of the corresponding events generated by the\n * custom element. For example, given `{onactivate: 'activate'}` an event\n * function may be passed via the component's `onactivate` prop and will be\n * called when the custom element fires its `activate` event.\n * @param options.displayName A React component display name, used in debugging\n * messages. Default value is inferred from the name of custom element class\n * registered via `customElements.define`.\n */\nexport function createComponent<\n I extends HTMLElement,\n E extends EventNames = {}\n>(options: Options<I, E>): ReactWebComponent<I, E>;\n/**\n * @deprecated Use `createComponent(options)` instead of individual arguments.\n *\n * Creates a React component for a custom element. Properties are distinguished\n * from attributes automatically, and events can be configured so they are\n * added to the custom element as event listeners.\n *\n * @param React The React module, typically imported from the `react` npm\n * package.\n * @param tagName The custom element tag name registered via\n * `customElements.define`.\n * @param elementClass The custom element class registered via\n * `customElements.define`.\n * @param events An object listing events to which the component can listen. The\n * object keys are the event property names passed in via React props and the\n * object values are the names of the corresponding events generated by the\n * custom element. For example, given `{onactivate: 'activate'}` an event\n * function may be passed via the component's `onactivate` prop and will be\n * called when the custom element fires its `activate` event.\n * @param displayName A React component display name, used in debugging\n * messages. Default value is inferred from the name of custom element class\n * registered via `customElements.define`.\n */\nexport function createComponent<\n I extends HTMLElement,\n E extends EventNames = {}\n>(\n ReactOrOptions: typeof window.React,\n tagName: string,\n elementClass: Constructor<I>,\n events?: E,\n displayName?: string\n): ReactWebComponent<I, E>;\nexport function createComponent<\n I extends HTMLElement,\n E extends EventNames = {}\n>(\n ReactOrOptions: typeof window.React | Options<I, E> = window.React,\n tagName?: string,\n elementClass?: Constructor<I>,\n events?: E,\n displayName?: string\n): ReactWebComponent<I, E> {\n // digest overloaded parameters\n let React: typeof window.React;\n let tag: string;\n let element: Constructor<I>;\n if (tagName === undefined) {\n const options = ReactOrOptions as Options<I, E>;\n ({tagName: tag, elementClass: element, events, displayName} = options);\n React = options.react;\n } else {\n React = ReactOrOptions as typeof window.React;\n element = elementClass as Constructor<I>;\n tag = tagName;\n }\n\n const Component = React.Component;\n const createElement = React.createElement;\n const eventProps = new Set(Object.keys(events ?? {}));\n\n type Props = ReactComponentProps<I, E>;\n\n class ReactComponent extends Component<Props> {\n private _element: I | null = null;\n private _elementProps!: {[index: string]: unknown};\n private _userRef?: React.Ref<I>;\n private _ref?: React.RefCallback<I>;\n\n static displayName = displayName ?? element.name;\n\n private _updateElement(oldProps?: Props) {\n if (this._element === null) {\n return;\n }\n // Set element properties to the values in `this.props`\n for (const prop in this._elementProps) {\n setProperty(\n this._element,\n prop,\n this.props[prop],\n oldProps ? oldProps[prop] : undefined,\n events\n );\n }\n // Note, the spirit of React might be to \"unset\" any old values that\n // are no longer included; however, there's no reasonable value to set\n // them to so we just leave the previous state as is.\n }\n\n /**\n * Updates element properties correctly setting properties\n * on mount.\n */\n override componentDidMount() {\n this._updateElement();\n }\n\n /**\n * Updates element properties correctly setting properties\n * on every update. Note, this does not include mount.\n */\n override componentDidUpdate(old: Props) {\n this._updateElement(old);\n }\n\n /**\n * Renders the custom element with a `ref` prop which allows this\n * component to reference the custom element.\n *\n * Standard attributes are passed to React and element properties and events\n * are updated in componentDidMount/componentDidUpdate.\n *\n */\n override render() {\n // Since refs only get fulfilled once, pass a new one if the user's\n // ref changed. This allows refs to be fulfilled as expected, going from\n // having a value to null.\n const userRef = this.props.__forwardedRef ?? null;\n if (this._ref === undefined || this._userRef !== userRef) {\n this._ref = (value: I | null) => {\n if (this._element === null) {\n this._element = value;\n }\n if (userRef !== null) {\n setRef(userRef, value);\n }\n this._userRef = userRef;\n };\n }\n // Filters class properties out and passes the remaining\n // attributes to React. This allows attributes to use framework rules\n // for setting attributes and render correctly under SSR.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const props: any = {ref: this._ref};\n // Note, save element props while iterating to avoid the need to\n // iterate again when setting properties.\n this._elementProps = {};\n for (const [k, v] of Object.entries(this.props)) {\n if (k === '__forwardedRef') continue;\n\n if (reservedReactProperties.has(k)) {\n // React does *not* handle `className` for custom elements so\n // coerce it to `class` so it's handled correctly.\n props[k === 'className' ? 'class' : k] = v;\n continue;\n }\n\n if (eventProps.has(k) || k in element.prototype) {\n this._elementProps[k] = v;\n continue;\n }\n\n props[k] = v;\n }\n return createElement<React.HTMLAttributes<I>, I>(tag, props);\n }\n }\n\n const ForwardedComponent: ReactWebComponent<I, E> = React.forwardRef<\n I,\n WebComponentProps<I, E>\n >((props, ref) =>\n createElement<Props, ReactComponent, typeof ReactComponent>(\n ReactComponent,\n {...props, __forwardedRef: ref},\n props?.children\n )\n );\n\n // To ease debugging in the React Developer Tools\n ForwardedComponent.displayName = ReactComponent.displayName;\n\n return ForwardedComponent;\n}\n"],
|
|
5
|
+
"mappings": "4BAEI,OAAOA,MAAW,QCiEtB,IAAMC,EAA0B,IAAIC,IAAI,CACtC,WACA,YACA,MACA,QACA,WAAA,CAAA,EAGIC,EAGF,IAAIC,QAsCFC,EAAc,CAClBC,EACAC,EACAC,EACAC,EACAC,IAAAA,CAEA,IAAMC,EAAQD,GAAAA,KAAAA,OAAAA,EAASH,GACnBI,IADmBJ,QACIC,IAAUC,EAalCD,GAAD,MACAD,KAAQK,YAAYC,UAEpBP,EAAKQ,gBAAgBP,CAAAA,EAKvBD,EAAKC,GAAmBC,GA3DO,CAC/BF,EACAK,EACAI,IAAAA,CAEA,IAAIL,EAASP,EAAea,IAAIV,CAAAA,EAC5BI,IAD4BJ,QAE9BH,EAAec,IAAIX,EAAOI,EAAS,IAAIQ,GAAAA,EAEzC,IAAIC,EAAUT,EAAOM,IAAIL,CAAAA,EACrBI,IADqBJ,OAGnBQ,IAFFJ,QAGAL,EAAOO,IAAIN,EAAQQ,EAAU,CAACC,YAAaL,CAAAA,CAAAA,EAC3CT,EAAKe,iBAAiBV,EAAOQ,CAAAA,GAG7BA,EAAQC,YAAcL,EAGfI,IAHeJ,SAIxBL,EAAOY,OAAOX,CAAAA,EACdL,EAAKiB,oBAAoBZ,EAAOQ,CAAAA,EACjC,GAiB0B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CAAC,CACV,CACJ,CACA,EACL,CAAC",
|
|
6
|
+
"names": ["React", "reservedReactProperties", "Set", "listenedEvents", "WeakMap", "setProperty", "node", "name", "value", "old", "events", "event", "HTMLElement", "prototype", "removeAttribute", "listener", "get", "set", "Map", "handler", "handleEvent", "addEventListener", "delete", "removeEventListener", "createComponent", "ReactOrOptions", "window", "React", "tagName", "elementClass", "displayName", "tag", "element", "options", "react", "Component", "createElement", "eventProps", "Object", "keys", "ReactComponent", "constructor", "this", "_element", "_updateElement", "oldProps", "prop", "_elementProps", "props", "componentDidMount", "componentDidUpdate", "render", "userRef", "_a", "__forwardedRef", "_ref", "_userRef", "ref", "current", "k", "v", "entries", "has", "ForwardedComponent", "forwardRef", "children", "BlAlert", "React", "elem", "s", "BlBadge", "BlButton", "BlCheckboxGroup", "BlDialog", "BlDrawer", "BlDropdown", "BlIcon", "BlInput", "BlPagination", "BlProgressIndicator", "BlRadioGroup", "BlSelect", "BlSwitch", "BlTabGroup", "BlTooltip", "BlCheckbox", "BlDropdownGroup", "BlDropdownItem", "BlRadio", "BlSelectOption", "BlTab", "BlTabPanel"]
|
|
7
7
|
}
|
package/dist/baklava.d.ts
CHANGED
|
@@ -20,5 +20,6 @@ export { default as BlTooltip } from './components/tooltip/bl-tooltip';
|
|
|
20
20
|
export { default as BlDropdown } from './components/dropdown/bl-dropdown';
|
|
21
21
|
export { default as BlDropdownItem } from './components/dropdown/item/bl-dropdown-item';
|
|
22
22
|
export { default as BlDropdownGroup } from './components/dropdown/group/bl-dropdown-group';
|
|
23
|
+
export { default as BlSwitch } from './components/switch/bl-switch';
|
|
23
24
|
export { getIconPath, setIconPath } from './utilities/asset-paths';
|
|
24
25
|
//# sourceMappingURL=baklava.d.ts.map
|
package/dist/baklava.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baklava.d.ts","sourceRoot":"","sources":["../src/baklava.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAA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E,OAAO,IAAI,KAAK,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,+CAA+C,CAAC;AAC3F,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC"}
|
package/dist/baklava.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g}from"./chunk-SIGNZ5EB.js";import{a as
|
|
1
|
+
import{b as G}from"./chunk-K7ADOVTV.js";import{a as g}from"./chunk-SIGNZ5EB.js";import{a as I}from"./chunk-PL6NHIFG.js";import{a as b}from"./chunk-IDG5M2QP.js";import{a as h}from"./chunk-RQQTHSVK.js";import{b as D,d as P}from"./chunk-M623DR5J.js";import{b as w}from"./chunk-LPQ6QJUJ.js";import{a as B}from"./chunk-JHOV25H6.js";import{a as s}from"./chunk-YFAHSZVL.js";import{a as n}from"./chunk-A25HQAVJ.js";import{c,f as i}from"./chunk-WFBCOT52.js";import{a as m}from"./chunk-6BJAHDFH.js";import{a as x}from"./chunk-KWTSWXUL.js";import"./chunk-KWAF5LTC.js";import{a as r}from"./chunk-YJS4QEL4.js";import{a}from"./chunk-54XXQVFL.js";import{b as f,e as p}from"./chunk-6SKD6QNV.js";import"./chunk-KQBKSEYJ.js";import"./chunk-5VLVLBWY.js";import{a as d}from"./chunk-H37QVPNF.js";import{a as u}from"./chunk-WIJU4SW3.js";import{a as l}from"./chunk-EADA5CG6.js";import"./chunk-ENFFFE4I.js";import"./chunk-2TVOKUHE.js";import{a as o,b as t,c as e}from"./chunk-WXJKPVRA.js";import"./chunk-72IJCTLJ.js";import"./chunk-23UFIOHV.js";import"./chunk-HG7OBTQS.js";import"./chunk-NZ3RGSR6.js";export{r as BlAlert,a as BlBadge,l as BlButton,f as BlCheckbox,p as BlCheckboxGroup,d as BlDialog,u as BlDrawer,P as BlDropdown,w as BlDropdownGroup,D as BlDropdownItem,e as BlIcon,s as BlInput,B as BlPagination,n as BlProgressIndicator,c as BlRadio,i as BlRadioGroup,m as BlSelect,x as BlSelectOption,G as BlSwitch,I as BlTab,g as BlTabGroup,b as BlTabPanel,h as BlTooltip,t as getIconPath,o as setIconPath};
|
|
2
2
|
//# sourceMappingURL=baklava.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{a as b}from"./chunk-2TVOKUHE.js";import{a as d}from"./chunk-23UFIOHV.js";import{a as l,b as c,f as n,g as h,h as a}from"./chunk-HG7OBTQS.js";import{a as r}from"./chunk-NZ3RGSR6.js";var p=l`:host{display:inline-block;cursor:pointer}span{display:inline-block}.switch{--track-height:var(--bl-size-xl);--track-width:var(--bl-size-4xl);--thumb-offset:var(--bl-size-4xs);--thumb-height:calc(var(--track-height) - calc(2 * var(--thumb-offset)));--thumb-width:var(--thumb-height);--animation-duration:var(--bl-switch-animation-duration,300ms);--switch-color:var(--bl-switch-color,var(--bl-color-primary));background-color:var(--bl-color-content-passive);border-radius:var(--bl-border-radius-pill);height:var(--track-height);transition-property:background-color;transition-duration:var(--animation-duration);width:var(--track-width)}.switch::before{content:"";display:inline-block;background-color:white;border-radius:var(--bl-border-radius-circle);height:var(--thumb-height);left:var(--thumb-offset);position:relative;top:var(--thumb-offset);transition:transform;transition-duration:var(--animation-duration);width:var(--thumb-width)}:host([checked]) .switch{background-color:var(--switch-color)}:host([checked]) .switch::before{transform:translateX(calc(var(--track-width) - var(--thumb-width) - calc(2 * var(--thumb-offset))))}:host([disabled]) .switch{opacity:.5}:host([disabled]){cursor:not-allowed}.switch:focus-visible{position:relative;outline:0}.switch:focus-visible::after{border:2px solid var(--switch-color);border-radius:var(--bl-border-radius-pill);content:"";position:absolute;top:-3px;right:-3px;bottom:-3px;left:-3px}`,u=p;var m="bl-switch",t=class extends n{constructor(){super(...arguments);this.checked=!1;this.disabled=!1}static get styles(){return[u]}toggle(){this.disabled||(this.checked=!this.checked,this.onToggle(this.checked))}handleKeyDown(e){(e.code==="Enter"||e.code==="Space")&&(this.toggle(),e.preventDefault())}render(){var i,o,s;let e=(s=(o=this.ariaLabel)!=null?o:(i=this.attributes.getNamedItem("aria-label"))==null?void 0:i.value)!=null?s:void 0;return c`
|
|
2
|
+
<span
|
|
3
|
+
class="switch"
|
|
4
|
+
role="switch"
|
|
5
|
+
aria-checked=${this.checked}
|
|
6
|
+
aria-readonly=${!!this.disabled}
|
|
7
|
+
@click=${this.toggle}
|
|
8
|
+
@keydown=${this.handleKeyDown}
|
|
9
|
+
aria-label=${b(e)}
|
|
10
|
+
tabindex="0"
|
|
11
|
+
>
|
|
12
|
+
</span>
|
|
13
|
+
`}};r([a({type:Boolean,reflect:!0})],t.prototype,"checked",2),r([a({type:Boolean,reflect:!0})],t.prototype,"disabled",2),r([d("bl-switch-toggle")],t.prototype,"onToggle",2),t=r([h(m)],t);export{m as a,t as b};
|
|
14
|
+
//# sourceMappingURL=chunk-K7ADOVTV.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/switch/bl-switch.css", "../src/components/switch/bl-switch.ts"],
|
|
4
|
+
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{display:inline-block;cursor:pointer}span{display:inline-block}.switch{--track-height:var(--bl-size-xl);--track-width:var(--bl-size-4xl);--thumb-offset:var(--bl-size-4xs);--thumb-height:calc(var(--track-height) - calc(2 * var(--thumb-offset)));--thumb-width:var(--thumb-height);--animation-duration:var(--bl-switch-animation-duration,300ms);--switch-color:var(--bl-switch-color,var(--bl-color-primary));background-color:var(--bl-color-content-passive);border-radius:var(--bl-border-radius-pill);height:var(--track-height);transition-property:background-color;transition-duration:var(--animation-duration);width:var(--track-width)}.switch::before{content:\"\";display:inline-block;background-color:white;border-radius:var(--bl-border-radius-circle);height:var(--thumb-height);left:var(--thumb-offset);position:relative;top:var(--thumb-offset);transition:transform;transition-duration:var(--animation-duration);width:var(--thumb-width)}:host([checked]) .switch{background-color:var(--switch-color)}:host([checked]) .switch::before{transform:translateX(calc(var(--track-width) - var(--thumb-width) - calc(2 * var(--thumb-offset))))}:host([disabled]) .switch{opacity:.5}:host([disabled]){cursor:not-allowed}.switch:focus-visible{position:relative;outline:0}.switch:focus-visible::after{border:2px solid var(--switch-color);border-radius:var(--bl-border-radius-pill);content:\"\";position:absolute;top:-3px;right:-3px;bottom:-3px;left:-3px}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, TemplateResult } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { customElement, property } from 'lit/decorators.js';\nimport { event, EventDispatcher } from '../../utilities/event';\nimport style from './bl-switch.css';\n\nexport const blSwitchTag = 'bl-switch';\n\n/**\n * @tag bl-switch\n * @summary Baklava Switch component\n */\n@customElement(blSwitchTag)\nexport default class BlSwitch extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n /**\n * Sets the checked state for switch\n */\n @property({ type: Boolean, reflect: true })\n checked = false;\n\n /**\n * Sets the disabled state for switch\n */\n @property({ type: Boolean, reflect: true })\n disabled? = false;\n\n /**\n * Fires whenever user toggles the switch\n */\n @event('bl-switch-toggle') private onToggle: EventDispatcher<boolean>;\n\n toggle() {\n if (this.disabled) return;\n\n this.checked = !this.checked;\n this.onToggle(this.checked);\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n if (event.code === 'Enter' || event.code === 'Space') {\n this.toggle();\n event.preventDefault();\n }\n }\n\n render(): TemplateResult {\n const ariaLabel = this.ariaLabel ?? this.attributes.getNamedItem(\"aria-label\")?.value ?? undefined;\n\n return html`\n <span\n class=\"switch\"\n role=\"switch\"\n aria-checked=${this.checked}\n aria-readonly=${!!this.disabled}\n @click=${this.toggle}\n @keydown=${this.handleKeyDown}\n aria-label=${ifDefined(ariaLabel)}\n tabindex=\"0\"\n >\n </span>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [blSwitchTag]: BlSwitch;\n }\n}\n"],
|
|
5
|
+
"mappings": "4LACO,IAAMA,EAASC,g6CACfC,EAAQF,ECIR,IAAMG,EAAc,YAONC,EAArB,cAAsCC,CAAW,CAAjD,kCASE,aAAU,GAMV,cAAY,GAdZ,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CAmBA,QAAS,CACH,KAAK,WAET,KAAK,QAAU,CAAC,KAAK,QACrB,KAAK,SAAS,KAAK,OAAO,EAC5B,CAEQ,cAAcC,EAAsB,EACtCA,EAAM,OAAS,SAAWA,EAAM,OAAS,WAC3C,KAAK,OAAO,EACZA,EAAM,eAAe,EAEzB,CAEA,QAAyB,CAjD3B,IAAAC,EAAAC,EAAAC,EAkDI,IAAMC,GAAYD,GAAAD,EAAA,KAAK,YAAL,KAAAA,GAAkBD,EAAA,KAAK,WAAW,aAAa,YAAY,IAAzC,YAAAA,EAA4C,QAA9D,KAAAE,EAAuE,OAEzF,OAAOE;AAAA;AAAA;AAAA;AAAA,uBAIY,KAAK;AAAA,wBACJ,CAAC,CAAC,KAAK;AAAA,iBACd,KAAK;AAAA,mBACH,KAAK;AAAA,qBACHC,EAAUF,CAAS;AAAA;AAAA;AAAA;AAAA,KAKtC,CACF,EA5CEG,EAAA,CADCC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GARvBX,EASnB,uBAMAU,EAAA,CADCC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAdvBX,EAenB,wBAKmCU,EAAA,CAAlCP,EAAM,kBAAkB,GApBNH,EAoBgB,wBApBhBA,EAArBU,EAAA,CADCE,EAAcb,CAAW,GACLC",
|
|
6
|
+
"names": ["styles", "r", "bl_switch_default", "blSwitchTag", "BlSwitch", "s", "bl_switch_default", "event", "_a", "_b", "_c", "ariaLabel", "$", "l", "__decorateClass", "e", "n"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CSSResultGroup, LitElement, TemplateResult } from 'lit';
|
|
2
|
+
export declare const blSwitchTag = "bl-switch";
|
|
3
|
+
/**
|
|
4
|
+
* @tag bl-switch
|
|
5
|
+
* @summary Baklava Switch component
|
|
6
|
+
*/
|
|
7
|
+
export default class BlSwitch extends LitElement {
|
|
8
|
+
static get styles(): CSSResultGroup;
|
|
9
|
+
/**
|
|
10
|
+
* Sets the checked state for switch
|
|
11
|
+
*/
|
|
12
|
+
checked: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Sets the disabled state for switch
|
|
15
|
+
*/
|
|
16
|
+
disabled?: boolean | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Fires whenever user toggles the switch
|
|
19
|
+
*/
|
|
20
|
+
private onToggle;
|
|
21
|
+
toggle(): void;
|
|
22
|
+
private handleKeyDown;
|
|
23
|
+
render(): TemplateResult;
|
|
24
|
+
}
|
|
25
|
+
declare global {
|
|
26
|
+
interface HTMLElementTagNameMap {
|
|
27
|
+
[blSwitchTag]: BlSwitch;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=bl-switch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bl-switch.d.ts","sourceRoot":"","sources":["../../../src/components/switch/bl-switch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAQ,UAAU,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAMvE,eAAO,MAAM,WAAW,cAAc,CAAC;AAEvC;;;GAGG;AAEH,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,UAAU;IAC9C,MAAM,KAAK,MAAM,IAAI,cAAc,CAElC;IAED;;OAEG;IAEH,OAAO,UAAS;IAEhB;;OAEG;IAEH,QAAQ,CAAC,sBAAS;IAElB;;OAEG;IACwB,OAAO,CAAC,QAAQ,CAA2B;IAEtE,MAAM;IAON,OAAO,CAAC,aAAa;IAOrB,MAAM,IAAI,cAAc;CAiBzB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC;KACzB;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bl-switch.test.d.ts","sourceRoot":"","sources":["../../../src/components/switch/bl-switch.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-SIGNZ5EB.js";import"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-SIGNZ5EB.js";import"../../chunk-PL6NHIFG.js";import"../../chunk-IDG5M2QP.js";import"../../chunk-23UFIOHV.js";import"../../chunk-HG7OBTQS.js";import"../../chunk-NZ3RGSR6.js";export{a as default};
|
|
2
2
|
//# sourceMappingURL=bl-tab-group.js.map
|
|
@@ -1382,6 +1382,86 @@
|
|
|
1382
1382
|
}
|
|
1383
1383
|
]
|
|
1384
1384
|
},
|
|
1385
|
+
{
|
|
1386
|
+
"kind": "javascript-module",
|
|
1387
|
+
"path": "src/components/switch/bl-switch.ts",
|
|
1388
|
+
"declarations": [
|
|
1389
|
+
{
|
|
1390
|
+
"kind": "variable",
|
|
1391
|
+
"name": "blSwitchTag",
|
|
1392
|
+
"type": {
|
|
1393
|
+
"text": "string"
|
|
1394
|
+
},
|
|
1395
|
+
"default": "'bl-switch'"
|
|
1396
|
+
},
|
|
1397
|
+
{
|
|
1398
|
+
"kind": "class",
|
|
1399
|
+
"description": "",
|
|
1400
|
+
"name": "BlSwitch",
|
|
1401
|
+
"events": [
|
|
1402
|
+
{
|
|
1403
|
+
"type": {
|
|
1404
|
+
"text": "CustomEvent<boolean>"
|
|
1405
|
+
},
|
|
1406
|
+
"description": "Fires whenever user toggles the switch",
|
|
1407
|
+
"name": "bl-switch-toggle"
|
|
1408
|
+
}
|
|
1409
|
+
],
|
|
1410
|
+
"attributes": [
|
|
1411
|
+
{
|
|
1412
|
+
"name": "checked",
|
|
1413
|
+
"type": {
|
|
1414
|
+
"text": "boolean"
|
|
1415
|
+
},
|
|
1416
|
+
"default": "false",
|
|
1417
|
+
"description": "Sets the checked state for switch",
|
|
1418
|
+
"fieldName": "checked"
|
|
1419
|
+
},
|
|
1420
|
+
{
|
|
1421
|
+
"name": "disabled",
|
|
1422
|
+
"type": {
|
|
1423
|
+
"text": "boolean"
|
|
1424
|
+
},
|
|
1425
|
+
"default": "false",
|
|
1426
|
+
"description": "Sets the disabled state for switch",
|
|
1427
|
+
"fieldName": "disabled"
|
|
1428
|
+
}
|
|
1429
|
+
],
|
|
1430
|
+
"superclass": {
|
|
1431
|
+
"name": "LitElement",
|
|
1432
|
+
"package": "lit"
|
|
1433
|
+
},
|
|
1434
|
+
"tagName": "bl-switch",
|
|
1435
|
+
"summary": "Baklava Switch component",
|
|
1436
|
+
"customElement": true
|
|
1437
|
+
}
|
|
1438
|
+
],
|
|
1439
|
+
"exports": [
|
|
1440
|
+
{
|
|
1441
|
+
"kind": "js",
|
|
1442
|
+
"name": "blSwitchTag",
|
|
1443
|
+
"declaration": {
|
|
1444
|
+
"name": "blSwitchTag",
|
|
1445
|
+
"module": "src/components/switch/bl-switch.ts"
|
|
1446
|
+
}
|
|
1447
|
+
},
|
|
1448
|
+
{
|
|
1449
|
+
"kind": "js",
|
|
1450
|
+
"name": "default",
|
|
1451
|
+
"declaration": {
|
|
1452
|
+
"name": "BlSwitch",
|
|
1453
|
+
"module": "src/components/switch/bl-switch.ts"
|
|
1454
|
+
}
|
|
1455
|
+
},
|
|
1456
|
+
{
|
|
1457
|
+
"kind": "custom-element-definition",
|
|
1458
|
+
"declaration": {
|
|
1459
|
+
"name": "BlSwitch",
|
|
1460
|
+
"module": "src/components/switch/bl-switch.ts"
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
]
|
|
1464
|
+
},
|
|
1385
1465
|
{
|
|
1386
1466
|
"kind": "javascript-module",
|
|
1387
1467
|
"path": "src/components/tab-group/bl-tab-group.ts",
|