@gouvfr-lasuite/ui-kit 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { Context } from 'react';
2
2
  import { CunninghamProvider as CunninghamProvider_2 } from '@openfun/cunningham-react';
3
3
  import { CursorProps } from 'react-arborist';
4
+ import { default as default_2 } from 'react';
4
5
  import { Dispatch } from 'react';
5
6
  import { JSX } from 'react/jsx-runtime';
6
7
  import { Key } from 'react-stately';
@@ -64,6 +65,8 @@ export declare type BaseTreeViewData<T> = {
64
65
  nodeType?: Exclude<TreeViewNodeTypeEnum, TreeViewNodeTypeEnum.TITLE | TreeViewNodeTypeEnum.SEPARATOR>;
65
66
  } & T));
66
67
 
68
+ export declare const containerSizeMap: Record<IconSize, number>;
69
+
67
70
  export declare const cunninghamConfig: {
68
71
  themes: {
69
72
  default: {
@@ -443,11 +446,25 @@ export declare type FilterProps = {
443
446
 
444
447
  export declare const Footer: () => JSX.Element;
445
448
 
449
+ export declare const getContainerSize: (iconSize: IconSize) => number;
450
+
451
+ export declare const getIconSize: (iconSize: IconSize) => number;
452
+
446
453
  export declare function getLocales(): {
447
454
  "en-US": any;
448
455
  "fr-FR": any;
449
456
  };
450
457
 
458
+ /**
459
+ * Get a consistent avatar's color according to a hash of the name
460
+ */
461
+ export declare const getUserColor: (name: string) => string;
462
+
463
+ /**
464
+ * Split the name into parts and return the first two initials
465
+ */
466
+ export declare const getUserInitials: (name: string) => string;
467
+
451
468
  export declare const Header: ({ leftIcon, rightIcon, languages, onTogglePanel, isPanelOpen, }: HeaderProps) => JSX.Element;
452
469
 
453
470
  export declare const headerHeight = 52;
@@ -474,6 +491,50 @@ export declare const HomeGutter: ({ children }: {
474
491
 
475
492
  export declare const HorizontalSeparator: ({ withPadding }: Props_3) => JSX.Element;
476
493
 
494
+ export declare const Icon: default_2.FC<IconProps>;
495
+
496
+ export declare type IconProps = {
497
+ /**
498
+ * The name of the Material Icon to display
499
+ */
500
+ name: string;
501
+ /**
502
+ * The type of the icon
503
+ */
504
+ type?: IconType;
505
+ /**
506
+ * The size of the icon
507
+ */
508
+ size?: IconSize | number;
509
+ /**
510
+ * Custom CSS class name
511
+ */
512
+ className?: string;
513
+ /**
514
+ * Custom color for the icon
515
+ */
516
+ color?: string;
517
+ /**
518
+ * Additional props to pass to the span element
519
+ */
520
+ [key: string]: unknown;
521
+ };
522
+
523
+ export declare enum IconSize {
524
+ X_SMALL = "xsmall",
525
+ SMALL = "small",
526
+ MEDIUM = "medium",
527
+ LARGE = "large",
528
+ X_LARGE = "xlarge"
529
+ }
530
+
531
+ export declare const iconSizeMap: Record<IconSize, number>;
532
+
533
+ export declare enum IconType {
534
+ OUTLINED = "outlined",
535
+ FILLED = "filled"
536
+ }
537
+
477
538
  export declare type InvitationData<UserType, T> = T & {
478
539
  id: string;
479
540
  role: string;