@stackflow/plugin-basic-ui 1.16.1 → 1.18.0

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.
@@ -33,6 +33,12 @@ export type AppBarProps = Partial<
33
33
  | "backgroundColorTransitionDuration"
34
34
  | "backgroundImage"
35
35
  | "backgroundImageTransitionDuration"
36
+ | "minHeight"
37
+ | "fontSize"
38
+ | "lineHeight"
39
+ | "hitSlop"
40
+ | "containerPadding"
41
+ | "itemGap"
36
42
  >
37
43
  > & {
38
44
  title?: React.ReactNode;
@@ -93,6 +99,12 @@ const AppBar = forwardRef<HTMLDivElement, AppBarProps>(
93
99
  onTopClick,
94
100
  enterStyle,
95
101
  className,
102
+ minHeight,
103
+ fontSize,
104
+ lineHeight,
105
+ hitSlop,
106
+ containerPadding,
107
+ itemGap,
96
108
  },
97
109
  ref,
98
110
  ) => {
@@ -323,6 +335,12 @@ const AppBar = forwardRef<HTMLDivElement, AppBarProps>(
323
335
  [globalVars.appBar.backgroundImageTransitionDuration]:
324
336
  backgroundImageTransitionDuration,
325
337
  [appScreenCss.vars.appBar.center.mainWidth]: `${maxWidth}px`,
338
+ [globalVars.appBar.minHeight]: minHeight,
339
+ [globalVars.appBar.containerPadding]: containerPadding,
340
+ [globalVars.appBar.fontSize]: fontSize,
341
+ [globalVars.appBar.hitSlop]: hitSlop,
342
+ [globalVars.appBar.lineHeight]: lineHeight,
343
+ [globalVars.appBar.itemGap]: itemGap,
326
344
  }),
327
345
  )}
328
346
  data-part="appBar"
@@ -49,6 +49,33 @@ export const appScreen = recipe({
49
49
  "exit-active": exitActive,
50
50
  "exit-done": exitDone,
51
51
  },
52
+ hasAppBar: {
53
+ true: {
54
+ vars: {
55
+ [vars.appBar.topMargin]: globalVars.appBar.height,
56
+ },
57
+ /**
58
+ * When `max()` and `env()` (or `constant()`) supported
59
+ *
60
+ * - https://caniuse.com/css-env-function
61
+ * - https://caniuse.com/css-math-functions
62
+ */
63
+ "@supports": {
64
+ "(padding: max(0px)) and (padding: constant(safe-area-inset-top))": {
65
+ vars: {
66
+ [vars.appBar.topMargin]:
67
+ `calc(${globalVars.appBar.height} + max(${globalVars.appBar.minSafeAreaInsetTop}, constant(safe-area-inset-top)))`,
68
+ },
69
+ },
70
+ "(padding: max(0px)) and (padding: env(safe-area-inset-top))": {
71
+ vars: {
72
+ [vars.appBar.topMargin]:
73
+ `calc(${globalVars.appBar.height} + max(${globalVars.appBar.minSafeAreaInsetTop}, env(safe-area-inset-top)))`,
74
+ },
75
+ },
76
+ },
77
+ },
78
+ },
52
79
  },
53
80
  });
54
81
 
@@ -59,9 +86,9 @@ export const dim = style([
59
86
  {
60
87
  opacity: 0,
61
88
  zIndex: vars.zIndexes.dim,
89
+ height: globalVars.dimHeight,
62
90
  selectors: {
63
91
  [`${android} &`]: {
64
- height: "10rem",
65
92
  background: `linear-gradient(${globalVars.dimBackgroundColor}, rgba(0, 0, 0, 0))`,
66
93
  },
67
94
  [`
@@ -89,7 +116,7 @@ export const paper = recipe({
89
116
  zIndex: vars.zIndexes.paper,
90
117
  selectors: {
91
118
  [`${cupertino} &`]: {
92
- transform: "translate3d(100%, 0, 0)",
119
+ transform: `translate3d(${globalVars.defaultTransitionOffSet}, 0, 0)`,
93
120
  },
94
121
  [`
95
122
  ${cupertino} ${enterActive} &,
@@ -99,7 +126,7 @@ export const paper = recipe({
99
126
  },
100
127
  [`${android} &`]: {
101
128
  opacity: 0,
102
- transform: "translate3d(0, 10rem, 0)",
129
+ transform: `translate3d(0, ${globalVars.defaultTransitionOffSet}, 0)`,
103
130
  },
104
131
  [`
105
132
  ${android} ${enterActive} &,
@@ -118,30 +145,6 @@ export const paper = recipe({
118
145
  {
119
146
  transition: `transform ${vars.transitionDuration}, opacity ${vars.transitionDuration}, margin-top ${globalVars.appBar.heightTransitionDuration}`,
120
147
  paddingTop: vars.appBar.topMargin,
121
- vars: {
122
- [vars.appBar.topMargin]: globalVars.appBar.height,
123
- },
124
- /**
125
- * When `max()` and `env()` (or `constant()`) supported
126
- *
127
- * - https://caniuse.com/css-env-function
128
- * - https://caniuse.com/css-math-functions
129
- */
130
- "@supports": {
131
- "(padding: max(0px)) and (padding: constant(safe-area-inset-top))":
132
- {
133
- vars: {
134
- [vars.appBar.topMargin]:
135
- `calc(${globalVars.appBar.height} + max(${globalVars.appBar.minSafeAreaInsetTop}, constant(safe-area-inset-top)))`,
136
- },
137
- },
138
- "(padding: max(0px)) and (padding: env(safe-area-inset-top))": {
139
- vars: {
140
- [vars.appBar.topMargin]:
141
- `calc(${globalVars.appBar.height} + max(${globalVars.appBar.minSafeAreaInsetTop}, env(safe-area-inset-top)))`,
142
- },
143
- },
144
- },
145
148
  },
146
149
  ],
147
150
  },
@@ -195,15 +198,15 @@ export const edge = recipe({
195
198
  f.left0,
196
199
  f.fullHeight,
197
200
  {
198
- width: "1.25rem",
201
+ width: globalVars.edge.width,
199
202
  zIndex: vars.zIndexes.edge,
200
203
  },
201
204
  ],
202
205
  variants: {
203
206
  hasAppBar: {
204
207
  true: {
205
- top: globalVars.appBar.height,
206
- height: `calc(100% - ${globalVars.appBar.height})`,
208
+ top: vars.appBar.topMargin,
209
+ height: `calc(100% - ${vars.appBar.topMargin})`,
207
210
  },
208
211
  },
209
212
  },
@@ -237,6 +237,7 @@ const AppScreen: React.FC<AppScreenProps> = ({
237
237
  ref={appScreenRef}
238
238
  className={clsx(
239
239
  css.appScreen({
240
+ hasAppBar,
240
241
  transitionState:
241
242
  transitionState === "enter-done" ||
242
243
  transitionState === "exit-done"