├── .nvmrc ├── .husky ├── .gitignore ├── pre-commit └── prepare-commit-msg ├── packages ├── type-utils │ ├── .npmignore │ ├── tsconfig.json │ ├── tsconfig.build.json │ ├── README.md │ ├── .gitignore │ ├── vite.config.js │ └── package.json ├── solid-doc-site │ ├── src │ │ ├── pages │ │ │ ├── CenterPage │ │ │ │ ├── index.tsx │ │ │ │ ├── argTypes.ts │ │ │ │ ├── maxWidth.tsx │ │ │ │ ├── centerText.tsx │ │ │ │ ├── playground.tsx │ │ │ │ └── centerChildren.tsx │ │ │ ├── CoverPage │ │ │ │ ├── index.tsx │ │ │ │ ├── minHeight.tsx │ │ │ │ ├── topAndBottom.tsx │ │ │ │ ├── playground.tsx │ │ │ │ ├── noStretch.tsx │ │ │ │ └── argTypes.ts │ │ │ ├── FramePage │ │ │ │ ├── index.tsx │ │ │ │ ├── ratioArray.tsx │ │ │ │ ├── ratioString.tsx │ │ │ │ ├── position.tsx │ │ │ │ ├── withoutRatio.tsx │ │ │ │ ├── playground.tsx │ │ │ │ └── argTypes.ts │ │ │ ├── GridPage │ │ │ │ ├── index.tsx │ │ │ │ ├── minItemWidth.tsx │ │ │ │ ├── playground.tsx │ │ │ │ └── argTypes.ts │ │ │ ├── InlinePage │ │ │ │ ├── index.tsx │ │ │ │ ├── minItemWidth.tsx │ │ │ │ ├── switchAt.tsx │ │ │ │ ├── playground.tsx │ │ │ │ ├── inlineClusterProps.tsx │ │ │ │ ├── stretch.tsx │ │ │ │ └── argTypes.ts │ │ │ ├── PadBoxPage │ │ │ │ ├── index.tsx │ │ │ │ ├── argTypes.ts │ │ │ │ ├── playground.tsx │ │ │ │ ├── paddingObject.tsx │ │ │ │ └── paddingArray.tsx │ │ │ ├── ReelPage │ │ │ │ ├── index.tsx │ │ │ │ ├── colors.ts │ │ │ │ ├── playground.tsx │ │ │ │ ├── argTypes.ts │ │ │ │ └── snap.tsx │ │ │ ├── SplitPage │ │ │ │ ├── index.tsx │ │ │ │ ├── switchAt.tsx │ │ │ │ ├── playground.tsx │ │ │ │ ├── minItemWidth.tsx │ │ │ │ ├── argTypes.ts │ │ │ │ └── fractions.tsx │ │ │ ├── StackPage │ │ │ │ ├── index.tsx │ │ │ │ ├── playground.tsx │ │ │ │ ├── argTypes.ts │ │ │ │ └── align.tsx │ │ │ ├── ColumnsPage │ │ │ │ ├── index.tsx │ │ │ │ ├── columns.tsx │ │ │ │ ├── switchAt.tsx │ │ │ │ ├── playground.tsx │ │ │ │ ├── column-playground.tsx │ │ │ │ ├── span.tsx │ │ │ │ ├── offset.tsx │ │ │ │ └── argTypes.ts │ │ │ ├── ColumnDropPage │ │ │ │ ├── index.tsx │ │ │ │ ├── basis.tsx │ │ │ │ ├── playground.tsx │ │ │ │ ├── noStretch.tsx │ │ │ │ └── argTypes.ts │ │ │ ├── InlineClusterPage │ │ │ │ ├── index.tsx │ │ │ │ ├── playground.tsx │ │ │ │ ├── argTypes.ts │ │ │ │ ├── align.tsx │ │ │ │ └── justify.tsx │ │ │ └── MasonryGridPage │ │ │ │ ├── index.tsx │ │ │ │ └── argTypes.ts │ │ ├── global-styles.css │ │ ├── components │ │ │ ├── Heading.tsx │ │ │ ├── Box.tsx │ │ │ ├── PageSection.tsx │ │ │ ├── Button.tsx │ │ │ └── Story.tsx │ │ ├── types │ │ │ └── argType.d.ts │ │ └── index.tsx │ ├── tsconfig.json │ ├── babel.config.js │ ├── tsconfig.build.json │ ├── vite.config.js │ ├── index.html │ └── README.md ├── css │ ├── tsconfig.json │ ├── postcss.config.js │ ├── tsconfig.build.json │ ├── README.md │ ├── package.json │ └── src │ │ ├── reset.css │ │ └── components │ │ └── frame.css ├── center │ ├── tsconfig.json │ ├── tsconfig.build.json │ ├── vite.config.js │ ├── README.md │ ├── package.json │ └── src │ │ └── index.tsx ├── columns │ ├── tsconfig.json │ ├── tsconfig.build.json │ ├── vite.config.js │ └── package.json ├── cover │ ├── tsconfig.json │ ├── tsconfig.build.json │ ├── vite.config.js │ └── package.json ├── frame │ ├── tsconfig.json │ ├── tsconfig.build.json │ ├── vite.config.js │ ├── README.md │ └── package.json ├── grid │ ├── tsconfig.json │ ├── tsconfig.build.json │ ├── vite.config.js │ ├── README.md │ └── package.json ├── inline │ ├── tsconfig.json │ ├── tsconfig.build.json │ ├── vite.config.js │ └── package.json ├── padbox │ ├── tsconfig.json │ ├── tsconfig.build.json │ ├── vite.config.js │ ├── README.md │ └── package.json ├── reel │ ├── tsconfig.json │ ├── tsconfig.build.json │ ├── vite.config.js │ ├── README.md │ ├── src │ │ └── index.tsx │ └── package.json ├── solid │ ├── tsconfig.json │ ├── babel.config.js │ ├── tsconfig.build.json │ ├── src │ │ ├── index.tsx │ │ ├── theme-provider.tsx │ │ ├── open-props.d.ts │ │ ├── create-container-query.tsx │ │ ├── stack.tsx │ │ ├── center.tsx │ │ └── reel.tsx │ ├── vite.config.js │ └── README.md ├── split │ ├── tsconfig.json │ ├── tsconfig.build.json │ ├── vite.config.js │ └── package.json ├── stack │ ├── tsconfig.json │ ├── tsconfig.build.json │ ├── vite.config.js │ ├── README.md │ ├── src │ │ └── index.tsx │ └── package.json ├── appboundary │ ├── tsconfig.json │ ├── README.md │ ├── tsconfig.build.json │ ├── vite.config.js │ └── src │ │ └── index.tsx ├── column-drop │ ├── tsconfig.json │ ├── tsconfig.build.json │ ├── vite.config.js │ └── README.md ├── masonry-grid │ ├── tsconfig.json │ ├── README.md │ ├── tsconfig.build.json │ └── vite.config.js ├── primitives │ ├── tsconfig.json │ ├── __tests__ │ │ └── primitives.test.jsx │ ├── tsconfig.build.json │ ├── README.md │ ├── src │ │ └── index.tsx │ └── vite.config.js ├── inline-cluster │ ├── tsconfig.json │ ├── tsconfig.build.json │ ├── vite.config.js │ └── README.md └── spacing-constants │ ├── tsconfig.json │ ├── tsconfig.build.json │ ├── vite.config.js │ ├── __tests__ │ └── __snapshots__ │ │ └── spacing-constants.test.tsx.snap │ └── package.json ├── public ├── locales │ ├── fr │ │ └── contributing.json │ └── es │ │ └── contributing.json ├── robots.txt ├── favicon.ico ├── people.jpeg ├── Full logo.png └── Logo only.png ├── .storybook ├── assets │ ├── grid.png │ ├── Full logo.png │ ├── Logo only.png │ ├── data-pic.jpg │ ├── jacket-pic.jpg │ ├── menu-start.png │ ├── newsletter.png │ ├── card-initial.png │ ├── card-styled.png │ ├── column-drop.png │ ├── hero-example.png │ ├── masonry-grid.png │ ├── menu-mobile.png │ ├── hero-breakdown.png │ ├── initial-setup.png │ ├── hero-page-initial.png │ ├── menu-just-inline.png │ ├── newsletter-after.png │ ├── newsletter-before.png │ ├── hero-page-with-cover.png │ └── hero-page-with-center.png ├── manager-styles.css ├── ui-components │ ├── Avatar.tsx │ ├── Heading.tsx │ ├── SwitchToDocs.tsx │ ├── Intl.tsx │ └── Button.ts ├── manager-head.html ├── manager.ts ├── i18n.ts ├── preview.ts └── main.ts ├── .vscode ├── mcp.json └── settings.json ├── .github ├── FUNDING.yml ├── workflows │ ├── stale.yml │ ├── chromatic.yml │ └── verify.yml ├── dependabot.yml └── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md ├── stories ├── inline │ ├── Component.tsx │ └── argTypes.ts ├── split │ ├── Component.tsx │ └── argTypes.ts ├── stack │ ├── Component.tsx │ └── argTypes.ts ├── column-drop │ ├── Component.tsx │ └── argTypes.ts ├── frame │ └── argTypes.ts ├── center │ ├── argTypes.ts │ └── Component.tsx ├── inline-cluster │ ├── Component.tsx │ └── argTypes.ts ├── columns │ ├── Component.tsx │ └── argTypes.ts ├── appboundary │ ├── Component.tsx │ └── argTypes.ts ├── css │ └── css-reset.mdx ├── reel │ ├── colors.ts │ └── argTypes.ts ├── cover │ ├── Component.tsx │ └── argTypes.ts ├── grid │ └── argTypes.ts ├── use-stateful-ref │ └── useStatefulRef.mdx ├── primitives │ └── primitives.mdx ├── use-container-query │ └── useContainerQuery.mdx ├── use-resize-observer │ └── useReseizeObserver.mdx └── use-forwarded-ref │ └── useForwardedRef.mdx ├── examples ├── Component.tsx └── plans.ts ├── lerna.json ├── setupTest.js ├── nx.json ├── .eslintrc ├── knip.json ├── vite.config.js ├── README.md ├── tsconfig.build.json ├── LICENSE ├── netlify.toml ├── tsconfig.json └── CONTRIBUTING.md /.nvmrc: -------------------------------------------------------------------------------- 1 | lts/jod -------------------------------------------------------------------------------- /.husky/.gitignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /packages/type-utils/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /public/locales/fr/contributing.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * Disallow: -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/CenterPage/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./CenterPage"; 2 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/CoverPage/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./CoverPage"; 2 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/FramePage/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./FramePage"; 2 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/GridPage/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./GridPage"; 2 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/InlinePage/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./InlinePage"; 2 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/PadBoxPage/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./PadBoxPage"; 2 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/ReelPage/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./ReelPage"; 2 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/SplitPage/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./SplitPage"; 2 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/StackPage/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./StackPage"; 2 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/ColumnsPage/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./ColumnsPage"; 2 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/ColumnDropPage/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./ColumnDropPage"; 2 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bedrock-Layouts/Bedrock/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /public/people.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bedrock-Layouts/Bedrock/HEAD/public/people.jpeg -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/InlineClusterPage/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./InlineClusterPage"; 2 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/MasonryGridPage/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./MasonaryGridPage"; 2 | -------------------------------------------------------------------------------- /public/Full logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bedrock-Layouts/Bedrock/HEAD/public/Full logo.png -------------------------------------------------------------------------------- /public/Logo only.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bedrock-Layouts/Bedrock/HEAD/public/Logo only.png -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | # npx lint-staged 5 | yarn verify 6 | -------------------------------------------------------------------------------- /.storybook/assets/grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bedrock-Layouts/Bedrock/HEAD/.storybook/assets/grid.png -------------------------------------------------------------------------------- /.storybook/assets/Full logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bedrock-Layouts/Bedrock/HEAD/.storybook/assets/Full logo.png -------------------------------------------------------------------------------- /.storybook/assets/Logo only.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bedrock-Layouts/Bedrock/HEAD/.storybook/assets/Logo only.png -------------------------------------------------------------------------------- /.storybook/assets/data-pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bedrock-Layouts/Bedrock/HEAD/.storybook/assets/data-pic.jpg -------------------------------------------------------------------------------- /.storybook/assets/jacket-pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bedrock-Layouts/Bedrock/HEAD/.storybook/assets/jacket-pic.jpg -------------------------------------------------------------------------------- /.storybook/assets/menu-start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bedrock-Layouts/Bedrock/HEAD/.storybook/assets/menu-start.png -------------------------------------------------------------------------------- /.storybook/assets/newsletter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bedrock-Layouts/Bedrock/HEAD/.storybook/assets/newsletter.png -------------------------------------------------------------------------------- /.storybook/assets/card-initial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bedrock-Layouts/Bedrock/HEAD/.storybook/assets/card-initial.png -------------------------------------------------------------------------------- /.storybook/assets/card-styled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bedrock-Layouts/Bedrock/HEAD/.storybook/assets/card-styled.png -------------------------------------------------------------------------------- /.storybook/assets/column-drop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bedrock-Layouts/Bedrock/HEAD/.storybook/assets/column-drop.png -------------------------------------------------------------------------------- /.storybook/assets/hero-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bedrock-Layouts/Bedrock/HEAD/.storybook/assets/hero-example.png -------------------------------------------------------------------------------- /.storybook/assets/masonry-grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bedrock-Layouts/Bedrock/HEAD/.storybook/assets/masonry-grid.png -------------------------------------------------------------------------------- /.storybook/assets/menu-mobile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bedrock-Layouts/Bedrock/HEAD/.storybook/assets/menu-mobile.png -------------------------------------------------------------------------------- /.storybook/assets/hero-breakdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bedrock-Layouts/Bedrock/HEAD/.storybook/assets/hero-breakdown.png -------------------------------------------------------------------------------- /.storybook/assets/initial-setup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bedrock-Layouts/Bedrock/HEAD/.storybook/assets/initial-setup.png -------------------------------------------------------------------------------- /.husky/prepare-commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | exec < /dev/tty && node_modules/.bin/cz --hook || true 5 | -------------------------------------------------------------------------------- /.storybook/assets/hero-page-initial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bedrock-Layouts/Bedrock/HEAD/.storybook/assets/hero-page-initial.png -------------------------------------------------------------------------------- /.storybook/assets/menu-just-inline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bedrock-Layouts/Bedrock/HEAD/.storybook/assets/menu-just-inline.png -------------------------------------------------------------------------------- /.storybook/assets/newsletter-after.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bedrock-Layouts/Bedrock/HEAD/.storybook/assets/newsletter-after.png -------------------------------------------------------------------------------- /.storybook/assets/newsletter-before.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bedrock-Layouts/Bedrock/HEAD/.storybook/assets/newsletter-before.png -------------------------------------------------------------------------------- /packages/css/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.build.json", 3 | "compilerOptions": { 4 | "baseUrl": "." 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /.storybook/assets/hero-page-with-cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bedrock-Layouts/Bedrock/HEAD/.storybook/assets/hero-page-with-cover.png -------------------------------------------------------------------------------- /packages/center/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.build.json", 3 | "compilerOptions": { 4 | "baseUrl": "." 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/columns/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.build.json", 3 | "compilerOptions": { 4 | "baseUrl": "." 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/cover/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.build.json", 3 | "compilerOptions": { 4 | "baseUrl": "." 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/frame/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.build.json", 3 | "compilerOptions": { 4 | "baseUrl": "." 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/grid/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.build.json", 3 | "compilerOptions": { 4 | "baseUrl": "." 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/inline/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.build.json", 3 | "compilerOptions": { 4 | "baseUrl": "." 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/padbox/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.build.json", 3 | "compilerOptions": { 4 | "baseUrl": "." 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/reel/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.build.json", 3 | "compilerOptions": { 4 | "baseUrl": "." 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/solid/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.build.json", 3 | "compilerOptions": { 4 | "baseUrl": "." 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/split/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.build.json", 3 | "compilerOptions": { 4 | "baseUrl": "." 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/stack/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.build.json", 3 | "compilerOptions": { 4 | "baseUrl": "." 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /.storybook/assets/hero-page-with-center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bedrock-Layouts/Bedrock/HEAD/.storybook/assets/hero-page-with-center.png -------------------------------------------------------------------------------- /packages/appboundary/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.build.json", 3 | "compilerOptions": { 4 | "baseUrl": "." 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/column-drop/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.build.json", 3 | "compilerOptions": { 4 | "baseUrl": "." 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/masonry-grid/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.build.json", 3 | "compilerOptions": { 4 | "baseUrl": "." 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/primitives/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.build.json", 3 | "compilerOptions": { 4 | "baseUrl": "." 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/type-utils/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.build.json", 3 | "compilerOptions": { 4 | "baseUrl": "." 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /.vscode/mcp.json: -------------------------------------------------------------------------------- 1 | { 2 | "servers": { 3 | "nx-mcp": { 4 | "type": "sse", 5 | "url": "http://localhost:9505/sse" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /packages/inline-cluster/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.build.json", 3 | "compilerOptions": { 4 | "baseUrl": "." 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/solid-doc-site/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.build.json", 3 | "compilerOptions": { 4 | "baseUrl": "." 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | github: Bedrock-Layouts 5 | -------------------------------------------------------------------------------- /packages/spacing-constants/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.build.json", 3 | "compilerOptions": { 4 | "baseUrl": ".", 5 | "types": ["vitest/globals"] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /stories/inline/Component.tsx: -------------------------------------------------------------------------------- 1 | import styled from "styled-components"; 2 | export const Component = styled.div` 3 | background: black; 4 | min-height: 50px; 5 | min-width: 50px; 6 | `; 7 | -------------------------------------------------------------------------------- /stories/split/Component.tsx: -------------------------------------------------------------------------------- 1 | import styled from "styled-components"; 2 | export const Component = styled.div` 3 | background: black; 4 | min-height: 50px; 5 | min-width: 50px; 6 | `; 7 | -------------------------------------------------------------------------------- /stories/stack/Component.tsx: -------------------------------------------------------------------------------- 1 | import styled from "styled-components"; 2 | export const Component = styled.div` 3 | background: black; 4 | min-height: 50px; 5 | min-width: 50px; 6 | `; 7 | -------------------------------------------------------------------------------- /stories/column-drop/Component.tsx: -------------------------------------------------------------------------------- 1 | import styled from "styled-components"; 2 | export const Component = styled.div` 3 | background: black; 4 | min-height: 50px; 5 | min-width: 50px; 6 | `; 7 | -------------------------------------------------------------------------------- /packages/solid/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | ["@babel/preset-env", { targets: { node: "current" } }], 4 | "solid", 5 | "@babel/preset-typescript", 6 | ], 7 | }; 8 | -------------------------------------------------------------------------------- /packages/solid-doc-site/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | ["@babel/preset-env", { targets: { node: "current" } }], 4 | "solid", 5 | "@babel/preset-typescript", 6 | ], 7 | }; 8 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules/typescript/lib", 3 | "editor.defaultFormatter": "esbenp.prettier-vscode", 4 | "editor.formatOnSave": true, 5 | "nxConsole.generateAiAgentRules": true 6 | } 7 | -------------------------------------------------------------------------------- /packages/appboundary/README.md: -------------------------------------------------------------------------------- 1 | # `@bedrock-layout/appboundary` 2 | 3 | Full docs at [bedrock-layout.dev](https://bedrock-layout.dev/) 4 | 5 | **Note:** This hook is deprecated and will be removed in the next major version. 6 | -------------------------------------------------------------------------------- /packages/css/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [ 3 | // eslint-disable-next-line @typescript-eslint/no-var-requires 4 | require("cssnano")({ 5 | preset: "default", 6 | }), 7 | ], 8 | }; 9 | -------------------------------------------------------------------------------- /stories/frame/argTypes.ts: -------------------------------------------------------------------------------- 1 | export const argTypes = { 2 | ratio: { 3 | control: "text", 4 | }, 5 | position: { 6 | control: "text", 7 | }, 8 | children: { 9 | control: "none", 10 | }, 11 | }; 12 | -------------------------------------------------------------------------------- /packages/center/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "include": ["src", "types", "../../types"], 4 | "compilerOptions": { 5 | "outDir": "./lib", 6 | "declaration": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/cover/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "include": ["src", "types", "../../types"], 4 | "compilerOptions": { 5 | "outDir": "./lib", 6 | "declaration": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/css/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "include": ["src", "types", "../../types"], 4 | "compilerOptions": { 5 | "outDir": "./lib", 6 | "declaration": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/frame/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "include": ["src", "types", "../../types"], 4 | "compilerOptions": { 5 | "outDir": "./lib", 6 | "declaration": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/grid/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "include": ["src", "types", "../../types"], 4 | "compilerOptions": { 5 | "outDir": "./lib", 6 | "declaration": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/inline/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "include": ["src", "types", "../../types"], 4 | "compilerOptions": { 5 | "outDir": "./lib", 6 | "declaration": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/masonry-grid/README.md: -------------------------------------------------------------------------------- 1 | # `@bedrock-layout/masonry-grid` 2 | 3 | Full docs at [bedrock-layout.dev](https://bedrock-layout.dev/) 4 | 5 | **Note:** This hook is deprecated and will be removed in the next major version. 6 | -------------------------------------------------------------------------------- /packages/padbox/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "include": ["src", "types", "../../types"], 4 | "compilerOptions": { 5 | "outDir": "./lib", 6 | "declaration": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/reel/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "include": ["src", "types", "../../types"], 4 | "compilerOptions": { 5 | "outDir": "./lib", 6 | "declaration": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/split/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "include": ["src", "types", "../../types"], 4 | "compilerOptions": { 5 | "outDir": "./lib", 6 | "declaration": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/stack/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "include": ["src", "types", "../../types"], 4 | "compilerOptions": { 5 | "outDir": "./lib", 6 | "declaration": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/appboundary/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "include": ["src", "types", "../../types"], 4 | "compilerOptions": { 5 | "outDir": "./lib", 6 | "declaration": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/column-drop/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "include": ["src", "types", "../../types"], 4 | "compilerOptions": { 5 | "outDir": "./lib", 6 | "declaration": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/columns/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "include": ["src", "types", "../../types"], 4 | "compilerOptions": { 5 | "outDir": "./lib", 6 | "declaration": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/primitives/__tests__/primitives.test.jsx: -------------------------------------------------------------------------------- 1 | import * as primitives from "../src"; 2 | 3 | describe("primitives", () => { 4 | test("primitives snapshot", () => { 5 | expect(primitives).toMatchSnapshot(); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/primitives/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "include": ["src", "types", "../../types"], 4 | "compilerOptions": { 5 | "outDir": "./lib", 6 | "declaration": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/type-utils/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "include": ["src", "types", "../../types"], 4 | "compilerOptions": { 5 | "outDir": "./lib", 6 | "declaration": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/inline-cluster/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "include": ["src", "types", "../../types"], 4 | "compilerOptions": { 5 | "outDir": "./lib", 6 | "declaration": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/masonry-grid/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "include": ["src", "types", "../../types"], 4 | "compilerOptions": { 5 | "outDir": "./lib", 6 | "declaration": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/global-styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: var(--font-sans); 3 | background-color: var(--gray-8); 4 | } 5 | 6 | h2 { 7 | font-size: var(--font-size-6); 8 | font-weight: var(--font-weight-9); 9 | } 10 | -------------------------------------------------------------------------------- /stories/center/argTypes.ts: -------------------------------------------------------------------------------- 1 | export const argTypes = { 2 | maxWidth: { 3 | control: "text", 4 | }, 5 | centerText: { 6 | control: "boolean", 7 | }, 8 | centerChildren: { 9 | control: "boolean", 10 | }, 11 | }; 12 | -------------------------------------------------------------------------------- /packages/solid-doc-site/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "include": ["src", "types", "../../types"], 4 | "compilerOptions": { 5 | "jsx": "preserve", 6 | "jsxImportSource": "solid-js" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /stories/inline-cluster/Component.tsx: -------------------------------------------------------------------------------- 1 | import styled from "styled-components"; 2 | export const Component = styled.div<{ widthLevel?: number }>` 3 | background: black; 4 | min-height: 50px; 5 | min-width: ${({ widthLevel = 2 }) => widthLevel * 50}px; 6 | `; 7 | -------------------------------------------------------------------------------- /.storybook/manager-styles.css: -------------------------------------------------------------------------------- 1 | a[href="#storybook-preview-wrapper"] { 2 | top: 0; 3 | } 4 | 5 | a[title="Bedrock Layout Primitives"] { 6 | filter: invert(90%); 7 | } 8 | 9 | [data-is-storybook][data-is-storybook] { 10 | background-color: var(--gray-10); 11 | } 12 | -------------------------------------------------------------------------------- /packages/spacing-constants/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "include": ["src", "types", "../../types"], 4 | "compilerOptions": { 5 | "outDir": "./lib", 6 | "declaration": true, 7 | "types": ["vitest/globals"] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /.storybook/ui-components/Avatar.tsx: -------------------------------------------------------------------------------- 1 | import { Frame } from "../../packages/frame/src"; 2 | import React from "react"; 3 | 4 | export const Avatar = (props) => ( 5 | 6 | 7 | 8 | ); 9 | -------------------------------------------------------------------------------- /examples/Component.tsx: -------------------------------------------------------------------------------- 1 | import { PadBox } from "@bedrock-layout/padbox"; 2 | import styled from "styled-components"; 3 | 4 | export const Component = styled.div.attrs(() => ({ 5 | as: PadBox, 6 | padding: "size3", 7 | }))` 8 | border: 1px solid black; 9 | text-align: center; 10 | `; 11 | -------------------------------------------------------------------------------- /packages/solid-doc-site/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "vite"; 2 | import solidPlugin from "vite-plugin-solid"; 3 | 4 | module.exports = defineConfig({ 5 | plugins: [solidPlugin()], 6 | build: { 7 | target: "esnext", 8 | polyfillDynamicImport: false, 9 | }, 10 | }); 11 | -------------------------------------------------------------------------------- /packages/type-utils/README.md: -------------------------------------------------------------------------------- 1 | # `@bedrock-layout/type-util` 2 | 3 | This is a utility package for building bedrock layout primitives in React. This package does not follow semver and should not be used directly by anyone. If you want to use it, I recommend forking it and using it in your code base. 4 | -------------------------------------------------------------------------------- /.storybook/manager-head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | Bedrock Layout 11 | -------------------------------------------------------------------------------- /packages/solid/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "include": ["src", "types", "../../types"], 4 | "compilerOptions": { 5 | "outDir": "./lib", 6 | "declaration": true, 7 | "jsx": "preserve", 8 | "jsxImportSource": "solid-js" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/components/Heading.tsx: -------------------------------------------------------------------------------- 1 | import { styled } from "solid-styled-components"; 2 | 3 | export const Heading = styled("h1")` 4 | font-size: clamp(2rem, 10vw, 4.5rem); 5 | font-family: "Roboto", sans-serif; 6 | font-weight: var(--font-weight-4); 7 | letter-spacing: var(--font-letterspacing-1); 8 | `; 9 | -------------------------------------------------------------------------------- /stories/columns/Component.tsx: -------------------------------------------------------------------------------- 1 | import styled from "styled-components"; 2 | export const Component = styled.div` 3 | display: flex; 4 | place-content: center; 5 | place-items: center; 6 | background: black; 7 | min-height: 50px; 8 | color: white; 9 | text-align: center; 10 | padding: 1rem; 11 | font-size: 1.5rem; 12 | `; 13 | -------------------------------------------------------------------------------- /stories/appboundary/Component.tsx: -------------------------------------------------------------------------------- 1 | import styled from "styled-components"; 2 | export const Component = styled.div` 3 | display: flex; 4 | place-content: center; 5 | place-items: center; 6 | background: black; 7 | min-height: 50px; 8 | color: white; 9 | text-align: center; 10 | padding: 1rem; 11 | font-size: 1.5rem; 12 | `; 13 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/SplitPage/switchAt.tsx: -------------------------------------------------------------------------------- 1 | import { Split } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | import { Box } from "../../components/Box"; 5 | 6 | export function SwitchAt(): JSXElement { 7 | return ( 8 | 9 | 10 | 11 | 12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /public/locales/es/contributing.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Contribuyendo al Bedrock Layout", 3 | "thanks": "🎉 ¡Gracias por tomarse el tiempo para contribuir! 🎉", 4 | "description1": "Bedrock Layout es un proyecto comunitario de código abierto. Estamos encantados de recibir contribuciones de todo tipo, incluidos informes de errores, solicitudes de funciones y solicitudes de incorporación de cambios" 5 | } 6 | -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": ["packages/*"], 3 | "npmClient": "yarn", 4 | "version": "independent", 5 | "useNx": "true", 6 | "command": { 7 | "version": { 8 | "conventionalCommits": true, 9 | "allowBranch": ["main"] 10 | }, 11 | "publish": { 12 | "conventionalCommits": true, 13 | "allowBranch": ["main"], 14 | "yes": true 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/SplitPage/playground.tsx: -------------------------------------------------------------------------------- 1 | import { Split, SplitProps } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | import { Box } from "../../components/Box"; 5 | 6 | export function Playground(props: Readonly): JSXElement { 7 | return ( 8 | 9 | 10 | 11 | 12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/FramePage/ratioArray.tsx: -------------------------------------------------------------------------------- 1 | import { Frame } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | import imgSrc from "../../../../../.storybook/assets/data-pic.jpg"; 5 | 6 | export function RatioArray(): JSXElement { 7 | return ( 8 | 9 | computer with data 10 | 11 | ); 12 | } 13 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/FramePage/ratioString.tsx: -------------------------------------------------------------------------------- 1 | import { Frame } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | import imgSrc from "../../../../../.storybook/assets/data-pic.jpg"; 5 | 6 | export function RatioString(): JSXElement { 7 | return ( 8 | 9 | computer with data 10 | 11 | ); 12 | } 13 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/FramePage/position.tsx: -------------------------------------------------------------------------------- 1 | import { Frame } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | import imgSrc from "../../../../../.storybook/assets/data-pic.jpg"; 5 | 6 | export function Position(): JSXElement { 7 | return ( 8 | 9 | computer with data 10 | 11 | ); 12 | } 13 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/InlinePage/minItemWidth.tsx: -------------------------------------------------------------------------------- 1 | import { Inline } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | import { Box } from "../../components/Box"; 5 | 6 | export function MinItemWidth(): JSXElement { 7 | return ( 8 | 9 | 10 | 11 | 12 | 13 | 14 | ); 15 | } 16 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/FramePage/withoutRatio.tsx: -------------------------------------------------------------------------------- 1 | import { Frame } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | import imgSrc from "../../../../../.storybook/assets/data-pic.jpg"; 5 | 6 | export function WithoutRatio(): JSXElement { 7 | return ( 8 | 9 | computer with data 10 | 11 | ); 12 | } 13 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/StackPage/playground.tsx: -------------------------------------------------------------------------------- 1 | import { Stack, StackProps } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | import { Box } from "../../components/Box"; 5 | 6 | export function Playground(props: Readonly): JSXElement { 7 | return ( 8 | 9 | 10 | 11 | 12 | 13 | 14 | ); 15 | } 16 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/components/Box.tsx: -------------------------------------------------------------------------------- 1 | import { styled } from "solid-styled-components"; 2 | 3 | export const Box = styled.div<{ widthLevel?: number; bgColor?: string }>` 4 | background: ${(props) => (props.bgColor ? props.bgColor : "black")}; 5 | min-height: 50px; 6 | min-width: ${({ widthLevel = 1 }) => widthLevel * 50}px; 7 | color: white; 8 | display: flex; 9 | place-content: center; 10 | align-items: center; 11 | `; 12 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/FramePage/playground.tsx: -------------------------------------------------------------------------------- 1 | import { Frame, FrameProps } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | import imgSrc from "../../../../../.storybook/assets/data-pic.jpg"; 5 | 6 | export function Playground(props: Readonly): JSXElement { 7 | return ( 8 | 9 | computer with data 10 | 11 | ); 12 | } 13 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/InlinePage/switchAt.tsx: -------------------------------------------------------------------------------- 1 | import { Inline } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | import { Box } from "../../components/Box"; 5 | 6 | export function SwitchAt(): JSXElement { 7 | return ( 8 | 9 | 10 | 11 | 12 | 13 | 14 | ); 15 | } 16 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/ReelPage/colors.ts: -------------------------------------------------------------------------------- 1 | export const colors: string[] = [ 2 | "Lavender", 3 | "Purple", 4 | "Thistle", 5 | "Plum", 6 | "Orchid", 7 | "Violet", 8 | "RebeccaPurple", 9 | "Magenta", 10 | "MediumOrchid", 11 | "DarkOrchid", 12 | "BlueViolet", 13 | "DarkMagenta", 14 | "MediumPurple", 15 | "MediumSlateBlue", 16 | "SlateBlue", 17 | "DarkSlateBlue", 18 | "Indigo", 19 | "DarkViolet", 20 | ]; 21 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/InlinePage/playground.tsx: -------------------------------------------------------------------------------- 1 | import { Inline, InlineProps } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | import { Box } from "../../components/Box"; 5 | 6 | export function Playground(props: Readonly): JSXElement { 7 | return ( 8 | 9 | 10 | 11 | 12 | 13 | 14 | ); 15 | } 16 | -------------------------------------------------------------------------------- /stories/css/css-reset.mdx: -------------------------------------------------------------------------------- 1 | import { Meta } from "@storybook/addon-docs"; 2 | 3 | 4 | 5 | # CSS Reset 6 | 7 | A CSS Reset that compliments well with the Bedrock Layout Primitives 8 | 9 | The reset is not included in the main CSS bundle, so you will need to bring it in individually. 10 | 11 | ```javascript 12 | import "@bedrock-layout/css/lib/reset.min.css"; 13 | ``` 14 | -------------------------------------------------------------------------------- /.storybook/ui-components/Heading.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import styled from "styled-components"; 3 | 4 | import { Stack } from "../../packages/stack/src"; 5 | 6 | export const Heading = (props) => ( 7 | 8 | ); 9 | 10 | export const SubHeading = styled.span` 11 | font-size: var(--font-size-fluid-2); 12 | line-height: var(--font-lineheight-2); 13 | letter-spacing: 0.5ch; 14 | `; 15 | -------------------------------------------------------------------------------- /stories/appboundary/argTypes.ts: -------------------------------------------------------------------------------- 1 | export const argTypes = { 2 | boundarySize: { 3 | control: "select", 4 | options: [ 5 | "sizeContent1", 6 | "sizeContent2", 7 | "sizeContent3", 8 | "sizeHeader1", 9 | "sizeHeader2", 10 | "sizeHeader3", 11 | "sizeXxs", 12 | "sizeXs", 13 | "sizeSm", 14 | "sizeMd", 15 | "sizeLg", 16 | "sizeXl", 17 | "sizeXxl", 18 | ], 19 | }, 20 | }; 21 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/ColumnsPage/columns.tsx: -------------------------------------------------------------------------------- 1 | import { Columns } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | import { Box } from "../../components/Box"; 5 | 6 | export function ColumnsExample(): JSXElement { 7 | return ( 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /packages/type-utils/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /lib 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | .npmrc 22 | 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | /.rts2_cache* 27 | 28 | -------------------------------------------------------------------------------- /.storybook/ui-components/SwitchToDocs.tsx: -------------------------------------------------------------------------------- 1 | import { useEffect } from "react"; 2 | 3 | export const SwitchToDocs = () => { 4 | useEffect(() => { 5 | try { 6 | const { href } = window.location; 7 | 8 | if (href.includes("viewMode=story")) { 9 | window.location.href = href.replace("viewMode=story", "viewMode=docs"); 10 | } 11 | } catch (error) { 12 | // Do nothing if it wasn't able to click on Docs button. 13 | } 14 | }); 15 | return null; 16 | }; 17 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/ColumnsPage/switchAt.tsx: -------------------------------------------------------------------------------- 1 | import { Column, Columns } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | import { Box } from "../../components/Box"; 5 | 6 | export function SwitchAt(): JSXElement { 7 | return ( 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/components/PageSection.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable react/style-prop-object */ 2 | import { Stack } from "@bedrock-layout/solid"; 3 | import { JSXElement } from "solid-js"; 4 | 5 | export function PageSection( 6 | props: Readonly<{ 7 | title: string; 8 | children: JSXElement; 9 | }>, 10 | ): JSXElement { 11 | return ( 12 | 13 |

{props.title}

14 | {props.children} 15 |
16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/GridPage/minItemWidth.tsx: -------------------------------------------------------------------------------- 1 | import { Grid } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | import { Box } from "../../components/Box"; 5 | 6 | export function MinItemWidth(): JSXElement { 7 | return ( 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | ); 19 | } 20 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/PadBoxPage/argTypes.ts: -------------------------------------------------------------------------------- 1 | import { spacing } from "@bedrock-layout/solid"; 2 | import { ArgType } from "src/types/argType"; 3 | 4 | export const argTypes: ArgType = { 5 | padding: { 6 | description: "Sets the padding around the content of the element", 7 | summary: "Space | Space[] | Record", 8 | defaultValue: "0px", 9 | initialValue: "size3", 10 | control: "select", 11 | options: Object.keys(spacing), 12 | }, 13 | }; 14 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/GridPage/playground.tsx: -------------------------------------------------------------------------------- 1 | import { Grid, GridProps } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | import { Box } from "../../components/Box"; 5 | 6 | export function Playground(props: Readonly): JSXElement { 7 | return ( 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | ); 19 | } 20 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/ColumnDropPage/basis.tsx: -------------------------------------------------------------------------------- 1 | import { ColumnDrop } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | import { Box } from "../../components/Box"; 5 | 6 | export function Basis(): JSXElement { 7 | return ( 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | ); 19 | } 20 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/InlinePage/inlineClusterProps.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable react/style-prop-object */ 2 | import { Inline } from "@bedrock-layout/solid"; 3 | import { JSXElement } from "solid-js"; 4 | 5 | import { Box } from "../../components/Box"; 6 | 7 | export function ICProps(): JSXElement { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /setupTest.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @jest-environment jsdom 3 | */ 4 | 5 | import { vi } from "vitest"; 6 | 7 | global.IS_REACT_ACT_ENVIRONMENT = true; 8 | 9 | Object.defineProperty(global, "CSS", { 10 | writable: true, 11 | value: { 12 | supports: vi.fn(), 13 | }, 14 | }); 15 | 16 | Object.defineProperty(global, "ResizeObserver", { 17 | writable: true, 18 | value: vi.fn().mockImplementation(() => ({ 19 | disconnect: vi.fn(), 20 | observe: vi.fn(), 21 | unobserve: vi.fn(), 22 | })), 23 | }); 24 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | name: Mark stale issues and pull requests 2 | 3 | on: 4 | schedule: 5 | - cron: "30 1 * * *" 6 | 7 | jobs: 8 | stale: 9 | 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - uses: actions/stale@v1 14 | with: 15 | repo-token: ${{ secrets.GITHUB_TOKEN }} 16 | stale-issue-message: 'Stale issue message' 17 | stale-pr-message: 'Stale pull request message' 18 | stale-issue-label: 'no-issue-activity' 19 | stale-pr-label: 'no-pr-activity' 20 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/ColumnDropPage/playground.tsx: -------------------------------------------------------------------------------- 1 | import { ColumnDrop, ColumnDropProps } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | import { Box } from "../../components/Box"; 5 | 6 | export function Playground(props: Readonly): JSXElement { 7 | return ( 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /.storybook/ui-components/Intl.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { UseTranslationOptions, useTranslation } from "react-i18next"; 3 | 4 | export const Intl = ({ 5 | children, 6 | options, 7 | }: { 8 | children: string; 9 | options?: UseTranslationOptions; 10 | }) => { 11 | const { t } = useTranslation(); 12 | return <>{t(children, options)}; 13 | }; 14 | 15 | export function NameSpace({ ns }: { ns: string }) { 16 | const { i18n } = useTranslation(); 17 | i18n.loadNamespaces(ns); 18 | return null; 19 | } 20 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/ColumnDropPage/noStretch.tsx: -------------------------------------------------------------------------------- 1 | import { ColumnDrop } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | import { Box } from "../../components/Box"; 5 | 6 | export function NoStretch(): JSXElement { 7 | return ( 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | ); 19 | } 20 | -------------------------------------------------------------------------------- /packages/solid/src/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./spacing-constants"; 2 | export * from "./center"; 3 | export * from "./column-drop"; 4 | export * from "./create-container-query"; 5 | export * from "./frame"; 6 | export * from "./grid"; 7 | export * from "./masonry-grid"; 8 | export * from "./inline-cluster"; 9 | export * from "./inline"; 10 | export * from "./padbox"; 11 | export * from "./reel"; 12 | export * from "./split"; 13 | export * from "./stack"; 14 | export * from "./cover"; 15 | export * from "./columns"; 16 | export * from "./theme-provider"; 17 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "npm" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "daily" 12 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/ReelPage/playground.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable react/style-prop-object */ 2 | import { Reel, ReelProps } from "@bedrock-layout/solid"; 3 | import { JSXElement } from "solid-js"; 4 | 5 | import { Box } from "../../components/Box"; 6 | import { colors } from "./colors"; 7 | 8 | export function Playground(props: Readonly): JSXElement { 9 | return ( 10 | 11 | {colors.map((color) => { 12 | return ; 13 | })} 14 | 15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /.storybook/manager.ts: -------------------------------------------------------------------------------- 1 | // .storybook/manager.js 2 | import "open-props/open-props.min.css"; 3 | 4 | import "./manager-styles.css"; 5 | 6 | import { addons } from "@storybook/manager-api"; 7 | import { create } from "@storybook/theming"; 8 | import openProps from "open-props"; 9 | 10 | addons.setConfig({ 11 | showToolbar: false, 12 | theme: create({ 13 | base: "dark", 14 | brandTitle: "Bedrock Layout Primitives", 15 | brandUrl: "/", 16 | brandImage: "/Logo only.png", 17 | fontBase: '"Roboto", sans-serif', 18 | textColor: openProps.gray2, 19 | }), 20 | }); 21 | -------------------------------------------------------------------------------- /.storybook/i18n.ts: -------------------------------------------------------------------------------- 1 | import i18n from "i18next"; 2 | import LanguageDetector from "i18next-browser-languagedetector"; 3 | import Backend from "i18next-http-backend"; 4 | import { initReactI18next } from "react-i18next"; 5 | 6 | i18n 7 | .use(Backend) // lazy loads translations from /public/locales 8 | .use(LanguageDetector) // detect user language 9 | .use(initReactI18next) // passes i18n down to react-i18next 10 | .init({ 11 | fallbackLng: "en", 12 | ns: "landing", 13 | interpolation: { 14 | escapeValue: false, 15 | }, 16 | }); 17 | 18 | export default i18n; 19 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/InlineClusterPage/playground.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable react/style-prop-object */ 2 | import { InlineCluster, InlineClusterProps } from "@bedrock-layout/solid"; 3 | import { JSXElement } from "solid-js"; 4 | 5 | import { Box } from "../../components/Box"; 6 | 7 | export function Playground(props: Readonly): JSXElement { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/types/argType.d.ts: -------------------------------------------------------------------------------- 1 | type Controls = 2 | | { 3 | control: "text"; 4 | initialValue: string; 5 | } 6 | | { 7 | control: "number"; 8 | initialValue: number; 9 | } 10 | | { 11 | control: "boolean"; 12 | initialValue: boolean; 13 | } 14 | | { 15 | control: "select"; 16 | initialValue: string; 17 | options: string[]; 18 | }; 19 | 20 | type ArgDetails = { 21 | description: string; 22 | defaultValue?: string; 23 | summary: string; 24 | } & Controls; 25 | 26 | export type ArgType = Record; 27 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/CoverPage/minHeight.tsx: -------------------------------------------------------------------------------- 1 | import { Cover } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | export function MinHeight(): JSXElement { 5 | return ( 6 | 7 |
8 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Fuga 9 | consequuntur corrupti beatae commodi vitae, perspiciatis totam provident 10 | architecto doloribus aperiam sapiente, incidunt nihil suscipit 11 | voluptatibus tempore est dolor! Iusto, vero. 12 |
13 |
14 | ); 15 | } 16 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/ColumnsPage/playground.tsx: -------------------------------------------------------------------------------- 1 | import { Column, Columns, ColumnsProps } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | import { Box } from "../../components/Box"; 5 | 6 | export function Playground(props: Readonly): JSXElement { 7 | return ( 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | ); 22 | } 23 | -------------------------------------------------------------------------------- /packages/type-utils/vite.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | // vite.config.js 3 | const path = require("path"); 4 | const { defineConfig } = require("vite"); 5 | 6 | module.exports = defineConfig({ 7 | build: { 8 | outDir: "./lib", 9 | lib: { 10 | entry: path.resolve(__dirname, "src/index.tsx"), 11 | name: "type-util", 12 | formats: ["cjs", "umd", "es"], 13 | fileName: (format) => { 14 | return `index.${format === "es" ? "m" : format}.js`; 15 | }, 16 | }, 17 | rollupOptions: { 18 | external: ["react"], 19 | }, 20 | }, 21 | }); 22 | -------------------------------------------------------------------------------- /nx.json: -------------------------------------------------------------------------------- 1 | { 2 | "nxCloudAccessToken": "NzI4NTdmYmYtMTMyZS00YjE4LWE4OTEtMDcyZjUxZDVmNmVifHJlYWQtd3JpdGU=", 3 | "targetDefaults": { 4 | "test": { 5 | "cache": true 6 | }, 7 | "test:coverage": { 8 | "cache": true 9 | }, 10 | "verify": { 11 | "cache": true 12 | }, 13 | "check-types": { 14 | "cache": true 15 | }, 16 | "lint": { 17 | "cache": true 18 | }, 19 | "check-format": { 20 | "cache": true 21 | }, 22 | "knip": { 23 | "cache": true 24 | }, 25 | "build": { 26 | "cache": false, 27 | "dependsOn": ["^build"] 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/ColumnsPage/column-playground.tsx: -------------------------------------------------------------------------------- 1 | import { Column, ColumnProps, Columns } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | import { Box } from "../../components/Box"; 5 | 6 | export function ColumnPlayground(props: Readonly): JSXElement { 7 | return ( 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/ColumnsPage/span.tsx: -------------------------------------------------------------------------------- 1 | import { Column, Columns } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | import { Box } from "../../components/Box"; 5 | 6 | export function Span(): JSXElement { 7 | return ( 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | ); 22 | } 23 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/components/Button.tsx: -------------------------------------------------------------------------------- 1 | import { styled } from "solid-styled-components"; 2 | 3 | export const Button = styled("button")<{ 4 | primary?: boolean; 5 | }>` 6 | padding: var(--size-3) var(--size-7); 7 | border-radius: 0.5rem; 8 | border-width: 1px; 9 | border-style: solid; 10 | border-color: ${({ primary }) => (primary ? "white" : "black")}; 11 | background-color: ${({ primary }) => (primary ? "black" : "white")}; 12 | color: ${({ primary }) => (primary ? "white" : "black")}; 13 | text-decoration: none; 14 | text-align: center; 15 | :disabled { 16 | opacity: 0.5; 17 | font-size: 1rem; 18 | } 19 | `; 20 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/MasonryGridPage/argTypes.ts: -------------------------------------------------------------------------------- 1 | import { spacing } from "@bedrock-layout/solid"; 2 | import { ArgType } from "src/types/argType"; 3 | 4 | export const argTypes: ArgType = { 5 | gutter: { 6 | description: "Sets space between each element", 7 | summary: "Space", 8 | defaultValue: "0px", 9 | initialValue: "size3", 10 | control: "select", 11 | options: Object.keys(spacing), 12 | }, 13 | minItemWidth: { 14 | description: "Sets the basis of each of the children", 15 | summary: "CSSLength", 16 | defaultValue: "639px", 17 | initialValue: "20rem", 18 | control: "text", 19 | }, 20 | }; 21 | -------------------------------------------------------------------------------- /packages/spacing-constants/vite.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | // vite.config.js 3 | const path = require("path"); 4 | const { defineConfig } = require("vite"); 5 | 6 | module.exports = defineConfig({ 7 | build: { 8 | outDir: "./lib", 9 | lib: { 10 | entry: path.resolve(__dirname, "src/index.tsx"), 11 | name: "spacing-constants", 12 | formats: ["cjs", "umd", "es"], 13 | fileName: (format) => { 14 | return `index.${format === "es" ? "m" : format}.js`; 15 | }, 16 | }, 17 | rollupOptions: { 18 | external: ["react", "open-props"], 19 | }, 20 | }, 21 | }); 22 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/FramePage/argTypes.ts: -------------------------------------------------------------------------------- 1 | import { ArgType } from "src/types/argType"; 2 | 3 | export const argTypes: ArgType = { 4 | ratio: { 5 | description: "Aspect ratio that you want the child element to maintain", 6 | // eslint-disable-next-line no-template-curly-in-string 7 | summary: "[number, number] | `${number}/${number}`", 8 | initialValue: "16/4", 9 | control: "text", 10 | }, 11 | position: { 12 | description: "Sets the alignment of the media in the Frame", 13 | summary: "object-position value", 14 | defaultValue: "50% 50%", 15 | initialValue: "50% 50%", 16 | control: "text", 17 | }, 18 | }; 19 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/ColumnsPage/offset.tsx: -------------------------------------------------------------------------------- 1 | import { Column, Columns } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | import { Box } from "../../components/Box"; 5 | 6 | export function Offset(): JSXElement { 7 | return ( 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | ); 22 | } 23 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/PadBoxPage/playground.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable react/style-prop-object */ 2 | import { PadBox, PadBoxProps } from "@bedrock-layout/solid"; 3 | import { JSXElement } from "solid-js"; 4 | 5 | export function Playground(props: Readonly): JSXElement { 6 | return ( 7 | 8 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Fuga consequuntur 9 | corrupti beatae commodi vitae, perspiciatis totam provident architecto 10 | doloribus aperiam sapiente, incidunt nihil suscipit voluptatibus tempore 11 | est dolor! Iusto, vero. 12 | 13 | ); 14 | } 15 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/ReelPage/argTypes.ts: -------------------------------------------------------------------------------- 1 | import { spacing } from "@bedrock-layout/solid"; 2 | import { ArgType } from "src/types/argType"; 3 | 4 | export const argTypes: ArgType = { 5 | gap: { 6 | description: "Sets space between each element", 7 | summary: "Space", 8 | defaultValue: "0px", 9 | initialValue: "size3", 10 | control: "select", 11 | options: Object.keys(spacing), 12 | }, 13 | snapType: { 14 | description: "Sets the scroll snap type", 15 | summary: "string", 16 | control: "select", 17 | defaultValue: "none", 18 | initialValue: "none", 19 | options: ["none", "proximity", "mandatory"], 20 | }, 21 | }; 22 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/SplitPage/minItemWidth.tsx: -------------------------------------------------------------------------------- 1 | import { Split } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | import { Box } from "../../components/Box"; 5 | 6 | export function MinItemWidth(): JSXElement { 7 | return ( 8 | <> 9 |

{"With fraction of 2/3 and minItemWidth of 40ch"}

10 | 11 | 12 | 13 | 14 |

{"With auto-start and minItemWidth of 30ch"}

15 | 16 | 17 | 18 | 19 | 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /packages/solid/vite.config.js: -------------------------------------------------------------------------------- 1 | import path from "path"; 2 | 3 | import { defineConfig } from "vite"; 4 | import solidPlugin from "vite-plugin-solid"; 5 | 6 | export default defineConfig({ 7 | plugins: [solidPlugin()], 8 | build: { 9 | outDir: "./lib", 10 | lib: { 11 | entry: path.resolve(__dirname, "src/index.tsx"), 12 | name: "solid", 13 | formats: ["cjs", "umd", "es"], 14 | fileName: (format) => { 15 | return `index.${format === "es" ? "m" : format}.js`; 16 | }, 17 | }, 18 | rollupOptions: { 19 | external: [ 20 | "solid-js", 21 | "@bedrock-layout/register-resize-callback", 22 | "open-props", 23 | ], 24 | }, 25 | }, 26 | }); 27 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/StackPage/argTypes.ts: -------------------------------------------------------------------------------- 1 | import { spacing } from "@bedrock-layout/solid"; 2 | import { ArgType } from "src/types/argType"; 3 | 4 | export const argTypes: ArgType = { 5 | gap: { 6 | description: "Sets space between each element", 7 | summary: "Space", 8 | defaultValue: "0px", 9 | initialValue: "size3", 10 | control: "select", 11 | options: Object.keys(spacing), 12 | }, 13 | align: { 14 | description: "Sets the block alignment of the children", 15 | summary: "start | end | center | stretch", 16 | defaultValue: "stretch", 17 | initialValue: "stretch", 18 | control: "select", 19 | options: ["start", "end", "center", "stretch"], 20 | }, 21 | }; 22 | -------------------------------------------------------------------------------- /stories/reel/colors.ts: -------------------------------------------------------------------------------- 1 | import styled from "styled-components"; 2 | export const colors: string[] = [ 3 | "Lavender", 4 | "Thistle", 5 | "Plum", 6 | "Orchid", 7 | "Violet", 8 | "Fuchsia", 9 | "Magenta", 10 | "MediumOrchid", 11 | "DarkOrchid", 12 | "DarkViolet", 13 | "BlueViolet", 14 | "DarkMagenta", 15 | "Purple", 16 | "MediumPurple", 17 | "MediumSlateBlue", 18 | "SlateBlue", 19 | "DarkSlateBlue", 20 | "RebeccaPurple", 21 | "Indigo", 22 | ]; 23 | 24 | export const ColoredRect = styled.div<{ bgColor: string }>` 25 | ${(props) => (props.bgColor ? `background-color: ${props.bgColor};` : "")} 26 | padding: 50px; 27 | text-align: center; 28 | `; 29 | ColoredRect.displayName = "ColoredRect"; 30 | -------------------------------------------------------------------------------- /packages/center/vite.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | // vite.config.js 3 | const path = require("path"); 4 | const { defineConfig } = require("vite"); 5 | 6 | module.exports = defineConfig({ 7 | build: { 8 | outDir: "./lib", 9 | lib: { 10 | entry: path.resolve(__dirname, "src/index.tsx"), 11 | name: "center", 12 | formats: ["cjs", "umd", "es"], 13 | fileName: (format) => { 14 | return `index.${format === "es" ? "m" : format}.js`; 15 | }, 16 | }, 17 | rollupOptions: { 18 | external: [ 19 | "react", 20 | "@bedrock-layout/type-utils", 21 | "@bedrock-layout/spacing-constants", 22 | ], 23 | }, 24 | }, 25 | }); 26 | -------------------------------------------------------------------------------- /packages/cover/vite.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | // vite.config.js 3 | const path = require("path"); 4 | const { defineConfig } = require("vite"); 5 | 6 | module.exports = defineConfig({ 7 | build: { 8 | outDir: "./lib", 9 | lib: { 10 | entry: path.resolve(__dirname, "src/index.tsx"), 11 | name: "cover", 12 | formats: ["cjs", "umd", "es"], 13 | fileName: (format) => { 14 | return `index.${format === "es" ? "m" : format}.js`; 15 | }, 16 | }, 17 | rollupOptions: { 18 | external: [ 19 | "react", 20 | "@bedrock-layout/type-utils", 21 | "@bedrock-layout/spacing-constants", 22 | ], 23 | }, 24 | }, 25 | }); 26 | -------------------------------------------------------------------------------- /packages/frame/vite.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | // vite.config.js 3 | const path = require("path"); 4 | const { defineConfig } = require("vite"); 5 | 6 | module.exports = defineConfig({ 7 | build: { 8 | outDir: "./lib", 9 | lib: { 10 | entry: path.resolve(__dirname, "src/index.tsx"), 11 | name: "frame", 12 | formats: ["cjs", "umd", "es"], 13 | fileName: (format) => { 14 | return `index.${format === "es" ? "m" : format}.js`; 15 | }, 16 | }, 17 | rollupOptions: { 18 | external: [ 19 | "react", 20 | "@bedrock-layout/type-utils", 21 | "@bedrock-layout/spacing-constants", 22 | ], 23 | }, 24 | }, 25 | }); 26 | -------------------------------------------------------------------------------- /packages/grid/vite.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | // vite.config.js 3 | const path = require("path"); 4 | const { defineConfig } = require("vite"); 5 | 6 | module.exports = defineConfig({ 7 | build: { 8 | outDir: "./lib", 9 | lib: { 10 | entry: path.resolve(__dirname, "src/index.tsx"), 11 | name: "grid", 12 | formats: ["cjs", "umd", "es"], 13 | fileName: (format) => { 14 | return `index.${format === "es" ? "m" : format}.js`; 15 | }, 16 | }, 17 | rollupOptions: { 18 | external: [ 19 | "react", 20 | "@bedrock-layout/spacing-constants", 21 | "@bedrock-layout/type-utils", 22 | ], 23 | }, 24 | }, 25 | }); 26 | -------------------------------------------------------------------------------- /packages/inline/vite.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | // vite.config.js 3 | const path = require("path"); 4 | const { defineConfig } = require("vite"); 5 | 6 | module.exports = defineConfig({ 7 | build: { 8 | outDir: "./lib", 9 | lib: { 10 | entry: path.resolve(__dirname, "src/index.tsx"), 11 | name: "inline", 12 | formats: ["cjs", "umd", "es"], 13 | fileName: (format) => { 14 | return `index.${format === "es" ? "m" : format}.js`; 15 | }, 16 | }, 17 | rollupOptions: { 18 | external: [ 19 | "react", 20 | "@bedrock-layout/type-utils", 21 | "@bedrock-layout/spacing-constants", 22 | ], 23 | }, 24 | }, 25 | }); 26 | -------------------------------------------------------------------------------- /packages/padbox/vite.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | // vite.config.js 3 | const path = require("path"); 4 | const { defineConfig } = require("vite"); 5 | 6 | module.exports = defineConfig({ 7 | build: { 8 | outDir: "./lib", 9 | lib: { 10 | entry: path.resolve(__dirname, "src/index.tsx"), 11 | name: "padbox", 12 | formats: ["cjs", "umd", "es"], 13 | fileName: (format) => { 14 | return `index.${format === "es" ? "m" : format}.js`; 15 | }, 16 | }, 17 | rollupOptions: { 18 | external: [ 19 | "react", 20 | "@bedrock-layout/type-utils", 21 | "@bedrock-layout/spacing-constants", 22 | ], 23 | }, 24 | }, 25 | }); 26 | -------------------------------------------------------------------------------- /packages/reel/vite.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | // vite.config.js 3 | const path = require("path"); 4 | const { defineConfig } = require("vite"); 5 | 6 | module.exports = defineConfig({ 7 | build: { 8 | outDir: "./lib", 9 | lib: { 10 | entry: path.resolve(__dirname, "src/index.tsx"), 11 | name: "reel", 12 | formats: ["cjs", "umd", "es"], 13 | fileName: (format) => { 14 | return `index.${format === "es" ? "m" : format}.js`; 15 | }, 16 | }, 17 | rollupOptions: { 18 | external: [ 19 | "react", 20 | "@bedrock-layout/type-utils", 21 | "@bedrock-layout/spacing-constants", 22 | ], 23 | }, 24 | }, 25 | }); 26 | -------------------------------------------------------------------------------- /packages/split/vite.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | // vite.config.js 3 | const path = require("path"); 4 | const { defineConfig } = require("vite"); 5 | 6 | module.exports = defineConfig({ 7 | build: { 8 | outDir: "./lib", 9 | lib: { 10 | entry: path.resolve(__dirname, "src/index.tsx"), 11 | name: "split", 12 | formats: ["cjs", "umd", "es"], 13 | fileName: (format) => { 14 | return `index.${format === "es" ? "m" : format}.js`; 15 | }, 16 | }, 17 | rollupOptions: { 18 | external: [ 19 | "react", 20 | "@bedrock-layout/type-utils", 21 | "@bedrock-layout/spacing-constants", 22 | ], 23 | }, 24 | }, 25 | }); 26 | -------------------------------------------------------------------------------- /packages/stack/vite.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | // vite.config.js 3 | const path = require("path"); 4 | const { defineConfig } = require("vite"); 5 | 6 | module.exports = defineConfig({ 7 | build: { 8 | outDir: "./lib", 9 | lib: { 10 | entry: path.resolve(__dirname, "src/index.tsx"), 11 | name: "stack", 12 | formats: ["cjs", "umd", "es"], 13 | fileName: (format) => { 14 | return `index.${format === "es" ? "m" : format}.js`; 15 | }, 16 | }, 17 | rollupOptions: { 18 | external: [ 19 | "react", 20 | "@bedrock-layout/spacing-constants", 21 | "@bedrock-layout/type-utils", 22 | ], 23 | }, 24 | }, 25 | }); 26 | -------------------------------------------------------------------------------- /packages/columns/vite.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | // vite.config.js 3 | const path = require("path"); 4 | const { defineConfig } = require("vite"); 5 | 6 | module.exports = defineConfig({ 7 | build: { 8 | outDir: "./lib", 9 | lib: { 10 | entry: path.resolve(__dirname, "src/index.tsx"), 11 | name: "columns", 12 | formats: ["cjs", "umd", "es"], 13 | fileName: (format) => { 14 | return `index.${format === "es" ? "m" : format}.js`; 15 | }, 16 | }, 17 | rollupOptions: { 18 | external: [ 19 | "react", 20 | "@bedrock-layout/spacing-constants", 21 | "@bedrock-layout/type-utils", 22 | ], 23 | }, 24 | }, 25 | }); 26 | -------------------------------------------------------------------------------- /packages/solid-doc-site/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 14 | Solid Bedrock Layout 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/CoverPage/topAndBottom.tsx: -------------------------------------------------------------------------------- 1 | import { Cover } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | export function TopAndBottom(): JSXElement { 5 | return ( 6 | I am on top.} 10 | bottom={I am on bottom.} 11 | > 12 |
13 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Fuga 14 | consequuntur corrupti beatae commodi vitae, perspiciatis totam provident 15 | architecto doloribus aperiam sapiente, incidunt nihil suscipit 16 | voluptatibus tempore est dolor! Iusto, vero. 17 |
18 |
19 | ); 20 | } 21 | -------------------------------------------------------------------------------- /packages/column-drop/vite.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | // vite.config.js 3 | const path = require("path"); 4 | const { defineConfig } = require("vite"); 5 | 6 | module.exports = defineConfig({ 7 | build: { 8 | outDir: "./lib", 9 | lib: { 10 | entry: path.resolve(__dirname, "src/index.tsx"), 11 | name: "column-drop", 12 | formats: ["cjs", "umd", "es"], 13 | fileName: (format) => { 14 | return `index.${format === "es" ? "m" : format}.js`; 15 | }, 16 | }, 17 | rollupOptions: { 18 | external: [ 19 | "react", 20 | "@bedrock-layout/type-utils", 21 | "@bedrock-layout/spacing-constants", 22 | ], 23 | }, 24 | }, 25 | }); 26 | -------------------------------------------------------------------------------- /packages/inline-cluster/vite.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | // vite.config.js 3 | const path = require("path"); 4 | const { defineConfig } = require("vite"); 5 | 6 | module.exports = defineConfig({ 7 | build: { 8 | outDir: "./lib", 9 | lib: { 10 | entry: path.resolve(__dirname, "src/index.tsx"), 11 | name: "masonry-ggrid", 12 | formats: ["cjs", "umd", "es"], 13 | fileName: (format) => { 14 | return `index.${format === "es" ? "m" : format}.js`; 15 | }, 16 | }, 17 | rollupOptions: { 18 | external: [ 19 | "react", 20 | "@bedrock-layout/type-utils", 21 | "@bedrock-layout/spacing-constants", 22 | ], 23 | }, 24 | }, 25 | }); 26 | -------------------------------------------------------------------------------- /stories/cover/Component.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export function Component() { 4 | return ( 5 |
6 | Nulla luctus nisl nec dui auctor volutpat. Phasellus condimentum elementum 7 | enim in pharetra. Curabitur eget urna cursus, imperdiet leo eu, elementum 8 | leo. Proin laoreet eleifend nisl ut iaculis. Ut dictum est vitae rutrum 9 | elementum. Donec dictum ex ac nibh auctor semper. Phasellus sed rhoncus 10 | arcu, eu consectetur ipsum. Ut dictum a elit at sollicitudin. Quisque sed 11 | augue molestie, auctor purus quis, luctus ipsum. Donec ultrices vel nisi 12 | vehicula facilisis. Vestibulum cursus nisi tellus, sit amet sagittis nisl 13 | luctus ut. 14 |
15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /packages/solid/src/theme-provider.tsx: -------------------------------------------------------------------------------- 1 | import { JSXElement, createContext, useContext } from "solid-js"; 2 | 3 | // eslint-disable-next-line @typescript-eslint/no-empty-interface 4 | export interface DefaultTheme {} 5 | 6 | const ThemeContext = createContext({}); 7 | 8 | export interface ThemeProviderProps { 9 | theme: DefaultTheme; 10 | children: JSXElement; 11 | } 12 | 13 | export function ThemeProvider(props: Readonly): JSXElement { 14 | return ( 15 | 16 | {props.children} 17 | 18 | ); 19 | } 20 | 21 | export function useTheme(): DefaultTheme { 22 | try { 23 | return useContext(ThemeContext); 24 | } catch (e) { 25 | return {}; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /stories/center/Component.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export function Component() { 4 | return ( 5 |
6 | Nulla luctus nisl nec dui auctor volutpat. Phasellus condimentum elementum 7 | enim in pharetra. Curabitur eget urna cursus, imperdiet leo eu, elementum 8 | leo. Proin laoreet eleifend nisl ut iaculis. Ut dictum est vitae rutrum 9 | elementum. Donec dictum ex ac nibh auctor semper. Phasellus sed rhoncus 10 | arcu, eu consectetur ipsum. Ut dictum a elit at sollicitudin. Quisque sed 11 | augue molestie, auctor purus quis, luctus ipsum. Donec ultrices vel nisi 12 | vehicula facilisis. Vestibulum cursus nisi tellus, sit amet sagittis nisl 13 | luctus ut. 14 |
15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /packages/appboundary/vite.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | // vite.config.js 3 | const path = require("path"); 4 | const { defineConfig } = require("vite"); 5 | 6 | module.exports = defineConfig({ 7 | build: { 8 | outDir: "./lib", 9 | lib: { 10 | entry: path.resolve(__dirname, "src/index.tsx"), 11 | name: "appboundary", 12 | formats: ["cjs", "umd", "es"], 13 | fileName: (format) => { 14 | return `index.${format === "es" ? "m" : format}.js`; 15 | }, 16 | }, 17 | rollupOptions: { 18 | external: [ 19 | "react", 20 | "@bedrock-layout/type-utils", 21 | "@bedrock-layout/spacing-constants", 22 | "@bedrock-layout/center", 23 | ], 24 | }, 25 | }, 26 | }); 27 | -------------------------------------------------------------------------------- /packages/css/README.md: -------------------------------------------------------------------------------- 1 | # `@bedrock-layout/css` 2 | 3 | Pure CSS version of the Bedrock Layout Primitives 4 | 5 | Full docs at: [bedrock-layout.dev](https://bedrock-layout.dev/) 6 | 7 | ## How to install 8 | 9 | `npm install @bedrock-layout/css` 10 | 11 | ## How to import 12 | 13 | You can import all the entire CSS bundle like this: 14 | 15 | ```javascript 16 | import '@bedrock-layout/css/lib/bedrock-layou.min.css'; 17 | ``` 18 | 19 | Or you can import just the parts you want from the components directory 20 | 21 | ```javascript 22 | import '@bedrock-layout/css/lib/components/spaceing-properties.min.css'; 23 | import '@bedrock-layout/css/lib/reset.min.css'; 24 | import '@bedrock-layout/css/lib/components/stack.min.css'; 25 | import '@bedrock-layout/css/lib/components/center.min.css'; 26 | ``` 27 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/CoverPage/playground.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable react/style-prop-object */ 2 | import { Cover, CoverProps } from "@bedrock-layout/solid"; 3 | import { JSXElement } from "solid-js"; 4 | 5 | export function Playground(props: Readonly): JSXElement { 6 | return ( 7 | {props.top}} 10 | bottom={
{props.bottom}
} 11 | > 12 |
13 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Fuga 14 | consequuntur corrupti beatae commodi vitae, perspiciatis totam provident 15 | architecto doloribus aperiam sapiente, incidunt nihil suscipit 16 | voluptatibus tempore est dolor! Iusto, vero. 17 |
18 |
19 | ); 20 | } 21 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/CenterPage/argTypes.ts: -------------------------------------------------------------------------------- 1 | import { ArgType } from "src/types/argType"; 2 | 3 | export const argTypes: ArgType = { 4 | maxWidth: { 5 | description: "Sets the max inline size of the component", 6 | summary: "CSSLength", 7 | defaultValue: "100%", 8 | initialValue: "100%", 9 | control: "text", 10 | }, 11 | centerText: { 12 | description: "Sets the text alignment of the component to be centered", 13 | defaultValue: "false", 14 | initialValue: false, 15 | summary: "boolean", 16 | control: "boolean", 17 | }, 18 | centerChildren: { 19 | description: 20 | "Sets the alignment of the component's children to be centered", 21 | defaultValue: "false", 22 | initialValue: false, 23 | summary: "boolean", 24 | control: "boolean", 25 | }, 26 | }; 27 | -------------------------------------------------------------------------------- /packages/masonry-grid/vite.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | // vite.config.js 3 | const path = require("path"); 4 | const { defineConfig } = require("vite"); 5 | 6 | module.exports = defineConfig({ 7 | build: { 8 | outDir: "./lib", 9 | lib: { 10 | entry: path.resolve(__dirname, "src/index.tsx"), 11 | name: "masonry-grid", 12 | formats: ["cjs", "umd", "es"], 13 | fileName: (format) => { 14 | return `index.${format === "es" ? "m" : format}.js`; 15 | }, 16 | }, 17 | rollupOptions: { 18 | external: [ 19 | "react", 20 | "@bedrock-layout/spacing-constants", 21 | "@bedrock-layout/type-utils", 22 | "@bedrock-layout/grid", 23 | "@bedrock-layout/use-resize-observer", 24 | ], 25 | }, 26 | }, 27 | }); 28 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/CoverPage/noStretch.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable react/style-prop-object */ 2 | import { Cover } from "@bedrock-layout/solid"; 3 | import { JSXElement } from "solid-js"; 4 | 5 | export function NoStretch(): JSXElement { 6 | return ( 7 | I am on top.} 12 | bottom={I am on bottom.} 13 | > 14 |
15 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Fuga 16 | consequuntur corrupti beatae commodi vitae, perspiciatis totam provident 17 | architecto doloribus aperiam sapiente, incidunt nihil suscipit 18 | voluptatibus tempore est dolor! Iusto, vero. 19 |
20 |
21 | ); 22 | } 23 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "react-app", 4 | "plugin:jsx-a11y/recommended", 5 | "eslint-config-prettier", 6 | "plugin:storybook/recommended", 7 | "plugin:functional/external-typescript-recommended", 8 | "plugin:functional/lite" 9 | ], 10 | "parser": "@typescript-eslint/parser", 11 | "parserOptions": { 12 | "project": true 13 | }, 14 | "plugins": ["jsx-a11y", "functional"], 15 | "ignorePatterns": [ 16 | "node_modules", 17 | "dist", 18 | "build", 19 | "storybook-static", 20 | "vite.config.js", 21 | "**/*.d.ts", 22 | "**/*.test.tsx", 23 | "**/*.test.ts", 24 | "**/*.config.js", 25 | "**/*build.ts" 26 | ], 27 | "rules": { 28 | "@typescript-eslint/explicit-function-return-type": 0, 29 | "no-console": "error", 30 | "functional/no-return-void": "off" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /knip.json: -------------------------------------------------------------------------------- 1 | { 2 | "ignore": [ 3 | ".storybook/**", 4 | "packages/**/__tests__/**", 5 | "examples/**", 6 | "stories/**", 7 | "packages/css/postcss.config.js", 8 | "packages/solid-doc-site/babel.config.js", 9 | "packages/solid/babel.config.js" 10 | ], 11 | "ignoreBinaries": ["knip", "yarn-deduplicate"], 12 | "ignoreDependencies": [ 13 | "tslib", 14 | "@typescript-eslint/eslint-plugin", 15 | "nx", 16 | "@radix-ui/.*", 17 | "@vitest/.*", 18 | "@storybook/.*", 19 | "@nrwl/.*", 20 | "@types/.*", 21 | "minify", 22 | "postcss", 23 | "postcss-cli", 24 | "prettier-plugin-import-sort", 25 | "typescript-eslint", 26 | "import-sort-style-module", 27 | "eslint-plugin-import", 28 | "eslint-plugin-prettier", 29 | "eslint-plugin-react", 30 | "eslint-plugin-react-hooks" 31 | ] 32 | } 33 | -------------------------------------------------------------------------------- /packages/solid/src/open-props.d.ts: -------------------------------------------------------------------------------- 1 | declare module "open-props" { 2 | export default { 3 | size000: "-.5rem", 4 | size00: "-.25rem", 5 | size1: ".25rem", 6 | size2: ".5rem", 7 | size3: "1rem", 8 | size4: "1.25rem", 9 | size5: "1.5rem", 10 | size6: "1.75rem", 11 | size7: "2rem", 12 | size8: "3rem", 13 | size9: "4rem", 14 | size10: "5rem", 15 | size11: "7.5rem", 16 | size12: "10rem", 17 | size13: "15rem", 18 | size14: "20rem", 19 | size15: "30rem", 20 | sizeContent1: "20ch", 21 | sizeContent2: "45ch", 22 | sizeContent3: "60ch", 23 | sizeHeader1: "20ch", 24 | sizeHeader2: "25ch", 25 | sizeHeader3: "35ch", 26 | sizeXxs: "240px", 27 | sizeXs: "360px", 28 | sizeSm: "480px", 29 | sizeMd: "768px", 30 | sizeLg: "1024px", 31 | sizeXl: "1440px", 32 | sizeXxl: "1920px", 33 | }; 34 | } 35 | -------------------------------------------------------------------------------- /stories/reel/argTypes.ts: -------------------------------------------------------------------------------- 1 | export const argTypes = { 2 | gutter: { 3 | control: "select", 4 | options: [ 5 | "size000", 6 | "size00", 7 | "size1", 8 | "size2", 9 | "size3", 10 | "size4", 11 | "size5", 12 | "size6", 13 | "size7", 14 | "size8", 15 | "size9", 16 | "size10", 17 | "size11", 18 | "size12", 19 | "size13", 20 | "size14", 21 | "size15", 22 | ], 23 | }, 24 | gap: { 25 | control: "select", 26 | options: [ 27 | "size000", 28 | "size00", 29 | "size1", 30 | "size2", 31 | "size3", 32 | "size4", 33 | "size5", 34 | "size6", 35 | "size7", 36 | "size8", 37 | "size9", 38 | "size10", 39 | "size11", 40 | "size12", 41 | "size13", 42 | "size14", 43 | "size15", 44 | ], 45 | }, 46 | }; 47 | -------------------------------------------------------------------------------- /stories/split/argTypes.ts: -------------------------------------------------------------------------------- 1 | export const argTypes = { 2 | gutter: { 3 | control: "select", 4 | options: [ 5 | "size000", 6 | "size00", 7 | "size1", 8 | "size2", 9 | "size3", 10 | "size4", 11 | "size5", 12 | "size6", 13 | "size7", 14 | "size8", 15 | "size9", 16 | "size10", 17 | "size11", 18 | "size12", 19 | "size13", 20 | "size14", 21 | "size15", 22 | ], 23 | }, 24 | gap: { 25 | control: "select", 26 | options: [ 27 | "size000", 28 | "size00", 29 | "size1", 30 | "size2", 31 | "size3", 32 | "size4", 33 | "size5", 34 | "size6", 35 | "size7", 36 | "size8", 37 | "size9", 38 | "size10", 39 | "size11", 40 | "size12", 41 | "size13", 42 | "size14", 43 | "size15", 44 | ], 45 | }, 46 | }; 47 | -------------------------------------------------------------------------------- /stories/stack/argTypes.ts: -------------------------------------------------------------------------------- 1 | export const argTypes = { 2 | gutter: { 3 | control: "select", 4 | options: [ 5 | "size000", 6 | "size00", 7 | "size1", 8 | "size2", 9 | "size3", 10 | "size4", 11 | "size5", 12 | "size6", 13 | "size7", 14 | "size8", 15 | "size9", 16 | "size10", 17 | "size11", 18 | "size12", 19 | "size13", 20 | "size14", 21 | "size15", 22 | ], 23 | }, 24 | gap: { 25 | control: "select", 26 | options: [ 27 | "size000", 28 | "size00", 29 | "size1", 30 | "size2", 31 | "size3", 32 | "size4", 33 | "size5", 34 | "size6", 35 | "size7", 36 | "size8", 37 | "size9", 38 | "size10", 39 | "size11", 40 | "size12", 41 | "size13", 42 | "size14", 43 | "size15", 44 | ], 45 | }, 46 | }; 47 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/ColumnDropPage/argTypes.ts: -------------------------------------------------------------------------------- 1 | import { spacing } from "@bedrock-layout/solid"; 2 | import { ArgType } from "src/types/argType"; 3 | 4 | export const argTypes: ArgType = { 5 | gap: { 6 | description: "Sets space between each element", 7 | summary: "Space", 8 | defaultValue: "0px", 9 | initialValue: "space3", 10 | control: "select", 11 | options: Object.keys(spacing), 12 | }, 13 | minItemWidth: { 14 | description: "Sets the minItemWidth of each of the children", 15 | summary: "CSSLength", 16 | defaultValue: "159px", 17 | initialValue: "15rem", 18 | control: "text", 19 | }, 20 | noStretchedColumns: { 21 | description: 22 | "If true, the columns will not be stretched to fill the container", 23 | summary: "boolean", 24 | defaultValue: "false", 25 | initialValue: false, 26 | control: "boolean", 27 | }, 28 | }; 29 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/GridPage/argTypes.ts: -------------------------------------------------------------------------------- 1 | import { spacing } from "@bedrock-layout/solid"; 2 | import { ArgType } from "src/types/argType"; 3 | 4 | export const argTypes: ArgType = { 5 | gap: { 6 | description: "Sets space between each element", 7 | summary: "Space", 8 | defaultValue: "0px", 9 | initialValue: "size3", 10 | control: "select", 11 | options: Object.keys(spacing), 12 | }, 13 | variant: { 14 | description: "Sets the variant of the grid to be default grid or masonry", 15 | summary: "grid | masonry", 16 | defaultValue: "grid", 17 | initialValue: "grid", 18 | control: "select", 19 | options: ["grid", "masonry"], 20 | }, 21 | minItemWidth: { 22 | description: "Sets the basis of each of the children", 23 | summary: "CSSLength", 24 | defaultValue: "639px", 25 | initialValue: "20rem", 26 | control: "text", 27 | }, 28 | }; 29 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/components/Story.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable react/style-prop-object */ 2 | import { PadBox, Stack } from "@bedrock-layout/solid"; 3 | import dedent from "dedent"; 4 | import { JSX } from "solid-js"; 5 | 6 | import { CodeBlock } from "./CodeBlock"; 7 | 8 | export function Story( 9 | props: Readonly<{ 10 | children: JSX.Element; 11 | code: 12 | | string 13 | | ((props: { dedent: (literals: string) => string }) => string); 14 | }>, 15 | ): JSX.Element { 16 | const finalCode = 17 | typeof props.code === "string" ? props.code : props.code({ dedent }); 18 | 19 | return ( 20 | 21 | 27 | {props.children} 28 | 29 | 30 | 31 | ); 32 | } 33 | -------------------------------------------------------------------------------- /.storybook/ui-components/Button.ts: -------------------------------------------------------------------------------- 1 | import styled from "styled-components"; 2 | 3 | import { PadBox } from "../../packages/padbox/src"; 4 | 5 | export const Button = styled.button.attrs<{ 6 | primary?: boolean; 7 | icon?: boolean; 8 | as?: string; 9 | }>((props) => { 10 | return { 11 | padding: props.icon ? "size2" : ["size3", "size7"], 12 | forwardedAs: props.as ?? "button", 13 | as: PadBox, 14 | }; 15 | })<{ 16 | primary?: boolean; 17 | icon?: boolean; 18 | }>` 19 | border-radius: 0.5rem; 20 | border: none; 21 | background-color: ${({ primary }) => 22 | primary ? "var(--gray-0)" : "var(--gray-10)"}; 23 | text-decoration: none; 24 | text-align: center; 25 | && { 26 | color: ${({ primary }) => (primary ? "var(--gray-10)" : "var(--gray-0)")}; 27 | } 28 | :disabled { 29 | opacity: 0.5; 30 | font-size: 1rem; 31 | } 32 | :active { 33 | transform: scale(0.95); 34 | } 35 | `; 36 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/SplitPage/argTypes.ts: -------------------------------------------------------------------------------- 1 | import { spacing } from "@bedrock-layout/solid"; 2 | import { ArgType } from "src/types/argType"; 3 | 4 | export const argTypes: ArgType = { 5 | gap: { 6 | description: "Sets space between each element", 7 | summary: "Space", 8 | defaultValue: "0px", 9 | control: "select", 10 | initialValue: "size3", 11 | options: Object.keys(spacing), 12 | }, 13 | switchAt: { 14 | description: 15 | "Sets the width threshold that the split will switch to a Stack layout", 16 | 17 | summary: "string | number", 18 | control: "text", 19 | initialValue: "25rem", 20 | }, 21 | fraction: { 22 | description: "Sets the fractional split", 23 | summary: "string", 24 | initialValue: "1/2", 25 | defaultValue: "1/2", 26 | control: "select", 27 | options: ["auto-start", "auto-end", "1/4", "1/3", "1/2", "2/3", "3/4"], 28 | }, 29 | }; 30 | -------------------------------------------------------------------------------- /.github/workflows/chromatic.yml: -------------------------------------------------------------------------------- 1 | # .github/workflows/chromatic.yml 2 | 3 | # Workflow name 4 | name: "Chromatic" 5 | 6 | # Event for the workflow 7 | on: pull_request 8 | 9 | # List of jobs 10 | jobs: 11 | chromatic-deployment: 12 | # Operating System 13 | runs-on: ubuntu-latest 14 | # Job steps 15 | steps: 16 | - uses: actions/checkout@v1 17 | - name: Install dependencies 18 | run: yarn 19 | # 👇 Adds Chromatic as a step in the workflow 20 | - name: Publish to Chromatic 21 | uses: chromaui/action@v1 22 | # Chromatic GitHub Action options 23 | with: 24 | token: ${{ secrets.GITHUB_TOKEN }} 25 | # 👇 Chromatic projectToken, refer to the manage page to obtain it. 26 | projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} 27 | exitZeroOnChanges: false 28 | buildScriptName: build:storybook 29 | onlyChanged: true 30 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/index.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable react/style-prop-object */ 2 | import "@bedrock-layout/css/lib/reset.min.css"; 3 | import "@bedrock-layout/css/lib/bedrock-layout.min.css"; 4 | import "open-props/style"; 5 | import "highlight.js/styles/atom-one-dark.css"; 6 | 7 | import "./global-styles.css"; 8 | 9 | import { Center, Cover } from "@bedrock-layout/solid"; 10 | import { Router } from "@solidjs/router"; 11 | /* @refresh reload */ 12 | import { render } from "solid-js/web"; 13 | 14 | import App from "./App"; 15 | 16 | render( 17 | () => ( 18 | 19 |
24 | 25 | 26 | 27 |
28 |
29 | ), 30 | document.getElementById("root") as HTMLElement, 31 | ); 32 | -------------------------------------------------------------------------------- /vite.config.js: -------------------------------------------------------------------------------- 1 | /// 2 | import reactRefresh from "@vitejs/plugin-react-refresh"; 3 | import { defineConfig } from "vite"; 4 | 5 | export default defineConfig({ 6 | plugins: [reactRefresh()], 7 | test: { 8 | globals: true, 9 | environment: "jsdom", 10 | setupFiles: ["./setupTest.js"], 11 | exclude: [ 12 | "**/node_modules/**", 13 | "**/dist/**", 14 | "**/cypress/**", 15 | "**/.{idea,git,cache,output,temp}/**", 16 | "**/lib/**", 17 | ], 18 | coverage: { 19 | reporter: ["text", "json", "html"], 20 | statements: 98, 21 | branches: 95, 22 | functions: 97, 23 | lines: 98, 24 | exclude: [ 25 | "**/node_modules/**", 26 | "**/dist/**", 27 | "**/cypress/**", 28 | "**/.{idea,git,cache,output,temp}/**", 29 | "**/lib/**", 30 | "**/__tests__/**", 31 | ], 32 | }, 33 | }, 34 | }); 35 | -------------------------------------------------------------------------------- /stories/cover/argTypes.ts: -------------------------------------------------------------------------------- 1 | export const argTypes = { 2 | gutter: { 3 | control: "select", 4 | options: [ 5 | "size000", 6 | "size00", 7 | "size1", 8 | "size2", 9 | "size3", 10 | "size4", 11 | "size5", 12 | "size6", 13 | "size7", 14 | "size8", 15 | "size9", 16 | "size10", 17 | "size11", 18 | "size12", 19 | "size13", 20 | "size14", 21 | "size15", 22 | ], 23 | }, 24 | gap: { 25 | control: "select", 26 | options: [ 27 | "size000", 28 | "size00", 29 | "size1", 30 | "size2", 31 | "size3", 32 | "size4", 33 | "size5", 34 | "size6", 35 | "size7", 36 | "size8", 37 | "size9", 38 | "size10", 39 | "size11", 40 | "size12", 41 | "size13", 42 | "size14", 43 | "size15", 44 | ], 45 | }, 46 | minHeight: { 47 | control: "text", 48 | }, 49 | }; 50 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ![Bedrock Layout Primitives](https://user-images.githubusercontent.com/5460770/77477816-8df68000-6de2-11ea-83be-9f12c8de7f0d.png) 2 | 3 | ## Foundational Layout Primitives for your React App 4 | 5 | [![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/) 6 | [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) 7 | ![Build Status](https://github.com/Bedrock-Layouts/Bedrock/actions/workflows/verify.yml/badge.svg) 8 | ![GitHub](https://img.shields.io/github/license/Bedrock-Layouts/Bedrock) 9 | ![GitHub Repo stars](https://img.shields.io/github/stars/Bedrock-Layouts/Bedrock?style=social) 10 | 11 | Full docs at: [bedrock-layout.dev](https://bedrock-layout.dev/) 12 | 13 | ## Contributors 14 | 15 | Thank you to everyone who has contributed code so far. 16 | 17 | ![GitHub Contributors Image](https://contrib.rocks/image?repo=Bedrock-Layouts/Bedrock) 18 | -------------------------------------------------------------------------------- /tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "skipLibCheck": true, 4 | "allowJs": true, 5 | "allowSyntheticDefaultImports": true, 6 | "alwaysStrict": true, 7 | "declaration": false, 8 | "emitDecoratorMetadata": false, 9 | "esModuleInterop": true, 10 | "experimentalDecorators": false, 11 | "importHelpers": true, 12 | "jsx": "react", 13 | "lib": ["esnext", "dom"], 14 | "moduleResolution": "bundler", 15 | "noFallthroughCasesInSwitch": false, 16 | "noImplicitAny": true, 17 | "noImplicitReturns": true, 18 | "noImplicitThis": true, 19 | "noUnusedLocals": false, 20 | "noUnusedParameters": false, 21 | "pretty": true, 22 | "sourceMap": true, 23 | "strict": true, 24 | "strictFunctionTypes": true, 25 | "strictNullChecks": true, 26 | "strictPropertyInitialization": true, 27 | "stripInternal": true, 28 | "target": "esnext", 29 | "types": ["vitest/globals", "vite/client"] 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/InlineClusterPage/argTypes.ts: -------------------------------------------------------------------------------- 1 | import { spacing } from "@bedrock-layout/solid"; 2 | import { ArgType } from "src/types/argType"; 3 | 4 | export const argTypes: ArgType = { 5 | gap: { 6 | description: "Sets space between each element", 7 | summary: "Space", 8 | defaultValue: "0px", 9 | initialValue: "size3", 10 | control: "select", 11 | options: Object.keys(spacing), 12 | }, 13 | justify: { 14 | description: "Sets the inline justification of the children", 15 | summary: "start | end | center", 16 | defaultValue: "start", 17 | initialValue: "start", 18 | control: "select", 19 | options: ["start", "end", "center"], 20 | }, 21 | align: { 22 | description: "Sets the block alignment of the children", 23 | summary: "start | end | center | stretch", 24 | defaultValue: "start", 25 | initialValue: "start", 26 | control: "select", 27 | options: ["start", "end", "center", "stretch"], 28 | }, 29 | }; 30 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/InlinePage/stretch.tsx: -------------------------------------------------------------------------------- 1 | import { Inline } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | import { Box } from "../../components/Box"; 5 | 6 | export function Stretch(): JSXElement { 7 | return ( 8 | <> 9 |

start

10 | 11 | 12 | 13 | 14 | 15 | 16 |

end

17 | 18 | 19 | 20 | 21 | 22 | 23 |

all

24 | 25 | 26 | 27 | 28 | 29 | 30 |

2 index

31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | ); 39 | } 40 | -------------------------------------------------------------------------------- /packages/primitives/README.md: -------------------------------------------------------------------------------- 1 | # `@bedrock-layout/primitives` 2 | 3 | All the primitives and hooks in a single package. 4 | 5 | Full docs at: [bedrock-layout.dev](https://bedrock-layout.dev/) 6 | 7 | ## How to install 8 | 9 | `npm install @bedrock-layout/primitives` 10 | 11 | or 12 | 13 | `yarn add @bedrock-laylock/primitives` 14 | 15 | --- 16 | 17 | ## Usage 18 | 19 | ```javascript 20 | import { Stack, Inline, Split, Cover, Frame } from '@bedrock-layout/primitives'; 21 | 22 | export function Hero() { 23 | return ( 24 | 25 | {/* */} 26 | 27 | 28 | 29 |

{/* */}

30 |

{/* */}

31 | 32 | 33 | 34 | 35 |
36 |
37 | 38 | 39 | 40 |
41 |
42 | ); 43 | } 44 | ``` 45 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/CenterPage/maxWidth.tsx: -------------------------------------------------------------------------------- 1 | import { Center } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | export function MaxWidth(): JSXElement { 5 | return ( 6 |
12 |
13 | Nulla luctus nisl nec dui auctor volutpat. Phasellus condimentum 14 | elementum enim in pharetra. Curabitur eget urna cursus, imperdiet leo 15 | eu, elementum leo. Proin laoreet eleifend nisl ut iaculis. Ut dictum est 16 | vitae rutrum elementum. Donec dictum ex ac nibh auctor semper. Phasellus 17 | sed rhoncus arcu, eu consectetur ipsum. Ut dictum a elit at 18 | sollicitudin. Quisque sed augue molestie, auctor purus quis, luctus 19 | ipsum. Donec ultrices vel nisi vehicula facilisis. Vestibulum cursus 20 | nisi tellus, sit amet sagittis nisl luctus ut. 21 |
22 |
23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /packages/solid/README.md: -------------------------------------------------------------------------------- 1 | # `@bedrock-layout/solid` 2 | 3 | All the layout primitives and solid primitives in a single package. 4 | 5 | Full docs at: [solid.bedrock-layout.dev](https://solid.bedrock-layout.dev/) 6 | 7 | ## How to install 8 | 9 | `npm install @bedrock-layout/solid` 10 | 11 | or 12 | 13 | `yarn add @bedrock-laylock/solid` 14 | 15 | --- 16 | 17 | ## Usage 18 | 19 | ```javascript 20 | import { Stack, Inline, Split, Cover, Frame } from '@bedrock-layout/solid'; 21 | 22 | export function Hero() { 23 | return ( 24 | 25 | {/* */} 26 | 27 | 28 | 29 |

{/* */}

30 |

{/* */}

31 | 32 | 33 | 34 | 35 |
36 |
37 | 38 | 39 | 40 |
41 |
42 | ); 43 | } 44 | ``` 45 | -------------------------------------------------------------------------------- /packages/solid-doc-site/README.md: -------------------------------------------------------------------------------- 1 | # `@bedrock-layout/solid` 2 | 3 | All the layout primitives and solid primitives in a single package. 4 | 5 | Full docs at: [solid.bedrock-layout.dev](https://solid.bedrock-layout.dev/) 6 | 7 | ## How to install 8 | 9 | `npm install @bedrock-layout/solid` 10 | 11 | or 12 | 13 | `yarn add @bedrock-laylock/solid` 14 | 15 | --- 16 | 17 | ## Usage 18 | 19 | ```javascript 20 | import { Stack, Inline, Split, Cover, Frame } from '@bedrock-layout/solid'; 21 | 22 | export function Hero() { 23 | return ( 24 | 25 | {/* */} 26 | 27 | 28 | 29 |

{/* */}

30 |

{/* */}

31 | 32 | 33 | 34 | 35 |
36 |
37 | 38 | 39 | 40 |
41 |
42 | ); 43 | } 44 | ``` 45 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/CenterPage/centerText.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable react/style-prop-object */ 2 | import { Center } from "@bedrock-layout/solid"; 3 | import { JSXElement } from "solid-js"; 4 | 5 | export function CenterText(): JSXElement { 6 | return ( 7 |
8 |
9 | Nulla luctus nisl nec dui auctor volutpat. Phasellus condimentum 10 | elementum enim in pharetra. Curabitur eget urna cursus, imperdiet leo 11 | eu, elementum leo. Proin laoreet eleifend nisl ut iaculis. Ut dictum est 12 | vitae rutrum elementum. Donec dictum ex ac nibh auctor semper. Phasellus 13 | sed rhoncus arcu, eu consectetur ipsum. Ut dictum a elit at 14 | sollicitudin. Quisque sed augue molestie, auctor purus quis, luctus 15 | ipsum. Donec ultrices vel nisi vehicula facilisis. Vestibulum cursus 16 | nisi tellus, sit amet sagittis nisl luctus ut. 17 |
18 |
19 | ); 20 | } 21 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/PadBoxPage/paddingObject.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable react/style-prop-object */ 2 | import { PadBox } from "@bedrock-layout/solid"; 3 | import { JSXElement } from "solid-js"; 4 | 5 | export function PaddingObject(): JSXElement { 6 | return ( 7 | <> 8 |

With an object of values

9 |
10 |         
11 |           {JSON.stringify(
12 |             { top: "size3", inlineEnd: "size7", blockEnd: "size1" },
13 |             null,
14 |             3,
15 |           )}
16 |         
17 |       
18 | 22 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Fuga 23 | consequuntur corrupti beatae commodi vitae, perspiciatis totam provident 24 | architecto doloribus aperiam sapiente, incidunt nihil suscipit 25 | voluptatibus tempore est dolor! Iusto, vero. 26 | 27 | 28 | ); 29 | } 30 | -------------------------------------------------------------------------------- /stories/grid/argTypes.ts: -------------------------------------------------------------------------------- 1 | export const argTypes = { 2 | gutter: { 3 | control: "select", 4 | options: [ 5 | "size000", 6 | "size00", 7 | "size1", 8 | "size2", 9 | "size3", 10 | "size4", 11 | "size5", 12 | "size6", 13 | "size7", 14 | "size8", 15 | "size9", 16 | "size10", 17 | "size11", 18 | "size12", 19 | "size13", 20 | "size14", 21 | "size15", 22 | ], 23 | }, 24 | gap: { 25 | control: "select", 26 | options: [ 27 | "size000", 28 | "size00", 29 | "size1", 30 | "size2", 31 | "size3", 32 | "size4", 33 | "size5", 34 | "size6", 35 | "size7", 36 | "size8", 37 | "size9", 38 | "size10", 39 | "size11", 40 | "size12", 41 | "size13", 42 | "size14", 43 | "size15", 44 | ], 45 | }, 46 | variant: { 47 | control: "select", 48 | options: ["grid", "masonry"], 49 | }, 50 | minItemWidth: { 51 | control: "text", 52 | }, 53 | }; 54 | -------------------------------------------------------------------------------- /packages/primitives/src/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "@bedrock-layout/appboundary"; 2 | export * from "@bedrock-layout/center"; 3 | export * from "@bedrock-layout/column-drop"; 4 | export * from "@bedrock-layout/columns"; 5 | export * from "@bedrock-layout/cover"; 6 | export * from "@bedrock-layout/frame"; 7 | export * from "@bedrock-layout/grid"; 8 | export * from "@bedrock-layout/inline"; 9 | export * from "@bedrock-layout/inline-cluster"; 10 | export * from "@bedrock-layout/masonry-grid"; 11 | export * from "@bedrock-layout/padbox"; 12 | export * from "@bedrock-layout/reel"; 13 | export * from "@bedrock-layout/register-resize-callback"; 14 | export * from "@bedrock-layout/spacing-constants"; 15 | export * from "@bedrock-layout/split"; 16 | export * from "@bedrock-layout/stack"; 17 | export { useContainerQuery } from "@bedrock-layout/use-container-query"; 18 | export { useForwardedRef } from "@bedrock-layout/use-forwarded-ref"; 19 | export { useResizeObserver } from "@bedrock-layout/use-resize-observer"; 20 | export { useStatefulRef } from "@bedrock-layout/use-stateful-ref"; 21 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/CenterPage/playground.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable react/style-prop-object */ 2 | import { Center, CenterProps } from "@bedrock-layout/solid"; 3 | import { JSXElement } from "solid-js"; 4 | 5 | export function Playground(props: Readonly): JSXElement { 6 | return ( 7 |
8 |
9 | Nulla luctus nisl nec dui auctor volutpat. Phasellus condimentum 10 | elementum enim in pharetra. Curabitur eget urna cursus, imperdiet leo 11 | eu, elementum leo. Proin laoreet eleifend nisl ut iaculis. Ut dictum est 12 | vitae rutrum elementum. Donec dictum ex ac nibh auctor semper. Phasellus 13 | sed rhoncus arcu, eu consectetur ipsum. Ut dictum a elit at 14 | sollicitudin. Quisque sed augue molestie, auctor purus quis, luctus 15 | ipsum. Donec ultrices vel nisi vehicula facilisis. Vestibulum cursus 16 | nisi tellus, sit amet sagittis nisl luctus ut. 17 |
18 |
19 | ); 20 | } 21 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/CenterPage/centerChildren.tsx: -------------------------------------------------------------------------------- 1 | import { Center } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | export function CenterChildren(): JSXElement { 5 | return ( 6 |
12 |
17 | Nulla luctus nisl nec dui auctor volutpat. Phasellus condimentum 18 | elementum enim in pharetra. Curabitur eget urna cursus, imperdiet leo 19 | eu, elementum leo. Proin laoreet eleifend nisl ut iaculis. Ut dictum est 20 | vitae rutrum elementum. Donec dictum ex ac nibh auctor semper. Phasellus 21 | sed rhoncus arcu, eu consectetur ipsum. Ut dictum a elit at 22 | sollicitudin. Quisque sed augue molestie, auctor purus quis, luctus 23 | ipsum. Donec ultrices vel nisi vehicula facilisis. Vestibulum cursus 24 | nisi tellus, sit amet sagittis nisl luctus ut. 25 |
26 |
27 | ); 28 | } 29 | -------------------------------------------------------------------------------- /examples/plans.ts: -------------------------------------------------------------------------------- 1 | export const plans = [ 2 | { 3 | planName: "Freelancer", 4 | description: "The essentials to provide your best work for clients.", 5 | price: 15, 6 | benefits: [ 7 | "5 products", 8 | "Up to 1,000 subscribers", 9 | "Basic analytics", 10 | "48-hour support response time", 11 | ], 12 | }, 13 | { 14 | planName: "Startup", 15 | description: "A plan that scales with your rapidly growing business.", 16 | price: 30, 17 | benefits: [ 18 | "25 products", 19 | "Up to 10,000 subscribers", 20 | "Advanced analytics", 21 | "24-hour support response time", 22 | "Marketing automations", 23 | ], 24 | }, 25 | { 26 | planName: "Enterprise", 27 | description: "Dedicated support and infrastructure for your company.", 28 | price: 60, 29 | benefits: [ 30 | "Unlimited products", 31 | "Unlimited subscribers", 32 | "Advanced analytics", 33 | "1-hour dedicated support response time", 34 | "Marketing automations", 35 | "Custom reporting tools", 36 | ], 37 | }, 38 | ]; 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Bedrock-Layouts 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /stories/inline-cluster/argTypes.ts: -------------------------------------------------------------------------------- 1 | export const argTypes = { 2 | gutter: { 3 | control: "select", 4 | options: [ 5 | "size000", 6 | "size00", 7 | "size1", 8 | "size2", 9 | "size3", 10 | "size4", 11 | "size5", 12 | "size6", 13 | "size7", 14 | "size8", 15 | "size9", 16 | "size10", 17 | "size11", 18 | "size12", 19 | "size13", 20 | "size14", 21 | "size15", 22 | ], 23 | }, 24 | gap: { 25 | control: "select", 26 | options: [ 27 | "size000", 28 | "size00", 29 | "size1", 30 | "size2", 31 | "size3", 32 | "size4", 33 | "size5", 34 | "size6", 35 | "size7", 36 | "size8", 37 | "size9", 38 | "size10", 39 | "size11", 40 | "size12", 41 | "size13", 42 | "size14", 43 | "size15", 44 | ], 45 | }, 46 | justify: { 47 | control: "select", 48 | options: ["start", "end", "center", "space-between", "space-around"], 49 | }, 50 | align: { 51 | control: "select", 52 | options: ["start", "end", "center", "stretch"], 53 | }, 54 | }; 55 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/StackPage/align.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable react/style-prop-object */ 2 | import { Stack } from "@bedrock-layout/solid"; 3 | import { JSXElement } from "solid-js"; 4 | 5 | import { Box } from "../../components/Box"; 6 | 7 | export function Align(): JSXElement { 8 | return ( 9 | <> 10 |

start

11 | 12 | 13 | 14 | 15 | 16 |

end

17 | 18 | 19 | 20 | 21 | 22 |

center

23 | 24 | 25 | 26 | 27 | 28 |

stretch

29 | 30 | 31 | 32 | 33 | 34 | 35 | ); 36 | } 37 | -------------------------------------------------------------------------------- /stories/column-drop/argTypes.ts: -------------------------------------------------------------------------------- 1 | export const argTypes = { 2 | gutter: { 3 | control: "select", 4 | options: [ 5 | "size000", 6 | "size00", 7 | "size1", 8 | "size2", 9 | "size3", 10 | "size4", 11 | "size5", 12 | "size6", 13 | "size7", 14 | "size8", 15 | "size9", 16 | "size10", 17 | "size11", 18 | "size12", 19 | "size13", 20 | "size14", 21 | "size15", 22 | ], 23 | }, 24 | gap: { 25 | control: "select", 26 | options: [ 27 | "size000", 28 | "size00", 29 | "size1", 30 | "size2", 31 | "size3", 32 | "size4", 33 | "size5", 34 | "size6", 35 | "size7", 36 | "size8", 37 | "size9", 38 | "size10", 39 | "size11", 40 | "size12", 41 | "size13", 42 | "size14", 43 | "size15", 44 | ], 45 | }, 46 | minItemWidth: { 47 | control: "text", 48 | }, 49 | noStretchedColumns: { 50 | control: "boolean", 51 | }, 52 | variant: { 53 | control: "select", 54 | options: ["default", "centered"], 55 | }, 56 | as: { 57 | control: "none", 58 | }, 59 | }; 60 | -------------------------------------------------------------------------------- /packages/css/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bedrock-layout/css", 3 | "version": "2.14.0", 4 | "description": "bedrock-layout css version", 5 | "sideEffects": false, 6 | "private": false, 7 | "publishConfig": { 8 | "access": "public" 9 | }, 10 | "keywords": [ 11 | "css", 12 | "layout", 13 | "react" 14 | ], 15 | "author": "Jarvis1010 ", 16 | "homepage": "https://bedrock-layout.dev/", 17 | "license": "MIT", 18 | "unpkg": "lib/bedrock-layout.min.css", 19 | "main": "lib/bedrock-layout.min.css", 20 | "module": "lib/bedrock-layout.min.css", 21 | "style": "bedrock-layout.min.css", 22 | "source": "src/bedrock-layout.css", 23 | "directories": { 24 | "lib": "lib" 25 | }, 26 | "files": [ 27 | "lib" 28 | ], 29 | "repository": { 30 | "type": "git", 31 | "url": "git+https://github.com/Bedrock-Layouts/Bedrock.git" 32 | }, 33 | "scripts": { 34 | "test": "echo \"Error: run tests from root\" && exit 1", 35 | "clean:build": "rimraf lib", 36 | "build": "ts-node build.ts" 37 | }, 38 | "bugs": { 39 | "url": "https://github.com/Bedrock-Layouts/Bedrock/issues" 40 | }, 41 | "nx": {} 42 | } 43 | -------------------------------------------------------------------------------- /stories/use-stateful-ref/useStatefulRef.mdx: -------------------------------------------------------------------------------- 1 | import { Meta } from "@storybook/addon-docs"; 2 | 3 | 4 | 5 | # useStatefulRef 6 | 7 | React RefObjects are not stateful, or in other words, changing the `current` property on the RefObject doesn't trigger a rerender. 8 | One can use a ref callback to updated state, but now we are no longer using RefObjects and there is great power in consistency and knowing we will be getting a 9 | RefObject every time. `useStatefulRef` will return a RefObject that can be passed around and used just like any other RefObject, except that changes to the `current` 10 | property will trigger a rerender just like updating state. 11 | 12 | ## Use case 13 | 14 | Anytime you want a RefObject that will trigger a rerender when the `current` property is updated 15 | 16 | ## How to install 17 | 18 | ```bash 19 | npm install @bedrock-layout/use-stateful-ref 20 | ``` 21 | 22 | ## Basic usage 23 | 24 | ```javascript 25 | const App = () => { 26 | const ref = useStatefulRef(null); 27 | //... Use the ref object will trigger a rerender 28 | return
{...content}
; 29 | }; 30 | ``` 31 | -------------------------------------------------------------------------------- /netlify.toml: -------------------------------------------------------------------------------- 1 | [[redirects]] 2 | force = true 3 | from = "/src-components-use-forwarded-ref" 4 | status = 301 5 | to = "/?path=/docs/hooks-useforwardedref--docs" 6 | 7 | [[redirects]] 8 | force = true 9 | from = "/sb-addons/.storybook/manager-bundle.css" 10 | status = 301 11 | to = "/sb-addons/storybook/manager-bundle.css" 12 | 13 | [[redirects]] 14 | force = true 15 | from = "/sb-addons/.storybook/manager-bundle.css.LEGAL.txt" 16 | status = 301 17 | to = "/sb-addons/storybook/manager-bundle.css.LEGAL.txt" 18 | 19 | [[redirects]] 20 | force = true 21 | from = "/sb-addons/.storybook/manager-bundle.css.map" 22 | status = 301 23 | to = "/sb-addons/storybook/manager-bundle.css.map" 24 | 25 | [[redirects]] 26 | force = true 27 | from = "/sb-addons/.storybook/manager-bundle.mjs" 28 | status = 301 29 | to = "/sb-addons/storybook/manager-bundle.mjs" 30 | 31 | [[redirects]] 32 | force = true 33 | from = "/sb-addons/.storybook/manager-bundle.mjs.LEGAL.txt" 34 | status = 301 35 | to = "/sb-addons/storybook/manager-bundle.mjs.LEGAL.txt" 36 | 37 | [[redirects]] 38 | force = true 39 | from = "/sb-addons/.storybook/manager-bundle.mjs.map" 40 | status = 301 41 | to = "/sb-addons/storybook/manager-bundle.mjs.map" 42 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/ReelPage/snap.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable react/style-prop-object */ 2 | import { Reel } from "@bedrock-layout/solid"; 3 | import { JSXElement } from "solid-js"; 4 | 5 | import { Box } from "../../components/Box"; 6 | import { colors } from "./colors"; 7 | 8 | export function SnapType(): JSXElement { 9 | return ( 10 | <> 11 |

none

12 |

scroll to the right to see the next item

13 | 14 | {colors.map((color) => { 15 | return ; 16 | })} 17 | 18 |

mandatory

19 |

scroll to the right to see the next item

20 | 21 | {colors.map((color) => { 22 | return ; 23 | })} 24 | 25 |

proximity

26 |

scroll to the right to see the next item

27 | 28 | {colors.map((color) => { 29 | return ; 30 | })} 31 | 32 | 33 | ); 34 | } 35 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/InlineClusterPage/align.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable react/style-prop-object */ 2 | import { InlineCluster } from "@bedrock-layout/solid"; 3 | import { JSXElement } from "solid-js"; 4 | 5 | import { Box } from "../../components/Box"; 6 | 7 | export function Align(): JSXElement { 8 | return ( 9 | <> 10 |

start

11 | 12 | 13 | 14 | 15 | 16 |

end

17 | 18 | 19 | 20 | 21 | 22 |

center

23 | 24 | 25 | 26 | 27 | 28 |

stretch

29 | 30 | 31 | 32 | 33 | 34 | 35 | ); 36 | } 37 | -------------------------------------------------------------------------------- /.storybook/preview.ts: -------------------------------------------------------------------------------- 1 | import "open-props/style"; 2 | 3 | import "../packages/css/lib/bedrock-layout.min.css"; 4 | import "./styles.css"; 5 | import "./i18n"; 6 | 7 | import { create } from "@storybook/theming"; 8 | 9 | import { template } from "./autodocTemplate"; 10 | 11 | export const parameters = { 12 | viewMode: "docs", 13 | previewTabs: { canvas: { hidden: true } }, 14 | docs: { 15 | theme: create({ 16 | base: "dark", 17 | }), 18 | page: template, 19 | toc: { disabled: false, headingSelector: "h2, h3" }, 20 | }, 21 | options: { 22 | storySort: { 23 | order: [ 24 | "Overview", 25 | "Getting Started", 26 | "Examples", 27 | "Spacer Components", 28 | "Wrapper Components", 29 | "Primitives", 30 | "Bedrock Layout CSS", 31 | ["A CSS Only Version", "reset.css", "spacing-properties.css"], 32 | "Hooks", 33 | ], 34 | }, 35 | }, 36 | }; 37 | 38 | export const globalTypes = { 39 | locale: { 40 | title: "Locale", 41 | description: "Internationalization locale", 42 | toolbar: { 43 | icon: "globe", 44 | items: [ 45 | { value: "en", title: "English" }, 46 | { value: "es", title: "Spanish" }, 47 | ], 48 | }, 49 | }, 50 | }; 51 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/CoverPage/argTypes.ts: -------------------------------------------------------------------------------- 1 | import { spacing } from "@bedrock-layout/solid"; 2 | import { ArgType } from "src/types/argType"; 3 | 4 | export const argTypes: ArgType = { 5 | gap: { 6 | description: "Sets space between each element", 7 | summary: "Space", 8 | defaultValue: "0px", 9 | initialValue: "size3", 10 | control: "select", 11 | options: Object.keys(spacing), 12 | }, 13 | stretchContent: { 14 | description: "Stretch the content of the children to fill the container", 15 | defaultValue: "false", 16 | initialValue: false, 17 | summary: "boolean", 18 | control: "boolean", 19 | }, 20 | minHeight: { 21 | description: "Sets the minimum block size of the component", 22 | summary: "CSSLength", 23 | initialValue: "25vh", 24 | defaultValue: "100vh", 25 | control: "text", 26 | }, 27 | top: { 28 | description: "renders an Node before the children", 29 | summary: "JSXElement", 30 | initialValue: "I am on top", 31 | defaultValue: "-", 32 | control: "text", 33 | }, 34 | bottom: { 35 | description: "renders an Node after the children", 36 | summary: "JSXElement", 37 | initialValue: "I am on bottom", 38 | defaultValue: "-", 39 | control: "text", 40 | }, 41 | }; 42 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/SplitPage/fractions.tsx: -------------------------------------------------------------------------------- 1 | import { Split } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | import { Box } from "../../components/Box"; 5 | 6 | export function Fraction(): JSXElement { 7 | return ( 8 | <> 9 |

1/4

10 | 11 | 12 | 13 | 14 |

1/3

15 | 16 | 17 | 18 | 19 |

1/2

20 | 21 | 22 | 23 | 24 |

2/3

25 | 26 | 27 | 28 | 29 |

3/4

30 | 31 | 32 | 33 | 34 |

auto-start

35 |

(The first box has a width of 100px)

36 | 37 | 38 | 39 | 40 |

auto-end

41 |

(The second box has a width of 100px)

42 | 43 | 44 | 45 | 46 | 47 | ); 48 | } 49 | -------------------------------------------------------------------------------- /packages/frame/README.md: -------------------------------------------------------------------------------- 1 | # `@bedrock-layout/frame` 2 | 3 | `Frame` is a layout helper that frames the content into the desired aspect ratio. 4 | 5 | Full docs at: [bedrock-layout.dev](https://bedrock-layout.dev/) 6 | 7 | --- 8 | 9 | ## When to Use 10 | 11 | Use Frame component when you want to crop on-screen content like media into any desired aspect ratio. 12 | 13 | --- 14 | 15 | ## How to install 16 | 17 | `npm install @bedrock-layout/frame` 18 | 19 | or 20 | 21 | `yarn add @bedrock-layout/frame` 22 | 23 | --- 24 | 25 | ## Usage 26 | 27 | ```javascript 28 | import { Frame } from "@bedrock-layout/frame"; 29 | 30 | 31 | 32 | ; 33 | ``` 34 | 35 | --- 36 | 37 | ## data-attribute 38 | 39 | For styling purposes, you can select `data-br-frame`. 40 | 41 | --- 42 | 43 | ## API 44 | 45 | ∏ 46 | | Property | Description | Type | Default | 47 | | :------: | :---------------------------------------------------------------------------------------------------------------------------: | :---------------: | :-------------------: | ----------------- | 48 | | ratio | Aspect ratio that you want the child element to maintain | `[number, number] | ${number}/${number}` | medium breakpoint | 49 | | position | Alignment of the child element. Use [object-position value](https://developer.mozilla.org/en-US/docs/Web/CSS/object-position) | string | `50%` | 50 | -------------------------------------------------------------------------------- /stories/primitives/primitives.mdx: -------------------------------------------------------------------------------- 1 | import { Meta } from "@storybook/addon-docs"; 2 | 3 | 4 | 5 | # A Single Package of All The Primitives 6 | 7 | Each of the primitives are independantly versioned and installable. There are many benefits to doing this, but it is also nice to have a single install point if you know that you will be using all or most of the primitives. 8 | 9 | The `@bedrock-layout/primitives` package includes all the primitives, hooks, and spacing-contants utilities in a single package as named exports. 10 | 11 | ## How to install 12 | 13 | `npm install @bedrock-layout/primitives` 14 | 15 | or 16 | 17 | `yarn add @bedrock-layout/primitives` 18 | 19 | --- 20 | 21 | ## Usage 22 | 23 | ```javascript 24 | import { Stack, Inline, Split, Cover, Frame } from "@bedrock-layout/primitives"; 25 | 26 | export function Hero() { 27 | return ( 28 | 29 | {/* */} 30 | 31 | 32 | 33 |

{/* */}

34 |

{/* */}

35 | 36 | 37 | 38 | 39 |
40 |
41 | 42 | 43 | 44 |
45 |
46 | ); 47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /packages/css/src/reset.css: -------------------------------------------------------------------------------- 1 | /* 2 | reset.css 3 | */ 4 | 5 | *, 6 | *::before, 7 | *::after { 8 | box-sizing: border-box; 9 | } 10 | 11 | * { 12 | margin: 0; 13 | } 14 | 15 | ul[class], 16 | ol[class] { 17 | padding: 0; 18 | list-style: none; 19 | } 20 | 21 | html:focus-within { 22 | scroll-behavior: smooth; 23 | } 24 | 25 | body { 26 | min-block-size: 100vh; 27 | text-rendering: optimizeSpeed; 28 | line-height: 1.5; 29 | font-size: 100%; 30 | -webkit-font-smoothing: antialiased; 31 | } 32 | 33 | a:not([class]) { 34 | text-decoration-skip-ink: auto; 35 | } 36 | 37 | img, 38 | picture { 39 | display: block; 40 | max-inline-size: 100%; 41 | } 42 | 43 | p, 44 | h1, 45 | h2, 46 | h3, 47 | h4, 48 | h5, 49 | h6, 50 | li, 51 | figcaption { 52 | max-inline-size: 60ch; 53 | overflow-wrap: break-word; 54 | } 55 | 56 | input, 57 | button, 58 | textarea, 59 | select { 60 | font: inherit; 61 | max-inline-size: 100%; 62 | } 63 | 64 | .js-focus-visible :focus:not(.focus-visible) { 65 | outline: none; 66 | } 67 | 68 | @media (prefers-reduced-motion: reduce) { 69 | html:focus-within { 70 | scroll-behavior: auto; 71 | } 72 | 73 | *, 74 | *::before, 75 | *::after { 76 | animation-duration: 0.01ms !important; 77 | animation-iteration-count: 1 !important; 78 | transition-duration: 0.01ms !important; 79 | scroll-behavior: auto !important; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /packages/center/README.md: -------------------------------------------------------------------------------- 1 | # `@bedrock-layout/center` 2 | 3 | A layout helper component that centers the content 4 | 5 | Full docs at: [bedrock-layout.dev](https://bedrock-layout.dev/) 6 | 7 | --- 8 | 9 | ## When to Use 10 | 11 | Use the `Center` component when you want to center the content and clamp it at the desired width, and can also center the children and text alignment. 12 | 13 | --- 14 | 15 | ## How to install 16 | 17 | `npm install @bedrock-layout/center` 18 | 19 | or 20 | 21 | `yarn add @bedrock-layout/center` 22 | 23 | --- 24 | 25 | ## Usage 26 | 27 | ```javascript 28 | import { Center } from "@bedrock-layout/center"; 29 | 30 |
31 |
1
32 |
2
33 |
3
34 |
4
35 |
5
36 |
6
37 |
; 38 | ``` 39 | 40 | --- 41 | 42 | ## data-attribute 43 | 44 | For styling purposes, you can select `data-br-center`. 45 | 46 | --- 47 | 48 | ## API 49 | 50 | | Property | Description | Type | Default | 51 | | :------------: | :-------------------------------: | :------------: | :-------------: | 52 | | maxWidth | Max width of the content | number, string | medium (1023px) | 53 | | centerText | Center align the text | boolean | false | 54 | | centerChildren | Center align the child components | boolean | false | 55 | -------------------------------------------------------------------------------- /stories/use-container-query/useContainerQuery.mdx: -------------------------------------------------------------------------------- 1 | import { Meta } from "@storybook/addon-docs"; 2 | 3 | 4 | 5 | # useContainerQuery 6 | 7 | ## Use case 8 | 9 | Used to verify the actual width of a DOM node, allowing you to do logic based on that. 10 | 11 | **The node provided to this hooks needs to be stateful or in other words should not come from `React.useRef`. Instead you can use `React.useState` and** 12 | **the `@bedrock-layout/use-forwarded-ref` is also stateful** 13 | 14 | ## How to install 15 | 16 | ```bash 17 | npm install @bedrock-layout/use-container-query 18 | ``` 19 | 20 | ## Basic usage 21 | 22 | ```javascript 23 | import { useContainerQuery } from '@bedrock-layout/use-container-query'; 24 | 25 | const Div = React.forwardRef(props,ref)=>{ 26 | const [node,setRef] = React.useState(null) 27 | const matches = useContainerQuery(node,320) 28 | // do something with matches 29 | return
30 | } 31 | ``` 32 | 33 | Or you can provide a range 34 | 35 | ```javascript 36 | import { useContainerQuery } from '@bedrock-layout/use-container-query'; 37 | 38 | const Div = React.forwardRef(props,ref)=>{ 39 | const [node,setRef] = React.useState(null) 40 | const matches = useContainerQuery(node, 320, 640) 41 | // do something with matches 42 | return
43 | } 44 | ``` 45 | -------------------------------------------------------------------------------- /stories/inline/argTypes.ts: -------------------------------------------------------------------------------- 1 | export const argTypes = { 2 | gutter: { 3 | control: "select", 4 | options: [ 5 | "size000", 6 | "size00", 7 | "size1", 8 | "size2", 9 | "size3", 10 | "size4", 11 | "size5", 12 | "size6", 13 | "size7", 14 | "size8", 15 | "size9", 16 | "size10", 17 | "size11", 18 | "size12", 19 | "size13", 20 | "size14", 21 | "size15", 22 | ], 23 | }, 24 | gap: { 25 | control: "select", 26 | options: [ 27 | "size000", 28 | "size00", 29 | "size1", 30 | "size2", 31 | "size3", 32 | "size4", 33 | "size5", 34 | "size6", 35 | "size7", 36 | "size8", 37 | "size9", 38 | "size10", 39 | "size11", 40 | "size12", 41 | "size13", 42 | "size14", 43 | "size15", 44 | ], 45 | }, 46 | justify: { 47 | control: "select", 48 | options: ["start", "end", "center", "space-between", "space-around"], 49 | }, 50 | align: { 51 | control: "select", 52 | options: ["start", "end", "center", "stretch"], 53 | }, 54 | stretch: { 55 | control: "select", 56 | options: ["all", "start", "end"], 57 | }, 58 | switchAt: { 59 | description: 60 | "Sets the width threshold that the split will switch to a Stack layout", 61 | control: "text", 62 | }, 63 | minItemWidth: { 64 | control: "text", 65 | }, 66 | }; 67 | -------------------------------------------------------------------------------- /packages/primitives/vite.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | // vite.config.js 3 | const path = require("path"); 4 | const { defineConfig } = require("vite"); 5 | 6 | module.exports = defineConfig({ 7 | build: { 8 | outDir: "./lib", 9 | lib: { 10 | entry: path.resolve(__dirname, "src/index.tsx"), 11 | name: "solid", 12 | formats: ["cjs", "umd", "es"], 13 | fileName: (format) => { 14 | return `index.${format === "es" ? "m" : format}.js`; 15 | }, 16 | }, 17 | rollupOptions: { 18 | external: [ 19 | "react", 20 | "@bedrock-layout/appboundary", 21 | "@bedrock-layout/center", 22 | "@bedrock-layout/column-drop", 23 | "@bedrock-layout/columns", 24 | "@bedrock-layout/cover", 25 | "@bedrock-layout/frame", 26 | "@bedrock-layout/grid", 27 | "@bedrock-layout/inline", 28 | "@bedrock-layout/inline-cluster", 29 | "@bedrock-layout/masonry-grid", 30 | "@bedrock-layout/padbox", 31 | "@bedrock-layout/reel", 32 | "@bedrock-layout/spacing-constants", 33 | "@bedrock-layout/split", 34 | "@bedrock-layout/stack", 35 | "@bedrock-layout/type-utils", 36 | "@bedrock-layout/use-container-query", 37 | "@bedrock-layout/use-forwarded-ref", 38 | "@bedrock-layout/use-resize-observer", 39 | "@bedrock-layout/use-stateful-ref", 40 | ], 41 | }, 42 | }, 43 | }); 44 | -------------------------------------------------------------------------------- /stories/columns/argTypes.ts: -------------------------------------------------------------------------------- 1 | export const columnsArgTypes = { 2 | gutter: { 3 | control: "select", 4 | options: [ 5 | "size000", 6 | "size00", 7 | "size1", 8 | "size2", 9 | "size3", 10 | "size4", 11 | "size5", 12 | "size6", 13 | "size7", 14 | "size8", 15 | "size9", 16 | "size10", 17 | "size11", 18 | "size12", 19 | "size13", 20 | "size14", 21 | "size15", 22 | ], 23 | }, 24 | gap: { 25 | control: "select", 26 | options: [ 27 | "size000", 28 | "size00", 29 | "size1", 30 | "size2", 31 | "size3", 32 | "size4", 33 | "size5", 34 | "size6", 35 | "size7", 36 | "size8", 37 | "size9", 38 | "size10", 39 | "size11", 40 | "size12", 41 | "size13", 42 | "size14", 43 | "size15", 44 | ], 45 | }, 46 | colCount: { 47 | control: "number", 48 | }, 49 | switchAt: { 50 | control: "text", 51 | }, 52 | as: { 53 | control: "none", 54 | }, 55 | }; 56 | 57 | export const columnArgTypes = { 58 | span: { 59 | table: { 60 | type: { summary: "number" }, 61 | }, 62 | control: "number", 63 | }, 64 | offsetStart: { 65 | table: { 66 | type: { summary: "number" }, 67 | }, 68 | control: "number", 69 | }, 70 | offsetEnd: { 71 | table: { 72 | type: { summary: "number" }, 73 | }, 74 | control: "number", 75 | }, 76 | }; 77 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/InlineClusterPage/justify.tsx: -------------------------------------------------------------------------------- 1 | import { InlineCluster } from "@bedrock-layout/solid"; 2 | import { JSXElement } from "solid-js"; 3 | 4 | import { Box } from "../../components/Box"; 5 | 6 | export function Justify(): JSXElement { 7 | return ( 8 | <> 9 |

start

10 | 11 | 12 | 13 | 14 | 15 | 16 |

end

17 | 18 | 19 | 20 | 21 | 22 | 23 |

center

24 | 25 | 26 | 27 | 28 | 29 | 30 |

space-around

31 | 32 | 33 | 34 | 35 | 36 | 37 |

space-between

38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | ); 46 | } 47 | -------------------------------------------------------------------------------- /packages/solid/src/create-container-query.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | init, 3 | registerCallback, 4 | } from "@bedrock-layout/register-resize-callback"; 5 | import { 6 | Accessor, 7 | Setter, 8 | createEffect, 9 | createSignal, 10 | onCleanup, 11 | onMount, 12 | } from "solid-js"; 13 | 14 | import { convertToMaybe } from "./typeUtils"; 15 | 16 | /** 17 | * @deprecated this function is deprecated and will be removed in the next major version 18 | */ 19 | export function createContainerQuery( 20 | width: number, 21 | maybeRef?: (ref: T) => unknown, 22 | ): [Accessor, Setter] { 23 | const [matches, setMatch] = createSignal(false); 24 | const [node, nodeRef] = createSignal(); 25 | 26 | onMount(() => { 27 | init(); 28 | }); 29 | 30 | createEffect(() => { 31 | if (convertToMaybe(node()) === undefined) return; 32 | 33 | if (maybeRef) { 34 | maybeRef(node() as T); 35 | } 36 | 37 | const cleanup = registerCallback(node() as T, (entry) => { 38 | //fix typings 39 | const nodeWidth = 40 | (entry.borderBoxSize as unknown as ResizeObserverSize)?.inlineSize ?? 41 | entry.contentRect.width; 42 | 43 | //nodeWidth can be zero when it is switching from one node to another. This will ignore that. 44 | if (nodeWidth > 0) { 45 | const newMatch = nodeWidth <= width; 46 | 47 | setMatch(newMatch); 48 | } 49 | }); 50 | 51 | onCleanup(cleanup); 52 | }); 53 | 54 | return [matches, nodeRef]; 55 | } 56 | -------------------------------------------------------------------------------- /packages/stack/README.md: -------------------------------------------------------------------------------- 1 | # `@bedrock-layout/stack` 2 | 3 | A layout helper component that creates a vertical stack layout with gutters (spacing) between each item. 4 | 5 | Full docs at: [bedrock-layout.dev](https://bedrock-layout.dev/) 6 | 7 | --- 8 | 9 | ## When to Use 10 | 11 | The `Stack` component literally stacks its child components on top of each other, while maintaining a consistent spacing between them. 12 | 13 | --- 14 | 15 | ## How to install 16 | 17 | `npm install @bedrock-layout/stack` 18 | 19 | or 20 | 21 | `yarn add @bedrock-layout/stack` 22 | 23 | --- 24 | 25 | ## Usage 26 | 27 | ```javascript 28 | import { Stack } from "@bedrock-layout/stack"; 29 | 30 | 31 |
1
32 |
2
33 |
3
34 |
4
35 |
5
36 |
6
37 |
; 38 | ``` 39 | 40 | --- 41 | 42 | ## data-attribute 43 | 44 | For styling purposes, you can select `data-br-stack`. 45 | 46 | --- 47 | 48 | ## API 49 | 50 | \* required 51 | 52 | | Property | Description | Type | Default | 53 | | :------: | :-----------------------------------------: | :------------------: | :-----: | 54 | | gutter\* | Sets the space between each child component | one of `Spacing`\*\* | - | 55 | 56 | \*\* By default, `Spacing` is one of the [spacing-constants](https://github.com/Bedrock-Layouts/Bedrock/tree/main/packages/spacing-constants) values, but this can be overwritten using the `ThemeProvider` from `@bedrock-layout/spacing-constants` 57 | -------------------------------------------------------------------------------- /.storybook/main.ts: -------------------------------------------------------------------------------- 1 | import { dirname, join } from "path"; 2 | 3 | import type { InlineConfig } from "vite"; 4 | 5 | const turbosnap = require("vite-plugin-turbosnap"); 6 | 7 | export const stories = [ 8 | "./pages/Landing.mdx", 9 | "./pages/introduction.mdx", 10 | "./pages/installation.mdx", 11 | "./pages/stack.mdx", 12 | "./pages/spacing.mdx", 13 | "./pages/menu.mdx", 14 | "./pages/hero.mdx", 15 | "./pages/new-arrivals.mdx", 16 | "../stories/**/*.@(mdx|stories.@(js|ts|tsx))", 17 | "./pages/contributing.mdx", 18 | "./pages/roadmap.mdx", 19 | "../examples/examples.mdx", 20 | "../examples/web.dev.mdx", 21 | ]; 22 | export const addons = [ 23 | getAbsolutePath("@storybook/addon-essentials"), 24 | getAbsolutePath("@chromaui/addon-visual-tests"), 25 | getAbsolutePath("@storybook/addon-mdx-gfm"), 26 | ]; 27 | 28 | export const staticDirs = ["../public"]; 29 | 30 | export const viteFinal = async (config: InlineConfig, { configType }) => { 31 | // Turbosnap is only useful when building for production 32 | if (configType === "PRODUCTION") { 33 | config.plugins?.push( 34 | turbosnap({ 35 | rootDir: config.root, 36 | }), 37 | ); 38 | } 39 | return config; 40 | }; 41 | 42 | export const framework = { 43 | name: getAbsolutePath("@storybook/react-vite"), 44 | options: {}, 45 | }; 46 | 47 | export const docs = { 48 | autodocs: true, 49 | toc: true, 50 | }; 51 | 52 | function getAbsolutePath(value: string): string { 53 | return dirname(require.resolve(join(value, "package.json"))); 54 | } 55 | -------------------------------------------------------------------------------- /packages/padbox/README.md: -------------------------------------------------------------------------------- 1 | # `@bedrock-layout/padbox` 2 | 3 | A layout helper component that creates vertical stack layout with gutters. 4 | 5 | Full docs at: [bedrock-layout.dev](https://bedrock-layout.dev/) 6 | 7 | --- 8 | 9 | ## When to Use 10 | 11 | `Padbox` component creates a uniform padding based on the spacing constants. It can either take a single value or an array/object of values to fine-tune the padding. 12 | 13 | --- 14 | 15 | ## How to install 16 | 17 | `npm install @bedrock-layout/padbox` 18 | 19 | or 20 | 21 | `yarn add @bedrock-layout/padbox` 22 | 23 | --- 24 | 25 | ## Usage 26 | 27 | ```javascript 28 | import { Padbox } from '@bedrock-layout/padbox'; 29 | 30 | {...content}; 31 | ``` 32 | 33 | --- 34 | 35 | ## data-attribute 36 | 37 | For styling purposes, you can select `data-bedrock-padbox`. 38 | 39 | --- 40 | 41 | ## API 42 | 43 | \* required 44 | 45 | | Property | Description | Type | Default | 46 | | :-------: | :------------------------------------------------: | :---------------------------------------------------------------: | :-----: | 47 | | padding\* | sets the padding around the content of the element | `Spacing`\*\*, array of `Spacings`, or object of `Spacing` values | - | 48 | 49 | \*\* By default, `Spacing` is one of the [spacing-constants](https://github.com/Bedrock-Layouts/Bedrock/tree/main/packages/spacing-constants) values, but this can be overwritten using the `ThemeProvider` from `@bedrock-layout/spacing-constants` 50 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/ColumnsPage/argTypes.ts: -------------------------------------------------------------------------------- 1 | import { spacing } from "@bedrock-layout/solid"; 2 | import { ArgType } from "src/types/argType"; 3 | 4 | export const argTypes: ArgType = { 5 | gap: { 6 | description: "Sets space between each element", 7 | summary: "Space", 8 | defaultValue: "0px", 9 | initialValue: "size3", 10 | control: "select", 11 | options: Object.keys(spacing), 12 | }, 13 | colCount: { 14 | description: "Sets the number of columns", 15 | defaultValue: "1", 16 | initialValue: 4, 17 | summary: "number", 18 | control: "number", 19 | }, 20 | switchAt: { 21 | description: 22 | "Sets the width threshold that the split will switch to a Stack layout", 23 | summary: "string | number", 24 | control: "text", 25 | initialValue: "25rem", 26 | }, 27 | }; 28 | 29 | export const columnArgTypes: ArgType = { 30 | span: { 31 | description: "Sets the number of columns the element will span", 32 | summary: "number", 33 | defaultValue: "1", 34 | initialValue: 1, 35 | control: "number", 36 | }, 37 | offsetStart: { 38 | description: 39 | "Sets the number of columns the element will offset before the element", 40 | summary: "number", 41 | defaultValue: "-", 42 | initialValue: 0, 43 | control: "number", 44 | }, 45 | offsetEnd: { 46 | description: 47 | "Sets the number of columns the element will offset after the element", 48 | summary: "number", 49 | defaultValue: "-", 50 | initialValue: 0, 51 | control: "number", 52 | }, 53 | }; 54 | -------------------------------------------------------------------------------- /.github/workflows/verify.yml: -------------------------------------------------------------------------------- 1 | # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions 3 | 4 | name: Build 5 | 6 | on: 7 | push: 8 | branches: [main] 9 | pull_request: 10 | branches: [main] 11 | 12 | jobs: 13 | build: 14 | runs-on: ubuntu-latest 15 | env: 16 | HUSKY: 0 17 | NPM_AUTH: ${{secrets.NPM_AUTH}} 18 | GH_TOKEN: ${{secrets.GH_TOKEN}} 19 | strategy: 20 | matrix: 21 | node-version: [22.x] 22 | # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ 23 | 24 | steps: 25 | - uses: actions/checkout@v4 26 | with: 27 | fetch-depth: "0" 28 | - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* 29 | - run: yarn config set registry https://registry.npmjs.org 30 | - run: yarn 31 | - run: yarn verify 32 | - run: git checkout main 33 | - run: git config --global user.email 'travis.mair@gmail.com' 34 | - run: git config --global user.name 'Jarvis1010' 35 | - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} 36 | run: echo "//registry.npmjs.org/:_authToken=${{secrets.NPM_AUTH}}" > ~/.npmrc 37 | - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} 38 | run: npm whoami 39 | - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} 40 | run: npx lerna publish --conventional-commits --yes 41 | -------------------------------------------------------------------------------- /packages/css/src/components/frame.css: -------------------------------------------------------------------------------- 1 | /* 2 | frame.css 3 | */ 4 | 5 | [data-bedrock-frame] { 6 | box-sizing: border-box; 7 | display: block; 8 | inline-size: 100%; 9 | position: relative; 10 | overflow: hidden; 11 | } 12 | 13 | [data-bedrock-frame] > * { 14 | position: absolute; 15 | 16 | inset-block-start: 0; 17 | inset-block-end: 0; 18 | inset-inline-start: 0; 19 | inset-inline-end: 0; 20 | 21 | inset-block: 0; 22 | inset-inline: 0; 23 | 24 | display: flex; 25 | justify-content: center; 26 | align-items: center; 27 | } 28 | 29 | [data-bedrock-frame] > :is(img, video) { 30 | inline-size: 100%; 31 | block-size: 100%; 32 | size: 100%; 33 | 34 | object-fit: cover; 35 | 36 | object-position: var(--position, "50%"); 37 | } 38 | 39 | [data-bedrock-frame][style*="--ratio"] { 40 | aspect-ratio: var(--ratio); 41 | } 42 | 43 | /* 44 | frame.css 45 | */ 46 | 47 | [data-br-frame] { 48 | box-sizing: border-box; 49 | display: block; 50 | inline-size: 100%; 51 | position: relative; 52 | overflow: hidden; 53 | } 54 | 55 | [data-br-frame] > * { 56 | position: absolute; 57 | 58 | inset-block-start: 0; 59 | inset-block-end: 0; 60 | inset-inline-start: 0; 61 | inset-inline-end: 0; 62 | 63 | inset-block: 0; 64 | inset-inline: 0; 65 | 66 | display: flex; 67 | justify-content: center; 68 | align-items: center; 69 | } 70 | 71 | [data-br-frame] > :is(img, video) { 72 | inline-size: 100%; 73 | block-size: 100%; 74 | size: 100%; 75 | 76 | object-fit: cover; 77 | 78 | object-position: var(--position, "50%"); 79 | } 80 | 81 | [data-br-frame][style*="--ratio"] { 82 | aspect-ratio: var(--ratio); 83 | } 84 | -------------------------------------------------------------------------------- /packages/reel/README.md: -------------------------------------------------------------------------------- 1 | # `@bedrock-layout/reel` 2 | 3 | A layout helper for scrolling content 4 | 5 | Full docs at: [bedrock-layout.dev](https://bedrock-layout.dev/) 6 | 7 | --- 8 | 9 | ## When to Use 10 | 11 | `Reel` component designs and organizes your content into scrollable flatlists, A.K.A Carousels. It also adds convenient breakpoints in the flatlists, hence providing a natural way to scroll through content. 12 | 13 | --- 14 | 15 | ## How to install 16 | 17 | `npm install @bedrock-layout/reel` 18 | 19 | or 20 | 21 | `yarn add @bedrock-layout/reel` 22 | 23 | ## Usage 24 | 25 | ```javascript 26 | import { Reel } from "@bedrock-layout/reel"; 27 | 28 | 29 |
1
30 |
2
31 |
3
32 |
4
33 |
5
34 |
6
35 |
; 36 | ``` 37 | 38 | --- 39 | 40 | ## data-attribute 41 | 42 | For styling purposes, you can select `data-br-reel`. 43 | 44 | --- 45 | 46 | ## API 47 | 48 | \* required 49 | 50 | | Property | Description | Type | Default | 51 | | :------: | :---------------------------------------: | :--------------------------------: | :-----: | 52 | | gutter\* | Sets the space between each child element | one of `Spacing`\*\* | - | 53 | | snapType | Controls horizontal snap type | `none`, `mandatory` or `proximity` | 'none' | 54 | 55 | \*\* By default, `Spacing` is one of [spacing-constants](https://github.com/Bedrock-Layouts/Bedrock/tree/main/packages/spacing-constants) values, but it can be overwritten using the `ThemeProvider` from `@bedrock-layout/spacing-constants` 56 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/InlinePage/argTypes.ts: -------------------------------------------------------------------------------- 1 | import { spacing } from "@bedrock-layout/solid"; 2 | import { ArgType } from "src/types/argType"; 3 | 4 | export const argTypes: ArgType = { 5 | gap: { 6 | description: "Sets space between each element", 7 | summary: "Space", 8 | defaultValue: "0px", 9 | initialValue: "size3", 10 | control: "select", 11 | options: Object.keys(spacing), 12 | }, 13 | minItemWidth: { 14 | description: "Sets the basis of each of the children", 15 | summary: "CSSLength", 16 | defaultValue: "0px", 17 | initialValue: "100px", 18 | control: "text", 19 | }, 20 | justify: { 21 | description: "Sets the inline justification of the children", 22 | summary: "start | end | center", 23 | defaultValue: "start", 24 | initialValue: "start", 25 | control: "select", 26 | options: ["start", "end", "center"], 27 | }, 28 | align: { 29 | description: "Sets the block alignment of the children", 30 | summary: "start | end | center | stretch", 31 | defaultValue: "start", 32 | initialValue: "start", 33 | control: "select", 34 | options: ["start", "end", "center", "stretch"], 35 | }, 36 | stretch: { 37 | description: "Sets which child will stretch in the inline direction", 38 | summary: "all | start | end or index of child", 39 | defaultValue: "-", 40 | initialValue: "-", 41 | control: "select", 42 | options: ["-", "all", "start", "end"], 43 | }, 44 | switchAt: { 45 | description: 46 | "Sets the width threshold that the split will switch to a Stack layout", 47 | summary: "string | number", 48 | control: "text", 49 | initialValue: "25rem", 50 | }, 51 | }; 52 | -------------------------------------------------------------------------------- /packages/stack/src/index.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | Gutter, 3 | getSafeGutter, 4 | useTheme, 5 | } from "@bedrock-layout/spacing-constants"; 6 | import { forwardRefWithAs } from "@bedrock-layout/type-utils"; 7 | import React from "react"; 8 | 9 | /** 10 | * Props for Stack component. 11 | */ 12 | export interface StackProps { 13 | /** 14 | * Sets space between each element. 15 | * @deprecated Use `gap` instead. 16 | */ 17 | gutter?: Gutter; 18 | /** 19 | * Sets space between each element. 20 | */ 21 | gap?: Gutter; 22 | 23 | /** 24 | * The `align` prop can be used to specify the inline alignment of the children. 25 | */ 26 | align?: "start" | "center" | "end" | "stretch"; 27 | } 28 | 29 | function createAttributeString( 30 | prefix: string, 31 | value: string | number | undefined, 32 | ) { 33 | if (value === undefined) return undefined; 34 | 35 | return `${prefix}:${value}`; 36 | } 37 | 38 | /** 39 | * The `Stack` is designed to literally stack items on top of each other while maintaining a consistent gutter between each item. 40 | */ 41 | export const Stack = forwardRefWithAs<"div", StackProps>(function Stack( 42 | { as: Component = "div", gutter, gap, align, style = {}, ...props }, 43 | ref, 44 | ) { 45 | const theme = useTheme(); 46 | 47 | const alignValue = createAttributeString("align", align); 48 | 49 | const maybeGutter = getSafeGutter(theme, gap ?? gutter); 50 | 51 | const attributes = [alignValue].filter(Boolean).join(" "); 52 | 53 | return ( 54 | 60 | ); 61 | }); 62 | -------------------------------------------------------------------------------- /packages/grid/README.md: -------------------------------------------------------------------------------- 1 | # `@bedrock-layout/grid` 2 | 3 | Grid is a layout helper that creates a responsive grid of items. 4 | 5 | Full docs at: [bedrock-layout.dev](https://bedrock-layout.dev/) 6 | 7 | --- 8 | 9 | ## When to Use 10 | 11 | `Grid` can be used to create a responsive grid layouts that can automatically wrap depending on the number of child elements and a `minItemWidth` value. 12 | 13 | --- 14 | 15 | ## How to install 16 | 17 | `npm install @bedrock-layout/grid` 18 | 19 | or 20 | 21 | `yarn add @bedrock-layout/grid` 22 | 23 | --- 24 | 25 | ## Usage 26 | 27 | ```javascript 28 | import { Grid } from "@bedrock-layout/grid"; 29 | 30 | 31 |
1
32 |
2
33 |
3
34 |
4
35 |
5
36 |
6
37 |
; 38 | ``` 39 | 40 | --- 41 | 42 | ## data-attribute 43 | 44 | For styling purposes, you can select `data-br-grid`. 45 | 46 | --- 47 | 48 | ## API 49 | 50 | \* required 51 | 52 | | Property | Description | Type | Default | 53 | | :----------: | :-------------------------------------------: | :------------------------------------: | :-----------: | 54 | | gutter\* | sets the space between each child element | One of `Spacing`\*\* | - | 55 | | minItemWidth | sets the min width size of each child element | number or valid CSS length as a string | small (639px) | 56 | 57 | \*\* By default, `Spacing` is one of [spacing-constants](https://github.com/Bedrock-Layouts/Bedrock/tree/main/packages/spacing-constants) values, but this can be overwritten using the `ThemeProvider` from `@bedrock-layout/spacing-constants` 58 | -------------------------------------------------------------------------------- /packages/reel/src/index.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | Gutter, 3 | getSafeGutter, 4 | useTheme, 5 | } from "@bedrock-layout/spacing-constants"; 6 | import { forwardRefWithAs } from "@bedrock-layout/type-utils"; 7 | import React, { CSSProperties } from "react"; 8 | 9 | /** 10 | * Props for the Reel component. 11 | */ 12 | export type ReelProps = { 13 | /** 14 | * Sets the scroll snap type. 15 | */ 16 | snapType?: "none" | "proximity" | "mandatory"; 17 | /** 18 | * Sets space between each element. 19 | * @deprecated Use `gap` instead. 20 | */ 21 | gutter?: Gutter; 22 | /** 23 | * Sets space between each element. 24 | */ 25 | gap?: Gutter; 26 | }; 27 | 28 | function createAttributeString( 29 | prefix: string, 30 | value: string | number | undefined, 31 | ) { 32 | if (value === undefined) return undefined; 33 | 34 | return `${prefix}:${value}`; 35 | } 36 | 37 | /** 38 | * Scrolling is a popular and natural way to interact with 39 | * web content. The `Reel` component is designed to organize 40 | * content into scrollable horizontal list with convenient scroll 41 | * snap points. 42 | */ 43 | export const Reel = forwardRefWithAs<"div", ReelProps>(function Reel( 44 | { as: Component = "div", snapType, gutter, gap, style = {}, ...props }, 45 | ref, 46 | ) { 47 | const theme = useTheme(); 48 | const maybeGutter = getSafeGutter(theme, gap ?? gutter); 49 | 50 | const attributeString = [createAttributeString("snapType", snapType)] 51 | .filter(Boolean) 52 | .join(" "); 53 | 54 | return ( 55 | 61 | ); 62 | }); 63 | -------------------------------------------------------------------------------- /stories/use-resize-observer/useReseizeObserver.mdx: -------------------------------------------------------------------------------- 1 | import { Meta } from "@storybook/addon-docs"; 2 | 3 | 4 | 5 | # useResizeObserver 6 | 7 | ## Use case 8 | 9 | Hook that is great for registering a callback that will be called if an associated node is resized. Uses the ResizeObserver API. 10 | 11 | ## How to install 12 | 13 | ```bash 14 | yarn add @bedrock-layout/use-resize-observer 15 | ``` 16 | 17 | ## Basic usage 18 | 19 | `useResizeObserver` takes a callback that accepts a `ResizeObserverEntry` and will return a ref object to assign the appropriate node. 20 | 21 | ```javascript 22 | import { useResizeObserver } from '@bedrock-layout/use-resize-observer'; 23 | 24 | function Component(props){ 25 | 26 | const ref = useResizeObserver((entry) => { 27 | /* do something with entry */ 28 | }) 29 | 30 | return
31 | } 32 | ``` 33 | 34 | Optionally, if you already have a node from a ref you are using you can pass it in as a second argument. **Note:** If you choose to use it this way, the node must be stateful either by using `@bedrock-layout/use-stateful-ref` or using a `React.useState` hook with the ref. If you are using the returned ref object, the node passed in will be ignored. 35 | 36 | ```javascript 37 | import { useResizeObserver } from '@bedrock-layout/use-resize-observer'; 38 | import { useStatefulRef } from '@bedrock-layout/use-stateful-ref'; 39 | 40 | function Component(props){ 41 | const statefulRef = useStatefulRef() 42 | const ref = useResizeObserver((entry) => { 43 | /* do something with entry */ 44 | }, statefulRef.current) 45 | 46 | return
47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /packages/stack/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bedrock-layout/stack", 3 | "version": "3.3.4", 4 | "description": "bedrock-layout stack layout primitive", 5 | "sideEffects": false, 6 | "private": false, 7 | "publishConfig": { 8 | "access": "public" 9 | }, 10 | "keywords": [ 11 | "stack", 12 | "layout", 13 | "react" 14 | ], 15 | "author": "Jarvis1010 ", 16 | "homepage": "https://bedrock-layout.dev/", 17 | "license": "MIT", 18 | "unpkg": "lib/index.umd.js", 19 | "main": "lib/index.umd.js", 20 | "umd:main": "lib/index.umd.js", 21 | "module": "lib/index.m.js", 22 | "source": "src/index.tsx", 23 | "types": "lib/index.d.ts", 24 | "exports": { 25 | ".": { 26 | "types": "./lib/index.d.ts", 27 | "import": "./lib/index.m.js", 28 | "require": "./lib/index.umd.js" 29 | } 30 | }, 31 | "directories": { 32 | "lib": "lib", 33 | "test": "__tests__" 34 | }, 35 | "files": [ 36 | "lib" 37 | ], 38 | "dependencies": { 39 | "@bedrock-layout/spacing-constants": "^3.3.10", 40 | "@bedrock-layout/type-utils": "^0.1.14" 41 | }, 42 | "peerDependencies": { 43 | "@bedrock-layout/css": "^2.1.0", 44 | "react": "^16.8 || ^17 || ^18" 45 | }, 46 | "repository": { 47 | "type": "git", 48 | "url": "git+https://github.com/Bedrock-Layouts/Bedrock.git" 49 | }, 50 | "scripts": { 51 | "test": "echo \"Error: run tests from root\" && exit 1", 52 | "lint": "eslint --ignore-path .gitignore .", 53 | "clean:build": "rimraf lib", 54 | "build": "vite build && tsc --emitDeclarationOnly" 55 | }, 56 | "bugs": { 57 | "url": "https://github.com/Bedrock-Layouts/Bedrock/issues" 58 | }, 59 | "gitHead": "a3f85a5aebbd9681317b1c00c88765b2537f9b10", 60 | "nx": {} 61 | } 62 | -------------------------------------------------------------------------------- /packages/solid-doc-site/src/pages/PadBoxPage/paddingArray.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable react/style-prop-object */ 2 | import { PadBox } from "@bedrock-layout/solid"; 3 | import { JSXElement } from "solid-js"; 4 | 5 | export function PaddingArray(): JSXElement { 6 | return ( 7 | <> 8 |

With 2 values

9 |
["size2", "size7"]
10 | 11 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Fuga 12 | consequuntur corrupti beatae commodi vitae, perspiciatis totam provident 13 | architecto doloribus aperiam sapiente, incidunt nihil suscipit 14 | voluptatibus tempore est dolor! Iusto, vero. 15 | 16 |

With 3 values

17 |
["size3", "size1", "size7"]
18 | 22 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Fuga 23 | consequuntur corrupti beatae commodi vitae, perspiciatis totam provident 24 | architecto doloribus aperiam sapiente, incidunt nihil suscipit 25 | voluptatibus tempore est dolor! Iusto, vero. 26 | 27 |

With 4 values

28 |
["size3", "size1", "size1", "size7"]
29 | 33 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Fuga 34 | consequuntur corrupti beatae commodi vitae, perspiciatis totam provident 35 | architecto doloribus aperiam sapiente, incidunt nihil suscipit 36 | voluptatibus tempore est dolor! Iusto, vero. 37 | 38 | 39 | ); 40 | } 41 | -------------------------------------------------------------------------------- /packages/spacing-constants/__tests__/__snapshots__/spacing-constants.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html 2 | 3 | exports[`Spacing Constants > constant snapshot 1`] = ` 4 | { 5 | "ThemeContext": { 6 | "$$typeof": Symbol(react.context), 7 | "Consumer": { 8 | "$$typeof": Symbol(react.context), 9 | "_context": [Circular], 10 | }, 11 | "Provider": { 12 | "$$typeof": Symbol(react.provider), 13 | "_context": [Circular], 14 | }, 15 | "_currentRenderer": null, 16 | "_currentRenderer2": null, 17 | "_currentValue": {}, 18 | "_currentValue2": {}, 19 | "_defaultValue": null, 20 | "_globalName": null, 21 | "_threadCount": 0, 22 | }, 23 | "ThemeProvider": [Function], 24 | "getSafeGutter": [Function], 25 | "getSizeValue": [Function], 26 | "getSpacingValue": [Function], 27 | "sizes": { 28 | "sizeContent1": "20ch", 29 | "sizeContent2": "45ch", 30 | "sizeContent3": "60ch", 31 | "sizeHeader1": "20ch", 32 | "sizeHeader2": "25ch", 33 | "sizeHeader3": "35ch", 34 | "sizeLg": "1024px", 35 | "sizeMd": "768px", 36 | "sizeSm": "480px", 37 | "sizeXl": "1440px", 38 | "sizeXs": "360px", 39 | "sizeXxl": "1920px", 40 | "sizeXxs": "240px", 41 | }, 42 | "spacing": { 43 | "size00": "-.25rem", 44 | "size000": "-.5rem", 45 | "size1": ".25rem", 46 | "size10": "5rem", 47 | "size11": "7.5rem", 48 | "size12": "10rem", 49 | "size13": "15rem", 50 | "size14": "20rem", 51 | "size15": "30rem", 52 | "size2": ".5rem", 53 | "size3": "1rem", 54 | "size4": "1.25rem", 55 | "size5": "1.5rem", 56 | "size6": "1.75rem", 57 | "size7": "2rem", 58 | "size8": "3rem", 59 | "size9": "4rem", 60 | }, 61 | "useTheme": [Function], 62 | } 63 | `; 64 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.build.json", 3 | "compilerOptions": { 4 | "types": ["vitest/globals"], 5 | "baseUrl": ".", 6 | "paths": { 7 | "@bedrock-layout/appboundary": ["packages/appboundary/src"], 8 | "@bedrock-layout/center": ["packages/center/src"], 9 | "@bedrock-layout/column-drop": ["packages/column-drop/src"], 10 | "@bedrock-layout/columns": ["packages/columns/src"], 11 | "@bedrock-layout/cover": ["packages/cover/src"], 12 | "@bedrock-layout/css-reset": ["packages/css-reset/src"], 13 | "@bedrock-layout/frame": ["packages/frame/src"], 14 | "@bedrock-layout/grid": ["packages/grid/src"], 15 | "@bedrock-layout/inline": ["packages/inline/src"], 16 | "@bedrock-layout/inline-cluster": ["packages/inline-cluster/src"], 17 | "@bedrock-layout/masonry-grid": ["packages/masonry-grid/src"], 18 | "@bedrock-layout/padbox": ["packages/padbox/src"], 19 | "@bedrock-layout/reel": ["packages/reel/src"], 20 | "@bedrock-layout/register-resize-callback": [ 21 | "packages/register-resize-callback/src" 22 | ], 23 | "@bedrock-layout/stack": ["packages/stack/src"], 24 | "@bedrock-layout/spacing-constants": ["packages/spacing-constants/src"], 25 | "@bedrock-layout/split": ["packages/split/src"], 26 | "@bedrock-layout/type-utils": ["packages/type-utils/src"], 27 | "@bedrock-layout/use-container-query": [ 28 | "packages/use-container-query/src" 29 | ], 30 | "@bedrock-layout/use-forwarded-ref": ["packages/use-forwarded-ref/src"], 31 | "@bedrock-layout/use-resize-observer": [ 32 | "packages/use-resize-observer/src" 33 | ], 34 | "@bedrock-layout/use-stateful-ref": ["packages/use-stateful-ref/src"], 35 | "$test/*": ["test/*"] 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /packages/spacing-constants/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bedrock-layout/spacing-constants", 3 | "version": "3.3.10", 4 | "description": "bedrock-layout spacing constants", 5 | "sideEffects": false, 6 | "private": false, 7 | "publishConfig": { 8 | "access": "public" 9 | }, 10 | "keywords": [ 11 | "spacing", 12 | "constants" 13 | ], 14 | "author": "Jarvis1010 ", 15 | "homepage": "https://bedrock-layout.dev/", 16 | "license": "MIT", 17 | "unpkg": "lib/index.umd.js", 18 | "main": "lib/index.umd.js", 19 | "umd:main": "lib/index.umd.js", 20 | "module": "lib/index.m.js", 21 | "source": "src/index.tsx", 22 | "types": "lib/index.d.ts", 23 | "exports": { 24 | ".": { 25 | "types": "./lib/index.d.ts", 26 | "import": "./lib/index.m.js", 27 | "require": "./lib/index.umd.js" 28 | } 29 | }, 30 | "directories": { 31 | "lib": "lib", 32 | "test": "__tests__" 33 | }, 34 | "files": [ 35 | "lib" 36 | ], 37 | "peerDependencies": { 38 | "react": "^16.8 || ^17 || ^18" 39 | }, 40 | "repository": { 41 | "type": "git", 42 | "url": "git+https://github.com/Bedrock-Layouts/Bedrock.git" 43 | }, 44 | "scripts": { 45 | "test": "echo \"Error: run tests from root\" && exit 1", 46 | "lint": "eslint --ignore-path .gitignore .", 47 | "clean:build": "rimraf lib", 48 | "build": "vite build && tsc --emitDeclarationOnly", 49 | "prettier": "prettier --ignore-path .gitignore \"**/*.+(js|jsx|ts|tsx|json)\"", 50 | "fix-format": "yarn prettier --write", 51 | "check-format": "yarn prettier --list-different", 52 | "check-types": "tsc --noEmit" 53 | }, 54 | "bugs": { 55 | "url": "https://github.com/Bedrock-Layouts/Bedrock/issues" 56 | }, 57 | "gitHead": "a3f85a5aebbd9681317b1c00c88765b2537f9b10", 58 | "nx": {} 59 | } 60 | -------------------------------------------------------------------------------- /packages/type-utils/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bedrock-layout/type-utils", 3 | "version": "0.1.14", 4 | "description": "bedrock-layout type utils", 5 | "sideEffects": false, 6 | "private": false, 7 | "publishConfig": { 8 | "access": "public" 9 | }, 10 | "keywords": [ 11 | "type utils", 12 | "react", 13 | "hook", 14 | "useRef" 15 | ], 16 | "author": "Jarvis1010 ", 17 | "homepage": "https://bedrock-layout.dev/", 18 | "license": "MIT", 19 | "unpkg": "lib/index.umd.js", 20 | "main": "lib/index.umd.js", 21 | "umd:main": "lib/index.umd.js", 22 | "source": "src/index.tsx", 23 | "types": "lib/index.d.ts", 24 | "exports": { 25 | ".": { 26 | "types": "./lib/index.d.ts", 27 | "import": "./lib/index.m.js", 28 | "require": "./lib/index.umd.js" 29 | } 30 | }, 31 | "directories": { 32 | "lib": "lib", 33 | "test": "__tests__" 34 | }, 35 | "files": [ 36 | "lib" 37 | ], 38 | "repository": { 39 | "type": "git", 40 | "url": "git+https://github.com/Bedrock-Layouts/Bedrock.git" 41 | }, 42 | "scripts": { 43 | "test": "echo \"Error: run tests from root\" && exit 1", 44 | "lint": "eslint --ignore-path .gitignore . --no-error-on-unmatched-pattern", 45 | "clean:build": "rimraf lib", 46 | "build": "vite build && tsc --emitDeclarationOnly", 47 | "prettier": "prettier --ignore-path .gitignore \"**/*.+(js|jsx|ts|tsx|json)\"", 48 | "fix-format": "yarn prettier --write", 49 | "check-format": "yarn prettier --list-different", 50 | "check-types": "tsc --noEmit" 51 | }, 52 | "bugs": { 53 | "url": "https://github.com/Bedrock-Layouts/Bedrock/issues" 54 | }, 55 | "peerDependencies": { 56 | "react": "^16.8 || ^17 || ^18" 57 | }, 58 | "gitHead": "a3f85a5aebbd9681317b1c00c88765b2537f9b10", 59 | "nx": {} 60 | } 61 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Bedrock Layout 2 | 3 | Thank you for taking the time to contribute! 🎉 4 | 5 | There are many ways to contribute to the Bedrock Layout Primitives. The most common is to fork the repository and make your own changes. You can also contribute directly to the discussions at the [GitHub repository](https://github.com/Bedrock-Layouts/Bedrock/discussions/categories/general) or you can create an [issue](https://github.com/Bedrock-Layouts/Bedrock/issues) to discuss the changes or problems you find. 6 | 7 | ## Contributing Code 8 | 9 | When contributing code to Bedrock Layout Primitives, please first create an [issue](https://github.com/Bedrock-Layouts/Bedrock/issues) to discuss the changes. 10 | 11 | Bedrock Layout Primitives is a monorepo of packages that are currently versioned independently of each other. It also utilizes Storybook as a documentation website. 12 | 13 | To manage all of these things, Bedrock uses Lerna to manage all the repositories into one monorepo. Lerna is used to publish to NPM, tag releases to Github, and process change logs under each package. To make the above possible in CI, Bedrock has adopted conventional commits and uses commitizen and husky to enforce it. 14 | 15 | To make a pull request, do the following: 16 | 17 | 1. Fork the repository. 18 | 1. Clone the repository from your GitHub. 19 | 1. Set up your environment with `yarn` 20 | 1. Check out a new branch and add your modification. 21 | 1. Add test cases for all your changes. 22 | 1. Update any README.md and documentation in Storybook under the examples folder in the corresponding package. 23 | 1. Use commitizen to do git commit by running `yarn cz` (be sure to stage your changes first). Doing this will automatically run `yarn verify` as a pre-commit hook when you do this. If anything fails, fix and follow this step again. 24 | 1. **DO NOT BUMP ANY VERSION NUMBERS OR UPDATE CHANGELOG.** 25 | 1. Send a pull request 🙏 26 | -------------------------------------------------------------------------------- /packages/frame/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bedrock-layout/frame", 3 | "version": "3.2.14", 4 | "description": "bedrock-layout frame", 5 | "sideEffects": false, 6 | "private": false, 7 | "publishConfig": { 8 | "access": "public" 9 | }, 10 | "keywords": [ 11 | "frame", 12 | "layout", 13 | "react" 14 | ], 15 | "author": "Jarvis1010 ", 16 | "homepage": "https://bedrock-layout.dev/", 17 | "license": "MIT", 18 | "unpkg": "lib/index.umd.js", 19 | "main": "lib/index.umd.js", 20 | "umd:main": "lib/index.umd.js", 21 | "module": "lib/index.m.js", 22 | "source": "src/index.tsx", 23 | "types": "lib/index.d.ts", 24 | "exports": { 25 | ".": { 26 | "types": "./lib/index.d.ts", 27 | "import": "./lib/index.m.js", 28 | "require": "./lib/index.umd.js" 29 | } 30 | }, 31 | "directories": { 32 | "lib": "lib", 33 | "test": "__tests__" 34 | }, 35 | "files": [ 36 | "lib" 37 | ], 38 | "dependencies": { 39 | "@bedrock-layout/type-utils": "^0.1.14" 40 | }, 41 | "peerDependencies": { 42 | "@bedrock-layout/css": "^2.1.0", 43 | "react": "^16.8 || ^17 || ^18" 44 | }, 45 | "repository": { 46 | "type": "git", 47 | "url": "git+https://github.com/Bedrock-Layouts/Bedrock.git" 48 | }, 49 | "scripts": { 50 | "test": "echo \"Error: run tests from root\" && exit 1", 51 | "lint": "eslint --ignore-path .gitignore .", 52 | "clean:build": "rimraf lib", 53 | "build": "vite build && tsc --emitDeclarationOnly", 54 | "prettier": "prettier --ignore-path .gitignore \"**/*.+(js|jsx|ts|tsx|json)\"", 55 | "fix-format": "yarn prettier --write", 56 | "check-format": "yarn prettier --list-different", 57 | "check-types": "tsc --noEmit" 58 | }, 59 | "bugs": { 60 | "url": "https://github.com/Bedrock-Layouts/Bedrock/issues" 61 | }, 62 | "gitHead": "a3f85a5aebbd9681317b1c00c88765b2537f9b10", 63 | "nx": {} 64 | } 65 | -------------------------------------------------------------------------------- /packages/solid/src/stack.tsx: -------------------------------------------------------------------------------- 1 | import { JSX, mergeProps } from "solid-js"; 2 | 3 | import { SpacingOptions, getSpacingValue } from "./spacing-constants"; 4 | import { useTheme } from "./theme-provider"; 5 | import createDynamic, { 6 | DynamicProps, 7 | HeadlessPropsWithRef, 8 | ValidConstructor, 9 | createPropsFromAccessors, 10 | omitProps, 11 | } from "./typeUtils"; 12 | 13 | const alignMap = { 14 | start: "align:start", 15 | end: "align:end", 16 | center: "align:center", 17 | stretch: "align:stretch", 18 | } as const; 19 | 20 | export interface StackPropsBase { 21 | /** 22 | * @deprecated Use `gap` instead 23 | */ 24 | gutter?: SpacingOptions; 25 | gap?: SpacingOptions; 26 | align?: keyof typeof alignMap; 27 | } 28 | 29 | export type StackProps = 30 | HeadlessPropsWithRef; 31 | 32 | export function Stack( 33 | props: Readonly>, 34 | ): JSX.Element { 35 | const theme = useTheme(); 36 | const propsStyle = () => 37 | typeof props.style === "string" 38 | ? props.style 39 | : Object.entries(props.style ?? ({} as JSX.CSSProperties)).reduce( 40 | (str, [key, value]) => str + `${key}:${value};`, 41 | "", 42 | ); 43 | 44 | const gutter = () => 45 | `--gutter: ${ 46 | getSpacingValue(theme, props.gap ?? props.gutter ?? "size00") ?? "0px" 47 | }`; 48 | 49 | const style = () => [propsStyle(), gutter()].join("; "); 50 | 51 | const align = () => 52 | props.align !== undefined ? alignMap[props.align] : undefined; 53 | 54 | const attrAssessor = () => [align()].filter(Boolean).join(" "); 55 | 56 | return createDynamic( 57 | () => props.as ?? ("div" as T), 58 | mergeProps( 59 | omitProps(props, ["as", "gutter"]), 60 | createPropsFromAccessors({ style, "data-br-stack": attrAssessor }), 61 | ) as DynamicProps, 62 | ); 63 | } 64 | -------------------------------------------------------------------------------- /packages/solid/src/center.tsx: -------------------------------------------------------------------------------- 1 | import { JSX, mergeProps } from "solid-js"; 2 | 3 | import { CSSLength } from "./spacing-constants"; 4 | import createDynamic, { 5 | DynamicProps, 6 | HeadlessPropsWithRef, 7 | ValidConstructor, 8 | createPropsFromAccessors, 9 | omitProps, 10 | } from "./typeUtils"; 11 | 12 | function getSafeMaxWidth(maxWidth?: MaxWidth) { 13 | if (maxWidth === undefined) return "100%"; 14 | if (typeof maxWidth === "number") return `${maxWidth}px`; 15 | return maxWidth; 16 | } 17 | 18 | type MaxWidth = number | CSSLength; 19 | 20 | export interface CenterBaseProps { 21 | maxWidth?: MaxWidth; 22 | centerText?: boolean; 23 | centerChildren?: boolean; 24 | } 25 | 26 | export type CenterProps = 27 | HeadlessPropsWithRef; 28 | 29 | export function Center( 30 | props: Readonly>, 31 | ): JSX.Element { 32 | const propsStyle = () => 33 | typeof props.style === "string" 34 | ? props.style 35 | : Object.entries(props.style ?? ({} as JSX.CSSProperties)).reduce( 36 | (str, [key, value]) => str + `${key}:${value};`, 37 | "", 38 | ); 39 | 40 | const maxWidth = () => `--maxWidth: ${getSafeMaxWidth(props.maxWidth)};`; 41 | 42 | const centerText = () => (props.centerText ? "center-text" : ""); 43 | 44 | const centerChildren = () => (props.centerChildren ? "center-children" : ""); 45 | 46 | const attrString = () => 47 | [centerText(), centerChildren()].filter(Boolean).join(" "); 48 | 49 | const style = () => [propsStyle(), maxWidth()].join("; "); 50 | 51 | return createDynamic( 52 | () => props.as ?? ("div" as T), 53 | mergeProps( 54 | omitProps(props, ["as", "maxWidth", "centerText", "centerChildren"]), 55 | createPropsFromAccessors({ 56 | style, 57 | "data-br-center": attrString, 58 | }), 59 | ) as DynamicProps, 60 | ); 61 | } 62 | -------------------------------------------------------------------------------- /packages/column-drop/README.md: -------------------------------------------------------------------------------- 1 | # `@bedrock-layout/column-drop` 2 | 3 | Layout helper that creates column-drop of items 4 | 5 | Full docs at: [bedrock-layout.dev](https://bedrock-layout.dev/) 6 | 7 | ## When to Use 8 | 9 | Used to create a column-drop layouts 10 | 11 | ## How to install 12 | 13 | `npm install @bedrock-layout/column-drop` 14 | 15 | ## Usage 16 | 17 | ```javascript 18 | import ColumnDrop from "@bedrock-layout/column-drop"; 19 | 20 | 21 | Lorem ipsum dolor 22 | sit amet consectetur 23 | adipisicing elit. 24 | ; 25 | ``` 26 | 27 | ## data-attribute 28 | 29 | For purposes of styling you can select `data-br-column-drop`. 30 | 31 | ## API 32 | 33 | \* required 34 | 35 | | Property | Description | Type | Default | 36 | | -------- | ----------------------------------------------------------- | --------------------------------------------- | ------- | 37 | | gutter\* | sets space inbetween each element | one of spacing\*\* | - | 38 | | stretch | child or children that will stretch to fill available space | One of: `all, start, end, index of the child` | - | 39 | | justify | Inline alignment | One of: `start, end, center` | `start` | 40 | | align | Block alignment | One of: `start, end, center` | `start` | 41 | | switchAt | The width that the container will switch to stacking | One of: `CSS length, number` | - | 42 | 43 | \*\* By default, spacings are one of the [spacing-constants](https://github.com/Bedrock-Layouts/Bedrock/tree/main/packages/spacing-constants), but can be overridden using the `ThemeProvider` from `@bedrock-layout/spacing-constants` 44 | -------------------------------------------------------------------------------- /packages/grid/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bedrock-layout/grid", 3 | "version": "4.4.4", 4 | "description": "bedrock-layout grid", 5 | "sideEffects": false, 6 | "private": false, 7 | "publishConfig": { 8 | "access": "public" 9 | }, 10 | "keywords": [ 11 | "grid", 12 | "layout", 13 | "react" 14 | ], 15 | "author": "Jarvis1010 ", 16 | "homepage": "https://bedrock-layout.dev/", 17 | "license": "MIT", 18 | "unpkg": "lib/index.umd.js", 19 | "main": "lib/index.umd.js", 20 | "umd:main": "lib/index.umd.js", 21 | "module": "lib/index.m.js", 22 | "source": "src/index.tsx", 23 | "types": "lib/index.d.ts", 24 | "exports": { 25 | ".": { 26 | "types": "./lib/index.d.ts", 27 | "import": "./lib/index.m.js", 28 | "require": "./lib/index.umd.js" 29 | } 30 | }, 31 | "directories": { 32 | "lib": "lib", 33 | "test": "__tests__" 34 | }, 35 | "files": [ 36 | "lib" 37 | ], 38 | "dependencies": { 39 | "@bedrock-layout/spacing-constants": "^3.3.10", 40 | "@bedrock-layout/type-utils": "^0.1.14" 41 | }, 42 | "peerDependencies": { 43 | "@bedrock-layout/css": "^2.1.0", 44 | "react": "^16.8 || ^17 || ^18" 45 | }, 46 | "repository": { 47 | "type": "git", 48 | "url": "git+https://github.com/Bedrock-Layouts/Bedrock.git" 49 | }, 50 | "scripts": { 51 | "test": "echo \"Error: run tests from root\" && exit 1", 52 | "lint": "eslint --ignore-path .gitignore .", 53 | "clean:build": "rimraf lib", 54 | "build": "vite build && tsc --emitDeclarationOnly", 55 | "prettier": "prettier --ignore-path .gitignore \"**/*.+(js|jsx|ts|tsx|json)\"", 56 | "fix-format": "yarn prettier --write", 57 | "check-format": "yarn prettier --list-different", 58 | "check-types": "tsc --noEmit" 59 | }, 60 | "bugs": { 61 | "url": "https://github.com/Bedrock-Layouts/Bedrock/issues" 62 | }, 63 | "gitHead": "a3f85a5aebbd9681317b1c00c88765b2537f9b10", 64 | "nx": {} 65 | } 66 | -------------------------------------------------------------------------------- /packages/cover/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bedrock-layout/cover", 3 | "version": "3.5.4", 4 | "description": "bedrock-layout cover", 5 | "sideEffects": false, 6 | "private": false, 7 | "publishConfig": { 8 | "access": "public" 9 | }, 10 | "keywords": [ 11 | "cover", 12 | "layout", 13 | "react" 14 | ], 15 | "author": "Jarvis1010 ", 16 | "homepage": "https://bedrock-layout.dev/", 17 | "license": "MIT", 18 | "unpkg": "lib/index.umd.js", 19 | "main": "lib/index.umd.js", 20 | "umd:main": "lib/index.umd.js", 21 | "module": "lib/index.m.js", 22 | "source": "src/index.tsx", 23 | "types": "lib/index.d.ts", 24 | "exports": { 25 | ".": { 26 | "types": "./lib/index.d.ts", 27 | "import": "./lib/index.m.js", 28 | "require": "./lib/index.umd.js" 29 | } 30 | }, 31 | "directories": { 32 | "lib": "lib", 33 | "test": "__tests__" 34 | }, 35 | "files": [ 36 | "lib" 37 | ], 38 | "dependencies": { 39 | "@bedrock-layout/spacing-constants": "^3.3.10", 40 | "@bedrock-layout/type-utils": "^0.1.14" 41 | }, 42 | "peerDependencies": { 43 | "@bedrock-layout/css": "^2.1.0", 44 | "react": "^16.8 || ^17 || ^18" 45 | }, 46 | "repository": { 47 | "type": "git", 48 | "url": "git+https://github.com/Bedrock-Layouts/Bedrock.git" 49 | }, 50 | "scripts": { 51 | "test": "echo \"Error: run tests from root\" && exit 1", 52 | "lint": "eslint --ignore-path .gitignore .", 53 | "clean:build": "rimraf lib", 54 | "build": "vite build && tsc --emitDeclarationOnly", 55 | "prettier": "prettier --ignore-path .gitignore \"**/*.+(js|jsx|ts|tsx|json)\"", 56 | "fix-format": "yarn prettier --write", 57 | "check-format": "yarn prettier --list-different", 58 | "check-types": "tsc --noEmit" 59 | }, 60 | "bugs": { 61 | "url": "https://github.com/Bedrock-Layouts/Bedrock/issues" 62 | }, 63 | "gitHead": "a3f85a5aebbd9681317b1c00c88765b2537f9b10", 64 | "nx": {} 65 | } 66 | -------------------------------------------------------------------------------- /packages/inline-cluster/README.md: -------------------------------------------------------------------------------- 1 | # `@bedrock-layout/inline-cluster` 2 | 3 | InlineCluster is a layout helper component that displays items in a row. 4 | 5 | Full docs at: [bedrock-layout.dev](https://bedrock-layout.dev/) 6 | 7 | --- 8 | 9 | ## When to Use 10 | 11 | The `InclineCluster` component can be used to create inline-cluster layouts where items are displayed in a single row. If the number of items is too large, then they are displayed in a cluster with respect to the container's width and the cluster's justification (start, end, or center). 12 | 13 | --- 14 | 15 | ## How to install 16 | 17 | `npm install @bedrock-layout/inline-cluster` 18 | 19 | or 20 | 21 | `yarn add @bedrock-layout/inline-cluster` 22 | 23 | --- 24 | 25 | ## Usage 26 | 27 | ```javascript 28 | import { InlineCluster } from "@bedrock-layout/inline-cluster"; 29 | 30 | 31 | Lorem ipsum dolor 32 | sit amet consectetur 33 | adipisicing elit. 34 | ; 35 | ``` 36 | 37 | --- 38 | 39 | ## data-attribute 40 | 41 | For styling purposes, you can select `data-br-inline-cluster`. 42 | 43 | --- 44 | 45 | ## API 46 | 47 | \* required 48 | 49 | | Property | Description | Type | Default | 50 | | :------: | :-------------------------------------------: | :--------------------------: | :-----: | 51 | | gutter\* | Sets the space between each child element | one of `Spacing`\*\* | - | 52 | | justify | Sets the inline justification of the children | One of: `start, end, center` | `start` | 53 | | align | Sets the block alignment of the children | One of: `start, end, center` | `start` | 54 | 55 | \*\* By default, `Spacing` is one of [spacing-constants](https://github.com/Bedrock-Layouts/Bedrock/tree/main/packages/spacing-constants) values, but this can be overwritten using the `ThemeProvider` from `@bedrock-layout/spacing-constants` 56 | -------------------------------------------------------------------------------- /packages/reel/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bedrock-layout/reel", 3 | "version": "2.2.4", 4 | "description": "bedrock-layout reel", 5 | "sideEffects": false, 6 | "private": false, 7 | "publishConfig": { 8 | "access": "public" 9 | }, 10 | "keywords": [ 11 | "reel", 12 | "scroll-snap", 13 | "layout", 14 | "react" 15 | ], 16 | "author": "Bedrock Layout", 17 | "homepage": "https://bedrock-layout.dev/", 18 | "license": "MIT", 19 | "unpkg": "lib/index.umd.js", 20 | "main": "lib/index.umd.js", 21 | "umd:main": "lib/index.umd.js", 22 | "module": "lib/index.m.js", 23 | "source": "src/index.tsx", 24 | "types": "lib/index.d.ts", 25 | "exports": { 26 | ".": { 27 | "types": "./lib/index.d.ts", 28 | "import": "./lib/index.m.js", 29 | "require": "./lib/index.umd.js" 30 | } 31 | }, 32 | "directories": { 33 | "lib": "lib", 34 | "test": "__tests__" 35 | }, 36 | "files": [ 37 | "lib" 38 | ], 39 | "dependencies": { 40 | "@bedrock-layout/spacing-constants": "^3.3.10", 41 | "@bedrock-layout/type-utils": "^0.1.14" 42 | }, 43 | "peerDependencies": { 44 | "@bedrock-layout/css": "^2.1.0", 45 | "react": "^16.8 || ^17 || ^18" 46 | }, 47 | "repository": { 48 | "type": "git", 49 | "url": "git+https://github.com/Bedrock-Layouts/Bedrock.git" 50 | }, 51 | "scripts": { 52 | "test": "echo \"Error: run tests from root\" && exit 1", 53 | "lint": "eslint --ignore-path .gitignore .", 54 | "clean:build": "rimraf lib", 55 | "build": "vite build && tsc --emitDeclarationOnly", 56 | "prettier": "prettier --ignore-path .gitignore \"**/*.+(js|jsx|ts|tsx|json)\"", 57 | "fix-format": "yarn prettier --write", 58 | "check-format": "yarn prettier --list-different", 59 | "check-types": "tsc --noEmit" 60 | }, 61 | "bugs": { 62 | "url": "https://github.com/Bedrock-Layouts/Bedrock/issues" 63 | }, 64 | "gitHead": "a3f85a5aebbd9681317b1c00c88765b2537f9b10", 65 | "nx": {} 66 | } 67 | -------------------------------------------------------------------------------- /packages/split/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bedrock-layout/split", 3 | "version": "3.2.4", 4 | "description": "bedrock-layout split", 5 | "sideEffects": false, 6 | "private": false, 7 | "publishConfig": { 8 | "access": "public" 9 | }, 10 | "keywords": [ 11 | "split", 12 | "layout", 13 | "react" 14 | ], 15 | "author": "Jarvis1010 ", 16 | "homepage": "https://bedrock-layout.dev/", 17 | "license": "MIT", 18 | "unpkg": "lib/index.umd.js", 19 | "main": "lib/index.umd.js", 20 | "umd:main": "lib/index.umd.js", 21 | "module": "lib/index.m.js", 22 | "source": "src/index.tsx", 23 | "types": "lib/index.d.ts", 24 | "exports": { 25 | ".": { 26 | "types": "./lib/index.d.ts", 27 | "import": "./lib/index.m.js", 28 | "require": "./lib/index.umd.js" 29 | } 30 | }, 31 | "directories": { 32 | "lib": "lib", 33 | "test": "__tests__" 34 | }, 35 | "files": [ 36 | "lib" 37 | ], 38 | "dependencies": { 39 | "@bedrock-layout/spacing-constants": "^3.3.10", 40 | "@bedrock-layout/type-utils": "^0.1.14" 41 | }, 42 | "peerDependencies": { 43 | "@bedrock-layout/css": "^2.1.0", 44 | "react": "^16.8 || ^17 || ^18" 45 | }, 46 | "repository": { 47 | "type": "git", 48 | "url": "git+https://github.com/Bedrock-Layouts/Bedrock.git" 49 | }, 50 | "scripts": { 51 | "test": "echo \"Error: run tests from root\" && exit 1", 52 | "lint": "eslint --ignore-path .gitignore .", 53 | "clean:build": "rimraf lib", 54 | "build": "vite build && tsc --emitDeclarationOnly", 55 | "prettier": "prettier --ignore-path .gitignore \"**/*.+(js|jsx|ts|tsx|json)\"", 56 | "fix-format": "yarn prettier --write", 57 | "check-format": "yarn prettier --list-different", 58 | "check-types": "tsc --noEmit" 59 | }, 60 | "bugs": { 61 | "url": "https://github.com/Bedrock-Layouts/Bedrock/issues" 62 | }, 63 | "gitHead": "a3f85a5aebbd9681317b1c00c88765b2537f9b10", 64 | "nx": {} 65 | } 66 | -------------------------------------------------------------------------------- /packages/center/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bedrock-layout/center", 3 | "version": "3.2.15", 4 | "description": "bedrock-layout center", 5 | "sideEffects": false, 6 | "private": false, 7 | "publishConfig": { 8 | "access": "public" 9 | }, 10 | "keywords": [ 11 | "center", 12 | "layout", 13 | "react" 14 | ], 15 | "author": "Jarvis1010 ", 16 | "homepage": "https://bedrock-layout.dev/", 17 | "license": "MIT", 18 | "unpkg": "lib/index.umd.js", 19 | "main": "lib/index.umd.js", 20 | "umd:main": "lib/index.umd.js", 21 | "module": "lib/index.m.js", 22 | "source": "src/index.tsx", 23 | "types": "lib/index.d.ts", 24 | "exports": { 25 | ".": { 26 | "types": "./lib/index.d.ts", 27 | "import": "./lib/index.m.js", 28 | "require": "./lib/index.umd.js" 29 | } 30 | }, 31 | "directories": { 32 | "lib": "lib", 33 | "test": "__tests__" 34 | }, 35 | "files": [ 36 | "lib" 37 | ], 38 | "dependencies": { 39 | "@bedrock-layout/spacing-constants": "^3.3.10", 40 | "@bedrock-layout/type-utils": "^0.1.14" 41 | }, 42 | "peerDependencies": { 43 | "@bedrock-layout/css": "^2.1.0", 44 | "react": "^16.8 || ^17 || ^18" 45 | }, 46 | "repository": { 47 | "type": "git", 48 | "url": "git+https://github.com/Bedrock-Layouts/Bedrock.git" 49 | }, 50 | "scripts": { 51 | "test": "echo \"Error: run tests from root\" && exit 1", 52 | "lint": "eslint --ignore-path .gitignore .", 53 | "clean:build": "rimraf lib", 54 | "build": "vite build && tsc --emitDeclarationOnly", 55 | "prettier": "prettier --ignore-path .gitignore \"**/*.+(js|jsx|ts|tsx|json)\"", 56 | "fix-format": "yarn prettier --write", 57 | "check-format": "yarn prettier --list-different", 58 | "check-types": "tsc --noEmit" 59 | }, 60 | "bugs": { 61 | "url": "https://github.com/Bedrock-Layouts/Bedrock/issues" 62 | }, 63 | "gitHead": "a3f85a5aebbd9681317b1c00c88765b2537f9b10", 64 | "nx": {} 65 | } 66 | -------------------------------------------------------------------------------- /packages/columns/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bedrock-layout/columns", 3 | "version": "3.3.4", 4 | "description": "bedrock-layout columns", 5 | "sideEffects": false, 6 | "private": false, 7 | "publishConfig": { 8 | "access": "public" 9 | }, 10 | "keywords": [ 11 | "columns", 12 | "layout", 13 | "react" 14 | ], 15 | "author": "Jarvis1010 ", 16 | "homepage": "https://bedrock-layout.dev/", 17 | "license": "MIT", 18 | "unpkg": "lib/index.umd.js", 19 | "main": "lib/index.umd.js", 20 | "umd:main": "lib/index.umd.js", 21 | "module": "lib/index.m.js", 22 | "source": "src/index.tsx", 23 | "types": "lib/index.d.ts", 24 | "exports": { 25 | ".": { 26 | "types": "./lib/index.d.ts", 27 | "import": "./lib/index.m.js", 28 | "require": "./lib/index.umd.js" 29 | } 30 | }, 31 | "directories": { 32 | "lib": "lib", 33 | "test": "__tests__" 34 | }, 35 | "files": [ 36 | "lib" 37 | ], 38 | "dependencies": { 39 | "@bedrock-layout/spacing-constants": "^3.3.10", 40 | "@bedrock-layout/type-utils": "^0.1.14" 41 | }, 42 | "peerDependencies": { 43 | "@bedrock-layout/css": "^2.1.0", 44 | "react": "^16.8 || ^17 || ^18" 45 | }, 46 | "repository": { 47 | "type": "git", 48 | "url": "git+https://github.com/Bedrock-Layouts/Bedrock.git" 49 | }, 50 | "scripts": { 51 | "test": "echo \"Error: run tests from root\" && exit 1", 52 | "lint": "eslint --ignore-path .gitignore .", 53 | "clean:build": "rimraf lib", 54 | "build": "vite build && tsc --emitDeclarationOnly", 55 | "prettier": "prettier --ignore-path .gitignore \"**/*.+(js|jsx|ts|tsx|json)\"", 56 | "fix-format": "yarn prettier --write", 57 | "check-format": "yarn prettier --list-different", 58 | "check-types": "tsc --noEmit" 59 | }, 60 | "bugs": { 61 | "url": "https://github.com/Bedrock-Layouts/Bedrock/issues" 62 | }, 63 | "gitHead": "a3f85a5aebbd9681317b1c00c88765b2537f9b10", 64 | "nx": {} 65 | } 66 | -------------------------------------------------------------------------------- /stories/use-forwarded-ref/useForwardedRef.mdx: -------------------------------------------------------------------------------- 1 | import { Meta } from "@storybook/addon-docs"; 2 | 3 | 4 | 5 | # useForwardedRef 6 | 7 | ## Use case 8 | 9 | Used to provide a safe ref to use when working with a forwardRef. The ref Object provided from `useForwardedRef` is stateful or in otherwords, 10 | will trigger a rerender when the `current` property changes. 11 | 12 | ## How to install 13 | 14 | ```bash 15 | npm install @bedrock-layout/use-forwarded-ref 16 | ``` 17 | 18 | ## Basic usage 19 | 20 | ```javascript 21 | import { useForwardedRef } from '@bedrock-layout/use-forwarded-ref'; 22 | 23 | const ForwardedRefDiv = React.forwardRef((props,ref)=>{ 24 | const innerRef = useForwardedRef(ref) 25 | // do something with innerRef 26 | return
27 | }) 28 | ``` 29 | 30 | Then in your app you would use it like this: 31 | 32 | ```javascript 33 | const App = () => { 34 | const ref = React.useRef(null); 35 | console.log(ref.current); 36 | return {...content}; 37 | }; 38 | ``` 39 | 40 | ## Config 41 | 42 | `useForwardedRef` accepts a single config object as a second argument. The config object can have the following properties: `isStateful`. `isStateful` is a boolean that determines if the ref is stateful or not. 43 | 44 | If `isStateful` is true, the ref will trigger a rerender when the `current` property changes. If `isStateful` is false, the ref will not trigger a rerender when the `current` property changes. 45 | 46 | The default value is true. 47 | 48 | For example: 49 | 50 | ```javascript 51 | import { useForwardedRef } from '@bedrock-layout/use-forwarded-ref'; 52 | 53 | const ForwardedRefDiv = React.forwardRef((props,ref)=>{ 54 | const innerRef = useForwardedRef(ref, {isStateful: false}) 55 | // innerRef will not trigger a rerender when the `current` property changes 56 | return
57 | }) 58 | ``` 59 | -------------------------------------------------------------------------------- /packages/padbox/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bedrock-layout/padbox", 3 | "version": "3.2.14", 4 | "description": "bedrock-layout padbox layout primitive", 5 | "sideEffects": false, 6 | "private": false, 7 | "publishConfig": { 8 | "access": "public" 9 | }, 10 | "keywords": [ 11 | "padbox", 12 | "layout", 13 | "react" 14 | ], 15 | "author": "Jarvis1010 ", 16 | "homepage": "https://bedrock-layout.dev/", 17 | "license": "MIT", 18 | "unpkg": "lib/index.umd.js", 19 | "main": "lib/index.umd.js", 20 | "umd:main": "lib/index.umd.js", 21 | "module": "lib/index.m.js", 22 | "source": "src/index.tsx", 23 | "types": "lib/index.d.ts", 24 | "exports": { 25 | ".": { 26 | "types": "./lib/index.d.ts", 27 | "import": "./lib/index.m.js", 28 | "require": "./lib/index.umd.js" 29 | } 30 | }, 31 | "directories": { 32 | "lib": "lib", 33 | "test": "__tests__" 34 | }, 35 | "files": [ 36 | "lib" 37 | ], 38 | "dependencies": { 39 | "@bedrock-layout/spacing-constants": "^3.3.10", 40 | "@bedrock-layout/type-utils": "^0.1.14" 41 | }, 42 | "peerDependencies": { 43 | "@bedrock-layout/css": "^2.1.0", 44 | "react": "^16.8 || ^17 || ^18" 45 | }, 46 | "repository": { 47 | "type": "git", 48 | "url": "git+https://github.com/Bedrock-Layouts/Bedrock.git" 49 | }, 50 | "scripts": { 51 | "test": "echo \"Error: run tests from root\" && exit 1", 52 | "lint": "eslint --ignore-path .gitignore .", 53 | "clean:build": "rimraf lib", 54 | "build": "vite build && tsc --emitDeclarationOnly", 55 | "prettier": "prettier --ignore-path .gitignore \"**/*.+(js|jsx|ts|tsx|json)\"", 56 | "fix-format": "yarn prettier --write", 57 | "check-format": "yarn prettier --list-different", 58 | "check-types": "tsc --noEmit" 59 | }, 60 | "bugs": { 61 | "url": "https://github.com/Bedrock-Layouts/Bedrock/issues" 62 | }, 63 | "gitHead": "a3f85a5aebbd9681317b1c00c88765b2537f9b10", 64 | "nx": {} 65 | } 66 | -------------------------------------------------------------------------------- /packages/solid/src/reel.tsx: -------------------------------------------------------------------------------- 1 | import { JSX, mergeProps } from "solid-js"; 2 | 3 | import { SpacingOptions, getSpacingValue } from "./spacing-constants"; 4 | import { useTheme } from "./theme-provider"; 5 | import createDynamic, { 6 | DynamicProps, 7 | HeadlessPropsWithRef, 8 | ValidConstructor, 9 | createPropsFromAccessors, 10 | omitProps, 11 | } from "./typeUtils"; 12 | 13 | export interface ReelBaseProps { 14 | snapType?: "none" | "proximity" | "mandatory"; 15 | /** 16 | * @deprecated Use `gap` instead 17 | */ 18 | gutter?: SpacingOptions; 19 | gap?: SpacingOptions; 20 | } 21 | 22 | export type ReelProps = 23 | HeadlessPropsWithRef; 24 | 25 | export function Reel( 26 | props: Readonly>, 27 | ): JSX.Element { 28 | const theme = useTheme(); 29 | const propsStyle = () => 30 | typeof props.style === "string" 31 | ? props.style 32 | : Object.entries(props.style ?? ({} as JSX.CSSProperties)).reduce( 33 | (str, [key, value]) => str + `${key}:${value};`, 34 | "", 35 | ); 36 | 37 | const gutter = () => 38 | `--gutter: ${ 39 | getSpacingValue(theme, props.gap ?? props.gutter ?? "size00") ?? "0px" 40 | }`; 41 | 42 | const snapType = () => { 43 | switch (props.snapType) { 44 | case "none": { 45 | return "snapType:none"; 46 | } 47 | case "proximity": { 48 | return "snapType:proximity"; 49 | } 50 | case "mandatory": { 51 | return "snapType:mandatory"; 52 | } 53 | default: { 54 | return "snapType:none"; 55 | } 56 | } 57 | }; 58 | 59 | const style = () => [propsStyle(), gutter()].join("; "); 60 | 61 | return createDynamic( 62 | () => props.as ?? ("div" as T), 63 | mergeProps( 64 | omitProps(props, ["as", "gutter"]), 65 | createPropsFromAccessors({ style, "data-br-reel": snapType }), 66 | ) as DynamicProps, 67 | ); 68 | } 69 | -------------------------------------------------------------------------------- /packages/appboundary/src/index.tsx: -------------------------------------------------------------------------------- 1 | import { Center } from "@bedrock-layout/center"; 2 | import { 3 | CSSLength, 4 | SizesOptions, 5 | getSizeValue, 6 | sizes, 7 | useTheme, 8 | } from "@bedrock-layout/spacing-constants"; 9 | import { forwardRefWithAs } from "@bedrock-layout/type-utils"; 10 | import React from "react"; 11 | 12 | /** 13 | * The `boundarySize` prop can can be a CSSLength, a number, or a key of the theme's sizes options. 14 | */ 15 | export type BoundarySize = number | CSSLength | SizesOptions; 16 | 17 | /** 18 | * Props for the AppBoundary component. 19 | */ 20 | export type AppBoundaryProps = { 21 | /** 22 | * Sets the size of the app boundary. 23 | * The `boundarySize` prop can accept any positive integer, `CSSLength`, `SizeOption`. 24 | */ 25 | boundarySize?: BoundarySize; 26 | }; 27 | 28 | /** 29 | * The `AppBoundary` component is designed to wrap your entire app. 30 | * Your app will be clamped at the `boundarySize` and stay centered on the screen. 31 | * By default, it will clamp the width at the `sizeXxl` option, 32 | * but can also be set to other the valid size options using the `boundarySize` prop. 33 | * 34 | * @deprecated this component is deprecated and will be removed in the next major version 35 | */ 36 | export const AppBoundary = forwardRefWithAs<"div", AppBoundaryProps>( 37 | function AppBoundary( 38 | { as: Component = "div", boundarySize, children, style, ...props }, 39 | ref, 40 | ) { 41 | const theme = useTheme(); 42 | const maybeSize = getSizeValue(theme, boundarySize); 43 | const safeStyle = style ?? {}; 44 | 45 | return ( 46 | 57 |
{children}
58 |
59 | ); 60 | }, 61 | ); 62 | -------------------------------------------------------------------------------- /packages/center/src/index.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | CSSLength, 3 | SizesOptions, 4 | getSizeValue, 5 | useTheme, 6 | } from "@bedrock-layout/spacing-constants"; 7 | import { forwardRefWithAs } from "@bedrock-layout/type-utils"; 8 | import React, { CSSProperties } from "react"; 9 | 10 | /** 11 | * The `maxWidth` prop can be a CSSLength, a number, or a key of the theme's sizes options. 12 | */ 13 | export type MaxWidth = number | CSSLength | SizesOptions; 14 | 15 | /** 16 | * Props for the Center component. 17 | */ 18 | export type CenterProps = { 19 | /** 20 | * Sets the max-inline size of the component. 21 | * The `maxWidth` prop can be a CSSLength, a number, or a key of the theme's sizes options. 22 | */ 23 | maxWidth?: MaxWidth; 24 | /** 25 | * Sets the text alignment of the component to center. 26 | */ 27 | centerText?: boolean; 28 | /** 29 | * Sets the alignment of the component's children to be centered. 30 | * @deprecated Use with the stack component set to align="center" instead. 31 | */ 32 | centerChildren?: boolean; 33 | }; 34 | 35 | /** 36 | * The `Center` component is designed to center and clamp its width at a predefined value. 37 | * You can also center the children and text alignment as well. 38 | */ 39 | export const Center = forwardRefWithAs<"div", CenterProps>(function Center( 40 | { 41 | as: Component = "div", 42 | centerChildren, 43 | centerText, 44 | maxWidth, 45 | style = {}, 46 | ...props 47 | }, 48 | ref, 49 | ) { 50 | const theme = useTheme(); 51 | const centerProps = [ 52 | centerText && "center-text", 53 | centerChildren && "center-children", 54 | ] 55 | .filter(Boolean) 56 | .join(" "); 57 | 58 | return ( 59 | 70 | ); 71 | }); 72 | -------------------------------------------------------------------------------- /packages/inline/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bedrock-layout/inline", 3 | "version": "4.4.4", 4 | "description": "bedrock-layout inline", 5 | "sideEffects": false, 6 | "private": false, 7 | "publishConfig": { 8 | "access": "public" 9 | }, 10 | "keywords": [ 11 | "inline", 12 | "flexbox", 13 | "layout", 14 | "react" 15 | ], 16 | "author": "Jarvis1010 ", 17 | "homepage": "https://bedrock-layout.dev/", 18 | "license": "MIT", 19 | "unpkg": "lib/index.umd.js", 20 | "main": "lib/index.umd.js", 21 | "umd:main": "lib/index.umd.js", 22 | "module": "lib/index.m.js", 23 | "source": "src/index.tsx", 24 | "types": "lib/index.d.ts", 25 | "exports": { 26 | ".": { 27 | "types": "./lib/index.d.ts", 28 | "import": "./lib/index.m.js", 29 | "require": "./lib/index.umd.js" 30 | } 31 | }, 32 | "directories": { 33 | "lib": "lib", 34 | "test": "__tests__" 35 | }, 36 | "files": [ 37 | "lib" 38 | ], 39 | "dependencies": { 40 | "@bedrock-layout/spacing-constants": "^3.3.10", 41 | "@bedrock-layout/type-utils": "^0.1.14" 42 | }, 43 | "peerDependencies": { 44 | "@bedrock-layout/css": "^2.1.0", 45 | "react": "^16.8 || ^17 || ^18" 46 | }, 47 | "repository": { 48 | "type": "git", 49 | "url": "git+https://github.com/Bedrock-Layouts/Bedrock.git" 50 | }, 51 | "scripts": { 52 | "test": "echo \"Error: run tests from root\" && exit 1", 53 | "lint": "eslint --ignore-path .gitignore .", 54 | "clean:build": "rimraf lib", 55 | "build": "vite build && tsc --emitDeclarationOnly", 56 | "prettier": "prettier --ignore-path .gitignore \"**/*.+(js|jsx|ts|tsx|json)\"", 57 | "fix-format": "yarn prettier --write", 58 | "check-format": "yarn prettier --list-different", 59 | "check-types": "tsc --noEmit" 60 | }, 61 | "bugs": { 62 | "url": "https://github.com/Bedrock-Layouts/Bedrock/issues" 63 | }, 64 | "gitHead": "a3f85a5aebbd9681317b1c00c88765b2537f9b10", 65 | "nx": {} 66 | } 67 | --------------------------------------------------------------------------------