dhre-ui-kit 0.0.153 → 0.0.155

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
@@ -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,
@@ -4245,17 +4252,48 @@ const styles$1 = reactNative.StyleSheet.create({
4245
4252
  appointmentInfo: {
4246
4253
  flex: 1,
4247
4254
  flexDirection: "row",
4248
- justifyContent: "space-between"
4255
+ flexWrap: "wrap",
4256
+ rowGap: verticalScale(16)
4249
4257
  },
4250
4258
  infoColumn: {
4251
- flex: 1,
4259
+ width: "50%",
4252
4260
  rowGap: verticalScale(4)
4253
4261
  },
4262
+ infoRow: {
4263
+ flexDirection: "row",
4264
+ columnGap: horizontalScale(4)
4265
+ },
4254
4266
  locationInfo: {
4255
4267
  rowGap: verticalScale(4)
4256
4268
  },
4257
4269
  getDirectionsText: {
4258
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
+ textAlign: "left"
4288
+ },
4289
+ actionIcons: {
4290
+ flexDirection: "row",
4291
+ columnGap: horizontalScale(16)
4292
+ },
4293
+ iconContainer: {
4294
+ width: moderateScale(32),
4295
+ height: moderateScale(32),
4296
+ borderRadius: moderateScale(25)
4259
4297
  }
4260
4298
  });
4261
4299
 
@@ -4267,11 +4305,18 @@ const AppointmentCard = ({
4267
4305
  title,
4268
4306
  headerTitle,
4269
4307
  headerSubtitle,
4270
- appointmentId,
4271
- requestId,
4272
- location,
4273
- onPress,
4274
- onHeaderPress
4308
+ onViewDetailsPress,
4309
+ statusIcon,
4310
+ infoIcon,
4311
+ deleteIcon,
4312
+ editIcon,
4313
+ onDeletePress,
4314
+ onEditPress,
4315
+ onDirectionPress,
4316
+ data,
4317
+ viewText,
4318
+ info,
4319
+ directionText
4275
4320
  }) => {
4276
4321
  const { theme } = useTheme();
4277
4322
  return /* @__PURE__ */ React__default["default"].createElement(
@@ -4287,93 +4332,125 @@ const AppointmentCard = ({
4287
4332
  borderBottomColor: theme.BORDER_SEPERATOR_HEADER
4288
4333
  },
4289
4334
  headerStyle: styles$1.accordionHeader,
4290
- headerComponent: () => /* @__PURE__ */ React__default["default"].createElement(
4291
- reactNative.Pressable,
4292
- {
4293
- style: styles$1.accordionHeaderContent,
4294
- onPress: onHeaderPress
4295
- },
4296
- headerIcon,
4297
- /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$1.accordionText }, /* @__PURE__ */ React__default["default"].createElement(
4298
- CustomTypography,
4299
- {
4300
- text: headerTitle,
4301
- variant: FontStyle.L2_REGULAR,
4302
- style: { color: theme.CONTENT_SECONDRY }
4303
- }
4304
- ), /* @__PURE__ */ React__default["default"].createElement(
4305
- CustomTypography,
4306
- {
4307
- text: headerSubtitle,
4308
- variant: FontStyle.B3_REGULAR,
4309
- style: { color: theme.CONTENT_PRIMARY }
4310
- }
4311
- ))
4312
- ),
4313
- icon
4314
- },
4315
- /* @__PURE__ */ React__default["default"].createElement(
4316
- reactNative.View,
4317
- {
4318
- style: {
4319
- ...styles$1.accordionDetails,
4320
- borderTopColor: theme.BORDER_SEPERATOR_HEADER
4321
- }
4322
- },
4323
- /* @__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(
4335
+ 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(
4324
4336
  CustomTypography,
4325
4337
  {
4326
- text: "APPOINTMENT ID",
4327
- variant: FontStyle.L3_REGULAR,
4338
+ text: headerTitle,
4339
+ variant: FontStyle.L2_REGULAR,
4328
4340
  style: { color: theme.CONTENT_SECONDRY }
4329
4341
  }
4330
4342
  ), /* @__PURE__ */ React__default["default"].createElement(
4331
4343
  CustomTypography,
4332
4344
  {
4333
- text: appointmentId?.toString(),
4334
- variant: FontStyle.L1_REGULAR,
4345
+ text: headerSubtitle,
4346
+ variant: FontStyle.B3_REGULAR,
4335
4347
  style: { color: theme.CONTENT_PRIMARY }
4336
4348
  }
4337
- )), /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$1.infoColumn }, /* @__PURE__ */ React__default["default"].createElement(
4349
+ ))),
4350
+ icon
4351
+ },
4352
+ /* @__PURE__ */ React__default["default"].createElement(
4353
+ reactNative.View,
4354
+ {
4355
+ style: [
4356
+ styles$1.accordionDetails,
4357
+ { borderTopColor: theme.BORDER_SEPERATOR_HEADER }
4358
+ ]
4359
+ },
4360
+ /* @__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(
4338
4361
  CustomTypography,
4339
4362
  {
4340
- text: "REQUEST ID",
4363
+ text: title2,
4341
4364
  variant: FontStyle.L3_REGULAR,
4342
4365
  style: { color: theme.CONTENT_SECONDRY }
4343
4366
  }
4344
- ), /* @__PURE__ */ React__default["default"].createElement(
4367
+ ), /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$1.infoRow }, isStatus && statusIcon, /* @__PURE__ */ React__default["default"].createElement(
4345
4368
  CustomTypography,
4346
4369
  {
4347
- text: requestId,
4370
+ text: value,
4348
4371
  variant: FontStyle.L1_REGULAR,
4349
- style: { color: theme.CONTENT_PRIMARY }
4372
+ style: {
4373
+ color: isStatus ? theme.WARNING : theme.CONTENT_PRIMARY
4374
+ }
4350
4375
  }
4351
- ))),
4352
- /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$1.locationInfo }, /* @__PURE__ */ React__default["default"].createElement(
4376
+ )), isLocation && /* @__PURE__ */ React__default["default"].createElement(
4353
4377
  CustomTypography,
4354
4378
  {
4355
- text: "LOCATION",
4356
- variant: FontStyle.L3_REGULAR,
4357
- style: { color: theme.CONTENT_SECONDRY }
4379
+ text: directionText,
4380
+ variant: FontStyle.L2_REGULAR,
4381
+ style: [
4382
+ styles$1.getDirectionsText,
4383
+ { color: theme.CONTENT_PRIMARY }
4384
+ ],
4385
+ onPress: onDirectionPress
4358
4386
  }
4359
- ), /* @__PURE__ */ React__default["default"].createElement(
4360
- CustomTypography,
4387
+ )))),
4388
+ /* @__PURE__ */ React__default["default"].createElement(
4389
+ reactNative.View,
4361
4390
  {
4362
- text: location,
4363
- variant: FontStyle.L1_REGULAR,
4364
- style: { color: theme.CONTENT_PRIMARY }
4365
- }
4366
- ), /* @__PURE__ */ React__default["default"].createElement(reactNative.Pressable, { onPress }, /* @__PURE__ */ React__default["default"].createElement(
4367
- CustomTypography,
4391
+ style: [
4392
+ styles$1.infoContainer,
4393
+ {
4394
+ backgroundColor: theme.SURFACE_TERTIARY
4395
+ }
4396
+ ]
4397
+ },
4398
+ infoIcon,
4399
+ /* @__PURE__ */ React__default["default"].createElement(
4400
+ CustomTypography,
4401
+ {
4402
+ text: info,
4403
+ variant: FontStyle.L2_REGULAR,
4404
+ style: { flex: 1, color: theme.CONTENT_SECONDRY }
4405
+ }
4406
+ )
4407
+ ),
4408
+ /* @__PURE__ */ React__default["default"].createElement(
4409
+ reactNative.View,
4368
4410
  {
4369
- text: "Get directions",
4370
- variant: FontStyle.L2_REGULAR,
4371
- style: {
4372
- ...styles$1.getDirectionsText,
4373
- color: theme.CONTENT_PRIMARY
4411
+ style: [
4412
+ styles$1.actionsContainer,
4413
+ {
4414
+ borderTopColor: theme.BORDER_SEPERATOR_HEADER
4415
+ }
4416
+ ]
4417
+ },
4418
+ /* @__PURE__ */ React__default["default"].createElement(
4419
+ CustomTypography,
4420
+ {
4421
+ text: viewText,
4422
+ variant: FontStyle.L2_REGULAR,
4423
+ style: [
4424
+ styles$1.viewText,
4425
+ {
4426
+ color: theme.CONTENT_PRIMARY
4427
+ }
4428
+ ],
4429
+ onPress: onViewDetailsPress
4374
4430
  }
4375
- }
4376
- )))
4431
+ ),
4432
+ /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$1.actionIcons }, /* @__PURE__ */ React__default["default"].createElement(
4433
+ CustomIcon,
4434
+ {
4435
+ icon: deleteIcon,
4436
+ containerStyle: {
4437
+ ...styles$1.iconContainer,
4438
+ backgroundColor: theme.SURFACE_INVERTED
4439
+ },
4440
+ onPress: onDeletePress
4441
+ }
4442
+ ), /* @__PURE__ */ React__default["default"].createElement(
4443
+ CustomIcon,
4444
+ {
4445
+ icon: editIcon,
4446
+ containerStyle: {
4447
+ ...styles$1.iconContainer,
4448
+ backgroundColor: theme.SURFACE_INVERTED
4449
+ },
4450
+ onPress: onEditPress
4451
+ }
4452
+ ))
4453
+ )
4377
4454
  )
4378
4455
  );
4379
4456
  };