@e-burgos/tucu-ui 2.7.3 → 2.8.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/CHANGELOG.md +27 -0
- package/README.md +17 -0
- package/base.css +225 -0
- package/components/inputs/input.mjs +43 -43
- package/components/inputs/select.mjs +1 -1
- package/components/loaders/loader.mjs +21 -21
- package/components/typography/index.mjs +30 -30
- package/index.css +1 -1
- package/index.js +1 -1
- package/macos/index.css +15 -0
- package/macos/sonoma/index.css +34 -0
- package/macos/sonoma/macos-auth.css +162 -0
- package/macos/sonoma/macos-backgrounds.css +314 -0
- package/macos/sonoma/macos-buttons.css +231 -0
- package/macos/sonoma/macos-cards.css +104 -0
- package/macos/sonoma/macos-content.css +157 -0
- package/macos/sonoma/macos-dialogs.css +122 -0
- package/macos/sonoma/macos-feedback.css +237 -0
- package/macos/sonoma/macos-fonts.css +7 -0
- package/macos/sonoma/macos-foundations.css +479 -0
- package/macos/sonoma/macos-inputs.css +1580 -0
- package/macos/sonoma/macos-layouts.css +223 -0
- package/macos/sonoma/macos-liquid-glass.css +279 -0
- package/macos/sonoma/macos-menus.css +184 -0
- package/macos/sonoma/macos-misc.css +635 -0
- package/macos/sonoma/macos-navigation.css +145 -0
- package/macos/sonoma/macos-selection.css +237 -0
- package/macos/sonoma/macos-sidebar.css +416 -0
- package/macos/sonoma/macos-tables.css +318 -0
- package/macos/sonoma/macos-toolbar.css +302 -0
- package/macos/sonoma/macos-typography.css +485 -0
- package/macos/sonoma/macos-window.css +273 -0
- package/macos/tahoe/index.css +34 -0
- package/macos/tahoe/macos-auth.css +162 -0
- package/macos/tahoe/macos-backgrounds.css +314 -0
- package/macos/tahoe/macos-buttons.css +286 -0
- package/macos/tahoe/macos-cards.css +125 -0
- package/macos/tahoe/macos-content.css +157 -0
- package/macos/tahoe/macos-dialogs.css +195 -0
- package/macos/tahoe/macos-feedback.css +273 -0
- package/macos/tahoe/macos-fonts.css +7 -0
- package/macos/tahoe/macos-foundations.css +516 -0
- package/macos/tahoe/macos-inputs.css +1656 -0
- package/macos/tahoe/macos-layouts.css +438 -0
- package/macos/tahoe/macos-liquid-glass.css +279 -0
- package/macos/tahoe/macos-menus.css +184 -0
- package/macos/tahoe/macos-misc.css +635 -0
- package/macos/tahoe/macos-navigation.css +191 -0
- package/macos/tahoe/macos-selection.css +237 -0
- package/macos/tahoe/macos-sidebar.css +420 -0
- package/macos/tahoe/macos-tables.css +320 -0
- package/macos/tahoe/macos-toolbar.css +304 -0
- package/macos/tahoe/macos-typography.css +485 -0
- package/macos/tahoe/macos-window.css +273 -0
- package/package.json +3 -2
- package/theme.css +812 -0
- package/third-party.css +39 -0
- package/utilities.css +105 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,33 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.8.1] - 2026-07-16
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- release @e-burgos/tucu-ui-mcp@0.6.1
|
|
13
|
+
- fix stale MCP tool count and schemas on the MCP Server page
|
|
14
|
+
- document the ./theme export and fix the Home page's CSS setup guide
|
|
15
|
+
- bump @e-burgos/tucu-ui to ^2.8.0
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- stop uncontrolled-to-controlled warning on date picker
|
|
20
|
+
- sync catalog/quickstart/changelog resources with tucu-ui 2.8.0
|
|
21
|
+
- scan ui/tucu-docs for Tailwind classes too
|
|
22
|
+
## [2.8.0] - 2026-07-15
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- add a tokens-only ./theme export for Tailwind consumers (WS2)
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- bump @e-burgos/tucu-ui to ^2.7.3
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
|
|
34
|
+
- stop scanning third-party node_modules for Tailwind classes
|
|
8
35
|
## [2.7.3] - 2026-07-15
|
|
9
36
|
|
|
10
37
|
### Changed
|
package/README.md
CHANGED
|
@@ -44,6 +44,23 @@ In your main CSS file:
|
|
|
44
44
|
|
|
45
45
|
> Includes full Tailwind CSS v4 — no additional Tailwind setup required.
|
|
46
46
|
|
|
47
|
+
### Already using Tailwind CSS v4 in your project?
|
|
48
|
+
|
|
49
|
+
Don't import `./styles` alongside your own `@import 'tailwindcss'` — that
|
|
50
|
+
runs two separate Tailwind builds in the same page, and their layers can
|
|
51
|
+
override each other unpredictably. Use `./theme` instead: tokens and
|
|
52
|
+
component styles only, no bundled Tailwind, so your own build generates
|
|
53
|
+
every utility class (yours and Tucu UI's) from one instance.
|
|
54
|
+
|
|
55
|
+
```css
|
|
56
|
+
@import 'tailwindcss';
|
|
57
|
+
@import '@e-burgos/tucu-ui/theme';
|
|
58
|
+
@source '../node_modules/@e-burgos/tucu-ui';
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Import order between these three lines doesn't matter — your own utility
|
|
62
|
+
classes always win over Tucu UI's defaults either way.
|
|
63
|
+
|
|
47
64
|
---
|
|
48
65
|
|
|
49
66
|
## Quick Start
|
package/base.css
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
/* ===================================================================
|
|
2
|
+
TUCU-UI — BASE STYLES
|
|
3
|
+
===================================================================
|
|
4
|
+
|
|
5
|
+
Structural mode styles (html:root, html.dark) live in Tailwind's own
|
|
6
|
+
`base` layer. Tailwind v4 fixes the layer order — theme < base <
|
|
7
|
+
components < utilities — the moment `@import 'tailwindcss'` runs
|
|
8
|
+
ANYWHERE in a build, regardless of where relative to that import this
|
|
9
|
+
file's `@layer base { ... }` block appears. That means any utility
|
|
10
|
+
class (the consumer's own, or one of ours) reliably wins over these
|
|
11
|
+
rules, while they still win over Tailwind's own preflight/theme reset
|
|
12
|
+
— without needing to be unlayered.
|
|
13
|
+
|
|
14
|
+
Imported by globals.css and theme.css.
|
|
15
|
+
=================================================================== */
|
|
16
|
+
|
|
17
|
+
@layer base {
|
|
18
|
+
/* =================================================================
|
|
19
|
+
LIGHT MODE (default)
|
|
20
|
+
================================================================= */
|
|
21
|
+
html:root {
|
|
22
|
+
@apply antialiased;
|
|
23
|
+
@apply bg-light;
|
|
24
|
+
-webkit-tap-highlight-color: transparent;
|
|
25
|
+
border-color: var(--color-border);
|
|
26
|
+
font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont,
|
|
27
|
+
'Segoe UI', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans',
|
|
28
|
+
'Helvetica Neue', sans-serif;
|
|
29
|
+
color: var(--font-primary-color);
|
|
30
|
+
|
|
31
|
+
/* Semantic colors — Foreground */
|
|
32
|
+
--color-semantic-fg: var(--color-tucu-ui-gray-100);
|
|
33
|
+
--color-semantic-fg-muted: var(--color-tucu-ui-gray-60);
|
|
34
|
+
--color-semantic-fg-inverse: var(--color-tucu-ui-gray-0);
|
|
35
|
+
--color-semantic-fg-primary: var(--color-tucu-ui-blue-60);
|
|
36
|
+
--color-semantic-fg-warning: var(--color-tucu-ui-orange-60);
|
|
37
|
+
--color-semantic-fg-positive: var(--color-tucu-ui-green-60);
|
|
38
|
+
--color-semantic-fg-negative: var(--color-tucu-ui-red-60);
|
|
39
|
+
|
|
40
|
+
/* Semantic colors — Background */
|
|
41
|
+
--color-semantic-bg: var(--color-tucu-ui-gray-0);
|
|
42
|
+
--color-semantic-bg-alternate: var(--color-tucu-ui-gray-10);
|
|
43
|
+
--color-semantic-bg-inverse: var(--color-tucu-ui-gray-100);
|
|
44
|
+
--color-semantic-bg-primary: var(--color-tucu-ui-blue-60);
|
|
45
|
+
--color-semantic-bg-primary-wash: var(--color-tucu-ui-blue-0);
|
|
46
|
+
--color-semantic-bg-secondary: var(--color-tucu-ui-gray-10);
|
|
47
|
+
--color-semantic-bg-tertiary: var(--color-tucu-ui-gray-20);
|
|
48
|
+
--color-semantic-bg-secondary-wash: var(--color-tucu-ui-gray-5);
|
|
49
|
+
--color-semantic-bg-negative: var(--color-tucu-ui-red-60);
|
|
50
|
+
--color-semantic-bg-negative-wash: var(--color-tucu-ui-red-0);
|
|
51
|
+
--color-semantic-bg-positive: var(--color-tucu-ui-green-60);
|
|
52
|
+
--color-semantic-bg-positive-wash: var(--color-tucu-ui-green-0);
|
|
53
|
+
--color-semantic-bg-warning: var(--color-tucu-ui-orange-40);
|
|
54
|
+
--color-semantic-bg-warning-wash: var(--color-tucu-ui-orange-0);
|
|
55
|
+
--color-semantic-bg-info: var(--color-tucu-ui-blue-60);
|
|
56
|
+
|
|
57
|
+
/* Semantic colors — Line */
|
|
58
|
+
--color-semantic-line-primary: var(--color-tucu-ui-gray-20);
|
|
59
|
+
--color-semantic-line-primary-subtle: color-mix(
|
|
60
|
+
in oklab,
|
|
61
|
+
var(--color-black) 10%,
|
|
62
|
+
transparent
|
|
63
|
+
);
|
|
64
|
+
--color-semantic-line-inverse: var(--color-tucu-ui-gray-0);
|
|
65
|
+
|
|
66
|
+
/* Semantic colors — Elevation */
|
|
67
|
+
--color-semantic-elevation-1: var(--color-tucu-ui-gray-0);
|
|
68
|
+
--color-semantic-elevation-2: var(--color-tucu-ui-gray-0);
|
|
69
|
+
|
|
70
|
+
/* Semantic colors — Accent */
|
|
71
|
+
--color-semantic-accent-subtle-green: var(--color-tucu-ui-green-0);
|
|
72
|
+
--color-semantic-accent-bold-green: var(--color-tucu-ui-green-60);
|
|
73
|
+
--color-semantic-accent-subtle-blue: var(--color-tucu-ui-blue-0);
|
|
74
|
+
--color-semantic-accent-bold-blue: var(--color-tucu-ui-blue-60);
|
|
75
|
+
--color-semantic-accent-subtle-purple: var(--color-tucu-ui-purple-0);
|
|
76
|
+
--color-semantic-accent-bold-purple: var(--color-tucu-ui-purple-80);
|
|
77
|
+
--color-semantic-accent-subtle-yellow: var(--color-tucu-ui-yellow-0);
|
|
78
|
+
--color-semantic-accent-bold-yellow: var(--color-tucu-ui-yellow-30);
|
|
79
|
+
--color-semantic-accent-subtle-red: var(--color-tucu-ui-red-0);
|
|
80
|
+
--color-semantic-accent-bold-red: var(--color-tucu-ui-red-60);
|
|
81
|
+
--color-semantic-accent-subtle-gray: var(--color-tucu-ui-gray-10);
|
|
82
|
+
--color-semantic-accent-bold-gray: var(--color-tucu-ui-gray-80);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* =================================================================
|
|
86
|
+
DARK MODE
|
|
87
|
+
================================================================= */
|
|
88
|
+
html.dark {
|
|
89
|
+
@apply bg-dark;
|
|
90
|
+
color: var(--font-primary-dark-color);
|
|
91
|
+
|
|
92
|
+
--color-brand: var(--color-semantic-dark-bg-primary);
|
|
93
|
+
--color-primary: var(--color-semantic-dark-bg-primary);
|
|
94
|
+
--color-secondary: var(--color-semantic-dark-bg-secondary);
|
|
95
|
+
--color-accent: var(--color-semantic-dark-accent-bold-yellow);
|
|
96
|
+
--color-muted: var(--color-semantic-dark-fg-muted);
|
|
97
|
+
--color-border: var(
|
|
98
|
+
--color-semantic-dark-line-primary-subtle,
|
|
99
|
+
color-mix(in oklab, var(--color-white) 8%, transparent)
|
|
100
|
+
) !important;
|
|
101
|
+
|
|
102
|
+
/* Status Colors */
|
|
103
|
+
--color-success: var(--color-semantic-dark-bg-positive);
|
|
104
|
+
--color-warning: var(--color-semantic-dark-bg-warning);
|
|
105
|
+
--color-error: var(--color-semantic-dark-bg-negative);
|
|
106
|
+
--color-info: var(--color-semantic-dark-bg-info);
|
|
107
|
+
|
|
108
|
+
/* Dark/Light Theme Colors */
|
|
109
|
+
--color-body: var(--color-semantic-dark-bg);
|
|
110
|
+
--color-light-dark: var(--color-semantic-dark-bg-secondary-wash);
|
|
111
|
+
--color-foreground: var(--font-primary-dark-color);
|
|
112
|
+
--hero-grid-color: var(--color-gray-800);
|
|
113
|
+
|
|
114
|
+
/* Semantic colors — Foreground */
|
|
115
|
+
--color-semantic-fg: var(--color-semantic-dark-fg);
|
|
116
|
+
--color-semantic-fg-muted: var(--color-semantic-dark-fg-muted);
|
|
117
|
+
--color-semantic-fg-inverse: var(--color-semantic-dark-fg-inverse);
|
|
118
|
+
--color-semantic-fg-primary: var(--color-semantic-dark-fg-primary);
|
|
119
|
+
--color-semantic-fg-warning: var(--color-semantic-dark-fg-warning);
|
|
120
|
+
--color-semantic-fg-positive: var(--color-semantic-dark-fg-positive);
|
|
121
|
+
--color-semantic-fg-negative: var(--color-semantic-dark-fg-negative);
|
|
122
|
+
|
|
123
|
+
/* Semantic colors — Background */
|
|
124
|
+
--color-semantic-bg: var(--color-semantic-dark-bg);
|
|
125
|
+
--color-semantic-bg-alternate: var(--color-semantic-dark-bg-alternate);
|
|
126
|
+
--color-semantic-bg-inverse: var(--color-semantic-dark-bg-inverse);
|
|
127
|
+
--color-semantic-bg-primary: var(--color-semantic-dark-bg-primary);
|
|
128
|
+
--color-semantic-bg-primary-wash: var(
|
|
129
|
+
--color-semantic-dark-bg-primary-wash
|
|
130
|
+
);
|
|
131
|
+
--color-semantic-bg-secondary: var(--color-semantic-dark-bg-secondary);
|
|
132
|
+
--color-semantic-bg-tertiary: var(--color-semantic-dark-bg-tertiary);
|
|
133
|
+
--color-semantic-bg-secondary-wash: var(
|
|
134
|
+
--color-semantic-dark-bg-secondary-wash
|
|
135
|
+
);
|
|
136
|
+
--color-semantic-bg-negative: var(--color-semantic-dark-bg-negative);
|
|
137
|
+
--color-semantic-bg-negative-wash: var(
|
|
138
|
+
--color-semantic-dark-bg-negative-wash
|
|
139
|
+
);
|
|
140
|
+
--color-semantic-bg-positive: var(--color-semantic-dark-bg-positive);
|
|
141
|
+
--color-semantic-bg-positive-wash: var(
|
|
142
|
+
--color-semantic-dark-bg-positive-wash
|
|
143
|
+
);
|
|
144
|
+
--color-semantic-bg-warning: var(--color-semantic-dark-bg-warning);
|
|
145
|
+
--color-semantic-bg-warning-wash: var(
|
|
146
|
+
--color-semantic-dark-bg-warning-wash
|
|
147
|
+
);
|
|
148
|
+
--color-semantic-bg-info: var(--color-semantic-dark-bg-info);
|
|
149
|
+
|
|
150
|
+
/* Semantic colors — Line */
|
|
151
|
+
--color-semantic-line-primary: var(--color-semantic-dark-line-primary);
|
|
152
|
+
--color-semantic-line-primary-subtle: var(
|
|
153
|
+
--color-semantic-dark-line-primary-subtle
|
|
154
|
+
);
|
|
155
|
+
--color-semantic-line-inverse: var(--color-semantic-dark-line-inverse);
|
|
156
|
+
|
|
157
|
+
/* Semantic colors — Elevation */
|
|
158
|
+
--color-semantic-elevation-1: var(--color-semantic-dark-elevation-1);
|
|
159
|
+
--color-semantic-elevation-2: var(--color-semantic-dark-elevation-2);
|
|
160
|
+
|
|
161
|
+
/* Semantic colors — Accent */
|
|
162
|
+
--color-semantic-accent-subtle-green: var(
|
|
163
|
+
--color-semantic-dark-accent-subtle-green
|
|
164
|
+
);
|
|
165
|
+
--color-semantic-accent-bold-green: var(
|
|
166
|
+
--color-semantic-dark-accent-bold-green
|
|
167
|
+
);
|
|
168
|
+
--color-semantic-accent-subtle-blue: var(
|
|
169
|
+
--color-semantic-dark-accent-subtle-blue
|
|
170
|
+
);
|
|
171
|
+
--color-semantic-accent-bold-blue: var(
|
|
172
|
+
--color-semantic-dark-accent-bold-blue
|
|
173
|
+
);
|
|
174
|
+
--color-semantic-accent-subtle-purple: var(
|
|
175
|
+
--color-semantic-dark-accent-subtle-purple
|
|
176
|
+
);
|
|
177
|
+
--color-semantic-accent-bold-purple: var(
|
|
178
|
+
--color-semantic-dark-accent-bold-purple
|
|
179
|
+
);
|
|
180
|
+
--color-semantic-accent-subtle-yellow: var(
|
|
181
|
+
--color-semantic-dark-accent-subtle-yellow
|
|
182
|
+
);
|
|
183
|
+
--color-semantic-accent-bold-yellow: var(
|
|
184
|
+
--color-semantic-dark-accent-bold-yellow
|
|
185
|
+
);
|
|
186
|
+
--color-semantic-accent-subtle-red: var(
|
|
187
|
+
--color-semantic-dark-accent-subtle-red
|
|
188
|
+
);
|
|
189
|
+
--color-semantic-accent-bold-red: var(
|
|
190
|
+
--color-semantic-dark-accent-bold-red
|
|
191
|
+
);
|
|
192
|
+
--color-semantic-accent-subtle-gray: var(
|
|
193
|
+
--color-semantic-dark-accent-subtle-gray
|
|
194
|
+
);
|
|
195
|
+
--color-semantic-accent-bold-gray: var(
|
|
196
|
+
--color-semantic-dark-accent-bold-gray
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/* ===================================================================
|
|
201
|
+
NO FOCUS RINGS ON INPUTS (all themes)
|
|
202
|
+
Uses html:root to match specificity of theme-scoped rules
|
|
203
|
+
(html.macos-tahoe / html.macos) and wins by cascade order.
|
|
204
|
+
=================================================================== */
|
|
205
|
+
html:root [data-tucu='input-control']:focus,
|
|
206
|
+
html:root [data-tucu='input']:focus-within,
|
|
207
|
+
html:root [data-tucu='textarea']:focus,
|
|
208
|
+
html:root [data-tucu='select']:focus-within,
|
|
209
|
+
html:root [data-tucu='select-trigger']:focus,
|
|
210
|
+
html:root [data-tucu='select-search']:focus,
|
|
211
|
+
html:root [data-tucu='input-searcher']:focus-within,
|
|
212
|
+
html:root [data-tucu='input-calendar']:focus,
|
|
213
|
+
html:root [data-tucu='checkbox']:focus,
|
|
214
|
+
html:root [data-tucu='checkbox']:focus-visible,
|
|
215
|
+
html:root [data-tucu='radio']:focus,
|
|
216
|
+
html:root [data-tucu='radio']:focus-visible,
|
|
217
|
+
html:root [data-tucu='switch-control']:focus-visible,
|
|
218
|
+
html:root [data-tucu='pin-code-input']:focus,
|
|
219
|
+
html:root [data-tucu='file-input-dropzone']:focus,
|
|
220
|
+
html:root [data-tucu='file-input-dropzone']:focus-within {
|
|
221
|
+
outline: none !important;
|
|
222
|
+
box-shadow: none !important;
|
|
223
|
+
--tw-ring-shadow: 0 0 #0000 !important;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as f, jsx as
|
|
1
|
+
import { jsxs as f, jsx as a, Fragment as Ne } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as Me, useState as y, useRef as de, useId as Ce, useCallback as q, useEffect as C } from "react";
|
|
3
3
|
import { createPortal as Se } from "react-dom";
|
|
4
4
|
import h from "classnames";
|
|
@@ -64,13 +64,13 @@ const Re = {
|
|
|
64
64
|
locale: G = "en-US",
|
|
65
65
|
...p
|
|
66
66
|
}, $) => {
|
|
67
|
-
const [T, pe] = y(!1), [c, te] = y(!1), [he, J] = y(!1), [E, L] = y(null), [b, N] = y(/* @__PURE__ */ new Date()), [w, j] = y(!1), K = de(null), M = de(null), [me, xe] = y({}), be = Ce(), H = ge || be, re = `${H}-error`,
|
|
67
|
+
const [T, pe] = y(!1), [c, te] = y(!1), [he, J] = y(!1), [E, L] = y(null), [b, N] = y(/* @__PURE__ */ new Date()), [w, j] = y(!1), K = de(null), M = de(null), [me, xe] = y({}), be = Ce(), H = ge || be, re = `${H}-error`, ne = `${H}-helper`, fe = [d ? re : null, U ? ne : null].filter(Boolean).join(" ") || void 0, ae = () => {
|
|
68
68
|
pe(!T);
|
|
69
69
|
}, ye = r === "password" && T ? "text" : r, P = q(
|
|
70
70
|
(e, t = x) => {
|
|
71
71
|
if (!e || e.trim() === "")
|
|
72
72
|
return null;
|
|
73
|
-
const
|
|
73
|
+
const n = /^(\d{4})-(\d{2})-(\d{2})$/, o = e.match(n);
|
|
74
74
|
if (o) {
|
|
75
75
|
const Q = parseInt(o[1], 10), X = parseInt(o[2], 10), Z = parseInt(o[3], 10);
|
|
76
76
|
if (!isNaN(Z) && !isNaN(X) && !isNaN(Q)) {
|
|
@@ -106,26 +106,26 @@ const Re = {
|
|
|
106
106
|
},
|
|
107
107
|
[x]
|
|
108
108
|
), we = (e, t = x) => {
|
|
109
|
-
const
|
|
109
|
+
const n = e.getDate().toString().padStart(2, "0"), o = (e.getMonth() + 1).toString().padStart(2, "0"), s = e.getFullYear();
|
|
110
110
|
switch (t) {
|
|
111
111
|
case "DD-MM-YYYY":
|
|
112
|
-
return `${
|
|
112
|
+
return `${n}-${o}-${s}`;
|
|
113
113
|
case "MM-DD-YYYY":
|
|
114
|
-
return `${o}-${
|
|
114
|
+
return `${o}-${n}-${s}`;
|
|
115
115
|
case "YYYY-MM-DD":
|
|
116
|
-
return `${s}-${o}-${
|
|
116
|
+
return `${s}-${o}-${n}`;
|
|
117
117
|
case "DD/MM/YYYY":
|
|
118
|
-
return `${
|
|
118
|
+
return `${n}/${o}/${s}`;
|
|
119
119
|
case "MM/DD/YYYY":
|
|
120
|
-
return `${o}/${
|
|
120
|
+
return `${o}/${n}/${s}`;
|
|
121
121
|
case "YYYY/MM/DD":
|
|
122
|
-
return `${s}/${o}/${
|
|
122
|
+
return `${s}/${o}/${n}`;
|
|
123
123
|
default:
|
|
124
|
-
return `${
|
|
124
|
+
return `${n}-${o}-${s}`;
|
|
125
125
|
}
|
|
126
126
|
}, De = (e) => {
|
|
127
|
-
const t = e.getDate().toString().padStart(2, "0"),
|
|
128
|
-
return `${e.getFullYear()}-${
|
|
127
|
+
const t = e.getDate().toString().padStart(2, "0"), n = (e.getMonth() + 1).toString().padStart(2, "0");
|
|
128
|
+
return `${e.getFullYear()}-${n}-${t}`;
|
|
129
129
|
};
|
|
130
130
|
C(() => {
|
|
131
131
|
if (r === "date" && l && typeof l == "string") {
|
|
@@ -141,7 +141,7 @@ const Re = {
|
|
|
141
141
|
}, [l, r, x, P]);
|
|
142
142
|
const D = q(() => {
|
|
143
143
|
if (!M.current) return;
|
|
144
|
-
const e = M.current.getBoundingClientRect(), t = w ? 320 : 380,
|
|
144
|
+
const e = M.current.getBoundingClientRect(), t = w ? 320 : 380, n = window.innerHeight - e.bottom, o = e.top, s = n < t && o > n;
|
|
145
145
|
xe({
|
|
146
146
|
position: "fixed",
|
|
147
147
|
...s ? { bottom: window.innerHeight - e.top + 4 } : { top: e.bottom + 4 },
|
|
@@ -196,16 +196,16 @@ const Re = {
|
|
|
196
196
|
};
|
|
197
197
|
ee?.(t);
|
|
198
198
|
}, ke = () => {
|
|
199
|
-
const e = b.getFullYear(), t = b.getMonth(),
|
|
200
|
-
o.setDate(o.getDate() -
|
|
199
|
+
const e = b.getFullYear(), t = b.getMonth(), n = new Date(e, t, 1), o = new Date(n);
|
|
200
|
+
o.setDate(o.getDate() - n.getDay());
|
|
201
201
|
const s = [], i = new Date(o);
|
|
202
202
|
for (let u = 0; u < 42; u++)
|
|
203
203
|
s.push(new Date(i)), i.setDate(i.getDate() + 1);
|
|
204
204
|
return s;
|
|
205
205
|
}, R = (e) => {
|
|
206
206
|
N((t) => {
|
|
207
|
-
const
|
|
208
|
-
return e === "prev" ?
|
|
207
|
+
const n = new Date(t);
|
|
208
|
+
return e === "prev" ? n.setMonth(t.getMonth() - 1) : n.setMonth(t.getMonth() + 1), n;
|
|
209
209
|
});
|
|
210
210
|
}, B = () => {
|
|
211
211
|
c ? Y() : Ye();
|
|
@@ -242,12 +242,12 @@ const Re = {
|
|
|
242
242
|
),
|
|
243
243
|
children: [
|
|
244
244
|
g,
|
|
245
|
-
p.required && /* @__PURE__ */
|
|
245
|
+
p.required && /* @__PURE__ */ a("sup", { className: "inline-block text-[13px] text-red-500 ltr:ml-[4px] rtl:mr-[4px]", children: "*" })
|
|
246
246
|
]
|
|
247
247
|
}
|
|
248
248
|
),
|
|
249
249
|
/* @__PURE__ */ f("div", { ref: M, className: "relative", children: [
|
|
250
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ a(
|
|
251
251
|
"input",
|
|
252
252
|
{
|
|
253
253
|
"data-tucu": "input-control",
|
|
@@ -258,7 +258,7 @@ const Re = {
|
|
|
258
258
|
"aria-invalid": d ? "true" : "false",
|
|
259
259
|
"aria-required": p.required ? "true" : void 0,
|
|
260
260
|
readOnly: r === "date",
|
|
261
|
-
value: r === "date"
|
|
261
|
+
value: r === "date" ? E ? we(E) : l ?? "" : l,
|
|
262
262
|
onChange: r !== "date" ? ee : void 0,
|
|
263
263
|
onClick: r === "date" ? B : void 0,
|
|
264
264
|
onTouchStart: r === "date" ? B : ie,
|
|
@@ -280,7 +280,7 @@ const Re = {
|
|
|
280
280
|
)
|
|
281
281
|
}
|
|
282
282
|
),
|
|
283
|
-
(W || I) && /* @__PURE__ */
|
|
283
|
+
(W || I) && /* @__PURE__ */ a(
|
|
284
284
|
"span",
|
|
285
285
|
{
|
|
286
286
|
className: h(
|
|
@@ -291,18 +291,18 @@ const Re = {
|
|
|
291
291
|
children: W || I
|
|
292
292
|
}
|
|
293
293
|
),
|
|
294
|
-
r === "password" && /* @__PURE__ */
|
|
294
|
+
r === "password" && /* @__PURE__ */ a(
|
|
295
295
|
"button",
|
|
296
296
|
{
|
|
297
297
|
type: "button",
|
|
298
|
-
onClick:
|
|
299
|
-
onTouchStart:
|
|
298
|
+
onClick: ae,
|
|
299
|
+
onTouchStart: ae,
|
|
300
300
|
className: "absolute top-1/2 right-[12px] -translate-y-1/2 flex items-center justify-center w-[20px] h-[20px] text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300 transition-colors duration-200 focus:outline-none cursor-pointer",
|
|
301
301
|
"aria-label": T ? "Hide password" : "Show password",
|
|
302
|
-
children: T ? /* @__PURE__ */
|
|
302
|
+
children: T ? /* @__PURE__ */ a(Le, { className: "w-[16px] h-[16px]" }) : /* @__PURE__ */ a(je, { className: "w-[16px] h-[16px]" })
|
|
303
303
|
}
|
|
304
304
|
),
|
|
305
|
-
r === "date" && /* @__PURE__ */
|
|
305
|
+
r === "date" && /* @__PURE__ */ a(
|
|
306
306
|
"button",
|
|
307
307
|
{
|
|
308
308
|
type: "button",
|
|
@@ -310,7 +310,7 @@ const Re = {
|
|
|
310
310
|
onTouchStart: B,
|
|
311
311
|
className: "absolute top-1/2 right-[12px] -translate-y-1/2 flex items-center justify-center w-[20px] h-[20px] text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300 transition-colors duration-200 focus:outline-none cursor-pointer",
|
|
312
312
|
"aria-label": "Open date picker",
|
|
313
|
-
children: /* @__PURE__ */
|
|
313
|
+
children: /* @__PURE__ */ a(He, { className: "w-[16px] h-[16px]" })
|
|
314
314
|
}
|
|
315
315
|
)
|
|
316
316
|
] }),
|
|
@@ -328,17 +328,17 @@ const Re = {
|
|
|
328
328
|
),
|
|
329
329
|
children: [
|
|
330
330
|
/* @__PURE__ */ f("div", { className: "flex items-center justify-between mb-[16px]", children: [
|
|
331
|
-
/* @__PURE__ */
|
|
331
|
+
/* @__PURE__ */ a(
|
|
332
332
|
"button",
|
|
333
333
|
{
|
|
334
334
|
type: "button",
|
|
335
335
|
onClick: () => R("prev"),
|
|
336
336
|
onTouchStart: () => R("prev"),
|
|
337
337
|
className: "p-[4px] hover:bg-gray-100 dark:hover:bg-gray-700 rounded-md transition-colors",
|
|
338
|
-
children: /* @__PURE__ */
|
|
338
|
+
children: /* @__PURE__ */ a(Pe, { className: "w-[16px] h-[16px] text-gray-600 dark:text-gray-400" })
|
|
339
339
|
}
|
|
340
340
|
),
|
|
341
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ a(
|
|
342
342
|
"button",
|
|
343
343
|
{
|
|
344
344
|
type: "button",
|
|
@@ -351,18 +351,18 @@ const Re = {
|
|
|
351
351
|
})
|
|
352
352
|
}
|
|
353
353
|
),
|
|
354
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ a(
|
|
355
355
|
"button",
|
|
356
356
|
{
|
|
357
357
|
type: "button",
|
|
358
358
|
onClick: () => R("next"),
|
|
359
359
|
onTouchStart: () => R("next"),
|
|
360
360
|
className: "p-[4px] hover:bg-gray-100 dark:hover:bg-gray-700 rounded-md transition-colors",
|
|
361
|
-
children: /* @__PURE__ */
|
|
361
|
+
children: /* @__PURE__ */ a(Fe, { className: "w-[16px] h-[16px] text-gray-600 dark:text-gray-400" })
|
|
362
362
|
}
|
|
363
363
|
)
|
|
364
364
|
] }),
|
|
365
|
-
w && /* @__PURE__ */
|
|
365
|
+
w && /* @__PURE__ */ a("div", { className: "mb-[16px]", children: /* @__PURE__ */ a("div", { className: "grid grid-cols-4 gap-[8px] max-h-[160px] overflow-y-auto", children: ve().map((e) => /* @__PURE__ */ a(
|
|
366
366
|
"button",
|
|
367
367
|
{
|
|
368
368
|
type: "button",
|
|
@@ -380,7 +380,7 @@ const Re = {
|
|
|
380
380
|
e
|
|
381
381
|
)) }) }),
|
|
382
382
|
!w && /* @__PURE__ */ f(Ne, { children: [
|
|
383
|
-
/* @__PURE__ */
|
|
383
|
+
/* @__PURE__ */ a("div", { className: "grid grid-cols-7 gap-[4px] mb-[8px]", children: Be(G).map((e) => /* @__PURE__ */ a(
|
|
384
384
|
"div",
|
|
385
385
|
{
|
|
386
386
|
className: "text-xs font-medium text-gray-500 dark:text-gray-400 text-center py-[4px]",
|
|
@@ -388,9 +388,9 @@ const Re = {
|
|
|
388
388
|
},
|
|
389
389
|
e
|
|
390
390
|
)) }),
|
|
391
|
-
/* @__PURE__ */
|
|
392
|
-
const
|
|
393
|
-
return /* @__PURE__ */
|
|
391
|
+
/* @__PURE__ */ a("div", { className: "grid grid-cols-7 gap-[4px]", children: ke().map((e, t) => {
|
|
392
|
+
const n = e.getMonth() === b.getMonth(), o = E && e.toDateString() === E.toDateString(), s = e.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
|
|
393
|
+
return /* @__PURE__ */ a(
|
|
394
394
|
"button",
|
|
395
395
|
{
|
|
396
396
|
type: "button",
|
|
@@ -399,8 +399,8 @@ const Re = {
|
|
|
399
399
|
className: h(
|
|
400
400
|
"text-xs p-[8px] rounded-md transition-colors hover:bg-gray-100 dark:hover:bg-gray-700",
|
|
401
401
|
{
|
|
402
|
-
"text-gray-400 dark:text-gray-500": !
|
|
403
|
-
"text-gray-900 dark:text-gray-100":
|
|
402
|
+
"text-gray-400 dark:text-gray-500": !n,
|
|
403
|
+
"text-gray-900 dark:text-gray-100": n && !o,
|
|
404
404
|
"bg-blue-500 text-white hover:bg-blue-600": o,
|
|
405
405
|
"ring-2 ring-blue-500 ring-offset-1": s && !o
|
|
406
406
|
}
|
|
@@ -410,7 +410,7 @@ const Re = {
|
|
|
410
410
|
t
|
|
411
411
|
);
|
|
412
412
|
}) }),
|
|
413
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ a("div", { className: "mt-[16px] pt-[12px] border-t border-border", children: /* @__PURE__ */ a(
|
|
414
414
|
"button",
|
|
415
415
|
{
|
|
416
416
|
type: "button",
|
|
@@ -427,8 +427,8 @@ const Re = {
|
|
|
427
427
|
document.body
|
|
428
428
|
)
|
|
429
429
|
] }),
|
|
430
|
-
d && /* @__PURE__ */
|
|
431
|
-
!d && U && /* @__PURE__ */
|
|
430
|
+
d && /* @__PURE__ */ a(Ie, { id: re, error: d, size: "md" }),
|
|
431
|
+
!d && U && /* @__PURE__ */ a($e, { id: ne, size: "md", children: U })
|
|
432
432
|
]
|
|
433
433
|
}
|
|
434
434
|
);
|
|
@@ -276,7 +276,7 @@ function ze({
|
|
|
276
276
|
onClick: se,
|
|
277
277
|
onKeyDown: ie,
|
|
278
278
|
className: f(
|
|
279
|
-
"text-case-inherit letter-space-inherit flex w-full items-center justify-between font-medium outline-hidden duration-200",
|
|
279
|
+
"tucu-text-case-inherit tucu-letter-space-inherit flex w-full items-center justify-between font-medium outline-hidden duration-200",
|
|
280
280
|
be.select[q],
|
|
281
281
|
ve[A],
|
|
282
282
|
b && we[A][b],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as p, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import m from "classnames";
|
|
3
|
-
const
|
|
3
|
+
const c = {
|
|
4
4
|
blink: "animate-blink",
|
|
5
5
|
scaleUp: "animate-scale-up",
|
|
6
6
|
moveUp: "animate-move-up"
|
|
@@ -8,7 +8,7 @@ const i = {
|
|
|
8
8
|
small: "w-1.5 h-1.5",
|
|
9
9
|
medium: "w-2.5 h-2.5",
|
|
10
10
|
large: "w-3 h-3"
|
|
11
|
-
},
|
|
11
|
+
}, t = {
|
|
12
12
|
primary: "bg-brand",
|
|
13
13
|
gray: "bg-gray-500",
|
|
14
14
|
success: "bg-green-500",
|
|
@@ -16,19 +16,19 @@ const i = {
|
|
|
16
16
|
info: "bg-blue-500",
|
|
17
17
|
warning: "bg-orange-500"
|
|
18
18
|
};
|
|
19
|
-
function
|
|
19
|
+
function i(e) {
|
|
20
20
|
return e === "small" ? "relative top-1.5" : "relative top-3";
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
return e === "moveUp" && n === "small" ? "animate-move-up-small" :
|
|
22
|
+
function u(e, n) {
|
|
23
|
+
return e === "moveUp" && n === "small" ? "animate-move-up-small" : c[e];
|
|
24
24
|
}
|
|
25
25
|
function y({
|
|
26
26
|
tag: e = "div",
|
|
27
27
|
color: n = "primary",
|
|
28
28
|
size: a = "medium",
|
|
29
29
|
variant: l = "moveUp",
|
|
30
|
-
showOnlyThreeDots:
|
|
31
|
-
className:
|
|
30
|
+
showOnlyThreeDots: r,
|
|
31
|
+
className: d
|
|
32
32
|
}) {
|
|
33
33
|
return /* @__PURE__ */ p(
|
|
34
34
|
e,
|
|
@@ -36,8 +36,8 @@ function y({
|
|
|
36
36
|
"data-tucu": "loader",
|
|
37
37
|
className: m(
|
|
38
38
|
"flex items-center gap-2",
|
|
39
|
-
l === "moveUp" &&
|
|
40
|
-
|
|
39
|
+
l === "moveUp" && i(a),
|
|
40
|
+
d
|
|
41
41
|
),
|
|
42
42
|
children: [
|
|
43
43
|
/* @__PURE__ */ o(
|
|
@@ -45,9 +45,9 @@ function y({
|
|
|
45
45
|
{
|
|
46
46
|
className: m(
|
|
47
47
|
"rounded-full",
|
|
48
|
-
|
|
48
|
+
u(l, a),
|
|
49
49
|
s[a],
|
|
50
|
-
|
|
50
|
+
t[n]
|
|
51
51
|
)
|
|
52
52
|
}
|
|
53
53
|
),
|
|
@@ -55,10 +55,10 @@ function y({
|
|
|
55
55
|
"span",
|
|
56
56
|
{
|
|
57
57
|
className: m(
|
|
58
|
-
"animation-delay-200 rounded-full",
|
|
59
|
-
|
|
58
|
+
"tucu-animation-delay-200 rounded-full",
|
|
59
|
+
u(l, a),
|
|
60
60
|
s[a],
|
|
61
|
-
|
|
61
|
+
t[n]
|
|
62
62
|
)
|
|
63
63
|
}
|
|
64
64
|
),
|
|
@@ -66,21 +66,21 @@ function y({
|
|
|
66
66
|
"span",
|
|
67
67
|
{
|
|
68
68
|
className: m(
|
|
69
|
-
"animation-delay-500 rounded-full",
|
|
70
|
-
|
|
69
|
+
"tucu-animation-delay-500 rounded-full",
|
|
70
|
+
u(l, a),
|
|
71
71
|
s[a],
|
|
72
|
-
|
|
72
|
+
t[n]
|
|
73
73
|
)
|
|
74
74
|
}
|
|
75
75
|
),
|
|
76
|
-
l === "moveUp" && !
|
|
76
|
+
l === "moveUp" && !r ? /* @__PURE__ */ o(
|
|
77
77
|
"span",
|
|
78
78
|
{
|
|
79
79
|
className: m(
|
|
80
|
-
"animation-delay-700 rounded-full",
|
|
81
|
-
|
|
80
|
+
"tucu-animation-delay-700 rounded-full",
|
|
81
|
+
u(l, a),
|
|
82
82
|
s[a],
|
|
83
|
-
|
|
83
|
+
t[n]
|
|
84
84
|
)
|
|
85
85
|
}
|
|
86
86
|
) : null
|