@mittwald/flow-react-components 1.6.0-next.7 → 1.6.0-next.9

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 (41) hide show
  1. package/dist/assets/component-index.json +1 -1
  2. package/dist/assets/doc-properties.json +1 -1
  3. package/dist/js/packages/components/src/components/AccentBox/AccentBox.mjs +3 -2
  4. package/dist/js/packages/components/src/components/AccentBox/AccentBox.mjs.map +1 -1
  5. package/dist/js/packages/components/src/components/Accordion/Accordion.mjs +3 -2
  6. package/dist/js/packages/components/src/components/Accordion/Accordion.mjs.map +1 -1
  7. package/dist/js/packages/components/src/components/Alert/Alert.mjs +3 -2
  8. package/dist/js/packages/components/src/components/Alert/Alert.mjs.map +1 -1
  9. package/dist/js/packages/components/src/components/CartesianChart/components/YAxis/YAxis.mjs +23 -5
  10. package/dist/js/packages/components/src/components/CartesianChart/components/YAxis/YAxis.mjs.map +1 -1
  11. package/dist/js/packages/components/src/components/CartesianChart/hooks/useTickLabelWidth.mjs +67 -0
  12. package/dist/js/packages/components/src/components/CartesianChart/hooks/useTickLabelWidth.mjs.map +1 -0
  13. package/dist/js/packages/components/src/components/ComboBox/ComboBox.mjs +3 -2
  14. package/dist/js/packages/components/src/components/ComboBox/ComboBox.mjs.map +1 -1
  15. package/dist/js/packages/components/src/components/DatePicker/DatePicker.mjs +2 -1
  16. package/dist/js/packages/components/src/components/DatePicker/DatePicker.mjs.map +1 -1
  17. package/dist/js/packages/components/src/components/DateRangePicker/DateRangePicker.mjs +2 -1
  18. package/dist/js/packages/components/src/components/DateRangePicker/DateRangePicker.mjs.map +1 -1
  19. package/dist/js/packages/components/src/components/Heading/Heading.mjs +2 -0
  20. package/dist/js/packages/components/src/components/Heading/Heading.mjs.map +1 -1
  21. package/dist/js/packages/components/src/components/IllustratedMessage/IllustratedMessage.mjs +3 -2
  22. package/dist/js/packages/components/src/components/IllustratedMessage/IllustratedMessage.mjs.map +1 -1
  23. package/dist/js/packages/components/src/components/Label/Label.mjs +0 -4
  24. package/dist/js/packages/components/src/components/Label/Label.mjs.map +1 -1
  25. package/dist/js/packages/components/src/components/List/components/Items/views/GridList/GridList.mjs +3 -0
  26. package/dist/js/packages/components/src/components/List/components/Items/views/GridList/GridList.mjs.map +1 -1
  27. package/dist/js/packages/components/src/components/Overlay/components/OverlayContent.mjs +2 -1
  28. package/dist/js/packages/components/src/components/Overlay/components/OverlayContent.mjs.map +1 -1
  29. package/dist/js/packages/components/src/components/Popover/components/PopoverContent/PopoverContent.mjs +4 -2
  30. package/dist/js/packages/components/src/components/Popover/components/PopoverContent/PopoverContent.mjs.map +1 -1
  31. package/dist/js/packages/components/src/components/Section/Section.mjs +9 -5
  32. package/dist/js/packages/components/src/components/Section/Section.mjs.map +1 -1
  33. package/dist/js/packages/components/src/components/Section/components/SectionHeader/SectionHeader.mjs +0 -4
  34. package/dist/js/packages/components/src/components/Section/components/SectionHeader/SectionHeader.mjs.map +1 -1
  35. package/dist/js/packages/components/src/components/Section/context.mjs +47 -0
  36. package/dist/js/packages/components/src/components/Section/context.mjs.map +1 -0
  37. package/dist/js/packages/components/src/components/Table/Table.mjs +3 -0
  38. package/dist/js/packages/components/src/components/Table/Table.mjs.map +1 -1
  39. package/dist/types/components/CartesianChart/hooks/useTickLabelWidth.d.ts +1 -0
  40. package/dist/types/components/Section/context.d.ts +28 -0
  41. package/package.json +10 -10
@@ -3,6 +3,7 @@
3
3
  import AccentBox_module_default from "./AccentBox.module.mjs";
4
4
  import { PropsContextProvider } from "../../lib/propsContext/components/PropsContextProvider.mjs";
5
5
  import { flowComponent } from "../../lib/componentFactory/flowComponent.mjs";
6
+ import { SectionHeadingReset } from "../Section/context.mjs";
6
7
  import clsx from "clsx";
7
8
  import { jsx } from "react/jsx-runtime";
8
9
  //#region src/components/AccentBox/AccentBox.tsx
@@ -46,10 +47,10 @@ var AccentBox = flowComponent("AccentBox", (props) => {
46
47
  return /* @__PURE__ */ jsx(Element, {
47
48
  className: rootClassName,
48
49
  style,
49
- children: /* @__PURE__ */ jsx(PropsContextProvider, {
50
+ children: /* @__PURE__ */ jsx(SectionHeadingReset, { children: /* @__PURE__ */ jsx(PropsContextProvider, {
50
51
  props: propsContext,
51
52
  children
52
- })
53
+ }) })
53
54
  });
54
55
  });
55
56
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"AccentBox.mjs","names":["anyAccentBoxBackgroundColors","styles"],"sources":["../../../../../../../src/components/AccentBox/AccentBox.tsx"],"sourcesContent":["import type { CSSProperties, PropsWithChildren } from \"react\";\nimport type {\n AlphaColor,\n PropsWithClassName,\n PropsWithElementType,\n} from \"@/lib/types/props\";\nimport clsx from \"clsx\";\nimport styles from \"./AccentBox.module.scss\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\n\nconst accentBoxBackgroundColors = [\n \"neutral\",\n \"blue\",\n \"violet\",\n \"teal\",\n \"lilac\",\n \"green\",\n \"navy\",\n \"gradient\",\n] as const;\n\ntype AccentBoxBackgroundColor = (typeof accentBoxBackgroundColors)[number];\ntype AccentBoxWithCustomBackgroundColor =\n AccentBoxBackgroundColor | (string & {});\n\nfunction isFlowColor(\n something: unknown,\n): something is AccentBoxBackgroundColor {\n const anyAccentBoxBackgroundColors =\n accentBoxBackgroundColors as readonly string[];\n return (\n typeof something === \"string\" &&\n anyAccentBoxBackgroundColors.includes(something)\n );\n}\n\nexport interface AccentBoxProps\n extends\n PropsWithChildren,\n PropsWithElementType<\"div\" | \"section\" | \"article\">,\n PropsWithClassName,\n FlowComponentProps {\n /** The background color of the accent box. @default \"neutral\" */\n backgroundColor?: AccentBoxWithCustomBackgroundColor;\n /** The content color of the accent box. @default \"default\" */\n color?: \"default\" | AlphaColor;\n /** The background image of the accent box. */\n backgroundImage?: string;\n /** The aspect ratio of the accent box. */\n aspectRatio?: CSSProperties[\"aspectRatio\"];\n}\n\n/**\n * @flr-generate all\n * @flowStatus beta\n */\nexport const AccentBox = flowComponent(\"AccentBox\", (props) => {\n const {\n color: colorFromProps,\n backgroundColor = \"neutral\",\n backgroundImage,\n children,\n elementType = \"div\",\n className,\n style: styleFromProps,\n aspectRatio,\n } = props;\n\n const defaultColor =\n (colorFromProps as unknown as string) === \"gradient\" ||\n backgroundColor === \"gradient\"\n ? \"dark\"\n : \"default\";\n\n const color = colorFromProps ?? defaultColor;\n\n const isAFlowColor = isFlowColor(backgroundColor);\n\n // backwards compatibility\n const backgroundColorFromColor =\n (colorFromProps as unknown as string) === \"neutral\" ||\n (colorFromProps as unknown as string) === \"gradient\" ||\n (colorFromProps as unknown as string) === \"green\"\n ? (colorFromProps as unknown as AccentBoxBackgroundColor)\n : undefined;\n\n const style = {\n backgroundColor: isAFlowColor ? undefined : backgroundColor,\n backgroundImage: backgroundImage ? `url(${backgroundImage})` : undefined,\n aspectRatio,\n ...styleFromProps,\n };\n\n const rootClassName = clsx(\n styles.accentBox,\n backgroundColorFromColor\n ? styles[backgroundColorFromColor]\n : isAFlowColor\n ? styles[backgroundColor]\n : undefined,\n className,\n );\n\n const Element = elementType;\n\n const contentColor = color === \"default\" ? undefined : color;\n\n const propsContext: PropsContext = {\n Link: {\n color: contentColor,\n },\n Text: {\n color: contentColor,\n },\n Heading: {\n color: contentColor,\n },\n Icon: {\n className: styles.icon,\n },\n };\n\n return (\n <Element className={rootClassName} style={style}>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </Element>\n );\n});\n\nexport default AccentBox;\n"],"mappings":";;;;;;;;AAcA,IAAM,4BAA4B;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAMA,SAAS,YACP,WACuC;CAGvC,OACE,OAAO,cAAc,YACrBA,0BAA6B,SAAS,SAAS;AAEnD;;;;;AAsBA,IAAa,YAAY,cAAc,cAAc,UAAU;CAC7D,MAAM,EACJ,OAAO,gBACP,kBAAkB,WAClB,iBACA,UACA,cAAc,OACd,WACA,OAAO,gBACP,gBACE;CAQJ,MAAM,QAAQ,mBALX,mBAAyC,cAC1C,oBAAoB,aAChB,SACA;CAIN,MAAM,eAAe,YAAY,eAAe;CAGhD,MAAM,2BACH,mBAAyC,aACzC,mBAAyC,cACzC,mBAAyC,UACrC,iBACD,KAAA;CAEN,MAAM,QAAQ;EACZ,iBAAiB,eAAe,KAAA,IAAY;EAC5C,iBAAiB,kBAAkB,OAAO,gBAAgB,KAAK,KAAA;EAC/D;EACA,GAAG;CACL;CAEA,MAAM,gBAAgB,KACpBC,yBAAO,WACP,2BACIA,yBAAO,4BACP,eACEA,yBAAO,mBACP,KAAA,GACN,SACF;CAEA,MAAM,UAAU;CAEhB,MAAM,eAAe,UAAU,YAAY,KAAA,IAAY;CAEvD,MAAM,eAA6B;EACjC,MAAM,EACJ,OAAO,aACT;EACA,MAAM,EACJ,OAAO,aACT;EACA,SAAS,EACP,OAAO,aACT;EACA,MAAM,EACJ,WAAWA,yBAAO,KACpB;CACF;CAEA,OACE,oBAAC,SAAD;EAAS,WAAW;EAAsB;EACxC,UAAA,oBAAC,sBAAD;GAAsB,OAAO;GAC1B;EACmB,CAAA;CACf,CAAA;AAEb,CAAC"}
1
+ {"version":3,"file":"AccentBox.mjs","names":["anyAccentBoxBackgroundColors","styles"],"sources":["../../../../../../../src/components/AccentBox/AccentBox.tsx"],"sourcesContent":["import type { CSSProperties, PropsWithChildren } from \"react\";\nimport type {\n AlphaColor,\n PropsWithClassName,\n PropsWithElementType,\n} from \"@/lib/types/props\";\nimport clsx from \"clsx\";\nimport styles from \"./AccentBox.module.scss\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport { SectionHeadingReset } from \"@/components/Section/context\";\n\nconst accentBoxBackgroundColors = [\n \"neutral\",\n \"blue\",\n \"violet\",\n \"teal\",\n \"lilac\",\n \"green\",\n \"navy\",\n \"gradient\",\n] as const;\n\ntype AccentBoxBackgroundColor = (typeof accentBoxBackgroundColors)[number];\ntype AccentBoxWithCustomBackgroundColor =\n AccentBoxBackgroundColor | (string & {});\n\nfunction isFlowColor(\n something: unknown,\n): something is AccentBoxBackgroundColor {\n const anyAccentBoxBackgroundColors =\n accentBoxBackgroundColors as readonly string[];\n return (\n typeof something === \"string\" &&\n anyAccentBoxBackgroundColors.includes(something)\n );\n}\n\nexport interface AccentBoxProps\n extends\n PropsWithChildren,\n PropsWithElementType<\"div\" | \"section\" | \"article\">,\n PropsWithClassName,\n FlowComponentProps {\n /** The background color of the accent box. @default \"neutral\" */\n backgroundColor?: AccentBoxWithCustomBackgroundColor;\n /** The content color of the accent box. @default \"default\" */\n color?: \"default\" | AlphaColor;\n /** The background image of the accent box. */\n backgroundImage?: string;\n /** The aspect ratio of the accent box. */\n aspectRatio?: CSSProperties[\"aspectRatio\"];\n}\n\n/**\n * @flr-generate all\n * @flowStatus beta\n */\nexport const AccentBox = flowComponent(\"AccentBox\", (props) => {\n const {\n color: colorFromProps,\n backgroundColor = \"neutral\",\n backgroundImage,\n children,\n elementType = \"div\",\n className,\n style: styleFromProps,\n aspectRatio,\n } = props;\n\n const defaultColor =\n (colorFromProps as unknown as string) === \"gradient\" ||\n backgroundColor === \"gradient\"\n ? \"dark\"\n : \"default\";\n\n const color = colorFromProps ?? defaultColor;\n\n const isAFlowColor = isFlowColor(backgroundColor);\n\n // backwards compatibility\n const backgroundColorFromColor =\n (colorFromProps as unknown as string) === \"neutral\" ||\n (colorFromProps as unknown as string) === \"gradient\" ||\n (colorFromProps as unknown as string) === \"green\"\n ? (colorFromProps as unknown as AccentBoxBackgroundColor)\n : undefined;\n\n const style = {\n backgroundColor: isAFlowColor ? undefined : backgroundColor,\n backgroundImage: backgroundImage ? `url(${backgroundImage})` : undefined,\n aspectRatio,\n ...styleFromProps,\n };\n\n const rootClassName = clsx(\n styles.accentBox,\n backgroundColorFromColor\n ? styles[backgroundColorFromColor]\n : isAFlowColor\n ? styles[backgroundColor]\n : undefined,\n className,\n );\n\n const Element = elementType;\n\n const contentColor = color === \"default\" ? undefined : color;\n\n const propsContext: PropsContext = {\n Link: {\n color: contentColor,\n },\n Text: {\n color: contentColor,\n },\n Heading: {\n color: contentColor,\n },\n Icon: {\n className: styles.icon,\n },\n };\n\n return (\n <Element className={rootClassName} style={style}>\n <SectionHeadingReset>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </SectionHeadingReset>\n </Element>\n );\n});\n\nexport default AccentBox;\n"],"mappings":";;;;;;;;;AAeA,IAAM,4BAA4B;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAMA,SAAS,YACP,WACuC;CAGvC,OACE,OAAO,cAAc,YACrBA,0BAA6B,SAAS,SAAS;AAEnD;;;;;AAsBA,IAAa,YAAY,cAAc,cAAc,UAAU;CAC7D,MAAM,EACJ,OAAO,gBACP,kBAAkB,WAClB,iBACA,UACA,cAAc,OACd,WACA,OAAO,gBACP,gBACE;CAQJ,MAAM,QAAQ,mBALX,mBAAyC,cAC1C,oBAAoB,aAChB,SACA;CAIN,MAAM,eAAe,YAAY,eAAe;CAGhD,MAAM,2BACH,mBAAyC,aACzC,mBAAyC,cACzC,mBAAyC,UACrC,iBACD,KAAA;CAEN,MAAM,QAAQ;EACZ,iBAAiB,eAAe,KAAA,IAAY;EAC5C,iBAAiB,kBAAkB,OAAO,gBAAgB,KAAK,KAAA;EAC/D;EACA,GAAG;CACL;CAEA,MAAM,gBAAgB,KACpBC,yBAAO,WACP,2BACIA,yBAAO,4BACP,eACEA,yBAAO,mBACP,KAAA,GACN,SACF;CAEA,MAAM,UAAU;CAEhB,MAAM,eAAe,UAAU,YAAY,KAAA,IAAY;CAEvD,MAAM,eAA6B;EACjC,MAAM,EACJ,OAAO,aACT;EACA,MAAM,EACJ,OAAO,aACT;EACA,SAAS,EACP,OAAO,aACT;EACA,MAAM,EACJ,WAAWA,yBAAO,KACpB;CACF;CAEA,OACE,oBAAC,SAAD;EAAS,WAAW;EAAsB;EACxC,UAAA,oBAAC,qBAAD,EAAA,UACE,oBAAC,sBAAD;GAAsB,OAAO;GAC1B;EACmB,CAAA,EACH,CAAA;CACd,CAAA;AAEb,CAAC"}
@@ -3,6 +3,7 @@
3
3
  import { PropsContextProvider } from "../../lib/propsContext/components/PropsContextProvider.mjs";
4
4
  import { flowComponent } from "../../lib/componentFactory/flowComponent.mjs";
5
5
  import dynamic from "../../lib/propsContext/dynamicProps/dynamic.mjs";
6
+ import { SectionHeadingReset } from "../Section/context.mjs";
6
7
  import Accordion_module_default from "./Accordion.module.mjs";
7
8
  import { useWarnDeprecation } from "../DeprecationWarningProvider/DeprecationWarningProvider.mjs";
8
9
  import { IconChevronDown } from "../Icon/components/icons/IconChevronDown.mjs";
@@ -101,7 +102,7 @@ var Accordion = flowComponent("Accordion", (props) => {
101
102
  ...rest,
102
103
  id,
103
104
  className: rootClassName,
104
- children: /* @__PURE__ */ jsx(TriggerContext, {
105
+ children: /* @__PURE__ */ jsx(SectionHeadingReset, { children: /* @__PURE__ */ jsx(TriggerContext, {
105
106
  value: triggerProps,
106
107
  children: /* @__PURE__ */ jsxs(PropsContextProvider, {
107
108
  props: propsContext,
@@ -118,7 +119,7 @@ var Accordion = flowComponent("Accordion", (props) => {
118
119
  })
119
120
  })]
120
121
  })
121
- })
122
+ }) })
122
123
  });
123
124
  }, { type: "layout" });
124
125
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"Accordion.mjs","names":["styles"],"sources":["../../../../../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["import type { ComponentProps, FC, PropsWithChildren } from \"react\";\nimport { createContext, useContext, useEffect, useId, useRef } from \"react\";\nimport { useDisclosure } from \"react-aria\";\nimport { useDisclosureState } from \"react-stately\";\nimport clsx from \"clsx\";\nimport styles from \"./Accordion.module.scss\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport { Button, type ButtonProps } from \"@/components/Button\";\nimport { IconChevronDown } from \"@/components/Icon/components/icons\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\nimport { useWarnDeprecation } from \"@/components/DeprecationWarningProvider\";\nimport {\n AccordionGroupContext,\n useAccordionGroupContext,\n} from \"@/components/AccordionGroup/context\";\n\nexport interface AccordionProps extends PropsWithChildren<\n ComponentProps<\"div\">\n> {\n /**\n * The key of the accordion inside an `AccordionGroup`, used by its\n * `expandedKeys`. Also set as the DOM id.\n */\n id?: string;\n /** Whether the accordion should be initially expanded. */\n defaultExpanded?: boolean;\n /**\n * The visual variant of the accordion. Has no effect.\n *\n * @deprecated Use `AccordionGroup` or a `LayoutCard` to set accordions apart.\n */\n variant?: \"default\" | \"outline\";\n}\n\n/*\n * The header button is rendered by the `Heading`, `Text` or `Label` the\n * consumer wrote, through a memoized props context. It reads the disclosure\n * state from a React context instead, so it always gets the current one.\n */\ntype TriggerProps = Pick<\n ButtonProps,\n \"id\" | \"aria-expanded\" | \"aria-controls\" | \"onPress\" | \"onPressStart\"\n>;\n\nconst TriggerContext = createContext<TriggerProps | null>(null);\n\ninterface HeaderButtonProps extends PropsWithChildren {\n /** Text and label headers are smaller than headings, so is their chevron. */\n isCompact?: boolean;\n}\n\n/*\n * Declared here and not inside the accordion: a component defined in a render\n * body gets a new identity on every render, so React unmounts and remounts it —\n * and the toggle loses the focus it just received on its own press.\n */\nconst HeaderButton: FC<HeaderButtonProps> = (props) => {\n const { children, isCompact } = props;\n const buttonProps = useContext(TriggerContext);\n\n return (\n <Button\n tunnel={null}\n unstyled\n className={styles.headerButton}\n {...buttonProps}\n >\n <span className={styles.headerContent}>{children}</span>\n <IconChevronDown\n className={styles.chevron}\n size={isCompact ? \"s\" : \"m\"}\n />\n </Button>\n );\n};\n\n/* Text and label headers render the same compact toggle. */\nconst compactHeader = {\n className: clsx(styles.header, styles.textHeader),\n children: dynamic((props: PropsWithChildren) => (\n <HeaderButton isCompact>{props.children}</HeaderButton>\n )),\n};\n\nconst propsContext: PropsContext = {\n Content: {\n className: styles.contentInner,\n tunnel: {\n id: \"content\",\n component: \"Accordion\",\n },\n },\n Heading: {\n className: styles.header,\n level: 3,\n children: dynamic((props) => <HeaderButton>{props.children}</HeaderButton>),\n Button: { size: \"m\" },\n },\n Text: {\n ...compactHeader,\n elementType: \"div\",\n },\n Label: {\n ...compactHeader,\n /*\n * A <label> names the first labelable element below it — here the toggle,\n * whose own text is the label's only content. The name computation walks\n * into the label, meets the button it started from and stops, so the\n * toggle ends up with an empty name. A <span> names nothing and the name\n * comes from the toggle's content again.\n */\n elementType: \"span\",\n },\n};\n\n/**\n * @flr-generate all\n * @flowStatus beta\n */\nexport const Accordion: FC<AccordionProps> = flowComponent(\n \"Accordion\",\n (props) => {\n const {\n children,\n className,\n id,\n defaultExpanded = false,\n variant,\n ...rest\n } = props;\n\n const warnDeprecation = useWarnDeprecation();\n if (variant !== undefined) {\n warnDeprecation(\n \"The 'variant' prop of the 'Accordion' component is deprecated and will be removed in a future release. Use 'AccordionGroup' or a 'LayoutCard' to set accordions apart instead.\",\n );\n }\n\n const generatedKey = useId();\n const key = id ?? generatedKey;\n const group = useAccordionGroupContext();\n const register = group?.register;\n\n /* `onExpandedChange` reports only keys the consumer gave. */\n useEffect(\n () => (id === undefined ? undefined : register?.(id, defaultExpanded)),\n [register, id, defaultExpanded],\n );\n\n const state = useDisclosureState({\n defaultExpanded,\n ...(group && {\n isExpanded: group.isExpanded(key, defaultExpanded),\n onExpandedChange: (isExpanded) => group.setExpanded(key, isExpanded),\n }),\n });\n\n const panelRef = useRef<HTMLDivElement>(null);\n const { buttonProps, panelProps } = useDisclosure({}, state, panelRef);\n const triggerProps: TriggerProps = {\n id: buttonProps.id,\n \"aria-expanded\": state.isExpanded,\n \"aria-controls\": buttonProps[\"aria-controls\"],\n onPress: buttonProps.onPress,\n onPressStart: buttonProps.onPressStart,\n };\n\n const rootClassName = clsx(\n styles.accordion,\n state.isExpanded && styles.expanded,\n group && styles.grouped,\n className,\n );\n\n return (\n <div {...rest} id={id} className={rootClassName}>\n <TriggerContext value={triggerProps}>\n <PropsContextProvider props={propsContext}>\n {children}\n <div {...panelProps} ref={panelRef} className={styles.content}>\n {/* An accordion inside the content is not part of this group. */}\n <AccordionGroupContext value={null}>\n <UiComponentTunnelExit id=\"content\" component=\"Accordion\" />\n </AccordionGroupContext>\n </div>\n </PropsContextProvider>\n </TriggerContext>\n </div>\n );\n },\n {\n type: \"layout\",\n },\n);\n\nexport default Accordion;\n"],"mappings":";;;;;;;;;;;;;;;;;AA8CA,IAAM,iBAAiB,cAAmC,IAAI;AAY9D,IAAM,gBAAuC,UAAU;CACrD,MAAM,EAAE,UAAU,cAAc;CAChC,MAAM,cAAc,WAAW,cAAc;CAE7C,OACE,qBAAC,QAAD;EACE,QAAQ;EACR,UAAA;EACA,WAAWA,yBAAO;EAClB,GAAI;EAJN,UAAA,CAME,oBAAC,QAAD;GAAM,WAAWA,yBAAO;GAAgB;EAAe,CAAA,GACvD,oBAAC,iBAAD;GACE,WAAWA,yBAAO;GAClB,MAAM,YAAY,MAAM;EACzB,CAAA,CACK;;AAEZ;AAGA,IAAM,gBAAgB;CACpB,WAAW,KAAKA,yBAAO,QAAQA,yBAAO,UAAU;CAChD,UAAU,SAAS,UACjB,oBAAC,cAAD;EAAc,WAAA;EAAW,UAAA,MAAM;CAAuB,CAAA,CACvD;AACH;AAEA,IAAM,eAA6B;CACjC,SAAS;EACP,WAAWA,yBAAO;EAClB,QAAQ;GACN,IAAI;GACJ,WAAW;EACb;CACF;CACA,SAAS;EACP,WAAWA,yBAAO;EAClB,OAAO;EACP,UAAU,SAAS,UAAU,oBAAC,cAAD,EAAA,UAAe,MAAM,SAAuB,CAAA,CAAC;EAC1E,QAAQ,EAAE,MAAM,IAAI;CACtB;CACA,MAAM;EACJ,GAAG;EACH,aAAa;CACf;CACA,OAAO;EACL,GAAG;EAQH,aAAa;CACf;AACF;;;;;AAMA,IAAa,YAAgC,cAC3C,cACC,UAAU;CACT,MAAM,EACJ,UACA,WACA,IACA,kBAAkB,OAClB,SACA,GAAG,SACD;CAEJ,MAAM,kBAAkB,mBAAmB;CAC3C,IAAI,YAAY,KAAA,GACd,gBACE,gLACF;CAGF,MAAM,eAAe,MAAM;CAC3B,MAAM,MAAM,MAAM;CAClB,MAAM,QAAQ,yBAAyB;CACvC,MAAM,WAAW,OAAO;CAGxB,gBACS,OAAO,KAAA,IAAY,KAAA,IAAY,WAAW,IAAI,eAAe,GACpE;EAAC;EAAU;EAAI;CAAe,CAChC;CAEA,MAAM,QAAQ,mBAAmB;EAC/B;EACA,GAAI,SAAS;GACX,YAAY,MAAM,WAAW,KAAK,eAAe;GACjD,mBAAmB,eAAe,MAAM,YAAY,KAAK,UAAU;EACrE;CACF,CAAC;CAED,MAAM,WAAW,OAAuB,IAAI;CAC5C,MAAM,EAAE,aAAa,eAAe,cAAc,CAAC,GAAG,OAAO,QAAQ;CACrE,MAAM,eAA6B;EACjC,IAAI,YAAY;EAChB,iBAAiB,MAAM;EACvB,iBAAiB,YAAY;EAC7B,SAAS,YAAY;EACrB,cAAc,YAAY;CAC5B;CAEA,MAAM,gBAAgB,KACpBA,yBAAO,WACP,MAAM,cAAcA,yBAAO,UAC3B,SAASA,yBAAO,SAChB,SACF;CAEA,OACE,oBAAC,OAAD;EAAK,GAAI;EAAU;EAAI,WAAW;EAChC,UAAA,oBAAC,gBAAD;GAAgB,OAAO;GACrB,UAAA,qBAAC,sBAAD;IAAsB,OAAO;IAA7B,UAAA,CACG,UACD,oBAAC,OAAD;KAAK,GAAI;KAAY,KAAK;KAAU,WAAWA,yBAAO;KAEpD,UAAA,oBAAC,uBAAD;MAAuB,OAAO;MAC5B,UAAA,oBAAC,uBAAD;OAAuB,IAAG;OAAU,WAAU;MAAa,CAAA;KACtC,CAAA;IACpB,CAAA,CACe;;EACR,CAAA;CACb,CAAA;AAET,GACA,EACE,MAAM,SACR,CACF"}
1
+ {"version":3,"file":"Accordion.mjs","names":["styles"],"sources":["../../../../../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["import type { ComponentProps, FC, PropsWithChildren } from \"react\";\nimport { createContext, useContext, useEffect, useId, useRef } from \"react\";\nimport { useDisclosure } from \"react-aria\";\nimport { useDisclosureState } from \"react-stately\";\nimport clsx from \"clsx\";\nimport styles from \"./Accordion.module.scss\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport { Button, type ButtonProps } from \"@/components/Button\";\nimport { IconChevronDown } from \"@/components/Icon/components/icons\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\nimport { useWarnDeprecation } from \"@/components/DeprecationWarningProvider\";\nimport {\n AccordionGroupContext,\n useAccordionGroupContext,\n} from \"@/components/AccordionGroup/context\";\nimport { SectionHeadingReset } from \"@/components/Section/context\";\n\nexport interface AccordionProps extends PropsWithChildren<\n ComponentProps<\"div\">\n> {\n /**\n * The key of the accordion inside an `AccordionGroup`, used by its\n * `expandedKeys`. Also set as the DOM id.\n */\n id?: string;\n /** Whether the accordion should be initially expanded. */\n defaultExpanded?: boolean;\n /**\n * The visual variant of the accordion. Has no effect.\n *\n * @deprecated Use `AccordionGroup` or a `LayoutCard` to set accordions apart.\n */\n variant?: \"default\" | \"outline\";\n}\n\n/*\n * The header button is rendered by the `Heading`, `Text` or `Label` the\n * consumer wrote, through a memoized props context. It reads the disclosure\n * state from a React context instead, so it always gets the current one.\n */\ntype TriggerProps = Pick<\n ButtonProps,\n \"id\" | \"aria-expanded\" | \"aria-controls\" | \"onPress\" | \"onPressStart\"\n>;\n\nconst TriggerContext = createContext<TriggerProps | null>(null);\n\ninterface HeaderButtonProps extends PropsWithChildren {\n /** Text and label headers are smaller than headings, so is their chevron. */\n isCompact?: boolean;\n}\n\n/*\n * Declared here and not inside the accordion: a component defined in a render\n * body gets a new identity on every render, so React unmounts and remounts it —\n * and the toggle loses the focus it just received on its own press.\n */\nconst HeaderButton: FC<HeaderButtonProps> = (props) => {\n const { children, isCompact } = props;\n const buttonProps = useContext(TriggerContext);\n\n return (\n <Button\n tunnel={null}\n unstyled\n className={styles.headerButton}\n {...buttonProps}\n >\n <span className={styles.headerContent}>{children}</span>\n <IconChevronDown\n className={styles.chevron}\n size={isCompact ? \"s\" : \"m\"}\n />\n </Button>\n );\n};\n\n/* Text and label headers render the same compact toggle. */\nconst compactHeader = {\n className: clsx(styles.header, styles.textHeader),\n children: dynamic((props: PropsWithChildren) => (\n <HeaderButton isCompact>{props.children}</HeaderButton>\n )),\n};\n\nconst propsContext: PropsContext = {\n Content: {\n className: styles.contentInner,\n tunnel: {\n id: \"content\",\n component: \"Accordion\",\n },\n },\n Heading: {\n className: styles.header,\n level: 3,\n children: dynamic((props) => <HeaderButton>{props.children}</HeaderButton>),\n Button: { size: \"m\" },\n },\n Text: {\n ...compactHeader,\n elementType: \"div\",\n },\n Label: {\n ...compactHeader,\n /*\n * A <label> names the first labelable element below it — here the toggle,\n * whose own text is the label's only content. The name computation walks\n * into the label, meets the button it started from and stops, so the\n * toggle ends up with an empty name. A <span> names nothing and the name\n * comes from the toggle's content again.\n */\n elementType: \"span\",\n },\n};\n\n/**\n * @flr-generate all\n * @flowStatus beta\n */\nexport const Accordion: FC<AccordionProps> = flowComponent(\n \"Accordion\",\n (props) => {\n const {\n children,\n className,\n id,\n defaultExpanded = false,\n variant,\n ...rest\n } = props;\n\n const warnDeprecation = useWarnDeprecation();\n if (variant !== undefined) {\n warnDeprecation(\n \"The 'variant' prop of the 'Accordion' component is deprecated and will be removed in a future release. Use 'AccordionGroup' or a 'LayoutCard' to set accordions apart instead.\",\n );\n }\n\n const generatedKey = useId();\n const key = id ?? generatedKey;\n const group = useAccordionGroupContext();\n const register = group?.register;\n\n /* `onExpandedChange` reports only keys the consumer gave. */\n useEffect(\n () => (id === undefined ? undefined : register?.(id, defaultExpanded)),\n [register, id, defaultExpanded],\n );\n\n const state = useDisclosureState({\n defaultExpanded,\n ...(group && {\n isExpanded: group.isExpanded(key, defaultExpanded),\n onExpandedChange: (isExpanded) => group.setExpanded(key, isExpanded),\n }),\n });\n\n const panelRef = useRef<HTMLDivElement>(null);\n const { buttonProps, panelProps } = useDisclosure({}, state, panelRef);\n const triggerProps: TriggerProps = {\n id: buttonProps.id,\n \"aria-expanded\": state.isExpanded,\n \"aria-controls\": buttonProps[\"aria-controls\"],\n onPress: buttonProps.onPress,\n onPressStart: buttonProps.onPressStart,\n };\n\n const rootClassName = clsx(\n styles.accordion,\n state.isExpanded && styles.expanded,\n group && styles.grouped,\n className,\n );\n\n return (\n <div {...rest} id={id} className={rootClassName}>\n <SectionHeadingReset>\n <TriggerContext value={triggerProps}>\n <PropsContextProvider props={propsContext}>\n {children}\n <div {...panelProps} ref={panelRef} className={styles.content}>\n {/* An accordion inside the content is not part of this group. */}\n <AccordionGroupContext value={null}>\n <UiComponentTunnelExit id=\"content\" component=\"Accordion\" />\n </AccordionGroupContext>\n </div>\n </PropsContextProvider>\n </TriggerContext>\n </SectionHeadingReset>\n </div>\n );\n },\n {\n type: \"layout\",\n },\n);\n\nexport default Accordion;\n"],"mappings":";;;;;;;;;;;;;;;;;;AA+CA,IAAM,iBAAiB,cAAmC,IAAI;AAY9D,IAAM,gBAAuC,UAAU;CACrD,MAAM,EAAE,UAAU,cAAc;CAChC,MAAM,cAAc,WAAW,cAAc;CAE7C,OACE,qBAAC,QAAD;EACE,QAAQ;EACR,UAAA;EACA,WAAWA,yBAAO;EAClB,GAAI;EAJN,UAAA,CAME,oBAAC,QAAD;GAAM,WAAWA,yBAAO;GAAgB;EAAe,CAAA,GACvD,oBAAC,iBAAD;GACE,WAAWA,yBAAO;GAClB,MAAM,YAAY,MAAM;EACzB,CAAA,CACK;;AAEZ;AAGA,IAAM,gBAAgB;CACpB,WAAW,KAAKA,yBAAO,QAAQA,yBAAO,UAAU;CAChD,UAAU,SAAS,UACjB,oBAAC,cAAD;EAAc,WAAA;EAAW,UAAA,MAAM;CAAuB,CAAA,CACvD;AACH;AAEA,IAAM,eAA6B;CACjC,SAAS;EACP,WAAWA,yBAAO;EAClB,QAAQ;GACN,IAAI;GACJ,WAAW;EACb;CACF;CACA,SAAS;EACP,WAAWA,yBAAO;EAClB,OAAO;EACP,UAAU,SAAS,UAAU,oBAAC,cAAD,EAAA,UAAe,MAAM,SAAuB,CAAA,CAAC;EAC1E,QAAQ,EAAE,MAAM,IAAI;CACtB;CACA,MAAM;EACJ,GAAG;EACH,aAAa;CACf;CACA,OAAO;EACL,GAAG;EAQH,aAAa;CACf;AACF;;;;;AAMA,IAAa,YAAgC,cAC3C,cACC,UAAU;CACT,MAAM,EACJ,UACA,WACA,IACA,kBAAkB,OAClB,SACA,GAAG,SACD;CAEJ,MAAM,kBAAkB,mBAAmB;CAC3C,IAAI,YAAY,KAAA,GACd,gBACE,gLACF;CAGF,MAAM,eAAe,MAAM;CAC3B,MAAM,MAAM,MAAM;CAClB,MAAM,QAAQ,yBAAyB;CACvC,MAAM,WAAW,OAAO;CAGxB,gBACS,OAAO,KAAA,IAAY,KAAA,IAAY,WAAW,IAAI,eAAe,GACpE;EAAC;EAAU;EAAI;CAAe,CAChC;CAEA,MAAM,QAAQ,mBAAmB;EAC/B;EACA,GAAI,SAAS;GACX,YAAY,MAAM,WAAW,KAAK,eAAe;GACjD,mBAAmB,eAAe,MAAM,YAAY,KAAK,UAAU;EACrE;CACF,CAAC;CAED,MAAM,WAAW,OAAuB,IAAI;CAC5C,MAAM,EAAE,aAAa,eAAe,cAAc,CAAC,GAAG,OAAO,QAAQ;CACrE,MAAM,eAA6B;EACjC,IAAI,YAAY;EAChB,iBAAiB,MAAM;EACvB,iBAAiB,YAAY;EAC7B,SAAS,YAAY;EACrB,cAAc,YAAY;CAC5B;CAEA,MAAM,gBAAgB,KACpBA,yBAAO,WACP,MAAM,cAAcA,yBAAO,UAC3B,SAASA,yBAAO,SAChB,SACF;CAEA,OACE,oBAAC,OAAD;EAAK,GAAI;EAAU;EAAI,WAAW;EAChC,UAAA,oBAAC,qBAAD,EAAA,UACE,oBAAC,gBAAD;GAAgB,OAAO;GACrB,UAAA,qBAAC,sBAAD;IAAsB,OAAO;IAA7B,UAAA,CACG,UACD,oBAAC,OAAD;KAAK,GAAI;KAAY,KAAK;KAAU,WAAWA,yBAAO;KAEpD,UAAA,oBAAC,uBAAD;MAAuB,OAAO;MAC5B,UAAA,oBAAC,uBAAD;OAAuB,IAAG;OAAU,WAAU;MAAa,CAAA;KACtC,CAAA;IACpB,CAAA,CACe;;EACR,CAAA,EACG,CAAA;CAClB,CAAA;AAET,GACA,EACE,MAAM,SACR,CACF"}
@@ -3,6 +3,7 @@
3
3
  import { PropsContextProvider } from "../../lib/propsContext/components/PropsContextProvider.mjs";
4
4
  import { flowComponent } from "../../lib/componentFactory/flowComponent.mjs";
5
5
  import dynamic from "../../lib/propsContext/dynamicProps/dynamic.mjs";
6
+ import { SectionHeadingReset } from "../Section/context.mjs";
6
7
  import { useSkeletonMode } from "../SkeletonMode/skeletonModeContext.mjs";
7
8
  import { AlertIcon } from "../AlertIcon/AlertIcon.mjs";
8
9
  import Alert_module_default from "./Alert.module.mjs";
@@ -37,11 +38,11 @@ var Alert = flowComponent("Alert", (props) => {
37
38
  ...rest,
38
39
  className: rootClassName,
39
40
  ref,
40
- children: /* @__PURE__ */ jsx(PropsContextProvider, {
41
+ children: /* @__PURE__ */ jsx(SectionHeadingReset, { children: /* @__PURE__ */ jsx(PropsContextProvider, {
41
42
  props: propsContext,
42
43
  dependencies: [status],
43
44
  children
44
- })
45
+ }) })
45
46
  });
46
47
  });
47
48
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.mjs","names":["styles","_Fragment"],"sources":["../../../../../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import { AlertIcon } from \"@/components/AlertIcon\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport type { PropsWithStatus } from \"@/lib/types/props\";\nimport clsx from \"clsx\";\nimport type { ComponentProps, PropsWithChildren } from \"react\";\nimport styles from \"./Alert.module.scss\";\nimport { useSkeletonMode } from \"@/components/SkeletonMode/skeletonModeContext\";\n\nexport interface AlertProps\n extends\n PropsWithChildren<ComponentProps<\"aside\">>,\n PropsWithStatus,\n FlowComponentProps<HTMLElement> {}\n\n/** @flr-generate all */\nexport const Alert = flowComponent(\"Alert\", (props) => {\n const { children, className, status = \"info\", ref, ...rest } = props;\n\n const isSkeleton = useSkeletonMode();\n\n const rootClassName = clsx(\n styles.alert,\n styles[status],\n isSkeleton && styles.skeleton,\n className,\n );\n\n const propsContext: PropsContext = {\n Heading: {\n className: styles.heading,\n level: 3,\n size: \"s\",\n children: dynamic((props) => (\n <>\n <AlertIcon status={status} className={styles.icon} />\n {props.children}\n </>\n )),\n },\n Content: {\n className: styles.content,\n Button: {\n size: \"s\",\n },\n ActionGroup: {\n preserveOrder: true,\n size: \"s\",\n },\n },\n };\n\n return (\n <aside {...rest} className={rootClassName} ref={ref}>\n <PropsContextProvider props={propsContext} dependencies={[status]}>\n {children}\n </PropsContextProvider>\n </aside>\n );\n});\n\nexport default Alert;\n"],"mappings":";;;;;;;;;;;;AAkBA,IAAa,QAAQ,cAAc,UAAU,UAAU;CACrD,MAAM,EAAE,UAAU,WAAW,SAAS,QAAQ,KAAK,GAAG,SAAS;CAE/D,MAAM,aAAa,gBAAgB;CAEnC,MAAM,gBAAgB,KACpBA,qBAAO,OACPA,qBAAO,SACP,cAAcA,qBAAO,UACrB,SACF;CAEA,MAAM,eAA6B;EACjC,SAAS;GACP,WAAWA,qBAAO;GAClB,OAAO;GACP,MAAM;GACN,UAAU,SAAS,UACjB,qBAAAC,UAAA,EAAA,UAAA,CACE,oBAAC,WAAD;IAAmB;IAAQ,WAAWD,qBAAO;GAAO,CAAA,GACnD,MAAM,QACP,EAAA,CAAA,CACH;EACH;EACA,SAAS;GACP,WAAWA,qBAAO;GAClB,QAAQ,EACN,MAAM,IACR;GACA,aAAa;IACX,eAAe;IACf,MAAM;GACR;EACF;CACF;CAEA,OACE,oBAAC,SAAD;EAAO,GAAI;EAAM,WAAW;EAAoB;EAC9C,UAAA,oBAAC,sBAAD;GAAsB,OAAO;GAAc,cAAc,CAAC,MAAM;GAC7D;EACmB,CAAA;CACjB,CAAA;AAEX,CAAC"}
1
+ {"version":3,"file":"Alert.mjs","names":["styles","_Fragment"],"sources":["../../../../../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import { AlertIcon } from \"@/components/AlertIcon\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport type { PropsWithStatus } from \"@/lib/types/props\";\nimport clsx from \"clsx\";\nimport type { ComponentProps, PropsWithChildren } from \"react\";\nimport styles from \"./Alert.module.scss\";\nimport { useSkeletonMode } from \"@/components/SkeletonMode/skeletonModeContext\";\nimport { SectionHeadingReset } from \"@/components/Section/context\";\n\nexport interface AlertProps\n extends\n PropsWithChildren<ComponentProps<\"aside\">>,\n PropsWithStatus,\n FlowComponentProps<HTMLElement> {}\n\n/** @flr-generate all */\nexport const Alert = flowComponent(\"Alert\", (props) => {\n const { children, className, status = \"info\", ref, ...rest } = props;\n\n const isSkeleton = useSkeletonMode();\n\n const rootClassName = clsx(\n styles.alert,\n styles[status],\n isSkeleton && styles.skeleton,\n className,\n );\n\n const propsContext: PropsContext = {\n Heading: {\n className: styles.heading,\n level: 3,\n size: \"s\",\n children: dynamic((props) => (\n <>\n <AlertIcon status={status} className={styles.icon} />\n {props.children}\n </>\n )),\n },\n Content: {\n className: styles.content,\n Button: {\n size: \"s\",\n },\n ActionGroup: {\n preserveOrder: true,\n size: \"s\",\n },\n },\n };\n\n return (\n <aside {...rest} className={rootClassName} ref={ref}>\n <SectionHeadingReset>\n <PropsContextProvider props={propsContext} dependencies={[status]}>\n {children}\n </PropsContextProvider>\n </SectionHeadingReset>\n </aside>\n );\n});\n\nexport default Alert;\n"],"mappings":";;;;;;;;;;;;;AAmBA,IAAa,QAAQ,cAAc,UAAU,UAAU;CACrD,MAAM,EAAE,UAAU,WAAW,SAAS,QAAQ,KAAK,GAAG,SAAS;CAE/D,MAAM,aAAa,gBAAgB;CAEnC,MAAM,gBAAgB,KACpBA,qBAAO,OACPA,qBAAO,SACP,cAAcA,qBAAO,UACrB,SACF;CAEA,MAAM,eAA6B;EACjC,SAAS;GACP,WAAWA,qBAAO;GAClB,OAAO;GACP,MAAM;GACN,UAAU,SAAS,UACjB,qBAAAC,UAAA,EAAA,UAAA,CACE,oBAAC,WAAD;IAAmB;IAAQ,WAAWD,qBAAO;GAAO,CAAA,GACnD,MAAM,QACP,EAAA,CAAA,CACH;EACH;EACA,SAAS;GACP,WAAWA,qBAAO;GAClB,QAAQ,EACN,MAAM,IACR;GACA,aAAa;IACX,eAAe;IACf,MAAM;GACR;EACF;CACF;CAEA,OACE,oBAAC,SAAD;EAAO,GAAI;EAAM,WAAW;EAAoB;EAC9C,UAAA,oBAAC,qBAAD,EAAA,UACE,oBAAC,sBAAD;GAAsB,OAAO;GAAc,cAAc,CAAC,MAAM;GAC7D;EACmB,CAAA,EACH,CAAA;CAChB,CAAA;AAEX,CAAC"}
@@ -2,6 +2,7 @@
2
2
  /* */
3
3
  import { useDesignTokens } from "../../../../lib/theming/hooks/useDesignTokens.mjs";
4
4
  import { useCartesianChartContext } from "../../context.mjs";
5
+ import { useTickLabelWidth } from "../../hooks/useTickLabelWidth.mjs";
5
6
  import { TypedYAxis } from "./types.mjs";
6
7
  import { jsx } from "react/jsx-runtime";
7
8
  import * as Recharts from "recharts";
@@ -20,17 +21,34 @@ var YAxis = (props) => {
20
21
  const { domain, type = "auto", width, ...rest } = props;
21
22
  const tokens = useDesignTokens();
22
23
  const { layout } = useCartesianChartContext();
23
- const isCategoryAxis = type === "category" || type === "auto" && layout === "vertical";
24
+ const tickLabels = useTickLabelWidth();
25
+ const isAutoWidth = (width ?? (type === "category" || type === "auto" && layout === "vertical" ? "auto" : void 0)) === "auto";
26
+ const tickMargin = parseInt(tokens.axis.spacing.value);
27
+ const tickSize = parseInt(tokens.axis["tick-size"].value);
28
+ const tickFill = tokens.axis["color"].value;
29
+ const autoWidth = tickLabels.width === void 0 ? "auto" : tickLabels.width + tickSize + tickMargin;
30
+ const measuredTick = (tickProps) => {
31
+ const { payload, index, tickFormatter } = tickProps;
32
+ const value = `${tickFormatter ? tickFormatter(payload.value, index) : payload.value}${rest.unit ?? ""}`;
33
+ return /* @__PURE__ */ jsx(Recharts.Text, {
34
+ ...tickProps,
35
+ ref: tickLabels.labelRef,
36
+ className: "recharts-cartesian-axis-tick-value",
37
+ fill: tickFill,
38
+ width: void 0,
39
+ children: value
40
+ });
41
+ };
24
42
  return /* @__PURE__ */ jsx(Recharts.YAxis, {
25
43
  ...rest,
26
44
  allowDataOverflow: true,
27
45
  domain,
28
46
  type,
29
- width: width ?? (isCategoryAxis ? "auto" : void 0),
47
+ width: isAutoWidth ? autoWidth : width,
30
48
  fontSize: tokens.axis["font-size"].value,
31
- tick: { fill: tokens.axis["color"].value },
32
- tickMargin: parseInt(tokens.axis.spacing.value),
33
- tickSize: parseInt(tokens.axis["tick-size"].value)
49
+ tick: isAutoWidth ? measuredTick : { fill: tickFill },
50
+ tickMargin,
51
+ tickSize
34
52
  });
35
53
  };
36
54
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"YAxis.mjs","names":[],"sources":["../../../../../../../../../src/components/CartesianChart/components/YAxis/YAxis.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport * as Recharts from \"recharts\";\nimport type {\n ChartDataValue,\n DataKey,\n DataKeyValue,\n} from \"@/components/CartesianChart/types\";\nimport { useCartesianChartContext } from \"@/components/CartesianChart/context\";\nimport { useDesignTokens } from \"@/lib/theming\";\n\nexport type YAxisProps<\n TData extends ChartDataValue = ChartDataValue,\n TDataKey extends DataKey<TData> = DataKey<TData>,\n TDataMatch = DataKeyValue<TData, TDataKey>,\n> = Pick<\n Recharts.YAxisProps,\n | \"className\"\n | \"orientation\"\n | \"allowDecimals\"\n | \"interval\"\n | \"minTickGap\"\n | \"scale\"\n | \"type\"\n | \"domain\"\n | \"hide\"\n | \"unit\"\n> & {\n dataKey?: TDataKey;\n tickFormatter?: (value: TDataMatch, index: number) => string;\n /**\n * The width of the axis in pixels. `\"auto\"` sizes the axis to its widest tick\n * label. Defaults to `\"auto\"` for a category axis (e.g. with `layout` set to\n * `\"vertical\"`) and to `60` otherwise. Pin a number to align the plot areas\n * of synchronized charts.\n */\n width?: number | \"auto\";\n};\n\n/**\n * `tickFormatter` is deliberately not part of the remote surface. A function\n * property crosses the boundary as a thread proxy whose call returns a Promise,\n * and recharts concatenates the formatter's result straight into the tick label\n * — so remotely every tick rendered `[object Promise]`. Dropping it from the\n * remote surface leaves the raw value there; the prop keeps working locally.\n *\n * @flr-generate all\n * @flr-ignore-props tickFormatter\n */\nexport const YAxis: FC<YAxisProps> = (props) => {\n const { domain, type = \"auto\", width, ...rest } = props;\n\n const tokens = useDesignTokens();\n const { layout } = useCartesianChartContext();\n\n const isCategoryAxis =\n type === \"category\" || (type === \"auto\" && layout === \"vertical\");\n\n return (\n <Recharts.YAxis\n {...rest}\n allowDataOverflow\n domain={domain}\n type={type}\n width={width ?? (isCategoryAxis ? \"auto\" : undefined)}\n fontSize={tokens.axis[\"font-size\"].value}\n tick={{\n fill: tokens.axis[\"color\"].value,\n }}\n tickMargin={parseInt(tokens.axis.spacing.value)}\n tickSize={parseInt(tokens.axis[\"tick-size\"].value)}\n />\n );\n};\n\nexport { TypedYAxis } from \"./types\";\n\nexport default YAxis;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAgDA,IAAa,SAAyB,UAAU;CAC9C,MAAM,EAAE,QAAQ,OAAO,QAAQ,OAAO,GAAG,SAAS;CAElD,MAAM,SAAS,gBAAgB;CAC/B,MAAM,EAAE,WAAW,yBAAyB;CAE5C,MAAM,iBACJ,SAAS,cAAe,SAAS,UAAU,WAAW;CAExD,OACE,oBAAC,SAAS,OAAV;EACE,GAAI;EACJ,mBAAA;EACQ;EACF;EACN,OAAO,UAAU,iBAAiB,SAAS,KAAA;EAC3C,UAAU,OAAO,KAAK,YAAY,CAAC;EACnC,MAAM,EACJ,MAAM,OAAO,KAAK,QAAQ,CAAC,MAC7B;EACA,YAAY,SAAS,OAAO,KAAK,QAAQ,KAAK;EAC9C,UAAU,SAAS,OAAO,KAAK,YAAY,CAAC,KAAK;CAClD,CAAA;AAEL"}
1
+ {"version":3,"file":"YAxis.mjs","names":[],"sources":["../../../../../../../../../src/components/CartesianChart/components/YAxis/YAxis.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport * as Recharts from \"recharts\";\nimport type {\n ChartDataValue,\n DataKey,\n DataKeyValue,\n} from \"@/components/CartesianChart/types\";\nimport { useCartesianChartContext } from \"@/components/CartesianChart/context\";\nimport { useDesignTokens } from \"@/lib/theming\";\nimport { useTickLabelWidth } from \"@/components/CartesianChart/hooks/useTickLabelWidth\";\n\nexport type YAxisProps<\n TData extends ChartDataValue = ChartDataValue,\n TDataKey extends DataKey<TData> = DataKey<TData>,\n TDataMatch = DataKeyValue<TData, TDataKey>,\n> = Pick<\n Recharts.YAxisProps,\n | \"className\"\n | \"orientation\"\n | \"allowDecimals\"\n | \"interval\"\n | \"minTickGap\"\n | \"scale\"\n | \"type\"\n | \"domain\"\n | \"hide\"\n | \"unit\"\n> & {\n dataKey?: TDataKey;\n tickFormatter?: (value: TDataMatch, index: number) => string;\n /**\n * The width of the axis in pixels. `\"auto\"` sizes the axis to its widest tick\n * label. Defaults to `\"auto\"` for a category axis (e.g. with `layout` set to\n * `\"vertical\"`) and to `60` otherwise. Pin a number to align the plot areas\n * of synchronized charts.\n */\n width?: number | \"auto\";\n};\n\n/**\n * `tickFormatter` is deliberately not part of the remote surface. A function\n * property crosses the boundary as a thread proxy whose call returns a Promise,\n * and recharts concatenates the formatter's result straight into the tick label\n * — so remotely every tick rendered `[object Promise]`. Dropping it from the\n * remote surface leaves the raw value there; the prop keeps working locally.\n *\n * @flr-generate all\n * @flr-ignore-props tickFormatter\n */\nexport const YAxis: FC<YAxisProps> = (props) => {\n const { domain, type = \"auto\", width, ...rest } = props;\n\n const tokens = useDesignTokens();\n const { layout } = useCartesianChartContext();\n const tickLabels = useTickLabelWidth();\n\n const isCategoryAxis =\n type === \"category\" || (type === \"auto\" && layout === \"vertical\");\n const isAutoWidth =\n (width ?? (isCategoryAxis ? \"auto\" : undefined)) === \"auto\";\n\n const tickMargin = parseInt(tokens.axis.spacing.value);\n const tickSize = parseInt(tokens.axis[\"tick-size\"].value);\n const tickFill = tokens.axis[\"color\"].value;\n\n /*\n * Recharts' own `\"auto\"` stays in charge until the labels are measured, so\n * the first frame is close already.\n */\n const autoWidth =\n tickLabels.width === undefined\n ? \"auto\"\n : tickLabels.width + tickSize + tickMargin;\n\n /*\n * Recharts' default tick label, plus the measuring ref. Recharts passes a\n * numeric axis width on to the label, which wraps once the text is wider —\n * so the label drops it, as it does with `\"auto\"`.\n */\n const measuredTick = (tickProps: Recharts.YAxisTickContentProps) => {\n const { payload, index, tickFormatter } = tickProps;\n const value = `${tickFormatter ? tickFormatter(payload.value, index) : payload.value}${rest.unit ?? \"\"}`;\n return (\n <Recharts.Text\n {...tickProps}\n ref={tickLabels.labelRef}\n className=\"recharts-cartesian-axis-tick-value\"\n fill={tickFill}\n width={undefined}\n >\n {value}\n </Recharts.Text>\n );\n };\n\n return (\n <Recharts.YAxis\n {...rest}\n allowDataOverflow\n domain={domain}\n type={type}\n width={isAutoWidth ? autoWidth : width}\n fontSize={tokens.axis[\"font-size\"].value}\n tick={isAutoWidth ? measuredTick : { fill: tickFill }}\n tickMargin={tickMargin}\n tickSize={tickSize}\n />\n );\n};\n\nexport { TypedYAxis } from \"./types\";\n\nexport default YAxis;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAiDA,IAAa,SAAyB,UAAU;CAC9C,MAAM,EAAE,QAAQ,OAAO,QAAQ,OAAO,GAAG,SAAS;CAElD,MAAM,SAAS,gBAAgB;CAC/B,MAAM,EAAE,WAAW,yBAAyB;CAC5C,MAAM,aAAa,kBAAkB;CAIrC,MAAM,eACH,UAFD,SAAS,cAAe,SAAS,UAAU,WAAW,aAE1B,SAAS,KAAA,QAAgB;CAEvD,MAAM,aAAa,SAAS,OAAO,KAAK,QAAQ,KAAK;CACrD,MAAM,WAAW,SAAS,OAAO,KAAK,YAAY,CAAC,KAAK;CACxD,MAAM,WAAW,OAAO,KAAK,QAAQ,CAAC;CAMtC,MAAM,YACJ,WAAW,UAAU,KAAA,IACjB,SACA,WAAW,QAAQ,WAAW;CAOpC,MAAM,gBAAgB,cAA8C;EAClE,MAAM,EAAE,SAAS,OAAO,kBAAkB;EAC1C,MAAM,QAAQ,GAAG,gBAAgB,cAAc,QAAQ,OAAO,KAAK,IAAI,QAAQ,QAAQ,KAAK,QAAQ;EACpG,OACE,oBAAC,SAAS,MAAV;GACE,GAAI;GACJ,KAAK,WAAW;GAChB,WAAU;GACV,MAAM;GACN,OAAO,KAAA;GAEN,UAAA;EACY,CAAA;CAEnB;CAEA,OACE,oBAAC,SAAS,OAAV;EACE,GAAI;EACJ,mBAAA;EACQ;EACF;EACN,OAAO,cAAc,YAAY;EACjC,UAAU,OAAO,KAAK,YAAY,CAAC;EACnC,MAAM,cAAc,eAAe,EAAE,MAAM,SAAS;EACxC;EACF;CACX,CAAA;AAEL"}
@@ -0,0 +1,67 @@
1
+ "use client"
2
+ /* */
3
+ import { createFrameResizeObserver } from "../../../lib/dom/createFrameResizeObserver.mjs";
4
+ import { useCallback, useEffect, useRef, useState } from "react";
5
+ //#region src/components/CartesianChart/hooks/useTickLabelWidth.ts
6
+ var measureLabel = (label) => {
7
+ try {
8
+ return label.getBBox().width;
9
+ } catch {
10
+ return 0;
11
+ }
12
+ };
13
+ /**
14
+ * Measures the widest tick label of an axis, for an axis that sizes itself to
15
+ * its labels.
16
+ *
17
+ * Replaces recharts' own `width="auto"` measurement, which undersizes the axis
18
+ * in two ways. It reads `getBoundingClientRect()` — screen pixels, which a CSS
19
+ * `zoom` or `transform` on an ancestor scales — and uses the result as SVG user
20
+ * units. And it measures once, so a web font that replaces its fallback after
21
+ * mount widens the labels past the axis. `getBBox()` measures in user units,
22
+ * and a `ResizeObserver` — which tracks an SVG element's bbox — measures again
23
+ * whenever a label changes size: a font swap, a new text, a hidden chart that
24
+ * is shown.
25
+ *
26
+ * Attach the returned ref to every tick label. The width is `undefined` until a
27
+ * label has been measured.
28
+ *
29
+ * @internal
30
+ */
31
+ var useTickLabelWidth = () => {
32
+ const labels = useRef(/* @__PURE__ */ new Set());
33
+ const observer = useRef(null);
34
+ const [width, setWidth] = useState();
35
+ const measure = useCallback(() => {
36
+ const widest = Math.max(0, ...[...labels.current].map(measureLabel));
37
+ setWidth(widest > 0 ? Math.ceil(widest) : void 0);
38
+ }, []);
39
+ useEffect(() => {
40
+ if (typeof ResizeObserver === "undefined") return;
41
+ const frameObserver = createFrameResizeObserver(measure);
42
+ frameObserver.observe(labels.current);
43
+ observer.current = frameObserver;
44
+ return () => {
45
+ frameObserver.disconnect();
46
+ observer.current = null;
47
+ };
48
+ }, [measure]);
49
+ return {
50
+ width,
51
+ labelRef: useCallback((label) => {
52
+ if (!label) return;
53
+ labels.current.add(label);
54
+ observer.current?.observe(labels.current);
55
+ measure();
56
+ return () => {
57
+ labels.current.delete(label);
58
+ observer.current?.observe(labels.current);
59
+ measure();
60
+ };
61
+ }, [measure])
62
+ };
63
+ };
64
+ //#endregion
65
+ export { useTickLabelWidth };
66
+
67
+ //# sourceMappingURL=useTickLabelWidth.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTickLabelWidth.mjs","names":[],"sources":["../../../../../../../../src/components/CartesianChart/hooks/useTickLabelWidth.ts"],"sourcesContent":["import {\n type RefCallback,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport {\n createFrameResizeObserver,\n type FrameResizeObserver,\n} from \"@/lib/dom/createFrameResizeObserver\";\n\nconst measureLabel = (label: SVGTextElement): number => {\n try {\n return label.getBBox().width;\n } catch {\n // Firefox throws for an element that is not rendered, and jsdom has no\n // `getBBox` at all.\n return 0;\n }\n};\n\n/**\n * Measures the widest tick label of an axis, for an axis that sizes itself to\n * its labels.\n *\n * Replaces recharts' own `width=\"auto\"` measurement, which undersizes the axis\n * in two ways. It reads `getBoundingClientRect()` — screen pixels, which a CSS\n * `zoom` or `transform` on an ancestor scales — and uses the result as SVG user\n * units. And it measures once, so a web font that replaces its fallback after\n * mount widens the labels past the axis. `getBBox()` measures in user units,\n * and a `ResizeObserver` — which tracks an SVG element's bbox — measures again\n * whenever a label changes size: a font swap, a new text, a hidden chart that\n * is shown.\n *\n * Attach the returned ref to every tick label. The width is `undefined` until a\n * label has been measured.\n *\n * @internal\n */\nexport const useTickLabelWidth = () => {\n const labels = useRef(new Set<SVGTextElement>());\n const observer = useRef<FrameResizeObserver>(null);\n const [width, setWidth] = useState<number>();\n\n const measure = useCallback(() => {\n const widest = Math.max(0, ...[...labels.current].map(measureLabel));\n setWidth(widest > 0 ? Math.ceil(widest) : undefined);\n }, []);\n\n useEffect(() => {\n // jsdom has no `ResizeObserver`.\n if (typeof ResizeObserver === \"undefined\") {\n return;\n }\n const frameObserver = createFrameResizeObserver(measure);\n frameObserver.observe(labels.current);\n observer.current = frameObserver;\n return () => {\n frameObserver.disconnect();\n observer.current = null;\n };\n }, [measure]);\n\n const labelRef: RefCallback<SVGTextElement> = useCallback(\n (label) => {\n if (!label) {\n return;\n }\n labels.current.add(label);\n observer.current?.observe(labels.current);\n measure();\n return () => {\n labels.current.delete(label);\n observer.current?.observe(labels.current);\n measure();\n };\n },\n [measure],\n );\n\n return { width, labelRef };\n};\n"],"mappings":";;;;;AAYA,IAAM,gBAAgB,UAAkC;CACtD,IAAI;EACF,OAAO,MAAM,QAAQ,CAAC,CAAC;CACzB,QAAQ;EAGN,OAAO;CACT;AACF;;;;;;;;;;;;;;;;;;;AAoBA,IAAa,0BAA0B;CACrC,MAAM,SAAS,uBAAO,IAAI,IAAoB,CAAC;CAC/C,MAAM,WAAW,OAA4B,IAAI;CACjD,MAAM,CAAC,OAAO,YAAY,SAAiB;CAE3C,MAAM,UAAU,kBAAkB;EAChC,MAAM,SAAS,KAAK,IAAI,GAAG,GAAG,CAAC,GAAG,OAAO,OAAO,CAAC,CAAC,IAAI,YAAY,CAAC;EACnE,SAAS,SAAS,IAAI,KAAK,KAAK,MAAM,IAAI,KAAA,CAAS;CACrD,GAAG,CAAC,CAAC;CAEL,gBAAgB;EAEd,IAAI,OAAO,mBAAmB,aAC5B;EAEF,MAAM,gBAAgB,0BAA0B,OAAO;EACvD,cAAc,QAAQ,OAAO,OAAO;EACpC,SAAS,UAAU;EACnB,aAAa;GACX,cAAc,WAAW;GACzB,SAAS,UAAU;EACrB;CACF,GAAG,CAAC,OAAO,CAAC;CAmBZ,OAAO;EAAE;EAAO,UAjB8B,aAC3C,UAAU;GACT,IAAI,CAAC,OACH;GAEF,OAAO,QAAQ,IAAI,KAAK;GACxB,SAAS,SAAS,QAAQ,OAAO,OAAO;GACxC,QAAQ;GACR,aAAa;IACX,OAAO,QAAQ,OAAO,KAAK;IAC3B,SAAS,SAAS,QAAQ,OAAO,OAAO;IACxC,QAAQ;GACV;EACF,GACA,CAAC,OAAO,CAGM;CAAS;AAC3B"}
@@ -19,7 +19,7 @@ import * as Aria from "react-aria-components";
19
19
  //#region src/components/ComboBox/ComboBox.tsx
20
20
  /** @flr-generate all */
21
21
  var ComboBox = flowComponent("ComboBox", (props) => {
22
- const { children, className, menuTrigger = "focus", onChange, onSelectionChange, placeholder, ref, renderEmptyState, ...rest } = props;
22
+ const { children, className, menuTrigger = "focus", onChange, onOpenChange, onSelectionChange, placeholder, ref, renderEmptyState, ...rest } = props;
23
23
  const { FieldErrorView, FieldErrorCaptureContext, wrapperProps, controlProps, fieldPropsContext, skeletonProps } = useFieldComponent(props, "ComboBox");
24
24
  const stringFormatter = useLocalizedStringFormatter(__locale_default, "ComboBox");
25
25
  const rootClassName = clsx(wrapperProps.className, ComboBox_module_default.comboBox, className);
@@ -40,8 +40,9 @@ var ComboBox = flowComponent("ComboBox", (props) => {
40
40
  ...controlProps,
41
41
  ...skeletonProps,
42
42
  onSelectionChange: handleSelectionChange,
43
- onOpenChange: (isOpen) => {
43
+ onOpenChange: (isOpen, menuTrigger) => {
44
44
  controller.setOpen(isOpen);
45
+ onOpenChange?.(isOpen, menuTrigger);
45
46
  },
46
47
  children: /* @__PURE__ */ jsxs(PropsContextProvider, {
47
48
  props: propsContext,
@@ -1 +1 @@
1
- {"version":3,"file":"ComboBox.mjs","names":["locales","styles"],"sources":["../../../../../../../src/components/ComboBox/ComboBox.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport type { Key } from \"react-aria-components\";\nimport * as Aria from \"react-aria-components\";\nimport { Button } from \"@/components/Button\";\nimport { IconChevronDown } from \"@/components/Icon/components/icons\";\nimport { Options } from \"@/components/Options\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport styles from \"./ComboBox.module.scss\";\nimport locales from \"./locales/*.locale.json\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { getOptionsTunnelProps } from \"@/components/Option/optionsTunnel\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport type { OptionsProps } from \"@/components/Options/Options\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport interface ComboBoxProps\n extends\n Omit<Aria.ComboBoxProps<never>, \"children\" | \"onChange\">,\n Pick<Aria.InputProps, \"placeholder\">,\n Pick<OptionsProps, \"renderEmptyState\">,\n PropsWithChildren,\n FlowComponentProps<HTMLInputElement> {\n /** Called with the key of the selected option whenever the selection changes. */\n onChange?: (value: string) => void;\n}\n\n/** @flr-generate all */\nexport const ComboBox = flowComponent(\"ComboBox\", (props) => {\n const {\n children,\n className,\n menuTrigger = \"focus\",\n onChange,\n onSelectionChange,\n placeholder,\n ref,\n renderEmptyState,\n ...rest\n } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n wrapperProps,\n controlProps,\n fieldPropsContext,\n skeletonProps,\n } = useFieldComponent(props, \"ComboBox\");\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"ComboBox\");\n\n const rootClassName = clsx(\n wrapperProps.className,\n styles.comboBox,\n className,\n );\n\n const propsContext: PropsContext = {\n Option: {\n tunnel: getOptionsTunnelProps(\"ComboBox\"),\n },\n ...fieldPropsContext,\n };\n\n const handleSelectionChange = (key: Key | null) => {\n if (key === null) {\n return;\n }\n onChange?.(String(key));\n onSelectionChange?.(key);\n };\n\n const controller = useOverlayController(\"ComboBox\", {\n reuseControllerFromContext: false,\n });\n\n return (\n <Aria.ComboBox\n menuTrigger={menuTrigger}\n className={rootClassName}\n {...rest}\n {...controlProps}\n {...skeletonProps}\n onSelectionChange={handleSelectionChange}\n onOpenChange={(isOpen) => {\n controller.setOpen(isOpen);\n }}\n >\n <PropsContextProvider props={propsContext}>\n <FieldErrorCaptureContext>\n <div className={styles.input}>\n <Aria.Input placeholder={placeholder} ref={ref} />\n <Button\n className={styles.toggle}\n aria-label={stringFormatter.format(\"showOptions\")}\n variant=\"plain\"\n color=\"secondary\"\n >\n <IconChevronDown />\n </Button>\n </div>\n\n {children}\n\n <Options\n controller={controller}\n onOpenChange={() => {\n // cut-off to avoid double controller state changes\n }}\n renderEmptyState={renderEmptyState}\n >\n <UiComponentTunnelExit id=\"options\" component=\"ComboBox\" />\n </Options>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </PropsContextProvider>\n </Aria.ComboBox>\n );\n});\n\nexport default ComboBox;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgCA,IAAa,WAAW,cAAc,aAAa,UAAU;CAC3D,MAAM,EACJ,UACA,WACA,cAAc,SACd,UACA,mBACA,aACA,KACA,kBACA,GAAG,SACD;CAEJ,MAAM,EACJ,gBACA,0BACA,cACA,cACA,mBACA,kBACE,kBAAkB,OAAO,UAAU;CAEvC,MAAM,kBAAkB,4BAA4BA,kBAAS,UAAU;CAEvE,MAAM,gBAAgB,KACpB,aAAa,WACbC,wBAAO,UACP,SACF;CAEA,MAAM,eAA6B;EACjC,QAAQ,EACN,QAAQ,sBAAsB,UAAU,EAC1C;EACA,GAAG;CACL;CAEA,MAAM,yBAAyB,QAAoB;EACjD,IAAI,QAAQ,MACV;EAEF,WAAW,OAAO,GAAG,CAAC;EACtB,oBAAoB,GAAG;CACzB;CAEA,MAAM,aAAa,qBAAqB,YAAY,EAClD,4BAA4B,MAC9B,CAAC;CAED,OACE,oBAAC,KAAK,UAAN;EACe;EACb,WAAW;EACX,GAAI;EACJ,GAAI;EACJ,GAAI;EACJ,mBAAmB;EACnB,eAAe,WAAW;GACxB,WAAW,QAAQ,MAAM;EAC3B;EAEA,UAAA,qBAAC,sBAAD;GAAsB,OAAO;GAA7B,UAAA,CACE,qBAAC,0BAAD,EAAA,UAAA;IACE,qBAAC,OAAD;KAAK,WAAWA,wBAAO;KAAvB,UAAA,CACE,oBAAC,KAAK,OAAN;MAAyB;MAAkB;KAAM,CAAA,GACjD,oBAAC,QAAD;MACE,WAAWA,wBAAO;MAClB,cAAY,gBAAgB,OAAO,aAAa;MAChD,SAAQ;MACR,OAAM;MAEN,UAAA,oBAAC,iBAAD,CAAkB,CAAA;KACZ,CAAA,CACL;;IAEJ;IAED,oBAAC,SAAD;KACc;KACZ,oBAAoB,CAEpB;KACkB;KAElB,UAAA,oBAAC,uBAAD;MAAuB,IAAG;MAAU,WAAU;KAAY,CAAA;IACnD,CAAA;GACe,EAAA,CAAA,GAC1B,oBAAC,gBAAD,CAAiB,CAAA,CACG;;CACT,CAAA;AAEnB,CAAC"}
1
+ {"version":3,"file":"ComboBox.mjs","names":["locales","styles"],"sources":["../../../../../../../src/components/ComboBox/ComboBox.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport type { Key } from \"react-aria-components\";\nimport * as Aria from \"react-aria-components\";\nimport { Button } from \"@/components/Button\";\nimport { IconChevronDown } from \"@/components/Icon/components/icons\";\nimport { Options } from \"@/components/Options\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport styles from \"./ComboBox.module.scss\";\nimport locales from \"./locales/*.locale.json\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { getOptionsTunnelProps } from \"@/components/Option/optionsTunnel\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport type { OptionsProps } from \"@/components/Options/Options\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport interface ComboBoxProps\n extends\n Omit<Aria.ComboBoxProps<never>, \"children\" | \"onChange\">,\n Pick<Aria.InputProps, \"placeholder\">,\n Pick<OptionsProps, \"renderEmptyState\">,\n PropsWithChildren,\n FlowComponentProps<HTMLInputElement> {\n /** Called with the key of the selected option whenever the selection changes. */\n onChange?: (value: string) => void;\n}\n\n/** @flr-generate all */\nexport const ComboBox = flowComponent(\"ComboBox\", (props) => {\n const {\n children,\n className,\n menuTrigger = \"focus\",\n onChange,\n onOpenChange,\n onSelectionChange,\n placeholder,\n ref,\n renderEmptyState,\n ...rest\n } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n wrapperProps,\n controlProps,\n fieldPropsContext,\n skeletonProps,\n } = useFieldComponent(props, \"ComboBox\");\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"ComboBox\");\n\n const rootClassName = clsx(\n wrapperProps.className,\n styles.comboBox,\n className,\n );\n\n const propsContext: PropsContext = {\n Option: {\n tunnel: getOptionsTunnelProps(\"ComboBox\"),\n },\n ...fieldPropsContext,\n };\n\n const handleSelectionChange = (key: Key | null) => {\n if (key === null) {\n return;\n }\n onChange?.(String(key));\n onSelectionChange?.(key);\n };\n\n const controller = useOverlayController(\"ComboBox\", {\n reuseControllerFromContext: false,\n });\n\n return (\n <Aria.ComboBox\n menuTrigger={menuTrigger}\n className={rootClassName}\n {...rest}\n {...controlProps}\n {...skeletonProps}\n onSelectionChange={handleSelectionChange}\n onOpenChange={(isOpen, menuTrigger) => {\n controller.setOpen(isOpen);\n onOpenChange?.(isOpen, menuTrigger);\n }}\n >\n <PropsContextProvider props={propsContext}>\n <FieldErrorCaptureContext>\n <div className={styles.input}>\n <Aria.Input placeholder={placeholder} ref={ref} />\n <Button\n className={styles.toggle}\n aria-label={stringFormatter.format(\"showOptions\")}\n variant=\"plain\"\n color=\"secondary\"\n >\n <IconChevronDown />\n </Button>\n </div>\n\n {children}\n\n <Options\n controller={controller}\n onOpenChange={() => {\n // cut-off to avoid double controller state changes\n }}\n renderEmptyState={renderEmptyState}\n >\n <UiComponentTunnelExit id=\"options\" component=\"ComboBox\" />\n </Options>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </PropsContextProvider>\n </Aria.ComboBox>\n );\n});\n\nexport default ComboBox;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgCA,IAAa,WAAW,cAAc,aAAa,UAAU;CAC3D,MAAM,EACJ,UACA,WACA,cAAc,SACd,UACA,cACA,mBACA,aACA,KACA,kBACA,GAAG,SACD;CAEJ,MAAM,EACJ,gBACA,0BACA,cACA,cACA,mBACA,kBACE,kBAAkB,OAAO,UAAU;CAEvC,MAAM,kBAAkB,4BAA4BA,kBAAS,UAAU;CAEvE,MAAM,gBAAgB,KACpB,aAAa,WACbC,wBAAO,UACP,SACF;CAEA,MAAM,eAA6B;EACjC,QAAQ,EACN,QAAQ,sBAAsB,UAAU,EAC1C;EACA,GAAG;CACL;CAEA,MAAM,yBAAyB,QAAoB;EACjD,IAAI,QAAQ,MACV;EAEF,WAAW,OAAO,GAAG,CAAC;EACtB,oBAAoB,GAAG;CACzB;CAEA,MAAM,aAAa,qBAAqB,YAAY,EAClD,4BAA4B,MAC9B,CAAC;CAED,OACE,oBAAC,KAAK,UAAN;EACe;EACb,WAAW;EACX,GAAI;EACJ,GAAI;EACJ,GAAI;EACJ,mBAAmB;EACnB,eAAe,QAAQ,gBAAgB;GACrC,WAAW,QAAQ,MAAM;GACzB,eAAe,QAAQ,WAAW;EACpC;EAEA,UAAA,qBAAC,sBAAD;GAAsB,OAAO;GAA7B,UAAA,CACE,qBAAC,0BAAD,EAAA,UAAA;IACE,qBAAC,OAAD;KAAK,WAAWA,wBAAO;KAAvB,UAAA,CACE,oBAAC,KAAK,OAAN;MAAyB;MAAkB;KAAM,CAAA,GACjD,oBAAC,QAAD;MACE,WAAWA,wBAAO;MAClB,cAAY,gBAAgB,OAAO,aAAa;MAChD,SAAQ;MACR,OAAM;MAEN,UAAA,oBAAC,iBAAD,CAAkB,CAAA;KACZ,CAAA,CACL;;IAEJ;IAED,oBAAC,SAAD;KACc;KACZ,oBAAoB,CAEpB;KACkB;KAElB,UAAA,oBAAC,uBAAD;MAAuB,IAAG;MAAU,WAAU;KAAY,CAAA;IACnD,CAAA;GACe,EAAA,CAAA,GAC1B,oBAAC,gBAAD,CAAiB,CAAA,CACG;;CACT,CAAA;AAEnB,CAAC"}
@@ -16,7 +16,7 @@ import * as Aria from "react-aria-components";
16
16
  //#region src/components/DatePicker/DatePicker.tsx
17
17
  /** @flr-generate all */
18
18
  var DatePicker = flowComponent("DatePicker", (props) => {
19
- const { children, className, onChange, ref, ...rest } = useControlledHostValueProps(props, null);
19
+ const { children, className, onChange, onOpenChange, ref, ...rest } = useControlledHostValueProps(props, null);
20
20
  const popoverController = useOverlayController("Popover", { reuseControllerFromContext: false });
21
21
  const { FieldErrorView, FieldErrorCaptureContext, wrapperProps, controlProps, fieldPropsContext, skeletonProps } = useFieldComponent(props, "DatePicker");
22
22
  const rootClassName = clsx(wrapperProps.className, className);
@@ -44,6 +44,7 @@ var DatePicker = flowComponent("DatePicker", (props) => {
44
44
  placement: "bottom end",
45
45
  isDialogContent: true,
46
46
  controller: popoverController,
47
+ onOpenChange,
47
48
  children: /* @__PURE__ */ jsx(Calendar, { className: DatePicker_module_default.calendar })
48
49
  })
49
50
  ] }), /* @__PURE__ */ jsx(FieldErrorView, {})]
@@ -1 +1 @@
1
- {"version":3,"file":"DatePicker.mjs","names":["styles"],"sources":["../../../../../../../src/components/DatePicker/DatePicker.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport clsx from \"clsx\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport * as Aria from \"react-aria-components\";\nimport { DateInput } from \"./components/DateInput\";\nimport { Popover } from \"@/components/Popover/Popover\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { Calendar } from \"@/components/Calendar\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport styles from \"./DatePicker.module.scss\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\n\nexport interface DatePickerProps<T extends Aria.DateValue = Aria.DateValue>\n extends\n PropsWithChildren<Omit<Aria.DatePickerProps<T>, \"children\" | \"ref\">>,\n FlowComponentProps<HTMLSpanElement> {}\n\n/** @flr-generate all */\nexport const DatePicker = flowComponent(\"DatePicker\", (props) => {\n // `null` is what react-aria's date picker state uses for \"no date\"\n const { children, className, onChange, ref, ...rest } =\n useControlledHostValueProps(props, null);\n\n const popoverController = useOverlayController(\"Popover\", {\n reuseControllerFromContext: false,\n });\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n wrapperProps,\n controlProps,\n fieldPropsContext,\n skeletonProps,\n } = useFieldComponent(props, \"DatePicker\");\n\n const rootClassName = clsx(wrapperProps.className, className);\n\n return (\n <Aria.DatePicker\n {...rest}\n {...controlProps}\n {...skeletonProps}\n className={rootClassName}\n onOpenChange={(v) => popoverController.setOpen(v)}\n isOpen={popoverController.isOpen}\n onChange={(value) => {\n if (onChange) {\n onChange(value);\n }\n popoverController.close();\n }}\n >\n <FieldErrorCaptureContext>\n <DateInput isDisabled={props.isDisabled} ref={ref} />\n <PropsContextProvider props={fieldPropsContext}>\n {children}\n </PropsContextProvider>\n <Popover\n placement=\"bottom end\"\n isDialogContent\n controller={popoverController}\n >\n <Calendar className={styles.calendar} />\n </Popover>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </Aria.DatePicker>\n );\n});\n\nexport default DatePicker;\n"],"mappings":";;;;;;;;;;;;;;;;;AAsBA,IAAa,aAAa,cAAc,eAAe,UAAU;CAE/D,MAAM,EAAE,UAAU,WAAW,UAAU,KAAK,GAAG,SAC7C,4BAA4B,OAAO,IAAI;CAEzC,MAAM,oBAAoB,qBAAqB,WAAW,EACxD,4BAA4B,MAC9B,CAAC;CACD,MAAM,EACJ,gBACA,0BACA,cACA,cACA,mBACA,kBACE,kBAAkB,OAAO,YAAY;CAEzC,MAAM,gBAAgB,KAAK,aAAa,WAAW,SAAS;CAE5D,OACE,qBAAC,KAAK,YAAN;EACE,GAAI;EACJ,GAAI;EACJ,GAAI;EACJ,WAAW;EACX,eAAe,MAAM,kBAAkB,QAAQ,CAAC;EAChD,QAAQ,kBAAkB;EAC1B,WAAW,UAAU;GACnB,IAAI,UACF,SAAS,KAAK;GAEhB,kBAAkB,MAAM;EAC1B;EAZF,UAAA,CAcE,qBAAC,0BAAD,EAAA,UAAA;GACE,oBAAC,WAAD;IAAW,YAAY,MAAM;IAAiB;GAAM,CAAA;GACpD,oBAAC,sBAAD;IAAsB,OAAO;IAC1B;GACmB,CAAA;GACtB,oBAAC,SAAD;IACE,WAAU;IACV,iBAAA;IACA,YAAY;IAEZ,UAAA,oBAAC,UAAD,EAAU,WAAWA,0BAAO,SAAW,CAAA;GAChC,CAAA;EACe,EAAA,CAAA,GAC1B,oBAAC,gBAAD,CAAiB,CAAA,CACF;;AAErB,CAAC"}
1
+ {"version":3,"file":"DatePicker.mjs","names":["styles"],"sources":["../../../../../../../src/components/DatePicker/DatePicker.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport clsx from \"clsx\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport * as Aria from \"react-aria-components\";\nimport { DateInput } from \"./components/DateInput\";\nimport { Popover } from \"@/components/Popover/Popover\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { Calendar } from \"@/components/Calendar\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport styles from \"./DatePicker.module.scss\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\n\nexport interface DatePickerProps<T extends Aria.DateValue = Aria.DateValue>\n extends\n PropsWithChildren<Omit<Aria.DatePickerProps<T>, \"children\" | \"ref\">>,\n FlowComponentProps<HTMLSpanElement> {}\n\n/** @flr-generate all */\nexport const DatePicker = flowComponent(\"DatePicker\", (props) => {\n // `null` is what react-aria's date picker state uses for \"no date\"\n const { children, className, onChange, onOpenChange, ref, ...rest } =\n useControlledHostValueProps(props, null);\n\n const popoverController = useOverlayController(\"Popover\", {\n reuseControllerFromContext: false,\n });\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n wrapperProps,\n controlProps,\n fieldPropsContext,\n skeletonProps,\n } = useFieldComponent(props, \"DatePicker\");\n\n const rootClassName = clsx(wrapperProps.className, className);\n\n return (\n <Aria.DatePicker\n {...rest}\n {...controlProps}\n {...skeletonProps}\n className={rootClassName}\n onOpenChange={(v) => popoverController.setOpen(v)}\n isOpen={popoverController.isOpen}\n onChange={(value) => {\n if (onChange) {\n onChange(value);\n }\n popoverController.close();\n }}\n >\n <FieldErrorCaptureContext>\n <DateInput isDisabled={props.isDisabled} ref={ref} />\n <PropsContextProvider props={fieldPropsContext}>\n {children}\n </PropsContextProvider>\n <Popover\n placement=\"bottom end\"\n isDialogContent\n controller={popoverController}\n onOpenChange={onOpenChange}\n >\n <Calendar className={styles.calendar} />\n </Popover>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </Aria.DatePicker>\n );\n});\n\nexport default DatePicker;\n"],"mappings":";;;;;;;;;;;;;;;;;AAsBA,IAAa,aAAa,cAAc,eAAe,UAAU;CAE/D,MAAM,EAAE,UAAU,WAAW,UAAU,cAAc,KAAK,GAAG,SAC3D,4BAA4B,OAAO,IAAI;CAEzC,MAAM,oBAAoB,qBAAqB,WAAW,EACxD,4BAA4B,MAC9B,CAAC;CACD,MAAM,EACJ,gBACA,0BACA,cACA,cACA,mBACA,kBACE,kBAAkB,OAAO,YAAY;CAEzC,MAAM,gBAAgB,KAAK,aAAa,WAAW,SAAS;CAE5D,OACE,qBAAC,KAAK,YAAN;EACE,GAAI;EACJ,GAAI;EACJ,GAAI;EACJ,WAAW;EACX,eAAe,MAAM,kBAAkB,QAAQ,CAAC;EAChD,QAAQ,kBAAkB;EAC1B,WAAW,UAAU;GACnB,IAAI,UACF,SAAS,KAAK;GAEhB,kBAAkB,MAAM;EAC1B;EAZF,UAAA,CAcE,qBAAC,0BAAD,EAAA,UAAA;GACE,oBAAC,WAAD;IAAW,YAAY,MAAM;IAAiB;GAAM,CAAA;GACpD,oBAAC,sBAAD;IAAsB,OAAO;IAC1B;GACmB,CAAA;GACtB,oBAAC,SAAD;IACE,WAAU;IACV,iBAAA;IACA,YAAY;IACE;IAEd,UAAA,oBAAC,UAAD,EAAU,WAAWA,0BAAO,SAAW,CAAA;GAChC,CAAA;EACe,EAAA,CAAA,GAC1B,oBAAC,gBAAD,CAAiB,CAAA,CACF;;AAErB,CAAC"}
@@ -15,7 +15,7 @@ import * as Aria from "react-aria-components";
15
15
  //#region src/components/DateRangePicker/DateRangePicker.tsx
16
16
  /** @flr-generate all */
17
17
  var DateRangePicker = flowComponent("DateRangePicker", (props) => {
18
- const { children, className, onChange, ref, withDatePickerPresets = false, ...rest } = useControlledHostValueProps(props, null);
18
+ const { children, className, onChange, onOpenChange, ref, withDatePickerPresets = false, ...rest } = useControlledHostValueProps(props, null);
19
19
  const popoverController = useOverlayController("Popover", { reuseControllerFromContext: false });
20
20
  const { FieldErrorView, FieldErrorCaptureContext, wrapperProps, controlProps, fieldPropsContext, skeletonProps } = useFieldComponent(props, "DateRangePicker");
21
21
  const rootClassName = clsx(wrapperProps.className, className);
@@ -44,6 +44,7 @@ var DateRangePicker = flowComponent("DateRangePicker", (props) => {
44
44
  placement: "bottom end",
45
45
  isDialogContent: true,
46
46
  controller: popoverController,
47
+ onOpenChange,
47
48
  children: /* @__PURE__ */ jsx(RangeCalendar, {
48
49
  withDatePickerPresets,
49
50
  className: DateRangePicker_module_default.calendar
@@ -1 +1 @@
1
- {"version":3,"file":"DateRangePicker.mjs","names":["styles"],"sources":["../../../../../../../src/components/DateRangePicker/DateRangePicker.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport clsx from \"clsx\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport * as Aria from \"react-aria-components\";\nimport { Popover } from \"@/components/Popover\";\nimport { type DateRangePresets, RangeCalendar } from \"@/components/Calendar\";\nimport { DateRangeInput } from \"./components/DateRangeInput\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\nimport type { RangeValue } from \"react-aria\";\nimport type { DateValue } from \"@internationalized/date\";\nimport styles from \"./DateRangePicker.module.scss\";\n\nexport interface DateRangePickerProps<T extends Aria.DateValue = Aria.DateValue>\n extends\n PropsWithChildren<Omit<Aria.DateRangePickerProps<T>, \"children\" | \"ref\">>,\n FlowComponentProps<HTMLSpanElement> {\n /**\n * Whether the calendar offers presets to pick a range with one click. Pass an\n * array to replace the built-in presets with your own.\n *\n * @default false\n */\n withDatePickerPresets?: boolean | DateRangePresets;\n}\n\n/** @flr-generate all */\nexport const DateRangePicker = flowComponent(\"DateRangePicker\", (props) => {\n // `null` is what react-aria's date range picker state uses for \"no range\"\n const {\n children,\n className,\n onChange,\n ref,\n withDatePickerPresets = false,\n ...rest\n } = useControlledHostValueProps(props, null);\n\n const popoverController = useOverlayController(\"Popover\", {\n reuseControllerFromContext: false,\n });\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n wrapperProps,\n controlProps,\n fieldPropsContext,\n skeletonProps,\n } = useFieldComponent(props, \"DateRangePicker\");\n\n const rootClassName = clsx(wrapperProps.className, className);\n\n const onDatePickerChange = (value: RangeValue<DateValue> | null) => {\n if (onChange) {\n onChange(value);\n }\n popoverController.close();\n };\n\n return (\n <Aria.DateRangePicker\n {...rest}\n {...skeletonProps}\n aria-describedby={controlProps[\"aria-describedby\"]}\n className={rootClassName}\n onOpenChange={(v) => popoverController.setOpen(v)}\n isOpen={popoverController.isOpen}\n onChange={onDatePickerChange}\n >\n <FieldErrorCaptureContext>\n <DateRangeInput isDisabled={props.isDisabled} ref={ref} />\n <PropsContextProvider props={fieldPropsContext}>\n {children}\n </PropsContextProvider>\n <Popover\n placement=\"bottom end\"\n isDialogContent\n controller={popoverController}\n >\n <RangeCalendar\n withDatePickerPresets={withDatePickerPresets}\n className={styles.calendar}\n />\n </Popover>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </Aria.DateRangePicker>\n );\n});\n\nexport default DateRangePicker;\n"],"mappings":";;;;;;;;;;;;;;;;AAgCA,IAAa,kBAAkB,cAAc,oBAAoB,UAAU;CAEzE,MAAM,EACJ,UACA,WACA,UACA,KACA,wBAAwB,OACxB,GAAG,SACD,4BAA4B,OAAO,IAAI;CAE3C,MAAM,oBAAoB,qBAAqB,WAAW,EACxD,4BAA4B,MAC9B,CAAC;CACD,MAAM,EACJ,gBACA,0BACA,cACA,cACA,mBACA,kBACE,kBAAkB,OAAO,iBAAiB;CAE9C,MAAM,gBAAgB,KAAK,aAAa,WAAW,SAAS;CAE5D,MAAM,sBAAsB,UAAwC;EAClE,IAAI,UACF,SAAS,KAAK;EAEhB,kBAAkB,MAAM;CAC1B;CAEA,OACE,qBAAC,KAAK,iBAAN;EACE,GAAI;EACJ,GAAI;EACJ,oBAAkB,aAAa;EAC/B,WAAW;EACX,eAAe,MAAM,kBAAkB,QAAQ,CAAC;EAChD,QAAQ,kBAAkB;EAC1B,UAAU;EAPZ,UAAA,CASE,qBAAC,0BAAD,EAAA,UAAA;GACE,oBAAC,gBAAD;IAAgB,YAAY,MAAM;IAAiB;GAAM,CAAA;GACzD,oBAAC,sBAAD;IAAsB,OAAO;IAC1B;GACmB,CAAA;GACtB,oBAAC,SAAD;IACE,WAAU;IACV,iBAAA;IACA,YAAY;IAEZ,UAAA,oBAAC,eAAD;KACyB;KACvB,WAAWA,+BAAO;IACnB,CAAA;GACM,CAAA;EACe,EAAA,CAAA,GAC1B,oBAAC,gBAAD,CAAiB,CAAA,CACG;;AAE1B,CAAC"}
1
+ {"version":3,"file":"DateRangePicker.mjs","names":["styles"],"sources":["../../../../../../../src/components/DateRangePicker/DateRangePicker.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport clsx from \"clsx\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport * as Aria from \"react-aria-components\";\nimport { Popover } from \"@/components/Popover\";\nimport { type DateRangePresets, RangeCalendar } from \"@/components/Calendar\";\nimport { DateRangeInput } from \"./components/DateRangeInput\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\nimport type { RangeValue } from \"react-aria\";\nimport type { DateValue } from \"@internationalized/date\";\nimport styles from \"./DateRangePicker.module.scss\";\n\nexport interface DateRangePickerProps<T extends Aria.DateValue = Aria.DateValue>\n extends\n PropsWithChildren<Omit<Aria.DateRangePickerProps<T>, \"children\" | \"ref\">>,\n FlowComponentProps<HTMLSpanElement> {\n /**\n * Whether the calendar offers presets to pick a range with one click. Pass an\n * array to replace the built-in presets with your own.\n *\n * @default false\n */\n withDatePickerPresets?: boolean | DateRangePresets;\n}\n\n/** @flr-generate all */\nexport const DateRangePicker = flowComponent(\"DateRangePicker\", (props) => {\n // `null` is what react-aria's date range picker state uses for \"no range\"\n const {\n children,\n className,\n onChange,\n onOpenChange,\n ref,\n withDatePickerPresets = false,\n ...rest\n } = useControlledHostValueProps(props, null);\n\n const popoverController = useOverlayController(\"Popover\", {\n reuseControllerFromContext: false,\n });\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n wrapperProps,\n controlProps,\n fieldPropsContext,\n skeletonProps,\n } = useFieldComponent(props, \"DateRangePicker\");\n\n const rootClassName = clsx(wrapperProps.className, className);\n\n const onDatePickerChange = (value: RangeValue<DateValue> | null) => {\n if (onChange) {\n onChange(value);\n }\n popoverController.close();\n };\n\n return (\n <Aria.DateRangePicker\n {...rest}\n {...skeletonProps}\n aria-describedby={controlProps[\"aria-describedby\"]}\n className={rootClassName}\n onOpenChange={(v) => popoverController.setOpen(v)}\n isOpen={popoverController.isOpen}\n onChange={onDatePickerChange}\n >\n <FieldErrorCaptureContext>\n <DateRangeInput isDisabled={props.isDisabled} ref={ref} />\n <PropsContextProvider props={fieldPropsContext}>\n {children}\n </PropsContextProvider>\n <Popover\n placement=\"bottom end\"\n isDialogContent\n controller={popoverController}\n onOpenChange={onOpenChange}\n >\n <RangeCalendar\n withDatePickerPresets={withDatePickerPresets}\n className={styles.calendar}\n />\n </Popover>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </Aria.DateRangePicker>\n );\n});\n\nexport default DateRangePicker;\n"],"mappings":";;;;;;;;;;;;;;;;AAgCA,IAAa,kBAAkB,cAAc,oBAAoB,UAAU;CAEzE,MAAM,EACJ,UACA,WACA,UACA,cACA,KACA,wBAAwB,OACxB,GAAG,SACD,4BAA4B,OAAO,IAAI;CAE3C,MAAM,oBAAoB,qBAAqB,WAAW,EACxD,4BAA4B,MAC9B,CAAC;CACD,MAAM,EACJ,gBACA,0BACA,cACA,cACA,mBACA,kBACE,kBAAkB,OAAO,iBAAiB;CAE9C,MAAM,gBAAgB,KAAK,aAAa,WAAW,SAAS;CAE5D,MAAM,sBAAsB,UAAwC;EAClE,IAAI,UACF,SAAS,KAAK;EAEhB,kBAAkB,MAAM;CAC1B;CAEA,OACE,qBAAC,KAAK,iBAAN;EACE,GAAI;EACJ,GAAI;EACJ,oBAAkB,aAAa;EAC/B,WAAW;EACX,eAAe,MAAM,kBAAkB,QAAQ,CAAC;EAChD,QAAQ,kBAAkB;EAC1B,UAAU;EAPZ,UAAA,CASE,qBAAC,0BAAD,EAAA,UAAA;GACE,oBAAC,gBAAD;IAAgB,YAAY,MAAM;IAAiB;GAAM,CAAA;GACzD,oBAAC,sBAAD;IAAsB,OAAO;IAC1B;GACmB,CAAA;GACtB,oBAAC,SAAD;IACE,WAAU;IACV,iBAAA;IACA,YAAY;IACE;IAEd,UAAA,oBAAC,eAAD;KACyB;KACvB,WAAWA,+BAAO;IACnB,CAAA;GACM,CAAA;EACe,EAAA,CAAA,GAC1B,oBAAC,gBAAD,CAAiB,CAAA,CACG;;AAE1B,CAAC"}
@@ -2,6 +2,7 @@
2
2
  /* */
3
3
  import { PropsContextProvider } from "../../lib/propsContext/components/PropsContextProvider.mjs";
4
4
  import { flowComponent } from "../../lib/componentFactory/flowComponent.mjs";
5
+ import { useRegisterSectionHeading } from "../Section/context.mjs";
5
6
  import { useSkeletonMode } from "../SkeletonMode/skeletonModeContext.mjs";
6
7
  import { UiComponentTunnelExit } from "../UiComponentTunnel/UiComponentTunnelExit.mjs";
7
8
  import { styleClassname } from "../../lib/scss/selectors.mjs";
@@ -25,6 +26,7 @@ var sizeByLevel = {
25
26
  /** @flr-generate all */
26
27
  var Heading = flowComponent("Heading", (props) => {
27
28
  const { children, className, level = 2, color = "default", wrap, size, ref, elementType, ...rest } = props;
29
+ useRegisterSectionHeading(rest.id);
28
30
  const isSkeleton = useSkeletonMode();
29
31
  const rootClassName = clsx(Heading_module_default.heading, size && Heading_module_default[`size-${size}`], color !== "default" && Heading_module_default[color], wrap && Heading_module_default[`wrap-${wrap}`], styleClassname(Heading_module_default, `h${level}`), className);
30
32
  const Element = elementType ?? Aria.Heading;
@@ -1 +1 @@
1
- {"version":3,"file":"Heading.mjs","names":["styles"],"sources":["../../../../../../../src/components/Heading/Heading.tsx"],"sourcesContent":["import type { AlphaColor, PropsWithElementType } from \"@/lib/types/props\";\nimport styles from \"./Heading.module.scss\";\nimport { styleClassname } from \"@/lib/scss/selectors\";\nimport clsx from \"clsx\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport * as Aria from \"react-aria-components\";\nimport { Children } from \"react\";\nimport { SkeletonTextContent } from \"@/components/SkeletonMode/components/SkeletonTextContent\";\nimport { useSkeletonMode } from \"@/components/SkeletonMode/skeletonModeContext\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport interface HeadingProps\n extends\n Aria.HeadingProps,\n FlowComponentProps,\n PropsWithElementType<\"span\" | \"p\"> {\n /** The font size of the heading. */\n size?: \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\" | \"xxl\";\n /** The color of the heading. @default \"default\" */\n color?: \"default\" | \"danger\" | \"unavailable\" | AlphaColor;\n /** The text-wrap property of the text. @default undefined */\n wrap?: \"wrap\" | \"balance\";\n}\n\n/**\n * The font size each heading level renders at — the TypeScript half of the\n * level-based `--font-size` rules in Heading.module.scss. Levels 4 to 6 fall\n * through to the `xs` default.\n */\nconst sizeByLevel: Record<number, NonNullable<HeadingProps[\"size\"]>> = {\n 1: \"xl\",\n 2: \"m\",\n 3: \"s\",\n};\n\n/** @flr-generate all */\nexport const Heading = flowComponent(\"Heading\", (props) => {\n const {\n children,\n className,\n level = 2,\n color = \"default\",\n wrap,\n size,\n ref,\n elementType,\n ...rest\n } = props;\n\n const isSkeleton = useSkeletonMode();\n\n const rootClassName = clsx(\n styles.heading,\n size && styles[`size-${size}`],\n color !== \"default\" && styles[color],\n wrap && styles[`wrap-${wrap}`],\n // The level class carries the font size. Emitted for every heading — not\n // just the `elementType` ones — so the stylesheet can select on the class\n // instead of the h1–h6 element react-aria renders without one.\n styleClassname(styles, `h${level}`),\n className,\n );\n\n const Element = elementType ?? Aria.Heading;\n\n const effectiveSize = size ?? sizeByLevel[level] ?? \"xs\";\n const buttonSize =\n effectiveSize === \"xl\" || effectiveSize === \"xxl\" ? \"m\" : \"s\";\n\n const propsContext: PropsContext = {\n Icon: {\n \"aria-hidden\": true,\n className: styles.icon,\n },\n AlertBadge: {\n tunnel: {\n id: \"headingContent\",\n component: \"Heading\",\n },\n },\n Badge: {\n tunnel: {\n id: \"headingContent\",\n component: \"Heading\",\n },\n },\n Button: {\n tunnel: {\n id: \"headingContent\",\n component: \"Heading\",\n },\n size: buttonSize,\n },\n CopyButton: {\n tunnel: {\n id: \"headingContent\",\n component: \"Heading\",\n },\n size: buttonSize,\n },\n ContextualHelpTrigger: {\n tunnel: {\n id: \"headingContent\",\n component: \"Heading\",\n },\n Button: {\n tunnel: null,\n },\n },\n AlertText: {\n Icon: {\n className: styles.icon,\n },\n },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n <Element\n className={rootClassName}\n {...rest}\n ref={ref}\n level={level}\n inert={isSkeleton || undefined}\n >\n <span className={styles.headingText}>\n <SkeletonTextContent defaultWidth=\"12em\">\n {children}\n </SkeletonTextContent>\n <UiComponentTunnelExit id=\"headingContent\" component=\"Heading\">\n {(items) =>\n Children.count(items) > 0 && (\n <span className={styles.headingTextSpacer} />\n )\n }\n </UiComponentTunnelExit>\n </span>\n <span className={styles.headingContent}>\n <UiComponentTunnelExit id=\"headingContent\" component=\"Heading\">\n {(items) =>\n Children.map(items, (item) => (\n <span className={styles.headingContentItem}>{item}</span>\n ))\n }\n </UiComponentTunnelExit>\n </span>\n </Element>\n </PropsContextProvider>\n );\n});\n\nexport default Heading;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAgCA,IAAM,cAAiE;CACrE,GAAG;CACH,GAAG;CACH,GAAG;AACL;;AAGA,IAAa,UAAU,cAAc,YAAY,UAAU;CACzD,MAAM,EACJ,UACA,WACA,QAAQ,GACR,QAAQ,WACR,MACA,MACA,KACA,aACA,GAAG,SACD;CAEJ,MAAM,aAAa,gBAAgB;CAEnC,MAAM,gBAAgB,KACpBA,uBAAO,SACP,QAAQA,uBAAO,QAAQ,SACvB,UAAU,aAAaA,uBAAO,QAC9B,QAAQA,uBAAO,QAAQ,SAIvB,eAAeA,wBAAQ,IAAI,OAAO,GAClC,SACF;CAEA,MAAM,UAAU,eAAe,KAAK;CAEpC,MAAM,gBAAgB,QAAQ,YAAY,UAAU;CACpD,MAAM,aACJ,kBAAkB,QAAQ,kBAAkB,QAAQ,MAAM;CAE5D,MAAM,eAA6B;EACjC,MAAM;GACJ,eAAe;GACf,WAAWA,uBAAO;EACpB;EACA,YAAY,EACV,QAAQ;GACN,IAAI;GACJ,WAAW;EACb,EACF;EACA,OAAO,EACL,QAAQ;GACN,IAAI;GACJ,WAAW;EACb,EACF;EACA,QAAQ;GACN,QAAQ;IACN,IAAI;IACJ,WAAW;GACb;GACA,MAAM;EACR;EACA,YAAY;GACV,QAAQ;IACN,IAAI;IACJ,WAAW;GACb;GACA,MAAM;EACR;EACA,uBAAuB;GACrB,QAAQ;IACN,IAAI;IACJ,WAAW;GACb;GACA,QAAQ,EACN,QAAQ,KACV;EACF;EACA,WAAW,EACT,MAAM,EACJ,WAAWA,uBAAO,KACpB,EACF;CACF;CAEA,OACE,oBAAC,sBAAD;EAAsB,OAAO;EAC3B,UAAA,qBAAC,SAAD;GACE,WAAW;GACX,GAAI;GACC;GACE;GACP,OAAO,cAAc,KAAA;GALvB,UAAA,CAOE,qBAAC,QAAD;IAAM,WAAWA,uBAAO;IAAxB,UAAA,CACE,oBAAC,qBAAD;KAAqB,cAAa;KAC/B;IACkB,CAAA,GACrB,oBAAC,uBAAD;KAAuB,IAAG;KAAiB,WAAU;KACjD,WAAA,UACA,SAAS,MAAM,KAAK,IAAI,KACtB,oBAAC,QAAD,EAAM,WAAWA,uBAAO,kBAAoB,CAAA;IAG3B,CAAA,CACnB;GACN,CAAA,GAAA,oBAAC,QAAD;IAAM,WAAWA,uBAAO;IACtB,UAAA,oBAAC,uBAAD;KAAuB,IAAG;KAAiB,WAAU;KACjD,WAAA,UACA,SAAS,IAAI,QAAQ,SACnB,oBAAC,QAAD;MAAM,WAAWA,uBAAO;MAAqB,UAAA;KAAW,CAAA,CACzD;IAEkB,CAAA;GACnB,CAAA,CACC;;CACW,CAAA;AAE1B,CAAC"}
1
+ {"version":3,"file":"Heading.mjs","names":["styles"],"sources":["../../../../../../../src/components/Heading/Heading.tsx"],"sourcesContent":["import type { AlphaColor, PropsWithElementType } from \"@/lib/types/props\";\nimport styles from \"./Heading.module.scss\";\nimport { styleClassname } from \"@/lib/scss/selectors\";\nimport clsx from \"clsx\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport * as Aria from \"react-aria-components\";\nimport { Children } from \"react\";\nimport { SkeletonTextContent } from \"@/components/SkeletonMode/components/SkeletonTextContent\";\nimport { useSkeletonMode } from \"@/components/SkeletonMode/skeletonModeContext\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\nimport { useRegisterSectionHeading } from \"@/components/Section/context\";\n\nexport interface HeadingProps\n extends\n Aria.HeadingProps,\n FlowComponentProps,\n PropsWithElementType<\"span\" | \"p\"> {\n /** The font size of the heading. */\n size?: \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\" | \"xxl\";\n /** The color of the heading. @default \"default\" */\n color?: \"default\" | \"danger\" | \"unavailable\" | AlphaColor;\n /** The text-wrap property of the text. @default undefined */\n wrap?: \"wrap\" | \"balance\";\n}\n\n/**\n * The font size each heading level renders at — the TypeScript half of the\n * level-based `--font-size` rules in Heading.module.scss. Levels 4 to 6 fall\n * through to the `xs` default.\n */\nconst sizeByLevel: Record<number, NonNullable<HeadingProps[\"size\"]>> = {\n 1: \"xl\",\n 2: \"m\",\n 3: \"s\",\n};\n\n/** @flr-generate all */\nexport const Heading = flowComponent(\"Heading\", (props) => {\n const {\n children,\n className,\n level = 2,\n color = \"default\",\n wrap,\n size,\n ref,\n elementType,\n ...rest\n } = props;\n\n useRegisterSectionHeading(rest.id);\n\n const isSkeleton = useSkeletonMode();\n\n const rootClassName = clsx(\n styles.heading,\n size && styles[`size-${size}`],\n color !== \"default\" && styles[color],\n wrap && styles[`wrap-${wrap}`],\n // The level class carries the font size. Emitted for every heading — not\n // just the `elementType` ones — so the stylesheet can select on the class\n // instead of the h1–h6 element react-aria renders without one.\n styleClassname(styles, `h${level}`),\n className,\n );\n\n const Element = elementType ?? Aria.Heading;\n\n const effectiveSize = size ?? sizeByLevel[level] ?? \"xs\";\n const buttonSize =\n effectiveSize === \"xl\" || effectiveSize === \"xxl\" ? \"m\" : \"s\";\n\n const propsContext: PropsContext = {\n Icon: {\n \"aria-hidden\": true,\n className: styles.icon,\n },\n AlertBadge: {\n tunnel: {\n id: \"headingContent\",\n component: \"Heading\",\n },\n },\n Badge: {\n tunnel: {\n id: \"headingContent\",\n component: \"Heading\",\n },\n },\n Button: {\n tunnel: {\n id: \"headingContent\",\n component: \"Heading\",\n },\n size: buttonSize,\n },\n CopyButton: {\n tunnel: {\n id: \"headingContent\",\n component: \"Heading\",\n },\n size: buttonSize,\n },\n ContextualHelpTrigger: {\n tunnel: {\n id: \"headingContent\",\n component: \"Heading\",\n },\n Button: {\n tunnel: null,\n },\n },\n AlertText: {\n Icon: {\n className: styles.icon,\n },\n },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n <Element\n className={rootClassName}\n {...rest}\n ref={ref}\n level={level}\n inert={isSkeleton || undefined}\n >\n <span className={styles.headingText}>\n <SkeletonTextContent defaultWidth=\"12em\">\n {children}\n </SkeletonTextContent>\n <UiComponentTunnelExit id=\"headingContent\" component=\"Heading\">\n {(items) =>\n Children.count(items) > 0 && (\n <span className={styles.headingTextSpacer} />\n )\n }\n </UiComponentTunnelExit>\n </span>\n <span className={styles.headingContent}>\n <UiComponentTunnelExit id=\"headingContent\" component=\"Heading\">\n {(items) =>\n Children.map(items, (item) => (\n <span className={styles.headingContentItem}>{item}</span>\n ))\n }\n </UiComponentTunnelExit>\n </span>\n </Element>\n </PropsContextProvider>\n );\n});\n\nexport default Heading;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAiCA,IAAM,cAAiE;CACrE,GAAG;CACH,GAAG;CACH,GAAG;AACL;;AAGA,IAAa,UAAU,cAAc,YAAY,UAAU;CACzD,MAAM,EACJ,UACA,WACA,QAAQ,GACR,QAAQ,WACR,MACA,MACA,KACA,aACA,GAAG,SACD;CAEJ,0BAA0B,KAAK,EAAE;CAEjC,MAAM,aAAa,gBAAgB;CAEnC,MAAM,gBAAgB,KACpBA,uBAAO,SACP,QAAQA,uBAAO,QAAQ,SACvB,UAAU,aAAaA,uBAAO,QAC9B,QAAQA,uBAAO,QAAQ,SAIvB,eAAeA,wBAAQ,IAAI,OAAO,GAClC,SACF;CAEA,MAAM,UAAU,eAAe,KAAK;CAEpC,MAAM,gBAAgB,QAAQ,YAAY,UAAU;CACpD,MAAM,aACJ,kBAAkB,QAAQ,kBAAkB,QAAQ,MAAM;CAE5D,MAAM,eAA6B;EACjC,MAAM;GACJ,eAAe;GACf,WAAWA,uBAAO;EACpB;EACA,YAAY,EACV,QAAQ;GACN,IAAI;GACJ,WAAW;EACb,EACF;EACA,OAAO,EACL,QAAQ;GACN,IAAI;GACJ,WAAW;EACb,EACF;EACA,QAAQ;GACN,QAAQ;IACN,IAAI;IACJ,WAAW;GACb;GACA,MAAM;EACR;EACA,YAAY;GACV,QAAQ;IACN,IAAI;IACJ,WAAW;GACb;GACA,MAAM;EACR;EACA,uBAAuB;GACrB,QAAQ;IACN,IAAI;IACJ,WAAW;GACb;GACA,QAAQ,EACN,QAAQ,KACV;EACF;EACA,WAAW,EACT,MAAM,EACJ,WAAWA,uBAAO,KACpB,EACF;CACF;CAEA,OACE,oBAAC,sBAAD;EAAsB,OAAO;EAC3B,UAAA,qBAAC,SAAD;GACE,WAAW;GACX,GAAI;GACC;GACE;GACP,OAAO,cAAc,KAAA;GALvB,UAAA,CAOE,qBAAC,QAAD;IAAM,WAAWA,uBAAO;IAAxB,UAAA,CACE,oBAAC,qBAAD;KAAqB,cAAa;KAC/B;IACkB,CAAA,GACrB,oBAAC,uBAAD;KAAuB,IAAG;KAAiB,WAAU;KACjD,WAAA,UACA,SAAS,MAAM,KAAK,IAAI,KACtB,oBAAC,QAAD,EAAM,WAAWA,uBAAO,kBAAoB,CAAA;IAG3B,CAAA,CACnB;GACN,CAAA,GAAA,oBAAC,QAAD;IAAM,WAAWA,uBAAO;IACtB,UAAA,oBAAC,uBAAD;KAAuB,IAAG;KAAiB,WAAU;KACjD,WAAA,UACA,SAAS,IAAI,QAAQ,SACnB,oBAAC,QAAD;MAAM,WAAWA,uBAAO;MAAqB,UAAA;KAAW,CAAA,CACzD;IAEkB,CAAA;GACnB,CAAA,CACC;;CACW,CAAA;AAE1B,CAAC"}
@@ -2,6 +2,7 @@
2
2
  /* */
3
3
  import { PropsContextProvider } from "../../lib/propsContext/components/PropsContextProvider.mjs";
4
4
  import { flowComponent } from "../../lib/componentFactory/flowComponent.mjs";
5
+ import { SectionHeadingReset } from "../Section/context.mjs";
5
6
  import { isAlphaColor } from "../../lib/types/props.mjs";
6
7
  import IllustratedMessage_module_default from "./IllustratedMessage.module.mjs";
7
8
  import clsx from "clsx";
@@ -35,10 +36,10 @@ var IllustratedMessage = flowComponent("IllustratedMessage", (props) => {
35
36
  return /* @__PURE__ */ jsx("div", {
36
37
  ...rest,
37
38
  className: rootClassName,
38
- children: /* @__PURE__ */ jsx(PropsContextProvider, {
39
+ children: /* @__PURE__ */ jsx(SectionHeadingReset, { children: /* @__PURE__ */ jsx(PropsContextProvider, {
39
40
  props: propsContext,
40
41
  children
41
- })
42
+ }) })
42
43
  });
43
44
  });
44
45
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"IllustratedMessage.mjs","names":["styles"],"sources":["../../../../../../../src/components/IllustratedMessage/IllustratedMessage.tsx"],"sourcesContent":["import type { ComponentProps, PropsWithChildren } from \"react\";\nimport styles from \"./IllustratedMessage.module.scss\";\nimport clsx from \"clsx\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { type AlphaColor, isAlphaColor } from \"@/lib/types/props\";\n\nexport interface IllustratedMessageProps\n extends PropsWithChildren<ComponentProps<\"div\">>, FlowComponentProps {\n /** The color of the illustrated message. @default \"default\" */\n color?: \"default\" | \"danger\" | \"unavailable\" | AlphaColor;\n}\n\n/** @flr-generate all */\nexport const IllustratedMessage = flowComponent(\n \"IllustratedMessage\",\n (props) => {\n const { className, children, color = \"default\", ...rest } = props;\n\n const rootClassName = clsx(\n styles.illustratedMessage,\n color !== \"default\" && styles[color],\n className,\n );\n\n const alphaColor = isAlphaColor(color) ? color : undefined;\n\n const propsContext: PropsContext = {\n Icon: {\n className: styles.icon,\n size: \"l\",\n },\n Heading: {\n className: styles.heading,\n color,\n },\n Text: {\n className: styles.text,\n color: alphaColor,\n },\n Button: {\n color: alphaColor,\n },\n ActionGroup: {\n preserveOrder: true,\n className: styles.actionGroup,\n },\n ProgressBar: { className: styles.progressBar },\n };\n\n return (\n <div {...rest} className={rootClassName}>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </div>\n );\n },\n);\n\nexport default IllustratedMessage;\n"],"mappings":";;;;;;;;;;AAkBA,IAAa,qBAAqB,cAChC,uBACC,UAAU;CACT,MAAM,EAAE,WAAW,UAAU,QAAQ,WAAW,GAAG,SAAS;CAE5D,MAAM,gBAAgB,KACpBA,kCAAO,oBACP,UAAU,aAAaA,kCAAO,QAC9B,SACF;CAEA,MAAM,aAAa,aAAa,KAAK,IAAI,QAAQ,KAAA;CAEjD,MAAM,eAA6B;EACjC,MAAM;GACJ,WAAWA,kCAAO;GAClB,MAAM;EACR;EACA,SAAS;GACP,WAAWA,kCAAO;GAClB;EACF;EACA,MAAM;GACJ,WAAWA,kCAAO;GAClB,OAAO;EACT;EACA,QAAQ,EACN,OAAO,WACT;EACA,aAAa;GACX,eAAe;GACf,WAAWA,kCAAO;EACpB;EACA,aAAa,EAAE,WAAWA,kCAAO,YAAY;CAC/C;CAEA,OACE,oBAAC,OAAD;EAAK,GAAI;EAAM,WAAW;EACxB,UAAA,oBAAC,sBAAD;GAAsB,OAAO;GAC1B;EACmB,CAAA;CACnB,CAAA;AAET,CACF"}
1
+ {"version":3,"file":"IllustratedMessage.mjs","names":["styles"],"sources":["../../../../../../../src/components/IllustratedMessage/IllustratedMessage.tsx"],"sourcesContent":["import type { ComponentProps, PropsWithChildren } from \"react\";\nimport styles from \"./IllustratedMessage.module.scss\";\nimport clsx from \"clsx\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { type AlphaColor, isAlphaColor } from \"@/lib/types/props\";\nimport { SectionHeadingReset } from \"@/components/Section/context\";\n\nexport interface IllustratedMessageProps\n extends PropsWithChildren<ComponentProps<\"div\">>, FlowComponentProps {\n /** The color of the illustrated message. @default \"default\" */\n color?: \"default\" | \"danger\" | \"unavailable\" | AlphaColor;\n}\n\n/** @flr-generate all */\nexport const IllustratedMessage = flowComponent(\n \"IllustratedMessage\",\n (props) => {\n const { className, children, color = \"default\", ...rest } = props;\n\n const rootClassName = clsx(\n styles.illustratedMessage,\n color !== \"default\" && styles[color],\n className,\n );\n\n const alphaColor = isAlphaColor(color) ? color : undefined;\n\n const propsContext: PropsContext = {\n Icon: {\n className: styles.icon,\n size: \"l\",\n },\n Heading: {\n className: styles.heading,\n color,\n },\n Text: {\n className: styles.text,\n color: alphaColor,\n },\n Button: {\n color: alphaColor,\n },\n ActionGroup: {\n preserveOrder: true,\n className: styles.actionGroup,\n },\n ProgressBar: { className: styles.progressBar },\n };\n\n return (\n <div {...rest} className={rootClassName}>\n <SectionHeadingReset>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </SectionHeadingReset>\n </div>\n );\n },\n);\n\nexport default IllustratedMessage;\n"],"mappings":";;;;;;;;;;;AAmBA,IAAa,qBAAqB,cAChC,uBACC,UAAU;CACT,MAAM,EAAE,WAAW,UAAU,QAAQ,WAAW,GAAG,SAAS;CAE5D,MAAM,gBAAgB,KACpBA,kCAAO,oBACP,UAAU,aAAaA,kCAAO,QAC9B,SACF;CAEA,MAAM,aAAa,aAAa,KAAK,IAAI,QAAQ,KAAA;CAEjD,MAAM,eAA6B;EACjC,MAAM;GACJ,WAAWA,kCAAO;GAClB,MAAM;EACR;EACA,SAAS;GACP,WAAWA,kCAAO;GAClB;EACF;EACA,MAAM;GACJ,WAAWA,kCAAO;GAClB,OAAO;EACT;EACA,QAAQ,EACN,OAAO,WACT;EACA,aAAa;GACX,eAAe;GACf,WAAWA,kCAAO;EACpB;EACA,aAAa,EAAE,WAAWA,kCAAO,YAAY;CAC/C;CAEA,OACE,oBAAC,OAAD;EAAK,GAAI;EAAM,WAAW;EACxB,UAAA,oBAAC,qBAAD,EAAA,UACE,oBAAC,sBAAD;GAAsB,OAAO;GAC1B;EACmB,CAAA,EACH,CAAA;CAClB,CAAA;AAET,CACF"}
@@ -39,10 +39,6 @@ var Label = flowComponent("Label", (props) => {
39
39
  Button: {
40
40
  tunnel: rightTunnel,
41
41
  size: "s"
42
- },
43
- Action: {
44
- tunnel: rightTunnel,
45
- Button: { tunnel: null }
46
42
  }
47
43
  };
48
44
  return /* @__PURE__ */ jsx(PropsContextProvider, {
@@ -1 +1 @@
1
- {"version":3,"file":"Label.mjs","names":["locales","styles"],"sources":["../../../../../../../src/components/Label/Label.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport React from \"react\";\nimport styles from \"./Label.module.scss\";\nimport * as Aria from \"react-aria-components\";\nimport clsx from \"clsx\";\nimport {\n overlayTriggersTunneledTo,\n type PropsContext,\n PropsContextProvider,\n} from \"@/lib/propsContext\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport locales from \"./locales/*.locale.json\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\nimport { SkeletonTextContent } from \"@/components/SkeletonMode/components/SkeletonTextContent\";\nimport { useSkeletonMode } from \"@/components/SkeletonMode/skeletonModeContext\";\n\nexport interface LabelProps\n extends\n PropsWithChildren<Omit<Aria.LabelProps, \"children\">>,\n FlowComponentProps<HTMLLabelElement> {\n /** Whether the label should show an \"optional\" indicator. */\n optional?: boolean;\n /** Whether the label should be displayed as disabled. */\n isDisabled?: boolean;\n /** @internal */\n unstyled?: boolean;\n}\n\n/** @flr-generate all */\nexport const Label = flowComponent(\"Label\", (props) => {\n const {\n children,\n className,\n optional,\n isDisabled,\n ref,\n unstyled = false,\n ...rest\n } = props;\n\n const [labelProps, labelRef] = Aria.useContextProps(\n rest,\n ref,\n Aria.LabelContext,\n );\n const { id, ...rootProps } = labelProps;\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"Label\");\n const isSkeleton = useSkeletonMode();\n\n const rootClassName = unstyled\n ? className\n : clsx(styles.label, isDisabled && styles.disabled, className);\n\n const optionalMarker = (\n <span className={styles.optional}>\n {stringFormatter.format(\"optional\")}\n </span>\n );\n\n const rightTunnel = {\n id: \"right\",\n component: \"Label\",\n } as const;\n\n const propsContext: PropsContext = {\n ...overlayTriggersTunneledTo(rightTunnel),\n // The contextual help sits next to the label text, not with the actions.\n ContextualHelpTrigger: {\n tunnel: {\n id: \"contextualHelp\",\n component: \"Label\",\n },\n },\n Button: {\n tunnel: rightTunnel,\n size: \"s\",\n },\n Action: {\n tunnel: rightTunnel,\n Button: {\n tunnel: null,\n },\n },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n {/* The context is already merged into `labelProps` above. */}\n <Aria.LabelContext.Provider value={null}>\n <Aria.Label\n {...rootProps}\n className={rootClassName}\n ref={labelRef}\n inert={isSkeleton || undefined}\n >\n {/*\n * Fields point `aria-labelledby` at the label's id, and the name\n * computation takes every descendant's name, buttons included. The\n * id sits on this span so the tunnelled buttons stay out of it.\n */}\n <span id={id} className={styles.text}>\n <SkeletonTextContent defaultWidth=\"6em\">\n {children}\n {optional && optionalMarker}\n </SkeletonTextContent>\n </span>\n <UiComponentTunnelExit id=\"contextualHelp\" component=\"Label\">\n {(children) => {\n if (React.Children.count(children) >= 1) {\n return children;\n }\n\n return undefined;\n }}\n </UiComponentTunnelExit>\n <UiComponentTunnelExit id=\"right\" component=\"Label\">\n {(children) => {\n if (React.Children.count(children) >= 1) {\n return <div className={styles.right}>{children}</div>;\n }\n\n return undefined;\n }}\n </UiComponentTunnelExit>\n </Aria.Label>\n </Aria.LabelContext.Provider>\n </PropsContextProvider>\n );\n});\n\nexport default Label;\n"],"mappings":";;;;;;;;;;;;;;;;;AA+BA,IAAa,QAAQ,cAAc,UAAU,UAAU;CACrD,MAAM,EACJ,UACA,WACA,UACA,YACA,KACA,WAAW,OACX,GAAG,SACD;CAEJ,MAAM,CAAC,YAAY,YAAY,KAAK,gBAClC,MACA,KACA,KAAK,YACP;CACA,MAAM,EAAE,IAAI,GAAG,cAAc;CAE7B,MAAM,kBAAkB,4BAA4BA,kBAAS,OAAO;CACpE,MAAM,aAAa,gBAAgB;CAEnC,MAAM,gBAAgB,WAClB,YACA,KAAKC,qBAAO,OAAO,cAAcA,qBAAO,UAAU,SAAS;CAE/D,MAAM,iBACJ,oBAAC,QAAD;EAAM,WAAWA,qBAAO;EACrB,UAAA,gBAAgB,OAAO,UAAU;CAC9B,CAAA;CAGR,MAAM,cAAc;EAClB,IAAI;EACJ,WAAW;CACb;CAEA,MAAM,eAA6B;EACjC,GAAG,0BAA0B,WAAW;EAExC,uBAAuB,EACrB,QAAQ;GACN,IAAI;GACJ,WAAW;EACb,EACF;EACA,QAAQ;GACN,QAAQ;GACR,MAAM;EACR;EACA,QAAQ;GACN,QAAQ;GACR,QAAQ,EACN,QAAQ,KACV;EACF;CACF;CAEA,OACE,oBAAC,sBAAD;EAAsB,OAAO;EAE3B,UAAA,oBAAC,KAAK,aAAa,UAAnB;GAA4B,OAAO;GACjC,UAAA,qBAAC,KAAK,OAAN;IACE,GAAI;IACJ,WAAW;IACX,KAAK;IACL,OAAO,cAAc,KAAA;IAJvB,UAAA;KAWE,oBAAC,QAAD;MAAU;MAAI,WAAWA,qBAAO;MAC9B,UAAA,qBAAC,qBAAD;OAAqB,cAAa;OAAlC,UAAA,CACG,UACA,YAAY,cACM;;KACjB,CAAA;KACN,oBAAC,uBAAD;MAAuB,IAAG;MAAiB,WAAU;MACjD,WAAA,aAAa;OACb,IAAI,MAAM,SAAS,MAAM,QAAQ,KAAK,GACpC,OAAO;MAIX;KACqB,CAAA;KACvB,oBAAC,uBAAD;MAAuB,IAAG;MAAQ,WAAU;MACxC,WAAA,aAAa;OACb,IAAI,MAAM,SAAS,MAAM,QAAQ,KAAK,GACpC,OAAO,oBAAC,OAAD;QAAK,WAAWA,qBAAO;QAAQ;OAAc,CAAA;MAIxD;KACqB,CAAA;IACb;;EACc,CAAA;CACR,CAAA;AAE1B,CAAC"}
1
+ {"version":3,"file":"Label.mjs","names":["locales","styles"],"sources":["../../../../../../../src/components/Label/Label.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport React from \"react\";\nimport styles from \"./Label.module.scss\";\nimport * as Aria from \"react-aria-components\";\nimport clsx from \"clsx\";\nimport {\n overlayTriggersTunneledTo,\n type PropsContext,\n PropsContextProvider,\n} from \"@/lib/propsContext\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport locales from \"./locales/*.locale.json\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\nimport { SkeletonTextContent } from \"@/components/SkeletonMode/components/SkeletonTextContent\";\nimport { useSkeletonMode } from \"@/components/SkeletonMode/skeletonModeContext\";\n\nexport interface LabelProps\n extends\n PropsWithChildren<Omit<Aria.LabelProps, \"children\">>,\n FlowComponentProps<HTMLLabelElement> {\n /** Whether the label should show an \"optional\" indicator. */\n optional?: boolean;\n /** Whether the label should be displayed as disabled. */\n isDisabled?: boolean;\n /** @internal */\n unstyled?: boolean;\n}\n\n/** @flr-generate all */\nexport const Label = flowComponent(\"Label\", (props) => {\n const {\n children,\n className,\n optional,\n isDisabled,\n ref,\n unstyled = false,\n ...rest\n } = props;\n\n const [labelProps, labelRef] = Aria.useContextProps(\n rest,\n ref,\n Aria.LabelContext,\n );\n const { id, ...rootProps } = labelProps;\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"Label\");\n const isSkeleton = useSkeletonMode();\n\n const rootClassName = unstyled\n ? className\n : clsx(styles.label, isDisabled && styles.disabled, className);\n\n const optionalMarker = (\n <span className={styles.optional}>\n {stringFormatter.format(\"optional\")}\n </span>\n );\n\n const rightTunnel = {\n id: \"right\",\n component: \"Label\",\n } as const;\n\n const propsContext: PropsContext = {\n ...overlayTriggersTunneledTo(rightTunnel),\n // The contextual help sits next to the label text, not with the actions.\n ContextualHelpTrigger: {\n tunnel: {\n id: \"contextualHelp\",\n component: \"Label\",\n },\n },\n Button: {\n tunnel: rightTunnel,\n size: \"s\",\n },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n {/* The context is already merged into `labelProps` above. */}\n <Aria.LabelContext.Provider value={null}>\n <Aria.Label\n {...rootProps}\n className={rootClassName}\n ref={labelRef}\n inert={isSkeleton || undefined}\n >\n {/*\n * Fields point `aria-labelledby` at the label's id, and the name\n * computation takes every descendant's name, buttons included. The\n * id sits on this span so the tunnelled buttons stay out of it.\n */}\n <span id={id} className={styles.text}>\n <SkeletonTextContent defaultWidth=\"6em\">\n {children}\n {optional && optionalMarker}\n </SkeletonTextContent>\n </span>\n <UiComponentTunnelExit id=\"contextualHelp\" component=\"Label\">\n {(children) => {\n if (React.Children.count(children) >= 1) {\n return children;\n }\n\n return undefined;\n }}\n </UiComponentTunnelExit>\n <UiComponentTunnelExit id=\"right\" component=\"Label\">\n {(children) => {\n if (React.Children.count(children) >= 1) {\n return <div className={styles.right}>{children}</div>;\n }\n\n return undefined;\n }}\n </UiComponentTunnelExit>\n </Aria.Label>\n </Aria.LabelContext.Provider>\n </PropsContextProvider>\n );\n});\n\nexport default Label;\n"],"mappings":";;;;;;;;;;;;;;;;;AA+BA,IAAa,QAAQ,cAAc,UAAU,UAAU;CACrD,MAAM,EACJ,UACA,WACA,UACA,YACA,KACA,WAAW,OACX,GAAG,SACD;CAEJ,MAAM,CAAC,YAAY,YAAY,KAAK,gBAClC,MACA,KACA,KAAK,YACP;CACA,MAAM,EAAE,IAAI,GAAG,cAAc;CAE7B,MAAM,kBAAkB,4BAA4BA,kBAAS,OAAO;CACpE,MAAM,aAAa,gBAAgB;CAEnC,MAAM,gBAAgB,WAClB,YACA,KAAKC,qBAAO,OAAO,cAAcA,qBAAO,UAAU,SAAS;CAE/D,MAAM,iBACJ,oBAAC,QAAD;EAAM,WAAWA,qBAAO;EACrB,UAAA,gBAAgB,OAAO,UAAU;CAC9B,CAAA;CAGR,MAAM,cAAc;EAClB,IAAI;EACJ,WAAW;CACb;CAEA,MAAM,eAA6B;EACjC,GAAG,0BAA0B,WAAW;EAExC,uBAAuB,EACrB,QAAQ;GACN,IAAI;GACJ,WAAW;EACb,EACF;EACA,QAAQ;GACN,QAAQ;GACR,MAAM;EACR;CACF;CAEA,OACE,oBAAC,sBAAD;EAAsB,OAAO;EAE3B,UAAA,oBAAC,KAAK,aAAa,UAAnB;GAA4B,OAAO;GACjC,UAAA,qBAAC,KAAK,OAAN;IACE,GAAI;IACJ,WAAW;IACX,KAAK;IACL,OAAO,cAAc,KAAA;IAJvB,UAAA;KAWE,oBAAC,QAAD;MAAU;MAAI,WAAWA,qBAAO;MAC9B,UAAA,qBAAC,qBAAD;OAAqB,cAAa;OAAlC,UAAA,CACG,UACA,YAAY,cACM;;KACjB,CAAA;KACN,oBAAC,uBAAD;MAAuB,IAAG;MAAiB,WAAU;MACjD,WAAA,aAAa;OACb,IAAI,MAAM,SAAS,MAAM,QAAQ,KAAK,GACpC,OAAO;MAIX;KACqB,CAAA;KACvB,oBAAC,uBAAD;MAAuB,IAAG;MAAQ,WAAU;MACxC,WAAA,aAAa;OACb,IAAI,MAAM,SAAS,MAAM,QAAQ,KAAK,GACpC,OAAO,oBAAC,OAAD;QAAK,WAAWA,qBAAO;QAAQ;OAAc,CAAA;MAIxD;KACqB,CAAA;IACb;;EACc,CAAA;CACR,CAAA;AAE1B,CAAC"}