@mittwald/flow-react-components 1.5.0-next.0 → 1.5.0-next.1
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/css/all-layered.css +1 -1
- package/dist/css/all.css +1 -1
- package/dist/js/packages/components/src/components/Flex/Flex.mjs +21 -14
- package/dist/js/packages/components/src/components/Flex/Flex.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Flex/Flex.module.mjs +16 -2
- package/dist/js/packages/components/src/components/Flex/Flex.module.mjs.map +1 -1
- package/package.json +9 -9
|
@@ -4,26 +4,33 @@ import Flex_module_default from "./Flex.module.mjs";
|
|
|
4
4
|
import clsx from "clsx";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/Flex/Flex.tsx
|
|
7
|
+
var sizeVariable = (size) => size && `var(--size-px--${size})`;
|
|
7
8
|
/** @flr-generate all */
|
|
8
9
|
var Flex = (props) => {
|
|
9
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
|
|
11
|
+
const columnGapSize = columnGap ?? gap;
|
|
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;
|
|
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
|
+
const style = {
|
|
19
|
+
"--flex--direction": direction,
|
|
20
|
+
"--flex--wrap": wrap,
|
|
21
|
+
"--flex--align": align === "end" ? "flex-end" : align === "start" ? "flex-start" : align,
|
|
22
|
+
"--flex--justify": justify,
|
|
23
|
+
"--flex--column-gap": sizeVariable(columnGapSize),
|
|
24
|
+
"--flex--row-gap": sizeVariable(rowGapSize),
|
|
25
|
+
"--flex--padding-top": sizeVariable(paddingTopSize),
|
|
26
|
+
"--flex--padding-bottom": sizeVariable(paddingBottomSize),
|
|
27
|
+
"--flex--padding-left": sizeVariable(paddingLeftSize),
|
|
28
|
+
"--flex--padding-right": sizeVariable(paddingRightSize)
|
|
29
|
+
};
|
|
11
30
|
return /* @__PURE__ */ jsx(elementType, {
|
|
12
31
|
...restProps,
|
|
13
32
|
className: rootClassName,
|
|
14
|
-
style
|
|
15
|
-
flexDirection: direction,
|
|
16
|
-
alignItems: align === "end" ? "flex-end" : align === "start" ? "flex-start" : align,
|
|
17
|
-
justifyContent: justify,
|
|
18
|
-
columnGap: columnGap ? `var(--size-px--${columnGap})` : gap ? `var(--size-px--${gap})` : void 0,
|
|
19
|
-
rowGap: rowGap ? `var(--size-px--${rowGap})` : gap ? `var(--size-px--${gap})` : void 0,
|
|
20
|
-
flexGrow: grow ? 1 : void 0,
|
|
21
|
-
flexWrap: wrap,
|
|
22
|
-
paddingTop: paddingTop ? `var(--size-px--${paddingTop})` : padding ? `var(--size-px--${padding})` : void 0,
|
|
23
|
-
paddingBottom: paddingBottom ? `var(--size-px--${paddingBottom})` : padding ? `var(--size-px--${padding})` : void 0,
|
|
24
|
-
paddingLeft: paddingLeft ? `var(--size-px--${paddingLeft})` : padding ? `var(--size-px--${padding})` : void 0,
|
|
25
|
-
paddingRight: paddingRight ? `var(--size-px--${paddingRight})` : padding ? `var(--size-px--${padding})` : void 0
|
|
26
|
-
},
|
|
33
|
+
style,
|
|
27
34
|
children
|
|
28
35
|
});
|
|
29
36
|
};
|
|
@@ -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\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
|
|
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":";;;;;;AAuDA,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,YACA,eACA,aACA,cACA,cAAc,OACd,GAAG,cACD;CAEJ,MAAM,gBAAgB,aAAa;CACnC,MAAM,aAAa,UAAU;CAC7B,MAAM,iBAAiB,cAAc;CACrC,MAAM,oBAAoB,iBAAiB;CAC3C,MAAM,kBAAkB,eAAe;CACvC,MAAM,mBAAmB,gBAAgB;CAEzC,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"}
|
|
@@ -2,8 +2,22 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
//#region src/components/Flex/Flex.module.scss
|
|
4
4
|
var flex = "flow--flex";
|
|
5
|
-
var
|
|
5
|
+
var align = "flow--flex--align";
|
|
6
|
+
var justify = "flow--flex--justify";
|
|
7
|
+
var grow = "flow--flex--grow";
|
|
8
|
+
var Flex_module_default = {
|
|
9
|
+
flex,
|
|
10
|
+
align,
|
|
11
|
+
justify,
|
|
12
|
+
grow,
|
|
13
|
+
"column-gap": "flow--flex--column-gap",
|
|
14
|
+
"row-gap": "flow--flex--row-gap",
|
|
15
|
+
"padding-top": "flow--flex--padding-top",
|
|
16
|
+
"padding-bottom": "flow--flex--padding-bottom",
|
|
17
|
+
"padding-left": "flow--flex--padding-left",
|
|
18
|
+
"padding-right": "flow--flex--padding-right"
|
|
19
|
+
};
|
|
6
20
|
//#endregion
|
|
7
|
-
export { Flex_module_default as default, flex };
|
|
21
|
+
export { align, Flex_module_default as default, flex, grow, justify };
|
|
8
22
|
|
|
9
23
|
//# sourceMappingURL=Flex.module.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flex.module.mjs","names":[],"sources":["../../../../../../../src/components/Flex/Flex.module.scss"],"sourcesContent":[".flex {\n display: flex;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Flex.module.mjs","names":[],"sources":["../../../../../../../src/components/Flex/Flex.module.scss"],"sourcesContent":["/* The props arrive as custom properties, so a consumer's `className` – a\n media query included – can override them. A property whose prop is unset is\n left alone entirely, instead of competing with the consumer's CSS. */\n.flex {\n display: flex;\n flex-flow: var(--flex--direction) var(--flex--wrap);\n}\n\n.align {\n align-items: var(--flex--align);\n}\n\n.justify {\n justify-content: var(--flex--justify);\n}\n\n.grow {\n flex-grow: 1;\n}\n\n/* Spacing */\n.column-gap {\n column-gap: var(--flex--column-gap);\n}\n\n.row-gap {\n row-gap: var(--flex--row-gap);\n}\n\n.padding-top {\n padding-top: var(--flex--padding-top);\n}\n\n.padding-bottom {\n padding-bottom: var(--flex--padding-bottom);\n}\n\n/* The props are named physically, so they stay physical under `direction: rtl`. */\n.padding-left {\n // stylelint-disable-next-line logical-css/require-logical-properties -- `paddingLeft` prop\n padding-left: var(--flex--padding-left);\n}\n\n.padding-right {\n // stylelint-disable-next-line logical-css/require-logical-properties -- `paddingRight` prop\n padding-right: var(--flex--padding-right);\n}\n"],"mappings":""}
|
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.1",
|
|
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.1",
|
|
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.1",
|
|
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.1",
|
|
142
|
+
"@mittwald/flow-design-tokens": "1.5.0-next.1",
|
|
143
|
+
"@mittwald/flow-icons-base": "1.5.0-next.1",
|
|
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.1",
|
|
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.1",
|
|
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": "960225094d5ee4e519ccdd7020d4dd138fa3bceb"
|
|
223
223
|
}
|