@giddaa-housing/ui 0.1.0 → 1.0.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/README.md +18 -6
- package/css/base.css +37 -0
- package/css/components.css +135 -0
- package/css/generated/shared.css +1 -0
- package/css/giddaa.css +402 -0
- package/css/preset.css +77 -0
- package/css/styles.css +2 -0
- package/css/theme.css +255 -0
- package/dist/accordion.js +5 -35
- package/dist/accordion.js.map +1 -1
- package/dist/activity-timeline.d.ts +33 -0
- package/dist/activity-timeline.js +212 -0
- package/dist/activity-timeline.js.map +1 -0
- package/dist/alert.js +5 -35
- package/dist/alert.js.map +1 -1
- package/dist/auth-layout.d.ts +23 -0
- package/dist/auth-layout.js +304 -0
- package/dist/auth-layout.js.map +1 -0
- package/dist/avatar.js +10 -142
- package/dist/avatar.js.map +1 -1
- package/dist/badge.d.ts +3 -2
- package/dist/badge.js +6 -114
- package/dist/badge.js.map +1 -1
- package/dist/bar-chart.d.ts +101 -77
- package/dist/bar-chart.js +142 -220
- package/dist/bar-chart.js.map +1 -1
- package/dist/breadcrumb.js +5 -35
- package/dist/breadcrumb.js.map +1 -1
- package/dist/bullet-chart.js +15 -48
- package/dist/bullet-chart.js.map +1 -1
- package/dist/button-group.js +14 -90
- package/dist/button-group.js.map +1 -1
- package/dist/button.d.ts +5 -5
- package/dist/button.js +7 -140
- package/dist/button.js.map +1 -1
- package/dist/calendar.js +12 -287
- package/dist/calendar.js.map +1 -1
- package/dist/card.js +5 -35
- package/dist/card.js.map +1 -1
- package/dist/carousel.js +12 -386
- package/dist/carousel.js.map +1 -1
- package/dist/chart.js +16 -480
- package/dist/chart.js.map +1 -1
- package/dist/checkbox.d.ts +1 -1
- package/dist/checkbox.js +13 -48
- package/dist/checkbox.js.map +1 -1
- package/dist/chunk-322YCNVL.js +278 -0
- package/dist/chunk-322YCNVL.js.map +1 -0
- package/dist/chunk-3ACQVT7A.js +25 -0
- package/dist/chunk-3ACQVT7A.js.map +1 -0
- package/dist/chunk-3T65TLJX.js +334 -0
- package/dist/chunk-3T65TLJX.js.map +1 -0
- package/dist/chunk-6ZSGQHH2.js +192 -0
- package/dist/chunk-6ZSGQHH2.js.map +1 -0
- package/dist/chunk-7TBMLFGW.js +41 -0
- package/dist/chunk-7TBMLFGW.js.map +1 -0
- package/dist/chunk-B4H6RNDH.js +135 -0
- package/dist/chunk-B4H6RNDH.js.map +1 -0
- package/dist/chunk-BUXCGZ6X.js +219 -0
- package/dist/chunk-BUXCGZ6X.js.map +1 -0
- package/dist/chunk-CHII2QHH.js +58 -0
- package/dist/chunk-CHII2QHH.js.map +1 -0
- package/dist/chunk-DMNOXRRW.js +147 -0
- package/dist/chunk-DMNOXRRW.js.map +1 -0
- package/dist/chunk-EFSOSSIC.js +130 -0
- package/dist/chunk-EFSOSSIC.js.map +1 -0
- package/dist/chunk-FZDSVMKY.js +363 -0
- package/dist/chunk-FZDSVMKY.js.map +1 -0
- package/dist/chunk-GJOFIJS3.js +246 -0
- package/dist/chunk-GJOFIJS3.js.map +1 -0
- package/dist/chunk-HL3ZSYES.js +23 -0
- package/dist/chunk-HL3ZSYES.js.map +1 -0
- package/dist/chunk-JVLUBAPB.js +129 -0
- package/dist/chunk-JVLUBAPB.js.map +1 -0
- package/dist/chunk-KDPYSOYZ.js +64 -0
- package/dist/chunk-KDPYSOYZ.js.map +1 -0
- package/dist/chunk-KSMDANKI.js +43 -0
- package/dist/chunk-KSMDANKI.js.map +1 -0
- package/dist/chunk-MEKCCOP5.js +46 -0
- package/dist/chunk-MEKCCOP5.js.map +1 -0
- package/dist/chunk-NOFXVRWL.js +451 -0
- package/dist/chunk-NOFXVRWL.js.map +1 -0
- package/dist/chunk-PC5MHNVA.js +171 -0
- package/dist/chunk-PC5MHNVA.js.map +1 -0
- package/dist/chunk-QKAQZ2GU.js +122 -0
- package/dist/chunk-QKAQZ2GU.js.map +1 -0
- package/dist/chunk-QZHSHSVV.js +26 -0
- package/dist/chunk-QZHSHSVV.js.map +1 -0
- package/dist/chunk-RBMK26XD.js +19 -0
- package/dist/chunk-RBMK26XD.js.map +1 -0
- package/dist/chunk-SFNJGF6M.js +262 -0
- package/dist/chunk-SFNJGF6M.js.map +1 -0
- package/dist/chunk-UJJNLGTM.js +112 -0
- package/dist/chunk-UJJNLGTM.js.map +1 -0
- package/dist/chunk-VGR4ZWJ3.js +418 -0
- package/dist/chunk-VGR4ZWJ3.js.map +1 -0
- package/dist/chunk-XG47P6D4.js +99 -0
- package/dist/chunk-XG47P6D4.js.map +1 -0
- package/dist/chunk-XZZAHNVM.js +21 -0
- package/dist/chunk-XZZAHNVM.js.map +1 -0
- package/dist/chunk-Y4TTYVNE.js +36 -0
- package/dist/chunk-Y4TTYVNE.js.map +1 -0
- package/dist/chunk-YDWIHW6Q.js +69 -0
- package/dist/chunk-YDWIHW6Q.js.map +1 -0
- package/dist/collapsible.js +6 -35
- package/dist/collapsible.js.map +1 -1
- package/dist/combobox.js +26 -694
- package/dist/combobox.js.map +1 -1
- package/dist/cta.d.ts +66 -0
- package/dist/cta.js +358 -0
- package/dist/cta.js.map +1 -0
- package/dist/currency-selector.d.ts +42 -0
- package/dist/currency-selector.js +192 -0
- package/dist/currency-selector.js.map +1 -0
- package/dist/date-picker.d.ts +18 -10
- package/dist/date-picker.js +105 -430
- package/dist/date-picker.js.map +1 -1
- package/dist/details-card.d.ts +19 -0
- package/dist/details-card.js +267 -0
- package/dist/details-card.js.map +1 -0
- package/dist/dialog.js +36 -146
- package/dist/dialog.js.map +1 -1
- package/dist/dropdown-menu.d.ts +1 -1
- package/dist/dropdown-menu.js +20 -358
- package/dist/dropdown-menu.js.map +1 -1
- package/dist/dropzone.js +13 -40
- package/dist/dropzone.js.map +1 -1
- package/dist/editorial-card.d.ts +29 -0
- package/dist/editorial-card.js +311 -0
- package/dist/editorial-card.js.map +1 -0
- package/dist/empty-state.js +5 -35
- package/dist/empty-state.js.map +1 -1
- package/dist/field.js +30 -135
- package/dist/field.js.map +1 -1
- package/dist/footer.d.ts +47 -0
- package/dist/footer.js +430 -0
- package/dist/footer.js.map +1 -0
- package/dist/funnel-chart.js +42 -415
- package/dist/funnel-chart.js.map +1 -1
- package/dist/gallery-indicator.d.ts +18 -0
- package/dist/gallery-indicator.js +12 -0
- package/dist/gallery-indicator.js.map +1 -0
- package/dist/heatmap-chart.d.ts +98 -0
- package/dist/heatmap-chart.js +248 -0
- package/dist/heatmap-chart.js.map +1 -0
- package/dist/infotip.d.ts +11 -0
- package/dist/infotip.js +66 -0
- package/dist/infotip.js.map +1 -0
- package/dist/input-group.d.ts +2 -1
- package/dist/input-group.js +15 -371
- package/dist/input-group.js.map +1 -1
- package/dist/input-size-context.js +5 -19
- package/dist/input-size-context.js.map +1 -1
- package/dist/input.js +6 -78
- package/dist/input.js.map +1 -1
- package/dist/item.js +5 -35
- package/dist/item.js.map +1 -1
- package/dist/kpi-card.js +12 -52
- package/dist/kpi-card.js.map +1 -1
- package/dist/label.js +5 -64
- package/dist/label.js.map +1 -1
- package/dist/line-chart.js +9 -166
- package/dist/line-chart.js.map +1 -1
- package/dist/logo.js +4 -141
- package/dist/logo.js.map +1 -1
- package/dist/map-indicator.d.ts +13 -0
- package/dist/map-indicator.js +109 -0
- package/dist/map-indicator.js.map +1 -0
- package/dist/match.d.ts +16 -0
- package/dist/match.js +113 -0
- package/dist/match.js.map +1 -0
- package/dist/media-gallery-hero.d.ts +60 -0
- package/dist/media-gallery-hero.js +362 -0
- package/dist/media-gallery-hero.js.map +1 -0
- package/dist/media-player.d.ts +60 -0
- package/dist/media-player.js +1394 -0
- package/dist/media-player.js.map +1 -0
- package/dist/number-input.js +30 -325
- package/dist/number-input.js.map +1 -1
- package/dist/page-header.js +4 -32
- package/dist/page-header.js.map +1 -1
- package/dist/pagination.d.ts +1 -0
- package/dist/pagination.js +27 -161
- package/dist/pagination.js.map +1 -1
- package/dist/password-input.d.ts +1 -0
- package/dist/password-input.js +21 -319
- package/dist/password-input.js.map +1 -1
- package/dist/phone-input.d.ts +2 -1
- package/dist/phone-input.js +148 -359
- package/dist/phone-input.js.map +1 -1
- package/dist/photo-gallery.d.ts +1 -1
- package/dist/photo-gallery.js +97 -393
- package/dist/photo-gallery.js.map +1 -1
- package/dist/pie-chart.js +17 -52
- package/dist/pie-chart.js.map +1 -1
- package/dist/popover.js +13 -158
- package/dist/popover.js.map +1 -1
- package/dist/price-tag.d.ts +35 -0
- package/dist/price-tag.js +178 -0
- package/dist/price-tag.js.map +1 -0
- package/dist/progress.d.ts +5 -2
- package/dist/progress.js +14 -303
- package/dist/progress.js.map +1 -1
- package/dist/property-listing-card.d.ts +32 -0
- package/dist/property-listing-card.js +235 -0
- package/dist/property-listing-card.js.map +1 -0
- package/dist/radar-chart.d.ts +110 -0
- package/dist/radar-chart.js +147 -0
- package/dist/radar-chart.js.map +1 -0
- package/dist/radio-group.js +15 -50
- package/dist/radio-group.js.map +1 -1
- package/dist/review-block.d.ts +20 -0
- package/dist/review-block.js +10 -0
- package/dist/review-block.js.map +1 -0
- package/dist/rich-text-editor.js +172 -433
- package/dist/rich-text-editor.js.map +1 -1
- package/dist/scatter-chart.d.ts +142 -0
- package/dist/scatter-chart.js +252 -0
- package/dist/scatter-chart.js.map +1 -0
- package/dist/search-input.d.ts +1 -0
- package/dist/search-input.js +22 -320
- package/dist/search-input.js.map +1 -1
- package/dist/select.js +15 -292
- package/dist/select.js.map +1 -1
- package/dist/separator.js +5 -68
- package/dist/separator.js.map +1 -1
- package/dist/sheet.js +14 -271
- package/dist/sheet.js.map +1 -1
- package/dist/sidebar.d.ts +1 -1
- package/dist/sidebar.js +89 -494
- package/dist/sidebar.js.map +1 -1
- package/dist/size-context.js +5 -17
- package/dist/size-context.js.map +1 -1
- package/dist/skeleton.js +4 -44
- package/dist/skeleton.js.map +1 -1
- package/dist/slider.d.ts +28 -0
- package/dist/slider.js +152 -0
- package/dist/slider.js.map +1 -0
- package/dist/sparkline.js +33 -341
- package/dist/sparkline.js.map +1 -1
- package/dist/stepper.js +5 -35
- package/dist/stepper.js.map +1 -1
- package/dist/styles.css +9593 -2
- package/dist/switch.js +13 -48
- package/dist/switch.js.map +1 -1
- package/dist/tab-list.js +35 -306
- package/dist/tab-list.js.map +1 -1
- package/dist/table.js +5 -32
- package/dist/table.js.map +1 -1
- package/dist/tabs.js +10 -150
- package/dist/tabs.js.map +1 -1
- package/dist/tag.d.ts +7 -6
- package/dist/tag.js +101 -97
- package/dist/tag.js.map +1 -1
- package/dist/testimonial-block.d.ts +34 -0
- package/dist/testimonial-block.js +377 -0
- package/dist/testimonial-block.js.map +1 -0
- package/dist/textarea.js +6 -73
- package/dist/textarea.js.map +1 -1
- package/dist/time-picker.js +119 -279
- package/dist/time-picker.js.map +1 -1
- package/dist/toast.js +27 -132
- package/dist/toast.js.map +1 -1
- package/dist/tooltip.d.ts +5 -5
- package/dist/tooltip.js +7 -90
- package/dist/tooltip.js.map +1 -1
- package/dist/tree-map.js +41 -414
- package/dist/tree-map.js.map +1 -1
- package/dist/waterfall-chart.d.ts +129 -0
- package/dist/waterfall-chart.js +577 -0
- package/dist/waterfall-chart.js.map +1 -0
- package/package.json +98 -28
- package/dist/base.css +0 -32
- package/dist/files/red-hat-display-latin-300-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-300-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-300-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-300-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-400-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-400-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-400-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-400-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-500-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-500-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-500-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-500-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-600-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-600-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-600-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-600-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-700-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-700-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-700-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-700-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-800-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-800-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-800-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-800-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-900-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-900-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-900-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-900-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-300-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-300-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-300-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-300-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-400-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-400-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-400-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-400-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-500-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-500-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-500-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-500-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-600-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-600-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-600-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-600-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-700-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-700-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-700-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-700-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-800-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-800-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-800-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-800-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-900-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-900-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-900-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-900-normal.woff2 +0 -0
- package/dist/index.d.ts +0 -87
- package/dist/index.js +0 -10448
- package/dist/index.js.map +0 -1
- package/dist/red-hat-display.css +0 -2
- package/dist/theme/giddaa.css +0 -2
package/dist/phone-input.js
CHANGED
|
@@ -1,4 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Popover,
|
|
4
|
+
PopoverContent,
|
|
5
|
+
PopoverTrigger
|
|
6
|
+
} from "./chunk-JVLUBAPB.js";
|
|
7
|
+
import {
|
|
8
|
+
Separator
|
|
9
|
+
} from "./chunk-CHII2QHH.js";
|
|
10
|
+
import {
|
|
11
|
+
InputGroup,
|
|
12
|
+
InputGroupAddon,
|
|
13
|
+
InputGroupInput
|
|
14
|
+
} from "./chunk-6ZSGQHH2.js";
|
|
15
|
+
import "./chunk-KSMDANKI.js";
|
|
16
|
+
import "./chunk-MEKCCOP5.js";
|
|
17
|
+
import "./chunk-3ACQVT7A.js";
|
|
18
|
+
import "./chunk-B4H6RNDH.js";
|
|
19
|
+
import {
|
|
20
|
+
useComponentSize
|
|
21
|
+
} from "./chunk-HL3ZSYES.js";
|
|
22
|
+
import {
|
|
23
|
+
cn
|
|
24
|
+
} from "./chunk-Y4TTYVNE.js";
|
|
25
|
+
|
|
26
|
+
// src/phone-input.tsx
|
|
2
27
|
import {
|
|
3
28
|
AsYouType,
|
|
4
29
|
getCountries,
|
|
@@ -8,314 +33,7 @@ import {
|
|
|
8
33
|
import { CheckIcon, ChevronDownIcon, SearchIcon } from "lucide-react";
|
|
9
34
|
import * as React from "react";
|
|
10
35
|
import flags from "react-phone-number-input/flags";
|
|
11
|
-
|
|
12
|
-
// src/lib/cn.ts
|
|
13
|
-
import { clsx } from "clsx";
|
|
14
|
-
import { extendTailwindMerge } from "tailwind-merge";
|
|
15
|
-
var twMerge = extendTailwindMerge({
|
|
16
|
-
extend: {
|
|
17
|
-
classGroups: {
|
|
18
|
-
"font-size": [
|
|
19
|
-
{
|
|
20
|
-
text: [
|
|
21
|
-
"gdt-display",
|
|
22
|
-
"gdt-h1",
|
|
23
|
-
"gdt-h2",
|
|
24
|
-
"gdt-h3",
|
|
25
|
-
"gdt-h4",
|
|
26
|
-
"gdt-h5",
|
|
27
|
-
"gdt-xl",
|
|
28
|
-
"gdt-lg",
|
|
29
|
-
"gdt-md",
|
|
30
|
-
"gdt-sm",
|
|
31
|
-
"gdt-xs",
|
|
32
|
-
"gdt-subtext",
|
|
33
|
-
"gdt-capitalized"
|
|
34
|
-
]
|
|
35
|
-
}
|
|
36
|
-
]
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
function cn(...inputs) {
|
|
41
|
-
return twMerge(clsx(inputs));
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// src/components/ui/input-group.tsx
|
|
45
|
-
import { cva as cva2 } from "class-variance-authority";
|
|
46
|
-
|
|
47
|
-
// src/components/ui/size-context.tsx
|
|
48
|
-
import { createContext, useContext } from "react";
|
|
49
|
-
import { Fragment, jsx } from "react/jsx-runtime";
|
|
50
|
-
var SizeContext = createContext(void 0);
|
|
51
|
-
function SizeProvider({
|
|
52
|
-
children,
|
|
53
|
-
size
|
|
54
|
-
}) {
|
|
55
|
-
if (!size) {
|
|
56
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
57
|
-
}
|
|
58
|
-
return /* @__PURE__ */ jsx(SizeContext.Provider, { value: size, children });
|
|
59
|
-
}
|
|
60
|
-
function useComponentSize(size, fallback = "md") {
|
|
61
|
-
const inheritedSize = useContext(SizeContext);
|
|
62
|
-
return size ?? inheritedSize ?? fallback;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// src/components/ui/input.tsx
|
|
66
|
-
import { Input as InputPrimitive } from "@base-ui/react/input";
|
|
67
|
-
import { cva } from "class-variance-authority";
|
|
68
|
-
|
|
69
|
-
// src/components/ui/input-size-context.tsx
|
|
70
|
-
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
71
|
-
import { Fragment as Fragment2, jsx as jsx2 } from "react/jsx-runtime";
|
|
72
|
-
var InputSizeContext = createContext2(
|
|
73
|
-
void 0
|
|
74
|
-
);
|
|
75
|
-
function InputSizeProvider({
|
|
76
|
-
children,
|
|
77
|
-
size
|
|
78
|
-
}) {
|
|
79
|
-
if (!size) {
|
|
80
|
-
return /* @__PURE__ */ jsx2(Fragment2, { children });
|
|
81
|
-
}
|
|
82
|
-
return /* @__PURE__ */ jsx2(InputSizeContext.Provider, { value: size, children });
|
|
83
|
-
}
|
|
84
|
-
function useInputComponentSize(size, fallback = "md") {
|
|
85
|
-
const inheritedSize = useContext2(InputSizeContext);
|
|
86
|
-
return size ?? inheritedSize ?? fallback;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// src/components/ui/input.tsx
|
|
90
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
91
|
-
var inputVariants = cva(
|
|
92
|
-
"flex w-full min-w-0 rounded-full border border-line bg-canvas text-fg-primary transition-[background-color,border-color,box-shadow,color] outline-none file:inline-flex file:border-0 file:bg-transparent file:font-normal file:text-fg-primary placeholder:text-fg-muted hover:border-line-strong focus-visible:border-line-focus focus-visible:inset-ring-1 inset-ring-line-focus disabled:pointer-events-none disabled:cursor-not-allowed disabled:border-line-subtle disabled:bg-surface disabled:text-fg-muted disabled:placeholder:text-fg-muted aria-invalid:border-line-danger aria-invalid:text-fg-danger aria-invalid:placeholder:text-fg-danger aria-invalid:shadow-none",
|
|
93
|
-
{
|
|
94
|
-
variants: {
|
|
95
|
-
size: {
|
|
96
|
-
sm: "h-8 px-3 text-gdt-xs font-normal file:text-gdt-xs",
|
|
97
|
-
md: "h-10 px-3.5 text-gdt-sm font-normal file:text-gdt-sm",
|
|
98
|
-
lg: "h-12 px-4 text-gdt-md font-normal file:text-gdt-md",
|
|
99
|
-
xl: "h-14 px-4.5 text-gdt-lg font-normal file:text-gdt-lg"
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
defaultVariants: {
|
|
103
|
-
size: "md"
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
);
|
|
107
|
-
function Input({ className, size, type, ...props }) {
|
|
108
|
-
const resolvedSize = useInputComponentSize(size);
|
|
109
|
-
return /* @__PURE__ */ jsx3(
|
|
110
|
-
InputPrimitive,
|
|
111
|
-
{
|
|
112
|
-
type,
|
|
113
|
-
"data-slot": "input",
|
|
114
|
-
"data-size": resolvedSize,
|
|
115
|
-
className: cn(inputVariants({ size: resolvedSize }), className),
|
|
116
|
-
...props
|
|
117
|
-
}
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// src/components/ui/input-group.tsx
|
|
122
|
-
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
123
|
-
var inputGroupVariants = cva2(
|
|
124
|
-
"group/input-group relative flex w-full min-w-0 items-center rounded-full has-[textarea]:rounded-xl has-data-[align=block-end]:rounded-xl has-data-[align=block-start]:rounded-xl border border-line bg-canvas transition-[background-color,border-color,box-shadow,color] outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:border-line-subtle has-disabled:bg-surface has-disabled:text-fg-muted focus-within:border-line-focus focus-within:inset-ring-1 inset-ring-line-focus has-[[data-slot][aria-invalid=true]]:border-line-danger has-[[data-slot][aria-invalid=true]]:inset-shadow-none has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-start]]:[&>[data-slot=input-group-control]]:group-data-[size=sm]/input-group:pl-2 has-[>[data-align=inline-start]]:[&>[data-slot=input-group-control]]:group-data-[size=md]/input-group:pl-2.5 has-[>[data-align=inline-start]]:[&>[data-slot=input-group-control]]:group-data-[size=lg]/input-group:pl-3 has-[>[data-align=inline-start]]:[&>[data-slot=input-group-control]]:group-data-[size=xl]/input-group:pl-3 has-[>[data-align=inline-end]]:[&>[data-slot=input-group-control]]:group-data-[size=sm]/input-group:pr-2 has-[>[data-align=inline-end]]:[&>[data-slot=input-group-control]]:group-data-[size=md]/input-group:pr-2.5 has-[>[data-align=inline-end]]:[&>[data-slot=input-group-control]]:group-data-[size=lg]/input-group:pr-3 has-[>[data-align=inline-end]]:[&>[data-slot=input-group-control]]:group-data-[size=xl]/input-group:pr-3",
|
|
125
|
-
{
|
|
126
|
-
variants: {
|
|
127
|
-
size: {
|
|
128
|
-
sm: "h-8",
|
|
129
|
-
md: "h-10",
|
|
130
|
-
lg: "h-12",
|
|
131
|
-
xl: "h-14"
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
defaultVariants: {
|
|
135
|
-
size: "md"
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
);
|
|
139
|
-
function InputGroup({
|
|
140
|
-
className,
|
|
141
|
-
size,
|
|
142
|
-
...props
|
|
143
|
-
}) {
|
|
144
|
-
const inheritedSize = useComponentSize();
|
|
145
|
-
const resolvedSize = size ?? inheritedSize;
|
|
146
|
-
const componentSize = resolvedSize === "xl" ? void 0 : resolvedSize;
|
|
147
|
-
return /* @__PURE__ */ jsx4(SizeProvider, { size: componentSize, children: /* @__PURE__ */ jsx4(InputSizeProvider, { size: resolvedSize, children: /* @__PURE__ */ jsx4(
|
|
148
|
-
"div",
|
|
149
|
-
{
|
|
150
|
-
"data-slot": "input-group",
|
|
151
|
-
"data-size": resolvedSize,
|
|
152
|
-
role: "group",
|
|
153
|
-
className: cn(inputGroupVariants({ size: resolvedSize }), className),
|
|
154
|
-
...props
|
|
155
|
-
}
|
|
156
|
-
) }) });
|
|
157
|
-
}
|
|
158
|
-
var inputGroupAddonVariants = cva2(
|
|
159
|
-
"flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-gdt-sm font-normal text-fg-secondary select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[size=lg]/input-group:[&>svg:not([class*='size-'])]:size-4.5 group-data-[size=xl]/input-group:[&>svg:not([class*='size-'])]:size-5 [&>svg:not([class*='size-'])]:size-4",
|
|
160
|
-
{
|
|
161
|
-
variants: {
|
|
162
|
-
align: {
|
|
163
|
-
"inline-start": "order-first group-data-[size=sm]/input-group:pl-3 group-data-[size=md]/input-group:pl-3.5 group-data-[size=lg]/input-group:pl-4 group-data-[size=xl]/input-group:pl-4.5 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]",
|
|
164
|
-
"inline-end": "order-last group-data-[size=sm]/input-group:pr-3 group-data-[size=md]/input-group:pr-3.5 group-data-[size=lg]/input-group:pr-4 group-data-[size=xl]/input-group:pr-4.5 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]",
|
|
165
|
-
"block-start": "order-first w-full justify-start px-3 group-data-[size=md]/input-group:px-3.5 group-data-[size=lg]/input-group:px-4 group-data-[size=xl]/input-group:px-4.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2",
|
|
166
|
-
"block-end": "order-last w-full justify-start px-3 group-data-[size=md]/input-group:px-3.5 group-data-[size=lg]/input-group:px-4 group-data-[size=xl]/input-group:px-4.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"
|
|
167
|
-
}
|
|
168
|
-
},
|
|
169
|
-
defaultVariants: {
|
|
170
|
-
align: "inline-start"
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
);
|
|
174
|
-
function InputGroupAddon({
|
|
175
|
-
className,
|
|
176
|
-
align = "inline-start",
|
|
177
|
-
...props
|
|
178
|
-
}) {
|
|
179
|
-
return (
|
|
180
|
-
// biome-ignore lint/a11y/useSemanticElements: addon is a structural wrapper for grouped input affordances.
|
|
181
|
-
// biome-ignore lint/a11y/useKeyWithClickEvents: click only forwards focus to the sibling input and is not a standalone action target.
|
|
182
|
-
/* @__PURE__ */ jsx4(
|
|
183
|
-
"div",
|
|
184
|
-
{
|
|
185
|
-
role: "group",
|
|
186
|
-
"data-slot": "input-group-addon",
|
|
187
|
-
"data-align": align,
|
|
188
|
-
className: cn(inputGroupAddonVariants({ align }), className),
|
|
189
|
-
onClick: (e) => {
|
|
190
|
-
if (e.target.closest("button")) {
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
e.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
194
|
-
},
|
|
195
|
-
...props
|
|
196
|
-
}
|
|
197
|
-
)
|
|
198
|
-
);
|
|
199
|
-
}
|
|
200
|
-
var inputGroupButtonVariants = cva2(
|
|
201
|
-
"flex items-center gap-2 text-sm shadow-none rounded-full",
|
|
202
|
-
{
|
|
203
|
-
variants: {
|
|
204
|
-
size: {
|
|
205
|
-
xs: "h-6 gap-1 px-1.5 [&>svg:not([class*='size-'])]:size-3.5",
|
|
206
|
-
sm: "",
|
|
207
|
-
"icon-xs": "size-6 p-0 has-[>svg]:p-0",
|
|
208
|
-
"icon-sm": "size-8 p-0 has-[>svg]:p-0"
|
|
209
|
-
}
|
|
210
|
-
},
|
|
211
|
-
defaultVariants: {
|
|
212
|
-
size: "xs"
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
);
|
|
216
|
-
function InputGroupInput({
|
|
217
|
-
className,
|
|
218
|
-
size,
|
|
219
|
-
...props
|
|
220
|
-
}) {
|
|
221
|
-
return /* @__PURE__ */ jsx4(
|
|
222
|
-
Input,
|
|
223
|
-
{
|
|
224
|
-
"data-slot": "input-group-control",
|
|
225
|
-
size,
|
|
226
|
-
className: cn(
|
|
227
|
-
"flex-1 rounded-none border-0 bg-transparent shadow-none inset-shadow-none inset-ring-0 focus:border-transparent focus:shadow-none focus:inset-shadow-none focus-visible:border-transparent focus-visible:shadow-none focus-visible:ring-0 focus-visible:inset-ring-0 focus-visible:inset-shadow-none disabled:bg-transparent aria-invalid:ring-0 aria-invalid:inset-ring-0 dark:bg-transparent dark:disabled:bg-transparent",
|
|
228
|
-
className
|
|
229
|
-
),
|
|
230
|
-
...props
|
|
231
|
-
}
|
|
232
|
-
);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
// src/components/ui/popover.tsx
|
|
236
|
-
import { Popover as PopoverPrimitive } from "@base-ui/react/popover";
|
|
237
|
-
import { jsx as jsx5, jsxs } from "react/jsx-runtime";
|
|
238
|
-
function Popover({ ...props }) {
|
|
239
|
-
return /* @__PURE__ */ jsx5(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
240
|
-
}
|
|
241
|
-
function PopoverTrigger({ ...props }) {
|
|
242
|
-
return /* @__PURE__ */ jsx5(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
243
|
-
}
|
|
244
|
-
function PopoverContent({
|
|
245
|
-
className,
|
|
246
|
-
align = "center",
|
|
247
|
-
alignOffset = 0,
|
|
248
|
-
side = "bottom",
|
|
249
|
-
sideOffset = 6,
|
|
250
|
-
showArrow = true,
|
|
251
|
-
size = "md",
|
|
252
|
-
children,
|
|
253
|
-
...props
|
|
254
|
-
}) {
|
|
255
|
-
return /* @__PURE__ */ jsx5(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx5(
|
|
256
|
-
PopoverPrimitive.Positioner,
|
|
257
|
-
{
|
|
258
|
-
align,
|
|
259
|
-
alignOffset,
|
|
260
|
-
side,
|
|
261
|
-
sideOffset,
|
|
262
|
-
className: "isolate z-50",
|
|
263
|
-
children: /* @__PURE__ */ jsxs(
|
|
264
|
-
PopoverPrimitive.Popup,
|
|
265
|
-
{
|
|
266
|
-
"data-slot": "popover-content",
|
|
267
|
-
className: cn(
|
|
268
|
-
"z-50 relative flex w-72 max-w-[calc(100vw-2rem)] origin-(--transform-origin) flex-col rounded-lg border-0 bg-surface-overlay py-4 text-gdt-sm text-fg-primary shadow-2 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 has-[&_[data-slot=popover-footer]]:pb-0",
|
|
269
|
-
className
|
|
270
|
-
),
|
|
271
|
-
...props,
|
|
272
|
-
children: [
|
|
273
|
-
/* @__PURE__ */ jsx5(SizeProvider, { size, children }),
|
|
274
|
-
showArrow ? /* @__PURE__ */ jsx5(PopoverPrimitive.Arrow, { className: "relative block w-3 h-1.5 overflow-clip data-[side=bottom]:top-[-6px] data-[side=left]:right-[-9px] data-[side=left]:rotate-90 data-[side=right]:left-[-9px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-6px] data-[side=top]:rotate-180 before:content-[''] before:absolute before:bottom-0 before:left-1/2 before:w-[calc(6px*sqrt(2))] before:h-[calc(6px*sqrt(2))] before:bg-surface-overlay before:border before:border-line before:[transform:translate(-50%,50%)_rotate(45deg)]" }) : null
|
|
275
|
-
]
|
|
276
|
-
}
|
|
277
|
-
)
|
|
278
|
-
}
|
|
279
|
-
) });
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
// src/components/ui/separator.tsx
|
|
283
|
-
import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";
|
|
284
|
-
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
285
|
-
function Separator({
|
|
286
|
-
className,
|
|
287
|
-
orientation = "horizontal",
|
|
288
|
-
dashed = false,
|
|
289
|
-
shade = "feint",
|
|
290
|
-
thickness = "default",
|
|
291
|
-
...props
|
|
292
|
-
}) {
|
|
293
|
-
return /* @__PURE__ */ jsx6(
|
|
294
|
-
SeparatorPrimitive,
|
|
295
|
-
{
|
|
296
|
-
"data-slot": "separator",
|
|
297
|
-
orientation,
|
|
298
|
-
className: cn(
|
|
299
|
-
"shrink-0 data-horizontal:h-0 data-horizontal:w-full data-vertical:w-0 data-vertical:self-stretch",
|
|
300
|
-
// style
|
|
301
|
-
dashed ? "border-dashed" : "border-solid",
|
|
302
|
-
// shade
|
|
303
|
-
shade === "feint" && "border-line-subtle",
|
|
304
|
-
shade === "deep" && "border-line",
|
|
305
|
-
// thickness
|
|
306
|
-
thickness === "hairline" && "data-horizontal:border-t-[0.5px] data-vertical:border-l-[0.5px]",
|
|
307
|
-
thickness === "default" && "data-horizontal:border-t data-vertical:border-l",
|
|
308
|
-
thickness === "thick" && "data-horizontal:border-t-2 data-vertical:border-l-2",
|
|
309
|
-
thickness === "extra-thick" && "data-horizontal:border-t-[3px] data-vertical:border-l-[3px]",
|
|
310
|
-
className
|
|
311
|
-
),
|
|
312
|
-
...props
|
|
313
|
-
}
|
|
314
|
-
);
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
// src/components/ui/phone-input.tsx
|
|
318
|
-
import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
36
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
319
37
|
var regionNames = typeof Intl !== "undefined" && "DisplayNames" in Intl ? new Intl.DisplayNames(["en"], { type: "region" }) : void 0;
|
|
320
38
|
var COUNTRIES = getCountries().map((code) => ({
|
|
321
39
|
code,
|
|
@@ -355,7 +73,7 @@ function CountryFlag({
|
|
|
355
73
|
className
|
|
356
74
|
}) {
|
|
357
75
|
const Flag = flags[country];
|
|
358
|
-
return /* @__PURE__ */
|
|
76
|
+
return /* @__PURE__ */ jsx(
|
|
359
77
|
"span",
|
|
360
78
|
{
|
|
361
79
|
className: cn(
|
|
@@ -363,7 +81,83 @@ function CountryFlag({
|
|
|
363
81
|
flagSizeVariants[size],
|
|
364
82
|
className
|
|
365
83
|
),
|
|
366
|
-
children: Flag ? /* @__PURE__ */
|
|
84
|
+
children: Flag ? /* @__PURE__ */ jsx(Flag, { title: country }) : /* @__PURE__ */ jsx("span", { className: "text-gdt-xs text-fg-secondary", children: country })
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
var ROW_HEIGHT = 40;
|
|
89
|
+
var LIST_PADDING = 6;
|
|
90
|
+
var OVERSCAN = 6;
|
|
91
|
+
function CountryList({
|
|
92
|
+
items,
|
|
93
|
+
country,
|
|
94
|
+
onSelect
|
|
95
|
+
}) {
|
|
96
|
+
const scrollRef = React.useRef(null);
|
|
97
|
+
const [viewport, setViewport] = React.useState(256);
|
|
98
|
+
const [scrollTop, setScrollTop] = React.useState(() => {
|
|
99
|
+
const index = items.findIndex((entry) => entry.code === country);
|
|
100
|
+
return index > 0 ? index * ROW_HEIGHT : 0;
|
|
101
|
+
});
|
|
102
|
+
React.useLayoutEffect(() => {
|
|
103
|
+
const el = scrollRef.current;
|
|
104
|
+
if (!el) return;
|
|
105
|
+
setViewport(el.clientHeight);
|
|
106
|
+
el.scrollTop = scrollTop;
|
|
107
|
+
}, []);
|
|
108
|
+
if (items.length === 0) {
|
|
109
|
+
return /* @__PURE__ */ jsx("p", { className: "px-3.5 py-6 text-center text-gdt-sm text-fg-secondary", children: "No country found" });
|
|
110
|
+
}
|
|
111
|
+
const total = items.length;
|
|
112
|
+
const first = Math.max(0, Math.floor(scrollTop / ROW_HEIGHT) - OVERSCAN);
|
|
113
|
+
const last = Math.min(
|
|
114
|
+
total,
|
|
115
|
+
Math.ceil((scrollTop + viewport) / ROW_HEIGHT) + OVERSCAN
|
|
116
|
+
);
|
|
117
|
+
const visible = items.slice(first, last);
|
|
118
|
+
return /* @__PURE__ */ jsx(
|
|
119
|
+
"div",
|
|
120
|
+
{
|
|
121
|
+
ref: scrollRef,
|
|
122
|
+
onScroll: (event) => setScrollTop(event.currentTarget.scrollTop),
|
|
123
|
+
className: "no-scrollbar max-h-64 overflow-y-auto",
|
|
124
|
+
children: /* @__PURE__ */ jsx(
|
|
125
|
+
"div",
|
|
126
|
+
{
|
|
127
|
+
className: "relative w-full",
|
|
128
|
+
style: { height: total * ROW_HEIGHT + LIST_PADDING * 2 },
|
|
129
|
+
children: visible.map((entry, i) => {
|
|
130
|
+
const index = first + i;
|
|
131
|
+
const selected = entry.code === country;
|
|
132
|
+
return /* @__PURE__ */ jsxs(
|
|
133
|
+
"button",
|
|
134
|
+
{
|
|
135
|
+
type: "button",
|
|
136
|
+
style: {
|
|
137
|
+
position: "absolute",
|
|
138
|
+
top: index * ROW_HEIGHT + LIST_PADDING,
|
|
139
|
+
height: ROW_HEIGHT
|
|
140
|
+
},
|
|
141
|
+
onClick: () => onSelect(entry.code),
|
|
142
|
+
className: cn(
|
|
143
|
+
"flex w-full items-center gap-2.5 px-3.5 text-left text-gdt-sm outline-none transition-colors hover:bg-surface focus-visible:bg-surface",
|
|
144
|
+
selected ? "font-medium text-fg-brand" : "text-fg-primary"
|
|
145
|
+
),
|
|
146
|
+
children: [
|
|
147
|
+
/* @__PURE__ */ jsx(CountryFlag, { country: entry.code, size: "md" }),
|
|
148
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: entry.name }),
|
|
149
|
+
/* @__PURE__ */ jsxs("span", { className: "shrink-0 text-fg-secondary", children: [
|
|
150
|
+
"+",
|
|
151
|
+
entry.calling
|
|
152
|
+
] }),
|
|
153
|
+
selected && /* @__PURE__ */ jsx(CheckIcon, { className: "size-4 shrink-0 text-fg-brand" })
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
entry.code
|
|
157
|
+
);
|
|
158
|
+
})
|
|
159
|
+
}
|
|
160
|
+
)
|
|
367
161
|
}
|
|
368
162
|
);
|
|
369
163
|
}
|
|
@@ -371,16 +165,12 @@ function CountrySelect({
|
|
|
371
165
|
country,
|
|
372
166
|
size,
|
|
373
167
|
disabled,
|
|
374
|
-
onSelect
|
|
168
|
+
onSelect,
|
|
169
|
+
finalFocusRef
|
|
375
170
|
}) {
|
|
376
171
|
const [open, setOpen] = React.useState(false);
|
|
377
172
|
const [query, setQuery] = React.useState("");
|
|
378
173
|
const searchRef = React.useRef(null);
|
|
379
|
-
React.useEffect(() => {
|
|
380
|
-
if (!open) return;
|
|
381
|
-
const frame = requestAnimationFrame(() => searchRef.current?.focus());
|
|
382
|
-
return () => cancelAnimationFrame(frame);
|
|
383
|
-
}, [open]);
|
|
384
174
|
const filtered = React.useMemo(() => {
|
|
385
175
|
const q = query.trim().toLowerCase();
|
|
386
176
|
if (!q) return COUNTRIES;
|
|
@@ -393,8 +183,12 @@ function CountrySelect({
|
|
|
393
183
|
setOpen(next);
|
|
394
184
|
if (!next) setQuery("");
|
|
395
185
|
}
|
|
396
|
-
|
|
397
|
-
|
|
186
|
+
function handleSelect(next) {
|
|
187
|
+
onSelect(next);
|
|
188
|
+
handleOpenChange(false);
|
|
189
|
+
}
|
|
190
|
+
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: handleOpenChange, children: [
|
|
191
|
+
/* @__PURE__ */ jsxs(
|
|
398
192
|
PopoverTrigger,
|
|
399
193
|
{
|
|
400
194
|
disabled,
|
|
@@ -407,12 +201,12 @@ function CountrySelect({
|
|
|
407
201
|
size === "lg" && "text-gdt-md"
|
|
408
202
|
),
|
|
409
203
|
children: [
|
|
410
|
-
/* @__PURE__ */
|
|
411
|
-
/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ jsx(CountryFlag, { country, size }),
|
|
205
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
412
206
|
"+",
|
|
413
207
|
getCountryCallingCode(country)
|
|
414
208
|
] }),
|
|
415
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ jsx(
|
|
416
210
|
ChevronDownIcon,
|
|
417
211
|
{
|
|
418
212
|
className: cn(
|
|
@@ -425,18 +219,19 @@ function CountrySelect({
|
|
|
425
219
|
]
|
|
426
220
|
}
|
|
427
221
|
),
|
|
428
|
-
/* @__PURE__ */
|
|
222
|
+
/* @__PURE__ */ jsxs(
|
|
429
223
|
PopoverContent,
|
|
430
224
|
{
|
|
431
225
|
showArrow: false,
|
|
432
226
|
align: "start",
|
|
433
227
|
alignOffset: 0,
|
|
434
228
|
sideOffset: 10,
|
|
229
|
+
finalFocus: finalFocusRef,
|
|
435
230
|
className: "w-72 gap-0 overflow-hidden p-0",
|
|
436
231
|
children: [
|
|
437
|
-
/* @__PURE__ */
|
|
438
|
-
/* @__PURE__ */
|
|
439
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 border-b border-line-subtle px-3.5 py-2.5", children: [
|
|
233
|
+
/* @__PURE__ */ jsx(SearchIcon, { className: "size-4 shrink-0 text-fg-secondary" }),
|
|
234
|
+
/* @__PURE__ */ jsx(
|
|
440
235
|
"input",
|
|
441
236
|
{
|
|
442
237
|
ref: searchRef,
|
|
@@ -447,33 +242,15 @@ function CountrySelect({
|
|
|
447
242
|
}
|
|
448
243
|
)
|
|
449
244
|
] }),
|
|
450
|
-
/* @__PURE__ */
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
},
|
|
460
|
-
className: cn(
|
|
461
|
-
"flex w-full items-center gap-2.5 px-3.5 py-2 text-left text-gdt-sm outline-none transition-colors hover:bg-surface focus-visible:bg-surface",
|
|
462
|
-
selected ? "font-medium text-fg-brand" : "text-fg-primary"
|
|
463
|
-
),
|
|
464
|
-
children: [
|
|
465
|
-
/* @__PURE__ */ jsx7(CountryFlag, { country: entry.code, size: "md" }),
|
|
466
|
-
/* @__PURE__ */ jsx7("span", { className: "min-w-0 flex-1 truncate", children: entry.name }),
|
|
467
|
-
/* @__PURE__ */ jsxs2("span", { className: "shrink-0 text-fg-secondary", children: [
|
|
468
|
-
"+",
|
|
469
|
-
entry.calling
|
|
470
|
-
] }),
|
|
471
|
-
selected && /* @__PURE__ */ jsx7(CheckIcon, { className: "size-4 shrink-0 text-fg-brand" })
|
|
472
|
-
]
|
|
473
|
-
},
|
|
474
|
-
entry.code
|
|
475
|
-
);
|
|
476
|
-
}) })
|
|
245
|
+
/* @__PURE__ */ jsx(
|
|
246
|
+
CountryList,
|
|
247
|
+
{
|
|
248
|
+
items: filtered,
|
|
249
|
+
country,
|
|
250
|
+
onSelect: handleSelect
|
|
251
|
+
},
|
|
252
|
+
query
|
|
253
|
+
)
|
|
477
254
|
]
|
|
478
255
|
}
|
|
479
256
|
)
|
|
@@ -490,9 +267,19 @@ function PhoneInput({
|
|
|
490
267
|
className,
|
|
491
268
|
id,
|
|
492
269
|
name,
|
|
270
|
+
ref,
|
|
493
271
|
"aria-invalid": ariaInvalid
|
|
494
272
|
}) {
|
|
495
273
|
const resolvedSize = useComponentSize(size);
|
|
274
|
+
const inputRef = React.useRef(null);
|
|
275
|
+
const setInputRef = React.useCallback(
|
|
276
|
+
(node) => {
|
|
277
|
+
inputRef.current = node;
|
|
278
|
+
if (typeof ref === "function") ref(node);
|
|
279
|
+
else if (ref) ref.current = node;
|
|
280
|
+
},
|
|
281
|
+
[ref]
|
|
282
|
+
);
|
|
496
283
|
const initial = React.useMemo(() => parseValue(value), []);
|
|
497
284
|
const [country, setCountry] = React.useState(
|
|
498
285
|
initial.country ?? defaultCountry
|
|
@@ -528,18 +315,19 @@ function PhoneInput({
|
|
|
528
315
|
"group-has-[[aria-invalid=true]]/input-group:bg-line-danger",
|
|
529
316
|
"group-has-disabled/input-group:bg-line-subtle"
|
|
530
317
|
);
|
|
531
|
-
return /* @__PURE__ */
|
|
532
|
-
/* @__PURE__ */
|
|
533
|
-
/* @__PURE__ */
|
|
318
|
+
return /* @__PURE__ */ jsxs(InputGroup, { size: resolvedSize, className, children: [
|
|
319
|
+
/* @__PURE__ */ jsxs(InputGroupAddon, { align: "inline-start", className: "gap-2 self-stretch py-0", children: [
|
|
320
|
+
/* @__PURE__ */ jsx(
|
|
534
321
|
CountrySelect,
|
|
535
322
|
{
|
|
536
323
|
country,
|
|
537
324
|
size: resolvedSize,
|
|
538
325
|
disabled,
|
|
539
|
-
onSelect: handleCountrySelect
|
|
326
|
+
onSelect: handleCountrySelect,
|
|
327
|
+
finalFocusRef: inputRef
|
|
540
328
|
}
|
|
541
329
|
),
|
|
542
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ jsx(
|
|
543
331
|
Separator,
|
|
544
332
|
{
|
|
545
333
|
orientation: "vertical",
|
|
@@ -548,9 +336,10 @@ function PhoneInput({
|
|
|
548
336
|
}
|
|
549
337
|
)
|
|
550
338
|
] }),
|
|
551
|
-
/* @__PURE__ */
|
|
339
|
+
/* @__PURE__ */ jsx(
|
|
552
340
|
InputGroupInput,
|
|
553
341
|
{
|
|
342
|
+
ref: setInputRef,
|
|
554
343
|
id,
|
|
555
344
|
name,
|
|
556
345
|
type: "tel",
|