@draftbit/core 46.4.4-764cb2.2 → 46.4.4-79fcb6.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.
@@ -12,7 +12,6 @@ var _theming = require("../../theming");
12
12
  var _Portal = _interopRequireDefault(require("../Portal/Portal"));
13
13
  var _Touchable = _interopRequireDefault(require("../Touchable"));
14
14
  var _DatePickerComponent = _interopRequireDefault(require("./DatePickerComponent"));
15
- var _utilities = require("../../utilities");
16
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
16
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
18
17
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -43,11 +42,7 @@ const DatePicker = _ref => {
43
42
  rightIconName,
44
43
  leftIconMode = "inset",
45
44
  label,
46
- labelSize,
47
- labelColor,
48
45
  placeholder,
49
- borderColor: inputBorderColor,
50
- borderColorActive: inputBorderColorActive,
51
46
  ...props
52
47
  } = _ref;
53
48
  const [value, setValue] = React.useState(date || defaultValue);
@@ -64,9 +59,6 @@ const DatePicker = _ref => {
64
59
  measured: false,
65
60
  width: 0
66
61
  });
67
- const {
68
- textStyles
69
- } = (0, _utilities.extractStyles)(style);
70
62
  const getValidDate = () => {
71
63
  if (!value) {
72
64
  return new Date();
@@ -156,8 +148,8 @@ const DatePicker = _ref => {
156
148
  };
157
149
  const MINIMIZED_LABEL_Y_OFFSET = -(typography.caption.lineHeight + 4);
158
150
  const OUTLINE_MINIMIZED_LABEL_Y_OFFSET = -(16 * 0.5 + 4);
159
- const MAXIMIZED_LABEL_FONT_SIZE = (textStyles === null || textStyles === void 0 ? void 0 : textStyles.fontSize) || typography.subtitle1.fontSize;
160
- const MINIMIZED_LABEL_FONT_SIZE = labelSize ? labelSize : typography.caption.fontSize;
151
+ const MAXIMIZED_LABEL_FONT_SIZE = typography.subtitle1.fontSize;
152
+ const MINIMIZED_LABEL_FONT_SIZE = typography.caption.fontSize;
161
153
  const hasActiveOutline = focused;
162
154
  let inputTextColor, activeColor, underlineColor, borderColor, placeholderColor, containerStyle, backgroundColor, inputStyle;
163
155
  inputTextColor = colors.strong;
@@ -168,9 +160,9 @@ const DatePicker = _ref => {
168
160
  underlineColor = "transparent";
169
161
  backgroundColor = colors.divider;
170
162
  } else {
171
- activeColor = inputBorderColorActive || colors.primary;
172
- placeholderColor = borderColor = inputBorderColor || colors.light;
173
- underlineColor = inputBorderColor || colors.light;
163
+ activeColor = colors.primary;
164
+ placeholderColor = borderColor = colors.light;
165
+ underlineColor = colors.light;
174
166
  backgroundColor = colors.background;
175
167
  }
176
168
  const {
@@ -225,7 +217,6 @@ const DatePicker = _ref => {
225
217
  const labelStyle = {
226
218
  ...typography.subtitle1,
227
219
  top: type === "solid" ? 16 : 0,
228
- fontFamily: textStyles === null || textStyles === void 0 ? void 0 : textStyles.fontFamily,
229
220
  left: leftIconName && leftIconMode === "inset" ? ICON_SIZE + (type === "solid" ? 16 : 12) : 0,
230
221
  transform: [{
231
222
  // Move label to top
@@ -249,7 +240,7 @@ const DatePicker = _ref => {
249
240
  };
250
241
  const inputStyles = [styles.input, inputStyle, type === "solid" ? {
251
242
  marginHorizontal: 12
252
- } : {}, textStyles];
243
+ } : {}];
253
244
 
254
245
  // const render = (props) => <NativeTextInput {...props} />;
255
246
 
@@ -298,7 +289,7 @@ const DatePicker = _ref => {
298
289
  style: [styles.placeholder, type === "solid" ? {
299
290
  paddingHorizontal: 12
300
291
  } : {}, labelStyle, {
301
- color: labelColor || colors.light,
292
+ color: colors.light,
302
293
  opacity: labeled.interpolate({
303
294
  inputRange: [0, 1],
304
295
  outputRange: [hasActiveOutline ? 1 : 0, 0]
@@ -309,7 +300,7 @@ const DatePicker = _ref => {
309
300
  style: [styles.placeholder, type === "solid" ? {
310
301
  paddingHorizontal: 12
311
302
  } : {}, labelStyle, {
312
- color: labelColor || placeholder,
303
+ color: placeholderColor,
313
304
  opacity: hasActiveOutline ? labeled : 1
314
305
  }],
315
306
  numberOfLines: 1
@@ -7,31 +7,16 @@ exports.default = void 0;
7
7
  var React = _interopRequireWildcard(require("react"));
8
8
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
9
9
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
10
+ 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; }
11
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
12
+ 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); }
10
13
  class PortalConsumer extends React.Component {
11
- async componentDidMount() {
12
- this.checkManager();
13
- // Delay updating to prevent React from going to infinite loop
14
- await Promise.resolve();
15
- this.key = this.props.manager.mount(this.props.children);
14
+ constructor() {
15
+ super(...arguments);
16
+ _defineProperty(this, "key", void 0);
16
17
  }
17
- componentDidUpdate() {
18
- this.checkManager();
19
- this.props.manager.update(this.key, this.props.children);
20
- }
21
- componentWillUnmount() {
18
+ async componentDidMount() {
22
19
  this.checkManager();
23
- this.props.manager.unmount(this.key);
24
- }
25
- checkManager() {
26
- if (!this.props.manager) {
27
- throw new Error("Looks like you forgot to wrap your root component with `Provider` component from `react-native-paper`.\n\n" + "Please read our getting-started guide and make sure you've followed all the required steps.\n\n" + "https://callstack.github.io/react-native-paper/getting-started.html");
28
- }
29
- }
30
- render() {
31
- return null;
32
- }
33
- }
34
- exports.default = PortalConsumer;s.checkManager();
35
20
 
36
21
  // Delay updating to prevent React from going to infinite loop
37
22
  await Promise.resolve();
@@ -12,4 +12,4 @@ const APPROX_STATUSBAR_HEIGHT = _reactNative.Platform.select({
12
12
  android: DEFAULT_STATUSBAR_HEIGHT_EXPO,
13
13
  ios: _reactNative.Platform.Version < 11 ? DEFAULT_STATUSBAR_HEIGHT_EXPO : 0
14
14
  });
15
- exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;AR_HEIGHT;
15
+ exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;
@@ -10,7 +10,17 @@ const SEED_DATA = {
10
10
  tag: "AudioPlayer",
11
11
  description: "Given a source URL, plays sounds & audio!",
12
12
  category: _types.COMPONENT_TYPES.media,
13
- layout: {},
13
+ stylesPanelSections: [_types.StylesPanelSections.Typography, _types.StylesPanelSections.Background, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position],
14
+ layout: {
15
+ backgroundColor: "#eee",
16
+ paddingLeft: 16,
17
+ paddingRight: 16,
18
+ paddingTop: 8,
19
+ paddingBottom: 8,
20
+ borderRadius: 24,
21
+ flexDirection: "row",
22
+ alignItems: "center"
23
+ },
14
24
  props: {
15
25
  source: {
16
26
  group: _types.GROUPS.data,
@@ -21,7 +31,27 @@ const SEED_DATA = {
21
31
  defaultValue: "https://static.draftbit.com/audio/intro-to-draftbit-audio.mp3",
22
32
  formType: _types.FORM_TYPES.sourceUrl,
23
33
  propType: _types.PROP_TYPES.OBJECT
24
- }
34
+ },
35
+ sliderColor: (0, _types.createColorProp)({
36
+ label: "Thumb Color",
37
+ defaultValue: "strong"
38
+ }),
39
+ completedTrackColor: (0, _types.createColorProp)({
40
+ label: "Completed Track Color",
41
+ defaultValue: "background"
42
+ }),
43
+ remainingTrackColor: (0, _types.createColorProp)({
44
+ label: "Remaining Track Color",
45
+ defaultValue: "light"
46
+ }),
47
+ trackThumbSize: (0, _types.createNumberProp)({
48
+ label: "Thumb Size",
49
+ defaultValue: 24
50
+ }),
51
+ playIconColor: (0, _types.createColorProp)({
52
+ label: "Play Icon Color",
53
+ defaultValue: "strong"
54
+ })
25
55
  }
26
56
  };
27
57
  exports.SEED_DATA = SEED_DATA;
@@ -16,12 +16,6 @@ const SEED_DATA_PROPS = {
16
16
  required: true,
17
17
  group: _types.GROUPS.data
18
18
  },
19
- labelSize: (0, _types.createNumberProp)({
20
- label: "Label Size"
21
- }),
22
- labelColor: (0, _types.createColorProp)({
23
- label: "Label Color"
24
- }),
25
19
  mode: {
26
20
  label: "Mode",
27
21
  description: "Choose between date, time and datetime",
@@ -33,12 +27,6 @@ const SEED_DATA_PROPS = {
33
27
  options: ["date", "time", "datetime"],
34
28
  group: _types.GROUPS.basic
35
29
  },
36
- borderColor: (0, _types.createColorProp)({
37
- label: "Border Color"
38
- }),
39
- borderColorActive: (0, _types.createColorProp)({
40
- label: "Border Color"
41
- }),
42
30
  format: {
43
31
  label: "Format",
44
32
  description: "Create an output format for the date.",
@@ -156,7 +144,6 @@ const SEED_DATA = [{
156
144
  category: _types.COMPONENT_TYPES.input,
157
145
  layout: null,
158
146
  triggers: [_types.Triggers.OnDateChange],
159
- StylesPanelSections: [_types.StylesPanelSections.Background, _types.StylesPanelSections.Borders, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Size, _types.StylesPanelSections.Typography],
160
147
  props: {
161
148
  ...SEED_DATA_PROPS,
162
149
  type: {
@@ -7,7 +7,6 @@ import { withTheme } from "../../theming";
7
7
  import Portal from "../Portal/Portal";
8
8
  import Touchable from "../Touchable";
9
9
  import DateTimePicker from "./DatePickerComponent";
10
- import { extractStyles } from "../../utilities";
11
10
  const AnimatedText = Animated.createAnimatedComponent(Text);
12
11
  const FOCUS_ANIMATION_DURATION = 150;
13
12
  const BLUR_ANIMATION_DURATION = 180;
@@ -34,11 +33,7 @@ const DatePicker = _ref => {
34
33
  rightIconName,
35
34
  leftIconMode = "inset",
36
35
  label,
37
- labelSize,
38
- labelColor,
39
36
  placeholder,
40
- borderColor: inputBorderColor,
41
- borderColorActive: inputBorderColorActive,
42
37
  ...props
43
38
  } = _ref;
44
39
  const [value, setValue] = React.useState(date || defaultValue);
@@ -55,9 +50,6 @@ const DatePicker = _ref => {
55
50
  measured: false,
56
51
  width: 0
57
52
  });
58
- const {
59
- textStyles
60
- } = extractStyles(style);
61
53
  const getValidDate = () => {
62
54
  if (!value) {
63
55
  return new Date();
@@ -147,8 +139,8 @@ const DatePicker = _ref => {
147
139
  };
148
140
  const MINIMIZED_LABEL_Y_OFFSET = -(typography.caption.lineHeight + 4);
149
141
  const OUTLINE_MINIMIZED_LABEL_Y_OFFSET = -(16 * 0.5 + 4);
150
- const MAXIMIZED_LABEL_FONT_SIZE = (textStyles === null || textStyles === void 0 ? void 0 : textStyles.fontSize) || typography.subtitle1.fontSize;
151
- const MINIMIZED_LABEL_FONT_SIZE = labelSize ? labelSize : typography.caption.fontSize;
142
+ const MAXIMIZED_LABEL_FONT_SIZE = typography.subtitle1.fontSize;
143
+ const MINIMIZED_LABEL_FONT_SIZE = typography.caption.fontSize;
152
144
  const hasActiveOutline = focused;
153
145
  let inputTextColor, activeColor, underlineColor, borderColor, placeholderColor, containerStyle, backgroundColor, inputStyle;
154
146
  inputTextColor = colors.strong;
@@ -159,9 +151,9 @@ const DatePicker = _ref => {
159
151
  underlineColor = "transparent";
160
152
  backgroundColor = colors.divider;
161
153
  } else {
162
- activeColor = inputBorderColorActive || colors.primary;
163
- placeholderColor = borderColor = inputBorderColor || colors.light;
164
- underlineColor = inputBorderColor || colors.light;
154
+ activeColor = colors.primary;
155
+ placeholderColor = borderColor = colors.light;
156
+ underlineColor = colors.light;
165
157
  backgroundColor = colors.background;
166
158
  }
167
159
  const {
@@ -216,7 +208,6 @@ const DatePicker = _ref => {
216
208
  const labelStyle = {
217
209
  ...typography.subtitle1,
218
210
  top: type === "solid" ? 16 : 0,
219
- fontFamily: textStyles === null || textStyles === void 0 ? void 0 : textStyles.fontFamily,
220
211
  left: leftIconName && leftIconMode === "inset" ? ICON_SIZE + (type === "solid" ? 16 : 12) : 0,
221
212
  transform: [{
222
213
  // Move label to top
@@ -240,7 +231,7 @@ const DatePicker = _ref => {
240
231
  };
241
232
  const inputStyles = [styles.input, inputStyle, type === "solid" ? {
242
233
  marginHorizontal: 12
243
- } : {}, textStyles];
234
+ } : {}];
244
235
 
245
236
  // const render = (props) => <NativeTextInput {...props} />;
246
237
 
@@ -289,7 +280,7 @@ const DatePicker = _ref => {
289
280
  style: [styles.placeholder, type === "solid" ? {
290
281
  paddingHorizontal: 12
291
282
  } : {}, labelStyle, {
292
- color: labelColor || colors.light,
283
+ color: colors.light,
293
284
  opacity: labeled.interpolate({
294
285
  inputRange: [0, 1],
295
286
  outputRange: [hasActiveOutline ? 1 : 0, 0]
@@ -300,7 +291,7 @@ const DatePicker = _ref => {
300
291
  style: [styles.placeholder, type === "solid" ? {
301
292
  paddingHorizontal: 12
302
293
  } : {}, labelStyle, {
303
- color: labelColor || placeholder,
294
+ color: placeholderColor,
304
295
  opacity: hasActiveOutline ? labeled : 1
305
296
  }],
306
297
  numberOfLines: 1
@@ -1,10 +1,20 @@
1
- import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES } from "@draftbit/types";
1
+ import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, StylesPanelSections, createColorProp, createNumberProp } from "@draftbit/types";
2
2
  export const SEED_DATA = {
3
3
  name: "Audio Player",
4
4
  tag: "AudioPlayer",
5
5
  description: "Given a source URL, plays sounds & audio!",
6
6
  category: COMPONENT_TYPES.media,
7
- layout: {},
7
+ stylesPanelSections: [StylesPanelSections.Typography, StylesPanelSections.Background, StylesPanelSections.Borders, StylesPanelSections.Size, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Position],
8
+ layout: {
9
+ backgroundColor: "#eee",
10
+ paddingLeft: 16,
11
+ paddingRight: 16,
12
+ paddingTop: 8,
13
+ paddingBottom: 8,
14
+ borderRadius: 24,
15
+ flexDirection: "row",
16
+ alignItems: "center"
17
+ },
8
18
  props: {
9
19
  source: {
10
20
  group: GROUPS.data,
@@ -15,6 +25,26 @@ export const SEED_DATA = {
15
25
  defaultValue: "https://static.draftbit.com/audio/intro-to-draftbit-audio.mp3",
16
26
  formType: FORM_TYPES.sourceUrl,
17
27
  propType: PROP_TYPES.OBJECT
18
- }
28
+ },
29
+ sliderColor: createColorProp({
30
+ label: "Thumb Color",
31
+ defaultValue: "strong"
32
+ }),
33
+ completedTrackColor: createColorProp({
34
+ label: "Completed Track Color",
35
+ defaultValue: "background"
36
+ }),
37
+ remainingTrackColor: createColorProp({
38
+ label: "Remaining Track Color",
39
+ defaultValue: "light"
40
+ }),
41
+ trackThumbSize: createNumberProp({
42
+ label: "Thumb Size",
43
+ defaultValue: 24
44
+ }),
45
+ playIconColor: createColorProp({
46
+ label: "Play Icon Color",
47
+ defaultValue: "strong"
48
+ })
19
49
  }
20
50
  };
@@ -1,4 +1,4 @@
1
- import { COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, FIELD_NAME, GROUPS, Triggers, StylesPanelSections, createNumberProp, createColorProp } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, FIELD_NAME, GROUPS, Triggers } from "@draftbit/types";
2
2
  const SEED_DATA_PROPS = {
3
3
  label: {
4
4
  label: "Label",
@@ -10,12 +10,6 @@ const SEED_DATA_PROPS = {
10
10
  required: true,
11
11
  group: GROUPS.data
12
12
  },
13
- labelSize: createNumberProp({
14
- label: "Label Size"
15
- }),
16
- labelColor: createColorProp({
17
- label: "Label Color"
18
- }),
19
13
  mode: {
20
14
  label: "Mode",
21
15
  description: "Choose between date, time and datetime",
@@ -27,12 +21,6 @@ const SEED_DATA_PROPS = {
27
21
  options: ["date", "time", "datetime"],
28
22
  group: GROUPS.basic
29
23
  },
30
- borderColor: createColorProp({
31
- label: "Border Color"
32
- }),
33
- borderColorActive: createColorProp({
34
- label: "Border Color"
35
- }),
36
24
  format: {
37
25
  label: "Format",
38
26
  description: "Create an output format for the date.",
@@ -150,7 +138,6 @@ export const SEED_DATA = [{
150
138
  category: COMPONENT_TYPES.input,
151
139
  layout: null,
152
140
  triggers: [Triggers.OnDateChange],
153
- StylesPanelSections: [StylesPanelSections.Background, StylesPanelSections.Borders, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Position, StylesPanelSections.Size, StylesPanelSections.Typography],
154
141
  props: {
155
142
  ...SEED_DATA_PROPS,
156
143
  type: {
@@ -15,14 +15,10 @@ declare type Props = {
15
15
  mode?: "date" | "time" | "datetime";
16
16
  type?: "solid" | "underline";
17
17
  label?: string;
18
- labelSize?: number;
19
- labelColor: string;
20
18
  placeholder?: string;
21
19
  leftIconName?: string;
22
20
  leftIconMode?: "outset" | "inset";
23
21
  rightIconName?: string;
24
- borderColor?: string;
25
- borderColorActive?: string;
26
22
  } & IconSlot & TextInputProps;
27
23
  declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<React.PropsWithChildren<Props>, "theme"> & {
28
24
  theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
@@ -3,7 +3,17 @@ export declare const SEED_DATA: {
3
3
  tag: string;
4
4
  description: string;
5
5
  category: string;
6
- layout: {};
6
+ stylesPanelSections: string[];
7
+ layout: {
8
+ backgroundColor: string;
9
+ paddingLeft: number;
10
+ paddingRight: number;
11
+ paddingTop: number;
12
+ paddingBottom: number;
13
+ borderRadius: number;
14
+ flexDirection: string;
15
+ alignItems: string;
16
+ };
7
17
  props: {
8
18
  source: {
9
19
  group: string;
@@ -15,5 +25,56 @@ export declare const SEED_DATA: {
15
25
  formType: string;
16
26
  propType: string;
17
27
  };
28
+ sliderColor: {
29
+ group: string;
30
+ label: string;
31
+ description: string;
32
+ editable: boolean;
33
+ required: boolean;
34
+ defaultValue: null;
35
+ formType: string;
36
+ propType: string;
37
+ };
38
+ completedTrackColor: {
39
+ group: string;
40
+ label: string;
41
+ description: string;
42
+ editable: boolean;
43
+ required: boolean;
44
+ defaultValue: null;
45
+ formType: string;
46
+ propType: string;
47
+ };
48
+ remainingTrackColor: {
49
+ group: string;
50
+ label: string;
51
+ description: string;
52
+ editable: boolean;
53
+ required: boolean;
54
+ defaultValue: null;
55
+ formType: string;
56
+ propType: string;
57
+ };
58
+ trackThumbSize: {
59
+ label: string;
60
+ description: string;
61
+ formType: string;
62
+ propType: string;
63
+ group: string;
64
+ defaultValue: null;
65
+ editable: boolean;
66
+ required: boolean;
67
+ step: number;
68
+ };
69
+ playIconColor: {
70
+ group: string;
71
+ label: string;
72
+ description: string;
73
+ editable: boolean;
74
+ required: boolean;
75
+ defaultValue: null;
76
+ formType: string;
77
+ propType: string;
78
+ };
18
79
  };
19
80
  };
@@ -5,7 +5,6 @@ export declare const SEED_DATA: {
5
5
  category: string;
6
6
  layout: null;
7
7
  triggers: string[];
8
- StylesPanelSections: string[];
9
8
  props: {
10
9
  type: {
11
10
  label: string;
@@ -28,27 +27,6 @@ export declare const SEED_DATA: {
28
27
  required: boolean;
29
28
  group: string;
30
29
  };
31
- labelSize: {
32
- label: string;
33
- description: string;
34
- formType: string;
35
- propType: string;
36
- group: string;
37
- defaultValue: null;
38
- editable: boolean;
39
- required: boolean;
40
- step: number;
41
- };
42
- labelColor: {
43
- group: string;
44
- label: string;
45
- description: string;
46
- editable: boolean;
47
- required: boolean;
48
- defaultValue: null;
49
- formType: string;
50
- propType: string;
51
- };
52
30
  mode: {
53
31
  label: string;
54
32
  description: string;
@@ -60,26 +38,6 @@ export declare const SEED_DATA: {
60
38
  options: string[];
61
39
  group: string;
62
40
  };
63
- borderColor: {
64
- group: string;
65
- label: string;
66
- description: string;
67
- editable: boolean;
68
- required: boolean;
69
- defaultValue: null;
70
- formType: string;
71
- propType: string;
72
- };
73
- borderColorActive: {
74
- group: string;
75
- label: string;
76
- description: string;
77
- editable: boolean;
78
- required: boolean;
79
- defaultValue: null;
80
- formType: string;
81
- propType: string;
82
- };
83
41
  format: {
84
42
  label: string;
85
43
  description: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.4.4-764cb2.2+764cb2a",
3
+ "version": "46.4.4-79fcb6.2+79fcb6c",
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.4.4-764cb2.2+764cb2a",
44
+ "@draftbit/types": "^46.4.4-79fcb6.2+79fcb6c",
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",
@@ -81,5 +81,5 @@
81
81
  ]
82
82
  ]
83
83
  },
84
- "gitHead": "764cb2a61a908445041f9426c4663e188448ee5f"
84
+ "gitHead": "79fcb6cc7a81e72fbe77e8e7917715289d3884f0"
85
85
  }
@@ -6,7 +6,6 @@ import { withTheme } from "../../theming";
6
6
  import Portal from "../Portal/Portal";
7
7
  import Touchable from "../Touchable";
8
8
  import DateTimePicker from "./DatePickerComponent";
9
- import { extractStyles } from "../../utilities";
10
9
  const AnimatedText = Animated.createAnimatedComponent(Text);
11
10
  const FOCUS_ANIMATION_DURATION = 150;
12
11
  const BLUR_ANIMATION_DURATION = 180;
@@ -25,7 +24,7 @@ const MONTHS = [
25
24
  "November",
26
25
  "December",
27
26
  ];
28
- const DatePicker = ({ Icon, style, theme: { colors, typography, roundness, disabledOpacity }, date, onDateChange = () => { }, defaultValue, disabled = false, mode = "date", format, type = "underline", leftIconName, rightIconName, leftIconMode = "inset", label, labelSize, labelColor, placeholder, borderColor: inputBorderColor, borderColorActive: inputBorderColorActive, ...props }) => {
27
+ const DatePicker = ({ Icon, style, theme: { colors, typography, roundness, disabledOpacity }, date, onDateChange = () => { }, defaultValue, disabled = false, mode = "date", format, type = "underline", leftIconName, rightIconName, leftIconMode = "inset", label, placeholder, ...props }) => {
29
28
  const [value, setValue] = React.useState(date || defaultValue);
30
29
  React.useEffect(() => {
31
30
  if (defaultValue != null) {
@@ -37,7 +36,6 @@ const DatePicker = ({ Icon, style, theme: { colors, typography, roundness, disab
37
36
  const [placeholder1, setPlaceholder1] = React.useState("");
38
37
  const [focused, setFocused] = React.useState(false);
39
38
  const [labelLayout, setLabelLayout] = React.useState({ measured: false, width: 0 });
40
- const { textStyles } = extractStyles(style);
41
39
  const getValidDate = () => {
42
40
  if (!value) {
43
41
  return new Date();
@@ -127,10 +125,8 @@ const DatePicker = ({ Icon, style, theme: { colors, typography, roundness, disab
127
125
  };
128
126
  const MINIMIZED_LABEL_Y_OFFSET = -(typography.caption.lineHeight + 4);
129
127
  const OUTLINE_MINIMIZED_LABEL_Y_OFFSET = -(16 * 0.5 + 4);
130
- const MAXIMIZED_LABEL_FONT_SIZE = (textStyles === null || textStyles === void 0 ? void 0 : textStyles.fontSize) || typography.subtitle1.fontSize;
131
- const MINIMIZED_LABEL_FONT_SIZE = labelSize
132
- ? labelSize
133
- : typography.caption.fontSize;
128
+ const MAXIMIZED_LABEL_FONT_SIZE = typography.subtitle1.fontSize;
129
+ const MINIMIZED_LABEL_FONT_SIZE = typography.caption.fontSize;
134
130
  const hasActiveOutline = focused;
135
131
  let inputTextColor, activeColor, underlineColor, borderColor, placeholderColor, containerStyle, backgroundColor, inputStyle;
136
132
  inputTextColor = colors.strong;
@@ -142,9 +138,9 @@ const DatePicker = ({ Icon, style, theme: { colors, typography, roundness, disab
142
138
  backgroundColor = colors.divider;
143
139
  }
144
140
  else {
145
- activeColor = inputBorderColorActive || colors.primary;
146
- placeholderColor = borderColor = inputBorderColor || colors.light;
147
- underlineColor = inputBorderColor || colors.light;
141
+ activeColor = colors.primary;
142
+ placeholderColor = borderColor = colors.light;
143
+ underlineColor = colors.light;
148
144
  backgroundColor = colors.background;
149
145
  }
150
146
  const { lineHeight, ...subtitle1 } = typography.subtitle1;
@@ -206,7 +202,6 @@ const DatePicker = ({ Icon, style, theme: { colors, typography, roundness, disab
206
202
  const labelStyle = {
207
203
  ...typography.subtitle1,
208
204
  top: type === "solid" ? 16 : 0,
209
- fontFamily: textStyles === null || textStyles === void 0 ? void 0 : textStyles.fontFamily,
210
205
  left: leftIconName && leftIconMode === "inset"
211
206
  ? ICON_SIZE + (type === "solid" ? 16 : 12)
212
207
  : 0,
@@ -250,7 +245,6 @@ const DatePicker = ({ Icon, style, theme: { colors, typography, roundness, disab
250
245
  styles.input,
251
246
  inputStyle,
252
247
  type === "solid" ? { marginHorizontal: 12 } : {},
253
- textStyles,
254
248
  ];
255
249
  // const render = (props) => <NativeTextInput {...props} />;
256
250
  return (React.createElement(View, { style: [styles.container, style] },
@@ -288,7 +282,7 @@ const DatePicker = ({ Icon, style, theme: { colors, typography, roundness, disab
288
282
  type === "solid" ? { paddingHorizontal: 12 } : {},
289
283
  labelStyle,
290
284
  {
291
- color: labelColor || colors.light,
285
+ color: colors.light,
292
286
  opacity: labeled.interpolate({
293
287
  inputRange: [0, 1],
294
288
  outputRange: [hasActiveOutline ? 1 : 0, 0],
@@ -300,7 +294,7 @@ const DatePicker = ({ Icon, style, theme: { colors, typography, roundness, disab
300
294
  type === "solid" ? { paddingHorizontal: 12 } : {},
301
295
  labelStyle,
302
296
  {
303
- color: labelColor || placeholder,
297
+ color: placeholderColor,
304
298
  opacity: hasActiveOutline ? labeled : 1,
305
299
  },
306
300
  ], numberOfLines: 1 }, label))) : null,
@@ -23,7 +23,6 @@ import DateTimePicker from "./DatePickerComponent";
23
23
 
24
24
  import type { Theme } from "../../styles/DefaultTheme";
25
25
  import type { IconSlot } from "../../interfaces/Icon";
26
- import { extractStyles } from "../../utilities";
27
26
 
28
27
  const AnimatedText = Animated.createAnimatedComponent(Text);
29
28
 
@@ -48,14 +47,10 @@ type Props = {
48
47
  mode?: "date" | "time" | "datetime";
49
48
  type?: "solid" | "underline";
50
49
  label?: string;
51
- labelSize?: number;
52
- labelColor: string;
53
50
  placeholder?: string;
54
51
  leftIconName?: string;
55
52
  leftIconMode?: "outset" | "inset";
56
53
  rightIconName?: string;
57
- borderColor?: string;
58
- borderColorActive?: string;
59
54
  } & IconSlot &
60
55
  TextInputProps;
61
56
 
@@ -89,11 +84,7 @@ const DatePicker: React.FC<React.PropsWithChildren<Props>> = ({
89
84
  rightIconName,
90
85
  leftIconMode = "inset",
91
86
  label,
92
- labelSize,
93
- labelColor,
94
87
  placeholder,
95
- borderColor: inputBorderColor,
96
- borderColorActive: inputBorderColorActive,
97
88
  ...props
98
89
  }) => {
99
90
  const [value, setValue] = React.useState<any>(date || defaultValue);
@@ -115,8 +106,6 @@ const DatePicker: React.FC<React.PropsWithChildren<Props>> = ({
115
106
  width: number;
116
107
  }>({ measured: false, width: 0 });
117
108
 
118
- const { textStyles } = extractStyles(style);
119
-
120
109
  const getValidDate = (): Date => {
121
110
  if (!value) {
122
111
  return new Date();
@@ -222,11 +211,8 @@ const DatePicker: React.FC<React.PropsWithChildren<Props>> = ({
222
211
 
223
212
  const MINIMIZED_LABEL_Y_OFFSET = -(typography.caption.lineHeight + 4);
224
213
  const OUTLINE_MINIMIZED_LABEL_Y_OFFSET = -(16 * 0.5 + 4);
225
- const MAXIMIZED_LABEL_FONT_SIZE =
226
- textStyles?.fontSize || typography.subtitle1.fontSize;
227
- const MINIMIZED_LABEL_FONT_SIZE = labelSize
228
- ? labelSize
229
- : typography.caption.fontSize;
214
+ const MAXIMIZED_LABEL_FONT_SIZE = typography.subtitle1.fontSize;
215
+ const MINIMIZED_LABEL_FONT_SIZE = typography.caption.fontSize;
230
216
 
231
217
  const hasActiveOutline = focused;
232
218
 
@@ -247,9 +233,9 @@ const DatePicker: React.FC<React.PropsWithChildren<Props>> = ({
247
233
  underlineColor = "transparent";
248
234
  backgroundColor = colors.divider;
249
235
  } else {
250
- activeColor = inputBorderColorActive || colors.primary;
251
- placeholderColor = borderColor = inputBorderColor || colors.light;
252
- underlineColor = inputBorderColor || colors.light;
236
+ activeColor = colors.primary;
237
+ placeholderColor = borderColor = colors.light;
238
+ underlineColor = colors.light;
253
239
  backgroundColor = colors.background;
254
240
  }
255
241
 
@@ -320,7 +306,6 @@ const DatePicker: React.FC<React.PropsWithChildren<Props>> = ({
320
306
  const labelStyle = {
321
307
  ...typography.subtitle1,
322
308
  top: type === "solid" ? 16 : 0,
323
- fontFamily: textStyles?.fontFamily,
324
309
  left:
325
310
  leftIconName && leftIconMode === "inset"
326
311
  ? ICON_SIZE + (type === "solid" ? 16 : 12)
@@ -366,7 +351,6 @@ const DatePicker: React.FC<React.PropsWithChildren<Props>> = ({
366
351
  styles.input,
367
352
  inputStyle,
368
353
  type === "solid" ? { marginHorizontal: 12 } : {},
369
- textStyles,
370
354
  ];
371
355
 
372
356
  // const render = (props) => <NativeTextInput {...props} />;
@@ -422,7 +406,7 @@ const DatePicker: React.FC<React.PropsWithChildren<Props>> = ({
422
406
  type === "solid" ? { paddingHorizontal: 12 } : {},
423
407
  labelStyle,
424
408
  {
425
- color: labelColor || colors.light,
409
+ color: colors.light,
426
410
  opacity: labeled.interpolate({
427
411
  inputRange: [0, 1],
428
412
  outputRange: [hasActiveOutline ? 1 : 0, 0],
@@ -439,7 +423,7 @@ const DatePicker: React.FC<React.PropsWithChildren<Props>> = ({
439
423
  type === "solid" ? { paddingHorizontal: 12 } : {},
440
424
  labelStyle,
441
425
  {
442
- color: labelColor || placeholder,
426
+ color: placeholderColor,
443
427
  opacity: hasActiveOutline ? labeled : 1,
444
428
  },
445
429
  ]}
@@ -1,10 +1,27 @@
1
- import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, } from "@draftbit/types";
1
+ import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, StylesPanelSections, createColorProp, createNumberProp, } from "@draftbit/types";
2
2
  export const SEED_DATA = {
3
3
  name: "Audio Player",
4
4
  tag: "AudioPlayer",
5
5
  description: "Given a source URL, plays sounds & audio!",
6
6
  category: COMPONENT_TYPES.media,
7
- layout: {},
7
+ stylesPanelSections: [
8
+ StylesPanelSections.Typography,
9
+ StylesPanelSections.Background,
10
+ StylesPanelSections.Borders,
11
+ StylesPanelSections.Size,
12
+ StylesPanelSections.MarginsAndPaddings,
13
+ StylesPanelSections.Position,
14
+ ],
15
+ layout: {
16
+ backgroundColor: "#eee",
17
+ paddingLeft: 16,
18
+ paddingRight: 16,
19
+ paddingTop: 8,
20
+ paddingBottom: 8,
21
+ borderRadius: 24,
22
+ flexDirection: "row",
23
+ alignItems: "center",
24
+ },
8
25
  props: {
9
26
  source: {
10
27
  group: GROUPS.data,
@@ -16,5 +33,25 @@ export const SEED_DATA = {
16
33
  formType: FORM_TYPES.sourceUrl,
17
34
  propType: PROP_TYPES.OBJECT,
18
35
  },
36
+ sliderColor: createColorProp({
37
+ label: "Thumb Color",
38
+ defaultValue: "strong",
39
+ }),
40
+ completedTrackColor: createColorProp({
41
+ label: "Completed Track Color",
42
+ defaultValue: "background",
43
+ }),
44
+ remainingTrackColor: createColorProp({
45
+ label: "Remaining Track Color",
46
+ defaultValue: "light",
47
+ }),
48
+ trackThumbSize: createNumberProp({
49
+ label: "Thumb Size",
50
+ defaultValue: 24,
51
+ }),
52
+ playIconColor: createColorProp({
53
+ label: "Play Icon Color",
54
+ defaultValue: "strong",
55
+ }),
19
56
  },
20
57
  };
@@ -3,6 +3,9 @@ import {
3
3
  COMPONENT_TYPES,
4
4
  FORM_TYPES,
5
5
  PROP_TYPES,
6
+ StylesPanelSections,
7
+ createColorProp,
8
+ createNumberProp,
6
9
  } from "@draftbit/types";
7
10
 
8
11
  export const SEED_DATA = {
@@ -10,7 +13,24 @@ export const SEED_DATA = {
10
13
  tag: "AudioPlayer",
11
14
  description: "Given a source URL, plays sounds & audio!",
12
15
  category: COMPONENT_TYPES.media,
13
- layout: {},
16
+ stylesPanelSections: [
17
+ StylesPanelSections.Typography,
18
+ StylesPanelSections.Background,
19
+ StylesPanelSections.Borders,
20
+ StylesPanelSections.Size,
21
+ StylesPanelSections.MarginsAndPaddings,
22
+ StylesPanelSections.Position,
23
+ ],
24
+ layout: {
25
+ backgroundColor: "#eee",
26
+ paddingLeft: 16,
27
+ paddingRight: 16,
28
+ paddingTop: 8,
29
+ paddingBottom: 8,
30
+ borderRadius: 24,
31
+ flexDirection: "row",
32
+ alignItems: "center",
33
+ },
14
34
  props: {
15
35
  source: {
16
36
  group: GROUPS.data,
@@ -23,5 +43,25 @@ export const SEED_DATA = {
23
43
  formType: FORM_TYPES.sourceUrl,
24
44
  propType: PROP_TYPES.OBJECT,
25
45
  },
46
+ sliderColor: createColorProp({
47
+ label: "Thumb Color",
48
+ defaultValue: "strong",
49
+ }),
50
+ completedTrackColor: createColorProp({
51
+ label: "Completed Track Color",
52
+ defaultValue: "background",
53
+ }),
54
+ remainingTrackColor: createColorProp({
55
+ label: "Remaining Track Color",
56
+ defaultValue: "light",
57
+ }),
58
+ trackThumbSize: createNumberProp({
59
+ label: "Thumb Size",
60
+ defaultValue: 24,
61
+ }),
62
+ playIconColor: createColorProp({
63
+ label: "Play Icon Color",
64
+ defaultValue: "strong",
65
+ }),
26
66
  },
27
67
  };
@@ -1,4 +1,4 @@
1
- import { COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, FIELD_NAME, GROUPS, Triggers, StylesPanelSections, createNumberProp, createColorProp, } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, FIELD_NAME, GROUPS, Triggers, } from "@draftbit/types";
2
2
  const SEED_DATA_PROPS = {
3
3
  label: {
4
4
  label: "Label",
@@ -10,12 +10,6 @@ const SEED_DATA_PROPS = {
10
10
  required: true,
11
11
  group: GROUPS.data,
12
12
  },
13
- labelSize: createNumberProp({
14
- label: "Label Size",
15
- }),
16
- labelColor: createColorProp({
17
- label: "Label Color",
18
- }),
19
13
  mode: {
20
14
  label: "Mode",
21
15
  description: "Choose between date, time and datetime",
@@ -27,12 +21,6 @@ const SEED_DATA_PROPS = {
27
21
  options: ["date", "time", "datetime"],
28
22
  group: GROUPS.basic,
29
23
  },
30
- borderColor: createColorProp({
31
- label: "Border Color",
32
- }),
33
- borderColorActive: createColorProp({
34
- label: "Border Color",
35
- }),
36
24
  format: {
37
25
  label: "Format",
38
26
  description: "Create an output format for the date.",
@@ -151,14 +139,6 @@ export const SEED_DATA = [
151
139
  category: COMPONENT_TYPES.input,
152
140
  layout: null,
153
141
  triggers: [Triggers.OnDateChange],
154
- StylesPanelSections: [
155
- StylesPanelSections.Background,
156
- StylesPanelSections.Borders,
157
- StylesPanelSections.MarginsAndPaddings,
158
- StylesPanelSections.Position,
159
- StylesPanelSections.Size,
160
- StylesPanelSections.Typography,
161
- ],
162
142
  props: {
163
143
  ...SEED_DATA_PROPS,
164
144
  type: {
@@ -5,9 +5,6 @@ import {
5
5
  FIELD_NAME,
6
6
  GROUPS,
7
7
  Triggers,
8
- StylesPanelSections,
9
- createNumberProp,
10
- createColorProp,
11
8
  } from "@draftbit/types";
12
9
 
13
10
  const SEED_DATA_PROPS = {
@@ -21,12 +18,6 @@ const SEED_DATA_PROPS = {
21
18
  required: true,
22
19
  group: GROUPS.data,
23
20
  },
24
- labelSize: createNumberProp({
25
- label: "Label Size",
26
- }),
27
- labelColor: createColorProp({
28
- label: "Label Color",
29
- }),
30
21
  mode: {
31
22
  label: "Mode",
32
23
  description: "Choose between date, time and datetime",
@@ -38,12 +29,6 @@ const SEED_DATA_PROPS = {
38
29
  options: ["date", "time", "datetime"],
39
30
  group: GROUPS.basic,
40
31
  },
41
- borderColor: createColorProp({
42
- label: "Border Color",
43
- }),
44
- borderColorActive: createColorProp({
45
- label: "Border Color",
46
- }),
47
32
  format: {
48
33
  label: "Format",
49
34
  description: "Create an output format for the date.",
@@ -165,14 +150,6 @@ export const SEED_DATA = [
165
150
  category: COMPONENT_TYPES.input,
166
151
  layout: null,
167
152
  triggers: [Triggers.OnDateChange],
168
- StylesPanelSections: [
169
- StylesPanelSections.Background,
170
- StylesPanelSections.Borders,
171
- StylesPanelSections.MarginsAndPaddings,
172
- StylesPanelSections.Position,
173
- StylesPanelSections.Size,
174
- StylesPanelSections.Typography,
175
- ],
176
153
  props: {
177
154
  ...SEED_DATA_PROPS,
178
155
  type: {