@photon-ai/pho-ui 1.4.0 → 2.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/dist/chunks/IconAlertCircleFilled-VxKU8TYK.js +11 -0
- package/dist/chunks/IconAlertCircleFilled-VxKU8TYK.js.map +1 -0
- package/dist/chunks/IconArrowUpRight-DGgKzQwV.js +14 -0
- package/dist/chunks/IconArrowUpRight-DGgKzQwV.js.map +1 -0
- package/dist/chunks/IconChevronLeft-CSWMKQ4C.js +11 -0
- package/dist/chunks/IconChevronLeft-CSWMKQ4C.js.map +1 -0
- package/dist/chunks/IconInfoCircle-L0zfhg7R.js +21 -0
- package/dist/chunks/IconInfoCircle-L0zfhg7R.js.map +1 -0
- package/dist/chunks/animated-height-DhNSac85.js +50 -0
- package/dist/chunks/animated-height-DhNSac85.js.map +1 -0
- package/dist/chunks/basic-page-D1zm81YS.js +481 -0
- package/dist/chunks/basic-page-D1zm81YS.js.map +1 -0
- package/dist/chunks/{close-button-B8gF5UNk.js → button-X5wsWvRa.js} +127 -147
- package/dist/chunks/button-X5wsWvRa.js.map +1 -0
- package/dist/chunks/close-button-xadxp0j8.js +29 -0
- package/dist/chunks/close-button-xadxp0j8.js.map +1 -0
- package/dist/chunks/combobox-rLdS6fl-.js +117 -0
- package/dist/chunks/combobox-rLdS6fl-.js.map +1 -0
- package/dist/chunks/dialog-Caze1vkf.js +252 -0
- package/dist/chunks/dialog-Caze1vkf.js.map +1 -0
- package/dist/chunks/error-DR6G2LmG.js +251 -0
- package/dist/chunks/error-DR6G2LmG.js.map +1 -0
- package/dist/chunks/{input-CxS7ndpb.js → input-D3XQcC4J.js} +29 -31
- package/dist/chunks/input-D3XQcC4J.js.map +1 -0
- package/dist/chunks/{menu-BSXds3Rt.js → menu-BC-9IP29.js} +39 -39
- package/dist/chunks/menu-BC-9IP29.js.map +1 -0
- package/dist/chunks/popover-EL1SE1kj.js +46 -0
- package/dist/chunks/popover-EL1SE1kj.js.map +1 -0
- package/dist/chunks/{sidebar-DGpEKxOn.js → sidebar-DDJC1MeD.js} +72 -64
- package/dist/chunks/sidebar-DDJC1MeD.js.map +1 -0
- package/dist/components/button.js +13 -12
- package/dist/components/combobox.js +2 -114
- package/dist/components/command.js +242 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/context-menu.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/error.js +13 -0
- package/dist/components/input.js +1 -1
- package/dist/components/menu.js +1 -1
- package/dist/components/notification.js +27 -39
- package/dist/components/notification.js.map +1 -1
- package/dist/components/phone-input.js +17001 -0
- package/dist/components/phone-input.js.map +1 -0
- package/dist/components/popover.js +2 -43
- package/dist/components/toast.js.map +1 -1
- package/dist/index.js +62 -50
- package/dist/primitives.js +1 -1
- package/dist/sections/basic-page.js +1 -1
- package/dist/sections/sidebar.js +1 -1
- package/dist/src/components/command/command.d.ts +114 -0
- package/dist/src/components/command/index.d.ts +1 -0
- package/dist/src/components/dialog/dialog.d.ts +89 -1
- package/dist/src/components/drawer/drawer.d.ts +2 -2
- package/dist/src/components/error/error.d.ts +56 -0
- package/dist/src/components/error/index.d.ts +2 -0
- package/dist/src/components/error/problem.d.ts +80 -0
- package/dist/src/components/notification/notification.d.ts +1 -1
- package/dist/src/components/phone-input/country-alpha3.d.ts +250 -0
- package/dist/src/components/phone-input/country-search.d.ts +8 -0
- package/dist/src/components/phone-input/index.d.ts +1 -0
- package/dist/src/components/phone-input/phone-input.d.ts +47 -0
- package/dist/src/components/toast/toast.d.ts +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/sections/basic-page/basic-page.d.ts +165 -45
- package/dist/src/sections/sidebar/sidebar.d.ts +8 -3
- package/dist/src/utils/animated-height.d.ts +13 -0
- package/package.json +16 -5
- package/src/styles/theme.css +27 -0
- package/dist/chunks/basic-page-4_GZOvRr.js +0 -255
- package/dist/chunks/basic-page-4_GZOvRr.js.map +0 -1
- package/dist/chunks/close-button-B8gF5UNk.js.map +0 -1
- package/dist/chunks/dialog-Ba0UUE5g.js +0 -155
- package/dist/chunks/dialog-Ba0UUE5g.js.map +0 -1
- package/dist/chunks/input-CxS7ndpb.js.map +0 -1
- package/dist/chunks/menu-BSXds3Rt.js.map +0 -1
- package/dist/chunks/sidebar-DGpEKxOn.js.map +0 -1
- package/dist/components/alert-dialog.js +0 -59
- package/dist/components/alert-dialog.js.map +0 -1
- package/dist/components/combobox.js.map +0 -1
- package/dist/components/popover.js.map +0 -1
- package/dist/src/components/alert-dialog/alert-dialog.d.ts +0 -41
- package/dist/src/components/alert-dialog/index.d.ts +0 -1
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { CountryCode } from 'libphonenumber-js/min';
|
|
2
|
+
/** ISO 3166-1 alpha-3 for every country code `libphonenumber-js` exposes. */
|
|
3
|
+
export declare const COUNTRY_ALPHA3: {
|
|
4
|
+
readonly AC: "ASC";
|
|
5
|
+
readonly AD: "AND";
|
|
6
|
+
readonly AE: "ARE";
|
|
7
|
+
readonly AF: "AFG";
|
|
8
|
+
readonly AG: "ATG";
|
|
9
|
+
readonly AI: "AIA";
|
|
10
|
+
readonly AL: "ALB";
|
|
11
|
+
readonly AM: "ARM";
|
|
12
|
+
readonly AO: "AGO";
|
|
13
|
+
readonly AR: "ARG";
|
|
14
|
+
readonly AS: "ASM";
|
|
15
|
+
readonly AT: "AUT";
|
|
16
|
+
readonly AU: "AUS";
|
|
17
|
+
readonly AW: "ABW";
|
|
18
|
+
readonly AX: "ALA";
|
|
19
|
+
readonly AZ: "AZE";
|
|
20
|
+
readonly BA: "BIH";
|
|
21
|
+
readonly BB: "BRB";
|
|
22
|
+
readonly BD: "BGD";
|
|
23
|
+
readonly BE: "BEL";
|
|
24
|
+
readonly BF: "BFA";
|
|
25
|
+
readonly BG: "BGR";
|
|
26
|
+
readonly BH: "BHR";
|
|
27
|
+
readonly BI: "BDI";
|
|
28
|
+
readonly BJ: "BEN";
|
|
29
|
+
readonly BL: "BLM";
|
|
30
|
+
readonly BM: "BMU";
|
|
31
|
+
readonly BN: "BRN";
|
|
32
|
+
readonly BO: "BOL";
|
|
33
|
+
readonly BQ: "BES";
|
|
34
|
+
readonly BR: "BRA";
|
|
35
|
+
readonly BS: "BHS";
|
|
36
|
+
readonly BT: "BTN";
|
|
37
|
+
readonly BW: "BWA";
|
|
38
|
+
readonly BY: "BLR";
|
|
39
|
+
readonly BZ: "BLZ";
|
|
40
|
+
readonly CA: "CAN";
|
|
41
|
+
readonly CC: "CCK";
|
|
42
|
+
readonly CD: "COD";
|
|
43
|
+
readonly CF: "CAF";
|
|
44
|
+
readonly CG: "COG";
|
|
45
|
+
readonly CH: "CHE";
|
|
46
|
+
readonly CI: "CIV";
|
|
47
|
+
readonly CK: "COK";
|
|
48
|
+
readonly CL: "CHL";
|
|
49
|
+
readonly CM: "CMR";
|
|
50
|
+
readonly CN: "CHN";
|
|
51
|
+
readonly CO: "COL";
|
|
52
|
+
readonly CR: "CRI";
|
|
53
|
+
readonly CU: "CUB";
|
|
54
|
+
readonly CV: "CPV";
|
|
55
|
+
readonly CW: "CUW";
|
|
56
|
+
readonly CX: "CXR";
|
|
57
|
+
readonly CY: "CYP";
|
|
58
|
+
readonly CZ: "CZE";
|
|
59
|
+
readonly DE: "DEU";
|
|
60
|
+
readonly DJ: "DJI";
|
|
61
|
+
readonly DK: "DNK";
|
|
62
|
+
readonly DM: "DMA";
|
|
63
|
+
readonly DO: "DOM";
|
|
64
|
+
readonly DZ: "DZA";
|
|
65
|
+
readonly EC: "ECU";
|
|
66
|
+
readonly EE: "EST";
|
|
67
|
+
readonly EG: "EGY";
|
|
68
|
+
readonly EH: "ESH";
|
|
69
|
+
readonly ER: "ERI";
|
|
70
|
+
readonly ES: "ESP";
|
|
71
|
+
readonly ET: "ETH";
|
|
72
|
+
readonly FI: "FIN";
|
|
73
|
+
readonly FJ: "FJI";
|
|
74
|
+
readonly FK: "FLK";
|
|
75
|
+
readonly FM: "FSM";
|
|
76
|
+
readonly FO: "FRO";
|
|
77
|
+
readonly FR: "FRA";
|
|
78
|
+
readonly GA: "GAB";
|
|
79
|
+
readonly GB: "GBR";
|
|
80
|
+
readonly GD: "GRD";
|
|
81
|
+
readonly GE: "GEO";
|
|
82
|
+
readonly GF: "GUF";
|
|
83
|
+
readonly GG: "GGY";
|
|
84
|
+
readonly GH: "GHA";
|
|
85
|
+
readonly GI: "GIB";
|
|
86
|
+
readonly GL: "GRL";
|
|
87
|
+
readonly GM: "GMB";
|
|
88
|
+
readonly GN: "GIN";
|
|
89
|
+
readonly GP: "GLP";
|
|
90
|
+
readonly GQ: "GNQ";
|
|
91
|
+
readonly GR: "GRC";
|
|
92
|
+
readonly GT: "GTM";
|
|
93
|
+
readonly GU: "GUM";
|
|
94
|
+
readonly GW: "GNB";
|
|
95
|
+
readonly GY: "GUY";
|
|
96
|
+
readonly HK: "HKG";
|
|
97
|
+
readonly HN: "HND";
|
|
98
|
+
readonly HR: "HRV";
|
|
99
|
+
readonly HT: "HTI";
|
|
100
|
+
readonly HU: "HUN";
|
|
101
|
+
readonly ID: "IDN";
|
|
102
|
+
readonly IE: "IRL";
|
|
103
|
+
readonly IL: "ISR";
|
|
104
|
+
readonly IM: "IMN";
|
|
105
|
+
readonly IN: "IND";
|
|
106
|
+
readonly IO: "IOT";
|
|
107
|
+
readonly IQ: "IRQ";
|
|
108
|
+
readonly IR: "IRN";
|
|
109
|
+
readonly IS: "ISL";
|
|
110
|
+
readonly IT: "ITA";
|
|
111
|
+
readonly JE: "JEY";
|
|
112
|
+
readonly JM: "JAM";
|
|
113
|
+
readonly JO: "JOR";
|
|
114
|
+
readonly JP: "JPN";
|
|
115
|
+
readonly KE: "KEN";
|
|
116
|
+
readonly KG: "KGZ";
|
|
117
|
+
readonly KH: "KHM";
|
|
118
|
+
readonly KI: "KIR";
|
|
119
|
+
readonly KM: "COM";
|
|
120
|
+
readonly KN: "KNA";
|
|
121
|
+
readonly KP: "PRK";
|
|
122
|
+
readonly KR: "KOR";
|
|
123
|
+
readonly KW: "KWT";
|
|
124
|
+
readonly KY: "CYM";
|
|
125
|
+
readonly KZ: "KAZ";
|
|
126
|
+
readonly LA: "LAO";
|
|
127
|
+
readonly LB: "LBN";
|
|
128
|
+
readonly LC: "LCA";
|
|
129
|
+
readonly LI: "LIE";
|
|
130
|
+
readonly LK: "LKA";
|
|
131
|
+
readonly LR: "LBR";
|
|
132
|
+
readonly LS: "LSO";
|
|
133
|
+
readonly LT: "LTU";
|
|
134
|
+
readonly LU: "LUX";
|
|
135
|
+
readonly LV: "LVA";
|
|
136
|
+
readonly LY: "LBY";
|
|
137
|
+
readonly MA: "MAR";
|
|
138
|
+
readonly MC: "MCO";
|
|
139
|
+
readonly MD: "MDA";
|
|
140
|
+
readonly ME: "MNE";
|
|
141
|
+
readonly MF: "MAF";
|
|
142
|
+
readonly MG: "MDG";
|
|
143
|
+
readonly MH: "MHL";
|
|
144
|
+
readonly MK: "MKD";
|
|
145
|
+
readonly ML: "MLI";
|
|
146
|
+
readonly MM: "MMR";
|
|
147
|
+
readonly MN: "MNG";
|
|
148
|
+
readonly MO: "MAC";
|
|
149
|
+
readonly MP: "MNP";
|
|
150
|
+
readonly MQ: "MTQ";
|
|
151
|
+
readonly MR: "MRT";
|
|
152
|
+
readonly MS: "MSR";
|
|
153
|
+
readonly MT: "MLT";
|
|
154
|
+
readonly MU: "MUS";
|
|
155
|
+
readonly MV: "MDV";
|
|
156
|
+
readonly MW: "MWI";
|
|
157
|
+
readonly MX: "MEX";
|
|
158
|
+
readonly MY: "MYS";
|
|
159
|
+
readonly MZ: "MOZ";
|
|
160
|
+
readonly NA: "NAM";
|
|
161
|
+
readonly NC: "NCL";
|
|
162
|
+
readonly NE: "NER";
|
|
163
|
+
readonly NF: "NFK";
|
|
164
|
+
readonly NG: "NGA";
|
|
165
|
+
readonly NI: "NIC";
|
|
166
|
+
readonly NL: "NLD";
|
|
167
|
+
readonly NO: "NOR";
|
|
168
|
+
readonly NP: "NPL";
|
|
169
|
+
readonly NR: "NRU";
|
|
170
|
+
readonly NU: "NIU";
|
|
171
|
+
readonly NZ: "NZL";
|
|
172
|
+
readonly OM: "OMN";
|
|
173
|
+
readonly PA: "PAN";
|
|
174
|
+
readonly PE: "PER";
|
|
175
|
+
readonly PF: "PYF";
|
|
176
|
+
readonly PG: "PNG";
|
|
177
|
+
readonly PH: "PHL";
|
|
178
|
+
readonly PK: "PAK";
|
|
179
|
+
readonly PL: "POL";
|
|
180
|
+
readonly PM: "SPM";
|
|
181
|
+
readonly PR: "PRI";
|
|
182
|
+
readonly PS: "PSE";
|
|
183
|
+
readonly PT: "PRT";
|
|
184
|
+
readonly PW: "PLW";
|
|
185
|
+
readonly PY: "PRY";
|
|
186
|
+
readonly QA: "QAT";
|
|
187
|
+
readonly RE: "REU";
|
|
188
|
+
readonly RO: "ROU";
|
|
189
|
+
readonly RS: "SRB";
|
|
190
|
+
readonly RU: "RUS";
|
|
191
|
+
readonly RW: "RWA";
|
|
192
|
+
readonly SA: "SAU";
|
|
193
|
+
readonly SB: "SLB";
|
|
194
|
+
readonly SC: "SYC";
|
|
195
|
+
readonly SD: "SDN";
|
|
196
|
+
readonly SE: "SWE";
|
|
197
|
+
readonly SG: "SGP";
|
|
198
|
+
readonly SH: "SHN";
|
|
199
|
+
readonly SI: "SVN";
|
|
200
|
+
readonly SJ: "SJM";
|
|
201
|
+
readonly SK: "SVK";
|
|
202
|
+
readonly SL: "SLE";
|
|
203
|
+
readonly SM: "SMR";
|
|
204
|
+
readonly SN: "SEN";
|
|
205
|
+
readonly SO: "SOM";
|
|
206
|
+
readonly SR: "SUR";
|
|
207
|
+
readonly SS: "SSD";
|
|
208
|
+
readonly ST: "STP";
|
|
209
|
+
readonly SV: "SLV";
|
|
210
|
+
readonly SX: "SXM";
|
|
211
|
+
readonly SY: "SYR";
|
|
212
|
+
readonly SZ: "SWZ";
|
|
213
|
+
readonly TA: "TAA";
|
|
214
|
+
readonly TC: "TCA";
|
|
215
|
+
readonly TD: "TCD";
|
|
216
|
+
readonly TG: "TGO";
|
|
217
|
+
readonly TH: "THA";
|
|
218
|
+
readonly TJ: "TJK";
|
|
219
|
+
readonly TK: "TKL";
|
|
220
|
+
readonly TL: "TLS";
|
|
221
|
+
readonly TM: "TKM";
|
|
222
|
+
readonly TN: "TUN";
|
|
223
|
+
readonly TO: "TON";
|
|
224
|
+
readonly TR: "TUR";
|
|
225
|
+
readonly TT: "TTO";
|
|
226
|
+
readonly TV: "TUV";
|
|
227
|
+
readonly TW: "TWN";
|
|
228
|
+
readonly TZ: "TZA";
|
|
229
|
+
readonly UA: "UKR";
|
|
230
|
+
readonly UG: "UGA";
|
|
231
|
+
readonly US: "USA";
|
|
232
|
+
readonly UY: "URY";
|
|
233
|
+
readonly UZ: "UZB";
|
|
234
|
+
readonly VA: "VAT";
|
|
235
|
+
readonly VC: "VCT";
|
|
236
|
+
readonly VE: "VEN";
|
|
237
|
+
readonly VG: "VGB";
|
|
238
|
+
readonly VI: "VIR";
|
|
239
|
+
readonly VN: "VNM";
|
|
240
|
+
readonly VU: "VUT";
|
|
241
|
+
readonly WF: "WLF";
|
|
242
|
+
readonly WS: "WSM";
|
|
243
|
+
readonly XK: "XKX";
|
|
244
|
+
readonly YE: "YEM";
|
|
245
|
+
readonly YT: "MYT";
|
|
246
|
+
readonly ZA: "ZAF";
|
|
247
|
+
readonly ZM: "ZMB";
|
|
248
|
+
readonly ZW: "ZWE";
|
|
249
|
+
};
|
|
250
|
+
export declare function getCountryAlpha3(country: CountryCode): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CountryCode } from 'libphonenumber-js/min';
|
|
2
|
+
/**
|
|
3
|
+
* Fold a search string for accent-insensitive matching — `Åland` ↔ `aland`,
|
|
4
|
+
* `Côte` ↔ `cote`. NFD splits base letters from combining marks; we drop the
|
|
5
|
+
* marks and lowercase.
|
|
6
|
+
*/
|
|
7
|
+
export declare function foldSearch(value: string): string;
|
|
8
|
+
export declare function countrySearchAliases(country: CountryCode): readonly string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PhoneInput, type CountryCode, type PhoneInputChangeMeta, type PhoneInputProps, } from './phone-input';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { InputHTMLAttributes, ReactNode, Ref } from 'react';
|
|
2
|
+
import { CountryCode } from 'libphonenumber-js/min';
|
|
3
|
+
import { InputGroupSize } from '../input-group';
|
|
4
|
+
export type { CountryCode };
|
|
5
|
+
export interface PhoneInputChangeMeta {
|
|
6
|
+
country: CountryCode;
|
|
7
|
+
isValid: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface PhoneInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "value" | "defaultValue" | "onChange"> {
|
|
10
|
+
/** Controlled E.164 value (`+14155550123`), or `""` when empty. */
|
|
11
|
+
value?: string;
|
|
12
|
+
/** Uncontrolled initial E.164 value. */
|
|
13
|
+
defaultValue?: string;
|
|
14
|
+
/** Fires with the E.164 value (or `""`) and validity metadata. */
|
|
15
|
+
onValueChange?: (value: string, meta: PhoneInputChangeMeta) => void;
|
|
16
|
+
/** Country used when the value has no country. @default `"US"` */
|
|
17
|
+
defaultCountry?: CountryCode;
|
|
18
|
+
/** Countries offered in the picker. Defaults to every libphonenumber country. */
|
|
19
|
+
countries?: CountryCode[];
|
|
20
|
+
/**
|
|
21
|
+
* Pin the calling-code addon — flag + `+N` stay visible, but the country
|
|
22
|
+
* picker is replaced by a static label. Use when the number's region is
|
|
23
|
+
* already known (e.g. confirm-to-destroy flows).
|
|
24
|
+
*/
|
|
25
|
+
lockCountry?: boolean;
|
|
26
|
+
/** Size variant, matching Input / Input Group. @default `"md"` */
|
|
27
|
+
size?: InputGroupSize;
|
|
28
|
+
/** Render the invalid state (error ring + error-colored hint). */
|
|
29
|
+
invalid?: boolean;
|
|
30
|
+
/** Field label (associated for accessibility). */
|
|
31
|
+
label?: ReactNode;
|
|
32
|
+
/** Helper text below the field; rendered in the error color when `invalid`. */
|
|
33
|
+
hint?: ReactNode;
|
|
34
|
+
/** Node rendered at the right edge of the label row. */
|
|
35
|
+
labelTrailing?: ReactNode;
|
|
36
|
+
/** Class applied to the Input Group surface. */
|
|
37
|
+
wrapperClassName?: string;
|
|
38
|
+
ref?: Ref<HTMLInputElement>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Phone number field — country picker (searchable Combobox) + national number
|
|
42
|
+
* input on a shared Input Group surface. The committed value is always E.164.
|
|
43
|
+
*/
|
|
44
|
+
export declare function PhoneInput({ value, defaultValue, onValueChange, defaultCountry, countries: countriesProp, lockCountry, size, invalid, label, hint, labelTrailing, disabled, required, placeholder, className, wrapperClassName, id, ref, "aria-label": ariaLabel, onKeyDown, ...props }: PhoneInputProps): import("react").JSX.Element;
|
|
45
|
+
export declare namespace PhoneInput {
|
|
46
|
+
var displayName: string;
|
|
47
|
+
}
|
|
@@ -16,7 +16,7 @@ declare function Close({ className, ...props }: StyledProps<typeof BaseToast.Clo
|
|
|
16
16
|
* maps `useToastManager().toasts` to `Toast.Root`s, then call
|
|
17
17
|
* `useToastManager().add({ title, description })` to show one. Use a toast for
|
|
18
18
|
* confirmation of a background action; for a choice the user must make, use
|
|
19
|
-
* `
|
|
19
|
+
* `Dialog`.
|
|
20
20
|
*/
|
|
21
21
|
export declare const Toast: {
|
|
22
22
|
Provider: import('react').FC<import('@base-ui/react').ToastProviderProps>;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -12,5 +12,6 @@ export * from './components/input-group';
|
|
|
12
12
|
export * from './components/card';
|
|
13
13
|
export * from './components/dialog';
|
|
14
14
|
export * from './components/status-view';
|
|
15
|
+
export * from './components/error';
|
|
15
16
|
export * from './sections/sidebar';
|
|
16
17
|
export * from './sections/basic-page';
|
|
@@ -1,24 +1,7 @@
|
|
|
1
1
|
import { AnchorHTMLAttributes, ComponentProps, ReactNode, Ref } from 'react';
|
|
2
2
|
import { ButtonLinkProps } from '../../components/button';
|
|
3
|
-
/**
|
|
4
|
-
* BasicPage — Pho's standard content page: a page title, section titles, and
|
|
5
|
-
* bordered cards of label/control rows. Settings, billing, members — any
|
|
6
|
-
* single-column management surface.
|
|
7
|
-
*
|
|
8
|
-
* Spacing: wrap the page in `Root` (a 42rem column with `px-5` gutters,
|
|
9
|
-
* vertical padding). `Stack` separates blocks (`gap-10`). Inside a block,
|
|
10
|
-
* children share `gap-3`. Wrap a section title + description in `Header`
|
|
11
|
-
* (`gap-0.5`) so that pair stays tight — don't put them as loose siblings.
|
|
12
|
-
* Parts already carry `px-5`.
|
|
13
|
-
*
|
|
14
|
-
* Navigation: pages may drill into subpages. `RowLink` is a whole-row link
|
|
15
|
-
* (trailing chevron) and `Back` returns to the parent — both render through
|
|
16
|
-
* the host's `LinkProvider`; the URL itself stays the router's job. `Back`
|
|
17
|
-
* floats in `Root`'s top padding, so `Title` never moves between pages that
|
|
18
|
-
* have a back link and pages that don't.
|
|
19
|
-
*/
|
|
20
3
|
/** Bordered card that stacks rows with hairline dividers. */
|
|
21
|
-
export declare const BASIC_PAGE_CARD = "
|
|
4
|
+
export declare const BASIC_PAGE_CARD = "rounded-base border border-pho-secondary bg-pho-primary divide-y divide-pho-secondary [&>:has(+[data-basic-page-alert])]:border-b-0";
|
|
22
5
|
/**
|
|
23
6
|
* Standalone callout surface — featured block (invite form, notice, etc.).
|
|
24
7
|
* Don't wrap in `Card`; this is the outer chrome.
|
|
@@ -62,33 +45,84 @@ export declare const BASIC_PAGE_ITEM_PANEL_DIVIDED = "-mx-2 -mt-1.5 flex items-c
|
|
|
62
45
|
* so wide viewports render exactly as before while narrow ones keep a 20px
|
|
63
46
|
* breathing edge instead of running content into the viewport.
|
|
64
47
|
*
|
|
65
|
-
* `relative` anchors `Back`, which floats in the top padding
|
|
66
|
-
*
|
|
48
|
+
* `relative` anchors `Back`, which floats in the top padding. The top zone
|
|
49
|
+
* is conditional (`:has()`): pages carrying a `Back` reserve 64px for it;
|
|
50
|
+
* pages without one keep the tighter 48px so the title doesn't sit low.
|
|
51
|
+
*
|
|
52
|
+
* The column is also a `min-h-full` flex stack: when the host gives it a
|
|
53
|
+
* height context (an app shell's scroll pane), a full-page state can claim
|
|
54
|
+
* the leftover viewport with `flex-1` — `ErrorView className="flex-1"`
|
|
55
|
+
* centers itself vertically below the title. Hosts without a height context
|
|
56
|
+
* see a normal column; regular pages are unaffected.
|
|
57
|
+
*
|
|
58
|
+
* Root itself never animates — the page entrance lives on `Stack`, so
|
|
59
|
+
* `Title` and `Back` (the page chrome) stay put while the body below rises
|
|
60
|
+
* in.
|
|
67
61
|
*/
|
|
68
62
|
declare function Root({ className, ...props }: ComponentProps<"div"> & {
|
|
69
63
|
ref?: Ref<HTMLDivElement>;
|
|
70
64
|
}): import("react").JSX.Element;
|
|
65
|
+
export interface BasicPageTitleProps extends ComponentProps<"h1"> {
|
|
66
|
+
/**
|
|
67
|
+
* Shared-element key. Pair with the same `morphId` on the subpage's
|
|
68
|
+
* `Back` and the word morphs between title and back link across the
|
|
69
|
+
* navigation. Skipped under reduced motion.
|
|
70
|
+
*/
|
|
71
|
+
morphId?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Rise this title into its line on mount — for a subpage title whose line
|
|
74
|
+
* an inbound Title ↔ Back morph departs from. The moment the word lifts
|
|
75
|
+
* off, this title floats up from just below it (the Stack physics), so
|
|
76
|
+
* the two form one upward stream and never overlap. Skipped under
|
|
77
|
+
* reduced motion.
|
|
78
|
+
*/
|
|
79
|
+
enter?: boolean;
|
|
80
|
+
ref?: Ref<HTMLHeadingElement>;
|
|
81
|
+
}
|
|
71
82
|
/**
|
|
72
83
|
* Page title — largest heading on the surface. Plain-text children get a slug
|
|
73
84
|
* `id` for hash targets (`#profile`); the heading itself is not a link.
|
|
74
85
|
*/
|
|
75
|
-
declare function Title({ id, className, children, ...props }:
|
|
76
|
-
|
|
77
|
-
|
|
86
|
+
declare function Title({ id, morphId, enter, className, children, ...props }: BasicPageTitleProps): import("react").JSX.Element;
|
|
87
|
+
export interface BasicPageStackProps extends Omit<ComponentProps<"div">, RevealMotionConflicts> {
|
|
88
|
+
ref?: Ref<HTMLDivElement>;
|
|
89
|
+
}
|
|
78
90
|
/**
|
|
79
91
|
* Vertical stack under the page title. Blocks (forms / sections) use `gap-10`;
|
|
80
92
|
* each block lays out its children with `gap-3`.
|
|
93
|
+
*
|
|
94
|
+
* Mounting plays the page entrance: the stack rises 12px and fades in on the
|
|
95
|
+
* Card-shell / Command spring while `Title` / `Back` above stay put. What
|
|
96
|
+
* that means per state:
|
|
97
|
+
*
|
|
98
|
+
* - **Entering the page** — whatever the page first shows (skeleton
|
|
99
|
+
* included) rides in with its stack.
|
|
100
|
+
* - **Skeleton in a separate component** — swapping it for the loaded
|
|
101
|
+
* return mounts a fresh stack, so the entrance replays as the
|
|
102
|
+
* data-arrival animation. That's the right feel for shapes the skeleton
|
|
103
|
+
* couldn't predict (lists of unknown length).
|
|
104
|
+
* - **1:1 skeleton** — keep ONE stack mounted and branch its children
|
|
105
|
+
* (`{pending ? bones : content}`): values then fill in place with no
|
|
106
|
+
* motion.
|
|
107
|
+
*
|
|
108
|
+
* Static under reduced motion.
|
|
81
109
|
*/
|
|
82
|
-
declare function Stack({ className, ...props }:
|
|
83
|
-
ref?: Ref<HTMLDivElement>;
|
|
84
|
-
}): import("react").JSX.Element;
|
|
110
|
+
declare function Stack({ className, ...props }: BasicPageStackProps): import("react").JSX.Element;
|
|
85
111
|
/**
|
|
86
|
-
* Title + optional description pair.
|
|
87
|
-
*
|
|
112
|
+
* Title + optional description pair. No gap between them — the block's
|
|
113
|
+
* `gap-3` only applies between this header and the card.
|
|
88
114
|
*/
|
|
89
|
-
|
|
115
|
+
export interface BasicPageHeaderProps extends Omit<ComponentProps<"div">, RevealMotionConflicts> {
|
|
116
|
+
/**
|
|
117
|
+
* Rise this header into place on mount — the Header flavor of `Title`'s
|
|
118
|
+
* `enter`, for a subpage title that carries a description: the pair
|
|
119
|
+
* floats up from below the departing morph word as one block. Put `enter`
|
|
120
|
+
* here and NOT on the `Title` inside. Skipped under reduced motion.
|
|
121
|
+
*/
|
|
122
|
+
enter?: boolean;
|
|
90
123
|
ref?: Ref<HTMLDivElement>;
|
|
91
|
-
}
|
|
124
|
+
}
|
|
125
|
+
declare function Header({ enter, className, ...props }: BasicPageHeaderProps): import("react").JSX.Element;
|
|
92
126
|
/**
|
|
93
127
|
* Section heading — same padding as the page title, smaller type. Hashable via
|
|
94
128
|
* slug `id` (not a link).
|
|
@@ -111,10 +145,18 @@ declare function Description({ className, ...props }: ComponentProps<"p"> & {
|
|
|
111
145
|
declare function SectionFooter({ className, ...props }: ComponentProps<"p"> & {
|
|
112
146
|
ref?: Ref<HTMLParagraphElement>;
|
|
113
147
|
}): import("react").JSX.Element;
|
|
114
|
-
|
|
115
|
-
|
|
148
|
+
export interface BasicPageCardProps extends ComponentProps<"div"> {
|
|
149
|
+
/**
|
|
150
|
+
* Glide the card's height when its content swaps — bones becoming a
|
|
151
|
+
* different number of rows, a row created or revoked, an inline state
|
|
152
|
+
* change. The height follows the content on the page spring instead of
|
|
153
|
+
* jumping. Reserve it for cards whose contents change while mounted.
|
|
154
|
+
*/
|
|
155
|
+
animateHeight?: boolean;
|
|
116
156
|
ref?: Ref<HTMLDivElement>;
|
|
117
|
-
}
|
|
157
|
+
}
|
|
158
|
+
/** Bordered card that stacks rows with hairline dividers. */
|
|
159
|
+
declare function Card({ animateHeight, className, children, ...props }: BasicPageCardProps): import("react").JSX.Element;
|
|
118
160
|
/**
|
|
119
161
|
* One card row that can host subviews. Padding matches a plain row, so use it
|
|
120
162
|
* for any row that may grow an `ItemPanel` — primary content goes straight in
|
|
@@ -156,9 +198,15 @@ declare function ItemPanel({ divided, className, ...props }: BasicPageItemPanelP
|
|
|
156
198
|
* Standalone callout. Pair with `CalloutTitle` / `CalloutDescription` (and
|
|
157
199
|
* optional actions) for a featured block — e.g. an invite form. Do not wrap
|
|
158
200
|
* in `Card`; this is already the outer surface.
|
|
201
|
+
*
|
|
202
|
+
* Pass `icon` for a decorative glyph anchored to the header block (first
|
|
203
|
+
* child) — typically a Tabler outline icon. The icon is aria-hidden; keep
|
|
204
|
+
* meaning in the title/description.
|
|
159
205
|
*/
|
|
160
|
-
declare function Callout({ className, ...props }: ComponentProps<"div"> & {
|
|
206
|
+
declare function Callout({ className, icon, children, ...props }: ComponentProps<"div"> & {
|
|
161
207
|
ref?: Ref<HTMLDivElement>;
|
|
208
|
+
/** Decorative icon, top-right of the header (first child). */
|
|
209
|
+
icon?: ReactNode;
|
|
162
210
|
}): import("react").JSX.Element;
|
|
163
211
|
/** Callout heading — same type as `SectionTitle`. Hashable via slug `id`. */
|
|
164
212
|
declare function CalloutTitle({ id, className, children, ...props }: ComponentProps<"h2"> & {
|
|
@@ -175,25 +223,50 @@ export interface BasicPageRowProps extends Omit<ComponentProps<"div">, "title">
|
|
|
175
223
|
description?: ReactNode;
|
|
176
224
|
/** Associates the label with a control id. When omitted, the label is not a `<label>`. */
|
|
177
225
|
htmlFor?: string;
|
|
226
|
+
/**
|
|
227
|
+
* Stack the label above a full-width control instead of the default
|
|
228
|
+
* label-left / control-right layout at `sm+`. Keeps the compact `gap-3`
|
|
229
|
+
* rhythm — the default row's `justify-between` would otherwise stretch
|
|
230
|
+
* label and control apart under `min-h-[4.25rem]`.
|
|
231
|
+
*/
|
|
232
|
+
stacked?: boolean;
|
|
178
233
|
ref?: Ref<HTMLDivElement>;
|
|
179
234
|
}
|
|
180
235
|
/**
|
|
181
236
|
* One row: label (+ optional description) left, control right.
|
|
182
237
|
* Pass `htmlFor` when the row wraps a labelled input; omit it for display/
|
|
183
|
-
* action rows (avatar, danger-zone delete).
|
|
238
|
+
* action rows (avatar, danger-zone delete). Pass `stacked` for full-width
|
|
239
|
+
* controls that sit under the label.
|
|
184
240
|
*/
|
|
185
|
-
declare function Row({ label, description, htmlFor, className, children, ...props }: BasicPageRowProps): import("react").JSX.Element;
|
|
241
|
+
declare function Row({ label, description, htmlFor, stacked, className, children, ...props }: BasicPageRowProps): import("react").JSX.Element;
|
|
186
242
|
/** Read-only value on the right side of a row (email, etc.). */
|
|
187
243
|
declare function Value({ className, ...props }: ComponentProps<"p"> & {
|
|
188
244
|
ref?: Ref<HTMLParagraphElement>;
|
|
189
245
|
}): import("react").JSX.Element;
|
|
246
|
+
export interface BasicPageAlertProps extends Omit<ComponentProps<"div">, "children"> {
|
|
247
|
+
/** The caught value — a problem body, an `Error` wrapping one, or unknown. */
|
|
248
|
+
error?: unknown;
|
|
249
|
+
/** Override the derived message. */
|
|
250
|
+
children?: ReactNode;
|
|
251
|
+
/**
|
|
252
|
+
* Explicit presence override — defaults to whether there is anything to
|
|
253
|
+
* show, so the reveal plays as the mutation's error comes and goes.
|
|
254
|
+
*/
|
|
255
|
+
show?: boolean;
|
|
256
|
+
ref?: Ref<HTMLDivElement>;
|
|
257
|
+
}
|
|
190
258
|
/**
|
|
191
|
-
*
|
|
192
|
-
*
|
|
259
|
+
* Server error under a row, still inside the card — the partial failure
|
|
260
|
+
* ("Couldn't update your name"), rendered by `Error` from the problem body.
|
|
261
|
+
* Keep it mounted and pass the mutation's error: the line reveals and
|
|
262
|
+
* collapses on `Footer`'s height spring + fade. The card drops its divider
|
|
263
|
+
* above the line so it reads as part of the row it belongs to. Matches card
|
|
264
|
+
* horizontal padding — don't re-apply `px-5`.
|
|
265
|
+
*
|
|
266
|
+
* For a page that failed to load outright, swap the stack for an `ErrorView`
|
|
267
|
+
* instead.
|
|
193
268
|
*/
|
|
194
|
-
declare function Alert({ className, ...props }:
|
|
195
|
-
ref?: Ref<HTMLParagraphElement>;
|
|
196
|
-
}): import("react").JSX.Element;
|
|
269
|
+
declare function Alert({ error, show, className, children, ...props }: BasicPageAlertProps): import("react").JSX.Element;
|
|
197
270
|
export interface BasicPageFooterProps extends ComponentProps<"div"> {
|
|
198
271
|
/**
|
|
199
272
|
* Animated presence for dirty-state bars: the card glides open/closed on a
|
|
@@ -210,11 +283,56 @@ export interface BasicPageFooterProps extends ComponentProps<"div"> {
|
|
|
210
283
|
* out following the onboarding card's motion language.
|
|
211
284
|
*/
|
|
212
285
|
declare function Footer({ show, className, ...props }: BasicPageFooterProps): import("react").JSX.Element;
|
|
286
|
+
/**
|
|
287
|
+
* DOM handlers whose React signatures clash with Motion's gesture props of
|
|
288
|
+
* the same name on `motion.*` elements — excluded from `Reveal`'s public API
|
|
289
|
+
* (same policy as Button).
|
|
290
|
+
*/
|
|
291
|
+
type RevealMotionConflicts = "onAnimationStart" | "onAnimationEnd" | "onAnimationIteration" | "onDrag" | "onDragStart" | "onDragEnd" | "onDragEnter" | "onDragExit" | "onDragLeave" | "onDragOver" | "onDrop";
|
|
292
|
+
export interface BasicPageRevealProps extends Omit<ComponentProps<"div">, RevealMotionConflicts> {
|
|
293
|
+
/**
|
|
294
|
+
* Animated presence for a `Stack` block that comes and goes: keep the
|
|
295
|
+
* block mounted and drive it with `show` — it glides open and closed
|
|
296
|
+
* (height + fade) on the page spring, with the Stack's `gap-10`
|
|
297
|
+
* compensated so nothing jumps when it fully collapses. Omit `show` for
|
|
298
|
+
* the one-shot data-arrival entrance.
|
|
299
|
+
*/
|
|
300
|
+
show?: boolean;
|
|
301
|
+
/**
|
|
302
|
+
* Which gap the presence variant compensates while collapsing —
|
|
303
|
+
* `"stack"` for a Stack block (`gap-10`), `"block"` for an element
|
|
304
|
+
* inside a block (`gap-3`). @default "stack"
|
|
305
|
+
*/
|
|
306
|
+
gap?: "stack" | "block";
|
|
307
|
+
ref?: Ref<HTMLDivElement>;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Data-arrival entrance for regions whose shape the skeleton couldn't
|
|
311
|
+
* predict — a list of unknown length, a region that depends on the data.
|
|
312
|
+
* Wrap that region (keeping `Title` and 1:1 chrome outside): once the shape
|
|
313
|
+
* is known it rises 12px and fades in on the Card-shell / Command spring,
|
|
314
|
+
* the same physics as the `Footer` / `Alert` reveals. When the skeleton
|
|
315
|
+
* mirrors the loaded layout element for element, skip the reveal — values
|
|
316
|
+
* fill into a shape that never moves. The page *entrance* is separate and
|
|
317
|
+
* already built into `Stack`: whatever the page first shows (including the
|
|
318
|
+
* skeleton) rides that. Static under reduced motion.
|
|
319
|
+
*
|
|
320
|
+
* With `show`, Reveal becomes an animated-presence block instead (the
|
|
321
|
+
* `Footer` grammar): a whole section of the Stack that appears or leaves at
|
|
322
|
+
* runtime glides open/closed while its neighbours follow.
|
|
323
|
+
*/
|
|
324
|
+
declare function Reveal({ show, gap, className, ...props }: BasicPageRevealProps): import("react").JSX.Element;
|
|
213
325
|
export interface BasicPageBackProps extends Omit<ButtonLinkProps, "variant" | "size" | "shape" | "prefix" | "suffix" | "svgOnly" | "href"> {
|
|
214
326
|
/** Parent destination — rendered through the host's `LinkProvider`. */
|
|
215
327
|
href: string;
|
|
216
328
|
/** Label — name the parent page. @default "Back" */
|
|
217
329
|
children?: ReactNode;
|
|
330
|
+
/**
|
|
331
|
+
* Shared-element key. Pair with the same `morphId` on the parent page's
|
|
332
|
+
* `Title` and the word morphs between title and back link across the
|
|
333
|
+
* navigation. Skipped under reduced motion.
|
|
334
|
+
*/
|
|
335
|
+
morphId?: string;
|
|
218
336
|
}
|
|
219
337
|
/**
|
|
220
338
|
* Back link for a subpage — a small ghost `ButtonLink`; place inside `Root`,
|
|
@@ -226,11 +344,11 @@ export interface BasicPageBackProps extends Omit<ButtonLinkProps, "variant" | "s
|
|
|
226
344
|
* 40px in (`px-5` root gutter + `px-5` title pad); inside a `sm` ghost button
|
|
227
345
|
* the label sits 29.75px in (8px icon-side pad + 15.75px chevron, 1.125em at
|
|
228
346
|
* the 14px `text-base`, + 4px gap + 2px label-span `px-0.5`) — so `left` is
|
|
229
|
-
* the 10.25px difference. `top-
|
|
347
|
+
* the 10.25px difference. `top-4` centers the 32px button in the 64px
|
|
230
348
|
* reserved zone. The chevron and the ghost hover pill hang in the padding —
|
|
231
349
|
* the usual optical alignment for borderless controls.
|
|
232
350
|
*/
|
|
233
|
-
declare function Back({ href, className, children, ...props }: BasicPageBackProps): import("react").JSX.Element;
|
|
351
|
+
declare function Back({ href, className, morphId, children, ...props }: BasicPageBackProps): import("react").JSX.Element;
|
|
234
352
|
export interface BasicPageRowLinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "href" | "title"> {
|
|
235
353
|
/** Left-side field name — plain text, or compose with a trailing badge. */
|
|
236
354
|
label: ReactNode;
|
|
@@ -246,7 +364,8 @@ export interface BasicPageRowLinkProps extends Omit<AnchorHTMLAttributes<HTMLAnc
|
|
|
246
364
|
}
|
|
247
365
|
/**
|
|
248
366
|
* A row that navigates — the whole row is one link into a subpage, with a
|
|
249
|
-
* trailing chevron cue.
|
|
367
|
+
* trailing chevron cue. Always horizontal: a column stack would park the
|
|
368
|
+
* chevron under the label on narrow viewports. Hover lifts the row, and
|
|
250
369
|
* first/last rows follow the card's corner radius.
|
|
251
370
|
*/
|
|
252
371
|
declare function RowLink({ label, description, leading, href, className, children, ...props }: BasicPageRowLinkProps): import("react").JSX.Element;
|
|
@@ -279,7 +398,7 @@ declare function RowLink({ label, description, leading, href, className, childre
|
|
|
279
398
|
* </BasicPage.Row>
|
|
280
399
|
* </BasicPage.Card>
|
|
281
400
|
* </div>
|
|
282
|
-
* <BasicPage.Callout>
|
|
401
|
+
* <BasicPage.Callout icon={<IconMail stroke={1.25} />}>
|
|
283
402
|
* <BasicPage.Header>
|
|
284
403
|
* <BasicPage.CalloutTitle>Invitations</BasicPage.CalloutTitle>
|
|
285
404
|
* <BasicPage.CalloutDescription>…</BasicPage.CalloutDescription>
|
|
@@ -328,5 +447,6 @@ export declare const BasicPage: {
|
|
|
328
447
|
Value: typeof Value;
|
|
329
448
|
Alert: typeof Alert;
|
|
330
449
|
Footer: typeof Footer;
|
|
450
|
+
Reveal: typeof Reveal;
|
|
331
451
|
};
|
|
332
452
|
export {};
|