dhre-ui-kit 0.0.153 → 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.mjs CHANGED
@@ -1899,7 +1899,6 @@ const Accordion = ({
1899
1899
  headerComponent,
1900
1900
  disabled = false,
1901
1901
  icon,
1902
- onHeaderPress,
1903
1902
  titleVariant = "B4_REGULAR"
1904
1903
  }) => {
1905
1904
  const contentRef = useRef(null);
@@ -1934,22 +1933,30 @@ const Accordion = ({
1934
1933
  },
1935
1934
  testID: testId
1936
1935
  },
1937
- /* @__PURE__ */ React.createElement(View, { style: [styles$m.header, headerStyle, disabled && { opacity: 0.5 }] }, headerComponent ? headerComponent() : /* @__PURE__ */ React.createElement(Pressable, { onPress: onHeaderPress }, /* @__PURE__ */ React.createElement(
1938
- CustomTypography,
1936
+ /* @__PURE__ */ React.createElement(
1937
+ Pressable,
1939
1938
  {
1940
- variant: titleVariant,
1941
- text: title,
1942
- style: {
1943
- ...styles$m.title,
1944
- color: theme.CONTENT_PRIMARY,
1945
- ...titleStyle
1939
+ style: [styles$m.header, headerStyle, disabled && { opacity: 0.5 }],
1940
+ onPress: !disabled ? onToggle : void 0
1941
+ },
1942
+ headerComponent ? headerComponent() : /* @__PURE__ */ React.createElement(
1943
+ CustomTypography,
1944
+ {
1945
+ variant: titleVariant,
1946
+ text: title,
1947
+ style: {
1948
+ ...styles$m.title,
1949
+ color: theme.CONTENT_PRIMARY,
1950
+ ...titleStyle
1951
+ }
1946
1952
  }
1947
- }
1948
- )), /* @__PURE__ */ React.createElement(Pressable, { onPress: !disabled ? onToggle : void 0 }, React.cloneElement(icon, {
1949
- width: moderateScale(20),
1950
- height: moderateScale(20),
1951
- style: styles$m.iconStyle
1952
- }))),
1953
+ ),
1954
+ React.cloneElement(icon, {
1955
+ width: moderateScale(20),
1956
+ height: moderateScale(20),
1957
+ style: styles$m.iconStyle
1958
+ })
1959
+ ),
1953
1960
  optionalElement ? optionalElement() : null,
1954
1961
  isOpen && /* @__PURE__ */ React.createElement(Animated.View, { style: [styles$m.content, { height: cardHeight }] }, /* @__PURE__ */ React.createElement(
1955
1962
  View,
@@ -4212,17 +4219,47 @@ const styles$1 = StyleSheet.create({
4212
4219
  appointmentInfo: {
4213
4220
  flex: 1,
4214
4221
  flexDirection: "row",
4215
- justifyContent: "space-between"
4222
+ flexWrap: "wrap",
4223
+ rowGap: verticalScale(16)
4216
4224
  },
4217
4225
  infoColumn: {
4218
- flex: 1,
4226
+ width: "50%",
4219
4227
  rowGap: verticalScale(4)
4220
4228
  },
4229
+ infoRow: {
4230
+ flexDirection: "row",
4231
+ columnGap: horizontalScale(4)
4232
+ },
4221
4233
  locationInfo: {
4222
4234
  rowGap: verticalScale(4)
4223
4235
  },
4224
4236
  getDirectionsText: {
4225
4237
  textDecorationLine: "underline"
4238
+ },
4239
+ infoContainer: {
4240
+ padding: moderateScale(8),
4241
+ flexDirection: "row",
4242
+ columnGap: horizontalScale(8),
4243
+ borderRadius: moderateScale(8)
4244
+ },
4245
+ actionsContainer: {
4246
+ borderTopWidth: 1,
4247
+ paddingTop: verticalScale(16),
4248
+ flexDirection: "row"
4249
+ },
4250
+ viewText: {
4251
+ flex: 1,
4252
+ textDecorationLine: "underline",
4253
+ alignSelf: "center"
4254
+ },
4255
+ actionIcons: {
4256
+ flexDirection: "row",
4257
+ columnGap: horizontalScale(16)
4258
+ },
4259
+ iconContainer: {
4260
+ width: moderateScale(32),
4261
+ height: moderateScale(32),
4262
+ borderRadius: moderateScale(25)
4226
4263
  }
4227
4264
  });
4228
4265
 
@@ -4234,11 +4271,18 @@ const AppointmentCard = ({
4234
4271
  title,
4235
4272
  headerTitle,
4236
4273
  headerSubtitle,
4237
- appointmentId,
4238
- requestId,
4239
- location,
4240
- onPress,
4241
- onHeaderPress
4274
+ onViewDetailsPress,
4275
+ statusIcon,
4276
+ infoIcon,
4277
+ deleteIcon,
4278
+ editIcon,
4279
+ onDeletePress,
4280
+ onEditPress,
4281
+ onDirectionPress,
4282
+ data,
4283
+ viewText,
4284
+ info,
4285
+ directionText
4242
4286
  }) => {
4243
4287
  const { theme } = useTheme();
4244
4288
  return /* @__PURE__ */ React.createElement(
@@ -4254,93 +4298,125 @@ const AppointmentCard = ({
4254
4298
  borderBottomColor: theme.BORDER_SEPERATOR_HEADER
4255
4299
  },
4256
4300
  headerStyle: styles$1.accordionHeader,
4257
- headerComponent: () => /* @__PURE__ */ React.createElement(
4258
- Pressable,
4259
- {
4260
- style: styles$1.accordionHeaderContent,
4261
- onPress: onHeaderPress
4262
- },
4263
- headerIcon,
4264
- /* @__PURE__ */ React.createElement(View, { style: styles$1.accordionText }, /* @__PURE__ */ React.createElement(
4265
- CustomTypography,
4266
- {
4267
- text: headerTitle,
4268
- variant: FontStyle.L2_REGULAR,
4269
- style: { color: theme.CONTENT_SECONDRY }
4270
- }
4271
- ), /* @__PURE__ */ React.createElement(
4272
- CustomTypography,
4273
- {
4274
- text: headerSubtitle,
4275
- variant: FontStyle.B3_REGULAR,
4276
- style: { color: theme.CONTENT_PRIMARY }
4277
- }
4278
- ))
4279
- ),
4280
- icon
4281
- },
4282
- /* @__PURE__ */ React.createElement(
4283
- View,
4284
- {
4285
- style: {
4286
- ...styles$1.accordionDetails,
4287
- borderTopColor: theme.BORDER_SEPERATOR_HEADER
4288
- }
4289
- },
4290
- /* @__PURE__ */ React.createElement(View, { style: styles$1.appointmentInfo }, /* @__PURE__ */ React.createElement(View, { style: styles$1.infoColumn }, /* @__PURE__ */ React.createElement(
4301
+ headerComponent: () => /* @__PURE__ */ React.createElement(View, { style: styles$1.accordionHeaderContent }, headerIcon, /* @__PURE__ */ React.createElement(View, { style: styles$1.accordionText }, /* @__PURE__ */ React.createElement(
4291
4302
  CustomTypography,
4292
4303
  {
4293
- text: "APPOINTMENT ID",
4294
- variant: FontStyle.L3_REGULAR,
4304
+ text: headerTitle,
4305
+ variant: FontStyle.L2_REGULAR,
4295
4306
  style: { color: theme.CONTENT_SECONDRY }
4296
4307
  }
4297
4308
  ), /* @__PURE__ */ React.createElement(
4298
4309
  CustomTypography,
4299
4310
  {
4300
- text: appointmentId?.toString(),
4301
- variant: FontStyle.L1_REGULAR,
4311
+ text: headerSubtitle,
4312
+ variant: FontStyle.B3_REGULAR,
4302
4313
  style: { color: theme.CONTENT_PRIMARY }
4303
4314
  }
4304
- )), /* @__PURE__ */ React.createElement(View, { style: styles$1.infoColumn }, /* @__PURE__ */ React.createElement(
4315
+ ))),
4316
+ icon
4317
+ },
4318
+ /* @__PURE__ */ React.createElement(
4319
+ View,
4320
+ {
4321
+ style: [
4322
+ styles$1.accordionDetails,
4323
+ { borderTopColor: theme.BORDER_SEPERATOR_HEADER }
4324
+ ]
4325
+ },
4326
+ /* @__PURE__ */ React.createElement(View, { style: styles$1.appointmentInfo }, data.map(({ title: title2, value, isLocation, isStatus }) => /* @__PURE__ */ React.createElement(View, { style: styles$1.infoColumn, key: title2 }, /* @__PURE__ */ React.createElement(
4305
4327
  CustomTypography,
4306
4328
  {
4307
- text: "REQUEST ID",
4329
+ text: title2,
4308
4330
  variant: FontStyle.L3_REGULAR,
4309
4331
  style: { color: theme.CONTENT_SECONDRY }
4310
4332
  }
4311
- ), /* @__PURE__ */ React.createElement(
4333
+ ), /* @__PURE__ */ React.createElement(View, { style: styles$1.infoRow }, isStatus && statusIcon, /* @__PURE__ */ React.createElement(
4312
4334
  CustomTypography,
4313
4335
  {
4314
- text: requestId,
4336
+ text: value,
4315
4337
  variant: FontStyle.L1_REGULAR,
4316
- style: { color: theme.CONTENT_PRIMARY }
4338
+ style: {
4339
+ color: isStatus ? theme.WARNING : theme.CONTENT_PRIMARY
4340
+ }
4317
4341
  }
4318
- ))),
4319
- /* @__PURE__ */ React.createElement(View, { style: styles$1.locationInfo }, /* @__PURE__ */ React.createElement(
4342
+ )), isLocation && /* @__PURE__ */ React.createElement(
4320
4343
  CustomTypography,
4321
4344
  {
4322
- text: "LOCATION",
4323
- variant: FontStyle.L3_REGULAR,
4324
- style: { color: theme.CONTENT_SECONDRY }
4345
+ text: directionText,
4346
+ variant: FontStyle.L2_REGULAR,
4347
+ style: [
4348
+ styles$1.getDirectionsText,
4349
+ { color: theme.CONTENT_PRIMARY }
4350
+ ],
4351
+ onPress: onDirectionPress
4325
4352
  }
4326
- ), /* @__PURE__ */ React.createElement(
4327
- CustomTypography,
4353
+ )))),
4354
+ /* @__PURE__ */ React.createElement(
4355
+ View,
4328
4356
  {
4329
- text: location,
4330
- variant: FontStyle.L1_REGULAR,
4331
- style: { color: theme.CONTENT_PRIMARY }
4332
- }
4333
- ), /* @__PURE__ */ React.createElement(Pressable, { onPress }, /* @__PURE__ */ React.createElement(
4334
- CustomTypography,
4357
+ style: [
4358
+ styles$1.infoContainer,
4359
+ {
4360
+ backgroundColor: theme.SURFACE_TERTIARY
4361
+ }
4362
+ ]
4363
+ },
4364
+ infoIcon,
4365
+ /* @__PURE__ */ React.createElement(
4366
+ CustomTypography,
4367
+ {
4368
+ text: info,
4369
+ variant: FontStyle.L2_REGULAR,
4370
+ style: { flex: 1, color: theme.CONTENT_SECONDRY }
4371
+ }
4372
+ )
4373
+ ),
4374
+ /* @__PURE__ */ React.createElement(
4375
+ View,
4335
4376
  {
4336
- text: "Get directions",
4337
- variant: FontStyle.L2_REGULAR,
4338
- style: {
4339
- ...styles$1.getDirectionsText,
4340
- color: theme.CONTENT_PRIMARY
4377
+ style: [
4378
+ styles$1.actionsContainer,
4379
+ {
4380
+ borderTopColor: theme.BORDER_SEPERATOR_HEADER
4381
+ }
4382
+ ]
4383
+ },
4384
+ /* @__PURE__ */ React.createElement(
4385
+ CustomTypography,
4386
+ {
4387
+ text: viewText,
4388
+ variant: FontStyle.L2_REGULAR,
4389
+ style: [
4390
+ styles$1.viewText,
4391
+ {
4392
+ color: theme.CONTENT_PRIMARY
4393
+ }
4394
+ ],
4395
+ onPress: onViewDetailsPress
4341
4396
  }
4342
- }
4343
- )))
4397
+ ),
4398
+ /* @__PURE__ */ React.createElement(View, { style: styles$1.actionIcons }, /* @__PURE__ */ React.createElement(
4399
+ CustomIcon,
4400
+ {
4401
+ icon: deleteIcon,
4402
+ containerStyle: {
4403
+ ...styles$1.iconContainer,
4404
+ backgroundColor: theme.SURFACE_INVERTED
4405
+ },
4406
+ onPress: onDeletePress
4407
+ }
4408
+ ), /* @__PURE__ */ React.createElement(
4409
+ CustomIcon,
4410
+ {
4411
+ icon: editIcon,
4412
+ containerStyle: {
4413
+ ...styles$1.iconContainer,
4414
+ backgroundColor: theme.SURFACE_INVERTED
4415
+ },
4416
+ onPress: onEditPress
4417
+ }
4418
+ ))
4419
+ )
4344
4420
  )
4345
4421
  );
4346
4422
  };