@mittwald/flow-react-components 1.6.0-next.60 → 1.6.0-next.61

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 (82) hide show
  1. package/AGENTS.md +11 -0
  2. package/MIGRATION.md +205 -0
  3. package/USAGE.md +1 -1
  4. package/dist/assets/component-index.json +1 -1
  5. package/dist/assets/doc-properties.json +1 -1
  6. package/dist/css/all-layered.css +1 -1
  7. package/dist/css/all.css +8 -6
  8. package/dist/js/default.mjs +1 -1
  9. package/dist/js/internal.mjs +2 -2
  10. package/dist/js/packages/components/src/components/AccentBox/AccentBox.mjs +35 -11
  11. package/dist/js/packages/components/src/components/AccentBox/AccentBox.mjs.map +1 -1
  12. package/dist/js/packages/components/src/components/AccentBox/AccentBox.module.mjs +11 -11
  13. package/dist/js/packages/components/src/components/AccentBox/AccentBox.module.mjs.map +1 -1
  14. package/dist/js/packages/components/src/components/Accordion/Accordion.mjs +1 -1
  15. package/dist/js/packages/components/src/components/ActionGroup/ActionGroup.mjs +1 -1
  16. package/dist/js/packages/components/src/components/Alert/Alert.module.mjs.map +1 -1
  17. package/dist/js/packages/components/src/components/Avatar/Avatar.mjs +8 -2
  18. package/dist/js/packages/components/src/components/Avatar/Avatar.mjs.map +1 -1
  19. package/dist/js/packages/components/src/components/Avatar/Avatar.module.mjs +9 -7
  20. package/dist/js/packages/components/src/components/Avatar/Avatar.module.mjs.map +1 -1
  21. package/dist/js/packages/components/src/components/Avatar/avatarColors.mjs +3 -7
  22. package/dist/js/packages/components/src/components/Avatar/avatarColors.mjs.map +1 -1
  23. package/dist/js/packages/components/src/components/Badge/Badge.mjs +16 -3
  24. package/dist/js/packages/components/src/components/Badge/Badge.mjs.map +1 -1
  25. package/dist/js/packages/components/src/components/Badge/Badge.module.mjs +11 -11
  26. package/dist/js/packages/components/src/components/Badge/Badge.module.mjs.map +1 -1
  27. package/dist/js/packages/components/src/components/Breadcrumb/Breadcrumb.mjs +1 -1
  28. package/dist/js/packages/components/src/components/Button/Button.mjs +1 -1
  29. package/dist/js/packages/components/src/components/CartesianChart/components/Area/Area.mjs +1 -1
  30. package/dist/js/packages/components/src/components/CartesianChart/components/Area/Area.mjs.map +1 -1
  31. package/dist/js/packages/components/src/components/CartesianChart/components/Bar/Bar.mjs +1 -1
  32. package/dist/js/packages/components/src/components/CartesianChart/components/Bar/Bar.mjs.map +1 -1
  33. package/dist/js/packages/components/src/components/CartesianChart/components/Line/Line.mjs +1 -1
  34. package/dist/js/packages/components/src/components/CartesianChart/components/Line/Line.mjs.map +1 -1
  35. package/dist/js/packages/components/src/components/CodeEditor/themes/defaultEditorTheme.mjs +10 -10
  36. package/dist/js/packages/components/src/components/CodeEditor/themes/defaultEditorTheme.mjs.map +1 -1
  37. package/dist/js/packages/components/src/components/Color/Color.mjs +5 -6
  38. package/dist/js/packages/components/src/components/Color/Color.mjs.map +1 -1
  39. package/dist/js/packages/components/src/components/Color/Color.module.mjs +7 -5
  40. package/dist/js/packages/components/src/components/Color/Color.module.mjs.map +1 -1
  41. package/dist/js/packages/components/src/components/DonutChart/components/DonutChartFill.mjs +1 -1
  42. package/dist/js/packages/components/src/components/DonutChart/components/DonutChartFill.mjs.map +1 -1
  43. package/dist/js/packages/components/src/components/HeaderNavigation/HeaderNavigation.mjs +1 -1
  44. package/dist/js/packages/components/src/components/Heading/Heading.mjs +1 -1
  45. package/dist/js/packages/components/src/components/Icon/Icon.mjs +5 -7
  46. package/dist/js/packages/components/src/components/Icon/Icon.mjs.map +1 -1
  47. package/dist/js/packages/components/src/components/Icon/Icon.module.mjs +7 -5
  48. package/dist/js/packages/components/src/components/Icon/Icon.module.mjs.map +1 -1
  49. package/dist/js/packages/components/src/components/IllustratedMessage/IllustratedMessage.mjs +1 -1
  50. package/dist/js/packages/components/src/components/Initials/lib/getColorFromInitials.mjs +1 -1
  51. package/dist/js/packages/components/src/components/Initials/lib/getColorFromInitials.mjs.map +1 -1
  52. package/dist/js/packages/components/src/components/Legend/components/LegendItem/LegendItem.mjs +1 -1
  53. package/dist/js/packages/components/src/components/Legend/components/LegendItem/LegendItem.mjs.map +1 -1
  54. package/dist/js/packages/components/src/components/Link/Link.mjs +1 -1
  55. package/dist/js/packages/components/src/components/LoadingSpinner/LoadingSpinner.mjs +1 -1
  56. package/dist/js/packages/components/src/components/Notification/Notification.module.mjs.map +1 -1
  57. package/dist/js/packages/components/src/components/Overlay/Overlay.module.mjs.map +1 -1
  58. package/dist/js/packages/components/src/components/ProgressBar/components/ProgressBarBar.mjs +1 -1
  59. package/dist/js/packages/components/src/components/ProgressBar/components/ProgressBarBar.mjs.map +1 -1
  60. package/dist/js/packages/components/src/components/Text/Text.mjs +1 -1
  61. package/dist/js/packages/components/src/lib/hooks/useDeprecatedColor.mjs +20 -0
  62. package/dist/js/packages/components/src/lib/hooks/useDeprecatedColor.mjs.map +1 -0
  63. package/dist/js/packages/components/src/lib/tokens/CategoricalColors.mjs +1 -1
  64. package/dist/js/packages/components/src/lib/tokens/CategoricalColors.mjs.map +1 -1
  65. package/dist/js/packages/components/src/lib/types/props.mjs +17 -1
  66. package/dist/js/packages/components/src/lib/types/props.mjs.map +1 -1
  67. package/dist/js/packages/design-tokens/dist/json-runtime/all-dark.mjs +1779 -1270
  68. package/dist/js/packages/design-tokens/dist/json-runtime/all-dark.mjs.map +1 -1
  69. package/dist/js/packages/design-tokens/dist/json-runtime/all-light.mjs +1779 -1270
  70. package/dist/js/packages/design-tokens/dist/json-runtime/all-light.mjs.map +1 -1
  71. package/dist/types/components/AccentBox/AccentBox.d.ts +12 -3
  72. package/dist/types/components/Avatar/Avatar.d.ts +7 -3
  73. package/dist/types/components/Avatar/avatarColors.d.ts +2 -1
  74. package/dist/types/components/Badge/Badge.d.ts +19 -3
  75. package/dist/types/components/Color/Color.d.ts +8 -4
  76. package/dist/types/components/Icon/Icon.d.ts +5 -3
  77. package/dist/types/lib/hooks/useDeprecatedColor.d.ts +9 -0
  78. package/dist/types/lib/theming/hooks/useDesignTokens.d.ts +1478 -958
  79. package/dist/types/lib/tokens/CategoricalColors.d.ts +1 -1
  80. package/dist/types/lib/tokens/getCategoricalColorByIndex.d.ts +1 -1
  81. package/dist/types/lib/types/props.d.ts +12 -0
  82. package/package.json +10 -10
@@ -1,13 +1,22 @@
1
1
  import { CSSProperties, PropsWithChildren } from 'react';
2
2
  import { AlphaColor, PropsWithClassName, PropsWithElementType } from '../../lib/types/props';
3
3
  import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
4
- declare const accentBoxBackgroundColors: readonly ["neutral", "blue", "violet", "teal", "lilac", "green", "navy", "gradient"];
4
+ declare const accentBoxBackgroundColors: readonly ["neutral", "blue", "navy", "lilac", "sage", "salmon", "gradient-navy", "gradient-sage", "gradient-lilac", "gradient-salmon", ...("violet" | "teal")[], "gradient", "green"];
5
5
  type AccentBoxBackgroundColor = (typeof accentBoxBackgroundColors)[number];
6
6
  type AccentBoxWithCustomBackgroundColor = AccentBoxBackgroundColor | (string & {});
7
7
  export interface AccentBoxProps extends PropsWithChildren, PropsWithElementType<"div" | "section" | "article">, PropsWithClassName, FlowComponentProps<HTMLElement> {
8
- /** The background color of the accent box. @default "neutral" */
8
+ /**
9
+ * The background color of the accent box. Besides the Flow colors, any custom
10
+ * CSS color is supported.
11
+ *
12
+ * @default "neutral"
13
+ * @deprecatedValues violet, teal, green, gradient
14
+ */
9
15
  backgroundColor?: AccentBoxWithCustomBackgroundColor;
10
- /** The content color of the accent box. @default "default" */
16
+ /**
17
+ * The content color of the accent box. Defaults to `dark` on the decorative
18
+ * colors and the gradients, otherwise to `default`.
19
+ */
11
20
  color?: "default" | AlphaColor;
12
21
  /** The background image of the accent box. */
13
22
  backgroundImage?: string;
@@ -1,12 +1,16 @@
1
1
  import { PropsWithChildren } from 'react';
2
- import { PropsWithClassName, Status } from '../../lib/types/props';
2
+ import { DeprecatedDecorativeColor, PropsWithClassName, Status } from '../../lib/types/props';
3
3
  import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
4
4
  import { avatarColors } from './avatarColors';
5
- export type AvatarColors = (typeof avatarColors)[number];
5
+ export type AvatarColors = (typeof avatarColors)[number] | DeprecatedDecorativeColor | "green";
6
6
  export interface AvatarProps extends PropsWithChildren, PropsWithClassName, FlowComponentProps {
7
7
  /** The size of the avatar. @default "m" */
8
8
  size?: "xs" | "s" | "m" | "l";
9
- /** The color of icons and initials inside the avatar. */
9
+ /**
10
+ * The color of icons and initials inside the avatar.
11
+ *
12
+ * @deprecatedValues violet, teal, green
13
+ */
10
14
  color?: AvatarColors;
11
15
  /**
12
16
  * Adds status icon and color to the avatar. May only be used if the status is
@@ -1 +1,2 @@
1
- export declare const avatarColors: readonly ["blue", "teal", "green", "violet", "lilac"];
1
+ /** The colors an avatar offers, and the palette of dynamic initials. */
2
+ export declare const avatarColors: readonly ["blue", "navy", "lilac", "sage", "salmon"];
@@ -2,14 +2,30 @@ import { PropsWithChildren } from 'react';
2
2
  import { PropsWithClassName } from '../../lib/types/props';
3
3
  import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
4
4
  import { PressEvent } from '@react-types/shared';
5
- export declare const badgeColors: readonly ["neutral", "blue", "navy", "violet", "teal", "lilac", "green", "orange", "red", "dark", "light", "dark-static", "light-static"];
6
- export type BadgeColors = (typeof badgeColors)[number];
5
+ export declare const badgeColors: readonly ["neutral", "blue", "navy", "lilac", "sage", "salmon", "success", "warning", "danger", "dark", "light", "dark-static", "light-static"];
6
+ /**
7
+ * Deprecated badge colors and the color each renders as. The status hues are
8
+ * named by their meaning now, and the brand's green and orange are `sage` and
9
+ * `salmon`.
10
+ */
11
+ declare const deprecatedBadgeColors: {
12
+ readonly green: "success";
13
+ readonly orange: "warning";
14
+ readonly red: "danger";
15
+ readonly violet: "lilac";
16
+ readonly teal: "sage";
17
+ };
18
+ export type BadgeColors = (typeof badgeColors)[number] | keyof typeof deprecatedBadgeColors;
7
19
  export interface BadgeProps extends PropsWithChildren, FlowComponentProps<HTMLSpanElement>, PropsWithClassName {
8
20
  /** Handler that is called when the badge is pressed. */
9
21
  onPress?: (e: PressEvent) => void;
10
22
  /** Handler that is called when the badges close icon is pressed. */
11
23
  onClose?: (e: PressEvent) => void;
12
- /** The color of the badge. @default "neutral" */
24
+ /**
25
+ * The color of the badge. @default "neutral"
26
+ *
27
+ * @deprecatedValues violet, teal, green, orange, red
28
+ */
13
29
  color?: BadgeColors;
14
30
  /** Whether the badge is disabled. */
15
31
  isDisabled?: boolean;
@@ -1,10 +1,14 @@
1
1
  import { FC, PropsWithChildren } from 'react';
2
- import { PropsWithClassName } from '../../lib/types/props';
3
- declare const flowColors: readonly ["blue", "violet", "teal", "lilac", "info", "success", "warning", "danger", "unavailable", "dark", "light", "dark-static", "light-static"];
2
+ import { DeprecatedDecorativeColor, PropsWithClassName } from '../../lib/types/props';
3
+ declare const flowColors: readonly ["blue", "navy", "lilac", "sage", "salmon", "info", "success", "warning", "danger", "unavailable", "dark", "light", "dark-static", "light-static"];
4
4
  type FlowColor = (typeof flowColors)[number];
5
- type FlowWithCustomColor = FlowColor | (string & {});
5
+ type FlowWithCustomColor = FlowColor | DeprecatedDecorativeColor | (string & {});
6
6
  export interface ColorProps extends PropsWithChildren, PropsWithClassName {
7
- /** The color of the element. @default "blue" */
7
+ /**
8
+ * The color of the element. @default "blue"
9
+ *
10
+ * @deprecatedValues violet, teal
11
+ */
8
12
  color?: FlowWithCustomColor;
9
13
  }
10
14
  /** @flr-generate all */
@@ -1,16 +1,18 @@
1
1
  import { PropsWithChildren, SVGAttributes, default as React } from 'react';
2
2
  import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
3
- import { Status } from '../../lib/types/props';
3
+ import { DeprecatedDecorativeColor, Status } from '../../lib/types/props';
4
4
  type SvgAttributeProps = SVGAttributes<SVGSVGElement>;
5
- declare const iconColors: readonly ["neutral", "blue", "violet", "teal", "lilac", "info", "success", "warning", "danger", "unavailable", "dark", "light", "dark-static", "light-static"];
5
+ declare const iconColors: readonly ["neutral", "blue", "navy", "lilac", "sage", "salmon", "info", "success", "warning", "danger", "unavailable", "dark", "light", "dark-static", "light-static"];
6
6
  type IconColor = (typeof iconColors)[number];
7
- type IconWithCustomColor = IconColor | (string & {});
7
+ type IconWithCustomColor = IconColor | DeprecatedDecorativeColor | (string & {});
8
8
  export interface IconProps extends PropsWithChildren<Omit<SvgAttributeProps, "name" | "color">>, FlowComponentProps {
9
9
  /** The size of the icon. @default "m" */
10
10
  size?: "s" | "m" | "l";
11
11
  /**
12
12
  * The color of the icon. Besides the Flow colors, any custom CSS color is
13
13
  * supported. Inherits the surrounding text color when unset.
14
+ *
15
+ * @deprecatedValues violet, teal
14
16
  */
15
17
  color?: IconWithCustomColor;
16
18
  /**
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Resolves a deprecated `color` prop value to the value it renders as, and
3
+ * warns when one is passed. Other values pass through unchanged. `prop` names
4
+ * the prop the replacement belongs on, where that is not the prop the value was
5
+ * passed to.
6
+ */
7
+ export declare const useDeprecatedColor: <TColor extends string, TReplacements extends Readonly<Record<string, string>>>(color: TColor | undefined, replacements: TReplacements, { prop }?: {
8
+ prop?: string;
9
+ }) => Exclude<TColor, keyof TReplacements> | TReplacements[keyof TReplacements] | undefined;