@alveole/components 1.1.3 → 1.2.1

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.
Files changed (121) hide show
  1. package/dist/core/PdfViewer/PdfViewer.js +2 -2
  2. package/dist/generated/version.d.ts +1 -1
  3. package/dist/generated/version.js +1 -1
  4. package/dist/stories/index.d.ts +1 -0
  5. package/dist/stories/index.d.ts.map +1 -1
  6. package/dist/stories/index.js +1 -0
  7. package/dist/ui/Autocomplete/Autocomplete.web.d.ts +2 -0
  8. package/dist/ui/Autocomplete/Autocomplete.web.d.ts.map +1 -1
  9. package/dist/ui/Button/Button.d.ts.map +1 -1
  10. package/dist/ui/Button/Button.js +3 -2
  11. package/dist/ui/Button/Button.stories.d.ts +23 -12
  12. package/dist/ui/Button/Button.stories.d.ts.map +1 -1
  13. package/dist/ui/Button/Button.stories.js +18 -0
  14. package/dist/ui/Button/Button.stories.sources.d.ts +2 -0
  15. package/dist/ui/Button/Button.stories.sources.d.ts.map +1 -1
  16. package/dist/ui/Button/Button.stories.sources.js +3 -0
  17. package/dist/ui/DateInput/DateInput.d.ts +2 -0
  18. package/dist/ui/DateInput/DateInput.d.ts.map +1 -1
  19. package/dist/ui/DateInput/DateInput.ios.d.ts +2 -0
  20. package/dist/ui/DateInput/DateInput.ios.d.ts.map +1 -1
  21. package/dist/ui/DateInput/DateInput.stories.d.ts +2 -0
  22. package/dist/ui/DateInput/DateInput.stories.d.ts.map +1 -1
  23. package/dist/ui/DateInput/DateInput.web.d.ts +2 -0
  24. package/dist/ui/DateInput/DateInput.web.d.ts.map +1 -1
  25. package/dist/ui/DurationInput/DurationInput.d.ts +2 -0
  26. package/dist/ui/DurationInput/DurationInput.d.ts.map +1 -1
  27. package/dist/ui/DurationInput/DurationInput.stories.d.ts +2 -0
  28. package/dist/ui/DurationInput/DurationInput.stories.d.ts.map +1 -1
  29. package/dist/ui/EmailField/EmailField.d.ts +2 -0
  30. package/dist/ui/EmailField/EmailField.d.ts.map +1 -1
  31. package/dist/ui/EmailField/EmailField.stories.d.ts +2 -0
  32. package/dist/ui/EmailField/EmailField.stories.d.ts.map +1 -1
  33. package/dist/ui/FormControl/FormControl.stories.d.ts +8 -0
  34. package/dist/ui/FormControl/FormControl.stories.d.ts.map +1 -1
  35. package/dist/ui/FormControl/FormControl.styles.d.ts +8 -0
  36. package/dist/ui/FormControl/FormControl.styles.d.ts.map +1 -1
  37. package/dist/ui/FormControl/FormControl.styles.js +4 -0
  38. package/dist/ui/FormControl/FormControlLabel.d.ts +4 -1
  39. package/dist/ui/FormControl/FormControlLabel.d.ts.map +1 -1
  40. package/dist/ui/FormControl/FormControlLabel.js +2 -2
  41. package/dist/ui/ListItem/ListItem.d.ts.map +1 -1
  42. package/dist/ui/ListItem/ListItem.js +2 -2
  43. package/dist/ui/ListItem/ListItem.stories.d.ts +5 -0
  44. package/dist/ui/ListItem/ListItem.stories.d.ts.map +1 -1
  45. package/dist/ui/ListItem/ListItem.stories.js +5 -0
  46. package/dist/ui/ListItem/ListItem.stories.sources.d.ts.map +1 -1
  47. package/dist/ui/ListItem/ListItem.stories.sources.js +1 -0
  48. package/dist/ui/OtpField/OtpField.d.ts +2 -0
  49. package/dist/ui/OtpField/OtpField.d.ts.map +1 -1
  50. package/dist/ui/OtpField/OtpField.stories.d.ts +2 -0
  51. package/dist/ui/OtpField/OtpField.stories.d.ts.map +1 -1
  52. package/dist/ui/PasswordField/PasswordField.d.ts +2 -0
  53. package/dist/ui/PasswordField/PasswordField.d.ts.map +1 -1
  54. package/dist/ui/PasswordField/PasswordField.stories.d.ts +2 -0
  55. package/dist/ui/PasswordField/PasswordField.stories.d.ts.map +1 -1
  56. package/dist/ui/PhoneField/PhoneField.d.ts +2 -0
  57. package/dist/ui/PhoneField/PhoneField.d.ts.map +1 -1
  58. package/dist/ui/PhoneField/PhoneField.stories.d.ts +2 -0
  59. package/dist/ui/PhoneField/PhoneField.stories.d.ts.map +1 -1
  60. package/dist/ui/RadioGroup/RadioGroup.d.ts +2 -0
  61. package/dist/ui/RadioGroup/RadioGroup.d.ts.map +1 -1
  62. package/dist/ui/RadioGroup/RadioGroup.stories.d.ts +2 -0
  63. package/dist/ui/RadioGroup/RadioGroup.stories.d.ts.map +1 -1
  64. package/dist/ui/RadioGroup/index.d.ts +2 -0
  65. package/dist/ui/RadioGroup/index.d.ts.map +1 -1
  66. package/dist/ui/ResourceList/ResourceList.js +2 -2
  67. package/dist/ui/ResourceList/ResourceList.stories.d.ts +7 -0
  68. package/dist/ui/ResourceList/ResourceList.stories.d.ts.map +1 -1
  69. package/dist/ui/ResourceList/ResourceList.stories.js +7 -0
  70. package/dist/ui/ResourceList/ResourceList.stories.sources.d.ts +3 -0
  71. package/dist/ui/ResourceList/ResourceList.stories.sources.d.ts.map +1 -1
  72. package/dist/ui/ResourceList/ResourceList.stories.sources.js +5 -0
  73. package/dist/ui/Select/Select.d.ts +2 -0
  74. package/dist/ui/Select/Select.d.ts.map +1 -1
  75. package/dist/ui/Select/Select.stories.d.ts +2 -0
  76. package/dist/ui/Select/Select.stories.d.ts.map +1 -1
  77. package/dist/ui/SelectMultiple/SelectMultiple.web.d.ts +2 -0
  78. package/dist/ui/SelectMultiple/SelectMultiple.web.d.ts.map +1 -1
  79. package/dist/ui/Spinner/Spinner.d.ts +5 -0
  80. package/dist/ui/Spinner/Spinner.d.ts.map +1 -0
  81. package/dist/ui/Spinner/Spinner.js +47 -0
  82. package/dist/ui/Spinner/Spinner.shared.d.ts +12 -0
  83. package/dist/ui/Spinner/Spinner.shared.d.ts.map +1 -0
  84. package/dist/ui/Spinner/Spinner.shared.js +3 -0
  85. package/dist/ui/Spinner/Spinner.stories.d.ts +21 -0
  86. package/dist/ui/Spinner/Spinner.stories.d.ts.map +1 -0
  87. package/dist/ui/Spinner/Spinner.stories.js +25 -0
  88. package/dist/ui/Spinner/Spinner.stories.sources.d.ts +8 -0
  89. package/dist/ui/Spinner/Spinner.stories.sources.d.ts.map +1 -0
  90. package/dist/ui/Spinner/Spinner.stories.sources.js +8 -0
  91. package/dist/ui/Spinner/Spinner.styles.d.ts +9 -0
  92. package/dist/ui/Spinner/Spinner.styles.d.ts.map +1 -0
  93. package/dist/ui/Spinner/Spinner.styles.js +5 -0
  94. package/dist/ui/Spinner/Spinner.web.d.ts +5 -0
  95. package/dist/ui/Spinner/Spinner.web.d.ts.map +1 -0
  96. package/dist/ui/Spinner/Spinner.web.js +53 -0
  97. package/dist/ui/Spinner/index.d.ts +2 -0
  98. package/dist/ui/Spinner/index.d.ts.map +1 -0
  99. package/dist/ui/Spinner/index.js +1 -0
  100. package/dist/ui/TextField/TextField.d.ts +2 -0
  101. package/dist/ui/TextField/TextField.d.ts.map +1 -1
  102. package/dist/ui/TextField/TextField.stories.d.ts +2 -0
  103. package/dist/ui/TextField/TextField.stories.d.ts.map +1 -1
  104. package/dist/ui/TextareaField/TextareaField.d.ts +2 -0
  105. package/dist/ui/TextareaField/TextareaField.d.ts.map +1 -1
  106. package/dist/ui/TextareaField/TextareaField.stories.d.ts +2 -0
  107. package/dist/ui/TextareaField/TextareaField.stories.d.ts.map +1 -1
  108. package/dist/ui/TextareaInput/TextareaInput.d.ts +2 -0
  109. package/dist/ui/TextareaInput/TextareaInput.d.ts.map +1 -1
  110. package/dist/ui/TextareaInput/TextareaInput.stories.d.ts +2 -0
  111. package/dist/ui/TextareaInput/TextareaInput.stories.d.ts.map +1 -1
  112. package/dist/ui/TimeInput/TimeInput.d.ts +2 -0
  113. package/dist/ui/TimeInput/TimeInput.d.ts.map +1 -1
  114. package/dist/ui/TimeInput/TimeInput.stories.d.ts +2 -0
  115. package/dist/ui/TimeInput/TimeInput.stories.d.ts.map +1 -1
  116. package/dist/ui/TimeInput/TimeInput.web.d.ts +2 -0
  117. package/dist/ui/TimeInput/TimeInput.web.d.ts.map +1 -1
  118. package/dist/ui/index.d.ts +1 -0
  119. package/dist/ui/index.d.ts.map +1 -1
  120. package/dist/ui/index.js +1 -0
  121. package/package.json +5 -4
@@ -13,6 +13,8 @@ declare const _default: {
13
13
  } & {
14
14
  label: string;
15
15
  labelRight?: React.ReactNode;
16
+ optional?: boolean;
17
+ optionalText?: string;
16
18
  disabled?: boolean;
17
19
  } & import("..").FormControlCaptionProps & import("..").FormControlHintProps & {
18
20
  onChange?: import("..").TextInputProps["onChangeText"];
@@ -1 +1 @@
1
- {"version":3,"file":"PasswordField.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/PasswordField/PasswordField.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wBAOkB;AAElB,eAAO,MAAM,OAAO,mCAMnB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,iCAAiC,CAAC"}
1
+ {"version":3,"file":"PasswordField.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/PasswordField/PasswordField.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wBAOkB;AAElB,eAAO,MAAM,OAAO,mCAMnB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,iCAAiC,CAAC"}
@@ -13,6 +13,8 @@ export declare const PhoneField: React.ForwardRefExoticComponent<Omit<import("re
13
13
  } & {
14
14
  label: string;
15
15
  labelRight?: React.ReactNode;
16
+ optional?: boolean;
17
+ optionalText?: string;
16
18
  disabled?: boolean;
17
19
  } & FormControlCaptionProps & FormControlHintProps & {
18
20
  onChange?: TextInputProps["onChangeText"];
@@ -1 +1 @@
1
- {"version":3,"file":"PhoneField.d.ts","sourceRoot":"","sources":["../../../src/ui/PhoneField/PhoneField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,uBAAuB,EAEvB,oBAAoB,EAEpB,qBAAqB,EAGrB,cAAc,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,MAAM,eAAe,GAAG,cAAc,GAC1C,qBAAqB,GACrB,oBAAoB,GACpB,uBAAuB,GAAG;IACxB,QAAQ,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CAC3C,CAAC;AAEJ,eAAO,MAAM,UAAU;;;;;;;;;;;;eAHR,cAAc,CAAC,cAAc,CAAC;0DAoB3C,CAAC"}
1
+ {"version":3,"file":"PhoneField.d.ts","sourceRoot":"","sources":["../../../src/ui/PhoneField/PhoneField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,uBAAuB,EAEvB,oBAAoB,EAEpB,qBAAqB,EAGrB,cAAc,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,MAAM,eAAe,GAAG,cAAc,GAC1C,qBAAqB,GACrB,oBAAoB,GACpB,uBAAuB,GAAG;IACxB,QAAQ,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CAC3C,CAAC;AAEJ,eAAO,MAAM,UAAU;;;;;;;;;;;;;;eAHR,cAAc,CAAC,cAAc,CAAC;0DAoB3C,CAAC"}
@@ -13,6 +13,8 @@ declare const _default: {
13
13
  } & {
14
14
  label: string;
15
15
  labelRight?: React.ReactNode;
16
+ optional?: boolean;
17
+ optionalText?: string;
16
18
  disabled?: boolean;
17
19
  } & import("..").FormControlCaptionProps & import("..").FormControlHintProps & {
18
20
  onChange?: import("..").TextInputProps["onChangeText"];
@@ -1 +1 @@
1
- {"version":3,"file":"PhoneField.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/PhoneField/PhoneField.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAIA,wBAOkB;AAElB,eAAO,MAAM,OAAO,mCAMnB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC"}
1
+ {"version":3,"file":"PhoneField.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/PhoneField/PhoneField.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAIA,wBAOkB;AAElB,eAAO,MAAM,OAAO,mCAMnB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC"}
@@ -11,6 +11,8 @@ export type RadioGroupProps = Omit<TamaguiRadioGroupProps, 'value' | 'onValueCha
11
11
  export declare const RadioGroup: React.ForwardRefExoticComponent<Omit<TamaguiRadioGroupProps, "direction" | "value" | "onValueChange"> & FormControlCaptionProps & {
12
12
  label: string;
13
13
  labelRight?: React.ReactNode;
14
+ optional?: boolean;
15
+ optionalText?: string;
14
16
  disabled?: boolean;
15
17
  } & FormControlHintProps & {
16
18
  label?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../../src/ui/RadioGroup/RadioGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,uBAAuB,EAEvB,oBAAoB,EAEpB,qBAAqB,EACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAmC,eAAe,IAAI,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAIrH,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC;AAE/C,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,sBAAsB,EAAE,OAAO,GAAG,eAAe,GAAG,WAAW,CAAC,GACjG,uBAAuB,GACvB,qBAAqB,GACrB,oBAAoB,GAAG;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,sBAAsB,CAAC,OAAO,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,sBAAsB,CAAC,eAAe,CAAC,CAAC;IACnD,OAAO,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;CAC9B,CAAC;AAEJ,eAAO,MAAM,UAAU;;;;;YANX,MAAM;YACN,sBAAsB,CAAC,OAAO,CAAC;eAC5B,sBAAsB,CAAC,eAAe,CAAC;cACxC,SAAS,GAAG,MAAM;wCAuD9B,CAAC"}
1
+ {"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../../src/ui/RadioGroup/RadioGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,uBAAuB,EAEvB,oBAAoB,EAEpB,qBAAqB,EACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAmC,eAAe,IAAI,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAIrH,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC;AAE/C,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,sBAAsB,EAAE,OAAO,GAAG,eAAe,GAAG,WAAW,CAAC,GACjG,uBAAuB,GACvB,qBAAqB,GACrB,oBAAoB,GAAG;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,sBAAsB,CAAC,OAAO,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,sBAAsB,CAAC,eAAe,CAAC,CAAC;IACnD,OAAO,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;CAC9B,CAAC;AAEJ,eAAO,MAAM,UAAU;;;;;;;YANX,MAAM;YACN,sBAAsB,CAAC,OAAO,CAAC;eAC5B,sBAAsB,CAAC,eAAe,CAAC;cACxC,SAAS,GAAG,MAAM;wCAuD9B,CAAC"}
@@ -6,6 +6,8 @@ declare const _default: {
6
6
  component: import("react").ForwardRefExoticComponent<Omit<import("tamagui").RadioGroupProps, "direction" | "value" | "onValueChange"> & import("..").FormControlCaptionProps & {
7
7
  label: string;
8
8
  labelRight?: React.ReactNode;
9
+ optional?: boolean;
10
+ optionalText?: string;
9
11
  disabled?: boolean;
10
12
  } & import("..").FormControlHintProps & {
11
13
  label?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/RadioGroup/RadioGroup.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wBAOkB;AAElB,eAAO,MAAM,OAAO,mCASnB,CAAC;AAEF,eAAO,MAAM,KAAK,mCAQjB,CAAC;AAEF,eAAO,MAAM,SAAS,mCAOrB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC"}
1
+ {"version":3,"file":"RadioGroup.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/RadioGroup/RadioGroup.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wBAOkB;AAElB,eAAO,MAAM,OAAO,mCASnB,CAAC;AAEF,eAAO,MAAM,KAAK,mCAQjB,CAAC;AAEF,eAAO,MAAM,SAAS,mCAOrB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC"}
@@ -5,6 +5,8 @@ export { RadioGroupItemProps } from './RadioGroupItem';
5
5
  export declare const RadioGroup: import("react").ForwardRefExoticComponent<Omit<import("tamagui").RadioGroupProps, "direction" | "value" | "onValueChange"> & import("..").FormControlCaptionProps & {
6
6
  label: string;
7
7
  labelRight?: React.ReactNode;
8
+ optional?: boolean;
9
+ optionalText?: string;
8
10
  disabled?: boolean;
9
11
  } & import("..").FormControlHintProps & {
10
12
  label?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/RadioGroup/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,eAAO,MAAM,UAAU;;;;;;;;;;;;CAGrB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/RadioGroup/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;CAGrB,CAAC"}
@@ -1,13 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { FlashList } from '@shopify/flash-list';
3
- import { ActivityIndicator } from 'react-native';
4
3
  import { Box, Typography } from '../../core';
4
+ import { Spinner } from '../Spinner';
5
5
  import { useStyles } from './ResourceList.styles';
6
6
  export const ResourceList = (props) => {
7
7
  const { style, data, isLoading, withPagination, renderNoContent, noBorder = false, withWhiteBackground = false, titre, ...listProps } = props;
8
8
  const styles = useStyles();
9
9
  if (isLoading) {
10
- return (_jsx(Box, { tag: "resource-list-loader", style: styles.loader, children: _jsx(ActivityIndicator, { size: "large", style: { margin: 'auto' } }) }));
10
+ return (_jsx(Box, { tag: "resource-list-loader", style: styles.loader, children: _jsx(Spinner, { size: "lg" }) }));
11
11
  }
12
12
  if (!data || data.length === 0)
13
13
  return renderNoContent();
@@ -53,6 +53,13 @@ export declare const Default: () => import("react").JSX.Element;
53
53
  export declare const WithTitle: () => import("react").JSX.Element;
54
54
  export declare const WithIcon: () => import("react").JSX.Element;
55
55
  export declare const WithPreviewImageAndTrailing: () => import("react").JSX.Element;
56
+ /**
57
+ * Quand `isLoading` est `true`, la liste entière est remplacée par un
58
+ * spinner centré. Aucun délai n'est appliqué ici : le chargement initial
59
+ * d'une liste vide n'a rien à afficher, le spinner apparaît donc
60
+ * immédiatement pour éviter un écran blanc sans feedback.
61
+ */
62
+ export declare const IsLoading: () => import("react").JSX.Element;
56
63
  export declare const WithNoContent: () => import("react").JSX.Element;
57
64
  export declare const WithDivider: () => import("react").JSX.Element;
58
65
  export * as Sources from './ResourceList.stories.sources';
@@ -1 +1 @@
1
- {"version":3,"file":"ResourceList.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/ResourceList/ResourceList.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,wBASkB;AA6BlB,eAAO,MAAM,OAAO,mCASnB,CAAC;AAEF,eAAO,MAAM,SAAS,mCAUrB,CAAC;AAEF,eAAO,MAAM,QAAQ,mCAcpB,CAAC;AAEF,eAAO,MAAM,2BAA2B,mCAevC,CAAC;AAEF,eAAO,MAAM,aAAa,mCAOzB,CAAC;AAEF,eAAO,MAAM,WAAW,mCAUvB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,gCAAgC,CAAC"}
1
+ {"version":3,"file":"ResourceList.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/ResourceList/ResourceList.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,wBASkB;AA6BlB,eAAO,MAAM,OAAO,mCASnB,CAAC;AAEF,eAAO,MAAM,SAAS,mCAUrB,CAAC;AAEF,eAAO,MAAM,QAAQ,mCAcpB,CAAC;AAEF,eAAO,MAAM,2BAA2B,mCAevC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,SAAS,mCAQrB,CAAC;AAEF,eAAO,MAAM,aAAa,mCAOzB,CAAC;AAEF,eAAO,MAAM,WAAW,mCAUvB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,gCAAgC,CAAC"}
@@ -43,6 +43,13 @@ export const Default = () => (_jsx(ResourceList, { data: exampleData, keyExtract
43
43
  export const WithTitle = () => (_jsx(ResourceList, { titre: "Titre de la liste", data: exampleData, keyExtractor: item => item.id, renderItem: ({ item, index }) => (_jsx(ListItem, { title: item.name, description: item.description, showSeparateur: index !== 0 })), renderNoContent: () => _jsx(EmptyState, { title: "Aucun \u00E9l\u00E9ment", description: "Cliquez sur le bouton", iconName: "House" }) }));
44
44
  export const WithIcon = () => (_jsx(ResourceList, { data: exampleData, keyExtractor: item => item.id, renderItem: ({ item, index }) => (_jsx(ListItem, { title: item.name, description: item.description, IconProps: { name: 'Settings' }, showSeparateur: index !== 0 })), renderNoContent: () => _jsx(EmptyState, { title: "Aucun \u00E9l\u00E9ment", description: "Cliquez sur le bouton", iconName: "House" }) }));
45
45
  export const WithPreviewImageAndTrailing = () => (_jsx(ResourceList, { data: exampleDataWithPreview, keyExtractor: item => item.id, renderItem: ({ item, index }) => (_jsx(ListItem, { title: item.name, description: item.description, preview_url: item.preview_url, trailing: () => _jsx(LucideIcon, { name: "ChevronRight", size: "sm" }), showSeparateur: index !== 0 })), renderNoContent: () => _jsx(EmptyState, { title: "Aucun \u00E9l\u00E9ment", description: "Cliquez sur le bouton", iconName: "House" }) }));
46
+ /**
47
+ * Quand `isLoading` est `true`, la liste entière est remplacée par un
48
+ * spinner centré. Aucun délai n'est appliqué ici : le chargement initial
49
+ * d'une liste vide n'a rien à afficher, le spinner apparaît donc
50
+ * immédiatement pour éviter un écran blanc sans feedback.
51
+ */
52
+ export const IsLoading = () => (_jsx(ResourceList, { data: [], isLoading: true, keyExtractor: item => item.id, renderItem: () => null, renderNoContent: () => null }));
46
53
  export const WithNoContent = () => (_jsx(ResourceList, { data: [], keyExtractor: item => item.id, renderItem: ({ item }) => _jsx(ListItem, { title: item.name, description: item.description }), renderNoContent: () => _jsx(EmptyState, { title: "Aucun \u00E9l\u00E9ment", description: "Cliquez sur le bouton", iconName: "House" }) }));
47
54
  export const WithDivider = () => (_jsx(ResourceList, { data: exampleData, keyExtractor: item => item.id, renderItem: ({ item, index }) => (_jsx(ListItem, { title: item.name, description: item.description, showSeparateur: index !== 0 })), ItemSeparatorComponent: ResourceListDivider, renderNoContent: () => _jsx(EmptyState, { title: "Aucun \u00E9l\u00E9ment", description: "Cliquez sur le bouton", iconName: "House" }) }));
48
55
  export * as Sources from './ResourceList.stories.sources';
@@ -2,6 +2,7 @@ export declare const Default: () => string;
2
2
  export declare const WithTitle: () => string;
3
3
  export declare const WithIcon: () => string;
4
4
  export declare const WithPreviewImageAndTrailing: () => string;
5
+ export declare const IsLoading: () => string;
5
6
  export declare const WithNoContent: () => string;
6
7
  export declare const WithDivider: () => string;
7
8
  export declare const storySources: {
@@ -9,8 +10,10 @@ export declare const storySources: {
9
10
  readonly WithTitle: () => string;
10
11
  readonly WithIcon: () => string;
11
12
  readonly WithPreviewImageAndTrailing: () => string;
13
+ readonly IsLoading: () => string;
12
14
  readonly WithNoContent: () => string;
13
15
  readonly WithDivider: () => string;
14
16
  };
15
17
  export type StorySourceName = keyof typeof storySources;
18
+ export declare const storyDescriptions: Partial<Record<StorySourceName, string>>;
16
19
  //# sourceMappingURL=ResourceList.stories.sources.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ResourceList.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/ResourceList/ResourceList.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,cAA+Y,CAAC;AAEpa,eAAO,MAAM,SAAS,cAAkb,CAAC;AAEzc,eAAO,MAAM,QAAQ,cAA4d,CAAC;AAElf,eAAO,MAAM,2BAA2B,cAAmkB,CAAC;AAE5mB,eAAO,MAAM,aAAa,cAA8W,CAAC;AAEzY,eAAO,MAAM,WAAW,cAAqc,CAAC;AAE9d,eAAO,MAAM,YAAY;;;;;;;CAOf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC"}
1
+ {"version":3,"file":"ResourceList.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/ResourceList/ResourceList.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,cAA+Y,CAAC;AAEpa,eAAO,MAAM,SAAS,cAAkb,CAAC;AAEzc,eAAO,MAAM,QAAQ,cAA4d,CAAC;AAElf,eAAO,MAAM,2BAA2B,cAAmkB,CAAC;AAE5mB,eAAO,MAAM,SAAS,cAAoO,CAAC;AAE3P,eAAO,MAAM,aAAa,cAA8W,CAAC;AAEzY,eAAO,MAAM,WAAW,cAAqc,CAAC;AAE9d,eAAO,MAAM,YAAY;;;;;;;;CAQf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC;AAExD,eAAO,MAAM,iBAAiB,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAEtE,CAAC"}
@@ -4,6 +4,7 @@ export const Default = () => "export const Default = () => (\n <ResourceList\n
4
4
  export const WithTitle = () => "export const WithTitle = () => (\n <ResourceList\n titre=\"Titre de la liste\"\n data={exampleData}\n keyExtractor={item => item.id}\n renderItem={({ item, index }) => (\n <ListItem title={item.name} description={item.description} showSeparateur={index !== 0} />\n )}\n renderNoContent={() => <EmptyState title=\"Aucun élément\" description=\"Cliquez sur le bouton\" iconName=\"House\" />}\n />\n);";
5
5
  export const WithIcon = () => "export const WithIcon = () => (\n <ResourceList\n data={exampleData}\n keyExtractor={item => item.id}\n renderItem={({ item, index }) => (\n <ListItem\n title={item.name}\n description={item.description}\n IconProps={{ name: 'Settings' }}\n showSeparateur={index !== 0}\n />\n )}\n renderNoContent={() => <EmptyState title=\"Aucun élément\" description=\"Cliquez sur le bouton\" iconName=\"House\" />}\n />\n);";
6
6
  export const WithPreviewImageAndTrailing = () => "export const WithPreviewImageAndTrailing = () => (\n <ResourceList\n data={exampleDataWithPreview}\n keyExtractor={item => item.id}\n renderItem={({ item, index }) => (\n <ListItem\n title={item.name}\n description={item.description}\n preview_url={item.preview_url}\n trailing={() => <LucideIcon name=\"ChevronRight\" size=\"sm\" />}\n showSeparateur={index !== 0}\n />\n )}\n renderNoContent={() => <EmptyState title=\"Aucun élément\" description=\"Cliquez sur le bouton\" iconName=\"House\" />}\n />\n);";
7
+ export const IsLoading = () => "export const IsLoading = () => (\n <ResourceList\n data={[] as typeof exampleData}\n isLoading={true}\n keyExtractor={item => item.id}\n renderItem={() => null}\n renderNoContent={() => null}\n />\n);";
7
8
  export const WithNoContent = () => "export const WithNoContent = () => (\n <ResourceList\n data={[] as typeof exampleData}\n keyExtractor={item => item.id}\n renderItem={({ item }) => <ListItem title={item.name} description={item.description} />}\n renderNoContent={() => <EmptyState title=\"Aucun élément\" description=\"Cliquez sur le bouton\" iconName=\"House\" />}\n />\n);";
8
9
  export const WithDivider = () => "export const WithDivider = () => (\n <ResourceList\n data={exampleData}\n keyExtractor={item => item.id}\n renderItem={({ item, index }) => (\n <ListItem title={item.name} description={item.description} showSeparateur={index !== 0} />\n )}\n ItemSeparatorComponent={ResourceListDivider}\n renderNoContent={() => <EmptyState title=\"Aucun élément\" description=\"Cliquez sur le bouton\" iconName=\"House\" />}\n />\n);";
9
10
  export const storySources = {
@@ -11,6 +12,10 @@ export const storySources = {
11
12
  WithTitle,
12
13
  WithIcon,
13
14
  WithPreviewImageAndTrailing,
15
+ IsLoading,
14
16
  WithNoContent,
15
17
  WithDivider,
16
18
  };
19
+ export const storyDescriptions = {
20
+ IsLoading: "Quand `isLoading` est `true`, la liste entière est remplacée par un\nspinner centré. Aucun délai n'est appliqué ici : le chargement initial\nd'une liste vide n'a rien à afficher, le spinner apparaît donc\nimmédiatement pour éviter un écran blanc sans feedback.",
21
+ };
@@ -14,6 +14,8 @@ export type SelectProps = Partial<Pick<PickerProps, 'onBlur' | 'onFocus'>> & For
14
14
  export declare const Select: React.ForwardRefExoticComponent<Partial<Pick<PickerProps<import("@react-native-picker/picker/typings/Picker").ItemValue>, "onFocus" | "onBlur">> & {
15
15
  label: string;
16
16
  labelRight?: React.ReactNode;
17
+ optional?: boolean;
18
+ optionalText?: string;
17
19
  disabled?: boolean;
18
20
  } & FormControlCaptionProps & FormControlHintProps & {
19
21
  value: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/ui/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,uBAAuB,EAEvB,oBAAoB,EAEpB,qBAAqB,EAGtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,MAAM,MAAM,YAAY,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5D,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,GAAG,SAAS,CAAC,CAAC,GACxE,qBAAqB,GACrB,oBAAoB,GACpB,uBAAuB,GAAG;IACxB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC3C,CAAC;AAEJ,eAAO,MAAM,MAAM;;;;;WANR,MAAM,GAAG,IAAI;kBACN,MAAM;aACX,YAAY,EAAE;eACZ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI;0DAkE3C,CAAC"}
1
+ {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/ui/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,uBAAuB,EAEvB,oBAAoB,EAEpB,qBAAqB,EAGtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,MAAM,MAAM,YAAY,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5D,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,GAAG,SAAS,CAAC,CAAC,GACxE,qBAAqB,GACrB,oBAAoB,GACpB,uBAAuB,GAAG;IACxB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC3C,CAAC;AAEJ,eAAO,MAAM,MAAM;;;;;;;WANR,MAAM,GAAG,IAAI;kBACN,MAAM;aACX,YAAY,EAAE;eACZ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI;0DAkE3C,CAAC"}
@@ -6,6 +6,8 @@ declare const _default: {
6
6
  component: import("react").ForwardRefExoticComponent<Partial<Pick<import("@react-native-picker/picker").PickerProps<import("@react-native-picker/picker/typings/Picker").ItemValue>, "onFocus" | "onBlur">> & {
7
7
  label: string;
8
8
  labelRight?: React.ReactNode;
9
+ optional?: boolean;
10
+ optionalText?: string;
9
11
  disabled?: boolean;
10
12
  } & import("..").FormControlCaptionProps & import("..").FormControlHintProps & {
11
13
  value: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"Select.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Select/Select.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wBAOkB;AAQlB,eAAO,MAAM,OAAO,mCAOnB,CAAC;AAEF,eAAO,MAAM,MAAM,mCAOlB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"Select.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Select/Select.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wBAOkB;AAQlB,eAAO,MAAM,OAAO,mCAOnB,CAAC;AAEF,eAAO,MAAM,MAAM,mCAOlB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,0BAA0B,CAAC"}
@@ -3,6 +3,8 @@ import type { SelectMultipleOption } from './SelectMultiple';
3
3
  export declare const SelectMultiple: React.ForwardRefExoticComponent<{
4
4
  label: string;
5
5
  labelRight?: React.ReactNode;
6
+ optional?: boolean;
7
+ optionalText?: string;
6
8
  disabled?: boolean;
7
9
  } & import("@alveole/components").FormControlCaptionProps & import("@alveole/components").FormControlHintProps & {
8
10
  options?: SelectMultipleOption[];
@@ -1 +1 @@
1
- {"version":3,"file":"SelectMultiple.web.d.ts","sourceRoot":"","sources":["../../../src/ui/SelectMultiple/SelectMultiple.web.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,oBAAoB,EAAuB,MAAM,kBAAkB,CAAC;AAGlF,eAAO,MAAM,cAAc;;;;;;;;;;6BA4EzB,CAAC"}
1
+ {"version":3,"file":"SelectMultiple.web.d.ts","sourceRoot":"","sources":["../../../src/ui/SelectMultiple/SelectMultiple.web.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,oBAAoB,EAAuB,MAAM,kBAAkB,CAAC;AAGlF,eAAO,MAAM,cAAc;;;;;;;;;;;;6BA4EzB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { SpinnerProps } from './Spinner.shared';
3
+ export type { SpinnerProps };
4
+ export declare const Spinner: ({ size, delay, style }: SpinnerProps) => React.JSX.Element | null;
5
+ //# sourceMappingURL=Spinner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../../src/ui/Spinner/Spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAsB,YAAY,EAAc,MAAM,kBAAkB,CAAC;AAGhF,YAAY,EAAE,YAAY,EAAE,CAAC;AAS7B,eAAO,MAAM,OAAO,GAAI,wBAA+B,YAAY,6BAsDlE,CAAC"}
@@ -0,0 +1,47 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import { Animated, Easing } from 'react-native';
4
+ import { Circle, Svg } from 'react-native-svg';
5
+ import { DELAY_MS, SIZE_MAP, STROKE_MAP } from './Spinner.shared';
6
+ import { useStyles } from './Spinner.styles';
7
+ function resolveDelay(delay) {
8
+ if (delay === undefined || delay === false)
9
+ return null;
10
+ if (delay === true)
11
+ return 1000;
12
+ if (typeof delay === 'string')
13
+ return DELAY_MS[delay] ?? 0;
14
+ return delay;
15
+ }
16
+ export const Spinner = ({ size = 'md', delay, style }) => {
17
+ const styles = useStyles();
18
+ const [rotation] = React.useState(() => new Animated.Value(0));
19
+ const delayMs = React.useMemo(() => resolveDelay(delay), [delay]);
20
+ const [visible, setVisible] = React.useState(delayMs === null);
21
+ const px = SIZE_MAP[size];
22
+ const strokeWidth = STROKE_MAP[size];
23
+ const r = (px - strokeWidth) / 2;
24
+ const cx = px / 2;
25
+ const circumference = 2 * Math.PI * r;
26
+ const dashArray = `${circumference * 0.75} ${circumference * 0.25}`;
27
+ const spin = rotation.interpolate({ inputRange: [0, 1], outputRange: ['0deg', '360deg'] });
28
+ React.useEffect(() => {
29
+ if (delayMs === null)
30
+ return;
31
+ const timer = setTimeout(() => setVisible(true), delayMs);
32
+ return () => clearTimeout(timer);
33
+ }, [delayMs]);
34
+ React.useEffect(() => {
35
+ const anim = Animated.loop(Animated.timing(rotation, {
36
+ toValue: 1,
37
+ duration: 800,
38
+ easing: Easing.linear,
39
+ useNativeDriver: true,
40
+ }));
41
+ anim.start();
42
+ return () => anim.stop();
43
+ }, [rotation]);
44
+ if (!visible)
45
+ return null;
46
+ return (_jsx(Animated.View, { style: [{ width: px, height: px, transform: [{ rotate: spin }] }, style], children: _jsxs(Svg, { width: px, height: px, viewBox: `0 0 ${px} ${px}`, children: [_jsx(Circle, { cx: cx, cy: cx, r: r, fill: "none", strokeWidth: strokeWidth, stroke: styles.track.color }), _jsx(Circle, { cx: cx, cy: cx, r: r, fill: "none", strokeWidth: strokeWidth, stroke: styles.arc.color, strokeDasharray: dashArray, strokeLinecap: "round", rotation: -90, origin: `${cx}, ${cx}` })] }) }));
47
+ };
@@ -0,0 +1,12 @@
1
+ import type { ViewStyle } from 'react-native';
2
+ export type SpinnerSize = 'sm' | 'md' | 'lg';
3
+ export type SpinnerDelay = boolean | 'short' | 'long' | number;
4
+ export type SpinnerProps = {
5
+ size?: SpinnerSize;
6
+ delay?: SpinnerDelay;
7
+ style?: ViewStyle;
8
+ };
9
+ export declare const SIZE_MAP: Record<SpinnerSize, number>;
10
+ export declare const STROKE_MAP: Record<SpinnerSize, number>;
11
+ export declare const DELAY_MS: Record<string, number>;
12
+ //# sourceMappingURL=Spinner.shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spinner.shared.d.ts","sourceRoot":"","sources":["../../../src/ui/Spinner/Spinner.shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE7C,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAE/D,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAA8B,CAAC;AAChF,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAA2B,CAAC;AAC/E,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAA8B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export const SIZE_MAP = { sm: 16, md: 32, lg: 64 };
2
+ export const STROKE_MAP = { sm: 2, md: 3, lg: 5 };
3
+ export const DELAY_MS = { short: 300, long: 1000 };
@@ -0,0 +1,21 @@
1
+ declare const _default: {
2
+ title: string;
3
+ tags: "ui"[];
4
+ experimental: false;
5
+ description: string;
6
+ shortDescription: string;
7
+ component: ({ size, delay, style }: import("./Spinner.shared").SpinnerProps) => import("react").JSX.Element | null;
8
+ styleFn: () => {
9
+ track: {
10
+ color: string;
11
+ };
12
+ arc: {
13
+ color: string;
14
+ };
15
+ };
16
+ };
17
+ export default _default;
18
+ export declare const Sizes: () => import("react").JSX.Element;
19
+ export declare const WithDelay: () => import("react").JSX.Element;
20
+ export * as Sources from './Spinner.stories.sources';
21
+ //# sourceMappingURL=Spinner.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spinner.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Spinner/Spinner.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAKA,wBAiBkB;AAElB,eAAO,MAAM,KAAK,mCAMjB,CAAC;AAEF,eAAO,MAAM,SAAS,mCAKrB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box } from '../../core';
3
+ import { Spinner } from './Spinner';
4
+ import { useStyles } from './Spinner.styles';
5
+ export default {
6
+ title: 'Spinner',
7
+ tags: ['ui'],
8
+ experimental: false,
9
+ description: `Indicateur de chargement animé en rotation.
10
+
11
+ Trois tailles disponibles : \`sm\` (16 px), \`md\` (32 px, défaut) et \`lg\` (64 px).
12
+
13
+ La prop \`delay\` permet de retarder l'apparition du spinner pour éviter un flash sur les opérations rapides :
14
+ - \`false\` / absent : visible immédiatement
15
+ - \`true\` : délai de 1 000 ms
16
+ - \`"short"\` : 300 ms
17
+ - \`"long"\` : 1 000 ms
18
+ - \`number\` : délai personnalisé en millisecondes`,
19
+ shortDescription: 'Indicateur de chargement animé disponible en trois tailles.',
20
+ component: Spinner,
21
+ styleFn: useStyles,
22
+ };
23
+ export const Sizes = () => (_jsxs(Box, { display: "flex", flexDirection: "row", style: { alignItems: 'center' }, gap: 16, children: [_jsx(Spinner, { size: "sm" }), _jsx(Spinner, { size: "md" }), _jsx(Spinner, { size: "lg" })] }));
24
+ export const WithDelay = () => (_jsxs(Box, { display: "flex", flexDirection: "row", style: { alignItems: 'center' }, gap: 16, children: [_jsx(Spinner, { size: "md", delay: "short" }, "short"), _jsx(Spinner, { size: "md", delay: "long" }, "long")] }));
25
+ export * as Sources from './Spinner.stories.sources';
@@ -0,0 +1,8 @@
1
+ export declare const Sizes: () => string;
2
+ export declare const WithDelay: () => string;
3
+ export declare const storySources: {
4
+ readonly Sizes: () => string;
5
+ readonly WithDelay: () => string;
6
+ };
7
+ export type StorySourceName = keyof typeof storySources;
8
+ //# sourceMappingURL=Spinner.stories.sources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spinner.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/Spinner/Spinner.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK,cAAsO,CAAC;AAEzP,eAAO,MAAM,SAAS,cAAuQ,CAAC;AAE9R,eAAO,MAAM,YAAY;;;CAGf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC"}
@@ -0,0 +1,8 @@
1
+ // This file is generated. Do not edit manually.
2
+ // Source: src/ui/Spinner/Spinner.stories.tsx
3
+ export const Sizes = () => "export const Sizes = () => (\n <Box display=\"flex\" flexDirection=\"row\" style={{ alignItems: 'center' }} gap={16}>\n <Spinner size=\"sm\" />\n <Spinner size=\"md\" />\n <Spinner size=\"lg\" />\n </Box>\n);";
4
+ export const WithDelay = () => "export const WithDelay = () => (\n <Box display=\"flex\" flexDirection=\"row\" style={{ alignItems: 'center' }} gap={16}>\n <Spinner size=\"md\" delay=\"short\" key=\"short\" />\n <Spinner size=\"md\" delay=\"long\" key=\"long\" />\n </Box>\n);";
5
+ export const storySources = {
6
+ Sizes,
7
+ WithDelay,
8
+ };
@@ -0,0 +1,9 @@
1
+ export declare const useStyles: () => {
2
+ track: {
3
+ color: string;
4
+ };
5
+ arc: {
6
+ color: string;
7
+ };
8
+ };
9
+ //# sourceMappingURL=Spinner.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spinner.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/Spinner/Spinner.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;CAGnB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { makeStyles } from '@alveole/theme';
2
+ export const useStyles = makeStyles(({ color }) => ({
3
+ track: { color: color.light.border['default-grey'] },
4
+ arc: { color: color.light.artwork['major-primary'] },
5
+ }));
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { SpinnerProps } from './Spinner.shared';
3
+ export type { SpinnerProps };
4
+ export declare const Spinner: ({ size, delay, style }: SpinnerProps) => React.JSX.Element | null;
5
+ //# sourceMappingURL=Spinner.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spinner.web.d.ts","sourceRoot":"","sources":["../../../src/ui/Spinner/Spinner.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAsB,YAAY,EAAc,MAAM,kBAAkB,CAAC;AAGhF,YAAY,EAAE,YAAY,EAAE,CAAC;AAS7B,eAAO,MAAM,OAAO,GAAI,wBAA+B,YAAY,6BA+ClE,CAAC"}
@@ -0,0 +1,53 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import { Animated, Easing } from 'react-native';
4
+ import { DELAY_MS, SIZE_MAP, STROKE_MAP } from './Spinner.shared';
5
+ import { useStyles } from './Spinner.styles';
6
+ function resolveDelay(delay) {
7
+ if (delay === undefined || delay === false)
8
+ return null;
9
+ if (delay === true)
10
+ return 1000;
11
+ if (typeof delay === 'string')
12
+ return DELAY_MS[delay] ?? 0;
13
+ return delay;
14
+ }
15
+ export const Spinner = ({ size = 'md', delay, style }) => {
16
+ const styles = useStyles();
17
+ const [rotation] = React.useState(() => new Animated.Value(0));
18
+ const delayMs = React.useMemo(() => resolveDelay(delay), [delay]);
19
+ const [visible, setVisible] = React.useState(delayMs === null);
20
+ const px = SIZE_MAP[size];
21
+ const strokeWidth = STROKE_MAP[size];
22
+ const spin = rotation.interpolate({ inputRange: [0, 1], outputRange: ['0deg', '360deg'] });
23
+ React.useEffect(() => {
24
+ if (delayMs === null)
25
+ return;
26
+ const timer = setTimeout(() => setVisible(true), delayMs);
27
+ return () => clearTimeout(timer);
28
+ }, [delayMs]);
29
+ React.useEffect(() => {
30
+ const anim = Animated.loop(Animated.timing(rotation, {
31
+ toValue: 1,
32
+ duration: 800,
33
+ easing: Easing.linear,
34
+ useNativeDriver: false,
35
+ }));
36
+ anim.start();
37
+ return () => anim.stop();
38
+ }, [rotation]);
39
+ if (!visible)
40
+ return null;
41
+ return (_jsx(Animated.View, { style: [
42
+ {
43
+ width: px,
44
+ height: px,
45
+ borderRadius: px / 2,
46
+ borderWidth: strokeWidth,
47
+ borderColor: styles.track.color,
48
+ borderTopColor: styles.arc.color,
49
+ transform: [{ rotate: spin }],
50
+ },
51
+ style,
52
+ ] }));
53
+ };
@@ -0,0 +1,2 @@
1
+ export * from './Spinner';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/Spinner/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './Spinner';
@@ -14,6 +14,8 @@ export declare const TextField: React.ForwardRefExoticComponent<Omit<import("rea
14
14
  } & {
15
15
  label: string;
16
16
  labelRight?: React.ReactNode;
17
+ optional?: boolean;
18
+ optionalText?: string;
17
19
  disabled?: boolean;
18
20
  } & FormControlCaptionProps & FormControlHintProps & {
19
21
  type?: "text" | "hidden";
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../src/ui/TextField/TextField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,uBAAuB,EAEvB,oBAAoB,EAEpB,qBAAqB,EAIrB,cAAc,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,MAAM,cAAc,GAAG,cAAc,GACzC,qBAAqB,GACrB,oBAAoB,GACpB,uBAAuB,GAAG;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IACzB,QAAQ,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CAC3C,CAAC;AAEJ,eAAO,MAAM,SAAS;;;;;;;;;;;;WAJX,MAAM,GAAG,QAAQ;eACb,cAAc,CAAC,cAAc,CAAC;0DAqC3C,CAAC"}
1
+ {"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../src/ui/TextField/TextField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,uBAAuB,EAEvB,oBAAoB,EAEpB,qBAAqB,EAIrB,cAAc,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,MAAM,cAAc,GAAG,cAAc,GACzC,qBAAqB,GACrB,oBAAoB,GACpB,uBAAuB,GAAG;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IACzB,QAAQ,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CAC3C,CAAC;AAEJ,eAAO,MAAM,SAAS;;;;;;;;;;;;;;WAJX,MAAM,GAAG,QAAQ;eACb,cAAc,CAAC,cAAc,CAAC;0DAqC3C,CAAC"}
@@ -13,6 +13,8 @@ declare const _default: {
13
13
  } & {
14
14
  label: string;
15
15
  labelRight?: React.ReactNode;
16
+ optional?: boolean;
17
+ optionalText?: string;
16
18
  disabled?: boolean;
17
19
  } & import("..").FormControlCaptionProps & import("..").FormControlHintProps & {
18
20
  type?: "text" | "hidden";
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/TextField/TextField.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAKA,wBAOkB;AAElB,eAAO,MAAM,OAAO,mCAMnB,CAAC;AAEF,eAAO,MAAM,MAAM,mCAOlB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,6BAA6B,CAAC"}
1
+ {"version":3,"file":"TextField.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/TextField/TextField.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wBAOkB;AAElB,eAAO,MAAM,OAAO,mCAMnB,CAAC;AAEF,eAAO,MAAM,MAAM,mCAOlB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,6BAA6B,CAAC"}
@@ -14,6 +14,8 @@ export declare const TextareaField: React.ForwardRefExoticComponent<Omit<import(
14
14
  } & {
15
15
  label: string;
16
16
  labelRight?: React.ReactNode;
17
+ optional?: boolean;
18
+ optionalText?: string;
17
19
  disabled?: boolean;
18
20
  } & FormControlCaptionProps & FormControlHintProps & {
19
21
  onChange?: TextInputProps["onChangeText"];
@@ -1 +1 @@
1
- {"version":3,"file":"TextareaField.d.ts","sourceRoot":"","sources":["../../../src/ui/TextareaField/TextareaField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,uBAAuB,EAEvB,oBAAoB,EAEpB,qBAAqB,EAGrB,cAAc,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,MAAM,kBAAkB,GAAG,cAAc,GAC7C,qBAAqB,GACrB,oBAAoB,GACpB,uBAAuB,GAAG;IACxB,QAAQ,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;IAC1C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEJ,eAAO,MAAM,aAAa;;;;;;;;;;;;eAJX,cAAc,CAAC,cAAc,CAAC;oBACzB,MAAM;0DAoBxB,CAAC"}
1
+ {"version":3,"file":"TextareaField.d.ts","sourceRoot":"","sources":["../../../src/ui/TextareaField/TextareaField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,uBAAuB,EAEvB,oBAAoB,EAEpB,qBAAqB,EAGrB,cAAc,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,MAAM,kBAAkB,GAAG,cAAc,GAC7C,qBAAqB,GACrB,oBAAoB,GACpB,uBAAuB,GAAG;IACxB,QAAQ,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;IAC1C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEJ,eAAO,MAAM,aAAa;;;;;;;;;;;;;;eAJX,cAAc,CAAC,cAAc,CAAC;oBACzB,MAAM;0DAoBxB,CAAC"}
@@ -13,6 +13,8 @@ declare const _default: {
13
13
  } & {
14
14
  label: string;
15
15
  labelRight?: React.ReactNode;
16
+ optional?: boolean;
17
+ optionalText?: string;
16
18
  disabled?: boolean;
17
19
  } & import("..").FormControlCaptionProps & import("..").FormControlHintProps & {
18
20
  onChange?: import("..").TextInputProps["onChangeText"];
@@ -1 +1 @@
1
- {"version":3,"file":"TextareaField.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/TextareaField/TextareaField.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAIA,wBAOkB;AAElB,eAAO,MAAM,OAAO,mCAMnB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,iCAAiC,CAAC"}
1
+ {"version":3,"file":"TextareaField.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/TextareaField/TextareaField.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAIA,wBAOkB;AAElB,eAAO,MAAM,OAAO,mCAMnB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,iCAAiC,CAAC"}
@@ -14,6 +14,8 @@ export declare const TextareaInput: React.ForwardRefExoticComponent<Omit<import(
14
14
  } & {
15
15
  label: string;
16
16
  labelRight?: React.ReactNode;
17
+ optional?: boolean;
18
+ optionalText?: string;
17
19
  disabled?: boolean;
18
20
  } & import("@alveole/components").FormControlCaptionProps & import("@alveole/components").FormControlHintProps & {
19
21
  type?: "text" | "hidden";
@@ -1 +1 @@
1
- {"version":3,"file":"TextareaInput.d.ts","sourceRoot":"","sources":["../../../src/ui/TextareaInput/TextareaInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAa,cAAc,EAAE,MAAM,cAAc,CAAC;AAEzD,MAAM,MAAM,kBAAkB,GAAG,cAAc,GAAG;IAChD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;oBAJR,MAAM;oBACN,MAAM,IAAI;0DAoB3B,CAAC"}
1
+ {"version":3,"file":"TextareaInput.d.ts","sourceRoot":"","sources":["../../../src/ui/TextareaInput/TextareaInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAa,cAAc,EAAE,MAAM,cAAc,CAAC;AAEzD,MAAM,MAAM,kBAAkB,GAAG,cAAc,GAAG;IAChD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;oBAJR,MAAM;oBACN,MAAM,IAAI;0DAoB3B,CAAC"}
@@ -13,6 +13,8 @@ declare const _default: {
13
13
  } & {
14
14
  label: string;
15
15
  labelRight?: React.ReactNode;
16
+ optional?: boolean;
17
+ optionalText?: string;
16
18
  disabled?: boolean;
17
19
  } & import("..").FormControlCaptionProps & import("..").FormControlHintProps & {
18
20
  type?: "text" | "hidden";
@@ -1 +1 @@
1
- {"version":3,"file":"TextareaInput.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/TextareaInput/TextareaInput.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,wBAOkB;AAElB,eAAO,MAAM,OAAO,mCAMnB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,iCAAiC,CAAC"}
1
+ {"version":3,"file":"TextareaInput.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/TextareaInput/TextareaInput.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,wBAOkB;AAElB,eAAO,MAAM,OAAO,mCAMnB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,iCAAiC,CAAC"}