@trendyol/baklava 2.0.0-beta.47 → 2.0.0-beta.49
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 +19 -17
- 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-UL6BSR26.js +28 -0
- package/dist/chunk-UL6BSR26.js.map +7 -0
- package/dist/components/drawer/bl-drawer.d.ts +48 -0
- package/dist/components/drawer/bl-drawer.d.ts.map +1 -0
- package/dist/components/drawer/bl-drawer.js +2 -0
- package/dist/components/drawer/bl-drawer.js.map +7 -0
- package/dist/components/drawer/bl-drawer.test.d.ts +2 -0
- package/dist/components/drawer/bl-drawer.test.d.ts.map +1 -0
- package/dist/custom-elements.json +87 -0
- package/package.json +2 -2
package/dist/baklava-react.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type BlBadgeType from "./components/badge/bl-badge";
|
|
|
4
4
|
import type BlButtonType from "./components/button/bl-button";
|
|
5
5
|
import type BlCheckboxType from "./components/checkbox/bl-checkbox";
|
|
6
6
|
import type BlDialogType from "./components/dialog/bl-dialog";
|
|
7
|
+
import type BlDrawerType from "./components/drawer/bl-drawer";
|
|
7
8
|
import type BlIconType from "./components/icon/bl-icon";
|
|
8
9
|
import type BlInputType from "./components/input/bl-input";
|
|
9
10
|
import type BlPaginationType from "./components/pagination/bl-pagination";
|
|
@@ -16,21 +17,22 @@ import type BlRadioType from "./components/radio-group/radio/bl-radio";
|
|
|
16
17
|
import type BlSelectOptionType from "./components/select/option/bl-select-option";
|
|
17
18
|
import type BlTabType from "./components/tab-group/tab/bl-tab";
|
|
18
19
|
import type BlTabPanelType from "./components/tab-group/tab-panel/bl-tab-panel";
|
|
19
|
-
export declare const BlAlert: React.
|
|
20
|
-
export declare const BlBadge: React.
|
|
21
|
-
export declare const BlButton: React.
|
|
22
|
-
export declare const BlCheckbox: React.
|
|
23
|
-
export declare const BlDialog: React.
|
|
24
|
-
export declare const
|
|
25
|
-
export declare const
|
|
26
|
-
export declare const
|
|
27
|
-
export declare const
|
|
28
|
-
export declare const
|
|
29
|
-
export declare const
|
|
30
|
-
export declare const
|
|
31
|
-
export declare const
|
|
32
|
-
export declare const
|
|
33
|
-
export declare const
|
|
34
|
-
export declare const
|
|
35
|
-
export declare const
|
|
20
|
+
export declare const BlAlert: React.LazyExoticComponent<import("@lit-labs/react").ReactWebComponent<BlAlertType, {}>>;
|
|
21
|
+
export declare const BlBadge: React.LazyExoticComponent<import("@lit-labs/react").ReactWebComponent<BlBadgeType, {}>>;
|
|
22
|
+
export declare const BlButton: React.LazyExoticComponent<import("@lit-labs/react").ReactWebComponent<BlButtonType, {}>>;
|
|
23
|
+
export declare const BlCheckbox: React.LazyExoticComponent<import("@lit-labs/react").ReactWebComponent<BlCheckboxType, {}>>;
|
|
24
|
+
export declare const BlDialog: React.LazyExoticComponent<import("@lit-labs/react").ReactWebComponent<BlDialogType, {}>>;
|
|
25
|
+
export declare const BlDrawer: React.LazyExoticComponent<import("@lit-labs/react").ReactWebComponent<BlDrawerType, {}>>;
|
|
26
|
+
export declare const BlIcon: React.LazyExoticComponent<import("@lit-labs/react").ReactWebComponent<BlIconType, {}>>;
|
|
27
|
+
export declare const BlInput: React.LazyExoticComponent<import("@lit-labs/react").ReactWebComponent<BlInputType, {}>>;
|
|
28
|
+
export declare const BlPagination: React.LazyExoticComponent<import("@lit-labs/react").ReactWebComponent<BlPaginationType, {}>>;
|
|
29
|
+
export declare const BlProgressIndicator: React.LazyExoticComponent<import("@lit-labs/react").ReactWebComponent<BlProgressIndicatorType, {}>>;
|
|
30
|
+
export declare const BlRadioGroup: React.LazyExoticComponent<import("@lit-labs/react").ReactWebComponent<BlRadioGroupType, {}>>;
|
|
31
|
+
export declare const BlSelect: React.LazyExoticComponent<import("@lit-labs/react").ReactWebComponent<BlSelectType, {}>>;
|
|
32
|
+
export declare const BlTabGroup: React.LazyExoticComponent<import("@lit-labs/react").ReactWebComponent<BlTabGroupType, {}>>;
|
|
33
|
+
export declare const BlTooltip: React.LazyExoticComponent<import("@lit-labs/react").ReactWebComponent<BlTooltipType, {}>>;
|
|
34
|
+
export declare const BlRadio: React.LazyExoticComponent<import("@lit-labs/react").ReactWebComponent<BlRadioType, {}>>;
|
|
35
|
+
export declare const BlSelectOption: React.LazyExoticComponent<import("@lit-labs/react").ReactWebComponent<BlSelectOptionType, {}>>;
|
|
36
|
+
export declare const BlTab: React.LazyExoticComponent<import("@lit-labs/react").ReactWebComponent<BlTabType, {}>>;
|
|
37
|
+
export declare const BlTabPanel: React.LazyExoticComponent<import("@lit-labs/react").ReactWebComponent<BlTabPanelType, {}>>;
|
|
36
38
|
//# sourceMappingURL=baklava-react.d.ts.map
|
|
@@ -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,cAAc,MAAM,mCAAmC,CAAC;AACpE,OAAO,KAAK,YAAY,MAAM,+BAA+B,CAAC;AAC9D,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,cA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;AAIF,eAAO,MAAM,OAAO,yFAWnB,CAAC;AAIF,eAAO,MAAM,QAAQ,0FAWpB,CAAC;AAIF,eAAO,MAAM,UAAU,4FAWtB,CAAC;AAIF,eAAO,MAAM,QAAQ,0FAWpB,CAAC;AAIF,eAAO,MAAM,QAAQ,0FAWpB,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,UAAU,4FAWtB,CAAC;AAIF,eAAO,MAAM,SAAS,2FAWrB,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
|
|
1
|
+
import"./chunk-NZ3RGSR6.js";import t from"react";var C=new Set(["children","localName","ref","style","className"]),w=new WeakMap,x=(e,m,u,h,y)=>{let s=y==null?void 0:y[m];s===void 0||u===h?u==null&&m in HTMLElement.prototype?e.removeAttribute(m):e[m]=u:((r,n,f)=>{let p=w.get(r);p===void 0&&w.set(r,p=new Map);let i=p.get(n);f!==void 0?i===void 0?(p.set(n,i={handleEvent:f}),r.addEventListener(n,i)):i.handleEvent=f:i!==void 0&&(p.delete(n),r.removeEventListener(n,i))})(e,s,u)};function o(e=window.React,m,u,h,y){let s,r,n;if(m===void 0){let b=e;({tagName:r,elementClass:n,events:h,displayName:y}=b),s=b.react}else s=e,n=u,r=m;let f=s.Component,p=s.createElement,i=new Set(Object.keys(h!=null?h:{}));class g extends f{constructor(){super(...arguments),this.o=null}t(a){if(this.o!==null)for(let c in this.i)x(this.o,c,this.props[c],a?a[c]:void 0,h)}componentDidMount(){this.t()}componentDidUpdate(a){this.t(a)}render(){var a;let c=(a=this.props._$Gl)!==null&&a!==void 0?a:null;this.h!==void 0&&this.u===c||(this.h=l=>{this.o===null&&(this.o=l),c!==null&&((d,v)=>{typeof d=="function"?d(v):d.current=v})(c,l),this.u=c});let B={ref:this.h};this.i={};for(let[l,d]of Object.entries(this.props))l!=="__forwardedRef"&&(C.has(l)?B[l==="className"?"class":l]=d:i.has(l)||l in n.prototype?this.i[l]=d:B[l]=d);return p(r,B)}}g.displayName=y!=null?y:n.name;let T=s.forwardRef((b,a)=>p(g,{...b,_$Gl:a},b==null?void 0:b.children));return T.displayName=g.displayName,T}var I=t.lazy(()=>customElements.whenDefined("bl-alert").then(e=>({default:o({react:t,tagName:"bl-alert",elementClass:e,events:{onClose:"bl-close"}})}))),S=t.lazy(()=>customElements.whenDefined("bl-badge").then(e=>({default:o({react:t,tagName:"bl-badge",elementClass:e,events:{}})}))),R=t.lazy(()=>customElements.whenDefined("bl-button").then(e=>({default:o({react:t,tagName:"bl-button",elementClass:e,events:{onClick:"bl-click"}})}))),P=t.lazy(()=>customElements.whenDefined("bl-checkbox").then(e=>({default:o({react:t,tagName:"bl-checkbox",elementClass:e,events:{onChange:"bl-checkbox-change"}})}))),G=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"}})}))),O=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-icon").then(e=>({default:o({react:t,tagName:"bl-icon",elementClass:e,events:{onLoad:"bl-load",onError:"bl-error"}})}))),L=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"}})}))),M=t.lazy(()=>customElements.whenDefined("bl-pagination").then(e=>({default:o({react:t,tagName:"bl-pagination",elementClass:e,events:{onChange:"bl-change"}})}))),_=t.lazy(()=>customElements.whenDefined("bl-progress-indicator").then(e=>({default:o({react:t,tagName:"bl-progress-indicator",elementClass:e,events:{}})}))),j=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:{}})}))),F=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"}})}))),U=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"}})}))),W=t.lazy(()=>customElements.whenDefined("bl-select-option").then(e=>({default:o({react:t,tagName:"bl-select-option",elementClass:e,events:{onOption:"bl-select-option"}})}))),q=t.lazy(()=>customElements.whenDefined("bl-tab").then(e=>({default:o({react:t,tagName:"bl-tab",elementClass:e,events:{onSelected:"bl-tab-selected"}})}))),J=t.lazy(()=>customElements.whenDefined("bl-tab-panel").then(e=>({default:o({react:t,tagName:"bl-tab-panel",elementClass:e,events:{}})})));export{I as BlAlert,S as BlBadge,R as BlButton,P as BlCheckbox,G as BlDialog,O as BlDrawer,A as BlIcon,L as BlInput,M as BlPagination,_ as BlProgressIndicator,U as BlRadio,j as BlRadioGroup,H as BlSelect,W as BlSelectOption,q as BlTab,$ as BlTabGroup,J as BlTabPanel,F 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 BlCheckboxType from \"./components/checkbox/bl-checkbox\";\nimport type BlDialogType from \"./components/dialog/bl-dialog\";\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 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 = createComponent<BlAlertType>(\n React,\n 'bl-alert',\n customElements.get('bl-alert'),\n {\"onClose\":\"bl-close\"}\n );\n\n\n export const BlBadge = createComponent<BlBadgeType>(\n React,\n 'bl-badge',\n customElements.get('bl-badge'),\n {}\n );\n\n\n export const BlButton = createComponent<BlButtonType>(\n React,\n 'bl-button',\n customElements.get('bl-button'),\n {\"onClick\":\"bl-click\"}\n );\n\n\n export const BlCheckbox = createComponent<BlCheckboxType>(\n React,\n 'bl-checkbox',\n customElements.get('bl-checkbox'),\n {\"onChange\":\"bl-checkbox-change\"}\n );\n\n\n export const BlDialog = createComponent<BlDialogType>(\n React,\n 'bl-dialog',\n customElements.get('bl-dialog'),\n {\"onOpen\":\"bl-dialog-open\",\"onClose\":\"bl-dialog-close\"}\n );\n\n\n export const BlIcon = createComponent<BlIconType>(\n React,\n 'bl-icon',\n customElements.get('bl-icon'),\n {\"onLoad\":\"bl-load\",\"onError\":\"bl-error\"}\n );\n\n\n export const BlInput = createComponent<BlInputType>(\n React,\n 'bl-input',\n customElements.get('bl-input'),\n {\"onChange\":\"bl-change\",\"onInput\":\"bl-input\",\"onInvalid\":\"bl-invalid\"}\n );\n\n\n export const BlPagination = createComponent<BlPaginationType>(\n React,\n 'bl-pagination',\n customElements.get('bl-pagination'),\n {\"onChange\":\"bl-change\"}\n );\n\n\n export const BlProgressIndicator = createComponent<BlProgressIndicatorType>(\n React,\n 'bl-progress-indicator',\n customElements.get('bl-progress-indicator'),\n {}\n );\n\n\n export const BlRadioGroup = createComponent<BlRadioGroupType>(\n React,\n 'bl-radio-group',\n customElements.get('bl-radio-group'),\n {\"onChange\":\"bl-radio-change\"}\n );\n\n\n export const BlSelect = createComponent<BlSelectType>(\n React,\n 'bl-select',\n customElements.get('bl-select'),\n {\"onSelect\":\"bl-select\"}\n );\n\n\n export const BlTabGroup = createComponent<BlTabGroupType>(\n React,\n 'bl-tab-group',\n customElements.get('bl-tab-group'),\n {}\n );\n\n\n export const BlTooltip = createComponent<BlTooltipType>(\n React,\n 'bl-tooltip',\n customElements.get('bl-tooltip'),\n {\"onShow\":\"bl-tooltip-show\",\"onHide\":\"bl-tooltip-hide\"}\n );\n\n\n export const BlRadio = createComponent<BlRadioType>(\n React,\n 'bl-radio',\n customElements.get('bl-radio'),\n {\"onChecked\":\"bl-checked\",\"onFocus\":\"bl-focus\",\"onBlur\":\"bl-blur\"}\n );\n\n\n export const BlSelectOption = createComponent<BlSelectOptionType>(\n React,\n 'bl-select-option',\n customElements.get('bl-select-option'),\n {\"onOption\":\"bl-select-option\"}\n );\n\n\n export const BlTab = createComponent<BlTabType>(\n React,\n 'bl-tab',\n customElements.get('bl-tab'),\n {\"onSelected\":\"bl-tab-selected\"}\n );\n\n\n export const BlTabPanel = createComponent<BlTabPanelType>(\n React,\n 'bl-tab-panel',\n customElements.get('bl-tab-panel'),\n {}\n );", "/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\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?: Events\n) => {\n const event = events?.[name];\n if (event !== undefined) {\n // Dirty check event value.\n if (value !== old) {\n addOrUpdateEventListener(node, event, value as (e?: Event) => void);\n }\n } else {\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\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\ntype Constructor<T> = {new (): T};\n\n/***\n * Typecast that curries an Event type through a string. The goal of the type\n * cast is to match a prop name to a typed event callback.\n */\nexport type EventName<T extends Event = Event> = string & {\n __event_type: T;\n};\n\ntype Events = Record<string, EventName | string>;\n\ntype EventProps<R extends Events> = {\n [K in keyof R]: R[K] extends EventName\n ? (e: R[K]['__event_type']) => void\n : (e: Event) => void;\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 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 const createComponent = <I extends HTMLElement, E extends Events = {}>(\n React: typeof window.React,\n tagName: string,\n elementClass: Constructor<I>,\n events?: E,\n displayName?: string\n) => {\n const Component = React.Component;\n const createElement = React.createElement;\n\n // Props the user is allowed to use, includes standard attributes, children,\n // ref, as well as special event and element properties.\n type ReactProps = Omit<React.HTMLAttributes<I>, keyof E>;\n type ElementWithoutPropsOrEvents = Omit<I, keyof E | keyof ReactProps>;\n type UserProps = Partial<\n ReactProps & ElementWithoutPropsOrEvents & EventProps<E>\n >;\n\n // Props used by this component wrapper. This is the UserProps 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.\n type ComponentProps = UserProps & {\n __forwardedRef?: React.Ref<unknown>;\n };\n\n // Set of properties/events which should be specially handled by the wrapper\n // and not handled directly by React.\n const elementClassProps = new Set(Object.keys(events ?? {}));\n for (const p in elementClass.prototype) {\n if (!(p in HTMLElement.prototype)) {\n if (reservedReactProperties.has(p)) {\n // Note, this effectively warns only for `ref` since the other\n // reserved props are on HTMLElement.prototype. To address this\n // would require crawling down the prototype, which doesn't feel worth\n // it since implementing these properties on an element is extremely\n // rare.\n console.warn(\n `${tagName} contains property ${p} which is a React ` +\n `reserved property. It will be used by React and not set on ` +\n `the element.`\n );\n } else {\n elementClassProps.add(p);\n }\n }\n }\n\n class ReactComponent extends Component<ComponentProps> {\n private _element: I | null = null;\n private _elementProps!: {[index: string]: unknown};\n private _userRef?: React.Ref<unknown>;\n private _ref?: React.RefCallback<I>;\n\n static displayName = displayName ?? elementClass.name;\n\n private _updateElement(oldProps?: ComponentProps) {\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 as keyof ComponentProps],\n oldProps ? oldProps[prop as keyof ComponentProps] : 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: ComponentProps) {\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 as React.Ref<unknown>;\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 (elementClassProps.has(k)) {\n this._elementProps[k] = v;\n } else {\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 }\n }\n return createElement(tagName, props);\n }\n }\n\n const ForwardedComponent = React.forwardRef(\n (props?: UserProps, ref?: React.Ref<unknown>) =>\n createElement(\n ReactComponent,\n {...props, __forwardedRef: ref} as ComponentProps,\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,
|
|
6
|
-
"names": ["React", "reservedReactProperties", "Set", "listenedEvents", "WeakMap", "setProperty", "node", "name", "value", "old", "events", "event", "listener", "get", "set", "Map", "handler", "handleEvent", "addEventListener", "delete", "removeEventListener", "createComponent", "
|
|
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 BlCheckboxType from \"./components/checkbox/bl-checkbox\";\nimport type BlDialogType from \"./components/dialog/bl-dialog\";\nimport type BlDrawerType from \"./components/drawer/bl-drawer\";\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 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 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\"}\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 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 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,IAAI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B,CACxC,CACJ,CACA,EACL,CAAC,EAIakB,EAAanB,EAAM,KAAK,IACnC,eAAe,YAAY,cAAc,EAAE,KAAKC,IAAS,CACrD,QAASC,EACP,CACE,MAAOF,EACP,QAAS,eACT,aAAcC,EACd,OAAO,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", "BlCheckbox", "BlDialog", "BlDrawer", "BlIcon", "BlInput", "BlPagination", "BlProgressIndicator", "BlRadioGroup", "BlSelect", "BlTabGroup", "BlTooltip", "BlRadio", "BlSelectOption", "BlTab", "BlTabPanel"]
|
|
7
7
|
}
|
package/dist/baklava.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { default as BlBadge } from './components/badge/bl-badge';
|
|
|
3
3
|
export { default as BlButton } from './components/button/bl-button';
|
|
4
4
|
export { default as BlCheckbox } from './components/checkbox/bl-checkbox';
|
|
5
5
|
export { default as BlDialog } from './components/dialog/bl-dialog';
|
|
6
|
+
export { default as BlDrawer } from './components/drawer/bl-drawer';
|
|
6
7
|
export { default as BlIcon } from './components/icon/bl-icon';
|
|
7
8
|
export { default as BlInput } from './components/input/bl-input';
|
|
8
9
|
export { default as BlPagination } from './components/pagination/bl-pagination';
|
package/dist/baklava.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
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AW,EAAE,MAAM,yBAAyB,CAAC"}
|
package/dist/baklava.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as P}from"./chunk-7FCUFV6V.js";import{a as B}from"./chunk-4H6GIXMH.js";import{a as u}from"./chunk-JDM44V27.js";import{a as m}from"./chunk-A25HQAVJ.js";import{c as n,f as i}from"./chunk-WFBCOT52.js";import"./chunk-5VLVLBWY.js";import{a as x}from"./chunk-GBFJ2WUI.js";import{a as s}from"./chunk-KWTSWXUL.js";import"./chunk-VNGNBBSS.js";import{a as I}from"./chunk-C5HFLPOK.js";import{a as c}from"./chunk-EX6STMCI.js";import{a as g}from"./chunk-IDG5M2QP.js";import{a as e}from"./chunk-FFIDELPT.js";import{a as r}from"./chunk-54XXQVFL.js";import{a as f}from"./chunk-KXWO7VUG.js";import"./chunk-KQBKSEYJ.js";import{a as p}from"./chunk-H37QVPNF.js";import{a as d}from"./chunk-UL6BSR26.js";import{a as l}from"./chunk-HUFJDENF.js";import"./chunk-2TVOKUHE.js";import"./chunk-ENFFFE4I.js";import{a as o,b as t,c as a}from"./chunk-WXJKPVRA.js";import"./chunk-72IJCTLJ.js";import"./chunk-23UFIOHV.js";import"./chunk-HG7OBTQS.js";import"./chunk-NZ3RGSR6.js";export{e as BlAlert,r as BlBadge,l as BlButton,f as BlCheckbox,p as BlDialog,d as BlDrawer,a as BlIcon,u as BlInput,B as BlPagination,m as BlProgressIndicator,n as BlRadio,i as BlRadioGroup,x as BlSelect,s as BlSelectOption,c as BlTab,I as BlTabGroup,g as BlTabPanel,P as BlTooltip,t as getIconPath,o as setIconPath};
|
|
2
2
|
//# sourceMappingURL=baklava.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import{a}from"./chunk-23UFIOHV.js";import{a as o,b as t,f as l,g as s,h as n}from"./chunk-HG7OBTQS.js";import{a as r}from"./chunk-NZ3RGSR6.js";var p=o`@keyframes slide-from-right{0%{transform:translateX(+100%)}100%{transform:translateX(0)}}.drawer{position:fixed;top:0;right:0;width:424px;height:100%;background:var(--bl-color-primary-background);box-shadow:var(--bl-size-xs) 0 var(--bl-size-2xl) rgba(0 0 0 / 50%);animation:.25s slide-from-right;z-index:999}iframe{height:100%;width:100%;border:0}.container{display:flex;flex-direction:column;width:100%;height:100%}header{display:flex;justify-content:space-between;align-items:baseline;gap:var(--bl-size-2xs);padding:var(--bl-size-xl) var(--bl-size-xl) 0 var(--bl-size-xl);background-color:white}header .header-buttons{display:flex;gap:24px;margin-left:auto}header h2{font:var(--bl-font-title-1-medium);color:var(--bl-color-secondary);overflow:hidden;margin:0;padding:0}section{padding:var(--bl-size-xl) var(--bl-size-xl) var(--bl-size-m) var(--bl-size-xl)}.content{overflow-y:scroll}.iframe-content{height:100%}@media only screen and (max-width:424px){:host([open]) .drawer{width:calc(100vw - 24px)}}`,d=p;var e=class extends l{constructor(){super(...arguments);this.open=!1}static get styles(){return[d]}connectedCallback(){super.connectedCallback(),window==null||window.addEventListener("bl-drawer-open",i=>{i.target!==this&&this.closeDrawer()})}updated(i){i.has("open")&&this.toggleDialogHandler()}toggleDialogHandler(){this.open?this.onOpen(""):this.onClose("")}closeDrawer(){this.open=!1}renderContent(){let i=this.embedUrl?t`<iframe src=${this.embedUrl}></iframe>`:t`<slot />`;return t`<section class=${this.embedUrl?"iframe-content":"content"}>
|
|
2
|
+
${i}
|
|
3
|
+
</section>`}renderContainer(){let i=this.caption?t`<h2 id="drawer-caption">${this.caption}</h2>`:"",c=this.externalLink?t`<bl-button
|
|
4
|
+
icon="external_link"
|
|
5
|
+
variant="tertiary"
|
|
6
|
+
kind="neutral"
|
|
7
|
+
size="small"
|
|
8
|
+
href="${this.externalLink}"
|
|
9
|
+
target="_blank"
|
|
10
|
+
></bl-button>`:"";return t`<div class="container">
|
|
11
|
+
<header>
|
|
12
|
+
${i}
|
|
13
|
+
<div class="header-buttons">
|
|
14
|
+
${c}
|
|
15
|
+
<bl-button
|
|
16
|
+
@click="${this.closeDrawer}"
|
|
17
|
+
icon="close"
|
|
18
|
+
size="small"
|
|
19
|
+
variant="tertiary"
|
|
20
|
+
kind="neutral"
|
|
21
|
+
></bl-button>
|
|
22
|
+
</div>
|
|
23
|
+
</header>
|
|
24
|
+
${this.renderContent()}
|
|
25
|
+
</div>`}render(){return this.open?t`<div class="drawer">
|
|
26
|
+
${this.renderContainer()}
|
|
27
|
+
</div>`:t``}};r([n({type:Boolean,reflect:!0})],e.prototype,"open",2),r([n({type:String})],e.prototype,"caption",2),r([n({type:String,attribute:"embed-url"})],e.prototype,"embedUrl",2),r([n({type:String,attribute:"external-link"})],e.prototype,"externalLink",2),r([a("bl-drawer-open")],e.prototype,"onOpen",2),r([a("bl-drawer-close")],e.prototype,"onClose",2),e=r([s("bl-drawer")],e);export{e as a};
|
|
28
|
+
//# sourceMappingURL=chunk-UL6BSR26.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/drawer/bl-drawer.css", "../src/components/drawer/bl-drawer.ts"],
|
|
4
|
+
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`@keyframes slide-from-right{0%{transform:translateX(+100%)}100%{transform:translateX(0)}}.drawer{position:fixed;top:0;right:0;width:424px;height:100%;background:var(--bl-color-primary-background);box-shadow:var(--bl-size-xs) 0 var(--bl-size-2xl) rgba(0 0 0 / 50%);animation:.25s slide-from-right;z-index:999}iframe{height:100%;width:100%;border:0}.container{display:flex;flex-direction:column;width:100%;height:100%}header{display:flex;justify-content:space-between;align-items:baseline;gap:var(--bl-size-2xs);padding:var(--bl-size-xl) var(--bl-size-xl) 0 var(--bl-size-xl);background-color:white}header .header-buttons{display:flex;gap:24px;margin-left:auto}header h2{font:var(--bl-font-title-1-medium);color:var(--bl-color-secondary);overflow:hidden;margin:0;padding:0}section{padding:var(--bl-size-xl) var(--bl-size-xl) var(--bl-size-m) var(--bl-size-xl)}.content{overflow-y:scroll}.iframe-content{height:100%}@media only screen and (max-width:424px){:host([open]) .drawer{width:calc(100vw - 24px)}}`;\nexport default styles;\n", "import {customElement, property} from \"lit/decorators.js\";\nimport {CSSResultGroup, html, LitElement, TemplateResult} from \"lit\";\nimport {event, EventDispatcher} from \"../../utilities/event\";\nimport '../button/bl-button';\nimport style from './bl-drawer.css';\nimport {PropertyValues} from \"lit\";\n\n/**\n * @tag bl-drawer\n * @summary Baklava Drawer component\n *\n */\n\n@customElement('bl-drawer')\nexport default class BlDrawer extends LitElement{\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n /**\n * Sets drawer open-close status\n */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n /**\n * Sets the drawer title\n */\n @property({type:String})\n caption?: string;\n\n /**\n * Sets the drawer embed url for iframe\n */\n @property({type:String, attribute:'embed-url'})\n embedUrl?: string;\n\n /**\n * Sets the drawer external link\n */\n @property({type:String, attribute:'external-link'})\n externalLink?: string;\n\n /**\n * Fires when the drawer is opened\n */\n @event('bl-drawer-open') private onOpen: EventDispatcher<string>;\n\n /**\n * Fires when the drawer is closed\n */\n @event('bl-drawer-close') private onClose: EventDispatcher<string>;\n\n connectedCallback() {\n super.connectedCallback();\n window?.addEventListener('bl-drawer-open',(event) => {\n if(event.target !== this)\n this.closeDrawer();\n });\n }\n\n updated(changedProperties: PropertyValues<this>) {\n if (changedProperties.has('open')) {\n this.toggleDialogHandler();\n }\n }\n\n private toggleDialogHandler() {\n if (this.open) {\n // FIXME: Allow events without payload\n this.onOpen('');\n } else {\n // FIXME: Allow events without payload\n this.onClose('');\n }\n }\n\n private closeDrawer() {\n this.open = false;\n }\n\n private renderContent(){\n const content = this.embedUrl ?\n html`<iframe src=${this.embedUrl}></iframe>`\n : html`<slot />`\n\n return html`<section class=${this.embedUrl ? 'iframe-content' : 'content'}>\n ${content}\n </section>`\n }\n\n private renderContainer() {\n const title = this.caption ? html`<h2 id=\"drawer-caption\">${this.caption}</h2>` : '';\n const external_button = this.externalLink ? html`<bl-button\n icon=\"external_link\"\n variant=\"tertiary\"\n kind=\"neutral\"\n size=\"small\"\n href=\"${this.externalLink}\"\n target=\"_blank\"\n ></bl-button>` : '';\n\n return html`<div class=\"container\">\n <header>\n ${title}\n <div class=\"header-buttons\">\n ${external_button}\n <bl-button\n @click=\"${this.closeDrawer}\"\n icon=\"close\"\n size=\"small\"\n variant=\"tertiary\"\n kind=\"neutral\"\n ></bl-button>\n </div>\n </header>\n ${this.renderContent()}\n </div>`;\n }\n\n\n\n render(): TemplateResult{\n if(this.open){\n return html`<div class=\"drawer\">\n ${this.renderContainer()}\n </div>`;\n }else {\n return html``\n }\n }\n\n}\ndeclare global{\n interface HTMLElementTagNameMap {\n 'bl-drawer' : BlDrawer;\n }\n}\n"],
|
|
5
|
+
"mappings": "+IACO,IAAMA,EAASC,8+BACfC,EAAQF,ECYf,IAAqBG,EAArB,cAAsCC,CAAU,CAAhD,kCASE,UAAO,GARP,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CAoCA,mBAAoB,CAClB,MAAM,kBAAkB,EACxB,qBAAQ,iBAAiB,iBAAkBC,GAAU,CAChDA,EAAM,SAAW,MAClB,KAAK,YAAY,CACrB,EACF,CAEA,QAAQC,EAAyC,CAC3CA,EAAkB,IAAI,MAAM,GAC9B,KAAK,oBAAoB,CAE7B,CAEQ,qBAAsB,CACxB,KAAK,KAEP,KAAK,OAAO,EAAE,EAGd,KAAK,QAAQ,EAAE,CAEnB,CAEQ,aAAc,CACpB,KAAK,KAAO,EACd,CAEQ,eAAe,CACrB,IAAMC,EAAU,KAAK,SACnBC,gBAAmB,KAAK,qBACtBA,YAEJ,OAAOA,mBAAsB,KAAK,SAAW,iBAAmB;AAAA,QAC5DD;AAAA,iBAEN,CAEQ,iBAAkB,CACxB,IAAME,EAAQ,KAAK,QAAUD,4BAA+B,KAAK,eAAiB,GAC5EE,EAAkB,KAAK,aAAeF;AAAA;AAAA;AAAA;AAAA;AAAA,cAKlC,KAAK;AAAA;AAAA,mBAEE,GAEjB,OAAOA;AAAA;AAAA,UAEDC;AAAA;AAAA,YAEEC;AAAA;AAAA,sBAEU,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAQnB,KAAK,cAAc;AAAA,WAEzB,CAIA,QAAwB,CACtB,OAAG,KAAK,KACCF;AAAA,YACD,KAAK,gBAAgB;AAAA,gBAGpBA,GAEX,CAEF,EA7GEG,EAAA,CADCC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GARvBV,EASnB,oBAMAS,EAAA,CADCC,EAAS,CAAC,KAAK,MAAM,CAAC,GAdJV,EAenB,uBAMAS,EAAA,CADCC,EAAS,CAAC,KAAK,OAAQ,UAAU,WAAW,CAAC,GApB3BV,EAqBnB,wBAMAS,EAAA,CADCC,EAAS,CAAC,KAAK,OAAQ,UAAU,eAAe,CAAC,GA1B/BV,EA2BnB,4BAKiCS,EAAA,CAAhCN,EAAM,gBAAgB,GAhCJH,EAgCc,sBAKCS,EAAA,CAAjCN,EAAM,iBAAiB,GArCLH,EAqCe,uBArCfA,EAArBS,EAAA,CADCE,EAAc,WAAW,GACLX",
|
|
6
|
+
"names": ["styles", "r", "bl_drawer_default", "BlDrawer", "s", "bl_drawer_default", "event", "changedProperties", "content", "$", "title", "external_button", "__decorateClass", "e", "n"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { CSSResultGroup, LitElement, TemplateResult } from "lit";
|
|
2
|
+
import '../button/bl-button';
|
|
3
|
+
import { PropertyValues } from "lit";
|
|
4
|
+
/**
|
|
5
|
+
* @tag bl-drawer
|
|
6
|
+
* @summary Baklava Drawer component
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
export default class BlDrawer extends LitElement {
|
|
10
|
+
static get styles(): CSSResultGroup;
|
|
11
|
+
/**
|
|
12
|
+
* Sets drawer open-close status
|
|
13
|
+
*/
|
|
14
|
+
open: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Sets the drawer title
|
|
17
|
+
*/
|
|
18
|
+
caption?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Sets the drawer embed url for iframe
|
|
21
|
+
*/
|
|
22
|
+
embedUrl?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Sets the drawer external link
|
|
25
|
+
*/
|
|
26
|
+
externalLink?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Fires when the drawer is opened
|
|
29
|
+
*/
|
|
30
|
+
private onOpen;
|
|
31
|
+
/**
|
|
32
|
+
* Fires when the drawer is closed
|
|
33
|
+
*/
|
|
34
|
+
private onClose;
|
|
35
|
+
connectedCallback(): void;
|
|
36
|
+
updated(changedProperties: PropertyValues<this>): void;
|
|
37
|
+
private toggleDialogHandler;
|
|
38
|
+
private closeDrawer;
|
|
39
|
+
private renderContent;
|
|
40
|
+
private renderContainer;
|
|
41
|
+
render(): TemplateResult;
|
|
42
|
+
}
|
|
43
|
+
declare global {
|
|
44
|
+
interface HTMLElementTagNameMap {
|
|
45
|
+
'bl-drawer': BlDrawer;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=bl-drawer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bl-drawer.d.ts","sourceRoot":"","sources":["../../../src/components/drawer/bl-drawer.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,cAAc,EAAQ,UAAU,EAAE,cAAc,EAAC,MAAM,KAAK,CAAC;AAErE,OAAO,qBAAqB,CAAC;AAE7B,OAAO,EAAC,cAAc,EAAC,MAAM,KAAK,CAAC;AAEnC;;;;GAIG;AAGH,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,UAAU;IAC9C,MAAM,KAAK,MAAM,IAAI,cAAc,CAElC;IAED;;OAEG;IAEH,IAAI,UAAS;IAEb;;OAEG;IAEH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IAEH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IAEH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACsB,OAAO,CAAC,MAAM,CAA0B;IAEjE;;OAEG;IACuB,OAAO,CAAC,OAAO,CAA0B;IAEnE,iBAAiB;IAQjB,OAAO,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC;IAM/C,OAAO,CAAC,mBAAmB;IAU3B,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,eAAe;IA+BvB,MAAM,IAAI,cAAc;CAUzB;AACD,OAAO,CAAC,MAAM,CAAA;IACZ,UAAU,qBAAqB;QAC7B,WAAW,EAAG,QAAQ,CAAC;KACxB;CACF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"../../chunk-UL6BSR26.js";import"../../chunk-HUFJDENF.js";import"../../chunk-2TVOKUHE.js";import"../../chunk-ENFFFE4I.js";import"../../chunk-WXJKPVRA.js";import"../../chunk-72IJCTLJ.js";import"../../chunk-23UFIOHV.js";import"../../chunk-HG7OBTQS.js";import"../../chunk-NZ3RGSR6.js";export{a as default};
|
|
2
|
+
//# sourceMappingURL=bl-drawer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bl-drawer.test.d.ts","sourceRoot":"","sources":["../../../src/components/drawer/bl-drawer.test.ts"],"names":[],"mappings":""}
|
|
@@ -439,6 +439,93 @@
|
|
|
439
439
|
}
|
|
440
440
|
]
|
|
441
441
|
},
|
|
442
|
+
{
|
|
443
|
+
"kind": "javascript-module",
|
|
444
|
+
"path": "src/components/drawer/bl-drawer.ts",
|
|
445
|
+
"declarations": [
|
|
446
|
+
{
|
|
447
|
+
"kind": "class",
|
|
448
|
+
"description": "",
|
|
449
|
+
"name": "BlDrawer",
|
|
450
|
+
"events": [
|
|
451
|
+
{
|
|
452
|
+
"type": {
|
|
453
|
+
"text": "CustomEvent<string>"
|
|
454
|
+
},
|
|
455
|
+
"description": "Fires when the drawer is opened",
|
|
456
|
+
"name": "bl-drawer-open"
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
"type": {
|
|
460
|
+
"text": "CustomEvent<string>"
|
|
461
|
+
},
|
|
462
|
+
"description": "Fires when the drawer is closed",
|
|
463
|
+
"name": "bl-drawer-close"
|
|
464
|
+
}
|
|
465
|
+
],
|
|
466
|
+
"attributes": [
|
|
467
|
+
{
|
|
468
|
+
"name": "open",
|
|
469
|
+
"type": {
|
|
470
|
+
"text": "boolean"
|
|
471
|
+
},
|
|
472
|
+
"default": "false",
|
|
473
|
+
"description": "Sets drawer open-close status",
|
|
474
|
+
"fieldName": "open"
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
"name": "caption",
|
|
478
|
+
"type": {
|
|
479
|
+
"text": "string | undefined"
|
|
480
|
+
},
|
|
481
|
+
"description": "Sets the drawer title",
|
|
482
|
+
"fieldName": "caption"
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
"name": "embed-url",
|
|
486
|
+
"type": {
|
|
487
|
+
"text": "string | undefined"
|
|
488
|
+
},
|
|
489
|
+
"description": "Sets the drawer embed url for iframe",
|
|
490
|
+
"fieldName": "embedUrl"
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
"name": "external-link",
|
|
494
|
+
"type": {
|
|
495
|
+
"text": "string | undefined"
|
|
496
|
+
},
|
|
497
|
+
"description": "Sets the drawer external link",
|
|
498
|
+
"fieldName": "externalLink"
|
|
499
|
+
}
|
|
500
|
+
],
|
|
501
|
+
"superclass": {
|
|
502
|
+
"name": "LitElement",
|
|
503
|
+
"package": "lit"
|
|
504
|
+
},
|
|
505
|
+
"tagName": "bl-drawer",
|
|
506
|
+
"summary": "Baklava Drawer component",
|
|
507
|
+
"customElement": true
|
|
508
|
+
}
|
|
509
|
+
],
|
|
510
|
+
"exports": [
|
|
511
|
+
{
|
|
512
|
+
"kind": "js",
|
|
513
|
+
"name": "default",
|
|
514
|
+
"declaration": {
|
|
515
|
+
"name": "BlDrawer",
|
|
516
|
+
"module": "src/components/drawer/bl-drawer.ts"
|
|
517
|
+
}
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
"kind": "custom-element-definition",
|
|
521
|
+
"name": "bl-drawer",
|
|
522
|
+
"declaration": {
|
|
523
|
+
"name": "BlDrawer",
|
|
524
|
+
"module": "src/components/drawer/bl-drawer.ts"
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
]
|
|
528
|
+
},
|
|
442
529
|
{
|
|
443
530
|
"kind": "javascript-module",
|
|
444
531
|
"path": "src/components/icon/bl-icon.ts",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trendyol/baklava",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.49",
|
|
4
4
|
"description": "Trendyol Baklava Design System",
|
|
5
5
|
"main": "dist/baklava.js",
|
|
6
6
|
"module": "dist/baklava.js",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@floating-ui/dom": "^0.5.4",
|
|
61
61
|
"@fontsource/rubik": "^4.5.9",
|
|
62
|
-
"@lit-labs/react": "^1.0
|
|
62
|
+
"@lit-labs/react": "^1.1.0",
|
|
63
63
|
"@open-wc/form-control": "^0.4.1",
|
|
64
64
|
"@open-wc/form-helpers": "^0.1.2",
|
|
65
65
|
"element-internals-polyfill": "^1.1.15",
|