@getpara/core-components 2.0.0-alpha.5 → 2.0.0-alpha.50
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/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-1591d4b0.entry.js +28 -0
- package/dist/capsule/p-1591d4b0.entry.js.map +1 -0
- package/dist/capsule/p-3719bb1e.entry.js +2 -0
- package/dist/capsule/p-3719bb1e.entry.js.map +1 -0
- package/dist/cjs/capsule.cjs.js +1 -1
- package/dist/cjs/cpsl-alert_34.cjs.entry.js +545 -69
- package/dist/cjs/cpsl-alert_34.cjs.entry.js.map +1 -1
- package/dist/cjs/cpsl-identicon.cjs.entry.js +4 -2
- package/dist/cjs/cpsl-identicon.cjs.entry.js.map +1 -1
- package/dist/cjs/index.cjs.js +5 -2
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/assets/icons/arrow-circle-down.svg +3 -0
- package/dist/collection/assets/icons/backpack.svg +8 -0
- package/dist/collection/assets/icons/bera-brand.svg +7 -0
- package/dist/collection/assets/icons/coinbase.svg +10 -0
- package/dist/collection/assets/icons/cosmos-circle.svg +4 -0
- package/dist/collection/assets/icons/cosmostation.svg +11 -0
- package/dist/collection/assets/icons/dots-square.svg +13 -0
- package/dist/collection/assets/icons/eth-circle.svg +9 -0
- package/dist/collection/assets/icons/glow.svg +15 -0
- package/dist/collection/assets/icons/haha.svg +15 -0
- package/dist/collection/assets/icons/index.js +56 -0
- package/dist/collection/assets/icons/index.js.map +1 -1
- package/dist/collection/assets/icons/keplr.svg +30 -0
- package/dist/collection/assets/icons/leap.svg +20 -0
- package/dist/collection/assets/icons/metamask.svg +21 -0
- package/dist/collection/assets/icons/okx.svg +15 -0
- package/dist/collection/assets/icons/para-arrow.svg +3 -0
- package/dist/collection/assets/icons/phantom.svg +11 -0
- package/dist/collection/assets/icons/rabby.svg +24 -0
- package/dist/collection/assets/icons/rainbow.svg +54 -0
- package/dist/collection/assets/icons/safe.svg +7 -0
- package/dist/collection/assets/icons/solana-circle.svg +20 -0
- package/dist/collection/assets/icons/solflare.svg +11 -0
- package/dist/collection/assets/icons/star-05.svg +3 -0
- package/dist/collection/assets/icons/user-01.svg +3 -0
- package/dist/collection/assets/icons/user-plus.svg +3 -0
- package/dist/collection/assets/icons/valora.svg +25 -0
- package/dist/collection/assets/icons/wallet-02.svg +3 -0
- package/dist/collection/assets/icons/wallet-connect.svg +3 -0
- package/dist/collection/assets/icons/zerion.svg +15 -0
- package/dist/collection/components/cpsl-alert/cpsl-alert.js +1 -1
- package/dist/collection/components/cpsl-auth-modal/cpsl-auth-modal.css +4 -4
- package/dist/collection/components/cpsl-code-input/cpsl-code-input.js +39 -15
- package/dist/collection/components/cpsl-code-input/cpsl-code-input.js.map +1 -1
- package/dist/collection/components/cpsl-icon/cpsl-icon.css +13 -9
- package/dist/collection/components/cpsl-icon/cpsl-icon.js +75 -2
- package/dist/collection/components/cpsl-icon/cpsl-icon.js.map +1 -1
- package/dist/collection/components/cpsl-identicon/cpsl-identicon.css +2 -1
- package/dist/collection/components/cpsl-identicon/cpsl-identicon.js +21 -1
- package/dist/collection/components/cpsl-identicon/cpsl-identicon.js.map +1 -1
- package/dist/collection/components/cpsl-input/cpsl-input.js +1 -1
- package/dist/collection/components/cpsl-overlay/cpsl-overlay.css +1 -1
- package/dist/collection/components/cpsl-popover/cpsl-popover.js +44 -37
- 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-select/cpsl-select.css +5 -0
- package/dist/collection/components/cpsl-select/cpsl-select.js +23 -4
- package/dist/collection/components/cpsl-select/cpsl-select.js.map +1 -1
- package/dist/collection/components/cpsl-select-item/cpsl-select-item.css +0 -1
- package/dist/collection/components/cpsl-select-item/cpsl-select-item.js +9 -1
- package/dist/collection/components/cpsl-select-item/cpsl-select-item.js.map +1 -1
- package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js +2 -2
- package/dist/collection/components/cpsl-spinner/cpsl-spinner.css +10 -2
- package/dist/collection/components/cpsl-spinner/cpsl-spinner.js +7 -7
- package/dist/collection/components/cpsl-spinner/cpsl-spinner.js.map +1 -1
- package/dist/collection/components/cpsl-text/cpsl-text.css +25 -0
- package/dist/collection/components/cpsl-text/cpsl-text.js +25 -3
- package/dist/collection/components/cpsl-text/cpsl-text.js.map +1 -1
- package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.css +10 -0
- package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.js +23 -2
- package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.js.map +1 -1
- package/dist/collection/interface.js.map +1 -1
- package/dist/collection/utils/theme/generatePalette.js +3 -1
- package/dist/collection/utils/theme/generatePalette.js.map +1 -1
- package/dist/collection/utils/theme/generateTheme.js +2 -1
- package/dist/collection/utils/theme/generateTheme.js.map +1 -1
- package/dist/esm/capsule.js +1 -1
- package/dist/esm/cpsl-alert_34.entry.js +545 -69
- package/dist/esm/cpsl-alert_34.entry.js.map +1 -1
- package/dist/esm/cpsl-identicon.entry.js +4 -2
- package/dist/esm/cpsl-identicon.entry.js.map +1 -1
- package/dist/esm/index.js +5 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/scripts/appendLoaderExports.js +3 -3
- package/dist/scripts/appendLoaderExports.js.map +1 -1
- package/dist/types/assets/icons/index.d.ts +28 -0
- package/dist/types/components/cpsl-icon/cpsl-icon.d.ts +16 -0
- package/dist/types/components/cpsl-identicon/cpsl-identicon.d.ts +1 -0
- package/dist/types/components/cpsl-popover/cpsl-popover.d.ts +5 -0
- package/dist/types/components/cpsl-select/cpsl-select.d.ts +6 -1
- package/dist/types/components/cpsl-spinner/cpsl-spinner.d.ts +2 -2
- package/dist/types/components/cpsl-text/cpsl-text.d.ts +7 -1
- package/dist/types/components/cpsl-tile-button/cpsl-tile-button.d.ts +5 -0
- package/dist/types/components.d.ts +74 -8
- package/dist/types/interface.d.ts +1 -0
- package/dist/types/utils/theme/generatePalette.d.ts +1 -1
- package/dist/types/utils/theme/generateTheme.d.ts +1 -1
- package/package.json +36 -36
- package/dist/capsule/p-438442c7.entry.js +0 -2
- package/dist/capsule/p-438442c7.entry.js.map +0 -1
- package/dist/capsule/p-5049e2a1.entry.js +0 -28
- package/dist/capsule/p-5049e2a1.entry.js.map +0 -1
|
@@ -9,12 +9,15 @@ export declare const Icons: {
|
|
|
9
9
|
arbitrumBrand: string;
|
|
10
10
|
arrowCircleBrokenDownLeft: string;
|
|
11
11
|
arrowCircleDownFilled: string;
|
|
12
|
+
arrowCircleDown: string;
|
|
12
13
|
arrowNarrow: string;
|
|
13
14
|
arrow: string;
|
|
14
15
|
asterisk: string;
|
|
16
|
+
backpack: string;
|
|
15
17
|
backupKit: string;
|
|
16
18
|
bank: string;
|
|
17
19
|
baseBrand: string;
|
|
20
|
+
beraBrand: string;
|
|
18
21
|
brush: string;
|
|
19
22
|
celoBrand: string;
|
|
20
23
|
checkCircleFilled: string;
|
|
@@ -30,9 +33,12 @@ export declare const Icons: {
|
|
|
30
33
|
clubhouseBrand: string;
|
|
31
34
|
clubhouse: string;
|
|
32
35
|
code: string;
|
|
36
|
+
coinbase: string;
|
|
33
37
|
copy07: string;
|
|
34
38
|
copy: string;
|
|
39
|
+
cosmosCircle: string;
|
|
35
40
|
cosmos: string;
|
|
41
|
+
cosmostation: string;
|
|
36
42
|
creditCard02: string;
|
|
37
43
|
creditCard: string;
|
|
38
44
|
cube03: string;
|
|
@@ -45,6 +51,7 @@ export declare const Icons: {
|
|
|
45
51
|
discordBrand: string;
|
|
46
52
|
discord: string;
|
|
47
53
|
dot: string;
|
|
54
|
+
dotsSquare: string;
|
|
48
55
|
dots: string;
|
|
49
56
|
downloadCloud: string;
|
|
50
57
|
download: string;
|
|
@@ -53,6 +60,7 @@ export declare const Icons: {
|
|
|
53
60
|
earth: string;
|
|
54
61
|
edit02: string;
|
|
55
62
|
emptyCircle: string;
|
|
63
|
+
ethCircle: string;
|
|
56
64
|
ethereum: string;
|
|
57
65
|
eyeOff: string;
|
|
58
66
|
eye: string;
|
|
@@ -67,9 +75,11 @@ export declare const Icons: {
|
|
|
67
75
|
githubBrand: string;
|
|
68
76
|
github: string;
|
|
69
77
|
globe: string;
|
|
78
|
+
glow: string;
|
|
70
79
|
googleBrand: string;
|
|
71
80
|
google: string;
|
|
72
81
|
gridDots: string;
|
|
82
|
+
haha: string;
|
|
73
83
|
helpCircle: string;
|
|
74
84
|
heroAlertCircle: string;
|
|
75
85
|
heroCheckmarkCapsule: string;
|
|
@@ -88,8 +98,10 @@ export declare const Icons: {
|
|
|
88
98
|
infoCircle: string;
|
|
89
99
|
instagramBrand: string;
|
|
90
100
|
instagram: string;
|
|
101
|
+
keplr: string;
|
|
91
102
|
key: string;
|
|
92
103
|
laptop: string;
|
|
104
|
+
leap: string;
|
|
93
105
|
lenovo: string;
|
|
94
106
|
lg: string;
|
|
95
107
|
lightning01: string;
|
|
@@ -101,12 +113,15 @@ export declare const Icons: {
|
|
|
101
113
|
logOut: string;
|
|
102
114
|
mail: string;
|
|
103
115
|
menu: string;
|
|
116
|
+
metamask: string;
|
|
104
117
|
monitor: string;
|
|
105
118
|
moonpayBrand: string;
|
|
106
119
|
moreLoginOptions: string;
|
|
107
120
|
motorola: string;
|
|
108
121
|
nobleBrand: string;
|
|
122
|
+
okx: string;
|
|
109
123
|
optimismBrand: string;
|
|
124
|
+
paraArrow: string;
|
|
110
125
|
paraBlackBg: string;
|
|
111
126
|
paraBrand: string;
|
|
112
127
|
paraIconBrand: string;
|
|
@@ -117,6 +132,7 @@ export declare const Icons: {
|
|
|
117
132
|
paraRings: string;
|
|
118
133
|
para: string;
|
|
119
134
|
passcode: string;
|
|
135
|
+
phantom: string;
|
|
120
136
|
phone: string;
|
|
121
137
|
pintrestBrand: string;
|
|
122
138
|
pintrest: string;
|
|
@@ -127,11 +143,14 @@ export declare const Icons: {
|
|
|
127
143
|
puzzlePiece: string;
|
|
128
144
|
qrCode02: string;
|
|
129
145
|
qrCode: string;
|
|
146
|
+
rabby: string;
|
|
147
|
+
rainbow: string;
|
|
130
148
|
rampNetworkBrand: string;
|
|
131
149
|
rampNetwork: string;
|
|
132
150
|
redditBrand: string;
|
|
133
151
|
reddit: string;
|
|
134
152
|
refresh: string;
|
|
153
|
+
safe: string;
|
|
135
154
|
samsung: string;
|
|
136
155
|
search: string;
|
|
137
156
|
send: string;
|
|
@@ -143,9 +162,12 @@ export declare const Icons: {
|
|
|
143
162
|
sliders: string;
|
|
144
163
|
snapchatBrand: string;
|
|
145
164
|
snapchat: string;
|
|
165
|
+
solanaCircle: string;
|
|
146
166
|
solana: string;
|
|
167
|
+
solflare: string;
|
|
147
168
|
spacingHeight: string;
|
|
148
169
|
star04Filled: string;
|
|
170
|
+
star05: string;
|
|
149
171
|
stars01Filled: string;
|
|
150
172
|
stars02: string;
|
|
151
173
|
stars: string;
|
|
@@ -162,12 +184,18 @@ export declare const Icons: {
|
|
|
162
184
|
twitterBrand: string;
|
|
163
185
|
twitter: string;
|
|
164
186
|
usdcBrand: string;
|
|
187
|
+
user01: string;
|
|
165
188
|
userCircle: string;
|
|
189
|
+
userPlus: string;
|
|
166
190
|
user: string;
|
|
191
|
+
valora: string;
|
|
192
|
+
wallet02: string;
|
|
193
|
+
walletConnect: string;
|
|
167
194
|
wallet: string;
|
|
168
195
|
x: string;
|
|
169
196
|
youtubeBrand: string;
|
|
170
197
|
youtube: string;
|
|
198
|
+
zerion: string;
|
|
171
199
|
AD: string;
|
|
172
200
|
AE: string;
|
|
173
201
|
AF: string;
|
|
@@ -20,5 +20,21 @@ export declare class CpslIcon {
|
|
|
20
20
|
* The name of the icon. If both `icon` and `src` are provided, `icon` will be used.
|
|
21
21
|
*/
|
|
22
22
|
icon?: IconType;
|
|
23
|
+
/**
|
|
24
|
+
* Whether the icon should be rounded.
|
|
25
|
+
*/
|
|
26
|
+
radius?: 'none' | 'theme' | 'full';
|
|
27
|
+
/**
|
|
28
|
+
* The background CSS property of the icon.
|
|
29
|
+
*/
|
|
30
|
+
background?: string;
|
|
31
|
+
/**
|
|
32
|
+
* The color of the icon.
|
|
33
|
+
*/
|
|
34
|
+
color?: string;
|
|
35
|
+
/**
|
|
36
|
+
* The border CSS property of the icon.
|
|
37
|
+
*/
|
|
38
|
+
border?: string;
|
|
23
39
|
render(): any;
|
|
24
40
|
}
|
|
@@ -50,6 +50,11 @@ export declare class CpslPopover {
|
|
|
50
50
|
* Default is: `"bottom"`.
|
|
51
51
|
*/
|
|
52
52
|
transformOriginVertical?: 'top' | 'center' | 'bottom';
|
|
53
|
+
/**
|
|
54
|
+
* If `true`, the popover will be aligned to the center of the trigger element.
|
|
55
|
+
* Default is `false`.
|
|
56
|
+
*/
|
|
57
|
+
alignCenter: boolean;
|
|
53
58
|
/**
|
|
54
59
|
* Which trigger causes the popover to open.
|
|
55
60
|
* Options are: `"click"`, `"hover"`.
|
|
@@ -17,6 +17,11 @@ export declare class CpslSelect {
|
|
|
17
17
|
* Default is `false`
|
|
18
18
|
*/
|
|
19
19
|
autoWidth?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* If `true`, the popover will be aligned to the center of the trigger element.
|
|
22
|
+
* Default is `false`.
|
|
23
|
+
*/
|
|
24
|
+
alignCenter: boolean;
|
|
20
25
|
/**
|
|
21
26
|
* If `true`, the user cannot interact with the input.
|
|
22
27
|
*/
|
|
@@ -45,7 +50,7 @@ export declare class CpslSelect {
|
|
|
45
50
|
* The name of the icon to use for the end icon.
|
|
46
51
|
* Default: `chevronUp`
|
|
47
52
|
*/
|
|
48
|
-
icon?: IconType;
|
|
53
|
+
icon?: IconType | null;
|
|
49
54
|
/**
|
|
50
55
|
* The label for the input.
|
|
51
56
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export declare class CpslSpinner {
|
|
2
2
|
/**
|
|
3
3
|
* Variant of the spinner
|
|
4
|
-
* Default is '
|
|
4
|
+
* Default is 'pending'.
|
|
5
5
|
*/
|
|
6
|
-
variant?: '
|
|
6
|
+
variant?: 'idle' | 'pending' | 'error' | 'success';
|
|
7
7
|
/**
|
|
8
8
|
* Size of the spinner in pixels.
|
|
9
9
|
* Default is 50.
|
|
@@ -4,7 +4,7 @@ export declare class CpslText {
|
|
|
4
4
|
* Options are: `"primary"`, `"secondary", `"tertiary", `"subtle", `"inverted", `"error".
|
|
5
5
|
* Default is: `"primary"`.
|
|
6
6
|
*/
|
|
7
|
-
color?: 'primary' | 'secondary' | 'tertiary' | 'subtle' | 'inverted' | 'error' | 'contrast';
|
|
7
|
+
color?: 'primary' | 'secondary' | 'tertiary' | 'subtle' | 'inverted' | 'error' | 'contrast' | 'success';
|
|
8
8
|
/**
|
|
9
9
|
* The variant of text.
|
|
10
10
|
* Options are: `"body2XS"`, `"bodyXS", `"bodyS", `"bodyM", `"bodyL", `"bodyXL", `"headingXS", `"headingS", `"headingM", `"headingL", `"headingXL", `"heading2XL".
|
|
@@ -17,6 +17,12 @@ export declare class CpslText {
|
|
|
17
17
|
* Default is: `"regular"`.
|
|
18
18
|
*/
|
|
19
19
|
weight?: 'regular' | 'medium' | 'semiBold' | 'bold';
|
|
20
|
+
/**
|
|
21
|
+
* The text-align CSS property to apply.
|
|
22
|
+
* Options are: `"left"`, `"center", `"right".
|
|
23
|
+
* Default is: `"left"`.
|
|
24
|
+
*/
|
|
25
|
+
align?: 'left' | 'center' | 'right';
|
|
20
26
|
private getContent;
|
|
21
27
|
render(): any;
|
|
22
28
|
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { IconType } from '../../interface.js';
|
|
2
2
|
export declare class CpslTileButton {
|
|
3
|
+
/**
|
|
4
|
+
* If the button is disabled.
|
|
5
|
+
* Default is: false.
|
|
6
|
+
*/
|
|
7
|
+
disabled?: boolean;
|
|
3
8
|
/**
|
|
4
9
|
* The external source of the icon. If both `icon` and `src` are provided, `icon` will be used.
|
|
5
10
|
*/
|
|
@@ -388,6 +388,18 @@ export namespace Components {
|
|
|
388
388
|
"withDefaultTheme"?: boolean;
|
|
389
389
|
}
|
|
390
390
|
interface CpslIcon {
|
|
391
|
+
/**
|
|
392
|
+
* The background CSS property of the icon.
|
|
393
|
+
*/
|
|
394
|
+
"background"?: string;
|
|
395
|
+
/**
|
|
396
|
+
* The border CSS property of the icon.
|
|
397
|
+
*/
|
|
398
|
+
"border"?: string;
|
|
399
|
+
/**
|
|
400
|
+
* The color of the icon.
|
|
401
|
+
*/
|
|
402
|
+
"color"?: string;
|
|
391
403
|
/**
|
|
392
404
|
* The name of the icon. If both `icon` and `src` are provided, `icon` will be used.
|
|
393
405
|
*/
|
|
@@ -400,6 +412,10 @@ export namespace Components {
|
|
|
400
412
|
* Whether to invert the icon's colors.
|
|
401
413
|
*/
|
|
402
414
|
"invert"?: boolean;
|
|
415
|
+
/**
|
|
416
|
+
* Whether the icon should be rounded.
|
|
417
|
+
*/
|
|
418
|
+
"radius"?: 'none' | 'theme' | 'full';
|
|
403
419
|
/**
|
|
404
420
|
* The CSS size of the icon.
|
|
405
421
|
*/
|
|
@@ -424,6 +440,7 @@ export namespace Components {
|
|
|
424
440
|
"icons": (IconType | string)[];
|
|
425
441
|
}
|
|
426
442
|
interface CpslIdenticon {
|
|
443
|
+
"arcWidth": string;
|
|
427
444
|
"hash"?: string | undefined;
|
|
428
445
|
/**
|
|
429
446
|
* The CSS width and height of the identicon. Default is: 40px.
|
|
@@ -668,6 +685,10 @@ export namespace Components {
|
|
|
668
685
|
"text": string;
|
|
669
686
|
}
|
|
670
687
|
interface CpslPopover {
|
|
688
|
+
/**
|
|
689
|
+
* If `true`, the popover will be aligned to the center of the trigger element. Default is `false`.
|
|
690
|
+
*/
|
|
691
|
+
"alignCenter": boolean;
|
|
671
692
|
/**
|
|
672
693
|
* ID for the element that the popover anchors to.
|
|
673
694
|
*/
|
|
@@ -758,6 +779,10 @@ export namespace Components {
|
|
|
758
779
|
"justify"?: React.CSSProperties['justifyContent'];
|
|
759
780
|
}
|
|
760
781
|
interface CpslSelect {
|
|
782
|
+
/**
|
|
783
|
+
* If `true`, the popover will be aligned to the center of the trigger element. Default is `false`.
|
|
784
|
+
*/
|
|
785
|
+
"alignCenter": boolean;
|
|
761
786
|
/**
|
|
762
787
|
* ID of element to anchor popover to.
|
|
763
788
|
*/
|
|
@@ -789,7 +814,7 @@ export namespace Components {
|
|
|
789
814
|
/**
|
|
790
815
|
* The name of the icon to use for the end icon. Default: `chevronUp`
|
|
791
816
|
*/
|
|
792
|
-
"icon"?: IconType;
|
|
817
|
+
"icon"?: IconType | null;
|
|
793
818
|
/**
|
|
794
819
|
* ID of the element, must be unique for the popover trigger.
|
|
795
820
|
*/
|
|
@@ -893,9 +918,9 @@ export namespace Components {
|
|
|
893
918
|
*/
|
|
894
919
|
"speed"?: number;
|
|
895
920
|
/**
|
|
896
|
-
* Variant of the spinner Default is '
|
|
921
|
+
* Variant of the spinner Default is 'pending'.
|
|
897
922
|
*/
|
|
898
|
-
"variant"?: '
|
|
923
|
+
"variant"?: 'idle' | 'pending' | 'error' | 'success';
|
|
899
924
|
}
|
|
900
925
|
interface CpslSwitch {
|
|
901
926
|
/**
|
|
@@ -926,10 +951,14 @@ export namespace Components {
|
|
|
926
951
|
"selectedTab"?: string;
|
|
927
952
|
}
|
|
928
953
|
interface CpslText {
|
|
954
|
+
/**
|
|
955
|
+
* The text-align CSS property to apply. Options are: `"left"`, `"center", `"right". Default is: `"left"`.
|
|
956
|
+
*/
|
|
957
|
+
"align"?: 'left' | 'center' | 'right';
|
|
929
958
|
/**
|
|
930
959
|
* The color of text. Options are: `"primary"`, `"secondary", `"tertiary", `"subtle", `"inverted", `"error". Default is: `"primary"`.
|
|
931
960
|
*/
|
|
932
|
-
"color"?: 'primary' | 'secondary' | 'tertiary' | 'subtle' | 'inverted' | 'error' | 'contrast';
|
|
961
|
+
"color"?: 'primary' | 'secondary' | 'tertiary' | 'subtle' | 'inverted' | 'error' | 'contrast' | 'success';
|
|
933
962
|
/**
|
|
934
963
|
* The variant of text. Options are: `"body2XS"`, `"bodyXS", `"bodyS", `"bodyM", `"bodyL", `"bodyXL", `"headingXS", `"headingS", `"headingM", `"headingL", `"headingXL", `"heading2XL". Default is: `"bodyM"`.
|
|
935
964
|
*/
|
|
@@ -940,6 +969,10 @@ export namespace Components {
|
|
|
940
969
|
"weight"?: 'regular' | 'medium' | 'semiBold' | 'bold';
|
|
941
970
|
}
|
|
942
971
|
interface CpslTileButton {
|
|
972
|
+
/**
|
|
973
|
+
* If the button is disabled. Default is: false.
|
|
974
|
+
*/
|
|
975
|
+
"disabled"?: boolean;
|
|
943
976
|
/**
|
|
944
977
|
* The name of the icon. If both `icon` and `src` are provided, `icon` will be used.
|
|
945
978
|
*/
|
|
@@ -1948,6 +1981,18 @@ declare namespace LocalJSX {
|
|
|
1948
1981
|
"withDefaultTheme"?: boolean;
|
|
1949
1982
|
}
|
|
1950
1983
|
interface CpslIcon {
|
|
1984
|
+
/**
|
|
1985
|
+
* The background CSS property of the icon.
|
|
1986
|
+
*/
|
|
1987
|
+
"background"?: string;
|
|
1988
|
+
/**
|
|
1989
|
+
* The border CSS property of the icon.
|
|
1990
|
+
*/
|
|
1991
|
+
"border"?: string;
|
|
1992
|
+
/**
|
|
1993
|
+
* The color of the icon.
|
|
1994
|
+
*/
|
|
1995
|
+
"color"?: string;
|
|
1951
1996
|
/**
|
|
1952
1997
|
* The name of the icon. If both `icon` and `src` are provided, `icon` will be used.
|
|
1953
1998
|
*/
|
|
@@ -1960,6 +2005,10 @@ declare namespace LocalJSX {
|
|
|
1960
2005
|
* Whether to invert the icon's colors.
|
|
1961
2006
|
*/
|
|
1962
2007
|
"invert"?: boolean;
|
|
2008
|
+
/**
|
|
2009
|
+
* Whether the icon should be rounded.
|
|
2010
|
+
*/
|
|
2011
|
+
"radius"?: 'none' | 'theme' | 'full';
|
|
1963
2012
|
/**
|
|
1964
2013
|
* The CSS size of the icon.
|
|
1965
2014
|
*/
|
|
@@ -1984,6 +2033,7 @@ declare namespace LocalJSX {
|
|
|
1984
2033
|
"icons"?: (IconType | string)[];
|
|
1985
2034
|
}
|
|
1986
2035
|
interface CpslIdenticon {
|
|
2036
|
+
"arcWidth"?: string;
|
|
1987
2037
|
"hash"?: string | undefined;
|
|
1988
2038
|
/**
|
|
1989
2039
|
* The CSS width and height of the identicon. Default is: 40px.
|
|
@@ -2276,6 +2326,10 @@ declare namespace LocalJSX {
|
|
|
2276
2326
|
"text"?: string;
|
|
2277
2327
|
}
|
|
2278
2328
|
interface CpslPopover {
|
|
2329
|
+
/**
|
|
2330
|
+
* If `true`, the popover will be aligned to the center of the trigger element. Default is `false`.
|
|
2331
|
+
*/
|
|
2332
|
+
"alignCenter"?: boolean;
|
|
2279
2333
|
/**
|
|
2280
2334
|
* ID for the element that the popover anchors to.
|
|
2281
2335
|
*/
|
|
@@ -2374,6 +2428,10 @@ declare namespace LocalJSX {
|
|
|
2374
2428
|
"justify"?: React.CSSProperties['justifyContent'];
|
|
2375
2429
|
}
|
|
2376
2430
|
interface CpslSelect {
|
|
2431
|
+
/**
|
|
2432
|
+
* If `true`, the popover will be aligned to the center of the trigger element. Default is `false`.
|
|
2433
|
+
*/
|
|
2434
|
+
"alignCenter"?: boolean;
|
|
2377
2435
|
/**
|
|
2378
2436
|
* ID of element to anchor popover to.
|
|
2379
2437
|
*/
|
|
@@ -2405,7 +2463,7 @@ declare namespace LocalJSX {
|
|
|
2405
2463
|
/**
|
|
2406
2464
|
* The name of the icon to use for the end icon. Default: `chevronUp`
|
|
2407
2465
|
*/
|
|
2408
|
-
"icon"?: IconType;
|
|
2466
|
+
"icon"?: IconType | null;
|
|
2409
2467
|
/**
|
|
2410
2468
|
* ID of the element, must be unique for the popover trigger.
|
|
2411
2469
|
*/
|
|
@@ -2529,9 +2587,9 @@ declare namespace LocalJSX {
|
|
|
2529
2587
|
*/
|
|
2530
2588
|
"speed"?: number;
|
|
2531
2589
|
/**
|
|
2532
|
-
* Variant of the spinner Default is '
|
|
2590
|
+
* Variant of the spinner Default is 'pending'.
|
|
2533
2591
|
*/
|
|
2534
|
-
"variant"?: '
|
|
2592
|
+
"variant"?: 'idle' | 'pending' | 'error' | 'success';
|
|
2535
2593
|
}
|
|
2536
2594
|
interface CpslSwitch {
|
|
2537
2595
|
/**
|
|
@@ -2570,10 +2628,14 @@ declare namespace LocalJSX {
|
|
|
2570
2628
|
"selectedTab"?: string;
|
|
2571
2629
|
}
|
|
2572
2630
|
interface CpslText {
|
|
2631
|
+
/**
|
|
2632
|
+
* The text-align CSS property to apply. Options are: `"left"`, `"center", `"right". Default is: `"left"`.
|
|
2633
|
+
*/
|
|
2634
|
+
"align"?: 'left' | 'center' | 'right';
|
|
2573
2635
|
/**
|
|
2574
2636
|
* The color of text. Options are: `"primary"`, `"secondary", `"tertiary", `"subtle", `"inverted", `"error". Default is: `"primary"`.
|
|
2575
2637
|
*/
|
|
2576
|
-
"color"?: 'primary' | 'secondary' | 'tertiary' | 'subtle' | 'inverted' | 'error' | 'contrast';
|
|
2638
|
+
"color"?: 'primary' | 'secondary' | 'tertiary' | 'subtle' | 'inverted' | 'error' | 'contrast' | 'success';
|
|
2577
2639
|
/**
|
|
2578
2640
|
* The variant of text. Options are: `"body2XS"`, `"bodyXS", `"bodyS", `"bodyM", `"bodyL", `"bodyXL", `"headingXS", `"headingS", `"headingM", `"headingL", `"headingXL", `"heading2XL". Default is: `"bodyM"`.
|
|
2579
2641
|
*/
|
|
@@ -2584,6 +2646,10 @@ declare namespace LocalJSX {
|
|
|
2584
2646
|
"weight"?: 'regular' | 'medium' | 'semiBold' | 'bold';
|
|
2585
2647
|
}
|
|
2586
2648
|
interface CpslTileButton {
|
|
2649
|
+
/**
|
|
2650
|
+
* If the button is disabled. Default is: false.
|
|
2651
|
+
*/
|
|
2652
|
+
"disabled"?: boolean;
|
|
2587
2653
|
/**
|
|
2588
2654
|
* The name of the icon. If both `icon` and `src` are provided, `icon` will be used.
|
|
2589
2655
|
*/
|
|
@@ -4,6 +4,6 @@ export type Palette = {
|
|
|
4
4
|
backgroundColors: string[];
|
|
5
5
|
accentColors: string[];
|
|
6
6
|
};
|
|
7
|
-
export declare const generatePalette: ({ foregroundColor, backgroundColor, accentColor, isDarkTheme, customPalette, }: Pick<Theme, 'foregroundColor' | 'backgroundColor' | 'accentColor' | 'customPalette'> & {
|
|
7
|
+
export declare const generatePalette: ({ foregroundColor, backgroundColor, accentColor, isDarkTheme, customPalette, overlayBackground, }: Pick<Theme, 'foregroundColor' | 'backgroundColor' | 'accentColor' | 'customPalette' | 'overlayBackground'> & {
|
|
8
8
|
isDarkTheme: boolean;
|
|
9
9
|
}) => void;
|
|
@@ -3,4 +3,4 @@ import { Theme } from '../../interface.js';
|
|
|
3
3
|
* Generates css theme variables.
|
|
4
4
|
* @returns @boolean Whether background is dark or not.
|
|
5
5
|
*/
|
|
6
|
-
export declare const generateTheme: ({ foregroundColor, backgroundColor, accentColor, darkForegroundColor, darkBackgroundColor, darkAccentColor, mode, font, customPalette, borderRadius, customFontSizes, customBorderRadii, }: Theme) => void;
|
|
6
|
+
export declare const generateTheme: ({ foregroundColor, backgroundColor, accentColor, darkForegroundColor, darkBackgroundColor, darkAccentColor, mode, font, customPalette, borderRadius, customFontSizes, customBorderRadii, overlayBackground, }: Theme) => void;
|
package/package.json
CHANGED
|
@@ -1,39 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/core-components",
|
|
3
|
-
"version": "2.0.0-alpha.5",
|
|
4
3
|
"description": "Capsule Core Components",
|
|
5
|
-
"
|
|
6
|
-
"type": "module",
|
|
7
|
-
"types": "dist/types/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./dist/types/index.d.ts",
|
|
11
|
-
"import": "./dist/index.js",
|
|
12
|
-
"require": "./dist/index.cjs.js"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"sideEffects": [
|
|
16
|
-
"*.css",
|
|
17
|
-
"*.scss"
|
|
18
|
-
],
|
|
4
|
+
"version": "2.0.0-alpha.50",
|
|
19
5
|
"collection": "dist/collection/collection-manifest.json",
|
|
20
6
|
"collection:main": "dist/collection/index.js",
|
|
21
|
-
"files": [
|
|
22
|
-
"dist/",
|
|
23
|
-
"css/"
|
|
24
|
-
],
|
|
25
|
-
"scripts": {
|
|
26
|
-
"build": "yarn build:assets && yarn build:css && stencil build && yarn appendLoaderExports",
|
|
27
|
-
"start": "yarn build:assets && yarn build:css && stencil build --dev --watch --serve",
|
|
28
|
-
"test": "stencil test --spec --clearCache",
|
|
29
|
-
"test.watch": "stencil test --spec --watchAll --clearCache",
|
|
30
|
-
"generate": "stencil generate",
|
|
31
|
-
"build:css": "sass --embed-sources src/css:./css",
|
|
32
|
-
"build:assets": "ts-node -T ./scripts/buildAssets.ts",
|
|
33
|
-
"appendLoaderExports": "ts-node -T ./scripts/appendLoaderExports.ts",
|
|
34
|
-
"storybook": "storybook dev -p 6006",
|
|
35
|
-
"build-storybook": "storybook build"
|
|
36
|
-
},
|
|
37
7
|
"dependencies": {
|
|
38
8
|
"@stencil/core": "^4.7.0",
|
|
39
9
|
"color-blend": "^4.0.0",
|
|
@@ -47,9 +17,9 @@
|
|
|
47
17
|
"@chromatic-com/storybook": "^1.6.0",
|
|
48
18
|
"@stencil/react-output-target": "^0.5.3",
|
|
49
19
|
"@stencil/sass": "^3.0.10",
|
|
50
|
-
"@storybook/addon-essentials": "^8.
|
|
51
|
-
"@storybook/addon-interactions": "^8.
|
|
52
|
-
"@storybook/addon-links": "^8.
|
|
20
|
+
"@storybook/addon-essentials": "^8.6.4",
|
|
21
|
+
"@storybook/addon-interactions": "^8.6.4",
|
|
22
|
+
"@storybook/addon-links": "^8.6.4",
|
|
53
23
|
"@storybook/addon-notes": "^5.3.21",
|
|
54
24
|
"@storybook/addon-webpack5-compiler-swc": "^1.0.4",
|
|
55
25
|
"@storybook/blocks": "^8.1.11",
|
|
@@ -64,9 +34,39 @@
|
|
|
64
34
|
"rollup-plugin-dotenv": "^0.5.0",
|
|
65
35
|
"sass": "^1.71.1",
|
|
66
36
|
"stencil-inline-svg": "^1.1.0",
|
|
67
|
-
"storybook": "^8.
|
|
37
|
+
"storybook": "^8.6.4",
|
|
68
38
|
"storybook-addon-stencil": "^0.2.1",
|
|
69
39
|
"ts-node": "^10.9.2"
|
|
70
40
|
},
|
|
71
|
-
"
|
|
41
|
+
"exports": {
|
|
42
|
+
".": {
|
|
43
|
+
"types": "./dist/types/index.d.ts",
|
|
44
|
+
"import": "./dist/index.js",
|
|
45
|
+
"require": "./dist/index.cjs.js"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"files": [
|
|
49
|
+
"dist/",
|
|
50
|
+
"css/"
|
|
51
|
+
],
|
|
52
|
+
"main": "dist/index.js",
|
|
53
|
+
"scripts": {
|
|
54
|
+
"appendLoaderExports": "ts-node -T ./scripts/appendLoaderExports.ts",
|
|
55
|
+
"build": "yarn build:assets && yarn build:css && stencil build && yarn appendLoaderExports",
|
|
56
|
+
"build-storybook": "storybook build",
|
|
57
|
+
"build:assets": "ts-node -T ./scripts/buildAssets.ts",
|
|
58
|
+
"build:css": "sass --embed-sources src/css:./css",
|
|
59
|
+
"generate": "stencil generate",
|
|
60
|
+
"start": "yarn build:assets && yarn build:css && stencil build --dev --watch --serve",
|
|
61
|
+
"storybook": "storybook dev -p 6006",
|
|
62
|
+
"test": "stencil test --spec --clearCache",
|
|
63
|
+
"test.watch": "stencil test --spec --watchAll --clearCache"
|
|
64
|
+
},
|
|
65
|
+
"sideEffects": [
|
|
66
|
+
"*.css",
|
|
67
|
+
"*.scss"
|
|
68
|
+
],
|
|
69
|
+
"type": "module",
|
|
70
|
+
"types": "dist/types/index.d.ts",
|
|
71
|
+
"gitHead": "688b92a7ca207593a4a3be09cb5cc580092614fc"
|
|
72
72
|
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,h as o,H as e}from"./p-fa6b7678.js";import{C as r,P as n}from"./p-497acb43.js";const i=":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%);--identicon-background-empty:linear-gradient(136deg, #aaaaaa 6.86%, #999999 93.78%);display:block;aspect-ratio:1;border-radius:25%;position:relative;border:1px solid var(--cpsl-color-background-8)}:host>svg{fill:rgba(255, 255, 255, 0.6);position:absolute;width:30%}: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)}:host(.empty){background:var(--identicon-background-empty)}:host(.avatar){border-radius:1000px}";const d=i;const a=t=>o("svg",{class:{rotate90:t===1,rotate180:t===2,rotate270:t===3},viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg"},o("g",{"clip-path":"url(#clip0_674_66)"},o("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"})),o("defs",null,o("clipPath",{id:"clip0_674_66"},o("rect",{width:"12",height:"12"}))));const l=t=>o("svg",{class:{rotate90:t===1,rotate180:t===2,rotate270:t===3},viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg"},o("g",{"clip-path":"url(#clip0_674_255)"},o("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"}),o("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"})),o("defs",null,o("clipPath",{id:"clip0_674_255"},o("rect",{width:"12",height:"12"}))));const s=[[[0,0,0,0],[0,1,3,2]],[[1,1,0,0],[0,1,3,2]],[[0,1,0,1],[0,1,3,2]],[[0,0,1,1],[0,1,3,2]],[[1,0,1,0],[0,1,3,2]],[[1,1,1,1],[0,1,3,2]],[[0,0,0,0],[2,3,1,0]],[[1,1,1,1],[2,3,1,0]],[[1,1,1,1],[0,1,2,3]]];const c=class{constructor(o){t(this,o);this.hash=undefined;this.size="40px";this.variant="default"}render(){let t;const r=!this.hash;if(!r)t=u(this.hash);return o(e,{key:"55072485ad5993ad8eb075a9d7d83e7e137ec9cd",class:{red:(t===null||t===void 0?void 0:t.color)==="red",orange:(t===null||t===void 0?void 0:t.color)==="orange",yellow:(t===null||t===void 0?void 0:t.color)==="yellow",green:(t===null||t===void 0?void 0:t.color)==="green",blue:(t===null||t===void 0?void 0:t.color)==="blue",purple:(t===null||t===void 0?void 0:t.color)==="purple",empty:!(t===null||t===void 0?void 0:t.color)&&!this.hash,avatar:this.variant==="avatar"},style:{width:this.size,height:this.size}},(t===null||t===void 0?void 0:t.shapes)&&(t===null||t===void 0?void 0:t.rotations)&&t.shapes.map(((o,e)=>o?l(t.rotations[e]):a(t.rotations[e]))))}};const g=[r.length,s.length,16];function u(t){const o=new n(t);const[e,i,d]=g.map((t=>o.nextInt(0,t-1)));const a=Math.floor(d/4);const[l,c]=[d%2===1,d%4>=2];return{color:r[e],shapes:s[i][0].map(((t,o)=>o===a?l?t===1?false:true:t===1:t===1)),rotations:s[i][1].map(((t,o)=>o===a?c?(t+2)%4:t:t))}}c.style=d;export{c as cpsl_identicon};
|
|
2
|
-
//# sourceMappingURL=p-438442c7.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","BASE_PATTERNS","CpslIdenticon","render","props","isEmpty","this","hash","getIdenticonProps","Host","key","red","color","orange","yellow","green","blue","purple","empty","avatar","variant","style","size","shapes","rotations","map","isDouble","index","PRANDO_INTS","COLORS","length","seed","rng","Prando","iColor","iPattern","iDeviation","len","nextInt","deviationIndex","Math","floor","isDeviateShape","isDeviateFlip","s","i","r"],"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 --identicon-background-empty: linear-gradient(136deg, #aaaaaa 6.86%, #999999 93.78%);\n\n display: block;\n aspect-ratio: 1;\n border-radius: 25%;\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: 30%;\n }\n\n & > svg.rotate90 {\n transform: rotate(0.25turn);\n }\n\n & > svg.rotate180 {\n transform: rotate(0.5turn);\n }\n\n & > svg.rotate270 {\n transform: rotate(0.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\n:host(.empty) {\n background: var(--identicon-background-empty);\n}\n\n:host(.avatar) {\n border-radius: 1000px;\n}\n","import { Component, Host, Prop, h } from '@stencil/core';\nimport Prando from '../../lib/prando.js';\nimport { Color, COLORS } from '../../utils/prand.js';\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\nconst BASE_PATTERNS = [\n [\n [0, 0, 0, 0],\n [0, 1, 3, 2],\n ],\n [\n [1, 1, 0, 0],\n [0, 1, 3, 2],\n ],\n [\n [0, 1, 0, 1],\n [0, 1, 3, 2],\n ],\n [\n [0, 0, 1, 1],\n [0, 1, 3, 2],\n ],\n [\n [1, 0, 1, 0],\n [0, 1, 3, 2],\n ],\n [\n [1, 1, 1, 1],\n [0, 1, 3, 2],\n ],\n [\n [0, 0, 0, 0],\n [2, 3, 1, 0],\n ],\n [\n [1, 1, 1, 1],\n [2, 3, 1, 0],\n ],\n [\n [1, 1, 1, 1],\n [0, 1, 2, 3],\n ],\n];\n\n@Component({\n tag: 'cpsl-identicon',\n styleUrl: 'cpsl-identicon.scss',\n shadow: true,\n})\nexport class CpslIdenticon {\n @Prop() hash?: string | undefined;\n\n /**\n * The CSS width and height of the identicon.\n * Default is: 40px.\n */\n @Prop() size: string = '40px';\n\n @Prop() variant: 'default' | 'avatar' = 'default';\n\n render() {\n let props;\n const isEmpty = !this.hash;\n if (!isEmpty) props = getIdenticonProps(this.hash);\n\n return (\n <Host\n class={{\n red: props?.color === 'red',\n orange: props?.color === 'orange',\n yellow: props?.color === 'yellow',\n green: props?.color === 'green',\n blue: props?.color === 'blue',\n purple: props?.color === 'purple',\n empty: !props?.color && !this.hash,\n avatar: this.variant === 'avatar',\n }}\n style={{\n width: this.size,\n height: this.size,\n }}\n >\n {props?.shapes &&\n props?.rotations &&\n props.shapes.map((isDouble, index) => {\n return isDouble ? DoubleArc(props.rotations[index]) : SingleArc(props.rotations[index]);\n })}\n </Host>\n );\n }\n}\n\nconst PRANDO_INTS = [COLORS.length, BASE_PATTERNS.length, 16];\n\nfunction getIdenticonProps(seed: string): { color: Color; shapes: boolean[]; rotations: number[] } {\n const rng = new Prando(seed);\n\n const [iColor, iPattern, iDeviation] = PRANDO_INTS.map(len => rng.nextInt(0, len - 1));\n\n const deviationIndex = Math.floor(iDeviation / 4);\n const [isDeviateShape, isDeviateFlip] = [iDeviation % 2 === 1, iDeviation % 4 >= 2];\n\n return {\n color: COLORS[iColor],\n shapes: BASE_PATTERNS[iPattern][0].map((s, i) => {\n return i === deviationIndex ? (isDeviateShape ? (s === 1 ? false : true) : s === 1) : s === 1;\n }),\n rotations: BASE_PATTERNS[iPattern][1].map((r, i) => (i === deviationIndex ? (isDeviateFlip ? (r + 2) % 4 : r) : r)),\n };\n}\n"],"mappings":"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","ignoreList":[]}
|