- src/i18n/server.ts: createI18nConfig factory consolidating the locale resolution chain (cookie → access_token preferred_language claim → Accept-Language → default). Reusable across apps; previously each frontend reimplemented it. - AdminShell: thread signoutPath + myProfileUrl (default https://my.gosec.internal/profile) into the navbar; render My Profile link alongside logout. - LogoutButton: replace two-step fetch+signOut+redirect with a plain anchor pointing at signoutPath — the NextAuth POST-only signout endpoint plus form-CSRF flow doesn't need client JS. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
146 lines
2.6 KiB
TypeScript
146 lines
2.6 KiB
TypeScript
/**
|
|
* @gsc/web-kit/forms — form primitives + validation.
|
|
*
|
|
* Curated re-export from @limitless/ui. Apps import everything here
|
|
* instead of reaching into the lower layer:
|
|
*
|
|
* import { Form, FormGroup, FormControl, Select, SelectSingle,
|
|
* useValidation, required, email } from "@gsc/web-kit/forms";
|
|
*/
|
|
|
|
// Form primitives
|
|
export {
|
|
FormGroup,
|
|
FormControl,
|
|
FormCheck,
|
|
Select,
|
|
InputGroup,
|
|
} from "@limitless/ui";
|
|
export type {
|
|
FormGroupProps,
|
|
FormControlProps,
|
|
FormCheckProps,
|
|
SelectOption,
|
|
SelectProps,
|
|
InputGroupProps,
|
|
} from "@limitless/ui";
|
|
|
|
// Rich selects (react-select family — AdvancedSelect module)
|
|
export {
|
|
SelectSingle,
|
|
MultiSelect,
|
|
TagsSelect,
|
|
AsyncSelect,
|
|
} from "@limitless/ui";
|
|
export type {
|
|
SelectSingleProps,
|
|
SelectMultiProps,
|
|
CreatableSelectProps,
|
|
AsyncSelectProps,
|
|
} from "@limitless/ui";
|
|
|
|
// Rich inputs
|
|
export {
|
|
DatePicker,
|
|
ColorPicker,
|
|
TagInput,
|
|
FileUpload,
|
|
Slider,
|
|
Rating,
|
|
DualListBox,
|
|
ImageCropper,
|
|
} from "@limitless/ui";
|
|
|
|
// Multi-step
|
|
export { Wizard, Stepper } from "@limitless/ui";
|
|
|
|
// Validation — hooks (re-exported via @limitless/ui root: `export * from './validation'`)
|
|
export {
|
|
useValidation,
|
|
useFieldValidation,
|
|
useAddressAutocomplete,
|
|
} from "@limitless/ui";
|
|
|
|
// Validation — format validators
|
|
export {
|
|
required,
|
|
minLength,
|
|
maxLength,
|
|
pattern,
|
|
matches,
|
|
email,
|
|
url,
|
|
tel,
|
|
number,
|
|
range,
|
|
date,
|
|
time,
|
|
datetimeLocal,
|
|
month,
|
|
week,
|
|
color,
|
|
search,
|
|
password,
|
|
getPasswordStrength,
|
|
file,
|
|
checkbox,
|
|
radio,
|
|
} from "@limitless/ui";
|
|
|
|
// Validation — security
|
|
export {
|
|
noInjection,
|
|
noSqlInjection,
|
|
noScriptInjection,
|
|
noHtmlInjection,
|
|
noPromptInjection,
|
|
detectInjectionType,
|
|
SQL_INJECTION_PATTERNS,
|
|
SCRIPT_INJECTION_PATTERNS,
|
|
HTML_INJECTION_PATTERNS,
|
|
PROMPT_INJECTION_PATTERNS,
|
|
} from "@limitless/ui";
|
|
|
|
// Validation — address
|
|
export {
|
|
postalCode,
|
|
europeanPostalCode,
|
|
city,
|
|
streetAddress,
|
|
houseNumber,
|
|
europeanCountry,
|
|
europeanAddress,
|
|
getCountryName,
|
|
getPostalCodeHint,
|
|
POSTAL_CODE_PATTERNS,
|
|
EU_COUNTRIES,
|
|
EEA_COUNTRIES,
|
|
EUROPEAN_COUNTRIES,
|
|
} from "@limitless/ui";
|
|
|
|
// Validation — types
|
|
export type {
|
|
ValidationStatus,
|
|
ValidationResult,
|
|
FieldState,
|
|
FormState,
|
|
ValidatorFn,
|
|
FieldSchema,
|
|
FormSchema,
|
|
EuropeanAddress,
|
|
AddressSuggestion,
|
|
SecurityValidationOptions,
|
|
PasswordStrength,
|
|
PasswordOptions,
|
|
PhoneOptions,
|
|
NumberOptions,
|
|
DateOptions,
|
|
TimeOptions,
|
|
FileOptions,
|
|
UseValidationOptions,
|
|
UseFieldValidationOptions,
|
|
UseAddressAutocompleteOptions,
|
|
ServerValidationSchema,
|
|
ServerValidationResult,
|
|
} from "@limitless/ui";
|