react-miui 0.23.7-beta.1 → 0.23.7
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 +5 -3
- package/dist/components/layout/header/StickyHeader.d.ts +6 -6
- package/dist/components/layout/header/StickyHeader.d.ts.map +1 -1
- package/dist/components/layout/header/StickyHeader.js +35 -14
- package/dist/components/layout/header/StickyHeader.js.map +1 -1
- package/dist/components/layout/header/StickyHeader.stories.d.ts +2 -1
- package/dist/components/layout/header/StickyHeader.stories.d.ts.map +1 -1
- package/dist/components/layout/header/StickyHeader.stories.js +62 -4
- package/dist/components/layout/header/StickyHeader.stories.js.map +1 -1
- package/dist/components/layout/header/StickyHeader.styled.d.ts +3 -1
- package/dist/components/layout/header/StickyHeader.styled.d.ts.map +1 -1
- package/dist/components/layout/header/StickyHeader.styled.js +17 -7
- package/dist/components/layout/header/StickyHeader.styled.js.map +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/Drawer.html +15 -16
- package/docs/classes/Pop.html +15 -16
- package/docs/classes/ToasterProvider.html +11 -12
- package/docs/enums/ICON.html +15 -16
- package/docs/functions/Action.html +7 -7
- package/docs/functions/Button.html +7 -7
- package/docs/functions/Card.html +7 -7
- package/docs/functions/Checkbox.html +7 -7
- package/docs/functions/Choice.html +8 -8
- package/docs/functions/CoveringLoader.html +7 -7
- package/docs/functions/DirectionPad.html +7 -7
- package/docs/functions/EqualActions.html +7 -7
- package/docs/functions/FullLoader.html +7 -7
- package/docs/functions/HandleEsc.html +7 -7
- package/docs/functions/Header.html +7 -7
- package/docs/functions/HeaderIconAction.html +7 -7
- package/docs/functions/Icon-1.html +7 -7
- package/docs/functions/If.html +7 -7
- package/docs/functions/Input.html +8 -8
- package/docs/functions/KeyValue.html +7 -7
- package/docs/functions/Label.html +7 -7
- package/docs/functions/List-1.html +7 -7
- package/docs/functions/Loader.html +7 -7
- package/docs/functions/Loading.html +7 -7
- package/docs/functions/Message.html +7 -7
- package/docs/functions/Modal-1.html +7 -7
- package/docs/functions/ModalButtons.html +7 -7
- package/docs/functions/PopLoader.html +7 -7
- package/docs/functions/PopOption.html +7 -7
- package/docs/functions/SearchContainer.html +7 -7
- package/docs/functions/Section.html +7 -7
- package/docs/functions/Select.html +7 -7
- package/docs/functions/Selector.html +8 -8
- package/docs/functions/Spacer.html +7 -7
- package/docs/functions/Stats.html +7 -7
- package/docs/functions/{StickyHeader-1.html → StickyHeader.html} +14 -14
- package/docs/functions/Table.html +7 -7
- package/docs/functions/TextArea.html +7 -7
- package/docs/functions/Toggle.html +7 -7
- package/docs/functions/getCssText.html +7 -7
- package/docs/functions/styled.html +7 -7
- package/docs/functions/useToaster.html +8 -8
- package/docs/index.html +7 -7
- package/docs/interfaces/ActionProps.html +14 -15
- package/docs/interfaces/ChoiceProps.html +12 -13
- package/docs/interfaces/IconProps.html +8 -9
- package/docs/interfaces/InputCustomProps.html +11 -12
- package/docs/interfaces/StickyHeaderProps.html +99 -0
- package/docs/modules/List.html +8 -9
- package/docs/modules/Modal.html +7 -8
- package/docs/modules.html +9 -9
- package/docs/pages/tutorials/Test.html +7 -7
- package/docs/types/InputProps.html +8 -8
- package/docs/types/ThemeCSS.html +8 -8
- package/docs/variables/List.Header.html +6 -7
- package/docs/variables/List.Item.html +6 -7
- package/docs/variables/Modal.RemovePadding.html +6 -7
- package/docs/variables/cssReset.html +8 -8
- package/docs/variables/miuiScrollbars.html +8 -8
- package/esm/components/layout/header/StickyHeader.d.ts +6 -6
- package/esm/components/layout/header/StickyHeader.d.ts.map +1 -1
- package/esm/components/layout/header/StickyHeader.js +12 -11
- package/esm/components/layout/header/StickyHeader.js.map +1 -1
- package/esm/components/layout/header/StickyHeader.stories.d.ts +2 -1
- package/esm/components/layout/header/StickyHeader.stories.d.ts.map +1 -1
- package/esm/components/layout/header/StickyHeader.stories.js +39 -2
- package/esm/components/layout/header/StickyHeader.stories.js.map +1 -1
- package/esm/components/layout/header/StickyHeader.styled.d.ts +3 -1
- package/esm/components/layout/header/StickyHeader.styled.d.ts.map +1 -1
- package/esm/components/layout/header/StickyHeader.styled.js +17 -7
- package/esm/components/layout/header/StickyHeader.styled.js.map +1 -1
- package/package.json +3 -2
- package/pnpm-lock.yaml +163 -49
- package/src/components/layout/header/StickyHeader.stories.tsx +47 -1
- package/src/components/layout/header/StickyHeader.styled.ts +18 -7
- package/src/components/layout/header/StickyHeader.tsx +33 -22
- package/docs/functions/StickyHeader.Content.html +0 -61
- package/docs/modules/StickyHeader.html +0 -58
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>miuiScrollbars | react-miui - v0.23.7
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>miuiScrollbars | react-miui - v0.23.7</title><meta name="description" content="Documentation for react-miui - v0.23.7"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script><link rel="stylesheet" href="../assets/pages.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
|
|
2
2
|
<div class="tsd-toolbar-contents container">
|
|
3
3
|
<div class="table-cell" id="tsd-search" data-base="..">
|
|
4
4
|
<div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
|
|
@@ -6,18 +6,18 @@
|
|
|
6
6
|
<div id="tsd-toolbar-links"></div></div>
|
|
7
7
|
<ul class="results">
|
|
8
8
|
<li class="state loading">Preparing search index...</li>
|
|
9
|
-
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">react-miui - v0.23.7
|
|
9
|
+
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">react-miui - v0.23.7</a></div>
|
|
10
10
|
<div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
|
|
11
11
|
<div class="container container-main">
|
|
12
12
|
<div class="col-8 col-content">
|
|
13
13
|
<div class="tsd-page-title">
|
|
14
14
|
<ul class="tsd-breadcrumb">
|
|
15
|
-
<li><a href="../modules.html">react-miui - v0.23.7
|
|
15
|
+
<li><a href="../modules.html">react-miui - v0.23.7</a></li>
|
|
16
16
|
<li><a href="miuiScrollbars.html">miuiScrollbars</a></li></ul>
|
|
17
17
|
<h1>Variable miuiScrollbars<code class="tsd-tag ts-flagConst">Const</code> </h1></div>
|
|
18
18
|
<div class="tsd-signature">miui<wbr/>Scrollbars<span class="tsd-signature-symbol">:</span> <a href="../types/ThemeCSS.html" class="tsd-signature-type" data-tsd-kind="Type alias">ThemeCSS</a><span class="tsd-signature-symbol"> = ...</span></div><aside class="tsd-sources">
|
|
19
19
|
<ul>
|
|
20
|
-
<li>Defined in <a href="https://github.com/dzek69/react-miui/blob/
|
|
20
|
+
<li>Defined in <a href="https://github.com/dzek69/react-miui/blob/93fdb3b/src/scrollbars.css.ts#L18">src/scrollbars.css.ts:18</a></li></ul></aside></div>
|
|
21
21
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
22
22
|
<div class="tsd-navigation settings">
|
|
23
23
|
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|
|
@@ -37,12 +37,11 @@
|
|
|
37
37
|
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg> Modules</h3></summary>
|
|
38
38
|
<div class="tsd-accordion-details">
|
|
39
39
|
<ul>
|
|
40
|
-
<li><a href="../modules.html">react-<wbr/>miui -<wbr/> v0.23.7
|
|
40
|
+
<li><a href="../modules.html">react-<wbr/>miui -<wbr/> v0.23.7</a>
|
|
41
41
|
<ul>
|
|
42
42
|
<li class="pages-entry pages-entry-page pages-entry-depth-1"><a href="../pages/tutorials/Test.html">Test</a></li>
|
|
43
43
|
<li class="tsd-kind-namespace"><a href="../modules/List.html">List</a></li>
|
|
44
|
-
<li class="tsd-kind-namespace"><a href="../modules/Modal.html">Modal</a></li>
|
|
45
|
-
<li class="tsd-kind-namespace"><a href="../modules/StickyHeader.html">Sticky<wbr/>Header</a></li></ul></li></ul></div></details></nav>
|
|
44
|
+
<li class="tsd-kind-namespace"><a href="../modules/Modal.html">Modal</a></li></ul></li></ul></div></details></nav>
|
|
46
45
|
<nav class="tsd-navigation secondary menu-sticky">
|
|
47
46
|
<ul>
|
|
48
47
|
<li class="tsd-kind-enum"><a href="../enums/ICON.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-enum)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-8-path"></rect><path d="M9.45 16V7.24H14.49V8.224H10.518V10.936H14.07V11.908H10.518V15.016H14.49V16H9.45Z" fill="var(--color-text)" id="icon-8-text"></path></svg>ICON</a></li>
|
|
@@ -53,6 +52,7 @@
|
|
|
53
52
|
<li class="tsd-kind-interface"><a href="../interfaces/ChoiceProps.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>Choice<wbr/>Props</a></li>
|
|
54
53
|
<li class="tsd-kind-interface"><a href="../interfaces/IconProps.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>Icon<wbr/>Props</a></li>
|
|
55
54
|
<li class="tsd-kind-interface"><a href="../interfaces/InputCustomProps.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>Input<wbr/>Custom<wbr/>Props</a></li>
|
|
55
|
+
<li class="tsd-kind-interface"><a href="../interfaces/StickyHeaderProps.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>Sticky<wbr/>Header<wbr/>Props</a></li>
|
|
56
56
|
<li class="tsd-kind-type-alias"><a href="../types/InputProps.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-4194304-path"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)" id="icon-4194304-text"></path></svg>Input<wbr/>Props</a></li>
|
|
57
57
|
<li class="tsd-kind-type-alias"><a href="../types/ThemeCSS.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>ThemeCSS</a></li>
|
|
58
58
|
<li class="tsd-kind-variable"><a href="cssReset.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-variable)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-32-path"></rect><path d="M11.106 16L8.85 7.24H9.966L11.454 13.192C11.558 13.608 11.646 13.996 11.718 14.356C11.79 14.708 11.842 14.976 11.874 15.16C11.906 14.976 11.954 14.708 12.018 14.356C12.09 13.996 12.178 13.608 12.282 13.192L13.758 7.24H14.85L12.582 16H11.106Z" fill="var(--color-text)" id="icon-32-text"></path></svg>css<wbr/>Reset</a></li>
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
<li class="tsd-kind-function"><a href="../functions/Selector.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>Selector</a></li>
|
|
89
89
|
<li class="tsd-kind-function"><a href="../functions/Spacer.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>Spacer</a></li>
|
|
90
90
|
<li class="tsd-kind-function"><a href="../functions/Stats.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>Stats</a></li>
|
|
91
|
-
<li class="tsd-kind-function"><a href="../functions/StickyHeader
|
|
91
|
+
<li class="tsd-kind-function"><a href="../functions/StickyHeader.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>Sticky<wbr/>Header</a></li>
|
|
92
92
|
<li class="tsd-kind-function"><a href="../functions/Table.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>Table</a></li>
|
|
93
93
|
<li class="tsd-kind-function"><a href="../functions/TextArea.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>Text<wbr/>Area</a></li>
|
|
94
94
|
<li class="tsd-kind-function"><a href="../functions/Toggle.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>Toggle</a></li>
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { Content } from "./StickyHeader.styled";
|
|
2
3
|
interface ContentComponent {
|
|
3
|
-
Content:
|
|
4
|
-
}
|
|
5
|
-
interface ContentProps {
|
|
6
|
-
className?: string;
|
|
7
|
-
children: React.ReactNode;
|
|
4
|
+
Content: typeof Content;
|
|
8
5
|
}
|
|
9
6
|
interface Props {
|
|
10
7
|
position?: "top" | "left" | "right" | "bottom";
|
|
11
8
|
className?: string;
|
|
9
|
+
__dangerouslyDisableChildrenGuard?: boolean;
|
|
12
10
|
children: React.ReactNode;
|
|
13
11
|
}
|
|
14
|
-
|
|
12
|
+
type StickyHeaderType = React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>> & ContentComponent;
|
|
13
|
+
declare const StickyHeader: StickyHeaderType;
|
|
15
14
|
export { StickyHeader };
|
|
15
|
+
export type { Props as StickyHeaderProps };
|
|
16
16
|
//# sourceMappingURL=StickyHeader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StickyHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/header/StickyHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"StickyHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/header/StickyHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,OAAO,EAAsB,MAAM,uBAAuB,CAAC;AAIpE,UAAU,gBAAgB;IACtB,OAAO,EAAE,OAAO,OAAO,CAAC;CAC3B;AAED,UAAU,KAAK;IAIX,QAAQ,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IAI/C,SAAS,CAAC,EAAE,MAAM,CAAC;IAKnB,iCAAiC,CAAC,EAAE,OAAO,CAAC;IAC5C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAsCD,KAAK,gBAAgB,GAAG,KAAK,CAAC,yBAAyB,CAAC,KAAK,GAAG,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,GAAG,gBAAgB,CAAC;AAExH,QAAA,MAAM,YAAY,kBAAsC,CAAC;AAGzD,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,YAAY,EAAE,KAAK,IAAI,iBAAiB,EAAE,CAAC"}
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
2
|
import { Header } from "./Header.js";
|
|
3
3
|
import { Content, StyledStickyHeader } from "./StickyHeader.styled.js";
|
|
4
4
|
const err = new TypeError("StickyHeader needs two children - Header and StickyHeader.Content");
|
|
5
|
-
const
|
|
6
|
-
const { children: _children, position = "top", ...rest } = props;
|
|
5
|
+
const StickyHeaderRaw = forwardRef((props, ref) => {
|
|
6
|
+
const { children: _children, position = "top", __dangerouslyDisableChildrenGuard, ...rest } = props;
|
|
7
|
+
if (__dangerouslyDisableChildrenGuard) {
|
|
8
|
+
return (React.createElement(StyledStickyHeader, { ref: ref, ...rest, position: position }, _children));
|
|
9
|
+
}
|
|
7
10
|
const children = React.Children.toArray(_children);
|
|
8
11
|
if (children.length !== 2) {
|
|
9
12
|
throw err;
|
|
10
13
|
}
|
|
11
|
-
let header = children.find(c => typeof c === "object" && "type" in c && c.type === Header), content = children.find(c => typeof c === "object" && "type" in c && c.type ===
|
|
14
|
+
let header = children.find(c => typeof c === "object" && "type" in c && c.type === Header), content = children.find(c => typeof c === "object" && "type" in c && c.type === Content);
|
|
12
15
|
if (!header || !content) {
|
|
13
16
|
throw err;
|
|
14
17
|
}
|
|
15
18
|
header = header;
|
|
16
19
|
content = content;
|
|
17
|
-
|
|
18
|
-
return (React.createElement(StyledStickyHeader, { ...rest, position: position },
|
|
20
|
+
return (React.createElement(StyledStickyHeader, { ref: ref, ...rest, position: position },
|
|
19
21
|
React.cloneElement(header, { position }),
|
|
20
|
-
React.
|
|
21
|
-
};
|
|
22
|
-
StickyHeader
|
|
23
|
-
|
|
24
|
-
};
|
|
22
|
+
React.cloneElement(content, { position })));
|
|
23
|
+
});
|
|
24
|
+
const StickyHeader = StickyHeaderRaw;
|
|
25
|
+
StickyHeader.Content = Content;
|
|
25
26
|
export { StickyHeader };
|
|
26
27
|
//# sourceMappingURL=StickyHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StickyHeader.js","sourceRoot":"","sources":["../../../../src/components/layout/header/StickyHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"StickyHeader.js","sourceRoot":"","sources":["../../../../src/components/layout/header/StickyHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEpE,MA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ACxC,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,CAAC,CACzB,CACxB,CAAC;AACN,CAAC,CAAC,CAAC;AAIH,MAAM,YAAY,GAAG,eAAmC,CAAC;AACzD,YAAY,CAAC,OAAO,GAAG,OAAO,CAAC;AAE/B,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { StickyHeader } from "./StickyHeader";
|
|
|
3
3
|
declare const meta: Meta;
|
|
4
4
|
type Story = StoryObj<typeof StickyHeader>;
|
|
5
5
|
declare const Primary: Story;
|
|
6
|
-
|
|
6
|
+
declare const RefsDemo: Story;
|
|
7
|
+
export { Primary, RefsDemo, };
|
|
7
8
|
export default meta;
|
|
8
9
|
//# sourceMappingURL=StickyHeader.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StickyHeader.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/header/StickyHeader.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StickyHeader.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/header/StickyHeader.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,QAAA,MAAM,IAAI,EAAE,IAmBX,CAAC;AAEF,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,YAAY,CAAC,CAAC;AAE3C,QAAA,MAAM,OAAO,EAAE,KAmBd,CAAC;AAEF,QAAA,MAAM,QAAQ,EAAE,KA0Bf,CAAC;AAEF,OAAO,EACH,OAAO,EACP,QAAQ,GACX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1,10 +1,26 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { useEffect } from "react";
|
|
2
|
+
import { useForceUpdate } from "@ezez/hooks";
|
|
2
3
|
import { StickyHeader } from "./StickyHeader.js";
|
|
3
4
|
import { Header } from "./Header.js";
|
|
4
5
|
const meta = {
|
|
5
6
|
title: "Components/Layout/Header/StickyHeader",
|
|
6
7
|
component: StickyHeader,
|
|
7
8
|
tags: ["autodocs", "layout"],
|
|
9
|
+
argTypes: {
|
|
10
|
+
children: {
|
|
11
|
+
control: {
|
|
12
|
+
disable: true,
|
|
13
|
+
},
|
|
14
|
+
description: "Usual children",
|
|
15
|
+
},
|
|
16
|
+
position: {
|
|
17
|
+
control: {
|
|
18
|
+
type: "select",
|
|
19
|
+
},
|
|
20
|
+
description: "Position of the header",
|
|
21
|
+
options: ["top", "left", "right", "bottom"],
|
|
22
|
+
},
|
|
23
|
+
},
|
|
8
24
|
};
|
|
9
25
|
const Primary = {
|
|
10
26
|
render: (args) => {
|
|
@@ -18,6 +34,27 @@ const Primary = {
|
|
|
18
34
|
React.createElement(StickyHeader.Content, null, longContent))));
|
|
19
35
|
},
|
|
20
36
|
};
|
|
21
|
-
|
|
37
|
+
const RefsDemo = {
|
|
38
|
+
render: (args) => {
|
|
39
|
+
const ref = React.useRef(null);
|
|
40
|
+
const refContent = React.useRef(null);
|
|
41
|
+
const handleForceUpdate = useForceUpdate();
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
handleForceUpdate();
|
|
44
|
+
}, []);
|
|
45
|
+
console.info("RefsDemo", {
|
|
46
|
+
ref: ref.current, refContent: refContent.current,
|
|
47
|
+
});
|
|
48
|
+
return (React.createElement(React.Fragment, null,
|
|
49
|
+
React.createElement(StickyHeader, { ...args, ref: ref },
|
|
50
|
+
React.createElement(Header, null, "x"),
|
|
51
|
+
React.createElement(StickyHeader.Content, { ref: refContent },
|
|
52
|
+
`Ref: ${ref.current ? `set ${ref.current.nodeName}` : "not set"}`,
|
|
53
|
+
React.createElement("br", null),
|
|
54
|
+
`RefContent: ${refContent.current ? `set ${refContent.current.nodeName}` : "not set"}`,
|
|
55
|
+
React.createElement("br", null)))));
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
export { Primary, RefsDemo, };
|
|
22
59
|
export default meta;
|
|
23
60
|
//# sourceMappingURL=StickyHeader.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StickyHeader.stories.js","sourceRoot":"","sources":["../../../../src/components/layout/header/StickyHeader.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"StickyHeader.stories.js","sourceRoot":"","sources":["../../../../src/components/layout/header/StickyHeader.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAI7C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,IAAI,GAAS;IACf,KAAK,EAAE,uCAAuC;IAC9C,SAAS,EAAE,YAAY;IACvB,IAAI,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC;IAC5B,QAAQ,EAAE;QACN,QAAQ,EAAE;YACN,OAAO,EAAE;gBACL,OAAO,EAAE,IAAI;aAChB;YACD,WAAW,EAAE,gBAAgB;SAChC;QACD,QAAQ,EAAE;YACN,OAAO,EAAE;gBACL,IAAI,EAAE,QAAQ;aACjB;YACD,WAAW,EAAE,wBAAwB;YACrC,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC;SAC9C;KACJ;CACJ,CAAC;AAIF,MAAM,OAAO,GAAU;IACnB,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;QAEb,MAAM,WAAW,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,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AQ,GACX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -80,7 +80,9 @@ declare const StyledStickyHeader: import("@stitches/react/types/styled-component
|
|
|
80
80
|
height: string | number;
|
|
81
81
|
};
|
|
82
82
|
}>>;
|
|
83
|
-
declare const Content: import("@stitches/react/types/styled-component").StyledComponent<"div", {
|
|
83
|
+
declare const Content: import("@stitches/react/types/styled-component").StyledComponent<"div", {
|
|
84
|
+
position?: "left" | "bottom" | "right" | "top";
|
|
85
|
+
}, {}, import("@stitches/react/types/css-util").CSS<{}, {
|
|
84
86
|
colors: {
|
|
85
87
|
background: string;
|
|
86
88
|
mainColor: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StickyHeader.styled.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/header/StickyHeader.styled.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"StickyHeader.styled.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/header/StickyHeader.styled.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiBtB,CAAC;AAEH,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgBX,CAAC;AAEH,OAAO,EACH,OAAO,EACP,kBAAkB,GACrB,CAAC"}
|
|
@@ -1,26 +1,36 @@
|
|
|
1
1
|
import { styled } from "../../../theme.js";
|
|
2
2
|
const StyledStickyHeader = styled("div", {
|
|
3
3
|
height: "100%",
|
|
4
|
-
display: "
|
|
5
|
-
|
|
6
|
-
gridTemplateColumns: "1fr",
|
|
4
|
+
display: "flex",
|
|
5
|
+
flexDirection: "column",
|
|
7
6
|
variants: {
|
|
8
7
|
position: {
|
|
9
8
|
top: {},
|
|
10
9
|
left: {
|
|
11
|
-
|
|
12
|
-
gridTemplateColumns: "auto 1fr",
|
|
10
|
+
flexDirection: "row",
|
|
13
11
|
},
|
|
14
12
|
bottom: {},
|
|
15
13
|
right: {
|
|
16
|
-
|
|
17
|
-
gridTemplateColumns: "1fr auto",
|
|
14
|
+
flexDirection: "row",
|
|
18
15
|
},
|
|
19
16
|
},
|
|
20
17
|
},
|
|
21
18
|
});
|
|
22
19
|
const Content = styled("div", {
|
|
20
|
+
flex: 1,
|
|
23
21
|
overflow: "auto",
|
|
22
|
+
variants: {
|
|
23
|
+
position: {
|
|
24
|
+
top: {},
|
|
25
|
+
bottom: {
|
|
26
|
+
order: 1,
|
|
27
|
+
},
|
|
28
|
+
left: {},
|
|
29
|
+
right: {
|
|
30
|
+
order: 1,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
24
34
|
});
|
|
25
35
|
export { Content, StyledStickyHeader, };
|
|
26
36
|
//# sourceMappingURL=StickyHeader.styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StickyHeader.styled.js","sourceRoot":"","sources":["../../../../src/components/layout/header/StickyHeader.styled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,MAAM,kBAAkB,GAAG,MAAM,CAAC,KAAK,EAAE;IACrC,MAAM,EAAE,MAAM;IACd,OAAO,EAAE,MAAM;IACf,
|
|
1
|
+
{"version":3,"file":"StickyHeader.styled.js","sourceRoot":"","sources":["../../../../src/components/layout/header/StickyHeader.styled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,MAAM,kBAAkB,GAAG,MAAM,CAAC,KAAK,EAAE;IACrC,MAAM,EAAE,MAAM;IACd,OAAO,EAAE,MAAM;IACf,aAAa,EAAE,QAAQ;IAEvB,QAAQ,EAAE;QACN,QAAQ,EAAE;YACN,GAAG,EAAE,EAAE;YACP,IAAI,EAAE;gBACF,aAAa,EAAE,KAAK;aACvB;YACD,MAAM,EAAE,EAAE;YACV,KAAK,EAAE;gBACH,aAAa,EAAE,KAAK;aACvB;SACJ;KACJ;CACJ,CAAC,CAAC;AAEH,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,EAAE;IAC1B,IAAI,EAAE,CAAC;IACP,QAAQ,EAAE,MAAM;IAEhB,QAAQ,EAAE;QACN,QAAQ,EAAE;YACN,GAAG,EAAE,EAAE;YACP,MAAM,EAAE;gBACJ,KAAK,EAAE,CAAC;aACX;YACD,IAAI,EAAE,EAAE;YACR,KAAK,EAAE;gBACH,KAAK,EAAE,CAAC;aACX;SACJ;KACJ;CACJ,CAAC,CAAC;AAEH,OAAO,EACH,OAAO,EACP,kBAAkB,GACrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-miui",
|
|
3
|
-
"version": "0.23.7
|
|
3
|
+
"version": "0.23.7",
|
|
4
4
|
"author": "Jacek Nowacki",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"@dzek69/eslint-config-import-typescript": "^1.0.1",
|
|
49
49
|
"@dzek69/eslint-config-react": "^1.2.2",
|
|
50
50
|
"@dzek69/eslint-config-typescript": "^1.1.1",
|
|
51
|
+
"@ezez/hooks": "^2.0.0",
|
|
51
52
|
"@icon-park/react": "^1.4.2",
|
|
52
53
|
"@knodes/typedoc-plugin-pages": "^0.23.4",
|
|
53
54
|
"@storybook/addon-essentials": "^7.6.6",
|
|
@@ -80,7 +81,7 @@
|
|
|
80
81
|
"react-use": "^17.4.0",
|
|
81
82
|
"resolve-tspaths": "^0.8.15",
|
|
82
83
|
"sass": "^1.35.2",
|
|
83
|
-
"storybook": "^7.6.
|
|
84
|
+
"storybook": "^7.6.17",
|
|
84
85
|
"ts-node": "^10.9.1",
|
|
85
86
|
"typedoc": "^0.23.28",
|
|
86
87
|
"typescript": "^5.2.2"
|