bromcom-ui-next 0.1.2 → 0.1.4
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/bromcom-ui/bromcom-ui.css +1 -1
- package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
- package/dist/bromcom-ui/bromcom-ui.esm.js.map +1 -1
- package/dist/bromcom-ui/global/global.js +14 -15
- package/dist/bromcom-ui/p-04f6d730.entry.js +2 -0
- package/dist/bromcom-ui/p-04f6d730.entry.js.map +1 -0
- package/dist/bromcom-ui/{p-b36f4f44.js → p-12360e4c.js} +1 -1
- package/dist/bromcom-ui/p-15fe392b.js +3 -0
- package/dist/bromcom-ui/p-15fe392b.js.map +1 -0
- package/dist/bromcom-ui/p-1b11150b.entry.js +2 -0
- package/dist/bromcom-ui/p-1b11150b.entry.js.map +1 -0
- package/dist/bromcom-ui/p-1d86c1cf.entry.js +2 -0
- package/dist/bromcom-ui/p-1d86c1cf.entry.js.map +1 -0
- package/dist/bromcom-ui/p-31354aaa.js +2 -0
- package/dist/bromcom-ui/p-31354aaa.js.map +1 -0
- package/dist/bromcom-ui/p-3b607038.entry.js +2 -0
- package/dist/bromcom-ui/p-3b607038.entry.js.map +1 -0
- package/dist/bromcom-ui/p-5d0838e9.entry.js +2 -0
- package/dist/bromcom-ui/p-5d0838e9.entry.js.map +1 -0
- package/dist/bromcom-ui/p-729a870f.js +2 -0
- package/dist/bromcom-ui/p-729a870f.js.map +1 -0
- package/dist/bromcom-ui/p-a590f793.entry.js +2 -0
- package/dist/bromcom-ui/p-a590f793.entry.js.map +1 -0
- package/dist/bromcom-ui/p-cd437280.entry.js +2 -0
- package/dist/bromcom-ui/p-cd437280.entry.js.map +1 -0
- package/dist/bromcom-ui/p-dcea8d62.entry.js +2 -0
- package/dist/bromcom-ui/{p-0a74cf15.entry.js.map → p-dcea8d62.entry.js.map} +1 -1
- package/dist/bromcom-ui/p-ebed10d5.entry.js +2 -0
- package/dist/bromcom-ui/{p-2d836917.entry.js.map → p-ebed10d5.entry.js.map} +1 -1
- package/dist/cjs/app-globals-29edfda4.js +39 -0
- package/dist/cjs/app-globals-29edfda4.js.map +1 -0
- package/dist/cjs/bcm-accordion-group.cjs.entry.js +92 -0
- package/dist/cjs/bcm-accordion-group.cjs.entry.js.map +1 -0
- package/dist/cjs/bcm-accordion.cjs.entry.js +128 -0
- package/dist/cjs/bcm-accordion.cjs.entry.js.map +1 -0
- package/dist/cjs/bcm-alert.cjs.entry.js +2 -2
- package/dist/cjs/bcm-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/bcm-avatar_4.cjs.entry.js +577 -0
- package/dist/cjs/bcm-avatar_4.cjs.entry.js.map +1 -0
- package/dist/cjs/bcm-chip.cjs.entry.js +130 -0
- package/dist/cjs/bcm-chip.cjs.entry.js.map +1 -0
- package/dist/cjs/bcm-divider.cjs.entry.js +81 -0
- package/dist/cjs/bcm-divider.cjs.entry.js.map +1 -0
- package/dist/cjs/bcm-input.cjs.entry.js +313 -0
- package/dist/cjs/bcm-input.cjs.entry.js.map +1 -0
- package/dist/cjs/bcm-text.cjs.entry.js +4 -4
- package/dist/cjs/bcm-text.cjs.entry.js.map +1 -1
- package/dist/cjs/bcm-textarea.cjs.entry.js +316 -0
- package/dist/cjs/bcm-textarea.cjs.entry.js.map +1 -0
- package/dist/cjs/bromcom-ui.cjs.js +3 -3
- package/dist/cjs/{index-638f2d15.js → index-4795c073.js} +43 -5
- package/dist/cjs/index-4795c073.js.map +1 -0
- package/dist/{components/p-b36f4f44.js → cjs/index-5a88e57b.js} +5 -3
- package/dist/cjs/{index-a4eea4bb.js.map → index-5a88e57b.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/validation-messages-c36e5c31.js +134 -0
- package/dist/cjs/validation-messages-c36e5c31.js.map +1 -0
- package/dist/collection/collection-manifest.json +6 -1
- package/dist/collection/components/accordion/accordion.component.js +5 -5
- package/dist/collection/components/accordion/accordion.component.js.map +1 -1
- package/dist/collection/components/accordion/accordion.css +1 -1
- package/dist/collection/components/accordion-group/accordion-group.component.js +1 -1
- package/dist/collection/components/accordion-group/accordion-group.component.js.map +1 -1
- package/dist/collection/components/accordion-group/accordion-group.css +1 -1
- package/dist/collection/components/alert/alert.css +1 -1
- package/dist/collection/components/avatar/avatar.component.js.map +1 -1
- package/dist/collection/components/avatar/avatar.css +1 -1
- package/dist/collection/components/badge/badge.component.js +373 -0
- package/dist/collection/components/badge/badge.component.js.map +1 -0
- package/dist/collection/components/badge/badge.css +1 -0
- package/dist/collection/components/basic-badge/basic-badge.component.js +236 -0
- package/dist/collection/components/basic-badge/basic-badge.component.js.map +1 -0
- package/dist/collection/components/basic-badge/basic-badge.css +1 -0
- package/dist/collection/components/button/button.component.js +3 -3
- package/dist/collection/components/button/button.component.js.map +1 -1
- package/dist/collection/components/button/button.css +1 -1
- package/dist/collection/components/chip/chip.component.js +2 -2
- package/dist/collection/components/chip/chip.component.js.map +1 -1
- package/dist/collection/components/chip/chip.css +1 -1
- package/dist/collection/components/divider/divider.component.js +190 -0
- package/dist/collection/components/divider/divider.component.js.map +1 -0
- package/dist/collection/components/divider/divider.css +1 -0
- package/dist/collection/components/input/input.component.js +1050 -0
- package/dist/collection/components/input/input.component.js.map +1 -0
- package/dist/collection/components/input/input.css +2 -0
- package/dist/collection/components/input/types.js +11 -0
- package/dist/collection/components/input/types.js.map +1 -0
- package/dist/collection/components/text/text.component.js +1 -1
- package/dist/collection/components/text/text.css +1 -1
- package/dist/collection/components/textarea/textarea.component.js +1013 -0
- package/dist/collection/components/textarea/textarea.component.js.map +1 -0
- package/dist/collection/components/textarea/textarea.css +2 -0
- package/dist/collection/components/textarea/types.js +2 -0
- package/dist/collection/components/textarea/types.js.map +1 -0
- package/dist/collection/global/global.js +14 -15
- package/dist/collection/utils/i18n.js +29 -0
- package/dist/collection/utils/i18n.js.map +1 -0
- package/dist/collection/utils/id/generate-id.js +16 -0
- package/dist/collection/utils/id/generate-id.js.map +1 -0
- package/dist/collection/utils/slot/check-slot-content.js +15 -0
- package/dist/collection/utils/slot/check-slot-content.js.map +1 -0
- package/dist/collection/utils/validation-messages.js +17 -0
- package/dist/collection/utils/validation-messages.js.map +1 -0
- package/dist/components/bcm-accordion-group.js +3 -3
- package/dist/components/bcm-accordion-group.js.map +1 -1
- package/dist/components/bcm-accordion.js +7 -7
- package/dist/components/bcm-accordion.js.map +1 -1
- package/dist/components/bcm-alert.js +2 -2
- package/dist/components/bcm-alert.js.map +1 -1
- package/dist/components/bcm-avatar.js +13 -7
- package/dist/components/bcm-avatar.js.map +1 -1
- package/dist/components/bcm-badge.d.ts +11 -0
- package/dist/components/bcm-badge.js +8 -0
- package/dist/components/bcm-badge.js.map +1 -0
- package/dist/components/bcm-basic-badge.d.ts +11 -0
- package/dist/components/bcm-basic-badge.js +113 -0
- package/dist/components/bcm-basic-badge.js.map +1 -0
- package/dist/components/bcm-button.js +5 -5
- package/dist/components/bcm-button.js.map +1 -1
- package/dist/components/bcm-chip.js +4 -4
- package/dist/components/bcm-chip.js.map +1 -1
- package/dist/components/bcm-divider.d.ts +11 -0
- package/dist/components/bcm-divider.js +100 -0
- package/dist/components/bcm-divider.js.map +1 -0
- package/dist/components/bcm-input.d.ts +11 -0
- package/dist/components/bcm-input.js +369 -0
- package/dist/components/bcm-input.js.map +1 -0
- package/dist/components/bcm-text.js +4 -4
- package/dist/components/bcm-text.js.map +1 -1
- package/dist/components/bcm-textarea.d.ts +11 -0
- package/dist/components/bcm-textarea.js +369 -0
- package/dist/components/bcm-textarea.js.map +1 -0
- package/dist/components/index.js +12 -16
- package/dist/components/index.js.map +1 -1
- package/dist/{esm/index-f0e9d579.js → components/p-12360e4c.js} +3 -3
- package/dist/components/{p-b36f4f44.js.map → p-12360e4c.js.map} +1 -1
- package/dist/components/{p-0adcc84f.js → p-13582168.js} +34 -3
- package/dist/components/p-13582168.js.map +1 -0
- package/dist/components/p-31354aaa.js +129 -0
- package/dist/components/p-31354aaa.js.map +1 -0
- package/dist/components/p-39637e05.js +145 -0
- package/dist/components/p-39637e05.js.map +1 -0
- package/dist/esm/app-globals-bfa07b76.js +37 -0
- package/dist/esm/app-globals-bfa07b76.js.map +1 -0
- package/dist/esm/bcm-accordion-group.entry.js +88 -0
- package/dist/esm/bcm-accordion-group.entry.js.map +1 -0
- package/dist/esm/bcm-accordion.entry.js +124 -0
- package/dist/esm/bcm-accordion.entry.js.map +1 -0
- package/dist/esm/bcm-alert.entry.js +2 -2
- package/dist/esm/bcm-alert.entry.js.map +1 -1
- package/dist/esm/bcm-avatar_4.entry.js +570 -0
- package/dist/esm/bcm-avatar_4.entry.js.map +1 -0
- package/dist/esm/bcm-chip.entry.js +126 -0
- package/dist/esm/bcm-chip.entry.js.map +1 -0
- package/dist/esm/bcm-divider.entry.js +77 -0
- package/dist/esm/bcm-divider.entry.js.map +1 -0
- package/dist/esm/bcm-input.entry.js +309 -0
- package/dist/esm/bcm-input.entry.js.map +1 -0
- package/dist/esm/bcm-text.entry.js +4 -4
- package/dist/esm/bcm-text.entry.js.map +1 -1
- package/dist/esm/bcm-textarea.entry.js +312 -0
- package/dist/esm/bcm-textarea.entry.js.map +1 -0
- package/dist/esm/bromcom-ui.js +4 -4
- package/dist/{cjs/index-a4eea4bb.js → esm/index-097075ad.js} +3 -5
- package/dist/esm/{index-f0e9d579.js.map → index-097075ad.js.map} +1 -1
- package/dist/esm/{index-ce2fac11.js → index-27cc1bac.js} +43 -5
- package/dist/esm/index-27cc1bac.js.map +1 -0
- package/dist/esm/loader.js +4 -4
- package/dist/esm/validation-messages-a29d53be.js +129 -0
- package/dist/esm/validation-messages-a29d53be.js.map +1 -0
- package/dist/types/components/badge/badge.component.d.ts +87 -0
- package/dist/types/components/basic-badge/basic-badge.component.d.ts +54 -0
- package/dist/types/components/divider/divider.component.d.ts +40 -0
- package/dist/types/components/input/input.component.d.ts +93 -0
- package/dist/types/components/input/types.d.ts +13 -0
- package/dist/types/components/textarea/textarea.component.d.ts +85 -0
- package/dist/types/components/textarea/types.d.ts +7 -0
- package/dist/types/components.d.ts +889 -0
- package/dist/types/utils/i18n.d.ts +8 -0
- package/dist/types/utils/id/generate-id.d.ts +9 -0
- package/dist/types/utils/slot/check-slot-content.d.ts +7 -0
- package/dist/types/utils/validation-messages.d.ts +11 -0
- package/package.json +3 -2
- package/dist/bromcom-ui/p-0a74cf15.entry.js +0 -2
- package/dist/bromcom-ui/p-27c997d8.js +0 -3
- package/dist/bromcom-ui/p-27c997d8.js.map +0 -1
- package/dist/bromcom-ui/p-2d836917.entry.js +0 -2
- package/dist/bromcom-ui/p-40643b53.js +0 -2
- package/dist/bromcom-ui/p-40643b53.js.map +0 -1
- package/dist/bromcom-ui/p-84a5dcdb.entry.js +0 -2
- package/dist/bromcom-ui/p-84a5dcdb.entry.js.map +0 -1
- package/dist/bromcom-ui/p-f0c61f8c.entry.js +0 -2
- package/dist/bromcom-ui/p-f0c61f8c.entry.js.map +0 -1
- package/dist/cjs/app-globals-e8faea0d.js +0 -43
- package/dist/cjs/app-globals-e8faea0d.js.map +0 -1
- package/dist/cjs/bcm-accordion_4.cjs.entry.js +0 -623
- package/dist/cjs/bcm-accordion_4.cjs.entry.js.map +0 -1
- package/dist/cjs/bcm-avatar.cjs.entry.js +0 -89
- package/dist/cjs/bcm-avatar.cjs.entry.js.map +0 -1
- package/dist/cjs/index-638f2d15.js.map +0 -1
- package/dist/components/p-0adcc84f.js.map +0 -1
- package/dist/esm/app-globals-f781c325.js +0 -41
- package/dist/esm/app-globals-f781c325.js.map +0 -1
- package/dist/esm/bcm-accordion_4.entry.js +0 -616
- package/dist/esm/bcm-accordion_4.entry.js.map +0 -1
- package/dist/esm/bcm-avatar.entry.js +0 -85
- package/dist/esm/bcm-avatar.entry.js.map +0 -1
- package/dist/esm/index-ce2fac11.js.map +0 -1
- /package/dist/bromcom-ui/{p-b36f4f44.js.map → p-12360e4c.js.map} +0 -0
|
@@ -0,0 +1,577 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-4795c073.js');
|
|
6
|
+
const index$1 = require('./index-5a88e57b.js');
|
|
7
|
+
const index$2 = require('./index-310db2a6.js');
|
|
8
|
+
|
|
9
|
+
const avatarCss = ":host{--bcm-avatar-bg:var(--bcm-ui-color-background-default-default);--bcm-avatar-text:var(--bcm-ui-color-text-default);--bcm-avatar-radius:50%}.bcm-ui-element{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Inter,sans-serif}.static{position:static}.-right-0\\.5{right:-.125rem}.-top-0\\.5{top:-.125rem}.right-0{right:0}.top-0{top:0}.inline-flex{display:inline-flex}.h-10{height:2.5rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-full{height:100%}.w-10{width:2.5rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-full{width:100%}.items-center{align-items:center}.justify-center{justify-content:center}.rounded-\\[--bcm-ui-radius\\]{border-radius:var(--bcm-ui-radius)}.rounded-full{border-radius:9999px}.bg-\\[--bcm-avatar-bg\\]{background-color:var(--bcm-avatar-bg)}.text-size-4{font-size:var(--bcm-ui-font-size-4,14px);line-height:var(--bcm-ui-line-height-4,20px)}.text-size-5{font-size:var(--bcm-ui-font-size-5,16px);line-height:var(--bcm-ui-line-height-5,24px)}.text-size-6{font-size:var(--bcm-ui-font-size-6,18px);line-height:var(--bcm-ui-line-height-6,24px)}.font-medium{font-weight:500}.uppercase{text-transform:uppercase}.text-\\[--bcm-avatar-text\\]{color:var(--bcm-avatar-text)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}";
|
|
10
|
+
const BcmAvatarStyle0 = avatarCss;
|
|
11
|
+
|
|
12
|
+
const BcmAvatar = class {
|
|
13
|
+
constructor(hostRef) {
|
|
14
|
+
index.registerInstance(this, hostRef);
|
|
15
|
+
/** Shape of the avatar (ellipse/square) */
|
|
16
|
+
this.shape = 'ellipse';
|
|
17
|
+
/** Size of the avatar */
|
|
18
|
+
this.size = 'medium';
|
|
19
|
+
/** Fallback icon class */
|
|
20
|
+
this.icon = 'fas fa-user';
|
|
21
|
+
/** Status indicator animation */
|
|
22
|
+
this.blink = false;
|
|
23
|
+
this.isFallback = false;
|
|
24
|
+
}
|
|
25
|
+
getFirstLetters(name) {
|
|
26
|
+
const words = name.split(' ');
|
|
27
|
+
const initials = words.map(word => word.charAt(0).toUpperCase()).join('');
|
|
28
|
+
return initials.substring(0, 2);
|
|
29
|
+
}
|
|
30
|
+
render() {
|
|
31
|
+
const baseClass = index$1.classNames('bcm-avatar bcm-ui-element bcm-ui-content-display', 'uppercase font-medium', 'inline-flex items-center justify-center', 'bg-[--bcm-avatar-bg] text-[--bcm-avatar-text]', {
|
|
32
|
+
'shape-ellipse rounded-full': this.shape === 'ellipse',
|
|
33
|
+
'shape-square rounded-[--bcm-ui-radius]': this.shape === 'square',
|
|
34
|
+
'size-small text-size-4 w-6 h-6': this.size === 'small',
|
|
35
|
+
'size-medium text-size-5 w-8 h-8': this.size === 'medium',
|
|
36
|
+
'size-large text-size-6 w-10 h-10': this.size === 'large',
|
|
37
|
+
});
|
|
38
|
+
const badgeClass = index$1.classNames('badge', {
|
|
39
|
+
'top-0 right-0': this.shape === 'ellipse',
|
|
40
|
+
'-top-0.5 -right-0.5': this.shape === 'square',
|
|
41
|
+
});
|
|
42
|
+
const imageClass = index$1.classNames('image w-full h-full', {
|
|
43
|
+
'rounded-full': this.shape === 'ellipse',
|
|
44
|
+
'rounded-[--bcm-ui-radius]': this.shape === 'square',
|
|
45
|
+
});
|
|
46
|
+
let style = {};
|
|
47
|
+
if (this.color) {
|
|
48
|
+
const isColorTone = this.color.includes('-');
|
|
49
|
+
const _color = isColorTone ? this.color.split('-')[0] : this.color;
|
|
50
|
+
const bgColor = `var(--bcm-ui-color-background-palette-${_color}-default)`;
|
|
51
|
+
const textColor = `var(--bcm-ui-color-text-palette-${_color}`;
|
|
52
|
+
style = {
|
|
53
|
+
'--bcm-avatar-bg': bgColor,
|
|
54
|
+
'--bcm-avatar-text': textColor,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
const customSize = !Object.keys(['small', 'medium', 'large']).includes(this.size)
|
|
58
|
+
? {
|
|
59
|
+
width: `${this.size}px`,
|
|
60
|
+
height: `${this.size}px`,
|
|
61
|
+
fontSize: `${+this.size / 2}px`,
|
|
62
|
+
}
|
|
63
|
+
: {};
|
|
64
|
+
const RenderContent = () => {
|
|
65
|
+
if (this.isFallback) {
|
|
66
|
+
if (this.name) {
|
|
67
|
+
return this.getFirstLetters(this.name);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
return index.h("i", { class: this.icon });
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
else if (this.image) {
|
|
74
|
+
return index.h("img", { class: imageClass, onError: () => (this.isFallback = true), src: this.image, alt: this.alt, "aria-label": this.alt || this.name || 'Avatar' });
|
|
75
|
+
}
|
|
76
|
+
else if (this.name) {
|
|
77
|
+
return this.getFirstLetters(this.name);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
return index.h("i", { class: this.icon });
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
return (index.h("div", { role: "img", "aria-label": this.alt || this.name || 'Avatar', class: baseClass, style: Object.assign(Object.assign({}, style), customSize) }, index.h(RenderContent, null), this.status && index.h("bcm-badge", { class: badgeClass, status: this.status, blink: this.blink, "aria-hidden": "true" }), index.h("slot", null)));
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
BcmAvatar.style = BcmAvatarStyle0;
|
|
87
|
+
|
|
88
|
+
const badgeCss = ".relative{position:relative}:host{--bcm-badge-bg:var(--bcm-ui-color-background-default-default);--bcm-badge-text:var(--bcm-ui-color-text-default);--bcm-badge-radius:9999px;display:inline-block;position:relative}::slotted([slot=badge]){color:var(--bcm-badge-text);font-weight:500}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.bcm-ui-element{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Inter,sans-serif}.static{position:static}.absolute{position:absolute}.-bottom-1{bottom:-.25rem}.-left-1{left:-.25rem}.-right-1{right:-.25rem}.-top-1{top:-.25rem}.z-10{z-index:10}.inline-flex{display:inline-flex}.size-1{height:.25rem;width:.25rem}.size-1\\.5{height:.375rem;width:.375rem}.size-2{height:.5rem;width:.5rem}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.items-center{align-items:center}.justify-center{justify-content:center}.gap-0{gap:0}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.rounded-\\[--bcm-badge-radius\\]{border-radius:var(--bcm-badge-radius)}.bg-\\[--bcm-badge-bg\\]{background-color:var(--bcm-badge-bg)}.p-0{padding:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.py-0\\.5{padding-bottom:.125rem;padding-top:.125rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.text-\\[0px\\]{font-size:0}.text-size-3{font-size:var(--bcm-ui-font-size-3,12px);line-height:var(--bcm-ui-line-height-3,16px)}.text-size-4{font-size:var(--bcm-ui-font-size-4,14px);line-height:var(--bcm-ui-line-height-4,20px)}.text-size-5{font-size:var(--bcm-ui-font-size-5,16px);line-height:var(--bcm-ui-line-height-5,24px)}.font-medium{font-weight:500}.leading-none{line-height:1}.text-\\[--bcm-badge-text\\]{color:var(--bcm-badge-text)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:h-full:after{content:var(--tw-content);height:100%}.after\\:w-full:after{content:var(--tw-content);width:100%}@keyframes ping{75%,to{content:var(--tw-content);opacity:0;transform:scale(2)}}.after\\:animate-blink:after{animation:ping 2s infinite;content:var(--tw-content)}.after\\:rounded-full:after{border-radius:9999px;content:var(--tw-content)}.after\\:bg-\\[--bcm-badge-bg\\]:after{background-color:var(--bcm-badge-bg);content:var(--tw-content)}.after\\:content-\\[\\\"\\\"\\]:after{--tw-content:\"\";content:var(--tw-content)}.-right-0\\.5{right:-.125rem}.-top-0\\.5{top:-.125rem}.right-0{right:0}.top-0{top:0}.h-10{height:2.5rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-full{height:100%}.w-10{width:2.5rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-full{width:100%}.rounded-\\[--bcm-ui-radius\\]{border-radius:var(--bcm-ui-radius)}.rounded-full{border-radius:9999px}.bg-\\[--bcm-avatar-bg\\]{background-color:var(--bcm-avatar-bg)}.text-size-6{font-size:var(--bcm-ui-font-size-6,18px);line-height:var(--bcm-ui-line-height-6,24px)}.uppercase{text-transform:uppercase}.text-\\[--bcm-avatar-text\\]{color:var(--bcm-avatar-text)}";
|
|
89
|
+
const BcmBadgeStyle0 = badgeCss;
|
|
90
|
+
|
|
91
|
+
const Badge = class {
|
|
92
|
+
constructor(hostRef) {
|
|
93
|
+
index.registerInstance(this, hostRef);
|
|
94
|
+
/**
|
|
95
|
+
* Determines the size of the badge.
|
|
96
|
+
* @type {'small' | 'medium' | 'large'}
|
|
97
|
+
* @default 'medium'
|
|
98
|
+
*/
|
|
99
|
+
this.size = 'medium';
|
|
100
|
+
/**
|
|
101
|
+
* Sets the visual variant of the badge.
|
|
102
|
+
* 'dot': Appears as a small dot indicator
|
|
103
|
+
* 'text': Displays content as text
|
|
104
|
+
* @type {'dot' | 'text'}
|
|
105
|
+
* @default 'text'
|
|
106
|
+
*/
|
|
107
|
+
this.variant = 'text';
|
|
108
|
+
/**
|
|
109
|
+
* Enables soft color mode for the badge.
|
|
110
|
+
* When true, uses lighter tones and pastel colors.
|
|
111
|
+
* @type {boolean}
|
|
112
|
+
* @default false
|
|
113
|
+
*/
|
|
114
|
+
this.soft = false;
|
|
115
|
+
/**
|
|
116
|
+
* Enables blinking animation for the badge.
|
|
117
|
+
* Useful for drawing attention or indicating active status.
|
|
118
|
+
* @type {boolean}
|
|
119
|
+
* @default false
|
|
120
|
+
*/
|
|
121
|
+
this.blink = false;
|
|
122
|
+
/**
|
|
123
|
+
* Sets the position of the badge relative to its container.
|
|
124
|
+
* @type {'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'}
|
|
125
|
+
* @default 'top-right'
|
|
126
|
+
*/
|
|
127
|
+
this.position = 'top-right';
|
|
128
|
+
this.classes = index$2.ce({
|
|
129
|
+
base: 'badge bcm-ui-element absolute font-medium inline-flex items-center justify-center bg-[--bcm-badge-bg] text-[--bcm-badge-text] rounded-[--bcm-badge-radius] z-10',
|
|
130
|
+
variants: {
|
|
131
|
+
size: {
|
|
132
|
+
small: 'gap-1 px-1 text-size-3',
|
|
133
|
+
medium: 'gap-1 py-0.5 px-1.5 text-size-4',
|
|
134
|
+
large: 'gap-2 py-1 px-2 text-size-5',
|
|
135
|
+
},
|
|
136
|
+
variant: {
|
|
137
|
+
dot: 'gap-0 p-0 text-[0px] leading-none',
|
|
138
|
+
text: '',
|
|
139
|
+
},
|
|
140
|
+
position: {
|
|
141
|
+
'top-right': '-top-1 -right-1',
|
|
142
|
+
'top-left': '-top-1 -left-1',
|
|
143
|
+
'bottom-right': '-bottom-1 -right-1',
|
|
144
|
+
'bottom-left': '-bottom-1 -left-1',
|
|
145
|
+
},
|
|
146
|
+
blink: {
|
|
147
|
+
true: 'after:content-[""] after:absolute after:rounded-full after:bg-[--bcm-badge-bg] after:animate-blink after:w-full after:h-full',
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
compoundVariants: [
|
|
151
|
+
{
|
|
152
|
+
variant: 'dot',
|
|
153
|
+
size: 'small',
|
|
154
|
+
class: 'size-1',
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
variant: 'dot',
|
|
158
|
+
size: 'medium',
|
|
159
|
+
class: 'size-1.5',
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
variant: 'dot',
|
|
163
|
+
size: 'large',
|
|
164
|
+
class: 'size-2',
|
|
165
|
+
},
|
|
166
|
+
],
|
|
167
|
+
defaultVariants: {
|
|
168
|
+
variant: 'text',
|
|
169
|
+
size: 'medium',
|
|
170
|
+
position: 'top-right',
|
|
171
|
+
blink: false,
|
|
172
|
+
},
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
get offsetStyle() {
|
|
176
|
+
if (!this.offset)
|
|
177
|
+
return {};
|
|
178
|
+
const [x = 0, y = 0] = this.offset.split(',').map(val => val.trim());
|
|
179
|
+
return { transform: `translate(${x}px, ${y}px)` };
|
|
180
|
+
}
|
|
181
|
+
get badgeStyle() {
|
|
182
|
+
if (!this.color)
|
|
183
|
+
return {};
|
|
184
|
+
const variantType = this.soft ? 'soft' : 'vivid';
|
|
185
|
+
return {
|
|
186
|
+
'--bcm-badge-bg': `var(--bcm-ui-color-background-${variantType}-${this.color}-default)`,
|
|
187
|
+
'--bcm-badge-text': this.soft ? `var(--bcm-ui-color-text-palette-${this.color})` : 'var(--bcm-ui-color-text-base)',
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
render() {
|
|
191
|
+
return (index.h("div", { key: '9c6ce83cc0ae25399f2d97139d9e91578be38237', class: "relative inline-flex" }, index.h("slot", { key: 'b05db7fc70a8ff5c680e79507d44678ea4f8aba4' }), index.h("div", { key: 'e3fe3d09e236ae1569d533824f4bb585a5871b53', role: "status", "aria-live": "polite", "aria-label": this.status ? `Status: ${this.status}` : undefined, class: this.classes({
|
|
192
|
+
size: this.size,
|
|
193
|
+
variant: this.variant,
|
|
194
|
+
position: this.position,
|
|
195
|
+
blink: this.blink,
|
|
196
|
+
}), style: Object.assign(Object.assign({}, this.badgeStyle), this.offsetStyle) }, this.variant == 'text' && index.h("slot", { key: '98e3f9eaa2966a748e41782efbe78ca35a9deee6', name: "badge" }, this.text))));
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
Badge.style = BcmBadgeStyle0;
|
|
200
|
+
|
|
201
|
+
const basicBadgeCss = ":host{--bcm-badge-bg:var(--bcm-ui-color-background-default-default);--bcm-badge-text:var(--bcm-ui-color-text-default);--bcm-badge-radius:9999px;display:inline-flex;height:-moz-fit-content;height:fit-content;width:-moz-fit-content;width:fit-content}.badge-content{color:var(--bcm-badge-text);font-weight:500}.bcm-ui-element{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Inter,sans-serif}.static{position:static}.inline-flex{display:inline-flex}.size-1{height:.25rem;width:.25rem}.size-1\\.5{height:.375rem;width:.375rem}.size-2{height:.5rem;width:.5rem}.select-none{user-select:none}.items-center{align-items:center}.justify-center{justify-content:center}.gap-0{gap:0}.whitespace-nowrap{white-space:nowrap}.rounded-\\[--bcm-badge-radius\\]{border-radius:var(--bcm-badge-radius)}.bg-\\[--bcm-badge-bg\\]{background-color:var(--bcm-badge-bg)}.p-0{padding:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.py-0\\.5{padding-bottom:.125rem;padding-top:.125rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.text-\\[0px\\]{font-size:0}.text-size-3{font-size:var(--bcm-ui-font-size-3,12px);line-height:var(--bcm-ui-line-height-3,16px)}.text-size-4{font-size:var(--bcm-ui-font-size-4,14px);line-height:var(--bcm-ui-line-height-4,20px)}.text-size-5{font-size:var(--bcm-ui-font-size-5,16px);line-height:var(--bcm-ui-line-height-5,24px)}.font-medium{font-weight:500}.leading-none{line-height:1}.text-\\[--bcm-badge-text\\]{color:var(--bcm-badge-text)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}";
|
|
202
|
+
const BcmBasicBadgeStyle0 = basicBadgeCss;
|
|
203
|
+
|
|
204
|
+
const BasicBadge = class {
|
|
205
|
+
constructor(hostRef) {
|
|
206
|
+
index.registerInstance(this, hostRef);
|
|
207
|
+
/**
|
|
208
|
+
* Determines the size of the badge.
|
|
209
|
+
* @type {'small' | 'medium' | 'large'}
|
|
210
|
+
* @default 'medium'
|
|
211
|
+
*/
|
|
212
|
+
this.size = 'medium';
|
|
213
|
+
/**
|
|
214
|
+
* Sets the visual variant of the badge.
|
|
215
|
+
* 'dot': Appears as a small dot indicator
|
|
216
|
+
* 'text': Displays content as text
|
|
217
|
+
* @type {'dot' | 'text'}
|
|
218
|
+
* @default 'text'
|
|
219
|
+
*/
|
|
220
|
+
this.variant = 'text';
|
|
221
|
+
/**
|
|
222
|
+
* Enables soft color mode for the badge.
|
|
223
|
+
* When true, uses lighter tones and pastel colors.
|
|
224
|
+
* @type {boolean}
|
|
225
|
+
* @default false
|
|
226
|
+
*/
|
|
227
|
+
this.soft = false;
|
|
228
|
+
this.classes = index$2.ce({
|
|
229
|
+
base: 'badge bcm-ui-element inline-flex items-center justify-center whitespace-nowrap select-none font-medium bg-[--bcm-badge-bg] text-[--bcm-badge-text] rounded-[--bcm-badge-radius]',
|
|
230
|
+
variants: {
|
|
231
|
+
size: {
|
|
232
|
+
small: 'px-1 text-size-3',
|
|
233
|
+
medium: 'py-0.5 px-1.5 text-size-4',
|
|
234
|
+
large: 'py-1 px-2 text-size-5',
|
|
235
|
+
},
|
|
236
|
+
variant: {
|
|
237
|
+
dot: 'gap-0 p-0 text-[0px] leading-none',
|
|
238
|
+
text: '',
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
compoundVariants: [
|
|
242
|
+
{
|
|
243
|
+
variant: 'dot',
|
|
244
|
+
size: 'small',
|
|
245
|
+
class: 'size-1',
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
variant: 'dot',
|
|
249
|
+
size: 'medium',
|
|
250
|
+
class: 'size-1.5',
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
variant: 'dot',
|
|
254
|
+
size: 'large',
|
|
255
|
+
class: 'size-2',
|
|
256
|
+
},
|
|
257
|
+
],
|
|
258
|
+
defaultVariants: {
|
|
259
|
+
variant: 'text',
|
|
260
|
+
size: 'medium',
|
|
261
|
+
blink: false,
|
|
262
|
+
},
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
get badgeStyle() {
|
|
266
|
+
if (!this.color)
|
|
267
|
+
return {};
|
|
268
|
+
const variantType = this.soft ? 'soft' : 'vivid';
|
|
269
|
+
return {
|
|
270
|
+
'--bcm-badge-bg': `var(--bcm-ui-color-background-${variantType}-${this.color}-default)`,
|
|
271
|
+
'--bcm-badge-text': this.soft ? `var(--bcm-ui-color-text-palette-${this.color})` : 'var(--bcm-ui-color-text-base)',
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
render() {
|
|
275
|
+
return (index.h("span", { key: '17d82a67aaf2793bbd922c901bbfb05b91abea35', part: "base", role: "status", "aria-live": "polite", style: this.badgeStyle, class: this.classes({
|
|
276
|
+
size: this.size,
|
|
277
|
+
variant: this.variant,
|
|
278
|
+
}) }, this.variant === 'text' && (index.h("span", { key: '5b4fffd0979dec737d0209f8268467c19a5dd795', class: "badge-content" }, index.h("slot", { key: 'a554c64e657079ba933ead458c76a894f236b533' })))));
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
BasicBadge.style = BcmBasicBadgeStyle0;
|
|
282
|
+
|
|
283
|
+
const variantOptions = {
|
|
284
|
+
save: {
|
|
285
|
+
text: 'Save',
|
|
286
|
+
status: 'success',
|
|
287
|
+
icon: 'far fa-save',
|
|
288
|
+
iconPosition: 'prefix',
|
|
289
|
+
kind: 'primary',
|
|
290
|
+
},
|
|
291
|
+
ok: {
|
|
292
|
+
text: 'Ok',
|
|
293
|
+
status: 'success',
|
|
294
|
+
icon: 'far fa-check',
|
|
295
|
+
iconPosition: 'prefix',
|
|
296
|
+
},
|
|
297
|
+
new: {
|
|
298
|
+
text: 'New',
|
|
299
|
+
status: 'success',
|
|
300
|
+
icon: 'far fa-plus',
|
|
301
|
+
iconPosition: 'prefix',
|
|
302
|
+
},
|
|
303
|
+
add: {
|
|
304
|
+
text: 'Add',
|
|
305
|
+
status: 'success',
|
|
306
|
+
icon: 'far fa-plus',
|
|
307
|
+
iconPosition: 'prefix',
|
|
308
|
+
},
|
|
309
|
+
create: {
|
|
310
|
+
text: 'Create',
|
|
311
|
+
status: 'success',
|
|
312
|
+
icon: 'far fa-plus',
|
|
313
|
+
iconPosition: 'prefix',
|
|
314
|
+
},
|
|
315
|
+
prev: {
|
|
316
|
+
text: 'Prev',
|
|
317
|
+
status: 'default',
|
|
318
|
+
icon: 'far fa-arrow-left',
|
|
319
|
+
iconPosition: 'prefix',
|
|
320
|
+
},
|
|
321
|
+
next: {
|
|
322
|
+
text: 'Next',
|
|
323
|
+
status: 'default',
|
|
324
|
+
icon: 'far fa-arrow-right',
|
|
325
|
+
iconPosition: 'suffix',
|
|
326
|
+
},
|
|
327
|
+
apply: {
|
|
328
|
+
text: 'Apply',
|
|
329
|
+
status: 'default',
|
|
330
|
+
icon: 'far fa-check-circle',
|
|
331
|
+
iconPosition: 'prefix',
|
|
332
|
+
},
|
|
333
|
+
submit: {
|
|
334
|
+
text: 'Submit',
|
|
335
|
+
status: 'default',
|
|
336
|
+
icon: 'far fa-save',
|
|
337
|
+
iconPosition: 'prefix',
|
|
338
|
+
},
|
|
339
|
+
send: {
|
|
340
|
+
text: 'Send',
|
|
341
|
+
status: 'success',
|
|
342
|
+
icon: 'far fa-paper-plane',
|
|
343
|
+
iconPosition: 'prefix',
|
|
344
|
+
},
|
|
345
|
+
delete: {
|
|
346
|
+
text: 'Delete',
|
|
347
|
+
status: 'error',
|
|
348
|
+
icon: 'far fa-trash',
|
|
349
|
+
iconPosition: 'prefix',
|
|
350
|
+
},
|
|
351
|
+
cancel: {
|
|
352
|
+
text: 'Cancel',
|
|
353
|
+
status: 'error',
|
|
354
|
+
icon: 'far fa-times',
|
|
355
|
+
iconPosition: 'prefix',
|
|
356
|
+
},
|
|
357
|
+
decline: {
|
|
358
|
+
text: 'Decline',
|
|
359
|
+
status: 'error',
|
|
360
|
+
icon: 'far fa-ban',
|
|
361
|
+
iconPosition: 'prefix',
|
|
362
|
+
},
|
|
363
|
+
close: {
|
|
364
|
+
text: 'Close',
|
|
365
|
+
status: 'error',
|
|
366
|
+
icon: 'far fa-times-circle',
|
|
367
|
+
iconPosition: 'prefix',
|
|
368
|
+
},
|
|
369
|
+
archive: {
|
|
370
|
+
text: 'Archive',
|
|
371
|
+
status: 'error',
|
|
372
|
+
icon: 'far fa-folder-open',
|
|
373
|
+
iconPosition: 'prefix',
|
|
374
|
+
},
|
|
375
|
+
remove: {
|
|
376
|
+
text: 'Remove',
|
|
377
|
+
status: 'error',
|
|
378
|
+
icon: 'far fa-minus-circle',
|
|
379
|
+
iconPosition: 'prefix',
|
|
380
|
+
},
|
|
381
|
+
edit: {
|
|
382
|
+
text: 'Edit',
|
|
383
|
+
status: 'default',
|
|
384
|
+
icon: 'far fa-edit',
|
|
385
|
+
iconPosition: 'prefix',
|
|
386
|
+
},
|
|
387
|
+
export: {
|
|
388
|
+
text: 'Export',
|
|
389
|
+
status: 'default',
|
|
390
|
+
icon: 'far fa-sign-out',
|
|
391
|
+
iconPosition: 'prefix',
|
|
392
|
+
},
|
|
393
|
+
import: {
|
|
394
|
+
text: 'Import',
|
|
395
|
+
status: 'default',
|
|
396
|
+
icon: 'far fa-sign-in',
|
|
397
|
+
iconPosition: 'prefix',
|
|
398
|
+
},
|
|
399
|
+
filter: {
|
|
400
|
+
text: 'Filter',
|
|
401
|
+
status: 'default',
|
|
402
|
+
icon: 'far fa-filter',
|
|
403
|
+
iconPosition: 'prefix',
|
|
404
|
+
},
|
|
405
|
+
update: {
|
|
406
|
+
text: 'Update',
|
|
407
|
+
status: 'default',
|
|
408
|
+
icon: 'far fa-sync',
|
|
409
|
+
iconPosition: 'prefix',
|
|
410
|
+
},
|
|
411
|
+
reset: {
|
|
412
|
+
text: 'Reset',
|
|
413
|
+
status: 'default',
|
|
414
|
+
icon: 'far fa-sync',
|
|
415
|
+
iconPosition: 'prefix',
|
|
416
|
+
},
|
|
417
|
+
download: {
|
|
418
|
+
text: 'Download',
|
|
419
|
+
status: 'default',
|
|
420
|
+
icon: 'far fa-download',
|
|
421
|
+
iconPosition: 'prefix',
|
|
422
|
+
},
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
const buttonCss = ".relative{position:relative}:host{display:inline-block;position:relative}:host([full-width]){width:100%}.inline-flex{display:inline-flex}.min-h-10{min-height:2.5rem}.min-h-6{min-height:1.5rem}.min-h-8{min-height:2rem}.w-full{width:100%}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.appearance-none{appearance:none}.items-center{align-items:center}.justify-center{justify-content:center}.rounded{border-radius:.25rem}.border{border-width:1px}.border-solid{border-style:solid}.border-\\[--bcm-button-border\\]{border-color:var(--bcm-button-border)}.bg-\\[--bcm-button-bg\\]{background-color:var(--bcm-button-bg)}.bg-\\[--bcm-ui-color-background-disabled-default\\]{background-color:var(--bcm-ui-color-background-disabled-default)}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.py-0\\.5{padding-bottom:.125rem;padding-top:.125rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-px{padding-bottom:1px;padding-top:1px}.text-size-4{font-size:var(--bcm-ui-font-size-4,14px);line-height:var(--bcm-ui-line-height-4,20px)}.text-size-5{font-size:var(--bcm-ui-font-size-5,16px);line-height:var(--bcm-ui-line-height-5,24px)}.text-size-6{font-size:var(--bcm-ui-font-size-6,18px);line-height:var(--bcm-ui-line-height-6,24px)}.leading-none{line-height:1}.text-\\[--bcm-button-text\\]{color:var(--bcm-button-text)}.text-color-disabled{color:var(--bcm-ui-color-text-disabled)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline{outline-style:solid}.outline-0{outline-width:0}.hover\\:bg-\\[--bcm-button-bg-hover\\]:hover{background-color:var(--bcm-button-bg-hover)}.focus-visible\\:ring:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.active\\:bg-\\[--bcm-button-bg-active\\]:active{background-color:var(--bcm-button-bg-active)}";
|
|
426
|
+
const BcmButtonStyle0 = buttonCss;
|
|
427
|
+
|
|
428
|
+
const BcmButton = class {
|
|
429
|
+
constructor(hostRef) {
|
|
430
|
+
index.registerInstance(this, hostRef);
|
|
431
|
+
this.bcmClick = index.createEvent(this, "bcmClick", 1);
|
|
432
|
+
this.bcmFocus = index.createEvent(this, "bcmFocus", 1);
|
|
433
|
+
this.bcmBlur = index.createEvent(this, "bcmBlur", 1);
|
|
434
|
+
/** Defines the main visual style of the button */
|
|
435
|
+
this.kind = 'primary';
|
|
436
|
+
/** Controls the button size */
|
|
437
|
+
this.size = 'medium';
|
|
438
|
+
/** Defines the button's status/state color */
|
|
439
|
+
this.status = 'default';
|
|
440
|
+
/** Icon placement (prefix/suffix) */
|
|
441
|
+
this.iconPosition = 'prefix';
|
|
442
|
+
/** Icon-only button mode */
|
|
443
|
+
this.iconOnly = false;
|
|
444
|
+
/** Full width button */
|
|
445
|
+
this.fullWidth = false;
|
|
446
|
+
/** HTML button type */
|
|
447
|
+
this.type = 'button';
|
|
448
|
+
/** Loading state */
|
|
449
|
+
this.loading = false;
|
|
450
|
+
/** Disabled state */
|
|
451
|
+
this.disabled = false;
|
|
452
|
+
/** Active state */
|
|
453
|
+
this.active = false;
|
|
454
|
+
this.handleClick = (event) => {
|
|
455
|
+
if (!this.disabled && !this.loading) {
|
|
456
|
+
this.bcmClick.emit(event);
|
|
457
|
+
}
|
|
458
|
+
};
|
|
459
|
+
this.handleFocus = (event) => {
|
|
460
|
+
this.bcmFocus.emit(event);
|
|
461
|
+
};
|
|
462
|
+
this.handleBlur = (event) => {
|
|
463
|
+
this.bcmBlur.emit(event);
|
|
464
|
+
};
|
|
465
|
+
this.buttonClass = index$2.ce({
|
|
466
|
+
base: 'bcm-button appearance-none inline-flex items-center justify-center border border-solid rounded outline-0',
|
|
467
|
+
variants: {
|
|
468
|
+
size: {
|
|
469
|
+
small: 'text-size-4 py-px px-2 min-h-6',
|
|
470
|
+
medium: 'text-size-5 py-0.5 px-3 min-h-8',
|
|
471
|
+
large: 'text-size-6 py-1 px-3 min-h-10',
|
|
472
|
+
},
|
|
473
|
+
kind: {
|
|
474
|
+
primary: 'kind-primary',
|
|
475
|
+
ghost: 'kind-ghost',
|
|
476
|
+
text: 'kind-text',
|
|
477
|
+
outline: 'kind-outline',
|
|
478
|
+
},
|
|
479
|
+
fullWidth: {
|
|
480
|
+
true: 'full-width w-full',
|
|
481
|
+
},
|
|
482
|
+
disabled: {
|
|
483
|
+
true: 'disabled cursor-not-allowed bg-[--bcm-ui-color-background-disabled-default] text-color-disabled border-color-disabled',
|
|
484
|
+
false: [
|
|
485
|
+
'cursor-pointer',
|
|
486
|
+
'bg-[--bcm-button-bg] text-[--bcm-button-text] border-[--bcm-button-border]',
|
|
487
|
+
'hover:bg-[--bcm-button-bg-hover]',
|
|
488
|
+
'active:bg-[--bcm-button-bg-active]',
|
|
489
|
+
'focus-visible:ring',
|
|
490
|
+
],
|
|
491
|
+
},
|
|
492
|
+
loading: {
|
|
493
|
+
true: '',
|
|
494
|
+
},
|
|
495
|
+
},
|
|
496
|
+
defaultVariants: {
|
|
497
|
+
size: 'medium',
|
|
498
|
+
kind: 'primary',
|
|
499
|
+
fullWidth: false,
|
|
500
|
+
disabled: false,
|
|
501
|
+
loading: false,
|
|
502
|
+
},
|
|
503
|
+
}, {
|
|
504
|
+
twMerge: false,
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
get buttonText() {
|
|
508
|
+
return this.text || (this.variant ? variantOptions[this.variant].text : '');
|
|
509
|
+
}
|
|
510
|
+
get buttonIcon() {
|
|
511
|
+
if (this.variant && variantOptions[this.variant].icon) {
|
|
512
|
+
return {
|
|
513
|
+
icon: variantOptions[this.variant].icon,
|
|
514
|
+
position: variantOptions[this.variant].iconPosition || 'prefix',
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
return {
|
|
518
|
+
icon: this.icon,
|
|
519
|
+
position: this.iconPosition,
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
get buttonStatus() {
|
|
523
|
+
return this.variant ? variantOptions[this.variant].status : this.status;
|
|
524
|
+
}
|
|
525
|
+
get buttonStyles() {
|
|
526
|
+
const status = this.buttonStatus === 'default' ? 'primary' : this.buttonStatus;
|
|
527
|
+
const kindStyleMap = {
|
|
528
|
+
primary: {
|
|
529
|
+
'--bcm-button-bg': `var(--bcm-ui-color-background-${status}-default)`,
|
|
530
|
+
'--bcm-button-bg-hover': `var(--bcm-ui-color-background-${status}-hover)`,
|
|
531
|
+
'--bcm-button-bg-active': `var(--bcm-ui-color-background-${status}-active)`,
|
|
532
|
+
'--bcm-button-border': 'transparent',
|
|
533
|
+
'--bcm-button-text': 'var(--bcm-ui-color-text-base)',
|
|
534
|
+
},
|
|
535
|
+
outline: {
|
|
536
|
+
'--bcm-button-bg': 'var(--bcm-ui-color-background-default-default)',
|
|
537
|
+
'--bcm-button-bg-hover': 'var(--bcm-ui-color-background-default-hover)',
|
|
538
|
+
'--bcm-button-bg-active': 'var(--bcm-ui-color-background-default-active)',
|
|
539
|
+
'--bcm-button-border': `var(--bcm-ui-color-border-${this.buttonStatus})`,
|
|
540
|
+
'--bcm-button-text': `var(--bcm-ui-color-text-${this.buttonStatus})`,
|
|
541
|
+
},
|
|
542
|
+
ghost: {
|
|
543
|
+
'--bcm-button-bg': 'transparent',
|
|
544
|
+
'--bcm-button-bg-hover': 'var(--bcm-ui-color-background-default-hover)',
|
|
545
|
+
'--bcm-button-bg-active': 'var(--bcm-ui-color-background-default-active)',
|
|
546
|
+
'--bcm-button-border': 'transparent',
|
|
547
|
+
'--bcm-button-text': `var(--bcm-ui-color-text-${this.buttonStatus})`,
|
|
548
|
+
},
|
|
549
|
+
text: {
|
|
550
|
+
'--bcm-button-bg': 'transparent',
|
|
551
|
+
'--bcm-button-bg-hover': 'var(--bcm-ui-color-background-default-hover)',
|
|
552
|
+
'--bcm-button-bg-active': 'var(--bcm-ui-color-background-default-active)',
|
|
553
|
+
'--bcm-button-border': 'transparent',
|
|
554
|
+
'--bcm-button-text': `var(--bcm-ui-color-text-${status})`,
|
|
555
|
+
},
|
|
556
|
+
};
|
|
557
|
+
return kindStyleMap[this.kind];
|
|
558
|
+
}
|
|
559
|
+
render() {
|
|
560
|
+
const { icon, position } = this.buttonIcon;
|
|
561
|
+
return (index.h(index.Host, { key: 'b1188fbe4439c4878a3306020097d07913b2212d' }, index.h("button", { key: 'eae7a80a19ea54120102d93127f55b039833bc54', type: this.type, disabled: this.disabled || this.loading, "aria-label": this.label, "aria-expanded": this.expanded, "aria-controls": this.controls, "aria-disabled": this.disabled, onClick: this.handleClick, onFocus: this.handleFocus, onBlur: this.handleBlur, style: this.buttonStyles, class: this.buttonClass({
|
|
562
|
+
size: this.size,
|
|
563
|
+
kind: this.kind,
|
|
564
|
+
fullWidth: this.fullWidth,
|
|
565
|
+
disabled: this.disabled,
|
|
566
|
+
loading: this.loading,
|
|
567
|
+
}) }, this.loading && index.h("slot", { key: 'c231e6995ec417011a833b86668be0226855df26', name: "loading" }), index.h("span", { key: '0398204b65ab60a2061b78cedd61c1fc934f9946' }, index.h("slot", { key: '664f13b119445486a1185bb009581cc64d1c0b3e', name: "prefix" }, position === 'prefix' && icon && index.h("i", { key: 'c06367c640065ef5255a89c3d3c9db08a88659d1', class: ' leading-none ' + icon }))), index.h("slot", { key: 'f8fc4f7eaae1ad869af95a6990a53def07678cd7' }, this.buttonText), index.h("span", { key: 'b1b7dc15d8090bb057b6b237d65c17ac328ee380' }, index.h("slot", { key: '43539884f514d7bb365e10e06bf1119b5c60a2b3', name: "suffix" }, position === 'suffix' && icon && index.h("i", { key: 'bf9ad3dc22fc11ca218c28e1a00e9e5a8cef80f2', class: ' leading-none ' + icon }))))));
|
|
568
|
+
}
|
|
569
|
+
};
|
|
570
|
+
BcmButton.style = BcmButtonStyle0;
|
|
571
|
+
|
|
572
|
+
exports.bcm_avatar = BcmAvatar;
|
|
573
|
+
exports.bcm_badge = Badge;
|
|
574
|
+
exports.bcm_basic_badge = BasicBadge;
|
|
575
|
+
exports.bcm_button = BcmButton;
|
|
576
|
+
|
|
577
|
+
//# sourceMappingURL=bcm-avatar_4.cjs.entry.js.map
|