Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
mhmo91 committed Dec 7, 2023
1 parent 9d9b70f commit 3a45a58
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 37 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mhmo91/schmancy",
"version": "0.0.10",
"version": "0.0.11",
"description": "UI library build with web components",
"main": "./dist/index.js",
"repository": {
Expand Down
36 changes: 18 additions & 18 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
export * from './autocomplete';
export * from './busy';
export * from './button';
export * from './checkbox';
export * from './form';
export * from './input';
export * from './layout';
export * from './menu';
export * from './mixin';
export * from './notification';
export * from './option';
export * from './paper';
export * from './radio-group';
export * from './sheet';
export * from './table';
export * from './tabs';
export * from './tree';
export * from './typography';
export * from './autocomplete'
export * from './busy'
export * from './button'
export * from './checkbox'
export * from './form'
export * from './input'
export * from './layout'
export * from './menu'
export * from './mixin'
export * from './notification'
export * from './option'
export * from './paper'
export * from './radio-group'
export * from './sheet'
export * from './table'
export * from './tabs'
export * from './tree'
export * from './typography'
8 changes: 4 additions & 4 deletions src/sheet/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from './sheet'
export * from './sheet-content'
export * from './sheet.service'
export * from './hook'
export * from './hook'
export * from './sheet-content'
export * from './sheet.service'
export * from './sheet'
3 changes: 1 addition & 2 deletions src/sheet/sheet.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,5 +171,4 @@ class BottomSheetService {
// sheet?.remove()
}
}
const sheet = new BottomSheetService()
export default sheet
export const sheet = new BottomSheetService()
11 changes: 3 additions & 8 deletions src/sheet/sheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ import { classMap } from 'lit/directives/class-map.js'
import { fromEvent, merge, takeUntil, tap } from 'rxjs'
import { hook } from './hook'
import style from './sheet.scss?inline'
import bottomsheetService, {
HereMorty,
SchmancySheetPosition,
WhereAreYouRicky,
WhereAreYouRickyEvent,
} from './sheet.service'
import { HereMorty, SchmancySheetPosition, WhereAreYouRicky, WhereAreYouRickyEvent, sheet } from './sheet.service'

@customElement('schmancy-sheet')
export default class SchmancySheet extends TailwindElement(style) {
Expand Down Expand Up @@ -59,7 +54,7 @@ export default class SchmancySheet extends TailwindElement(style) {
const isSheetElementFocused =
this.sheet?.contains(event.target as Node) && document.activeElement === event.target
if (event.key === 'Escape' && !isSheetElementFocused) {
bottomsheetService.dismiss(this.uid)
sheet.dismiss(this.uid)
}
}),
),
Expand Down Expand Up @@ -157,7 +152,7 @@ export default class SchmancySheet extends TailwindElement(style) {
<div
class="overlay"
@click=${() => {
if (this.allowOverlyDismiss) bottomsheetService.dismiss(this.uid)
if (this.allowOverlyDismiss) sheet.dismiss(this.uid)
}}
></div>
<div class="contents" data-position=${this.position}>
Expand Down
1 change: 1 addition & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ export * from './sheet';
export * from './table';
export * from './tabs';
export * from './tree';
export * from './typography';
4 changes: 2 additions & 2 deletions types/sheet/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from './sheet';
export * from './hook';
export * from './sheet-content';
export * from './sheet.service';
export * from './hook';
export * from './sheet';
4 changes: 2 additions & 2 deletions types/sheet/sheet.service.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ declare class BottomSheetService {
open(target: BottomSheeetTarget): void;
close(uid?: string): void;
}
declare const sheetService: BottomSheetService;
export default sheetService;
export declare const sheet: BottomSheetService;
export {};
1 change: 1 addition & 0 deletions types/typography/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './typography';
41 changes: 41 additions & 0 deletions types/typography/typography.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
declare const SchmancyTypography_base: import("..").Constructor<CustomElementConstructor> & import("..").Constructor<import("@schmancy/mixin/tailwind/tailwind.mixin").ITailwindElementMixin> & import("..").Constructor<import("lit").LitElement> & import("..").Constructor<import("..").IBaseMixin>;
/**
* @element schmancy-typography
* @slot - The text for the typography.
*/
export declare class SchmancyTypography extends SchmancyTypography_base {
/**
* @attr {primary |secondary |success |error |warning } color - The color of the typography.
*/
color: 'primary' | 'primary-muted' | 'secondary' | 'success' | 'error' | 'warning' | 'white' | null;
/**
* @attr {display | headline | title | body | label } type - The type of the typography.
*/
type: 'display' | 'headline' | 'title' | 'body' | 'label';
/**
* @attr token - The token of the typography.
* @default medium
* @type {'small' |'medium' |'large'}
*/
token: 'small' | 'medium' | 'large';
/**
* @attr
* @default left
* @type {'left' |'center' |'right'}
*/
align: 'left' | 'center' | 'justify' | 'right';
/**
* @attr
* @default normal
* @type {'normal' |'bold'}
* @public
*/
weight: 'normal' | 'bold';
render(): import("lit-html").TemplateResult<1>;
}
declare global {
interface HTMLElementTagNameMap {
'schmancy-typography': SchmancyTypography;
}
}
export {};

0 comments on commit 3a45a58

Please sign in to comment.