@draftbit/core 46.7.8-9c448b.2 → 46.7.9-28aa70.2

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.
@@ -57,7 +57,6 @@ const Picker = _ref => {
57
57
  placeholder,
58
58
  value,
59
59
  disabled = false,
60
- theme,
61
60
  assistiveText,
62
61
  label,
63
62
  iconColor = unstyledColor,
@@ -95,9 +94,6 @@ const Picker = _ref => {
95
94
  value: placeholder,
96
95
  label: placeholder
97
96
  }, ...normalizedOptions] : normalizedOptions;
98
- const {
99
- colors
100
- } = theme;
101
97
  const {
102
98
  viewStyles,
103
99
  textStyles
@@ -220,12 +216,10 @@ const Picker = _ref => {
220
216
  style: styles.primaryTextContainer
221
217
  }, labelText, /*#__PURE__*/React.createElement(_reactNative.Text, {
222
218
  style: primaryTextStyle
223
- }, String(selectedLabel !== null && selectedLabel !== void 0 ? selectedLabel : placeholder))), rightIcon)), assistiveTextLabel), isIos && pickerVisible ? /*#__PURE__*/React.createElement(_Portal.default, null, /*#__PURE__*/React.createElement(_reactNative.View, {
224
- style: [styles.iosPicker, {
225
- backgroundColor: colors.divider
226
- }]
227
- }, /*#__PURE__*/React.createElement(_reactNativeSafeAreaContext.SafeAreaView, {
228
- style: styles.iosSafeArea
219
+ }, String(selectedLabel !== null && selectedLabel !== void 0 ? selectedLabel : placeholder))), rightIcon)), assistiveTextLabel), isIos && pickerVisible ? /*#__PURE__*/React.createElement(_Portal.default, null, /*#__PURE__*/React.createElement(_reactNativeSafeAreaContext.SafeAreaView, {
220
+ style: styles.iosPicker
221
+ }, /*#__PURE__*/React.createElement(_reactNative.View, {
222
+ style: styles.iosPickerContent
229
223
  }, /*#__PURE__*/React.createElement(_DeprecatedButton.default, {
230
224
  Icon: Icon,
231
225
  type: "text",
@@ -297,10 +291,10 @@ const styles = _reactNative.StyleSheet.create({
297
291
  justifyContent: "center",
298
292
  width: "100%",
299
293
  maxWidth: deviceWidth,
300
- maxHeight: deviceHeight
294
+ maxHeight: deviceHeight,
295
+ backgroundColor: "white"
301
296
  },
302
- iosSafeArea: {
303
- backgroundColor: "white",
297
+ iosPickerContent: {
304
298
  flexDirection: "column",
305
299
  width: "100%",
306
300
  maxWidth: deviceWidth
@@ -48,7 +48,6 @@ const Picker = _ref => {
48
48
  placeholder,
49
49
  value,
50
50
  disabled = false,
51
- theme,
52
51
  assistiveText,
53
52
  label,
54
53
  iconColor = unstyledColor,
@@ -86,9 +85,6 @@ const Picker = _ref => {
86
85
  value: placeholder,
87
86
  label: placeholder
88
87
  }, ...normalizedOptions] : normalizedOptions;
89
- const {
90
- colors
91
- } = theme;
92
88
  const {
93
89
  viewStyles,
94
90
  textStyles
@@ -211,12 +207,10 @@ const Picker = _ref => {
211
207
  style: styles.primaryTextContainer
212
208
  }, labelText, /*#__PURE__*/React.createElement(Text, {
213
209
  style: primaryTextStyle
214
- }, String(selectedLabel !== null && selectedLabel !== void 0 ? selectedLabel : placeholder))), rightIcon)), assistiveTextLabel), isIos && pickerVisible ? /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(View, {
215
- style: [styles.iosPicker, {
216
- backgroundColor: colors.divider
217
- }]
218
- }, /*#__PURE__*/React.createElement(SafeAreaView, {
219
- style: styles.iosSafeArea
210
+ }, String(selectedLabel !== null && selectedLabel !== void 0 ? selectedLabel : placeholder))), rightIcon)), assistiveTextLabel), isIos && pickerVisible ? /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(SafeAreaView, {
211
+ style: styles.iosPicker
212
+ }, /*#__PURE__*/React.createElement(View, {
213
+ style: styles.iosPickerContent
220
214
  }, /*#__PURE__*/React.createElement(Button, {
221
215
  Icon: Icon,
222
216
  type: "text",
@@ -288,10 +282,10 @@ const styles = StyleSheet.create({
288
282
  justifyContent: "center",
289
283
  width: "100%",
290
284
  maxWidth: deviceWidth,
291
- maxHeight: deviceHeight
285
+ maxHeight: deviceHeight,
286
+ backgroundColor: "white"
292
287
  },
293
- iosSafeArea: {
294
- backgroundColor: "white",
288
+ iosPickerContent: {
295
289
  flexDirection: "column",
296
290
  width: "100%",
297
291
  maxWidth: deviceWidth
@@ -1,6 +1,3 @@
1
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
1
  // @ts-nocheck
5
2
  import React, { Component } from "react";
6
3
  import { View, Text, StyleSheet, Animated, TouchableWithoutFeedback } from "react-native";
@@ -12,7 +9,7 @@ const STEP_STATUS = {
12
9
  export default class StepIndicator extends Component {
13
10
  constructor(props) {
14
11
  super(props);
15
- _defineProperty(this, "renderProgressBarBackground", () => {
12
+ this.renderProgressBarBackground = () => {
16
13
  const {
17
14
  stepCount,
18
15
  direction
@@ -55,8 +52,8 @@ export default class StepIndicator extends Component {
55
52
  },
56
53
  style: progressBarBackgroundStyle
57
54
  });
58
- });
59
- _defineProperty(this, "renderProgressBar", () => {
55
+ };
56
+ this.renderProgressBar = () => {
60
57
  const {
61
58
  stepCount,
62
59
  direction
@@ -86,8 +83,8 @@ export default class StepIndicator extends Component {
86
83
  return /*#__PURE__*/React.createElement(Animated.View, {
87
84
  style: progressBarStyle
88
85
  });
89
- });
90
- _defineProperty(this, "renderStepIndicator", () => {
86
+ };
87
+ this.renderStepIndicator = () => {
91
88
  let steps = [];
92
89
  const {
93
90
  stepCount,
@@ -118,8 +115,8 @@ export default class StepIndicator extends Component {
118
115
  height: this.state.customStyles.currentStepIndicatorSize
119
116
  }]
120
117
  }, steps);
121
- });
122
- _defineProperty(this, "renderStepLabels", () => {
118
+ };
119
+ this.renderStepLabels = () => {
123
120
  const {
124
121
  labels,
125
122
  direction,
@@ -161,8 +158,8 @@ export default class StepIndicator extends Component {
161
158
  alignItems: this.state.customStyles.labelAlign
162
159
  }]
163
160
  }, labelViews);
164
- });
165
- _defineProperty(this, "renderStep", position => {
161
+ };
162
+ this.renderStep = position => {
166
163
  const {
167
164
  renderStepIndicator
168
165
  } = this.props;
@@ -229,8 +226,8 @@ export default class StepIndicator extends Component {
229
226
  }) : /*#__PURE__*/React.createElement(Text, {
230
227
  style: indicatorLabelStyle
231
228
  }, "".concat(position + 1)));
232
- });
233
- _defineProperty(this, "getStepStatus", stepPosition => {
229
+ };
230
+ this.getStepStatus = stepPosition => {
234
231
  const {
235
232
  currentPosition
236
233
  } = this.props;
@@ -241,8 +238,8 @@ export default class StepIndicator extends Component {
241
238
  } else {
242
239
  return STEP_STATUS.UNFINISHED;
243
240
  }
244
- });
245
- _defineProperty(this, "onCurrentPositionChanged", position => {
241
+ };
242
+ this.onCurrentPositionChanged = position => {
246
243
  let {
247
244
  stepCount
248
245
  } = this.props;
@@ -262,7 +259,7 @@ export default class StepIndicator extends Component {
262
259
  toValue: this.state.customStyles.currentStepIndicatorSize / 2,
263
260
  duration: 100
264
261
  })])]).start();
265
- });
262
+ };
266
263
  const defaultStyles = {
267
264
  stepIndicatorSize: 30,
268
265
  currentStepIndicatorSize: 40,
@@ -328,7 +325,6 @@ export default class StepIndicator extends Component {
328
325
  // ),
329
326
  // }));
330
327
  // }
331
-
332
328
  if (prevProps.currentPosition !== this.props.currentPosition) {
333
329
  this.onCurrentPositionChanged(this.props.currentPosition);
334
330
  }
@@ -369,6 +365,50 @@ const styles = StyleSheet.create({
369
365
  justifyContent: "center"
370
366
  }
371
367
  });
368
+ StepIndicator.defaultProps = {
369
+ currentPosition: 0,
370
+ stepCount: 5,
371
+ customStyles: {},
372
+ direction: "horizontal"
373
+ };rrentPositionChanged(this.props.currentPosition);
374
+ }
375
+ }
376
+ }
377
+ const styles = StyleSheet.create({
378
+ container: {
379
+ backgroundColor: "transparent"
380
+ },
381
+ stepIndicatorContainer: {
382
+ flexDirection: "row",
383
+ alignItems: "center",
384
+ justifyContent: "space-around",
385
+ backgroundColor: "transparent"
386
+ },
387
+ stepLabelsContainer: {
388
+ justifyContent: "space-around"
389
+ },
390
+ step: {
391
+ alignItems: "center",
392
+ justifyContent: "center",
393
+ zIndex: 2
394
+ },
395
+ stepContainer: {
396
+ flex: 1,
397
+ flexDirection: "row",
398
+ alignItems: "center",
399
+ justifyContent: "center"
400
+ },
401
+ stepLabel: {
402
+ fontSize: 12,
403
+ textAlign: "center",
404
+ fontWeight: "500"
405
+ },
406
+ stepLabelItem: {
407
+ flex: 1,
408
+ alignItems: "center",
409
+ justifyContent: "center"
410
+ }
411
+ });
372
412
  StepIndicator.defaultProps = {
373
413
  currentPosition: 0,
374
414
  stepCount: 5,
@@ -1 +1 @@
1
- {"version":3,"file":"Picker.d.ts","sourceRoot":"","sources":["../../../../../src/components/Picker/Picker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAKL,SAAS,EACT,SAAS,EAEV,MAAM,cAAc,CAAC;AAStB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAQtD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,oBAAY,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,GAAG;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,KAAK,CAAC,EA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;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,YAAY,EAAE,GAAG,MAAM,EAAE,CAAC;IACnC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CACxB,CAAC;;;;AAiaF,wBAAiC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.7.8-9c448b.2+9c448bf",
3
+ "version": "46.7.9-28aa70.2+28aa703",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -41,7 +41,7 @@
41
41
  "dependencies": {
42
42
  "@date-io/date-fns": "^1.3.13",
43
43
  "@draftbit/react-theme-provider": "^2.1.1",
44
- "@draftbit/types": "^46.7.8-9c448b.2+9c448bf",
44
+ "@draftbit/types": "^46.7.9-28aa70.2+28aa703",
45
45
  "@material-ui/core": "^4.11.0",
46
46
  "@material-ui/pickers": "^3.2.10",
47
47
  "@react-native-community/slider": "4.2.3",
@@ -92,5 +92,5 @@
92
92
  ]
93
93
  ]
94
94
  },
95
- "gitHead": "9c448bf73613d11fc61192e808a40f0ad86fa502"
95
+ "gitHead": "28aa70352ea13ca8e0c808bd54f2aa682dae0082"
96
96
  }
@@ -35,7 +35,7 @@ const isIos = Platform.OS === "ios";
35
35
  const unstyledColor = "rgba(165, 173, 183, 1)";
36
36
  const disabledColor = "rgb(240, 240, 240)";
37
37
  const errorColor = "rgba(255, 69, 100, 1)";
38
- const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style, placeholder, value, disabled = false, theme, assistiveText, label, iconColor = unstyledColor, iconSize = 24, leftIconMode = "inset", leftIconName, placeholderTextColor = unstyledColor, rightIconName, type = "solid", }) => {
38
+ const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style, placeholder, value, disabled = false, assistiveText, label, iconColor = unstyledColor, iconSize = 24, leftIconMode = "inset", leftIconName, placeholderTextColor = unstyledColor, rightIconName, type = "solid", }) => {
39
39
  var _a, _b;
40
40
  const androidPickerRef = React.useRef(undefined);
41
41
  const [internalValue, setInternalValue] = React.useState(value || defaultValue);
@@ -63,7 +63,6 @@ const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style,
63
63
  const pickerOptions = placeholder
64
64
  ? [{ value: placeholder, label: placeholder }, ...normalizedOptions]
65
65
  : normalizedOptions;
66
- const { colors } = theme;
67
66
  const { viewStyles, textStyles } = extractStyles(style);
68
67
  const additionalBorderStyles = ["backgroundColor"];
69
68
  const additionalMarginStyles = [
@@ -183,13 +182,8 @@ const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style,
183
182
  rightIcon)),
184
183
  assistiveTextLabel),
185
184
  isIos && pickerVisible ? (React.createElement(Portal, null,
186
- React.createElement(View, { style: [
187
- styles.iosPicker,
188
- {
189
- backgroundColor: colors.divider,
190
- },
191
- ] },
192
- React.createElement(SafeAreaView, { style: styles.iosSafeArea },
185
+ React.createElement(SafeAreaView, { style: styles.iosPicker },
186
+ React.createElement(View, { style: styles.iosPickerContent },
193
187
  React.createElement(Button, { Icon: Icon, type: "text", onPress: togglePickerVisible, style: styles.iosButton }, "Close"),
194
188
  React.createElement(NativePicker, { style: styles.iosNativePicker, selectedValue: internalValue, onValueChange: handleValueChange }, pickerOptions.map((option) => (React.createElement(NativePicker.Item, { label: option.label, value: option.value, key: option.value })))))))) : null,
195
189
  !isIos && pickerVisible ? (React.createElement(NativePicker, { enabled: pickerVisible, selectedValue: internalValue, onValueChange: handleValueChange, style: styles.nonIosPicker, ref: androidPickerRef, onBlur: () => setPickerVisible(false) }, pickerOptions.map((option) => (React.createElement(NativePicker.Item, { label: option.label, value: option.value, key: option.value }))))) : null));
@@ -239,9 +233,9 @@ const styles = StyleSheet.create({
239
233
  width: "100%",
240
234
  maxWidth: deviceWidth,
241
235
  maxHeight: deviceHeight,
242
- },
243
- iosSafeArea: {
244
236
  backgroundColor: "white",
237
+ },
238
+ iosPickerContent: {
245
239
  flexDirection: "column",
246
240
  width: "100%",
247
241
  maxWidth: deviceWidth,
@@ -98,7 +98,6 @@ const Picker: React.FC<PickerProps> = ({
98
98
  placeholder,
99
99
  value,
100
100
  disabled = false,
101
- theme,
102
101
  assistiveText,
103
102
  label,
104
103
  iconColor = unstyledColor,
@@ -145,8 +144,6 @@ const Picker: React.FC<PickerProps> = ({
145
144
  ? [{ value: placeholder, label: placeholder }, ...normalizedOptions]
146
145
  : normalizedOptions;
147
146
 
148
- const { colors } = theme;
149
-
150
147
  const { viewStyles, textStyles } = extractStyles(style);
151
148
 
152
149
  const additionalBorderStyles = ["backgroundColor"];
@@ -347,15 +344,8 @@ const Picker: React.FC<PickerProps> = ({
347
344
  {/* iosPicker */}
348
345
  {isIos && pickerVisible ? (
349
346
  <Portal>
350
- <View
351
- style={[
352
- styles.iosPicker,
353
- {
354
- backgroundColor: colors.divider,
355
- },
356
- ]}
357
- >
358
- <SafeAreaView style={styles.iosSafeArea}>
347
+ <SafeAreaView style={styles.iosPicker}>
348
+ <View style={styles.iosPickerContent}>
359
349
  <Button
360
350
  Icon={Icon}
361
351
  type="text"
@@ -378,8 +368,8 @@ const Picker: React.FC<PickerProps> = ({
378
368
  />
379
369
  ))}
380
370
  </NativePicker>
381
- </SafeAreaView>
382
- </View>
371
+ </View>
372
+ </SafeAreaView>
383
373
  </Portal>
384
374
  ) : null}
385
375
 
@@ -451,9 +441,9 @@ const styles = StyleSheet.create({
451
441
  width: "100%",
452
442
  maxWidth: deviceWidth,
453
443
  maxHeight: deviceHeight,
454
- },
455
- iosSafeArea: {
456
444
  backgroundColor: "white",
445
+ },
446
+ iosPickerContent: {
457
447
  flexDirection: "column",
458
448
  width: "100%",
459
449
  maxWidth: deviceWidth,