@usecapsule/core-components 3.4.1 → 3.5.1-dev.1
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/css/capsule-core.css +1 -1
- package/dist/capsule/capsule.esm.js +1 -1
- package/dist/capsule/capsule.esm.js.map +1 -1
- package/dist/capsule/index.esm.js +1 -1
- package/dist/capsule/index.esm.js.map +1 -1
- package/dist/capsule/p-286db996.js +2 -0
- package/dist/capsule/p-286db996.js.map +1 -0
- package/dist/capsule/{p-f0cd0482.entry.js → p-41bc3c58.entry.js} +2 -2
- package/dist/capsule/p-4da7328c.entry.js +20 -0
- package/dist/capsule/p-4da7328c.entry.js.map +1 -0
- package/dist/capsule/p-52bb30d8.entry.js +2 -0
- package/dist/capsule/p-52bb30d8.entry.js.map +1 -0
- package/dist/capsule/{p-5965b15e.entry.js → p-5cd62456.entry.js} +2 -2
- package/dist/capsule/{p-b96e357a.entry.js → p-7dff759e.entry.js} +2 -2
- package/dist/capsule/p-7dff759e.entry.js.map +1 -0
- package/dist/capsule/p-ab7b3141.entry.js +2 -0
- package/dist/capsule/{p-1bd11889.entry.js → p-c9e61114.entry.js} +2 -2
- package/dist/capsule/{p-9e64a60e.entry.js → p-d4bdb369.entry.js} +2 -2
- package/dist/capsule/{p-d165df27.entry.js → p-de2a16e4.entry.js} +2 -2
- package/dist/cjs/capsule.cjs.js +1 -1
- package/dist/cjs/cpsl-alert_34.cjs.entry.js +553 -54
- package/dist/cjs/cpsl-alert_34.cjs.entry.js.map +1 -1
- package/dist/cjs/cpsl-col.cjs.entry.js +1 -1
- package/dist/cjs/cpsl-grid.cjs.entry.js +2 -2
- package/dist/cjs/cpsl-hero.cjs.entry.js +8 -4
- package/dist/cjs/cpsl-hero.cjs.entry.js.map +1 -1
- package/dist/cjs/cpsl-identicon.cjs.entry.js +76 -30
- package/dist/cjs/cpsl-identicon.cjs.entry.js.map +1 -1
- package/dist/cjs/cpsl-info-box.cjs.entry.js +1 -1
- package/dist/cjs/cpsl-modal-v2.cjs.entry.js +1 -1
- package/dist/cjs/cpsl-nav-button.cjs.entry.js +1 -1
- package/dist/cjs/cpsl-row.cjs.entry.js +1 -1
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/prand-a35ea6b2.js +209 -0
- package/dist/cjs/prand-a35ea6b2.js.map +1 -0
- package/dist/collection/assets/icons/alert-triangle.svg +5 -0
- package/dist/collection/assets/icons/arrow-circle-down-filled.svg +5 -0
- package/dist/collection/assets/icons/check-circle-filled.svg +5 -0
- package/dist/collection/assets/icons/chevron-down.svg +5 -0
- package/dist/collection/assets/icons/chevron-selector-vertical.svg +5 -0
- package/dist/collection/assets/icons/cosmos.svg +12 -0
- package/dist/collection/assets/icons/credit-card-02.svg +5 -0
- package/dist/collection/assets/icons/edit-02.svg +5 -0
- package/dist/collection/assets/icons/ethereum.svg +4 -0
- package/dist/collection/assets/icons/index.js +375 -1
- package/dist/collection/assets/icons/index.js.map +1 -1
- package/dist/collection/assets/icons/plus.svg +5 -0
- package/dist/collection/assets/icons/polygon.svg +5 -0
- package/dist/collection/assets/icons/solana.svg +19 -0
- package/dist/collection/assets/icons/star-04-filled.svg +3 -0
- package/dist/collection/assets/icons/user.svg +5 -0
- package/dist/collection/assets/images/index.js +5 -1
- package/dist/collection/assets/images/index.js.map +1 -1
- package/dist/collection/components/cpsl-alert/cpsl-alert.css +23 -2
- package/dist/collection/components/cpsl-alert/cpsl-alert.js +21 -3
- package/dist/collection/components/cpsl-alert/cpsl-alert.js.map +1 -1
- package/dist/collection/components/cpsl-app-bar/cpsl-app-bar.js +3 -3
- package/dist/collection/components/cpsl-auth-modal/cpsl-auth-modal.css +6 -1
- package/dist/collection/components/cpsl-avatar/cpsl-avatar.js +1 -1
- package/dist/collection/components/cpsl-button/cpsl-button.css +1 -1
- package/dist/collection/components/cpsl-button/cpsl-button.js +2 -2
- package/dist/collection/components/cpsl-button-group/cpsl-button-group.js +1 -1
- package/dist/collection/components/cpsl-card/cpsl-card.js +1 -1
- package/dist/collection/components/cpsl-checkbox/cpsl-checkbox.js +1 -1
- package/dist/collection/components/cpsl-code-input/cpsl-code-input.js +2 -2
- package/dist/collection/components/cpsl-col/cpsl-col.js +1 -1
- package/dist/collection/components/cpsl-divider/cpsl-divider.js +1 -1
- package/dist/collection/components/cpsl-drawer/cpsl-drawer.js +2 -2
- package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js +1 -1
- package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js +20 -1
- package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js.map +1 -1
- package/dist/collection/components/cpsl-grid/cpsl-grid.js +2 -2
- package/dist/collection/components/cpsl-hero/cpsl-hero.css +4 -4
- package/dist/collection/components/cpsl-hero/cpsl-hero.js +2 -2
- package/dist/collection/components/cpsl-hero/cpsl-hero.js.map +1 -1
- package/dist/collection/components/cpsl-icon/cpsl-icon.js +2 -2
- package/dist/collection/components/cpsl-icon-group/cpsl-icon-group.js +1 -1
- package/dist/collection/components/cpsl-identicon/cpsl-identicon.css +17 -10
- package/dist/collection/components/cpsl-identicon/cpsl-identicon.js +101 -36
- package/dist/collection/components/cpsl-identicon/cpsl-identicon.js.map +1 -1
- package/dist/collection/components/cpsl-identicon/cpsl-identicon.stories.js +1 -1
- package/dist/collection/components/cpsl-identicon/cpsl-identicon.stories.js.map +1 -1
- package/dist/collection/components/cpsl-info-box/cpsl-info-box.js +1 -1
- package/dist/collection/components/cpsl-input/cpsl-input.js +22 -2
- package/dist/collection/components/cpsl-input/cpsl-input.js.map +1 -1
- package/dist/collection/components/cpsl-modal-v2/cpsl-modal-v2.js +1 -1
- package/dist/collection/components/cpsl-nav-button/cpsl-nav-button.js +1 -1
- package/dist/collection/components/cpsl-nav-button-group/cpsl-nav-button-group.js +1 -1
- package/dist/collection/components/cpsl-overlay/cpsl-overlay.js +1 -1
- package/dist/collection/components/cpsl-pagination/cpsl-pagination.js +1 -1
- package/dist/collection/components/cpsl-pill/cpsl-pill.js +1 -1
- package/dist/collection/components/cpsl-popover/cpsl-popover.js +6 -3
- package/dist/collection/components/cpsl-popover/cpsl-popover.js.map +1 -1
- package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js +1 -1
- package/dist/collection/components/cpsl-radio/cpsl-radio.js +1 -1
- package/dist/collection/components/cpsl-row/cpsl-row.js +1 -1
- package/dist/collection/components/cpsl-select/cpsl-select.css +1 -0
- package/dist/collection/components/cpsl-select/cpsl-select.js +45 -2
- package/dist/collection/components/cpsl-select/cpsl-select.js.map +1 -1
- package/dist/collection/components/cpsl-select-item/cpsl-select-item.js +1 -1
- package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js +3 -3
- package/dist/collection/components/cpsl-spinner/cpsl-spinner.js +2 -2
- package/dist/collection/components/cpsl-switch/cpsl-switch.js +1 -1
- package/dist/collection/components/cpsl-tab/cpsl-tab.css +4 -4
- package/dist/collection/components/cpsl-tab/cpsl-tab.js +32 -1
- package/dist/collection/components/cpsl-tab/cpsl-tab.js.map +1 -1
- package/dist/collection/components/cpsl-tab/tab-interface.js.map +1 -1
- package/dist/collection/components/cpsl-table/cpsl-table.js +1 -1
- package/dist/collection/components/cpsl-tabs/cpsl-tabs.js +16 -1
- package/dist/collection/components/cpsl-tabs/cpsl-tabs.js.map +1 -1
- package/dist/collection/components/cpsl-text/cpsl-text.js +9 -8
- package/dist/collection/components/cpsl-text/cpsl-text.js.map +1 -1
- package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.js +2 -2
- package/dist/collection/index.js +1 -0
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/lib/prando.js +187 -0
- package/dist/collection/lib/prando.js.map +1 -0
- package/dist/collection/utils/prand.js +16 -0
- package/dist/collection/utils/prand.js.map +1 -0
- package/dist/esm/capsule.js +1 -1
- package/dist/esm/cpsl-alert_34.entry.js +553 -54
- package/dist/esm/cpsl-alert_34.entry.js.map +1 -1
- package/dist/esm/cpsl-col.entry.js +1 -1
- package/dist/esm/cpsl-grid.entry.js +2 -2
- package/dist/esm/cpsl-hero.entry.js +8 -4
- package/dist/esm/cpsl-hero.entry.js.map +1 -1
- package/dist/esm/cpsl-identicon.entry.js +76 -30
- package/dist/esm/cpsl-identicon.entry.js.map +1 -1
- package/dist/esm/cpsl-info-box.entry.js +1 -1
- package/dist/esm/cpsl-modal-v2.entry.js +1 -1
- package/dist/esm/cpsl-nav-button.entry.js +1 -1
- package/dist/esm/cpsl-row.entry.js +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/prand-c8323494.js +205 -0
- package/dist/esm/prand-c8323494.js.map +1 -0
- package/dist/scripts/buildAssets.js +9 -9
- package/dist/scripts/buildAssets.js.map +1 -1
- package/dist/types/assets/icons/index.d.ts +14 -0
- package/dist/types/components/cpsl-alert/cpsl-alert.d.ts +4 -0
- package/dist/types/components/cpsl-file-upload/cpsl-file-upload.d.ts +5 -0
- package/dist/types/components/cpsl-identicon/cpsl-identicon.d.ts +5 -4
- package/dist/types/components/cpsl-input/cpsl-input.d.ts +4 -0
- package/dist/types/components/cpsl-select/cpsl-select.d.ts +10 -0
- package/dist/types/components/cpsl-tab/cpsl-tab.d.ts +7 -1
- package/dist/types/components/cpsl-tab/tab-interface.d.ts +3 -0
- package/dist/types/components/cpsl-tabs/cpsl-tabs.d.ts +2 -0
- package/dist/types/components.d.ts +51 -8
- package/dist/types/index.d.ts +1 -0
- package/dist/types/lib/prando.d.ts +92 -0
- package/dist/types/utils/prand.d.ts +3 -0
- package/package.json +4 -5
- package/dist/capsule/p-5d62e610.entry.js +0 -2
- package/dist/capsule/p-5d62e610.entry.js.map +0 -1
- package/dist/capsule/p-afbb1e6f.entry.js +0 -20
- package/dist/capsule/p-afbb1e6f.entry.js.map +0 -1
- package/dist/capsule/p-b96e357a.entry.js.map +0 -1
- package/dist/capsule/p-cfc382c0.entry.js +0 -2
- /package/dist/capsule/{p-f0cd0482.entry.js.map → p-41bc3c58.entry.js.map} +0 -0
- /package/dist/capsule/{p-5965b15e.entry.js.map → p-5cd62456.entry.js.map} +0 -0
- /package/dist/capsule/{p-cfc382c0.entry.js.map → p-ab7b3141.entry.js.map} +0 -0
- /package/dist/capsule/{p-1bd11889.entry.js.map → p-c9e61114.entry.js.map} +0 -0
- /package/dist/capsule/{p-9e64a60e.entry.js.map → p-d4bdb369.entry.js.map} +0 -0
- /package/dist/capsule/{p-d165df27.entry.js.map → p-de2a16e4.entry.js.map} +0 -0
- /package/dist/types/Users/{norwood/capsule-repos → taylorbosch/Documents/GitHub/Capsule}/web-sdk/packages/core-components/.stencil/scripts/buildAssets.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildAssets.js","sourceRoot":"","sources":["../../scripts/buildAssets.ts"],"names":[],"mappings":";;;;;;;;;AAAA,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACzB,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC;AAE1C,SAAS,WAAW,CAAC,IAAI;IACvB,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAC7C,CAAC;AAED,SAAS,YAAY,CAAC,IAAI;IACxB,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;AACnD,CAAC;AAED,SAAS,aAAa,CAAC,IAAI;IACzB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;AAC7C,CAAC;
|
|
1
|
+
{"version":3,"file":"buildAssets.js","sourceRoot":"","sources":["../../scripts/buildAssets.ts"],"names":[],"mappings":";;;;;;;;;AAAA,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACzB,MAAM,UAAU,GAAG,OAAO,CAAC,I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C,CAAC;QAErG,MAAM,aAAa,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC1C,MAAM,GAAG,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;QAC7B,MAAM,aAAa,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;QAEvC,MAAM,iBAAiB,GAAG,WAAW,CAAC,aAAa,CAAC,CAAC;QAErD,MAAM,OAAO,GAAG,cAAc,GAAG,WAAW,OAAO,EAAE,CAAC;QAEtD,SAAS,IAAI,KAAK,iBAAiB,WAAW,OAAO,MAAM,CAAC;IAC9D,CAAC;IAED,EAAE,CAAC,SAAS,CAAC,8BAA8B,EAAE,GAAG,SAAS,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE;QAC7E,IAAI,GAAG,EAAE,CAAC;YACR,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,IAAI,GAAG,GAAG,EAAE;IAChB,gBAAgB,EAAE,CAAC;IACnB,WAAW,EAAE,CAAC;AAChB,CAAC,CAAC;AACF,IAAI,EAAE,CAAC","sourcesContent":["const fs = require('fs');\nconst fsPromises = require('fs').promises;\n\nfunction toCamelCase(text) {\n return text.replace(/-\\w/g, clearAndUpper);\n}\n\nfunction toPascalCase(text) {\n return text.replace(/(^\\w|-\\w)/g, clearAndUpper);\n}\n\nfunction clearAndUpper(text) {\n return text.replace(/-/, '').toUpperCase();\n}\n\nconst buildIconLibrary = () => {\n let files: string[] = fs.readdirSync('./src/assets/icons');\n let flagFiles = fs.readdirSync('./src/assets/icons/flags');\n\n let importString = '';\n let objString = `export const Icons = {`;\n\n for (const fileName of files) {\n if (!fileName.includes('.svg')) {\n continue;\n }\n\n const fileNameNoExt = fileName.split('.')[0];\n\n const camelCaseFileName = toCamelCase(fileNameNoExt);\n const pascalCaseFileName = toPascalCase(fileNameNoExt);\n\n importString += `import ${pascalCaseFileName} from './${fileName}';\\n`;\n objString += `\\n ${camelCaseFileName}: ${pascalCaseFileName},`;\n }\n\n for (const fileName of flagFiles) {\n if (!fileName.includes('.svg')) {\n continue;\n }\n\n const fileNameNoExt = fileName.split('.')[0];\n\n const camelCaseFileName = toCamelCase(fileNameNoExt);\n const pascalCaseFileName = toPascalCase(fileNameNoExt);\n\n importString += `import ${pascalCaseFileName} from './flags/${fileName}';\\n`;\n objString += `\\n ${camelCaseFileName}: ${pascalCaseFileName},`;\n }\n\n const codeStr = `${importString}\\n${objString}\\n};\\n`;\n fs.writeFile('./src/assets/icons/index.ts', codeStr, 'utf8', err => {\n if (err) {\n console.error(err);\n }\n });\n};\n\nconst buildImages = async () => {\n const files: string[] = fs.readdirSync('./src/assets/images');\n\n let objString = 'export const Images = {\\n';\n\n for (let i = 0; i < files.length; i++) {\n const fileName = files[i];\n\n if (!fileName.includes('png') && !fileName.includes('jpg') && !fileName.includes('jpeg')) {\n continue;\n }\n\n const content = await fsPromises.readFile(`./src/assets/images/${fileName}`, { encoding: 'base64' });\n\n const fileNameSplit = fileName.split('.');\n const ext = fileNameSplit[1];\n const fileNameNoExt = fileNameSplit[0];\n\n const camelCaseFileName = toCamelCase(fileNameNoExt);\n\n const dataUrl = `data:image/${ext};base64,${content}`;\n\n objString += ` ${camelCaseFileName}:\\n '${dataUrl}',\\n`;\n }\n\n fs.writeFile('./src/assets/images/index.ts', `${objString}};\\n`, 'utf8', err => {\n if (err) {\n console.error(err);\n }\n });\n};\n\nconst main = () => {\n buildIconLibrary();\n buildImages();\n};\nmain();\n"]}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export declare const Icons: {
|
|
2
2
|
alertCircle: string;
|
|
3
|
+
alertTriangle: string;
|
|
3
4
|
angelListBrand: string;
|
|
4
5
|
angelList: string;
|
|
5
6
|
appleBrand: string;
|
|
6
7
|
apple: string;
|
|
7
8
|
arrowCircleBrokenDownLeft: string;
|
|
9
|
+
arrowCircleDownFilled: string;
|
|
8
10
|
arrowNarrow: string;
|
|
9
11
|
arrow: string;
|
|
10
12
|
backupKit: string;
|
|
@@ -14,14 +16,19 @@ export declare const Icons: {
|
|
|
14
16
|
capsuleRingsDark: string;
|
|
15
17
|
capsuleRings: string;
|
|
16
18
|
capsule: string;
|
|
19
|
+
checkCircleFilled: string;
|
|
17
20
|
checkCircle: string;
|
|
18
21
|
check: string;
|
|
22
|
+
chevronDown: string;
|
|
23
|
+
chevronSelectorVertical: string;
|
|
19
24
|
chevronUp: string;
|
|
20
25
|
clock: string;
|
|
21
26
|
close: string;
|
|
22
27
|
clubhouseBrand: string;
|
|
23
28
|
clubhouse: string;
|
|
24
29
|
copy: string;
|
|
30
|
+
cosmos: string;
|
|
31
|
+
creditCard02: string;
|
|
25
32
|
creditCard: string;
|
|
26
33
|
cube: string;
|
|
27
34
|
decentBrand: string;
|
|
@@ -34,6 +41,8 @@ export declare const Icons: {
|
|
|
34
41
|
dribbbleBrand: string;
|
|
35
42
|
dribbble: string;
|
|
36
43
|
earth: string;
|
|
44
|
+
edit02: string;
|
|
45
|
+
ethereum: string;
|
|
37
46
|
eyeOff: string;
|
|
38
47
|
eye: string;
|
|
39
48
|
facebookBrand: string;
|
|
@@ -81,6 +90,8 @@ export declare const Icons: {
|
|
|
81
90
|
pintrestBrand: string;
|
|
82
91
|
pintrest: string;
|
|
83
92
|
plusCircle: string;
|
|
93
|
+
plus: string;
|
|
94
|
+
polygon: string;
|
|
84
95
|
puzzlePiece: string;
|
|
85
96
|
qrCode02: string;
|
|
86
97
|
qrCode: string;
|
|
@@ -97,6 +108,8 @@ export declare const Icons: {
|
|
|
97
108
|
signal: string;
|
|
98
109
|
snapchatBrand: string;
|
|
99
110
|
snapchat: string;
|
|
111
|
+
solana: string;
|
|
112
|
+
star04Filled: string;
|
|
100
113
|
stars: string;
|
|
101
114
|
stripeBrand: string;
|
|
102
115
|
telegramBrand: string;
|
|
@@ -107,6 +120,7 @@ export declare const Icons: {
|
|
|
107
120
|
tumblr: string;
|
|
108
121
|
twitterBrand: string;
|
|
109
122
|
twitter: string;
|
|
123
|
+
user: string;
|
|
110
124
|
wallet: string;
|
|
111
125
|
x: string;
|
|
112
126
|
youtubeBrand: string;
|
|
@@ -10,6 +10,10 @@ export declare class CpslAlert {
|
|
|
10
10
|
* Default is: `"error"`.
|
|
11
11
|
*/
|
|
12
12
|
variant?: 'error' | 'warning' | 'success' | 'custom';
|
|
13
|
+
/**
|
|
14
|
+
* Whether to show the alert with a filled background based on the variant
|
|
15
|
+
*/
|
|
16
|
+
filled?: boolean;
|
|
13
17
|
private get iconType();
|
|
14
18
|
render(): any;
|
|
15
19
|
}
|
|
@@ -7,6 +7,11 @@ export declare class CpslFileUpload {
|
|
|
7
7
|
dragError?: boolean;
|
|
8
8
|
isUploading?: boolean;
|
|
9
9
|
uploadError?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* If the input is disabled.
|
|
12
|
+
* Default is: false.
|
|
13
|
+
*/
|
|
14
|
+
disabled?: boolean;
|
|
10
15
|
/**
|
|
11
16
|
* Error text to show below the input. If this is provided the input will enter an error state.
|
|
12
17
|
*/
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export declare class CpslIdenticon {
|
|
2
|
-
hash
|
|
2
|
+
hash?: string | undefined;
|
|
3
3
|
/**
|
|
4
|
-
* The
|
|
5
|
-
* Default is:
|
|
4
|
+
* The CSS width and height of the identicon.
|
|
5
|
+
* Default is: 40px.
|
|
6
6
|
*/
|
|
7
|
-
size:
|
|
7
|
+
size: string;
|
|
8
|
+
variant: 'default' | 'avatar';
|
|
8
9
|
render(): any;
|
|
9
10
|
}
|
|
@@ -36,6 +36,10 @@ export declare class CpslInput {
|
|
|
36
36
|
* This may not be sufficient for the element to be focused on page load.
|
|
37
37
|
*/
|
|
38
38
|
autofocus: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* If `true`, the input's entire contents will be selected on focus.
|
|
41
|
+
*/
|
|
42
|
+
autoselect: boolean;
|
|
39
43
|
/**
|
|
40
44
|
* If `true`, the user cannot interact with the input.
|
|
41
45
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
import { IconType } from '../../interface';
|
|
2
3
|
export declare class CpslSelect {
|
|
3
4
|
el: HTMLCpslSelectElement;
|
|
4
5
|
private popoverEl;
|
|
@@ -40,10 +41,19 @@ export declare class CpslSelect {
|
|
|
40
41
|
* ID of the element, must be unique for the popover trigger.
|
|
41
42
|
*/
|
|
42
43
|
id: string;
|
|
44
|
+
/**
|
|
45
|
+
* The name of the icon to use for the end icon.
|
|
46
|
+
* Default: `chevronUp`
|
|
47
|
+
*/
|
|
48
|
+
icon?: IconType;
|
|
43
49
|
/**
|
|
44
50
|
* The label for the input.
|
|
45
51
|
*/
|
|
46
52
|
label?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Whether or not to show the rotation animation for the end icon.
|
|
55
|
+
*/
|
|
56
|
+
noIconAnimation?: boolean;
|
|
47
57
|
/**
|
|
48
58
|
* Placeholder to display if `selectedValue` is empty.
|
|
49
59
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
-
import { TabClickEventDetail } from './tab-interface';
|
|
2
|
+
import { TabClickEventDetail, TabSizeChangeEventDetail } from './tab-interface';
|
|
3
3
|
import { TabsChangedEventDetail } from '../cpsl-tabs/tabs-interface';
|
|
4
4
|
export declare class CpslTab {
|
|
5
5
|
el: HTMLCpslTabElement;
|
|
@@ -17,8 +17,14 @@ export declare class CpslTab {
|
|
|
17
17
|
* @internal
|
|
18
18
|
*/
|
|
19
19
|
cpslTabButtonClick: EventEmitter<TabClickEventDetail>;
|
|
20
|
+
/**
|
|
21
|
+
* Emitted when tab size changes
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
cpslTabButtonSizeChange: EventEmitter<TabSizeChangeEventDetail>;
|
|
20
25
|
onTabsChanged(ev: CustomEvent<TabsChangedEventDetail>): void;
|
|
21
26
|
onTabsInit(ev: CustomEvent<TabsChangedEventDetail>): void;
|
|
27
|
+
componentDidLoad(): void;
|
|
22
28
|
private setSelected;
|
|
23
29
|
private onTabClicked;
|
|
24
30
|
render(): any;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
import { TabSizeChangeEventDetail } from '../cpsl-tab/tab-interface';
|
|
2
3
|
import { TabsChangedEventDetail } from './tabs-interface';
|
|
3
4
|
export declare class CpslTabs {
|
|
4
5
|
el: HTMLCpslTabsElement;
|
|
@@ -23,6 +24,7 @@ export declare class CpslTabs {
|
|
|
23
24
|
cpslTabsInit: EventEmitter<TabsChangedEventDetail>;
|
|
24
25
|
updateSlider(): void;
|
|
25
26
|
updateTab(newValue?: string, oldValue?: string): void;
|
|
27
|
+
onTabSizeChange(ev: CustomEvent<TabSizeChangeEventDetail>): void;
|
|
26
28
|
componentWillLoad(): void;
|
|
27
29
|
componentDidLoad(): void;
|
|
28
30
|
private get tabs();
|
|
@@ -9,16 +9,20 @@ import { AutocompleteTypes, IconType, TextFieldTypes } from "./interface";
|
|
|
9
9
|
import { CodeChangeEventDetail } from "./components/cpsl-code-input/code-change-interface";
|
|
10
10
|
import { DropdownInputEventDetail } from "./components/cpsl-dropdown/dropdown-interface";
|
|
11
11
|
import { InputChangeEventDetail, InputInputEventDetail } from "./components/cpsl-input/input-interface";
|
|
12
|
-
import { TabClickEventDetail } from "./components/cpsl-tab/tab-interface";
|
|
12
|
+
import { TabClickEventDetail, TabSizeChangeEventDetail } from "./components/cpsl-tab/tab-interface";
|
|
13
13
|
import { TabsChangedEventDetail } from "./components/cpsl-tabs/tabs-interface";
|
|
14
14
|
export { AutocompleteTypes, IconType, TextFieldTypes } from "./interface";
|
|
15
15
|
export { CodeChangeEventDetail } from "./components/cpsl-code-input/code-change-interface";
|
|
16
16
|
export { DropdownInputEventDetail } from "./components/cpsl-dropdown/dropdown-interface";
|
|
17
17
|
export { InputChangeEventDetail, InputInputEventDetail } from "./components/cpsl-input/input-interface";
|
|
18
|
-
export { TabClickEventDetail } from "./components/cpsl-tab/tab-interface";
|
|
18
|
+
export { TabClickEventDetail, TabSizeChangeEventDetail } from "./components/cpsl-tab/tab-interface";
|
|
19
19
|
export { TabsChangedEventDetail } from "./components/cpsl-tabs/tabs-interface";
|
|
20
20
|
export namespace Components {
|
|
21
21
|
interface CpslAlert {
|
|
22
|
+
/**
|
|
23
|
+
* Whether to show the alert with a filled background based on the variant
|
|
24
|
+
*/
|
|
25
|
+
"filled"?: boolean;
|
|
22
26
|
/**
|
|
23
27
|
* The name of the icon to show.
|
|
24
28
|
*/
|
|
@@ -301,6 +305,10 @@ export namespace Components {
|
|
|
301
305
|
"width": string;
|
|
302
306
|
}
|
|
303
307
|
interface CpslFileUpload {
|
|
308
|
+
/**
|
|
309
|
+
* If the input is disabled. Default is: false.
|
|
310
|
+
*/
|
|
311
|
+
"disabled"?: boolean;
|
|
304
312
|
/**
|
|
305
313
|
* Error text to show below the input. If this is provided the input will enter an error state.
|
|
306
314
|
*/
|
|
@@ -389,11 +397,12 @@ export namespace Components {
|
|
|
389
397
|
"icons": (IconType | string)[];
|
|
390
398
|
}
|
|
391
399
|
interface CpslIdenticon {
|
|
392
|
-
"hash"
|
|
400
|
+
"hash"?: string | undefined;
|
|
393
401
|
/**
|
|
394
|
-
* The
|
|
402
|
+
* The CSS width and height of the identicon. Default is: 40px.
|
|
395
403
|
*/
|
|
396
|
-
"size":
|
|
404
|
+
"size": string;
|
|
405
|
+
"variant": 'default' | 'avatar';
|
|
397
406
|
}
|
|
398
407
|
interface CpslInfoBox {
|
|
399
408
|
}
|
|
@@ -414,6 +423,10 @@ export namespace Components {
|
|
|
414
423
|
* Sets the [`autofocus` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus) on the native input element. This may not be sufficient for the element to be focused on page load.
|
|
415
424
|
*/
|
|
416
425
|
"autofocus": boolean;
|
|
426
|
+
/**
|
|
427
|
+
* If `true`, the input's entire contents will be selected on focus.
|
|
428
|
+
*/
|
|
429
|
+
"autoselect": boolean;
|
|
417
430
|
/**
|
|
418
431
|
* If `true`, the input primary color will use the contrast value, not the primary text value.
|
|
419
432
|
*/
|
|
@@ -722,6 +735,10 @@ export namespace Components {
|
|
|
722
735
|
* Helper text to show below the input. If `"errorText"` is provided that will take precedence.
|
|
723
736
|
*/
|
|
724
737
|
"helperText"?: string;
|
|
738
|
+
/**
|
|
739
|
+
* The name of the icon to use for the end icon. Default: `chevronUp`
|
|
740
|
+
*/
|
|
741
|
+
"icon"?: IconType;
|
|
725
742
|
/**
|
|
726
743
|
* ID of the element, must be unique for the popover trigger.
|
|
727
744
|
*/
|
|
@@ -730,6 +747,10 @@ export namespace Components {
|
|
|
730
747
|
* The label for the input.
|
|
731
748
|
*/
|
|
732
749
|
"label"?: string;
|
|
750
|
+
/**
|
|
751
|
+
* Whether or not to show the rotation animation for the end icon.
|
|
752
|
+
*/
|
|
753
|
+
"noIconAnimation"?: boolean;
|
|
733
754
|
/**
|
|
734
755
|
* Placeholder to display if `selectedValue` is empty.
|
|
735
756
|
*/
|
|
@@ -1332,6 +1353,7 @@ declare global {
|
|
|
1332
1353
|
};
|
|
1333
1354
|
interface HTMLCpslTabElementEventMap {
|
|
1334
1355
|
"cpslTabButtonClick": TabClickEventDetail;
|
|
1356
|
+
"cpslTabButtonSizeChange": TabSizeChangeEventDetail;
|
|
1335
1357
|
}
|
|
1336
1358
|
interface HTMLCpslTabElement extends Components.CpslTab, HTMLStencilElement {
|
|
1337
1359
|
addEventListener<K extends keyof HTMLCpslTabElementEventMap>(type: K, listener: (this: HTMLCpslTabElement, ev: CpslTabCustomEvent<HTMLCpslTabElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -1430,6 +1452,10 @@ declare global {
|
|
|
1430
1452
|
}
|
|
1431
1453
|
declare namespace LocalJSX {
|
|
1432
1454
|
interface CpslAlert {
|
|
1455
|
+
/**
|
|
1456
|
+
* Whether to show the alert with a filled background based on the variant
|
|
1457
|
+
*/
|
|
1458
|
+
"filled"?: boolean;
|
|
1433
1459
|
/**
|
|
1434
1460
|
* The name of the icon to show.
|
|
1435
1461
|
*/
|
|
@@ -1744,6 +1770,10 @@ declare namespace LocalJSX {
|
|
|
1744
1770
|
"width"?: string;
|
|
1745
1771
|
}
|
|
1746
1772
|
interface CpslFileUpload {
|
|
1773
|
+
/**
|
|
1774
|
+
* If the input is disabled. Default is: false.
|
|
1775
|
+
*/
|
|
1776
|
+
"disabled"?: boolean;
|
|
1747
1777
|
/**
|
|
1748
1778
|
* Error text to show below the input. If this is provided the input will enter an error state.
|
|
1749
1779
|
*/
|
|
@@ -1852,11 +1882,12 @@ declare namespace LocalJSX {
|
|
|
1852
1882
|
"icons"?: (IconType | string)[];
|
|
1853
1883
|
}
|
|
1854
1884
|
interface CpslIdenticon {
|
|
1855
|
-
"hash"?: string;
|
|
1885
|
+
"hash"?: string | undefined;
|
|
1856
1886
|
/**
|
|
1857
|
-
* The
|
|
1887
|
+
* The CSS width and height of the identicon. Default is: 40px.
|
|
1858
1888
|
*/
|
|
1859
|
-
"size"?:
|
|
1889
|
+
"size"?: string;
|
|
1890
|
+
"variant"?: 'default' | 'avatar';
|
|
1860
1891
|
}
|
|
1861
1892
|
interface CpslInfoBox {
|
|
1862
1893
|
}
|
|
@@ -1877,6 +1908,10 @@ declare namespace LocalJSX {
|
|
|
1877
1908
|
* Sets the [`autofocus` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus) on the native input element. This may not be sufficient for the element to be focused on page load.
|
|
1878
1909
|
*/
|
|
1879
1910
|
"autofocus"?: boolean;
|
|
1911
|
+
/**
|
|
1912
|
+
* If `true`, the input's entire contents will be selected on focus.
|
|
1913
|
+
*/
|
|
1914
|
+
"autoselect"?: boolean;
|
|
1880
1915
|
/**
|
|
1881
1916
|
* If `true`, the input primary color will use the contrast value, not the primary text value.
|
|
1882
1917
|
*/
|
|
@@ -2241,6 +2276,10 @@ declare namespace LocalJSX {
|
|
|
2241
2276
|
* Helper text to show below the input. If `"errorText"` is provided that will take precedence.
|
|
2242
2277
|
*/
|
|
2243
2278
|
"helperText"?: string;
|
|
2279
|
+
/**
|
|
2280
|
+
* The name of the icon to use for the end icon. Default: `chevronUp`
|
|
2281
|
+
*/
|
|
2282
|
+
"icon"?: IconType;
|
|
2244
2283
|
/**
|
|
2245
2284
|
* ID of the element, must be unique for the popover trigger.
|
|
2246
2285
|
*/
|
|
@@ -2249,6 +2288,10 @@ declare namespace LocalJSX {
|
|
|
2249
2288
|
* The label for the input.
|
|
2250
2289
|
*/
|
|
2251
2290
|
"label"?: string;
|
|
2291
|
+
/**
|
|
2292
|
+
* Whether or not to show the rotation animation for the end icon.
|
|
2293
|
+
*/
|
|
2294
|
+
"noIconAnimation"?: boolean;
|
|
2252
2295
|
/**
|
|
2253
2296
|
* Emitted when the input loses focus.
|
|
2254
2297
|
*/
|
package/dist/types/index.d.ts
CHANGED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export default class Prando {
|
|
2
|
+
private static readonly MIN;
|
|
3
|
+
private static readonly MAX;
|
|
4
|
+
private _seed;
|
|
5
|
+
private _value;
|
|
6
|
+
/**
|
|
7
|
+
* Generate a new Prando pseudo-random number generator.
|
|
8
|
+
*
|
|
9
|
+
* @param seed - A number or string seed that determines which pseudo-random number sequence will be created. Defaults to a random seed based on `Math.random()`.
|
|
10
|
+
*/
|
|
11
|
+
constructor(seed?: number | string);
|
|
12
|
+
/**
|
|
13
|
+
* Generates a pseudo-random number between a lower (inclusive) and a higher (exclusive) bounds.
|
|
14
|
+
*
|
|
15
|
+
* @param min - The minimum number that can be randomly generated.
|
|
16
|
+
* @param pseudoMax - The maximum number that can be randomly generated (exclusive).
|
|
17
|
+
* @return The generated pseudo-random number.
|
|
18
|
+
*/
|
|
19
|
+
next(min?: number, pseudoMax?: number): number;
|
|
20
|
+
/**
|
|
21
|
+
* Generates a pseudo-random integer number in a range (inclusive).
|
|
22
|
+
*
|
|
23
|
+
* @param min - The minimum number that can be randomly generated.
|
|
24
|
+
* @param max - The maximum number that can be randomly generated.
|
|
25
|
+
* @return The generated pseudo-random number.
|
|
26
|
+
*/
|
|
27
|
+
nextInt(min?: number, max?: number): number;
|
|
28
|
+
/**
|
|
29
|
+
* Generates a pseudo-random string sequence of a particular length from a specific character range.
|
|
30
|
+
*
|
|
31
|
+
* Note: keep in mind that creating a random string sequence does not guarantee uniqueness; there is always a
|
|
32
|
+
* 1 in (char_length^string_length) chance of collision. For real unique string ids, always check for
|
|
33
|
+
* pre-existing ids, or employ a robust GUID/UUID generator.
|
|
34
|
+
*
|
|
35
|
+
* @param length - Length of the string to be generated.
|
|
36
|
+
* @param chars - Characters that are used when creating the random string. Defaults to all alphanumeric chars (A-Z, a-z, 0-9).
|
|
37
|
+
* @return The generated string sequence.
|
|
38
|
+
*/
|
|
39
|
+
nextString(length?: number, chars?: string): string;
|
|
40
|
+
/**
|
|
41
|
+
* Generates a pseudo-random string of 1 character specific character range.
|
|
42
|
+
*
|
|
43
|
+
* @param chars - Characters that are used when creating the random string. Defaults to all alphanumeric chars (A-Z, a-z, 0-9).
|
|
44
|
+
* @return The generated character.
|
|
45
|
+
*/
|
|
46
|
+
nextChar(chars?: string): string;
|
|
47
|
+
/**
|
|
48
|
+
* Picks a pseudo-random item from an array. The array is left unmodified.
|
|
49
|
+
*
|
|
50
|
+
* Note: keep in mind that while the returned item will be random enough, picking one item from the array at a time
|
|
51
|
+
* does not guarantee nor imply that a sequence of random non-repeating items will be picked. If you want to
|
|
52
|
+
* *pick items in a random order* from an array, instead of *pick one random item from an array*, it's best to
|
|
53
|
+
* apply a *shuffle* transformation to the array instead, then read it linearly.
|
|
54
|
+
*
|
|
55
|
+
* @param array - Array of any type containing one or more candidates for random picking.
|
|
56
|
+
* @return An item from the array.
|
|
57
|
+
*/
|
|
58
|
+
nextArrayItem<T>(array: T[]): T;
|
|
59
|
+
/**
|
|
60
|
+
* Generates a pseudo-random boolean.
|
|
61
|
+
*
|
|
62
|
+
* @return A value of true or false.
|
|
63
|
+
*/
|
|
64
|
+
nextBoolean(): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Skips ahead in the sequence of numbers that are being generated. This is equivalent to
|
|
67
|
+
* calling next() a specified number of times, but faster since it doesn't need to map the
|
|
68
|
+
* new random numbers to a range and return it.
|
|
69
|
+
*
|
|
70
|
+
* @param iterations - The number of items to skip ahead.
|
|
71
|
+
*/
|
|
72
|
+
skip(iterations?: number): void;
|
|
73
|
+
/**
|
|
74
|
+
* Reset the pseudo-random number sequence back to its starting seed. Further calls to next()
|
|
75
|
+
* will then produce the same sequence of numbers it had produced before. This is equivalent to
|
|
76
|
+
* creating a new Prando instance with the same seed as another Prando instance.
|
|
77
|
+
*
|
|
78
|
+
* Example:
|
|
79
|
+
* let rng = new Prando(12345678);
|
|
80
|
+
* console.log(rng.next()); // 0.6177754114889017
|
|
81
|
+
* console.log(rng.next()); // 0.5784605181725837
|
|
82
|
+
* rng.reset();
|
|
83
|
+
* console.log(rng.next()); // 0.6177754114889017 again
|
|
84
|
+
* console.log(rng.next()); // 0.5784605181725837 again
|
|
85
|
+
*/
|
|
86
|
+
reset(): void;
|
|
87
|
+
private recalculate;
|
|
88
|
+
private xorshift;
|
|
89
|
+
private map;
|
|
90
|
+
private hashCode;
|
|
91
|
+
private getSafeSeed;
|
|
92
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usecapsule/core-components",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.1-dev.1",
|
|
4
4
|
"description": "Capsule Core Components",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"scripts": {
|
|
19
19
|
"build": "yarn build:assets && yarn build:css && stencil build",
|
|
20
20
|
"start": "yarn build:assets && yarn build:css && stencil build --dev --watch --serve",
|
|
21
|
-
"test": "stencil test --spec
|
|
22
|
-
"test.watch": "stencil test --spec --
|
|
21
|
+
"test": "stencil test --spec",
|
|
22
|
+
"test.watch": "stencil test --spec --watchAll",
|
|
23
23
|
"generate": "stencil generate",
|
|
24
24
|
"build:css": "sass --embed-sources src/css:./css",
|
|
25
25
|
"build:assets": "ts-node -T ./scripts/buildAssets.ts",
|
|
@@ -59,6 +59,5 @@
|
|
|
59
59
|
"storybook": "^8.1.11",
|
|
60
60
|
"storybook-addon-stencil": "^0.2.1",
|
|
61
61
|
"ts-node": "^10.9.2"
|
|
62
|
-
}
|
|
63
|
-
"gitHead": "e360ffa87553d566b73df627fbcc114e6e737391"
|
|
62
|
+
}
|
|
64
63
|
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,h as e,H as o}from"./p-fa6b7678.js";const r=":host{--identicon-background-red:linear-gradient(136deg, #FF4270 6.86%, #FF7C7C 93.78%);--identicon-background-orange:linear-gradient(136deg, #F45532 6.86%, #FF9B63 93.78%);--identicon-background-yellow:linear-gradient(136deg, #FFA756 6.86%, #FBFF47 93.78%);--identicon-background-green:linear-gradient(136deg, #0CAE60 6.86%, #7BFFD0 93.78%);--identicon-background-blue:linear-gradient(136deg, #476FFF 6.86%, #47C8FF 93.78%);--identicon-background-purple:linear-gradient(136deg, #9747FF 6.86%, #DA47FF 93.78%);display:block;width:62px;height:62px;aspect-ratio:1;border-radius:6px;position:relative;border:1px solid var(--cpsl-color-background-8)}:host>svg{fill:rgba(255, 255, 255, 0.6);position:absolute;width:35%}:host>svg.rotate90{transform:rotate(0.25turn)}:host>svg.rotate180{transform:rotate(0.5turn)}:host>svg.rotate270{transform:rotate(0.75turn)}:host>svg:nth-child(1){right:50%;bottom:50%}:host>svg:nth-child(2){left:50%;bottom:50%}:host>svg:nth-child(3){right:50%;top:50%}:host>svg:nth-child(4){left:50%;top:50%}:host(.red){background:var(--identicon-background-red)}:host(.orange){background:var(--identicon-background-orange)}:host(.green){background:var(--identicon-background-green)}:host(.yellow){background:var(--identicon-background-yellow)}:host(.blue){background:var(--identicon-background-blue)}:host(.purple){background:var(--identicon-background-purple)}";const n=r;const d=t=>e("svg",{class:{rotate90:t===1,rotate180:t===2,rotate270:t===3},viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg"},e("g",{"clip-path":"url(#clip0_674_66)"},e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24ZM12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z"})),e("defs",null,e("clipPath",{id:"clip0_674_66"},e("rect",{width:"12",height:"12"}))));const i=t=>e("svg",{class:{rotate90:t===1,rotate180:t===2,rotate270:t===3},viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg"},e("g",{"clip-path":"url(#clip0_674_255)"},e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24ZM12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z"}),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 18C15.3137 18 18 15.3137 18 12C18 8.68629 15.3137 6 12 6C8.68629 6 6 8.68629 6 12C6 15.3137 8.68629 18 12 18ZM12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z"})),e("defs",null,e("clipPath",{id:"clip0_674_255"},e("rect",{width:"12",height:"12"}))));const a=class{constructor(e){t(this,e);this.hash=undefined;this.size=40}render(){const[t,r]=l(this.hash);const n=(t>>2&1)!==0;const a=(t>>3&1)!==0;const c=(t>>4&1)!==0;const s=(t>>5&1)!==0;const g=t>>6&3;const u=t>>7&3;const h=t>>8&3;const p=t>>9&3;const[b,v]=[[n,a,c,s],[g,u,h,p]];return e(o,{key:"39bcae00e3fd58ff94639fbb43c77fd942899e51",class:{red:r==="red",orange:r==="orange",yellow:r==="yellow",green:r==="green",blue:r==="blue",purple:r==="purple"}},b.map(((t,e)=>t?i(v[e]):d(v[e]))))}};const c=["red","orange","yellow","green","blue","purple"];function l(t){const e=t.charCodeAt(0)<<24|t.charCodeAt(1)<<16|t.charCodeAt(2)<<8|t.charCodeAt(3);const o=c[Math.abs(e%6)];return[e,o]}a.style=n;export{a as cpsl_identicon};
|
|
2
|
-
//# sourceMappingURL=p-5d62e610.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["cpslIdenticonCss","CpslIdenticonStyle0","SingleArc","rotation","h","class","rotate90","rotate180","rotate270","viewBox","xmlns","d","id","width","height","DoubleArc","CpslIdenticon","render","code","color","stringToBinaryAndColor","this","hash","shapeA","shapeB","shapeC","shapeD","rotationA","rotationB","rotationC","rotationD","shapes","rotations","Host","key","red","orange","yellow","green","blue","purple","map","isDouble","index","COLORS","charCodeAt","Math","abs"],"sources":["src/components/cpsl-identicon/cpsl-identicon.scss?tag=cpsl-identicon&encapsulation=shadow","src/components/cpsl-identicon/cpsl-identicon.tsx"],"sourcesContent":[":host {\n --identicon-background-red: linear-gradient(136deg, #FF4270 6.86%, #FF7C7C 93.78%);\n --identicon-background-orange: linear-gradient(136deg, #F45532 6.86%, #FF9B63 93.78%);\n --identicon-background-yellow: linear-gradient(136deg, #FFA756 6.86%, #FBFF47 93.78%);\n --identicon-background-green: linear-gradient(136deg, #0CAE60 6.86%, #7BFFD0 93.78%);\n --identicon-background-blue: linear-gradient(136deg, #476FFF 6.86%, #47C8FF 93.78%);\n --identicon-background-purple: linear-gradient(136deg, #9747FF 6.86%, #DA47FF 93.78%);\n\n display: block;\n width: 62px;\n height: 62px;\n aspect-ratio: 1;\n border-radius: 6px;\n position: relative;\n border: 1px solid var(--cpsl-color-background-8);\n\n & > svg {\n fill: rgba(255, 255, 255, 0.6);\n position: absolute;\n width: 35%;\n }\n\n & > svg.rotate90 {\n transform: rotate(.25turn);\n }\n\n & > svg.rotate180 {\n transform: rotate(.5turn);\n }\n\n & > svg.rotate270 {\n transform: rotate(.75turn);\n }\n\n & > svg:nth-child(1) {\n right: 50%;\n bottom: 50%;\n }\n\n & > svg:nth-child(2) {\n left: 50%;\n bottom: 50%;\n }\n\n & > svg:nth-child(3) {\n right: 50%;\n top: 50%;\n }\n\n & > svg:nth-child(4) {\n left: 50%;\n top: 50%;\n }\n}\n\n:host(.red) {\n background: var(--identicon-background-red);\n}\n\n:host(.orange) {\n background: var(--identicon-background-orange);\n}\n\n:host(.green) {\n background: var(--identicon-background-green);\n}\n\n:host(.yellow) {\n background: var(--identicon-background-yellow);\n}\n\n:host(.blue) {\n background: var(--identicon-background-blue);\n}\n\n:host(.purple) {\n background: var(--identicon-background-purple);\n}\n","import { Component, Host, Prop, h } from '@stencil/core';\n\nconst SingleArc = (rotation: number) => (\n <svg\n class={{\n rotate90: rotation === 1,\n rotate180: rotation === 2,\n rotate270: rotation === 3,\n }}\n viewBox=\"0 0 12 12\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g clip-path=\"url(#clip0_674_66)\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24ZM12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_674_66\">\n <rect width=\"12\" height=\"12\" />\n </clipPath>\n </defs>\n </svg>\n);\n\nconst DoubleArc = (rotation: number) => (\n <svg\n class={{\n rotate90: rotation === 1,\n rotate180: rotation === 2,\n rotate270: rotation === 3,\n }}\n viewBox=\"0 0 12 12\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g clip-path=\"url(#clip0_674_255)\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24ZM12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M12 18C15.3137 18 18 15.3137 18 12C18 8.68629 15.3137 6 12 6C8.68629 6 6 8.68629 6 12C6 15.3137 8.68629 18 12 18ZM12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_674_255\">\n <rect width=\"12\" height=\"12\" />\n </clipPath>\n </defs>\n </svg>\n);\n\n@Component({\n tag: 'cpsl-identicon',\n styleUrl: 'cpsl-identicon.scss',\n shadow: true,\n})\nexport class CpslIdenticon {\n @Prop() hash: string;\n\n /**\n * The size of the identicon.\n * Default is: 40.\n */\n @Prop() size: number = 40;\n\n render() {\n const [code, color] = stringToBinaryAndColor(this.hash);\n const shapeA = ((code >> 2) & 1) !== 0;\n const shapeB = ((code >> 3) & 1) !== 0;\n const shapeC = ((code >> 4) & 1) !== 0;\n const shapeD = ((code >> 5) & 1) !== 0;\n const rotationA = (code >> 6) & 3;\n const rotationB = (code >> 7) & 3;\n const rotationC = (code >> 8) & 3;\n const rotationD = (code >> 9) & 3;\n\n const [shapes, rotations] = [\n [shapeA, shapeB, shapeC, shapeD],\n [rotationA, rotationB, rotationC, rotationD],\n ];\n\n return (\n <Host\n class={{\n red: color === 'red',\n orange: color === 'orange',\n yellow: color === 'yellow',\n green: color === 'green',\n blue: color === 'blue',\n purple: color === 'purple',\n }}\n >\n {shapes.map((isDouble, index) => {\n return isDouble ? DoubleArc(rotations[index]) : SingleArc(rotations[index]);\n })}\n </Host>\n );\n }\n}\n\ntype Color = 'red' | 'orange' | 'yellow' | 'green' | 'blue' | 'purple';\n\nconst COLORS: Color[] = ['red', 'orange', 'yellow', 'green', 'blue', 'purple'];\n\nfunction stringToBinaryAndColor(hash: string): [number, Color] {\n const code = (hash.charCodeAt(0) << 24) | (hash.charCodeAt(1) << 16) | (hash.charCodeAt(2) << 8) | hash.charCodeAt(3);\n\n const color = COLORS[Math.abs(code % 6)];\n\n return [code, color];\n}\n"],"mappings":"kDAAA,MAAMA,EAAmB,k2CACzB,MAAAC,EAAeD,ECCf,MAAME,EAAaC,GACjBC,EAAA,OACEC,MAAO,CACLC,SAAUH,IAAa,EACvBI,UAAWJ,IAAa,EACxBK,UAAWL,IAAa,GAE1BM,QAAQ,YACRC,MAAM,8BAENN,EAAA,iBAAa,sBACXA,EAAA,oBACY,UAAS,YACT,UACVO,EAAE,wOAGNP,EAAA,YACEA,EAAA,YAAUQ,GAAG,gBACXR,EAAA,QAAMS,MAAM,KAAKC,OAAO,UAMhC,MAAMC,EAAaZ,GACjBC,EAAA,OACEC,MAAO,CACLC,SAAUH,IAAa,EACvBI,UAAWJ,IAAa,EACxBK,UAAWL,IAAa,GAE1BM,QAAQ,YACRC,MAAM,8BAENN,EAAA,iBAAa,uBACXA,EAAA,oBACY,UAAS,YACT,UACVO,EAAE,uOAEJP,EAAA,oBACY,UAAS,YACT,UACVO,EAAE,wOAGNP,EAAA,YACEA,EAAA,YAAUQ,GAAG,iBACXR,EAAA,QAAMS,MAAM,KAAKC,OAAO,U,MAWnBE,EAAa,M,uDAOD,E,CAEvB,MAAAC,GACE,MAAOC,EAAM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