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,129 @@
|
|
|
1
|
+
const byteToHex = [];
|
|
2
|
+
for (let i = 0; i < 256; ++i) {
|
|
3
|
+
byteToHex.push((i + 0x100).toString(16).slice(1));
|
|
4
|
+
}
|
|
5
|
+
function unsafeStringify(arr, offset = 0) {
|
|
6
|
+
return (byteToHex[arr[offset + 0]] +
|
|
7
|
+
byteToHex[arr[offset + 1]] +
|
|
8
|
+
byteToHex[arr[offset + 2]] +
|
|
9
|
+
byteToHex[arr[offset + 3]] +
|
|
10
|
+
'-' +
|
|
11
|
+
byteToHex[arr[offset + 4]] +
|
|
12
|
+
byteToHex[arr[offset + 5]] +
|
|
13
|
+
'-' +
|
|
14
|
+
byteToHex[arr[offset + 6]] +
|
|
15
|
+
byteToHex[arr[offset + 7]] +
|
|
16
|
+
'-' +
|
|
17
|
+
byteToHex[arr[offset + 8]] +
|
|
18
|
+
byteToHex[arr[offset + 9]] +
|
|
19
|
+
'-' +
|
|
20
|
+
byteToHex[arr[offset + 10]] +
|
|
21
|
+
byteToHex[arr[offset + 11]] +
|
|
22
|
+
byteToHex[arr[offset + 12]] +
|
|
23
|
+
byteToHex[arr[offset + 13]] +
|
|
24
|
+
byteToHex[arr[offset + 14]] +
|
|
25
|
+
byteToHex[arr[offset + 15]]).toLowerCase();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
let getRandomValues;
|
|
29
|
+
const rnds8 = new Uint8Array(16);
|
|
30
|
+
function rng() {
|
|
31
|
+
if (!getRandomValues) {
|
|
32
|
+
if (typeof crypto === 'undefined' || !crypto.getRandomValues) {
|
|
33
|
+
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
34
|
+
}
|
|
35
|
+
getRandomValues = crypto.getRandomValues.bind(crypto);
|
|
36
|
+
}
|
|
37
|
+
return getRandomValues(rnds8);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
41
|
+
const native = { randomUUID };
|
|
42
|
+
|
|
43
|
+
function v4(options, buf, offset) {
|
|
44
|
+
if (native.randomUUID && !buf && !options) {
|
|
45
|
+
return native.randomUUID();
|
|
46
|
+
}
|
|
47
|
+
options = options || {};
|
|
48
|
+
const rnds = options.random ?? options.rng?.() ?? rng();
|
|
49
|
+
if (rnds.length < 16) {
|
|
50
|
+
throw new Error('Random bytes length must be >= 16');
|
|
51
|
+
}
|
|
52
|
+
rnds[6] = (rnds[6] & 0x0f) | 0x40;
|
|
53
|
+
rnds[8] = (rnds[8] & 0x3f) | 0x80;
|
|
54
|
+
if (buf) {
|
|
55
|
+
offset = offset || 0;
|
|
56
|
+
if (offset < 0 || offset + 16 > buf.length) {
|
|
57
|
+
throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
|
|
58
|
+
}
|
|
59
|
+
for (let i = 0; i < 16; ++i) {
|
|
60
|
+
buf[offset + i] = rnds[i];
|
|
61
|
+
}
|
|
62
|
+
return buf;
|
|
63
|
+
}
|
|
64
|
+
return unsafeStringify(rnds);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Generates a unique identifier with an optional prefix.
|
|
69
|
+
* @param prefix - Optional prefix for the generated ID (default: 'bcm')
|
|
70
|
+
* @returns A unique string ID in the format "prefix-uuid"
|
|
71
|
+
* @example
|
|
72
|
+
* const id = generateId('button'); // -> "button-123e4567-e89b..."
|
|
73
|
+
* const defaultId = generateId(); // -> "bcm-123e4567-e89b..."
|
|
74
|
+
*/
|
|
75
|
+
const generateId = (prefix = 'bcm') => {
|
|
76
|
+
if (!prefix) {
|
|
77
|
+
throw new Error('Prefix cannot be empty');
|
|
78
|
+
}
|
|
79
|
+
return `${prefix}-${v4()}`;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
class I18n {
|
|
83
|
+
static setMessages(locale, messages) {
|
|
84
|
+
this.messages[locale] = messages;
|
|
85
|
+
this.currentLocale = locale; // Mesajları set ederken locale'i de güncelle
|
|
86
|
+
// console.log(`I18n messages set for locale: ${locale}`, messages);
|
|
87
|
+
}
|
|
88
|
+
static setLocale(locale) {
|
|
89
|
+
if (this.messages[locale]) {
|
|
90
|
+
this.currentLocale = locale;
|
|
91
|
+
// Locale değiştiğinde console'a bilgi ver (development için)
|
|
92
|
+
console.log(`I18n locale changed to: ${locale}`);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
console.warn(`Locale '${locale}' not found in messages`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
static t(key, data) {
|
|
99
|
+
var _a;
|
|
100
|
+
const message = ((_a = this.messages[this.currentLocale]) === null || _a === void 0 ? void 0 : _a[key]) || key;
|
|
101
|
+
if (!data)
|
|
102
|
+
return message;
|
|
103
|
+
return Object.entries(data).reduce((msg, [key, value]) => {
|
|
104
|
+
return msg.replace(new RegExp(`{${key}}`, 'g'), String(value));
|
|
105
|
+
}, message);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
I18n.messages = {};
|
|
109
|
+
I18n.currentLocale = 'en';
|
|
110
|
+
|
|
111
|
+
const defaultValidationMessages = {
|
|
112
|
+
email: 'Please enter a valid email address',
|
|
113
|
+
required: 'This field is required',
|
|
114
|
+
minlength: 'Please enter at least {min} characters',
|
|
115
|
+
maxlength: 'Please enter no more than {max} characters',
|
|
116
|
+
min: 'Value must be at least {min}',
|
|
117
|
+
max: 'Value must be at most {max}',
|
|
118
|
+
pattern: 'Please enter a valid format',
|
|
119
|
+
};
|
|
120
|
+
const setValidationMessages = (locale, messages) => {
|
|
121
|
+
I18n.setMessages(locale, Object.assign(Object.assign({}, defaultValidationMessages), messages));
|
|
122
|
+
};
|
|
123
|
+
const getValidationMessage = (type, data) => {
|
|
124
|
+
return I18n.t(type, data);
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export { getValidationMessage as a, defaultValidationMessages as d, generateId as g, setValidationMessages as s };
|
|
128
|
+
|
|
129
|
+
//# sourceMappingURL=validation-messages-a29d53be.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Ac,EAAE,QAAmD;IACvG,IAAI,CAAC,WAAW,CAAC,MAAM,kCAAO,yBAAyB,GAAK,QAAQ,EAAG,CAAC;AAC1E,EAAE;MAEW,oBAAoB,GAAG,CAAC,IAA4C,EAAE,IAAsC;IACvH,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAC5B;;;;","names":["uuidv4"],"sources":["node_modules/uuid/dist/esm-browser/stringify.js","node_modules/uuid/dist/esm-browser/rng.js","node_modules/uuid/dist/esm-browser/native.js","node_modules/uuid/dist/esm-browser/v4.js","src/utils/id/generate-id.ts","src/utils/i18n.ts","src/utils/validation-messages.ts"],"sourcesContent":["import validate from './validate.js';\nconst byteToHex = [];\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\nexport function unsafeStringify(arr, offset = 0) {\n return (byteToHex[arr[offset + 0]] +\n byteToHex[arr[offset + 1]] +\n byteToHex[arr[offset + 2]] +\n byteToHex[arr[offset + 3]] +\n '-' +\n byteToHex[arr[offset + 4]] +\n byteToHex[arr[offset + 5]] +\n '-' +\n byteToHex[arr[offset + 6]] +\n byteToHex[arr[offset + 7]] +\n '-' +\n byteToHex[arr[offset + 8]] +\n byteToHex[arr[offset + 9]] +\n '-' +\n byteToHex[arr[offset + 10]] +\n byteToHex[arr[offset + 11]] +\n byteToHex[arr[offset + 12]] +\n byteToHex[arr[offset + 13]] +\n byteToHex[arr[offset + 14]] +\n byteToHex[arr[offset + 15]]).toLowerCase();\n}\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset);\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n return uuid;\n}\nexport default stringify;\n","let getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n if (!getRandomValues) {\n if (typeof crypto === 'undefined' || !crypto.getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n getRandomValues = crypto.getRandomValues.bind(crypto);\n }\n return getRandomValues(rnds8);\n}\n","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default { randomUUID };\n","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n options = options || {};\n const rnds = options.random ?? options.rng?.() ?? rng();\n if (rnds.length < 16) {\n throw new Error('Random bytes length must be >= 16');\n }\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n if (buf) {\n offset = offset || 0;\n if (offset < 0 || offset + 16 > buf.length) {\n throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);\n }\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n return buf;\n }\n return unsafeStringify(rnds);\n}\nexport default v4;\n","import { v4 as uuidv4 } from 'uuid';\n\n/**\n * Generates a unique identifier with an optional prefix.\n * @param prefix - Optional prefix for the generated ID (default: 'bcm')\n * @returns A unique string ID in the format \"prefix-uuid\"\n * @example\n * const id = generateId('button'); // -> \"button-123e4567-e89b...\"\n * const defaultId = generateId(); // -> \"bcm-123e4567-e89b...\"\n */\nexport const generateId = (prefix = 'bcm'): string => {\n if (!prefix) {\n throw new Error('Prefix cannot be empty');\n }\n return `${prefix}-${uuidv4()}`;\n};\n","export type MessageTemplateData = Record<string, string | number>;\n\nexport class I18n {\n private static messages: Record<string, Record<string, string>> = {};\n private static currentLocale = 'en';\n\n static setMessages(locale: string, messages: Record<string, string>) {\n this.messages[locale] = messages;\n this.currentLocale = locale; // Mesajları set ederken locale'i de güncelle\n // console.log(`I18n messages set for locale: ${locale}`, messages);\n }\n\n static setLocale(locale: string) {\n if (this.messages[locale]) {\n this.currentLocale = locale;\n // Locale değiştiğinde console'a bilgi ver (development için)\n console.log(`I18n locale changed to: ${locale}`);\n } else {\n console.warn(`Locale '${locale}' not found in messages`);\n }\n }\n\n static t(key: string, data?: MessageTemplateData): string {\n const message = this.messages[this.currentLocale]?.[key] || key;\n if (!data) return message;\n\n return Object.entries(data).reduce((msg, [key, value]) => {\n return msg.replace(new RegExp(`{${key}}`, 'g'), String(value));\n }, message);\n }\n}\n","import { I18n } from './i18n';\n\nexport const defaultValidationMessages = {\n email: 'Please enter a valid email address',\n required: 'This field is required',\n minlength: 'Please enter at least {min} characters',\n maxlength: 'Please enter no more than {max} characters',\n min: 'Value must be at least {min}',\n max: 'Value must be at most {max}',\n pattern: 'Please enter a valid format',\n};\n\nexport const setValidationMessages = (locale: string, messages: Partial<typeof defaultValidationMessages>) => {\n I18n.setMessages(locale, { ...defaultValidationMessages, ...messages });\n};\n\nexport const getValidationMessage = (type: keyof typeof defaultValidationMessages, data?: Record<string, string | number>) => {\n return I18n.t(type, data);\n};\n"],"version":3}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { ComponentInterface } from '../../stencil-public-runtime';
|
|
2
|
+
/**
|
|
3
|
+
* @component BcmBadge
|
|
4
|
+
* @description A versatile badge component that can be positioned around its container.
|
|
5
|
+
* Supports different sizes, variants (dot/text), colors, and positioning options.
|
|
6
|
+
* Can display status indicators with optional blinking animation.
|
|
7
|
+
*
|
|
8
|
+
* @example Basic usage
|
|
9
|
+
* <bcm-badge color="primary" position="top-right">
|
|
10
|
+
* <div>Container Content</div>
|
|
11
|
+
* <span slot="badge">New</span>
|
|
12
|
+
* </bcm-badge>
|
|
13
|
+
*
|
|
14
|
+
* @example Status indicator with blink
|
|
15
|
+
* <bcm-badge variant="dot" color="success" blink={true} status="Online">
|
|
16
|
+
* <div>User Profile</div>
|
|
17
|
+
* </bcm-badge>
|
|
18
|
+
*/
|
|
19
|
+
export declare class Badge implements ComponentInterface {
|
|
20
|
+
/**
|
|
21
|
+
* Determines the size of the badge.
|
|
22
|
+
* @type {'small' | 'medium' | 'large'}
|
|
23
|
+
* @default 'medium'
|
|
24
|
+
*/
|
|
25
|
+
size: 'small' | 'medium' | 'large';
|
|
26
|
+
/**
|
|
27
|
+
* Sets the visual variant of the badge.
|
|
28
|
+
* 'dot': Appears as a small dot indicator
|
|
29
|
+
* 'text': Displays content as text
|
|
30
|
+
* @type {'dot' | 'text'}
|
|
31
|
+
* @default 'text'
|
|
32
|
+
*/
|
|
33
|
+
variant: 'dot' | 'text';
|
|
34
|
+
/**
|
|
35
|
+
* Defines the color of the badge.
|
|
36
|
+
* Uses system color variables (e.g., 'primary', 'success', 'warning', etc.)
|
|
37
|
+
* @type {string}
|
|
38
|
+
* @optional
|
|
39
|
+
*/
|
|
40
|
+
color?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Enables soft color mode for the badge.
|
|
43
|
+
* When true, uses lighter tones and pastel colors.
|
|
44
|
+
* @type {boolean}
|
|
45
|
+
* @default false
|
|
46
|
+
*/
|
|
47
|
+
soft: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Enables blinking animation for the badge.
|
|
50
|
+
* Useful for drawing attention or indicating active status.
|
|
51
|
+
* @type {boolean}
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
54
|
+
blink: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Status message for accessibility purposes.
|
|
57
|
+
* Will be read by screen readers.
|
|
58
|
+
* @type {string}
|
|
59
|
+
* @optional
|
|
60
|
+
*/
|
|
61
|
+
status?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Sets the position of the badge relative to its container.
|
|
64
|
+
* @type {'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'}
|
|
65
|
+
* @default 'top-right'
|
|
66
|
+
*/
|
|
67
|
+
position: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
|
|
68
|
+
/**
|
|
69
|
+
* Fine-tune the badge position with custom offset.
|
|
70
|
+
* Format: "x,y" in pixels (e.g., "10,-5")
|
|
71
|
+
* @type {string}
|
|
72
|
+
* @optional
|
|
73
|
+
*/
|
|
74
|
+
offset: string;
|
|
75
|
+
/**
|
|
76
|
+
* Text to be displayed inside the badge.
|
|
77
|
+
* Used when variant is set to 'text'.
|
|
78
|
+
* Can be overridden using the "badge" slot.
|
|
79
|
+
* @type {string}
|
|
80
|
+
* @optional
|
|
81
|
+
*/
|
|
82
|
+
text?: string;
|
|
83
|
+
private classes;
|
|
84
|
+
private get offsetStyle();
|
|
85
|
+
private get badgeStyle();
|
|
86
|
+
render(): any;
|
|
87
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ComponentInterface } from '../../stencil-public-runtime';
|
|
2
|
+
/**
|
|
3
|
+
* @component BcmBasicBadge
|
|
4
|
+
* @description A basic badge component that can be used as a status indicator or to highlight content.
|
|
5
|
+
* Supports dot and text variants with different sizes and color options.
|
|
6
|
+
*
|
|
7
|
+
* @example Basic usage
|
|
8
|
+
* <bcm-basic-badge size="medium" color="primary">
|
|
9
|
+
* New
|
|
10
|
+
* </bcm-basic-badge>
|
|
11
|
+
*
|
|
12
|
+
* @example Dot variant
|
|
13
|
+
* <bcm-basic-badge variant="dot" color="success" />
|
|
14
|
+
*/
|
|
15
|
+
export declare class BasicBadge implements ComponentInterface {
|
|
16
|
+
/**
|
|
17
|
+
* Determines the size of the badge.
|
|
18
|
+
* @type {'small' | 'medium' | 'large'}
|
|
19
|
+
* @default 'medium'
|
|
20
|
+
*/
|
|
21
|
+
size: 'small' | 'medium' | 'large';
|
|
22
|
+
/**
|
|
23
|
+
* Sets the visual variant of the badge.
|
|
24
|
+
* 'dot': Appears as a small dot indicator
|
|
25
|
+
* 'text': Displays content as text
|
|
26
|
+
* @type {'dot' | 'text'}
|
|
27
|
+
* @default 'text'
|
|
28
|
+
*/
|
|
29
|
+
variant: 'dot' | 'text';
|
|
30
|
+
/**
|
|
31
|
+
* Defines the color of the badge.
|
|
32
|
+
* Uses system color variables (e.g., 'primary', 'success', 'warning', etc.)
|
|
33
|
+
* @type {string}
|
|
34
|
+
* @optional
|
|
35
|
+
*/
|
|
36
|
+
color?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Enables soft color mode for the badge.
|
|
39
|
+
* When true, uses lighter tones and pastel colors.
|
|
40
|
+
* @type {boolean}
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
soft: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Text to be displayed inside the badge.
|
|
46
|
+
* Used when variant is set to 'text'.
|
|
47
|
+
* @type {string}
|
|
48
|
+
* @optional
|
|
49
|
+
*/
|
|
50
|
+
text?: string;
|
|
51
|
+
private classes;
|
|
52
|
+
private get badgeStyle();
|
|
53
|
+
render(): any;
|
|
54
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ComponentInterface } from '../../stencil-public-runtime';
|
|
2
|
+
/**
|
|
3
|
+
* @component BCM Divider
|
|
4
|
+
* @description
|
|
5
|
+
* A versatile divider component that creates a visual separation between content.
|
|
6
|
+
* It supports horizontal or vertical orientation with customizable styles and sizes.
|
|
7
|
+
* The component uses CSS variables for theming and Tailwind for styling.
|
|
8
|
+
*/
|
|
9
|
+
export declare class Divider implements ComponentInterface {
|
|
10
|
+
/**
|
|
11
|
+
* @prop {('horizontal'|'vertical')} direction
|
|
12
|
+
* @description Determines the orientation of the divider
|
|
13
|
+
* @default 'horizontal'
|
|
14
|
+
* @example
|
|
15
|
+
* <bcm-divider direction="vertical" />
|
|
16
|
+
*/
|
|
17
|
+
direction: 'horizontal' | 'vertical';
|
|
18
|
+
/**
|
|
19
|
+
* @prop {('solid'|'dashed'|'dotted')} variant
|
|
20
|
+
* @description Sets the border style of the divider
|
|
21
|
+
* @default 'solid'
|
|
22
|
+
* @example
|
|
23
|
+
* <bcm-divider variant="dashed" />
|
|
24
|
+
*/
|
|
25
|
+
variant: 'solid' | 'dashed' | 'dotted';
|
|
26
|
+
/**
|
|
27
|
+
* @prop {('small'|'medium'|'large')} size
|
|
28
|
+
* @description Controls the thickness of the divider
|
|
29
|
+
* @default 'medium'
|
|
30
|
+
* @values
|
|
31
|
+
* - small: 1px border
|
|
32
|
+
* - medium: 2px border
|
|
33
|
+
* - large: 4px border
|
|
34
|
+
* @example
|
|
35
|
+
* <bcm-divider size="large" />
|
|
36
|
+
*/
|
|
37
|
+
size: 'small' | 'medium' | 'large';
|
|
38
|
+
private dividerClass;
|
|
39
|
+
render(): any;
|
|
40
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
import { InputSize, InputStatus, InputType } from './types';
|
|
3
|
+
export declare class BcmInput {
|
|
4
|
+
el: HTMLElement;
|
|
5
|
+
private inputRef;
|
|
6
|
+
isFocused: boolean;
|
|
7
|
+
validationMessage: string;
|
|
8
|
+
isValid: boolean;
|
|
9
|
+
internalStatus: InputStatus;
|
|
10
|
+
internalErrorMessage: string;
|
|
11
|
+
/** Input value */
|
|
12
|
+
value: string;
|
|
13
|
+
/** Input placeholder text */
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
/** Input name */
|
|
16
|
+
name?: string;
|
|
17
|
+
/** Input id */
|
|
18
|
+
_id?: string;
|
|
19
|
+
/** Controls the input size */
|
|
20
|
+
size: InputSize;
|
|
21
|
+
/** Defines the input's status/state */
|
|
22
|
+
status: InputStatus;
|
|
23
|
+
/** Full width input */
|
|
24
|
+
fullWidth: boolean;
|
|
25
|
+
/** HTML input type */
|
|
26
|
+
type: InputType;
|
|
27
|
+
/** Whether the input is disabled */
|
|
28
|
+
disabled: boolean;
|
|
29
|
+
/** Whether the input is readonly */
|
|
30
|
+
readonly: boolean;
|
|
31
|
+
/** Whether the input is required */
|
|
32
|
+
required: boolean;
|
|
33
|
+
/** Input autocomplete attribute */
|
|
34
|
+
autocomplete?: string;
|
|
35
|
+
/** Min length for text input */
|
|
36
|
+
minLength?: number;
|
|
37
|
+
/** Max length for text input */
|
|
38
|
+
maxLength?: number;
|
|
39
|
+
/** Min value for number input */
|
|
40
|
+
min?: number;
|
|
41
|
+
/** Max value for number input */
|
|
42
|
+
max?: number;
|
|
43
|
+
/** Step value for number input */
|
|
44
|
+
step?: number;
|
|
45
|
+
/** Pattern for validation */
|
|
46
|
+
pattern?: string;
|
|
47
|
+
/** Input label for accessibility */
|
|
48
|
+
label?: string;
|
|
49
|
+
/** Error message to display */
|
|
50
|
+
errorMessage?: string;
|
|
51
|
+
/** Caption text to display below input */
|
|
52
|
+
captionText?: string;
|
|
53
|
+
/** ID of associated label element */
|
|
54
|
+
labelledby?: string;
|
|
55
|
+
/** ID of associated caption/error text element */
|
|
56
|
+
describedby?: string;
|
|
57
|
+
/** Prefix icon class name */
|
|
58
|
+
prefixIcon?: string;
|
|
59
|
+
/** Suffix icon class name */
|
|
60
|
+
suffixIcon?: string;
|
|
61
|
+
/** Whether to use native form validation
|
|
62
|
+
* If false, component will handle validation internally
|
|
63
|
+
*/
|
|
64
|
+
useNativeValidation: boolean;
|
|
65
|
+
/** Custom validation function */
|
|
66
|
+
validator?: (value: string) => string | undefined;
|
|
67
|
+
bcmInput: EventEmitter<InputEvent>;
|
|
68
|
+
bcmChange: EventEmitter<Event>;
|
|
69
|
+
bcmFocus: EventEmitter<FocusEvent>;
|
|
70
|
+
bcmBlur: EventEmitter<FocusEvent>;
|
|
71
|
+
bcmKeyDown: EventEmitter<KeyboardEvent>;
|
|
72
|
+
bcmKeyUp: EventEmitter<KeyboardEvent>;
|
|
73
|
+
handleValueChange(newValue: string): void;
|
|
74
|
+
watchStatus(newValue: InputStatus): void;
|
|
75
|
+
watchErrorMessage(newValue: string): void;
|
|
76
|
+
setFocus(): Promise<void>;
|
|
77
|
+
setBlur(): Promise<void>;
|
|
78
|
+
select(): Promise<void>;
|
|
79
|
+
/** Sets locale and messages for all inputs */
|
|
80
|
+
setLocale(locale: string, messages: Record<string, string>): Promise<void>;
|
|
81
|
+
componentWillLoad(): void;
|
|
82
|
+
private validateInput;
|
|
83
|
+
private onInput;
|
|
84
|
+
private onChange;
|
|
85
|
+
private onFocus;
|
|
86
|
+
private onBlur;
|
|
87
|
+
private onKeyDown;
|
|
88
|
+
private onKeyUp;
|
|
89
|
+
private hasSlotContent;
|
|
90
|
+
private styleClass;
|
|
91
|
+
private getDefaultIconForType;
|
|
92
|
+
render(): any;
|
|
93
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type InputSize = 'small' | 'medium' | 'large';
|
|
2
|
+
export type InputStatus = 'default' | 'error' | 'success' | 'warning' | 'info';
|
|
3
|
+
export type InputType = 'text' | 'password' | 'email' | 'number' | 'tel' | 'url' | 'search' | 'date' | 'time' | 'datetime-local';
|
|
4
|
+
export declare const defaultIcons: {
|
|
5
|
+
readonly search: "fa-regular fa-magnifying-glass";
|
|
6
|
+
readonly email: "fa-regular fa-envelope";
|
|
7
|
+
readonly tel: "fa-regular fa-phone";
|
|
8
|
+
readonly url: "fa-regular fa-link";
|
|
9
|
+
readonly date: "fa-regular fa-calendar";
|
|
10
|
+
readonly time: "fa-regular fa-clock";
|
|
11
|
+
readonly 'datetime-local': "fa-regular fa-calendar-clock";
|
|
12
|
+
readonly password: "fa-regular fa-lock";
|
|
13
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
import { InputSize, InputStatus, TextareaResize } from './types';
|
|
3
|
+
export declare class BcmTextarea {
|
|
4
|
+
el: HTMLElement;
|
|
5
|
+
private textareaRef;
|
|
6
|
+
isFocused: boolean;
|
|
7
|
+
validationMessage: string;
|
|
8
|
+
isValid: boolean;
|
|
9
|
+
internalStatus: InputStatus;
|
|
10
|
+
internalErrorMessage: string;
|
|
11
|
+
/** Textarea value */
|
|
12
|
+
value: string;
|
|
13
|
+
/** Textarea rows */
|
|
14
|
+
rows?: number;
|
|
15
|
+
/** Textarea cols */
|
|
16
|
+
cols?: number;
|
|
17
|
+
/** Minimum height in rows */
|
|
18
|
+
minRows?: number;
|
|
19
|
+
/** Maximum height in rows */
|
|
20
|
+
maxRows?: number;
|
|
21
|
+
/** Resize behavior */
|
|
22
|
+
resize: TextareaResize;
|
|
23
|
+
/** Auto grow height based on content */
|
|
24
|
+
autoGrow: boolean;
|
|
25
|
+
/** Input placeholder text */
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
/** Input name */
|
|
28
|
+
name?: string;
|
|
29
|
+
/** Input id */
|
|
30
|
+
_id?: string;
|
|
31
|
+
/** Controls the textarea size */
|
|
32
|
+
size: InputSize;
|
|
33
|
+
/** Defines the textarea's status/state */
|
|
34
|
+
status: InputStatus;
|
|
35
|
+
/** Full width textarea */
|
|
36
|
+
fullWidth: boolean;
|
|
37
|
+
/** Whether the textarea is disabled */
|
|
38
|
+
disabled: boolean;
|
|
39
|
+
/** Whether the textarea is readonly */
|
|
40
|
+
readonly: boolean;
|
|
41
|
+
/** Whether the textarea is required */
|
|
42
|
+
required: boolean;
|
|
43
|
+
/** Min length for text input */
|
|
44
|
+
minLength?: number;
|
|
45
|
+
/** Max length for text input */
|
|
46
|
+
maxLength?: number;
|
|
47
|
+
/** Show character counter */
|
|
48
|
+
showCounter: boolean;
|
|
49
|
+
/** Textarea label for accessibility */
|
|
50
|
+
label?: string;
|
|
51
|
+
/** Error message to display */
|
|
52
|
+
errorMessage?: string;
|
|
53
|
+
/** Caption text to display below textarea */
|
|
54
|
+
captionText?: string;
|
|
55
|
+
/** ID of associated label element */
|
|
56
|
+
labelledby?: string;
|
|
57
|
+
/** ID of associated caption/error text element */
|
|
58
|
+
describedby?: string;
|
|
59
|
+
/** Custom validation function */
|
|
60
|
+
validator?: (value: string) => string | undefined;
|
|
61
|
+
bcmInput: EventEmitter<InputEvent>;
|
|
62
|
+
bcmChange: EventEmitter<Event>;
|
|
63
|
+
bcmFocus: EventEmitter<FocusEvent>;
|
|
64
|
+
bcmBlur: EventEmitter<FocusEvent>;
|
|
65
|
+
bcmKeyDown: EventEmitter<KeyboardEvent>;
|
|
66
|
+
bcmKeyUp: EventEmitter<KeyboardEvent>;
|
|
67
|
+
handleValueChange(newValue: string): void;
|
|
68
|
+
watchStatus(newValue: InputStatus): void;
|
|
69
|
+
watchErrorMessage(newValue: string): void;
|
|
70
|
+
componentWillLoad(): void;
|
|
71
|
+
componentDidLoad(): void;
|
|
72
|
+
disconnectedCallback(): void;
|
|
73
|
+
setFocus(): Promise<void>;
|
|
74
|
+
setBlur(): Promise<void>;
|
|
75
|
+
select(): Promise<void>;
|
|
76
|
+
private adjustHeight;
|
|
77
|
+
private validateInput;
|
|
78
|
+
private onChange;
|
|
79
|
+
private onFocus;
|
|
80
|
+
private onBlur;
|
|
81
|
+
private onKeyDown;
|
|
82
|
+
private onKeyUp;
|
|
83
|
+
private styleClass;
|
|
84
|
+
render(): any;
|
|
85
|
+
}
|