design-zystem 1.0.311 → 1.0.312
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/index.d.mts +53 -1
- package/dist/index.d.ts +53 -1
- package/dist/index.js +40 -12
- package/dist/index.mjs +38 -12
- package/dist/ui/index.d.mts +53 -1
- package/dist/ui/index.d.ts +53 -1
- package/dist/ui/index.js +46 -16
- package/dist/ui/index.mjs +44 -16
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1387,4 +1387,56 @@ declare const formatKM: (value: string | number | null | undefined) => string;
|
|
|
1387
1387
|
|
|
1388
1388
|
declare const parseAmount: (value: string) => number | null;
|
|
1389
1389
|
|
|
1390
|
-
|
|
1390
|
+
/**
|
|
1391
|
+
* Attributs qui neutralisent l'autofill du navigateur **et** des gestionnaires
|
|
1392
|
+
* de mots de passe (1Password, LastPass, Bitwarden, Dashlane) sur un champ.
|
|
1393
|
+
*
|
|
1394
|
+
* Appliqués par défaut par les champs du DS : sans ça, un coffre-fort réécrit
|
|
1395
|
+
* à l'ouverture d'une page les valeurs déjà présentes dans le formulaire
|
|
1396
|
+
* (fiche existante en édition), silencieusement.
|
|
1397
|
+
*
|
|
1398
|
+
* `autoComplete: 'off'` seul ne suffit pas : les extensions l'ignorent, chacune
|
|
1399
|
+
* a son propre attribut d'opt-out.
|
|
1400
|
+
*
|
|
1401
|
+
* Étalés **avant** les props du consommateur : un champ qui a besoin de
|
|
1402
|
+
* l'autofill (page de login) surcharge ce qu'il veut, y compris en repassant
|
|
1403
|
+
* `undefined` sur un `data-*` pour le retirer.
|
|
1404
|
+
*
|
|
1405
|
+
* @example
|
|
1406
|
+
* <input {...noAutofillProps} {...props} />
|
|
1407
|
+
* // login : <Input autoComplete="username" data-1p-ignore={undefined} />
|
|
1408
|
+
*/
|
|
1409
|
+
declare const noAutofillProps: {
|
|
1410
|
+
readonly autoComplete: "off";
|
|
1411
|
+
/** 1Password */
|
|
1412
|
+
readonly 'data-1p-ignore': true;
|
|
1413
|
+
/** LastPass */
|
|
1414
|
+
readonly 'data-lpignore': "true";
|
|
1415
|
+
/** Bitwarden */
|
|
1416
|
+
readonly 'data-bwignore': true;
|
|
1417
|
+
/** Dashlane */
|
|
1418
|
+
readonly 'data-form-type': "other";
|
|
1419
|
+
};
|
|
1420
|
+
/**
|
|
1421
|
+
* Inverse de {@link noAutofillProps} : réautorise l'autofill sur un champ
|
|
1422
|
+
* précis, en neutralisant les `data-*` d'opt-out posés par défaut.
|
|
1423
|
+
*
|
|
1424
|
+
* À réserver aux champs où l'autofill est *voulu* : login, changement de mot
|
|
1425
|
+
* de passe. Partout ailleurs, le défaut du DS est le bon comportement.
|
|
1426
|
+
*
|
|
1427
|
+
* @param autoComplete valeur HTML `autocomplete` du champ — `username`,
|
|
1428
|
+
* `current-password`, `new-password`, `email`…
|
|
1429
|
+
*
|
|
1430
|
+
* @example
|
|
1431
|
+
* <Input type="text" {...allowAutofill('username')} />
|
|
1432
|
+
* <PasswordInput {...allowAutofill('current-password')} />
|
|
1433
|
+
*/
|
|
1434
|
+
declare const allowAutofill: (autoComplete: string) => {
|
|
1435
|
+
autoComplete: string;
|
|
1436
|
+
"data-1p-ignore": undefined;
|
|
1437
|
+
"data-lpignore": undefined;
|
|
1438
|
+
"data-bwignore": undefined;
|
|
1439
|
+
"data-form-type": undefined;
|
|
1440
|
+
};
|
|
1441
|
+
|
|
1442
|
+
export { Accordion, type AccordionItem, Avatar, Banner, type BannerAction, type BannerProps, Box, Bubble, Bulk, Button, Card, type CardProps, CardSkeleton, Checkbox, Col, Collapse, ColorPicker, DatePicker, type DatePickerProps, type DatePreset, Divider, Drawer, EmptyState, FileUploadZone, type FloatingAction, FloatingButton, type FloatingButtonProps, Gantt, type GanttBand, type GanttBar, type GanttDay, GanttDot, type GanttProps, type GanttRow, GanttSwatch, Grid, Icon, IconTabs, Image, Input, Link, List, ListItem, MetricCard, Modal, ModalConfirmation, MultiSelect, NewModal, Options, PageContainer, Pagination, type PastelColorPair, Popover, ProgressBar, type ProgressBarProps, type ProgressBarSegment, Radio, Row, Select, type SelectOption, type SelectProps, SkeletonRow, SliderInput, type SortOrder, Spinner, Stepper, Switch, Table, TableBody, TableCell, TableFooter, TableFooterCell, TableFooterRow, TableHeader, TableHeaderCell, type TableHeaderCellProps, TableHeaderRow, TableRow, Tabs, TagBubble, Text, Timeline, type TimelineItem, type ToastOptions, type ToastType, Toaster, Tooltip, addBusinessDays, allowAutofill, appendCacheBuster, appendQueryParam, capitalizeFirstLetter, colors, easterDate, formatAddress, formatCityFromFormattedAddress, formatCityWithPostalCode, formatDate, formatDateWithTime, formatDistance, formatDuration, formatEuro, formatKM, formatLocality, formatName, formatNameWithInitial, formatPhoneNumber, formatPlate, formatPlateWithoutDashes, formatPostalCodeFromFormattedAddress, formatRegionCode, formatTime, formatVin, generateHexColor, getAvatarColor, getCleanFileName, getElapsedTime, getFileIconByMimeType, getFileKind, getFileNameFromUrl, getInitials, getMimeCategory, getPastelColorPair, getRelativeTime, isHoliday, isSameDay, isolateCity, noAutofillProps, optimizeImage, parseAmount, parseIsoDate, toast, truncateFileName, truncateText };
|
package/dist/index.d.ts
CHANGED
|
@@ -1387,4 +1387,56 @@ declare const formatKM: (value: string | number | null | undefined) => string;
|
|
|
1387
1387
|
|
|
1388
1388
|
declare const parseAmount: (value: string) => number | null;
|
|
1389
1389
|
|
|
1390
|
-
|
|
1390
|
+
/**
|
|
1391
|
+
* Attributs qui neutralisent l'autofill du navigateur **et** des gestionnaires
|
|
1392
|
+
* de mots de passe (1Password, LastPass, Bitwarden, Dashlane) sur un champ.
|
|
1393
|
+
*
|
|
1394
|
+
* Appliqués par défaut par les champs du DS : sans ça, un coffre-fort réécrit
|
|
1395
|
+
* à l'ouverture d'une page les valeurs déjà présentes dans le formulaire
|
|
1396
|
+
* (fiche existante en édition), silencieusement.
|
|
1397
|
+
*
|
|
1398
|
+
* `autoComplete: 'off'` seul ne suffit pas : les extensions l'ignorent, chacune
|
|
1399
|
+
* a son propre attribut d'opt-out.
|
|
1400
|
+
*
|
|
1401
|
+
* Étalés **avant** les props du consommateur : un champ qui a besoin de
|
|
1402
|
+
* l'autofill (page de login) surcharge ce qu'il veut, y compris en repassant
|
|
1403
|
+
* `undefined` sur un `data-*` pour le retirer.
|
|
1404
|
+
*
|
|
1405
|
+
* @example
|
|
1406
|
+
* <input {...noAutofillProps} {...props} />
|
|
1407
|
+
* // login : <Input autoComplete="username" data-1p-ignore={undefined} />
|
|
1408
|
+
*/
|
|
1409
|
+
declare const noAutofillProps: {
|
|
1410
|
+
readonly autoComplete: "off";
|
|
1411
|
+
/** 1Password */
|
|
1412
|
+
readonly 'data-1p-ignore': true;
|
|
1413
|
+
/** LastPass */
|
|
1414
|
+
readonly 'data-lpignore': "true";
|
|
1415
|
+
/** Bitwarden */
|
|
1416
|
+
readonly 'data-bwignore': true;
|
|
1417
|
+
/** Dashlane */
|
|
1418
|
+
readonly 'data-form-type': "other";
|
|
1419
|
+
};
|
|
1420
|
+
/**
|
|
1421
|
+
* Inverse de {@link noAutofillProps} : réautorise l'autofill sur un champ
|
|
1422
|
+
* précis, en neutralisant les `data-*` d'opt-out posés par défaut.
|
|
1423
|
+
*
|
|
1424
|
+
* À réserver aux champs où l'autofill est *voulu* : login, changement de mot
|
|
1425
|
+
* de passe. Partout ailleurs, le défaut du DS est le bon comportement.
|
|
1426
|
+
*
|
|
1427
|
+
* @param autoComplete valeur HTML `autocomplete` du champ — `username`,
|
|
1428
|
+
* `current-password`, `new-password`, `email`…
|
|
1429
|
+
*
|
|
1430
|
+
* @example
|
|
1431
|
+
* <Input type="text" {...allowAutofill('username')} />
|
|
1432
|
+
* <PasswordInput {...allowAutofill('current-password')} />
|
|
1433
|
+
*/
|
|
1434
|
+
declare const allowAutofill: (autoComplete: string) => {
|
|
1435
|
+
autoComplete: string;
|
|
1436
|
+
"data-1p-ignore": undefined;
|
|
1437
|
+
"data-lpignore": undefined;
|
|
1438
|
+
"data-bwignore": undefined;
|
|
1439
|
+
"data-form-type": undefined;
|
|
1440
|
+
};
|
|
1441
|
+
|
|
1442
|
+
export { Accordion, type AccordionItem, Avatar, Banner, type BannerAction, type BannerProps, Box, Bubble, Bulk, Button, Card, type CardProps, CardSkeleton, Checkbox, Col, Collapse, ColorPicker, DatePicker, type DatePickerProps, type DatePreset, Divider, Drawer, EmptyState, FileUploadZone, type FloatingAction, FloatingButton, type FloatingButtonProps, Gantt, type GanttBand, type GanttBar, type GanttDay, GanttDot, type GanttProps, type GanttRow, GanttSwatch, Grid, Icon, IconTabs, Image, Input, Link, List, ListItem, MetricCard, Modal, ModalConfirmation, MultiSelect, NewModal, Options, PageContainer, Pagination, type PastelColorPair, Popover, ProgressBar, type ProgressBarProps, type ProgressBarSegment, Radio, Row, Select, type SelectOption, type SelectProps, SkeletonRow, SliderInput, type SortOrder, Spinner, Stepper, Switch, Table, TableBody, TableCell, TableFooter, TableFooterCell, TableFooterRow, TableHeader, TableHeaderCell, type TableHeaderCellProps, TableHeaderRow, TableRow, Tabs, TagBubble, Text, Timeline, type TimelineItem, type ToastOptions, type ToastType, Toaster, Tooltip, addBusinessDays, allowAutofill, appendCacheBuster, appendQueryParam, capitalizeFirstLetter, colors, easterDate, formatAddress, formatCityFromFormattedAddress, formatCityWithPostalCode, formatDate, formatDateWithTime, formatDistance, formatDuration, formatEuro, formatKM, formatLocality, formatName, formatNameWithInitial, formatPhoneNumber, formatPlate, formatPlateWithoutDashes, formatPostalCodeFromFormattedAddress, formatRegionCode, formatTime, formatVin, generateHexColor, getAvatarColor, getCleanFileName, getElapsedTime, getFileIconByMimeType, getFileKind, getFileNameFromUrl, getInitials, getMimeCategory, getPastelColorPair, getRelativeTime, isHoliday, isSameDay, isolateCity, noAutofillProps, optimizeImage, parseAmount, parseIsoDate, toast, truncateFileName, truncateText };
|
package/dist/index.js
CHANGED
|
@@ -124,6 +124,7 @@ __export(index_exports, {
|
|
|
124
124
|
Toaster: () => Toaster,
|
|
125
125
|
Tooltip: () => Tooltip,
|
|
126
126
|
addBusinessDays: () => addBusinessDays,
|
|
127
|
+
allowAutofill: () => allowAutofill,
|
|
127
128
|
appendCacheBuster: () => appendCacheBuster,
|
|
128
129
|
appendQueryParam: () => appendQueryParam,
|
|
129
130
|
capitalizeFirstLetter: () => capitalizeFirstLetter,
|
|
@@ -162,6 +163,7 @@ __export(index_exports, {
|
|
|
162
163
|
isHoliday: () => isHoliday,
|
|
163
164
|
isSameDay: () => isSameDay,
|
|
164
165
|
isolateCity: () => isolateCity,
|
|
166
|
+
noAutofillProps: () => noAutofillProps,
|
|
165
167
|
optimizeImage: () => optimizeImage_default,
|
|
166
168
|
parseAmount: () => parseAmount,
|
|
167
169
|
parseIsoDate: () => parseIsoDate,
|
|
@@ -2536,6 +2538,28 @@ var Avatar = ({
|
|
|
2536
2538
|
var import_react12 = require("react");
|
|
2537
2539
|
var import_react_dom2 = __toESM(require("react-dom"));
|
|
2538
2540
|
var import_styled_components20 = __toESM(require("styled-components"));
|
|
2541
|
+
|
|
2542
|
+
// src/ui/lib/autofill.ts
|
|
2543
|
+
var noAutofillProps = {
|
|
2544
|
+
autoComplete: "off",
|
|
2545
|
+
/** 1Password */
|
|
2546
|
+
"data-1p-ignore": true,
|
|
2547
|
+
/** LastPass */
|
|
2548
|
+
"data-lpignore": "true",
|
|
2549
|
+
/** Bitwarden */
|
|
2550
|
+
"data-bwignore": true,
|
|
2551
|
+
/** Dashlane */
|
|
2552
|
+
"data-form-type": "other"
|
|
2553
|
+
};
|
|
2554
|
+
var allowAutofill = (autoComplete) => ({
|
|
2555
|
+
autoComplete,
|
|
2556
|
+
"data-1p-ignore": void 0,
|
|
2557
|
+
"data-lpignore": void 0,
|
|
2558
|
+
"data-bwignore": void 0,
|
|
2559
|
+
"data-form-type": void 0
|
|
2560
|
+
});
|
|
2561
|
+
|
|
2562
|
+
// src/ui-legacy/Components/Select/Select.tsx
|
|
2539
2563
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2540
2564
|
var StyledContainer = import_styled_components20.default.div.withConfig({
|
|
2541
2565
|
shouldForwardProp: (prop) => !["width", "noFlex", "label"].includes(prop)
|
|
@@ -2771,13 +2795,14 @@ var Select = ({
|
|
|
2771
2795
|
children: [
|
|
2772
2796
|
!hideSearchBar && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2773
2797
|
SearchInput,
|
|
2774
|
-
{
|
|
2798
|
+
__spreadProps(__spreadValues({
|
|
2775
2799
|
ref: searchInputRef,
|
|
2776
2800
|
type: "text",
|
|
2777
|
-
placeholder: "Rechercher..."
|
|
2801
|
+
placeholder: "Rechercher..."
|
|
2802
|
+
}, noAutofillProps), {
|
|
2778
2803
|
value: searchTerm,
|
|
2779
2804
|
onChange: handleSearch
|
|
2780
|
-
}
|
|
2805
|
+
})
|
|
2781
2806
|
),
|
|
2782
2807
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropdownList, { children: filteredOptions.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2783
2808
|
Option,
|
|
@@ -3144,12 +3169,12 @@ var Input = (0, import_react13.forwardRef)((props, ref) => {
|
|
|
3144
3169
|
isDate ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
3145
3170
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3146
3171
|
StyledInput,
|
|
3147
|
-
__spreadProps(__spreadValues({
|
|
3172
|
+
__spreadProps(__spreadValues(__spreadProps(__spreadValues({
|
|
3148
3173
|
id: inputId,
|
|
3149
3174
|
ref: innerRef,
|
|
3150
3175
|
type: "text",
|
|
3151
|
-
inputMode: "numeric"
|
|
3152
|
-
|
|
3176
|
+
inputMode: "numeric"
|
|
3177
|
+
}, noAutofillProps), {
|
|
3153
3178
|
value: displayDateValue,
|
|
3154
3179
|
onChange: handleDateInputChange,
|
|
3155
3180
|
onPaste: handleDateInputPaste,
|
|
@@ -3159,7 +3184,7 @@ var Input = (0, import_react13.forwardRef)((props, ref) => {
|
|
|
3159
3184
|
disabled,
|
|
3160
3185
|
"aria-required": required || void 0,
|
|
3161
3186
|
style: computedStyle
|
|
3162
|
-
}, forwardProps), {
|
|
3187
|
+
}), forwardProps), {
|
|
3163
3188
|
name: void 0,
|
|
3164
3189
|
min: void 0,
|
|
3165
3190
|
max: void 0,
|
|
@@ -3203,7 +3228,7 @@ var Input = (0, import_react13.forwardRef)((props, ref) => {
|
|
|
3203
3228
|
)
|
|
3204
3229
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3205
3230
|
Component,
|
|
3206
|
-
__spreadValues({
|
|
3231
|
+
__spreadValues(__spreadValues(__spreadValues({
|
|
3207
3232
|
id: inputId,
|
|
3208
3233
|
ref: innerRef,
|
|
3209
3234
|
type: isPassword ? showPassword ? "text" : "password" : type,
|
|
@@ -3215,7 +3240,7 @@ var Input = (0, import_react13.forwardRef)((props, ref) => {
|
|
|
3215
3240
|
disabled,
|
|
3216
3241
|
name: inputName,
|
|
3217
3242
|
style: computedStyle
|
|
3218
|
-
}, forwardProps)
|
|
3243
|
+
}, noAutofillProps), isPassword ? { autoComplete: "new-password" } : {}), forwardProps)
|
|
3219
3244
|
),
|
|
3220
3245
|
isPassword && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3221
3246
|
EyeButton,
|
|
@@ -3623,14 +3648,15 @@ var ColorPicker = (0, import_react17.forwardRef)(
|
|
|
3623
3648
|
) }) }),
|
|
3624
3649
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3625
3650
|
HexInput,
|
|
3626
|
-
{
|
|
3651
|
+
__spreadProps(__spreadValues({
|
|
3627
3652
|
type: "text",
|
|
3628
|
-
value: currentColor
|
|
3653
|
+
value: currentColor
|
|
3654
|
+
}, noAutofillProps), {
|
|
3629
3655
|
onChange: handleChange,
|
|
3630
3656
|
disabled,
|
|
3631
3657
|
$fontSize: dims.fontSize,
|
|
3632
3658
|
$padding: dims.inputPadding
|
|
3633
|
-
}
|
|
3659
|
+
})
|
|
3634
3660
|
)
|
|
3635
3661
|
] })
|
|
3636
3662
|
] });
|
|
@@ -7543,6 +7569,7 @@ var parseAmount = (value) => {
|
|
|
7543
7569
|
Toaster,
|
|
7544
7570
|
Tooltip,
|
|
7545
7571
|
addBusinessDays,
|
|
7572
|
+
allowAutofill,
|
|
7546
7573
|
appendCacheBuster,
|
|
7547
7574
|
appendQueryParam,
|
|
7548
7575
|
capitalizeFirstLetter,
|
|
@@ -7581,6 +7608,7 @@ var parseAmount = (value) => {
|
|
|
7581
7608
|
isHoliday,
|
|
7582
7609
|
isSameDay,
|
|
7583
7610
|
isolateCity,
|
|
7611
|
+
noAutofillProps,
|
|
7584
7612
|
optimizeImage,
|
|
7585
7613
|
parseAmount,
|
|
7586
7614
|
parseIsoDate,
|
package/dist/index.mjs
CHANGED
|
@@ -2395,6 +2395,28 @@ var Avatar = ({
|
|
|
2395
2395
|
import { useState as useState7, useRef as useRef5, useEffect as useEffect6 } from "react";
|
|
2396
2396
|
import ReactDOM from "react-dom";
|
|
2397
2397
|
import styled20 from "styled-components";
|
|
2398
|
+
|
|
2399
|
+
// src/ui/lib/autofill.ts
|
|
2400
|
+
var noAutofillProps = {
|
|
2401
|
+
autoComplete: "off",
|
|
2402
|
+
/** 1Password */
|
|
2403
|
+
"data-1p-ignore": true,
|
|
2404
|
+
/** LastPass */
|
|
2405
|
+
"data-lpignore": "true",
|
|
2406
|
+
/** Bitwarden */
|
|
2407
|
+
"data-bwignore": true,
|
|
2408
|
+
/** Dashlane */
|
|
2409
|
+
"data-form-type": "other"
|
|
2410
|
+
};
|
|
2411
|
+
var allowAutofill = (autoComplete) => ({
|
|
2412
|
+
autoComplete,
|
|
2413
|
+
"data-1p-ignore": void 0,
|
|
2414
|
+
"data-lpignore": void 0,
|
|
2415
|
+
"data-bwignore": void 0,
|
|
2416
|
+
"data-form-type": void 0
|
|
2417
|
+
});
|
|
2418
|
+
|
|
2419
|
+
// src/ui-legacy/Components/Select/Select.tsx
|
|
2398
2420
|
import { jsx as jsx24, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2399
2421
|
var StyledContainer = styled20.div.withConfig({
|
|
2400
2422
|
shouldForwardProp: (prop) => !["width", "noFlex", "label"].includes(prop)
|
|
@@ -2630,13 +2652,14 @@ var Select = ({
|
|
|
2630
2652
|
children: [
|
|
2631
2653
|
!hideSearchBar && /* @__PURE__ */ jsx24(
|
|
2632
2654
|
SearchInput,
|
|
2633
|
-
{
|
|
2655
|
+
__spreadProps(__spreadValues({
|
|
2634
2656
|
ref: searchInputRef,
|
|
2635
2657
|
type: "text",
|
|
2636
|
-
placeholder: "Rechercher..."
|
|
2658
|
+
placeholder: "Rechercher..."
|
|
2659
|
+
}, noAutofillProps), {
|
|
2637
2660
|
value: searchTerm,
|
|
2638
2661
|
onChange: handleSearch
|
|
2639
|
-
}
|
|
2662
|
+
})
|
|
2640
2663
|
),
|
|
2641
2664
|
/* @__PURE__ */ jsx24(DropdownList, { children: filteredOptions.map((option, index) => /* @__PURE__ */ jsx24(
|
|
2642
2665
|
Option,
|
|
@@ -3009,12 +3032,12 @@ var Input = forwardRef3((props, ref) => {
|
|
|
3009
3032
|
isDate ? /* @__PURE__ */ jsxs12(Fragment3, { children: [
|
|
3010
3033
|
/* @__PURE__ */ jsx25(
|
|
3011
3034
|
StyledInput,
|
|
3012
|
-
__spreadProps(__spreadValues({
|
|
3035
|
+
__spreadProps(__spreadValues(__spreadProps(__spreadValues({
|
|
3013
3036
|
id: inputId,
|
|
3014
3037
|
ref: innerRef,
|
|
3015
3038
|
type: "text",
|
|
3016
|
-
inputMode: "numeric"
|
|
3017
|
-
|
|
3039
|
+
inputMode: "numeric"
|
|
3040
|
+
}, noAutofillProps), {
|
|
3018
3041
|
value: displayDateValue,
|
|
3019
3042
|
onChange: handleDateInputChange,
|
|
3020
3043
|
onPaste: handleDateInputPaste,
|
|
@@ -3024,7 +3047,7 @@ var Input = forwardRef3((props, ref) => {
|
|
|
3024
3047
|
disabled,
|
|
3025
3048
|
"aria-required": required || void 0,
|
|
3026
3049
|
style: computedStyle
|
|
3027
|
-
}, forwardProps), {
|
|
3050
|
+
}), forwardProps), {
|
|
3028
3051
|
name: void 0,
|
|
3029
3052
|
min: void 0,
|
|
3030
3053
|
max: void 0,
|
|
@@ -3068,7 +3091,7 @@ var Input = forwardRef3((props, ref) => {
|
|
|
3068
3091
|
)
|
|
3069
3092
|
] }) : /* @__PURE__ */ jsx25(
|
|
3070
3093
|
Component,
|
|
3071
|
-
__spreadValues({
|
|
3094
|
+
__spreadValues(__spreadValues(__spreadValues({
|
|
3072
3095
|
id: inputId,
|
|
3073
3096
|
ref: innerRef,
|
|
3074
3097
|
type: isPassword ? showPassword ? "text" : "password" : type,
|
|
@@ -3080,7 +3103,7 @@ var Input = forwardRef3((props, ref) => {
|
|
|
3080
3103
|
disabled,
|
|
3081
3104
|
name: inputName,
|
|
3082
3105
|
style: computedStyle
|
|
3083
|
-
}, forwardProps)
|
|
3106
|
+
}, noAutofillProps), isPassword ? { autoComplete: "new-password" } : {}), forwardProps)
|
|
3084
3107
|
),
|
|
3085
3108
|
isPassword && /* @__PURE__ */ jsx25(
|
|
3086
3109
|
EyeButton,
|
|
@@ -3488,14 +3511,15 @@ var ColorPicker = forwardRef4(
|
|
|
3488
3511
|
) }) }),
|
|
3489
3512
|
/* @__PURE__ */ jsx29(
|
|
3490
3513
|
HexInput,
|
|
3491
|
-
{
|
|
3514
|
+
__spreadProps(__spreadValues({
|
|
3492
3515
|
type: "text",
|
|
3493
|
-
value: currentColor
|
|
3516
|
+
value: currentColor
|
|
3517
|
+
}, noAutofillProps), {
|
|
3494
3518
|
onChange: handleChange,
|
|
3495
3519
|
disabled,
|
|
3496
3520
|
$fontSize: dims.fontSize,
|
|
3497
3521
|
$padding: dims.inputPadding
|
|
3498
|
-
}
|
|
3522
|
+
})
|
|
3499
3523
|
)
|
|
3500
3524
|
] })
|
|
3501
3525
|
] });
|
|
@@ -7421,6 +7445,7 @@ export {
|
|
|
7421
7445
|
Toaster,
|
|
7422
7446
|
Tooltip,
|
|
7423
7447
|
addBusinessDays,
|
|
7448
|
+
allowAutofill,
|
|
7424
7449
|
appendCacheBuster,
|
|
7425
7450
|
appendQueryParam,
|
|
7426
7451
|
capitalizeFirstLetter,
|
|
@@ -7459,6 +7484,7 @@ export {
|
|
|
7459
7484
|
isHoliday,
|
|
7460
7485
|
isSameDay,
|
|
7461
7486
|
isolateCity,
|
|
7487
|
+
noAutofillProps,
|
|
7462
7488
|
optimizeImage_default as optimizeImage,
|
|
7463
7489
|
parseAmount,
|
|
7464
7490
|
parseIsoDate,
|
package/dist/ui/index.d.mts
CHANGED
|
@@ -1174,4 +1174,56 @@ interface OptimizeImageOptions {
|
|
|
1174
1174
|
}
|
|
1175
1175
|
declare const optimizeImage: (file: File | null | undefined, desiredBaseName: string, opts?: OptimizeImageOptions) => Promise<OptimizeImageResult>;
|
|
1176
1176
|
|
|
1177
|
-
|
|
1177
|
+
/**
|
|
1178
|
+
* Attributs qui neutralisent l'autofill du navigateur **et** des gestionnaires
|
|
1179
|
+
* de mots de passe (1Password, LastPass, Bitwarden, Dashlane) sur un champ.
|
|
1180
|
+
*
|
|
1181
|
+
* Appliqués par défaut par les champs du DS : sans ça, un coffre-fort réécrit
|
|
1182
|
+
* à l'ouverture d'une page les valeurs déjà présentes dans le formulaire
|
|
1183
|
+
* (fiche existante en édition), silencieusement.
|
|
1184
|
+
*
|
|
1185
|
+
* `autoComplete: 'off'` seul ne suffit pas : les extensions l'ignorent, chacune
|
|
1186
|
+
* a son propre attribut d'opt-out.
|
|
1187
|
+
*
|
|
1188
|
+
* Étalés **avant** les props du consommateur : un champ qui a besoin de
|
|
1189
|
+
* l'autofill (page de login) surcharge ce qu'il veut, y compris en repassant
|
|
1190
|
+
* `undefined` sur un `data-*` pour le retirer.
|
|
1191
|
+
*
|
|
1192
|
+
* @example
|
|
1193
|
+
* <input {...noAutofillProps} {...props} />
|
|
1194
|
+
* // login : <Input autoComplete="username" data-1p-ignore={undefined} />
|
|
1195
|
+
*/
|
|
1196
|
+
declare const noAutofillProps: {
|
|
1197
|
+
readonly autoComplete: "off";
|
|
1198
|
+
/** 1Password */
|
|
1199
|
+
readonly 'data-1p-ignore': true;
|
|
1200
|
+
/** LastPass */
|
|
1201
|
+
readonly 'data-lpignore': "true";
|
|
1202
|
+
/** Bitwarden */
|
|
1203
|
+
readonly 'data-bwignore': true;
|
|
1204
|
+
/** Dashlane */
|
|
1205
|
+
readonly 'data-form-type': "other";
|
|
1206
|
+
};
|
|
1207
|
+
/**
|
|
1208
|
+
* Inverse de {@link noAutofillProps} : réautorise l'autofill sur un champ
|
|
1209
|
+
* précis, en neutralisant les `data-*` d'opt-out posés par défaut.
|
|
1210
|
+
*
|
|
1211
|
+
* À réserver aux champs où l'autofill est *voulu* : login, changement de mot
|
|
1212
|
+
* de passe. Partout ailleurs, le défaut du DS est le bon comportement.
|
|
1213
|
+
*
|
|
1214
|
+
* @param autoComplete valeur HTML `autocomplete` du champ — `username`,
|
|
1215
|
+
* `current-password`, `new-password`, `email`…
|
|
1216
|
+
*
|
|
1217
|
+
* @example
|
|
1218
|
+
* <Input type="text" {...allowAutofill('username')} />
|
|
1219
|
+
* <PasswordInput {...allowAutofill('current-password')} />
|
|
1220
|
+
*/
|
|
1221
|
+
declare const allowAutofill: (autoComplete: string) => {
|
|
1222
|
+
autoComplete: string;
|
|
1223
|
+
"data-1p-ignore": undefined;
|
|
1224
|
+
"data-lpignore": undefined;
|
|
1225
|
+
"data-bwignore": undefined;
|
|
1226
|
+
"data-form-type": undefined;
|
|
1227
|
+
};
|
|
1228
|
+
|
|
1229
|
+
export { Attachment, type AttachmentProps, type AttachmentStatus, Avatar, AvatarBadge, type AvatarBadgeConfig, type AvatarBadgeProps, AvatarFallback, type AvatarFallbackProps, AvatarGroup, type AvatarGroupProps, AvatarImage, type AvatarImageProps, type AvatarProps, Badge, type BadgeProps, Banner, type BannerAction, type BannerProps, type BannerToggle, Box, type BoxProps, Bulk, type BulkProps, type BulkSection, Button, type ButtonColor, type ButtonProps, COLOR_TOKENS, Checkbox, type CheckboxProps, Collapsible, CollapsibleContent, CollapsibleTrigger, type ColorKey, ColorPicker, type ColorPickerProps, type ColorToken, DatePicker, type DatePickerMode, type DatePickerProps, type DatePreset, Divider, type DividerProps, Drawer, DrawerBody, DrawerClose, DrawerDescription, type DrawerDirection, DrawerFooter, DrawerHeader, type DrawerProps, DrawerTitle, EmailInput, type EmailInputProps, EmptyState, type EmptyStateProps, FileUploadZone, type FileUploadZoneProps, type FloatingAction, FloatingButton, type FloatingButtonProps, Gantt, type GanttBand, type GanttBar, type GanttDay, GanttDot, type GanttProps, type GanttRow, GanttSwatch, Icon, type IconColor, type IconFamily, type IconProps, type IconSize, type IconTabItem, IconTabs, type IconTabsProps, Image, type ImageProps, Input, InputGroup, InputGroupAddon, type InputGroupAddonProps, InputGroupButton, type InputGroupButtonProps, type InputGroupProps, type InputProps, Item, ItemActions, ItemContent, ItemDescription, ItemMedia, type ItemMediaProps, type ItemProps, ItemTitle, Label, type LabelProps, Layout, type LayoutProps, Link, type LinkProps, MetricCard, type MetricCardProps, Modal, ModalBody, ModalClose, ModalDescription, ModalFooter, ModalHeader, type ModalProps, ModalTitle, type MultiSelectProps, type OptimizeImageOptions, type OptimizeImageResult, PageContainer, type PageContainerProps, Pagination, type PaginationProps, PasswordInput, type PasswordInputProps, PdfPreview, type PdfPreviewProps, PhoneInput, type PhoneInputMeta, type PhoneInputProps, Popover, type PopoverMenuItem, type PopoverProps, ProgressBar, type ProgressBarProps, Radio, type RadioOption, type RadioProps, ScrollArea, type ScrollAreaProps, SearchInput, type SearchInputProps, Select, type SelectOption, type SelectProps, type SingleSelectProps, Skeleton, type SkeletonProps, Spinner, type SpinnerProps, type SpinnerSize, Stepper, type StepperProps, Switch, type SwitchProps, type TabItem, Table, TableCell, type TableCellProps, type TableEmptyState, TableFooter, TableFooterCell, type TableFooterCellProps, type TableFooterProps, TableFooterRow, type TableFooterRowProps, TableHeader, TableHeaderCell, type TableHeaderCellProps, type TableHeaderProps, TableHeaderRow, type TableHeaderRowProps, type TablePagination, type TableProps, TableRow, type TableRowProps, Tabs, type TabsProps, type TabsVariant, TagBubble, type TagBubbleProps, type TagOption, TagSelect, type TagSelectProps, Text, type TextProps, Textarea, type TextareaProps, Timeline, type TimelineItem, type TimelineProps, type ToastOptions, type ToastType, Toaster, Tooltip, type TooltipProps, addBusinessDays, allowAutofill, appendCacheBuster, appendQueryParam, buttonVariants, capitalizeFirstLetter, colors, easterDate, formatAddress, formatCityFromFormattedAddress, formatCityWithPostalCode, formatDate, formatDateWithTime, formatDistance, formatDuration, formatEuro, formatKM, formatLocality, formatName, formatNameWithInitial, formatPhoneNumber, formatPlate, formatPlateWithoutDashes, formatPostalCodeFromFormattedAddress, formatRegionCode, formatTime, formatVin, generateHexColor, getAvatarColor, getCleanFileName, getFileIconByMimeType, getFileKind, getFileNameFromUrl, getInitials, getMimeCategory, getRelativeTime, isHoliday, isSameDay, isolateCity, noAutofillProps, optimizeImage, parseAmount, parseIsoDate, toast, truncateFileName, truncateText, useAvatarSize };
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -1174,4 +1174,56 @@ interface OptimizeImageOptions {
|
|
|
1174
1174
|
}
|
|
1175
1175
|
declare const optimizeImage: (file: File | null | undefined, desiredBaseName: string, opts?: OptimizeImageOptions) => Promise<OptimizeImageResult>;
|
|
1176
1176
|
|
|
1177
|
-
|
|
1177
|
+
/**
|
|
1178
|
+
* Attributs qui neutralisent l'autofill du navigateur **et** des gestionnaires
|
|
1179
|
+
* de mots de passe (1Password, LastPass, Bitwarden, Dashlane) sur un champ.
|
|
1180
|
+
*
|
|
1181
|
+
* Appliqués par défaut par les champs du DS : sans ça, un coffre-fort réécrit
|
|
1182
|
+
* à l'ouverture d'une page les valeurs déjà présentes dans le formulaire
|
|
1183
|
+
* (fiche existante en édition), silencieusement.
|
|
1184
|
+
*
|
|
1185
|
+
* `autoComplete: 'off'` seul ne suffit pas : les extensions l'ignorent, chacune
|
|
1186
|
+
* a son propre attribut d'opt-out.
|
|
1187
|
+
*
|
|
1188
|
+
* Étalés **avant** les props du consommateur : un champ qui a besoin de
|
|
1189
|
+
* l'autofill (page de login) surcharge ce qu'il veut, y compris en repassant
|
|
1190
|
+
* `undefined` sur un `data-*` pour le retirer.
|
|
1191
|
+
*
|
|
1192
|
+
* @example
|
|
1193
|
+
* <input {...noAutofillProps} {...props} />
|
|
1194
|
+
* // login : <Input autoComplete="username" data-1p-ignore={undefined} />
|
|
1195
|
+
*/
|
|
1196
|
+
declare const noAutofillProps: {
|
|
1197
|
+
readonly autoComplete: "off";
|
|
1198
|
+
/** 1Password */
|
|
1199
|
+
readonly 'data-1p-ignore': true;
|
|
1200
|
+
/** LastPass */
|
|
1201
|
+
readonly 'data-lpignore': "true";
|
|
1202
|
+
/** Bitwarden */
|
|
1203
|
+
readonly 'data-bwignore': true;
|
|
1204
|
+
/** Dashlane */
|
|
1205
|
+
readonly 'data-form-type': "other";
|
|
1206
|
+
};
|
|
1207
|
+
/**
|
|
1208
|
+
* Inverse de {@link noAutofillProps} : réautorise l'autofill sur un champ
|
|
1209
|
+
* précis, en neutralisant les `data-*` d'opt-out posés par défaut.
|
|
1210
|
+
*
|
|
1211
|
+
* À réserver aux champs où l'autofill est *voulu* : login, changement de mot
|
|
1212
|
+
* de passe. Partout ailleurs, le défaut du DS est le bon comportement.
|
|
1213
|
+
*
|
|
1214
|
+
* @param autoComplete valeur HTML `autocomplete` du champ — `username`,
|
|
1215
|
+
* `current-password`, `new-password`, `email`…
|
|
1216
|
+
*
|
|
1217
|
+
* @example
|
|
1218
|
+
* <Input type="text" {...allowAutofill('username')} />
|
|
1219
|
+
* <PasswordInput {...allowAutofill('current-password')} />
|
|
1220
|
+
*/
|
|
1221
|
+
declare const allowAutofill: (autoComplete: string) => {
|
|
1222
|
+
autoComplete: string;
|
|
1223
|
+
"data-1p-ignore": undefined;
|
|
1224
|
+
"data-lpignore": undefined;
|
|
1225
|
+
"data-bwignore": undefined;
|
|
1226
|
+
"data-form-type": undefined;
|
|
1227
|
+
};
|
|
1228
|
+
|
|
1229
|
+
export { Attachment, type AttachmentProps, type AttachmentStatus, Avatar, AvatarBadge, type AvatarBadgeConfig, type AvatarBadgeProps, AvatarFallback, type AvatarFallbackProps, AvatarGroup, type AvatarGroupProps, AvatarImage, type AvatarImageProps, type AvatarProps, Badge, type BadgeProps, Banner, type BannerAction, type BannerProps, type BannerToggle, Box, type BoxProps, Bulk, type BulkProps, type BulkSection, Button, type ButtonColor, type ButtonProps, COLOR_TOKENS, Checkbox, type CheckboxProps, Collapsible, CollapsibleContent, CollapsibleTrigger, type ColorKey, ColorPicker, type ColorPickerProps, type ColorToken, DatePicker, type DatePickerMode, type DatePickerProps, type DatePreset, Divider, type DividerProps, Drawer, DrawerBody, DrawerClose, DrawerDescription, type DrawerDirection, DrawerFooter, DrawerHeader, type DrawerProps, DrawerTitle, EmailInput, type EmailInputProps, EmptyState, type EmptyStateProps, FileUploadZone, type FileUploadZoneProps, type FloatingAction, FloatingButton, type FloatingButtonProps, Gantt, type GanttBand, type GanttBar, type GanttDay, GanttDot, type GanttProps, type GanttRow, GanttSwatch, Icon, type IconColor, type IconFamily, type IconProps, type IconSize, type IconTabItem, IconTabs, type IconTabsProps, Image, type ImageProps, Input, InputGroup, InputGroupAddon, type InputGroupAddonProps, InputGroupButton, type InputGroupButtonProps, type InputGroupProps, type InputProps, Item, ItemActions, ItemContent, ItemDescription, ItemMedia, type ItemMediaProps, type ItemProps, ItemTitle, Label, type LabelProps, Layout, type LayoutProps, Link, type LinkProps, MetricCard, type MetricCardProps, Modal, ModalBody, ModalClose, ModalDescription, ModalFooter, ModalHeader, type ModalProps, ModalTitle, type MultiSelectProps, type OptimizeImageOptions, type OptimizeImageResult, PageContainer, type PageContainerProps, Pagination, type PaginationProps, PasswordInput, type PasswordInputProps, PdfPreview, type PdfPreviewProps, PhoneInput, type PhoneInputMeta, type PhoneInputProps, Popover, type PopoverMenuItem, type PopoverProps, ProgressBar, type ProgressBarProps, Radio, type RadioOption, type RadioProps, ScrollArea, type ScrollAreaProps, SearchInput, type SearchInputProps, Select, type SelectOption, type SelectProps, type SingleSelectProps, Skeleton, type SkeletonProps, Spinner, type SpinnerProps, type SpinnerSize, Stepper, type StepperProps, Switch, type SwitchProps, type TabItem, Table, TableCell, type TableCellProps, type TableEmptyState, TableFooter, TableFooterCell, type TableFooterCellProps, type TableFooterProps, TableFooterRow, type TableFooterRowProps, TableHeader, TableHeaderCell, type TableHeaderCellProps, type TableHeaderProps, TableHeaderRow, type TableHeaderRowProps, type TablePagination, type TableProps, TableRow, type TableRowProps, Tabs, type TabsProps, type TabsVariant, TagBubble, type TagBubbleProps, type TagOption, TagSelect, type TagSelectProps, Text, type TextProps, Textarea, type TextareaProps, Timeline, type TimelineItem, type TimelineProps, type ToastOptions, type ToastType, Toaster, Tooltip, type TooltipProps, addBusinessDays, allowAutofill, appendCacheBuster, appendQueryParam, buttonVariants, capitalizeFirstLetter, colors, easterDate, formatAddress, formatCityFromFormattedAddress, formatCityWithPostalCode, formatDate, formatDateWithTime, formatDistance, formatDuration, formatEuro, formatKM, formatLocality, formatName, formatNameWithInitial, formatPhoneNumber, formatPlate, formatPlateWithoutDashes, formatPostalCodeFromFormattedAddress, formatRegionCode, formatTime, formatVin, generateHexColor, getAvatarColor, getCleanFileName, getFileIconByMimeType, getFileKind, getFileNameFromUrl, getInitials, getMimeCategory, getRelativeTime, isHoliday, isSameDay, isolateCity, noAutofillProps, optimizeImage, parseAmount, parseIsoDate, toast, truncateFileName, truncateText, useAvatarSize };
|
package/dist/ui/index.js
CHANGED
|
@@ -149,6 +149,7 @@ __export(index_exports, {
|
|
|
149
149
|
Toaster: () => Toaster,
|
|
150
150
|
Tooltip: () => Tooltip,
|
|
151
151
|
addBusinessDays: () => addBusinessDays,
|
|
152
|
+
allowAutofill: () => allowAutofill,
|
|
152
153
|
appendCacheBuster: () => appendCacheBuster,
|
|
153
154
|
appendQueryParam: () => appendQueryParam,
|
|
154
155
|
buttonVariants: () => buttonVariants,
|
|
@@ -186,6 +187,7 @@ __export(index_exports, {
|
|
|
186
187
|
isHoliday: () => isHoliday,
|
|
187
188
|
isSameDay: () => isSameDay,
|
|
188
189
|
isolateCity: () => isolateCity,
|
|
190
|
+
noAutofillProps: () => noAutofillProps,
|
|
189
191
|
optimizeImage: () => optimizeImage,
|
|
190
192
|
parseAmount: () => parseAmount,
|
|
191
193
|
parseIsoDate: () => parseIsoDate,
|
|
@@ -990,6 +992,26 @@ Button.displayName = "Button";
|
|
|
990
992
|
// src/ui/components/ui/Input.tsx
|
|
991
993
|
var import_react9 = require("react");
|
|
992
994
|
|
|
995
|
+
// src/ui/lib/autofill.ts
|
|
996
|
+
var noAutofillProps = {
|
|
997
|
+
autoComplete: "off",
|
|
998
|
+
/** 1Password */
|
|
999
|
+
"data-1p-ignore": true,
|
|
1000
|
+
/** LastPass */
|
|
1001
|
+
"data-lpignore": "true",
|
|
1002
|
+
/** Bitwarden */
|
|
1003
|
+
"data-bwignore": true,
|
|
1004
|
+
/** Dashlane */
|
|
1005
|
+
"data-form-type": "other"
|
|
1006
|
+
};
|
|
1007
|
+
var allowAutofill = (autoComplete) => ({
|
|
1008
|
+
autoComplete,
|
|
1009
|
+
"data-1p-ignore": void 0,
|
|
1010
|
+
"data-lpignore": void 0,
|
|
1011
|
+
"data-bwignore": void 0,
|
|
1012
|
+
"data-form-type": void 0
|
|
1013
|
+
});
|
|
1014
|
+
|
|
993
1015
|
// src/ui/components/ui/Label.tsx
|
|
994
1016
|
var RadixLabel = __toESM(require("@radix-ui/react-label"));
|
|
995
1017
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
@@ -1026,10 +1048,11 @@ var Input = (0, import_react9.forwardRef)(
|
|
|
1026
1048
|
const inputId = label ? id != null ? id : generatedId : id;
|
|
1027
1049
|
const input = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1028
1050
|
"input",
|
|
1029
|
-
__spreadValues({
|
|
1051
|
+
__spreadValues(__spreadProps(__spreadValues({
|
|
1030
1052
|
ref,
|
|
1031
1053
|
id: inputId,
|
|
1032
|
-
required
|
|
1054
|
+
required
|
|
1055
|
+
}, noAutofillProps), {
|
|
1033
1056
|
className: cn(
|
|
1034
1057
|
"h-9 w-full rounded-[5px] border border-grey-300 bg-white px-2 text-[13px] font-sans text-neutral-800",
|
|
1035
1058
|
"placeholder:font-sans placeholder:text-xs placeholder:text-grey-500",
|
|
@@ -1038,7 +1061,7 @@ var Input = (0, import_react9.forwardRef)(
|
|
|
1038
1061
|
"aria-invalid:border-red-900 aria-invalid:focus:border-red-900",
|
|
1039
1062
|
className
|
|
1040
1063
|
)
|
|
1041
|
-
}, props)
|
|
1064
|
+
}), props)
|
|
1042
1065
|
);
|
|
1043
1066
|
if (!label) return input;
|
|
1044
1067
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Layout, { column: true, gap: 1.5, children: [
|
|
@@ -1057,8 +1080,9 @@ var Textarea = (0, import_react10.forwardRef)(
|
|
|
1057
1080
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1058
1081
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1059
1082
|
"textarea",
|
|
1060
|
-
__spreadValues({
|
|
1061
|
-
ref
|
|
1083
|
+
__spreadValues(__spreadProps(__spreadValues({
|
|
1084
|
+
ref
|
|
1085
|
+
}, noAutofillProps), {
|
|
1062
1086
|
className: cn(
|
|
1063
1087
|
"min-h-[80px] w-full rounded-[5px] border border-grey-300 bg-white px-2 py-2 text-[13px] font-sans text-neutral-800",
|
|
1064
1088
|
"placeholder:font-sans placeholder:text-xs placeholder:text-grey-500",
|
|
@@ -1067,7 +1091,7 @@ var Textarea = (0, import_react10.forwardRef)(
|
|
|
1067
1091
|
"aria-invalid:border-red-900 aria-invalid:focus:border-red-900",
|
|
1068
1092
|
className
|
|
1069
1093
|
)
|
|
1070
|
-
}, props)
|
|
1094
|
+
}), props)
|
|
1071
1095
|
);
|
|
1072
1096
|
}
|
|
1073
1097
|
);
|
|
@@ -1139,6 +1163,7 @@ var PasswordInput = (0, import_react12.forwardRef)(
|
|
|
1139
1163
|
__spreadValues({
|
|
1140
1164
|
ref,
|
|
1141
1165
|
type: visible ? "text" : "password",
|
|
1166
|
+
autoComplete: "new-password",
|
|
1142
1167
|
className: cn("pr-9", className)
|
|
1143
1168
|
}, props)
|
|
1144
1169
|
),
|
|
@@ -1248,7 +1273,7 @@ var PhoneInput = ({
|
|
|
1248
1273
|
value,
|
|
1249
1274
|
onChange: handleChange,
|
|
1250
1275
|
disabled,
|
|
1251
|
-
inputProps: { onPaste: handlePaste },
|
|
1276
|
+
inputProps: __spreadValues({ onPaste: handlePaste }, noAutofillProps),
|
|
1252
1277
|
className: cn(className)
|
|
1253
1278
|
}
|
|
1254
1279
|
)
|
|
@@ -1818,17 +1843,18 @@ var SearchField = ({
|
|
|
1818
1843
|
setSearchTerm
|
|
1819
1844
|
}) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1820
1845
|
"input",
|
|
1821
|
-
{
|
|
1846
|
+
__spreadProps(__spreadValues({
|
|
1822
1847
|
ref: searchInputRef,
|
|
1823
1848
|
type: "text",
|
|
1824
|
-
placeholder: "Rechercher..."
|
|
1849
|
+
placeholder: "Rechercher..."
|
|
1850
|
+
}, noAutofillProps), {
|
|
1825
1851
|
value: searchTerm,
|
|
1826
1852
|
onChange: (e) => setSearchTerm(e.target.value),
|
|
1827
1853
|
onKeyDown: (e) => {
|
|
1828
1854
|
if (!NAVIGATION_KEYS.has(e.key)) e.stopPropagation();
|
|
1829
1855
|
},
|
|
1830
1856
|
className: "w-full border-b border-grey-200 px-2 py-2 text-[13px] outline-none focus:border-blue-700"
|
|
1831
|
-
}
|
|
1857
|
+
})
|
|
1832
1858
|
);
|
|
1833
1859
|
var Select = (props) => {
|
|
1834
1860
|
const {
|
|
@@ -2122,10 +2148,11 @@ var TagSelect = ({
|
|
|
2122
2148
|
)),
|
|
2123
2149
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2124
2150
|
"input",
|
|
2125
|
-
{
|
|
2151
|
+
__spreadProps(__spreadValues({
|
|
2126
2152
|
ref: inputRef,
|
|
2127
2153
|
type: "text",
|
|
2128
|
-
disabled
|
|
2154
|
+
disabled
|
|
2155
|
+
}, noAutofillProps), {
|
|
2129
2156
|
value: searchTerm,
|
|
2130
2157
|
onChange: (e) => {
|
|
2131
2158
|
setSearchTerm(e.target.value);
|
|
@@ -2135,7 +2162,7 @@ var TagSelect = ({
|
|
|
2135
2162
|
onKeyDown: handleKeyDown,
|
|
2136
2163
|
placeholder: value.length === 0 ? placeholder : "",
|
|
2137
2164
|
className: "min-w-[80px] flex-1 border-0 bg-transparent p-0.5 text-xs text-neutral-800 outline-none placeholder:text-grey-600 disabled:cursor-not-allowed"
|
|
2138
|
-
}
|
|
2165
|
+
})
|
|
2139
2166
|
)
|
|
2140
2167
|
]
|
|
2141
2168
|
}
|
|
@@ -4159,13 +4186,14 @@ var ColorPicker = (0, import_react26.forwardRef)(
|
|
|
4159
4186
|
),
|
|
4160
4187
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4161
4188
|
"input",
|
|
4162
|
-
{
|
|
4189
|
+
__spreadProps(__spreadValues({
|
|
4163
4190
|
type: "text",
|
|
4164
|
-
value: currentColor
|
|
4191
|
+
value: currentColor
|
|
4192
|
+
}, noAutofillProps), {
|
|
4165
4193
|
onChange: handleChange,
|
|
4166
4194
|
disabled,
|
|
4167
4195
|
className: inputVariants({ size })
|
|
4168
|
-
}
|
|
4196
|
+
})
|
|
4169
4197
|
)
|
|
4170
4198
|
] })
|
|
4171
4199
|
]
|
|
@@ -5687,6 +5715,7 @@ var optimizeImage = async (file, desiredBaseName, opts = {}) => {
|
|
|
5687
5715
|
Toaster,
|
|
5688
5716
|
Tooltip,
|
|
5689
5717
|
addBusinessDays,
|
|
5718
|
+
allowAutofill,
|
|
5690
5719
|
appendCacheBuster,
|
|
5691
5720
|
appendQueryParam,
|
|
5692
5721
|
buttonVariants,
|
|
@@ -5724,6 +5753,7 @@ var optimizeImage = async (file, desiredBaseName, opts = {}) => {
|
|
|
5724
5753
|
isHoliday,
|
|
5725
5754
|
isSameDay,
|
|
5726
5755
|
isolateCity,
|
|
5756
|
+
noAutofillProps,
|
|
5727
5757
|
optimizeImage,
|
|
5728
5758
|
parseAmount,
|
|
5729
5759
|
parseIsoDate,
|
package/dist/ui/index.mjs
CHANGED
|
@@ -824,6 +824,26 @@ Button.displayName = "Button";
|
|
|
824
824
|
// src/ui/components/ui/Input.tsx
|
|
825
825
|
import { forwardRef as forwardRef9, useId } from "react";
|
|
826
826
|
|
|
827
|
+
// src/ui/lib/autofill.ts
|
|
828
|
+
var noAutofillProps = {
|
|
829
|
+
autoComplete: "off",
|
|
830
|
+
/** 1Password */
|
|
831
|
+
"data-1p-ignore": true,
|
|
832
|
+
/** LastPass */
|
|
833
|
+
"data-lpignore": "true",
|
|
834
|
+
/** Bitwarden */
|
|
835
|
+
"data-bwignore": true,
|
|
836
|
+
/** Dashlane */
|
|
837
|
+
"data-form-type": "other"
|
|
838
|
+
};
|
|
839
|
+
var allowAutofill = (autoComplete) => ({
|
|
840
|
+
autoComplete,
|
|
841
|
+
"data-1p-ignore": void 0,
|
|
842
|
+
"data-lpignore": void 0,
|
|
843
|
+
"data-bwignore": void 0,
|
|
844
|
+
"data-form-type": void 0
|
|
845
|
+
});
|
|
846
|
+
|
|
827
847
|
// src/ui/components/ui/Label.tsx
|
|
828
848
|
import * as RadixLabel from "@radix-ui/react-label";
|
|
829
849
|
import { jsx as jsx11, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
@@ -860,10 +880,11 @@ var Input = forwardRef9(
|
|
|
860
880
|
const inputId = label ? id != null ? id : generatedId : id;
|
|
861
881
|
const input = /* @__PURE__ */ jsx12(
|
|
862
882
|
"input",
|
|
863
|
-
__spreadValues({
|
|
883
|
+
__spreadValues(__spreadProps(__spreadValues({
|
|
864
884
|
ref,
|
|
865
885
|
id: inputId,
|
|
866
|
-
required
|
|
886
|
+
required
|
|
887
|
+
}, noAutofillProps), {
|
|
867
888
|
className: cn(
|
|
868
889
|
"h-9 w-full rounded-[5px] border border-grey-300 bg-white px-2 text-[13px] font-sans text-neutral-800",
|
|
869
890
|
"placeholder:font-sans placeholder:text-xs placeholder:text-grey-500",
|
|
@@ -872,7 +893,7 @@ var Input = forwardRef9(
|
|
|
872
893
|
"aria-invalid:border-red-900 aria-invalid:focus:border-red-900",
|
|
873
894
|
className
|
|
874
895
|
)
|
|
875
|
-
}, props)
|
|
896
|
+
}), props)
|
|
876
897
|
);
|
|
877
898
|
if (!label) return input;
|
|
878
899
|
return /* @__PURE__ */ jsxs3(Layout, { column: true, gap: 1.5, children: [
|
|
@@ -891,8 +912,9 @@ var Textarea = forwardRef10(
|
|
|
891
912
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
892
913
|
return /* @__PURE__ */ jsx13(
|
|
893
914
|
"textarea",
|
|
894
|
-
__spreadValues({
|
|
895
|
-
ref
|
|
915
|
+
__spreadValues(__spreadProps(__spreadValues({
|
|
916
|
+
ref
|
|
917
|
+
}, noAutofillProps), {
|
|
896
918
|
className: cn(
|
|
897
919
|
"min-h-[80px] w-full rounded-[5px] border border-grey-300 bg-white px-2 py-2 text-[13px] font-sans text-neutral-800",
|
|
898
920
|
"placeholder:font-sans placeholder:text-xs placeholder:text-grey-500",
|
|
@@ -901,7 +923,7 @@ var Textarea = forwardRef10(
|
|
|
901
923
|
"aria-invalid:border-red-900 aria-invalid:focus:border-red-900",
|
|
902
924
|
className
|
|
903
925
|
)
|
|
904
|
-
}, props)
|
|
926
|
+
}), props)
|
|
905
927
|
);
|
|
906
928
|
}
|
|
907
929
|
);
|
|
@@ -973,6 +995,7 @@ var PasswordInput = forwardRef12(
|
|
|
973
995
|
__spreadValues({
|
|
974
996
|
ref,
|
|
975
997
|
type: visible ? "text" : "password",
|
|
998
|
+
autoComplete: "new-password",
|
|
976
999
|
className: cn("pr-9", className)
|
|
977
1000
|
}, props)
|
|
978
1001
|
),
|
|
@@ -1086,7 +1109,7 @@ var PhoneInput = ({
|
|
|
1086
1109
|
value,
|
|
1087
1110
|
onChange: handleChange,
|
|
1088
1111
|
disabled,
|
|
1089
|
-
inputProps: { onPaste: handlePaste },
|
|
1112
|
+
inputProps: __spreadValues({ onPaste: handlePaste }, noAutofillProps),
|
|
1090
1113
|
className: cn(className)
|
|
1091
1114
|
}
|
|
1092
1115
|
)
|
|
@@ -1662,17 +1685,18 @@ var SearchField = ({
|
|
|
1662
1685
|
setSearchTerm
|
|
1663
1686
|
}) => /* @__PURE__ */ jsx24(
|
|
1664
1687
|
"input",
|
|
1665
|
-
{
|
|
1688
|
+
__spreadProps(__spreadValues({
|
|
1666
1689
|
ref: searchInputRef,
|
|
1667
1690
|
type: "text",
|
|
1668
|
-
placeholder: "Rechercher..."
|
|
1691
|
+
placeholder: "Rechercher..."
|
|
1692
|
+
}, noAutofillProps), {
|
|
1669
1693
|
value: searchTerm,
|
|
1670
1694
|
onChange: (e) => setSearchTerm(e.target.value),
|
|
1671
1695
|
onKeyDown: (e) => {
|
|
1672
1696
|
if (!NAVIGATION_KEYS.has(e.key)) e.stopPropagation();
|
|
1673
1697
|
},
|
|
1674
1698
|
className: "w-full border-b border-grey-200 px-2 py-2 text-[13px] outline-none focus:border-blue-700"
|
|
1675
|
-
}
|
|
1699
|
+
})
|
|
1676
1700
|
);
|
|
1677
1701
|
var Select = (props) => {
|
|
1678
1702
|
const {
|
|
@@ -1966,10 +1990,11 @@ var TagSelect = ({
|
|
|
1966
1990
|
)),
|
|
1967
1991
|
/* @__PURE__ */ jsx25(
|
|
1968
1992
|
"input",
|
|
1969
|
-
{
|
|
1993
|
+
__spreadProps(__spreadValues({
|
|
1970
1994
|
ref: inputRef,
|
|
1971
1995
|
type: "text",
|
|
1972
|
-
disabled
|
|
1996
|
+
disabled
|
|
1997
|
+
}, noAutofillProps), {
|
|
1973
1998
|
value: searchTerm,
|
|
1974
1999
|
onChange: (e) => {
|
|
1975
2000
|
setSearchTerm(e.target.value);
|
|
@@ -1979,7 +2004,7 @@ var TagSelect = ({
|
|
|
1979
2004
|
onKeyDown: handleKeyDown,
|
|
1980
2005
|
placeholder: value.length === 0 ? placeholder : "",
|
|
1981
2006
|
className: "min-w-[80px] flex-1 border-0 bg-transparent p-0.5 text-xs text-neutral-800 outline-none placeholder:text-grey-600 disabled:cursor-not-allowed"
|
|
1982
|
-
}
|
|
2007
|
+
})
|
|
1983
2008
|
)
|
|
1984
2009
|
]
|
|
1985
2010
|
}
|
|
@@ -4014,13 +4039,14 @@ var ColorPicker = forwardRef17(
|
|
|
4014
4039
|
),
|
|
4015
4040
|
/* @__PURE__ */ jsx58(
|
|
4016
4041
|
"input",
|
|
4017
|
-
{
|
|
4042
|
+
__spreadProps(__spreadValues({
|
|
4018
4043
|
type: "text",
|
|
4019
|
-
value: currentColor
|
|
4044
|
+
value: currentColor
|
|
4045
|
+
}, noAutofillProps), {
|
|
4020
4046
|
onChange: handleChange,
|
|
4021
4047
|
disabled,
|
|
4022
4048
|
className: inputVariants({ size })
|
|
4023
|
-
}
|
|
4049
|
+
})
|
|
4024
4050
|
)
|
|
4025
4051
|
] })
|
|
4026
4052
|
]
|
|
@@ -5550,6 +5576,7 @@ export {
|
|
|
5550
5576
|
Toaster,
|
|
5551
5577
|
Tooltip,
|
|
5552
5578
|
addBusinessDays,
|
|
5579
|
+
allowAutofill,
|
|
5553
5580
|
appendCacheBuster,
|
|
5554
5581
|
appendQueryParam,
|
|
5555
5582
|
buttonVariants,
|
|
@@ -5587,6 +5614,7 @@ export {
|
|
|
5587
5614
|
isHoliday,
|
|
5588
5615
|
isSameDay,
|
|
5589
5616
|
isolateCity,
|
|
5617
|
+
noAutofillProps,
|
|
5590
5618
|
optimizeImage,
|
|
5591
5619
|
parseAmount,
|
|
5592
5620
|
parseIsoDate,
|