@neoptocom/neopto-ui 1.6.0 → 1.6.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/index.cjs +28 -40
- package/dist/index.js +28 -40
- package/package.json +1 -1
- package/src/components/Autocomplete.tsx +1 -1
- package/src/components/Calendar.tsx +33 -38
package/dist/index.cjs
CHANGED
|
@@ -897,7 +897,7 @@ function Autocomplete({
|
|
|
897
897
|
onClick: selectedOption && !open ? handleClear : () => setOpen((s) => !s),
|
|
898
898
|
disabled,
|
|
899
899
|
"aria-label": selectedOption && !open ? "Clear" : open ? "Collapse" : "Expand",
|
|
900
|
-
className: "absolute right-
|
|
900
|
+
className: "absolute right-1 top-[-20%]",
|
|
901
901
|
iconClassName: [
|
|
902
902
|
"transition-transform duration-300 text-[var(--muted-fg)]",
|
|
903
903
|
open ? "rotate-180 text-[var(--color-brand)]" : ""
|
|
@@ -1549,21 +1549,8 @@ var Breadcrumb = ({
|
|
|
1549
1549
|
] }, index);
|
|
1550
1550
|
}) }) });
|
|
1551
1551
|
};
|
|
1552
|
-
var DAYS_OF_WEEK = ["
|
|
1553
|
-
var MONTHS = [
|
|
1554
|
-
"January",
|
|
1555
|
-
"February",
|
|
1556
|
-
"March",
|
|
1557
|
-
"April",
|
|
1558
|
-
"May",
|
|
1559
|
-
"June",
|
|
1560
|
-
"July",
|
|
1561
|
-
"August",
|
|
1562
|
-
"September",
|
|
1563
|
-
"October",
|
|
1564
|
-
"November",
|
|
1565
|
-
"December"
|
|
1566
|
-
];
|
|
1552
|
+
var DAYS_OF_WEEK = ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "S\xE1b"];
|
|
1553
|
+
var MONTHS = ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"];
|
|
1567
1554
|
function isSameDay(date1, date2) {
|
|
1568
1555
|
return date1.getDate() === date2.getDate() && date1.getMonth() === date2.getMonth() && date1.getFullYear() === date2.getFullYear();
|
|
1569
1556
|
}
|
|
@@ -1640,31 +1627,32 @@ function Calendar({
|
|
|
1640
1627
|
}
|
|
1641
1628
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full", children: [
|
|
1642
1629
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-4", children: [
|
|
1643
|
-
/* @__PURE__ */ jsxRuntime.
|
|
1644
|
-
"
|
|
1645
|
-
{
|
|
1646
|
-
type: "button",
|
|
1647
|
-
onClick: prevMonth,
|
|
1648
|
-
className: "p-2 rounded-full hover:bg-[var(--muted)] transition-colors",
|
|
1649
|
-
"aria-label": "Previous month",
|
|
1650
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "material-symbols-rounded text-[var(--fg)]", children: "chevron_left" })
|
|
1651
|
-
}
|
|
1652
|
-
),
|
|
1653
|
-
/* @__PURE__ */ jsxRuntime.jsxs("h3", { className: "text-sm font-medium text-[var(--fg)]", children: [
|
|
1654
|
-
MONTHS[currentMonth.getMonth()],
|
|
1655
|
-
" ",
|
|
1656
|
-
currentMonth.getFullYear()
|
|
1630
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1631
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typo, { variant: "title-md", bold: "medium", className: "text-[var(--fg)]", children: MONTHS[currentMonth.getMonth()] }),
|
|
1632
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typo, { variant: "title-md", bold: "medium", className: "text-cyan-500", children: currentMonth.getFullYear() })
|
|
1657
1633
|
] }),
|
|
1658
|
-
/* @__PURE__ */ jsxRuntime.
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1634
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1635
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1636
|
+
"button",
|
|
1637
|
+
{
|
|
1638
|
+
type: "button",
|
|
1639
|
+
onClick: prevMonth,
|
|
1640
|
+
className: "p-2 rounded-full hover:bg-[var(--muted)] transition-colors",
|
|
1641
|
+
"aria-label": "Previous month",
|
|
1642
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "material-symbols-rounded text-[var(--fg)]", children: "chevron_left" })
|
|
1643
|
+
}
|
|
1644
|
+
),
|
|
1645
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1646
|
+
"button",
|
|
1647
|
+
{
|
|
1648
|
+
type: "button",
|
|
1649
|
+
onClick: nextMonth,
|
|
1650
|
+
className: "p-2 rounded-full hover:bg-[var(--muted)] transition-colors",
|
|
1651
|
+
"aria-label": "Next month",
|
|
1652
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "material-symbols-rounded text-[var(--fg)]", children: "chevron_right" })
|
|
1653
|
+
}
|
|
1654
|
+
)
|
|
1655
|
+
] })
|
|
1668
1656
|
] }),
|
|
1669
1657
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-7 gap-1 mb-2", children: DAYS_OF_WEEK.map((day) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1670
1658
|
"div",
|
package/dist/index.js
CHANGED
|
@@ -876,7 +876,7 @@ function Autocomplete({
|
|
|
876
876
|
onClick: selectedOption && !open ? handleClear : () => setOpen((s) => !s),
|
|
877
877
|
disabled,
|
|
878
878
|
"aria-label": selectedOption && !open ? "Clear" : open ? "Collapse" : "Expand",
|
|
879
|
-
className: "absolute right-
|
|
879
|
+
className: "absolute right-1 top-[-20%]",
|
|
880
880
|
iconClassName: [
|
|
881
881
|
"transition-transform duration-300 text-[var(--muted-fg)]",
|
|
882
882
|
open ? "rotate-180 text-[var(--color-brand)]" : ""
|
|
@@ -1528,21 +1528,8 @@ var Breadcrumb = ({
|
|
|
1528
1528
|
] }, index);
|
|
1529
1529
|
}) }) });
|
|
1530
1530
|
};
|
|
1531
|
-
var DAYS_OF_WEEK = ["
|
|
1532
|
-
var MONTHS = [
|
|
1533
|
-
"January",
|
|
1534
|
-
"February",
|
|
1535
|
-
"March",
|
|
1536
|
-
"April",
|
|
1537
|
-
"May",
|
|
1538
|
-
"June",
|
|
1539
|
-
"July",
|
|
1540
|
-
"August",
|
|
1541
|
-
"September",
|
|
1542
|
-
"October",
|
|
1543
|
-
"November",
|
|
1544
|
-
"December"
|
|
1545
|
-
];
|
|
1531
|
+
var DAYS_OF_WEEK = ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "S\xE1b"];
|
|
1532
|
+
var MONTHS = ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"];
|
|
1546
1533
|
function isSameDay(date1, date2) {
|
|
1547
1534
|
return date1.getDate() === date2.getDate() && date1.getMonth() === date2.getMonth() && date1.getFullYear() === date2.getFullYear();
|
|
1548
1535
|
}
|
|
@@ -1619,31 +1606,32 @@ function Calendar({
|
|
|
1619
1606
|
}
|
|
1620
1607
|
return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
|
|
1621
1608
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-4", children: [
|
|
1622
|
-
/* @__PURE__ */
|
|
1623
|
-
"
|
|
1624
|
-
{
|
|
1625
|
-
type: "button",
|
|
1626
|
-
onClick: prevMonth,
|
|
1627
|
-
className: "p-2 rounded-full hover:bg-[var(--muted)] transition-colors",
|
|
1628
|
-
"aria-label": "Previous month",
|
|
1629
|
-
children: /* @__PURE__ */ jsx("span", { className: "material-symbols-rounded text-[var(--fg)]", children: "chevron_left" })
|
|
1630
|
-
}
|
|
1631
|
-
),
|
|
1632
|
-
/* @__PURE__ */ jsxs("h3", { className: "text-sm font-medium text-[var(--fg)]", children: [
|
|
1633
|
-
MONTHS[currentMonth.getMonth()],
|
|
1634
|
-
" ",
|
|
1635
|
-
currentMonth.getFullYear()
|
|
1609
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1610
|
+
/* @__PURE__ */ jsx(Typo, { variant: "title-md", bold: "medium", className: "text-[var(--fg)]", children: MONTHS[currentMonth.getMonth()] }),
|
|
1611
|
+
/* @__PURE__ */ jsx(Typo, { variant: "title-md", bold: "medium", className: "text-cyan-500", children: currentMonth.getFullYear() })
|
|
1636
1612
|
] }),
|
|
1637
|
-
/* @__PURE__ */
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1613
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
1614
|
+
/* @__PURE__ */ jsx(
|
|
1615
|
+
"button",
|
|
1616
|
+
{
|
|
1617
|
+
type: "button",
|
|
1618
|
+
onClick: prevMonth,
|
|
1619
|
+
className: "p-2 rounded-full hover:bg-[var(--muted)] transition-colors",
|
|
1620
|
+
"aria-label": "Previous month",
|
|
1621
|
+
children: /* @__PURE__ */ jsx("span", { className: "material-symbols-rounded text-[var(--fg)]", children: "chevron_left" })
|
|
1622
|
+
}
|
|
1623
|
+
),
|
|
1624
|
+
/* @__PURE__ */ jsx(
|
|
1625
|
+
"button",
|
|
1626
|
+
{
|
|
1627
|
+
type: "button",
|
|
1628
|
+
onClick: nextMonth,
|
|
1629
|
+
className: "p-2 rounded-full hover:bg-[var(--muted)] transition-colors",
|
|
1630
|
+
"aria-label": "Next month",
|
|
1631
|
+
children: /* @__PURE__ */ jsx("span", { className: "material-symbols-rounded text-[var(--fg)]", children: "chevron_right" })
|
|
1632
|
+
}
|
|
1633
|
+
)
|
|
1634
|
+
] })
|
|
1647
1635
|
] }),
|
|
1648
1636
|
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 gap-1 mb-2", children: DAYS_OF_WEEK.map((day) => /* @__PURE__ */ jsx(
|
|
1649
1637
|
"div",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neoptocom/neopto-ui",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A modern React component library built with Tailwind CSS v4 and TypeScript. Features dark mode, design tokens, and comprehensive Storybook documentation. Requires Tailwind v4+.",
|
|
6
6
|
"keywords": [
|
|
@@ -222,7 +222,7 @@ export default function Autocomplete({
|
|
|
222
222
|
}
|
|
223
223
|
disabled={disabled}
|
|
224
224
|
aria-label={selectedOption && !open ? "Clear" : open ? "Collapse" : "Expand"}
|
|
225
|
-
className="absolute right-
|
|
225
|
+
className="absolute right-1 top-[-20%]"
|
|
226
226
|
iconClassName={[
|
|
227
227
|
"transition-transform duration-300 text-[var(--muted-fg)]",
|
|
228
228
|
open ? "rotate-180 text-[var(--color-brand)]" : ""
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import Typo from "./Typo";
|
|
2
3
|
|
|
3
4
|
export type CalendarProps = {
|
|
4
5
|
/** Currently selected date */
|
|
@@ -13,21 +14,8 @@ export type CalendarProps = {
|
|
|
13
14
|
maxDate?: Date;
|
|
14
15
|
};
|
|
15
16
|
|
|
16
|
-
const DAYS_OF_WEEK = ["
|
|
17
|
-
const MONTHS = [
|
|
18
|
-
"January",
|
|
19
|
-
"February",
|
|
20
|
-
"March",
|
|
21
|
-
"April",
|
|
22
|
-
"May",
|
|
23
|
-
"June",
|
|
24
|
-
"July",
|
|
25
|
-
"August",
|
|
26
|
-
"September",
|
|
27
|
-
"October",
|
|
28
|
-
"November",
|
|
29
|
-
"December",
|
|
30
|
-
];
|
|
17
|
+
const DAYS_OF_WEEK = ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb"];
|
|
18
|
+
const MONTHS = ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"];
|
|
31
19
|
|
|
32
20
|
function isSameDay(date1: Date, date2: Date): boolean {
|
|
33
21
|
return (
|
|
@@ -130,29 +118,36 @@ export default function Calendar({
|
|
|
130
118
|
<div className="w-full">
|
|
131
119
|
{/* Header */}
|
|
132
120
|
<div className="flex items-center justify-between mb-4">
|
|
133
|
-
<
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
121
|
+
<div className="flex items-center gap-2">
|
|
122
|
+
<Typo variant="title-md" bold="medium" className="text-[var(--fg)]">
|
|
123
|
+
{MONTHS[currentMonth.getMonth()]}
|
|
124
|
+
</Typo>
|
|
125
|
+
<Typo variant="title-md" bold="medium" className="text-cyan-500">
|
|
126
|
+
{currentMonth.getFullYear()}
|
|
127
|
+
</Typo>
|
|
128
|
+
</div>
|
|
129
|
+
<div>
|
|
130
|
+
<button
|
|
131
|
+
type="button"
|
|
132
|
+
onClick={prevMonth}
|
|
133
|
+
className="p-2 rounded-full hover:bg-[var(--muted)] transition-colors"
|
|
134
|
+
aria-label="Previous month"
|
|
135
|
+
>
|
|
136
|
+
<span className="material-symbols-rounded text-[var(--fg)]">
|
|
137
|
+
chevron_left
|
|
138
|
+
</span>
|
|
139
|
+
</button>
|
|
140
|
+
<button
|
|
141
|
+
type="button"
|
|
142
|
+
onClick={nextMonth}
|
|
143
|
+
className="p-2 rounded-full hover:bg-[var(--muted)] transition-colors"
|
|
144
|
+
aria-label="Next month"
|
|
145
|
+
>
|
|
146
|
+
<span className="material-symbols-rounded text-[var(--fg)]">
|
|
147
|
+
chevron_right
|
|
148
|
+
</span>
|
|
149
|
+
</button>
|
|
150
|
+
</div>
|
|
156
151
|
</div>
|
|
157
152
|
|
|
158
153
|
{/* Days of week header */}
|