@cloudflare/component-page 10.0.16 → 10.1.1
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 +12 -0
- package/dist/Page.stories.d.ts +118 -0
- package/es/Page.js +6 -2
- package/es/Page.stories.js +175 -0
- package/lib/Page.js +5 -1
- package/lib/Page.stories.js +292 -0
- package/package.json +2 -2
- package/src/Page.stories.tsx +295 -0
- package/src/Page.tsx +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 10.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @cloudflare/component-link@9.0.17
|
|
8
|
+
|
|
9
|
+
## 10.1.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 82021ffb37: Default Page docs button to use Span for Tooltip, not button which creates invalid HTML
|
|
14
|
+
|
|
3
15
|
## 10.0.16
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentMeta } from '@storybook/react';
|
|
3
|
+
declare const _default: ComponentMeta<React.ComponentType<{
|
|
4
|
+
title?: React.ReactNode;
|
|
5
|
+
parentPageLabel?: React.ReactNode;
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
documentationLabel?: React.ReactNode;
|
|
8
|
+
documentationHref?: string | undefined;
|
|
9
|
+
control?: React.ReactNode;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
centerHeader?: boolean | undefined;
|
|
12
|
+
beta?: boolean | undefined;
|
|
13
|
+
titleRef?: React.RefObject<HTMLHeadingElement> | undefined;
|
|
14
|
+
parentPageLabelRef?: React.RefObject<HTMLHeadingElement> | undefined;
|
|
15
|
+
navigation?: React.ReactNode;
|
|
16
|
+
onDocumentationButtonClick?: (() => void) | undefined;
|
|
17
|
+
documentationAsButton?: boolean | undefined;
|
|
18
|
+
type?: ("narrow" | "wide" | "unbounded") | undefined;
|
|
19
|
+
className?: string | undefined;
|
|
20
|
+
testId?: string | undefined;
|
|
21
|
+
sidebar?: React.ReactNode;
|
|
22
|
+
sidebarPosition?: "left" | "inside" | "outside" | undefined;
|
|
23
|
+
autofocus?: boolean | undefined;
|
|
24
|
+
p?: import("csstype").PaddingProperty<string | number> | [import("csstype").PaddingProperty<string | number> | undefined, import("csstype").PaddingProperty<string | number> | undefined] | [import("csstype").PaddingProperty<string | number> | undefined, import("csstype").PaddingProperty<string | number> | undefined, import("csstype").PaddingProperty<string | number> | undefined] | undefined;
|
|
25
|
+
color?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
26
|
+
borderColor?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
27
|
+
height?: import("csstype").HeightProperty<string | number> | [import("csstype").HeightProperty<string | number> | undefined, import("csstype").HeightProperty<string | number> | undefined] | [import("csstype").HeightProperty<string | number> | undefined, import("csstype").HeightProperty<string | number> | undefined, import("csstype").HeightProperty<string | number> | undefined] | undefined;
|
|
28
|
+
width?: import("csstype").WidthProperty<string | number> | [import("csstype").WidthProperty<string | number> | undefined, import("csstype").WidthProperty<string | number> | undefined] | [import("csstype").WidthProperty<string | number> | undefined, import("csstype").WidthProperty<string | number> | undefined, import("csstype").WidthProperty<string | number> | undefined] | undefined;
|
|
29
|
+
cursor?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
30
|
+
display?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
31
|
+
fontSize?: import("csstype").FontSizeProperty<string | number> | [import("csstype").FontSizeProperty<string | number> | undefined, import("csstype").FontSizeProperty<string | number> | undefined] | [import("csstype").FontSizeProperty<string | number> | undefined, import("csstype").FontSizeProperty<string | number> | undefined, import("csstype").FontSizeProperty<string | number> | undefined] | undefined;
|
|
32
|
+
fontWeight?: import("csstype").FontWeightProperty | [import("csstype").FontWeightProperty | undefined, import("csstype").FontWeightProperty | undefined] | [import("csstype").FontWeightProperty | undefined, import("csstype").FontWeightProperty | undefined, import("csstype").FontWeightProperty | undefined] | undefined;
|
|
33
|
+
textDecoration?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
34
|
+
margin?: import("csstype").MarginProperty<string | number> | [import("csstype").MarginProperty<string | number> | undefined, import("csstype").MarginProperty<string | number> | undefined] | [import("csstype").MarginProperty<string | number> | undefined, import("csstype").MarginProperty<string | number> | undefined, import("csstype").MarginProperty<string | number> | undefined] | undefined;
|
|
35
|
+
marginLeft?: import("csstype").MarginLeftProperty<string | number> | [import("csstype").MarginLeftProperty<string | number> | undefined, import("csstype").MarginLeftProperty<string | number> | undefined] | [import("csstype").MarginLeftProperty<string | number> | undefined, import("csstype").MarginLeftProperty<string | number> | undefined, import("csstype").MarginLeftProperty<string | number> | undefined] | undefined;
|
|
36
|
+
marginRight?: import("csstype").MarginRightProperty<string | number> | [import("csstype").MarginRightProperty<string | number> | undefined, import("csstype").MarginRightProperty<string | number> | undefined] | [import("csstype").MarginRightProperty<string | number> | undefined, import("csstype").MarginRightProperty<string | number> | undefined, import("csstype").MarginRightProperty<string | number> | undefined] | undefined;
|
|
37
|
+
marginTop?: import("csstype").MarginTopProperty<string | number> | [import("csstype").MarginTopProperty<string | number> | undefined, import("csstype").MarginTopProperty<string | number> | undefined] | [import("csstype").MarginTopProperty<string | number> | undefined, import("csstype").MarginTopProperty<string | number> | undefined, import("csstype").MarginTopProperty<string | number> | undefined] | undefined;
|
|
38
|
+
marginBottom?: import("csstype").MarginBottomProperty<string | number> | [import("csstype").MarginBottomProperty<string | number> | undefined, import("csstype").MarginBottomProperty<string | number> | undefined] | [import("csstype").MarginBottomProperty<string | number> | undefined, import("csstype").MarginBottomProperty<string | number> | undefined, import("csstype").MarginBottomProperty<string | number> | undefined] | undefined;
|
|
39
|
+
padding?: import("csstype").PaddingProperty<string | number> | [import("csstype").PaddingProperty<string | number> | undefined, import("csstype").PaddingProperty<string | number> | undefined] | [import("csstype").PaddingProperty<string | number> | undefined, import("csstype").PaddingProperty<string | number> | undefined, import("csstype").PaddingProperty<string | number> | undefined] | undefined;
|
|
40
|
+
paddingLeft?: import("csstype").PaddingLeftProperty<string | number> | [import("csstype").PaddingLeftProperty<string | number> | undefined, import("csstype").PaddingLeftProperty<string | number> | undefined] | [import("csstype").PaddingLeftProperty<string | number> | undefined, import("csstype").PaddingLeftProperty<string | number> | undefined, import("csstype").PaddingLeftProperty<string | number> | undefined] | undefined;
|
|
41
|
+
paddingRight?: import("csstype").PaddingRightProperty<string | number> | [import("csstype").PaddingRightProperty<string | number> | undefined, import("csstype").PaddingRightProperty<string | number> | undefined] | [import("csstype").PaddingRightProperty<string | number> | undefined, import("csstype").PaddingRightProperty<string | number> | undefined, import("csstype").PaddingRightProperty<string | number> | undefined] | undefined;
|
|
42
|
+
paddingTop?: import("csstype").PaddingTopProperty<string | number> | [import("csstype").PaddingTopProperty<string | number> | undefined, import("csstype").PaddingTopProperty<string | number> | undefined] | [import("csstype").PaddingTopProperty<string | number> | undefined, import("csstype").PaddingTopProperty<string | number> | undefined, import("csstype").PaddingTopProperty<string | number> | undefined] | undefined;
|
|
43
|
+
paddingBottom?: import("csstype").PaddingBottomProperty<string | number> | [import("csstype").PaddingBottomProperty<string | number> | undefined, import("csstype").PaddingBottomProperty<string | number> | undefined] | [import("csstype").PaddingBottomProperty<string | number> | undefined, import("csstype").PaddingBottomProperty<string | number> | undefined, import("csstype").PaddingBottomProperty<string | number> | undefined] | undefined;
|
|
44
|
+
gap?: import("csstype").GapProperty<string | number> | [import("csstype").GapProperty<string | number> | undefined, import("csstype").GapProperty<string | number> | undefined] | [import("csstype").GapProperty<string | number> | undefined, import("csstype").GapProperty<string | number> | undefined, import("csstype").GapProperty<string | number> | undefined] | undefined;
|
|
45
|
+
m?: import("csstype").MarginProperty<string | number> | [import("csstype").MarginProperty<string | number> | undefined, import("csstype").MarginProperty<string | number> | undefined] | [import("csstype").MarginProperty<string | number> | undefined, import("csstype").MarginProperty<string | number> | undefined, import("csstype").MarginProperty<string | number> | undefined] | undefined;
|
|
46
|
+
ml?: import("csstype").MarginLeftProperty<string | number> | [import("csstype").MarginLeftProperty<string | number> | undefined, import("csstype").MarginLeftProperty<string | number> | undefined] | [import("csstype").MarginLeftProperty<string | number> | undefined, import("csstype").MarginLeftProperty<string | number> | undefined, import("csstype").MarginLeftProperty<string | number> | undefined] | undefined;
|
|
47
|
+
mr?: import("csstype").MarginRightProperty<string | number> | [import("csstype").MarginRightProperty<string | number> | undefined, import("csstype").MarginRightProperty<string | number> | undefined] | [import("csstype").MarginRightProperty<string | number> | undefined, import("csstype").MarginRightProperty<string | number> | undefined, import("csstype").MarginRightProperty<string | number> | undefined] | undefined;
|
|
48
|
+
mt?: import("csstype").MarginTopProperty<string | number> | [import("csstype").MarginTopProperty<string | number> | undefined, import("csstype").MarginTopProperty<string | number> | undefined] | [import("csstype").MarginTopProperty<string | number> | undefined, import("csstype").MarginTopProperty<string | number> | undefined, import("csstype").MarginTopProperty<string | number> | undefined] | undefined;
|
|
49
|
+
mb?: import("csstype").MarginBottomProperty<string | number> | [import("csstype").MarginBottomProperty<string | number> | undefined, import("csstype").MarginBottomProperty<string | number> | undefined] | [import("csstype").MarginBottomProperty<string | number> | undefined, import("csstype").MarginBottomProperty<string | number> | undefined, import("csstype").MarginBottomProperty<string | number> | undefined] | undefined;
|
|
50
|
+
mx?: import("csstype").MarginLeftProperty<string | number> | [import("csstype").MarginLeftProperty<string | number> | undefined, import("csstype").MarginLeftProperty<string | number> | undefined] | [import("csstype").MarginLeftProperty<string | number> | undefined, import("csstype").MarginLeftProperty<string | number> | undefined, import("csstype").MarginLeftProperty<string | number> | undefined] | undefined;
|
|
51
|
+
my?: import("csstype").MarginTopProperty<string | number> | [import("csstype").MarginTopProperty<string | number> | undefined, import("csstype").MarginTopProperty<string | number> | undefined] | [import("csstype").MarginTopProperty<string | number> | undefined, import("csstype").MarginTopProperty<string | number> | undefined, import("csstype").MarginTopProperty<string | number> | undefined] | undefined;
|
|
52
|
+
pl?: import("csstype").PaddingLeftProperty<string | number> | [import("csstype").PaddingLeftProperty<string | number> | undefined, import("csstype").PaddingLeftProperty<string | number> | undefined] | [import("csstype").PaddingLeftProperty<string | number> | undefined, import("csstype").PaddingLeftProperty<string | number> | undefined, import("csstype").PaddingLeftProperty<string | number> | undefined] | undefined;
|
|
53
|
+
pr?: import("csstype").PaddingRightProperty<string | number> | [import("csstype").PaddingRightProperty<string | number> | undefined, import("csstype").PaddingRightProperty<string | number> | undefined] | [import("csstype").PaddingRightProperty<string | number> | undefined, import("csstype").PaddingRightProperty<string | number> | undefined, import("csstype").PaddingRightProperty<string | number> | undefined] | undefined;
|
|
54
|
+
pt?: import("csstype").PaddingTopProperty<string | number> | [import("csstype").PaddingTopProperty<string | number> | undefined, import("csstype").PaddingTopProperty<string | number> | undefined] | [import("csstype").PaddingTopProperty<string | number> | undefined, import("csstype").PaddingTopProperty<string | number> | undefined, import("csstype").PaddingTopProperty<string | number> | undefined] | undefined;
|
|
55
|
+
pb?: import("csstype").PaddingBottomProperty<string | number> | [import("csstype").PaddingBottomProperty<string | number> | undefined, import("csstype").PaddingBottomProperty<string | number> | undefined] | [import("csstype").PaddingBottomProperty<string | number> | undefined, import("csstype").PaddingBottomProperty<string | number> | undefined, import("csstype").PaddingBottomProperty<string | number> | undefined] | undefined;
|
|
56
|
+
px?: import("csstype").PaddingLeftProperty<string | number> | [import("csstype").PaddingLeftProperty<string | number> | undefined, import("csstype").PaddingLeftProperty<string | number> | undefined] | [import("csstype").PaddingLeftProperty<string | number> | undefined, import("csstype").PaddingLeftProperty<string | number> | undefined, import("csstype").PaddingLeftProperty<string | number> | undefined] | undefined;
|
|
57
|
+
py?: import("csstype").PaddingTopProperty<string | number> | [import("csstype").PaddingTopProperty<string | number> | undefined, import("csstype").PaddingTopProperty<string | number> | undefined] | [import("csstype").PaddingTopProperty<string | number> | undefined, import("csstype").PaddingTopProperty<string | number> | undefined, import("csstype").PaddingTopProperty<string | number> | undefined] | undefined;
|
|
58
|
+
minWidth?: import("csstype").MinWidthProperty<string | number> | [import("csstype").MinWidthProperty<string | number> | undefined, import("csstype").MinWidthProperty<string | number> | undefined] | [import("csstype").MinWidthProperty<string | number> | undefined, import("csstype").MinWidthProperty<string | number> | undefined, import("csstype").MinWidthProperty<string | number> | undefined] | undefined;
|
|
59
|
+
minHeight?: import("csstype").MinHeightProperty<string | number> | [import("csstype").MinHeightProperty<string | number> | undefined, import("csstype").MinHeightProperty<string | number> | undefined] | [import("csstype").MinHeightProperty<string | number> | undefined, import("csstype").MinHeightProperty<string | number> | undefined, import("csstype").MinHeightProperty<string | number> | undefined] | undefined;
|
|
60
|
+
maxWidth?: import("csstype").MaxWidthProperty<string | number> | [import("csstype").MaxWidthProperty<string | number> | undefined, import("csstype").MaxWidthProperty<string | number> | undefined] | [import("csstype").MaxWidthProperty<string | number> | undefined, import("csstype").MaxWidthProperty<string | number> | undefined, import("csstype").MaxWidthProperty<string | number> | undefined] | undefined;
|
|
61
|
+
maxHeight?: import("csstype").MaxHeightProperty<string | number> | [import("csstype").MaxHeightProperty<string | number> | undefined, import("csstype").MaxHeightProperty<string | number> | undefined] | [import("csstype").MaxHeightProperty<string | number> | undefined, import("csstype").MaxHeightProperty<string | number> | undefined, import("csstype").MaxHeightProperty<string | number> | undefined] | undefined;
|
|
62
|
+
backgroundColor?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
63
|
+
borderLeftColor?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
64
|
+
borderRightColor?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
65
|
+
borderTopColor?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
66
|
+
borderBottomColor?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
67
|
+
borderStyle?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
68
|
+
borderTopStyle?: import("csstype").BorderTopStyleProperty | [import("csstype").BorderTopStyleProperty | undefined, import("csstype").BorderTopStyleProperty | undefined] | [import("csstype").BorderTopStyleProperty | undefined, import("csstype").BorderTopStyleProperty | undefined, import("csstype").BorderTopStyleProperty | undefined] | undefined;
|
|
69
|
+
borderBottomStyle?: import("csstype").BorderBottomStyleProperty | [import("csstype").BorderBottomStyleProperty | undefined, import("csstype").BorderBottomStyleProperty | undefined] | [import("csstype").BorderBottomStyleProperty | undefined, import("csstype").BorderBottomStyleProperty | undefined, import("csstype").BorderBottomStyleProperty | undefined] | undefined;
|
|
70
|
+
borderLeftStyle?: import("csstype").BorderLeftStyleProperty | [import("csstype").BorderLeftStyleProperty | undefined, import("csstype").BorderLeftStyleProperty | undefined] | [import("csstype").BorderLeftStyleProperty | undefined, import("csstype").BorderLeftStyleProperty | undefined, import("csstype").BorderLeftStyleProperty | undefined] | undefined;
|
|
71
|
+
borderRightStyle?: import("csstype").BorderRightStyleProperty | [import("csstype").BorderRightStyleProperty | undefined, import("csstype").BorderRightStyleProperty | undefined] | [import("csstype").BorderRightStyleProperty | undefined, import("csstype").BorderRightStyleProperty | undefined, import("csstype").BorderRightStyleProperty | undefined] | undefined;
|
|
72
|
+
borderWidth?: import("csstype").BorderWidthProperty<string | number> | [import("csstype").BorderWidthProperty<string | number> | undefined, import("csstype").BorderWidthProperty<string | number> | undefined] | [import("csstype").BorderWidthProperty<string | number> | undefined, import("csstype").BorderWidthProperty<string | number> | undefined, import("csstype").BorderWidthProperty<string | number> | undefined] | undefined;
|
|
73
|
+
borderTopWidth?: import("csstype").BorderTopWidthProperty<string | number> | [import("csstype").BorderTopWidthProperty<string | number> | undefined, import("csstype").BorderTopWidthProperty<string | number> | undefined] | [import("csstype").BorderTopWidthProperty<string | number> | undefined, import("csstype").BorderTopWidthProperty<string | number> | undefined, import("csstype").BorderTopWidthProperty<string | number> | undefined] | undefined;
|
|
74
|
+
borderBottomWidth?: import("csstype").BorderBottomWidthProperty<string | number> | [import("csstype").BorderBottomWidthProperty<string | number> | undefined, import("csstype").BorderBottomWidthProperty<string | number> | undefined] | [import("csstype").BorderBottomWidthProperty<string | number> | undefined, import("csstype").BorderBottomWidthProperty<string | number> | undefined, import("csstype").BorderBottomWidthProperty<string | number> | undefined] | undefined;
|
|
75
|
+
borderLeftWidth?: import("csstype").BorderLeftWidthProperty<string | number> | [import("csstype").BorderLeftWidthProperty<string | number> | undefined, import("csstype").BorderLeftWidthProperty<string | number> | undefined] | [import("csstype").BorderLeftWidthProperty<string | number> | undefined, import("csstype").BorderLeftWidthProperty<string | number> | undefined, import("csstype").BorderLeftWidthProperty<string | number> | undefined] | undefined;
|
|
76
|
+
borderRightWidth?: import("csstype").BorderRightWidthProperty<string | number> | [import("csstype").BorderRightWidthProperty<string | number> | undefined, import("csstype").BorderRightWidthProperty<string | number> | undefined] | [import("csstype").BorderRightWidthProperty<string | number> | undefined, import("csstype").BorderRightWidthProperty<string | number> | undefined, import("csstype").BorderRightWidthProperty<string | number> | undefined] | undefined;
|
|
77
|
+
borderRadius?: import("csstype").BorderRadiusProperty<string | number> | [import("csstype").BorderRadiusProperty<string | number> | undefined, import("csstype").BorderRadiusProperty<string | number> | undefined] | [import("csstype").BorderRadiusProperty<string | number> | undefined, import("csstype").BorderRadiusProperty<string | number> | undefined, import("csstype").BorderRadiusProperty<string | number> | undefined] | undefined;
|
|
78
|
+
borderTopLeftRadius?: import("csstype").BorderTopLeftRadiusProperty<string | number> | [import("csstype").BorderTopLeftRadiusProperty<string | number> | undefined, import("csstype").BorderTopLeftRadiusProperty<string | number> | undefined] | [import("csstype").BorderTopLeftRadiusProperty<string | number> | undefined, import("csstype").BorderTopLeftRadiusProperty<string | number> | undefined, import("csstype").BorderTopLeftRadiusProperty<string | number> | undefined] | undefined;
|
|
79
|
+
borderTopRightRadius?: import("csstype").BorderTopRightRadiusProperty<string | number> | [import("csstype").BorderTopRightRadiusProperty<string | number> | undefined, import("csstype").BorderTopRightRadiusProperty<string | number> | undefined] | [import("csstype").BorderTopRightRadiusProperty<string | number> | undefined, import("csstype").BorderTopRightRadiusProperty<string | number> | undefined, import("csstype").BorderTopRightRadiusProperty<string | number> | undefined] | undefined;
|
|
80
|
+
borderBottomLeftRadius?: import("csstype").BorderBottomLeftRadiusProperty<string | number> | [import("csstype").BorderBottomLeftRadiusProperty<string | number> | undefined, import("csstype").BorderBottomLeftRadiusProperty<string | number> | undefined] | [import("csstype").BorderBottomLeftRadiusProperty<string | number> | undefined, import("csstype").BorderBottomLeftRadiusProperty<string | number> | undefined, import("csstype").BorderBottomLeftRadiusProperty<string | number> | undefined] | undefined;
|
|
81
|
+
borderBottomRightRadius?: import("csstype").BorderBottomRightRadiusProperty<string | number> | [import("csstype").BorderBottomRightRadiusProperty<string | number> | undefined, import("csstype").BorderBottomRightRadiusProperty<string | number> | undefined] | [import("csstype").BorderBottomRightRadiusProperty<string | number> | undefined, import("csstype").BorderBottomRightRadiusProperty<string | number> | undefined, import("csstype").BorderBottomRightRadiusProperty<string | number> | undefined] | undefined;
|
|
82
|
+
textAlign?: import("csstype").TextAlignProperty | [import("csstype").TextAlignProperty | undefined, import("csstype").TextAlignProperty | undefined] | [import("csstype").TextAlignProperty | undefined, import("csstype").TextAlignProperty | undefined, import("csstype").TextAlignProperty | undefined] | undefined;
|
|
83
|
+
verticalAlign?: import("csstype").VerticalAlignProperty<string | number> | [import("csstype").VerticalAlignProperty<string | number> | undefined, import("csstype").VerticalAlignProperty<string | number> | undefined] | [import("csstype").VerticalAlignProperty<string | number> | undefined, import("csstype").VerticalAlignProperty<string | number> | undefined, import("csstype").VerticalAlignProperty<string | number> | undefined] | undefined;
|
|
84
|
+
alignItems?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
85
|
+
alignSelf?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
86
|
+
justifyContent?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
87
|
+
textTransform?: import("csstype").TextTransformProperty | [import("csstype").TextTransformProperty | undefined, import("csstype").TextTransformProperty | undefined] | [import("csstype").TextTransformProperty | undefined, import("csstype").TextTransformProperty | undefined, import("csstype").TextTransformProperty | undefined] | undefined;
|
|
88
|
+
boxSizing?: import("csstype").BoxSizingProperty | [import("csstype").BoxSizingProperty | undefined, import("csstype").BoxSizingProperty | undefined] | [import("csstype").BoxSizingProperty | undefined, import("csstype").BoxSizingProperty | undefined, import("csstype").BoxSizingProperty | undefined] | undefined;
|
|
89
|
+
flexDirection?: import("csstype").FlexDirectionProperty | [import("csstype").FlexDirectionProperty | undefined, import("csstype").FlexDirectionProperty | undefined] | [import("csstype").FlexDirectionProperty | undefined, import("csstype").FlexDirectionProperty | undefined, import("csstype").FlexDirectionProperty | undefined] | undefined;
|
|
90
|
+
flexBasis?: import("csstype").FlexBasisProperty<string | number> | [import("csstype").FlexBasisProperty<string | number> | undefined, import("csstype").FlexBasisProperty<string | number> | undefined] | [import("csstype").FlexBasisProperty<string | number> | undefined, import("csstype").FlexBasisProperty<string | number> | undefined, import("csstype").FlexBasisProperty<string | number> | undefined] | undefined;
|
|
91
|
+
flexGrow?: import("csstype").GlobalsNumber | [import("csstype").GlobalsNumber | undefined, import("csstype").GlobalsNumber | undefined] | [import("csstype").GlobalsNumber | undefined, import("csstype").GlobalsNumber | undefined, import("csstype").GlobalsNumber | undefined] | undefined;
|
|
92
|
+
gridTemplateColumns?: import("csstype").GridTemplateColumnsProperty<string | number> | [import("csstype").GridTemplateColumnsProperty<string | number> | undefined, import("csstype").GridTemplateColumnsProperty<string | number> | undefined] | [import("csstype").GridTemplateColumnsProperty<string | number> | undefined, import("csstype").GridTemplateColumnsProperty<string | number> | undefined, import("csstype").GridTemplateColumnsProperty<string | number> | undefined] | undefined;
|
|
93
|
+
innerRef?: React.Ref<never> | undefined;
|
|
94
|
+
gridColumnSpan?: number | number[] | "all" | "end" | undefined;
|
|
95
|
+
gridColumnPad?: number | number[] | undefined;
|
|
96
|
+
gridRowSpan?: number | number[] | undefined;
|
|
97
|
+
gridRowPad?: number | number[] | undefined;
|
|
98
|
+
gridAlign?: ("start" | "end" | "center" | "stretch") | undefined;
|
|
99
|
+
gridJustify?: ("start" | "end" | "center" | "stretch") | undefined;
|
|
100
|
+
}>>;
|
|
101
|
+
export default _default;
|
|
102
|
+
export declare const Default: () => JSX.Element;
|
|
103
|
+
export declare const WithParentLabel: () => JSX.Element;
|
|
104
|
+
export declare const WithBeta: () => JSX.Element;
|
|
105
|
+
export declare const WithDocumentation: () => JSX.Element;
|
|
106
|
+
export declare const WithDocumentationButton: () => JSX.Element;
|
|
107
|
+
export declare const WithSidebarInside: () => JSX.Element;
|
|
108
|
+
export declare const WithSidebarOutside: () => JSX.Element;
|
|
109
|
+
export declare const WithControl: () => JSX.Element;
|
|
110
|
+
export declare const WithNavigation: () => JSX.Element;
|
|
111
|
+
export declare const CenteredHeader: () => JSX.Element;
|
|
112
|
+
export declare const NarrowWidth: () => JSX.Element;
|
|
113
|
+
export declare const WideWidth: () => JSX.Element;
|
|
114
|
+
export declare const UnboundedWidth: () => JSX.Element;
|
|
115
|
+
export declare const ComplexExample: () => JSX.Element;
|
|
116
|
+
export declare const MinimalExample: () => JSX.Element;
|
|
117
|
+
export declare const NoTitle: () => JSX.Element;
|
|
118
|
+
export declare const LongContent: () => JSX.Element;
|
package/es/Page.js
CHANGED
|
@@ -9,7 +9,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
9
9
|
import React, { useEffect, useRef } from 'react';
|
|
10
10
|
import { useHistory } from 'react-router-dom';
|
|
11
11
|
import { createStyledComponent } from '@cloudflare/style-container';
|
|
12
|
-
import { Main, Header, Div, P } from '@cloudflare/elements';
|
|
12
|
+
import { Main, Header, Div, P, Span } from '@cloudflare/elements';
|
|
13
13
|
import { Label } from '@cloudflare/component-label';
|
|
14
14
|
import { Trans } from '@cloudflare/intl-react';
|
|
15
15
|
import { Heading, Section } from './Heading';
|
|
@@ -90,7 +90,11 @@ var PageHeader = _ref => {
|
|
|
90
90
|
message: /*#__PURE__*/React.createElement(Trans, {
|
|
91
91
|
id: "common.open_documentation",
|
|
92
92
|
_: 'Open documentation'
|
|
93
|
-
})
|
|
93
|
+
}),
|
|
94
|
+
Component: Span,
|
|
95
|
+
buttonProps: {
|
|
96
|
+
width: 'fit-content'
|
|
97
|
+
}
|
|
94
98
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
95
99
|
type: "primary",
|
|
96
100
|
borderRadius: '20vh',
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BrowserRouter } from 'react-router-dom';
|
|
3
|
+
import { Button } from '@cloudflare/component-button';
|
|
4
|
+
import { Card } from '@cloudflare/component-card';
|
|
5
|
+
import { Div, P } from '@cloudflare/elements';
|
|
6
|
+
import Page from './Page';
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Dash/Core/Page',
|
|
9
|
+
component: Page,
|
|
10
|
+
decorators: [Story => /*#__PURE__*/React.createElement(BrowserRouter, null, /*#__PURE__*/React.createElement(Story, null))],
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: 'fullscreen',
|
|
13
|
+
docs: {
|
|
14
|
+
description: {
|
|
15
|
+
component: 'A flexible page layout component with header, optional sidebar, and content area. Supports different width configurations and responsive behavior.'
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}; // Sample content components for stories
|
|
20
|
+
|
|
21
|
+
var SampleContent = () => /*#__PURE__*/React.createElement(Div, null, /*#__PURE__*/React.createElement(P, {
|
|
22
|
+
mb: 4
|
|
23
|
+
}, "This is sample page content. The Page component provides a consistent layout structure with header, optional sidebar, and main content area."), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(Div, {
|
|
24
|
+
p: 4,
|
|
25
|
+
mb: 4
|
|
26
|
+
}, /*#__PURE__*/React.createElement(P, {
|
|
27
|
+
mb: 2,
|
|
28
|
+
fontWeight: "bold"
|
|
29
|
+
}, "Sample Card Content"), /*#__PURE__*/React.createElement(P, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."))), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(Div, {
|
|
30
|
+
p: 4
|
|
31
|
+
}, /*#__PURE__*/React.createElement(P, {
|
|
32
|
+
mb: 2,
|
|
33
|
+
fontWeight: "bold"
|
|
34
|
+
}, "Another Card"), /*#__PURE__*/React.createElement(P, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."))));
|
|
35
|
+
|
|
36
|
+
var SampleSidebar = () => /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(Div, {
|
|
37
|
+
p: 4
|
|
38
|
+
}, /*#__PURE__*/React.createElement(P, {
|
|
39
|
+
mb: 3,
|
|
40
|
+
fontWeight: "bold"
|
|
41
|
+
}, "Sidebar Content"), /*#__PURE__*/React.createElement(P, {
|
|
42
|
+
mb: 2
|
|
43
|
+
}, "Quick Actions:"), /*#__PURE__*/React.createElement(Div, {
|
|
44
|
+
mb: 2
|
|
45
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
46
|
+
type: "primary",
|
|
47
|
+
width: "100%"
|
|
48
|
+
}, "Primary Action")), /*#__PURE__*/React.createElement(Div, {
|
|
49
|
+
mb: 2
|
|
50
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
51
|
+
type: "default",
|
|
52
|
+
width: "100%"
|
|
53
|
+
}, "Secondary Action")), /*#__PURE__*/React.createElement(P, {
|
|
54
|
+
mt: 3,
|
|
55
|
+
fontSize: 1,
|
|
56
|
+
color: "gray.3"
|
|
57
|
+
}, "Additional sidebar information and links can go here.")));
|
|
58
|
+
|
|
59
|
+
var SampleControl = () => /*#__PURE__*/React.createElement(Div, {
|
|
60
|
+
display: "flex",
|
|
61
|
+
alignItems: "center"
|
|
62
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
63
|
+
type: "primary",
|
|
64
|
+
mr: 2
|
|
65
|
+
}, "Create New"), /*#__PURE__*/React.createElement(Button, {
|
|
66
|
+
type: "default"
|
|
67
|
+
}, "Settings"));
|
|
68
|
+
|
|
69
|
+
var SampleNavigation = () => /*#__PURE__*/React.createElement(Button, {
|
|
70
|
+
type: "plain",
|
|
71
|
+
iconType: "backward",
|
|
72
|
+
onClick: () => console.log('Navigate back')
|
|
73
|
+
}, "Back to Dashboard");
|
|
74
|
+
|
|
75
|
+
export var Default = () => /*#__PURE__*/React.createElement(Page, {
|
|
76
|
+
title: "Page Title",
|
|
77
|
+
description: "This is a description of what this page is about and what users can expect to find here."
|
|
78
|
+
}, /*#__PURE__*/React.createElement(SampleContent, null));
|
|
79
|
+
export var WithParentLabel = () => /*#__PURE__*/React.createElement(Page, {
|
|
80
|
+
title: "Settings",
|
|
81
|
+
parentPageLabel: "Account Management",
|
|
82
|
+
description: "Configure your account settings and preferences."
|
|
83
|
+
}, /*#__PURE__*/React.createElement(SampleContent, null));
|
|
84
|
+
export var WithBeta = () => /*#__PURE__*/React.createElement(Page, {
|
|
85
|
+
title: "New Feature",
|
|
86
|
+
description: "This is a beta feature that is still in development.",
|
|
87
|
+
beta: true
|
|
88
|
+
}, /*#__PURE__*/React.createElement(SampleContent, null));
|
|
89
|
+
export var WithDocumentation = () => /*#__PURE__*/React.createElement(Page, {
|
|
90
|
+
title: "API Documentation",
|
|
91
|
+
description: "Learn how to integrate with our API endpoints.",
|
|
92
|
+
documentationLabel: "View API Docs",
|
|
93
|
+
documentationHref: "https://developers.cloudflare.com"
|
|
94
|
+
}, /*#__PURE__*/React.createElement(SampleContent, null));
|
|
95
|
+
export var WithDocumentationButton = () => /*#__PURE__*/React.createElement(Page, {
|
|
96
|
+
title: "Advanced Configuration",
|
|
97
|
+
description: "Configure advanced settings for your application.",
|
|
98
|
+
documentationLabel: "Help",
|
|
99
|
+
documentationAsButton: true,
|
|
100
|
+
onDocumentationButtonClick: () => console.log('Documentation button clicked')
|
|
101
|
+
}, /*#__PURE__*/React.createElement(SampleContent, null));
|
|
102
|
+
export var WithSidebarInside = () => /*#__PURE__*/React.createElement(Page, {
|
|
103
|
+
title: "Dashboard",
|
|
104
|
+
description: "Overview of your account activity and quick actions.",
|
|
105
|
+
sidebar: /*#__PURE__*/React.createElement(SampleSidebar, null),
|
|
106
|
+
sidebarPosition: "inside"
|
|
107
|
+
}, /*#__PURE__*/React.createElement(SampleContent, null));
|
|
108
|
+
export var WithSidebarOutside = () => /*#__PURE__*/React.createElement(Page, {
|
|
109
|
+
title: "Analytics",
|
|
110
|
+
description: "View detailed analytics and performance metrics.",
|
|
111
|
+
sidebar: /*#__PURE__*/React.createElement(SampleSidebar, null),
|
|
112
|
+
sidebarPosition: "outside"
|
|
113
|
+
}, /*#__PURE__*/React.createElement(SampleContent, null));
|
|
114
|
+
export var WithControl = () => /*#__PURE__*/React.createElement(Page, {
|
|
115
|
+
title: "User Management",
|
|
116
|
+
description: "Manage users and their permissions.",
|
|
117
|
+
control: /*#__PURE__*/React.createElement(SampleControl, null)
|
|
118
|
+
}, /*#__PURE__*/React.createElement(SampleContent, null));
|
|
119
|
+
export var WithNavigation = () => /*#__PURE__*/React.createElement(Page, {
|
|
120
|
+
title: "Project Details",
|
|
121
|
+
description: "View and edit project configuration.",
|
|
122
|
+
navigation: /*#__PURE__*/React.createElement(SampleNavigation, null)
|
|
123
|
+
}, /*#__PURE__*/React.createElement(SampleContent, null));
|
|
124
|
+
export var CenteredHeader = () => /*#__PURE__*/React.createElement(Page, {
|
|
125
|
+
title: "Welcome",
|
|
126
|
+
description: "Welcome to your dashboard. Get started by exploring the features below.",
|
|
127
|
+
centerHeader: true
|
|
128
|
+
}, /*#__PURE__*/React.createElement(SampleContent, null));
|
|
129
|
+
export var NarrowWidth = () => /*#__PURE__*/React.createElement(Page, {
|
|
130
|
+
title: "Narrow Page",
|
|
131
|
+
description: "This page uses the narrow width configuration for focused content.",
|
|
132
|
+
type: "narrow"
|
|
133
|
+
}, /*#__PURE__*/React.createElement(SampleContent, null));
|
|
134
|
+
export var WideWidth = () => /*#__PURE__*/React.createElement(Page, {
|
|
135
|
+
title: "Wide Page",
|
|
136
|
+
description: "This page uses the wide width configuration for more content.",
|
|
137
|
+
type: "wide"
|
|
138
|
+
}, /*#__PURE__*/React.createElement(SampleContent, null));
|
|
139
|
+
export var UnboundedWidth = () => /*#__PURE__*/React.createElement(Page, {
|
|
140
|
+
title: "Unbounded Page",
|
|
141
|
+
description: "This page uses the unbounded width configuration for full-width content.",
|
|
142
|
+
type: "unbounded"
|
|
143
|
+
}, /*#__PURE__*/React.createElement(SampleContent, null));
|
|
144
|
+
export var ComplexExample = () => /*#__PURE__*/React.createElement(Page, {
|
|
145
|
+
title: "Complex Page Example",
|
|
146
|
+
parentPageLabel: "Advanced Features",
|
|
147
|
+
description: "This example shows multiple features working together including beta label, documentation, controls, and sidebar.",
|
|
148
|
+
beta: true,
|
|
149
|
+
documentationLabel: "Learn More",
|
|
150
|
+
documentationHref: "https://developers.cloudflare.com",
|
|
151
|
+
control: /*#__PURE__*/React.createElement(SampleControl, null),
|
|
152
|
+
sidebar: /*#__PURE__*/React.createElement(SampleSidebar, null),
|
|
153
|
+
sidebarPosition: "inside",
|
|
154
|
+
navigation: /*#__PURE__*/React.createElement(SampleNavigation, null)
|
|
155
|
+
}, /*#__PURE__*/React.createElement(SampleContent, null));
|
|
156
|
+
export var MinimalExample = () => /*#__PURE__*/React.createElement(Page, {
|
|
157
|
+
title: "Minimal Page"
|
|
158
|
+
}, /*#__PURE__*/React.createElement(P, null, "This is a minimal page with just a title and simple content."));
|
|
159
|
+
export var NoTitle = () => /*#__PURE__*/React.createElement(Page, {
|
|
160
|
+
description: "A page without a title, showing just the description."
|
|
161
|
+
}, /*#__PURE__*/React.createElement(SampleContent, null));
|
|
162
|
+
export var LongContent = () => /*#__PURE__*/React.createElement(Page, {
|
|
163
|
+
title: "Long Content Example",
|
|
164
|
+
description: "This page demonstrates how the component handles longer content."
|
|
165
|
+
}, /*#__PURE__*/React.createElement(Div, null, Array.from({
|
|
166
|
+
length: 10
|
|
167
|
+
}, (_, i) => /*#__PURE__*/React.createElement(Card, {
|
|
168
|
+
key: i
|
|
169
|
+
}, /*#__PURE__*/React.createElement(Div, {
|
|
170
|
+
p: 4,
|
|
171
|
+
mb: 4
|
|
172
|
+
}, /*#__PURE__*/React.createElement(P, {
|
|
173
|
+
mb: 2,
|
|
174
|
+
fontWeight: "bold"
|
|
175
|
+
}, "Section ", i + 1), /*#__PURE__*/React.createElement(P, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."))))));
|
package/lib/Page.js
CHANGED
|
@@ -113,7 +113,11 @@ var PageHeader = function PageHeader(_ref) {
|
|
|
113
113
|
message: /*#__PURE__*/_react.default.createElement(_intlReact.Trans, {
|
|
114
114
|
id: "common.open_documentation",
|
|
115
115
|
_: 'Open documentation'
|
|
116
|
-
})
|
|
116
|
+
}),
|
|
117
|
+
Component: _elements.Span,
|
|
118
|
+
buttonProps: {
|
|
119
|
+
width: 'fit-content'
|
|
120
|
+
}
|
|
117
121
|
}, /*#__PURE__*/_react.default.createElement(_componentButton.Button, {
|
|
118
122
|
type: "primary",
|
|
119
123
|
borderRadius: '20vh',
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.WithSidebarOutside = exports.WithSidebarInside = exports.WithParentLabel = exports.WithNavigation = exports.WithDocumentationButton = exports.WithDocumentation = exports.WithControl = exports.WithBeta = exports.WideWidth = exports.UnboundedWidth = exports.NoTitle = exports.NarrowWidth = exports.MinimalExample = exports.LongContent = exports.Default = exports.ComplexExample = exports.CenteredHeader = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactRouterDom = require("react-router-dom");
|
|
11
|
+
|
|
12
|
+
var _componentButton = require("@cloudflare/component-button");
|
|
13
|
+
|
|
14
|
+
var _componentCard = require("@cloudflare/component-card");
|
|
15
|
+
|
|
16
|
+
var _elements = require("@cloudflare/elements");
|
|
17
|
+
|
|
18
|
+
var _Page = _interopRequireDefault(require("./Page"));
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
var _default = {
|
|
23
|
+
title: 'Dash/Core/Page',
|
|
24
|
+
component: _Page.default,
|
|
25
|
+
decorators: [function (Story) {
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement(_reactRouterDom.BrowserRouter, null, /*#__PURE__*/_react.default.createElement(Story, null));
|
|
27
|
+
}],
|
|
28
|
+
parameters: {
|
|
29
|
+
layout: 'fullscreen',
|
|
30
|
+
docs: {
|
|
31
|
+
description: {
|
|
32
|
+
component: 'A flexible page layout component with header, optional sidebar, and content area. Supports different width configurations and responsive behavior.'
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}; // Sample content components for stories
|
|
37
|
+
|
|
38
|
+
exports.default = _default;
|
|
39
|
+
|
|
40
|
+
var SampleContent = function SampleContent() {
|
|
41
|
+
return /*#__PURE__*/_react.default.createElement(_elements.Div, null, /*#__PURE__*/_react.default.createElement(_elements.P, {
|
|
42
|
+
mb: 4
|
|
43
|
+
}, "This is sample page content. The Page component provides a consistent layout structure with header, optional sidebar, and main content area."), /*#__PURE__*/_react.default.createElement(_componentCard.Card, null, /*#__PURE__*/_react.default.createElement(_elements.Div, {
|
|
44
|
+
p: 4,
|
|
45
|
+
mb: 4
|
|
46
|
+
}, /*#__PURE__*/_react.default.createElement(_elements.P, {
|
|
47
|
+
mb: 2,
|
|
48
|
+
fontWeight: "bold"
|
|
49
|
+
}, "Sample Card Content"), /*#__PURE__*/_react.default.createElement(_elements.P, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."))), /*#__PURE__*/_react.default.createElement(_componentCard.Card, null, /*#__PURE__*/_react.default.createElement(_elements.Div, {
|
|
50
|
+
p: 4
|
|
51
|
+
}, /*#__PURE__*/_react.default.createElement(_elements.P, {
|
|
52
|
+
mb: 2,
|
|
53
|
+
fontWeight: "bold"
|
|
54
|
+
}, "Another Card"), /*#__PURE__*/_react.default.createElement(_elements.P, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."))));
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
var SampleSidebar = function SampleSidebar() {
|
|
58
|
+
return /*#__PURE__*/_react.default.createElement(_componentCard.Card, null, /*#__PURE__*/_react.default.createElement(_elements.Div, {
|
|
59
|
+
p: 4
|
|
60
|
+
}, /*#__PURE__*/_react.default.createElement(_elements.P, {
|
|
61
|
+
mb: 3,
|
|
62
|
+
fontWeight: "bold"
|
|
63
|
+
}, "Sidebar Content"), /*#__PURE__*/_react.default.createElement(_elements.P, {
|
|
64
|
+
mb: 2
|
|
65
|
+
}, "Quick Actions:"), /*#__PURE__*/_react.default.createElement(_elements.Div, {
|
|
66
|
+
mb: 2
|
|
67
|
+
}, /*#__PURE__*/_react.default.createElement(_componentButton.Button, {
|
|
68
|
+
type: "primary",
|
|
69
|
+
width: "100%"
|
|
70
|
+
}, "Primary Action")), /*#__PURE__*/_react.default.createElement(_elements.Div, {
|
|
71
|
+
mb: 2
|
|
72
|
+
}, /*#__PURE__*/_react.default.createElement(_componentButton.Button, {
|
|
73
|
+
type: "default",
|
|
74
|
+
width: "100%"
|
|
75
|
+
}, "Secondary Action")), /*#__PURE__*/_react.default.createElement(_elements.P, {
|
|
76
|
+
mt: 3,
|
|
77
|
+
fontSize: 1,
|
|
78
|
+
color: "gray.3"
|
|
79
|
+
}, "Additional sidebar information and links can go here.")));
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
var SampleControl = function SampleControl() {
|
|
83
|
+
return /*#__PURE__*/_react.default.createElement(_elements.Div, {
|
|
84
|
+
display: "flex",
|
|
85
|
+
alignItems: "center"
|
|
86
|
+
}, /*#__PURE__*/_react.default.createElement(_componentButton.Button, {
|
|
87
|
+
type: "primary",
|
|
88
|
+
mr: 2
|
|
89
|
+
}, "Create New"), /*#__PURE__*/_react.default.createElement(_componentButton.Button, {
|
|
90
|
+
type: "default"
|
|
91
|
+
}, "Settings"));
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
var SampleNavigation = function SampleNavigation() {
|
|
95
|
+
return /*#__PURE__*/_react.default.createElement(_componentButton.Button, {
|
|
96
|
+
type: "plain",
|
|
97
|
+
iconType: "backward",
|
|
98
|
+
onClick: function onClick() {
|
|
99
|
+
return console.log('Navigate back');
|
|
100
|
+
}
|
|
101
|
+
}, "Back to Dashboard");
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
var Default = function Default() {
|
|
105
|
+
return /*#__PURE__*/_react.default.createElement(_Page.default, {
|
|
106
|
+
title: "Page Title",
|
|
107
|
+
description: "This is a description of what this page is about and what users can expect to find here."
|
|
108
|
+
}, /*#__PURE__*/_react.default.createElement(SampleContent, null));
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
exports.Default = Default;
|
|
112
|
+
|
|
113
|
+
var WithParentLabel = function WithParentLabel() {
|
|
114
|
+
return /*#__PURE__*/_react.default.createElement(_Page.default, {
|
|
115
|
+
title: "Settings",
|
|
116
|
+
parentPageLabel: "Account Management",
|
|
117
|
+
description: "Configure your account settings and preferences."
|
|
118
|
+
}, /*#__PURE__*/_react.default.createElement(SampleContent, null));
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
exports.WithParentLabel = WithParentLabel;
|
|
122
|
+
|
|
123
|
+
var WithBeta = function WithBeta() {
|
|
124
|
+
return /*#__PURE__*/_react.default.createElement(_Page.default, {
|
|
125
|
+
title: "New Feature",
|
|
126
|
+
description: "This is a beta feature that is still in development.",
|
|
127
|
+
beta: true
|
|
128
|
+
}, /*#__PURE__*/_react.default.createElement(SampleContent, null));
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
exports.WithBeta = WithBeta;
|
|
132
|
+
|
|
133
|
+
var WithDocumentation = function WithDocumentation() {
|
|
134
|
+
return /*#__PURE__*/_react.default.createElement(_Page.default, {
|
|
135
|
+
title: "API Documentation",
|
|
136
|
+
description: "Learn how to integrate with our API endpoints.",
|
|
137
|
+
documentationLabel: "View API Docs",
|
|
138
|
+
documentationHref: "https://developers.cloudflare.com"
|
|
139
|
+
}, /*#__PURE__*/_react.default.createElement(SampleContent, null));
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
exports.WithDocumentation = WithDocumentation;
|
|
143
|
+
|
|
144
|
+
var WithDocumentationButton = function WithDocumentationButton() {
|
|
145
|
+
return /*#__PURE__*/_react.default.createElement(_Page.default, {
|
|
146
|
+
title: "Advanced Configuration",
|
|
147
|
+
description: "Configure advanced settings for your application.",
|
|
148
|
+
documentationLabel: "Help",
|
|
149
|
+
documentationAsButton: true,
|
|
150
|
+
onDocumentationButtonClick: function onDocumentationButtonClick() {
|
|
151
|
+
return console.log('Documentation button clicked');
|
|
152
|
+
}
|
|
153
|
+
}, /*#__PURE__*/_react.default.createElement(SampleContent, null));
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
exports.WithDocumentationButton = WithDocumentationButton;
|
|
157
|
+
|
|
158
|
+
var WithSidebarInside = function WithSidebarInside() {
|
|
159
|
+
return /*#__PURE__*/_react.default.createElement(_Page.default, {
|
|
160
|
+
title: "Dashboard",
|
|
161
|
+
description: "Overview of your account activity and quick actions.",
|
|
162
|
+
sidebar: /*#__PURE__*/_react.default.createElement(SampleSidebar, null),
|
|
163
|
+
sidebarPosition: "inside"
|
|
164
|
+
}, /*#__PURE__*/_react.default.createElement(SampleContent, null));
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
exports.WithSidebarInside = WithSidebarInside;
|
|
168
|
+
|
|
169
|
+
var WithSidebarOutside = function WithSidebarOutside() {
|
|
170
|
+
return /*#__PURE__*/_react.default.createElement(_Page.default, {
|
|
171
|
+
title: "Analytics",
|
|
172
|
+
description: "View detailed analytics and performance metrics.",
|
|
173
|
+
sidebar: /*#__PURE__*/_react.default.createElement(SampleSidebar, null),
|
|
174
|
+
sidebarPosition: "outside"
|
|
175
|
+
}, /*#__PURE__*/_react.default.createElement(SampleContent, null));
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
exports.WithSidebarOutside = WithSidebarOutside;
|
|
179
|
+
|
|
180
|
+
var WithControl = function WithControl() {
|
|
181
|
+
return /*#__PURE__*/_react.default.createElement(_Page.default, {
|
|
182
|
+
title: "User Management",
|
|
183
|
+
description: "Manage users and their permissions.",
|
|
184
|
+
control: /*#__PURE__*/_react.default.createElement(SampleControl, null)
|
|
185
|
+
}, /*#__PURE__*/_react.default.createElement(SampleContent, null));
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
exports.WithControl = WithControl;
|
|
189
|
+
|
|
190
|
+
var WithNavigation = function WithNavigation() {
|
|
191
|
+
return /*#__PURE__*/_react.default.createElement(_Page.default, {
|
|
192
|
+
title: "Project Details",
|
|
193
|
+
description: "View and edit project configuration.",
|
|
194
|
+
navigation: /*#__PURE__*/_react.default.createElement(SampleNavigation, null)
|
|
195
|
+
}, /*#__PURE__*/_react.default.createElement(SampleContent, null));
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
exports.WithNavigation = WithNavigation;
|
|
199
|
+
|
|
200
|
+
var CenteredHeader = function CenteredHeader() {
|
|
201
|
+
return /*#__PURE__*/_react.default.createElement(_Page.default, {
|
|
202
|
+
title: "Welcome",
|
|
203
|
+
description: "Welcome to your dashboard. Get started by exploring the features below.",
|
|
204
|
+
centerHeader: true
|
|
205
|
+
}, /*#__PURE__*/_react.default.createElement(SampleContent, null));
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
exports.CenteredHeader = CenteredHeader;
|
|
209
|
+
|
|
210
|
+
var NarrowWidth = function NarrowWidth() {
|
|
211
|
+
return /*#__PURE__*/_react.default.createElement(_Page.default, {
|
|
212
|
+
title: "Narrow Page",
|
|
213
|
+
description: "This page uses the narrow width configuration for focused content.",
|
|
214
|
+
type: "narrow"
|
|
215
|
+
}, /*#__PURE__*/_react.default.createElement(SampleContent, null));
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
exports.NarrowWidth = NarrowWidth;
|
|
219
|
+
|
|
220
|
+
var WideWidth = function WideWidth() {
|
|
221
|
+
return /*#__PURE__*/_react.default.createElement(_Page.default, {
|
|
222
|
+
title: "Wide Page",
|
|
223
|
+
description: "This page uses the wide width configuration for more content.",
|
|
224
|
+
type: "wide"
|
|
225
|
+
}, /*#__PURE__*/_react.default.createElement(SampleContent, null));
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
exports.WideWidth = WideWidth;
|
|
229
|
+
|
|
230
|
+
var UnboundedWidth = function UnboundedWidth() {
|
|
231
|
+
return /*#__PURE__*/_react.default.createElement(_Page.default, {
|
|
232
|
+
title: "Unbounded Page",
|
|
233
|
+
description: "This page uses the unbounded width configuration for full-width content.",
|
|
234
|
+
type: "unbounded"
|
|
235
|
+
}, /*#__PURE__*/_react.default.createElement(SampleContent, null));
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
exports.UnboundedWidth = UnboundedWidth;
|
|
239
|
+
|
|
240
|
+
var ComplexExample = function ComplexExample() {
|
|
241
|
+
return /*#__PURE__*/_react.default.createElement(_Page.default, {
|
|
242
|
+
title: "Complex Page Example",
|
|
243
|
+
parentPageLabel: "Advanced Features",
|
|
244
|
+
description: "This example shows multiple features working together including beta label, documentation, controls, and sidebar.",
|
|
245
|
+
beta: true,
|
|
246
|
+
documentationLabel: "Learn More",
|
|
247
|
+
documentationHref: "https://developers.cloudflare.com",
|
|
248
|
+
control: /*#__PURE__*/_react.default.createElement(SampleControl, null),
|
|
249
|
+
sidebar: /*#__PURE__*/_react.default.createElement(SampleSidebar, null),
|
|
250
|
+
sidebarPosition: "inside",
|
|
251
|
+
navigation: /*#__PURE__*/_react.default.createElement(SampleNavigation, null)
|
|
252
|
+
}, /*#__PURE__*/_react.default.createElement(SampleContent, null));
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
exports.ComplexExample = ComplexExample;
|
|
256
|
+
|
|
257
|
+
var MinimalExample = function MinimalExample() {
|
|
258
|
+
return /*#__PURE__*/_react.default.createElement(_Page.default, {
|
|
259
|
+
title: "Minimal Page"
|
|
260
|
+
}, /*#__PURE__*/_react.default.createElement(_elements.P, null, "This is a minimal page with just a title and simple content."));
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
exports.MinimalExample = MinimalExample;
|
|
264
|
+
|
|
265
|
+
var NoTitle = function NoTitle() {
|
|
266
|
+
return /*#__PURE__*/_react.default.createElement(_Page.default, {
|
|
267
|
+
description: "A page without a title, showing just the description."
|
|
268
|
+
}, /*#__PURE__*/_react.default.createElement(SampleContent, null));
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
exports.NoTitle = NoTitle;
|
|
272
|
+
|
|
273
|
+
var LongContent = function LongContent() {
|
|
274
|
+
return /*#__PURE__*/_react.default.createElement(_Page.default, {
|
|
275
|
+
title: "Long Content Example",
|
|
276
|
+
description: "This page demonstrates how the component handles longer content."
|
|
277
|
+
}, /*#__PURE__*/_react.default.createElement(_elements.Div, null, Array.from({
|
|
278
|
+
length: 10
|
|
279
|
+
}, function (_, i) {
|
|
280
|
+
return /*#__PURE__*/_react.default.createElement(_componentCard.Card, {
|
|
281
|
+
key: i
|
|
282
|
+
}, /*#__PURE__*/_react.default.createElement(_elements.Div, {
|
|
283
|
+
p: 4,
|
|
284
|
+
mb: 4
|
|
285
|
+
}, /*#__PURE__*/_react.default.createElement(_elements.P, {
|
|
286
|
+
mb: 2,
|
|
287
|
+
fontWeight: "bold"
|
|
288
|
+
}, "Section ", i + 1), /*#__PURE__*/_react.default.createElement(_elements.P, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.")));
|
|
289
|
+
})));
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
exports.LongContent = LongContent;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/component-page",
|
|
3
3
|
"description": "Cloudflare Page Component",
|
|
4
|
-
"version": "10.
|
|
4
|
+
"version": "10.1.1",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
7
7
|
"author": "James Kyle <jkyle@cloudflare.com>",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@cloudflare/component-label": "^6.0.3",
|
|
17
|
-
"@cloudflare/component-link": "^9.0.
|
|
17
|
+
"@cloudflare/component-link": "^9.0.17",
|
|
18
18
|
"@cloudflare/elements": "^4.0.3",
|
|
19
19
|
"@cloudflare/intl-react": "^1.9.80"
|
|
20
20
|
},
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentMeta } from '@storybook/react';
|
|
3
|
+
import { BrowserRouter } from 'react-router-dom';
|
|
4
|
+
import { Button } from '@cloudflare/component-button';
|
|
5
|
+
import { Card } from '@cloudflare/component-card';
|
|
6
|
+
import { Div, P } from '@cloudflare/elements';
|
|
7
|
+
import Page from './Page';
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: 'Dash/Core/Page',
|
|
11
|
+
component: Page,
|
|
12
|
+
decorators: [
|
|
13
|
+
(Story: any) => (
|
|
14
|
+
<BrowserRouter>
|
|
15
|
+
<Story />
|
|
16
|
+
</BrowserRouter>
|
|
17
|
+
)
|
|
18
|
+
],
|
|
19
|
+
parameters: {
|
|
20
|
+
layout: 'fullscreen',
|
|
21
|
+
docs: {
|
|
22
|
+
description: {
|
|
23
|
+
component:
|
|
24
|
+
'A flexible page layout component with header, optional sidebar, and content area. Supports different width configurations and responsive behavior.'
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
} as ComponentMeta<typeof Page>;
|
|
29
|
+
|
|
30
|
+
// Sample content components for stories
|
|
31
|
+
const SampleContent = () => (
|
|
32
|
+
<Div>
|
|
33
|
+
<P mb={4}>
|
|
34
|
+
This is sample page content. The Page component provides a consistent
|
|
35
|
+
layout structure with header, optional sidebar, and main content area.
|
|
36
|
+
</P>
|
|
37
|
+
<Card>
|
|
38
|
+
<Div p={4} mb={4}>
|
|
39
|
+
<P mb={2} fontWeight="bold">
|
|
40
|
+
Sample Card Content
|
|
41
|
+
</P>
|
|
42
|
+
<P>
|
|
43
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do
|
|
44
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
45
|
+
</P>
|
|
46
|
+
</Div>
|
|
47
|
+
</Card>
|
|
48
|
+
<Card>
|
|
49
|
+
<Div p={4}>
|
|
50
|
+
<P mb={2} fontWeight="bold">
|
|
51
|
+
Another Card
|
|
52
|
+
</P>
|
|
53
|
+
<P>
|
|
54
|
+
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
|
|
55
|
+
nisi ut aliquip ex ea commodo consequat.
|
|
56
|
+
</P>
|
|
57
|
+
</Div>
|
|
58
|
+
</Card>
|
|
59
|
+
</Div>
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
const SampleSidebar = () => (
|
|
63
|
+
<Card>
|
|
64
|
+
<Div p={4}>
|
|
65
|
+
<P mb={3} fontWeight="bold">
|
|
66
|
+
Sidebar Content
|
|
67
|
+
</P>
|
|
68
|
+
<P mb={2}>Quick Actions:</P>
|
|
69
|
+
<Div mb={2}>
|
|
70
|
+
<Button type="primary" width="100%">
|
|
71
|
+
Primary Action
|
|
72
|
+
</Button>
|
|
73
|
+
</Div>
|
|
74
|
+
<Div mb={2}>
|
|
75
|
+
<Button type="default" width="100%">
|
|
76
|
+
Secondary Action
|
|
77
|
+
</Button>
|
|
78
|
+
</Div>
|
|
79
|
+
<P mt={3} fontSize={1} color="gray.3">
|
|
80
|
+
Additional sidebar information and links can go here.
|
|
81
|
+
</P>
|
|
82
|
+
</Div>
|
|
83
|
+
</Card>
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
const SampleControl = () => (
|
|
87
|
+
<Div display="flex" alignItems="center">
|
|
88
|
+
<Button type="primary" mr={2}>
|
|
89
|
+
Create New
|
|
90
|
+
</Button>
|
|
91
|
+
<Button type="default">Settings</Button>
|
|
92
|
+
</Div>
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
const SampleNavigation = () => (
|
|
96
|
+
<Button
|
|
97
|
+
type="plain"
|
|
98
|
+
iconType="backward"
|
|
99
|
+
onClick={() => console.log('Navigate back')}
|
|
100
|
+
>
|
|
101
|
+
Back to Dashboard
|
|
102
|
+
</Button>
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
export const Default = () => (
|
|
106
|
+
<Page
|
|
107
|
+
title="Page Title"
|
|
108
|
+
description="This is a description of what this page is about and what users can expect to find here."
|
|
109
|
+
>
|
|
110
|
+
<SampleContent />
|
|
111
|
+
</Page>
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
export const WithParentLabel = () => (
|
|
115
|
+
<Page
|
|
116
|
+
title="Settings"
|
|
117
|
+
parentPageLabel="Account Management"
|
|
118
|
+
description="Configure your account settings and preferences."
|
|
119
|
+
>
|
|
120
|
+
<SampleContent />
|
|
121
|
+
</Page>
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
export const WithBeta = () => (
|
|
125
|
+
<Page
|
|
126
|
+
title="New Feature"
|
|
127
|
+
description="This is a beta feature that is still in development."
|
|
128
|
+
beta={true}
|
|
129
|
+
>
|
|
130
|
+
<SampleContent />
|
|
131
|
+
</Page>
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
export const WithDocumentation = () => (
|
|
135
|
+
<Page
|
|
136
|
+
title="API Documentation"
|
|
137
|
+
description="Learn how to integrate with our API endpoints."
|
|
138
|
+
documentationLabel="View API Docs"
|
|
139
|
+
documentationHref="https://developers.cloudflare.com"
|
|
140
|
+
>
|
|
141
|
+
<SampleContent />
|
|
142
|
+
</Page>
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
export const WithDocumentationButton = () => (
|
|
146
|
+
<Page
|
|
147
|
+
title="Advanced Configuration"
|
|
148
|
+
description="Configure advanced settings for your application."
|
|
149
|
+
documentationLabel="Help"
|
|
150
|
+
documentationAsButton={true}
|
|
151
|
+
onDocumentationButtonClick={() =>
|
|
152
|
+
console.log('Documentation button clicked')
|
|
153
|
+
}
|
|
154
|
+
>
|
|
155
|
+
<SampleContent />
|
|
156
|
+
</Page>
|
|
157
|
+
);
|
|
158
|
+
|
|
159
|
+
export const WithSidebarInside = () => (
|
|
160
|
+
<Page
|
|
161
|
+
title="Dashboard"
|
|
162
|
+
description="Overview of your account activity and quick actions."
|
|
163
|
+
sidebar={<SampleSidebar />}
|
|
164
|
+
sidebarPosition="inside"
|
|
165
|
+
>
|
|
166
|
+
<SampleContent />
|
|
167
|
+
</Page>
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
export const WithSidebarOutside = () => (
|
|
171
|
+
<Page
|
|
172
|
+
title="Analytics"
|
|
173
|
+
description="View detailed analytics and performance metrics."
|
|
174
|
+
sidebar={<SampleSidebar />}
|
|
175
|
+
sidebarPosition="outside"
|
|
176
|
+
>
|
|
177
|
+
<SampleContent />
|
|
178
|
+
</Page>
|
|
179
|
+
);
|
|
180
|
+
|
|
181
|
+
export const WithControl = () => (
|
|
182
|
+
<Page
|
|
183
|
+
title="User Management"
|
|
184
|
+
description="Manage users and their permissions."
|
|
185
|
+
control={<SampleControl />}
|
|
186
|
+
>
|
|
187
|
+
<SampleContent />
|
|
188
|
+
</Page>
|
|
189
|
+
);
|
|
190
|
+
|
|
191
|
+
export const WithNavigation = () => (
|
|
192
|
+
<Page
|
|
193
|
+
title="Project Details"
|
|
194
|
+
description="View and edit project configuration."
|
|
195
|
+
navigation={<SampleNavigation />}
|
|
196
|
+
>
|
|
197
|
+
<SampleContent />
|
|
198
|
+
</Page>
|
|
199
|
+
);
|
|
200
|
+
|
|
201
|
+
export const CenteredHeader = () => (
|
|
202
|
+
<Page
|
|
203
|
+
title="Welcome"
|
|
204
|
+
description="Welcome to your dashboard. Get started by exploring the features below."
|
|
205
|
+
centerHeader={true}
|
|
206
|
+
>
|
|
207
|
+
<SampleContent />
|
|
208
|
+
</Page>
|
|
209
|
+
);
|
|
210
|
+
|
|
211
|
+
export const NarrowWidth = () => (
|
|
212
|
+
<Page
|
|
213
|
+
title="Narrow Page"
|
|
214
|
+
description="This page uses the narrow width configuration for focused content."
|
|
215
|
+
type="narrow"
|
|
216
|
+
>
|
|
217
|
+
<SampleContent />
|
|
218
|
+
</Page>
|
|
219
|
+
);
|
|
220
|
+
|
|
221
|
+
export const WideWidth = () => (
|
|
222
|
+
<Page
|
|
223
|
+
title="Wide Page"
|
|
224
|
+
description="This page uses the wide width configuration for more content."
|
|
225
|
+
type="wide"
|
|
226
|
+
>
|
|
227
|
+
<SampleContent />
|
|
228
|
+
</Page>
|
|
229
|
+
);
|
|
230
|
+
|
|
231
|
+
export const UnboundedWidth = () => (
|
|
232
|
+
<Page
|
|
233
|
+
title="Unbounded Page"
|
|
234
|
+
description="This page uses the unbounded width configuration for full-width content."
|
|
235
|
+
type="unbounded"
|
|
236
|
+
>
|
|
237
|
+
<SampleContent />
|
|
238
|
+
</Page>
|
|
239
|
+
);
|
|
240
|
+
|
|
241
|
+
export const ComplexExample = () => (
|
|
242
|
+
<Page
|
|
243
|
+
title="Complex Page Example"
|
|
244
|
+
parentPageLabel="Advanced Features"
|
|
245
|
+
description="This example shows multiple features working together including beta label, documentation, controls, and sidebar."
|
|
246
|
+
beta={true}
|
|
247
|
+
documentationLabel="Learn More"
|
|
248
|
+
documentationHref="https://developers.cloudflare.com"
|
|
249
|
+
control={<SampleControl />}
|
|
250
|
+
sidebar={<SampleSidebar />}
|
|
251
|
+
sidebarPosition="inside"
|
|
252
|
+
navigation={<SampleNavigation />}
|
|
253
|
+
>
|
|
254
|
+
<SampleContent />
|
|
255
|
+
</Page>
|
|
256
|
+
);
|
|
257
|
+
|
|
258
|
+
export const MinimalExample = () => (
|
|
259
|
+
<Page title="Minimal Page">
|
|
260
|
+
<P>This is a minimal page with just a title and simple content.</P>
|
|
261
|
+
</Page>
|
|
262
|
+
);
|
|
263
|
+
|
|
264
|
+
export const NoTitle = () => (
|
|
265
|
+
<Page description="A page without a title, showing just the description.">
|
|
266
|
+
<SampleContent />
|
|
267
|
+
</Page>
|
|
268
|
+
);
|
|
269
|
+
|
|
270
|
+
export const LongContent = () => (
|
|
271
|
+
<Page
|
|
272
|
+
title="Long Content Example"
|
|
273
|
+
description="This page demonstrates how the component handles longer content."
|
|
274
|
+
>
|
|
275
|
+
<Div>
|
|
276
|
+
{Array.from({ length: 10 }, (_, i) => (
|
|
277
|
+
<Card key={i}>
|
|
278
|
+
<Div p={4} mb={4}>
|
|
279
|
+
<P mb={2} fontWeight="bold">
|
|
280
|
+
Section {i + 1}
|
|
281
|
+
</P>
|
|
282
|
+
<P>
|
|
283
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do
|
|
284
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
|
|
285
|
+
enim ad minim veniam, quis nostrud exercitation ullamco laboris
|
|
286
|
+
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
|
|
287
|
+
reprehenderit in voluptate velit esse cillum dolore eu fugiat
|
|
288
|
+
nulla pariatur.
|
|
289
|
+
</P>
|
|
290
|
+
</Div>
|
|
291
|
+
</Card>
|
|
292
|
+
))}
|
|
293
|
+
</Div>
|
|
294
|
+
</Page>
|
|
295
|
+
);
|
package/src/Page.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
2
|
import { useHistory } from 'react-router-dom';
|
|
3
3
|
import { createStyledComponent } from '@cloudflare/style-container';
|
|
4
|
-
import { Main, Header, Div, P } from '@cloudflare/elements';
|
|
4
|
+
import { Main, Header, Div, P, Span } from '@cloudflare/elements';
|
|
5
5
|
import { Label } from '@cloudflare/component-label';
|
|
6
6
|
import { Trans } from '@cloudflare/intl-react';
|
|
7
7
|
import { Heading, Section } from './Heading';
|
|
@@ -125,6 +125,8 @@ const PageHeader = ({
|
|
|
125
125
|
_={'Open documentation'}
|
|
126
126
|
/>
|
|
127
127
|
}
|
|
128
|
+
Component={Span}
|
|
129
|
+
buttonProps={{ width: 'fit-content' }}
|
|
128
130
|
>
|
|
129
131
|
<Button
|
|
130
132
|
type="primary"
|