dhre-ui-kit 0.0.152 → 0.0.154

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/lib/index.d.ts CHANGED
@@ -354,7 +354,6 @@ interface AccordionProps {
354
354
  headerComponent?: () => React$1.ReactNode;
355
355
  disabled?: boolean;
356
356
  icon: React$1.ReactElement;
357
- onHeaderPress?: () => void;
358
357
  titleVariant?: string;
359
358
  }
360
359
 
@@ -1043,11 +1042,23 @@ interface AppointmentCardProps {
1043
1042
  title: string;
1044
1043
  headerTitle: string;
1045
1044
  headerSubtitle: string;
1046
- appointmentId: number;
1047
- requestId: string;
1048
- location: string;
1049
- onPress: () => void;
1050
- onHeaderPress: () => void;
1045
+ onViewDetailsPress: () => void;
1046
+ statusIcon: React$1.ReactElement;
1047
+ infoIcon: React$1.ReactElement;
1048
+ deleteIcon: React$1.ReactElement;
1049
+ editIcon: React$1.ReactElement;
1050
+ onDeletePress: () => void;
1051
+ onEditPress: () => void;
1052
+ onDirectionPress: () => void;
1053
+ data: {
1054
+ title: string;
1055
+ value: string;
1056
+ isLocation?: boolean;
1057
+ isStatus?: boolean;
1058
+ }[];
1059
+ viewText: string;
1060
+ info: string;
1061
+ directionText: string;
1051
1062
  }
1052
1063
 
1053
1064
  declare const _default$1: (props: AppointmentCardProps) => React$1.JSX.Element;
package/lib/index.js CHANGED
@@ -282,7 +282,7 @@ const ThemeProvider = ({ children }) => {
282
282
  acc[key] = theme[key][mode];
283
283
  return acc;
284
284
  }, {});
285
- return /* @__PURE__ */ React__default["default"].createElement(ThemeContext.Provider, { value: { theme: filteredTheme } }, children);
285
+ return /* @__PURE__ */ React__default["default"].createElement(ThemeContext.Provider, { value: { theme: filteredTheme, mode } }, children);
286
286
  };
287
287
  const useTheme = () => {
288
288
  const context = React.useContext(ThemeContext);
@@ -1932,7 +1932,6 @@ const Accordion = ({
1932
1932
  headerComponent,
1933
1933
  disabled = false,
1934
1934
  icon,
1935
- onHeaderPress,
1936
1935
  titleVariant = "B4_REGULAR"
1937
1936
  }) => {
1938
1937
  const contentRef = React.useRef(null);
@@ -1967,22 +1966,30 @@ const Accordion = ({
1967
1966
  },
1968
1967
  testID: testId
1969
1968
  },
1970
- /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: [styles$m.header, headerStyle, disabled && { opacity: 0.5 }] }, headerComponent ? headerComponent() : /* @__PURE__ */ React__default["default"].createElement(reactNative.Pressable, { onPress: onHeaderPress }, /* @__PURE__ */ React__default["default"].createElement(
1971
- CustomTypography,
1969
+ /* @__PURE__ */ React__default["default"].createElement(
1970
+ reactNative.Pressable,
1972
1971
  {
1973
- variant: titleVariant,
1974
- text: title,
1975
- style: {
1976
- ...styles$m.title,
1977
- color: theme.CONTENT_PRIMARY,
1978
- ...titleStyle
1972
+ style: [styles$m.header, headerStyle, disabled && { opacity: 0.5 }],
1973
+ onPress: !disabled ? onToggle : void 0
1974
+ },
1975
+ headerComponent ? headerComponent() : /* @__PURE__ */ React__default["default"].createElement(
1976
+ CustomTypography,
1977
+ {
1978
+ variant: titleVariant,
1979
+ text: title,
1980
+ style: {
1981
+ ...styles$m.title,
1982
+ color: theme.CONTENT_PRIMARY,
1983
+ ...titleStyle
1984
+ }
1979
1985
  }
1980
- }
1981
- )), /* @__PURE__ */ React__default["default"].createElement(reactNative.Pressable, { onPress: !disabled ? onToggle : void 0 }, React__default["default"].cloneElement(icon, {
1982
- width: moderateScale(20),
1983
- height: moderateScale(20),
1984
- style: styles$m.iconStyle
1985
- }))),
1986
+ ),
1987
+ React__default["default"].cloneElement(icon, {
1988
+ width: moderateScale(20),
1989
+ height: moderateScale(20),
1990
+ style: styles$m.iconStyle
1991
+ })
1992
+ ),
1986
1993
  optionalElement ? optionalElement() : null,
1987
1994
  isOpen && /* @__PURE__ */ React__default["default"].createElement(reactNative.Animated.View, { style: [styles$m.content, { height: cardHeight }] }, /* @__PURE__ */ React__default["default"].createElement(
1988
1995
  reactNative.View,
@@ -2754,7 +2761,7 @@ const DateRangePicker = (props) => {
2754
2761
  startDate: "",
2755
2762
  endDate: ""
2756
2763
  });
2757
- const { theme } = useTheme();
2764
+ const { theme, mode } = useTheme();
2758
2765
  const onDayPress = (day) => {
2759
2766
  const { dateString } = day;
2760
2767
  const { startDate, endDate } = selectedRange;
@@ -2778,7 +2785,7 @@ const DateRangePicker = (props) => {
2778
2785
  start.setDate(start.getDate() + 1);
2779
2786
  markedDates[start.toISOString().split("T")[0]] = {
2780
2787
  color: theme.SUCCESS,
2781
- textColor: theme.CONTENT_PRIMARY
2788
+ textColor: theme.CONTENT_INVERTED
2782
2789
  };
2783
2790
  }
2784
2791
  }
@@ -2787,7 +2794,10 @@ const DateRangePicker = (props) => {
2787
2794
  startingDay: true,
2788
2795
  color: theme.SUCCESS,
2789
2796
  textColor: theme.CONTENT_INVERTED,
2790
- customContainerStyle: { backgroundColor: theme.SURFACE_INVERTED }
2797
+ customContainerStyle: mode === "dark" ? { backgroundColor: theme.SURFACE_INVERTED } : {
2798
+ borderWidth: moderateScale(2),
2799
+ borderColor: theme.SURFACE_PRIMARY
2800
+ }
2791
2801
  };
2792
2802
  }
2793
2803
  if (endDate) {
@@ -2795,7 +2805,10 @@ const DateRangePicker = (props) => {
2795
2805
  endingDay: true,
2796
2806
  color: theme.SUCCESS,
2797
2807
  textColor: theme.CONTENT_INVERTED,
2798
- customContainerStyle: { backgroundColor: theme.SURFACE_INVERTED }
2808
+ customContainerStyle: mode === "dark" ? { backgroundColor: theme.SURFACE_INVERTED } : {
2809
+ borderWidth: moderateScale(2),
2810
+ borderColor: theme.SURFACE_PRIMARY
2811
+ }
2799
2812
  };
2800
2813
  }
2801
2814
  return markedDates;
@@ -4239,17 +4252,47 @@ const styles$1 = reactNative.StyleSheet.create({
4239
4252
  appointmentInfo: {
4240
4253
  flex: 1,
4241
4254
  flexDirection: "row",
4242
- justifyContent: "space-between"
4255
+ flexWrap: "wrap",
4256
+ rowGap: verticalScale(16)
4243
4257
  },
4244
4258
  infoColumn: {
4245
- flex: 1,
4259
+ width: "50%",
4246
4260
  rowGap: verticalScale(4)
4247
4261
  },
4262
+ infoRow: {
4263
+ flexDirection: "row",
4264
+ columnGap: horizontalScale(4)
4265
+ },
4248
4266
  locationInfo: {
4249
4267
  rowGap: verticalScale(4)
4250
4268
  },
4251
4269
  getDirectionsText: {
4252
4270
  textDecorationLine: "underline"
4271
+ },
4272
+ infoContainer: {
4273
+ padding: moderateScale(8),
4274
+ flexDirection: "row",
4275
+ columnGap: horizontalScale(8),
4276
+ borderRadius: moderateScale(8)
4277
+ },
4278
+ actionsContainer: {
4279
+ borderTopWidth: 1,
4280
+ paddingTop: verticalScale(16),
4281
+ flexDirection: "row"
4282
+ },
4283
+ viewText: {
4284
+ flex: 1,
4285
+ textDecorationLine: "underline",
4286
+ alignSelf: "center"
4287
+ },
4288
+ actionIcons: {
4289
+ flexDirection: "row",
4290
+ columnGap: horizontalScale(16)
4291
+ },
4292
+ iconContainer: {
4293
+ width: moderateScale(32),
4294
+ height: moderateScale(32),
4295
+ borderRadius: moderateScale(25)
4253
4296
  }
4254
4297
  });
4255
4298
 
@@ -4261,11 +4304,18 @@ const AppointmentCard = ({
4261
4304
  title,
4262
4305
  headerTitle,
4263
4306
  headerSubtitle,
4264
- appointmentId,
4265
- requestId,
4266
- location,
4267
- onPress,
4268
- onHeaderPress
4307
+ onViewDetailsPress,
4308
+ statusIcon,
4309
+ infoIcon,
4310
+ deleteIcon,
4311
+ editIcon,
4312
+ onDeletePress,
4313
+ onEditPress,
4314
+ onDirectionPress,
4315
+ data,
4316
+ viewText,
4317
+ info,
4318
+ directionText
4269
4319
  }) => {
4270
4320
  const { theme } = useTheme();
4271
4321
  return /* @__PURE__ */ React__default["default"].createElement(
@@ -4281,93 +4331,125 @@ const AppointmentCard = ({
4281
4331
  borderBottomColor: theme.BORDER_SEPERATOR_HEADER
4282
4332
  },
4283
4333
  headerStyle: styles$1.accordionHeader,
4284
- headerComponent: () => /* @__PURE__ */ React__default["default"].createElement(
4285
- reactNative.Pressable,
4286
- {
4287
- style: styles$1.accordionHeaderContent,
4288
- onPress: onHeaderPress
4289
- },
4290
- headerIcon,
4291
- /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$1.accordionText }, /* @__PURE__ */ React__default["default"].createElement(
4292
- CustomTypography,
4293
- {
4294
- text: headerTitle,
4295
- variant: FontStyle.L2_REGULAR,
4296
- style: { color: theme.CONTENT_SECONDRY }
4297
- }
4298
- ), /* @__PURE__ */ React__default["default"].createElement(
4299
- CustomTypography,
4300
- {
4301
- text: headerSubtitle,
4302
- variant: FontStyle.B3_REGULAR,
4303
- style: { color: theme.CONTENT_PRIMARY }
4304
- }
4305
- ))
4306
- ),
4307
- icon
4308
- },
4309
- /* @__PURE__ */ React__default["default"].createElement(
4310
- reactNative.View,
4311
- {
4312
- style: {
4313
- ...styles$1.accordionDetails,
4314
- borderTopColor: theme.BORDER_SEPERATOR_HEADER
4315
- }
4316
- },
4317
- /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$1.appointmentInfo }, /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$1.infoColumn }, /* @__PURE__ */ React__default["default"].createElement(
4334
+ headerComponent: () => /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$1.accordionHeaderContent }, headerIcon, /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$1.accordionText }, /* @__PURE__ */ React__default["default"].createElement(
4318
4335
  CustomTypography,
4319
4336
  {
4320
- text: "APPOINTMENT ID",
4321
- variant: FontStyle.L3_REGULAR,
4337
+ text: headerTitle,
4338
+ variant: FontStyle.L2_REGULAR,
4322
4339
  style: { color: theme.CONTENT_SECONDRY }
4323
4340
  }
4324
4341
  ), /* @__PURE__ */ React__default["default"].createElement(
4325
4342
  CustomTypography,
4326
4343
  {
4327
- text: appointmentId?.toString(),
4328
- variant: FontStyle.L1_REGULAR,
4344
+ text: headerSubtitle,
4345
+ variant: FontStyle.B3_REGULAR,
4329
4346
  style: { color: theme.CONTENT_PRIMARY }
4330
4347
  }
4331
- )), /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$1.infoColumn }, /* @__PURE__ */ React__default["default"].createElement(
4348
+ ))),
4349
+ icon
4350
+ },
4351
+ /* @__PURE__ */ React__default["default"].createElement(
4352
+ reactNative.View,
4353
+ {
4354
+ style: [
4355
+ styles$1.accordionDetails,
4356
+ { borderTopColor: theme.BORDER_SEPERATOR_HEADER }
4357
+ ]
4358
+ },
4359
+ /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$1.appointmentInfo }, data.map(({ title: title2, value, isLocation, isStatus }) => /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$1.infoColumn, key: title2 }, /* @__PURE__ */ React__default["default"].createElement(
4332
4360
  CustomTypography,
4333
4361
  {
4334
- text: "REQUEST ID",
4362
+ text: title2,
4335
4363
  variant: FontStyle.L3_REGULAR,
4336
4364
  style: { color: theme.CONTENT_SECONDRY }
4337
4365
  }
4338
- ), /* @__PURE__ */ React__default["default"].createElement(
4366
+ ), /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$1.infoRow }, isStatus && statusIcon, /* @__PURE__ */ React__default["default"].createElement(
4339
4367
  CustomTypography,
4340
4368
  {
4341
- text: requestId,
4369
+ text: value,
4342
4370
  variant: FontStyle.L1_REGULAR,
4343
- style: { color: theme.CONTENT_PRIMARY }
4371
+ style: {
4372
+ color: isStatus ? theme.WARNING : theme.CONTENT_PRIMARY
4373
+ }
4344
4374
  }
4345
- ))),
4346
- /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$1.locationInfo }, /* @__PURE__ */ React__default["default"].createElement(
4375
+ )), isLocation && /* @__PURE__ */ React__default["default"].createElement(
4347
4376
  CustomTypography,
4348
4377
  {
4349
- text: "LOCATION",
4350
- variant: FontStyle.L3_REGULAR,
4351
- style: { color: theme.CONTENT_SECONDRY }
4378
+ text: directionText,
4379
+ variant: FontStyle.L2_REGULAR,
4380
+ style: [
4381
+ styles$1.getDirectionsText,
4382
+ { color: theme.CONTENT_PRIMARY }
4383
+ ],
4384
+ onPress: onDirectionPress
4352
4385
  }
4353
- ), /* @__PURE__ */ React__default["default"].createElement(
4354
- CustomTypography,
4386
+ )))),
4387
+ /* @__PURE__ */ React__default["default"].createElement(
4388
+ reactNative.View,
4355
4389
  {
4356
- text: location,
4357
- variant: FontStyle.L1_REGULAR,
4358
- style: { color: theme.CONTENT_PRIMARY }
4359
- }
4360
- ), /* @__PURE__ */ React__default["default"].createElement(reactNative.Pressable, { onPress }, /* @__PURE__ */ React__default["default"].createElement(
4361
- CustomTypography,
4390
+ style: [
4391
+ styles$1.infoContainer,
4392
+ {
4393
+ backgroundColor: theme.SURFACE_TERTIARY
4394
+ }
4395
+ ]
4396
+ },
4397
+ infoIcon,
4398
+ /* @__PURE__ */ React__default["default"].createElement(
4399
+ CustomTypography,
4400
+ {
4401
+ text: info,
4402
+ variant: FontStyle.L2_REGULAR,
4403
+ style: { flex: 1, color: theme.CONTENT_SECONDRY }
4404
+ }
4405
+ )
4406
+ ),
4407
+ /* @__PURE__ */ React__default["default"].createElement(
4408
+ reactNative.View,
4362
4409
  {
4363
- text: "Get directions",
4364
- variant: FontStyle.L2_REGULAR,
4365
- style: {
4366
- ...styles$1.getDirectionsText,
4367
- color: theme.CONTENT_PRIMARY
4410
+ style: [
4411
+ styles$1.actionsContainer,
4412
+ {
4413
+ borderTopColor: theme.BORDER_SEPERATOR_HEADER
4414
+ }
4415
+ ]
4416
+ },
4417
+ /* @__PURE__ */ React__default["default"].createElement(
4418
+ CustomTypography,
4419
+ {
4420
+ text: viewText,
4421
+ variant: FontStyle.L2_REGULAR,
4422
+ style: [
4423
+ styles$1.viewText,
4424
+ {
4425
+ color: theme.CONTENT_PRIMARY
4426
+ }
4427
+ ],
4428
+ onPress: onViewDetailsPress
4368
4429
  }
4369
- }
4370
- )))
4430
+ ),
4431
+ /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$1.actionIcons }, /* @__PURE__ */ React__default["default"].createElement(
4432
+ CustomIcon,
4433
+ {
4434
+ icon: deleteIcon,
4435
+ containerStyle: {
4436
+ ...styles$1.iconContainer,
4437
+ backgroundColor: theme.SURFACE_INVERTED
4438
+ },
4439
+ onPress: onDeletePress
4440
+ }
4441
+ ), /* @__PURE__ */ React__default["default"].createElement(
4442
+ CustomIcon,
4443
+ {
4444
+ icon: editIcon,
4445
+ containerStyle: {
4446
+ ...styles$1.iconContainer,
4447
+ backgroundColor: theme.SURFACE_INVERTED
4448
+ },
4449
+ onPress: onEditPress
4450
+ }
4451
+ ))
4452
+ )
4371
4453
  )
4372
4454
  );
4373
4455
  };