@mittwald/flow-react-components 1.5.0-next.3 → 1.5.0-next.5
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.
- package/dist/assets/component-index.json +1 -1
- package/dist/assets/doc-properties.json +1 -1
- package/dist/js/packages/components/src/components/Flex/Flex.mjs +5 -5
- package/dist/js/packages/components/src/components/Flex/Flex.mjs.map +1 -1
- package/dist/types/components/Flex/Flex.d.ts +4 -0
- package/package.json +9 -9
|
@@ -7,13 +7,13 @@ import { jsx } from "react/jsx-runtime";
|
|
|
7
7
|
var sizeVariable = (size) => size && `var(--size-px--${size})`;
|
|
8
8
|
/** @flr-generate all */
|
|
9
9
|
var Flex = (props) => {
|
|
10
|
-
const { children, className, direction = "row", align, justify, gap, columnGap, rowGap, grow, wrap = "nowrap", padding, paddingTop, paddingBottom, paddingLeft, paddingRight, elementType = "div", ...restProps } = props;
|
|
10
|
+
const { children, className, direction = "row", align, justify, gap, columnGap, rowGap, grow, wrap = "nowrap", padding, paddingBlock, paddingInline, paddingTop, paddingBottom, paddingLeft, paddingRight, elementType = "div", ...restProps } = props;
|
|
11
11
|
const columnGapSize = columnGap ?? gap;
|
|
12
12
|
const rowGapSize = rowGap ?? gap;
|
|
13
|
-
const paddingTopSize = paddingTop ?? padding;
|
|
14
|
-
const paddingBottomSize = paddingBottom ?? padding;
|
|
15
|
-
const paddingLeftSize = paddingLeft ?? padding;
|
|
16
|
-
const paddingRightSize = paddingRight ?? padding;
|
|
13
|
+
const paddingTopSize = paddingTop ?? paddingBlock ?? padding;
|
|
14
|
+
const paddingBottomSize = paddingBottom ?? paddingBlock ?? padding;
|
|
15
|
+
const paddingLeftSize = paddingLeft ?? paddingInline ?? padding;
|
|
16
|
+
const paddingRightSize = paddingRight ?? paddingInline ?? padding;
|
|
17
17
|
const rootClassName = clsx(Flex_module_default.flex, align && Flex_module_default.align, justify && Flex_module_default.justify, grow && Flex_module_default.grow, columnGapSize && Flex_module_default["column-gap"], rowGapSize && Flex_module_default["row-gap"], paddingTopSize && Flex_module_default["padding-top"], paddingBottomSize && Flex_module_default["padding-bottom"], paddingLeftSize && Flex_module_default["padding-left"], paddingRightSize && Flex_module_default["padding-right"], className);
|
|
18
18
|
const style = {
|
|
19
19
|
"--flex--direction": direction,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flex.mjs","names":[],"sources":["../../../../../../../src/components/Flex/Flex.tsx"],"sourcesContent":["import type { CSSProperties, FC, PropsWithChildren } from \"react\";\nimport type {\n PropsWithClassName,\n PropsWithElementType,\n} from \"@/lib/types/props\";\nimport clsx from \"clsx\";\nimport styles from \"./Flex.module.scss\";\n\nexport interface FlexProps\n extends\n PropsWithChildren,\n PropsWithClassName,\n PropsWithElementType<\n | \"div\"\n | \"aside\"\n | \"ul\"\n | \"li\"\n | \"ol\"\n | \"section\"\n | \"main\"\n | \"span\"\n | \"p\"\n | \"footer\"\n | \"header\"\n > {\n /** The flexDirection value of the element. @default \"row\" */\n direction?: CSSProperties[\"flexDirection\"];\n /** The alignItems value of the element. @default \"start\" */\n align?: \"start\" | \"end\" | \"center\" | \"stretch\" | \"baseline\";\n /** The justifyContent value of the element. @default \"start\" */\n justify?: CSSProperties[\"justifyContent\"];\n /** The gap size of the element. */\n gap?: \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\";\n /** The columnGap size of the element. */\n columnGap?: \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\";\n /** The rowGap size of the element. */\n rowGap?: \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\";\n /** Whether the element should grow. */\n grow?: boolean;\n /** The flexWrap value of the element. @default \"nowrap\" */\n wrap?: CSSProperties[\"flexWrap\"];\n /** The padding of the element. */\n padding?: \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\";\n /** The padding top of the element. */\n paddingTop?: \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\";\n /** The padding bottom of the element. */\n paddingBottom?: \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\";\n /** The padding left of the element. */\n paddingLeft?: \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\";\n /** The padding right of the element. */\n paddingRight?: \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\";\n}\n\ntype FlexSize = \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\";\n\nconst sizeVariable = (size: FlexSize | undefined) =>\n size && `var(--size-px--${size})`;\n\n/** @flr-generate all */\nexport const Flex: FC<FlexProps> = (props) => {\n const {\n children,\n className,\n direction = \"row\",\n align,\n justify,\n gap,\n columnGap,\n rowGap,\n grow,\n wrap = \"nowrap\",\n padding,\n paddingTop,\n paddingBottom,\n paddingLeft,\n paddingRight,\n elementType = \"div\",\n ...restProps\n } = props;\n\n const columnGapSize = columnGap ?? gap;\n const rowGapSize = rowGap ?? gap;\n const paddingTopSize = paddingTop ?? padding;\n const paddingBottomSize = paddingBottom ?? padding;\n const paddingLeftSize = paddingLeft ?? padding;\n const paddingRightSize = paddingRight ?? padding;\n\n const rootClassName = clsx(\n styles.flex,\n align && styles.align,\n justify && styles.justify,\n grow && styles.grow,\n columnGapSize && styles[\"column-gap\"],\n rowGapSize && styles[\"row-gap\"],\n paddingTopSize && styles[\"padding-top\"],\n paddingBottomSize && styles[\"padding-bottom\"],\n paddingLeftSize && styles[\"padding-left\"],\n paddingRightSize && styles[\"padding-right\"],\n className,\n );\n\n const style: CSSProperties = {\n \"--flex--direction\": direction,\n \"--flex--wrap\": wrap,\n \"--flex--align\":\n align === \"end\" ? \"flex-end\" : align === \"start\" ? \"flex-start\" : align,\n \"--flex--justify\": justify,\n \"--flex--column-gap\": sizeVariable(columnGapSize),\n \"--flex--row-gap\": sizeVariable(rowGapSize),\n \"--flex--padding-top\": sizeVariable(paddingTopSize),\n \"--flex--padding-bottom\": sizeVariable(paddingBottomSize),\n \"--flex--padding-left\": sizeVariable(paddingLeftSize),\n \"--flex--padding-right\": sizeVariable(paddingRightSize),\n };\n\n const Element = elementType;\n\n return (\n <Element {...restProps} className={rootClassName} style={style}>\n {children}\n </Element>\n );\n};\nexport default Flex;\n"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"Flex.mjs","names":[],"sources":["../../../../../../../src/components/Flex/Flex.tsx"],"sourcesContent":["import type { CSSProperties, FC, PropsWithChildren } from \"react\";\nimport type {\n PropsWithClassName,\n PropsWithElementType,\n} from \"@/lib/types/props\";\nimport clsx from \"clsx\";\nimport styles from \"./Flex.module.scss\";\n\nexport interface FlexProps\n extends\n PropsWithChildren,\n PropsWithClassName,\n PropsWithElementType<\n | \"div\"\n | \"aside\"\n | \"ul\"\n | \"li\"\n | \"ol\"\n | \"section\"\n | \"main\"\n | \"span\"\n | \"p\"\n | \"footer\"\n | \"header\"\n > {\n /** The flexDirection value of the element. @default \"row\" */\n direction?: CSSProperties[\"flexDirection\"];\n /** The alignItems value of the element. @default \"start\" */\n align?: \"start\" | \"end\" | \"center\" | \"stretch\" | \"baseline\";\n /** The justifyContent value of the element. @default \"start\" */\n justify?: CSSProperties[\"justifyContent\"];\n /** The gap size of the element. */\n gap?: \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\";\n /** The columnGap size of the element. */\n columnGap?: \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\";\n /** The rowGap size of the element. */\n rowGap?: \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\";\n /** Whether the element should grow. */\n grow?: boolean;\n /** The flexWrap value of the element. @default \"nowrap\" */\n wrap?: CSSProperties[\"flexWrap\"];\n /** The padding of the element. */\n padding?: \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\";\n /** The padding top and bottom of the element. Takes precedence over `padding`. */\n paddingBlock?: \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\";\n /** The padding left and right of the element. Takes precedence over `padding`. */\n paddingInline?: \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\";\n /** The padding top of the element. */\n paddingTop?: \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\";\n /** The padding bottom of the element. */\n paddingBottom?: \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\";\n /** The padding left of the element. */\n paddingLeft?: \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\";\n /** The padding right of the element. */\n paddingRight?: \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\";\n}\n\ntype FlexSize = \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\";\n\nconst sizeVariable = (size: FlexSize | undefined) =>\n size && `var(--size-px--${size})`;\n\n/** @flr-generate all */\nexport const Flex: FC<FlexProps> = (props) => {\n const {\n children,\n className,\n direction = \"row\",\n align,\n justify,\n gap,\n columnGap,\n rowGap,\n grow,\n wrap = \"nowrap\",\n padding,\n paddingBlock,\n paddingInline,\n paddingTop,\n paddingBottom,\n paddingLeft,\n paddingRight,\n elementType = \"div\",\n ...restProps\n } = props;\n\n const columnGapSize = columnGap ?? gap;\n const rowGapSize = rowGap ?? gap;\n const paddingTopSize = paddingTop ?? paddingBlock ?? padding;\n const paddingBottomSize = paddingBottom ?? paddingBlock ?? padding;\n const paddingLeftSize = paddingLeft ?? paddingInline ?? padding;\n const paddingRightSize = paddingRight ?? paddingInline ?? padding;\n\n const rootClassName = clsx(\n styles.flex,\n align && styles.align,\n justify && styles.justify,\n grow && styles.grow,\n columnGapSize && styles[\"column-gap\"],\n rowGapSize && styles[\"row-gap\"],\n paddingTopSize && styles[\"padding-top\"],\n paddingBottomSize && styles[\"padding-bottom\"],\n paddingLeftSize && styles[\"padding-left\"],\n paddingRightSize && styles[\"padding-right\"],\n className,\n );\n\n const style: CSSProperties = {\n \"--flex--direction\": direction,\n \"--flex--wrap\": wrap,\n \"--flex--align\":\n align === \"end\" ? \"flex-end\" : align === \"start\" ? \"flex-start\" : align,\n \"--flex--justify\": justify,\n \"--flex--column-gap\": sizeVariable(columnGapSize),\n \"--flex--row-gap\": sizeVariable(rowGapSize),\n \"--flex--padding-top\": sizeVariable(paddingTopSize),\n \"--flex--padding-bottom\": sizeVariable(paddingBottomSize),\n \"--flex--padding-left\": sizeVariable(paddingLeftSize),\n \"--flex--padding-right\": sizeVariable(paddingRightSize),\n };\n\n const Element = elementType;\n\n return (\n <Element {...restProps} className={rootClassName} style={style}>\n {children}\n </Element>\n );\n};\nexport default Flex;\n"],"mappings":";;;;;;AA2DA,IAAM,gBAAgB,SACpB,QAAQ,kBAAkB,KAAK;;AAGjC,IAAa,QAAuB,UAAU;CAC5C,MAAM,EACJ,UACA,WACA,YAAY,OACZ,OACA,SACA,KACA,WACA,QACA,MACA,OAAO,UACP,SACA,cACA,eACA,YACA,eACA,aACA,cACA,cAAc,OACd,GAAG,cACD;CAEJ,MAAM,gBAAgB,aAAa;CACnC,MAAM,aAAa,UAAU;CAC7B,MAAM,iBAAiB,cAAc,gBAAgB;CACrD,MAAM,oBAAoB,iBAAiB,gBAAgB;CAC3D,MAAM,kBAAkB,eAAe,iBAAiB;CACxD,MAAM,mBAAmB,gBAAgB,iBAAiB;CAE1D,MAAM,gBAAgB,KACpB,oBAAO,MACP,SAAS,oBAAO,OAChB,WAAW,oBAAO,SAClB,QAAQ,oBAAO,MACf,iBAAiB,oBAAO,eACxB,cAAc,oBAAO,YACrB,kBAAkB,oBAAO,gBACzB,qBAAqB,oBAAO,mBAC5B,mBAAmB,oBAAO,iBAC1B,oBAAoB,oBAAO,kBAC3B,SACF;CAEA,MAAM,QAAuB;EAC3B,qBAAqB;EACrB,gBAAgB;EAChB,iBACE,UAAU,QAAQ,aAAa,UAAU,UAAU,eAAe;EACpE,mBAAmB;EACnB,sBAAsB,aAAa,aAAa;EAChD,mBAAmB,aAAa,UAAU;EAC1C,uBAAuB,aAAa,cAAc;EAClD,0BAA0B,aAAa,iBAAiB;EACxD,wBAAwB,aAAa,eAAe;EACpD,yBAAyB,aAAa,gBAAgB;CACxD;CAIA,OACE,oBAAC,aAAD;EAAS,GAAI;EAAW,WAAW;EAAsB;EACtD;CACM,CAAA;AAEb"}
|
|
@@ -19,6 +19,10 @@ export interface FlexProps extends PropsWithChildren, PropsWithClassName, PropsW
|
|
|
19
19
|
wrap?: CSSProperties["flexWrap"];
|
|
20
20
|
/** The padding of the element. */
|
|
21
21
|
padding?: "xs" | "s" | "m" | "l" | "xl";
|
|
22
|
+
/** The padding top and bottom of the element. Takes precedence over `padding`. */
|
|
23
|
+
paddingBlock?: "xs" | "s" | "m" | "l" | "xl";
|
|
24
|
+
/** The padding left and right of the element. Takes precedence over `padding`. */
|
|
25
|
+
paddingInline?: "xs" | "s" | "m" | "l" | "xl";
|
|
22
26
|
/** The padding top of the element. */
|
|
23
27
|
paddingTop?: "xs" | "s" | "m" | "l" | "xl";
|
|
24
28
|
/** The padding bottom of the element. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/flow-react-components",
|
|
3
|
-
"version": "1.5.0-next.
|
|
3
|
+
"version": "1.5.0-next.5",
|
|
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.5.0-next.
|
|
86
|
+
"@mittwald/flow-icons": "^1.5.0-next.5",
|
|
87
87
|
"@mittwald/password-tools-js": "^3.0.0",
|
|
88
|
-
"@mittwald/react-tunnel": "^1.5.0-next.
|
|
88
|
+
"@mittwald/react-tunnel": "^1.5.0-next.5",
|
|
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.5.0-next.
|
|
142
|
-
"@mittwald/flow-design-tokens": "1.5.0-next.
|
|
143
|
-
"@mittwald/flow-icons-base": "1.5.0-next.
|
|
141
|
+
"@mittwald/flow-core": "1.5.0-next.5",
|
|
142
|
+
"@mittwald/flow-design-tokens": "1.5.0-next.5",
|
|
143
|
+
"@mittwald/flow-icons-base": "1.5.0-next.5",
|
|
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.5.0-next.
|
|
146
|
+
"@mittwald/typescript-config": "1.5.0-next.5",
|
|
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.5.0-next.
|
|
198
|
+
"@mittwald/flow-icons-pro": "1.5.0-next.5",
|
|
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": "
|
|
222
|
+
"gitHead": "e9daa8bfb8f8c3b89bd9001696b970bb48067ead"
|
|
223
223
|
}
|