@uidu/page-header 0.2.13 → 1.0.3

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
@@ -1,5 +1,45 @@
1
1
  # @uidu/page-header
2
2
 
3
+ ## 1.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - e07f8ed62: Add lang files to npm
8
+ - Updated dependencies [e07f8ed62]
9
+ - @uidu/theme@0.6.7
10
+ - @uidu/shell@2.1.9
11
+
12
+ ## 1.0.2
13
+
14
+ ### Patch Changes
15
+
16
+ - 4eee3b6af: Added tailwind-config package, use tw in @uidu/menu
17
+
18
+ ## 1.0.1
19
+
20
+ ### Patch Changes
21
+
22
+ - beb3edb67: Select style updates, forwardRef to ShellBody
23
+ - Updated dependencies [beb3edb67]
24
+ - @uidu/theme@0.6.1
25
+ - @uidu/shell@2.0.3
26
+
27
+ ## 1.0.0
28
+
29
+ ### Major Changes
30
+
31
+ - c5a9ffbf6: ## Forms to tailwind, use css variables where possible, refactor Button completely
32
+
33
+ Button now is styleable from outside with tailwind or normal classNames. It's also possible to use css variables to style the button, and use variants to style the button.
34
+ Removed bootstrap dependency locally, to understand how the uikit behaves in a less opinionated client.
35
+ Bumped dependencies as well.
36
+
37
+ ### Patch Changes
38
+
39
+ - Updated dependencies [c5a9ffbf6]
40
+ - @uidu/shell@2.0.0
41
+ - @uidu/theme@0.6.0
42
+
3
43
  ## 0.2.13
4
44
 
5
45
  ### Patch Changes
@@ -1,20 +1,4 @@
1
- import { ReactElement, ReactNode } from 'react';
2
- declare type Props = {
3
- /** Returns the inner ref of the component. This is exposed so the focus can be set. */
4
- innerRef?: (element: HTMLElement) => void;
5
- /** Page breadcrumbs to be rendered above the title. */
6
- breadcrumbs?: ReactElement;
7
- /** Contents of the action bar to be rendered next to the page title. */
8
- actions?: ReactElement;
9
- /** Contents of the header bar to be rendered below the page title. */
10
- bottomBar?: ReactElement;
11
- /** Content of the page title. The text would be trimmed if it doesn't fit the
12
- header width and end with an ellipsis */
13
- children?: ReactNode;
14
- /** Disable default styles for page title */
15
- disableTitleStyles?: boolean;
16
- /** Prevent the title from wrapping across lines */
17
- truncateTitle?: boolean;
18
- };
19
- declare const PageHeader: ({ innerRef, breadcrumbs, actions, bottomBar, children, disableTitleStyles, truncateTitle, }: Props) => JSX.Element;
20
- export default PageHeader;
1
+ /// <reference types="react" />
2
+ import { PageHeaderProps } from '../types';
3
+ declare const PageHeader: ({ innerRef, breadcrumbs, actions, children, disableTitleStyles, truncateTitle, className, }: PageHeaderProps) => JSX.Element;
4
+ export default PageHeader;
@@ -1 +1 @@
1
- export { default } from './PageHeader';
1
+ export { default } from './PageHeader';
@@ -0,0 +1,18 @@
1
+ import { ReactElement, ReactNode } from 'react';
2
+ export declare type PageHeaderProps = {
3
+ /** Returns the inner ref of the component. This is exposed so the focus can be set. */
4
+ innerRef?: (element: HTMLElement) => void;
5
+ /** Page breadcrumbs to be rendered above the title. */
6
+ breadcrumbs?: ReactElement;
7
+ /** Contents of the action bar to be rendered next to the page title. */
8
+ actions?: ReactElement;
9
+ /** Classnames applied to PageHeader wrapper */
10
+ className?: string;
11
+ /** Content of the page title. The text would be trimmed if it doesn't fit the
12
+ header width and end with an ellipsis */
13
+ children?: ReactNode;
14
+ /** Disable default styles for page title */
15
+ disableTitleStyles?: boolean;
16
+ /** Prevent the title from wrapping across lines */
17
+ truncateTitle?: boolean;
18
+ };
package/dist/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@uidu/page-header",
3
- "version": "0.2.13",
3
+ "version": "1.0.3",
4
4
  "sideEffects": false
5
5
  }
@@ -2,80 +2,99 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var _styled = require('styled-components');
5
6
  require('react');
6
- var constants = require('@uidu/theme/constants');
7
- var typography = require('@uidu/theme/typography');
8
- var styled = require('styled-components');
9
7
  var jsxRuntime = require('react/jsx-runtime');
10
8
 
11
9
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
12
10
 
13
- var styled__default = /*#__PURE__*/_interopDefault(styled);
14
-
15
- var getTruncationStyles = function getTruncationStyles(_ref) {
16
- var truncate = _ref.truncate;
17
- return truncate ? "\n overflow-x: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n " : null;
18
- };
19
-
20
- var Outer = styled__default['default'].div.withConfig({
21
- displayName: "styled__Outer",
22
- componentId: "sc-1nd0qhd-0"
23
- })(["margin:", "px 0 ", "px 0;"], constants.gridSize() * 3, constants.gridSize() * 2);
24
- var StyledTitle = styled__default['default'].h1.withConfig({
25
- displayName: "styled__StyledTitle",
26
- componentId: "sc-1nd0qhd-1"
27
- })(["", ";", " line-height:", "px;margin-top:0;"], typography.h700(), getTruncationStyles, constants.gridSize() * 4);
28
- var TitleWrapper = styled__default['default'].div.withConfig({
29
- displayName: "styled__TitleWrapper",
30
- componentId: "sc-1nd0qhd-2"
31
- })(["align-items:flex-start;display:flex;", ""], function (_ref2) {
32
- var truncate = _ref2.truncate;
33
- return truncate ? 'flex-wrap: no-wrap;' : 'flex-wrap: wrap;';
34
- });
35
- var TitleContainer = styled__default['default'].div.withConfig({
36
- displayName: "styled__TitleContainer",
37
- componentId: "sc-1nd0qhd-3"
38
- })(["flex:1 0 auto;", " margin-bottom:", "px;max-width:100%;min-width:0;"], function (_ref3) {
39
- var truncate = _ref3.truncate;
40
- return truncate ? 'flex-shrink: 1;' : null;
41
- }, constants.gridSize());
42
- var ActionsWrapper = styled__default['default'].div.withConfig({
43
- displayName: "styled__ActionsWrapper",
44
- componentId: "sc-1nd0qhd-4"
45
- })(["flex:0 0 auto;margin-bottom:", "px;margin-left:auto;max-width:100%;padding-left:", "px;white-space:nowrap;>{text-align:right;}"], constants.gridSize(), constants.gridSize() * 4);
46
- var BottomBarWrapper = styled__default['default'].div.withConfig({
47
- displayName: "styled__BottomBarWrapper",
48
- componentId: "sc-1nd0qhd-5"
49
- })(["margin-top:", "px;"], constants.gridSize() * 2);
11
+ var _styled__default = /*#__PURE__*/_interopDefault(_styled);
50
12
 
51
13
  var PageHeader = function PageHeader(_ref) {
52
14
  var innerRef = _ref.innerRef,
53
15
  breadcrumbs = _ref.breadcrumbs,
54
16
  actions = _ref.actions,
55
- bottomBar = _ref.bottomBar,
56
17
  children = _ref.children,
57
18
  _ref$disableTitleStyl = _ref.disableTitleStyles,
58
19
  disableTitleStyles = _ref$disableTitleStyl === void 0 ? false : _ref$disableTitleStyl,
59
20
  _ref$truncateTitle = _ref.truncateTitle,
60
- truncateTitle = _ref$truncateTitle === void 0 ? false : _ref$truncateTitle;
61
- return /*#__PURE__*/jsxRuntime.jsxs(Outer, {
62
- children: [breadcrumbs, /*#__PURE__*/jsxRuntime.jsxs(TitleWrapper, {
63
- truncate: truncateTitle,
64
- children: [/*#__PURE__*/jsxRuntime.jsx(TitleContainer, {
65
- truncate: truncateTitle,
66
- children: disableTitleStyles ? children : /*#__PURE__*/jsxRuntime.jsx(StyledTitle, {
21
+ truncateTitle = _ref$truncateTitle === void 0 ? false : _ref$truncateTitle,
22
+ className = _ref.className;
23
+ return /*#__PURE__*/jsxRuntime.jsxs(_StyledDiv, {
24
+ className: className,
25
+ children: [breadcrumbs, /*#__PURE__*/jsxRuntime.jsxs(_StyledDiv2, {
26
+ children: [/*#__PURE__*/jsxRuntime.jsx(_StyledDiv3, {
27
+ children: disableTitleStyles ? children : /*#__PURE__*/jsxRuntime.jsx(_StyledH, {
67
28
  ref: innerRef,
68
29
  tabIndex: -1,
69
- truncate: truncateTitle,
30
+ $_css: [{
31
+ "fontSize": "1.5rem",
32
+ "lineHeight": "2rem",
33
+ "fontWeight": "700",
34
+ "@media (min-width: 640px)": {
35
+ "fontSize": "1.875rem",
36
+ "lineHeight": "2.25rem"
37
+ }
38
+ }, truncateTitle && {
39
+ "overflow": "hidden",
40
+ "textOverflow": "ellipsis",
41
+ "whiteSpace": "nowrap"
42
+ }],
70
43
  children: children
71
44
  })
72
- }), /*#__PURE__*/jsxRuntime.jsx(ActionsWrapper, {
45
+ }), /*#__PURE__*/jsxRuntime.jsx(_StyledDiv4, {
73
46
  children: actions
74
47
  })]
75
- }), bottomBar && /*#__PURE__*/jsxRuntime.jsxs(BottomBarWrapper, {
76
- children: [" ", bottomBar, " "]
77
48
  })]
78
49
  });
79
50
  };
80
51
 
81
- exports.default = PageHeader;
52
+ var PageHeader$1 = PageHeader;
53
+
54
+ var _StyledDiv = _styled__default["default"]("div").withConfig({
55
+ displayName: "PageHeader___StyledDiv",
56
+ componentId: "sc-9i9mq4-0"
57
+ })({
58
+ "display": "flex",
59
+ "flexGrow": "1",
60
+ "flexDirection": "column",
61
+ "paddingTop": "1.5rem",
62
+ "paddingBottom": "1.5rem",
63
+ "minWidth": "0px"
64
+ });
65
+
66
+ var _StyledDiv2 = _styled__default["default"]("div").withConfig({
67
+ displayName: "PageHeader___StyledDiv2",
68
+ componentId: "sc-9i9mq4-1"
69
+ })({
70
+ "marginTop": "0.25rem",
71
+ "display": "flex",
72
+ "justifyContent": "space-between",
73
+ "@media (min-width: 768px)": {
74
+ "alignItems": "center"
75
+ }
76
+ });
77
+
78
+ var _StyledDiv3 = _styled__default["default"]("div").withConfig({
79
+ displayName: "PageHeader___StyledDiv3",
80
+ componentId: "sc-9i9mq4-2"
81
+ })({
82
+ "flex": "1 1 0%",
83
+ "minWidth": "0px"
84
+ });
85
+
86
+ var _StyledH = _styled__default["default"]("h2").withConfig({
87
+ displayName: "PageHeader___StyledH",
88
+ componentId: "sc-9i9mq4-3"
89
+ })(["", ""], function (p) {
90
+ return p.$_css;
91
+ });
92
+
93
+ var _StyledDiv4 = _styled__default["default"]("div").withConfig({
94
+ displayName: "PageHeader___StyledDiv4",
95
+ componentId: "sc-9i9mq4-4"
96
+ })({
97
+ "marginLeft": "1rem"
98
+ });
99
+
100
+ exports["default"] = PageHeader$1;
@@ -2,80 +2,99 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var _styled = require('styled-components');
5
6
  require('react');
6
- var constants = require('@uidu/theme/constants');
7
- var typography = require('@uidu/theme/typography');
8
- var styled = require('styled-components');
9
7
  var jsxRuntime = require('react/jsx-runtime');
10
8
 
11
9
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
12
10
 
13
- var styled__default = /*#__PURE__*/_interopDefault(styled);
14
-
15
- var getTruncationStyles = function getTruncationStyles(_ref) {
16
- var truncate = _ref.truncate;
17
- return truncate ? "\n overflow-x: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n " : null;
18
- };
19
-
20
- var Outer = styled__default['default'].div.withConfig({
21
- displayName: "styled__Outer",
22
- componentId: "sc-1nd0qhd-0"
23
- })(["margin:", "px 0 ", "px 0;"], constants.gridSize() * 3, constants.gridSize() * 2);
24
- var StyledTitle = styled__default['default'].h1.withConfig({
25
- displayName: "styled__StyledTitle",
26
- componentId: "sc-1nd0qhd-1"
27
- })(["", ";", " line-height:", "px;margin-top:0;"], typography.h700(), getTruncationStyles, constants.gridSize() * 4);
28
- var TitleWrapper = styled__default['default'].div.withConfig({
29
- displayName: "styled__TitleWrapper",
30
- componentId: "sc-1nd0qhd-2"
31
- })(["align-items:flex-start;display:flex;", ""], function (_ref2) {
32
- var truncate = _ref2.truncate;
33
- return truncate ? 'flex-wrap: no-wrap;' : 'flex-wrap: wrap;';
34
- });
35
- var TitleContainer = styled__default['default'].div.withConfig({
36
- displayName: "styled__TitleContainer",
37
- componentId: "sc-1nd0qhd-3"
38
- })(["flex:1 0 auto;", " margin-bottom:", "px;max-width:100%;min-width:0;"], function (_ref3) {
39
- var truncate = _ref3.truncate;
40
- return truncate ? 'flex-shrink: 1;' : null;
41
- }, constants.gridSize());
42
- var ActionsWrapper = styled__default['default'].div.withConfig({
43
- displayName: "styled__ActionsWrapper",
44
- componentId: "sc-1nd0qhd-4"
45
- })(["flex:0 0 auto;margin-bottom:", "px;margin-left:auto;max-width:100%;padding-left:", "px;white-space:nowrap;>{text-align:right;}"], constants.gridSize(), constants.gridSize() * 4);
46
- var BottomBarWrapper = styled__default['default'].div.withConfig({
47
- displayName: "styled__BottomBarWrapper",
48
- componentId: "sc-1nd0qhd-5"
49
- })(["margin-top:", "px;"], constants.gridSize() * 2);
11
+ var _styled__default = /*#__PURE__*/_interopDefault(_styled);
50
12
 
51
13
  var PageHeader = function PageHeader(_ref) {
52
14
  var innerRef = _ref.innerRef,
53
15
  breadcrumbs = _ref.breadcrumbs,
54
16
  actions = _ref.actions,
55
- bottomBar = _ref.bottomBar,
56
17
  children = _ref.children,
57
18
  _ref$disableTitleStyl = _ref.disableTitleStyles,
58
19
  disableTitleStyles = _ref$disableTitleStyl === void 0 ? false : _ref$disableTitleStyl,
59
20
  _ref$truncateTitle = _ref.truncateTitle,
60
- truncateTitle = _ref$truncateTitle === void 0 ? false : _ref$truncateTitle;
61
- return /*#__PURE__*/jsxRuntime.jsxs(Outer, {
62
- children: [breadcrumbs, /*#__PURE__*/jsxRuntime.jsxs(TitleWrapper, {
63
- truncate: truncateTitle,
64
- children: [/*#__PURE__*/jsxRuntime.jsx(TitleContainer, {
65
- truncate: truncateTitle,
66
- children: disableTitleStyles ? children : /*#__PURE__*/jsxRuntime.jsx(StyledTitle, {
21
+ truncateTitle = _ref$truncateTitle === void 0 ? false : _ref$truncateTitle,
22
+ className = _ref.className;
23
+ return /*#__PURE__*/jsxRuntime.jsxs(_StyledDiv, {
24
+ className: className,
25
+ children: [breadcrumbs, /*#__PURE__*/jsxRuntime.jsxs(_StyledDiv2, {
26
+ children: [/*#__PURE__*/jsxRuntime.jsx(_StyledDiv3, {
27
+ children: disableTitleStyles ? children : /*#__PURE__*/jsxRuntime.jsx(_StyledH, {
67
28
  ref: innerRef,
68
29
  tabIndex: -1,
69
- truncate: truncateTitle,
30
+ $_css: [{
31
+ "fontSize": "1.5rem",
32
+ "lineHeight": "2rem",
33
+ "fontWeight": "700",
34
+ "@media (min-width: 640px)": {
35
+ "fontSize": "1.875rem",
36
+ "lineHeight": "2.25rem"
37
+ }
38
+ }, truncateTitle && {
39
+ "overflow": "hidden",
40
+ "textOverflow": "ellipsis",
41
+ "whiteSpace": "nowrap"
42
+ }],
70
43
  children: children
71
44
  })
72
- }), /*#__PURE__*/jsxRuntime.jsx(ActionsWrapper, {
45
+ }), /*#__PURE__*/jsxRuntime.jsx(_StyledDiv4, {
73
46
  children: actions
74
47
  })]
75
- }), bottomBar && /*#__PURE__*/jsxRuntime.jsxs(BottomBarWrapper, {
76
- children: [" ", bottomBar, " "]
77
48
  })]
78
49
  });
79
50
  };
80
51
 
81
- exports.default = PageHeader;
52
+ var PageHeader$1 = PageHeader;
53
+
54
+ var _StyledDiv = _styled__default["default"]("div").withConfig({
55
+ displayName: "PageHeader___StyledDiv",
56
+ componentId: "sc-9i9mq4-0"
57
+ })({
58
+ "display": "flex",
59
+ "flexGrow": "1",
60
+ "flexDirection": "column",
61
+ "paddingTop": "1.5rem",
62
+ "paddingBottom": "1.5rem",
63
+ "minWidth": "0px"
64
+ });
65
+
66
+ var _StyledDiv2 = _styled__default["default"]("div").withConfig({
67
+ displayName: "PageHeader___StyledDiv2",
68
+ componentId: "sc-9i9mq4-1"
69
+ })({
70
+ "marginTop": "0.25rem",
71
+ "display": "flex",
72
+ "justifyContent": "space-between",
73
+ "@media (min-width: 768px)": {
74
+ "alignItems": "center"
75
+ }
76
+ });
77
+
78
+ var _StyledDiv3 = _styled__default["default"]("div").withConfig({
79
+ displayName: "PageHeader___StyledDiv3",
80
+ componentId: "sc-9i9mq4-2"
81
+ })({
82
+ "flex": "1 1 0%",
83
+ "minWidth": "0px"
84
+ });
85
+
86
+ var _StyledH = _styled__default["default"]("h2").withConfig({
87
+ displayName: "PageHeader___StyledH",
88
+ componentId: "sc-9i9mq4-3"
89
+ })(["", ""], function (p) {
90
+ return p.$_css;
91
+ });
92
+
93
+ var _StyledDiv4 = _styled__default["default"]("div").withConfig({
94
+ displayName: "PageHeader___StyledDiv4",
95
+ componentId: "sc-9i9mq4-4"
96
+ })({
97
+ "marginLeft": "1rem"
98
+ });
99
+
100
+ exports["default"] = PageHeader$1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uidu/page-header",
3
- "version": "0.2.13",
3
+ "version": "1.0.3",
4
4
  "description": "A React component that represents Header of an application page",
5
5
  "repository": "https://github.com/uidu-org/guidu/tree/main/packages/navigation/page-header",
6
6
  "license": "MIT",
@@ -9,21 +9,21 @@
9
9
  "main": "dist/uidu-page-header.cjs.js",
10
10
  "types": "dist/uidu-page-header.cjs.d.ts",
11
11
  "dependencies": {
12
- "@uidu/shell": "^1.2.19",
13
- "@uidu/theme": "^0.5.14",
14
- "tslib": "^2.3.0"
12
+ "@uidu/shell": "^2.1.9",
13
+ "@uidu/theme": "^0.6.7",
14
+ "tslib": "^2.3.1"
15
15
  },
16
16
  "devDependencies": {
17
- "@uidu/breadcrumbs": "^0.2.13",
18
- "@uidu/button": "^0.4.13",
19
- "@uidu/docs": "^0.3.13",
20
- "@uidu/field-text": "^0.5.4",
21
- "@uidu/form": "^0.4.18",
22
- "@uidu/inline-edit": "0.2.14",
23
- "@uidu/select": "^0.6.18",
17
+ "@uidu/breadcrumbs": "^1.0.7",
18
+ "@uidu/button": "^1.3.7",
19
+ "@uidu/docs": "^0.5.5",
20
+ "@uidu/field-text": "^1.1.9",
21
+ "@uidu/form": "^1.2.10",
22
+ "@uidu/inline-edit": "0.3.9",
23
+ "@uidu/select": "^1.5.8",
24
24
  "react": "^17.0.2",
25
25
  "react-dom": "^17.0.2",
26
- "styled-components": "^5.3.0"
26
+ "styled-components": "^5.3.3"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "react": "^17.0.0",
@@ -1,10 +0,0 @@
1
- interface StyledProps {
2
- truncate?: boolean;
3
- }
4
- export declare const Outer: import("styled-components").StyledComponent<"div", any, {}, never>;
5
- export declare const StyledTitle: import("styled-components").StyledComponent<"h1", any, StyledProps, never>;
6
- export declare const TitleWrapper: import("styled-components").StyledComponent<"div", any, StyledProps, never>;
7
- export declare const TitleContainer: import("styled-components").StyledComponent<"div", any, StyledProps, never>;
8
- export declare const ActionsWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
9
- export declare const BottomBarWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
10
- export {};