@egen-civitas/esm-styleguide 1.4.0 → 1.5.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 (29) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/assistant/spline-scene.component.d.ts +5 -0
  3. package/dist/assistant/spline-scene.component.d.ts.map +1 -1
  4. package/dist/assistant/spline-scene.component.js +22 -18
  5. package/dist/selections/autocomplete/autocomplete.component.d.ts +82 -0
  6. package/dist/selections/autocomplete/autocomplete.component.d.ts.map +1 -0
  7. package/dist/selections/autocomplete/autocomplete.component.js +1114 -0
  8. package/dist/selections/autocomplete/index.d.ts +2 -0
  9. package/dist/selections/autocomplete/index.d.ts.map +1 -0
  10. package/dist/selections/autocomplete/index.js +1 -0
  11. package/dist/selections/combobox/combobox.component.d.ts +87 -0
  12. package/dist/selections/combobox/combobox.component.d.ts.map +1 -0
  13. package/dist/selections/combobox/combobox.component.js +392 -0
  14. package/dist/selections/combobox/index.d.ts +2 -0
  15. package/dist/selections/combobox/index.d.ts.map +1 -0
  16. package/dist/selections/combobox/index.js +1 -0
  17. package/dist/selections/index.d.ts +3 -0
  18. package/dist/selections/index.d.ts.map +1 -1
  19. package/dist/selections/index.js +8 -0
  20. package/dist/selections/morph-select/index.d.ts +2 -0
  21. package/dist/selections/morph-select/index.d.ts.map +1 -0
  22. package/dist/selections/morph-select/index.js +1 -0
  23. package/dist/selections/morph-select/morph-select.component.d.ts +69 -0
  24. package/dist/selections/morph-select/morph-select.component.d.ts.map +1 -0
  25. package/dist/selections/morph-select/morph-select.component.js +336 -0
  26. package/dist/selections/shared/selection-icons.d.ts +17 -0
  27. package/dist/selections/shared/selection-icons.d.ts.map +1 -0
  28. package/dist/selections/shared/selection-icons.js +52 -0
  29. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @egen-civitas/esm-styleguide
2
2
 
3
+ ## 1.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - cd162d1: Corrige 1.4.0 : importer le styleguide déclenchait le préchargement réseau de la scène Spline (1,3 Mo) pour toutes les apps. `SplineScene` charge désormais Spline à la demande (`React.lazy`) et le préchargement devient explicite via `preloadSplineScene(url)`.
8
+
9
+ ## 1.5.0
10
+
11
+ ### Minor Changes
12
+
13
+ - bfe6b03: Catégorie `selections` (Tailwind) : ajoute `MorphSelect` (trigger qui se morphe en panneau — `MorphSelectTrigger/Value/Content/Item`), `Autocomplete` (capsule Material 3 : simple/multi-sélection, création, ripple, chips) et `Combobox` (déclencheur + recherche, design shadcn reproduit sans Radix/cmdk). Design copié à l'identique des sources, entièrement configurable par le consommateur (`classNames` par zone, textes, rendus personnalisés, transitions, placement…). Icônes en SVG inline : aucune nouvelle dépendance.
14
+
15
+ `@egen-civitas/tailwind-preset` : ajoute les tokens sémantiques (`background`, `foreground`, `card`, `popover`, `muted`, `accent`, `secondary`, `primary`, `border`, `input`, `ring`, `destructive`) reliés à `colors.surface.*` / `colors.border.*` du thème EGEN (light/dark et surcharges tenant inclus), pour que `bg-card`, `text-foreground`, `border-border`… s'affichent réellement dans les composants Tailwind du styleguide.
16
+
3
17
  ## 1.4.0
4
18
 
5
19
  ### Minor Changes
@@ -4,6 +4,11 @@ interface SplineSceneProps {
4
4
  className?: string;
5
5
  onLoad?: (splineApp: unknown) => void;
6
6
  }
7
+ /**
8
+ * Préchauffe le cache navigateur avec une scène Spline (~1,3 Mo). À appeler explicitement
9
+ * (ouverture de l'assistant, idle…) — jamais au chargement du module.
10
+ */
11
+ export declare function preloadSplineScene(url: string): void;
7
12
  export declare function SplineScene({ scene, className, onLoad }: SplineSceneProps): React.JSX.Element;
8
13
  export default SplineScene;
9
14
  //# sourceMappingURL=spline-scene.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spline-scene.component.d.ts","sourceRoot":"","sources":["../../src/assistant/spline-scene.component.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,UAAU,gBAAgB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CACvC;AAiBD,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,SAA2B,EAAE,MAAM,EAAE,EAAE,gBAAgB,qBA4B3F;AAED,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"spline-scene.component.d.ts","sourceRoot":"","sources":["../../src/assistant/spline-scene.component.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmC,MAAM,OAAO,CAAC;AAMxD,UAAU,gBAAgB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CACvC;AAID;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CASpD;AAED,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,SAA2B,EAAE,MAAM,EAAE,EAAE,gBAAgB,qBA8B3F;AAED,eAAe,WAAW,CAAC"}
@@ -1,21 +1,22 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import React, { useState } from "react";
4
- import Spline from "@splinetool/react-spline";
5
- // Global preload helper to pre-fetch the 1.3MB 3D scene immediately into browser cache
6
- if (typeof window !== 'undefined') {
7
- const PRELOAD_URL = "https://prod.spline.design/kZDDjO5HuC9GJUM2/scene.splinecode";
8
- // Preload link tag
3
+ import React, { Suspense, lazy, useState } from "react";
4
+ // Spline (runtime WebGL ~ plusieurs centaines de Ko) est chargé à la demande : importer le
5
+ // styleguide ne doit JAMAIS déclencher de téléchargement ni d'effet de bord réseau.
6
+ const Spline = /*#__PURE__*/ lazy(()=>import("@splinetool/react-spline"));
7
+ const preloaded = new Set();
8
+ /**
9
+ * Préchauffe le cache navigateur avec une scène Spline (~1,3 Mo). À appeler explicitement
10
+ * (ouverture de l'assistant, idle…) — jamais au chargement du module.
11
+ */ export function preloadSplineScene(url) {
12
+ if (typeof document === 'undefined' || preloaded.has(url)) return;
13
+ preloaded.add(url);
9
14
  const link = document.createElement('link');
10
15
  link.rel = 'preload';
11
16
  link.as = 'fetch';
12
17
  link.crossOrigin = 'anonymous';
13
- link.href = PRELOAD_URL;
18
+ link.href = url;
14
19
  document.head.appendChild(link);
15
- // Background fetch to cache it in memory
16
- fetch(PRELOAD_URL, {
17
- mode: 'cors'
18
- }).catch(()=>{});
19
20
  }
20
21
  export function SplineScene({ scene, className = 'w-full h-full', onLoad }) {
21
22
  const [isLoaded, setIsLoaded] = useState(false);
@@ -36,13 +37,16 @@ export function SplineScene({ scene, className = 'w-full h-full', onLoad }) {
36
37
  }),
37
38
  /*#__PURE__*/ _jsx("div", {
38
39
  className: `w-full h-full transition-opacity duration-500 ${isLoaded ? 'opacity-100' : 'opacity-0'}`,
39
- children: /*#__PURE__*/ _jsx(Spline, {
40
- scene: scene,
41
- className: "w-full h-full",
42
- onLoad: (splineApp)=>{
43
- setIsLoaded(true);
44
- if (onLoad) onLoad(splineApp);
45
- }
40
+ children: /*#__PURE__*/ _jsx(Suspense, {
41
+ fallback: null,
42
+ children: /*#__PURE__*/ _jsx(Spline, {
43
+ scene: scene,
44
+ className: "w-full h-full",
45
+ onLoad: (splineApp)=>{
46
+ setIsLoaded(true);
47
+ if (onLoad) onLoad(splineApp);
48
+ }
49
+ })
46
50
  })
47
51
  })
48
52
  ]
@@ -0,0 +1,82 @@
1
+ import * as React from "react";
2
+ export interface AutocompleteItemData {
3
+ value: string;
4
+ label: string;
5
+ description?: string;
6
+ tag?: string;
7
+ [key: string]: any;
8
+ }
9
+ /** État passé à `renderItem` pour adapter le rendu d'une option. */
10
+ export interface AutocompleteItemState {
11
+ isActive: boolean;
12
+ isSelected: boolean;
13
+ isDisabled: boolean;
14
+ }
15
+ /** Classes additionnelles par zone du composant (fusionnées avec les classes par défaut). */
16
+ export interface AutocompleteClassNames {
17
+ /** Conteneur externe (réserve la hauteur en flux). */
18
+ root?: string;
19
+ /** Capsule (surface qui s'étend à l'ouverture). */
20
+ container?: string;
21
+ /** Ligne de saisie (input + bouton). */
22
+ inputRow?: string;
23
+ input?: string;
24
+ toggleButton?: string;
25
+ /** Ligne des chips (multi-sélection). */
26
+ chipsRow?: string;
27
+ chip?: string;
28
+ clearButton?: string;
29
+ /** `<ul>` de la liste d'options. */
30
+ list?: string;
31
+ item?: string;
32
+ emptyState?: string;
33
+ loadingState?: string;
34
+ }
35
+ /** Textes affichés par le composant (i18n). */
36
+ export interface AutocompleteLabels {
37
+ /** Message quand aucune option ne correspond. Défaut : prop `emptyMessage`. */
38
+ empty?: string;
39
+ loading?: string;
40
+ /** Libellé du bouton « tout effacer » (multi). */
41
+ clear?: string;
42
+ /** Libellé de l'option de création. Défaut : `Create "<saisie>"`. */
43
+ create?: (inputValue: string) => string;
44
+ /** aria-label du bouton d'ouverture. */
45
+ toggle?: string;
46
+ }
47
+ export interface AutocompleteProps {
48
+ items: AutocompleteItemData[];
49
+ placeholder?: string;
50
+ emptyMessage?: string;
51
+ value?: string | string[];
52
+ onValueChange?: (value: any) => void;
53
+ disabled?: boolean;
54
+ isCreatable?: boolean;
55
+ onCreate?: (value: string) => void;
56
+ className?: string;
57
+ onInputChange?: (value: string) => void;
58
+ loading?: boolean;
59
+ filterFn?: ((item: AutocompleteItemData, query: string) => boolean) | false | null;
60
+ debounceInterval?: number;
61
+ name?: string;
62
+ id?: string;
63
+ required?: boolean;
64
+ "aria-label"?: string;
65
+ "aria-labelledby"?: string;
66
+ maxOptions?: number;
67
+ minOptions?: number;
68
+ /** Classes additionnelles par zone. */
69
+ classNames?: AutocompleteClassNames;
70
+ /** Textes (i18n). */
71
+ labels?: AutocompleteLabels;
72
+ /** Rendu personnalisé du contenu d'une option (remplace label/description/tag). */
73
+ renderItem?: (item: AutocompleteItemData, state: AutocompleteItemState) => React.ReactNode;
74
+ /** Hauteur maximale de la liste en px. Défaut : 260. */
75
+ maxListHeight?: number;
76
+ /** Largeur maximale (px) du libellé d'un chip. Défaut : 120. */
77
+ chipMaxWidth?: number;
78
+ /** Style inline appliqué au conteneur externe. */
79
+ style?: React.CSSProperties;
80
+ }
81
+ export declare function Autocomplete({ items, placeholder, emptyMessage, value, onValueChange, disabled, isCreatable, onCreate, className, onInputChange, loading, filterFn, debounceInterval, name, id, required, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, maxOptions, minOptions, classNames, labels, renderItem, maxListHeight, chipMaxWidth, style, }: AutocompleteProps): React.JSX.Element;
82
+ //# sourceMappingURL=autocomplete.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autocomplete.component.d.ts","sourceRoot":"","sources":["../../../src/selections/autocomplete/autocomplete.component.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,oEAAoE;AACpE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,6FAA6F;AAC7F,MAAM,WAAW,sBAAsB;IACrC,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB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