@cryptlex/web-components 5.3.0 → 5.4.0
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/components/{ui/alert.d.ts → alert.d.ts} +3 -3
- package/dist/components/alert.js +2 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/{ui/avatar.d.ts → avatar.d.ts} +0 -1
- package/dist/components/avatar.js +2 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/{ui/badge.d.ts → badge.d.ts} +0 -1
- package/dist/components/badge.js +2 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/{ui/breadcrumbs.d.ts → breadcrumbs.d.ts} +1 -1
- package/dist/components/breadcrumbs.js +2 -0
- package/dist/components/breadcrumbs.js.map +1 -0
- package/dist/components/{ui/button.d.ts → button.d.ts} +5 -5
- package/dist/components/button.js +2 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/{ui/calendar.d.ts → calendar.d.ts} +2 -3
- package/dist/components/calendar.js +2 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/card.js +2 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/{inputs/checkbox.d.ts → checkbox.d.ts} +3 -3
- package/dist/components/checkbox.js +2 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/{data-table/table-commons.d.ts → data-table-commons.d.ts} +8 -8
- package/dist/components/data-table-commons.js +2 -0
- package/dist/components/data-table-commons.js.map +1 -0
- package/dist/components/{data-table/data-table-filter.d.ts → data-table-filter.d.ts} +3 -3
- package/dist/components/data-table-filter.js +2 -0
- package/dist/components/data-table-filter.js.map +1 -0
- package/dist/components/{data-table/data-table.d.ts → data-table.d.ts} +24 -25
- package/dist/components/data-table.js +2 -0
- package/dist/components/data-table.js.map +1 -0
- package/dist/components/{inputs/date-picker.d.ts → date-picker.d.ts} +3 -3
- package/dist/components/date-picker.js +2 -0
- package/dist/components/date-picker.js.map +1 -0
- package/dist/components/{inputs/datefield.d.ts → datefield.d.ts} +3 -3
- package/dist/components/datefield.js +2 -0
- package/dist/components/datefield.js.map +1 -0
- package/dist/components/{ui/dialog.d.ts → dialog.d.ts} +3 -4
- package/dist/components/dialog.js +2 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/{ui/disclosure.d.ts → disclosure.d.ts} +1 -2
- package/dist/components/disclosure.js +2 -0
- package/dist/components/disclosure.js.map +1 -0
- package/dist/components/{inputs/field.d.ts → field.d.ts} +5 -6
- package/dist/components/field.js +2 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/id-search.js +2 -0
- package/dist/components/id-search.js.map +1 -0
- package/dist/components/{inputs/input-otp.d.ts → input-otp.d.ts} +1 -2
- package/dist/components/input-otp.js +2 -0
- package/dist/components/input-otp.js.map +1 -0
- package/dist/components/key-value-card.js +2 -0
- package/dist/components/key-value-card.js.map +1 -0
- package/dist/components/{ui/list-box.d.ts → list-box.d.ts} +1 -1
- package/dist/components/list-box.js +2 -0
- package/dist/components/list-box.js.map +1 -0
- package/dist/components/loader.js +2 -0
- package/dist/components/loader.js.map +1 -0
- package/dist/components/{ui/menu.d.ts → menu.d.ts} +5 -6
- package/dist/components/menu.js +2 -0
- package/dist/components/menu.js.map +1 -0
- package/dist/components/{inputs/multi-select.d.ts → multi-select.d.ts} +3 -4
- package/dist/components/multi-select.js +2 -0
- package/dist/components/multi-select.js.map +1 -0
- package/dist/components/{inputs/numberfield.d.ts → numberfield.d.ts} +2 -3
- package/dist/components/numberfield.js +2 -0
- package/dist/components/numberfield.js.map +1 -0
- package/dist/components/{ui/popover.d.ts → popover.d.ts} +1 -1
- package/dist/components/popover.js +2 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/{inputs/searchfield.d.ts → searchfield.d.ts} +2 -2
- package/dist/components/searchfield.js +2 -0
- package/dist/components/searchfield.js.map +1 -0
- package/dist/components/select-options.js +2 -0
- package/dist/components/select-options.js.map +1 -0
- package/dist/components/{inputs/select.d.ts → select.d.ts} +5 -5
- package/dist/components/select.js +2 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/{ui/sidebar.d.ts → sidebar.d.ts} +4 -5
- package/dist/components/sidebar.js +2 -0
- package/dist/components/sidebar.js.map +1 -0
- package/dist/components/skeleton.js +2 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/{ui/sonner.d.ts → sonner.d.ts} +1 -1
- package/dist/components/sonner.js +2 -0
- package/dist/components/sonner.js.map +1 -0
- package/dist/components/table-of-contents.d.ts +9 -0
- package/dist/components/table-of-contents.js +2 -0
- package/dist/components/table-of-contents.js.map +1 -0
- package/dist/components/{ui/table.d.ts → table.d.ts} +0 -1
- package/dist/components/table.js +2 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/{ui/tabs.d.ts → tabs.d.ts} +1 -1
- package/dist/components/tabs.js +2 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/{inputs/textfield.d.ts → textfield.d.ts} +2 -2
- package/dist/components/textfield.js +2 -0
- package/dist/components/textfield.js.map +1 -0
- package/dist/components/{ui/timeline.d.ts → timeline.d.ts} +3 -3
- package/dist/components/timeline.js +2 -0
- package/dist/components/timeline.js.map +1 -0
- package/dist/components/{ui/tooltip.d.ts → tooltip.d.ts} +1 -1
- package/dist/components/tooltip.js +2 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/utils/form-context.d.ts +1 -1
- package/dist/utils/form-context.js +2 -5
- package/dist/utils/form-context.js.map +1 -0
- package/dist/utils/form-hook.d.ts +9 -11
- package/dist/utils/form-hook.js +2 -30
- package/dist/utils/form-hook.js.map +1 -0
- package/dist/utils/primitives.d.ts +16 -2
- package/dist/utils/primitives.js +2 -39
- package/dist/utils/primitives.js.map +1 -0
- package/dist/utils/resource-names.d.ts +1 -13
- package/dist/utils/resource-names.js +2 -212
- package/dist/utils/resource-names.js.map +1 -0
- package/dist/utils/use-mobile.js +2 -15
- package/dist/utils/use-mobile.js.map +1 -0
- package/lib/utilities.css +1 -1
- package/package.json +13 -12
- package/dist/components/data-table/data-table-filter.js +0 -112
- package/dist/components/data-table/data-table.js +0 -265
- package/dist/components/data-table/table-commons.js +0 -137
- package/dist/components/inputs/checkbox.js +0 -25
- package/dist/components/inputs/date-picker.js +0 -22
- package/dist/components/inputs/datefield.js +0 -25
- package/dist/components/inputs/field.js +0 -48
- package/dist/components/inputs/id-search.js +0 -40
- package/dist/components/inputs/input-otp.js +0 -19
- package/dist/components/inputs/multi-select.js +0 -18
- package/dist/components/inputs/numberfield.js +0 -25
- package/dist/components/inputs/searchfield.js +0 -24
- package/dist/components/inputs/select-options.js +0 -286
- package/dist/components/inputs/select.js +0 -34
- package/dist/components/inputs/textfield.js +0 -28
- package/dist/components/key-value-card/key-value-card.js +0 -40
- package/dist/components/ui/alert.js +0 -18
- package/dist/components/ui/avatar.js +0 -5
- package/dist/components/ui/badge.js +0 -5
- package/dist/components/ui/breadcrumbs.js +0 -28
- package/dist/components/ui/button.js +0 -34
- package/dist/components/ui/calendar.js +0 -63
- package/dist/components/ui/card.js +0 -20
- package/dist/components/ui/dialog.js +0 -42
- package/dist/components/ui/disclosure.js +0 -20
- package/dist/components/ui/list-box.js +0 -24
- package/dist/components/ui/loader.js +0 -6
- package/dist/components/ui/menu.js +0 -38
- package/dist/components/ui/popover.js +0 -14
- package/dist/components/ui/sidebar.js +0 -177
- package/dist/components/ui/skeleton.js +0 -5
- package/dist/components/ui/sonner.js +0 -14
- package/dist/components/ui/table.js +0 -26
- package/dist/components/ui/tabs.js +0 -25
- package/dist/components/ui/timeline.js +0 -31
- package/dist/components/ui/tooltip.js +0 -12
- /package/dist/components/{ui/card.d.ts → card.d.ts} +0 -0
- /package/dist/components/{inputs/id-search.d.ts → id-search.d.ts} +0 -0
- /package/dist/components/{key-value-card/key-value-card.d.ts → key-value-card.d.ts} +0 -0
- /package/dist/components/{ui/loader.d.ts → loader.d.ts} +0 -0
- /package/dist/components/{inputs/select-options.d.ts → select-options.d.ts} +0 -0
- /package/dist/components/{ui/skeleton.d.ts → skeleton.d.ts} +0 -0
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { SearchIcon, XIcon } from "lucide-react";
|
|
3
|
-
import { Button as AriaButton, Input as AriaInput, SearchField as AriaSearchField, composeRenderProps } from "react-aria-components";
|
|
4
|
-
import { cn } from "lib/utils/primitives";
|
|
5
|
-
import { FieldGroup, FormField } from "./field";
|
|
6
|
-
function ASearchField({ className, ...props }) {
|
|
7
|
-
return (_jsx(AriaSearchField, { className: composeRenderProps(className, (className) => cn("group", className)), ...props }));
|
|
8
|
-
}
|
|
9
|
-
function ASearchFieldInput({ className, ...props }) {
|
|
10
|
-
return (_jsx(AriaInput, { className: composeRenderProps(className, (className) => cn("min-w-0 ring-0 focus-visible:outline-none flex-1 bg-card px-2 py-1.5 placeholder:text-muted-foreground [&::-webkit-search-cancel-button]:hidden", className)), ...props }));
|
|
11
|
-
}
|
|
12
|
-
function SearchFieldClear({ className, ...props }) {
|
|
13
|
-
return (_jsx(AriaButton, { className: composeRenderProps(className, (className) => cn("mr-1 opacity-70 ring-offset-background transition-opacity",
|
|
14
|
-
/* Hover */
|
|
15
|
-
"data-[hovered]:opacity-100",
|
|
16
|
-
/* Disabled */
|
|
17
|
-
"data-[disabled]:pointer-events-none",
|
|
18
|
-
/* Empty */
|
|
19
|
-
"group-data-[empty]:invisible", className)), ...props }));
|
|
20
|
-
}
|
|
21
|
-
;
|
|
22
|
-
export function SearchField({ label, description, className, errorMessage, ...props }) {
|
|
23
|
-
return (_jsx(ASearchField, { className: composeRenderProps(className, (className) => cn("group form-field", className)), ...props, children: _jsx(FormField, { label: label, description: description, errorMessage: errorMessage, children: _jsxs(FieldGroup, { children: [_jsx(SearchIcon, { "aria-hidden": true, className: "size-icon text-muted-foreground" }), _jsx(ASearchFieldInput, { placeholder: "" }), _jsx(SearchFieldClear, { children: _jsx(XIcon, { "aria-hidden": true, className: "size-icon" }) })] }) }) }));
|
|
24
|
-
}
|
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
export const LICENSE_TYPE_OPTIONS = [
|
|
3
|
-
{
|
|
4
|
-
label: _jsx(_Fragment, { children: "Node-locked" }),
|
|
5
|
-
id: "node-locked",
|
|
6
|
-
},
|
|
7
|
-
{
|
|
8
|
-
label: _jsx(_Fragment, { children: "Hosted floating" }),
|
|
9
|
-
id: "hosted-floating",
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
label: _jsx(_Fragment, { children: "LexFloatServer" }),
|
|
13
|
-
id: "on-premise-floating",
|
|
14
|
-
},
|
|
15
|
-
];
|
|
16
|
-
/**
|
|
17
|
-
* Creates Unicode flag from a two-letter ISO country code.
|
|
18
|
-
* https://stackoverflow.com/questions/24050671/how-to-put-japan-flag-character-in-a-string
|
|
19
|
-
* @param {string} country — A two-letter ISO country code (case-insensitive).
|
|
20
|
-
* @return {string}
|
|
21
|
-
*/
|
|
22
|
-
function getCountryFlag(country) {
|
|
23
|
-
function getRegionalIndicatorSymbol(letter) {
|
|
24
|
-
return String.fromCodePoint(0x1f1e6 - 65 + letter.toUpperCase().charCodeAt(0));
|
|
25
|
-
}
|
|
26
|
-
return (getRegionalIndicatorSymbol(country[0]) +
|
|
27
|
-
getRegionalIndicatorSymbol(country[1]));
|
|
28
|
-
}
|
|
29
|
-
const ALL_COUNTRIES = {
|
|
30
|
-
AF: "Afghanistan",
|
|
31
|
-
AX: "Åland Islands",
|
|
32
|
-
AL: "Albania",
|
|
33
|
-
DZ: "Algeria",
|
|
34
|
-
AS: "American Samoa",
|
|
35
|
-
AD: "Andorra",
|
|
36
|
-
AO: "Angola",
|
|
37
|
-
AI: "Anguilla",
|
|
38
|
-
AQ: "Antarctica",
|
|
39
|
-
AG: "Antigua and Barbuda",
|
|
40
|
-
AR: "Argentina",
|
|
41
|
-
AM: "Armenia",
|
|
42
|
-
AW: "Aruba",
|
|
43
|
-
AU: "Australia",
|
|
44
|
-
AT: "Austria",
|
|
45
|
-
AZ: "Azerbaijan",
|
|
46
|
-
BS: "Bahamas",
|
|
47
|
-
BH: "Bahrain",
|
|
48
|
-
BD: "Bangladesh",
|
|
49
|
-
BB: "Barbados",
|
|
50
|
-
BY: "Belarus",
|
|
51
|
-
BE: "Belgium",
|
|
52
|
-
BZ: "Belize",
|
|
53
|
-
BJ: "Benin",
|
|
54
|
-
BM: "Bermuda",
|
|
55
|
-
BT: "Bhutan",
|
|
56
|
-
BO: "Bolivia (Plurinational State of)",
|
|
57
|
-
BQ: "Bonaire, Sint Eustatius and Saba",
|
|
58
|
-
BA: "Bosnia and Herzegovina",
|
|
59
|
-
BW: "Botswana",
|
|
60
|
-
BV: "Bouvet Island",
|
|
61
|
-
BR: "Brazil",
|
|
62
|
-
IO: "British Indian Ocean Territory",
|
|
63
|
-
BN: "Brunei Darussalam",
|
|
64
|
-
BG: "Bulgaria",
|
|
65
|
-
BF: "Burkina Faso",
|
|
66
|
-
BI: "Burundi",
|
|
67
|
-
CV: "Caboe Verde",
|
|
68
|
-
KH: "Cambodia",
|
|
69
|
-
CM: "Cameroon",
|
|
70
|
-
CA: "Canada",
|
|
71
|
-
KY: "Cayman Islands",
|
|
72
|
-
CF: "Central African Republic",
|
|
73
|
-
TD: "Chad",
|
|
74
|
-
CL: "Chile",
|
|
75
|
-
CN: "China",
|
|
76
|
-
CX: "Christmas Island",
|
|
77
|
-
CC: "Cocos (Keeling) Islands",
|
|
78
|
-
CO: "Colombia",
|
|
79
|
-
KM: "Comoros",
|
|
80
|
-
CG: "Congo",
|
|
81
|
-
CD: "Congo, Democratic Republic of the",
|
|
82
|
-
CK: "Cook Islands",
|
|
83
|
-
CR: "Costa Rica",
|
|
84
|
-
CI: "Côte d'voire",
|
|
85
|
-
HR: "Croatia",
|
|
86
|
-
CU: "Cuba",
|
|
87
|
-
CW: "Curaçao",
|
|
88
|
-
CY: "Cyprus",
|
|
89
|
-
CZ: "Czechia",
|
|
90
|
-
DK: "Denmark",
|
|
91
|
-
DJ: "Djibouti",
|
|
92
|
-
DM: "Dominica",
|
|
93
|
-
DO: "Dominican Republic",
|
|
94
|
-
EC: "Ecuador",
|
|
95
|
-
EG: "Egypt",
|
|
96
|
-
SV: "El Salvador",
|
|
97
|
-
GQ: "Equatorial Guinea",
|
|
98
|
-
ER: "Eritrea",
|
|
99
|
-
EE: "Estonia",
|
|
100
|
-
SZ: "Eswatini",
|
|
101
|
-
ET: "Ethiopia",
|
|
102
|
-
FK: "Falkland Islands (Malvinas)",
|
|
103
|
-
FO: "Faroe Islands",
|
|
104
|
-
FJ: "Fiji",
|
|
105
|
-
FI: "Finland",
|
|
106
|
-
FR: "France",
|
|
107
|
-
GF: "French Guiana",
|
|
108
|
-
PF: "French Polynesia",
|
|
109
|
-
TF: "French Southern Territories",
|
|
110
|
-
GA: "Gabon",
|
|
111
|
-
GM: "Gambia",
|
|
112
|
-
GE: "Georgia",
|
|
113
|
-
DE: "Germany",
|
|
114
|
-
GH: "Ghana",
|
|
115
|
-
GI: "Gibraltar",
|
|
116
|
-
GR: "Greece",
|
|
117
|
-
GL: "Greenland",
|
|
118
|
-
GD: "Grenada",
|
|
119
|
-
GP: "Guadeloupe",
|
|
120
|
-
GU: "Guam",
|
|
121
|
-
GT: "Guatemala",
|
|
122
|
-
GG: "Guernsey",
|
|
123
|
-
GN: "Guinea",
|
|
124
|
-
GW: "Guinea-Bissau",
|
|
125
|
-
GY: "Guyana",
|
|
126
|
-
HT: "Haiti",
|
|
127
|
-
HM: "Heard Island and Mcdonald Islands",
|
|
128
|
-
VA: "Holy See",
|
|
129
|
-
HN: "Honduras",
|
|
130
|
-
HK: "Hong Kong",
|
|
131
|
-
HU: "Hungary",
|
|
132
|
-
IS: "Iceland",
|
|
133
|
-
IN: "India",
|
|
134
|
-
ID: "Indonesia",
|
|
135
|
-
IR: "Iran (Islamic Republic of)",
|
|
136
|
-
IQ: "Iraq",
|
|
137
|
-
IE: "Ireland",
|
|
138
|
-
IM: "Isle of Man",
|
|
139
|
-
IL: "Israel",
|
|
140
|
-
IT: "Italy",
|
|
141
|
-
JM: "Jamaica",
|
|
142
|
-
JP: "Japan",
|
|
143
|
-
JE: "Jersey",
|
|
144
|
-
JO: "Jordan",
|
|
145
|
-
KZ: "Kazakhstan",
|
|
146
|
-
KE: "Kenya",
|
|
147
|
-
KI: "Kiribati",
|
|
148
|
-
KP: "Korea (Democratic People's Republic of)",
|
|
149
|
-
KR: "Korea (Republic of)",
|
|
150
|
-
KW: "Kuwait",
|
|
151
|
-
KG: "Kyrgyzstan",
|
|
152
|
-
LA: "Lao People's Democratic Republic",
|
|
153
|
-
LV: "Latvia",
|
|
154
|
-
LB: "Lebanon",
|
|
155
|
-
LS: "Lesotho",
|
|
156
|
-
LR: "Liberia",
|
|
157
|
-
LY: "Libya",
|
|
158
|
-
LI: "Liechtenstein",
|
|
159
|
-
LT: "Lithuania",
|
|
160
|
-
LU: "Luxembourg",
|
|
161
|
-
MO: "Macao",
|
|
162
|
-
MG: "Madagascar",
|
|
163
|
-
MW: "Malawi",
|
|
164
|
-
MY: "Malaysia",
|
|
165
|
-
MV: "Maldives",
|
|
166
|
-
ML: "Mali",
|
|
167
|
-
MT: "Malta",
|
|
168
|
-
MH: "Marshall Islands",
|
|
169
|
-
MQ: "Martinique",
|
|
170
|
-
MR: "Mauritania",
|
|
171
|
-
MU: "Mauritius",
|
|
172
|
-
YT: "Mayotte",
|
|
173
|
-
MX: "Mexico",
|
|
174
|
-
FM: "Micronesia (Federated States of)",
|
|
175
|
-
MD: "Moldova, Republic of",
|
|
176
|
-
MC: "Monaco",
|
|
177
|
-
MN: "Mongolia",
|
|
178
|
-
ME: "Montenegro",
|
|
179
|
-
MS: "Montserrat",
|
|
180
|
-
MA: "Morocco",
|
|
181
|
-
MZ: "Mozambique",
|
|
182
|
-
MM: "Myanmar",
|
|
183
|
-
NA: "Namibia",
|
|
184
|
-
NR: "Nauru",
|
|
185
|
-
NP: "Nepal",
|
|
186
|
-
NL: "Netherlands, Kingdom of the",
|
|
187
|
-
NC: "New Caledonia",
|
|
188
|
-
NZ: "New Zealand",
|
|
189
|
-
NI: "Nicaragua",
|
|
190
|
-
NE: "Niger",
|
|
191
|
-
NG: "Nigeria",
|
|
192
|
-
NU: "Niue",
|
|
193
|
-
NF: "Norfolk Island",
|
|
194
|
-
MK: "North Macedonia",
|
|
195
|
-
MP: "Northern Mariana Islands",
|
|
196
|
-
NO: "Norway",
|
|
197
|
-
OM: "Oman",
|
|
198
|
-
PK: "Pakistan",
|
|
199
|
-
PW: "Palau",
|
|
200
|
-
PS: "Palestine, State of",
|
|
201
|
-
PA: "Panama",
|
|
202
|
-
PG: "Papua New Guinea",
|
|
203
|
-
PY: "Paraguay",
|
|
204
|
-
PE: "Peru",
|
|
205
|
-
PH: "Philippines",
|
|
206
|
-
PN: "Pitcairn",
|
|
207
|
-
PL: "Poland",
|
|
208
|
-
PT: "Portugal",
|
|
209
|
-
PR: "Puerto Rico",
|
|
210
|
-
QA: "Qatar",
|
|
211
|
-
RE: "Réunion",
|
|
212
|
-
RO: "Romania",
|
|
213
|
-
RU: "Russian Federation",
|
|
214
|
-
RW: "Rwanda",
|
|
215
|
-
BL: "Saint Barthélemy",
|
|
216
|
-
SH: "Saint Helena, Ascension Island, Tristan da Cunha",
|
|
217
|
-
KN: "Saint Kitts and Nevis",
|
|
218
|
-
LC: "Saint Lucia",
|
|
219
|
-
MF: "Saint Martin (French part)",
|
|
220
|
-
PM: "Saint Pierre and Miquelon",
|
|
221
|
-
VC: "Saint Vincent and the Grenadines",
|
|
222
|
-
WS: "Samoa",
|
|
223
|
-
SM: "San Marino",
|
|
224
|
-
ST: "Sao Tome and Principe",
|
|
225
|
-
SA: "Saudi Arabia",
|
|
226
|
-
SN: "Senegal",
|
|
227
|
-
RS: "Serbia",
|
|
228
|
-
SC: "Seychelles",
|
|
229
|
-
SL: "Sierra Leone",
|
|
230
|
-
SG: "Singapore",
|
|
231
|
-
SX: "Sint Maarten (Dutch part)",
|
|
232
|
-
SK: "Slovakia",
|
|
233
|
-
SI: "Slovenia",
|
|
234
|
-
SB: "Solomon Islands",
|
|
235
|
-
SO: "Somalia",
|
|
236
|
-
ZA: "South Africa",
|
|
237
|
-
GS: "South Georgia and the South Sandwich Islands",
|
|
238
|
-
SS: "South Sudan",
|
|
239
|
-
ES: "Spain",
|
|
240
|
-
LK: "Sri Lanka",
|
|
241
|
-
SD: "Sudan",
|
|
242
|
-
SR: "Suriname",
|
|
243
|
-
SJ: "Svalbard and Jan Mayen",
|
|
244
|
-
SE: "Sweden",
|
|
245
|
-
CH: "Switzerland",
|
|
246
|
-
SY: "Syrian Arab Republic",
|
|
247
|
-
TW: "Taiwan, Province of China",
|
|
248
|
-
TJ: "Tajikistan",
|
|
249
|
-
TZ: "Tanzania, United Republic of",
|
|
250
|
-
TH: "Thailand",
|
|
251
|
-
TL: "Timor-Leste",
|
|
252
|
-
TG: "Togo",
|
|
253
|
-
TK: "Tokelau",
|
|
254
|
-
TO: "Tonga",
|
|
255
|
-
TT: "Trinidad and Tobago",
|
|
256
|
-
TN: "Tunisia",
|
|
257
|
-
TR: "Türkiye",
|
|
258
|
-
TM: "Turkmenistan",
|
|
259
|
-
TC: "Turks and Caicos Islands",
|
|
260
|
-
TV: "Tuvalu",
|
|
261
|
-
UG: "Uganda",
|
|
262
|
-
UA: "Ukraine",
|
|
263
|
-
AE: "United Arab Emirates",
|
|
264
|
-
GB: "United Kingdom of Great Britain and Northern Ireland",
|
|
265
|
-
UM: "United States Minor Outlying Islands",
|
|
266
|
-
US: "United States of America",
|
|
267
|
-
UY: "Uruguay",
|
|
268
|
-
UZ: "Uzbekistan",
|
|
269
|
-
VU: "Vanuatu",
|
|
270
|
-
VE: "Venezuela (Bolivarian Republic of)",
|
|
271
|
-
VN: "Viet Nam",
|
|
272
|
-
VG: "Virgin Islands (British)",
|
|
273
|
-
VI: "Virgin Islands (U.S)",
|
|
274
|
-
WF: "Wallis and Futuna",
|
|
275
|
-
EH: "Western Sahara",
|
|
276
|
-
YE: "Yemen",
|
|
277
|
-
ZM: "Zambia",
|
|
278
|
-
ZW: "Zimbabwe",
|
|
279
|
-
};
|
|
280
|
-
/** Options for MultiSelect component */
|
|
281
|
-
export const COUNTRY_OPTIONS = Object.entries(ALL_COUNTRIES).map((v) => {
|
|
282
|
-
return {
|
|
283
|
-
label: (_jsxs(_Fragment, { children: [getCountryFlag(v[0]), " ", v[1]] })),
|
|
284
|
-
id: v[0],
|
|
285
|
-
};
|
|
286
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { ListBox as AriaListBox, Select as AriaSelect, SelectValue as AriaSelectValue, composeRenderProps } from "react-aria-components";
|
|
4
|
-
import { FormField } from "lib/components/inputs/field";
|
|
5
|
-
import { Button } from "lib/components/ui/button";
|
|
6
|
-
import { useFieldContext } from "lib/utils/form-context";
|
|
7
|
-
import { getFieldErrorMessage } from "lib/utils/form-hook";
|
|
8
|
-
import { cn } from "lib/utils/primitives";
|
|
9
|
-
import { ChevronDown } from "lucide-react";
|
|
10
|
-
import { ListBoxCollection, ListBoxHeader, ListBoxItem, } from "../ui/list-box";
|
|
11
|
-
import { Popover } from "../ui/popover";
|
|
12
|
-
const ASelect = AriaSelect;
|
|
13
|
-
export const SelectItem = ListBoxItem;
|
|
14
|
-
export const SelectHeader = ListBoxHeader;
|
|
15
|
-
export const SelectCollection = ListBoxCollection;
|
|
16
|
-
export const SelectValue = ({ className, ...props }) => (_jsx(AriaSelectValue, { className: composeRenderProps(className, (className) => cn("line-clamp-1 data-[placeholder]:text-muted-foreground",
|
|
17
|
-
/* Description */
|
|
18
|
-
"[&>[slot=description]]:hidden", className)), ...props }));
|
|
19
|
-
function SelectTrigger({ className, children, ...props }) {
|
|
20
|
-
return (_jsx(Button, { ...props, children: composeRenderProps(children, (children) => (_jsxs(_Fragment, { children: [children, _jsx(ChevronDown, { "aria-hidden": "true", className: "size-icon opacity-50" })] }))) }));
|
|
21
|
-
}
|
|
22
|
-
export function SelectPopover({ className, ...props }) {
|
|
23
|
-
return (_jsx(Popover, { className: composeRenderProps(className, (className) => cn("w-auto min-w-[--trigger-width]", className)), ...props }));
|
|
24
|
-
}
|
|
25
|
-
function SelectListBox({ className, ...props }) {
|
|
26
|
-
return (_jsx(AriaListBox, { className: composeRenderProps(className, (className) => cn("overflow-auto p-1 outline-none [clip-path:inset(0_0_0_0_round_calc(var(--radius)-2px))]", className)), ...props }));
|
|
27
|
-
}
|
|
28
|
-
export function SingleSelect({ label, description, errorMessage, children, className, items, ...props }) {
|
|
29
|
-
return (_jsx(ASelect, { className: composeRenderProps(className, (className) => cn("group form-field", className)), ...props, children: _jsxs(FormField, { label: label, description: description, errorMessage: errorMessage, children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, {}) }), _jsx(SelectPopover, { children: _jsx(SelectListBox, { items: items, children: children }) })] }) }));
|
|
30
|
-
}
|
|
31
|
-
export function TfSingleSelect({ ...props }) {
|
|
32
|
-
const field = useFieldContext();
|
|
33
|
-
return (_jsx(SingleSelect, { selectedKey: field.state.value, onSelectionChange: (e) => field.handleChange(e.toString()), onBlur: field.handleBlur, errorMessage: getFieldErrorMessage(field), ...props, children: (item) => _jsx(SelectItem, { id: item.id, children: item.label }, item.id) }));
|
|
34
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Input as AriaInput, TextArea as AriaTextArea, TextField as AriaTextField, composeRenderProps } from "react-aria-components";
|
|
3
|
-
import { useFieldContext } from "lib/utils/form-context";
|
|
4
|
-
import { getFieldErrorMessage } from "lib/utils/form-hook";
|
|
5
|
-
import { cn } from "lib/utils/primitives";
|
|
6
|
-
import { FormField } from "./field";
|
|
7
|
-
const ATextField = AriaTextField;
|
|
8
|
-
function Input({ className, ...props }) {
|
|
9
|
-
return (_jsx(AriaInput, { className: composeRenderProps(className, (className) => cn("flex input-dim w-full border border-input bg-card ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground",
|
|
10
|
-
/* Disabled */
|
|
11
|
-
"disabled-muted",
|
|
12
|
-
/* Focused */
|
|
13
|
-
"focus-ring", className)), ...props }));
|
|
14
|
-
}
|
|
15
|
-
function TextArea({ className, ...props }) {
|
|
16
|
-
return (_jsx(AriaTextArea, { className: composeRenderProps(className, (className) => cn("flex min-h-32 w-full border border-input bg-card px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground",
|
|
17
|
-
/* Focused */
|
|
18
|
-
"focus-ring",
|
|
19
|
-
/* Disabled */
|
|
20
|
-
"disabled-muted", className)), ...props }));
|
|
21
|
-
}
|
|
22
|
-
export function TextField({ label, description, errorMessage, textArea, className, ...props }) {
|
|
23
|
-
return (_jsx(ATextField, { className: composeRenderProps(className, (className) => cn("group form-field", className)), ...props, children: _jsx(FormField, { label: label, errorMessage: errorMessage, description: description, children: textArea ? _jsx(TextArea, {}) : _jsx(Input, {}) }) }));
|
|
24
|
-
}
|
|
25
|
-
export function TfTextField({ isDisabled, ...props }) {
|
|
26
|
-
const field = useFieldContext();
|
|
27
|
-
return (_jsx(TextField, { isDisabled: isDisabled || field.form.state.isSubmitting, value: field.state.value, id: field.name, name: field.name, onBlur: field.handleBlur, onChange: field.handleChange, errorMessage: getFieldErrorMessage(field), ...props }));
|
|
28
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { formatDate } from "lib/components/data-table/table-commons";
|
|
3
|
-
import { Badge } from "lib/components/ui/badge";
|
|
4
|
-
import { Card, CardContent, CardHeader, CardTitle } from "lib/components/ui/card";
|
|
5
|
-
import { Skeleton } from "lib/components/ui/skeleton";
|
|
6
|
-
export const KeyValueCard = ({ data, label, fields, }) => {
|
|
7
|
-
const renderValue = (field, value) => {
|
|
8
|
-
if (field.transform) {
|
|
9
|
-
return field.transform(value);
|
|
10
|
-
}
|
|
11
|
-
if (value === undefined || value === null) {
|
|
12
|
-
return "-";
|
|
13
|
-
}
|
|
14
|
-
switch (field.type) {
|
|
15
|
-
case "date":
|
|
16
|
-
return _jsx("span", { children: formatDate(value) });
|
|
17
|
-
case "yesno":
|
|
18
|
-
return _jsx("span", { children: value ? "Yes" : "No" });
|
|
19
|
-
case "badge":
|
|
20
|
-
return (_jsx("div", { className: "flex flex-wrap gap-1", children: Array.isArray(value)
|
|
21
|
-
? value.map((item, index) => (_jsx(Badge, { children: typeof item === "object" ? item?.name || item?.id : item }, index)))
|
|
22
|
-
: value }));
|
|
23
|
-
case "boolean":
|
|
24
|
-
return _jsx("span", { children: value.toString() });
|
|
25
|
-
default:
|
|
26
|
-
return _jsx("span", { children: value });
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
return (_jsxs(Card, { children: [_jsx(CardHeader, { children: _jsx(CardTitle, { children: label }) }), _jsx(CardContent, { children: _jsx("div", { className: "flex flex-col gap-2", children: data
|
|
30
|
-
? fields.map((field) => {
|
|
31
|
-
// TODO: improve this
|
|
32
|
-
const value = field.accessor
|
|
33
|
-
? field.accessor
|
|
34
|
-
.split(".")
|
|
35
|
-
.reduce((obj, key) => obj && key in obj ? obj[key] : undefined, data)
|
|
36
|
-
: null;
|
|
37
|
-
return (_jsxs("div", { className: "flex w-full flex-col md:flex-row justify-between first:pt-0 last:pb-0", children: [_jsx("p", { className: "text-sm flex w-full justify-start col-span-1", children: field.display }), _jsx("div", { className: "text-sm flex w-full justify-start text-wrap break-all", children: renderValue(field, value) })] }, field.display));
|
|
38
|
-
})
|
|
39
|
-
: fields.map((_, index) => (_jsx(Skeleton, { className: "h-12 w-full" }, index))) }) })] }));
|
|
40
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cva } from "class-variance-authority";
|
|
3
|
-
import { cn } from "lib/utils/primitives";
|
|
4
|
-
export const alertVariants = cva(`transition-colors border border-dotted p-2 text-foreground text-sm inline-flex items-start gap-2`, {
|
|
5
|
-
variants: {
|
|
6
|
-
variant: {
|
|
7
|
-
destructive: "bg-destructive-foreground/20 text-destructive border-destructive",
|
|
8
|
-
success: "bg-success-foreground/20 text-success border-success",
|
|
9
|
-
muted: "bg-muted-foreground/20 text-muted border-muted",
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
defaultVariants: {
|
|
13
|
-
variant: "muted",
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
export function Alert({ children, className, variant, icon: Icon, ...props }) {
|
|
17
|
-
return (_jsxs("div", { role: "alert", className: cn(alertVariants({ variant }), className), ...props, children: [Icon && _jsx(Icon, { className: "size-icon mt-1" }), _jsx("span", { className: "w-full", children: children })] }));
|
|
18
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "lib/utils/primitives";
|
|
3
|
-
export function Avatar({ className, initials, ...props }) {
|
|
4
|
-
return (_jsx("div", { className: cn("relative text-xs font-mono font-bold flex items-center leading-none justify-center bg-accent text-accent-foreground select-none size-input shrink-0 overflow-hidden rounded-full", className), ...props, children: initials }));
|
|
5
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "lib/utils/primitives";
|
|
3
|
-
export function Badge({ className, children, ...props }) {
|
|
4
|
-
return (_jsx("span", { className: cn("text-muted leading-none text-sm px-1 inline-flex items-center justify-center select-none bg-card border h-input focus:outline-hidden focus:ring-1 focus:ring-ring", className), ...props, children: _jsx("span", { children: children }) }));
|
|
5
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Breadcrumb as AriaBreadcrumb, Breadcrumbs as AriaBreadcrumbs, Link as AriaLink, composeRenderProps, } from "react-aria-components";
|
|
3
|
-
import { cn } from "lib/utils/primitives";
|
|
4
|
-
import { ChevronRight, DotSquare } from "lucide-react";
|
|
5
|
-
export function Breadcrumbs({ className, ...props }) {
|
|
6
|
-
return (_jsx(AriaBreadcrumbs, { className: cn("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5", className), ...props }));
|
|
7
|
-
}
|
|
8
|
-
export function BreadcrumbItem({ className, ...props }) {
|
|
9
|
-
return (_jsx(AriaBreadcrumb, { className: cn("inline-flex items-center gap-1.5 sm:gap-2.5", className), ...props }));
|
|
10
|
-
}
|
|
11
|
-
export function BreadcrumbLink({ className, ...props }) {
|
|
12
|
-
return (_jsx(AriaLink, { className: composeRenderProps(className, (className) => cn("transition-colors",
|
|
13
|
-
/* Hover */
|
|
14
|
-
"data-[hovered]:text-foreground",
|
|
15
|
-
/* Disabled */
|
|
16
|
-
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
17
|
-
/* Current */
|
|
18
|
-
"data-[current]:pointer-events-auto data-[current]:opacity-100", className)), ...props }));
|
|
19
|
-
}
|
|
20
|
-
export function BreadcrumbSeparator({ children, className, ...props }) {
|
|
21
|
-
return (_jsx("span", { role: "presentation", "aria-hidden": "true", className: cn("[&>svg]:size-3.5", className), ...props, children: children || _jsx(ChevronRight, {}) }));
|
|
22
|
-
}
|
|
23
|
-
export function BreadcrumbEllipsis({ className, ...props }) {
|
|
24
|
-
return (_jsxs("span", { role: "presentation", "aria-hidden": "true", className: cn("flex size-9 items-center justify-center", className), ...props, children: [_jsx(DotSquare, { className: "size-4" }), _jsx("span", { className: "sr-only", children: "More" })] }));
|
|
25
|
-
}
|
|
26
|
-
export function BreadcrumbPage({ className, ...props }) {
|
|
27
|
-
return (_jsx(AriaLink, { className: composeRenderProps(className, (className) => cn("font-normal text-foreground", className)), ...props }));
|
|
28
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { cva } from "class-variance-authority";
|
|
4
|
-
import { cn } from "lib/utils/primitives";
|
|
5
|
-
import { Button as AriaButton, composeRenderProps, } from "react-aria-components";
|
|
6
|
-
import { Loader } from "./loader";
|
|
7
|
-
export const buttonVariants = cva("btn inline-flex gap-1 text-ellipsis overflow-hidden items-center justify-center font-medium transition-colors", {
|
|
8
|
-
variants: {
|
|
9
|
-
variant: {
|
|
10
|
-
primary: "btn-primary",
|
|
11
|
-
secondary: "btn-secondary",
|
|
12
|
-
destructive: "btn-destructive",
|
|
13
|
-
neutral: "btn-neutral",
|
|
14
|
-
ghost: "btn-ghost",
|
|
15
|
-
link: "text-primary underline-offset-4 hover:underline",
|
|
16
|
-
},
|
|
17
|
-
size: {
|
|
18
|
-
default: "input-dim",
|
|
19
|
-
icon: "size-input",
|
|
20
|
-
none: ""
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
defaultVariants: {
|
|
24
|
-
variant: "neutral",
|
|
25
|
-
size: "default",
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
export function Button({ className: additionalClasses, variant, size, children, isPending, active, ...props }) {
|
|
29
|
-
return (_jsx(AriaButton, { ...props, className: composeRenderProps(additionalClasses, (className) => cn(buttonVariants({
|
|
30
|
-
variant,
|
|
31
|
-
size,
|
|
32
|
-
className,
|
|
33
|
-
}), additionalClasses)), children: composeRenderProps(children, (children) => (_jsxs(_Fragment, { children: [isPending && _jsx(Loader, {}), !isPending && _jsx(_Fragment, { children: children })] }))) }));
|
|
34
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { getLocalTimeZone, today } from "@internationalized/date";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import { Calendar as AriaCalendar, CalendarCell as AriaCalendarCell, CalendarGrid as AriaCalendarGrid, CalendarGridBody as AriaCalendarGridBody, CalendarGridHeader as AriaCalendarGridHeader, CalendarHeaderCell as AriaCalendarHeaderCell, Heading as AriaHeading, RangeCalendar as AriaRangeCalendar, RangeCalendarStateContext as AriaRangeCalendarStateContext, composeRenderProps, Text, useLocale } from "react-aria-components";
|
|
5
|
-
import { Button, buttonVariants } from "lib/components/ui/button";
|
|
6
|
-
import { cn } from "lib/utils/primitives";
|
|
7
|
-
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
8
|
-
export function CalendarHeading(props) {
|
|
9
|
-
let { direction } = useLocale();
|
|
10
|
-
return (_jsxs("header", { className: "flex w-full items-center gap-1 px-1 pb-4", ...props, children: [_jsx(Button, { slot: "previous", size: 'none', className: cn("size-7 bg-transparent p-0 opacity-50",
|
|
11
|
-
/* Hover */
|
|
12
|
-
"data-[hovered]:opacity-100"), children: direction === "rtl" ? (_jsx(ChevronRight, { "aria-hidden": true })) : (_jsx(ChevronLeft, { "aria-hidden": true })) }), _jsx(AriaHeading, { className: "grow text-center text-sm font-medium" }), _jsx(Button, { slot: "next", className: cn("size-7 bg-transparent p-0 opacity-50",
|
|
13
|
-
/* Hover */
|
|
14
|
-
"data-[hovered]:opacity-100"), children: direction === "rtl" ? (_jsx(ChevronLeft, { "aria-hidden": true })) : (_jsx(ChevronRight, { "aria-hidden": true })) })] }));
|
|
15
|
-
}
|
|
16
|
-
export function CalendarGrid({ className, ...props }) {
|
|
17
|
-
return (_jsx(AriaCalendarGrid, { className: cn(" border-separate border-spacing-x-0 border-spacing-y-1 ", className), ...props }));
|
|
18
|
-
}
|
|
19
|
-
export const CalendarGridHeader = AriaCalendarGridHeader;
|
|
20
|
-
export function CalendarHeaderCell({ className, ...props }) {
|
|
21
|
-
return (_jsx(AriaCalendarHeaderCell, { className: cn("w-9 text-xs font-normal text-muted-foreground", className), ...props }));
|
|
22
|
-
}
|
|
23
|
-
export function CalendarGridBody({ className, ...props }) {
|
|
24
|
-
return (_jsx(AriaCalendarGridBody, { className: cn("[&>tr>td]:p-0", className), ...props }));
|
|
25
|
-
}
|
|
26
|
-
export function CalendarCell({ className, ...props }) {
|
|
27
|
-
const isRange = Boolean(React.useContext(AriaRangeCalendarStateContext));
|
|
28
|
-
return (_jsx(AriaCalendarCell, { className: composeRenderProps(className, (className, renderProps) => cn(buttonVariants({ variant: "ghost", size: 'none' }), "relative flex size-9 items-center justify-center p-0 text-sm font-normal",
|
|
29
|
-
/* Disabled */
|
|
30
|
-
renderProps.isDisabled && "text-muted-foreground opacity-50",
|
|
31
|
-
/* Selected */
|
|
32
|
-
renderProps.isSelected &&
|
|
33
|
-
"bg-primary text-primary-foreground data-[focused]:bg-primary data-[focused]:text-primary-foreground",
|
|
34
|
-
/* Hover */
|
|
35
|
-
renderProps.isHovered &&
|
|
36
|
-
renderProps.isSelected &&
|
|
37
|
-
(renderProps.isSelectionStart ||
|
|
38
|
-
renderProps.isSelectionEnd ||
|
|
39
|
-
!isRange) &&
|
|
40
|
-
"data-[hovered]:bg-primary data-[hovered]:text-primary-foreground",
|
|
41
|
-
/* Selection Start/End */
|
|
42
|
-
renderProps.isSelected &&
|
|
43
|
-
isRange &&
|
|
44
|
-
!renderProps.isSelectionStart &&
|
|
45
|
-
!renderProps.isSelectionEnd &&
|
|
46
|
-
"rounded-none bg-accent text-accent-foreground",
|
|
47
|
-
/* Outside Month */
|
|
48
|
-
renderProps.isOutsideMonth &&
|
|
49
|
-
"text-muted-foreground opacity-50 data-[selected]:bg-accent/50 data-[selected]:text-muted-foreground data-[selected]:opacity-30",
|
|
50
|
-
/* Current Date */
|
|
51
|
-
renderProps.date.compare(today(getLocalTimeZone())) === 0 &&
|
|
52
|
-
!renderProps.isSelected &&
|
|
53
|
-
"bg-accent text-accent-foreground",
|
|
54
|
-
/* Unavailable Date */
|
|
55
|
-
renderProps.isUnavailable && "cursor-default text-destructive ", renderProps.isInvalid &&
|
|
56
|
-
"bg-destructive text-destructive-foreground data-[focused]:bg-destructive data-[hovered]:bg-destructive data-[focused]:text-destructive-foreground data-[hovered]:text-destructive-foreground", className)), ...props }));
|
|
57
|
-
}
|
|
58
|
-
export function Calendar({ errorMessage, className, ...props }) {
|
|
59
|
-
return (_jsxs(AriaCalendar, { className: composeRenderProps(className, (className) => cn("w-fit", className)), ...props, children: [_jsx(CalendarHeading, {}), _jsxs(CalendarGrid, { children: [_jsx(CalendarGridHeader, { children: (day) => _jsx(CalendarHeaderCell, { children: day }) }), _jsx(CalendarGridBody, { children: (date) => _jsx(CalendarCell, { date: date }) })] }), errorMessage && (_jsx(Text, { className: "text-sm text-destructive", slot: "errorMessage", children: errorMessage }))] }));
|
|
60
|
-
}
|
|
61
|
-
export function RangeCalendar({ errorMessage, className, ...props }) {
|
|
62
|
-
return (_jsxs(AriaRangeCalendar, { className: composeRenderProps(className, (className) => cn("w-fit", className)), ...props, children: [_jsx(CalendarHeading, {}), _jsxs(CalendarGrid, { children: [_jsx(CalendarGridHeader, { children: (day) => _jsx(CalendarHeaderCell, { children: day }) }), _jsx(CalendarGridBody, { children: (date) => _jsx(CalendarCell, { date: date }) })] }), errorMessage && (_jsx(Text, { slot: "errorMessage", className: "text-sm text-destructive", children: errorMessage }))] }));
|
|
63
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "lib/utils/primitives";
|
|
3
|
-
export function Card({ className, ...props }) {
|
|
4
|
-
return (_jsx("div", { className: cn("flex flex-col p-icon border border-border bg-card text-card-foreground", className), ...props }));
|
|
5
|
-
}
|
|
6
|
-
export function CardHeader({ className, ...props }) {
|
|
7
|
-
return (_jsx("div", { className: cn("flex flex-col gap-y-1 pb-icon shrink-0", className), ...props }));
|
|
8
|
-
}
|
|
9
|
-
export function CardTitle({ className, ...props }) {
|
|
10
|
-
return (_jsx("h3", { className: cn("h4 leading-none", className), ...props }));
|
|
11
|
-
}
|
|
12
|
-
export function CardDescription({ className, ...props }) {
|
|
13
|
-
return (_jsx("p", { className: cn("caption", className), ...props }));
|
|
14
|
-
}
|
|
15
|
-
export function CardContent({ className, ...props }) {
|
|
16
|
-
return (_jsx("div", { className: cn("grow body", className), ...props }));
|
|
17
|
-
}
|
|
18
|
-
export function CardFooter({ className, ...props }) {
|
|
19
|
-
return (_jsx("div", { className: cn("flex items-center w-full pt-icon gap-2 justify-end", className), ...props }));
|
|
20
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { cva } from "class-variance-authority";
|
|
3
|
-
import { Dialog as AriaDialog, DialogTrigger as AriaDialogTrigger, Heading as AriaHeading, Modal as AriaModal, ModalOverlay as AriaModalOverlay, composeRenderProps } from "react-aria-components";
|
|
4
|
-
import { Button } from "lib/components/ui/button";
|
|
5
|
-
import { cn } from "lib/utils/primitives";
|
|
6
|
-
import { X } from "lucide-react";
|
|
7
|
-
const sheetVariants = cva([
|
|
8
|
-
"fixed z-50 gap-4 bg-popover transition ease-in-out",
|
|
9
|
-
"data-[entering]:duration-200 data-[entering]:animate-in data-[entering]:fade-in-0 data-[exiting]:duration-200 data-[exiting]:animate-out data-[exiting]:fade-out-0",
|
|
10
|
-
], {
|
|
11
|
-
variants: {
|
|
12
|
-
side: {
|
|
13
|
-
top: "inset-x-0 top-0 border-b data-[entering]:slide-in-from-top data-[exiting]:slide-out-to-top max-h-table",
|
|
14
|
-
bottom: "inset-x-0 bottom-0 border-t data-[entering]:slide-in-from-bottom data-[exiting]:slide-out-to-bottom max-h-table",
|
|
15
|
-
left: "inset-y-0 left-0 h-full w-3/4 border-r data-[entering]:slide-in-from-left data-[exiting]:slide-out-to-left sm:max-w-sm",
|
|
16
|
-
right: "inset-y-0 right-0 h-full w-3/4 border-l data-[entering]:slide-in-from-right data-[exiting]:slide-out-to-right sm:max-w-sm",
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
export const DialogTrigger = AriaDialogTrigger;
|
|
21
|
-
export const DialogOverlay = ({ className, isDismissable = true, ...props }) => (_jsx(AriaModalOverlay, { isDismissable: isDismissable, className: composeRenderProps(className, (className) => cn("fixed inset-0 z-50 bg-card/20",
|
|
22
|
-
/* Exiting */
|
|
23
|
-
"data-[exiting]:duration-100 data-[exiting]:animate-out",
|
|
24
|
-
/* Entering */
|
|
25
|
-
"data-[entering]:animate-in", className)), ...props }));
|
|
26
|
-
export function DialogContent({ className, children, side, role, closeButton = true, ...props }) {
|
|
27
|
-
return (_jsx(AriaModal, { className: composeRenderProps(className, (className) => cn(side
|
|
28
|
-
? sheetVariants({ side, className: "h-full p-6" })
|
|
29
|
-
: ["fixed left-[50vw] top-1/2 z-50 w-full max-w-lg -translate-x-1/2 -translate-y-1/2 border bg-popover p-icon duration-100 data-[exiting]:duration-100 data-[entering]:animate-in data-[exiting]:animate-out data-[entering]:fade-in-0 data-[exiting]:fade-out-0 data-[entering]:zoom-in-95 data-[exiting]:zoom-out-95 md:w-full"], className)), ...props, children: _jsx(AriaDialog, { role: role, className: cn(!side && "grid h-full gap-4 relative", "h-full outline-none"), children: composeRenderProps(children, (children, renderProps) => (_jsxs(_Fragment, { children: [children, closeButton && (_jsx("div", { className: "absolute right-1 top-1", children: _jsxs(Button, { size: 'icon', variant: 'destructive', onPress: renderProps.close, className: "opacity-70 transition-opacity data-[hovered]:opacity-100", children: [_jsx(X, {}), _jsx("span", { className: "sr-only", children: "Close" })] }) }))] }))) }) }));
|
|
30
|
-
}
|
|
31
|
-
export function DialogHeader({ className, ...props }) {
|
|
32
|
-
return (_jsx("div", { className: cn("flex flex-col gap-y-2 text-center sm:text-left", className), ...props }));
|
|
33
|
-
}
|
|
34
|
-
export function DialogFooter({ className, ...props }) {
|
|
35
|
-
return (_jsx("div", { className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2", className), ...props }));
|
|
36
|
-
}
|
|
37
|
-
export function DialogTitle({ className, ...props }) {
|
|
38
|
-
return (_jsx(AriaHeading, { slot: "title", className: cn("text-lg font-semibold leading-none tracking-tight", className), ...props }));
|
|
39
|
-
}
|
|
40
|
-
export function DialogDescription({ className, ...props }) {
|
|
41
|
-
return (_jsx("p", { className: cn("flex flex-col gap-y-1 text-center sm:text-left", className), ...props }));
|
|
42
|
-
}
|