@mittwald/flow-react-components 1.3.0-next.25 → 1.3.0-next.27

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 (24) hide show
  1. package/MIGRATION.md +24 -0
  2. package/dist/assets/component-index.json +1 -1
  3. package/dist/assets/doc-properties.json +1 -1
  4. package/dist/css/all-layered.css +1 -1
  5. package/dist/css/all.css +1 -1
  6. package/dist/js/packages/components/src/components/Image/Image.mjs +2 -2
  7. package/dist/js/packages/components/src/components/Image/Image.mjs.map +1 -1
  8. package/dist/js/packages/components/src/components/Image/Image.module.mjs +3 -1
  9. package/dist/js/packages/components/src/components/Image/Image.module.mjs.map +1 -1
  10. package/dist/js/packages/components/src/components/List/components/Items/Items.mjs +3 -6
  11. package/dist/js/packages/components/src/components/List/components/Items/Items.mjs.map +1 -1
  12. package/dist/js/packages/components/src/components/List/components/Table/Table.mjs +6 -2
  13. package/dist/js/packages/components/src/components/List/components/Table/Table.mjs.map +1 -1
  14. package/dist/js/packages/components/src/components/List/{components/Items/hooks → hooks}/useInfiniteScrollTrigger.mjs +11 -12
  15. package/dist/js/packages/components/src/components/List/hooks/useInfiniteScrollTrigger.mjs.map +1 -0
  16. package/dist/js/packages/design-tokens/dist/json-runtime/all-dark.mjs +1 -1
  17. package/dist/js/packages/design-tokens/dist/json-runtime/all-dark.mjs.map +1 -1
  18. package/dist/js/packages/design-tokens/dist/json-runtime/all-light.mjs +1 -1
  19. package/dist/js/packages/design-tokens/dist/json-runtime/all-light.mjs.map +1 -1
  20. package/dist/types/components/Image/Image.d.ts +7 -1
  21. package/dist/types/components/List/hooks/useInfiniteScrollTrigger.d.ts +17 -0
  22. package/package.json +9 -9
  23. package/dist/js/packages/components/src/components/List/components/Items/hooks/useInfiniteScrollTrigger.mjs.map +0 -1
  24. package/dist/types/components/List/components/Items/hooks/useInfiniteScrollTrigger.d.ts +0 -3
@@ -1,8 +1,14 @@
1
1
  import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
2
2
  import { ComponentProps } from 'react';
3
3
  export interface ImageProps extends Omit<ComponentProps<"img">, "ref">, FlowComponentProps<HTMLImageElement> {
4
- /** Display the image with border and rounded edges. */
4
+ /** Display the image with a border. */
5
5
  withBorder?: boolean;
6
+ /**
7
+ * Display the image with rounded corners.
8
+ *
9
+ * @default true
10
+ */
11
+ withRoundedCorners?: boolean;
6
12
  /**
7
13
  * The aspect ratio of the images container. Larger images will be centered
8
14
  * and their overflow will be hidden.
@@ -0,0 +1,17 @@
1
+ import { RefCallback } from 'react';
2
+ interface InfiniteScrollTrigger {
3
+ /**
4
+ * Attach to whatever the view renders for `triggerIndex`. A callback ref, so
5
+ * the observer follows the trigger as it moves on with every loaded batch — a
6
+ * ref object would leave the effect without a signal that the element it
7
+ * observes has been replaced.
8
+ */
9
+ triggerRef: RefCallback<HTMLElement>;
10
+ /**
11
+ * Index of the item that loads the next batch once it scrolls into view, or
12
+ * `undefined` while infinite scrolling is off.
13
+ */
14
+ triggerIndex: number | undefined;
15
+ }
16
+ export declare const useInfiniteScrollTrigger: () => InfiniteScrollTrigger;
17
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/flow-react-components",
3
- "version": "1.3.0-next.25",
3
+ "version": "1.3.0-next.27",
4
4
  "type": "module",
5
5
  "description": "A React implementation of Flow, mittwald’s design system",
6
6
  "homepage": "https://flow.mittwald.de",
@@ -83,9 +83,9 @@
83
83
  "@internationalized/string-compiler": "^3.4.1",
84
84
  "@lezer/common": "^1.5.2",
85
85
  "@lezer/highlight": "^1.2.3",
86
- "@mittwald/flow-icons": "^1.3.0-next.25",
86
+ "@mittwald/flow-icons": "^1.3.0-next.27",
87
87
  "@mittwald/password-tools-js": "^3.0.0",
88
- "@mittwald/react-tunnel": "^1.3.0-next.25",
88
+ "@mittwald/react-tunnel": "^1.3.0-next.27",
89
89
  "@mittwald/react-use-promise": "^4.2.2",
90
90
  "@react-aria/form": "^3.2.1",
91
91
  "@react-aria/i18n": "^3.13.1",
@@ -138,12 +138,12 @@
138
138
  "@internationalized/date": "^3.12.3",
139
139
  "@lezer/generator": "^1.8.0",
140
140
  "@lezer/lr": "^1.4.10",
141
- "@mittwald/flow-core": "1.3.0-next.25",
142
- "@mittwald/flow-design-tokens": "1.3.0-next.25",
143
- "@mittwald/flow-icons-base": "1.3.0-next.25",
141
+ "@mittwald/flow-core": "1.3.0-next.27",
142
+ "@mittwald/flow-design-tokens": "1.3.0-next.27",
143
+ "@mittwald/flow-icons-base": "1.3.0-next.27",
144
144
  "@mittwald/react-use-promise": "^4.2.2",
145
145
  "@mittwald/remote-dom-react": "1.2.2-mittwald.10",
146
- "@mittwald/typescript-config": "1.3.0-next.25",
146
+ "@mittwald/typescript-config": "1.3.0-next.27",
147
147
  "@nx/storybook": "^22.7.6",
148
148
  "@storybook/addon-a11y": "^10.5.10",
149
149
  "@storybook/addon-actions": "^9.0.8",
@@ -195,7 +195,7 @@
195
195
  },
196
196
  "peerDependencies": {
197
197
  "@internationalized/date": "^3.12.2",
198
- "@mittwald/flow-icons-pro": "1.3.0-next.25",
198
+ "@mittwald/flow-icons-pro": "1.3.0-next.27",
199
199
  "@mittwald/react-use-promise": "^4.2.2",
200
200
  "next": "^16.2.3",
201
201
  "react": "^19.2.0",
@@ -219,5 +219,5 @@
219
219
  "browserslist": [
220
220
  "baseline widely available"
221
221
  ],
222
- "gitHead": "ee347a2ee20ea60a68bb33cdfdcf6b2fb244c30d"
222
+ "gitHead": "ee01cfd0c948a38f6023903dfee1ec4453c99135"
223
223
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"useInfiniteScrollTrigger.mjs","names":[],"sources":["../../../../../../../../../../src/components/List/components/Items/hooks/useInfiniteScrollTrigger.ts"],"sourcesContent":["import { useEffect, useEffectEvent, type RefObject } from \"react\";\nimport { useList } from \"@/components/List/hooks/useList\";\n\nconst loadMoreThresholdFactor = 0.2;\nconst minLoadMoreThresholdRows = 1;\nconst maxLoadMoreThresholdRows = 8;\n\nexport const getLoadMoreThresholdRows = (batchSize: number): number =>\n Math.min(\n maxLoadMoreThresholdRows,\n Math.max(\n minLoadMoreThresholdRows,\n Math.round(batchSize * loadMoreThresholdFactor),\n ),\n );\n\nexport const useInfiniteScrollTrigger = (\n triggerRef: RefObject<HTMLElement | null>,\n): void => {\n const list = useList();\n const isLoading = list.loader.useIsLoading();\n const visibleItemsCount = list.batches.getVisibleItemsCount();\n\n const loadNextBatch = useEffectEvent(() => {\n if (list.batches.hasNextBatch() && !isLoading) {\n list.batches.nextBatch();\n }\n });\n\n useEffect(() => {\n const trigger = triggerRef.current;\n if (!trigger) {\n return;\n }\n\n const observer = new IntersectionObserver((entries) => {\n if (entries.some((entry) => entry.isIntersecting)) {\n loadNextBatch();\n }\n });\n observer.observe(trigger);\n\n return () => observer.disconnect();\n }, [loadNextBatch, triggerRef, visibleItemsCount]);\n};\n"],"mappings":";;;;;AAGA,IAAM,0BAA0B;AAChC,IAAM,2BAA2B;AACjC,IAAM,2BAA2B;AAEjC,IAAa,4BAA4B,cACvC,KAAK,IACH,0BACA,KAAK,IACH,0BACA,KAAK,MAAM,YAAY,uBAAuB,CAChD,CACF;AAEF,IAAa,4BACX,eACS;CACT,MAAM,OAAO,QAAQ;CACrB,MAAM,YAAY,KAAK,OAAO,aAAa;CAC3C,MAAM,oBAAoB,KAAK,QAAQ,qBAAqB;CAE5D,MAAM,gBAAgB,qBAAqB;EACzC,IAAI,KAAK,QAAQ,aAAa,KAAK,CAAC,WAClC,KAAK,QAAQ,UAAU;CAE3B,CAAC;CAED,gBAAgB;EACd,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SACH;EAGF,MAAM,WAAW,IAAI,sBAAsB,YAAY;GACrD,IAAI,QAAQ,MAAM,UAAU,MAAM,cAAc,GAC9C,cAAc;EAElB,CAAC;EACD,SAAS,QAAQ,OAAO;EAExB,aAAa,SAAS,WAAW;CACnC,GAAG;EAAC;EAAe;EAAY;CAAiB,CAAC;AACnD"}
@@ -1,3 +0,0 @@
1
- import { RefObject } from 'react';
2
- export declare const getLoadMoreThresholdRows: (batchSize: number) => number;
3
- export declare const useInfiniteScrollTrigger: (triggerRef: RefObject<HTMLElement | null>) => void;