@synerise/ds-grid 1.1.15 → 1.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.1.17](https://github.com/Synerise/synerise-design/compare/@synerise/ds-grid@1.1.16...@synerise/ds-grid@1.1.17) (2026-04-10)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-grid
9
+
10
+ ## [1.1.16](https://github.com/Synerise/synerise-design/compare/@synerise/ds-grid@1.1.15...@synerise/ds-grid@1.1.16) (2026-03-24)
11
+
12
+ **Note:** Version bump only for package @synerise/ds-grid
13
+
6
14
  ## [1.1.15](https://github.com/Synerise/synerise-design/compare/@synerise/ds-grid@1.1.14...@synerise/ds-grid@1.1.15) (2026-03-20)
7
15
 
8
16
  **Note:** Version bump only for package @synerise/ds-grid
@@ -1,2 +1,6 @@
1
- export var DEFAULT_GUTTER = 24;
2
- export var DEFAULT_COLUMNS_NUMBER = 24;
1
+ const DEFAULT_GUTTER = 24;
2
+ const DEFAULT_COLUMNS_NUMBER = 24;
3
+ export {
4
+ DEFAULT_COLUMNS_NUMBER,
5
+ DEFAULT_GUTTER
6
+ };
@@ -1,4 +1,4 @@
1
- export declare const GridContext: import("react").Context<{
1
+ export declare const GridContext: import('react').Context<{
2
2
  dimensions: {
3
3
  width: number;
4
4
  height: number;
@@ -1,7 +1,10 @@
1
- import { createContext } from 'react';
2
- export var GridContext = /*#__PURE__*/createContext({
1
+ import { createContext } from "react";
2
+ const GridContext = createContext({
3
3
  dimensions: {
4
4
  width: window.innerWidth,
5
5
  height: window.innerHeight
6
6
  }
7
- });
7
+ });
8
+ export {
9
+ GridContext
10
+ };
package/dist/Grid.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import React from 'react';
2
- import { type GridProps } from './Grid.types';
1
+ import { default as React } from 'react';
2
+ import { GridProps } from './Grid.types';
3
3
  declare const Grid: {
4
4
  ({ children, gutter, style }: GridProps): React.JSX.Element;
5
- Item: ({ children, contentWrapper, ...props }: import("./Grid.types").GridItemProps) => React.JSX.Element;
5
+ Item: ({ children, contentWrapper, ...props }: import('./Grid.types').GridItemProps) => React.JSX.Element;
6
6
  };
7
7
  export default Grid;
package/dist/Grid.js CHANGED
@@ -1,24 +1,18 @@
1
- import React from 'react';
2
- import { useBreakpoint } from '@synerise/ds-utils';
3
- import { DEFAULT_COLUMNS_NUMBER, DEFAULT_GUTTER } from './Grid.const';
4
- import { GridContext } from './Grid.context';
5
- import * as S from './Grid.styles';
6
- import Item from './GridItem/GridItem';
7
- var Grid = function Grid(_ref) {
8
- var _breakpointData$break;
9
- var children = _ref.children,
10
- _ref$gutter = _ref.gutter,
11
- gutter = _ref$gutter === void 0 ? DEFAULT_GUTTER : _ref$gutter,
12
- style = _ref.style;
13
- var breakpointData = useBreakpoint();
14
- return /*#__PURE__*/React.createElement(S.GridContainer, {
15
- style: style,
16
- className: "ds-grid",
17
- columns: ((_breakpointData$break = breakpointData.breakpoint) == null ? void 0 : _breakpointData$break.columns) || DEFAULT_COLUMNS_NUMBER,
18
- gutter: gutter
19
- }, /*#__PURE__*/React.createElement(GridContext.Provider, {
20
- value: breakpointData
21
- }, children));
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useBreakpoint } from "@synerise/ds-utils";
3
+ import { DEFAULT_GUTTER, DEFAULT_COLUMNS_NUMBER } from "./Grid.const.js";
4
+ import { GridContext } from "./Grid.context.js";
5
+ import { GridContainer } from "./Grid.styles.js";
6
+ import Item from "./GridItem/GridItem.js";
7
+ const Grid = ({
8
+ children,
9
+ gutter = DEFAULT_GUTTER,
10
+ style
11
+ }) => {
12
+ const breakpointData = useBreakpoint();
13
+ return /* @__PURE__ */ jsx(GridContainer, { style, className: "ds-grid", columns: breakpointData.breakpoint?.columns || DEFAULT_COLUMNS_NUMBER, gutter, children: /* @__PURE__ */ jsx(GridContext.Provider, { value: breakpointData, children }) });
22
14
  };
23
15
  Grid.Item = Item;
24
- export default Grid;
16
+ export {
17
+ Grid as default
18
+ };
@@ -1,8 +1,8 @@
1
- export declare const GridContainer: import("styled-components").StyledComponent<"div", any, {
1
+ export declare const GridContainer: import('styled-components').StyledComponent<"div", any, {
2
2
  columns: number;
3
3
  gutter: number;
4
4
  }, never>;
5
- export declare const GridItem: import("styled-components").StyledComponent<"div", any, {
5
+ export declare const GridItem: import('styled-components').StyledComponent<"div", any, {
6
6
  columns?: number;
7
7
  contentWrapper: boolean;
8
8
  maxColumns: number;
@@ -1,21 +1,13 @@
1
- import styled, { css } from 'styled-components';
2
- export var GridContainer = styled.div.withConfig({
1
+ import styled, { css } from "styled-components";
2
+ const GridContainer = /* @__PURE__ */ styled.div.withConfig({
3
3
  displayName: "Gridstyles__GridContainer",
4
4
  componentId: "sc-5newme-0"
5
- })(["width:100%;display:grid;grid-template-columns:repeat(", ",1fr);grid-row-gap:", ";grid-column-gap:", ";"], function (props) {
6
- return props.columns;
7
- }, function (props) {
8
- return props.gutter + "px";
9
- }, function (props) {
10
- return props.gutter + "px";
11
- });
12
- export var GridItem = styled.div.withConfig({
5
+ })(["width:100%;display:grid;grid-template-columns:repeat(", ",1fr);grid-row-gap:", ";grid-column-gap:", ";"], (props) => props.columns, (props) => `${props.gutter}px`, (props) => `${props.gutter}px`);
6
+ const GridItem = /* @__PURE__ */ styled.div.withConfig({
13
7
  displayName: "Gridstyles__GridItem",
14
8
  componentId: "sc-5newme-1"
15
- })(["grid-column:span ", ";display:", ";", ""], function (props) {
16
- return props.columns || 1;
17
- }, function (props) {
18
- return props.columns === 0 ? 'none' : 'inherit';
19
- }, function (props) {
20
- return props.contentWrapper && Boolean(props.maxColumns) && Boolean(props.columns) && css(["grid-column-start:", ";grid-column-end:", ";display:flex;flex-direction:column;align-items:flex-start;justify-content:stretch;& > *{width:100%;margin-bottom:24px;}"], props.maxColumns && props.columns ? (props.maxColumns - props.columns) / 2 + 1 : 'span', props.maxColumns && props.columns ? (props.maxColumns - props.columns) / 2 + 1 + props.columns : 1);
21
- });
9
+ })(["grid-column:span ", ";display:", ";", ""], (props) => props.columns || 1, (props) => props.columns === 0 ? "none" : "inherit", (props) => props.contentWrapper && Boolean(props.maxColumns) && Boolean(props.columns) && css(["grid-column-start:", ";grid-column-end:", ";display:flex;flex-direction:column;align-items:flex-start;justify-content:stretch;& > *{width:100%;margin-bottom:24px;}"], props.maxColumns && props.columns ? (props.maxColumns - props.columns) / 2 + 1 : "span", props.maxColumns && props.columns ? (props.maxColumns - props.columns) / 2 + 1 + props.columns : 1));
10
+ export {
11
+ GridContainer,
12
+ GridItem
13
+ };
@@ -1,4 +1,4 @@
1
- import { type CSSProperties, type ReactNode } from 'react';
1
+ import { CSSProperties, ReactNode } from 'react';
2
2
  export type GridProps = {
3
3
  gutter?: number;
4
4
  style?: CSSProperties;
@@ -1 +1 @@
1
- export {};
1
+
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { type GridItemProps } from '../Grid.types';
1
+ import { default as React } from 'react';
2
+ import { GridItemProps } from '../Grid.types';
3
3
  declare const Item: ({ children, contentWrapper, ...props }: GridItemProps) => React.JSX.Element;
4
4
  export default Item;
@@ -1,52 +1,45 @@
1
- var _excluded = ["children", "contentWrapper"];
2
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
3
- import React, { useContext, useMemo } from 'react';
4
- import { DEFAULT_COLUMNS_NUMBER } from '../Grid.const';
5
- import { GridContext } from '../Grid.context';
6
- import * as S from '../Grid.styles';
7
- var BREAKPOINTS = ['xxl', 'xl', 'lg', 'md', 'sm', 'xs'];
8
- var Item = function Item(_ref) {
9
- var _breakpointData$break2;
10
- var children = _ref.children,
11
- contentWrapper = _ref.contentWrapper,
12
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
13
- var breakpointData = useContext(GridContext);
14
- var definedBreakpoints = useMemo(function () {
15
- return BREAKPOINTS.filter(function (breakpoint) {
16
- return props[breakpoint] !== undefined;
17
- }).map(function (breakpoint) {
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useContext, useMemo } from "react";
3
+ import { DEFAULT_COLUMNS_NUMBER } from "../Grid.const.js";
4
+ import { GridContext } from "../Grid.context.js";
5
+ import { GridItem } from "../Grid.styles.js";
6
+ const BREAKPOINTS = ["xxl", "xl", "lg", "md", "sm", "xs"];
7
+ const Item = ({
8
+ children,
9
+ contentWrapper,
10
+ ...props
11
+ }) => {
12
+ const breakpointData = useContext(GridContext);
13
+ const definedBreakpoints = useMemo(() => {
14
+ return BREAKPOINTS.filter((breakpoint) => props[breakpoint] !== void 0).map((breakpoint) => {
18
15
  return {
19
16
  name: breakpoint,
20
17
  index: BREAKPOINTS.indexOf(breakpoint)
21
18
  };
22
19
  });
23
20
  }, [props]);
24
- var breakpointColumns = useMemo(function () {
21
+ const breakpointColumns = useMemo(() => {
25
22
  if (breakpointData.breakpoint) {
26
- var name = breakpointData.breakpoint.name;
27
- if (props[name] !== undefined) {
23
+ const {
24
+ name
25
+ } = breakpointData.breakpoint;
26
+ if (props[name] !== void 0) {
28
27
  return props[name];
29
28
  }
30
- var indexOfCurrentBreakpoint = BREAKPOINTS.indexOf(name);
31
- var nextAvailableBreakpoint = definedBreakpoints.find(function (breakpoint) {
32
- return breakpoint.index >= indexOfCurrentBreakpoint;
33
- });
34
- return nextAvailableBreakpoint ? props[nextAvailableBreakpoint.name] : undefined;
29
+ const indexOfCurrentBreakpoint = BREAKPOINTS.indexOf(name);
30
+ const nextAvailableBreakpoint = definedBreakpoints.find((breakpoint) => breakpoint.index >= indexOfCurrentBreakpoint);
31
+ return nextAvailableBreakpoint ? props[nextAvailableBreakpoint.name] : void 0;
35
32
  }
36
- return undefined;
33
+ return void 0;
37
34
  }, [breakpointData.breakpoint, definedBreakpoints, props]);
38
- var getColumns = useMemo(function () {
39
- var _breakpointData$break;
40
- if (breakpointColumns !== undefined) {
35
+ const getColumns = useMemo(() => {
36
+ if (breakpointColumns !== void 0) {
41
37
  return breakpointColumns;
42
38
  }
43
- return ((_breakpointData$break = breakpointData.breakpoint) == null ? void 0 : _breakpointData$break.columns) || DEFAULT_COLUMNS_NUMBER;
39
+ return breakpointData.breakpoint?.columns || DEFAULT_COLUMNS_NUMBER;
44
40
  }, [breakpointColumns, breakpointData]);
45
- return /*#__PURE__*/React.createElement(S.GridItem, {
46
- className: "ds-grid-item",
47
- columns: getColumns,
48
- maxColumns: (breakpointData == null || (_breakpointData$break2 = breakpointData.breakpoint) == null ? void 0 : _breakpointData$break2.columns) || getColumns,
49
- contentWrapper: Boolean(contentWrapper)
50
- }, children);
41
+ return /* @__PURE__ */ jsx(GridItem, { className: "ds-grid-item", columns: getColumns, maxColumns: breakpointData?.breakpoint?.columns || getColumns, contentWrapper: Boolean(contentWrapper), children });
42
+ };
43
+ export {
44
+ Item as default
51
45
  };
52
- export default Item;
package/dist/index.js CHANGED
@@ -1 +1,4 @@
1
- export { default } from './Grid';
1
+ import { default as default2 } from "./Grid.js";
2
+ export {
3
+ default2 as default
4
+ };
package/dist/modules.d.js CHANGED
@@ -1 +1 @@
1
- import '@testing-library/jest-dom';
1
+ import "@testing-library/jest-dom";
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-grid",
3
- "version": "1.1.15",
3
+ "version": "1.1.17",
4
4
  "description": "Grid UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -16,15 +16,12 @@
16
16
  "access": "public"
17
17
  },
18
18
  "scripts": {
19
- "build": "pnpm run build:js && pnpm run build:css && pnpm run defs",
20
- "build:css": "node ../../../scripts/style/less.js",
21
- "build:js": "babel --delete-dir-on-start --root-mode upward src --out-dir dist --extensions '.js,.ts,.tsx'",
22
- "build:watch": "pnpm run build:js -- --watch",
23
- "defs": "tsc --declaration --outDir dist/ --emitDeclarationOnly",
19
+ "build": "vite build",
20
+ "build:watch": "vite build --watch",
24
21
  "pack:ci": "pnpm pack --pack-destination ../../storybook/storybook-static/static",
25
22
  "prepublish": "pnpm run build",
26
- "test": "jest",
27
- "test:watch": "pnpm run test -- --watchAll",
23
+ "test": "vitest run",
24
+ "test:watch": "vitest",
28
25
  "types": "tsc --noEmit",
29
26
  "check:circular-dependencies": "madge --circular --extensions ts,tsx,js,jsx --ts-config tsconfig.json src/ --exclude '/dist/'",
30
27
  "upgrade:ds": "ncu -f \"@synerise/ds-*\" -u"
@@ -35,12 +32,13 @@
35
32
  ],
36
33
  "types": "dist/index.d.ts",
37
34
  "dependencies": {
38
- "@synerise/ds-utils": "^1.7.0"
35
+ "@synerise/ds-utils": "^1.8.0"
39
36
  },
40
37
  "peerDependencies": {
41
38
  "@synerise/ds-core": "*",
42
39
  "react": ">=16.9.0 <= 18.3.1",
43
- "styled-components": "^5.3.3"
40
+ "styled-components": "^5.3.3",
41
+ "vitest": "4"
44
42
  },
45
- "gitHead": "8efc031fa688c0b87c7b3915bae93546bb63bcac"
43
+ "gitHead": "ce3c6d75efe8573a2b274853636f959b75a6cd32"
46
44
  }