@usecapsule/core-components 3.2.0 → 3.3.1-dev.0
Sign up to get free protection for your applications and to get access to all the features.
- package/css/capsule-core.css +25 -10
- package/css/capsule-core.css.map +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-0e558c7f.entry.js +10 -0
- package/dist/capsule/{p-05cb769b.entry.js.map → p-0e558c7f.entry.js.map} +1 -1
- package/dist/capsule/{p-dc4591d5.entry.js → p-1bd11889.entry.js} +2 -2
- package/dist/capsule/p-1bd11889.entry.js.map +1 -0
- package/dist/capsule/p-32cdf894.entry.js +2 -0
- package/dist/capsule/p-32cdf894.entry.js.map +1 -0
- package/dist/capsule/p-3b042fd1.entry.js +2 -0
- package/dist/capsule/p-5965b15e.entry.js +2 -0
- package/dist/capsule/{p-c1aa1ffb.entry.js.map → p-5965b15e.entry.js.map} +1 -1
- package/dist/capsule/{p-742bda0b.entry.js → p-5d62e610.entry.js} +2 -2
- package/dist/capsule/p-60508b1e.entry.js +20 -0
- package/dist/capsule/p-60508b1e.entry.js.map +1 -0
- package/dist/cjs/capsule.cjs.js +1 -1
- package/dist/cjs/{cpsl-alert_33.cjs.entry.js → cpsl-alert_34.cjs.entry.js} +17025 -13458
- package/dist/cjs/cpsl-alert_34.cjs.entry.js.map +1 -0
- package/dist/cjs/cpsl-animation.cjs.entry.js +3 -2
- package/dist/cjs/cpsl-animation.cjs.entry.js.map +1 -1
- package/dist/cjs/cpsl-hero.cjs.entry.js +9 -6
- package/dist/cjs/cpsl-hero.cjs.entry.js.map +1 -1
- package/dist/cjs/cpsl-identicon.cjs.entry.js +1 -1
- package/dist/cjs/cpsl-info-box.cjs.entry.js +2 -2
- package/dist/cjs/cpsl-info-box.cjs.entry.js.map +1 -1
- package/dist/cjs/cpsl-modal-v2.cjs.entry.js +1 -1
- package/dist/cjs/cpsl-modal-v2.cjs.entry.js.map +1 -1
- package/dist/cjs/cpsl-row.cjs.entry.js +1 -1
- package/dist/cjs/index-65f57499.js +2 -2
- package/dist/cjs/index.cjs.js +40 -17
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/assets/icons/arrow-circle-broken-down-left.svg +3 -0
- package/dist/collection/assets/icons/bank.svg +3 -0
- package/dist/collection/assets/icons/credit-card.svg +3 -0
- package/dist/collection/assets/icons/dot.svg +3 -0
- package/dist/collection/assets/icons/download.svg +3 -0
- package/dist/collection/assets/icons/globe.svg +3 -0
- package/dist/collection/assets/icons/hero-alert-circle.svg +3 -0
- package/dist/collection/assets/icons/hero-checkmark-capsule.svg +11 -0
- package/dist/collection/assets/icons/hero-checkmark.svg +3 -0
- package/dist/collection/assets/icons/hero-external-connection.svg +71 -0
- package/dist/collection/assets/icons/index.js +21 -1
- package/dist/collection/assets/icons/index.js.map +1 -1
- package/dist/collection/assets/icons/link-external.svg +3 -0
- package/dist/collection/assets/icons/log-out.svg +3 -0
- package/dist/collection/assets/icons/moonpay-brand.svg +10 -0
- package/dist/collection/assets/icons/puzzle-piece.svg +3 -0
- package/dist/collection/assets/icons/qr-code-02.svg +3 -0
- package/dist/collection/assets/icons/qr-code.svg +3 -0
- package/dist/collection/assets/icons/refresh.svg +3 -3
- package/dist/collection/assets/icons/search.svg +3 -0
- package/dist/collection/assets/icons/send.svg +3 -0
- package/dist/collection/assets/icons/shield.svg +3 -0
- package/dist/collection/assets/icons/stripe-brand.svg +3 -0
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/cpsl-alert/cpsl-alert.js +3 -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-app-bar/cpsl-app-bar.js.map +1 -1
- package/dist/collection/components/{cpsl-modal/cpsl-modal.css → cpsl-auth-modal/cpsl-auth-modal.css} +33 -58
- package/dist/collection/components/{cpsl-modal/cpsl-modal.js → cpsl-auth-modal/cpsl-auth-modal.js} +13 -131
- package/dist/collection/components/cpsl-auth-modal/cpsl-auth-modal.js.map +1 -0
- package/dist/collection/components/cpsl-button/cpsl-button.css +89 -2
- package/dist/collection/components/cpsl-button/cpsl-button.js +6 -5
- package/dist/collection/components/cpsl-button/cpsl-button.js.map +1 -1
- package/dist/collection/components/cpsl-button/cpsl-button.stories.js.map +1 -1
- package/dist/collection/components/cpsl-button-group/cpsl-button-group.js +2 -2
- package/dist/collection/components/cpsl-button-group/cpsl-button-group.js.map +1 -1
- package/dist/collection/components/cpsl-card/cpsl-card.css +5 -2
- package/dist/collection/components/cpsl-code-input/cpsl-code-input.css +3 -0
- package/dist/collection/components/cpsl-code-input/cpsl-code-input.js +11 -7
- package/dist/collection/components/cpsl-code-input/cpsl-code-input.js.map +1 -1
- package/dist/collection/components/cpsl-divider/cpsl-divider.css +2 -1
- package/dist/collection/components/cpsl-drawer/cpsl-drawer.js +2 -2
- package/dist/collection/components/cpsl-drawer/cpsl-drawer.js.map +1 -1
- package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js +2 -2
- package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js.map +1 -1
- package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js +5 -10
- package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js.map +1 -1
- package/dist/collection/components/cpsl-hero/cpsl-hero.css +136 -71
- package/dist/collection/components/cpsl-hero/cpsl-hero.js +63 -9
- package/dist/collection/components/cpsl-hero/cpsl-hero.js.map +1 -1
- package/dist/collection/components/cpsl-icon/cpsl-icon.css +8 -0
- package/dist/collection/components/cpsl-icon/cpsl-icon.js +2 -2
- package/dist/collection/components/cpsl-icon/cpsl-icon.js.map +1 -1
- package/dist/collection/components/cpsl-icon-group/cpsl-icon-group.css +97 -0
- package/dist/collection/components/cpsl-icon-group/cpsl-icon-group.js +121 -0
- package/dist/collection/components/cpsl-icon-group/cpsl-icon-group.js.map +1 -0
- package/dist/collection/components/cpsl-identicon/cpsl-identicon.js +1 -1
- package/dist/collection/components/cpsl-info-box/cpsl-info-box.css +1 -2
- package/dist/collection/components/cpsl-info-box/cpsl-info-box.js +1 -1
- package/dist/collection/components/cpsl-input/cpsl-input.css +21 -2
- package/dist/collection/components/cpsl-input/cpsl-input.js +100 -28
- 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-modal-v2/cpsl-modal-v2.js.map +1 -1
- package/dist/collection/components/cpsl-nav-button-group/cpsl-nav-button-group.js +2 -2
- package/dist/collection/components/cpsl-nav-button-group/cpsl-nav-button-group.js.map +1 -1
- package/dist/collection/components/cpsl-overlay/cpsl-overlay.js +1 -1
- package/dist/collection/components/cpsl-overlay/cpsl-overlay.js.map +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.css +2 -0
- package/dist/collection/components/cpsl-popover/cpsl-popover.js +12 -14
- package/dist/collection/components/cpsl-popover/cpsl-popover.js.map +1 -1
- package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.css +12 -3
- package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js +28 -23
- package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js.map +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 +17 -0
- package/dist/collection/components/cpsl-select/cpsl-select.js +96 -6
- 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-select-item/cpsl-select-item.js.map +1 -1
- package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js +3 -3
- package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js.map +1 -1
- package/dist/collection/components/cpsl-spinner/cpsl-spinner.css +30 -8
- package/dist/collection/components/cpsl-spinner/cpsl-spinner.js +5 -7
- package/dist/collection/components/cpsl-spinner/cpsl-spinner.js.map +1 -1
- package/dist/collection/components/cpsl-switch/cpsl-switch.js +1 -1
- package/dist/collection/components/cpsl-tab/cpsl-tab.css +24 -1
- package/dist/collection/components/cpsl-tab/cpsl-tab.js +1 -1
- package/dist/collection/components/cpsl-tab/cpsl-tab.js.map +1 -1
- package/dist/collection/components/cpsl-table/cpsl-table.js +1 -9
- package/dist/collection/components/cpsl-table/cpsl-table.js.map +1 -1
- package/dist/collection/components/cpsl-tabs/cpsl-tabs.css +1 -4
- package/dist/collection/components/cpsl-tabs/cpsl-tabs.js +2 -5
- package/dist/collection/components/cpsl-tabs/cpsl-tabs.js.map +1 -1
- package/dist/collection/components/cpsl-text/cpsl-text.css +19 -0
- package/dist/collection/components/cpsl-text/cpsl-text.js +5 -4
- package/dist/collection/components/cpsl-text/cpsl-text.js.map +1 -1
- package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.css +3 -1
- package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.js +2 -2
- package/dist/collection/interface.js.map +1 -1
- package/dist/collection/utils/theme/generateBorderRadii.js +5 -4
- package/dist/collection/utils/theme/generateBorderRadii.js.map +1 -1
- package/dist/collection/utils/theme/generateFont.js +1 -1
- package/dist/collection/utils/theme/generateFont.js.map +1 -1
- package/dist/collection/utils/theme/generatePalette.js +25 -9
- package/dist/collection/utils/theme/generatePalette.js.map +1 -1
- package/dist/collection/utils/theme/generateTheme.js +9 -3
- package/dist/collection/utils/theme/generateTheme.js.map +1 -1
- package/dist/collection/utils/theme/utils.js.map +1 -1
- package/dist/esm/capsule.js +1 -1
- package/dist/esm/{cpsl-alert_33.entry.js → cpsl-alert_34.entry.js} +17026 -13460
- package/dist/esm/cpsl-alert_34.entry.js.map +1 -0
- package/dist/esm/cpsl-animation.entry.js +2 -1
- package/dist/esm/cpsl-animation.entry.js.map +1 -1
- package/dist/esm/cpsl-hero.entry.js +10 -7
- package/dist/esm/cpsl-hero.entry.js.map +1 -1
- package/dist/esm/cpsl-identicon.entry.js +1 -1
- package/dist/esm/cpsl-info-box.entry.js +2 -2
- package/dist/esm/cpsl-info-box.entry.js.map +1 -1
- package/dist/esm/cpsl-modal-v2.entry.js +1 -1
- package/dist/esm/cpsl-modal-v2.entry.js.map +1 -1
- package/dist/esm/cpsl-row.entry.js +1 -1
- package/dist/esm/index-91db3414.js +2 -2
- package/dist/esm/index.js +40 -17
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/assets/icons/index.d.ts +20 -0
- package/dist/types/components/{cpsl-modal/cpsl-modal.d.ts → cpsl-auth-modal/cpsl-auth-modal.d.ts} +3 -23
- package/dist/types/components/cpsl-button/cpsl-button.d.ts +2 -2
- package/dist/types/components/cpsl-hero/cpsl-hero.d.ts +18 -3
- package/dist/types/components/cpsl-icon-group/cpsl-icon-group.d.ts +20 -0
- package/dist/types/components/cpsl-input/cpsl-input.d.ts +13 -3
- package/dist/types/components/cpsl-popover/cpsl-popover.d.ts +2 -2
- package/dist/types/components/cpsl-qr-code/cpsl-qr-code.d.ts +1 -0
- package/dist/types/components/cpsl-select/cpsl-select.d.ts +22 -1
- package/dist/types/components/cpsl-text/cpsl-text.d.ts +1 -1
- package/dist/types/components.d.ts +222 -146
- package/dist/types/interface.d.ts +13 -0
- package/dist/types/utils/theme/generateBorderRadii.d.ts +1 -1
- package/dist/types/utils/theme/generatePalette.d.ts +4 -2
- package/dist/types/utils/theme/generateTheme.d.ts +1 -1
- package/package.json +4 -3
- package/dist/capsule/p-0462f723.js +0 -2
- package/dist/capsule/p-0462f723.js.map +0 -1
- package/dist/capsule/p-05cb769b.entry.js +0 -10
- package/dist/capsule/p-0eea90f8.entry.js +0 -2
- package/dist/capsule/p-7233228e.entry.js +0 -29
- package/dist/capsule/p-7233228e.entry.js.map +0 -1
- package/dist/capsule/p-c1aa1ffb.entry.js +0 -2
- package/dist/capsule/p-d351f076.entry.js +0 -2
- package/dist/capsule/p-d351f076.entry.js.map +0 -1
- package/dist/capsule/p-dc4591d5.entry.js.map +0 -1
- package/dist/cjs/_commonjsHelpers-b3309d7b.js +0 -12
- package/dist/cjs/_commonjsHelpers-b3309d7b.js.map +0 -1
- package/dist/cjs/cpsl-alert_33.cjs.entry.js.map +0 -1
- package/dist/collection/components/cpsl-modal/cpsl-modal.js.map +0 -1
- package/dist/esm/_commonjsHelpers-1789f0cf.js +0 -9
- package/dist/esm/_commonjsHelpers-1789f0cf.js.map +0 -1
- package/dist/esm/cpsl-alert_33.entry.js.map +0 -1
- /package/dist/capsule/{p-0eea90f8.entry.js.map → p-3b042fd1.entry.js.map} +0 -0
- /package/dist/capsule/{p-742bda0b.entry.js.map → p-5d62e610.entry.js.map} +0 -0
@@ -31,7 +31,7 @@ export class CpslText {
|
|
31
31
|
}
|
32
32
|
}
|
33
33
|
render() {
|
34
|
-
return (h(Host, { key: '
|
34
|
+
return (h(Host, { key: '58ac805e3be6c30296e97704f46b34b1201b01a0', class: {
|
35
35
|
// COLORS
|
36
36
|
'primary': this.color === 'primary',
|
37
37
|
'secondary': this.color === 'secondary',
|
@@ -39,6 +39,7 @@ export class CpslText {
|
|
39
39
|
'subtle': this.color === 'subtle',
|
40
40
|
'inverted': this.color === 'inverted',
|
41
41
|
'error': this.color === 'error',
|
42
|
+
'contrast': this.color === 'contrast',
|
42
43
|
// WEIGHTS
|
43
44
|
'medium': this.weight === 'medium',
|
44
45
|
'semi-bold': this.weight === 'semiBold',
|
@@ -76,8 +77,8 @@ export class CpslText {
|
|
76
77
|
"type": "string",
|
77
78
|
"mutable": false,
|
78
79
|
"complexType": {
|
79
|
-
"original": "'primary' | 'secondary' | 'tertiary' | 'subtle' | 'inverted' | 'error'",
|
80
|
-
"resolved": "\"error\" | \"inverted\" | \"primary\" | \"secondary\" | \"subtle\" | \"tertiary\"",
|
80
|
+
"original": "'primary' | 'secondary' | 'tertiary' | 'subtle' | 'inverted' | 'error' | 'contrast'",
|
81
|
+
"resolved": "\"contrast\" | \"error\" | \"inverted\" | \"primary\" | \"secondary\" | \"subtle\" | \"tertiary\"",
|
81
82
|
"references": {}
|
82
83
|
},
|
83
84
|
"required": false,
|
@@ -94,7 +95,7 @@ export class CpslText {
|
|
94
95
|
"type": "string",
|
95
96
|
"mutable": false,
|
96
97
|
"complexType": {
|
97
|
-
"original": "
|
98
|
+
"original": "'body2XS' | 'bodyXS' | 'bodyS' | 'bodyM' | 'bodyL' | 'bodyXL' | 'headingXS' | 'headingS' | 'headingM' | 'headingL' | 'headingXL' | 'heading2XL'",
|
98
99
|
"resolved": "\"body2XS\" | \"bodyL\" | \"bodyM\" | \"bodyS\" | \"bodyXL\" | \"bodyXS\" | \"heading2XL\" | \"headingL\" | \"headingM\" | \"headingS\" | \"headingXL\" | \"headingXS\"",
|
99
100
|
"references": {}
|
100
101
|
},
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cpsl-text.js","sourceRoot":"","sources":["../../../../src/components/cpsl-text/cpsl-text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOzD,MAAM,OAAO,QAAQ;;
|
1
|
+
{"version":3,"file":"cpsl-text.js","sourceRoot":"","sources":["../../../../src/components/cpsl-text/cpsl-text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOzD,MAAM,OAAO,QAAQ;;qBAMmF,SAAS;uBAOqD,OAAO;sBAO7G,SAAS;;IAEvE,IAAY,OAAO;QACjB,QAAQ,IAAI,CAAC,OAAO,EAAE,CAAC;YACrB,KAAK,WAAW,CAAC,CAAC,CAAC;gBACjB,OAAO,CACL;oBAC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OAAO,KAAK,SAAS;gBACtC,SAAS,EAAE,IAAI,CAAC,OAAO,KAAK,QAAQ;gBACpC,QAAQ,EAAE,IAAI,CAAC,OAAO,KAAK,OAAO;gBAClC,QAAQ,EAAE,IAAI,CAAC,OAAO,KAAK,OAAO;gBAClC,QAAQ,EAAE,IAAI,CAAC,OAAO,KAAK,OAAO;gBAClC,SAAS,EAAE,IAAI,CAAC,OAAO,KAAK,QAAQ;gBACpC,YAAY,EAAE,IAAI,CAAC,OAAO,KAAK,WAAW;gBAC1C,WAAW,EAAE,IAAI,CAAC,OAAO,KAAK,UAAU;gBACxC,WAAW,EAAE,IAAI,CAAC,OAAO,KAAK,UAAU;gBACxC,WAAW,EAAE,IAAI,CAAC,OAAO,KAAK,UAAU;gBACxC,YAAY,EAAE,IAAI,CAAC,OAAO,KAAK,WAAW;gBAC1C,aAAa,EAAE,IAAI,CAAC,OAAO,KAAK,YAAY;aAC7C,IAEA,IAAI,CAAC,OAAO,CACR,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-text',\n styleUrl: 'cpsl-text.scss',\n shadow: true,\n})\nexport class CpslText {\n /**\n * The color of text.\n * Options are: `\"primary\"`, `\"secondary\", `\"tertiary\", `\"subtle\", `\"inverted\", `\"error\".\n * Default is: `\"primary\"`.\n */\n @Prop() color?: 'primary' | 'secondary' | 'tertiary' | 'subtle' | 'inverted' | 'error' | 'contrast' = 'primary';\n\n /**\n * The variant of text.\n * Options are: `\"body2XS\"`, `\"bodyXS\", `\"bodyS\", `\"bodyM\", `\"bodyL\", `\"bodyXL\", `\"headingXS\", `\"headingS\", `\"headingM\", `\"headingL\", `\"headingXL\", `\"heading2XL\".\n * Default is: `\"bodyM\"`.\n */\n @Prop() variant?: 'body2XS' | 'bodyXS' | 'bodyS' | 'bodyM' | 'bodyL' | 'bodyXL' | 'headingXS' | 'headingS' | 'headingM' | 'headingL' | 'headingXL' | 'heading2XL' = 'bodyM';\n\n /**\n * The weight of text.\n * Options are: `\"regular\"`, `\"medium\", `\"semiBold\", `\"bold\".\n * Default is: `\"regular\"`.\n */\n @Prop() weight?: 'regular' | 'medium' | 'semiBold' | 'bold' = 'regular';\n\n private get Content() {\n switch (this.variant) {\n case 'headingXS': {\n return (\n <h6>\n <slot></slot>\n </h6>\n );\n }\n case 'headingS': {\n return (\n <h5>\n <slot></slot>\n </h5>\n );\n }\n case 'headingM': {\n return (\n <h4>\n <slot></slot>\n </h4>\n );\n }\n case 'headingL': {\n return (\n <h3>\n <slot></slot>\n </h3>\n );\n }\n case 'headingXL': {\n return (\n <h2>\n <slot></slot>\n </h2>\n );\n }\n case 'heading2XL': {\n return (\n <h1>\n <slot></slot>\n </h1>\n );\n }\n default: {\n return (\n <p>\n <slot></slot>\n </p>\n );\n }\n }\n }\n\n render() {\n return (\n <Host\n class={{\n // COLORS\n 'primary': this.color === 'primary',\n 'secondary': this.color === 'secondary',\n 'tertiary': this.color === 'tertiary',\n 'subtle': this.color === 'subtle',\n 'inverted': this.color === 'inverted',\n 'error': this.color === 'error',\n 'contrast': this.color === 'contrast',\n // WEIGHTS\n 'medium': this.weight === 'medium',\n 'semi-bold': this.weight === 'semiBold',\n 'bold': this.weight === 'bold',\n // SIZES\n 'body-2xs': this.variant === 'body2XS',\n 'body-xs': this.variant === 'bodyXS',\n 'body-s': this.variant === 'bodyS',\n 'body-m': this.variant === 'bodyM',\n 'body-l': this.variant === 'bodyL',\n 'body-xl': this.variant === 'bodyXL',\n 'heading-xs': this.variant === 'headingXS',\n 'heading-s': this.variant === 'headingS',\n 'heading-m': this.variant === 'headingM',\n 'heading-l': this.variant === 'headingL',\n 'heading-xl': this.variant === 'headingXL',\n 'heading-2xl': this.variant === 'heading2XL',\n }}\n >\n {this.Content}\n </Host>\n );\n }\n}\n"]}
|
@@ -60,7 +60,7 @@
|
|
60
60
|
--button-border-color: var(--cpsl-color-tile-button-border);
|
61
61
|
--button-width: 72px;
|
62
62
|
--button-height: 56px;
|
63
|
-
--button-gap:
|
63
|
+
--button-gap: 8px;
|
64
64
|
}
|
65
65
|
|
66
66
|
:host :hover {
|
@@ -93,4 +93,6 @@
|
|
93
93
|
}
|
94
94
|
.button-native cpsl-icon {
|
95
95
|
--icon-color: var(--button-icon-color);
|
96
|
+
--height: var(--button-icon-height);
|
97
|
+
--width: var(--button-icon-width);
|
96
98
|
}
|
@@ -5,7 +5,7 @@ export class CpslTileButton {
|
|
5
5
|
this.icon = undefined;
|
6
6
|
}
|
7
7
|
render() {
|
8
|
-
return (h(Host, { key: '
|
8
|
+
return (h(Host, { key: 'efb0b13e1e196e598d5ed3a7a4ddd90c4886778d' }, h("button", { key: 'bce5128aba915f22fd60af8ffd5dbcaefd0b4253', class: "button-native" }, h("cpsl-icon", { key: 'efdc98a5146432a589355983b2e5098d3d41ec28', exportparts: "icon", src: this.src, icon: this.icon }), h("slot", { key: '6bc4e41a608e42855c48130606c62a2562b9da36' }))));
|
9
9
|
}
|
10
10
|
static get is() { return "cpsl-tile-button"; }
|
11
11
|
static get encapsulation() { return "shadow"; }
|
@@ -43,7 +43,7 @@ export class CpslTileButton {
|
|
43
43
|
"mutable": false,
|
44
44
|
"complexType": {
|
45
45
|
"original": "IconType",
|
46
|
-
"resolved": "\"alertCircle\" | \"angelListBrand\" | \"angelList\" | \"appleBrand\" | \"apple\" | \"arrowNarrow\" | \"arrow\" | \"backupKit\" | \"brush\" | \"capsuleLogo\" | \"capsuleRingsDark\" | \"capsuleRings\" | \"capsule\" | \"checkCircle\" | \"check\" | \"chevronUp\" | \"clock\" | \"close\" | \"clubhouseBrand\" | \"clubhouse\" | \"copy\" | \"cube\" | \"decentBrand\" | \"decent\" | \"discordBrand\" | \"discord\" | \"downloadCloud\" | \"dribbbleBrand\" | \"dribbble\" | \"earth\" | \"eyeOff\" | \"eye\" | \"facebookBrand\" | \"facebook\" | \"farcasterBrand\" | \"farcaster\" | \"figmaBrand\" | \"figma\" | \"file\" | \"githubBrand\" | \"github\" | \"googleBrand\" | \"google\" | \"helpCircle\" | \"heroEmail\" | \"heroLock\" | \"heroPasskey\" | \"heroPhone\" | \"heroWallet\" | \"home\" | \"image\" | \"infoCircle\" | \"instagramBrand\" | \"instagram\" | \"key\" | \"lightning01\" | \"lightning\" | \"linkedinBrand\" | \"linkedin\" | \"mail\" | \"menu\" | \"moreLoginOptions\" | \"phone\" | \"pintrestBrand\" | \"pintrest\" | \"plusCircle\" | \"rampNetworkBrand\" | \"rampNetwork\" | \"redditBrand\" | \"reddit\" | \"refresh\" | \"settings\" | \"signalBrand\" | \"signal\" | \"snapchatBrand\" | \"snapchat\" | \"stars\" | \"telegramBrand\" | \"telegram\" | \"tikTokBrand\" | \"tikTok\" | \"tumblrBrand\" | \"tumblr\" | \"twitterBrand\" | \"twitter\" | \"wallet\" | \"x\" | \"youtubeBrand\" | \"youtube\" | \"AD\" | \"AE\" | \"AF\" | \"AG\" | \"AI\" | \"AL\" | \"AM\" | \"AO\" | \"AR\" | \"AS\" | \"AT\" | \"AU\" | \"AW\" | \"AX\" | \"AZ\" | \"BA\" | \"BB\" | \"BD\" | \"BE\" | \"BF\" | \"BG\" | \"BH\" | \"BI\" | \"BJ\" | \"BL\" | \"BM\" | \"BN\" | \"BO\" | \"BQ\" | \"BQ2\" | \"BQ3\" | \"BR\" | \"BS\" | \"BT\" | \"BW\" | \"BY\" | \"BZ\" | \"CA\" | \"CC\" | \"CD\" | \"CD2\" | \"CF\" | \"CH\" | \"CK\" | \"CL\" | \"CM\" | \"CN\" | \"CO\" | \"CR\" | \"CU\" | \"CW\" | \"CX\" | \"CY\" | \"CZ\" | \"DE\" | \"DJ\" | \"DK\" | \"DM\" | \"DO\" | \"DS\" | \"DZ\" | \"EC\" | \"EE\" | \"EG\" | \"EH\" | \"ER\" | \"ES\" | \"ET\" | \"FI\" | \"FJ\" | \"FK\" | \"FM\" | \"FO\" | \"FR\" | \"GA\" | \"GB2\" | \"GB\" | \"GD\" | \"GE\" | \"GG\" | \"GH\" | \"GI\" | \"GL\" | \"GM\" | \"GN\" | \"GQ\" | \"GR\" | \"GT\" | \"GU\" | \"GW\" | \"GY\" | \"HK\" | \"HN\" | \"HR\" | \"HT\" | \"HU\" | \"ID\" | \"IE\" | \"IL\" | \"IM\" | \"IN\" | \"IO\" | \"IQ\" | \"IR\" | \"IS\" | \"IT\" | \"JE\" | \"JM\" | \"JO\" | \"JP\" | \"KE\" | \"KG\" | \"KH\" | \"KI\" | \"KM\" | \"KN\" | \"KP\" | \"KR\" | \"KW\" | \"KY\" | \"KZ\" | \"LA\" | \"LB\" | \"LC\" | \"LI\" | \"LK\" | \"LR\" | \"LS\" | \"LT\" | \"LU\" | \"LV\" | \"LY\" | \"MA\" | \"MC\" | \"MD\" | \"ME\" | \"MG\" | \"MH\" | \"MK\" | \"ML\" | \"MM\" | \"MN\" | \"MO\" | \"MP\" | \"MQ\" | \"MR\" | \"MS\" | \"MT\" | \"MU\" | \"MV\" | \"MW\" | \"MX\" | \"MY\" | \"MZ\" | \"NA\" | \"NE\" | \"NF\" | \"NG\" | \"NI\" | \"NL\" | \"NO\" | \"NP\" | \"NR\" | \"NU\" | \"NZ\" | \"OM\" | \"PA\" | \"PE\" | \"PF\" | \"PG\" | \"PH\" | \"PK\" | \"PL\" | \"PN\" | \"PR\" | \"PS\" | \"PT\" | \"PW\" | \"PY\" | \"QA\" | \"RO\" | \"RS\" | \"RU\" | \"RW\" | \"SA\" | \"SB\" | \"SC\" | \"SE\" | \"SG\" | \"SI\" | \"SK\" | \"SL\" | \"SM\" | \"SN\" | \"SO\" | \"SR\" | \"SS\" | \"ST\" | \"SV\" | \"SX\" | \"SY\" | \"SZ\" | \"TC\" | \"TD\" | \"TG\" | \"TH\" | \"TJ\" | \"TK\" | \"TL\" | \"TM\" | \"TN\" | \"TO\" | \"TR\" | \"TT\" | \"TV\" | \"TW\" | \"TZ\" | \"UA\" | \"UG\" | \"US\" | \"UY\" | \"UZ\" | \"VC\" | \"VE\" | \"VG\" | \"VI\" | \"VN\" | \"VU\" | \"WS\" | \"YE\" | \"ZA\" | \"ZM\" | \"ZW\"",
|
46
|
+
"resolved": "\"search\" | \"alertCircle\" | \"angelListBrand\" | \"angelList\" | \"appleBrand\" | \"apple\" | \"arrowCircleBrokenDownLeft\" | \"arrowNarrow\" | \"arrow\" | \"backupKit\" | \"bank\" | \"brush\" | \"capsuleLogo\" | \"capsuleRingsDark\" | \"capsuleRings\" | \"capsule\" | \"checkCircle\" | \"check\" | \"chevronUp\" | \"clock\" | \"close\" | \"clubhouseBrand\" | \"clubhouse\" | \"copy\" | \"creditCard\" | \"cube\" | \"decentBrand\" | \"decent\" | \"discordBrand\" | \"discord\" | \"dot\" | \"downloadCloud\" | \"download\" | \"dribbbleBrand\" | \"dribbble\" | \"earth\" | \"eyeOff\" | \"eye\" | \"facebookBrand\" | \"facebook\" | \"farcasterBrand\" | \"farcaster\" | \"figmaBrand\" | \"figma\" | \"file\" | \"githubBrand\" | \"github\" | \"globe\" | \"googleBrand\" | \"google\" | \"helpCircle\" | \"heroAlertCircle\" | \"heroCheckmarkCapsule\" | \"heroCheckmark\" | \"heroEmail\" | \"heroExternalConnection\" | \"heroLock\" | \"heroPasskey\" | \"heroPhone\" | \"heroWallet\" | \"home\" | \"image\" | \"infoCircle\" | \"instagramBrand\" | \"instagram\" | \"key\" | \"lightning01\" | \"lightning\" | \"linkExternal\" | \"linkedinBrand\" | \"linkedin\" | \"logOut\" | \"mail\" | \"menu\" | \"moonpayBrand\" | \"moreLoginOptions\" | \"phone\" | \"pintrestBrand\" | \"pintrest\" | \"plusCircle\" | \"puzzlePiece\" | \"qrCode02\" | \"qrCode\" | \"rampNetworkBrand\" | \"rampNetwork\" | \"redditBrand\" | \"reddit\" | \"refresh\" | \"send\" | \"settings\" | \"shield\" | \"signalBrand\" | \"signal\" | \"snapchatBrand\" | \"snapchat\" | \"stars\" | \"stripeBrand\" | \"telegramBrand\" | \"telegram\" | \"tikTokBrand\" | \"tikTok\" | \"tumblrBrand\" | \"tumblr\" | \"twitterBrand\" | \"twitter\" | \"wallet\" | \"x\" | \"youtubeBrand\" | \"youtube\" | \"AD\" | \"AE\" | \"AF\" | \"AG\" | \"AI\" | \"AL\" | \"AM\" | \"AO\" | \"AR\" | \"AS\" | \"AT\" | \"AU\" | \"AW\" | \"AX\" | \"AZ\" | \"BA\" | \"BB\" | \"BD\" | \"BE\" | \"BF\" | \"BG\" | \"BH\" | \"BI\" | \"BJ\" | \"BL\" | \"BM\" | \"BN\" | \"BO\" | \"BQ\" | \"BQ2\" | \"BQ3\" | \"BR\" | \"BS\" | \"BT\" | \"BW\" | \"BY\" | \"BZ\" | \"CA\" | \"CC\" | \"CD\" | \"CD2\" | \"CF\" | \"CH\" | \"CK\" | \"CL\" | \"CM\" | \"CN\" | \"CO\" | \"CR\" | \"CU\" | \"CW\" | \"CX\" | \"CY\" | \"CZ\" | \"DE\" | \"DJ\" | \"DK\" | \"DM\" | \"DO\" | \"DS\" | \"DZ\" | \"EC\" | \"EE\" | \"EG\" | \"EH\" | \"ER\" | \"ES\" | \"ET\" | \"FI\" | \"FJ\" | \"FK\" | \"FM\" | \"FO\" | \"FR\" | \"GA\" | \"GB2\" | \"GB\" | \"GD\" | \"GE\" | \"GG\" | \"GH\" | \"GI\" | \"GL\" | \"GM\" | \"GN\" | \"GQ\" | \"GR\" | \"GT\" | \"GU\" | \"GW\" | \"GY\" | \"HK\" | \"HN\" | \"HR\" | \"HT\" | \"HU\" | \"ID\" | \"IE\" | \"IL\" | \"IM\" | \"IN\" | \"IO\" | \"IQ\" | \"IR\" | \"IS\" | \"IT\" | \"JE\" | \"JM\" | \"JO\" | \"JP\" | \"KE\" | \"KG\" | \"KH\" | \"KI\" | \"KM\" | \"KN\" | \"KP\" | \"KR\" | \"KW\" | \"KY\" | \"KZ\" | \"LA\" | \"LB\" | \"LC\" | \"LI\" | \"LK\" | \"LR\" | \"LS\" | \"LT\" | \"LU\" | \"LV\" | \"LY\" | \"MA\" | \"MC\" | \"MD\" | \"ME\" | \"MG\" | \"MH\" | \"MK\" | \"ML\" | \"MM\" | \"MN\" | \"MO\" | \"MP\" | \"MQ\" | \"MR\" | \"MS\" | \"MT\" | \"MU\" | \"MV\" | \"MW\" | \"MX\" | \"MY\" | \"MZ\" | \"NA\" | \"NE\" | \"NF\" | \"NG\" | \"NI\" | \"NL\" | \"NO\" | \"NP\" | \"NR\" | \"NU\" | \"NZ\" | \"OM\" | \"PA\" | \"PE\" | \"PF\" | \"PG\" | \"PH\" | \"PK\" | \"PL\" | \"PN\" | \"PR\" | \"PS\" | \"PT\" | \"PW\" | \"PY\" | \"QA\" | \"RO\" | \"RS\" | \"RU\" | \"RW\" | \"SA\" | \"SB\" | \"SC\" | \"SE\" | \"SG\" | \"SI\" | \"SK\" | \"SL\" | \"SM\" | \"SN\" | \"SO\" | \"SR\" | \"SS\" | \"ST\" | \"SV\" | \"SX\" | \"SY\" | \"SZ\" | \"TC\" | \"TD\" | \"TG\" | \"TH\" | \"TJ\" | \"TK\" | \"TL\" | \"TM\" | \"TN\" | \"TO\" | \"TR\" | \"TT\" | \"TV\" | \"TW\" | \"TZ\" | \"UA\" | \"UG\" | \"US\" | \"UY\" | \"UZ\" | \"VC\" | \"VE\" | \"VG\" | \"VI\" | \"VN\" | \"VU\" | \"WS\" | \"YE\" | \"ZA\" | \"ZM\" | \"ZW\"",
|
47
47
|
"references": {
|
48
48
|
"IconType": {
|
49
49
|
"location": "import",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/interface.ts"],"names":[],"mappings":"","sourcesContent":["import { Icons } from './assets/icons';\nimport { Images } from './assets/images';\n\nexport type PredefinedColors
|
1
|
+
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/interface.ts"],"names":[],"mappings":"","sourcesContent":["import { Icons } from './assets/icons';\nimport { Images } from './assets/images';\n\nexport type PredefinedColors = 'primary' | 'secondary' | 'tertiary' | 'success' | 'warning' | 'danger' | 'light' | 'medium' | 'dark';\n\n// From: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\nexport type AutocompleteTypes =\n | 'on'\n | 'off'\n | 'name'\n | 'honorific-prefix'\n | 'given-name'\n | 'additional-name'\n | 'family-name'\n | 'honorific-suffix'\n | 'nickname'\n | 'email'\n | 'username'\n | 'new-password'\n | 'current-password'\n | 'one-time-code'\n | 'organization-title'\n | 'organization'\n | 'street-address'\n | 'address-line1'\n | 'address-line2'\n | 'address-line3'\n | 'address-level4'\n | 'address-level3'\n | 'address-level2'\n | 'address-level1'\n | 'country'\n | 'country-name'\n | 'postal-code'\n | 'cc-name'\n | 'cc-given-name'\n | 'cc-additional-name'\n | 'cc-family-name'\n | 'cc-family-name'\n | 'cc-number'\n | 'cc-exp'\n | 'cc-exp-month'\n | 'cc-exp-year'\n | 'cc-csc'\n | 'cc-type'\n | 'transaction-currency'\n | 'transaction-amount'\n | 'language'\n | 'bday'\n | 'bday-day'\n | 'bday-month'\n | 'bday-year'\n | 'sex'\n | 'tel'\n | 'tel-country-code'\n | 'tel-national'\n | 'tel-area-code'\n | 'tel-local'\n | 'tel-extension'\n | 'impp'\n | 'url'\n | 'photo';\n\nexport type TextFieldTypes = 'date' | 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'url' | 'time' | 'week' | 'month' | 'datetime-local';\n\nexport type LiteralUnion<T extends U, U = string> = T | (U & Record<never, never>);\n\nexport type Color = LiteralUnion<PredefinedColors, string>;\n\nexport type CssClassMap = { [className: string]: boolean };\n\nexport type IconType = keyof typeof Icons;\n\nexport type ImageType = keyof typeof Images;\n\nexport type Theme = {\n foregroundColor?: string;\n backgroundColor?: string;\n accentColor?: string;\n darkForegroundColor?: string;\n darkBackgroundColor?: string;\n darkAccentColor?: string;\n mode?: 'light' | 'dark';\n borderRadius?: BorderRadius;\n font?: string;\n customPalette?: CustomPalette;\n customFontSizes?: CustomFontSizes;\n customBorderRadii?: CustomBorderRadii;\n};\n\nexport type BorderRadius = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';\n\nexport interface CustomBorderRadii {\n input?: string;\n select?: string;\n fileSelect?: string;\n alert?: string;\n tabs?: string;\n primaryButton?: string;\n secondaryButton?: string;\n destructiveButton?: string;\n tileButton?: string;\n modal?: string;\n pill?: string;\n qrCode?: string;\n infoBox?: string;\n tableContainer?: string;\n switch?: string;\n checkbox?: string;\n radio?: string;\n avatar?: string;\n card?: string;\n buttonGroup?: string;\n}\nexport interface CustomFontSizes {\n body2XS?: string;\n bodyXS?: string;\n bodyS?: string;\n bodyM?: string;\n bodyL?: string;\n bodyXL?: string;\n headingXS?: string;\n headingS?: string;\n headingM?: string;\n headingL?: string;\n headingXL?: string;\n heading2XL?: string;\n}\n\nexport interface CustomPalette {\n text?: {\n primary?: string;\n secondary?: string;\n subtle?: string;\n inverted?: string;\n error?: string;\n };\n modal?: {\n surface?: {\n main?: string;\n footer?: string;\n };\n border?: string;\n };\n input?: {\n surface?: {\n disabled?: string;\n default?: string;\n hover?: string;\n };\n border?: {\n placeholder?: string;\n active?: string;\n error?: string;\n };\n };\n select?: {\n surface?: {\n disabled?: string;\n default?: string;\n hover?: string;\n };\n border?: {\n placeholder?: string;\n active?: string;\n error?: string;\n };\n dropdown?: {\n border?: string;\n };\n };\n file?: {\n surface?: {\n disabled?: string;\n default?: string;\n drag?: string;\n };\n border?: {\n placeholder?: string;\n error?: string;\n };\n };\n tileButton?: {\n surface?: {\n default?: string;\n hover?: string;\n pressed?: string;\n };\n border?: string;\n };\n primaryButton?: {\n surface?: {\n default?: string;\n hover?: string;\n pressed?: string;\n disabled?: string;\n };\n border?: {\n default?: string;\n disabled?: string;\n };\n outline?: string;\n };\n secondaryButton?: {\n surface?: {\n default?: string;\n hover?: string;\n pressed?: string;\n disabled?: string;\n };\n border?: {\n default?: string;\n disabled?: string;\n };\n outline?: string;\n };\n destructiveButton?: {\n surface?: {\n default?: string;\n hover?: string;\n pressed?: string;\n disabled?: string;\n };\n border?: {\n default?: string;\n disabled?: string;\n };\n outline?: string;\n };\n divider?: string;\n spinner?: {\n path?: string;\n circle?: string;\n };\n pill?: {\n text?: string;\n container?: {\n background?: string;\n border?: string;\n };\n };\n progressIndicator?: {\n active?: string;\n next?: string;\n previous?: string;\n };\n qr?: {\n fill?: string;\n background?: string;\n border?: string;\n };\n slideButton?: {\n slider?: {\n background?: string;\n border?: string;\n text?: string;\n container?: {\n start?: {\n background?: string;\n border?: string;\n };\n end?: {\n background?: string;\n border?: string;\n };\n };\n };\n start?: {\n text?: string;\n };\n end?: {\n text?: string;\n };\n };\n alert?: {\n surface?: {\n error?: string;\n };\n border?: {\n error?: string;\n };\n };\n switch?: {\n surface?: {\n default?: string;\n checked?: string;\n };\n thumb?: {\n default?: string;\n checked?: string;\n };\n };\n checkbox?: {\n surface?: {\n default?: string;\n checked?: string;\n };\n border?: {\n default?: string;\n checked?: string;\n };\n icon?: string;\n };\n radio?: {\n surface?: {\n default?: string;\n checked?: string;\n };\n border?: {\n default?: string;\n checked?: string;\n };\n };\n card?: {\n surface?: string;\n border?: string;\n };\n iconGroup?: {\n surface?: string;\n border?: string;\n icon?: {\n default?: string;\n disabled?: string;\n };\n };\n}\n\nexport interface InteractionCallback {\n eventName: string;\n callback: (ev: any) => void;\n}\n"]}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { getCssBorderRadii } from "./utils";
|
2
|
-
export const generateBorderRadii = ({ borderRadius, customBorderRadii
|
2
|
+
export const generateBorderRadii = ({ borderRadius, customBorderRadii }) => {
|
3
3
|
let mediumRadius, largeRadius, checkboxRadius = 4;
|
4
4
|
const fullRadius = 1000;
|
5
5
|
let isFull = false;
|
@@ -50,12 +50,13 @@ export const generateBorderRadii = ({ borderRadius, customBorderRadii, }) => {
|
|
50
50
|
document.documentElement.style.setProperty('--cpsl-border-radius-select', `${isFull ? fullRadius : mediumRadius}px`);
|
51
51
|
document.documentElement.style.setProperty('--cpsl-border-radius-file', `${isFull ? fullRadius : mediumRadius}px`);
|
52
52
|
document.documentElement.style.setProperty('--cpsl-border-radius-alert', `${isFull ? fullRadius : mediumRadius}px`);
|
53
|
-
document.documentElement.style.setProperty('--cpsl-border-radius-tabs', `${
|
53
|
+
document.documentElement.style.setProperty('--cpsl-border-radius-tabs', `${isNone ? 0 : fullRadius}px`);
|
54
54
|
document.documentElement.style.setProperty('--cpsl-border-radius-primary-button', `${isFull ? fullRadius : mediumRadius}px`);
|
55
55
|
document.documentElement.style.setProperty('--cpsl-border-radius-secondary-button', `${isFull ? fullRadius : mediumRadius}px`);
|
56
|
+
document.documentElement.style.setProperty('--cpsl-border-radius-tertiary-button', `${isFull ? fullRadius : mediumRadius}px`);
|
56
57
|
document.documentElement.style.setProperty('--cpsl-border-radius-destructive-button', `${isFull ? fullRadius : mediumRadius}px`);
|
57
58
|
document.documentElement.style.setProperty('--cpsl-border-radius-tile-button', `${mediumRadius}px`);
|
58
|
-
document.documentElement.style.setProperty('--cpsl-border-radius-qr-code', `${
|
59
|
+
document.documentElement.style.setProperty('--cpsl-border-radius-qr-code', `${largeRadius}px`);
|
59
60
|
document.documentElement.style.setProperty('--cpsl-border-radius-info-box', `${mediumRadius}px`);
|
60
61
|
document.documentElement.style.setProperty('--cpsl-border-radius-table-container', `${mediumRadius}px`);
|
61
62
|
document.documentElement.style.setProperty('--cpsl-border-radius-avatar', `${mediumRadius}px`);
|
@@ -66,7 +67,7 @@ export const generateBorderRadii = ({ borderRadius, customBorderRadii, }) => {
|
|
66
67
|
document.documentElement.style.setProperty('--cpsl-border-radius-switch', `${isNone ? 0 : fullRadius}px`);
|
67
68
|
document.documentElement.style.setProperty('--cpsl-border-radius-pill', `${isNone ? 0 : fullRadius}px`);
|
68
69
|
document.documentElement.style.setProperty('--cpsl-border-radius-radio', `${fullRadius}px`);
|
69
|
-
if (
|
70
|
+
if (customBorderRadii) {
|
70
71
|
const cssBorderRadiiVars = getCssBorderRadii(customBorderRadii);
|
71
72
|
Object.entries(cssBorderRadiiVars).forEach(([k, v]) => document.documentElement.style.setProperty(k, v));
|
72
73
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"generateBorderRadii.js","sourceRoot":"","sources":["../../../../src/utils/theme/generateBorderRadii.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,
|
1
|
+
{"version":3,"file":"generateBorderRadii.js","sourceRoot":"","sources":["../../../../src/utils/theme/generateBorderRadii.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAAE,YAAY,EAAE,iBAAiB,EAAqD,EAAE,EAAE;IAC5H,IAAI,YAAoB,EACtB,WAAmB,EACnB,cAAc,GAAW,CAAC,CAAC;IAC7B,MAAM,UAAU,GAAG,IAAI,CAAC;IACxB,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,IAAI,MAAM,GAAG,KAAK,CAAC;IAEnB,QAAQ,YAAY,EAAE,CAAC;QACrB,KAAK,MAAM,CAAC,CAAC,CAAC;YACZ,MAAM,GAAG,IAAI,CAAC;YACd,YAAY,GAAG,CAAC,CAAC;YACjB,WAAW,GAAG,CAAC,CAAC;YAChB,cAAc,GAAG,CAAC,CAAC;YACnB,MAAM;QACR,CAAC;QACD,KAAK,IAAI,CAAC,CAAC,CAAC;YACV,YAAY,GAAG,CAAC,CAAC;YACjB,WAAW,GAAG,CAAC,CAAC;YAChB,cAAc,GAAG,CAAC,CAAC;YACnB,MAAM;QACR,CAAC;QACD,KAAK,IAAI,CAAC,CAAC,CAAC;YACV,YAAY,GAAG,CAAC,CAAC;YACjB,WAAW,GAAG,CAAC,CAAC;YAChB,MAAM;QACR,CAAC;QACD,KAAK,IAAI,C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AAC,KAAK,CAAC,WAAW,CAAC,2BAA2B,EAAE,GAAG,WAAW,IAAI,CAAC,CAAC;IAC5F,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CAAC,4BAA4B,EAAE,GAAG,WAAW,IAAI,CAAC,CAAC;IAC7F,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CAAC,+BAA+B,EAAE,GAAG,cAAc,IAAI,CAAC,CAAC;IACnG,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CAAC,6BAA6B,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC;IAC1G,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CAAC,2BAA2B,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC;IACxG,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CAAC,4BAA4B,EAAE,GAAG,UAAU,IAAI,CAAC,CAAC;IAE5F,IAAI,iBAAiB,EAAE,CAAC;QACtB,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;QAChE,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC3G,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { Theme } from '../../interface';\nimport { getCssBorderRadii } from './utils';\n\nexport const generateBorderRadii = ({ borderRadius, customBorderRadii }: Pick<Theme, 'borderRadius' | 'customBorderRadii'>) => {\n let mediumRadius: number,\n largeRadius: number,\n checkboxRadius: number = 4;\n const fullRadius = 1000;\n let isFull = false;\n let isNone = false;\n\n switch (borderRadius) {\n case 'none': {\n isNone = true;\n mediumRadius = 0;\n largeRadius = 0;\n checkboxRadius = 0;\n break;\n }\n case 'xs': {\n mediumRadius = 2;\n largeRadius = 4;\n checkboxRadius = 2;\n break;\n }\n case 'sm': {\n mediumRadius = 4;\n largeRadius = 8;\n break;\n }\n case 'md': {\n mediumRadius = 8;\n largeRadius = 16;\n break;\n }\n case 'xl': {\n mediumRadius = 16;\n largeRadius = 32;\n break;\n }\n case 'full': {\n mediumRadius = 24;\n largeRadius = 32;\n isFull = true;\n break;\n }\n default:\n case 'lg': {\n mediumRadius = 12;\n largeRadius = 24;\n break;\n }\n }\n\n document.documentElement.style.setProperty('--cpsl-border-radius-input', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-select', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-file', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-alert', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-tabs', `${isNone ? 0 : fullRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-primary-button', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-secondary-button', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-tertiary-button', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-destructive-button', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-tile-button', `${mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-qr-code', `${largeRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-info-box', `${mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-table-container', `${mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-avatar', `${mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-button-group', `${mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-card', `${largeRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-modal', `${largeRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-checkbox', `${checkboxRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-switch', `${isNone ? 0 : fullRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-pill', `${isNone ? 0 : fullRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-radio', `${fullRadius}px`);\n\n if (customBorderRadii) {\n const cssBorderRadiiVars = getCssBorderRadii(customBorderRadii);\n Object.entries(cssBorderRadiiVars).forEach(([k, v]) => document.documentElement.style.setProperty(k, v));\n }\n};\n"]}
|
@@ -13,7 +13,7 @@ const FONT_NAME_MAP = {
|
|
13
13
|
heading2XL: 'heading-2xl',
|
14
14
|
};
|
15
15
|
export const generateFont = ({ font, customFontSizes }) => {
|
16
|
-
if (
|
16
|
+
if (font) {
|
17
17
|
document.documentElement.style.setProperty('--cpsl-default-font', font);
|
18
18
|
}
|
19
19
|
Object.entries(FONT_NAME_MAP).forEach(([key, value]) => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"generateFont.js","sourceRoot":"","sources":["../../../../src/utils/theme/generateFont.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GAAG;IACpB,OAAO,EAAE,UAAU;IACnB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,SAAS;IACjB,SAAS,EAAE,YAAY;IACvB,QAAQ,EAAE,WAAW;IACrB,QAAQ,EAAE,WAAW;IACrB,QAAQ,EAAE,WAAW;IACrB,SAAS,EAAE,YAAY;IACvB,UAAU,EAAE,aAAa;CAC1B,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,IAAI,EAAE,eAAe,EAA2C,EAAE,EAAE;IACjG,IAAI,
|
1
|
+
{"version":3,"file":"generateFont.js","sourceRoot":"","sources":["../../../../src/utils/theme/generateFont.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GAAG;IACpB,OAAO,EAAE,UAAU;IACnB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,SAAS;IACjB,SAAS,EAAE,YAAY;IACvB,QAAQ,EAAE,WAAW;IACrB,QAAQ,EAAE,WAAW;IACrB,QAAQ,EAAE,WAAW;IACrB,SAAS,EAAE,YAAY;IACvB,UAAU,EAAE,aAAa;CAC1B,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,IAAI,EAAE,eAAe,EAA2C,EAAE,EAAE;IACjG,IAAI,IAAI,EAAE,CAAC;QACT,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC;IAC1E,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACrD,IAAI,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAG,GAAG,CAAC,EAAE,CAAC;YAC3B,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CAAC,oBAAoB,KAAK,EAAE,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC;QAChG,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,cAAc,CAAC,oBAAoB,KAAK,EAAE,CAAC,CAAC;QAC7E,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { Theme } from '../../interface';\n\nconst FONT_NAME_MAP = {\n body2XS: 'body-2xs',\n bodyXS: 'body-xs',\n bodyS: 'body-s',\n bodyM: 'body-m',\n bodyL: 'body-l',\n bodyXL: 'body-xl',\n headingXS: 'heading-xs',\n headingS: 'heading-s',\n headingM: 'heading-m',\n headingL: 'heading-l',\n headingXL: 'heading-xl',\n heading2XL: 'heading-2xl',\n};\n\nexport const generateFont = ({ font, customFontSizes }: Pick<Theme, 'font' | 'customFontSizes'>) => {\n if (font) {\n document.documentElement.style.setProperty('--cpsl-default-font', font);\n }\n\n Object.entries(FONT_NAME_MAP).forEach(([key, value]) => {\n if (customFontSizes?.[key]) {\n document.documentElement.style.setProperty(`--cpsl-font-size-${value}`, customFontSizes[key]);\n } else {\n document.documentElement.style.removeProperty(`--cpsl-font-size-${value}`);\n }\n });\n};\n"]}
|
@@ -1,24 +1,29 @@
|
|
1
1
|
import { mix, readableColorIsBlack } from "color2k";
|
2
2
|
import { getCssColors, isColor, overlayMix } from "./utils";
|
3
3
|
import { COLOR_MIXES, DEFAULT_THEME, UTILITY_COLORS } from "../../constants";
|
4
|
-
export const generatePalette = ({ foregroundColor, backgroundColor, customPalette, }) => {
|
5
|
-
if (!
|
4
|
+
export const generatePalette = ({ foregroundColor, backgroundColor, accentColor, isDarkTheme, customPalette, }) => {
|
5
|
+
if (!foregroundColor || !isColor(foregroundColor)) {
|
6
6
|
foregroundColor = DEFAULT_THEME.foregroundColor;
|
7
7
|
}
|
8
|
-
if (!
|
8
|
+
if (!backgroundColor || !isColor(backgroundColor)) {
|
9
9
|
backgroundColor = DEFAULT_THEME.backgroundColor;
|
10
10
|
}
|
11
|
-
|
11
|
+
if (!Boolean(accentColor) || !isColor(accentColor)) {
|
12
|
+
accentColor = foregroundColor;
|
13
|
+
}
|
14
|
+
const isDarkAccent = Boolean(accentColor) ? !readableColorIsBlack(accentColor) : false;
|
12
15
|
const palette = {
|
13
16
|
foregroundColors: [],
|
14
17
|
backgroundColors: [],
|
15
|
-
|
18
|
+
accentColors: [],
|
16
19
|
};
|
17
|
-
const backgroundMixColor =
|
18
|
-
const foregroundMixColor =
|
20
|
+
const backgroundMixColor = isDarkTheme ? '#FFFFFF' : '#000000';
|
21
|
+
const foregroundMixColor = isDarkTheme ? '#000000' : '#FFFFFF';
|
22
|
+
const accentMixColor = isDarkAccent ? '#FFFFFF' : '#000000';
|
19
23
|
COLOR_MIXES.forEach(value => {
|
20
24
|
palette.foregroundColors.push(mix(foregroundColor, foregroundMixColor, value));
|
21
25
|
palette.backgroundColors.push(mix(backgroundColor, backgroundMixColor, value));
|
26
|
+
palette.accentColors.push(mix(accentColor, accentMixColor, value));
|
22
27
|
});
|
23
28
|
// BACKGROUND
|
24
29
|
document.documentElement.style.setProperty('--cpsl-color-background-0', palette.backgroundColors[0]);
|
@@ -40,6 +45,18 @@ export const generatePalette = ({ foregroundColor, backgroundColor, customPalett
|
|
40
45
|
document.documentElement.style.setProperty('--cpsl-color-foreground-64', palette.foregroundColors[6]);
|
41
46
|
document.documentElement.style.setProperty('--cpsl-color-foreground-80', palette.foregroundColors[7]);
|
42
47
|
document.documentElement.style.setProperty('--cpsl-color-foreground-96', palette.foregroundColors[8]);
|
48
|
+
// ACCENT
|
49
|
+
document.documentElement.style.setProperty('--cpsl-color-accent-0', palette.accentColors[0]);
|
50
|
+
document.documentElement.style.setProperty('--cpsl-color-accent-4', palette.accentColors[1]);
|
51
|
+
document.documentElement.style.setProperty('--cpsl-color-accent-8', palette.accentColors[2]);
|
52
|
+
document.documentElement.style.setProperty('--cpsl-color-accent-16', palette.accentColors[3]);
|
53
|
+
document.documentElement.style.setProperty('--cpsl-color-accent-32', palette.accentColors[4]);
|
54
|
+
document.documentElement.style.setProperty('--cpsl-color-accent-48', palette.accentColors[5]);
|
55
|
+
document.documentElement.style.setProperty('--cpsl-color-accent-64', palette.accentColors[6]);
|
56
|
+
document.documentElement.style.setProperty('--cpsl-color-accent-80', palette.accentColors[7]);
|
57
|
+
document.documentElement.style.setProperty('--cpsl-color-accent-96', palette.accentColors[8]);
|
58
|
+
// CONTRAST
|
59
|
+
document.documentElement.style.setProperty('--cpsl-color-contrast', isDarkTheme ? '#FFFFFF' : '#000000');
|
43
60
|
const utilityLightMixColor = '#FFFFFF';
|
44
61
|
const utilityLightMixValue = 0.72;
|
45
62
|
// UTILITY
|
@@ -52,10 +69,9 @@ export const generatePalette = ({ foregroundColor, backgroundColor, customPalett
|
|
52
69
|
document.documentElement.style.setProperty('--cpsl-color-utility-red-light', mix(red, utilityLightMixColor, utilityLightMixValue));
|
53
70
|
document.documentElement.style.setProperty('--cpsl-color-utility-yellow-light', mix(yellow, utilityLightMixColor, utilityLightMixValue));
|
54
71
|
document.documentElement.style.setProperty('--cpsl-color-utility-green-light', mix(green, utilityLightMixColor, utilityLightMixValue));
|
55
|
-
if (
|
72
|
+
if (customPalette) {
|
56
73
|
const cssColorVars = getCssColors(customPalette);
|
57
74
|
Object.entries(cssColorVars).forEach(([k, v]) => document.documentElement.style.setProperty(k, v));
|
58
75
|
}
|
59
|
-
return palette;
|
60
76
|
};
|
61
77
|
//# sourceMappingURL=generatePalette.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"generatePalette.js","sourceRoot":"","sources":["../../../../src/utils/theme/generatePalette.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAQ7E,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC9B,eAAe,EACf,eAAe,EACf,aAAa,GACwD,EAAW,EAAE;IAClF,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC;QAC3D,eAAe,GAAG,aAAa,CAAC,eAAe,CAAC;IAClD,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,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ACxC,mCAAmC,EACnC,GAAG,CAAC,MAAM,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,CACxD,CAAC;IACF,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CACxC,kCAAkC,EAClC,GAAG,CAAC,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,CACvD,CAAC;IAEF,IAAI,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;QAC3B,MAAM,YAAY,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;QACjD,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACrG,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["import { mix, readableColorIsBlack } from 'color2k';\nimport { Theme } from '../../interface';\nimport { getCssColors, isColor, overlayMix } from './utils';\nimport { COLOR_MIXES, DEFAULT_THEME, UTILITY_COLORS } from '../../constants';\n\nexport type Palette = {\n foregroundColors: string[];\n backgroundColors: string[];\n isDarkBackground: boolean;\n};\n\nexport const generatePalette = ({\n foregroundColor,\n backgroundColor,\n customPalette,\n}: Pick<Theme, 'foregroundColor' | 'backgroundColor' | 'customPalette'>): Palette => {\n if (!Boolean(foregroundColor) || !isColor(foregroundColor)) {\n foregroundColor = DEFAULT_THEME.foregroundColor;\n }\n if (!Boolean(backgroundColor) || !isColor(backgroundColor)) {\n backgroundColor = DEFAULT_THEME.backgroundColor;\n }\n\n const isDarkBackground = !readableColorIsBlack(backgroundColor);\n\n const palette: Palette = {\n foregroundColors: [],\n backgroundColors: [],\n isDarkBackground,\n };\n\n const backgroundMixColor = isDarkBackground ? '#FFFFFF' : '#000000';\n const foregroundMixColor = isDarkBackground ? '#000000' : '#FFFFFF';\n\n COLOR_MIXES.forEach(value => {\n palette.foregroundColors.push(mix(foregroundColor, foregroundMixColor, value));\n palette.backgroundColors.push(mix(backgroundColor, backgroundMixColor, value));\n });\n\n // BACKGROUND\n document.documentElement.style.setProperty('--cpsl-color-background-0', palette.backgroundColors[0]);\n document.documentElement.style.setProperty('--cpsl-color-background-4', palette.backgroundColors[1]);\n document.documentElement.style.setProperty('--cpsl-color-background-8', palette.backgroundColors[2]);\n document.documentElement.style.setProperty('--cpsl-color-background-16', palette.backgroundColors[3]);\n document.documentElement.style.setProperty('--cpsl-color-background-32', palette.backgroundColors[4]);\n document.documentElement.style.setProperty('--cpsl-color-background-48', palette.backgroundColors[5]);\n document.documentElement.style.setProperty('--cpsl-color-background-64', palette.backgroundColors[6]);\n document.documentElement.style.setProperty('--cpsl-color-background-80', palette.backgroundColors[7]);\n document.documentElement.style.setProperty('--cpsl-color-background-96', palette.backgroundColors[8]);\n\n // FOREGROUND\n document.documentElement.style.setProperty('--cpsl-color-foreground-0', palette.foregroundColors[0]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-4', palette.foregroundColors[1]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-8', palette.foregroundColors[2]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-16', palette.foregroundColors[3]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-32', palette.foregroundColors[4]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-48', palette.foregroundColors[5]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-64', palette.foregroundColors[6]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-80', palette.foregroundColors[7]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-96', palette.foregroundColors[8]);\n\n const utilityLightMixColor = '#FFFFFF';\n const utilityLightMixValue = 0.72;\n // UTILITY\n const red = overlayMix(foregroundColor, UTILITY_COLORS.red);\n const yellow = overlayMix(foregroundColor, UTILITY_COLORS.yellow);\n const green = overlayMix(foregroundColor, UTILITY_COLORS.green);\n document.documentElement.style.setProperty('--cpsl-color-utility-red', red);\n document.documentElement.style.setProperty('--cpsl-color-utility-yellow', yellow);\n document.documentElement.style.setProperty('--cpsl-color-utility-green', green);\n document.documentElement.style.setProperty(\n '--cpsl-color-utility-red-light',\n mix(red, utilityLightMixColor, utilityLightMixValue),\n );\n document.documentElement.style.setProperty(\n '--cpsl-color-utility-yellow-light',\n mix(yellow, utilityLightMixColor, utilityLightMixValue),\n );\n document.documentElement.style.setProperty(\n '--cpsl-color-utility-green-light',\n mix(green, utilityLightMixColor, utilityLightMixValue),\n );\n\n if (Boolean(customPalette)) {\n const cssColorVars = getCssColors(customPalette);\n Object.entries(cssColorVars).forEach(([k, v]) => document.documentElement.style.setProperty(k, v));\n }\n\n return palette;\n};\n"]}
|
1
|
+
{"version":3,"file":"generatePalette.js","sourceRoot":"","sources":["../../../../src/utils/theme/generatePalette.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAQ7E,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC9B,eAAe,EACf,eAAe,EACf,WAAW,EACX,WAAW,EACX,aAAa,GACmG,EAAE,EAAE;IACpH,IAAI,CAAC,eAAe,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC;QAClD,eAAe,GAAG,aAAa,CAAC,eAAe,CAAC;IAClD,CAAC;IACD,IAAI,CAAC,eAAe,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC;QAClD,eAAe,GAAG,aAAa,CAAC,eAAe,CAAC;IAClD,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;QACnD,WAAW,GAAG,e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AChF,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CAAC,gCAAgC,EAAE,GAAG,CAAC,GAAG,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,CAAC,CAAC;IACnI,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CAAC,mCAAmC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,CAAC,CAAC;IACzI,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CAAC,kCAAkC,EAAE,GAAG,CAAC,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,CAAC,CAAC;IAEvI,IAAI,aAAa,EAAE,CAAC;QAClB,MAAM,YAAY,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;QACjD,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACrG,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { mix, readableColorIsBlack } from 'color2k';\nimport { Theme } from '../../interface';\nimport { getCssColors, isColor, overlayMix } from './utils';\nimport { COLOR_MIXES, DEFAULT_THEME, UTILITY_COLORS } from '../../constants';\n\nexport type Palette = {\n foregroundColors: string[];\n backgroundColors: string[];\n accentColors: string[];\n};\n\nexport const generatePalette = ({\n foregroundColor,\n backgroundColor,\n accentColor,\n isDarkTheme,\n customPalette,\n}: Pick<Theme, 'foregroundColor' | 'backgroundColor' | 'accentColor' | 'customPalette'> & { isDarkTheme: boolean }) => {\n if (!foregroundColor || !isColor(foregroundColor)) {\n foregroundColor = DEFAULT_THEME.foregroundColor;\n }\n if (!backgroundColor || !isColor(backgroundColor)) {\n backgroundColor = DEFAULT_THEME.backgroundColor;\n }\n if (!Boolean(accentColor) || !isColor(accentColor)) {\n accentColor = foregroundColor;\n }\n\n const isDarkAccent = Boolean(accentColor) ? !readableColorIsBlack(accentColor) : false;\n\n const palette: Palette = {\n foregroundColors: [],\n backgroundColors: [],\n accentColors: [],\n };\n\n const backgroundMixColor = isDarkTheme ? '#FFFFFF' : '#000000';\n const foregroundMixColor = isDarkTheme ? '#000000' : '#FFFFFF';\n const accentMixColor = isDarkAccent ? '#FFFFFF' : '#000000';\n\n COLOR_MIXES.forEach(value => {\n palette.foregroundColors.push(mix(foregroundColor, foregroundMixColor, value));\n palette.backgroundColors.push(mix(backgroundColor, backgroundMixColor, value));\n palette.accentColors.push(mix(accentColor, accentMixColor, value));\n });\n\n // BACKGROUND\n document.documentElement.style.setProperty('--cpsl-color-background-0', palette.backgroundColors[0]);\n document.documentElement.style.setProperty('--cpsl-color-background-4', palette.backgroundColors[1]);\n document.documentElement.style.setProperty('--cpsl-color-background-8', palette.backgroundColors[2]);\n document.documentElement.style.setProperty('--cpsl-color-background-16', palette.backgroundColors[3]);\n document.documentElement.style.setProperty('--cpsl-color-background-32', palette.backgroundColors[4]);\n document.documentElement.style.setProperty('--cpsl-color-background-48', palette.backgroundColors[5]);\n document.documentElement.style.setProperty('--cpsl-color-background-64', palette.backgroundColors[6]);\n document.documentElement.style.setProperty('--cpsl-color-background-80', palette.backgroundColors[7]);\n document.documentElement.style.setProperty('--cpsl-color-background-96', palette.backgroundColors[8]);\n\n // FOREGROUND\n document.documentElement.style.setProperty('--cpsl-color-foreground-0', palette.foregroundColors[0]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-4', palette.foregroundColors[1]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-8', palette.foregroundColors[2]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-16', palette.foregroundColors[3]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-32', palette.foregroundColors[4]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-48', palette.foregroundColors[5]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-64', palette.foregroundColors[6]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-80', palette.foregroundColors[7]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-96', palette.foregroundColors[8]);\n\n // ACCENT\n document.documentElement.style.setProperty('--cpsl-color-accent-0', palette.accentColors[0]);\n document.documentElement.style.setProperty('--cpsl-color-accent-4', palette.accentColors[1]);\n document.documentElement.style.setProperty('--cpsl-color-accent-8', palette.accentColors[2]);\n document.documentElement.style.setProperty('--cpsl-color-accent-16', palette.accentColors[3]);\n document.documentElement.style.setProperty('--cpsl-color-accent-32', palette.accentColors[4]);\n document.documentElement.style.setProperty('--cpsl-color-accent-48', palette.accentColors[5]);\n document.documentElement.style.setProperty('--cpsl-color-accent-64', palette.accentColors[6]);\n document.documentElement.style.setProperty('--cpsl-color-accent-80', palette.accentColors[7]);\n document.documentElement.style.setProperty('--cpsl-color-accent-96', palette.accentColors[8]);\n\n // CONTRAST\n document.documentElement.style.setProperty('--cpsl-color-contrast', isDarkTheme ? '#FFFFFF' : '#000000');\n\n const utilityLightMixColor = '#FFFFFF';\n const utilityLightMixValue = 0.72;\n // UTILITY\n const red = overlayMix(foregroundColor, UTILITY_COLORS.red);\n const yellow = overlayMix(foregroundColor, UTILITY_COLORS.yellow);\n const green = overlayMix(foregroundColor, UTILITY_COLORS.green);\n document.documentElement.style.setProperty('--cpsl-color-utility-red', red);\n document.documentElement.style.setProperty('--cpsl-color-utility-yellow', yellow);\n document.documentElement.style.setProperty('--cpsl-color-utility-green', green);\n document.documentElement.style.setProperty('--cpsl-color-utility-red-light', mix(red, utilityLightMixColor, utilityLightMixValue));\n document.documentElement.style.setProperty('--cpsl-color-utility-yellow-light', mix(yellow, utilityLightMixColor, utilityLightMixValue));\n document.documentElement.style.setProperty('--cpsl-color-utility-green-light', mix(green, utilityLightMixColor, utilityLightMixValue));\n\n if (customPalette) {\n const cssColorVars = getCssColors(customPalette);\n Object.entries(cssColorVars).forEach(([k, v]) => document.documentElement.style.setProperty(k, v));\n }\n};\n"]}
|
@@ -6,10 +6,16 @@ import { generatePalette } from "./generatePalette";
|
|
6
6
|
* Generates css theme variables.
|
7
7
|
* @returns @boolean Whether background is dark or not.
|
8
8
|
*/
|
9
|
-
export const generateTheme = ({ foregroundColor = DEFAULT_THEME.foregroundColor, backgroundColor = DEFAULT_THEME.backgroundColor, font, customPalette, borderRadius, customFontSizes, customBorderRadii, }) => {
|
10
|
-
const
|
9
|
+
export const generateTheme = ({ foregroundColor = DEFAULT_THEME.foregroundColor, backgroundColor = DEFAULT_THEME.backgroundColor, accentColor, darkForegroundColor, darkBackgroundColor, darkAccentColor, mode = 'light', font, customPalette, borderRadius, customFontSizes, customBorderRadii, }) => {
|
10
|
+
const isDarkTheme = mode === 'dark';
|
11
|
+
generatePalette({
|
12
|
+
foregroundColor: isDarkTheme ? (darkForegroundColor !== null && darkForegroundColor !== void 0 ? darkForegroundColor : foregroundColor) : foregroundColor,
|
13
|
+
backgroundColor: isDarkTheme ? (darkBackgroundColor !== null && darkBackgroundColor !== void 0 ? darkBackgroundColor : backgroundColor) : backgroundColor,
|
14
|
+
accentColor: isDarkTheme ? (darkAccentColor !== null && darkAccentColor !== void 0 ? darkAccentColor : accentColor) : accentColor,
|
15
|
+
customPalette,
|
16
|
+
isDarkTheme,
|
17
|
+
});
|
11
18
|
generateFont({ font, customFontSizes });
|
12
19
|
generateBorderRadii({ borderRadius, customBorderRadii });
|
13
|
-
return palette.isDarkBackground;
|
14
20
|
};
|
15
21
|
//# sourceMappingURL=generateTheme.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"generateTheme.js","sourceRoot":"","sources":["../../../../src/utils/theme/generateTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EA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,CAAC,WAAW;QACzE,aAAa;QACb,WAAW;KACZ,CAAC,CAAC;IAEH,YAAY,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC;IAExC,mBAAmB,CAAC,EAAE,YAAY,EAAE,iBAAiB,EAAE,CAAC,CAAC;AAC3D,CAAC,CAAC","sourcesContent":["import { DEFAULT_THEME } from '../../constants';\nimport { Theme } from '../../interface';\nimport { generateBorderRadii } from './generateBorderRadii';\nimport { generateFont } from './generateFont';\nimport { generatePalette } from './generatePalette';\n\n/**\n * Generates css theme variables.\n * @returns @boolean Whether background is dark or not.\n */\nexport const generateTheme = ({\n foregroundColor = DEFAULT_THEME.foregroundColor,\n backgroundColor = DEFAULT_THEME.backgroundColor,\n accentColor,\n darkForegroundColor,\n darkBackgroundColor,\n darkAccentColor,\n mode = 'light',\n font,\n customPalette,\n borderRadius,\n customFontSizes,\n customBorderRadii,\n}: Theme) => {\n const isDarkTheme = mode === 'dark';\n\n generatePalette({\n foregroundColor: isDarkTheme ? (darkForegroundColor ?? foregroundColor) : foregroundColor,\n backgroundColor: isDarkTheme ? (darkBackgroundColor ?? backgroundColor) : backgroundColor,\n accentColor: isDarkTheme ? (darkAccentColor ?? accentColor) : accentColor,\n customPalette,\n isDarkTheme,\n });\n\n generateFont({ font, customFontSizes });\n\n generateBorderRadii({ borderRadius, customBorderRadii });\n};\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/utils/theme/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,EAAE;IAChC,MAAM,CAAC,GAAG,IAAI,MAAM,EAAE,CAAC,KAAK,CAAC;IAC7B,CAAC,CAAC,KAAK,GAAG,QAAQ,CAAC;IACnB,OAA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AAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAEtK,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;AAClE,CAAC,CAAC","sourcesContent":["import { parseToRgba, rgba } from 'color2k';\nimport { CustomBorderRadii, CustomPalette } from '../../interface';\nimport { overlay } from 'color-blend';\n\nexport const isColor = strColor => {\n const s = new Option().style;\n s.color = strColor;\n return s.color !== '';\n};\n\nconst toKebabCase = (pascal: string) => pascal.replace(/([a-z0–9])([A-Z])/g, '$1-$2').toLowerCase();\n\n// This function handles arrays and objects\nconst buildVars = (prev: string, obj: any): { [k: string]: string } => {\n let resp = {};\n\n for (const k in obj) {\n const name = `${prev}-${toKebabCase(k)}`;\n if (typeof obj[k] === 'object' && obj[k] !== null) {\n resp = { ...resp, ...buildVars(name, obj[k]) };\n } else {\n resp[name] = obj[k];\n }\n }\n\n return resp;\n};\n\nexport const getCssColors = (customPalette: CustomPalette): { [k: string]: string } => buildVars('--cpsl-color', customPalette);\nexport const getCssBorderRadii = (customBorderRadii: CustomBorderRadii): { [k: string]: string } => buildVars('--cpsl-border-radius', customBorderRadii);\n\nexport const overlayMix = (baseColor: string, overlayColor: string) => {\n const baseRGBA = parseToRgba(baseColor);\n const overlayRGBA = parseToRgba(overlayColor);\n\n const finalRGBA = overlay({ r: baseRGBA[0], g: baseRGBA[1], b: baseRGBA[2], a: 0.1 }, { r: overlayRGBA[0], g: overlayRGBA[1], b: overlayRGBA[2], a: overlayRGBA[3] });\n\n return rgba(finalRGBA.r, finalRGBA.g, finalRGBA.b, finalRGBA.a);\n};\n"]}
|
package/dist/esm/capsule.js
CHANGED
@@ -16,7 +16,7 @@ var patchBrowser = () => {
|
|
16
16
|
|
17
17
|
patchBrowser().then(async (options) => {
|
18
18
|
await globalScripts();
|
19
|
-
return bootstrapLazy([["cpsl-modal-v2",[[1,"cpsl-modal-v2",{"enterTransitionDuration":[2,"enter-transition-duration"],"exitTransitionDuration":[2,"exit-transition-duration"],"elevated":[4],"noOverlay":[4,"no-overlay"],"open":[4],"zIndexOverride":[2,"z-index-override"]},null,{"open":["toggleHeight"]}]]],["cpsl-
|
19
|
+
return bootstrapLazy([["cpsl-hero",[[1,"cpsl-hero",{"height":[2],"hideFadeOut":[4,"hide-fade-out"],"variant":[513],"title":[513],"subtitle":[513],"withDefaultTheme":[4,"with-default-theme"]}]]],["cpsl-modal-v2",[[1,"cpsl-modal-v2",{"enterTransitionDuration":[2,"enter-transition-duration"],"exitTransitionDuration":[2,"exit-transition-duration"],"elevated":[4],"noOverlay":[4,"no-overlay"],"open":[4],"zIndexOverride":[2,"z-index-override"]},null,{"open":["toggleHeight"]}]]],["cpsl-animation",[[1,"cpsl-animation",{"src":[1],"replayAnimation":[64]}]]],["cpsl-col",[[1,"cpsl-col",{"offset":[1],"offsetXs":[1,"offset-xs"],"offsetSm":[1,"offset-sm"],"offsetMd":[1,"offset-md"],"offsetLg":[1,"offset-lg"],"offsetXl":[1,"offset-xl"],"pull":[1],"pullXs":[1,"pull-xs"],"pullSm":[1,"pull-sm"],"pullMd":[1,"pull-md"],"pullLg":[1,"pull-lg"],"pullXl":[1,"pull-xl"],"push":[1],"pushXs":[1,"push-xs"],"pushSm":[1,"push-sm"],"pushMd":[1,"push-md"],"pushLg":[1,"push-lg"],"pushXl":[1,"push-xl"],"size":[1],"sizeXs":[1,"size-xs"],"sizeSm":[1,"size-sm"],"sizeMd":[1,"size-md"],"sizeLg":[1,"size-lg"],"sizeXl":[1,"size-xl"]},[[9,"resize","onResize"]]]]],["cpsl-grid",[[1,"cpsl-grid",{"fixed":[4]}]]],["cpsl-identicon",[[1,"cpsl-identicon",{"hash":[1],"size":[2]}]]],["cpsl-info-box",[[1,"cpsl-info-box"]]],["cpsl-row",[[1,"cpsl-row"]]],["cpsl-alert_34",[[1,"cpsl-pagination",{"initialPage":[2,"initial-page"],"totalPages":[2,"total-pages"],"visiblePages":[1026,"visible-pages"],"currentPage":[32]},null,{"currentPage":["watchChange"]}],[1,"cpsl-select",{"anchorElId":[1,"anchor-el-id"],"autoWidth":[4,"auto-width"],"disabled":[4],"dropdownMaxHeight":[2,"dropdown-max-height"],"errorText":[1,"error-text"],"formatValue":[16],"helperText":[1,"helper-text"],"id":[1],"label":[1],"placeholder":[1],"required":[4],"selectedValue":[1,"selected-value"],"showFormattedSelectedItem":[4,"show-formatted-selected-item"],"showOptionalLabel":[4,"show-optional-label"],"showSearch":[4,"show-search"],"searchPlaceholder":[1,"search-placeholder"],"anchorEl":[32],"hasFocus":[32],"popoverOpen":[32],"hasSelectedItem":[32]},[[0,"cpslSelectItemClick","selectItemClickHandler"],[0,"cpslOpen","onPopoverOpen"],[0,"cpslClose","onPopoverClose"]],{"selectedValue":["onValueChange","handleValueChange"]}],[1,"cpsl-file-upload",{"errorText":[1,"error-text"],"externalFilename":[1,"external-filename"],"externalSrc":[1,"external-src"],"fileTypes":[16],"helperText":[1,"helper-text"],"label":[1],"required":[4],"showOptionalLabel":[4,"show-optional-label"],"uploadFile":[16],"file":[32],"dragOver":[32],"dragError":[32],"isUploading":[32],"uploadError":[32]}],[1,"cpsl-auth-modal",{"enterTransitionDuration":[2,"enter-transition-duration"],"exitTransitionDuration":[2,"exit-transition-duration"],"noOverlay":[4,"no-overlay"],"open":[4],"zIndexOverride":[2,"z-index-override"],"hasFooter":[32],"isMobile":[32]},null,{"open":["toggleModal"]}],[1,"cpsl-alert",{"icon":[1],"variant":[1]}],[1,"cpsl-checkbox",{"checked":[4]}],[1,"cpsl-code-input",{"code":[1025],"errorText":[1,"error-text"],"helperText":[1,"helper-text"],"length":[2],"type":[1]}],[1,"cpsl-drawer",{"anchor":[1],"anchorPosition":[2,"anchor-position"],"noOverlay":[4,"no-overlay"],"open":[4],"size":[8],"transitionDuration":[2,"transition-duration"],"transitionFunction":[1,"transition-function"],"variant":[1],"zIndexOverride":[2,"z-index-override"],"closedAnchorPosition":[32],"showTransition":[32]}],[1,"cpsl-icon-group",{"expandFrom":[1,"expand-from"],"disabled":[4],"icons":[16],"isHovered":[32]}],[1,"cpsl-slide-button",{"disabled":[4],"endIcon":[1,"end-icon"],"endText":[1,"end-text"],"startIcon":[1,"start-icon"],"startText":[1,"start-text"]}],[1,"cpsl-table",{"hasHorizontalScroll":[32],"hasVerticalScroll":[32]}],[1,"cpsl-tile-button",{"src":[1],"icon":[1]}],[1,"cpsl-app-bar",{"height":[2],"position":[1],"zIndexOverride":[2,"z-index-override"]}],[1,"cpsl-avatar",{"alt":[1],"src":[1],"variant":[1]}],[1,"cpsl-divider"],[1,"cpsl-dropdown",{"width":[1],"hasCpslSearch":[4,"has-cpsl-search"],"items":[16],"selectedItem":[1040],"isOpen":[32],"searchQuery":[32],"filteredItems":[32]},[[9,"resize","handleResize"]],{"selectedItem":["handleSelectedItemChange"],"isOpen":["handleOpenChange"]}],[1,"cpsl-nav-button-group",{"selectedId":[1,"selected-id"]},null,{"selectedId":["selectItem"]}],[1,"cpsl-pill",{"text":[1]}],[1,"cpsl-progress-indicator",{"totalSteps":[2,"total-steps"],"step":[2]}],[1,"cpsl-qr-code",{"url":[1],"imageSrc":[1,"image-src"],"size":[2]}],[1,"cpsl-radio",{"checked":[4]}],[1,"cpsl-select-item",{"selected":[4],"value":[1]}],[1,"cpsl-switch",{"checked":[4]}],[1,"cpsl-tab",{"selected":[4],"tab":[1]},[[8,"cpslTabsChanged","onTabsChanged"],[8,"cpslTabsInit","onTabsInit"]]],[1,"cpsl-tabs",{"fullWidth":[4,"full-width"],"selectedTab":[1,"selected-tab"],"selectedTabRect":[32],"loaded":[32]},null,{"fullWidth":["updateSlider"],"selectedTab":["updateTab"]}],[1,"cpsl-button",{"as":[1],"disabled":[516],"fullWidth":[4,"full-width"],"href":[1],"size":[1],"target":[1],"variant":[513]}],[1,"cpsl-button-group",{"selectedId":[1,"selected-id"]},null,{"selectedId":["selectItem"]}],[1,"cpsl-input",{"autocapitalize":[1],"autocomplete":[1],"autocorrect":[1],"noAutoDisable":[4,"no-auto-disable"],"autofocus":[4],"disabled":[4],"contrastText":[4,"contrast-text"],"enterkeyhint":[1],"errorText":[1,"error-text"],"mask":[1],"helperText":[1,"helper-text"],"inputmode":[1],"label":[1],"max":[8],"maxlength":[2],"min":[8],"minlength":[2],"multiple":[4],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[4],"required":[4],"showOptionalLabel":[4,"show-optional-label"],"spellcheck":[4],"startIconSrc":[1,"start-icon-src"],"startIcon":[1,"start-icon"],"step":[1],"type":[1],"value":[1025],"hasFocus":[32],"maskedInput":[32]},null,{"disabled":["handleDisable"],"mask":["handleSetupMask"],"value":["handleValueChange"]}],[1,"cpsl-popover",{"anchorEl":[16],"anchorOriginHorizontal":[1,"anchor-origin-horizontal"],"anchorOriginVertical":[1,"anchor-origin-vertical"],"autoWidth":[4,"auto-width"],"disabled":[4],"preventBlur":[4,"prevent-blur"],"transformOriginHorizontal":[1,"transform-origin-horizontal"],"transformOriginVertical":[1,"transform-origin-vertical"],"triggerAction":[1,"trigger-action"],"trigger":[1],"windowPadding":[2,"window-padding"],"open":[32],"positionX":[32],"positionY":[32],"closePopover":[64]},null,{"trigger":["onTriggerChange"],"triggerAction":["onTriggerChange"],"preventBlur":["onTriggerChange"],"anchorOriginHorizontal":["onAnchorChange"],"anchorOriginVertical":["onAnchorChange"],"open":["onOpenChange"]}],[1,"cpsl-spinner",{"size":[2],"speed":[2]}],[1,"cpsl-card"],[1,"cpsl-overlay",{"enterTransitionDuration":[2,"enter-transition-duration"],"exitTransitionDuration":[2,"exit-transition-duration"],"open":[4],"zIndexOverride":[2,"z-index-override"]},null,{"open":["toggleHeight"]}],[1,"cpsl-text",{"color":[1],"variant":[1],"weight":[1]}],[1,"cpsl-icon",{"src":[1],"icon":[1]}]]]], options);
|
20
20
|
});
|
21
21
|
|
22
22
|
//# sourceMappingURL=capsule.js.map
|