@getsoren/design-system 4.73.1 → 4.74.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.
@@ -0,0 +1,32 @@
1
+ export interface CountryOption {
2
+ /** ISO 3166-1 alpha-2 code — "FR" */
3
+ codeIso2: string;
4
+ /** Human-readable country name */
5
+ country: string;
6
+ /** International dialing prefix — "+33" */
7
+ phoneCode: string;
8
+ }
9
+ export interface CountryAutocompleteProps {
10
+ /** Options offered by the picker — the list (and its fetching) belongs to the consumer */
11
+ countries: CountryOption[];
12
+ /** Forwarded as `data-test` on the root element, for end-to-end selectors */
13
+ dataTest?: string;
14
+ /** ISO2 code shown while `value` is null, resolved from `countries` — e.g. the tenant's home country */
15
+ defaultCountryCode?: string;
16
+ /** Field label, already translated by the consumer (the design system only bundles en/fr) */
17
+ label: string;
18
+ /** Fires on user selection only — never for the resolved `defaultCountryCode` */
19
+ onChange: (country: CountryOption) => void;
20
+ /** Marks the field required (label asterisk) — validation itself belongs to the consumer */
21
+ required?: boolean;
22
+ /** Controlled selection; `null` shows `defaultCountryCode` (or nothing) until the user picks */
23
+ value: CountryOption | null;
24
+ /** Field width — the closed field only shows flag + ISO2 code, so its natural width is stable */
25
+ width?: number | string;
26
+ }
27
+ /**
28
+ * Country picker showing flag + ISO2 code, searchable by name, code or phone prefix.
29
+ * Purely presentational: the country list (and the label translation) belong to the consumer.
30
+ */
31
+ declare const CountryAutocomplete: ({ countries, dataTest, defaultCountryCode, label, onChange, required, value, width, }: CountryAutocompleteProps) => import("@emotion/react/jsx-runtime").JSX.Element;
32
+ export default CountryAutocomplete;
@@ -70,6 +70,8 @@ export type { ButtonProps } from './components/Inputs/Button';
70
70
  export { default as Button } from './components/Inputs/Button';
71
71
  export * from './components/Inputs/ChipFilter/ChipFilter';
72
72
  export { default as ChipFilter } from './components/Inputs/ChipFilter/ChipFilter';
73
+ export * from './components/Inputs/CountryAutocomplete/CountryAutocomplete';
74
+ export { default as CountryAutocomplete } from './components/Inputs/CountryAutocomplete/CountryAutocomplete';
73
75
  export * from './components/Inputs/File';
74
76
  export { default as File } from './components/Inputs/File';
75
77
  export * from './components/Inputs/QuantityField';
@@ -119,5 +121,6 @@ export * from './hooks/useTabs';
119
121
  export { default as useTabs } from './hooks/useTabs';
120
122
  export * from './utils/getBackgroundImageElevation';
121
123
  export { default as getBackgroundImageElevation } from './utils/getBackgroundImageElevation';
124
+ export { default as isoToEmojiFlag } from './utils/isoToEmojiFlag';
122
125
  export * from './utils/pxToRem';
123
126
  export { default as pxToRem } from './utils/pxToRem';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * ISO 3166-1 alpha-2 country code → regional-indicator emoji flag.
3
+ * Example: isoToEmojiFlag("FR") -> "🇫🇷"
4
+ * @param iso
5
+ */
6
+ declare const isoToEmojiFlag: (iso: string) => string;
7
+ export default isoToEmojiFlag;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@getsoren/design-system",
3
3
  "description": "Design System React library",
4
4
  "sideEffects": false,
5
- "version": "4.73.1",
5
+ "version": "4.74.0",
6
6
  "license": "ISC",
7
7
  "type": "module",
8
8
  "types": "./dist/src/main.d.ts",