@mittwald/flow-react-components 1.6.0-next.66 → 1.6.0-next.68

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 (87) hide show
  1. package/AGENTS.md +0 -11
  2. package/MIGRATION.md +0 -205
  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 +6 -8
  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 +11 -35
  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 +2 -8
  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 +7 -9
  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 +7 -3
  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 +3 -16
  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/CodeEditor.mjs +17 -8
  36. package/dist/js/packages/components/src/components/CodeEditor/CodeEditor.mjs.map +1 -1
  37. package/dist/js/packages/components/src/components/CodeEditor/themes/defaultEditorTheme.mjs +10 -10
  38. package/dist/js/packages/components/src/components/CodeEditor/themes/defaultEditorTheme.mjs.map +1 -1
  39. package/dist/js/packages/components/src/components/Color/Color.mjs +6 -5
  40. package/dist/js/packages/components/src/components/Color/Color.mjs.map +1 -1
  41. package/dist/js/packages/components/src/components/Color/Color.module.mjs +5 -7
  42. package/dist/js/packages/components/src/components/Color/Color.module.mjs.map +1 -1
  43. package/dist/js/packages/components/src/components/DonutChart/components/DonutChartFill.mjs +1 -1
  44. package/dist/js/packages/components/src/components/DonutChart/components/DonutChartFill.mjs.map +1 -1
  45. package/dist/js/packages/components/src/components/HeaderNavigation/HeaderNavigation.mjs +1 -1
  46. package/dist/js/packages/components/src/components/Heading/Heading.mjs +1 -1
  47. package/dist/js/packages/components/src/components/Icon/Icon.mjs +7 -5
  48. package/dist/js/packages/components/src/components/Icon/Icon.mjs.map +1 -1
  49. package/dist/js/packages/components/src/components/Icon/Icon.module.mjs +5 -7
  50. package/dist/js/packages/components/src/components/Icon/Icon.module.mjs.map +1 -1
  51. package/dist/js/packages/components/src/components/IllustratedMessage/IllustratedMessage.mjs +1 -1
  52. package/dist/js/packages/components/src/components/Initials/lib/getColorFromInitials.mjs +1 -1
  53. package/dist/js/packages/components/src/components/Initials/lib/getColorFromInitials.mjs.map +1 -1
  54. package/dist/js/packages/components/src/components/Legend/components/LegendItem/LegendItem.mjs +1 -1
  55. package/dist/js/packages/components/src/components/Legend/components/LegendItem/LegendItem.mjs.map +1 -1
  56. package/dist/js/packages/components/src/components/Link/Link.mjs +1 -1
  57. package/dist/js/packages/components/src/components/LoadingSpinner/LoadingSpinner.mjs +1 -1
  58. package/dist/js/packages/components/src/components/Notification/Notification.module.mjs.map +1 -1
  59. package/dist/js/packages/components/src/components/Overlay/Overlay.module.mjs.map +1 -1
  60. package/dist/js/packages/components/src/components/ProgressBar/components/ProgressBarBar.mjs +1 -1
  61. package/dist/js/packages/components/src/components/ProgressBar/components/ProgressBarBar.mjs.map +1 -1
  62. package/dist/js/packages/components/src/components/Text/Text.mjs +1 -1
  63. package/dist/js/packages/components/src/lib/dom/getCspNonce.mjs +16 -0
  64. package/dist/js/packages/components/src/lib/dom/getCspNonce.mjs.map +1 -0
  65. package/dist/js/packages/components/src/lib/tokens/CategoricalColors.mjs +1 -1
  66. package/dist/js/packages/components/src/lib/tokens/CategoricalColors.mjs.map +1 -1
  67. package/dist/js/packages/components/src/lib/types/props.mjs +1 -17
  68. package/dist/js/packages/components/src/lib/types/props.mjs.map +1 -1
  69. package/dist/js/packages/design-tokens/dist/json-runtime/all-dark.mjs +1270 -1779
  70. package/dist/js/packages/design-tokens/dist/json-runtime/all-dark.mjs.map +1 -1
  71. package/dist/js/packages/design-tokens/dist/json-runtime/all-light.mjs +1270 -1779
  72. package/dist/js/packages/design-tokens/dist/json-runtime/all-light.mjs.map +1 -1
  73. package/dist/types/components/AccentBox/AccentBox.d.ts +3 -12
  74. package/dist/types/components/Avatar/Avatar.d.ts +3 -7
  75. package/dist/types/components/Avatar/avatarColors.d.ts +1 -2
  76. package/dist/types/components/Badge/Badge.d.ts +3 -19
  77. package/dist/types/components/Color/Color.d.ts +4 -8
  78. package/dist/types/components/Icon/Icon.d.ts +3 -5
  79. package/dist/types/lib/dom/getCspNonce.d.ts +6 -0
  80. package/dist/types/lib/theming/hooks/useDesignTokens.d.ts +889 -1409
  81. package/dist/types/lib/tokens/CategoricalColors.d.ts +1 -1
  82. package/dist/types/lib/tokens/getCategoricalColorByIndex.d.ts +1 -1
  83. package/dist/types/lib/types/props.d.ts +0 -12
  84. package/package.json +10 -10
  85. package/dist/js/packages/components/src/lib/hooks/useDeprecatedColor.mjs +0 -20
  86. package/dist/js/packages/components/src/lib/hooks/useDeprecatedColor.mjs.map +0 -1
  87. package/dist/types/lib/hooks/useDeprecatedColor.d.ts +0 -9
@@ -1 +1 @@
1
- {"version":3,"file":"Bar.mjs","names":[],"sources":["../../../../../../../../../src/components/CartesianChart/components/Bar/Bar.tsx"],"sourcesContent":["import { type ComponentType, type FC } from \"react\";\nimport * as Recharts from \"recharts\";\nimport type { CategoricalWithCustomColor } from \"@/lib/tokens/CategoricalColors\";\nimport { isCategoricalColor } from \"@/lib/tokens/isCategoricalColor\";\nimport {\n type ChartDataValue,\n type DataKeyProp,\n type DataKeyWithLabel,\n isDataKeyWithLabel,\n} from \"@/components/CartesianChart/types\";\nimport { useCartesianChartContext } from \"@/components/CartesianChart/context\";\nimport { useScopedStackId } from \"@/components/CartesianChart/hooks/useScopedStackId\";\nimport { useChartAnimation } from \"@/components/CartesianChart/hooks/useChartAnimation\";\nimport { useDesignTokens } from \"@/lib/theming\";\n\ntype BarBaseProps = Pick<\n Recharts.BarProps,\n | \"className\"\n | \"stackId\"\n | \"key\"\n | \"xAxisId\"\n | \"yAxisId\"\n | \"unit\"\n | \"barSize\"\n | \"maxBarSize\"\n | \"minPointSize\"\n> & {\n /** The color of the bar. @default \"sea-green\" */\n color?: CategoricalWithCustomColor;\n};\n\nexport interface BarPropsByDataKeyProp<\n TData extends ChartDataValue = ChartDataValue,\n> extends BarBaseProps {\n dataKey: DataKeyProp<TData>;\n}\n\nexport interface BarPropsByDataKey<\n TData extends ChartDataValue = ChartDataValue,\n>\n extends BarBaseProps, DataKeyWithLabel<TData> {}\n\nexport type BarProps<TData extends ChartDataValue = ChartDataValue> =\n BarPropsByDataKey<TData> | BarPropsByDataKeyProp<TData>;\n\n/** @flr-generate all */\nexport const Bar: FC<BarProps> = (props) => {\n const { color: colorFromProps = \"sea-green\", ...rest } = props;\n\n const tokens = useDesignTokens();\n const animation = useChartAnimation();\n const { layout } = useCartesianChartContext();\n const stackId = useScopedStackId(props.stackId);\n\n const color = isCategoricalColor(colorFromProps)\n ? `var(--categorical--color--${colorFromProps})`\n : colorFromProps;\n\n const cornerRadius = parseInt(tokens.bar[\"corner-radius\"].value);\n const radius: Recharts.BarProps[\"radius\"] =\n layout === \"vertical\"\n ? [0, cornerRadius, cornerRadius, 0]\n : [cornerRadius, cornerRadius, 0, 0];\n\n const bar = (\n <Recharts.Bar\n name={isDataKeyWithLabel(props) ? props.dataKeyLabel : props.dataKey}\n {...rest}\n stackId={stackId}\n fill={color}\n radius={stackId === undefined ? radius : 0}\n {...animation}\n />\n );\n\n if (stackId === undefined) {\n return bar;\n }\n\n // Every Bar of a stack renders its own BarStack, because a Bar cannot know\n // its siblings — they all describe the same clip path, so the duplicates are\n // redundant rather than conflicting.\n return (\n <Recharts.BarStack stackId={stackId} radius={radius}>\n {bar}\n </Recharts.BarStack>\n );\n};\n\nexport const TypedBar = <TData extends ChartDataValue = ChartDataValue>() =>\n Bar as ComponentType<BarPropsByDataKeyProp<TData>>;\n\nexport default Bar;\n"],"mappings":";;;;;;;;;;;;;AA8CA,IAAa,OAAqB,UAAU;CAC1C,MAAM,EAAE,OAAO,iBAAiB,aAAa,GAAG,SAAS;CAEzD,MAAM,SAAS,gBAAgB;CAC/B,MAAM,YAAY,kBAAkB;CACpC,MAAM,EAAE,WAAW,yBAAyB;CAC5C,MAAM,UAAU,iBAAiB,MAAM,OAAO;CAE9C,MAAM,QAAQ,mBAAmB,cAAc,IAC3C,6BAA6B,eAAe,KAC5C;CAEJ,MAAM,eAAe,SAAS,OAAO,IAAI,gBAAgB,CAAC,KAAK;CAC/D,MAAM,SACJ,WAAW,aACP;EAAC;EAAG;EAAc;EAAc;CAAC,IACjC;EAAC;EAAc;EAAc;EAAG;CAAC;CAEvC,MAAM,MACJ,oBAAC,SAAS,KAAV;EACE,MAAM,mBAAmB,KAAK,IAAI,MAAM,eAAe,MAAM;EAC7D,GAAI;EACK;EACT,MAAM;EACN,QAAQ,YAAY,KAAA,IAAY,SAAS;EACzC,GAAI;CACL,CAAA;CAGH,IAAI,YAAY,KAAA,GACd,OAAO;CAMT,OACE,oBAAC,SAAS,UAAV;EAA4B;EAAiB;EAC1C,UAAA;CACgB,CAAA;AAEvB;AAEA,IAAa,iBACX"}
1
+ {"version":3,"file":"Bar.mjs","names":[],"sources":["../../../../../../../../../src/components/CartesianChart/components/Bar/Bar.tsx"],"sourcesContent":["import { type ComponentType, type FC } from \"react\";\nimport * as Recharts from \"recharts\";\nimport type { CategoricalWithCustomColor } from \"@/lib/tokens/CategoricalColors\";\nimport { isCategoricalColor } from \"@/lib/tokens/isCategoricalColor\";\nimport {\n type ChartDataValue,\n type DataKeyProp,\n type DataKeyWithLabel,\n isDataKeyWithLabel,\n} from \"@/components/CartesianChart/types\";\nimport { useCartesianChartContext } from \"@/components/CartesianChart/context\";\nimport { useScopedStackId } from \"@/components/CartesianChart/hooks/useScopedStackId\";\nimport { useChartAnimation } from \"@/components/CartesianChart/hooks/useChartAnimation\";\nimport { useDesignTokens } from \"@/lib/theming\";\n\ntype BarBaseProps = Pick<\n Recharts.BarProps,\n | \"className\"\n | \"stackId\"\n | \"key\"\n | \"xAxisId\"\n | \"yAxisId\"\n | \"unit\"\n | \"barSize\"\n | \"maxBarSize\"\n | \"minPointSize\"\n> & {\n /** The color of the bar. @default \"sea-green\" */\n color?: CategoricalWithCustomColor;\n};\n\nexport interface BarPropsByDataKeyProp<\n TData extends ChartDataValue = ChartDataValue,\n> extends BarBaseProps {\n dataKey: DataKeyProp<TData>;\n}\n\nexport interface BarPropsByDataKey<\n TData extends ChartDataValue = ChartDataValue,\n>\n extends BarBaseProps, DataKeyWithLabel<TData> {}\n\nexport type BarProps<TData extends ChartDataValue = ChartDataValue> =\n BarPropsByDataKey<TData> | BarPropsByDataKeyProp<TData>;\n\n/** @flr-generate all */\nexport const Bar: FC<BarProps> = (props) => {\n const { color: colorFromProps = \"sea-green\", ...rest } = props;\n\n const tokens = useDesignTokens();\n const animation = useChartAnimation();\n const { layout } = useCartesianChartContext();\n const stackId = useScopedStackId(props.stackId);\n\n const color = isCategoricalColor(colorFromProps)\n ? `var(--color--categorical--${colorFromProps})`\n : colorFromProps;\n\n const cornerRadius = parseInt(tokens.bar[\"corner-radius\"].value);\n const radius: Recharts.BarProps[\"radius\"] =\n layout === \"vertical\"\n ? [0, cornerRadius, cornerRadius, 0]\n : [cornerRadius, cornerRadius, 0, 0];\n\n const bar = (\n <Recharts.Bar\n name={isDataKeyWithLabel(props) ? props.dataKeyLabel : props.dataKey}\n {...rest}\n stackId={stackId}\n fill={color}\n radius={stackId === undefined ? radius : 0}\n {...animation}\n />\n );\n\n if (stackId === undefined) {\n return bar;\n }\n\n // Every Bar of a stack renders its own BarStack, because a Bar cannot know\n // its siblings — they all describe the same clip path, so the duplicates are\n // redundant rather than conflicting.\n return (\n <Recharts.BarStack stackId={stackId} radius={radius}>\n {bar}\n </Recharts.BarStack>\n );\n};\n\nexport const TypedBar = <TData extends ChartDataValue = ChartDataValue>() =>\n Bar as ComponentType<BarPropsByDataKeyProp<TData>>;\n\nexport default Bar;\n"],"mappings":";;;;;;;;;;;;;AA8CA,IAAa,OAAqB,UAAU;CAC1C,MAAM,EAAE,OAAO,iBAAiB,aAAa,GAAG,SAAS;CAEzD,MAAM,SAAS,gBAAgB;CAC/B,MAAM,YAAY,kBAAkB;CACpC,MAAM,EAAE,WAAW,yBAAyB;CAC5C,MAAM,UAAU,iBAAiB,MAAM,OAAO;CAE9C,MAAM,QAAQ,mBAAmB,cAAc,IAC3C,6BAA6B,eAAe,KAC5C;CAEJ,MAAM,eAAe,SAAS,OAAO,IAAI,gBAAgB,CAAC,KAAK;CAC/D,MAAM,SACJ,WAAW,aACP;EAAC;EAAG;EAAc;EAAc;CAAC,IACjC;EAAC;EAAc;EAAc;EAAG;CAAC;CAEvC,MAAM,MACJ,oBAAC,SAAS,KAAV;EACE,MAAM,mBAAmB,KAAK,IAAI,MAAM,eAAe,MAAM;EAC7D,GAAI;EACK;EACT,MAAM;EACN,QAAQ,YAAY,KAAA,IAAY,SAAS;EACzC,GAAI;CACL,CAAA;CAGH,IAAI,YAAY,KAAA,GACd,OAAO;CAMT,OACE,oBAAC,SAAS,UAAV;EAA4B;EAAiB;EAC1C,UAAA;CACgB,CAAA;AAEvB;AAEA,IAAa,iBACX"}
@@ -13,7 +13,7 @@ var Line = (props) => {
13
13
  const { color: colorFromProps = "sea-green", ...rest } = props;
14
14
  const tokens = useDesignTokens();
15
15
  const animation = useChartAnimation();
16
- const color = isCategoricalColor(colorFromProps) ? `var(--categorical--color--${colorFromProps})` : colorFromProps;
16
+ const color = isCategoricalColor(colorFromProps) ? `var(--color--categorical--${colorFromProps})` : colorFromProps;
17
17
  return /* @__PURE__ */ jsx(Recharts.Line, {
18
18
  ...rest,
19
19
  fill: color,
@@ -1 +1 @@
1
- {"version":3,"file":"Line.mjs","names":[],"sources":["../../../../../../../../../src/components/CartesianChart/components/Line/Line.tsx"],"sourcesContent":["import { type ComponentType, type FC } from \"react\";\nimport * as Recharts from \"recharts\";\nimport { AreaDot } from \"../AreaDot\";\nimport type { CategoricalWithCustomColor } from \"@/lib/tokens/CategoricalColors\";\nimport { isCategoricalColor } from \"@/lib/tokens/isCategoricalColor\";\nimport type {\n ChartDataValue,\n DataKey,\n} from \"@/components/CartesianChart/types\";\nimport { useChartAnimation } from \"@/components/CartesianChart/hooks/useChartAnimation\";\nimport { useDesignTokens } from \"@/lib/theming\";\n\nexport interface LineProps<\n TData extends ChartDataValue = ChartDataValue,\n> extends Pick<\n Recharts.LineProps,\n \"className\" | \"key\" | \"xAxisId\" | \"yAxisId\" | \"type\" | \"unit\"\n> {\n dataKey?: DataKey<TData>;\n /** The color of the line. @default \"sea-green\" */\n color?: CategoricalWithCustomColor;\n}\n\n/** @flr-generate all */\nexport const Line: FC<LineProps> = (props) => {\n const { color: colorFromProps = \"sea-green\", ...rest } = props;\n\n const tokens = useDesignTokens();\n const animation = useChartAnimation();\n\n const color = isCategoricalColor(colorFromProps)\n ? `var(--categorical--color--${colorFromProps})`\n : colorFromProps;\n\n return (\n <Recharts.Line\n {...rest}\n fill={color}\n activeDot={<AreaDot color={color} />}\n dot={false}\n stroke={color}\n strokeWidth={tokens.line[\"border-width\"].value}\n {...animation}\n />\n );\n};\n\nexport const TypedLine = <T extends ChartDataValue = ChartDataValue>() =>\n Line as ComponentType<LineProps<T>>;\n\nexport default Line;\n"],"mappings":";;;;;;;;;;;AAwBA,IAAa,QAAuB,UAAU;CAC5C,MAAM,EAAE,OAAO,iBAAiB,aAAa,GAAG,SAAS;CAEzD,MAAM,SAAS,gBAAgB;CAC/B,MAAM,YAAY,kBAAkB;CAEpC,MAAM,QAAQ,mBAAmB,cAAc,IAC3C,6BAA6B,eAAe,KAC5C;CAEJ,OACE,oBAAC,SAAS,MAAV;EACE,GAAI;EACJ,MAAM;EACN,WAAW,oBAAC,SAAD,EAAgB,MAAQ,CAAA;EACnC,KAAK;EACL,QAAQ;EACR,aAAa,OAAO,KAAK,eAAe,CAAC;EACzC,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,kBACX"}
1
+ {"version":3,"file":"Line.mjs","names":[],"sources":["../../../../../../../../../src/components/CartesianChart/components/Line/Line.tsx"],"sourcesContent":["import { type ComponentType, type FC } from \"react\";\nimport * as Recharts from \"recharts\";\nimport { AreaDot } from \"../AreaDot\";\nimport type { CategoricalWithCustomColor } from \"@/lib/tokens/CategoricalColors\";\nimport { isCategoricalColor } from \"@/lib/tokens/isCategoricalColor\";\nimport type {\n ChartDataValue,\n DataKey,\n} from \"@/components/CartesianChart/types\";\nimport { useChartAnimation } from \"@/components/CartesianChart/hooks/useChartAnimation\";\nimport { useDesignTokens } from \"@/lib/theming\";\n\nexport interface LineProps<\n TData extends ChartDataValue = ChartDataValue,\n> extends Pick<\n Recharts.LineProps,\n \"className\" | \"key\" | \"xAxisId\" | \"yAxisId\" | \"type\" | \"unit\"\n> {\n dataKey?: DataKey<TData>;\n /** The color of the line. @default \"sea-green\" */\n color?: CategoricalWithCustomColor;\n}\n\n/** @flr-generate all */\nexport const Line: FC<LineProps> = (props) => {\n const { color: colorFromProps = \"sea-green\", ...rest } = props;\n\n const tokens = useDesignTokens();\n const animation = useChartAnimation();\n\n const color = isCategoricalColor(colorFromProps)\n ? `var(--color--categorical--${colorFromProps})`\n : colorFromProps;\n\n return (\n <Recharts.Line\n {...rest}\n fill={color}\n activeDot={<AreaDot color={color} />}\n dot={false}\n stroke={color}\n strokeWidth={tokens.line[\"border-width\"].value}\n {...animation}\n />\n );\n};\n\nexport const TypedLine = <T extends ChartDataValue = ChartDataValue>() =>\n Line as ComponentType<LineProps<T>>;\n\nexport default Line;\n"],"mappings":";;;;;;;;;;;AAwBA,IAAa,QAAuB,UAAU;CAC5C,MAAM,EAAE,OAAO,iBAAiB,aAAa,GAAG,SAAS;CAEzD,MAAM,SAAS,gBAAgB;CAC/B,MAAM,YAAY,kBAAkB;CAEpC,MAAM,QAAQ,mBAAmB,cAAc,IAC3C,6BAA6B,eAAe,KAC5C;CAEJ,OACE,oBAAC,SAAS,MAAV;EACE,GAAI;EACJ,MAAM;EACN,WAAW,oBAAC,SAAD,EAAgB,MAAQ,CAAA;EACnC,KAAK;EACL,QAAQ;EACR,aAAa,OAAO,KAAK,eAAe,CAAC;EACzC,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,kBACX"}
@@ -11,12 +11,17 @@ import CodeEditor_module_default from "./CodeEditor.module.mjs";
11
11
  import { defaultLightTheme } from "./themes/defaultEditorTheme.mjs";
12
12
  import { useCodeEditorExtensions } from "./hooks/useCodeEditorExtensions.mjs";
13
13
  import { CopyButton } from "../CopyButton/CopyButton.mjs";
14
+ import { getCspNonce } from "../../lib/dom/getCspNonce.mjs";
14
15
  import clsx from "clsx";
15
16
  import { useCallback, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
16
17
  import { jsx, jsxs } from "react/jsx-runtime";
17
18
  import { useObjectRef } from "react-aria";
18
19
  import CodeMirror, { EditorView } from "@uiw/react-codemirror";
19
20
  // src/components/CodeEditor/CodeEditor.tsx
21
+ var cspNonceExtensions = () => {
22
+ const nonce = getCspNonce();
23
+ return nonce ? [EditorView.cspNonce.of(nonce)] : [];
24
+ };
20
25
  /**
21
26
  * @flr-generate all
22
27
  * @flowStatus new
@@ -88,14 +93,18 @@ var CodeEditor = flowComponent("CodeEditor", (props) => {
88
93
  * `onChange` is a new object. All three are stable, so a render with
89
94
  * unchanged props leaves the editor as it is.
90
95
  */
91
- const allExtensions = useMemo(() => [...enabledExtensions, EditorView.contentAttributes.of({
92
- ...labelledBy ? { "aria-labelledby": labelledBy } : {},
93
- ...ariaLabel ? { "aria-label": ariaLabel } : {},
94
- ...describedBy ? { "aria-describedby": describedBy } : {},
95
- ...isRequired ? { "aria-required": "true" } : {},
96
- ...isInvalid ? { "aria-invalid": "true" } : {},
97
- ...isDisabled ? { "aria-disabled": "true" } : {}
98
- })], [
96
+ const allExtensions = useMemo(() => [
97
+ ...enabledExtensions,
98
+ ...cspNonceExtensions(),
99
+ EditorView.contentAttributes.of({
100
+ ...labelledBy ? { "aria-labelledby": labelledBy } : {},
101
+ ...ariaLabel ? { "aria-label": ariaLabel } : {},
102
+ ...describedBy ? { "aria-describedby": describedBy } : {},
103
+ ...isRequired ? { "aria-required": "true" } : {},
104
+ ...isInvalid ? { "aria-invalid": "true" } : {},
105
+ ...isDisabled ? { "aria-disabled": "true" } : {}
106
+ })
107
+ ], [
99
108
  enabledExtensions,
100
109
  labelledBy,
101
110
  ariaLabel,
@@ -1 +1 @@
1
- {"version":3,"file":"CodeEditor.mjs","names":["styles"],"sources":["../../../../../../../src/components/CodeEditor/CodeEditor.tsx"],"sourcesContent":["import type { ReactCodeMirrorProps, Statistics } from \"@uiw/react-codemirror\";\nimport CodeMirror, { EditorView } from \"@uiw/react-codemirror\";\nimport {\n useCallback,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\nimport { joinIds, useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport styles from \"./CodeEditor.module.scss\";\nimport { type CodeEditorLanguage } from \"@/components/CodeEditor/languages\";\nimport { useMakeFocusable } from \"@/lib/hooks/dom/useMakeFocusable\";\nimport { useObjectRef } from \"react-aria\";\nimport { defaultLightTheme } from \"@/components/CodeEditor/themes/defaultEditorTheme\";\nimport {\n type CodeEditorSetup,\n useCodeEditorExtensions,\n} from \"@/components/CodeEditor/hooks/useCodeEditorExtensions\";\nimport { CopyButton } from \"@/components/CopyButton\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\nimport { useSkeletonMode } from \"@/components/SkeletonMode/skeletonModeContext\";\n\nexport interface CodeEditorProps\n extends\n Omit<ReactCodeMirrorProps, \"theme\" | \"lang\" | \"basicSetup\" | \"readOnly\">,\n CodeEditorSetup,\n FlowComponentProps {\n /** The initial code of an uncontrolled editor. */\n defaultValue?: string;\n /**\n * Whether the code can be read but not edited.\n *\n * @default false\n */\n isReadOnly?: boolean;\n /**\n * Whether the editor is disabled. The code can neither be edited, focused nor\n * copied.\n *\n * @default false\n */\n isDisabled?: boolean;\n /**\n * Whether the editor is displayed as invalid.\n *\n * @default false\n */\n isInvalid?: boolean;\n /** The elements class name. */\n className?: string;\n /**\n * The language the code is highlighted as. A language the editor does not\n * know is shown as plain text.\n */\n language?: CodeEditorLanguage | (string & {});\n /**\n * Whether a button to copy the code to the clipboard is shown.\n *\n * @default true\n */\n copyable?: boolean;\n /**\n * Whether the field must be filled in. Only marks the editor as required for\n * assistive technology — the editor does not validate itself.\n *\n * @default false\n */\n isRequired?: boolean;\n /**\n * @internal Set by `<Field />` on every form field. The editor has no\n * react-aria validation to forward it to and drops it.\n */\n validationBehavior?: unknown;\n}\n\n/**\n * @flr-generate all\n * @flowStatus new\n */\nexport const CodeEditor = flowComponent(\"CodeEditor\", (props) => {\n const {\n ref,\n children,\n className,\n language,\n extensions,\n isReadOnly,\n isDisabled,\n isInvalid,\n isRequired,\n validationBehavior: _ignoredValidationBehavior,\n value,\n onChange,\n onStatistics,\n showLineNumbers = true,\n showCodeFolding = true,\n showCodeIndentationMakers = true,\n showLinterMarkers = true,\n showActiveLineMarker = true,\n copyable = true,\n editable = true,\n height,\n minHeight,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n ...rest\n } = useControlledHostValueProps(props, \"\");\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n wrapperProps,\n controlProps,\n fieldPropsContext,\n } = useFieldComponent(props, \"CodeEditor\");\n\n const rootClassName = clsx(\n wrapperProps.className,\n styles.codeEditor,\n className,\n );\n\n const labelId = useId();\n const descriptionId = useId();\n\n /**\n * Both are optional. Their refs tell whether they are rendered, so the editor\n * never references an element that does not exist – a dangling id fails HTML\n * validators and a11y checks. The callbacks are stable: a new one per render\n * would detach and re-attach on every render.\n */\n const [hasLabel, setHasLabel] = useState(false);\n const [hasDescription, setHasDescription] = useState(false);\n const labelRef = useCallback((element: Element | null) => {\n setHasLabel(!!element);\n }, []);\n const descriptionRef = useCallback((element: Element | null) => {\n setHasDescription(!!element);\n }, []);\n\n /**\n * The label and the field description are declared as children of the code\n * editor, but must be rendered outside of the editor itself. They are\n * tunneled out of the editor – just like the field error. Their ids are the\n * ones the editor references.\n */\n const propsContext: PropsContext = {\n ...fieldPropsContext,\n Label: {\n ...fieldPropsContext.Label,\n id: labelId,\n ref: labelRef,\n tunnel: { id: \"label\", component: \"CodeEditor\" },\n },\n FieldDescription: {\n ...fieldPropsContext.FieldDescription,\n id: descriptionId,\n ref: descriptionRef,\n tunnel: { id: \"fieldDescription\", component: \"CodeEditor\" },\n },\n };\n\n const enabledExtensions = useCodeEditorExtensions(language, extensions, {\n showLineNumbers: showLineNumbers,\n showCodeIndentationMakers: showCodeIndentationMakers,\n showCodeFolding: showCodeFolding,\n showLinterMarkers: showLinterMarkers,\n });\n\n /**\n * The editable element of CodeMirror is the `.cm-content` element – not the\n * root element the props are applied to. Its ARIA attributes are set through\n * the content attributes facet.\n *\n * Without a label, an `aria-label` names the editor instead.\n */\n const labelledBy = joinIds(ariaLabelledBy, hasLabel && labelId);\n const describedBy = joinIds(\n hasDescription && descriptionId,\n controlProps[\"aria-describedby\"],\n );\n\n /**\n * CodeMirror reconfigures the editor whenever `extensions`, `basicSetup` or\n * `onChange` is a new object. All three are stable, so a render with\n * unchanged props leaves the editor as it is.\n */\n const allExtensions = useMemo(\n () => [\n ...enabledExtensions,\n EditorView.contentAttributes.of({\n ...(labelledBy ? { \"aria-labelledby\": labelledBy } : {}),\n ...(ariaLabel ? { \"aria-label\": ariaLabel } : {}),\n ...(describedBy ? { \"aria-describedby\": describedBy } : {}),\n ...(isRequired ? { \"aria-required\": \"true\" } : {}),\n ...(isInvalid ? { \"aria-invalid\": \"true\" } : {}),\n ...(isDisabled ? { \"aria-disabled\": \"true\" } : {}),\n }),\n ],\n [\n enabledExtensions,\n labelledBy,\n ariaLabel,\n describedBy,\n isRequired,\n isInvalid,\n isDisabled,\n ],\n );\n\n /*\n * A new `onChange` on every render would reconfigure the editor as well.\n * CodeMirror's update listener captures `onStatistics` along with it, so both\n * call the latest handler through a ref.\n */\n const handlersRef = useRef({ onChange, onStatistics });\n useLayoutEffect(() => {\n handlersRef.current = { onChange, onStatistics };\n });\n const stableOnChange = useCallback(\n (value: string) => handlersRef.current.onChange(value),\n [],\n );\n const stableOnStatistics = useCallback(\n (statistics: Statistics) => handlersRef.current.onStatistics?.(statistics),\n [],\n );\n\n const isEditable = editable && !isDisabled;\n const highlightActiveLine = showActiveLineMarker && !isDisabled;\n const basicSetup = useMemo(\n () => ({\n highlightActiveLine,\n highlightActiveLineGutter: highlightActiveLine,\n autocompletion: false,\n lineNumbers: false,\n foldGutter: false,\n highlightSelectionMatches: false,\n bracketMatching: isEditable,\n }),\n [highlightActiveLine, isEditable],\n );\n\n const localRef = useObjectRef(ref);\n\n useMakeFocusable(localRef);\n\n const isSkeleton = useSkeletonMode();\n\n /* No CodeMirror: one surface, as high as the code in the editor's line\n height. The children still render, so a label or a field description\n tunnels out and follows its own skeleton rule. */\n const skeleton = (\n <div\n className={clsx(\n styles.codeMirror,\n isReadOnly && styles.readonly,\n styles.skeleton,\n )}\n >\n <div\n className={styles.skeletonLines}\n style={{ height: height ?? minHeight }}\n >\n {(value ?? \"\").split(\"\\n\").map((line, index) => (\n <div key={index}>{line || \" \"}</div>\n ))}\n </div>\n {children}\n </div>\n );\n\n const editor = (\n <CodeMirror\n {...rest}\n value={value}\n onChange={stableOnChange}\n onStatistics={stableOnStatistics}\n basicSetup={basicSetup}\n theme={defaultLightTheme}\n data-invalid={isInvalid || undefined}\n data-disabled={isDisabled || undefined}\n readOnly={isReadOnly || isDisabled}\n editable={isEditable}\n className={clsx(styles.codeMirror, isReadOnly && styles.readonly)}\n ref={(codeMirrorRef) => {\n if (codeMirrorRef?.editor) {\n localRef.current = codeMirrorRef.editor;\n }\n }}\n extensions={allExtensions}\n height={height ?? minHeight}\n >\n {copyable && (\n <CopyButton\n className={styles.copyButton}\n size=\"s\"\n variant=\"soft\"\n text={value}\n isDisabled={isDisabled}\n />\n )}\n {children}\n </CodeMirror>\n );\n\n return (\n <div\n className={rootClassName}\n data-disabled={isDisabled || undefined}\n inert={isSkeleton || undefined}\n >\n <PropsContextProvider props={propsContext}>\n <UiComponentTunnelExit id=\"label\" component=\"CodeEditor\" />\n <FieldErrorCaptureContext>\n {isSkeleton ? skeleton : editor}\n </FieldErrorCaptureContext>\n <UiComponentTunnelExit id=\"fieldDescription\" component=\"CodeEditor\" />\n <FieldErrorView />\n </PropsContextProvider>\n </div>\n );\n});\n\nexport default CodeEditor;\n"],"mappings":"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"}
1
+ {"version":3,"file":"CodeEditor.mjs","names":["styles"],"sources":["../../../../../../../src/components/CodeEditor/CodeEditor.tsx"],"sourcesContent":["import type { ReactCodeMirrorProps, Statistics } from \"@uiw/react-codemirror\";\nimport CodeMirror, { EditorView } from \"@uiw/react-codemirror\";\nimport {\n useCallback,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\nimport { joinIds, useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport styles from \"./CodeEditor.module.scss\";\nimport { type CodeEditorLanguage } from \"@/components/CodeEditor/languages\";\nimport { useMakeFocusable } from \"@/lib/hooks/dom/useMakeFocusable\";\nimport { useObjectRef } from \"react-aria\";\nimport { defaultLightTheme } from \"@/components/CodeEditor/themes/defaultEditorTheme\";\nimport {\n type CodeEditorSetup,\n useCodeEditorExtensions,\n} from \"@/components/CodeEditor/hooks/useCodeEditorExtensions\";\nimport { CopyButton } from \"@/components/CopyButton\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\nimport { useSkeletonMode } from \"@/components/SkeletonMode/skeletonModeContext\";\nimport { getCspNonce } from \"@/lib/dom/getCspNonce\";\n\n/*\n * CodeMirror injects its base styles as a `<style>` element. A CSP without\n * `'unsafe-inline'` blocks it unless it carries the page's nonce – the editor\n * then loses its layout, e.g. the selection layer grows it while text is\n * selected.\n */\nconst cspNonceExtensions = () => {\n const nonce = getCspNonce();\n return nonce ? [EditorView.cspNonce.of(nonce)] : [];\n};\n\nexport interface CodeEditorProps\n extends\n Omit<ReactCodeMirrorProps, \"theme\" | \"lang\" | \"basicSetup\" | \"readOnly\">,\n CodeEditorSetup,\n FlowComponentProps {\n /** The initial code of an uncontrolled editor. */\n defaultValue?: string;\n /**\n * Whether the code can be read but not edited.\n *\n * @default false\n */\n isReadOnly?: boolean;\n /**\n * Whether the editor is disabled. The code can neither be edited, focused nor\n * copied.\n *\n * @default false\n */\n isDisabled?: boolean;\n /**\n * Whether the editor is displayed as invalid.\n *\n * @default false\n */\n isInvalid?: boolean;\n /** The elements class name. */\n className?: string;\n /**\n * The language the code is highlighted as. A language the editor does not\n * know is shown as plain text.\n */\n language?: CodeEditorLanguage | (string & {});\n /**\n * Whether a button to copy the code to the clipboard is shown.\n *\n * @default true\n */\n copyable?: boolean;\n /**\n * Whether the field must be filled in. Only marks the editor as required for\n * assistive technology — the editor does not validate itself.\n *\n * @default false\n */\n isRequired?: boolean;\n /**\n * @internal Set by `<Field />` on every form field. The editor has no\n * react-aria validation to forward it to and drops it.\n */\n validationBehavior?: unknown;\n}\n\n/**\n * @flr-generate all\n * @flowStatus new\n */\nexport const CodeEditor = flowComponent(\"CodeEditor\", (props) => {\n const {\n ref,\n children,\n className,\n language,\n extensions,\n isReadOnly,\n isDisabled,\n isInvalid,\n isRequired,\n validationBehavior: _ignoredValidationBehavior,\n value,\n onChange,\n onStatistics,\n showLineNumbers = true,\n showCodeFolding = true,\n showCodeIndentationMakers = true,\n showLinterMarkers = true,\n showActiveLineMarker = true,\n copyable = true,\n editable = true,\n height,\n minHeight,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n ...rest\n } = useControlledHostValueProps(props, \"\");\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n wrapperProps,\n controlProps,\n fieldPropsContext,\n } = useFieldComponent(props, \"CodeEditor\");\n\n const rootClassName = clsx(\n wrapperProps.className,\n styles.codeEditor,\n className,\n );\n\n const labelId = useId();\n const descriptionId = useId();\n\n /**\n * Both are optional. Their refs tell whether they are rendered, so the editor\n * never references an element that does not exist – a dangling id fails HTML\n * validators and a11y checks. The callbacks are stable: a new one per render\n * would detach and re-attach on every render.\n */\n const [hasLabel, setHasLabel] = useState(false);\n const [hasDescription, setHasDescription] = useState(false);\n const labelRef = useCallback((element: Element | null) => {\n setHasLabel(!!element);\n }, []);\n const descriptionRef = useCallback((element: Element | null) => {\n setHasDescription(!!element);\n }, []);\n\n /**\n * The label and the field description are declared as children of the code\n * editor, but must be rendered outside of the editor itself. They are\n * tunneled out of the editor – just like the field error. Their ids are the\n * ones the editor references.\n */\n const propsContext: PropsContext = {\n ...fieldPropsContext,\n Label: {\n ...fieldPropsContext.Label,\n id: labelId,\n ref: labelRef,\n tunnel: { id: \"label\", component: \"CodeEditor\" },\n },\n FieldDescription: {\n ...fieldPropsContext.FieldDescription,\n id: descriptionId,\n ref: descriptionRef,\n tunnel: { id: \"fieldDescription\", component: \"CodeEditor\" },\n },\n };\n\n const enabledExtensions = useCodeEditorExtensions(language, extensions, {\n showLineNumbers: showLineNumbers,\n showCodeIndentationMakers: showCodeIndentationMakers,\n showCodeFolding: showCodeFolding,\n showLinterMarkers: showLinterMarkers,\n });\n\n /**\n * The editable element of CodeMirror is the `.cm-content` element – not the\n * root element the props are applied to. Its ARIA attributes are set through\n * the content attributes facet.\n *\n * Without a label, an `aria-label` names the editor instead.\n */\n const labelledBy = joinIds(ariaLabelledBy, hasLabel && labelId);\n const describedBy = joinIds(\n hasDescription && descriptionId,\n controlProps[\"aria-describedby\"],\n );\n\n /**\n * CodeMirror reconfigures the editor whenever `extensions`, `basicSetup` or\n * `onChange` is a new object. All three are stable, so a render with\n * unchanged props leaves the editor as it is.\n */\n const allExtensions = useMemo(\n () => [\n ...enabledExtensions,\n ...cspNonceExtensions(),\n EditorView.contentAttributes.of({\n ...(labelledBy ? { \"aria-labelledby\": labelledBy } : {}),\n ...(ariaLabel ? { \"aria-label\": ariaLabel } : {}),\n ...(describedBy ? { \"aria-describedby\": describedBy } : {}),\n ...(isRequired ? { \"aria-required\": \"true\" } : {}),\n ...(isInvalid ? { \"aria-invalid\": \"true\" } : {}),\n ...(isDisabled ? { \"aria-disabled\": \"true\" } : {}),\n }),\n ],\n [\n enabledExtensions,\n labelledBy,\n ariaLabel,\n describedBy,\n isRequired,\n isInvalid,\n isDisabled,\n ],\n );\n\n /*\n * A new `onChange` on every render would reconfigure the editor as well.\n * CodeMirror's update listener captures `onStatistics` along with it, so both\n * call the latest handler through a ref.\n */\n const handlersRef = useRef({ onChange, onStatistics });\n useLayoutEffect(() => {\n handlersRef.current = { onChange, onStatistics };\n });\n const stableOnChange = useCallback(\n (value: string) => handlersRef.current.onChange(value),\n [],\n );\n const stableOnStatistics = useCallback(\n (statistics: Statistics) => handlersRef.current.onStatistics?.(statistics),\n [],\n );\n\n const isEditable = editable && !isDisabled;\n const highlightActiveLine = showActiveLineMarker && !isDisabled;\n const basicSetup = useMemo(\n () => ({\n highlightActiveLine,\n highlightActiveLineGutter: highlightActiveLine,\n autocompletion: false,\n lineNumbers: false,\n foldGutter: false,\n highlightSelectionMatches: false,\n bracketMatching: isEditable,\n }),\n [highlightActiveLine, isEditable],\n );\n\n const localRef = useObjectRef(ref);\n\n useMakeFocusable(localRef);\n\n const isSkeleton = useSkeletonMode();\n\n /* No CodeMirror: one surface, as high as the code in the editor's line\n height. The children still render, so a label or a field description\n tunnels out and follows its own skeleton rule. */\n const skeleton = (\n <div\n className={clsx(\n styles.codeMirror,\n isReadOnly && styles.readonly,\n styles.skeleton,\n )}\n >\n <div\n className={styles.skeletonLines}\n style={{ height: height ?? minHeight }}\n >\n {(value ?? \"\").split(\"\\n\").map((line, index) => (\n <div key={index}>{line || \" \"}</div>\n ))}\n </div>\n {children}\n </div>\n );\n\n const editor = (\n <CodeMirror\n {...rest}\n value={value}\n onChange={stableOnChange}\n onStatistics={stableOnStatistics}\n basicSetup={basicSetup}\n theme={defaultLightTheme}\n data-invalid={isInvalid || undefined}\n data-disabled={isDisabled || undefined}\n readOnly={isReadOnly || isDisabled}\n editable={isEditable}\n className={clsx(styles.codeMirror, isReadOnly && styles.readonly)}\n ref={(codeMirrorRef) => {\n if (codeMirrorRef?.editor) {\n localRef.current = codeMirrorRef.editor;\n }\n }}\n extensions={allExtensions}\n height={height ?? minHeight}\n >\n {copyable && (\n <CopyButton\n className={styles.copyButton}\n size=\"s\"\n variant=\"soft\"\n text={value}\n isDisabled={isDisabled}\n />\n )}\n {children}\n </CodeMirror>\n );\n\n return (\n <div\n className={rootClassName}\n data-disabled={isDisabled || undefined}\n inert={isSkeleton || undefined}\n >\n <PropsContextProvider props={propsContext}>\n <UiComponentTunnelExit id=\"label\" component=\"CodeEditor\" />\n <FieldErrorCaptureContext>\n {isSkeleton ? skeleton : editor}\n </FieldErrorCaptureContext>\n <UiComponentTunnelExit id=\"fieldDescription\" component=\"CodeEditor\" />\n <FieldErrorView />\n </PropsContextProvider>\n </div>\n );\n});\n\nexport default CodeEditor;\n"],"mappings":"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"}
@@ -17,7 +17,7 @@ var defaultLightTheme = githubLightInit({
17
17
  styles: [
18
18
  {
19
19
  tag: tags.keyword,
20
- color: "var(--code-syntax--color--keyword)"
20
+ color: "var(--color--code-syntax--keyword)"
21
21
  },
22
22
  {
23
23
  tag: [
@@ -25,39 +25,39 @@ var defaultLightTheme = githubLightInit({
25
25
  tags.className,
26
26
  tags.tagName
27
27
  ],
28
- color: "var(--code-syntax--color--type)"
28
+ color: "var(--color--code-syntax--type)"
29
29
  },
30
30
  {
31
31
  tag: tags.variableName,
32
- color: "var(--code-syntax--color--variable)"
32
+ color: "var(--color--code-syntax--variable)"
33
33
  },
34
34
  {
35
35
  tag: [tags.propertyName, tags.attributeName],
36
- color: "var(--code-syntax--color--property)"
36
+ color: "var(--color--code-syntax--property)"
37
37
  },
38
38
  {
39
39
  tag: [tags.string, tags.regexp],
40
- color: "var(--code-syntax--color--string)"
40
+ color: "var(--color--code-syntax--string)"
41
41
  },
42
42
  {
43
43
  tag: tags.number,
44
- color: "var(--code-syntax--color--number)"
44
+ color: "var(--color--code-syntax--number)"
45
45
  },
46
46
  {
47
47
  tag: tags.comment,
48
- color: "var(--code-syntax--color--comment)"
48
+ color: "var(--color--code-syntax--comment)"
49
49
  },
50
50
  {
51
51
  tag: [tags.function(tags.variableName), tags.function(tags.propertyName)],
52
- color: "var(--code-syntax--color--function)"
52
+ color: "var(--color--code-syntax--function)"
53
53
  },
54
54
  {
55
55
  tag: [tags.operator, tags.typeOperator],
56
- color: "var(--code-syntax--color--operator)"
56
+ color: "var(--color--code-syntax--operator)"
57
57
  },
58
58
  {
59
59
  tag: tags.invalid,
60
- color: "var(--code-syntax--color--invalid)"
60
+ color: "var(--color--code-syntax--invalid)"
61
61
  }
62
62
  ]
63
63
  });
@@ -1 +1 @@
1
- {"version":3,"file":"defaultEditorTheme.mjs","names":["t"],"sources":["../../../../../../../../src/components/CodeEditor/themes/defaultEditorTheme.ts"],"sourcesContent":["import { githubLightInit } from \"@uiw/codemirror-theme-github\";\nimport { tags as t } from \"@lezer/highlight\";\n\nexport const defaultLightTheme = githubLightInit({\n theme: \"light\",\n settings: {\n fontSize: \"var(--code-editor--font-size)\",\n fontFamily: \"var(--code-editor--font-family)\",\n foreground: \"var(--form-control--content-color--default)\",\n background: \"transparent\",\n gutterBackground: \"var(--form-control--background-color--default)\",\n gutterForeground: \"var(--form-control--content-color--default)\",\n gutterBorder: \"var(--code-editor--gutter-separator-color)\",\n },\n styles: [\n { tag: t.keyword, color: \"var(--code-syntax--color--keyword)\" },\n {\n tag: [t.typeName, t.className, t.tagName],\n color: \"var(--code-syntax--color--type)\",\n },\n { tag: t.variableName, color: \"var(--code-syntax--color--variable)\" },\n {\n tag: [t.propertyName, t.attributeName],\n color: \"var(--code-syntax--color--property)\",\n },\n { tag: [t.string, t.regexp], color: \"var(--code-syntax--color--string)\" },\n { tag: t.number, color: \"var(--code-syntax--color--number)\" },\n { tag: t.comment, color: \"var(--code-syntax--color--comment)\" },\n {\n tag: [t.function(t.variableName), t.function(t.propertyName)],\n color: \"var(--code-syntax--color--function)\",\n },\n {\n tag: [t.operator, t.typeOperator],\n color: \"var(--code-syntax--color--operator)\",\n },\n { tag: t.invalid, color: \"var(--code-syntax--color--invalid)\" },\n ],\n});\n"],"mappings":";;;;;AAGA,IAAa,oBAAoB,gBAAgB;CAC/C,OAAO;CACP,UAAU;EACR,UAAU;EACV,YAAY;EACZ,YAAY;EACZ,YAAY;EACZ,kBAAkB;EAClB,kBAAkB;EAClB,cAAc;CAChB;CACA,QAAQ;EACN;GAAE,KAAKA,KAAE;GAAS,OAAO;EAAqC;EAC9D;GACE,KAAK;IAACA,KAAE;IAAUA,KAAE;IAAWA,KAAE;GAAO;GACxC,OAAO;EACT;EACA;GAAE,KAAKA,KAAE;GAAc,OAAO;EAAsC;EACpE;GACE,KAAK,CAACA,KAAE,cAAcA,KAAE,aAAa;GACrC,OAAO;EACT;EACA;GAAE,KAAK,CAACA,KAAE,QAAQA,KAAE,MAAM;GAAG,OAAO;EAAoC;EACxE;GAAE,KAAKA,KAAE;GAAQ,OAAO;EAAoC;EAC5D;GAAE,KAAKA,KAAE;GAAS,OAAO;EAAqC;EAC9D;GACE,KAAK,CAACA,KAAE,SAASA,KAAE,YAAY,GAAGA,KAAE,SAASA,KAAE,YAAY,CAAC;GAC5D,OAAO;EACT;EACA;GACE,KAAK,CAACA,KAAE,UAAUA,KAAE,YAAY;GAChC,OAAO;EACT;EACA;GAAE,KAAKA,KAAE;GAAS,OAAO;EAAqC;CAChE;AACF,CAAC"}
1
+ {"version":3,"file":"defaultEditorTheme.mjs","names":["t"],"sources":["../../../../../../../../src/components/CodeEditor/themes/defaultEditorTheme.ts"],"sourcesContent":["import { githubLightInit } from \"@uiw/codemirror-theme-github\";\nimport { tags as t } from \"@lezer/highlight\";\n\nexport const defaultLightTheme = githubLightInit({\n theme: \"light\",\n settings: {\n fontSize: \"var(--code-editor--font-size)\",\n fontFamily: \"var(--code-editor--font-family)\",\n foreground: \"var(--form-control--content-color--default)\",\n background: \"transparent\",\n gutterBackground: \"var(--form-control--background-color--default)\",\n gutterForeground: \"var(--form-control--content-color--default)\",\n gutterBorder: \"var(--code-editor--gutter-separator-color)\",\n },\n styles: [\n { tag: t.keyword, color: \"var(--color--code-syntax--keyword)\" },\n {\n tag: [t.typeName, t.className, t.tagName],\n color: \"var(--color--code-syntax--type)\",\n },\n { tag: t.variableName, color: \"var(--color--code-syntax--variable)\" },\n {\n tag: [t.propertyName, t.attributeName],\n color: \"var(--color--code-syntax--property)\",\n },\n { tag: [t.string, t.regexp], color: \"var(--color--code-syntax--string)\" },\n { tag: t.number, color: \"var(--color--code-syntax--number)\" },\n { tag: t.comment, color: \"var(--color--code-syntax--comment)\" },\n {\n tag: [t.function(t.variableName), t.function(t.propertyName)],\n color: \"var(--color--code-syntax--function)\",\n },\n {\n tag: [t.operator, t.typeOperator],\n color: \"var(--color--code-syntax--operator)\",\n },\n { tag: t.invalid, color: \"var(--color--code-syntax--invalid)\" },\n ],\n});\n"],"mappings":";;;;;AAGA,IAAa,oBAAoB,gBAAgB;CAC/C,OAAO;CACP,UAAU;EACR,UAAU;EACV,YAAY;EACZ,YAAY;EACZ,YAAY;EACZ,kBAAkB;EAClB,kBAAkB;EAClB,cAAc;CAChB;CACA,QAAQ;EACN;GAAE,KAAKA,KAAE;GAAS,OAAO;EAAqC;EAC9D;GACE,KAAK;IAACA,KAAE;IAAUA,KAAE;IAAWA,KAAE;GAAO;GACxC,OAAO;EACT;EACA;GAAE,KAAKA,KAAE;GAAc,OAAO;EAAsC;EACpE;GACE,KAAK,CAACA,KAAE,cAAcA,KAAE,aAAa;GACrC,OAAO;EACT;EACA;GAAE,KAAK,CAACA,KAAE,QAAQA,KAAE,MAAM;GAAG,OAAO;EAAoC;EACxE;GAAE,KAAKA,KAAE;GAAQ,OAAO;EAAoC;EAC5D;GAAE,KAAKA,KAAE;GAAS,OAAO;EAAqC;EAC9D;GACE,KAAK,CAACA,KAAE,SAASA,KAAE,YAAY,GAAGA,KAAE,SAASA,KAAE,YAAY,CAAC;GAC5D,OAAO;EACT;EACA;GACE,KAAK,CAACA,KAAE,UAAUA,KAAE,YAAY;GAChC,OAAO;EACT;EACA;GAAE,KAAKA,KAAE;GAAS,OAAO;EAAqC;CAChE;AACF,CAAC"}
@@ -1,13 +1,15 @@
1
1
  "use client"
2
2
  /* */
3
- import { alphaColors, decorativeColors, deprecatedDecorativeColors, statusTypes } from "../../lib/types/props.mjs";
4
- import { useDeprecatedColor } from "../../lib/hooks/useDeprecatedColor.mjs";
3
+ import { alphaColors, statusTypes } from "../../lib/types/props.mjs";
5
4
  import Color_module_default from "./Color.module.mjs";
6
5
  import clsx from "clsx";
7
6
  import { jsx } from "react/jsx-runtime";
8
7
  // src/components/Color/Color.tsx
9
8
  var flowColors = [
10
- ...decorativeColors,
9
+ "blue",
10
+ "violet",
11
+ "teal",
12
+ "lilac",
11
13
  ...statusTypes,
12
14
  ...alphaColors
13
15
  ];
@@ -16,8 +18,7 @@ function isFlowColor(something) {
16
18
  }
17
19
  /** @flr-generate all */
18
20
  var Color = (props) => {
19
- const { children, className, color: colorFromProps = "blue" } = props;
20
- const color = useDeprecatedColor(colorFromProps, deprecatedDecorativeColors) ?? "blue";
21
+ const { children, className, color = "blue" } = props;
21
22
  const isAFlowColor = isFlowColor(color);
22
23
  const rootClassName = clsx(isAFlowColor && Color_module_default[color], className);
23
24
  return /* @__PURE__ */ jsx("span", {
@@ -1 +1 @@
1
- {"version":3,"file":"Color.mjs","names":["anyFlowColors","styles"],"sources":["../../../../../../../src/components/Color/Color.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport styles from \"./Color.module.scss\";\nimport {\n alphaColors,\n decorativeColors,\n deprecatedDecorativeColors,\n type DeprecatedDecorativeColor,\n type PropsWithClassName,\n statusTypes,\n} from \"@/lib/types/props\";\nimport clsx from \"clsx\";\nimport { useDeprecatedColor } from \"@/lib/hooks/useDeprecatedColor\";\n\nconst flowColors = [\n ...decorativeColors,\n ...statusTypes,\n ...alphaColors,\n] as const;\n\ntype FlowColor = (typeof flowColors)[number];\ntype FlowWithCustomColor =\n FlowColor | DeprecatedDecorativeColor | (string & {});\n\nfunction isFlowColor(something: unknown): something is FlowColor {\n const anyFlowColors = flowColors as readonly string[];\n return typeof something === \"string\" && anyFlowColors.includes(something);\n}\n\nexport interface ColorProps extends PropsWithChildren, PropsWithClassName {\n /**\n * The color of the element. @default \"blue\"\n *\n * @deprecatedValues violet, teal\n */\n color?: FlowWithCustomColor;\n}\n\n/** @flr-generate all */\nexport const Color: FC<ColorProps> = (props) => {\n const { children, className, color: colorFromProps = \"blue\" } = props;\n const color =\n useDeprecatedColor(colorFromProps, deprecatedDecorativeColors) ?? \"blue\";\n\n const isAFlowColor = isFlowColor(color);\n const rootClassName = clsx(isAFlowColor && styles[color], className);\n const style = !isAFlowColor ? { color } : undefined;\n\n return (\n <span className={rootClassName} style={style}>\n {children}\n </span>\n );\n};\n\nexport default Color;\n"],"mappings":";;;;;;;;AAaA,IAAM,aAAa;CACjB,GAAG;CACH,GAAG;CACH,GAAG;AACL;AAMA,SAAS,YAAY,WAA4C;CAE/D,OAAO,OAAO,cAAc,YAAYA,WAAc,SAAS,SAAS;AAC1E;;AAYA,IAAa,SAAyB,UAAU;CAC9C,MAAM,EAAE,UAAU,WAAW,OAAO,iBAAiB,WAAW;CAChE,MAAM,QACJ,mBAAmB,gBAAgB,0BAA0B,KAAK;CAEpE,MAAM,eAAe,YAAY,KAAK;CACtC,MAAM,gBAAgB,KAAK,gBAAgBC,qBAAO,QAAQ,SAAS;CAGnE,OACE,oBAAC,QAAD;EAAM,WAAW;EAAsB,OAH3B,CAAC,eAAe,EAAE,MAAM,IAAI,KAAA;EAIrC;CACG,CAAA;AAEV"}
1
+ {"version":3,"file":"Color.mjs","names":["anyFlowColors","styles"],"sources":["../../../../../../../src/components/Color/Color.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport styles from \"./Color.module.scss\";\nimport {\n alphaColors,\n type PropsWithClassName,\n statusTypes,\n} from \"@/lib/types/props\";\nimport clsx from \"clsx\";\n\nconst flowColors = [\n \"blue\",\n \"violet\",\n \"teal\",\n \"lilac\",\n ...statusTypes,\n ...alphaColors,\n] as const;\n\ntype FlowColor = (typeof flowColors)[number];\ntype FlowWithCustomColor = FlowColor | (string & {});\n\nfunction isFlowColor(something: unknown): something is FlowColor {\n const anyFlowColors = flowColors as readonly string[];\n return typeof something === \"string\" && anyFlowColors.includes(something);\n}\n\nexport interface ColorProps extends PropsWithChildren, PropsWithClassName {\n /** The color of the element. @default \"blue\" */\n color?: FlowWithCustomColor;\n}\n\n/** @flr-generate all */\nexport const Color: FC<ColorProps> = (props) => {\n const { children, className, color = \"blue\" } = props;\n\n const isAFlowColor = isFlowColor(color);\n const rootClassName = clsx(isAFlowColor && styles[color], className);\n const style = !isAFlowColor ? { color } : undefined;\n\n return (\n <span className={rootClassName} style={style}>\n {children}\n </span>\n );\n};\n\nexport default Color;\n"],"mappings":";;;;;;;AASA,IAAM,aAAa;CACjB;CACA;CACA;CACA;CACA,GAAG;CACH,GAAG;AACL;AAKA,SAAS,YAAY,WAA4C;CAE/D,OAAO,OAAO,cAAc,YAAYA,WAAc,SAAS,SAAS;AAC1E;;AAQA,IAAa,SAAyB,UAAU;CAC9C,MAAM,EAAE,UAAU,WAAW,QAAQ,WAAW;CAEhD,MAAM,eAAe,YAAY,KAAK;CACtC,MAAM,gBAAgB,KAAK,gBAAgBC,qBAAO,QAAQ,SAAS;CAGnE,OACE,oBAAC,QAAD;EAAM,WAAW;EAAsB,OAH3B,CAAC,eAAe,EAAE,MAAM,IAAI,KAAA;EAIrC;CACG,CAAA;AAEV"}
@@ -2,10 +2,9 @@
2
2
  /* */
3
3
  // src/components/Color/Color.module.scss
4
4
  var blue = "flow--color--blue";
5
- var navy = "flow--color--navy";
5
+ var violet = "flow--color--violet";
6
+ var teal = "flow--color--teal";
6
7
  var lilac = "flow--color--lilac";
7
- var sage = "flow--color--sage";
8
- var salmon = "flow--color--salmon";
9
8
  var danger = "flow--color--danger";
10
9
  var warning = "flow--color--warning";
11
10
  var success = "flow--color--success";
@@ -15,10 +14,9 @@ var light = "flow--color--light";
15
14
  var dark = "flow--color--dark";
16
15
  var Color_module_default = {
17
16
  blue,
18
- navy,
17
+ violet,
18
+ teal,
19
19
  lilac,
20
- sage,
21
- salmon,
22
20
  danger,
23
21
  warning,
24
22
  success,
@@ -29,6 +27,6 @@ var Color_module_default = {
29
27
  "light-static": "flow--color--light-static",
30
28
  "dark-static": "flow--color--dark-static"
31
29
  };
32
- export { blue, danger, dark, Color_module_default as default, info, light, lilac, navy, sage, salmon, success, unavailable, warning };
30
+ export { blue, danger, dark, Color_module_default as default, info, light, lilac, success, teal, unavailable, violet, warning };
33
31
 
34
32
  //# sourceMappingURL=Color.module.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Color.module.mjs","names":[],"sources":["../../../../../../../src/components/Color/Color.module.scss"],"sourcesContent":[".blue {\n color: var(--decorative-blue--color--content);\n}\n\n.navy {\n color: var(--decorative-navy--color--content);\n}\n\n.lilac {\n color: var(--decorative-lilac--color--content);\n}\n\n.sage {\n color: var(--decorative-sage--color--content);\n}\n\n.salmon {\n color: var(--decorative-salmon--color--content);\n}\n\n.danger {\n color: var(--danger-plain-content-color);\n}\n\n.warning {\n color: var(--warning-plain-content-color);\n}\n\n.success {\n color: var(--success-plain-content-color);\n}\n\n.info {\n color: var(--info-plain-content-color);\n}\n\n.unavailable {\n color: var(--unavailable-plain-content-color);\n}\n\n.light {\n color: var(--light-plain-content-color);\n}\n\n.dark {\n color: var(--dark-plain-content-color);\n}\n\n.light-static {\n color: var(--light-static-plain-content-color);\n}\n\n.dark-static {\n color: var(--dark-static-plain-content-color);\n}\n"],"mappings":""}
1
+ {"version":3,"file":"Color.module.mjs","names":[],"sources":["../../../../../../../src/components/Color/Color.module.scss"],"sourcesContent":[".blue {\n color: var(--primary--color--1000);\n}\n\n.violet {\n color: var(--color--soft-contrast-violet--800);\n}\n\n.teal {\n color: var(--color--super-teal--800);\n}\n\n.lilac {\n color: var(--color--bright-lilac--800);\n}\n\n.danger {\n color: var(--danger-plain-content-color);\n}\n\n.warning {\n color: var(--warning-plain-content-color);\n}\n\n.success {\n color: var(--success-plain-content-color);\n}\n\n.info {\n color: var(--info-plain-content-color);\n}\n\n.unavailable {\n color: var(--unavailable-plain-content-color);\n}\n\n.light {\n color: var(--light-plain-content-color);\n}\n\n.dark {\n color: var(--dark-plain-content-color);\n}\n\n.light-static {\n color: var(--light-static-plain-content-color);\n}\n\n.dark-static {\n color: var(--dark-static-plain-content-color);\n}\n"],"mappings":""}
@@ -30,7 +30,7 @@ var DonutChartFill = (props) => {
30
30
  const segmentPercent = 100 / maxValue * s.value;
31
31
  const currentOffsetPercent = offsetPercent;
32
32
  offsetPercent = offsetPercent + segmentPercent;
33
- const color = !s.color || isCategoricalColor(s.color) ? `var(--categorical--color--${s.color ?? getCategoricalColorByIndex(i)})` : s.color;
33
+ const color = !s.color || isCategoricalColor(s.color) ? `var(--color--categorical--${s.color ?? getCategoricalColorByIndex(i)})` : s.color;
34
34
  return /* @__PURE__ */ jsx("circle", {
35
35
  className: DonutChart_module_default.segment,
36
36
  cx: center,
@@ -1 +1 @@
1
- {"version":3,"file":"DonutChartFill.mjs","names":["styles"],"sources":["../../../../../../../../src/components/DonutChart/components/DonutChartFill.tsx"],"sourcesContent":["import type { CSSProperties, FC } from \"react\";\nimport styles from \"@/components/DonutChart/DonutChart.module.scss\";\nimport type { DonutChartProps } from \"@/components/DonutChart\";\nimport { getCategoricalColorByIndex } from \"@/lib/tokens/getCategoricalColorByIndex\";\nimport { isCategoricalColor } from \"@/lib/tokens/isCategoricalColor\";\n\ninterface Props extends Pick<DonutChartProps, \"segments\"> {\n center: number;\n value?: number;\n radius: number;\n maxValue: number;\n}\n\n/**\n * `pathLength=\"100\"` measures the stroke in percent, so the stylesheet draws\n * and rotates each circle from its share and its offset alone – and the load-in\n * keyframes can grow every segment out of 12 o'clock.\n */\nconst fillStyle = (percent: number, offsetPercent: number): CSSProperties => ({\n \"--donut-chart--percent\": percent,\n \"--donut-chart--offset\": offsetPercent,\n});\n\nexport const DonutChartFill: FC<Props> = (props) => {\n const { center, value = 0, radius, segments, maxValue } = props;\n\n const percent = (100 / maxValue) * value;\n\n if (!segments) {\n return (\n <circle\n className={styles.fill}\n cx={center}\n cy={center}\n r={radius}\n pathLength={100}\n style={fillStyle(percent, 0)}\n />\n );\n }\n\n let offsetPercent = 0;\n\n return segments.map((s, i) => {\n const segmentPercent = (100 / maxValue) * s.value;\n\n const currentOffsetPercent = offsetPercent;\n\n offsetPercent = offsetPercent + segmentPercent;\n\n const color =\n !s.color || isCategoricalColor(s.color)\n ? `var(--categorical--color--${s.color ?? getCategoricalColorByIndex(i)})`\n : s.color;\n\n // Index keys: a segment added after mount animates alone out of 12 o'clock,\n // over the segments already there.\n return (\n <circle\n key={i}\n className={styles.segment}\n cx={center}\n cy={center}\n r={radius}\n pathLength={100}\n stroke={color}\n style={fillStyle(segmentPercent, currentOffsetPercent)}\n />\n );\n });\n};\n"],"mappings":";;;;;;;;;;;;AAkBA,IAAM,aAAa,SAAiB,mBAA0C;CAC5E,0BAA0B;CAC1B,yBAAyB;AAC3B;AAEA,IAAa,kBAA6B,UAAU;CAClD,MAAM,EAAE,QAAQ,QAAQ,GAAG,QAAQ,UAAU,aAAa;CAE1D,MAAM,UAAW,MAAM,WAAY;CAEnC,IAAI,CAAC,UACH,OACE,oBAAC,UAAD;EACE,WAAWA,0BAAO;EAClB,IAAI;EACJ,IAAI;EACJ,GAAG;EACH,YAAY;EACZ,OAAO,UAAU,SAAS,CAAC;CAC5B,CAAA;CAIL,IAAI,gBAAgB;CAEpB,OAAO,SAAS,KAAK,GAAG,MAAM;EAC5B,MAAM,iBAAkB,MAAM,WAAY,EAAE;EAE5C,MAAM,uBAAuB;EAE7B,gBAAgB,gBAAgB;EAEhC,MAAM,QACJ,CAAC,EAAE,SAAS,mBAAmB,EAAE,KAAK,IAClC,6BAA6B,EAAE,SAAS,2BAA2B,CAAC,EAAE,KACtE,EAAE;EAIR,OACE,oBAAC,UAAD;GAEE,WAAWA,0BAAO;GAClB,IAAI;GACJ,IAAI;GACJ,GAAG;GACH,YAAY;GACZ,QAAQ;GACR,OAAO,UAAU,gBAAgB,oBAAoB;EACtD,GARM,CAQN;CAEL,CAAC;AACH"}
1
+ {"version":3,"file":"DonutChartFill.mjs","names":["styles"],"sources":["../../../../../../../../src/components/DonutChart/components/DonutChartFill.tsx"],"sourcesContent":["import type { CSSProperties, FC } from \"react\";\nimport styles from \"@/components/DonutChart/DonutChart.module.scss\";\nimport type { DonutChartProps } from \"@/components/DonutChart\";\nimport { getCategoricalColorByIndex } from \"@/lib/tokens/getCategoricalColorByIndex\";\nimport { isCategoricalColor } from \"@/lib/tokens/isCategoricalColor\";\n\ninterface Props extends Pick<DonutChartProps, \"segments\"> {\n center: number;\n value?: number;\n radius: number;\n maxValue: number;\n}\n\n/**\n * `pathLength=\"100\"` measures the stroke in percent, so the stylesheet draws\n * and rotates each circle from its share and its offset alone – and the load-in\n * keyframes can grow every segment out of 12 o'clock.\n */\nconst fillStyle = (percent: number, offsetPercent: number): CSSProperties => ({\n \"--donut-chart--percent\": percent,\n \"--donut-chart--offset\": offsetPercent,\n});\n\nexport const DonutChartFill: FC<Props> = (props) => {\n const { center, value = 0, radius, segments, maxValue } = props;\n\n const percent = (100 / maxValue) * value;\n\n if (!segments) {\n return (\n <circle\n className={styles.fill}\n cx={center}\n cy={center}\n r={radius}\n pathLength={100}\n style={fillStyle(percent, 0)}\n />\n );\n }\n\n let offsetPercent = 0;\n\n return segments.map((s, i) => {\n const segmentPercent = (100 / maxValue) * s.value;\n\n const currentOffsetPercent = offsetPercent;\n\n offsetPercent = offsetPercent + segmentPercent;\n\n const color =\n !s.color || isCategoricalColor(s.color)\n ? `var(--color--categorical--${s.color ?? getCategoricalColorByIndex(i)})`\n : s.color;\n\n // Index keys: a segment added after mount animates alone out of 12 o'clock,\n // over the segments already there.\n return (\n <circle\n key={i}\n className={styles.segment}\n cx={center}\n cy={center}\n r={radius}\n pathLength={100}\n stroke={color}\n style={fillStyle(segmentPercent, currentOffsetPercent)}\n />\n );\n });\n};\n"],"mappings":";;;;;;;;;;;;AAkBA,IAAM,aAAa,SAAiB,mBAA0C;CAC5E,0BAA0B;CAC1B,yBAAyB;AAC3B;AAEA,IAAa,kBAA6B,UAAU;CAClD,MAAM,EAAE,QAAQ,QAAQ,GAAG,QAAQ,UAAU,aAAa;CAE1D,MAAM,UAAW,MAAM,WAAY;CAEnC,IAAI,CAAC,UACH,OACE,oBAAC,UAAD;EACE,WAAWA,0BAAO;EAClB,IAAI;EACJ,IAAI;EACJ,GAAG;EACH,YAAY;EACZ,OAAO,UAAU,SAAS,CAAC;CAC5B,CAAA;CAIL,IAAI,gBAAgB;CAEpB,OAAO,SAAS,KAAK,GAAG,MAAM;EAC5B,MAAM,iBAAkB,MAAM,WAAY,EAAE;EAE5C,MAAM,uBAAuB;EAE7B,gBAAgB,gBAAgB;EAEhC,MAAM,QACJ,CAAC,EAAE,SAAS,mBAAmB,EAAE,KAAK,IAClC,6BAA6B,EAAE,SAAS,2BAA2B,CAAC,EAAE,KACtE,EAAE;EAIR,OACE,oBAAC,UAAD;GAEE,WAAWA,0BAAO;GAClB,IAAI;GACJ,IAAI;GACJ,GAAG;GACH,YAAY;GACZ,QAAQ;GACR,OAAO,UAAU,gBAAgB,oBAAoB;EACtD,GARM,CAQN;CAEL,CAAC;AACH"}
@@ -1,9 +1,9 @@
1
1
  "use client"
2
2
  /* */
3
- import { isAlphaColor } from "../../lib/types/props.mjs";
4
3
  import { PropsContextProvider } from "../../lib/propsContext/components/PropsContextProvider.mjs";
5
4
  import dynamic from "../../lib/propsContext/dynamicProps/dynamic.mjs";
6
5
  import { containsTextChild } from "../../lib/react/remote.mjs";
6
+ import { isAlphaColor } from "../../lib/types/props.mjs";
7
7
  import { Text } from "../Text/Text.mjs";
8
8
  import HeaderNavigation_module_default from "./HeaderNavigation.module.mjs";
9
9
  import clsx from "clsx";
@@ -3,9 +3,9 @@
3
3
  import { PropsContextProvider } from "../../lib/propsContext/components/PropsContextProvider.mjs";
4
4
  import { flowComponent } from "../../lib/componentFactory/flowComponent.mjs";
5
5
  import { useRegisterSectionHeading } from "../Section/context.mjs";
6
- import { styleClassname } from "../../lib/scss/selectors.mjs";
7
6
  import { useSkeletonMode } from "../SkeletonMode/skeletonModeContext.mjs";
8
7
  import { UiComponentTunnelExit } from "../UiComponentTunnel/UiComponentTunnelExit.mjs";
8
+ import { styleClassname } from "../../lib/scss/selectors.mjs";
9
9
  import { SkeletonTextContent } from "../SkeletonMode/components/SkeletonTextContent/SkeletonTextContent.mjs";
10
10
  import Heading_module_default from "./Heading.module.mjs";
11
11
  import clsx from "clsx";
@@ -1,11 +1,10 @@
1
1
  "use client"
2
2
  /* */
3
- import { alphaColors, decorativeColors, deprecatedDecorativeColors, statusTypes } from "../../lib/types/props.mjs";
4
3
  import { flowComponent } from "../../lib/componentFactory/flowComponent.mjs";
5
- import { useWarnDeprecation } from "../DeprecationWarningProvider/DeprecationWarningProvider.mjs";
6
- import { useDeprecatedColor } from "../../lib/hooks/useDeprecatedColor.mjs";
7
4
  import Icon_module_default from "./Icon.module.mjs";
8
5
  import { cloneElement as cloneElement$1 } from "../../lib/react/cloneElement.mjs";
6
+ import { alphaColors, statusTypes } from "../../lib/types/props.mjs";
7
+ import { useWarnDeprecation } from "../DeprecationWarningProvider/DeprecationWarningProvider.mjs";
9
8
  import { useSkeletonMode } from "../SkeletonMode/skeletonModeContext.mjs";
10
9
  import clsx from "clsx";
11
10
  import React from "react";
@@ -13,7 +12,10 @@ import { jsx } from "react/jsx-runtime";
13
12
  // src/components/Icon/Icon.tsx
14
13
  var iconColors = [
15
14
  "neutral",
16
- ...decorativeColors,
15
+ "blue",
16
+ "violet",
17
+ "teal",
18
+ "lilac",
17
19
  ...statusTypes,
18
20
  ...alphaColors
19
21
  ];
@@ -26,7 +28,7 @@ var Icon = flowComponent("Icon", (props) => {
26
28
  const isSkeleton = useSkeletonMode();
27
29
  const { className, "aria-label": ariaLabel, children, size = "m", status, color, ...svgAttributes } = props;
28
30
  if (status !== void 0) warnDeprecation("The 'status' prop is deprecated and will be removed in a future release. Use 'color' instead.");
29
- const resolvedColor = useDeprecatedColor(color, deprecatedDecorativeColors) ?? status;
31
+ const resolvedColor = color ?? status;
30
32
  const paletteColor = isIconColor(resolvedColor) ? resolvedColor : void 0;
31
33
  const customColor = paletteColor === void 0 ? resolvedColor : void 0;
32
34
  const customColorStyle = customColor ? {
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.mjs","names":["anyIconColors","styles","cloneElement"],"sources":["../../../../../../../src/components/Icon/Icon.tsx"],"sourcesContent":["import type { PropsWithChildren, SVGAttributes } from \"react\";\nimport React from \"react\";\nimport styles from \"./Icon.module.scss\";\nimport clsx from \"clsx\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { cloneElement } from \"@/lib/react/cloneElement\";\nimport {\n alphaColors,\n decorativeColors,\n deprecatedDecorativeColors,\n type DeprecatedDecorativeColor,\n type Status,\n statusTypes,\n} from \"@/lib/types/props\";\nimport { useDeprecatedColor } from \"@/lib/hooks/useDeprecatedColor\";\nimport { useWarnDeprecation } from \"@/components/DeprecationWarningProvider\";\nimport { useSkeletonMode } from \"@/components/SkeletonMode/skeletonModeContext\";\n\ntype SvgAttributeProps = SVGAttributes<SVGSVGElement>;\n\nconst iconColors = [\n \"neutral\",\n ...decorativeColors,\n ...statusTypes,\n ...alphaColors,\n] as const;\n\ntype IconColor = (typeof iconColors)[number];\ntype IconWithCustomColor =\n IconColor | DeprecatedDecorativeColor | (string & {});\n\nfunction isIconColor(something: unknown): something is IconColor {\n const anyIconColors = iconColors as readonly string[];\n return typeof something === \"string\" && anyIconColors.includes(something);\n}\n\nexport interface IconProps\n extends\n PropsWithChildren<Omit<SvgAttributeProps, \"name\" | \"color\">>,\n FlowComponentProps {\n /** The size of the icon. @default \"m\" */\n size?: \"s\" | \"m\" | \"l\";\n /**\n * The color of the icon. Besides the Flow colors, any custom CSS color is\n * supported. Inherits the surrounding text color when unset.\n *\n * @deprecatedValues violet, teal\n */\n color?: IconWithCustomColor;\n /**\n * The elements status.\n *\n * @deprecated Use `color` instead.\n */\n status?: Status;\n}\n\n/** @flr-generate all */\nexport const Icon = flowComponent(\"Icon\", (props) => {\n const warnDeprecation = useWarnDeprecation();\n const isSkeleton = useSkeletonMode();\n const {\n className,\n \"aria-label\": ariaLabel,\n children,\n size = \"m\",\n status,\n color,\n ...svgAttributes\n } = props;\n\n if (status !== undefined) {\n warnDeprecation(\n \"The 'status' prop is deprecated and will be removed in a future release. Use 'color' instead.\",\n );\n }\n\n const resolvedColor =\n useDeprecatedColor(color, deprecatedDecorativeColors) ?? status;\n const paletteColor = isIconColor(resolvedColor) ? resolvedColor : undefined;\n const customColor = paletteColor === undefined ? resolvedColor : undefined;\n const customColorStyle = customColor\n ? { color: customColor, ...svgAttributes.style }\n : undefined;\n\n const iconProps: SvgAttributeProps = {\n ...svgAttributes,\n ...(customColorStyle && { style: customColorStyle }),\n focusable: \"false\",\n role: \"img\",\n \"aria-hidden\": !ariaLabel,\n \"aria-label\": ariaLabel,\n className: clsx(\n styles.icon,\n styles[`size-${size}`],\n paletteColor && styles[paletteColor],\n className,\n ),\n };\n\n const iconElement = React.Children.toArray(children)[0];\n\n if (!React.isValidElement(iconElement)) {\n throw new Error(\n `Expected children of Icon component to be a valid React element (got ${String(\n children,\n )})`,\n );\n }\n\n /* An svg draws no `::after`, so the shimmer needs an element of its own. */\n if (isSkeleton) {\n return (\n <span\n className={clsx(iconProps.className, styles.skeleton)}\n style={svgAttributes.style}\n aria-hidden\n inert\n />\n );\n }\n\n return cloneElement(iconElement, iconProps);\n});\n\nexport default Icon;\n"],"mappings":";;;;;;;;;;;;;AAqBA,IAAM,aAAa;CACjB;CACA,GAAG;CACH,GAAG;CACH,GAAG;AACL;AAMA,SAAS,YAAY,WAA4C;CAE/D,OAAO,OAAO,cAAc,YAAYA,WAAc,SAAS,SAAS;AAC1E;;AAwBA,IAAa,OAAO,cAAc,SAAS,UAAU;CACnD,MAAM,kBAAkB,mBAAmB;CAC3C,MAAM,aAAa,gBAAgB;CACnC,MAAM,EACJ,WACA,cAAc,WACd,UACA,OAAO,KACP,QACA,OACA,GAAG,kBACD;CAEJ,IAAI,WAAW,KAAA,GACb,gBACE,+FACF;CAGF,MAAM,gBACJ,mBAAmB,OAAO,0BAA0B,KAAK;CAC3D,MAAM,eAAe,YAAY,aAAa,IAAI,gBAAgB,KAAA;CAClE,MAAM,cAAc,iBAAiB,KAAA,IAAY,gBAAgB,KAAA;CACjE,MAAM,mBAAmB,cACrB;EAAE,OAAO;EAAa,GAAG,cAAc;CAAM,IAC7C,KAAA;CAEJ,MAAM,YAA+B;EACnC,GAAG;EACH,GAAI,oBAAoB,EAAE,OAAO,iBAAiB;EAClD,WAAW;EACX,MAAM;EACN,eAAe,CAAC;EAChB,cAAc;EACd,WAAW,KACTC,oBAAO,MACPA,oBAAO,QAAQ,SACf,gBAAgBA,oBAAO,eACvB,SACF;CACF;CAEA,MAAM,cAAc,MAAM,SAAS,QAAQ,QAAQ,CAAC,CAAC;CAErD,IAAI,CAAC,MAAM,eAAe,WAAW,GACnC,MAAM,IAAI,MACR,wEAAwE,OACtE,QACF,EAAE,EACJ;CAIF,IAAI,YACF,OACE,oBAAC,QAAD;EACE,WAAW,KAAK,UAAU,WAAWA,oBAAO,QAAQ;EACpD,OAAO,cAAc;EACrB,eAAA;EACA,OAAA;CACD,CAAA;CAIL,OAAOC,eAAa,aAAa,SAAS;AAC5C,CAAC"}
1
+ {"version":3,"file":"Icon.mjs","names":["anyIconColors","styles","cloneElement"],"sources":["../../../../../../../src/components/Icon/Icon.tsx"],"sourcesContent":["import type { PropsWithChildren, SVGAttributes } from \"react\";\nimport React from \"react\";\nimport styles from \"./Icon.module.scss\";\nimport clsx from \"clsx\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { cloneElement } from \"@/lib/react/cloneElement\";\nimport { alphaColors, type Status, statusTypes } from \"@/lib/types/props\";\nimport { useWarnDeprecation } from \"@/components/DeprecationWarningProvider\";\nimport { useSkeletonMode } from \"@/components/SkeletonMode/skeletonModeContext\";\n\ntype SvgAttributeProps = SVGAttributes<SVGSVGElement>;\n\nconst iconColors = [\n \"neutral\",\n \"blue\",\n \"violet\",\n \"teal\",\n \"lilac\",\n ...statusTypes,\n ...alphaColors,\n] as const;\n\ntype IconColor = (typeof iconColors)[number];\ntype IconWithCustomColor = IconColor | (string & {});\n\nfunction isIconColor(something: unknown): something is IconColor {\n const anyIconColors = iconColors as readonly string[];\n return typeof something === \"string\" && anyIconColors.includes(something);\n}\n\nexport interface IconProps\n extends\n PropsWithChildren<Omit<SvgAttributeProps, \"name\" | \"color\">>,\n FlowComponentProps {\n /** The size of the icon. @default \"m\" */\n size?: \"s\" | \"m\" | \"l\";\n /**\n * The color of the icon. Besides the Flow colors, any custom CSS color is\n * supported. Inherits the surrounding text color when unset.\n */\n color?: IconWithCustomColor;\n /**\n * The elements status.\n *\n * @deprecated Use `color` instead.\n */\n status?: Status;\n}\n\n/** @flr-generate all */\nexport const Icon = flowComponent(\"Icon\", (props) => {\n const warnDeprecation = useWarnDeprecation();\n const isSkeleton = useSkeletonMode();\n const {\n className,\n \"aria-label\": ariaLabel,\n children,\n size = \"m\",\n status,\n color,\n ...svgAttributes\n } = props;\n\n if (status !== undefined) {\n warnDeprecation(\n \"The 'status' prop is deprecated and will be removed in a future release. Use 'color' instead.\",\n );\n }\n\n const resolvedColor = color ?? status;\n const paletteColor = isIconColor(resolvedColor) ? resolvedColor : undefined;\n const customColor = paletteColor === undefined ? resolvedColor : undefined;\n const customColorStyle = customColor\n ? { color: customColor, ...svgAttributes.style }\n : undefined;\n\n const iconProps: SvgAttributeProps = {\n ...svgAttributes,\n ...(customColorStyle && { style: customColorStyle }),\n focusable: \"false\",\n role: \"img\",\n \"aria-hidden\": !ariaLabel,\n \"aria-label\": ariaLabel,\n className: clsx(\n styles.icon,\n styles[`size-${size}`],\n paletteColor && styles[paletteColor],\n className,\n ),\n };\n\n const iconElement = React.Children.toArray(children)[0];\n\n if (!React.isValidElement(iconElement)) {\n throw new Error(\n `Expected children of Icon component to be a valid React element (got ${String(\n children,\n )})`,\n );\n }\n\n /* An svg draws no `::after`, so the shimmer needs an element of its own. */\n if (isSkeleton) {\n return (\n <span\n className={clsx(iconProps.className, styles.skeleton)}\n style={svgAttributes.style}\n aria-hidden\n inert\n />\n );\n }\n\n return cloneElement(iconElement, iconProps);\n});\n\nexport default Icon;\n"],"mappings":";;;;;;;;;;;;AAaA,IAAM,aAAa;CACjB;CACA;CACA;CACA;CACA;CACA,GAAG;CACH,GAAG;AACL;AAKA,SAAS,YAAY,WAA4C;CAE/D,OAAO,OAAO,cAAc,YAAYA,WAAc,SAAS,SAAS;AAC1E;;AAsBA,IAAa,OAAO,cAAc,SAAS,UAAU;CACnD,MAAM,kBAAkB,mBAAmB;CAC3C,MAAM,aAAa,gBAAgB;CACnC,MAAM,EACJ,WACA,cAAc,WACd,UACA,OAAO,KACP,QACA,OACA,GAAG,kBACD;CAEJ,IAAI,WAAW,KAAA,GACb,gBACE,+FACF;CAGF,MAAM,gBAAgB,SAAS;CAC/B,MAAM,eAAe,YAAY,aAAa,IAAI,gBAAgB,KAAA;CAClE,MAAM,cAAc,iBAAiB,KAAA,IAAY,gBAAgB,KAAA;CACjE,MAAM,mBAAmB,cACrB;EAAE,OAAO;EAAa,GAAG,cAAc;CAAM,IAC7C,KAAA;CAEJ,MAAM,YAA+B;EACnC,GAAG;EACH,GAAI,oBAAoB,EAAE,OAAO,iBAAiB;EAClD,WAAW;EACX,MAAM;EACN,eAAe,CAAC;EAChB,cAAc;EACd,WAAW,KACTC,oBAAO,MACPA,oBAAO,QAAQ,SACf,gBAAgBA,oBAAO,eACvB,SACF;CACF;CAEA,MAAM,cAAc,MAAM,SAAS,QAAQ,QAAQ,CAAC,CAAC;CAErD,IAAI,CAAC,MAAM,eAAe,WAAW,GACnC,MAAM,IAAI,MACR,wEAAwE,OACtE,QACF,EAAE,EACJ;CAIF,IAAI,YACF,OACE,oBAAC,QAAD;EACE,WAAW,KAAK,UAAU,WAAWA,oBAAO,QAAQ;EACpD,OAAO,cAAc;EACrB,eAAA;EACA,OAAA;CACD,CAAA;CAIL,OAAOC,eAAa,aAAa,SAAS;AAC5C,CAAC"}
@@ -9,10 +9,9 @@ var warning = "flow--icon--warning";
9
9
  var info = "flow--icon--info";
10
10
  var unavailable = "flow--icon--unavailable";
11
11
  var blue = "flow--icon--blue";
12
- var navy = "flow--icon--navy";
12
+ var violet = "flow--icon--violet";
13
+ var teal = "flow--icon--teal";
13
14
  var lilac = "flow--icon--lilac";
14
- var sage = "flow--icon--sage";
15
- var salmon = "flow--icon--salmon";
16
15
  var dark = "flow--icon--dark";
17
16
  var light = "flow--icon--light";
18
17
  var skeleton = "flow--icon--skeleton";
@@ -28,10 +27,9 @@ var Icon_module_default = {
28
27
  info,
29
28
  unavailable,
30
29
  blue,
31
- navy,
30
+ violet,
31
+ teal,
32
32
  lilac,
33
- sage,
34
- salmon,
35
33
  dark,
36
34
  light,
37
35
  "dark-static": "flow--icon--dark-static",
@@ -40,6 +38,6 @@ var Icon_module_default = {
40
38
  "skeleton-surface-shimmer": "flow--icon--skeleton-surface-shimmer",
41
39
  "skeleton-text-shimmer": "flow--icon--skeleton-text-shimmer"
42
40
  };
43
- export { blue, danger, dark, Icon_module_default as default, icon, info, light, lilac, navy, neutral, sage, salmon, skeleton, success, unavailable, warning };
41
+ export { blue, danger, dark, Icon_module_default as default, icon, info, light, lilac, neutral, skeleton, success, teal, unavailable, violet, warning };
44
42
 
45
43
  //# sourceMappingURL=Icon.module.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.module.mjs","names":[],"sources":["../../../../../../../src/components/Icon/Icon.module.scss"],"sourcesContent":["@use \"@/styles/mixins/skeleton\";\n\n.icon {\n flex-shrink: 0;\n max-width: none;\n display: inline-block;\n vertical-align: baseline;\n\n @extend .size-m;\n\n /* Sizes */\n @mixin size($size, $faPadding) {\n &:where(.size-#{$size}) {\n width: var(--icon--size--#{$size});\n height: var(--icon--size--#{$size});\n\n /*\n * FontAwesome inserts its stylesheet as an unlayered `<style>` element at\n * runtime (`autoAddCss` defaults to true), outside of Flow's build, and\n * sizes `.svg-inline--fa` itself (`content-box`, `1.25em` × `1em`).\n * Unlayered CSS beats layered CSS regardless of specificity, so this\n * override only applies in the layered stylesheet variant if it leaves\n * the cascade layer as well.\n *\n * `display` and `vertical-align` are set the same way: a context hides\n * its icon (`display: none` on `Breadcrumb`'s last separator, an\n * unselected `Segment`'s checkmark) or aligns it (`Alert`, `Link`).\n *\n * The size goes back to Flow's layered rules (`revert-layer`) instead of\n * the token, so a context's size (`Avatar`'s 70 %) still applies. The\n * variants without layers drop these declarations — there Flow's rules\n * already win, and `revert-layer` would discard them all.\n *\n * Marked at the leaf rather than in a separate block, because these rules\n * live in a size mixin – a block would have to duplicate it.\n */\n &:global(.svg-inline--fa) {\n @layer flow.unlayered {\n width: revert-layer;\n height: revert-layer;\n display: revert-layer;\n vertical-align: revert-layer;\n box-sizing: border-box;\n padding: $faPadding;\n }\n }\n }\n }\n\n @include size(m, var(--size-rem--xxs));\n @include size(s, var(--size-rem--xxs));\n @include size(l, var(--size-rem--xs));\n\n /*\n * FontAwesome also sets `vertical-align: -0.125em`, which would shift the\n * icon a context aligns (`Heading`, `Alert`, `Link`). Same mechanism as the\n * size above.\n */\n &:global(.svg-inline--fa) {\n @layer flow.unlayered {\n vertical-align: revert-layer;\n }\n }\n\n /* Colors */\n @mixin color($color) {\n &.#{$color} {\n color: var(--icon--#{$color}-color);\n }\n }\n\n &.neutral {\n color: var(--icon--color);\n }\n\n @include color(\"danger\");\n @include color(\"success\");\n @include color(\"warning\");\n @include color(\"info\");\n @include color(\"unavailable\");\n @include color(\"blue\");\n @include color(\"navy\");\n @include color(\"lilac\");\n @include color(\"sage\");\n @include color(\"salmon\");\n @include color(\"dark\");\n @include color(\"light\");\n @include color(\"dark-static\");\n @include color(\"light-static\");\n\n /* SkeletonMode */\n\n &.skeleton {\n @include skeleton.shape;\n\n --skeleton-radius: var(--corner-radius--s);\n }\n}\n\n@include skeleton.keyframes;\n"],"mappings":""}
1
+ {"version":3,"file":"Icon.module.mjs","names":[],"sources":["../../../../../../../src/components/Icon/Icon.module.scss"],"sourcesContent":["@use \"@/styles/mixins/skeleton\";\n\n.icon {\n flex-shrink: 0;\n max-width: none;\n display: inline-block;\n vertical-align: baseline;\n\n @extend .size-m;\n\n /* Sizes */\n @mixin size($size, $faPadding) {\n &:where(.size-#{$size}) {\n width: var(--icon--size--#{$size});\n height: var(--icon--size--#{$size});\n\n /*\n * FontAwesome inserts its stylesheet as an unlayered `<style>` element at\n * runtime (`autoAddCss` defaults to true), outside of Flow's build, and\n * sizes `.svg-inline--fa` itself (`content-box`, `1.25em` × `1em`).\n * Unlayered CSS beats layered CSS regardless of specificity, so this\n * override only applies in the layered stylesheet variant if it leaves\n * the cascade layer as well.\n *\n * `display` and `vertical-align` are set the same way: a context hides\n * its icon (`display: none` on `Breadcrumb`'s last separator, an\n * unselected `Segment`'s checkmark) or aligns it (`Alert`, `Link`).\n *\n * The size goes back to Flow's layered rules (`revert-layer`) instead of\n * the token, so a context's size (`Avatar`'s 70 %) still applies. The\n * variants without layers drop these declarations — there Flow's rules\n * already win, and `revert-layer` would discard them all.\n *\n * Marked at the leaf rather than in a separate block, because these rules\n * live in a size mixin – a block would have to duplicate it.\n */\n &:global(.svg-inline--fa) {\n @layer flow.unlayered {\n width: revert-layer;\n height: revert-layer;\n display: revert-layer;\n vertical-align: revert-layer;\n box-sizing: border-box;\n padding: $faPadding;\n }\n }\n }\n }\n\n @include size(m, var(--size-rem--xxs));\n @include size(s, var(--size-rem--xxs));\n @include size(l, var(--size-rem--xs));\n\n /*\n * FontAwesome also sets `vertical-align: -0.125em`, which would shift the\n * icon a context aligns (`Heading`, `Alert`, `Link`). Same mechanism as the\n * size above.\n */\n &:global(.svg-inline--fa) {\n @layer flow.unlayered {\n vertical-align: revert-layer;\n }\n }\n\n /* Colors */\n @mixin color($color) {\n &.#{$color} {\n color: var(--icon--#{$color}-color);\n }\n }\n\n &.neutral {\n color: var(--icon--color);\n }\n\n @include color(\"danger\");\n @include color(\"success\");\n @include color(\"warning\");\n @include color(\"info\");\n @include color(\"unavailable\");\n @include color(\"blue\");\n @include color(\"violet\");\n @include color(\"teal\");\n @include color(\"lilac\");\n @include color(\"dark\");\n @include color(\"light\");\n @include color(\"dark-static\");\n @include color(\"light-static\");\n\n /* SkeletonMode */\n\n &.skeleton {\n @include skeleton.shape;\n\n --skeleton-radius: var(--corner-radius--s);\n }\n}\n\n@include skeleton.keyframes;\n"],"mappings":""}
@@ -1,9 +1,9 @@
1
1
  "use client"
2
2
  /* */
3
- import { isAlphaColor } from "../../lib/types/props.mjs";
4
3
  import { PropsContextProvider } from "../../lib/propsContext/components/PropsContextProvider.mjs";
5
4
  import { flowComponent } from "../../lib/componentFactory/flowComponent.mjs";
6
5
  import { SectionHeadingReset } from "../Section/context.mjs";
6
+ import { isAlphaColor } from "../../lib/types/props.mjs";
7
7
  import IllustratedMessage_module_default from "./IllustratedMessage.module.mjs";
8
8
  import clsx from "clsx";
9
9
  import { jsx } from "react/jsx-runtime";
@@ -5,7 +5,7 @@ import { hash } from "object-code";
5
5
  // src/components/Initials/lib/getColorFromInitials.ts
6
6
  var getColorFromInitials = (initials) => {
7
7
  const code = hash(initials);
8
- const number = Math.abs(code % avatarColors.length);
8
+ const number = Math.abs(code % (avatarColors.length - 1));
9
9
  return avatarColors[number] ?? "blue";
10
10
  };
11
11
  export { getColorFromInitials };
@@ -1 +1 @@
1
- {"version":3,"file":"getColorFromInitials.mjs","names":["objectHash"],"sources":["../../../../../../../../src/components/Initials/lib/getColorFromInitials.ts"],"sourcesContent":["import { hash as objectHash } from \"object-code\";\nimport type { AvatarColors } from \"@/components/Avatar/Avatar\";\nimport { avatarColors } from \"@/components/Avatar/avatarColors\";\n\nexport const getColorFromInitials = (initials: string): AvatarColors => {\n const code = objectHash(initials);\n const number = Math.abs(code % avatarColors.length);\n return avatarColors[number] ?? \"blue\";\n};\n"],"mappings":";;;;;AAIA,IAAa,wBAAwB,aAAmC;CACtE,MAAM,OAAOA,KAAW,QAAQ;CAChC,MAAM,SAAS,KAAK,IAAI,OAAO,aAAa,MAAM;CAClD,OAAO,aAAa,WAAW;AACjC"}
1
+ {"version":3,"file":"getColorFromInitials.mjs","names":["objectHash"],"sources":["../../../../../../../../src/components/Initials/lib/getColorFromInitials.ts"],"sourcesContent":["import { hash as objectHash } from \"object-code\";\nimport type { AvatarColors } from \"@/components/Avatar/Avatar\";\nimport { avatarColors } from \"@/components/Avatar/avatarColors\";\n\nexport const getColorFromInitials = (initials: string): AvatarColors => {\n const code = objectHash(initials);\n const number = Math.abs(code % (avatarColors.length - 1));\n return avatarColors[number] ?? \"blue\";\n};\n"],"mappings":";;;;;AAIA,IAAa,wBAAwB,aAAmC;CACtE,MAAM,OAAOA,KAAW,QAAQ;CAChC,MAAM,SAAS,KAAK,IAAI,QAAQ,aAAa,SAAS,EAAE;CACxD,OAAO,aAAa,WAAW;AACjC"}
@@ -10,7 +10,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
10
10
  var LegendItem = (props) => {
11
11
  const { children, color: colorFromProps } = props;
12
12
  const isSkeleton = useSkeletonMode();
13
- const color = colorFromProps ? isCategoricalColor(colorFromProps) ? `var(--categorical--color--${colorFromProps})` : colorFromProps : void 0;
13
+ const color = colorFromProps ? isCategoricalColor(colorFromProps) ? `var(--color--categorical--${colorFromProps})` : colorFromProps : void 0;
14
14
  return /* @__PURE__ */ jsxs("li", {
15
15
  className: LegendItem_module_default.legendItem,
16
16
  inert: isSkeleton || void 0,
@@ -1 +1 @@
1
- {"version":3,"file":"LegendItem.mjs","names":["styles"],"sources":["../../../../../../../../../src/components/Legend/components/LegendItem/LegendItem.tsx"],"sourcesContent":["import Text from \"@/components/Text\";\nimport type { FC, PropsWithChildren } from \"react\";\nimport styles from \"./LegendItem.module.scss\";\nimport type { CategoricalWithCustomColor } from \"@/lib/tokens/CategoricalColors\";\nimport clsx from \"clsx\";\nimport { isCategoricalColor } from \"@/lib/tokens/isCategoricalColor\";\nimport { useSkeletonMode } from \"@/components/SkeletonMode/skeletonModeContext\";\n\nexport interface LegendItemProps extends PropsWithChildren {\n color?: CategoricalWithCustomColor;\n}\n\nexport const LegendItem: FC<LegendItemProps> = (props) => {\n const { children, color: colorFromProps } = props;\n\n const isSkeleton = useSkeletonMode();\n\n const color = colorFromProps\n ? isCategoricalColor(colorFromProps)\n ? `var(--categorical--color--${colorFromProps})`\n : colorFromProps\n : undefined;\n\n return (\n <li className={styles.legendItem} inert={isSkeleton || undefined}>\n <div\n style={\n colorFromProps && !isSkeleton ? { backgroundColor: color } : undefined\n }\n className={clsx(styles.colorSquare, isSkeleton && styles.skeleton)}\n />\n <Text>\n <small>{children}</small>\n </Text>\n </li>\n );\n};\n\nexport default LegendItem;\n"],"mappings":";;;;;;;;;AAYA,IAAa,cAAmC,UAAU;CACxD,MAAM,EAAE,UAAU,OAAO,mBAAmB;CAE5C,MAAM,aAAa,gBAAgB;CAEnC,MAAM,QAAQ,iBACV,mBAAmB,cAAc,IAC/B,6BAA6B,eAAe,KAC5C,iBACF,KAAA;CAEJ,OACE,qBAAC,MAAD;EAAI,WAAWA,0BAAO;EAAY,OAAO,cAAc,KAAA;EAAvD,UAAA,CACE,oBAAC,OAAD;GACE,OACE,kBAAkB,CAAC,aAAa,EAAE,iBAAiB,MAAM,IAAI,KAAA;GAE/D,WAAW,KAAKA,0BAAO,aAAa,cAAcA,0BAAO,QAAQ;EAClE,CAAA,GACD,oBAAC,MAAD,EAAA,UACE,oBAAC,SAAD,EAAQ,SAAgB,CAAA,EACpB,CAAA,CACJ;;AAER"}
1
+ {"version":3,"file":"LegendItem.mjs","names":["styles"],"sources":["../../../../../../../../../src/components/Legend/components/LegendItem/LegendItem.tsx"],"sourcesContent":["import Text from \"@/components/Text\";\nimport type { FC, PropsWithChildren } from \"react\";\nimport styles from \"./LegendItem.module.scss\";\nimport type { CategoricalWithCustomColor } from \"@/lib/tokens/CategoricalColors\";\nimport clsx from \"clsx\";\nimport { isCategoricalColor } from \"@/lib/tokens/isCategoricalColor\";\nimport { useSkeletonMode } from \"@/components/SkeletonMode/skeletonModeContext\";\n\nexport interface LegendItemProps extends PropsWithChildren {\n color?: CategoricalWithCustomColor;\n}\n\nexport const LegendItem: FC<LegendItemProps> = (props) => {\n const { children, color: colorFromProps } = props;\n\n const isSkeleton = useSkeletonMode();\n\n const color = colorFromProps\n ? isCategoricalColor(colorFromProps)\n ? `var(--color--categorical--${colorFromProps})`\n : colorFromProps\n : undefined;\n\n return (\n <li className={styles.legendItem} inert={isSkeleton || undefined}>\n <div\n style={\n colorFromProps && !isSkeleton ? { backgroundColor: color } : undefined\n }\n className={clsx(styles.colorSquare, isSkeleton && styles.skeleton)}\n />\n <Text>\n <small>{children}</small>\n </Text>\n </li>\n );\n};\n\nexport default LegendItem;\n"],"mappings":";;;;;;;;;AAYA,IAAa,cAAmC,UAAU;CACxD,MAAM,EAAE,UAAU,OAAO,mBAAmB;CAE5C,MAAM,aAAa,gBAAgB;CAEnC,MAAM,QAAQ,iBACV,mBAAmB,cAAc,IAC/B,6BAA6B,eAAe,KAC5C,iBACF,KAAA;CAEJ,OACE,qBAAC,MAAD;EAAI,WAAWA,0BAAO;EAAY,OAAO,cAAc,KAAA;EAAvD,UAAA,CACE,oBAAC,OAAD;GACE,OACE,kBAAkB,CAAC,aAAa,EAAE,iBAAiB,MAAM,IAAI,KAAA;GAE/D,WAAW,KAAKA,0BAAO,aAAa,cAAcA,0BAAO,QAAQ;EAClE,CAAA,GACD,oBAAC,MAAD,EAAA,UACE,oBAAC,SAAD,EAAQ,SAAgB,CAAA,EACpB,CAAA,CACJ;;AAER"}
@@ -1,10 +1,10 @@
1
1
  "use client"
2
2
  /* */
3
- import { isAlphaColor } from "../../lib/types/props.mjs";
4
3
  import { PropsContextProvider } from "../../lib/propsContext/components/PropsContextProvider.mjs";
5
4
  import { flowComponent } from "../../lib/componentFactory/flowComponent.mjs";
6
5
  import dynamic from "../../lib/propsContext/dynamicProps/dynamic.mjs";
7
6
  import { containsTextChild } from "../../lib/react/remote.mjs";
7
+ import { isAlphaColor } from "../../lib/types/props.mjs";
8
8
  import { useSkeletonMode } from "../SkeletonMode/skeletonModeContext.mjs";
9
9
  import { UiComponentTunnelExit } from "../UiComponentTunnel/UiComponentTunnelExit.mjs";
10
10
  import { hasContent } from "../SkeletonMode/lib/hasContent.mjs";
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
  /* */
3
- import { isAlphaColor } from "../../lib/types/props.mjs";
4
3
  import { flowComponent } from "../../lib/componentFactory/flowComponent.mjs";
4
+ import { isAlphaColor } from "../../lib/types/props.mjs";
5
5
  import { useSkeletonMode } from "../SkeletonMode/skeletonModeContext.mjs";
6
6
  import { IconPending } from "../Icon/components/icons/IconPending.mjs";
7
7
  import LoadingSpinner_module_default from "./LoadingSpinner.module.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"Notification.module.mjs","names":[],"sources":["../../../../../../../src/components/Notification/Notification.module.scss"],"sourcesContent":["@use \"@/styles/mixins/focus\";\n@use \"@/styles/mixins/skeleton\";\n\n.notification {\n border-radius: var(--notification--corner-radius);\n width: var(--notification--width);\n max-width: var(--notification--max-width);\n box-shadow: var(--notification--box-shadow);\n position: relative;\n border: var(--notification--border-width) var(--notification--border-style)\n var(--notification--border-color);\n\n /* The status stripe is masked out of a layer in the notification's\n shape, so it follows the corner radius instead of bending into it. */\n &::after {\n content: \"\";\n position: absolute;\n inset: calc(var(--notification--border-width) * -1);\n border-radius: inherit;\n pointer-events: none;\n mask-image: linear-gradient(\n to right,\n #000 var(--notification--border-x-start-width),\n transparent 0\n );\n }\n\n &:dir(rtl)::after {\n mask-image: linear-gradient(\n to left,\n #000 var(--notification--border-x-start-width),\n transparent 0\n );\n }\n\n @extend .info;\n\n /* Elements */\n\n .link {\n padding: var(--notification--padding);\n padding-inline-start: calc(\n var(--notification--padding) + var(--notification--border-x-start-width)\n );\n display: flex;\n flex-direction: column;\n row-gap: var(--notification--heading-to-text-spacing);\n cursor: default;\n transition-property: background-color;\n transition-duration: var(--transition--duration--default);\n position: relative;\n border-radius: calc(var(--notification--corner-radius) - 1px);\n\n @include focus.focus;\n }\n\n .heading {\n --button-size: calc(\n var(--button--line-height-s) + 2 * var(--button--padding-s-x)\n );\n\n padding-inline-end: calc(\n var(--button-size) + var(--heading--icon-to-text-spacing)\n );\n\n .icon {\n height: var(--heading-line-height);\n width: var(--heading-line-height);\n vertical-align: bottom;\n display: inline-block;\n margin-inline-end: var(--heading--icon-to-text-spacing);\n }\n }\n\n .text {\n font-size: var(--notification--font-size);\n }\n\n .close {\n position: absolute;\n top: var(--notification--padding);\n inset-inline-end: var(--notification--padding);\n }\n\n /* Status */\n\n @mixin status($status) {\n &.#{$status} {\n .link {\n border-color: var(--notification--#{$status}-background-color--default);\n background-color: var(\n --notification--#{$status}-background-color--default\n );\n }\n\n &::after {\n background-color: var(--notification--#{$status}-border-color);\n }\n\n &.hasLink {\n .link {\n &:hover {\n background-color: var(\n --notification--#{$status}-background-color--hover\n );\n }\n\n &[data-pressed] {\n background-color: var(\n --notification--#{$status}-background-color--pressed\n );\n }\n }\n }\n\n .heading {\n color: var(--notification--#{$status}-heading-color);\n }\n }\n }\n\n @include status(info);\n @include status(warning);\n @include status(danger);\n @include status(success);\n @include status(unavailable);\n\n /* SkeletonMode: no status color while the content loads */\n &.skeleton::after {\n background-color: skeleton.$background-color;\n }\n}\n"],"mappings":""}
1
+ {"version":3,"file":"Notification.module.mjs","names":[],"sources":["../../../../../../../src/components/Notification/Notification.module.scss"],"sourcesContent":["@use \"@/styles/mixins/focus\";\n@use \"@/styles/mixins/skeleton\";\n\n.notification {\n border-radius: var(--notification--corner-radius);\n width: var(--notification--width);\n max-width: var(--notification--max-width);\n box-shadow: var(--notification--box-shadow);\n position: relative;\n border: var(--notification--border-width) var(--notification--border-style)\n var(--notification--border-color);\n\n &::after {\n content: \"\";\n position: absolute;\n top: 0;\n bottom: 0;\n width: var(--notification--border-x-start-width);\n inset-inline-start: calc(var(--size-px--xxxs) * -1);\n border-start-start-radius: var(--notification--corner-radius);\n border-end-start-radius: var(--notification--corner-radius);\n }\n\n @extend .info;\n\n /* Elements */\n\n .link {\n padding: var(--notification--padding);\n padding-inline-start: calc(\n var(--notification--padding) + var(--notification--border-x-start-width)\n );\n display: flex;\n flex-direction: column;\n row-gap: var(--notification--heading-to-text-spacing);\n cursor: default;\n transition-property: background-color;\n transition-duration: var(--transition--duration--default);\n position: relative;\n border-radius: calc(var(--notification--corner-radius) - 1px);\n\n @include focus.focus;\n }\n\n .heading {\n --button-size: calc(\n var(--button--line-height-s) + 2 * var(--button--padding-s-x)\n );\n\n padding-inline-end: calc(\n var(--button-size) + var(--heading--icon-to-text-spacing)\n );\n\n .icon {\n height: var(--heading-line-height);\n width: var(--heading-line-height);\n vertical-align: bottom;\n display: inline-block;\n margin-inline-end: var(--heading--icon-to-text-spacing);\n }\n }\n\n .text {\n font-size: var(--notification--font-size);\n }\n\n .close {\n position: absolute;\n top: var(--notification--padding);\n inset-inline-end: var(--notification--padding);\n }\n\n /* Status */\n\n @mixin status($status) {\n &.#{$status} {\n .link {\n border-color: var(--notification--#{$status}-background-color--default);\n background-color: var(\n --notification--#{$status}-background-color--default\n );\n }\n\n &::after {\n background-color: var(--notification--#{$status}-border-color);\n }\n\n &.hasLink {\n .link {\n &:hover {\n background-color: var(\n --notification--#{$status}-background-color--hover\n );\n }\n\n &[data-pressed] {\n background-color: var(\n --notification--#{$status}-background-color--pressed\n );\n }\n }\n }\n\n .heading {\n color: var(--notification--#{$status}-heading-color);\n }\n }\n }\n\n @include status(info);\n @include status(warning);\n @include status(danger);\n @include status(success);\n @include status(unavailable);\n\n /* SkeletonMode: no status color while the content loads */\n &.skeleton::after {\n background-color: skeleton.$background-color;\n }\n}\n"],"mappings":""}