@rededor/cura 1.4.0 → 1.5.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{cura-accordion_12.cjs.entry.js → cura-accordion_13.cjs.entry.js} +107 -29
- package/dist/cjs/cura-accordion_13.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-alert.cjs.entry.js +1 -1
- package/dist/cjs/cura-avatar.cjs.entry.js +1 -1
- package/dist/cjs/cura-badge-counter.cjs.entry.js +2 -2
- package/dist/cjs/cura-badge-counter.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-badge-distance.cjs.entry.js +1 -1
- package/dist/cjs/cura-badge-distance.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-badge-dot.cjs.entry.js +44 -0
- package/dist/cjs/cura-badge-dot.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-badge-pill.cjs.entry.js +2 -1
- package/dist/cjs/cura-badge-pill.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-button-outline.cjs.entry.js +1 -1
- package/dist/cjs/cura-button-select.cjs.entry.js +1 -1
- package/dist/cjs/cura-button-transparent.cjs.entry.js +1 -1
- package/dist/cjs/cura-calendar.cjs.entry.js +1 -1
- package/dist/cjs/cura-card.cjs.entry.js +1 -1
- package/dist/cjs/cura-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/cura-display.cjs.entry.js +1 -1
- package/dist/cjs/cura-dropdown-search-option-title.cjs.entry.js +1 -1
- package/dist/cjs/cura-dropdown-search-option.cjs.entry.js +2 -2
- package/dist/cjs/cura-dropdown-search.cjs.entry.js +27 -21
- package/dist/cjs/cura-dropdown-search.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-icons-view.cjs.entry.js +1 -1
- package/dist/cjs/cura-input-date.cjs.entry.js +1 -1
- package/dist/cjs/cura-loader-bar.cjs.entry.js +1 -1
- package/dist/cjs/cura-progress-bar_2.cjs.entry.js +98 -0
- package/dist/cjs/cura-progress-bar_2.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-radio.cjs.entry.js +1 -1
- package/dist/cjs/cura-stepper.cjs.entry.js +123 -0
- package/dist/cjs/cura-stepper.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-switch.cjs.entry.js +1 -1
- package/dist/cjs/cura-toast.cjs.entry.js +1 -1
- package/dist/cjs/cura-tooltip.cjs.entry.js +9 -8
- package/dist/cjs/cura-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/cura.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +4 -0
- package/dist/collection/components/badges/cura-badge-counter/cura-badge-counter.js +2 -2
- package/dist/collection/components/badges/cura-badge-counter/cura-badge-counter.js.map +1 -1
- package/dist/collection/components/badges/cura-badge-distance/cura-badge-distance.css +2 -2
- package/dist/collection/components/badges/cura-badge-dot/cura-badge-dot.css +61 -0
- package/dist/collection/components/badges/cura-badge-dot/cura-badge-dot.js +108 -0
- package/dist/collection/components/badges/cura-badge-dot/cura-badge-dot.js.map +1 -0
- package/dist/collection/components/badges/cura-badge-dot/cura-badge-dot.stories.js +65 -0
- package/dist/collection/components/badges/cura-badge-dot/cura-badge-dot.stories.js.map +1 -0
- package/dist/collection/components/badges/cura-badge-pill/cura-badge-pill.js +2 -1
- package/dist/collection/components/badges/cura-badge-pill/cura-badge-pill.js.map +1 -1
- package/dist/collection/components/buttons/cura-button/cura-button.js +1 -1
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js +1 -1
- package/dist/collection/components/buttons/cura-button-select/cura-button-select.js +1 -1
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js +1 -1
- package/dist/collection/components/cura-alert/cura-alert.js +1 -1
- package/dist/collection/components/cura-avatar/cura-avatar.js +1 -1
- package/dist/collection/components/cura-calendar/cura-calendar.js +1 -1
- package/dist/collection/components/cura-card/cura-card.js +1 -1
- package/dist/collection/components/cura-icon/cura-icon.js +1 -1
- package/dist/collection/components/cura-icons-view/cura-icons-view.js +1 -1
- package/dist/collection/components/cura-modal/cura-modal.css +3 -3
- package/dist/collection/components/cura-modal/cura-modal.js +39 -1
- package/dist/collection/components/cura-modal/cura-modal.js.map +1 -1
- package/dist/collection/components/cura-modal/cura-modal.stories.js +18 -0
- package/dist/collection/components/cura-modal/cura-modal.stories.js.map +1 -1
- package/dist/collection/components/cura-page-template/cura-page-template.js +1 -1
- package/dist/collection/components/cura-stepper/cura-progress-bar/cura-progress-bar.css +15 -0
- package/dist/collection/components/cura-stepper/cura-progress-bar/cura-progress-bar.js +121 -0
- package/dist/collection/components/cura-stepper/cura-progress-bar/cura-progress-bar.js.map +1 -0
- package/dist/collection/components/cura-stepper/cura-stepper-item/cura-stepper-item.css +10 -0
- package/dist/collection/components/cura-stepper/cura-stepper-item/cura-stepper-item.js +153 -0
- package/dist/collection/components/cura-stepper/cura-stepper-item/cura-stepper-item.js.map +1 -0
- package/dist/collection/components/cura-stepper/cura-stepper.css +72 -0
- package/dist/collection/components/cura-stepper/cura-stepper.js +227 -0
- package/dist/collection/components/cura-stepper/cura-stepper.js.map +1 -0
- package/dist/collection/components/cura-stepper/cura-stepper.stories.js +97 -0
- package/dist/collection/components/cura-stepper/cura-stepper.stories.js.map +1 -0
- package/dist/collection/components/cura-stepper/stepper.type.js +2 -0
- package/dist/collection/components/cura-stepper/stepper.type.js.map +1 -0
- package/dist/collection/components/cura-toast/cura-toast.js +1 -1
- package/dist/collection/components/cura-tooltip/cura-tooltip.js +9 -8
- package/dist/collection/components/cura-tooltip/cura-tooltip.js.map +1 -1
- package/dist/collection/components/forms/cura-checkbox/cura-checkbox.js +1 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js +2 -2
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.js +1 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.css +4 -2
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js +28 -21
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js.map +1 -1
- package/dist/collection/components/forms/cura-input-date/cura-input-date.js +1 -1
- package/dist/collection/components/forms/cura-label/cura-label.js +1 -1
- package/dist/collection/components/forms/cura-radio/cura-radio.js +1 -1
- package/dist/collection/components/forms/cura-select/cura-select.css +5 -1
- package/dist/collection/components/forms/cura-select/cura-select.js +32 -19
- package/dist/collection/components/forms/cura-select/cura-select.js.map +1 -1
- package/dist/collection/components/forms/cura-select/cura-select.stories.js +1 -1
- package/dist/collection/components/forms/cura-select/cura-select.stories.js.map +1 -1
- package/dist/collection/components/forms/cura-select-options/cura-select-option.js +1 -1
- package/dist/collection/components/forms/cura-switch/cura-switch.js +1 -1
- package/dist/collection/components/loaders/cura-loader-bar/cura-loader-bar.js +1 -1
- package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.js +1 -1
- package/dist/collection/components/text/cura-display/cura-display.js +1 -1
- package/dist/collection/components/text/cura-heading/cura-heading.js +1 -1
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +1 -1
- package/dist/components/cura-alert.js +1 -1
- package/dist/components/cura-avatar.js +1 -1
- package/dist/components/cura-badge-counter2.js +2 -2
- package/dist/components/cura-badge-counter2.js.map +1 -1
- package/dist/components/cura-badge-distance.js +1 -1
- package/dist/components/cura-badge-distance.js.map +1 -1
- package/dist/components/cura-badge-dot.d.ts +11 -0
- package/dist/components/cura-badge-dot.js +63 -0
- package/dist/components/cura-badge-dot.js.map +1 -0
- package/dist/components/cura-badge-pill.js +1 -113
- package/dist/components/cura-badge-pill.js.map +1 -1
- package/dist/components/cura-badge-pill2.js +118 -0
- package/dist/components/cura-badge-pill2.js.map +1 -0
- package/dist/components/cura-button-outline.js +1 -1
- package/dist/components/cura-button-select.js +1 -1
- package/dist/components/cura-button-transparent2.js +1 -1
- package/dist/components/cura-button.js +1 -1
- package/dist/components/cura-calendar2.js +1 -1
- package/dist/components/cura-card.js +1 -1
- package/dist/components/cura-checkbox.js +1 -1
- package/dist/components/cura-display.js +1 -1
- package/dist/components/cura-dropdown-search-option-title.js +1 -1
- package/dist/components/cura-dropdown-search-option.js +2 -2
- package/dist/components/cura-dropdown-search.js +29 -22
- package/dist/components/cura-dropdown-search.js.map +1 -1
- package/dist/components/cura-heading2.js +1 -1
- package/dist/components/cura-icon2.js +1 -1
- package/dist/components/cura-icons-view.js +1 -1
- package/dist/components/cura-input-date.js +1 -1
- package/dist/components/cura-label2.js +1 -1
- package/dist/components/cura-loader-bar2.js +1 -1
- package/dist/components/cura-loader-circle2.js +1 -1
- package/dist/components/cura-modal.js +6 -2
- package/dist/components/cura-modal.js.map +1 -1
- package/dist/components/cura-page-template.js +1 -1
- package/dist/components/cura-paragraph2.js +1 -1
- package/dist/components/cura-progress-bar.d.ts +11 -0
- package/dist/components/cura-progress-bar.js +8 -0
- package/dist/components/cura-progress-bar.js.map +1 -0
- package/dist/components/cura-progress-bar2.js +48 -0
- package/dist/components/cura-progress-bar2.js.map +1 -0
- package/dist/components/cura-radio.js +1 -1
- package/dist/components/cura-select-option2.js +1 -1
- package/dist/components/cura-select2.js +33 -20
- package/dist/components/cura-select2.js.map +1 -1
- package/dist/components/cura-stepper-item.d.ts +11 -0
- package/dist/components/cura-stepper-item.js +8 -0
- package/dist/components/cura-stepper-item.js.map +1 -0
- package/dist/components/cura-stepper-item2.js +116 -0
- package/dist/components/cura-stepper-item2.js.map +1 -0
- package/dist/components/cura-stepper.d.ts +11 -0
- package/dist/components/cura-stepper.js +187 -0
- package/dist/components/cura-stepper.js.map +1 -0
- package/dist/components/cura-switch.js +1 -1
- package/dist/components/cura-toast.js +1 -1
- package/dist/components/cura-tooltip.js +9 -8
- package/dist/components/cura-tooltip.js.map +1 -1
- package/dist/components/index.js +8 -0
- package/dist/components/index.js.map +1 -1
- package/dist/cura/cura.esm.js +1 -1
- package/dist/cura/cura.esm.js.map +1 -1
- package/dist/cura/{p-a91d451f.entry.js → p-04006a3e.entry.js} +2 -2
- package/dist/cura/{p-576c65b4.entry.js → p-0a133399.entry.js} +2 -2
- package/dist/cura/{p-116a1cd6.entry.js → p-164ddb46.entry.js} +2 -2
- package/dist/cura/{p-36dbec98.entry.js → p-235ac0b4.entry.js} +2 -2
- package/dist/cura/p-23fa2246.entry.js +2 -0
- package/dist/cura/p-23fa2246.entry.js.map +1 -0
- package/dist/cura/{p-c4da4c44.entry.js → p-2af6216a.entry.js} +2 -2
- package/dist/cura/{p-42258230.entry.js → p-3030774e.entry.js} +2 -2
- package/dist/cura/{p-3d958d45.entry.js → p-3c0931d3.entry.js} +2 -2
- package/dist/cura/{p-ef593f12.entry.js → p-46eaee31.entry.js} +2 -2
- package/dist/cura/p-46eaee31.entry.js.map +1 -0
- package/dist/cura/{p-bdb1a0c5.entry.js → p-4aefe237.entry.js} +2 -2
- package/dist/cura/{p-aa65cb50.entry.js → p-529332d3.entry.js} +2 -2
- package/dist/cura/{p-aa65cb50.entry.js.map → p-529332d3.entry.js.map} +1 -1
- package/dist/cura/{p-19f28fa8.entry.js → p-545e8e55.entry.js} +2 -2
- package/dist/cura/p-557b90c4.entry.js +2 -0
- package/dist/cura/p-557b90c4.entry.js.map +1 -0
- package/dist/cura/p-6624108e.entry.js +2 -0
- package/dist/cura/p-6b627841.entry.js +2 -0
- package/dist/cura/p-6b627841.entry.js.map +1 -0
- package/dist/cura/{p-3eca0f0c.entry.js → p-70adcf7b.entry.js} +2 -2
- package/dist/cura/{p-52f854e0.entry.js → p-7ba80d78.entry.js} +2 -2
- package/dist/cura/{p-52f854e0.entry.js.map → p-7ba80d78.entry.js.map} +1 -1
- package/dist/cura/p-8622c492.entry.js +2 -0
- package/dist/cura/p-8622c492.entry.js.map +1 -0
- package/dist/cura/p-935eeb7b.entry.js +2 -0
- package/dist/cura/p-935eeb7b.entry.js.map +1 -0
- package/dist/cura/{p-2545cfc7.entry.js → p-b3e93e74.entry.js} +2 -2
- package/dist/cura/{p-dcd2e5bb.entry.js → p-bce10f9b.entry.js} +2 -2
- package/dist/cura/p-cfbe2bce.entry.js +2 -0
- package/dist/cura/p-cfbe2bce.entry.js.map +1 -0
- package/dist/cura/{p-818c581f.entry.js → p-d13e3295.entry.js} +2 -2
- package/dist/cura/{p-e1a41792.entry.js → p-ec7876d3.entry.js} +2 -2
- package/dist/cura/{p-b1a51e81.entry.js → p-ee8db3dc.entry.js} +2 -2
- package/dist/cura/{p-4b496c51.entry.js → p-f96b0923.entry.js} +2 -2
- package/dist/esm/{cura-accordion_12.entry.js → cura-accordion_13.entry.js} +107 -30
- package/dist/esm/cura-accordion_13.entry.js.map +1 -0
- package/dist/esm/cura-alert.entry.js +1 -1
- package/dist/esm/cura-avatar.entry.js +1 -1
- package/dist/esm/cura-badge-counter.entry.js +2 -2
- package/dist/esm/cura-badge-counter.entry.js.map +1 -1
- package/dist/esm/cura-badge-distance.entry.js +1 -1
- package/dist/esm/cura-badge-distance.entry.js.map +1 -1
- package/dist/esm/cura-badge-dot.entry.js +40 -0
- package/dist/esm/cura-badge-dot.entry.js.map +1 -0
- package/dist/esm/cura-badge-pill.entry.js +2 -1
- package/dist/esm/cura-badge-pill.entry.js.map +1 -1
- package/dist/esm/cura-button-outline.entry.js +1 -1
- package/dist/esm/cura-button-select.entry.js +1 -1
- package/dist/esm/cura-button-transparent.entry.js +1 -1
- package/dist/esm/cura-calendar.entry.js +1 -1
- package/dist/esm/cura-card.entry.js +1 -1
- package/dist/esm/cura-checkbox.entry.js +1 -1
- package/dist/esm/cura-display.entry.js +1 -1
- package/dist/esm/cura-dropdown-search-option-title.entry.js +1 -1
- package/dist/esm/cura-dropdown-search-option.entry.js +2 -2
- package/dist/esm/cura-dropdown-search.entry.js +27 -21
- package/dist/esm/cura-dropdown-search.entry.js.map +1 -1
- package/dist/esm/cura-icons-view.entry.js +1 -1
- package/dist/esm/cura-input-date.entry.js +1 -1
- package/dist/esm/cura-loader-bar.entry.js +1 -1
- package/dist/esm/cura-progress-bar_2.entry.js +93 -0
- package/dist/esm/cura-progress-bar_2.entry.js.map +1 -0
- package/dist/esm/cura-radio.entry.js +1 -1
- package/dist/esm/cura-stepper.entry.js +119 -0
- package/dist/esm/cura-stepper.entry.js.map +1 -0
- package/dist/esm/cura-switch.entry.js +1 -1
- package/dist/esm/cura-toast.entry.js +1 -1
- package/dist/esm/cura-tooltip.entry.js +9 -8
- package/dist/esm/cura-tooltip.entry.js.map +1 -1
- package/dist/esm/cura.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/badges/cura-badge-dot/cura-badge-dot.d.ts +24 -0
- package/dist/types/components/badges/cura-badge-dot/cura-badge-dot.stories.d.ts +53 -0
- package/dist/types/components/cura-modal/cura-modal.d.ts +10 -0
- package/dist/types/components/cura-modal/cura-modal.stories.d.ts +20 -0
- package/dist/types/components/cura-stepper/cura-progress-bar/cura-progress-bar.d.ts +23 -0
- package/dist/types/components/cura-stepper/cura-stepper-item/cura-stepper-item.d.ts +60 -0
- package/dist/types/components/cura-stepper/cura-stepper.d.ts +62 -0
- package/dist/types/components/cura-stepper/cura-stepper.stories.d.ts +77 -0
- package/dist/types/components/cura-stepper/stepper.type.d.ts +4 -0
- package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search.d.ts +3 -1
- package/dist/types/components/forms/cura-select/cura-select.d.ts +8 -8
- package/dist/types/components/forms/cura-select/cura-select.stories.d.ts +1 -1
- package/dist/types/components.d.ts +206 -0
- package/package.json +2 -2
- package/dist/cjs/cura-accordion_12.cjs.entry.js.map +0 -1
- package/dist/cjs/cura-modal.cjs.entry.js +0 -71
- package/dist/cjs/cura-modal.cjs.entry.js.map +0 -1
- package/dist/cura/p-35920ac0.entry.js +0 -2
- package/dist/cura/p-35920ac0.entry.js.map +0 -1
- package/dist/cura/p-3e4ca7e7.entry.js +0 -2
- package/dist/cura/p-3e4ca7e7.entry.js.map +0 -1
- package/dist/cura/p-6e4f4fbf.entry.js +0 -2
- package/dist/cura/p-6e4f4fbf.entry.js.map +0 -1
- package/dist/cura/p-ef593f12.entry.js.map +0 -1
- package/dist/cura/p-f23c4ed8.entry.js +0 -2
- package/dist/cura/p-f23c4ed8.entry.js.map +0 -1
- package/dist/cura/p-f5d45776.entry.js +0 -2
- package/dist/esm/cura-accordion_12.entry.js.map +0 -1
- package/dist/esm/cura-modal.entry.js +0 -67
- package/dist/esm/cura-modal.entry.js.map +0 -1
- /package/dist/cura/{p-a91d451f.entry.js.map → p-04006a3e.entry.js.map} +0 -0
- /package/dist/cura/{p-576c65b4.entry.js.map → p-0a133399.entry.js.map} +0 -0
- /package/dist/cura/{p-116a1cd6.entry.js.map → p-164ddb46.entry.js.map} +0 -0
- /package/dist/cura/{p-36dbec98.entry.js.map → p-235ac0b4.entry.js.map} +0 -0
- /package/dist/cura/{p-c4da4c44.entry.js.map → p-2af6216a.entry.js.map} +0 -0
- /package/dist/cura/{p-42258230.entry.js.map → p-3030774e.entry.js.map} +0 -0
- /package/dist/cura/{p-3d958d45.entry.js.map → p-3c0931d3.entry.js.map} +0 -0
- /package/dist/cura/{p-bdb1a0c5.entry.js.map → p-4aefe237.entry.js.map} +0 -0
- /package/dist/cura/{p-19f28fa8.entry.js.map → p-545e8e55.entry.js.map} +0 -0
- /package/dist/cura/{p-f5d45776.entry.js.map → p-6624108e.entry.js.map} +0 -0
- /package/dist/cura/{p-3eca0f0c.entry.js.map → p-70adcf7b.entry.js.map} +0 -0
- /package/dist/cura/{p-2545cfc7.entry.js.map → p-b3e93e74.entry.js.map} +0 -0
- /package/dist/cura/{p-dcd2e5bb.entry.js.map → p-bce10f9b.entry.js.map} +0 -0
- /package/dist/cura/{p-818c581f.entry.js.map → p-d13e3295.entry.js.map} +0 -0
- /package/dist/cura/{p-e1a41792.entry.js.map → p-ec7876d3.entry.js.map} +0 -0
- /package/dist/cura/{p-b1a51e81.entry.js.map → p-ee8db3dc.entry.js.map} +0 -0
- /package/dist/cura/{p-4b496c51.entry.js.map → p-f96b0923.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as e,h as s,H as i,g as a}from"./p-fd5ed6b0.js";import{i as n,a as h}from"./p-272c784a.js";const r=":host{display:block}.container{display:flex;flex-direction:column;position:relative}.container .calendar{padding:0px calc(var(--base-spacing) * 3px);margin-top:-8px;border-radius:0px 0px 4px 4px;border-top:0px;border-right:2px solid #D4D4D4;border-bottom:2px solid #D4D4D4;border-left:2px solid #D4D4D4;box-shadow:0px 4px 8px 0px var(--neutral-black-shadow, rgba(38, 38, 38, 0.16));position:absolute;top:100%;z-index:10;display:none;opacity:0;pointer-events:none}.container .calendar.visible{box-sizing:border-box;display:block;opacity:1;pointer-events:auto;width:100%;background-color:#fff}";const o=r;const d=class{constructor(s){t(this,s);this.dateChange=e(this,"dateChange",7);this.statusInputChange=e(this,"statusInputChange",7);this.label="";this.status="default";this.size="medium";this.name="";this.helperText=undefined;this.enableRangeDates=undefined;this.disableFutureDates=undefined;this.disablePassDates=undefined;this.iconName="";this.placeholder=null;this.styles={};this.isCalendarVisible=false;this.dates=[];this.value="";this.dateSettings={placeholder:null,mask:"date",mode:"single"}}connectedCallback(){const{fonts:t,colors:e,spacing:s}=window.CuraAPI.theme;const i=t.getWeights();this.styles={"--base-spacing":s.getSpacing(),"--neutral-purewhite":e.getColor("neutral-purewhite"),"--neutral-lighter":e.getColor("neutral-lighter"),"--neutral-base":e.getColor("neutral-base"),"--font-size":t.getSize(),"--font-color":t.getColor(),"--font-family":t.getFamily(),"--font-weight-regular":i.regular}}componentWillLoad(){this.updateDateSettings()}formAssociatedCallback(t){t.ariaLabel=this.label}updateDateSettings(){const t=this.getDateSettings(this.enableRangeDates);if(this.shouldUpdateDateSettings(t)){this.dateSettings=t}}getDateSettings(t){return{placeholder:this.placeholder||(t?"dd/mm/aaaa - dd/mm/aaaa":"dd/mm/aaaa"),mask:t?"dateRange":"date",mode:t?"range":"single"}}shouldUpdateDateSettings(t){return this.dateSettings.placeholder!==t.placeholder||this.dateSettings.mask!==t.mask||this.dateSettings.mode!==t.mode}handleClick(t){if(this.el.contains(t.target)){return}this.hideCalendar()}hideCalendar(){this.isCalendarVisible=false}showCalendar(){this.isCalendarVisible=true}handleInputDates(t){const e=t.target.value;const s=/^(\d{2}\/\d{2}\/\d{4})\s*-\s*(\d{2}\/\d{2}\/\d{4})$/;const i=/^(\d{2}\/\d{2}\/\d{4})$/;if(s.test(e)){const t=e.match(s);const i=this.parseStringToDate(t[1]);const a=this.parseStringToDate(t[2]);if(this.isDateValid(i)&&this.isDateValid(a)){this.status="default";this.dates=[i,a];this.value=`${this.parseDateToString(i)} - ${this.parseDateToString(a)}`;this.dateChange.emit(this.value)}else{this.resetDates()}}else if(i.test(e)){const t=e.match(i);const s=this.parseStringToDate(t[1]);if(this.isDateValid(s)){this.status="default";this.dates=[s];this.value=this.parseDateToString(s);this.dateChange.emit(this.value)}else{this.resetDates()}}else{this.dates=[]}}handleChangeDates(t){if(t.detail===""){this.dates=[];this.status="default";this.value="";this.dateChange.emit(this.value);this.statusInputChange.emit(this.status)}}isDateValid(t){const e=new Date;e.setHours(0,0,0,0);if(this.disablePassDates)return!n(t,e);if(this.disableFutureDates)return!h(t,e);return true}parseStringToDate(t){const[e,s,i]=t.split("/").map(Number);return new Date(i,s-1,e)}parseDateToString(t){const e=String(t.getDate()).padStart(2,"0");const s=String(t.getMonth()+1).padStart(2,"0");const i=t.getFullYear();return`${e}/${s}/${i}`}resetDates(){this.status="error";this.dates=[];this.statusInputChange.emit(this.status)}renderCalendarOrHelperText(){if(this.isCalendarVisible){return s("div",{class:"calendar visible"},s("cura-calendar",{customDates:this.dates,mode:this.dateSettings.mode,width:"100%",maxWidth:"400px",embedded:false,floating:false,disableFutureDates:this.disableFutureDates,disablePassDates:this.disablePassDates,onOnchangeday:t=>{const e=t.detail.days;if(e.length===1){this.value=this.parseDateToString(e[0])}else if(e.length>0){this.value=`${this.parseDateToString(e[0])} - ${this.parseDateToString(e[e.length-1])}`}else{this.value=""}this.dateChange.emit(this.value)}}))}else{return this.helperText}}render(){return s(i,{key:"
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as e,h as s,H as i,g as a}from"./p-fd5ed6b0.js";import{i as n,a as h}from"./p-272c784a.js";const r=":host{display:block}.container{display:flex;flex-direction:column;position:relative}.container .calendar{padding:0px calc(var(--base-spacing) * 3px);margin-top:-8px;border-radius:0px 0px 4px 4px;border-top:0px;border-right:2px solid #D4D4D4;border-bottom:2px solid #D4D4D4;border-left:2px solid #D4D4D4;box-shadow:0px 4px 8px 0px var(--neutral-black-shadow, rgba(38, 38, 38, 0.16));position:absolute;top:100%;z-index:10;display:none;opacity:0;pointer-events:none}.container .calendar.visible{box-sizing:border-box;display:block;opacity:1;pointer-events:auto;width:100%;background-color:#fff}";const o=r;const d=class{constructor(s){t(this,s);this.dateChange=e(this,"dateChange",7);this.statusInputChange=e(this,"statusInputChange",7);this.label="";this.status="default";this.size="medium";this.name="";this.helperText=undefined;this.enableRangeDates=undefined;this.disableFutureDates=undefined;this.disablePassDates=undefined;this.iconName="";this.placeholder=null;this.styles={};this.isCalendarVisible=false;this.dates=[];this.value="";this.dateSettings={placeholder:null,mask:"date",mode:"single"}}connectedCallback(){const{fonts:t,colors:e,spacing:s}=window.CuraAPI.theme;const i=t.getWeights();this.styles={"--base-spacing":s.getSpacing(),"--neutral-purewhite":e.getColor("neutral-purewhite"),"--neutral-lighter":e.getColor("neutral-lighter"),"--neutral-base":e.getColor("neutral-base"),"--font-size":t.getSize(),"--font-color":t.getColor(),"--font-family":t.getFamily(),"--font-weight-regular":i.regular}}componentWillLoad(){this.updateDateSettings()}formAssociatedCallback(t){t.ariaLabel=this.label}updateDateSettings(){const t=this.getDateSettings(this.enableRangeDates);if(this.shouldUpdateDateSettings(t)){this.dateSettings=t}}getDateSettings(t){return{placeholder:this.placeholder||(t?"dd/mm/aaaa - dd/mm/aaaa":"dd/mm/aaaa"),mask:t?"dateRange":"date",mode:t?"range":"single"}}shouldUpdateDateSettings(t){return this.dateSettings.placeholder!==t.placeholder||this.dateSettings.mask!==t.mask||this.dateSettings.mode!==t.mode}handleClick(t){if(this.el.contains(t.target)){return}this.hideCalendar()}hideCalendar(){this.isCalendarVisible=false}showCalendar(){this.isCalendarVisible=true}handleInputDates(t){const e=t.target.value;const s=/^(\d{2}\/\d{2}\/\d{4})\s*-\s*(\d{2}\/\d{2}\/\d{4})$/;const i=/^(\d{2}\/\d{2}\/\d{4})$/;if(s.test(e)){const t=e.match(s);const i=this.parseStringToDate(t[1]);const a=this.parseStringToDate(t[2]);if(this.isDateValid(i)&&this.isDateValid(a)){this.status="default";this.dates=[i,a];this.value=`${this.parseDateToString(i)} - ${this.parseDateToString(a)}`;this.dateChange.emit(this.value)}else{this.resetDates()}}else if(i.test(e)){const t=e.match(i);const s=this.parseStringToDate(t[1]);if(this.isDateValid(s)){this.status="default";this.dates=[s];this.value=this.parseDateToString(s);this.dateChange.emit(this.value)}else{this.resetDates()}}else{this.dates=[]}}handleChangeDates(t){if(t.detail===""){this.dates=[];this.status="default";this.value="";this.dateChange.emit(this.value);this.statusInputChange.emit(this.status)}}isDateValid(t){const e=new Date;e.setHours(0,0,0,0);if(this.disablePassDates)return!n(t,e);if(this.disableFutureDates)return!h(t,e);return true}parseStringToDate(t){const[e,s,i]=t.split("/").map(Number);return new Date(i,s-1,e)}parseDateToString(t){const e=String(t.getDate()).padStart(2,"0");const s=String(t.getMonth()+1).padStart(2,"0");const i=t.getFullYear();return`${e}/${s}/${i}`}resetDates(){this.status="error";this.dates=[];this.statusInputChange.emit(this.status)}renderCalendarOrHelperText(){if(this.isCalendarVisible){return s("div",{class:"calendar visible"},s("cura-calendar",{customDates:this.dates,mode:this.dateSettings.mode,width:"100%",maxWidth:"400px",embedded:false,floating:false,disableFutureDates:this.disableFutureDates,disablePassDates:this.disablePassDates,onOnchangeday:t=>{const e=t.detail.days;if(e.length===1){this.value=this.parseDateToString(e[0])}else if(e.length>0){this.value=`${this.parseDateToString(e[0])} - ${this.parseDateToString(e[e.length-1])}`}else{this.value=""}this.dateChange.emit(this.value)}}))}else{return this.helperText}}render(){return s(i,{key:"1395108764c1957abb9371b82ab983d076aaf61e"},s("div",{key:"e3134a1cfbf6f07b83f148b3e1b9c699e273a098",class:"container",style:this.styles},s("cura-input-text",{key:"507ce8cedd5a169832579ae3ea313d3b3d6813d2",label:this.label,name:this.name,status:this.status,value:this.value,onFocus:()=>this.showCalendar(),size:this.size,"icon-name":this.iconName,placeholder:this.dateSettings.placeholder,"mask-preset":this.dateSettings.mask,"enable-selection-mode":true,onKeyUp:t=>this.handleInputDates(t),autocomplete:"off",onValueChange:t=>this.handleChangeDates(t)},this.renderCalendarOrHelperText())))}static get formAssociated(){return true}get el(){return a(this)}static get watchers(){return{enableRangeDates:["updateDateSettings"]}}};d.style=o;export{d as cura_input_date};
|
|
2
|
+
//# sourceMappingURL=p-4aefe237.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,h as i,H as e}from"./p-fd5ed6b0.js";const s=':host{width:fit-content;display:inline-block;height:calc(var(--base-spacing) * 4px);position:relative}:host .container{display:flex;min-width:calc(var(--base-spacing) * 4px);width:fit-content;height:calc(var(--base-spacing) * 4px);justify-content:center;align-items:center;border-radius:calc(calc(var(--base-spacing) * 4px) / 2);background:var(--background-color);box-sizing:border-box;padding:0 calc(var(--base-spacing) * 1px);position:relative}:host .container.outline,:host .container.transparent{background:transparent !important}:host .container.outline::before{content:"";width:100%;height:100%;position:absolute;left:0px;top:0px;box-sizing:border-box;border:1px solid var(--background-color);border-radius:calc(calc(var(--base-spacing) * 4px) / 2)}';const a=s;const r=class{constructor(i){t(this,i);this.theme=window.CuraAPI.theme;this.labelColor="primary-darker";this.bgColorName="primary-lighter";this.number=undefined;this.color="primary";this.disabled=false;this.type="solid";this.styles={}}handleColorChange(){this.setColors()}setColors(){const t=this.color.toLowerCase();if(this.type==="outline"||this.type==="transparent"){this.bgColorName=this.disabled?`neutral-medium`:`${t}-dark`;this.labelColor=this.bgColorName}else{this.bgColorName=t==="neutral"||this.disabled?`neutral-pale`:`${t}-lighter`;this.labelColor=this.disabled?"neutral-medium":`${t}-dark`}this.styles=Object.assign(Object.assign({},this.styles),{"--background-color":this.theme.colors.getColor(`${this.bgColorName}`)})}connectedCallback(){this.styles["--base-spacing"]=this.theme.spacing.getSpacing();this.setColors()}getClasses(){const t={container:true};t[this.type.toLowerCase()]=true;return t}render(){return i(e,{key:"
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,h as i,H as e}from"./p-fd5ed6b0.js";const s=':host{width:fit-content;display:inline-block;height:calc(var(--base-spacing) * 4px);position:relative}:host .container{display:flex;min-width:calc(var(--base-spacing) * 4px);width:fit-content;height:calc(var(--base-spacing) * 4px);justify-content:center;align-items:center;border-radius:calc(calc(var(--base-spacing) * 4px) / 2);background:var(--background-color);box-sizing:border-box;padding:0 calc(var(--base-spacing) * 1px);position:relative}:host .container.outline,:host .container.transparent{background:transparent !important}:host .container.outline::before{content:"";width:100%;height:100%;position:absolute;left:0px;top:0px;box-sizing:border-box;border:1px solid var(--background-color);border-radius:calc(calc(var(--base-spacing) * 4px) / 2)}';const a=s;const r=class{constructor(i){t(this,i);this.theme=window.CuraAPI.theme;this.labelColor="primary-darker";this.bgColorName="primary-lighter";this.number=undefined;this.color="primary";this.disabled=false;this.type="solid";this.styles={}}handleColorChange(){this.setColors()}setColors(){const t=this.color.toLowerCase();if(this.type==="outline"||this.type==="transparent"){this.bgColorName=this.disabled?`neutral-medium`:`${t}-dark`;this.labelColor=this.bgColorName}else{this.bgColorName=t==="neutral"||this.disabled?`neutral-pale`:`${t}-lighter`;this.labelColor=this.disabled?"neutral-medium":`${t}-dark`}this.styles=Object.assign(Object.assign({},this.styles),{"--background-color":this.theme.colors.getColor(`${this.bgColorName}`)})}connectedCallback(){this.styles["--base-spacing"]=this.theme.spacing.getSpacing();this.setColors()}getClasses(){const t={container:true};t[this.type.toLowerCase()]=true;return t}render(){return i(e,{key:"8b67f2b913a10de53a519cdafcfbcb140b2adda5"},this.number&&this.number<=0?"":i("div",{class:this.getClasses(),style:this.styles},i("cura-label",{size:"xsmall","line-height":"none",color:this.labelColor},this.number>=100?"99+":this.number)))}static get watchers(){return{disabled:["handleColorChange"],color:["handleColorChange"],type:["handleColorChange"]}}};r.style=a;export{r as cura_badge_counter};
|
|
2
|
+
//# sourceMappingURL=p-529332d3.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["curaBadgeCounterCss","CuraBadgeCounterStyle0","CuraBadgeNumber","this","theme","window","CuraAPI","labelColor","bgColorName","handleColorChange","setColors","color","toLowerCase","type","disabled","styles","Object","assign","colors","getColor","connectedCallback","spacing","getSpacing","getClasses","classes","container","render","h","Host","key","number","class","style","size"],"sources":["src/components/badges/cura-badge-counter/cura-badge-counter.scss?tag=cura-badge-counter&encapsulation=shadow","src/components/badges/cura-badge-counter/cura-badge-counter.tsx"],"sourcesContent":["@import '../../../scss/mixins/spacing.scss';\n\n:host {\n width: fit-content;\n display: inline-block;\n height: #{$spacing-xxs};\n position: relative;\n\n .container {\n display: flex;\n min-width: #{$spacing-xxs};\n width: fit-content;\n height: #{$spacing-xxs};\n justify-content: center;\n align-items: center;\n border-radius: calc(#{$spacing-xxs} / 2);\n background: var(--background-color);\n box-sizing: border-box;\n padding: 0 #{$spacing-tiny};\n position: relative;\n\n &.outline,\n &.transparent {\n background: transparent !important;\n }\n\n &.outline {\n &::before {\n content: \"\";\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0px;\n top: 0px;\n box-sizing: border-box;\n border: 1px solid var(--background-color);\n border-radius: calc(#{$spacing-xxs} / 2);\n }\n }\n }\n\n}\n","import { Component, Host, Prop, h, State, Watch } from '@stencil/core';\n\n@Component({\n tag: 'cura-badge-counter',\n styleUrl: 'cura-badge-counter.scss',\n shadow: true,\n})\nexport class CuraBadgeNumber {\n\n theme = window.CuraAPI.theme;\n\n /** Número a ser representado no badge.\n * Apresentará 99+ para números acima desse valor.\n */\n @Prop({ reflect: true }) number: number | null;\n /**\n * Cor fundamental do design system sem profundidade.\n * Ex.: primary (padrão)\n */\n @Prop() color: string = 'primary';\n /**\n * Define o estado do badge como desabilitado ou habilitado.\n */\n @Prop() disabled: boolean = false;\n /**\n * Define o estilo visual entre solid (default), outline ou transparent.\n */\n @Prop() type: 'solid' | 'outline' | 'transparent' | string = 'solid';\n\n @State() styles = {};\n labelColor = 'primary-darker';\n bgColorName = 'primary-lighter';\n\n @Watch(\"disabled\")\n @Watch(\"color\")\n @Watch(\"type\")\n handleColorChange() {\n this.setColors();\n }\n\n setColors() {\n const color = this.color.toLowerCase();\n /** type outline and transparent */\n if (this.type === 'outline' || this.type === 'transparent') {\n this.bgColorName = this.disabled ? `neutral-medium` : `${color}-dark`;\n this.labelColor = this.bgColorName;\n /** type solid - default */\n } else {\n this.bgColorName = color === 'neutral' || this.disabled ? `neutral-pale` : `${color}-lighter`;\n this.labelColor = this.disabled ? 'neutral-medium' : `${color}-dark`;\n }\n this.styles = {\n ...this.styles,\n '--background-color': this.theme.colors.getColor(`${this.bgColorName}`),\n }\n }\n\n connectedCallback() {\n this.styles['--base-spacing'] = this.theme.spacing.getSpacing();\n this.setColors();\n }\n\n getClasses() {\n const classes = {\n 'container': true
|
|
1
|
+
{"version":3,"names":["curaBadgeCounterCss","CuraBadgeCounterStyle0","CuraBadgeNumber","this","theme","window","CuraAPI","labelColor","bgColorName","handleColorChange","setColors","color","toLowerCase","type","disabled","styles","Object","assign","colors","getColor","connectedCallback","spacing","getSpacing","getClasses","classes","container","render","h","Host","key","number","class","style","size"],"sources":["src/components/badges/cura-badge-counter/cura-badge-counter.scss?tag=cura-badge-counter&encapsulation=shadow","src/components/badges/cura-badge-counter/cura-badge-counter.tsx"],"sourcesContent":["@import '../../../scss/mixins/spacing.scss';\n\n:host {\n width: fit-content;\n display: inline-block;\n height: #{$spacing-xxs};\n position: relative;\n\n .container {\n display: flex;\n min-width: #{$spacing-xxs};\n width: fit-content;\n height: #{$spacing-xxs};\n justify-content: center;\n align-items: center;\n border-radius: calc(#{$spacing-xxs} / 2);\n background: var(--background-color);\n box-sizing: border-box;\n padding: 0 #{$spacing-tiny};\n position: relative;\n\n &.outline,\n &.transparent {\n background: transparent !important;\n }\n\n &.outline {\n &::before {\n content: \"\";\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0px;\n top: 0px;\n box-sizing: border-box;\n border: 1px solid var(--background-color);\n border-radius: calc(#{$spacing-xxs} / 2);\n }\n }\n }\n\n}\n","import { Component, Host, Prop, h, State, Watch } from '@stencil/core';\n\n@Component({\n tag: 'cura-badge-counter',\n styleUrl: 'cura-badge-counter.scss',\n shadow: true,\n})\nexport class CuraBadgeNumber {\n\n theme = window.CuraAPI.theme;\n\n /** Número a ser representado no badge.\n * Apresentará 99+ para números acima desse valor.\n */\n @Prop({ reflect: true }) number: number | null;\n /**\n * Cor fundamental do design system sem profundidade.\n * Ex.: primary (padrão)\n */\n @Prop() color: string = 'primary';\n /**\n * Define o estado do badge como desabilitado ou habilitado.\n */\n @Prop() disabled: boolean = false;\n /**\n * Define o estilo visual entre solid (default), outline ou transparent.\n */\n @Prop() type: 'solid' | 'outline' | 'transparent' | string = 'solid';\n\n @State() styles = {};\n labelColor = 'primary-darker';\n bgColorName = 'primary-lighter';\n\n @Watch(\"disabled\")\n @Watch(\"color\")\n @Watch(\"type\")\n handleColorChange() {\n this.setColors();\n }\n\n setColors() {\n const color = this.color.toLowerCase();\n /** type outline and transparent */\n if (this.type === 'outline' || this.type === 'transparent') {\n this.bgColorName = this.disabled ? `neutral-medium` : `${color}-dark`;\n this.labelColor = this.bgColorName;\n /** type solid - default */\n } else {\n this.bgColorName = color === 'neutral' || this.disabled ? `neutral-pale` : `${color}-lighter`;\n this.labelColor = this.disabled ? 'neutral-medium' : `${color}-dark`;\n }\n this.styles = {\n ...this.styles,\n '--background-color': this.theme.colors.getColor(`${this.bgColorName}`),\n }\n }\n\n connectedCallback() {\n this.styles['--base-spacing'] = this.theme.spacing.getSpacing();\n this.setColors();\n }\n\n getClasses() {\n const classes = {\n 'container': true\n };\n classes[this.type.toLowerCase()] = true;\n return classes;\n }\n\n\n render() {\n return (\n <Host>\n { this.number && this.number <= 0 ? '' : (\n <div class={this.getClasses()} style={this.styles}>\n <cura-label size=\"xsmall\" line-height=\"none\" color={this.labelColor}>\n {this.number >= 100 ? '99+' : this.number}\n </cura-label>\n </div>\n )}\n </Host>\n );\n }\n}\n"],"mappings":"kDAAA,MAAMA,EAAsB,svBAC5B,MAAAC,EAAeD,E,MCMFE,EAAe,M,yBAE1BC,KAAAC,MAAQC,OAAOC,QAAQF,MAqBvBD,KAAAI,WAAa,iBACbJ,KAAAK,YAAc,kB,iCAZU,U,cAII,M,UAIiC,Q,YAE3C,E,CAOlB,iBAAAC,GACEN,KAAKO,W,CAGP,SAAAA,GACE,MAAMC,EAAQR,KAAKQ,MAAMC,cAEzB,GAAIT,KAAKU,OAAS,WAAaV,KAAKU,OAAS,cAAe,CAC1DV,KAAKK,YAAcL,KAAKW,SAAW,iBAAmB,GAAGH,SACzDR,KAAKI,WAAaJ,KAAKK,W,KAElB,CACLL,KAAKK,YAAcG,IAAU,WAAaR,KAAKW,SAAW,eAAiB,GAAGH,YAC9ER,KAAKI,WAAaJ,KAAKW,SAAW,iBAAmB,GAAGH,Q,CAE1DR,KAAKY,OAAMC,OAAAC,OAAAD,OAAAC,OAAA,GACNd,KAAKY,QAAM,CACd,qBAAsBZ,KAAKC,MAAMc,OAAOC,SAAS,GAAGhB,KAAKK,gB,CAI7D,iBAAAY,GACEjB,KAAKY,OAAO,kBAAoBZ,KAAKC,MAAMiB,QAAQC,aACnDnB,KAAKO,W,CAGP,UAAAa,GACE,MAAMC,EAAU,CACdC,UAAa,MAEfD,EAAQrB,KAAKU,KAAKD,eAAiB,KACnC,OAAOY,C,CAIT,MAAAE,GACE,OACEC,EAACC,EAAI,CAAAC,IAAA,4CACD1B,KAAK2B,QAAU3B,KAAK2B,QAAU,EAAI,GACpCH,EAAA,OAAKI,MAAO5B,KAAKoB,aAAcS,MAAO7B,KAAKY,QACzCY,EAAA,cAAYM,KAAK,SAAQ,cAAa,OAAOtB,MAAOR,KAAKI,YACtDJ,KAAK2B,QAAU,IAAM,MAAQ3B,KAAK2B,S","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as e,h as o,H as r,g as i}from"./p-fd5ed6b0.js";import{l as s}from"./p-efcb32eb.js";const a=':host{--border-radius:4px;display:inline-block;vertical-align:middle;position:relative}:host button,:host a{outline:none;box-shadow:none;box-sizing:border-box;display:flex;width:100%;align-items:center;justify-content:center;text-decoration:none !important;font-size:var(--font-size);cursor:pointer;transition:background-color 0.07s linear, box-shadow 0.07s linear, border-color 0.07s linear;border-radius:var(--border-radius);position:relative;background-color:var(--neutral-purewhite);box-sizing:border-box;border:none}:host button:focus,:host a:focus{outline:2px solid #6EA8FF}:host button::before,:host a::before{content:"";width:100%;height:100%;position:absolute;left:0px;top:0px;box-sizing:border-box;border:2px solid var(--color-border);border-radius:var(--border-radius)}:host button:not(.disabled):hover,:host a:not(.disabled):hover{background-color:var(--color-background-hover);border-color:var(--color-border-hover-pressed)}:host button:focus,:host a:focus{border-color:var(--color-border) !important}:host button.large,:host a.large{padding:calc(var(--base-spacing) * 3px) calc(var(--base-spacing) * 4px);min-height:calc(var(--base-spacing) * 11px)}:host button.medium,:host a.medium{padding:calc(var(--base-spacing) * 3px);min-height:calc(var(--base-spacing) * 10px)}:host button.small,:host a.small{padding:calc(var(--base-spacing) * 2px);min-height:calc(var(--base-spacing) * 8px)}:host button cura-label,:host a cura-label{flex:1;text-align:var(--text-align, "left")}:host button .button-container,:host a .button-container{display:flex;align-items:center;opacity:1;transition:opacity 0.2s linear;position:relative;flex-direction:row !important}:host button .button-container .badge-number,:host a .button-container .badge-number{margin-left:10px}:host button.icon-right .button-container,:host a.icon-right .button-container{flex-direction:row-reverse}:host button.justify .button-container,:host a.justify .button-container{width:100%}:host button.icon-left cura-icon,:host a.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 3px)}:host button.icon-right cura-icon,:host a.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 3px)}:host button.medium.icon-left cura-icon,:host button.small.icon-left cura-icon,:host a.medium.icon-left cura-icon,:host a.small.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 2px)}:host button.medium.icon-right cura-icon,:host button.small.icon-right cura-icon,:host a.medium.icon-right cura-icon,:host a.small.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 2px)}:host button.selected,:host a.selected{cursor:pointer;background-color:var(--color-select);border-color:var(--color-select)}:host button.selected:not(.disabled):hover,:host a.selected:not(.disabled):hover{background-color:var(--color-border-hover-pressed);border-color:var(--color-border-hover-pressed)}:host button.selected:focus,:host a.selected:focus{border-color:var(--color-select-focus) !important}:host button.selected.disabled,:host a.selected.disabled{background-color:var(--color-disable-select);border-color:var(--color-disable-select)}:host button.disabled,:host a.disabled{cursor:not-allowed;background-color:var(--neutral-white-primary-darker);border-color:var(--color-border-disable-unselect)}';const n=a;const c=class{constructor(o){t(this,o);this.onclick=e(this,"onclick",7);this.theme=window.CuraAPI.theme;this.selected=false;this.iconName=undefined;this.size="medium";this.counter=undefined;this.disabled=undefined;this.background="light";this.color="primary";this.iconPosition=undefined;this.hovered=false;this.styles={}}setColors(){const t=[{name:"--color-border",thema:this.background==="light"?`${this.color}-darker`:"neutral-white"},{name:"--color-border-hover-pressed",thema:this.background==="light"?`${this.color}-dark`:`${this.color}-light`},{name:"--color-background-hover",thema:this.background==="light"?`${this.color}-light`:`${this.color}-dark`},{name:"--color-select",thema:this.background==="light"?`${this.color}-base`:"neutral-white"},{name:"--color-select-hover-pressed",thema:this.background==="light"?`${this.color}-dark`:`${this.color}-lighter`},{name:"--color-select-focus",thema:this.background==="light"?`${this.color}-base`:`${this.color}-lighter`},{name:"--color-disable-select",thema:this.background==="light"?"neutral-white":"neutral-black"},{name:"--color-border-disable-unselect",thema:"neutral-dark"},{name:"--color-counter-disabled",thema:this.background==="light"?"neutral-pale":"neutral-black"},{name:"--color-counter",thema:!this.disabled&&"primary-lighter"}];t.forEach((t=>this.styles[t.name]=window.CuraAPI.theme.colors.getColor(t.thema)));this.styles=Object.assign({},this.styles)}getClasses(){var t;const e={};e[`${(t=this.size)===null||t===void 0?void 0:t.toLowerCase()}`]=true;e[`icon-${this.iconPosition.toLowerCase()}`]=true;e["disabled"]=this.disabled;e["selected"]=this.selected;return e}connectedCallback(){this.weights=window.CuraAPI.theme.fonts.getWeights();this.styles["--base-spacing"]=window.CuraAPI.theme.spacing.getSpacing();this.styles["--font-size"]=window.CuraAPI.theme.fonts.getSize();this.styles["--font-family"]=window.CuraAPI.theme.fonts.getFamily();this.styles["--font-weight-medium"]=this.weights.medium;this.setColors()}getLabelFontColor(){if(this.disabled)return"neutral-dark";if(this.background==="dark"){return this.selected?"neutral-black":"neutral-white"}if(this.background==="light"){return this.selected?"neutral-white":"neutral-black"}}getColorBagdeNumber(){if(this.background==="dark"&&this.disabled){return this.selected?"neutral-black":"neutral-dark"}if(this.background==="light"&&this.disabled){return"neutral-medium"}return`${this.color}-darker`}getIcon(){const t=this.size==="large"?20:16;if(this.iconPosition==="right"){return}return o("cura-icon",{name:this.iconName,size:t,color:this.getLabelFontColor()})}getCounter(){return o("cura-badge-counter",{number:this.counter,color:this.color,disabled:this.disabled||null,class:"badge-number"})}getCheckIconRight(){const t=this.size==="large"?20:16;return o("cura-icon",{name:"check",size:t,color:this.getLabelFontColor()})}handleMouseEnter(){if(this.disabled)return;this.hovered=true}handleMouseLeave(){this.hovered=false}handleClick(t){if(this.disabled)t.preventDefault();this.selected=!this.selected;this.onclick.emit({selected:this.selected})}render(){const t=s[this.size]||s["default"];return o(r,{key:"
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as e,h as o,H as r,g as i}from"./p-fd5ed6b0.js";import{l as s}from"./p-efcb32eb.js";const a=':host{--border-radius:4px;display:inline-block;vertical-align:middle;position:relative}:host button,:host a{outline:none;box-shadow:none;box-sizing:border-box;display:flex;width:100%;align-items:center;justify-content:center;text-decoration:none !important;font-size:var(--font-size);cursor:pointer;transition:background-color 0.07s linear, box-shadow 0.07s linear, border-color 0.07s linear;border-radius:var(--border-radius);position:relative;background-color:var(--neutral-purewhite);box-sizing:border-box;border:none}:host button:focus,:host a:focus{outline:2px solid #6EA8FF}:host button::before,:host a::before{content:"";width:100%;height:100%;position:absolute;left:0px;top:0px;box-sizing:border-box;border:2px solid var(--color-border);border-radius:var(--border-radius)}:host button:not(.disabled):hover,:host a:not(.disabled):hover{background-color:var(--color-background-hover);border-color:var(--color-border-hover-pressed)}:host button:focus,:host a:focus{border-color:var(--color-border) !important}:host button.large,:host a.large{padding:calc(var(--base-spacing) * 3px) calc(var(--base-spacing) * 4px);min-height:calc(var(--base-spacing) * 11px)}:host button.medium,:host a.medium{padding:calc(var(--base-spacing) * 3px);min-height:calc(var(--base-spacing) * 10px)}:host button.small,:host a.small{padding:calc(var(--base-spacing) * 2px);min-height:calc(var(--base-spacing) * 8px)}:host button cura-label,:host a cura-label{flex:1;text-align:var(--text-align, "left")}:host button .button-container,:host a .button-container{display:flex;align-items:center;opacity:1;transition:opacity 0.2s linear;position:relative;flex-direction:row !important}:host button .button-container .badge-number,:host a .button-container .badge-number{margin-left:10px}:host button.icon-right .button-container,:host a.icon-right .button-container{flex-direction:row-reverse}:host button.justify .button-container,:host a.justify .button-container{width:100%}:host button.icon-left cura-icon,:host a.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 3px)}:host button.icon-right cura-icon,:host a.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 3px)}:host button.medium.icon-left cura-icon,:host button.small.icon-left cura-icon,:host a.medium.icon-left cura-icon,:host a.small.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 2px)}:host button.medium.icon-right cura-icon,:host button.small.icon-right cura-icon,:host a.medium.icon-right cura-icon,:host a.small.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 2px)}:host button.selected,:host a.selected{cursor:pointer;background-color:var(--color-select);border-color:var(--color-select)}:host button.selected:not(.disabled):hover,:host a.selected:not(.disabled):hover{background-color:var(--color-border-hover-pressed);border-color:var(--color-border-hover-pressed)}:host button.selected:focus,:host a.selected:focus{border-color:var(--color-select-focus) !important}:host button.selected.disabled,:host a.selected.disabled{background-color:var(--color-disable-select);border-color:var(--color-disable-select)}:host button.disabled,:host a.disabled{cursor:not-allowed;background-color:var(--neutral-white-primary-darker);border-color:var(--color-border-disable-unselect)}';const n=a;const c=class{constructor(o){t(this,o);this.onclick=e(this,"onclick",7);this.theme=window.CuraAPI.theme;this.selected=false;this.iconName=undefined;this.size="medium";this.counter=undefined;this.disabled=undefined;this.background="light";this.color="primary";this.iconPosition=undefined;this.hovered=false;this.styles={}}setColors(){const t=[{name:"--color-border",thema:this.background==="light"?`${this.color}-darker`:"neutral-white"},{name:"--color-border-hover-pressed",thema:this.background==="light"?`${this.color}-dark`:`${this.color}-light`},{name:"--color-background-hover",thema:this.background==="light"?`${this.color}-light`:`${this.color}-dark`},{name:"--color-select",thema:this.background==="light"?`${this.color}-base`:"neutral-white"},{name:"--color-select-hover-pressed",thema:this.background==="light"?`${this.color}-dark`:`${this.color}-lighter`},{name:"--color-select-focus",thema:this.background==="light"?`${this.color}-base`:`${this.color}-lighter`},{name:"--color-disable-select",thema:this.background==="light"?"neutral-white":"neutral-black"},{name:"--color-border-disable-unselect",thema:"neutral-dark"},{name:"--color-counter-disabled",thema:this.background==="light"?"neutral-pale":"neutral-black"},{name:"--color-counter",thema:!this.disabled&&"primary-lighter"}];t.forEach((t=>this.styles[t.name]=window.CuraAPI.theme.colors.getColor(t.thema)));this.styles=Object.assign({},this.styles)}getClasses(){var t;const e={};e[`${(t=this.size)===null||t===void 0?void 0:t.toLowerCase()}`]=true;e[`icon-${this.iconPosition.toLowerCase()}`]=true;e["disabled"]=this.disabled;e["selected"]=this.selected;return e}connectedCallback(){this.weights=window.CuraAPI.theme.fonts.getWeights();this.styles["--base-spacing"]=window.CuraAPI.theme.spacing.getSpacing();this.styles["--font-size"]=window.CuraAPI.theme.fonts.getSize();this.styles["--font-family"]=window.CuraAPI.theme.fonts.getFamily();this.styles["--font-weight-medium"]=this.weights.medium;this.setColors()}getLabelFontColor(){if(this.disabled)return"neutral-dark";if(this.background==="dark"){return this.selected?"neutral-black":"neutral-white"}if(this.background==="light"){return this.selected?"neutral-white":"neutral-black"}}getColorBagdeNumber(){if(this.background==="dark"&&this.disabled){return this.selected?"neutral-black":"neutral-dark"}if(this.background==="light"&&this.disabled){return"neutral-medium"}return`${this.color}-darker`}getIcon(){const t=this.size==="large"?20:16;if(this.iconPosition==="right"){return}return o("cura-icon",{name:this.iconName,size:t,color:this.getLabelFontColor()})}getCounter(){return o("cura-badge-counter",{number:this.counter,color:this.color,disabled:this.disabled||null,class:"badge-number"})}getCheckIconRight(){const t=this.size==="large"?20:16;return o("cura-icon",{name:"check",size:t,color:this.getLabelFontColor()})}handleMouseEnter(){if(this.disabled)return;this.hovered=true}handleMouseLeave(){this.hovered=false}handleClick(t){if(this.disabled)t.preventDefault();this.selected=!this.selected;this.onclick.emit({selected:this.selected})}render(){const t=s[this.size]||s["default"];return o(r,{key:"4b7592b68a09c5b93ec1c9ec6b84c7e5afa06ec3"},o("button",{key:"d607a733d64f73bd4bd4405e0aeb9d7f5ceebf52",class:this.getClasses(),style:this.styles,disabled:this.disabled,onClick:t=>this.handleClick(t),onMouseEnter:()=>this.handleMouseEnter(),onMouseLeave:()=>this.handleMouseLeave()},o("div",{key:"14e2f5b7309bf6c2252c81ab2f02fb36670facf3",class:"button-container"},this.iconName?this.getIcon():null,o("cura-label",{key:"0759d70b0105a56dfa42bce78f2f5b8c33b04254",class:"label",size:t,lineHeight:"0%",color:this.getLabelFontColor(),weight:"regular"},o("slot",{key:"a9935483ee6c67b8142878672804dfb7df0d8479"})),this.counter?this.getCounter():null,this.iconPosition==="right"&&this.selected?this.getCheckIconRight():null)))}get host(){return i(this)}static get watchers(){return{background:["setColors"],color:["setColors"]}}};c.style=n;export{c as cura_button_select};
|
|
2
|
+
//# sourceMappingURL=p-545e8e55.entry.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e,h as t,H as s,g as i}from"./p-fd5ed6b0.js";const r=":host{display:block;box-sizing:border-box}.progress-bar{position:relative;display:flex;align-items:center;justify-content:center}.progress-bar span{position:absolute;display:flex}";const o=r;const a=class{constructor(t){e(this,t);this.progressColor=undefined;this.progress=undefined;this.size=40;this.strokeWidth=3.25;this.active=undefined}render(){const e=(this.size-this.strokeWidth)/2;const i=e*Math.PI*2;const r=this.progress*i/100;const o=`0 0 ${this.size} ${this.size}`;return t(s,{key:"e0da7ede087161c67c9dd0371d15030dd5107a19"},t("div",{key:"ebe68fb426b46e94b7d03ded4e8aaed852337f30",class:"progress-bar"},t("svg",{key:"ace46878d45bfbe51dae29c3020d74f43c2f5147",width:this.size,height:this.size,viewBox:o},t("circle",{key:"dbbde61a95a7f13dc14a72fe538da43953852d7b",fill:"none",stroke:"#ccc",cx:this.size/2,cy:this.size/2,r:e,"stroke-width":`${this.strokeWidth}px`}),this.active&&t("circle",{key:"272c197451a47c73cfa91d7f7578a50b26958732",fill:"none",stroke:this.progressColor,cx:this.size/2,cy:this.size/2,r:e,"stroke-width":`${this.strokeWidth}px`,transform:`rotate(-90 ${this.size/2} ${this.size/2})`,"stroke-dasharray":`${r}px ${i-r}px`,"stroke-linecap":"round",style:{transition:"all 0.5s"}})),t("span",{key:"a80f024e09fb54218fe97039459472855226c063"},t("slot",{key:"5683f5edd5b54bd852fc1036b284656bfda066c4"}))))}};a.style=o;const n=":host{display:block;box-sizing:border-box}.item-container{display:flex;gap:4px;align-items:center}";const c=n;const l=class{constructor(t){e(this,t);this.statusMap={active:{badgeColor:"info",textColor:"info-dark",icon:"",iconOnly:false},stop:{badgeColor:"error",textColor:"error-darker",icon:"alertCircle",iconOnly:true},done:{badgeColor:"success",textColor:"success-darker",icon:"checkCircle",iconOnly:true},default:{badgeColor:"neutral",textColor:"neutral",icon:"",iconOnly:false}};this.displayHeading=false;this.heading=undefined;this.label=undefined;this.status="default";this.styles={}}connectedCallback(){this.updateStyles()}getStatusProperties(){return this.statusMap[this.status]||this.statusMap.default}updateStyles(){const{fonts:e,colors:t,spacing:s}=window.CuraAPI.theme;const i=e.getWeights();this.styles={"--base-spacing":s.getSpacing(),"--neutral-purewhite":t.getColor("neutral-purewhite"),"--neutral-lighter":t.getColor("neutral-lighter"),"--neutral-base":t.getColor("neutral-base"),"--font-size":e.getSize(),"--font-color":e.getColor(),"--font-family":e.getFamily(),"--font-weight-regular":i.regular}}render(){const{badgeColor:e,textColor:i,icon:r,iconOnly:o}=this.getStatusProperties();return t(s,{key:"c226daf451d9c861d5303474ef0fc31c1602371b"},t("div",{key:"7aece988946e4bef02c597a80ea1a505c201e188",class:"item-container",style:this.styles},t("cura-badge-pill",{key:"d0362b4a4ee3c047173399ea5f7c912a5a0f7810",type:"solid",color:e,"icon-name":r,"icon-only":o,"border-radius":"50%"},this.label),this.displayHeading&&this.heading&&t("cura-paragraph",{key:"015effecdb26be22386363e77bd5a0e671701d60",marginBlock:"0",size:"xsmall",color:i},this.heading)))}get hostElement(){return i(this)}};l.style=c;export{a as cura_progress_bar,l as cura_stepper_item};
|
|
2
|
+
//# sourceMappingURL=p-557b90c4.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["curaProgressBarCss","CuraProgressBarStyle0","CuraProgressBar","render","radius","this","size","strokeWidth","circumference","Math","PI","dash","progress","viewBox","h","Host","key","class","width","height","fill","stroke","cx","cy","r","active","progressColor","transform","style","transition","curaStepperItemCss","CuraStepperItemStyle0","CuraStepperItem","statusMap","badgeColor","textColor","icon","iconOnly","stop","done","default","connectedCallback","updateStyles","getStatusProperties","status","fonts","colors","spacing","window","CuraAPI","theme","weights","getWeights","styles","getSpacing","getColor","getSize","getFamily","regular","type","color","label","displayHeading","heading","marginBlock"],"sources":["src/components/cura-stepper/cura-progress-bar/cura-progress-bar.scss?tag=cura-progress-bar&encapsulation=shadow","src/components/cura-stepper/cura-progress-bar/cura-progress-bar.tsx","src/components/cura-stepper/cura-stepper-item/cura-stepper-item.scss?tag=cura-stepper-item&encapsulation=shadow","src/components/cura-stepper/cura-stepper-item/cura-stepper-item.tsx"],"sourcesContent":[":host {\n display: block;\n box-sizing: border-box;\n}\n\n.progress-bar {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n\n & span {\n position: absolute;\n display: flex;\n }\n}","import { Component, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'cura-progress-bar',\n styleUrl: 'cura-progress-bar.scss',\n shadow: true,\n})\nexport class CuraProgressBar {\n /**\n * Defines the color of the progress bar\n */\n @Prop({ reflect: true }) progressColor: string;\n\n /**\n * Defines the percentage of progress\n */\n @Prop({ reflect: true }) progress: number;\n\n /**\n * Defines the size of the progress bar\n */\n @Prop({ reflect: true }) size: number = 40;\n\n /**\n * Defines the width of the stroke (outline) of the progress circle\n */\n @Prop({ reflect: true }) strokeWidth: number = 3.25;\n\n /**\n * Defines whether the progress bar is active\n */\n @Prop({ reflect: true }) active: boolean;\n\n render() {\n const radius = (this.size - this.strokeWidth) / 2;\n const circumference = radius * Math.PI * 2;\n const dash = (this.progress * circumference) / 100;\n\n const viewBox = `0 0 ${this.size} ${this.size}`;\n\n return (\n <Host>\n <div class=\"progress-bar\">\n <svg width={this.size} height={this.size} viewBox={viewBox}>\n <circle fill=\"none\" stroke=\"#ccc\" cx={this.size / 2} cy={this.size / 2} r={radius} stroke-width={`${this.strokeWidth}px`} />\n {this.active && (\n <circle\n fill=\"none\"\n stroke={this.progressColor}\n cx={this.size / 2}\n cy={this.size / 2}\n r={radius}\n stroke-width={`${this.strokeWidth}px`}\n transform={`rotate(-90 ${this.size / 2} ${this.size / 2})`}\n stroke-dasharray={`${dash}px ${circumference - dash}px`}\n stroke-linecap=\"round\"\n style={{ transition: 'all 0.5s' }}\n />\n )}\n </svg>\n <span>\n <slot></slot>\n </span>\n </div>\n </Host>\n );\n }\n}\n",":host {\n display: block;\n box-sizing: border-box;\n}\n\n.item-container{\n display: flex;\n gap: 4px;\n align-items: center;\n}\n","import { Component, Element, Host, Prop, State, h } from '@stencil/core';\n\n@Component({\n tag: 'cura-stepper-item',\n styleUrl: 'cura-stepper-item.scss',\n shadow: true,\n})\nexport class CuraStepperItem {\n /**\n * Determines if the step title is displayed (default: false)\n */\n @Prop({ reflect: true }) displayHeading: boolean = false;\n\n /**\n * The title of the step (displayed if `displayHeading` is true)\n */\n @Prop({ reflect: true }) heading: string;\n\n /**\n * The label displayed inside the badge\n */\n @Prop({ reflect: true }) label: string;\n\n /**\n * The current status of the step\n * Can be:\n * - 'done' for completed steps\n * - 'stop' for failed steps\n * - 'active' for the current active step\n * - 'default' for steps that are neither done, active nor stopped.\n */\n @Prop({ reflect: true }) status: 'done' | 'stop' | 'active' | 'default' = 'default';\n\n @State() styles = {};\n\n @Element() hostElement: HTMLElement;\n\n connectedCallback() {\n this.updateStyles();\n }\n\n statusMap = {\n active: {\n badgeColor: 'info',\n textColor: 'info-dark',\n icon: '',\n iconOnly: false,\n },\n stop: {\n badgeColor: 'error',\n textColor: 'error-darker',\n icon: 'alertCircle',\n iconOnly: true,\n },\n done: {\n badgeColor: 'success',\n textColor: 'success-darker',\n icon: 'checkCircle',\n iconOnly: true,\n },\n default: {\n badgeColor: 'neutral',\n textColor: 'neutral',\n icon: '',\n iconOnly: false,\n },\n };\n\n getStatusProperties() {\n return this.statusMap[this.status] || this.statusMap.default;\n }\n\n updateStyles() {\n const { fonts, colors, spacing } = window.CuraAPI.theme;\n const weights = fonts.getWeights();\n\n this.styles = {\n '--base-spacing': spacing.getSpacing(),\n '--neutral-purewhite': colors.getColor('neutral-purewhite'),\n '--neutral-lighter': colors.getColor('neutral-lighter'),\n '--neutral-base': colors.getColor('neutral-base'),\n '--font-size': fonts.getSize(),\n '--font-color': fonts.getColor(),\n '--font-family': fonts.getFamily(),\n '--font-weight-regular': weights.regular,\n };\n }\n\n render() {\n const { badgeColor, textColor, icon, iconOnly } = this.getStatusProperties();\n return (\n <Host>\n <div class=\"item-container\" style={this.styles}>\n <cura-badge-pill\n type=\"solid\"\n color={badgeColor as 'info' | 'error' | 'success' | 'neutral' | 'primary' | 'secondary' | 'accent' | 'warning'}\n icon-name={icon}\n icon-only={iconOnly}\n border-radius=\"50%\"\n >\n {this.label}\n </cura-badge-pill>\n {this.displayHeading && this.heading && (\n <cura-paragraph marginBlock=\"0\" size=\"xsmall\" color={textColor}>\n {this.heading}\n </cura-paragraph>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"yDAAA,MAAMA,EAAqB,sLAC3B,MAAAC,EAAeD,E,MCMFE,EAAe,M,wFAcc,G,iBAKO,K,sBAO/C,MAAAC,GACE,MAAMC,GAAUC,KAAKC,KAAOD,KAAKE,aAAe,EAChD,MAAMC,EAAgBJ,EAASK,KAAKC,GAAK,EACzC,MAAMC,EAAQN,KAAKO,SAAWJ,EAAiB,IAE/C,MAAMK,EAAU,OAAOR,KAAKC,QAAQD,KAAKC,OAEzC,OACEQ,EAACC,EAAI,CAAAC,IAAA,4CACHF,EAAA,OAAAE,IAAA,2CAAKC,MAAM,gBACTH,EAAA,OAAAE,IAAA,2CAAKE,MAAOb,KAAKC,KAAMa,OAAQd,KAAKC,KAAMO,QAASA,GACjDC,EAAA,UAAAE,IAAA,2CAAQI,KAAK,OAAOC,OAAO,OAAOC,GAAIjB,KAAKC,KAAO,EAAGiB,GAAIlB,KAAKC,KAAO,EAAGkB,EAAGpB,EAAM,eAAgB,GAAGC,KAAKE,kBACxGF,KAAKoB,QACJX,EAAA,UAAAE,IAAA,2CACEI,KAAK,OACLC,OAAQhB,KAAKqB,cACbJ,GAAIjB,KAAKC,KAAO,EAChBiB,GAAIlB,KAAKC,KAAO,EAChBkB,EAAGpB,EAAM,eACK,GAAGC,KAAKE,gBACtBoB,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E,IAAA,2CACE2C,KAAK,QACLC,MAAO1B,EAAuG,YACnGE,EAAI,YACJC,EAAQ,gBACL,OAEbhC,KAAKwD,OAEPxD,KAAKyD,gBAAkBzD,KAAK0D,SAC3BjD,EAAA,kBAAAE,IAAA,2CAAgBgD,YAAY,IAAI1D,KAAK,SAASsD,MAAOzB,GAClD9B,KAAK0D,U","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as a,h as o,H as e}from"./p-fd5ed6b0.js";const r=":host{display:block;box-sizing:border-box;width:100%}cura-label{padding:12px 0px;border-bottom:1px solid var(--neutral-light)}";const t=r;const s=class{constructor(o){a(this,o)}render(){return o(e,{key:"b378a877e6a90727e3216c284c2a064992f2dfc9",slot:"dropdown-search-option"},o("cura-label",{key:"e2d457a7d42bcacae09012322b19a54e44fb109f",color:"neutral-dark",size:"xsmall",lineHeight:"16px",marginBlock:"0"},o("slot",{key:"e889fa1839988a0f138e14ad15b0e250100ba38c"})))}};s.style=t;export{s as cura_dropdown_search_option_title};
|
|
2
|
+
//# sourceMappingURL=p-6624108e.entry.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,h as r,H as e}from"./p-fd5ed6b0.js";const o=':host{display:block;position:relative;width:fit-content;height:fit-content}:host .container{width:calc(var(--base-spacing) * 2px);height:calc(var(--base-spacing) * 2px);position:relative;box-sizing:border-box}:host .container::before{width:100%;height:100%;position:absolute;left:0;top:0;content:"";box-sizing:border-box;border-radius:50%;border:1px solid var(--color-dark);background:var(--color)}:host .container.disabled::before{background:var(--neutral-pale);border:1px solid var(--neutral-medium)}:host .container.outline::before{background:transparent;border:2px solid var(--color)}:host .container.outline.disabled::before{border:2px solid var(--neutral-medium)}:host .container.transparent::before{background:var(--color-dark);border:none}:host .container.transparent.disabled::before{background:var(--neutral-medium);border:none}';const a=o;const s=class{constructor(r){t(this,r);this.theme=window.CuraAPI.theme;this.color="primary";this.disabled=false;this.type="solid";this.styles={}}connectedCallback(){this.styles["--base-spacing"]=this.theme.spacing.getSpacing();this.styles["--neutral-medium"]=this.theme.colors.getColor("neutral-dark");this.styles["--neutral-pale"]=this.theme.colors.getColor("neutral-pale");this.setColors()}setColors(){this.styles=Object.assign(Object.assign({},this.styles),{"--color":this.theme.colors.getColor(`${this.color}`),"--color-dark":this.theme.colors.getColor(`${this.color}-dark`)})}getClasses(){const t={container:true,disabled:this.disabled};t[`${this.type}`]=true;return t}render(){return r(e,{key:"00e335977fbb0677db9d95bab901a012ba8a5c06"},r("div",{key:"e828743793731c986f37dd6a9f7abdc78b63932b",class:this.getClasses(),style:this.styles}))}};s.style=a;export{s as cura_badge_dot};
|
|
2
|
+
//# sourceMappingURL=p-6b627841.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["curaBadgeDotCss","CuraBadgeDotStyle0","CuraBadgeDot","this","theme","window","CuraAPI","connectedCallback","styles","spacing","getSpacing","colors","getColor","setColors","Object","assign","color","getClasses","classes","container","disabled","type","render","h","Host","key","class","style"],"sources":["src/components/badges/cura-badge-dot/cura-badge-dot.scss?tag=cura-badge-dot&encapsulation=shadow","src/components/badges/cura-badge-dot/cura-badge-dot.tsx"],"sourcesContent":["@import \"../../../scss/mixins/spacing.scss\";\n\n:host {\n display: block;\n position: relative;\n width: fit-content;\n height: fit-content;\n\n .container {\n width: #{$spacing-mini};\n height: #{$spacing-mini};\n position: relative;\n box-sizing: border-box;\n\n &::before {\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0;\n top: 0;\n content: \"\";\n box-sizing: border-box;\n border-radius: 50%;\n border: 1px solid var(--color-dark);\n background: var(--color);\n }\n\n &.disabled::before {\n background: var(--neutral-pale);\n border: 1px solid var(--neutral-medium);\n }\n\n &.outline::before {\n background: transparent;\n border: 2px solid var(--color);\n }\n &.outline.disabled::before {\n border: 2px solid var(--neutral-medium);\n }\n\n &.transparent::before {\n background: var(--color-dark);\n border: none;\n }\n &.transparent.disabled::before {\n background: var(--neutral-medium);\n border: none;\n }\n\n }\n}\n","import { Component, Host, h, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'cura-badge-dot',\n styleUrl: 'cura-badge-dot.scss',\n shadow: true,\n})\nexport class CuraBadgeDot {\n\n theme = window.CuraAPI.theme;\n\n /**\n * Cor fundamental do design system sem profundidade.\n * Ex.: primary (padrão)\n */\n @Prop() color: string = 'primary';\n /**\n * Define o estado do badge como desabilitado ou habilitado.\n */\n @Prop({reflect: true}) disabled: boolean = false;\n /**\n * Define o estilo visual entre solid (default), outline ou transparent.\n */\n @Prop({reflect: true}) type: 'solid' | 'outline' | 'transparent' | string = 'solid';\n\n @State() styles = {};\n\n\n connectedCallback() {\n this.styles['--base-spacing'] = this.theme.spacing.getSpacing();\n this.styles['--neutral-medium'] = this.theme.colors.getColor('neutral-dark');;\n this.styles['--neutral-pale'] = this.theme.colors.getColor('neutral-pale');;\n this.setColors();\n }\n\n setColors() {\n this.styles = {\n ...this.styles,\n '--color': this.theme.colors.getColor(`${this.color}`),\n '--color-dark': this.theme.colors.getColor(`${this.color}-dark`)\n }\n }\n\n getClasses() {\n const classes = {\n 'container': true,\n 'disabled': this.disabled\n };\n classes[`${this.type}`] = true;\n return classes;\n }\n\n render() {\n return (\n <Host>\n <div class={this.getClasses()} style={this.styles}></div>\n </Host>\n );\n }\n}\n"],"mappings":"kDAAA,MAAMA,EAAkB,y0BACxB,MAAAC,EAAeD,E,MCMFE,EAAY,M,yBAEvBC,KAAAC,MAAQC,OAAOC,QAAQF,M,WAMC,U,cAImB,M,UAIiC,Q,YAE1D,E,CAGlB,iBAAAG,GACEJ,KAAKK,OAAO,kBAAoBL,KAAKC,MAAMK,QAAQC,aACnDP,KAAKK,OAAO,oBAAsBL,KAAKC,MAAMO,OAAOC,SAAS,gBAC7DT,KAAKK,OAAO,kBAAoBL,KAAKC,MAAMO,OAAOC,SAAS,gBAC3DT,KAAKU,W,CAGP,SAAAA,GACEV,KAAKK,OAAMM,OAAAC,OAAAD,OAAAC,OAAA,GACNZ,KAAKK,QAAM,CACd,UAAWL,KAAKC,MAAMO,OAAOC,SAAS,GAAGT,KAAKa,SAC9C,eAAgBb,KAAKC,MAAMO,OAAOC,SAAS,GAAGT,KAAKa,e,CAIvD,UAAAC,GACE,MAAMC,EAAU,CACdC,UAAa,KACbC,SAAYjB,KAAKiB,UAEnBF,EAAQ,GAAGf,KAAKkB,QAAU,KAC1B,OAAOH,C,CAGT,MAAAI,GACE,OACEC,EAACC,EAAI,CAAAC,IAAA,4CACHF,EAAA,OAAAE,IAAA,2CAAKC,MAAOvB,KAAKc,aAAcU,MAAOxB,KAAKK,S","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,h as s,H as h,g as o}from"./p-fd5ed6b0.js";const l=":host{display:block;font-size:var(--font-size-base)}:host h1,:host h2,:host h3,:host h4,:host h5,:host h6{font-family:var(--font-family);font-size:3em;font-weight:var(--font-weight-bold);color:var(--color-body);line-height:var(--line-height);margin-block:var(--margin-block);letter-spacing:0px}:host h1.small,:host h2.small,:host h3.small,:host h4.small,:host h5.small,:host h6.small{font-size:2.2857142857em;letter-spacing:-1.68px}@media (min-width: 769px) and (max-width: 1920px){:host h1,:host h2,:host h3,:host h4,:host h5,:host h6{font-size:3.429em}:host h1.small,:host h2.small,:host h3.small,:host h4.small,:host h5.small,:host h6.small{font-size:2.8571428571em;letter-spacing:-1.92px}}@media (min-width: 1921px){:host h1,:host h2,:host h3,:host h4,:host h5,:host h6{font-size:4.286em;line-height:calc(var(--line-height) + 5%)}:host h1.small,:host h2.small,:host h3.small,:host h4.small,:host h5.small,:host h6.small{font-size:3.5714285714em;letter-spacing:-1.2px}}:host ::slotted(b),:host ::slotted(strong){font-weight:var(--font-weight-bold)}:host ::slotted(a){font-weight:var(--font-weight-bold);color:var(--color-link);text-underline-offset:10%;cursor:pointer}:host ::slotted(u){text-underline-offset:10%}:host ::slotted(i),:host ::slotted(em){font-style:italic;font-weight:var(--font-weight-medium)}:host ::slotted(abbr){color:var(--color-link);text-decoration:underline dashed 1px var(--color-link);text-underline-offset:10%;cursor:default}";const e=l;const i=class{constructor(s){t(this,s);this.theme=window.CuraAPI.theme;this.level=1;this.size="large";this.spotColor="accent-dark";this.color=undefined;this.marginBlock="1.25em";this.lineHeight="120%";this.styles={}}handleChangeColor(){this.setColors()}connectedCallback(){this.setFontProperties();this.setColors()}setFontProperties(){this.weights=this.theme.fonts.getWeights();this.fontSizeBase=this.theme.fonts.getSize();this.styles={"--font-family":window.CuraAPI.theme.fonts.getFamily("display"),"--font-size":window.CuraAPI.theme.fonts.getSize(),"--font-weight-bold":this.weights.bold,"--font-weight-medium":this.weights.medium}}hostCSSProperties(){return{"--margin-block":this.marginBlock,"--font-size-base":this.fontSizeBase,"--line-height":this.lineHeight}}setColors(){const t=this.color?this.theme.colors.getColor(this.color):this.theme.fonts.getColor();this.styles=Object.assign(Object.assign({},this.styles),{"--color-body":t||this.theme.colors.getColor("neutral-darker"),"--color-link":this.theme.colors.getColor(`${this.spotColor}`)})}getClasses(){var t;const s={};s[`${(t=this.size)===null||t===void 0?void 0:t.toLowerCase()}`]=true;return s}getHeadingTag(){const t=this.getClasses();const h={1:s("h1",{style:this.styles,class:t},s("slot",null)),2:s("h2",{style:this.styles,class:t},s("slot",null)),3:s("h3",{style:this.styles,class:t},s("slot",null)),4:s("h4",{style:this.styles,class:t},s("slot",null)),5:s("h5",{style:this.styles,class:t},s("slot",null)),6:s("h6",{style:this.styles,class:t},s("slot",null)),default:s("h1",{style:this.styles,class:t},s("slot",null))};return h[`${this.level}`]||h["default"]}render(){return s(h,{key:"
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,h as s,H as h,g as o}from"./p-fd5ed6b0.js";const l=":host{display:block;font-size:var(--font-size-base)}:host h1,:host h2,:host h3,:host h4,:host h5,:host h6{font-family:var(--font-family);font-size:3em;font-weight:var(--font-weight-bold);color:var(--color-body);line-height:var(--line-height);margin-block:var(--margin-block);letter-spacing:0px}:host h1.small,:host h2.small,:host h3.small,:host h4.small,:host h5.small,:host h6.small{font-size:2.2857142857em;letter-spacing:-1.68px}@media (min-width: 769px) and (max-width: 1920px){:host h1,:host h2,:host h3,:host h4,:host h5,:host h6{font-size:3.429em}:host h1.small,:host h2.small,:host h3.small,:host h4.small,:host h5.small,:host h6.small{font-size:2.8571428571em;letter-spacing:-1.92px}}@media (min-width: 1921px){:host h1,:host h2,:host h3,:host h4,:host h5,:host h6{font-size:4.286em;line-height:calc(var(--line-height) + 5%)}:host h1.small,:host h2.small,:host h3.small,:host h4.small,:host h5.small,:host h6.small{font-size:3.5714285714em;letter-spacing:-1.2px}}:host ::slotted(b),:host ::slotted(strong){font-weight:var(--font-weight-bold)}:host ::slotted(a){font-weight:var(--font-weight-bold);color:var(--color-link);text-underline-offset:10%;cursor:pointer}:host ::slotted(u){text-underline-offset:10%}:host ::slotted(i),:host ::slotted(em){font-style:italic;font-weight:var(--font-weight-medium)}:host ::slotted(abbr){color:var(--color-link);text-decoration:underline dashed 1px var(--color-link);text-underline-offset:10%;cursor:default}";const e=l;const i=class{constructor(s){t(this,s);this.theme=window.CuraAPI.theme;this.level=1;this.size="large";this.spotColor="accent-dark";this.color=undefined;this.marginBlock="1.25em";this.lineHeight="120%";this.styles={}}handleChangeColor(){this.setColors()}connectedCallback(){this.setFontProperties();this.setColors()}setFontProperties(){this.weights=this.theme.fonts.getWeights();this.fontSizeBase=this.theme.fonts.getSize();this.styles={"--font-family":window.CuraAPI.theme.fonts.getFamily("display"),"--font-size":window.CuraAPI.theme.fonts.getSize(),"--font-weight-bold":this.weights.bold,"--font-weight-medium":this.weights.medium}}hostCSSProperties(){return{"--margin-block":this.marginBlock,"--font-size-base":this.fontSizeBase,"--line-height":this.lineHeight}}setColors(){const t=this.color?this.theme.colors.getColor(this.color):this.theme.fonts.getColor();this.styles=Object.assign(Object.assign({},this.styles),{"--color-body":t||this.theme.colors.getColor("neutral-darker"),"--color-link":this.theme.colors.getColor(`${this.spotColor}`)})}getClasses(){var t;const s={};s[`${(t=this.size)===null||t===void 0?void 0:t.toLowerCase()}`]=true;return s}getHeadingTag(){const t=this.getClasses();const h={1:s("h1",{style:this.styles,class:t},s("slot",null)),2:s("h2",{style:this.styles,class:t},s("slot",null)),3:s("h3",{style:this.styles,class:t},s("slot",null)),4:s("h4",{style:this.styles,class:t},s("slot",null)),5:s("h5",{style:this.styles,class:t},s("slot",null)),6:s("h6",{style:this.styles,class:t},s("slot",null)),default:s("h1",{style:this.styles,class:t},s("slot",null))};return h[`${this.level}`]||h["default"]}render(){return s(h,{key:"01876449797c600a4fa37c9b4addd80855e6fc83",style:this.hostCSSProperties()},this.getHeadingTag())}get host(){return o(this)}static get watchers(){return{color:["handleChangeColor"],spotColor:["handleChangeColor"]}}};i.style=e;export{i as cura_display};
|
|
2
|
+
//# sourceMappingURL=p-70adcf7b.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,h as t,H as r,g as a}from"./p-fd5ed6b0.js";const o='.badge-container{display:flex;align-items:center;justify-content:center;gap:calc(var(--base-spacing) * 1px);padding:calc(var(--base-spacing) * 1px);border-radius:var(--border-radius);font-family:var(--font-family);font-size:var(--font-size);position:relative;box-sizing:border-box;width:fit-content;height:calc(var(--base-spacing) * 5px);min-width:calc(var(--base-spacing) * 5px);background-color:var(--color-background)}.badge-container::before{content:"";width:100%;height:100%;position:absolute;left:0px;top:0px;box-sizing:border-box;border:1px solid transparent;border-radius:var(--border-radius);pointer-events:none}.badge-container.icon-only cura-label{display:none !important}.badge-container.disabled{background-color:var(--color-background-disabled)}.badge-container.outline{background-color:transparent}.badge-container.outline::before{border:1px solid var(--color-base)}.badge-container.outline.disabled::before{border:1px solid var(--color-outline-disabled)}.badge-container.transparent{background-color:transparent}.badge-container.transparent::before{border:1px solid transparent}.badge-container.transparent.disabled{background-color:transparent}.badge-container cura-icon{display:flex}';const i=o;const s=class{constructor(t){e(this,t);this.theme=window.CuraAPI.theme;this.type="solid";this.color="primary";this.iconName=undefined;this.iconset="default";this.disabled=false;this.iconOnly=false;this.borderRadius="2px";this.styles={}}handleColorChange(){this.setColors()}connectedCallback(){this.setBaseStyles();this.setColors()}setBaseStyles(){this.styles["--base-spacing"]=this.theme.spacing.getSpacing();this.styles["--font-family"]=this.theme.fonts.getFamily();this.styles["--font-size"]=this.theme.fonts.getSize();this.styles=Object.assign({},this.styles)}setColors(){const e=[{name:"--color-background",theme:`${this.color}-lighter`},{name:"--color-base",theme:`${this.color}-dark`},{name:"--color-background-disabled",theme:"neutral-pale"},{name:"--color-outline-disabled",theme:"neutral-medium"}];e.forEach((e=>{this.styles[e.name]=this.theme.colors.getColor(e.theme)}))}hostCSSProperties(){return{"--border-radius":this.borderRadius||"2px"}}getClasses(){const e={};e["badge-container"]=true;e[`icon-only`]=this.iconOnly;e["disabled"]=this.disabled;e[`${this.type}`]=true;return e}getSymbolColor(){return this.disabled?"neutral-medium":`${this.color}-dark`}getIcon(){if(!this.iconName)return"";return t("cura-icon",{name:this.iconName,iconset:this.iconset,size:"micro",color:this.getSymbolColor()})}render(){const e=this.getSymbolColor();return t(r,{key:"
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,h as t,H as r,g as a}from"./p-fd5ed6b0.js";const o='.badge-container{display:flex;align-items:center;justify-content:center;gap:calc(var(--base-spacing) * 1px);padding:calc(var(--base-spacing) * 1px);border-radius:var(--border-radius);font-family:var(--font-family);font-size:var(--font-size);position:relative;box-sizing:border-box;width:fit-content;height:calc(var(--base-spacing) * 5px);min-width:calc(var(--base-spacing) * 5px);background-color:var(--color-background)}.badge-container::before{content:"";width:100%;height:100%;position:absolute;left:0px;top:0px;box-sizing:border-box;border:1px solid transparent;border-radius:var(--border-radius);pointer-events:none}.badge-container.icon-only cura-label{display:none !important}.badge-container.disabled{background-color:var(--color-background-disabled)}.badge-container.outline{background-color:transparent}.badge-container.outline::before{border:1px solid var(--color-base)}.badge-container.outline.disabled::before{border:1px solid var(--color-outline-disabled)}.badge-container.transparent{background-color:transparent}.badge-container.transparent::before{border:1px solid transparent}.badge-container.transparent.disabled{background-color:transparent}.badge-container cura-icon{display:flex}';const i=o;const s=class{constructor(t){e(this,t);this.theme=window.CuraAPI.theme;this.type="solid";this.color="primary";this.iconName=undefined;this.iconset="default";this.disabled=false;this.iconOnly=false;this.borderRadius="2px";this.styles={}}handleColorChange(){this.setColors()}connectedCallback(){this.setBaseStyles();this.setColors()}setBaseStyles(){this.styles["--base-spacing"]=this.theme.spacing.getSpacing();this.styles["--font-family"]=this.theme.fonts.getFamily();this.styles["--font-size"]=this.theme.fonts.getSize();this.styles=Object.assign({},this.styles)}setColors(){const e=[{name:"--color-background",theme:`${this.color}-lighter`},{name:"--color-base",theme:`${this.color}-dark`},{name:"--color-background-disabled",theme:"neutral-pale"},{name:"--color-outline-disabled",theme:"neutral-medium"}];e.forEach((e=>{this.styles[e.name]=this.theme.colors.getColor(e.theme)}));this.styles=Object.assign({},this.styles)}hostCSSProperties(){return{"--border-radius":this.borderRadius||"2px"}}getClasses(){const e={};e["badge-container"]=true;e[`icon-only`]=this.iconOnly;e["disabled"]=this.disabled;e[`${this.type}`]=true;return e}getSymbolColor(){return this.disabled?"neutral-medium":`${this.color}-dark`}getIcon(){if(!this.iconName)return"";return t("cura-icon",{name:this.iconName,iconset:this.iconset,size:"micro",color:this.getSymbolColor()})}render(){const e=this.getSymbolColor();return t(r,{key:"d2b79aa7ede4462cd2b591b62321ef69b9e4fed3",style:this.hostCSSProperties()},t("div",{key:"a82383b03c02990b5879ca647ae06cabb5c32845",class:this.getClasses(),style:this.styles},this.getIcon(),t("cura-label",{key:"1ccf493530fa6b7cee25db83d0fcb37cf308df3d",size:"xsmall","line-height":"117%",color:e},t("slot",{key:"488e4fbd8b30cfcd15b25c9227e129b1c6e1ce32"}))))}get host(){return a(this)}static get watchers(){return{color:["handleColorChange"]}}};s.style=i;export{s as cura_badge_pill};
|
|
2
|
+
//# sourceMappingURL=p-7ba80d78.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["curaBadgePillCss","CuraBadgePillStyle0","CuraBadgePill","this","theme","window","CuraAPI","handleColorChange","setColors","connectedCallback","setBaseStyles","styles","spacing","getSpacing","fonts","getFamily","getSize","Object","assign","colors","name","color","forEach","getColor","hostCSSProperties","borderRadius","getClasses","classes","iconOnly","disabled","type","getSymbolColor","getIcon","iconName","h","iconset","size","render","symbolColor","Host","key","style","class"],"sources":["src/components/badges/cura-badge-pill/cura-badge-pill.scss?tag=cura-badge-pill&encapsulation=shadow","src/components/badges/cura-badge-pill/cura-badge-pill.tsx"],"sourcesContent":["@import \"../../../scss/mixins/spacing.scss\";\n\n.badge-container {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: #{$spacing-tiny};\n padding: #{$spacing-tiny};\n border-radius: var(--border-radius);\n font-family: var(--font-family);\n font-size: var(--font-size);\n position: relative;\n box-sizing: border-box;\n width: fit-content;\n height: #{$spacing-xs};\n min-width: #{$spacing-xs};\n\n background-color: var(--color-background);\n\n &::before {\n content: \"\";\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0px;\n top: 0px;\n box-sizing: border-box;\n border: 1px solid transparent;\n border-radius: var(--border-radius);\n pointer-events: none;\n }\n\n &.icon-only {\n cura-label {\n display: none !important;\n }\n }\n\n &.disabled {\n background-color: var(--color-background-disabled);\n }\n\n &.outline {\n background-color: transparent;\n\n &::before {\n border: 1px solid var(--color-base);\n }\n\n &.disabled::before {\n border: 1px solid var(--color-outline-disabled);\n }\n }\n\n &.transparent {\n background-color: transparent;\n\n &::before {\n border: 1px solid transparent;\n }\n\n &.disabled {\n background-color: transparent;\n }\n }\n\n cura-icon {\n display: flex;\n }\n}\n","import { Component, Host, Prop, State, h, Watch, Element } from '@stencil/core';\n\n@Component({\n tag: 'cura-badge-pill',\n styleUrl: 'cura-badge-pill.scss',\n shadow: true,\n})\nexport class CuraBadgePill {\n @Element() host: HTMLElement;\n\n /**\n * Badge type: solid | outline | transparent\n */\n @Prop({ reflect: true }) type: 'solid' | 'outline' | 'transparent' = 'solid';\n\n /**\n * Color base from color scheme. Default: primary\n */\n @Prop() color: 'primary' | 'secondary' | 'accent' | 'neutral' | 'info' | 'success' | 'warning' | 'error' = 'primary';\n\n /**\n * Name of the icon to be used from iconset\n */\n @Prop({ reflect: true }) iconName: string;\n\n /**\n * Custom iconset if needed\n */\n @Prop({ reflect: true }) iconset = 'default';\n\n /**\n * Disabled state. Boolean\n */\n @Prop({ reflect: true }) disabled = false;\n\n /**\n * Set badge to icon only. Boolean\n */\n @Prop({ reflect: true }) iconOnly = false;\n\n /**\n * Set border-radius.\n */\n @Prop({ reflect: true }) borderRadius: string = \"2px\";\n\n @State() styles = {};\n\n theme = window.CuraAPI.theme;\n\n @Watch('color')\n handleColorChange() {\n this.setColors();\n }\n\n connectedCallback() {\n this.setBaseStyles();\n this.setColors();\n }\n\n private setBaseStyles() {\n this.styles['--base-spacing'] = this.theme.spacing.getSpacing();\n this.styles['--font-family'] = this.theme.fonts.getFamily();\n this.styles['--font-size'] = this.theme.fonts.getSize();\n this.styles = { ...this.styles };\n }\n\n private setColors() {\n const colors = [\n { name: '--color-background', theme: `${this.color}-lighter` },\n { name: '--color-base', theme: `${this.color}-dark` },\n { name: '--color-background-disabled', theme: 'neutral-pale' },\n { name: '--color-outline-disabled', theme: 'neutral-medium' },\n ];\n\n colors.forEach(color => {\n this.styles[color.name] = this.theme.colors.getColor(color.theme);\n });\n }\n\n hostCSSProperties() {\n return {\n '--border-radius': this.borderRadius || '2px',\n };\n }\n\n getClasses() {\n const classes = {};\n classes['badge-container'] = true;\n classes[`icon-only`] = this.iconOnly;\n classes['disabled'] = this.disabled;\n classes[`${this.type}`] = true;\n return classes;\n }\n\n getSymbolColor() {\n return this.disabled\n ? 'neutral-medium'\n : `${this.color}-dark`;\n }\n\n getIcon() {\n if (!this.iconName) return '';\n return <cura-icon\n name={this.iconName}\n iconset={this.iconset}\n size={'micro'}\n color={this.getSymbolColor()}\n />;\n }\n\n render() {\n const symbolColor = this.getSymbolColor();\n return (\n <Host style={this.hostCSSProperties()}>\n <div class={this.getClasses()} style={this.styles}>\n {this.getIcon()}\n <cura-label size='xsmall' line-height=\"117%\" color={symbolColor}>\n <slot></slot>\n </cura-label>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"yDAAA,MAAMA,EAAmB,orCACzB,MAAAC,EAAeD,E,MCMFE,EAAa,M,yBAwCxBC,KAAAC,MAAQC,OAAOC,QAAQF,M,UAlC8C,Q,WAKsC,U,qCAUxE,U,cAKC,M,cAKA,M,kBAKY,M,YAE9B,E,CAKlB,iBAAAG,GACEJ,KAAKK,W,CAGP,iBAAAC,GACEN,KAAKO,gBACLP,KAAKK,W,CAGC,aAAAE,GACNP,KAAKQ,OAAO,kBAAoBR,KAAKC,MAAMQ,QAAQC,aACnDV,KAAKQ,OAAO,iBAAmBR,KAAKC,MAAMU,MAAMC,YAChDZ,KAAKQ,OAAO,eAAiBR,KAAKC,MAAMU,MAAME,UAC9Cb,KAAKQ,OAAMM,OAAAC,OAAA,GAAQf,KAAKQ,O,CAGlB,SAAAH,GACN,MAAMW,EAAS,CACb,CAAEC,KAAM,qBAAsBhB,MAAO,GAAGD,KAAKkB,iBAC7C,CAAED,KAAM,eAAgBhB,MAAO,GAAGD,KAAKkB,cACvC,CAAED,KAAM,8BAA+BhB,MAAO,gBAC9C,CAAEgB,KAAM,2BAA4BhB,MAAO,mBAG7Ce,EAAOG,SAAQD,IACblB,KAAKQ,OAAOU,EAAMD,MAAQjB,KAAKC,MAAMe,OAAOI,SAASF,EAAMjB,MAAM,
|
|
1
|
+
{"version":3,"names":["curaBadgePillCss","CuraBadgePillStyle0","CuraBadgePill","this","theme","window","CuraAPI","handleColorChange","setColors","connectedCallback","setBaseStyles","styles","spacing","getSpacing","fonts","getFamily","getSize","Object","assign","colors","name","color","forEach","getColor","hostCSSProperties","borderRadius","getClasses","classes","iconOnly","disabled","type","getSymbolColor","getIcon","iconName","h","iconset","size","render","symbolColor","Host","key","style","class"],"sources":["src/components/badges/cura-badge-pill/cura-badge-pill.scss?tag=cura-badge-pill&encapsulation=shadow","src/components/badges/cura-badge-pill/cura-badge-pill.tsx"],"sourcesContent":["@import \"../../../scss/mixins/spacing.scss\";\n\n.badge-container {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: #{$spacing-tiny};\n padding: #{$spacing-tiny};\n border-radius: var(--border-radius);\n font-family: var(--font-family);\n font-size: var(--font-size);\n position: relative;\n box-sizing: border-box;\n width: fit-content;\n height: #{$spacing-xs};\n min-width: #{$spacing-xs};\n\n background-color: var(--color-background);\n\n &::before {\n content: \"\";\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0px;\n top: 0px;\n box-sizing: border-box;\n border: 1px solid transparent;\n border-radius: var(--border-radius);\n pointer-events: none;\n }\n\n &.icon-only {\n cura-label {\n display: none !important;\n }\n }\n\n &.disabled {\n background-color: var(--color-background-disabled);\n }\n\n &.outline {\n background-color: transparent;\n\n &::before {\n border: 1px solid var(--color-base);\n }\n\n &.disabled::before {\n border: 1px solid var(--color-outline-disabled);\n }\n }\n\n &.transparent {\n background-color: transparent;\n\n &::before {\n border: 1px solid transparent;\n }\n\n &.disabled {\n background-color: transparent;\n }\n }\n\n cura-icon {\n display: flex;\n }\n}\n","import { Component, Host, Prop, State, h, Watch, Element } from '@stencil/core';\n\n@Component({\n tag: 'cura-badge-pill',\n styleUrl: 'cura-badge-pill.scss',\n shadow: true,\n})\nexport class CuraBadgePill {\n @Element() host: HTMLElement;\n\n /**\n * Badge type: solid | outline | transparent\n */\n @Prop({ reflect: true }) type: 'solid' | 'outline' | 'transparent' = 'solid';\n\n /**\n * Color base from color scheme. Default: primary\n */\n @Prop() color: 'primary' | 'secondary' | 'accent' | 'neutral' | 'info' | 'success' | 'warning' | 'error' = 'primary';\n\n /**\n * Name of the icon to be used from iconset\n */\n @Prop({ reflect: true }) iconName: string;\n\n /**\n * Custom iconset if needed\n */\n @Prop({ reflect: true }) iconset = 'default';\n\n /**\n * Disabled state. Boolean\n */\n @Prop({ reflect: true }) disabled = false;\n\n /**\n * Set badge to icon only. Boolean\n */\n @Prop({ reflect: true }) iconOnly = false;\n\n /**\n * Set border-radius.\n */\n @Prop({ reflect: true }) borderRadius: string = \"2px\";\n\n @State() styles = {};\n\n theme = window.CuraAPI.theme;\n\n @Watch('color')\n handleColorChange() {\n this.setColors();\n }\n\n connectedCallback() {\n this.setBaseStyles();\n this.setColors();\n }\n\n private setBaseStyles() {\n this.styles['--base-spacing'] = this.theme.spacing.getSpacing();\n this.styles['--font-family'] = this.theme.fonts.getFamily();\n this.styles['--font-size'] = this.theme.fonts.getSize();\n this.styles = { ...this.styles };\n }\n\n private setColors() {\n const colors = [\n { name: '--color-background', theme: `${this.color}-lighter` },\n { name: '--color-base', theme: `${this.color}-dark` },\n { name: '--color-background-disabled', theme: 'neutral-pale' },\n { name: '--color-outline-disabled', theme: 'neutral-medium' },\n ];\n\n colors.forEach(color => {\n this.styles[color.name] = this.theme.colors.getColor(color.theme);\n });\n this.styles = { ...this.styles };\n }\n\n hostCSSProperties() {\n return {\n '--border-radius': this.borderRadius || '2px',\n };\n }\n\n getClasses() {\n const classes = {};\n classes['badge-container'] = true;\n classes[`icon-only`] = this.iconOnly;\n classes['disabled'] = this.disabled;\n classes[`${this.type}`] = true;\n return classes;\n }\n\n getSymbolColor() {\n return this.disabled\n ? 'neutral-medium'\n : `${this.color}-dark`;\n }\n\n getIcon() {\n if (!this.iconName) return '';\n return <cura-icon\n name={this.iconName}\n iconset={this.iconset}\n size={'micro'}\n color={this.getSymbolColor()}\n />;\n }\n\n render() {\n const symbolColor = this.getSymbolColor();\n return (\n <Host style={this.hostCSSProperties()}>\n <div class={this.getClasses()} style={this.styles}>\n {this.getIcon()}\n <cura-label size='xsmall' line-height=\"117%\" color={symbolColor}>\n <slot></slot>\n </cura-label>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"yDAAA,MAAMA,EAAmB,or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C,QACdC,KAAM,QACNf,MAAOlB,KAAK4B,kB,CAIhB,MAAAM,GACE,MAAMC,EAAcnC,KAAK4B,iBACzB,OACEG,EAACK,EAAI,CAAAC,IAAA,2CAACC,MAAOtC,KAAKqB,qBAChBU,EAAA,OAAAM,IAAA,2CAAKE,MAAOvC,KAAKuB,aAAce,MAAOtC,KAAKQ,QACxCR,KAAK6B,UACNE,EAAA,cAAAM,IAAA,2CAAYJ,KAAK,SAAQ,cAAa,OAAOf,MAAOiB,GAClDJ,EAAA,QAAAM,IAAA,+C","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,c as a,h as r,H as e,g as o}from"./p-fd5ed6b0.js";const i=':host{position:absolute;z-index:99999;display:block;width:fit-content;height:fit-content;box-sizing:border-box}@media (max-width: 768px){:host{width:100%}}:host .container{display:flex;box-sizing:border-box;max-width:var(--max-width);height:auto;padding:calc(var(--base-spacing) * 2px);border:1px solid var(--neutral-light);border-radius:calc(var(--base-spacing) * 1px);background-color:var(--neutral-purewhite);box-shadow:0px 4px 8px 0px var(--neutral-black-shadow, rgba(38, 38, 38, 0.16))}@media (max-width: 768px){:host .container{max-width:90%;height:fit-content;padding:calc(var(--base-spacing) * 4px) calc(var(--base-spacing) * 4px) 0 calc(var(--base-spacing) * 4px);margin:0 auto;border:2px solid;border-radius:calc(var(--base-spacing) * 3px) calc(var(--base-spacing) * 3px) 0 0;border-color:var(--neutral-light) var(--neutral-light) transparent var(--neutral-light)}}:host .container::after{content:"";position:absolute;z-index:99999;width:calc(var(--base-spacing) * 2.5px);height:calc(var(--base-spacing) * 2.5px);border:1px solid;border-radius:2px;background-color:var(--neutral-purewhite);left:var(--arrow-left);top:var(--arrow-top);border-color:var(--arrow-border-color);transform:var(--arrow-translate) rotate(45deg)}@media (max-width: 768px){:host .container::after{display:none}}:host .container .content{flex:1 1 0;display:flex;flex-direction:column;gap:calc(var(--base-spacing) * 1px)}@media (max-width: 768px){:host .container .content{padding-bottom:calc(var(--base-spacing) * 4px);border-bottom:1px dashed var(--neutral-light)}}:host .container .close-icon{margin-left:calc(var(--base-spacing) * 3px);cursor:pointer}:host .container .close-button{padding:calc(var(--base-spacing) * 2px) 0}';const s=i;const n=768;const c=class{constructor(r){t(this,r);this.tooltipClosed=a(this,"tooltipClosed",7);this.styles={};this.handleClose=()=>{this.closeContainer()};this.elementId="";this.interactive=true;this.delay=250;this.maxWidth="280px";this.position="top";this.label=undefined;this.closeButton=false;this.isMobile=false}onWindowResize(){this.setPosition(this.targetElement)}onWindowScroll(){this.setPosition(this.targetElement)}connectedCallback(){this.setStyle()}render(){return r(e,{key:"3fe89da4d5b3a2830d4ab6a88e705b4cf2433289",role:"tooltip",id:this.elementId},r("div",{key:"6cece3dcbf275a851e0d53cb154b9dcf50a76948",class:"container",style:this.styles},r("div",{key:"802840b89feb6c4d89303da156f6f130e552a83b",class:"content"},r("cura-heading",{key:"ea98692d4fc34f05dcf8fcd5c325b8a1cd408226",level:4,size:"xsmall",color:"neutral-black",weight:"bold","margin-block":"0"},this.label),r("cura-paragraph",{key:"38bb7bf9f0a837813b490062ba5645f7148ac74b",color:"neutral-dark","spot-color":"secondary-darker",size:"xsmall",marginBlock:"0",lineHeight:"133.33%"},r("slot",{key:"960b6b6d8ee4636a31c2058aa4779050973e143e"}))),this.closeButton&&!this.isMobile&&r("cura-icon",{key:"d0bf72702fa8d24d1f5fac6fa473747bdaadcdaf",class:"close-icon",name:"close",size:16,color:"error-dark",onClick:this.handleClose}),this.isMobile&&r("cura-button-transparent",{key:"2213a6353b3d326ecde2e9eefe84811bd3161727",class:"close-button",size:"small",type:"button",color:"error","icon-name":"close","icon-position":"right",onClick:this.handleClose},"OK, entendi.")))}componentDidLoad(){var t,a,r,e,o;this.targetElement=document.querySelector(`[aria-labelledby="${this.elementId}"]`);if(!this.interactive){this.host.style.visibility="visible"}else{this.host.style.visibility="hidden";let i=null;let s=null;(t=this.targetElement)===null||t===void 0?void 0:t.addEventListener("mouseenter",(()=>{clearTimeout(s);i=setTimeout((()=>{this.host.style.visibility="visible"}),typeof this.delay==="number"&&this.delay>250?this.delay:250)}));(a=this.targetElement)===null||a===void 0?void 0:a.addEventListener("mouseleave",(()=>{clearTimeout(i);s=setTimeout((()=>{this.handleClose()}),typeof this.delay==="number"&&this.delay>250?this.delay:250)}));(r=this.host)===null||r===void 0?void 0:r.addEventListener("mouseenter",(()=>{if(window.getComputedStyle(this.host).visibility==="visible"){clearTimeout(s)}}));(e=this.host)===null||e===void 0?void 0:e.addEventListener("mouseleave",(()=>{clearTimeout(i);this.handleClose()}));(o=this.targetElement)===null||o===void 0?void 0:o.addEventListener("click",(()=>{if(window.getComputedStyle(this.host).visibility==="hidden"){i=setTimeout((()=>{this.host.style.visibility="visible"}),typeof this.delay==="number"&&this.delay>250?this.delay:250)}else{clearTimeout(i);this.handleClose()}}));document===null||document===void 0?void 0:document.addEventListener("click",(t=>{if(!this.targetElement.contains(t.target)&&!this.host.contains(t.target)){clearTimeout(i);this.handleClose()}}))}setTimeout((()=>{this.setPosition(this.targetElement)}),100)}setStyle(){this.styles=Object.assign(Object.assign({},this.styles),{"--max-width":this.maxWidth,"--base-spacing":window.CuraAPI.theme.spacing.getSpacing(),"--neutral-purewhite":window.CuraAPI.theme.colors.getColor(`neutral-purewhite`),"--neutral-light":window.CuraAPI.theme.colors.getColor(`neutral-light`),"--neutral-black-shadow":window.CuraAPI.theme.colors.getColor(`neutral-black`,.16)})}getClasses(){const[t,a]=this.position.split("-");const r={};r["container"]=true;if(t){r[t]=true}if(a){r[a]=true}return r}setPosition(t){const a=window.innerWidth;const r=window.innerHeight;const e=this.host.shadowRoot.querySelector(".container");this.isMobile=a<=n;this.host.style.position=this.isMobile?"fixed":"absolute";this.host.style.bottom=this.isMobile?"0":"unset";e.style.flexDirection=this.isMobile?"column":"row";if(this.isMobile){this.host.style.left="0";this.host.style.top="unset";return}const o={top:t.offsetTop,left:t.offsetLeft,width:t.offsetWidth,height:t.offsetHeight};const i=this.host.getBoundingClientRect();const s=10;const c=10;const l=o.width*.5+18;const d=o.height*.5+18;const h=this.styles["--neutral-light"];let p=0;let b=0;const f=Object.keys(this.getClasses()).filter((t=>["top","left","bottom","right","start","end"].includes(t)));const u=({arrowTop:t="",arrowLeft:a="",translate:r="",borderColor:e=""})=>{if(a)this.host.style.setProperty("--arrow-left",a);if(t)this.host.style.setProperty("--arrow-top",t);if(r)this.host.style.setProperty("--arrow-translate",r);if(e)this.host.style.setProperty("--arrow-border-color",e)};if(f.includes("top")||f.includes("bottom")){u({arrowLeft:"50%",translate:"translateX(-50%)"});if(f.includes("top")){b=o.top-i.height-c;u({arrowTop:"calc(100% - 6px)",borderColor:`transparent ${h} ${h} transparent`});if(b<s){b=o.top+o.height+c;u({arrowTop:"-6px",borderColor:`${h} transparent transparent ${h}`})}}if(f.includes("bottom")){b=o.top+o.height+c;u({arrowTop:"-6px",borderColor:`${h} transparent transparent ${h}`});if(b+i.height>r-s){b=o.top-i.height-c;u({arrowTop:"calc(100% - 6px)",borderColor:`transparent ${h} ${h} transparent`})}}p=o.left+(o.width-i.width)/2;if(f.includes("start")){p=o.left-i.width+l;u({arrowLeft:"calc(100% - 18px)"});if(p<s){p=o.left+o.width-l;u({arrowLeft:"18px"})}}if(f.includes("end")){p=o.left+o.width-l;u({arrowLeft:"18px"});if(p+i.width>a-s){p=o.left-i.width+l;u({arrowLeft:"calc(100% - 18px)"})}}}if(f.includes("right")||f.includes("left")){u({arrowTop:"50%",translate:"translateY(-50%)"});if(f.includes("right")){p=o.left+o.width+c;u({arrowLeft:"-6px",borderColor:`transparent transparent ${h} ${h}`});if(p+i.width>a-s){p=o.left-i.width-c;u({arrowLeft:"calc(100% - 6px)",borderColor:`${h} ${h} transparent transparent`})}}if(f.includes("left")){p=o.left-i.width-c;u({arrowLeft:"calc(100% - 6px)",borderColor:`${h} ${h} transparent transparent`});if(p<s){p=o.left+o.width+c;u({arrowLeft:"-6px",borderColor:`transparent transparent ${h} ${h}`})}}b=o.top+(o.height-i.height)/2;if(f.includes("start")){b=o.top-i.height+d;u({arrowTop:"calc(100% - 18px)"});if(b<s){b=o.top+o.height-d;u({arrowTop:"18px"})}}if(f.includes("end")){b=o.top+o.height-d;u({arrowTop:"18px"});if(b+i.height>r-s){b=o.top-i.height+d;u({arrowTop:"calc(100% - 18px)"})}}}this.host.style.left=`${p}px`;this.host.style.top=`${b}px`}closeContainer(){this.host.style.visibility="hidden";this.tooltipClosed.emit()}get host(){return o(this)}};c.style=s;export{c as cura_tooltip};
|
|
2
|
+
//# sourceMappingURL=p-8622c492.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["curaTooltipCss","CuraTooltipStyle0","BREAKPOINT_SMALL_MAX","CuraTooltip","this","styles","handleClose","closeContainer","onWindowResize","setPosition","targetElement","onWindowScroll","connectedCallback","setStyle","render","h","Host","key","role","id","elementId","class","style","level","size","color","weight","label","marginBlock","lineHeight","closeButton","isMobile","name","onClick","type","componentDidLoad","document","querySelector","interactive","host","visibility","openTimeoutID","closeTimeoutID","_a","addEventListener","clearTimeout","setTimeout","delay","_b","_c","window","getComputedStyle","_d","_e","event","contains","target","Object","assign","maxWidth","CuraAPI","theme","spacing","getSpacing","colors","getColor","getClasses","firstPosition","secondPosition","position","split","classes","element","windowWidth","innerWidth","windowHeight","innerHeight","container","shadowRoot","bottom","flexDirection","left","top","elementRect","offsetTop","offsetLeft","width","offsetWidth","height","offsetHeight","tooltipRect","getBoundingClientRect","SCREEN_LIMIT","SPACE_TO_ELEMENT","ARROW_HORIZONTAL_ADJUSTMENT","ARROW_VERTICAL_ADJUSTMENT","BORDER_COLOR","positions","keys","filter","p","includes","setArrowProperties","arrowTop","arrowLeft","translate","borderColor","setProperty","tooltipClosed","emit"],"sources":["src/components/cura-tooltip/cura-tooltip.scss?tag=cura-tooltip&encapsulation=shadow","src/components/cura-tooltip/cura-tooltip.tsx"],"sourcesContent":["@import '../../../src/scss/mixins/responsive.scss';\n@import '../../../src/scss/mixins/shadows.scss';\n@import '../../../src/scss/mixins/spacing.scss';\n\n:host {\n position: absolute;\n z-index: 99999;\n display: block;\n width: fit-content;\n height: fit-content;\n box-sizing: border-box;\n\n @include mobile-only() {\n width: 100%;\n }\n\n .container {\n display: flex;\n box-sizing: border-box;\n max-width: var(--max-width);\n height: auto;\n padding: calc(#{$base-spacing} * 2px);\n border: 1px solid var(--neutral-light);\n border-radius: calc(#{$base-spacing} * 1px);\n background-color: var(--neutral-purewhite);\n @include shadow-level3(--neutral-black-shadow);\n\n @include mobile-only() {\n max-width: 90%;\n height: fit-content;\n padding: calc(#{$base-spacing} * 4px) calc(#{$base-spacing} * 4px) 0 calc(#{$base-spacing} * 4px);\n margin: 0 auto;\n border: 2px solid;\n border-radius: calc(#{$base-spacing} * 3px) calc(#{$base-spacing} * 3px) 0 0;\n border-color: var(--neutral-light) var(--neutral-light) transparent var(--neutral-light);\n }\n\n &::after {\n content: '';\n position: absolute;\n z-index: 99999;\n width: calc(#{$base-spacing} * 2.5px);\n height: calc(#{$base-spacing} * 2.5px);\n border: 1px solid;\n border-radius: 2px;\n background-color: var(--neutral-purewhite);\n \n left: var(--arrow-left);\n top: var(--arrow-top);\n border-color: var(--arrow-border-color);\n transform: var(--arrow-translate) rotate(45deg);\n\n @include mobile-only() {\n display: none;\n }\n }\n\n .content {\n flex: 1 1 0;\n display: flex;\n flex-direction: column;\n gap: calc(#{$base-spacing} * 1px);\n\n @include mobile-only() {\n padding-bottom: calc(#{$base-spacing} * 4px);\n border-bottom: 1px dashed var(--neutral-light);\n }\n }\n\n .close-icon {\n margin-left: calc(#{$base-spacing} * 3px);\n cursor: pointer;\n }\n\n .close-button {\n padding: calc(#{$base-spacing} * 2px) 0;\n }\n }\n}","import { Component, Element, EventEmitter, Host, Prop, State, h, Event, Listen } from '@stencil/core';\n\nconst BREAKPOINT_SMALL_MAX = 768;\n\n@Component({\n tag: 'cura-tooltip',\n styleUrl: 'cura-tooltip.scss',\n shadow: true,\n})\nexport class CuraTooltip {\n @Element() host: HTMLElement;\n\n @Prop() elementId = '';\n @Prop() interactive = true;\n @Prop() delay = 250;\n @Prop() maxWidth = '280px';\n @Prop({ reflect: true }) position: 'top-start' | 'top' | 'top-end' | 'right-start' | 'right' | 'right-end' | 'bottom-start' | 'bottom' | 'bottom-end' | 'left-start' | 'left' | 'left-end' = 'top';\n @Prop({ reflect: true }) label: string;\n @Prop({ reflect: true }) closeButton = false;\n\n @State() isMobile = false;\n\n @Event({ eventName: 'tooltipClosed' }) tooltipClosed: EventEmitter<void>;\n\n targetElement: HTMLElement;\n\n styles = {};\n\n @Listen('resize', { target: 'window' })\n onWindowResize() {\n this.setPosition(this.targetElement);\n }\n\n @Listen('scroll', { target: 'window' })\n onWindowScroll() {\n this.setPosition(this.targetElement);\n }\n\n connectedCallback() {\n this.setStyle();\n }\n\n render() {\n return (\n <Host role=\"tooltip\" id={this.elementId}>\n <div class=\"container\" style={this.styles}>\n <div class=\"content\">\n <cura-heading level={4} size=\"xsmall\" color=\"neutral-black\" weight=\"bold\" margin-block=\"0\">\n {this.label}\n </cura-heading>\n <cura-paragraph color=\"neutral-dark\" spot-color=\"secondary-darker\" size=\"xsmall\" marginBlock=\"0\" lineHeight=\"133.33%\">\n <slot></slot>\n </cura-paragraph>\n </div>\n {this.closeButton && !this.isMobile && <cura-icon class=\"close-icon\" name=\"close\" size={16} color=\"error-dark\" onClick={this.handleClose}></cura-icon>}\n {this.isMobile && <cura-button-transparent class=\"close-button\" size=\"small\" type=\"button\" color=\"error\" icon-name=\"close\" icon-position=\"right\" onClick={this.handleClose}>OK, entendi.</cura-button-transparent>}\n </div>\n </Host>\n );\n }\n\n componentDidLoad() {\n this.targetElement = document.querySelector(`[aria-labelledby=\"${this.elementId}\"]`) as HTMLElement;\n\n if (!this.interactive) {\n this.host.style.visibility = 'visible';\n } else {\n this.host.style.visibility = 'hidden';\n\n let openTimeoutID = null;\n let closeTimeoutID = null;\n\n this.targetElement?.addEventListener('mouseenter', () => {\n clearTimeout(closeTimeoutID);\n openTimeoutID = setTimeout(() => {\n this.host.style.visibility = 'visible';\n }, typeof this.delay === 'number' && this.delay > 250 ? this.delay : 250);\n });\n \n this.targetElement?.addEventListener('mouseleave', () => {\n clearTimeout(openTimeoutID);\n closeTimeoutID = setTimeout(() => {\n this.handleClose();\n }, typeof this.delay === 'number' && this.delay > 250 ? this.delay : 250);\n });\n\n this.host?.addEventListener('mouseenter', () => {\n if (window.getComputedStyle(this.host).visibility === 'visible') {\n clearTimeout(closeTimeoutID);\n }\n });\n\n this.host?.addEventListener('mouseleave', () => {\n clearTimeout(openTimeoutID);\n this.handleClose();\n });\n\n this.targetElement?.addEventListener('click', () => {\n if (window.getComputedStyle(this.host).visibility === 'hidden') {\n openTimeoutID = setTimeout(() => {\n this.host.style.visibility = 'visible';\n }, typeof this.delay === 'number' && this.delay > 250 ? this.delay : 250);\n } else {\n clearTimeout(openTimeoutID);\n this.handleClose();\n }\n });\n \n document?.addEventListener('click', (event: MouseEvent) => {\n if(!this.targetElement.contains(event.target as HTMLElement) && !this.host.contains(event.target as HTMLElement)) {\n clearTimeout(openTimeoutID);\n this.handleClose();\n }\n });\n }\n\n setTimeout(() => {\n this.setPosition(this.targetElement);\n }, 100);\n }\n\n setStyle() {\n this.styles = {\n ...this.styles,\n '--max-width': this.maxWidth,\n '--base-spacing': window.CuraAPI.theme.spacing.getSpacing(),\n '--neutral-purewhite': window.CuraAPI.theme.colors.getColor(`neutral-purewhite`),\n '--neutral-light': window.CuraAPI.theme.colors.getColor(`neutral-light`),\n '--neutral-black-shadow': window.CuraAPI.theme.colors.getColor(`neutral-black`, 0.16),\n }\n }\n\n getClasses() {\n const [firstPosition, secondPosition] = this.position.split('-');\n const classes = {};\n\n classes['container'] = true;\n if (firstPosition) { classes[firstPosition] = true; }\n if (secondPosition) { classes[secondPosition] = true; }\n\n return classes;\n }\n\n setPosition(element: HTMLElement) {\n const windowWidth = window.innerWidth;\n const windowHeight = window.innerHeight;\n const container = this.host.shadowRoot.querySelector('.container') as HTMLElement;\n\n this.isMobile = windowWidth <= BREAKPOINT_SMALL_MAX;\n\n this.host.style.position = this.isMobile ? 'fixed' : 'absolute';\n this.host.style.bottom = this.isMobile ? '0' : 'unset';\n container.style.flexDirection = this.isMobile ? 'column' : 'row';\n\n if (this.isMobile) {\n this.host.style.left = '0';\n this.host.style.top = 'unset';\n return;\n }\n\n const elementRect = { \n top: element.offsetTop, \n left: element.offsetLeft, \n width: element.offsetWidth, \n height: element.offsetHeight\n };\n const tooltipRect = this.host.getBoundingClientRect();\n\n const SCREEN_LIMIT = 10;\n const SPACE_TO_ELEMENT = 10;\n const ARROW_HORIZONTAL_ADJUSTMENT = (elementRect.width * 0.5) + 18;\n const ARROW_VERTICAL_ADJUSTMENT = (elementRect.height * 0.5) + 18;\n const BORDER_COLOR = this.styles['--neutral-light'];\n\n let left = 0;\n let top = 0;\n\n const positions = Object.keys(this.getClasses()).filter((p) => ['top', 'left', 'bottom', 'right', 'start', 'end'].includes(p));\n\n const setArrowProperties = ({ arrowTop = '', arrowLeft = '', translate = '', borderColor = '' }) => {\n if (arrowLeft) this.host.style.setProperty('--arrow-left', arrowLeft);\n if (arrowTop) this.host.style.setProperty('--arrow-top', arrowTop);\n if (translate) this.host.style.setProperty('--arrow-translate', translate);\n if (borderColor) this.host.style.setProperty('--arrow-border-color', borderColor);\n };\n\n //Posicionamento vertical\n if (positions.includes('top') || positions.includes('bottom')) {\n setArrowProperties({ arrowLeft: '50%', translate: 'translateX(-50%)' });\n\n if (positions.includes('top')) {\n top = elementRect.top - tooltipRect.height - SPACE_TO_ELEMENT;\n setArrowProperties({ arrowTop: 'calc(100% - 6px)', borderColor: `transparent ${BORDER_COLOR} ${BORDER_COLOR} transparent` });\n\n if (top < SCREEN_LIMIT) {\n top = elementRect.top + elementRect.height + SPACE_TO_ELEMENT;\n setArrowProperties({ arrowTop: '-6px', borderColor: `${BORDER_COLOR} transparent transparent ${BORDER_COLOR}` });\n }\n }\n\n if (positions.includes('bottom')) {\n top = elementRect.top + elementRect.height + SPACE_TO_ELEMENT;\n setArrowProperties({ arrowTop: '-6px', borderColor: `${BORDER_COLOR} transparent transparent ${BORDER_COLOR}` });\n\n if (top + tooltipRect.height > windowHeight - SCREEN_LIMIT) {\n top = elementRect.top - tooltipRect.height - SPACE_TO_ELEMENT;\n setArrowProperties({ arrowTop: 'calc(100% - 6px)', borderColor: `transparent ${BORDER_COLOR} ${BORDER_COLOR} transparent` });\n }\n }\n\n left = elementRect.left + (elementRect.width - tooltipRect.width)/2;\n \n if (positions.includes('start')) {\n left = elementRect.left - tooltipRect.width + ARROW_HORIZONTAL_ADJUSTMENT;\n setArrowProperties({ arrowLeft: 'calc(100% - 18px)' });\n\n if (left < SCREEN_LIMIT) {\n left = elementRect.left + elementRect.width - ARROW_HORIZONTAL_ADJUSTMENT;\n setArrowProperties({ arrowLeft: '18px' });\n }\n }\n\n if (positions.includes('end')) {\n left = elementRect.left + elementRect.width - ARROW_HORIZONTAL_ADJUSTMENT;\n setArrowProperties({ arrowLeft: '18px' });\n\n if (left + tooltipRect.width > windowWidth - SCREEN_LIMIT) {\n left = elementRect.left - tooltipRect.width + ARROW_HORIZONTAL_ADJUSTMENT;\n setArrowProperties({ arrowLeft: 'calc(100% - 18px)' });\n }\n }\n }\n\n //Posicionamento horizontal\n if (positions.includes('right') || positions.includes('left')) {\n setArrowProperties({ arrowTop: '50%', translate: 'translateY(-50%)' });\n\n if (positions.includes('right')) {\n left = elementRect.left + elementRect.width + SPACE_TO_ELEMENT;\n setArrowProperties({ arrowLeft: '-6px', borderColor: `transparent transparent ${BORDER_COLOR} ${BORDER_COLOR}` });\n\n if (left + tooltipRect.width > windowWidth - SCREEN_LIMIT) {\n left = elementRect.left - tooltipRect.width - SPACE_TO_ELEMENT;\n setArrowProperties({ arrowLeft: 'calc(100% - 6px)', borderColor: `${BORDER_COLOR} ${BORDER_COLOR} transparent transparent` });\n }\n }\n\n if (positions.includes('left')) {\n left = elementRect.left - tooltipRect.width - SPACE_TO_ELEMENT;\n setArrowProperties({ arrowLeft: 'calc(100% - 6px)', borderColor: `${BORDER_COLOR} ${BORDER_COLOR} transparent transparent` });\n \n if (left < SCREEN_LIMIT) {\n left = elementRect.left + elementRect.width + SPACE_TO_ELEMENT;\n setArrowProperties({ arrowLeft: '-6px', borderColor: `transparent transparent ${BORDER_COLOR} ${BORDER_COLOR}` });\n }\n }\n \n top = elementRect.top + (elementRect.height - tooltipRect.height)/2;\n\n if (positions.includes('start')) {\n top = elementRect.top - tooltipRect.height + ARROW_VERTICAL_ADJUSTMENT;\n setArrowProperties({ arrowTop: 'calc(100% - 18px)' });\n\n if (top < SCREEN_LIMIT) {\n top = elementRect.top + elementRect.height - ARROW_VERTICAL_ADJUSTMENT;\n setArrowProperties({ arrowTop: '18px' });\n }\n }\n\n if (positions.includes('end')) {\n top = elementRect.top + elementRect.height - ARROW_VERTICAL_ADJUSTMENT;\n setArrowProperties({ arrowTop: '18px' });\n\n if (top + tooltipRect.height > windowHeight - SCREEN_LIMIT) {\n top = elementRect.top - tooltipRect.height + ARROW_VERTICAL_ADJUSTMENT;\n setArrowProperties({ arrowTop: 'calc(100% - 18px)' });\n }\n }\n }\n\n this.host.style.left = `${left}px`;\n this.host.style.top = `${top}px`;\n }\n\n closeContainer() {\n this.host.style.visibility = 'hidden';\n this.tooltipClosed.emit();\n }\n\n handleClose = () => {\n this.closeContainer();\n };\n}\n"],"mappings":"gEAAA,MAAMA,EAAiB,grDACvB,MAAAC,EAAeD,ECCf,MAAME,EAAuB,I,MAOhBC,EAAW,M,sEAiBtBC,KAAAC,OAAS,GAuQTD,KAAAE,YAAc,KACZF,KAAKG,gBAAgB,E,eAtRH,G,iBACE,K,WACN,I,cACG,Q,cAC0K,M,sCAEtJ,M,cAEnB,K,CASpB,cAAAC,GACEJ,KAAKK,YAAYL,KAAKM,c,CAIxB,cAAAC,GACEP,KAAKK,YAAYL,KAAKM,c,CAGxB,iBAAAE,GACER,KAAKS,U,C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AC7BnB,EAAMC,EAAYD,IAAMC,EAAYK,OAASO,EAC7CO,EAAmB,CAAEC,SAAU,SAE/B,GAAIrB,EAAMQ,EAAYF,OAASb,EAAeiB,EAAc,CAC1DV,EAAMC,EAAYD,IAAMQ,EAAYF,OAASO,EAC7CO,EAAmB,CAAEC,SAAU,qB,GAKrCnG,KAAKmC,KAAKjB,MAAM2D,KAAO,GAAGA,MAC1B7E,KAAKmC,KAAKjB,MAAM4D,IAAM,GAAGA,K,CAG3B,cAAA3E,GACEH,KAAKmC,KAAKjB,MAAMkB,WAAa,SAC7BpC,KAAKwG,cAAcC,M","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as a,h as e,H as t}from"./p-fd5ed6b0.js";const s=":host .container{display:flex;flex-direction:column;justify-content:center;align-items:center;width:calc(var(--base-spacing) * 10px);height:calc(var(--base-spacing) * 10px);border-radius:calc(var(--base-spacing) * 1px);background:var(--neutral-pale)}";const c=s;const i=class{constructor(e){a(this,e);this.isThousandRounded=false;this.theme=window.CuraAPI.theme;this.distance=0;this.label="km";this.styles={};this.displayDistance=0}formatDistance(){const a=this.distance%1!==0?parseFloat(this.distance.toFixed(1)):this.distance;this.isThousandRounded=Math.abs(a)>=1e3;this.displayDistance=this.isThousandRounded?parseFloat((a/1e3).toFixed(1)):a}connectedCallback(){this.setCssProperties();this.formatDistance()}render(){return e(t,{key:"cdc206deecbed2e069befda5d21ddcaf03049afc"},e("div",{key:"d22d2b5b97964281e8588fbc17a66f3fddcd875e",class:"container",style:this.styles},e("cura-label",{key:"0d54ab1ad403ba23a57fb78a422ed8c577cd627e",size:"xsmall",weight:"bold",color:"neutral-black"},this.displayDistance,this.isThousandRounded?"K":""),e("cura-label",{key:"d4929a67484bbfd6d6f3edce82414951ea4778c8",size:"xsmall",weight:"bold",color:"neutral-dark"},this.label)))}setCssProperties(){this.styles={"--neutral-pale":this.theme.colors.getColor(`neutral-pale`),"--base-spacing":this.theme.spacing.getSpacing()}}static get watchers(){return{distance:["formatDistance"]}}};i.style=c;export{i as cura_badge_distance};
|
|
2
|
+
//# sourceMappingURL=p-935eeb7b.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["curaBadgeDistanceCss","CuraBadgeDistanceStyle0","CuraDistance","this","isThousandRounded","theme","window","CuraAPI","formatDistance","roundedDistance","distance","parseFloat","toFixed","Math","abs","displayDistance","connectedCallback","setCssProperties","render","h","Host","key","class","style","styles","size","weight","color","label","colors","getColor","spacing","getSpacing"],"sources":["src/components/badges/cura-badge-distance/cura-badge-distance.scss?tag=cura-badge-distance&encapsulation=shadow","src/components/badges/cura-badge-distance/cura-badge-distance.tsx"],"sourcesContent":["@import \"../../../scss/mixins/spacing.scss\";\n\n:host {\n .container{\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: calc(#{$base-spacing} * 10px);\n height: calc(#{$base-spacing} * 10px);\n border-radius: calc(#{$base-spacing} * 1px);\n background: var(--neutral-pale);\n }\n}\n","import { Component, Host, Prop, State, Watch, h } from '@stencil/core';\n\n@Component({\n tag: 'cura-badge-distance',\n styleUrl: 'cura-badge-distance.scss',\n shadow: true,\n})\nexport class CuraDistance {\n\n @Prop() distance = 0;\n @Prop({ reflect: true }) label = 'km';\n @State() styles = {};\n @State() displayDistance = 0;\n isThousandRounded = false;\n\n theme = window.CuraAPI.theme;\n\n @Watch('distance')\n formatDistance() {\n const roundedDistance = this.distance % 1 !== 0 ? parseFloat(this.distance.toFixed(1)) : this.distance; \n this.isThousandRounded = Math.abs(roundedDistance) >= 1000;\n this.displayDistance = this.isThousandRounded ? parseFloat((roundedDistance / 1000).toFixed(1)) : roundedDistance;\n }\n\n\n connectedCallback(){\n this.setCssProperties();\n this.formatDistance(); \n }\n\n render() {\n return (\n <Host>\n <div class=\"container\" style={this.styles}>\n <cura-label size='xsmall' weight='bold' color='neutral-black'>\n {this.displayDistance}{this.isThousandRounded ? 'K' : ''}\n </cura-label>\n <cura-label size='xsmall' weight='bold' color='neutral-dark'>\n {this.label}\n </cura-label>\n </div>\n </Host>\n );\n }\n\n setCssProperties() {\n this.styles = {\n '--neutral-pale': this.theme.colors.getColor(`neutral-pale`),\n '--base-spacing': this.theme.spacing.getSpacing()\n }\n }\n\n}\n"],"mappings":"kDAAA,MAAMA,EAAuB,6PAC7B,MAAAC,EAAeD,E,MCMFE,EAAY,M,yBAMvBC,KAAAC,kBAAoB,MAEpBD,KAAAE,MAAQC,OAAOC,QAAQF,M,cANJ,E,WACc,K,YACf,G,qBACS,C,CAM3B,cAAAG,GACE,MAAMC,EAAkBN,KAAKO,SAAW,IAAM,EAAIC,WAAWR,KAAKO,SAASE,QAAQ,IAAMT,KAAKO,SAC9FP,KAAKC,kBAAoBS,KAAKC,IAAIL,IAAoB,IACtDN,KAAKY,gBAAkBZ,KAAKC,kBAAoBO,YAAYF,EAAkB,KAAMG,QAAQ,IAAMH,C,CAIpG,iBAAAO,GACEb,KAAKc,mBACLd,KAAKK,gB,CAGP,MAAAU,GACE,OACEC,EAACC,EAAI,CAAAC,IAAA,4CACHF,EAAA,OAAAE,IAAA,2CAAKC,MAAM,YAAYC,MAAOpB,KAAKqB,QACjCL,EAAA,cAAAE,IAAA,2CAAYI,KAAK,SAASC,OAAO,OAAOC,MAAM,iBAC3CxB,KAAKY,gBAAiBZ,KAAKC,kBAAoB,IAAM,IAExDe,EAAA,cAAAE,IAAA,2CAAYI,KAAK,SAASC,OAAO,OAAOC,MAAM,gBAC3CxB,KAAKyB,Q,CAOhB,gBAAAX,GACEd,KAAKqB,OAAS,CACZ,iBAAkBrB,KAAKE,MAAMwB,OAAOC,SAAS,gBAC7C,iBAAkB3B,KAAKE,MAAM0B,QAAQC,a","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,c as s,h as
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,c as s,h as t,H as c,g as a}from"./p-fd5ed6b0.js";const i=":host{display:block;box-sizing:border-box}:host .conteiner{display:flex;box-sizing:border-box;padding:calc(var(--base-spacing) * 3px);gap:calc(var(--base-spacing) * 3px);flex-shrink:0;border:1px solid var(--color-base);border-radius:4px;background-color:var(--color-lighter)}:host .conteiner.floating{box-shadow:0px 4px 8px 0px rgba(38, 38, 38, 0.16)}:host .content{flex:1;flex-direction:column;display:flex;gap:calc(var(--base-spacing) * 1px)}:host .icon-right{cursor:pointer}";const r=i;const o=class{constructor(t){e(this,t);this.close=s(this,"close",7);this.handleClose=()=>{this.close.emit();this.host.remove()};this.type="info";this.floating=false;this.label=undefined;this.closeable=true;this.icon=undefined;this.styles={}}setColors(){const e=[{name:"--color-lighter",theme:`${this.type}-lighter`},{name:"--neutral-black",theme:"neutral-black"},{name:"--color-light",theme:`${this.type}-light`},{name:"--color-base",theme:`${this.type}-base`}];e.forEach((e=>{this.styles[e.name]=window.CuraAPI.theme.colors.getColor(e.theme)}));this.styles=Object.assign({},this.styles)}connectedCallback(){this.styles["--base-spacing"]=window.CuraAPI.theme.spacing.getSpacing();this.setColors()}getClasses(){const e={};e["conteiner"]=true;e["floating"]=this.floating;return e}getNameIcon(){const e={info:"infoCircle",success:"checkCircle",warning:"alertCircle",error:"alertTriangle"};return this.icon?this.icon:e[this.type]}render(){return t(c,{key:"a0b22404673b1568b9cb937150dda71ce4c99d50"},t("div",{key:"c30bf1b97d1e1ffaf334ef3bca6cdd1f081c679c",class:this.getClasses(),style:this.styles},t("cura-icon",{key:"1bd88c8a19e073d7b9d967d8df38bb74063cd110",name:this.getNameIcon(),class:"icon-left",size:16,color:`${this.type}-dark`}),t("div",{key:"0df09a27c27c7e1743f7cfb9e71c96b102ff4484",class:"content"},this.label?t("cura-label",{class:"title",size:"small",color:"neutral-darker",weight:"bold"},this.label):"",t("cura-paragraph",{key:"687cc7ab050299f0878c2d10ccd28e92708db85d",class:"text",color:`${this.type}-darker`,size:"xsmall",marginBlock:"0",lineHeight:"133.33%"},t("slot",{key:"e2d85d40e65029ea71a43aa23e7298d6dcc7efa9"})),t("slot",{key:"a28fe90c9bfe2b9fb22f196eab7bb2e09e408dbf",name:"actions"})),this.closeable?t("cura-icon",{name:"close",size:16,color:"error-dark",class:"icon-right",onClick:this.handleClose}):""))}get host(){return a(this)}static get watchers(){return{type:["setColors"]}}};o.style=r;export{o as cura_alert};
|
|
2
|
+
//# sourceMappingURL=p-b3e93e74.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r,h as a,H as d}from"./p-fd5ed6b0.js";const i=":host{display:block;box-sizing:border-box;font-size:var(--font-size);font-family:var(--font-family)}:host ::slotted(*){display:flex;align-items:center;justify-content:center;font-size:var(--font-size);font-family:var(--font-family)}a{display:block;text-decoration:none !important;color:inherit}.solid{background-color:var(--neutral-purewhite);border:2px solid var(--neutral-base);border-radius:12px;overflow:hidden;padding:0px;box-shadow:none}.solid ::slotted(*){border-radius:0}.solid.hasPadding{padding:20px}.solid.hasPadding ::slotted(*){border-radius:4px !important}.solid.hasShadow{border:2px solid var(--neutral-base);box-shadow:0px 1px 4px 0px var(--neutral-black-shadow, rgba(38, 38, 38, 0.16))}.solid.cardLink{background-color:var(--neutral-purewhite);border:2px solid var(--primary-base);border-radius:12px;padding:0px;box-shadow:none;cursor:pointer}.solid.cardLink ::slotted(*){border-radius:0px}.solid.cardLink:hover{border:2px solid var(--primary-lighter) !important}.solid.cardLink.hasPadding{padding:20px}.solid.cardLink.hasPadding ::slotted(*){border-radius:4px !important}.solid.cardLink.hasPadding:hover{border:2px solid var(--primary-lighter) !important}.solid.cardLink.hasShadow{border:2px solid var(--primary-base);box-shadow:0px 4px 8px 0px var(--neutral-black-shadow, rgba(38, 38, 38, 0.16))}.solid.cardLink:not(.hasPadding).hasShadow ::slotted(*){border-radius:12px !important}.solid.cardLink.dark{background-color:var(--neutral-purewhite);border:2px solid var(--neutral-purewhite)}.solid.cardLink.dark:hover{border:2px solid var(--primary-lighter)}.transparent{background-color:transparent;border:0;border-radius:12px;padding:0px;overflow:hidden}.transparent ::slotted(*){border-radius:12px}.transparent.hasPadding{padding:20px}.transparent.hasPadding ::slotted(*){border-radius:4px}.transparent.cardLink{background-color:transparent;border:2px solid var(--primary-base);overflow:hidden;border-radius:12px;padding:0px;box-shadow:none}.transparent.cardLink ::slotted(*){border-radius:0px !important}.transparent.cardLink:hover{border:2px solid var(--primary-lighter) !important}.transparent.cardLink.light{background-color:var(--neutral-purewhite);border:2px solid var(--primary-base)}.transparent.cardLink.light ::slotted(*){border-radius:12px !important}.transparent.cardLink.light:hover{border-color:var(--primary-lighter) !important}.transparent.cardLink.dark{background-color:transparent;border:2px solid var(--neutral-purewhite)}.transparent.cardLink.dark:hover{border:0}.transparent.cardLink.hasPadding{padding:20px}.transparent.cardLink.hasPadding ::slotted(*){border-radius:4px !important}";const t=i;const o=class{constructor(a){r(this,a);this.hasPadding=true;this.hasShadow=false;this.type="solid";this.colorMode="light";this.href=undefined;this.target="_self";this.styles={}}connectedCallback(){this.weights=window.CuraAPI.theme.fonts.getWeights();this.styles["--base-spacing"]=window.CuraAPI.theme.spacing.getSpacing();this.styles["--neutral-purewhite"]=window.CuraAPI.theme.colors.getColor(`neutral-purewhite`);this.styles["--neutral-white"]=window.CuraAPI.theme.colors.getColor(`neutral-white`);this.styles["--neutral-base"]=window.CuraAPI.theme.colors.getColor(`neutral-base`);this.styles["--neutral-dark"]=window.CuraAPI.theme.colors.getColor(`neutral-dark`);this.styles["--neutral-black"]=window.CuraAPI.theme.colors.getColor(`neutral-black`);this.styles["--neutral-black-shadow"]=window.CuraAPI.theme.colors.getColor(`neutral-black`,.16);this.styles["--primary-lighter"]=window.CuraAPI.theme.colors.getColor(`primary-lighter`);this.styles["--primary-base"]=window.CuraAPI.theme.colors.getColor(`primary-base`);this.styles["--font-size"]=window.CuraAPI.theme.fonts.getSize();this.styles["--font-family"]=window.CuraAPI.theme.fonts.getFamily();this.styles["--font-weight-medium"]=this.weights.medium}getClasses(){const r={};r[this.type]=true;r[`cardLink`]=this.href;r[this.colorMode]=true;r[`hasPadding`]=this.hasPadding;r[`hasShadow`]=this.hasShadow;return r}render(){return a(d,{key:"
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r,h as a,H as d}from"./p-fd5ed6b0.js";const i=":host{display:block;box-sizing:border-box;font-size:var(--font-size);font-family:var(--font-family)}:host ::slotted(*){display:flex;align-items:center;justify-content:center;font-size:var(--font-size);font-family:var(--font-family)}a{display:block;text-decoration:none !important;color:inherit}.solid{background-color:var(--neutral-purewhite);border:2px solid var(--neutral-base);border-radius:12px;overflow:hidden;padding:0px;box-shadow:none}.solid ::slotted(*){border-radius:0}.solid.hasPadding{padding:20px}.solid.hasPadding ::slotted(*){border-radius:4px !important}.solid.hasShadow{border:2px solid var(--neutral-base);box-shadow:0px 1px 4px 0px var(--neutral-black-shadow, rgba(38, 38, 38, 0.16))}.solid.cardLink{background-color:var(--neutral-purewhite);border:2px solid var(--primary-base);border-radius:12px;padding:0px;box-shadow:none;cursor:pointer}.solid.cardLink ::slotted(*){border-radius:0px}.solid.cardLink:hover{border:2px solid var(--primary-lighter) !important}.solid.cardLink.hasPadding{padding:20px}.solid.cardLink.hasPadding ::slotted(*){border-radius:4px !important}.solid.cardLink.hasPadding:hover{border:2px solid var(--primary-lighter) !important}.solid.cardLink.hasShadow{border:2px solid var(--primary-base);box-shadow:0px 4px 8px 0px var(--neutral-black-shadow, rgba(38, 38, 38, 0.16))}.solid.cardLink:not(.hasPadding).hasShadow ::slotted(*){border-radius:12px !important}.solid.cardLink.dark{background-color:var(--neutral-purewhite);border:2px solid var(--neutral-purewhite)}.solid.cardLink.dark:hover{border:2px solid var(--primary-lighter)}.transparent{background-color:transparent;border:0;border-radius:12px;padding:0px;overflow:hidden}.transparent ::slotted(*){border-radius:12px}.transparent.hasPadding{padding:20px}.transparent.hasPadding ::slotted(*){border-radius:4px}.transparent.cardLink{background-color:transparent;border:2px solid var(--primary-base);overflow:hidden;border-radius:12px;padding:0px;box-shadow:none}.transparent.cardLink ::slotted(*){border-radius:0px !important}.transparent.cardLink:hover{border:2px solid var(--primary-lighter) !important}.transparent.cardLink.light{background-color:var(--neutral-purewhite);border:2px solid var(--primary-base)}.transparent.cardLink.light ::slotted(*){border-radius:12px !important}.transparent.cardLink.light:hover{border-color:var(--primary-lighter) !important}.transparent.cardLink.dark{background-color:transparent;border:2px solid var(--neutral-purewhite)}.transparent.cardLink.dark:hover{border:0}.transparent.cardLink.hasPadding{padding:20px}.transparent.cardLink.hasPadding ::slotted(*){border-radius:4px !important}";const t=i;const o=class{constructor(a){r(this,a);this.hasPadding=true;this.hasShadow=false;this.type="solid";this.colorMode="light";this.href=undefined;this.target="_self";this.styles={}}connectedCallback(){this.weights=window.CuraAPI.theme.fonts.getWeights();this.styles["--base-spacing"]=window.CuraAPI.theme.spacing.getSpacing();this.styles["--neutral-purewhite"]=window.CuraAPI.theme.colors.getColor(`neutral-purewhite`);this.styles["--neutral-white"]=window.CuraAPI.theme.colors.getColor(`neutral-white`);this.styles["--neutral-base"]=window.CuraAPI.theme.colors.getColor(`neutral-base`);this.styles["--neutral-dark"]=window.CuraAPI.theme.colors.getColor(`neutral-dark`);this.styles["--neutral-black"]=window.CuraAPI.theme.colors.getColor(`neutral-black`);this.styles["--neutral-black-shadow"]=window.CuraAPI.theme.colors.getColor(`neutral-black`,.16);this.styles["--primary-lighter"]=window.CuraAPI.theme.colors.getColor(`primary-lighter`);this.styles["--primary-base"]=window.CuraAPI.theme.colors.getColor(`primary-base`);this.styles["--font-size"]=window.CuraAPI.theme.fonts.getSize();this.styles["--font-family"]=window.CuraAPI.theme.fonts.getFamily();this.styles["--font-weight-medium"]=this.weights.medium}getClasses(){const r={};r[this.type]=true;r[`cardLink`]=this.href;r[this.colorMode]=true;r[`hasPadding`]=this.hasPadding;r[`hasShadow`]=this.hasShadow;return r}render(){return a(d,{key:"9478ce754c108db722dbc5bcbb00a0884b6c6f38",role:this.href?"link":"div"},this.href?a("a",{class:this.getClasses(),target:this.target,style:this.styles,href:this.href},a("slot",null)):a("div",{class:this.getClasses(),style:this.styles},a("slot",null)))}};o.style=t;export{o as cura_card};
|
|
2
|
+
//# sourceMappingURL=p-bce10f9b.entry.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,h as e,H as s,g as r}from"./p-fd5ed6b0.js";const i=":host{display:block;box-sizing:border-box;width:100%}cura-heading{--margin-block:0 !important}.container{display:flex}.compact{display:flex;padding:0px;justify-content:space-between;align-items:center}.compact .heading{text-align:right}.stepper-list{gap:4px;display:flex;flex-shrink:0;align-items:center;padding:0;flex:1;width:100%;justify-content:space-between}.step{display:flex;align-items:center;flex-direction:row;flex:1;gap:4px}.step .wrapper{flex:1;position:relative}.step .divider{background-color:var(--neutral-light);height:2px;flex:1;transition:all 1s}.step .animation{position:absolute;top:0;left:0;right:0;width:var(--progress-width)}.step .done{background-color:var(--success-light)}.step .stop{background-color:var(--error-light)}.step .active{background-color:var(--info-light)}.last{flex:0}";const o=i;const a=class{constructor(e){t(this,e);this.activeStepIndex=undefined;this.errorInCurrentStep=false;this.displayHeading=false;this.variant="default";this.steps=[];this.styles={};this.stepList=[]}connectedCallback(){this.initializeSteps();const{fonts:t,colors:e,spacing:s}=window.CuraAPI.theme;const r=t.getWeights();this.styles=this.generateStyles(e,t,s,r)}generateStyles(t,e,s,r){return{"--base-spacing":s.getSpacing(),"--neutral-purewhite":t.getColor("neutral-purewhite"),"--neutral-lighter":t.getColor("neutral-lighter"),"--neutral-base":t.getColor("neutral-base"),"--neutral-light":t.getColor("neutral-light"),"--success-light":t.getColor("success-light"),"--info-light":t.getColor("info-light"),"--error-light":t.getColor("error-light"),"--font-size":e.getSize(),"--font-color":e.getColor(),"--font-family":e.getFamily(),"--font-weight-regular":r.regular}}initializeSteps(){if(typeof this.steps==="string"){this.stepList=JSON.parse(this.steps||"[]")}else{this.stepList=this.steps}}getStepStatus(t){if(this.activeStepIndex===t&&this.errorInCurrentStep)return"stop";if(this.activeStepIndex===t&&this.stepList.length!==t)return"active";if(this.activeStepIndex>=t)return"done";return"default"}getProgressStyles(){const t={default:{progressColor:"var(--info-light)",activeStepTextColor:"info-darker",nextStepTextColor:"info-dark"},firstStep:{progressColor:"var(--info-light)",activeStepTextColor:"neutral-dark",nextStepTextColor:"neutral-medium"},completed:{progressColor:"var(--success-light)",activeStepTextColor:"success-darker",nextStepTextColor:"success-dark"},error:{progressColor:"var(--error-light)",activeStepTextColor:"error-darker",nextStepTextColor:"error-dark"}};if(this.errorInCurrentStep){return t.error}if(this.activeStepIndex===0){return t.firstStep}if(this.activeStepIndex===this.stepList.length){return t.completed}return t.default}renderCompactStepper(){var t;const s=this.activeStepIndex===0?this.stepList[this.activeStepIndex].title:this.stepList[this.activeStepIndex-1].title;const r=this.activeStepIndex===0?this.stepList[this.activeStepIndex+1].title:(t=this.stepList[this.activeStepIndex])===null||t===void 0?void 0:t.title;const i=this.activeStepIndex===this.stepList.length;const o=!(i||this.errorInCurrentStep);const{progressColor:a,activeStepTextColor:l,nextStepTextColor:n}=this.getProgressStyles();const c=this.activeStepIndex*100/this.stepList.length;return e("div",{class:"container compact",style:this.styles},e("cura-progress-bar",{progress:c,progressColor:a,active:this.activeStepIndex!==0},!o?e("cura-icon",{name:this.errorInCurrentStep?"alertCircle":"checkCircle",color:this.errorInCurrentStep?"error-dark":"success-dark",size:"16"}):e("cura-heading",{color:"neutral-dark",size:"xsmall"},this.activeStepIndex,"/",this.stepList.length)),this.displayHeading&&e("div",{class:"heading"},e("cura-heading",{size:"small",weight:"bold",color:l},s),!i&&e("cura-heading",{size:"xsmall",weight:"regular",color:n},"Próximo: ",r)))}renderStep(t,s){const r=this.getStepStatus(s+1);const i=s===this.stepList.length-1;const o=r!=="default"?"100%":"0";return e("div",{class:`step ${i?"last":""}`,key:t.title},e("cura-stepper-item",{heading:t.title,label:t.label,displayHeading:this.displayHeading,status:r}),s<this.stepList.length-1&&e("div",{class:"wrapper"},e("div",{class:"divider"}),e("div",{class:`divider ${r} animation`,style:{"--progress-width":o}})))}renderStepper(){return e("div",{class:"container",style:this.styles},e("div",{class:"stepper-list"},this.stepList.map(((t,e)=>this.renderStep(t,e)))))}render(){return e(s,{key:"a3c23a43dc82cba74b777a7e28ae7de1632ec95d"},this.variant==="default"?this.renderStepper():this.renderCompactStepper())}get host(){return r(this)}};a.style=o;export{a as cura_stepper};
|
|
2
|
+
//# sourceMappingURL=p-cfbe2bce.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["curaStepperCss","CuraStepperStyle0","CuraStepper","connectedCallback","this","initializeSteps","fonts","colors","spacing","window","CuraAPI","theme","weights","getWeights","styles","generateStyles","getSpacing","getColor","getSize","getFamily","regular","steps","stepList","JSON","parse","getStepStatus","step","activeStepIndex","errorInCurrentStep","length","getProgressStyles","progressStyles","default","progressColor","activeStepTextColor","nextStepTextColor","firstStep","completed","error","renderCompactStepper","title","subtitle","_a","inProgress","progress","h","class","style","active","name","color","size","displayHeading","weight","renderStep","stepIndex","stepStatus","lastStep","progressWidth","key","heading","label","status","renderStepper","map","render","Host","variant"],"sources":["src/components/cura-stepper/cura-stepper.scss?tag=cura-stepper&encapsulation=shadow","src/components/cura-stepper/cura-stepper.tsx"],"sourcesContent":[":host {\n display: block;\n box-sizing: border-box;\n width: 100%;\n}\n\ncura-heading { \n --margin-block: 0 !important;\n}\n\n.container {\n display: flex;\n}\n\n.compact {\n display: flex;\n padding: 0px;\n justify-content: space-between;\n align-items: center;\n\n .heading{\n text-align: right;\n }\n}\n\n.stepper-list {\n gap: 4px;\n display: flex;\n flex-shrink: 0;\n align-items: center;\n padding: 0;\n flex: 1;\n width: 100%;\n justify-content: space-between;\n}\n\n.step{\n display: flex;\n align-items: center;\n flex-direction: row;\n flex: 1;\n gap: 4px;\n\n .wrapper {\n flex: 1;\n position: relative;\n }\n\n .divider{\n background-color: var(--neutral-light);\n height: 2px;\n flex: 1;\n\n transition: all 1s;\n }\n\n .animation {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n width: var(--progress-width);\n }\n\n .done{\n background-color: var(--success-light);\n }\n\n .stop{\n background-color: var(--error-light);\n }\n\n .active{\n background-color: var(--info-light);\n }\n}\n\n.last{\n flex: 0;\n}\n","import { Component, Host, State, h, Element, Prop } from '@stencil/core';\nimport { Step } from './stepper.type';\n\n@Component({\n tag: 'cura-stepper',\n styleUrl: 'cura-stepper.scss',\n shadow: true,\n})\nexport class CuraStepper {\n /**\n * The current active step index\n */\n @Prop({ reflect: true }) activeStepIndex: number;\n\n /**\n * Indicates if a step has encountered an error\n * If `true`, the current step will be marked as 'stop'\n */\n @Prop({ reflect: true }) errorInCurrentStep: boolean = false;\n\n /**\n * Whether to display the title (default: false)\n */\n @Prop({ reflect: true }) displayHeading: boolean = false;\n\n /**\n * Allows you to set the appearance of the component (default: default)\n */\n @Prop({ reflect: true }) variant: 'compact' | 'default' = 'default';\n\n /**\n * List of steps in the stepper.\n */\n @Prop() steps: Step[] | string = [];\n /**\n * Reference to the host element.\n */\n @Element() host: HTMLElement;\n\n @State() styles = {};\n\n /**\n * Array of steps in the stepper.\n *\n * @type {Date[]}\n * @default []\n */\n @State() stepList: Step[] = [];\n\n connectedCallback() {\n this.initializeSteps();\n\n const { fonts, colors, spacing } = window.CuraAPI.theme;\n const weights = fonts.getWeights();\n\n this.styles = this.generateStyles(colors, fonts, spacing, weights);\n }\n\n generateStyles(colors, fonts, spacing, weights) {\n return {\n '--base-spacing': spacing.getSpacing(),\n '--neutral-purewhite': colors.getColor('neutral-purewhite'),\n '--neutral-lighter': colors.getColor('neutral-lighter'),\n '--neutral-base': colors.getColor('neutral-base'),\n '--neutral-light': colors.getColor('neutral-light'),\n '--success-light': colors.getColor('success-light'),\n '--info-light': colors.getColor('info-light'),\n '--error-light': colors.getColor('error-light'),\n '--font-size': fonts.getSize(),\n '--font-color': fonts.getColor(),\n '--font-family': fonts.getFamily(),\n '--font-weight-regular': weights.regular,\n };\n }\n\n initializeSteps() {\n if (typeof this.steps === 'string') {\n this.stepList = JSON.parse(this.steps || '[]');\n } else {\n this.stepList = this.steps;\n }\n }\n\n getStepStatus(step: number): 'done' | 'stop' | 'active' | 'default' {\n if (this.activeStepIndex === step && this.errorInCurrentStep) return 'stop';\n if (this.activeStepIndex === step && this.stepList.length !== step) return 'active';\n if (this.activeStepIndex >= step) return 'done';\n\n return 'default';\n }\n\n getProgressStyles() {\n const progressStyles = {\n default: {\n progressColor: 'var(--info-light)',\n activeStepTextColor: 'info-darker',\n nextStepTextColor: 'info-dark',\n },\n firstStep: {\n progressColor: 'var(--info-light)',\n activeStepTextColor: 'neutral-dark',\n nextStepTextColor: 'neutral-medium',\n },\n completed: {\n progressColor: 'var(--success-light)',\n activeStepTextColor: 'success-darker',\n nextStepTextColor: 'success-dark',\n },\n error: {\n progressColor: 'var(--error-light)',\n activeStepTextColor: 'error-darker',\n nextStepTextColor: 'error-dark',\n },\n };\n\n if (this.errorInCurrentStep) {\n return progressStyles.error;\n }\n\n if (this.activeStepIndex === 0) {\n return progressStyles.firstStep;\n }\n\n if (this.activeStepIndex === this.stepList.length) {\n return progressStyles.completed;\n }\n\n return progressStyles.default;\n }\n\n renderCompactStepper() {\n const title = this.activeStepIndex === 0 ? this.stepList[this.activeStepIndex].title : this.stepList[this.activeStepIndex - 1].title;\n const subtitle = this.activeStepIndex === 0 ? this.stepList[this.activeStepIndex + 1].title : this.stepList[this.activeStepIndex]?.title;\n const completed = this.activeStepIndex === this.stepList.length;\n const inProgress = !(completed || this.errorInCurrentStep);\n const { progressColor, activeStepTextColor, nextStepTextColor } = this.getProgressStyles();\n\n // Representa a porcentagem de progresso (step atual / quantidade de steps;)\n const progress = (this.activeStepIndex * 100) / this.stepList.length;\n\n return (\n <div class=\"container compact\" style={this.styles}>\n <cura-progress-bar progress={progress} progressColor={progressColor} active={this.activeStepIndex !== 0}>\n {!inProgress ? (\n <cura-icon name={this.errorInCurrentStep ? 'alertCircle' : 'checkCircle'} color={this.errorInCurrentStep ? 'error-dark' : 'success-dark'} size=\"16\"></cura-icon>\n ) : (\n <cura-heading color=\"neutral-dark\" size=\"xsmall\">\n {this.activeStepIndex}/{this.stepList.length}\n </cura-heading>\n )}\n </cura-progress-bar>\n {this.displayHeading && (\n <div class=\"heading\">\n <cura-heading size=\"small\" weight=\"bold\" color={activeStepTextColor}>\n {title}\n </cura-heading>\n {!completed && (\n <cura-heading size=\"xsmall\" weight=\"regular\" color={nextStepTextColor}>\n Próximo: {subtitle}\n </cura-heading>\n )}\n </div>\n )}\n </div>\n );\n }\n\n renderStep(step: Step, stepIndex: number) {\n const stepStatus = this.getStepStatus(stepIndex + 1);\n const lastStep = stepIndex === this.stepList.length - 1;\n const progressWidth = stepStatus !== 'default' ? '100%' : '0';\n\n return (\n <div class={`step ${lastStep ? 'last' : ''}`} key={step.title}>\n <cura-stepper-item heading={step.title} label={step.label} displayHeading={this.displayHeading} status={stepStatus} />\n {stepIndex < this.stepList.length - 1 && (\n <div class=\"wrapper\">\n <div class=\"divider\" />\n <div class={`divider ${stepStatus} animation`} style={{ '--progress-width': progressWidth }} />\n </div>\n )}\n </div>\n );\n }\n renderStepper() {\n return (\n <div class=\"container\" style={this.styles}>\n <div class=\"stepper-list\">{this.stepList.map((step, stepIndex) => this.renderStep(step, stepIndex))}</div>\n </div>\n );\n }\n\n render() {\n return <Host>{this.variant === 'default' ? this.renderStepper() : this.renderCompactStepper()}</Host>;\n }\n}\n"],"mappings":"yDAAA,MAAMA,EAAiB,0yBACvB,MAAAC,EAAeD,E,MCOFE,EAAW,M,gFAUiC,M,oBAKJ,M,aAKO,U,WAKzB,G,YAMf,G,cAQU,E,CAE5B,iBAAAC,GACEC,KAAKC,kBAEL,MAAMC,MAAEA,EAAKC,OAAEA,EAAMC,QAAEA,GAAYC,OAAOC,QAAQC,MAClD,MAAMC,EAAUN,EAAMO,aAEtBT,KAAKU,OAASV,KAAKW,eAAeR,EAAQD,EAAOE,EAASI,E,CAG5D,cAAAG,CAAeR,EAAQD,EAAOE,EAASI,G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KAAME,IAAKjC,EAAKc,OACtDK,EAAA,qBAAmBe,QAASlC,EAAKc,MAAOqB,MAAOnC,EAAKmC,MAAOT,eAAgBhD,KAAKgD,eAAgBU,OAAQN,IACvGD,EAAYnD,KAAKkB,SAASO,OAAS,GAClCgB,EAAA,OAAKC,MAAM,WACTD,EAAA,OAAKC,MAAM,YACXD,EAAA,OAAKC,MAAO,WAAWU,cAAwBT,MAAO,CAAE,mBAAoBW,M,CAMtF,aAAAK,GACE,OACElB,EAAA,OAAKC,MAAM,YAAYC,MAAO3C,KAAKU,QACjC+B,EAAA,OAAKC,MAAM,gBAAgB1C,KAAKkB,SAAS0C,KAAI,CAACtC,EAAM6B,IAAcnD,KAAKkD,WAAW5B,EAAM6B,M,CAK9F,MAAAU,GACE,OAAOpB,EAACqB,EAAI,CAAAP,IAAA,4CAAEvD,KAAK+D,UAAY,UAAY/D,KAAK2D,gBAAkB3D,KAAKmC,uB","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r,c as e,h as a,H as s,g as t}from"./p-fd5ed6b0.js";import{f as o}from"./p-f9b8f665.js";const i='@charset "UTF-8";:host{display:block;width:fit-content;box-sizing:border-box;}:host .container{display:flex;align-items:center;flex-direction:row-reverse;gap:var(--gap)}:host .position.container{flex-direction:row}:host .position .label-wrapper{justify-content:end}:host .position .message{text-align:right}:host .position .label{order:1}:host .info{display:flex;flex-direction:column}:host .label-wrapper{display:flex;justify-content:start;align-items:center;gap:5px}:host .control{width:fit-content;cursor:pointer;position:relative}:host .radio{margin:0;appearance:none;-webkit-appearance:none;-moz-appearance:none;border-radius:50%;border:2px solid var(--primary-base-neutral-medium);background:var(--neutral-purewhite);box-sizing:border-box;transition:border-color 0.3s;position:relative;display:flex;align-items:center;justify-content:center;cursor:pointer;width:var(--size);height:var(--size);flex:0 0 var(--size)}:host .radio::after{content:"";background:var(--color-base-light);border-radius:50%;opacity:0;transition:opacity 0.3s;width:var(--size-after);height:var(--size-after)}:host .radio:focus{border-color:var(--info-base) !important}:host .success .radio{border-color:var(--success-base);background:var(--success-lighter)}:host .success .radio:hover{border-color:var(--success-base) !important}:host .success.checked .radio{border-color:var(--success-base)}:host .success.checked .radio::after{background:var(--success-base)}:host .success.checked .radio:hover{background:var(--success-lighter) !important;border-color:var(--success-base) !important}:host .success.checked .radio:hover::after{background:var(--success-base) !important}:host .error .radio{border-color:var(--error-base);background:var(--error-lighter)}:host .error .radio:hover{border-color:var(--error-base) !important}:host .error.checked .radio{border-color:var(--error-base)}:host .error.checked .radio::after{background:var(--error-base)}:host .error.checked .radio:hover{background:var(--error-lighter) !important;border-color:var(--error-base) !important}:host .error.checked .radio:hover::after{background:var(--error-base) !important}:host .checked .radio::after{opacity:1;background:var(--color-base)}:host .checked .radio{border-color:var(--color-dark)}:host .checked .radio:hover{border-color:var(--color-light) !important}:host .checked .radio:hover::after{background:var(--color-light)}:host .disabled .radio{background:var(--primary-base-neutral-white);border-color:var(--primary-darker-neutral-base);cursor:not-allowed}:host .disabled .radio::after{background:var(--neutral-lighter)}:host .disabled.checked .radio{border-color:var(--primary-base-neutral-base) !important;background:var(--primary-darker-neutral-white) !important}:host .disabled.checked .radio::after{background:var(--primary-base-neutral-base) !important}:host :not(.disabled):not(.checked) .radio:hover{border-color:var(--primary-base-neutral-dark)}';const c=i;const d=class{constructor(a){r(this,a);this.onchange=e(this,"onchange",7);if(a.$hostElement$["s-ei"]){this.internals=a.$hostElement$["s-ei"]}else{this.internals=a.$hostElement$.attachInternals();a.$hostElement$["s-ei"]=this.internals}this.sizes={large:{size:20},medium:{size:14},small:{size:10}};this.isDarkbackground=()=>this.background==="dark";this.handleClick=()=>{if(this.disabled)return;this.checked=!this.checked;this.internals.setFormValue(this.value);this.onchange.emit({value:this.value,checked:this.checked})};this.checked=false;this.status="default";this.disabled=false;this.required=false;this.label="";this.ontabindex=undefined;this.position="left";this.value="";this.name="";this.background="light";this.size="medium";this.color="accent";this.styles={}}sizeHandler(){this.styles=Object.assign(Object.assign({},this.styles),{"--size-after":`${this.sizes[this.size].size}px`,"--size":`${o[this.size].size}px`,"--gap":`${o[this.size].gap}px`})}setColors(){const r=[{name:"--info-base",background:"info-base"},{name:"--color-light",background:`${this.color}-light`},{name:"--color-base",background:`${this.color}-base`},{name:"--color-dark",background:`${this.color}-dark`},{name:"--neutral-purewhite",background:"neutral-purewhite"},{name:"--success-lighter",background:"success-lighter"},{name:"--success-base",background:"success-base"},{name:"--error-lighter",background:"error-lighter"},{name:"--error-base",background:"error-base"},{name:"--primary-base-neutral-medium",background:this.isDarkbackground()?"primary-base":"neutral-medium"},{name:"--primary-base-neutral-white",background:this.isDarkbackground()?"primary-base":"neutral-white"},{name:"--primary-darker-neutral-white",background:this.isDarkbackground()?"primary-darker":"neutral-white"},{name:"--primary-darker-neutral-base",background:this.isDarkbackground()?"primary-darker":"neutral-base"},{name:"--primary-base-neutral-base",background:this.isDarkbackground()?"primary-base":"neutral-base"},{name:"--primary-base-neutral-dark",background:this.isDarkbackground()?"primary-base":"neutral-dark"},{name:"--primary-base-neutral-medium",background:this.isDarkbackground()?"primary-base":"neutral-medium"},{name:"--success-base-dark",background:this.isDarkbackground()?"success-base":"success-dark"},{name:"--error-base-dark",background:this.isDarkbackground()?"error-base":"error-dark"}];r.forEach((r=>{this.styles[r.name]=window.CuraAPI.theme.colors.getColor(r.background)}));this.styles=Object.assign({},this.styles)}formAssociatedCallback(r){r.ariaLabel=this.label}formStateRestoreCallback(r){this.value=r.value;this.checked=r.checked;this.internals.setFormValue(this.value)}formResetCallback(){this.value="";this.checked=false;this.internals.setValidity({});this.internals.setFormValue(this.value)}formDisabledCallback(r){this.disabled=r}connectedCallback(){this.sizeHandler();this.setColors()}getClasses(){const r={};r["container"]=true;r["checked"]=this.checked;r["disabled"]=this.disabled;r["position"]=this.position==="right";r[this.status]=true;return r}assignColor(r){if(this.disabled)return this.isDarkbackground()?"primary-darker":"neutral-medium";const e={success:{label:this.isDarkbackground()?"success-lighter":"success-darker",message:this.isDarkbackground()?"success-base":"success-dark"},error:{label:this.isDarkbackground()?"error-lighter":"neutral-darker",message:this.isDarkbackground()?"error-base":"error-dark"},default:{label:this.isDarkbackground()?"neutral-white":"neutral-black",message:this.isDarkbackground()?"primary-lighter":"neutral-dark"}};return e[this.status][r]}render(){return a(s,{key:"
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r,c as e,h as a,H as s,g as t}from"./p-fd5ed6b0.js";import{f as o}from"./p-f9b8f665.js";const i='@charset "UTF-8";:host{display:block;width:fit-content;box-sizing:border-box;}:host .container{display:flex;align-items:center;flex-direction:row-reverse;gap:var(--gap)}:host .position.container{flex-direction:row}:host .position .label-wrapper{justify-content:end}:host .position .message{text-align:right}:host .position .label{order:1}:host .info{display:flex;flex-direction:column}:host .label-wrapper{display:flex;justify-content:start;align-items:center;gap:5px}:host .control{width:fit-content;cursor:pointer;position:relative}:host .radio{margin:0;appearance:none;-webkit-appearance:none;-moz-appearance:none;border-radius:50%;border:2px solid var(--primary-base-neutral-medium);background:var(--neutral-purewhite);box-sizing:border-box;transition:border-color 0.3s;position:relative;display:flex;align-items:center;justify-content:center;cursor:pointer;width:var(--size);height:var(--size);flex:0 0 var(--size)}:host .radio::after{content:"";background:var(--color-base-light);border-radius:50%;opacity:0;transition:opacity 0.3s;width:var(--size-after);height:var(--size-after)}:host .radio:focus{border-color:var(--info-base) !important}:host .success .radio{border-color:var(--success-base);background:var(--success-lighter)}:host .success .radio:hover{border-color:var(--success-base) !important}:host .success.checked .radio{border-color:var(--success-base)}:host .success.checked .radio::after{background:var(--success-base)}:host .success.checked .radio:hover{background:var(--success-lighter) !important;border-color:var(--success-base) !important}:host .success.checked .radio:hover::after{background:var(--success-base) !important}:host .error .radio{border-color:var(--error-base);background:var(--error-lighter)}:host .error .radio:hover{border-color:var(--error-base) !important}:host .error.checked .radio{border-color:var(--error-base)}:host .error.checked .radio::after{background:var(--error-base)}:host .error.checked .radio:hover{background:var(--error-lighter) !important;border-color:var(--error-base) !important}:host .error.checked .radio:hover::after{background:var(--error-base) !important}:host .checked .radio::after{opacity:1;background:var(--color-base)}:host .checked .radio{border-color:var(--color-dark)}:host .checked .radio:hover{border-color:var(--color-light) !important}:host .checked .radio:hover::after{background:var(--color-light)}:host .disabled .radio{background:var(--primary-base-neutral-white);border-color:var(--primary-darker-neutral-base);cursor:not-allowed}:host .disabled .radio::after{background:var(--neutral-lighter)}:host .disabled.checked .radio{border-color:var(--primary-base-neutral-base) !important;background:var(--primary-darker-neutral-white) !important}:host .disabled.checked .radio::after{background:var(--primary-base-neutral-base) !important}:host :not(.disabled):not(.checked) .radio:hover{border-color:var(--primary-base-neutral-dark)}';const c=i;const d=class{constructor(a){r(this,a);this.onchange=e(this,"onchange",7);if(a.$hostElement$["s-ei"]){this.internals=a.$hostElement$["s-ei"]}else{this.internals=a.$hostElement$.attachInternals();a.$hostElement$["s-ei"]=this.internals}this.sizes={large:{size:20},medium:{size:14},small:{size:10}};this.isDarkbackground=()=>this.background==="dark";this.handleClick=()=>{if(this.disabled)return;this.checked=!this.checked;this.internals.setFormValue(this.value);this.onchange.emit({value:this.value,checked:this.checked})};this.checked=false;this.status="default";this.disabled=false;this.required=false;this.label="";this.ontabindex=undefined;this.position="left";this.value="";this.name="";this.background="light";this.size="medium";this.color="accent";this.styles={}}sizeHandler(){this.styles=Object.assign(Object.assign({},this.styles),{"--size-after":`${this.sizes[this.size].size}px`,"--size":`${o[this.size].size}px`,"--gap":`${o[this.size].gap}px`})}setColors(){const r=[{name:"--info-base",background:"info-base"},{name:"--color-light",background:`${this.color}-light`},{name:"--color-base",background:`${this.color}-base`},{name:"--color-dark",background:`${this.color}-dark`},{name:"--neutral-purewhite",background:"neutral-purewhite"},{name:"--success-lighter",background:"success-lighter"},{name:"--success-base",background:"success-base"},{name:"--error-lighter",background:"error-lighter"},{name:"--error-base",background:"error-base"},{name:"--primary-base-neutral-medium",background:this.isDarkbackground()?"primary-base":"neutral-medium"},{name:"--primary-base-neutral-white",background:this.isDarkbackground()?"primary-base":"neutral-white"},{name:"--primary-darker-neutral-white",background:this.isDarkbackground()?"primary-darker":"neutral-white"},{name:"--primary-darker-neutral-base",background:this.isDarkbackground()?"primary-darker":"neutral-base"},{name:"--primary-base-neutral-base",background:this.isDarkbackground()?"primary-base":"neutral-base"},{name:"--primary-base-neutral-dark",background:this.isDarkbackground()?"primary-base":"neutral-dark"},{name:"--primary-base-neutral-medium",background:this.isDarkbackground()?"primary-base":"neutral-medium"},{name:"--success-base-dark",background:this.isDarkbackground()?"success-base":"success-dark"},{name:"--error-base-dark",background:this.isDarkbackground()?"error-base":"error-dark"}];r.forEach((r=>{this.styles[r.name]=window.CuraAPI.theme.colors.getColor(r.background)}));this.styles=Object.assign({},this.styles)}formAssociatedCallback(r){r.ariaLabel=this.label}formStateRestoreCallback(r){this.value=r.value;this.checked=r.checked;this.internals.setFormValue(this.value)}formResetCallback(){this.value="";this.checked=false;this.internals.setValidity({});this.internals.setFormValue(this.value)}formDisabledCallback(r){this.disabled=r}connectedCallback(){this.sizeHandler();this.setColors()}getClasses(){const r={};r["container"]=true;r["checked"]=this.checked;r["disabled"]=this.disabled;r["position"]=this.position==="right";r[this.status]=true;return r}assignColor(r){if(this.disabled)return this.isDarkbackground()?"primary-darker":"neutral-medium";const e={success:{label:this.isDarkbackground()?"success-lighter":"success-darker",message:this.isDarkbackground()?"success-base":"success-dark"},error:{label:this.isDarkbackground()?"error-lighter":"neutral-darker",message:this.isDarkbackground()?"error-base":"error-dark"},default:{label:this.isDarkbackground()?"neutral-white":"neutral-black",message:this.isDarkbackground()?"primary-lighter":"neutral-dark"}};return e[this.status][r]}render(){return a(s,{key:"eecc279b05da57162acf41d62bac48a00cc9d985"},a("div",{key:"279b6922349bf02b7e65065bcb98b9c824073516",class:this.getClasses(),style:this.styles},a("div",{key:"a6a2de8f8d7e6efbca3aee079255451e448903a2",class:"info"},a("div",{key:"6d2733ca86d087031e1ec4fdea26d5906f695479",class:"label-wrapper"},a("cura-label",{key:"2c0c878411bb846ff7bcf24c385895f1d86b3022",class:"label",size:this.size==="large"?"medium":"xsmall",color:this.assignColor("label")},this.label),this.required&&a("cura-paragraph",{key:"07abc53858276dc6429381a0c658c562e1d05933",lineHeight:"0%",marginBlock:"0",color:"error-base"},"* ")),a("cura-label",{key:"ab5c0451842242ee584f2d3b430b803498190118",color:this.assignColor("message"),size:"xsmall",class:"message"},a("slot",{key:"3673a0a1ecc7f9dfa6975bdddaf708ed8ad1b72d"}))),a("input",{key:"db602c601168ada1a5a375d3ef122d4f315fa256",type:"radio",class:`radio ${this.size.toLocaleLowerCase()}`,name:this.name,value:this.value,required:this.required,tabIndex:this.ontabindex,disabled:this.disabled,checked:this.checked,onClick:this.handleClick})))}static get formAssociated(){return true}get host(){return t(this)}static get watchers(){return{size:["sizeHandler"],color:["setColors"],background:["setColors","assignColor"]}}};d.style=c;export{d as cura_radio};
|
|
2
|
+
//# sourceMappingURL=p-d13e3295.entry.js.map
|