@rededor/cura 1.6.0-alpha.0 → 1.6.0-alpha.2
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_18.cjs.entry.js +12 -15
- package/dist/cjs/cura-accordion_18.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-alert.cjs.entry.js +1 -1
- package/dist/cjs/cura-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-calendar.cjs.entry.js +12 -7
- package/dist/cjs/cura-calendar.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-toast.cjs.entry.js +7 -1
- package/dist/cjs/cura-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-tooltip.cjs.entry.js +1 -1
- 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/components/cura-alert/cura-alert.js +1 -1
- package/dist/collection/components/cura-alert/cura-alert.js.map +1 -1
- package/dist/collection/components/cura-avatar/cura-avatar.js +4 -4
- package/dist/collection/components/cura-avatar/cura-avatar.js.map +1 -1
- package/dist/collection/components/cura-calendar/cura-calendar.css +17 -16
- package/dist/collection/components/cura-calendar/cura-calendar.js +30 -7
- package/dist/collection/components/cura-calendar/cura-calendar.js.map +1 -1
- package/dist/collection/components/cura-calendar/cura-calendar.stories.js +12 -0
- package/dist/collection/components/cura-calendar/cura-calendar.stories.js.map +1 -1
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-new.js +7 -13
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-new.js.map +1 -1
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-new.stories.js +14 -3
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-new.stories.js.map +1 -1
- package/dist/collection/components/cura-icon/cura-icon.css +1 -0
- package/dist/collection/components/cura-toast/cura-toast.js +28 -1
- package/dist/collection/components/cura-toast/cura-toast.js.map +1 -1
- package/dist/collection/components/cura-toast/cura-toast.stories.js +7 -0
- package/dist/collection/components/cura-toast/cura-toast.stories.js.map +1 -1
- package/dist/collection/components/cura-tooltip/cura-tooltip.css +1 -1
- package/dist/collection/components/text/cura-heading/cura-heading.css +26 -26
- package/dist/components/cura-alert.js +6 -6
- package/dist/components/cura-alert.js.map +1 -1
- package/dist/components/cura-avatar.js +4 -4
- package/dist/components/cura-avatar.js.map +1 -1
- package/dist/components/cura-calendar2.js +14 -8
- package/dist/components/cura-calendar2.js.map +1 -1
- package/dist/components/cura-dropdown-search-new.js +7 -12
- package/dist/components/cura-dropdown-search-new.js.map +1 -1
- package/dist/components/cura-heading2.js +1 -1
- package/dist/components/cura-heading2.js.map +1 -1
- package/dist/components/cura-icon2.js +1 -1
- package/dist/components/cura-icon2.js.map +1 -1
- package/dist/components/cura-toast.js +9 -2
- package/dist/components/cura-toast.js.map +1 -1
- package/dist/components/cura-tooltip.js +1 -1
- package/dist/components/cura-tooltip.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-02c2b948.entry.js +2 -0
- package/dist/cura/p-02c2b948.entry.js.map +1 -0
- package/dist/cura/p-506747fb.entry.js +2 -0
- package/dist/cura/p-506747fb.entry.js.map +1 -0
- package/dist/cura/p-823d0bb5.entry.js +2 -0
- package/dist/cura/p-823d0bb5.entry.js.map +1 -0
- package/dist/cura/{p-e98a1ad2.entry.js → p-89671cd4.entry.js} +2 -2
- package/dist/cura/{p-e98a1ad2.entry.js.map → p-89671cd4.entry.js.map} +1 -1
- package/dist/cura/{p-c0f445b5.entry.js → p-bf69b32f.entry.js} +2 -2
- package/dist/cura/p-bf69b32f.entry.js.map +1 -0
- package/dist/esm/cura-accordion_18.entry.js +12 -15
- package/dist/esm/cura-accordion_18.entry.js.map +1 -1
- package/dist/esm/cura-alert.entry.js +1 -1
- package/dist/esm/cura-alert.entry.js.map +1 -1
- package/dist/esm/cura-calendar.entry.js +12 -7
- package/dist/esm/cura-calendar.entry.js.map +1 -1
- package/dist/esm/cura-toast.entry.js +7 -1
- package/dist/esm/cura-toast.entry.js.map +1 -1
- package/dist/esm/cura-tooltip.entry.js +1 -1
- 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/cura-avatar/cura-avatar.d.ts +1 -0
- package/dist/types/components/cura-calendar/cura-calendar.d.ts +8 -7
- package/dist/types/components/cura-calendar/cura-calendar.stories.d.ts +15 -0
- package/dist/types/components/cura-dropdown-search-new/cura-dropdown-search-new.d.ts +3 -1
- package/dist/types/components/cura-dropdown-search-new/cura-dropdown-search-new.stories.d.ts +12 -0
- package/dist/types/components/cura-toast/cura-toast.d.ts +4 -0
- package/dist/types/components/cura-toast/cura-toast.stories.d.ts +7 -0
- package/dist/types/components.d.ts +6 -0
- package/package.json +2 -2
- package/dist/cura/p-24d9f1f4.entry.js +0 -2
- package/dist/cura/p-24d9f1f4.entry.js.map +0 -1
- package/dist/cura/p-2afb14e9.entry.js +0 -2
- package/dist/cura/p-2afb14e9.entry.js.map +0 -1
- package/dist/cura/p-3576b633.entry.js +0 -2
- package/dist/cura/p-3576b633.entry.js.map +0 -1
- package/dist/cura/p-c0f445b5.entry.js.map +0 -1
|
@@ -3569,7 +3569,7 @@ var locale = {
|
|
|
3569
3569
|
};
|
|
3570
3570
|
const ptBR = locale;
|
|
3571
3571
|
|
|
3572
|
-
const curaCalendarCss = ":host{display:block;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);margin:0 auto}:host .calendar{display:flex;flex-direction:column;gap:5px;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);border-radius:4px;overflow:hidden;background:#fff;font-family:var(--font-family)}:host .calendar.embedded{border:2px solid var(--neutral-light);padding:0px 12px 12px 12px}:host .calendar.floating{box-shadow:0 4px 8px var(--neutral-light)}:host .header{position:relative;padding:12px 0}:host .header::after{content:\"\";position:absolute;bottom:0;left:2px;right:2px;border-bottom:2px dotted var(--neutral-light)}:host .month-year{display:flex;padding:12px 8px;justify-content:space-between;align-self:stretch}:host .month-year.dropdown{padding:0%}:host .select{display:flex;padding:7px 10px 0px;justify-content:center;align-items:center;gap:6px;flex:1 0 0}:host .drop-month{display:flex;max-width:118px;padding:0px;align-items:flex-start;gap:0px;flex:1 0 0}:host .drop-year{display:flex;min-width:80px;max-width:85px;padding:0px;align-items:flex-start;gap:0px;flex:1 0 0}:host .days-of-week{display:flex;height:30px;padding:4px;justify-content:center;align-items:center;gap:4px;flex-shrink:0}:host .day{flex:1;text-align:center}:host .dates{display:flex;flex-wrap:wrap;align-items:center;align-self:stretch;gap:0}:host .icon{cursor:pointer;position:relative;overflow:hidden;border-radius:50%}:host .icon.dropdown{margin-top:10px}:host .icon::before{content:\"\";position:absolute;border-radius:50%;top:50%;left:50%;width:20px;height:20px;background:var(--
|
|
3572
|
+
const curaCalendarCss = ":host{display:block;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);margin:0 auto}:host .calendar{display:flex;flex-direction:column;gap:5px;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);border-radius:4px;overflow:hidden;background:#fff;font-family:var(--font-family)}:host .calendar.embedded{border:2px solid var(--neutral-light);padding:0px 12px 12px 12px}:host .calendar.floating{box-shadow:0 4px 8px var(--neutral-light)}:host .header{position:relative;padding:12px 0}:host .header::after{content:\"\";position:absolute;bottom:0;left:2px;right:2px;border-bottom:2px dotted var(--neutral-light)}:host .month-year{display:flex;padding:12px 8px;justify-content:space-between;align-self:stretch}:host .month-year.dropdown{padding:0%}:host .select{display:flex;padding:7px 10px 0px;justify-content:center;align-items:center;gap:6px;flex:1 0 0}:host .drop-month{display:flex;max-width:118px;padding:0px;align-items:flex-start;gap:0px;flex:1 0 0}:host .drop-year{display:flex;min-width:80px;max-width:85px;padding:0px;align-items:flex-start;gap:0px;flex:1 0 0}:host .days-of-week{display:flex;height:30px;padding:4px;justify-content:center;align-items:center;gap:4px;flex-shrink:0}:host .day{flex:1;text-align:center}:host .dates{display:flex;flex-wrap:wrap;align-items:center;align-self:stretch;gap:0}:host .icon{cursor:pointer;position:relative;overflow:hidden;border-radius:50%}:host .icon.dropdown{margin-top:10px}:host .icon::before{content:\"\";position:absolute;border-radius:50%;top:50%;left:50%;width:20px;height:20px;background:var(--primary-base);transform:translate(-50%, -50%) scale(0);transition:transform 0.2s ease}:host .icon:active::before{transform:translate(-50%, -50%) scale(1)}:host .icon:active{transform:scale(1)}:host .collapsed-container{text-align:center;position:relative;display:flex;align-items:center;justify-content:center;padding-top:10px}:host .collapsed-container::before{content:\"\";position:absolute;bottom:0;top:0;left:2px;right:2px;border-top:2px dotted var(--neutral-light)}:host .date{display:flex;justify-content:center;align-items:center;height:auto;width:14.2857142857%;aspect-ratio:1;font-size:14px;cursor:pointer;position:relative;box-sizing:border-box;text-align:center;flex-shrink:0}:host .date.today{border:2px solid var(--primary-darker);border-radius:50%;color:var(--primary-darker)}:host .date.selected{color:var(--select-label) !important;background:var(--primary-base);border-radius:50%}:host .date.default-dates{color:var(--select-label) !important;background:var(--primary-base);border-radius:50%;border:none}:host .date.invalid{color:var(--neutral-dark) !important;cursor:not-allowed}:host .date.invalid:hover{background:none;box-shadow:none}:host .date.valid{color:var(--primary-darker);font-weight:var(--font-weight-bold)}:host .date.range.start{border-radius:50% 0 0 50%;color:var(--select-label) !important;background:var(--primary-base)}:host .date.range.interval{border-radius:0;background:var(--primary-lighter);color:var(--neutral-black) !important}:host .date.range.interval.today{border:none}:host .date.range.end{border-radius:0 50% 50% 0;color:var(--select-label) !important;background:var(--primary-base)}:host .date:hover{background:var(--primary-lighter);border-radius:50%;color:var(--neutral-white)}:host select,:host input{width:60px;font-size:16px;box-shadow:0 2px 2px var(--neutral-black);padding:5px;border-radius:4px;border:1px solid #ccc;background:#f7f7f7}";
|
|
3573
3573
|
const CuraCalendarStyle0 = curaCalendarCss;
|
|
3574
3574
|
|
|
3575
3575
|
const CuraCalendar = /*@__PURE__*/ proxyCustomElement(class CuraCalendar extends HTMLElement {
|
|
@@ -3599,10 +3599,11 @@ const CuraCalendar = /*@__PURE__*/ proxyCustomElement(class CuraCalendar extends
|
|
|
3599
3599
|
this.collapsed = null;
|
|
3600
3600
|
this.floating = undefined;
|
|
3601
3601
|
this.embedded = undefined;
|
|
3602
|
-
this.
|
|
3602
|
+
this.selectLabelColorMode = 'light';
|
|
3603
3603
|
this.selectedDates = [];
|
|
3604
3604
|
this.rangeStart = null;
|
|
3605
3605
|
this.defaultDates = [];
|
|
3606
|
+
this.currentDate = new Date();
|
|
3606
3607
|
this.selectMonth = '';
|
|
3607
3608
|
this.selectYear = '';
|
|
3608
3609
|
this.styles = {};
|
|
@@ -3611,12 +3612,15 @@ const CuraCalendar = /*@__PURE__*/ proxyCustomElement(class CuraCalendar extends
|
|
|
3611
3612
|
this.setFontProperties();
|
|
3612
3613
|
this.initializeDefaultDates();
|
|
3613
3614
|
const colors = [
|
|
3614
|
-
{ name: '--
|
|
3615
|
-
{ name: '--
|
|
3615
|
+
{ name: '--primary-base', theme: 'primary-base' },
|
|
3616
|
+
{ name: '--primary-lighter', theme: 'primary-lighter' },
|
|
3617
|
+
{ name: '--primary-light', theme: 'primary-light' },
|
|
3616
3618
|
{ name: '--neutral-black', theme: 'neutral-black' },
|
|
3617
3619
|
{ name: '--primary-darker', theme: 'primary-darker' },
|
|
3618
3620
|
{ name: '--neutral-dark', theme: 'neutral-dark' },
|
|
3619
3621
|
{ name: '--neutral-light', theme: 'neutral-light' },
|
|
3622
|
+
{ name: '--neutral-white', theme: 'neutral-white' },
|
|
3623
|
+
{ name: '--select-label', theme: this.selectLabelColorMode === 'dark' ? 'neutral-black' : 'neutral-white' },
|
|
3620
3624
|
];
|
|
3621
3625
|
colors.forEach(color => (this.styles = Object.assign(Object.assign({}, this.styles), { [color.name]: this.theme.colors.getColor(color.theme) })));
|
|
3622
3626
|
}
|
|
@@ -3642,6 +3646,7 @@ const CuraCalendar = /*@__PURE__*/ proxyCustomElement(class CuraCalendar extends
|
|
|
3642
3646
|
}
|
|
3643
3647
|
}
|
|
3644
3648
|
this.defaultDates = this.expandDateRanges(this.defaultDate);
|
|
3649
|
+
this.currentDate = this.defaultDates[0] ? this.defaultDates[0] : this.currentDate;
|
|
3645
3650
|
}
|
|
3646
3651
|
/**
|
|
3647
3652
|
* Get the locale for the calendar.
|
|
@@ -3735,7 +3740,7 @@ const CuraCalendar = /*@__PURE__*/ proxyCustomElement(class CuraCalendar extends
|
|
|
3735
3740
|
* @param {string} direction - 'prev' | 'next'
|
|
3736
3741
|
*/
|
|
3737
3742
|
updateCurrentMonth(direction) {
|
|
3738
|
-
let newMonth =
|
|
3743
|
+
let newMonth = this.currentDate;
|
|
3739
3744
|
if (direction === 'prev')
|
|
3740
3745
|
newMonth = subMonths(this.currentDate, 1);
|
|
3741
3746
|
if (direction === 'next')
|
|
@@ -3873,7 +3878,7 @@ const CuraCalendar = /*@__PURE__*/ proxyCustomElement(class CuraCalendar extends
|
|
|
3873
3878
|
return daysIncurrentDate.slice(0, DAYS_IN_CALENDAR_VIEW);
|
|
3874
3879
|
}
|
|
3875
3880
|
updateCurrentWeek(direction) {
|
|
3876
|
-
let newWeek =
|
|
3881
|
+
let newWeek = this.currentDate;
|
|
3877
3882
|
if (direction === 'prev')
|
|
3878
3883
|
newWeek = subWeeks(this.currentDate, 1);
|
|
3879
3884
|
if (direction === 'next')
|
|
@@ -4026,7 +4031,7 @@ const CuraCalendar = /*@__PURE__*/ proxyCustomElement(class CuraCalendar extends
|
|
|
4026
4031
|
}
|
|
4027
4032
|
render() {
|
|
4028
4033
|
const { months } = this.fetchMonthNames();
|
|
4029
|
-
return (h(Host, { key: '
|
|
4034
|
+
return (h(Host, { key: 'a27b858fff12fe2d19898dbb0be8080a0175c465', style: this.getHostCSSProperties() }, h("div", { key: 'e2fe9991e3ef03d11b0e58b412d31020ead1b344', class: `calendar ${this.floating ? 'floating' : ''} ${this.embedded ? 'embedded' : ''}`, style: this.styles }, h("header", { key: '8bf8a4f703043d907d8bc81ed22061380cd67ade', class: "header" }, h("div", { key: '66c2b27693f188929065972828c2ce4a672f1e74', class: `month-year ${this.type === 'dropdown' && 'dropdown'}` }, h("cura-icon", { key: '0e6841eb77061f404e23fbfc28be40600255767a', class: `icon ${this.type === 'dropdown' && 'dropdown'}`, name: "left", color: this.determinePrevButtonColor(), onClick: !this.collapsed ? () => this.updateCurrentMonth('prev') : () => this.updateCurrentWeek('prev') }), this.type === 'dropdown' ? (h("div", { class: "select" }, h("cura-select", { size: "small", class: "drop-month", mode: "transparent", value: months[getMonth(this.currentDate)], onSelected: e => this.onMonthDropdownChange(e) }, months.map((month, index) => (h("cura-select-option", { size: "xsmall", key: index, value: month }, month)))), h("cura-select", { size: "small", class: "drop-year", mode: "transparent", value: getYear(this.currentDate).toString(), onSelected: e => this.onYearDropdownChange(e) }, this.fetchYearList().map((year, index) => (h("cura-select-option", { key: index, value: year.toString() }, year.toString())))))) : (h("cura-label", { color: "neutral-black", size: "large" }, months[getMonth(this.currentDate)].slice(0, 3), ", ", getYear(this.currentDate))), h("cura-icon", { key: 'cdc62d8666dc7b890daadf63d2ffe0d0000ec545', class: `icon ${this.type === 'dropdown' && 'dropdown'}`, name: "right", color: "primary-base", onClick: !this.collapsed ? () => this.updateCurrentMonth('next') : () => this.updateCurrentWeek('next') }))), h("span", { key: 'fa0d8c6ff291f343da594799b3ba366d3e020e74', class: "days-of-week" }, this.fetchWeekDays().map((day, index) => (h("cura-label", { class: "day", size: "xsmall", color: "neutral-black", weight: "bold", key: index }, day === 'sab' ? 'SÁB' : day.toLocaleUpperCase())))), h("div", { key: 'dc072663767251cc694d51612cacd94f1fe31a84', class: "dates" }, !this.collapsed
|
|
4030
4035
|
? this.fetchDaysOfMonth().map((day, index) => (h("div", { key: index, class: this.getClasses(day), onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : '')))
|
|
4031
4036
|
: this.fetchDaysOfWeek().map((day, index) => (h("div", { key: index, class: this.getClasses(day), onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : '')))), this.collapsed !== null ? (this.collapsed ? (h("div", { class: "collapsed-container" }, h("cura-button-transparent", { onClick: () => this.showNotColapsedCalendar(), size: "small", color: "primary", fontColor: "dark", iconName: "plusCircle" }, "Veja mais datas"))) : (h("div", { class: "collapsed-container" }, h("cura-button-transparent", { onClick: () => this.showColapsedCalendar(), size: "small", color: "primary", fontColor: "dark", iconName: "minusCircle" }, "Veja menos datas")))) : null)));
|
|
4032
4037
|
}
|
|
@@ -4054,10 +4059,11 @@ const CuraCalendar = /*@__PURE__*/ proxyCustomElement(class CuraCalendar extends
|
|
|
4054
4059
|
"collapsed": [1540],
|
|
4055
4060
|
"floating": [1540],
|
|
4056
4061
|
"embedded": [1540],
|
|
4057
|
-
"
|
|
4062
|
+
"selectLabelColorMode": [1537, "select-label-color-mode"],
|
|
4058
4063
|
"selectedDates": [32],
|
|
4059
4064
|
"rangeStart": [32],
|
|
4060
4065
|
"defaultDates": [32],
|
|
4066
|
+
"currentDate": [32],
|
|
4061
4067
|
"selectMonth": [32],
|
|
4062
4068
|
"selectYear": [32],
|
|
4063
4069
|
"styles": [32]
|