@dash-ui/layout
Version:
A framework-agnostic layout library written in Dash
1 lines • 45.4 kB
Source Map (JSON)
{"version":3,"file":"index.mjs","sources":["../../src/index.ts"],"sourcesContent":["import compound from \"@dash-ui/compound\";\nimport type { ResponsiveStyles } from \"@dash-ui/responsive\";\nimport responsive from \"@dash-ui/responsive\";\nimport type {\n DashThemes,\n DashTokens,\n StyleObject,\n Styles,\n} from \"@dash-ui/styles\";\n\n/**\n * Creates new layout style utilities using an existing Dash `styles` instance.\n *\n * @param styles - An `styles` instance from `@dash-ui/styles`\n * @param mediaQueries - The media queries to use for responsive styles\n */\nfunction layout<\n Tokens extends\n | DashTokens\n | {\n gap: any;\n pad: any;\n borderWidth: any;\n shadow: any;\n radius: any;\n color: any;\n zIndex: any;\n },\n Themes extends DashThemes,\n MQ extends Record<string, string>\n>(styles: Styles<Tokens, Themes>, mediaQueries?: MQ) {\n const compoundStyles = compound(styles);\n const responsiveStyles: ResponsiveStyles<Tokens, Themes, MQ> = responsive(\n styles,\n mediaQueries || {}\n );\n\n const box = compoundStyles(\n {\n /**\n * Sets a `display` CSS property on your component\n */\n display: responsiveStyles.variants({\n flex: { display: \"flex\" },\n inlineFlex: { display: \"inline-flex\" },\n grid: { display: \"grid\" },\n inlineGrid: { display: \"inlineGrid\" },\n block: { display: \"block\" },\n inlineBlock: { display: \"inline-block\" },\n inline: { display: \"inline\" },\n table: { display: \"table\" },\n tableCell: { display: \"table-cell\" },\n tableRowGroup: { display: \"table-row-group\" },\n tableRow: { display: \"table-row\" },\n tableColumn: { display: \"table-column\" },\n tableColumnGroup: { display: \"table-column-group\" },\n tableHeader: { display: \"table-header\" },\n tableHeaderGroup: { display: \"table-header-group\" },\n tableFooterGroup: { display: \"table-footer-group\" },\n listItem: { display: \"list-item\" },\n contents: { display: \"contents\" },\n runIn: { display: \"run-in\" },\n none: { display: \"none\" },\n inherit: { display: \"inherit\" },\n initial: { display: \"initial\" },\n unset: { display: \"unset\" },\n revert: { display: \"revert\" },\n }),\n /**\n * Sets a `position` CSS property on your component\n */\n position: responsiveStyles.variants({\n absolute: { position: \"absolute\" },\n relative: { position: \"relative\" },\n fixed: { position: \"fixed\" },\n sticky: { position: \"sticky\" },\n static: { position: \"static\" },\n inherit: { position: \"inherit\" },\n initial: { position: \"initial\" },\n unset: { position: \"unset\" },\n revert: { position: \"revert\" },\n }),\n /**\n * Sets a `width` CSS property on your component\n */\n width: responsiveStyles.lazy((width: number | string) => ({ width })),\n /**\n * Sets a `height` CSS property on your component\n */\n height: responsiveStyles.lazy((height: number | string) => ({ height })),\n /**\n * Sets a `max-width` CSS property on your component\n */\n maxWidth: responsiveStyles.lazy((maxWidth: number | string) => ({\n maxWidth,\n })),\n /**\n * Sets a `max-height` CSS property on your component\n */\n maxHeight: responsiveStyles.lazy((maxHeight: number | string) => ({\n maxHeight,\n })),\n /**\n * Sets a `max-width` CSS property on your component\n */\n minWidth: responsiveStyles.lazy((minWidth: number | string) => ({\n minWidth,\n })),\n /**\n * Sets a `max-height` CSS property on your component\n */\n minHeight: responsiveStyles.lazy((minHeight: number | string) => ({\n minHeight,\n })),\n /**\n * Sets a `width` and `height` CSS property on your component\n */\n size: responsiveStyles.lazy((size: number | string) => ({\n width: size,\n height: size,\n })),\n /**\n * Sets a `padding` CSS property on your component using the \"pad\"\n * token in your theme\n */\n pad: responsiveStyles.lazy(\n (\n value:\n | Extract<keyof Tokens[\"pad\"], string | number>\n | Extract<keyof Tokens[\"pad\"], string | number>[]\n ) =>\n ({ pad }): StyleObject => ({\n padding: Array.isArray(value)\n ? value.map((k) => pad[k]).join(\" \")\n : pad[value],\n })\n ),\n /**\n * Sets a `background-color` CSS property on your component using the \"color\"\n * token in your theme\n */\n bg: responsiveStyles.variants(\n reduce(\n styles.tokens.color as Record<\n Extract<keyof Tokens[\"color\"], string | number>,\n string | number\n >,\n (\n acc: Record<\n Extract<keyof Tokens[\"color\"], string | number> | \"default\",\n StyleObject\n >,\n key\n ) => {\n acc[key] = {\n backgroundColor: styles.tokens.color[key],\n };\n\n return acc;\n },\n {}\n )\n ),\n /**\n * Sets a `border-color` CSS property on your component using the \"color\"\n * token in your theme and a `border-width` property using the \"borderWidth\"\n * token.\n */\n border: responsiveStyles.lazy(\n ([width, borderColor]: [\n (\n | Extract<keyof Tokens[\"borderWidth\"], string | number>\n | Extract<keyof Tokens[\"borderWidth\"], string | number>[]\n ),\n Extract<keyof Tokens[\"color\"], string | number>\n ]) =>\n ({ borderWidth, color }): StyleObject => ({\n borderWidth: Array.isArray(width)\n ? width.map((w) => borderWidth[w]).join(\" \")\n : borderWidth[width],\n borderStyle: \"solid\",\n borderColor: color[borderColor],\n })\n ),\n /**\n * Sets a `box-shadow` CSS property on your component using the \"shadow\"\n * token in your theme\n */\n shadow: responsiveStyles.variants(\n reduce(\n styles.tokens.shadow as Record<\n Extract<keyof Tokens[\"shadow\"], string | number>,\n string\n >,\n (\n acc: Record<\n Extract<keyof Tokens[\"shadow\"], string | number> | \"default\",\n StyleObject\n >,\n key\n ) => {\n acc[key] = {\n boxShadow: styles.tokens.shadow[key],\n };\n\n return acc;\n },\n {}\n )\n ),\n /**\n * Sets a `border-radius` CSS property on your component using the \"radius\"\n * token in your theme\n */\n radius: responsiveStyles.lazy(\n (\n value:\n | Extract<keyof Tokens[\"radius\"], string | number>\n | Extract<keyof Tokens[\"radius\"], string | number>[]\n ) =>\n ({ radius }): StyleObject => ({\n borderRadius: Array.isArray(value)\n ? value.map((k) => radius[k]).join(\" \")\n : radius[value],\n })\n ),\n /**\n * Sets the top, right, bottom, left position of the element\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/inset\n */\n inset: responsiveStyles.lazy(\n (value: string | number | (string | number)[]) => {\n if (Array.isArray(value)) {\n return {\n \"@supports (inset: 10px)\": {\n inset: value.map(unit).join(\" \"),\n },\n \"@supports not (inset: 10px)\": {\n top: value[0],\n right: value[1] ?? value[0],\n bottom: value[2] ?? value[0],\n left: value[3] ?? value[1] ?? value[0],\n },\n };\n }\n\n return {\n \"@supports (inset: 10px)\": {\n inset: value,\n },\n \"@supports not (inset: 10px)\": {\n top: value,\n right: value,\n bottom: value,\n left: value,\n },\n };\n }\n ),\n /**\n * Sets a `z-index` CSS property on your component\n */\n z: responsiveStyles.variants(\n reduce(\n styles.tokens.zIndex as Record<\n Extract<keyof Tokens[\"zIndex\"], string | number>,\n string | number\n >,\n (\n acc: Record<\n Extract<keyof Tokens[\"zIndex\"], string | number> | \"default\",\n StyleObject\n >,\n key\n ) => {\n acc[key] = {\n zIndex: styles.tokens.zIndex[key],\n };\n\n return acc;\n },\n {}\n )\n ),\n } as const,\n { atomic: true }\n );\n\n const alignItems = responsiveStyles.variants({\n start: {\n \"@supports (align-items: start)\": {\n alignItems: \"start\",\n },\n \"@supports not (align-items: start)\": {\n alignItems: \"flex-start\",\n },\n },\n end: {\n \"@supports (align-items: end)\": {\n alignItems: \"end\",\n },\n \"@supports not (align-items: end)\": {\n alignItems: \"flex-end\",\n },\n },\n center: { alignItems: \"center\" },\n baseline: { alignItems: \"baseline\" },\n stretch: { alignItems: \"stretch\" },\n normal: { alignItems: \"normal\" },\n inherit: { alignItems: \"inherit\" },\n initial: { alignItems: \"initial\" },\n unset: { alignItems: \"unset\" },\n revert: { alignItems: \"revert\" },\n } as const);\n\n const justifyItems = responsiveStyles.variants({\n start: {\n \"@supports (justify-items: start)\": {\n justifyItems: \"start\",\n },\n \"@supports not (justify-items: start)\": {\n justifyItems: \"flex-start\",\n },\n },\n end: {\n \"@supports (justify-items: end)\": {\n justifyItems: \"end\",\n },\n \"@supports not (justify-items: end)\": {\n justifyItems: \"flex-end\",\n },\n },\n center: { justifyItems: \"center\" },\n baseline: { justifyItems: \"baseline\" },\n stretch: { justifyItems: \"stretch\" },\n normal: { justifyItems: \"normal\" },\n inherit: { justifyItems: \"inherit\" },\n initial: { justifyItems: \"initial\" },\n unset: { justifyItems: \"unset\" },\n revert: { justifyItems: \"revert\" },\n } as const);\n\n const justifyContent = responsiveStyles.variants({\n start: {\n \"@supports (justify-content: start)\": {\n justifyContent: \"start\",\n },\n \"@supports not (justify-content: start)\": {\n justifyContent: \"flex-start\",\n },\n },\n end: {\n \"@supports (justify-content: end)\": {\n justifyContent: \"end\",\n },\n \"@supports not (justify-content: end)\": {\n justifyContent: \"flex-end\",\n },\n },\n center: { justifyContent: \"center\" },\n around: { justifyContent: \"space-around\" },\n between: { justifyContent: \"space-between\" },\n evenly: { justifyContent: \"space-evenly\" },\n baseline: { justifyContent: \"baseline\" },\n stretch: { justifyContent: \"stretch\" },\n normal: { justifyContent: \"normal\" },\n inherit: { justifyContent: \"inherit\" },\n initial: { justifyContent: \"initial\" },\n unset: { justifyContent: \"unset\" },\n revert: { justifyContent: \"revert\" },\n } as const);\n\n const alignContent = responsiveStyles.variants({\n start: {\n \"@supports (align-content: start)\": {\n alignContent: \"start\",\n },\n \"@supports not (align-content: start)\": {\n alignContent: \"flex-start\",\n },\n },\n end: {\n \"@supports (align-content: end)\": {\n alignContent: \"end\",\n },\n \"@supports not (align-content: end)\": {\n alignContent: \"flex-end\",\n },\n },\n center: { alignContent: \"center\" },\n around: { alignContent: \"space-around\" },\n between: { alignContent: \"space-between\" },\n evenly: { alignContent: \"space-evenly\" },\n baseline: { alignContent: \"baseline\" },\n stretch: { alignContent: \"stretch\" },\n normal: { alignContent: \"normal\" },\n inherit: { alignContent: \"inherit\" },\n initial: { alignContent: \"initial\" },\n unset: { alignContent: \"unset\" },\n revert: { alignContent: \"revert\" },\n } as const);\n\n const alignSelf = responsiveStyles.variants({\n start: {\n \"@supports (align-self: start)\": {\n alignSelf: \"start\",\n },\n \"@supports not (align-self: start)\": {\n alignSelf: \"flex-start\",\n },\n },\n end: {\n \"@supports (align-self: end)\": {\n alignSelf: \"end\",\n },\n \"@supports not (align-self: end)\": {\n alignSelf: \"flex-end\",\n },\n },\n center: { alignSelf: \"center\" },\n baseline: { alignSelf: \"baseline\" },\n stretch: { alignSelf: \"stretch\" },\n auto: { alignSelf: \"auto\" },\n normal: { alignSelf: \"normal\" },\n inherit: { alignSelf: \"inherit\" },\n initial: { alignSelf: \"initial\" },\n unset: { alignSelf: \"unset\" },\n revert: { alignSelf: \"revert\" },\n } as const);\n\n const justifySelf = responsiveStyles.variants({\n start: {\n \"@supports (justify-self: start)\": {\n justifySelf: \"start\",\n },\n \"@supports not (justify-self: start)\": {\n justifySelf: \"flex-start\",\n },\n },\n end: {\n \"@supports (justify-self: end)\": {\n justifySelf: \"end\",\n },\n \"@supports not (justify-self: end)\": {\n justifySelf: \"flex-end\",\n },\n },\n center: { justifySelf: \"center\" },\n around: { justifySelf: \"space-around\" },\n between: { justifySelf: \"space-between\" },\n evenly: { justifySelf: \"space-evenly\" },\n baseline: { justifySelf: \"baseline\" },\n stretch: { justifySelf: \"stretch\" },\n auto: { justifySelf: \"auto\" },\n normal: { justifySelf: \"normal\" },\n inherit: { justifySelf: \"inherit\" },\n initial: { justifySelf: \"initial\" },\n unset: { justifySelf: \"unset\" },\n revert: { justifySelf: \"revert\" },\n } as const);\n\n const flexItem = compoundStyles(\n {\n /**\n * Sets a `align-self` CSS property on your component\n */\n align: alignSelf,\n /**\n * Sets a `justify-self` CSS property on your component\n */\n basis: responsiveStyles.lazy((value: string | number) => ({\n flexBasis: value,\n })),\n /**\n * Sets a `justify-self` CSS property on your component\n */\n distribute: justifySelf,\n /**\n * Sets a `flex-grow` CSS property on your component\n */\n grow: responsiveStyles.lazy((value: number | boolean) => ({\n flexGrow: Number(value),\n })),\n /**\n * Sets a `order` CSS property on your component\n */\n order: responsiveStyles.lazy((value: number) => ({ order: value })),\n /**\n * Sets a `flex-shrink` CSS property on your component\n */\n shrink: responsiveStyles.lazy((value: number | boolean) => ({\n flexShrink: Number(value),\n })),\n ...box.styles,\n },\n { atomic: true }\n );\n\n const inline = compoundStyles(\n {\n default: responsiveStyles.one({\n display: \"flex\",\n flexWrap: \"wrap\",\n justifyContent: \"flex-start\",\n \"& > *\": {\n flexShrink: 0,\n },\n }),\n /**\n * Sets a vertical and horizontal gap between the child elements in the\n * inline using the \"gap\" token in your theme\n */\n gap: responsiveStyles.variants(\n reduce(\n styles.tokens.gap as Record<\n Extract<keyof Tokens[\"gap\"], string | number>,\n string | number\n >,\n (\n acc: Record<\n Extract<keyof Tokens[\"gap\"], string | number> | \"default\",\n StyleObject\n >,\n value\n ) => {\n const gap = styles.tokens.gap;\n\n acc[value] = {\n \"@supports (display: flex) and (gap: 1em)\": {\n gap: gap[value],\n },\n \"@supports not (display: flex) and (gap: 1em)\": {\n marginTop: `calc(-1 * ${gap[value]})!important`,\n marginLeft: `calc(-1 * ${gap[value]})!important`,\n \"& > *\": {\n marginTop: `${gap[value]}!important`,\n marginLeft: `${gap[value]}!important`,\n },\n },\n };\n\n return acc;\n },\n {}\n )\n ),\n /**\n * Distributed alignment properties on the x-axis using `justify-content`\n */\n distribute: justifyContent,\n /**\n * Positional alignment for its child items on the y-axis using `align-items`\n */\n align: alignItems,\n ...box.styles,\n } as const,\n { atomic: true }\n );\n\n const sharedGrid = compoundStyles(\n {\n default: responsiveStyles.one({ display: \"grid\" }),\n /**\n * Makes the component display as an `inline-grid` rather than `grid`\n */\n inline: responsiveStyles.one({ display: \"inline-grid\" }),\n /**\n * Sets a `justify-items` CSS property on your component\n */\n alignX: justifyItems,\n /**\n * Sets an `align-items` CSS property on your component\n */\n alignY: alignItems,\n /**\n * Sets a `justify-content` CSS property on your component\n */\n distributeX: justifyContent,\n /**\n * Sets an `align-content` CSS property on your component\n */\n distributeY: alignContent,\n /**\n * Sets a horizontal and vertical gap between the child elements in the row\n * using the \"gap\" token in your theme\n */\n gap: responsiveStyles.lazy(\n (\n value:\n | Extract<keyof Tokens[\"gap\"], number | string>\n | [\n Extract<keyof Tokens[\"gap\"], number | string>,\n Extract<keyof Tokens[\"gap\"], number | string>\n ]\n ) =>\n ({ gap }): StyleObject => ({\n gridGap: Array.isArray(value)\n ? value.map((p) => gap[p]).join(\" \")\n : gap[value] + \" \" + gap[value],\n gap: Array.isArray(value)\n ? value.map((p) => gap[p]).join(\" \")\n : gap[value] + \" \" + gap[value],\n })\n ),\n /**\n * Sets a `grid-template-rows` CSS property on your component\n */\n rows: responsiveStyles.lazy(\n (value: number | (number | string)[]): StyleObject => {\n let rows: (number | string)[];\n if (Array.isArray(value)) rows = value;\n // ie doesn't have repeat\n else rows = [`repeat(${value},minmax(0,1fr))`];\n return { gridTemplateRows: rows.map((row) => unit(row)).join(\" \") };\n }\n ),\n },\n { atomic: true }\n );\n\n const grid = compoundStyles(\n {\n /**\n * Sets a `grid-template-columns` CSS property on your component\n */\n cols: responsiveStyles.lazy((value: number | (number | string)[]) => {\n let columns: (number | string)[];\n if (Array.isArray(value)) columns = value;\n // ie doesn't have repeat\n else columns = [`repeat(${value},minmax(0,1fr))`];\n return {\n gridTemplateColumns: columns.map((col) => unit(col)).join(\" \"),\n };\n }),\n ...sharedGrid.styles,\n ...box.styles,\n } as const,\n { atomic: true }\n );\n\n const gridItem = compoundStyles(\n {\n /**\n * Sets a `justify-self` CSS property on your component\n */\n distribute: justifySelf,\n /**\n * Sets an `align-self` CSS property on your component\n */\n align: alignSelf,\n /**\n * Sets a `grid-column-start` CSS property on your component\n */\n colStart: responsiveStyles.lazy((gridColumnStart: number | string) => ({\n gridColumnStart,\n })),\n /**\n * Sets a `grid-column-end` CSS property on your component\n */\n colEnd: responsiveStyles.lazy((gridColumnEnd: number | string) => ({\n gridColumnEnd,\n })),\n /**\n * Sets a `grid-row-start` CSS property on your component\n */\n rowStart: responsiveStyles.lazy((gridRowStart: number | string) => ({\n gridRowStart,\n })),\n /**\n * Sets a `grid-row-end` CSS property on your component\n */\n rowEnd: responsiveStyles.lazy((gridRowEnd: number | string) => ({\n gridRowEnd,\n })),\n ...box.styles,\n } as const,\n { atomic: true }\n );\n\n const autoGrid = compoundStyles(\n {\n /**\n * The minimum width of a grid item\n */\n itemWidth: responsiveStyles.lazy((itemWidth: number | string) => ({\n gridTemplateColumns: `repeat(auto-fit, minmax(${unit(\n itemWidth\n )}, 1fr))`,\n })),\n ...sharedGrid.styles,\n } as const,\n { atomic: true }\n );\n\n const hstack = compoundStyles(\n {\n default: responsiveStyles.one({\n display: \"flex\",\n flexDirection: \"row\",\n \"& > *\": {\n flexShrink: 0,\n },\n }),\n /**\n * Reverses the order of the child elements\n */\n reversed: responsiveStyles.one({\n flexDirection: \"row-reverse\",\n }),\n /**\n * Sets a horizontal gap between the child elements in the hstack using the \"gap\"\n * token in your theme\n */\n gap: responsiveStyles.variants(\n reduce(\n styles.tokens.gap as Record<\n Extract<keyof Tokens[\"gap\"], string | number>,\n string | number\n >,\n (\n acc: Record<\n Extract<keyof Tokens[\"gap\"], string | number> | \"default\",\n StyleObject\n >,\n value\n ) => {\n const gap = styles.tokens.gap;\n const margin = {\n \"& > * + *\": {\n marginLeft: `${gap[value]}!important`,\n },\n };\n acc[value] = (\"\" + value).startsWith(\"-\")\n ? margin\n : {\n \"@supports (display: flex) and (gap: 1em)\": {\n gap: gap[value],\n },\n \"@supports not (display: flex) and (gap: 1em)\": margin,\n };\n\n return acc;\n },\n {}\n )\n ),\n /**\n * Distributed alignment properties on the y-axis using `justify-content`\n */\n distribute: justifyContent,\n /**\n * Positional alignment for its child items on the x-axis using `align-items`\n */\n align: alignItems,\n ...box.styles,\n } as const,\n { atomic: true }\n );\n\n const vstack = compoundStyles(\n {\n default: responsiveStyles.one({\n display: \"flex\",\n flexDirection: \"column\",\n \"& > *\": {\n flexShrink: 0,\n },\n }),\n /**\n * Reverses the order of the child elements\n */\n reversed: responsiveStyles.one({\n flexDirection: \"column-reverse\",\n }),\n /**\n * Sets a vertical gap between the child elements in the vstack using the \"gap\"\n * token in your theme\n */\n gap: responsiveStyles.variants(\n reduce(\n styles.tokens.gap as Record<\n Extract<keyof Tokens[\"gap\"], string | number>,\n string | number\n >,\n (\n acc: Record<\n Extract<keyof Tokens[\"gap\"], string | number> | \"default\",\n StyleObject\n >,\n value\n ) => {\n const gap = styles.tokens.gap;\n const margin = {\n \"& > * + *\": {\n marginTop: `${gap[value]}!important`,\n },\n };\n\n acc[value] = (value + \"\").startsWith(\"-\")\n ? margin\n : {\n \"@supports (display: flex) and (gap: 1em)\": {\n gap: gap[value],\n },\n \"@supports not (display: flex) and (gap: 1em)\": margin,\n };\n\n return acc;\n },\n {}\n )\n ),\n /**\n * Distributed alignment properties on the y-axis using `justify-content`\n */\n distribute: justifyContent,\n /**\n * Positional alignment for its child items on the y-axis using `align-items`\n */\n align: alignItems,\n ...box.styles,\n } as const,\n { atomic: true }\n );\n\n const zstack = compoundStyles(\n {\n default: responsiveStyles.one({\n display: \"grid\",\n \"> *\": {\n gridArea: \"1/1/1/1\",\n },\n }),\n inline: grid.styles.inline,\n alignX: justifyItems,\n alignY: alignItems,\n distributeX: justifyContent,\n distributeY: alignContent,\n center: responsiveStyles.one({\n alignItems: \"center\",\n justifyItems: \"center\",\n }),\n ...box.styles,\n } as const,\n { atomic: true }\n );\n\n const overlay = compoundStyles(\n {\n default: responsiveStyles.one({ position: \"absolute\" }),\n /**\n * Sets a `margin` between the edges of the overlay item's container\n */\n offset: responsiveStyles.lazy((margin: number | string) => ({ margin })),\n /**\n * Sets the placement of your overlay item relative to its container\n */\n placement: responsiveStyles.variants({\n top: { top: 0, left: \"50%\", transform: \"translateX(-50%)\" },\n right: { right: 0, top: \"50%\", transform: \"translateY(-50%)\" },\n bottom: { bottom: 0, left: \"50%\", transform: \"translateX(-50%)\" },\n left: { left: 0, top: \"50%\", transform: \"translateY(-50%)\" },\n center: {\n top: \"50%\",\n left: \"50%\",\n transform: \"translate(-50%, -50%)\",\n },\n topRight: { top: 0, right: 0 },\n topLeft: { top: 0, left: 0 },\n bottomRight: { bottom: 0, right: 0 },\n bottomLeft: { bottom: 0, left: 0 },\n }),\n ...box.styles,\n } as const,\n { atomic: true }\n );\n\n const bleed = compoundStyles(\n {\n /**\n * Sets a negative margin on itself using the \"pad\" token in your theme\n */\n amount: responsiveStyles.lazy(\n (\n value:\n | Extract<keyof Tokens[\"pad\"], string | number>\n | Extract<keyof Tokens[\"pad\"], string | number>[]\n ) =>\n ({ pad }): StyleObject => ({\n margin: Array.isArray(value)\n ? value\n .map((k) =>\n String(k).startsWith(\"-\")\n ? `${pad[k]}`\n : `calc(-1 * ${pad[k]})`\n )\n .join(\" \") + \"!important\"\n : String(value).startsWith(\"-\")\n ? `${pad[value]}!important`\n : `calc(-1 * ${pad[value]})!important`,\n })\n ),\n ...box.styles,\n } as const,\n { atomic: true }\n );\n\n return {\n /**\n * Sets a `align-items` CSS property on your component\n */\n alignItems,\n /**\n * Sets a `justify-items` CSS property on your component\n */\n justifyItems,\n /**\n * Sets a `justify-content` CSS property on your component\n */\n justifyContent,\n /**\n * Sets a `align-content` CSS property on your component\n */\n alignContent,\n /**\n * Sets a `align-self` CSS property on your component\n */\n alignSelf,\n /**\n * Sets a `justify-self` CSS property on your component\n */\n justifySelf,\n\n /**\n * A layout style for adding size, padding, position, color, and more\n * using tokens from your CSS variable theme.\n *\n * @example\n * <div className={box({size: 300, bg: {sm: 'red', md: 'blue'}})} />\n */\n box,\n /**\n * Arranges child nodes horizontally, wrapping to multiple lines if needed,\n * with equal spacing between items.\n *\n * If there is only a single child node, no space will be rendered.\n *\n * ```\n * ☐☐☐☐☐\n * ☐☐☐☐☐☐\n * ☐☐☐☐☐\n * ☐☐☐\n * ```\n *\n * Some use cases include input chips and tags.\n *\n * @example\n * <div className={inline({gap: 'sm})}>\n * <Item/>\n * <Item/>\n * </div>\n */\n inline,\n /**\n * A layout style that can add positioning properties to itself inside\n * of a flex container.\n *\n * @example\n * <div className={flexItem({alignSelf: 'center', order: 2})}/>\n */\n flexItem,\n /**\n * A layout style that distributes its children in a grid like so:\n *\n * ```\n * ☐ ☐ ☐\n * ☐ ☐ ☐\n * ☐ ☐ ☐\n * ```\n *\n * @example\n * <div className={grid({rows: 2, cols: 2})}>\n * <GridItem/>\n * <GridItem/>\n * <GridItem/>\n * <GridItem/>\n * </div>\n */\n grid,\n /**\n * A layout style that can add positioning properties to itself inside\n * of a `<Grid>` component.\n *\n * @example\n * <div className={grid({cols: 2, rows: 2})}>\n * // Occupies 2 columns\n * <div className={gridItem({colStart: 1, colEnd: 2})} />\n * <div/>\n * <div/>\n * </div>\n */\n gridItem,\n /**\n * A grid that automatically chooses a number of columns based on a preferred\n * minimum grid item width. The items will grow to fit snugly within the grid\n * container, like with flex wrapping, but no item will grow larger than the\n * column size, unlike flex wrapping.\n *\n * ☐ ☐ ☐\n * ☐ ☐ ☐\n * ☐ ☐\n */\n autoGrid,\n /**\n * A layout style that distributes its items in a row without wrapping\n * like so:\n *\n * ```\n * ☐ ☐ ☐ ☐ ☐ ☐ ☐\n * ```\n *\n * @example\n * <div className={hstack({gap: 'sm'})}>\n * <Item/>\n * <Item/>\n * </div>\n */\n hstack,\n /**\n * A layout style that distributes its items in a column without wrapping\n * like so:\n *\n * ```\n * ☐\n * ☐\n * ☐\n * ☐\n * ```\n *\n * @example\n * <div className={vstack({gap: 'sm'})}>\n * <Item/>\n * <Item/>\n * </div>\n */\n vstack,\n /**\n * A layout style that stacks its items on top of one another, like so:\n *\n * ```\n * _____\n * | ☐ |\n * _____\n * ```\n *\n * @example\n * <div className={zstack({center: true})} />\n */\n zstack,\n /**\n * A layout style than positions itself absolutely inside of its\n * container in whichever placement you decide.\n *\n * @example\n * <div className={overlay({placement: 'bottomRight', offset: 24})} />\n */\n overlay,\n /**\n * A layout style that sets a negative left/top margin on itself using\n * the \"pad\" token in your theme. This is useful for increasing the\n * tap area of a component while maintaining the desired visual padding.\n *\n * @example\n * <div className={bleed({amount: 'sm', pad: 'lg'})}>\n * <Item/>\n * <Item/>\n * </div>\n */\n bleed,\n } as const;\n}\n\nexport default layout;\n\nconst keys: <T>(obj: T) => (keyof T)[] = Object.keys;\nfunction reduce<T, U>(\n obj: T,\n fn: (acc: U, key: keyof T, currentIndex: number, arr: (keyof T)[]) => U,\n init: Partial<U>\n): U {\n return keys(obj).reduce(fn, init as U);\n}\n\n/**\n * Adds a `px` unit to numeric values and returns non-numeric values as\n * they are.\n *\n * @param value - The value you want to maybe add a unit to\n */\nfunction unit<T extends number | string>(value: T): T | string {\n return !isNaN(value as any) && value !== 0 ? `${value}px` : value;\n}\n"],"names":["_ref8","width","_ref9","height","_ref10","maxWidth","_ref11","maxHeight","_ref12","minWidth","_ref13","minHeight","_ref14","size","_ref15","value","_ref","pad","padding","Array","isArray","map","k","join","_ref16","_ref2","borderColor","_ref3","borderWidth","color","w","borderStyle","_ref17","_ref4","radius","borderRadius","_ref18","_value$","_value$2","_ref5","_value$3","inset","unit","top","right","bottom","left","_ref19","flexBasis","_ref20","flexGrow","Number","_ref21","order","_ref22","flexShrink","_ref23","_ref6","gap","gridGap","p","_ref24","row","_ref25","gridTemplateRows","_ref26","col","_ref27","gridTemplateColumns","_ref28","gridColumnStart","_ref29","gridColumnEnd","_ref30","gridRowStart","_ref31","gridRowEnd","_ref32","itemWidth","_ref33","margin","_ref34","_ref7","String","startsWith","layout","styles","mediaQueries","compoundStyles","compound","responsiveStyles","responsive","box","display","variants","flex","inlineFlex","grid","inlineGrid","block","inlineBlock","inline","table","tableCell","tableRowGroup","tableRow","tableColumn","tableColumnGroup","tableHeader","tableHeaderGroup","tableFooterGroup","listItem","contents","runIn","none","inherit","initial","unset","revert","position","absolute","relative","fixed","sticky","static","lazy","bg","reduce","tokens","acc","key","backgroundColor","border","shadow","boxShadow","z","zIndex","atomic","alignItems","start","end","center","baseline","stretch","normal","justifyItems","justifyContent","around","between","evenly","alignContent","alignSelf","auto","justifySelf","flexItem","_extends","align","basis","distribute","grow","shrink","default","one","flexWrap","marginTop","marginLeft","sharedGrid","alignX","alignY","distributeX","distributeY","rows","cols","gridItem","colStart","colEnd","rowStart","rowEnd","autoGrid","hstack","flexDirection","reversed","vstack","zstack","gridArea","overlay","offset","placement","transform","topRight","topLeft","bottomRight","bottomLeft","bleed","amount","obj","fn","init","keys","isNaN","Object"],"mappings":"oOAqFmC,SAAAA,EAACC,GAAD,MAA6B,CAAEA,QAA/B,C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