@dt-dds/react-app-header 0.1.0-beta.2 → 0.1.0-beta.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 +14 -0
- package/dist/index.d.mts +1 -5
- package/dist/index.d.ts +1 -5
- package/dist/index.js +22 -31
- package/dist/index.mjs +24 -30
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @dt-dds/react-app-header
|
|
2
2
|
|
|
3
|
+
## 0.1.0-beta.3
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- feat(core): share responsive HOC from core package
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- Updated dependencies [223664b]
|
|
13
|
+
- @dt-dds/react-core@1.0.0-beta.53
|
|
14
|
+
- @dt-dds/react-typography@1.0.0-beta.44
|
|
15
|
+
- @dt-dds/react-box@1.0.0-beta.60
|
|
16
|
+
|
|
3
17
|
## 0.1.0-beta.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { Theme } from '@dt-dds/themes';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default, { HTMLAttributes, ReactNode } from 'react';
|
|
4
|
-
|
|
5
|
-
interface ResponsiveProps {
|
|
6
|
-
hide?: string;
|
|
7
|
-
show?: string;
|
|
8
|
-
}
|
|
4
|
+
import { ResponsiveProps } from '@dt-dds/react-core';
|
|
9
5
|
|
|
10
6
|
type NavPosition = 'center' | 'left' | 'right';
|
|
11
7
|
interface NavigationProps extends ResponsiveProps, HTMLAttributes<HTMLElement> {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { Theme } from '@dt-dds/themes';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default, { HTMLAttributes, ReactNode } from 'react';
|
|
4
|
-
|
|
5
|
-
interface ResponsiveProps {
|
|
6
|
-
hide?: string;
|
|
7
|
-
show?: string;
|
|
8
|
-
}
|
|
4
|
+
import { ResponsiveProps } from '@dt-dds/react-core';
|
|
9
5
|
|
|
10
6
|
type NavPosition = 'center' | 'left' | 'right';
|
|
11
7
|
interface NavigationProps extends ResponsiveProps, HTMLAttributes<HTMLElement> {
|
package/dist/index.js
CHANGED
|
@@ -380,7 +380,7 @@ var AppHeader = (_a) => {
|
|
|
380
380
|
|
|
381
381
|
// src/components/Actions/Actions.tsx
|
|
382
382
|
var import_react6 = require("@emotion/react");
|
|
383
|
-
var
|
|
383
|
+
var import_react_core2 = require("@dt-dds/react-core");
|
|
384
384
|
|
|
385
385
|
// src/components/Actions/Actions.styled.tsx
|
|
386
386
|
var import_styled2 = __toESM(require("@emotion/styled"));
|
|
@@ -428,24 +428,8 @@ var ActionsContainer = import_styled2.default.div`
|
|
|
428
428
|
}}
|
|
429
429
|
`;
|
|
430
430
|
|
|
431
|
-
// src/utils/responsive.tsx
|
|
432
|
-
var import_react_core2 = require("@dt-dds/react-core");
|
|
433
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
434
|
-
var withResponsive = (Component) => {
|
|
435
|
-
const ResponsiveComponent = (props) => {
|
|
436
|
-
const hideMatches = (0, import_react_core2.useMedia)(props.hide || "(max-width: 0px)");
|
|
437
|
-
const showMatches = (0, import_react_core2.useMedia)(props.show || "(max-width: 0px)");
|
|
438
|
-
if (props.hide && hideMatches) return null;
|
|
439
|
-
if (props.show && !showMatches) return null;
|
|
440
|
-
const _a = props, { hide, show } = _a, componentProps = __objRest(_a, ["hide", "show"]);
|
|
441
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Component, __spreadValues({}, componentProps));
|
|
442
|
-
};
|
|
443
|
-
ResponsiveComponent.displayName = Component.displayName || Component.name || "Component";
|
|
444
|
-
return ResponsiveComponent;
|
|
445
|
-
};
|
|
446
|
-
|
|
447
431
|
// src/components/Actions/Actions.tsx
|
|
448
|
-
var
|
|
432
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
449
433
|
var ActionsBase = (_a) => {
|
|
450
434
|
var _b = _a, {
|
|
451
435
|
children,
|
|
@@ -455,9 +439,9 @@ var ActionsBase = (_a) => {
|
|
|
455
439
|
"position"
|
|
456
440
|
]);
|
|
457
441
|
const theme2 = (0, import_react6.useTheme)();
|
|
458
|
-
const isMobile = (0,
|
|
442
|
+
const isMobile = (0, import_react_core2.useMedia)(`(max-width: ${theme2.breakpoints.mq3}px)`);
|
|
459
443
|
const { state } = useAppHeaderContext();
|
|
460
|
-
return /* @__PURE__ */ (0,
|
|
444
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
461
445
|
ActionsContainer,
|
|
462
446
|
__spreadProps(__spreadValues({
|
|
463
447
|
isMobile,
|
|
@@ -469,9 +453,10 @@ var ActionsBase = (_a) => {
|
|
|
469
453
|
);
|
|
470
454
|
};
|
|
471
455
|
ActionsBase.displayName = "AppHeader.Actions";
|
|
472
|
-
var Actions = withResponsive(ActionsBase);
|
|
456
|
+
var Actions = (0, import_react_core2.withResponsive)(ActionsBase);
|
|
473
457
|
|
|
474
458
|
// src/components/AppName/AppName.tsx
|
|
459
|
+
var import_react_core3 = require("@dt-dds/react-core");
|
|
475
460
|
var import_react_typography = require("@dt-dds/react-typography");
|
|
476
461
|
|
|
477
462
|
// src/components/AppName/AppName.styled.tsx
|
|
@@ -505,7 +490,7 @@ var AppNameContainer = import_styled3.default.div`
|
|
|
505
490
|
`;
|
|
506
491
|
|
|
507
492
|
// src/components/AppName/AppName.tsx
|
|
508
|
-
var
|
|
493
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
509
494
|
var AppNameBase = (_a) => {
|
|
510
495
|
var _b = _a, {
|
|
511
496
|
name,
|
|
@@ -522,9 +507,9 @@ var AppNameBase = (_a) => {
|
|
|
522
507
|
return null;
|
|
523
508
|
}
|
|
524
509
|
if (children) {
|
|
525
|
-
return /* @__PURE__ */ (0,
|
|
510
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AppNameContainer, __spreadProps(__spreadValues({ isMobile, state }, rest), { children: content }));
|
|
526
511
|
}
|
|
527
|
-
return /* @__PURE__ */ (0,
|
|
512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AppNameContainer, __spreadProps(__spreadValues({ isMobile, state }, rest), { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
528
513
|
import_react_typography.Typography,
|
|
529
514
|
{
|
|
530
515
|
color: "primary.default",
|
|
@@ -535,7 +520,10 @@ var AppNameBase = (_a) => {
|
|
|
535
520
|
) }));
|
|
536
521
|
};
|
|
537
522
|
AppNameBase.displayName = "AppHeader.AppName";
|
|
538
|
-
var AppName = withResponsive(AppNameBase);
|
|
523
|
+
var AppName = (0, import_react_core3.withResponsive)(AppNameBase);
|
|
524
|
+
|
|
525
|
+
// src/components/Logo/Logo.tsx
|
|
526
|
+
var import_react_core4 = require("@dt-dds/react-core");
|
|
539
527
|
|
|
540
528
|
// src/components/Logo/Logo.styled.tsx
|
|
541
529
|
var import_styled4 = __toESM(require("@emotion/styled"));
|
|
@@ -573,7 +561,7 @@ var LogoContainer = import_styled4.default.div`
|
|
|
573
561
|
`;
|
|
574
562
|
|
|
575
563
|
// src/components/Logo/Logo.tsx
|
|
576
|
-
var
|
|
564
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
577
565
|
var LogoBase = (_a) => {
|
|
578
566
|
var _b = _a, {
|
|
579
567
|
children
|
|
@@ -582,10 +570,13 @@ var LogoBase = (_a) => {
|
|
|
582
570
|
]);
|
|
583
571
|
const { shouldCenterLogo: shouldCenterLogo2, isMobile } = useAppHeaderContext();
|
|
584
572
|
const shouldCenter = shouldCenterLogo2 && !isMobile;
|
|
585
|
-
return /* @__PURE__ */ (0,
|
|
573
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(LogoContainer, __spreadProps(__spreadValues({ shouldCenterLogo: shouldCenter }, rest), { children }));
|
|
586
574
|
};
|
|
587
575
|
LogoBase.displayName = "AppHeader.Logo";
|
|
588
|
-
var Logo = withResponsive(LogoBase);
|
|
576
|
+
var Logo = (0, import_react_core4.withResponsive)(LogoBase);
|
|
577
|
+
|
|
578
|
+
// src/components/Navigation/Navigation.tsx
|
|
579
|
+
var import_react_core5 = require("@dt-dds/react-core");
|
|
589
580
|
|
|
590
581
|
// src/components/Navigation/Navigation.styled.ts
|
|
591
582
|
var import_styled5 = __toESM(require("@emotion/styled"));
|
|
@@ -671,7 +662,7 @@ var NavigationStyled = import_styled5.default.nav`
|
|
|
671
662
|
`;
|
|
672
663
|
|
|
673
664
|
// src/components/Navigation/Navigation.tsx
|
|
674
|
-
var
|
|
665
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
675
666
|
var NavigationBase = (_a) => {
|
|
676
667
|
var _b = _a, {
|
|
677
668
|
children
|
|
@@ -679,10 +670,10 @@ var NavigationBase = (_a) => {
|
|
|
679
670
|
"children"
|
|
680
671
|
]);
|
|
681
672
|
const { state } = useAppHeaderContext();
|
|
682
|
-
return /* @__PURE__ */ (0,
|
|
673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(NavigationStyled, __spreadProps(__spreadValues({ state }, rest), { children }));
|
|
683
674
|
};
|
|
684
675
|
NavigationBase.displayName = "AppHeader.Navigation";
|
|
685
|
-
var Navigation = withResponsive(NavigationBase);
|
|
676
|
+
var Navigation = (0, import_react_core5.withResponsive)(NavigationBase);
|
|
686
677
|
|
|
687
678
|
// src/index.ts
|
|
688
679
|
var AppHeader2 = Object.assign(
|
package/dist/index.mjs
CHANGED
|
@@ -343,7 +343,10 @@ var AppHeader = (_a) => {
|
|
|
343
343
|
|
|
344
344
|
// src/components/Actions/Actions.tsx
|
|
345
345
|
import { useTheme as useTheme2 } from "@emotion/react";
|
|
346
|
-
import {
|
|
346
|
+
import {
|
|
347
|
+
useMedia as useMedia2,
|
|
348
|
+
withResponsive
|
|
349
|
+
} from "@dt-dds/react-core";
|
|
347
350
|
|
|
348
351
|
// src/components/Actions/Actions.styled.tsx
|
|
349
352
|
import styled2 from "@emotion/styled";
|
|
@@ -391,24 +394,8 @@ var ActionsContainer = styled2.div`
|
|
|
391
394
|
}}
|
|
392
395
|
`;
|
|
393
396
|
|
|
394
|
-
// src/utils/responsive.tsx
|
|
395
|
-
import { useMedia as useMedia2 } from "@dt-dds/react-core";
|
|
396
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
397
|
-
var withResponsive = (Component) => {
|
|
398
|
-
const ResponsiveComponent = (props) => {
|
|
399
|
-
const hideMatches = useMedia2(props.hide || "(max-width: 0px)");
|
|
400
|
-
const showMatches = useMedia2(props.show || "(max-width: 0px)");
|
|
401
|
-
if (props.hide && hideMatches) return null;
|
|
402
|
-
if (props.show && !showMatches) return null;
|
|
403
|
-
const _a = props, { hide, show } = _a, componentProps = __objRest(_a, ["hide", "show"]);
|
|
404
|
-
return /* @__PURE__ */ jsx3(Component, __spreadValues({}, componentProps));
|
|
405
|
-
};
|
|
406
|
-
ResponsiveComponent.displayName = Component.displayName || Component.name || "Component";
|
|
407
|
-
return ResponsiveComponent;
|
|
408
|
-
};
|
|
409
|
-
|
|
410
397
|
// src/components/Actions/Actions.tsx
|
|
411
|
-
import { jsx as
|
|
398
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
412
399
|
var ActionsBase = (_a) => {
|
|
413
400
|
var _b = _a, {
|
|
414
401
|
children,
|
|
@@ -418,9 +405,9 @@ var ActionsBase = (_a) => {
|
|
|
418
405
|
"position"
|
|
419
406
|
]);
|
|
420
407
|
const theme2 = useTheme2();
|
|
421
|
-
const isMobile =
|
|
408
|
+
const isMobile = useMedia2(`(max-width: ${theme2.breakpoints.mq3}px)`);
|
|
422
409
|
const { state } = useAppHeaderContext();
|
|
423
|
-
return /* @__PURE__ */
|
|
410
|
+
return /* @__PURE__ */ jsx3(
|
|
424
411
|
ActionsContainer,
|
|
425
412
|
__spreadProps(__spreadValues({
|
|
426
413
|
isMobile,
|
|
@@ -435,6 +422,7 @@ ActionsBase.displayName = "AppHeader.Actions";
|
|
|
435
422
|
var Actions = withResponsive(ActionsBase);
|
|
436
423
|
|
|
437
424
|
// src/components/AppName/AppName.tsx
|
|
425
|
+
import { withResponsive as withResponsive2 } from "@dt-dds/react-core";
|
|
438
426
|
import { Typography } from "@dt-dds/react-typography";
|
|
439
427
|
|
|
440
428
|
// src/components/AppName/AppName.styled.tsx
|
|
@@ -468,7 +456,7 @@ var AppNameContainer = styled3.div`
|
|
|
468
456
|
`;
|
|
469
457
|
|
|
470
458
|
// src/components/AppName/AppName.tsx
|
|
471
|
-
import { jsx as
|
|
459
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
472
460
|
var AppNameBase = (_a) => {
|
|
473
461
|
var _b = _a, {
|
|
474
462
|
name,
|
|
@@ -485,9 +473,9 @@ var AppNameBase = (_a) => {
|
|
|
485
473
|
return null;
|
|
486
474
|
}
|
|
487
475
|
if (children) {
|
|
488
|
-
return /* @__PURE__ */
|
|
476
|
+
return /* @__PURE__ */ jsx4(AppNameContainer, __spreadProps(__spreadValues({ isMobile, state }, rest), { children: content }));
|
|
489
477
|
}
|
|
490
|
-
return /* @__PURE__ */
|
|
478
|
+
return /* @__PURE__ */ jsx4(AppNameContainer, __spreadProps(__spreadValues({ isMobile, state }, rest), { children: /* @__PURE__ */ jsx4(
|
|
491
479
|
Typography,
|
|
492
480
|
{
|
|
493
481
|
color: "primary.default",
|
|
@@ -498,7 +486,10 @@ var AppNameBase = (_a) => {
|
|
|
498
486
|
) }));
|
|
499
487
|
};
|
|
500
488
|
AppNameBase.displayName = "AppHeader.AppName";
|
|
501
|
-
var AppName =
|
|
489
|
+
var AppName = withResponsive2(AppNameBase);
|
|
490
|
+
|
|
491
|
+
// src/components/Logo/Logo.tsx
|
|
492
|
+
import { withResponsive as withResponsive3 } from "@dt-dds/react-core";
|
|
502
493
|
|
|
503
494
|
// src/components/Logo/Logo.styled.tsx
|
|
504
495
|
import styled4 from "@emotion/styled";
|
|
@@ -536,7 +527,7 @@ var LogoContainer = styled4.div`
|
|
|
536
527
|
`;
|
|
537
528
|
|
|
538
529
|
// src/components/Logo/Logo.tsx
|
|
539
|
-
import { jsx as
|
|
530
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
540
531
|
var LogoBase = (_a) => {
|
|
541
532
|
var _b = _a, {
|
|
542
533
|
children
|
|
@@ -545,10 +536,13 @@ var LogoBase = (_a) => {
|
|
|
545
536
|
]);
|
|
546
537
|
const { shouldCenterLogo: shouldCenterLogo2, isMobile } = useAppHeaderContext();
|
|
547
538
|
const shouldCenter = shouldCenterLogo2 && !isMobile;
|
|
548
|
-
return /* @__PURE__ */
|
|
539
|
+
return /* @__PURE__ */ jsx5(LogoContainer, __spreadProps(__spreadValues({ shouldCenterLogo: shouldCenter }, rest), { children }));
|
|
549
540
|
};
|
|
550
541
|
LogoBase.displayName = "AppHeader.Logo";
|
|
551
|
-
var Logo =
|
|
542
|
+
var Logo = withResponsive3(LogoBase);
|
|
543
|
+
|
|
544
|
+
// src/components/Navigation/Navigation.tsx
|
|
545
|
+
import { withResponsive as withResponsive4 } from "@dt-dds/react-core";
|
|
552
546
|
|
|
553
547
|
// src/components/Navigation/Navigation.styled.ts
|
|
554
548
|
import styled5 from "@emotion/styled";
|
|
@@ -634,7 +628,7 @@ var NavigationStyled = styled5.nav`
|
|
|
634
628
|
`;
|
|
635
629
|
|
|
636
630
|
// src/components/Navigation/Navigation.tsx
|
|
637
|
-
import { jsx as
|
|
631
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
638
632
|
var NavigationBase = (_a) => {
|
|
639
633
|
var _b = _a, {
|
|
640
634
|
children
|
|
@@ -642,10 +636,10 @@ var NavigationBase = (_a) => {
|
|
|
642
636
|
"children"
|
|
643
637
|
]);
|
|
644
638
|
const { state } = useAppHeaderContext();
|
|
645
|
-
return /* @__PURE__ */
|
|
639
|
+
return /* @__PURE__ */ jsx6(NavigationStyled, __spreadProps(__spreadValues({ state }, rest), { children }));
|
|
646
640
|
};
|
|
647
641
|
NavigationBase.displayName = "AppHeader.Navigation";
|
|
648
|
-
var Navigation =
|
|
642
|
+
var Navigation = withResponsive4(NavigationBase);
|
|
649
643
|
|
|
650
644
|
// src/index.ts
|
|
651
645
|
var AppHeader2 = Object.assign(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dt-dds/react-app-header",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/index.js"
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"test:update:snapshot": "jest -u"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@dt-dds/react-core": "1.0.0-beta.
|
|
24
|
-
"@dt-dds/react-box": "1.0.0-beta.
|
|
25
|
-
"@dt-dds/react-typography": "1.0.0-beta.
|
|
23
|
+
"@dt-dds/react-core": "1.0.0-beta.53",
|
|
24
|
+
"@dt-dds/react-box": "1.0.0-beta.60",
|
|
25
|
+
"@dt-dds/react-typography": "1.0.0-beta.44",
|
|
26
26
|
"@dt-dds/themes": "1.0.0-beta.10"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"@babel/preset-env": "^7.22.9",
|
|
31
31
|
"@babel/preset-react": "^7.22.5",
|
|
32
32
|
"@babel/preset-typescript": "^7.23.3",
|
|
33
|
-
"@dt-dds/react-avatar": "1.0.0-beta.
|
|
34
|
-
"@dt-dds/react-icon": "1.0.0-beta.
|
|
35
|
-
"@dt-dds/react-icon-button": "1.0.0-beta.
|
|
33
|
+
"@dt-dds/react-avatar": "1.0.0-beta.65",
|
|
34
|
+
"@dt-dds/react-icon": "1.0.0-beta.56",
|
|
35
|
+
"@dt-dds/react-icon-button": "1.0.0-beta.22",
|
|
36
36
|
"@emotion/babel-plugin": "^11.11.0",
|
|
37
37
|
"@emotion/css": "^11.7.1",
|
|
38
38
|
"@emotion/jest": "^11.10.0",
|