@mittwald/flow-react-components 0.2.0-alpha.39 → 0.2.0-alpha.40

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.
@@ -21,9 +21,9 @@ const ColumnLayout = (props) => {
21
21
  elementType = "div",
22
22
  "aria-label": ariaLabel
23
23
  } = props;
24
- const columnsS = s ? getColumns(s) : void 0;
25
- const columnsM = m ? getColumns(m) : s ? columnsS : void 0;
26
- const columnsL = l ? getColumns(l) : m || s ? columnsM : void 0;
24
+ const columnsS = s ? getColumns(s) : "1fr";
25
+ const columnsM = m ? getColumns(m) : s ? columnsS : "1fr 1fr";
26
+ const columnsL = l ? getColumns(l) : m || s ? columnsM : "1fr 1fr 1fr";
27
27
  const style = {
28
28
  "--column-layout--columns-s": columnsS,
29
29
  "--column-layout--columns-m": columnsM,
@@ -1 +1 @@
1
- {"version":3,"file":"ColumnLayout.mjs","sources":["../../../../src/components/ColumnLayout/ColumnLayout.tsx"],"sourcesContent":["import type { CSSProperties, FC, PropsWithChildren } from \"react\";\nimport React from \"react\";\nimport styles from \"./ColumnLayout.module.scss\";\nimport { getColumns } from \"./lib/getColumns\";\nimport clsx from \"clsx\";\nimport type {\n PropsWithClassName,\n PropsWithElementType,\n} from \"@/lib/types/props\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\n\ntype GapSize = \"s\" | \"m\" | \"l\" | \"xl\";\n\nexport interface ColumnLayoutProps\n extends PropsWithChildren,\n PropsWithElementType<\"div\" | \"ul\">,\n PropsWithClassName {\n /** Column layout for container size s. */\n s?: number[];\n /** Column layout for container size m. */\n m?: number[];\n /** Column layout for container size l. */\n l?: number[];\n /**\n * Size of the row and column gap between the content blocks inside the column\n * layout.\n *\n * @default \"m\"\n */\n gap?: GapSize;\n /** Size of the row gap between the content blocks inside the column layout. */\n rowGap?: GapSize;\n /** Size of the column gap between the content blocks inside the column layout. */\n columnGap?: GapSize;\n}\n\n/**\n * @flr-generate all\n * @flr-clear-props-context\n */\nexport const ColumnLayout: FC<ColumnLayoutProps> = (props) => {\n const {\n children,\n className,\n s,\n m,\n l,\n gap = \"m\",\n rowGap = gap,\n columnGap = gap,\n elementType = \"div\",\n \"aria-label\": ariaLabel,\n } = props;\n\n const columnsS = s ? getColumns(s) : undefined;\n const columnsM = m ? getColumns(m) : s ? columnsS : undefined;\n const columnsL = l ? getColumns(l) : m || s ? columnsM : undefined;\n\n const style = {\n \"--column-layout--columns-s\": columnsS,\n \"--column-layout--columns-m\": columnsM,\n \"--column-layout--columns-l\": columnsL,\n \"--column-layout--row-gap\": `var(--column-layout--gap--${rowGap})`,\n \"--column-layout--column-gap\": `var(--column-layout--gap--${columnGap})`,\n } as CSSProperties;\n\n const rootClassName = clsx(styles.columnLayoutContainer, className);\n\n const Element = elementType;\n\n const propsContext: PropsContext = {\n Section: {\n hideSeparator: true,\n },\n };\n\n return (\n <div className={rootClassName} style={style}>\n <Element aria-label={ariaLabel} className={styles.columnLayout}>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </Element>\n </div>\n );\n};\n\nexport default ColumnLayout;\n"],"names":[],"mappings":";;;;;;;;AAyCa,MAAA,YAAA,GAAsC,CAAC,KAAU,KAAA;AAC5D,EAAM,MAAA;AAAA,IACJ,QAAA;AAAA,IACA,SAAA;AAAA,IACA,CAAA;AAAA,IACA,CAAA;AAAA,IACA,CAAA;AAAA,IACA,GAAM,GAAA,GAAA;AAAA,IACN,MAAS,GAAA,GAAA;AAAA,IACT,SAAY,GAAA,GAAA;AAAA,IACZ,WAAc,GAAA,KAAA;AAAA,IACd,YAAc,EAAA;AAAA,GACZ,GAAA,KAAA;AAEJ,EAAA,MAAM,QAAW,GAAA,CAAA,GAAI,UAAW,CAAA,CAAC,CAAI,GAAA,MAAA;AACrC,EAAA,MAAM,WAAW,CAAI,GAAA,UAAA,CAAW,CAAC,CAAA,GAAI,IAAI,QAAW,GAAA,MAAA;AACpD,EAAA,MAAM,WAAW,CAAI,GAAA,UAAA,CAAW,CAAC,CAAI,GAAA,CAAA,IAAK,IAAI,QAAW,GAAA,MAAA;AAEzD,EAAA,MAAM,KAAQ,GAAA;AAAA,IACZ,4BAA8B,EAAA,QAAA;AAAA,IAC9B,4BAA8B,EAAA,QAAA;AAAA,IAC9B,4BAA8B,EAAA,QAAA;AAAA,IAC9B,0BAAA,EAA4B,6BAA6B,MAAM,CAAA,CAAA,CAAA;AAAA,IAC/D,6BAAA,EAA+B,6BAA6B,SAAS,CAAA,CAAA;AAAA,GACvE;AAEA,EAAA,MAAM,aAAgB,GAAA,IAAA,CAAK,MAAO,CAAA,qBAAA,EAAuB,SAAS,CAAA;AAElE,EAAA,MAAM,OAAU,GAAA,WAAA;AAEhB,EAAA,MAAM,YAA6B,GAAA;AAAA,IACjC,OAAS,EAAA;AAAA,MACP,aAAe,EAAA;AAAA;AACjB,GACF;AAEA,EAAA,2BACG,KAAI,EAAA,EAAA,SAAA,EAAW,eAAe,KAC7B,EAAA,QAAA,kBAAA,GAAA,CAAC,WAAQ,YAAY,EAAA,SAAA,EAAW,SAAW,EAAA,MAAA,CAAO,cAChD,QAAC,kBAAA,GAAA,CAAA,oBAAA,EAAA,EAAqB,OAAO,YAC1B,EAAA,QAAA,EACH,GACF,CACF,EAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"ColumnLayout.mjs","sources":["../../../../src/components/ColumnLayout/ColumnLayout.tsx"],"sourcesContent":["import type { CSSProperties, FC, PropsWithChildren } from \"react\";\nimport React from \"react\";\nimport styles from \"./ColumnLayout.module.scss\";\nimport { getColumns } from \"./lib/getColumns\";\nimport clsx from \"clsx\";\nimport type {\n PropsWithClassName,\n PropsWithElementType,\n} from \"@/lib/types/props\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\n\ntype GapSize = \"s\" | \"m\" | \"l\" | \"xl\";\n\nexport interface ColumnLayoutProps\n extends PropsWithChildren,\n PropsWithElementType<\"div\" | \"ul\">,\n PropsWithClassName {\n /** Column layout for container size s. */\n s?: number[];\n /** Column layout for container size m. */\n m?: number[];\n /** Column layout for container size l. */\n l?: number[];\n /**\n * Size of the row and column gap between the content blocks inside the column\n * layout.\n *\n * @default \"m\"\n */\n gap?: GapSize;\n /** Size of the row gap between the content blocks inside the column layout. */\n rowGap?: GapSize;\n /** Size of the column gap between the content blocks inside the column layout. */\n columnGap?: GapSize;\n}\n\n/**\n * @flr-generate all\n * @flr-clear-props-context\n */\nexport const ColumnLayout: FC<ColumnLayoutProps> = (props) => {\n const {\n children,\n className,\n s,\n m,\n l,\n gap = \"m\",\n rowGap = gap,\n columnGap = gap,\n elementType = \"div\",\n \"aria-label\": ariaLabel,\n } = props;\n\n const columnsS = s ? getColumns(s) : \"1fr\";\n const columnsM = m ? getColumns(m) : s ? columnsS : \"1fr 1fr\";\n const columnsL = l ? getColumns(l) : m || s ? columnsM : \"1fr 1fr 1fr\";\n\n const style = {\n \"--column-layout--columns-s\": columnsS,\n \"--column-layout--columns-m\": columnsM,\n \"--column-layout--columns-l\": columnsL,\n \"--column-layout--row-gap\": `var(--column-layout--gap--${rowGap})`,\n \"--column-layout--column-gap\": `var(--column-layout--gap--${columnGap})`,\n } as CSSProperties;\n\n const rootClassName = clsx(styles.columnLayoutContainer, className);\n\n const Element = elementType;\n\n const propsContext: PropsContext = {\n Section: {\n hideSeparator: true,\n },\n };\n\n return (\n <div className={rootClassName} style={style}>\n <Element aria-label={ariaLabel} className={styles.columnLayout}>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </Element>\n </div>\n );\n};\n\nexport default ColumnLayout;\n"],"names":[],"mappings":";;;;;;;;AAyCa,MAAA,YAAA,GAAsC,CAAC,KAAU,KAAA;AAC5D,EAAM,MAAA;AAAA,IACJ,QAAA;AAAA,IACA,SAAA;AAAA,IACA,CAAA;AAAA,IACA,CAAA;AAAA,IACA,CAAA;AAAA,IACA,GAAM,GA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Story;
9
9
  export declare const Gaps: Story;
10
+ export declare const Nested: Story;
10
11
  //# sourceMappingURL=Default.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Default.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ColumnLayout/stories/Default.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAQ3C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CA6BnC,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,YAAY,CAAC,CAAC;AAE3C,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,YAAY,EAAE,KAgB1B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAsB7B,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAwDlB,CAAC"}
1
+ {"version":3,"file":"Default.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ColumnLayout/stories/Default.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAQ3C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CA6BnC,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,YAAY,CAAC,CAAC;AAE3C,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,YAAY,EAAE,KAgB1B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAmB7B,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAwDlB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAmBpB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/flow-react-components",
3
- "version": "0.2.0-alpha.39",
3
+ "version": "0.2.0-alpha.40",
4
4
  "type": "module",
5
5
  "description": "A React implementation of Flow, mittwald’s design system",
6
6
  "homepage": "https://mittwald.github.io/flow",
@@ -52,7 +52,7 @@
52
52
  "dependencies": {
53
53
  "@chakra-ui/live-region": "^2.1.0",
54
54
  "@internationalized/string-compiler": "^3.2.6",
55
- "@mittwald/react-tunnel": "0.2.0-alpha.39",
55
+ "@mittwald/react-tunnel": "0.2.0-alpha.40",
56
56
  "@mittwald/react-use-promise": "^2.6.0",
57
57
  "@react-aria/form": "^3.0.12",
58
58
  "@react-aria/utils": "^3.27.0",
@@ -90,7 +90,7 @@
90
90
  "devDependencies": {
91
91
  "@faker-js/faker": "^9.5.0",
92
92
  "@internationalized/date": "^3.7.0",
93
- "@mittwald/flow-design-tokens": "0.2.0-alpha.39",
93
+ "@mittwald/flow-design-tokens": "0.2.0-alpha.40",
94
94
  "@mittwald/react-use-promise": "^2.6.0",
95
95
  "@mittwald/typescript-config": "",
96
96
  "@nx/storybook": "^20.4.4",
@@ -168,5 +168,5 @@
168
168
  "optional": true
169
169
  }
170
170
  },
171
- "gitHead": "10ff9abf80942c8fc2a296cd11f49eb237802968"
171
+ "gitHead": "9b9f6e9a045acb6dcdd1bd1c5a9848e650f289bd"
172
172
  }