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 +17 -6
- package/lib/index.js +172 -90
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +172 -90
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -249,7 +249,7 @@ const ThemeProvider = ({ children }) => {
|
|
|
249
249
|
acc[key] = theme[key][mode];
|
|
250
250
|
return acc;
|
|
251
251
|
}, {});
|
|
252
|
-
return /* @__PURE__ */ React.createElement(ThemeContext.Provider, { value: { theme: filteredTheme } }, children);
|
|
252
|
+
return /* @__PURE__ */ React.createElement(ThemeContext.Provider, { value: { theme: filteredTheme, mode } }, children);
|
|
253
253
|
};
|
|
254
254
|
const useTheme = () => {
|
|
255
255
|
const context = useContext(ThemeContext);
|
|
@@ -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(
|
|
1938
|
-
|
|
1936
|
+
/* @__PURE__ */ React.createElement(
|
|
1937
|
+
Pressable,
|
|
1939
1938
|
{
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
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
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
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,
|
|
@@ -2721,7 +2728,7 @@ const DateRangePicker = (props) => {
|
|
|
2721
2728
|
startDate: "",
|
|
2722
2729
|
endDate: ""
|
|
2723
2730
|
});
|
|
2724
|
-
const { theme } = useTheme();
|
|
2731
|
+
const { theme, mode } = useTheme();
|
|
2725
2732
|
const onDayPress = (day) => {
|
|
2726
2733
|
const { dateString } = day;
|
|
2727
2734
|
const { startDate, endDate } = selectedRange;
|
|
@@ -2745,7 +2752,7 @@ const DateRangePicker = (props) => {
|
|
|
2745
2752
|
start.setDate(start.getDate() + 1);
|
|
2746
2753
|
markedDates[start.toISOString().split("T")[0]] = {
|
|
2747
2754
|
color: theme.SUCCESS,
|
|
2748
|
-
textColor: theme.
|
|
2755
|
+
textColor: theme.CONTENT_INVERTED
|
|
2749
2756
|
};
|
|
2750
2757
|
}
|
|
2751
2758
|
}
|
|
@@ -2754,7 +2761,10 @@ const DateRangePicker = (props) => {
|
|
|
2754
2761
|
startingDay: true,
|
|
2755
2762
|
color: theme.SUCCESS,
|
|
2756
2763
|
textColor: theme.CONTENT_INVERTED,
|
|
2757
|
-
customContainerStyle: { backgroundColor: theme.SURFACE_INVERTED }
|
|
2764
|
+
customContainerStyle: mode === "dark" ? { backgroundColor: theme.SURFACE_INVERTED } : {
|
|
2765
|
+
borderWidth: moderateScale(2),
|
|
2766
|
+
borderColor: theme.SURFACE_PRIMARY
|
|
2767
|
+
}
|
|
2758
2768
|
};
|
|
2759
2769
|
}
|
|
2760
2770
|
if (endDate) {
|
|
@@ -2762,7 +2772,10 @@ const DateRangePicker = (props) => {
|
|
|
2762
2772
|
endingDay: true,
|
|
2763
2773
|
color: theme.SUCCESS,
|
|
2764
2774
|
textColor: theme.CONTENT_INVERTED,
|
|
2765
|
-
customContainerStyle: { backgroundColor: theme.SURFACE_INVERTED }
|
|
2775
|
+
customContainerStyle: mode === "dark" ? { backgroundColor: theme.SURFACE_INVERTED } : {
|
|
2776
|
+
borderWidth: moderateScale(2),
|
|
2777
|
+
borderColor: theme.SURFACE_PRIMARY
|
|
2778
|
+
}
|
|
2766
2779
|
};
|
|
2767
2780
|
}
|
|
2768
2781
|
return markedDates;
|
|
@@ -4206,17 +4219,47 @@ const styles$1 = StyleSheet.create({
|
|
|
4206
4219
|
appointmentInfo: {
|
|
4207
4220
|
flex: 1,
|
|
4208
4221
|
flexDirection: "row",
|
|
4209
|
-
|
|
4222
|
+
flexWrap: "wrap",
|
|
4223
|
+
rowGap: verticalScale(16)
|
|
4210
4224
|
},
|
|
4211
4225
|
infoColumn: {
|
|
4212
|
-
|
|
4226
|
+
width: "50%",
|
|
4213
4227
|
rowGap: verticalScale(4)
|
|
4214
4228
|
},
|
|
4229
|
+
infoRow: {
|
|
4230
|
+
flexDirection: "row",
|
|
4231
|
+
columnGap: horizontalScale(4)
|
|
4232
|
+
},
|
|
4215
4233
|
locationInfo: {
|
|
4216
4234
|
rowGap: verticalScale(4)
|
|
4217
4235
|
},
|
|
4218
4236
|
getDirectionsText: {
|
|
4219
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)
|
|
4220
4263
|
}
|
|
4221
4264
|
});
|
|
4222
4265
|
|
|
@@ -4228,11 +4271,18 @@ const AppointmentCard = ({
|
|
|
4228
4271
|
title,
|
|
4229
4272
|
headerTitle,
|
|
4230
4273
|
headerSubtitle,
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4274
|
+
onViewDetailsPress,
|
|
4275
|
+
statusIcon,
|
|
4276
|
+
infoIcon,
|
|
4277
|
+
deleteIcon,
|
|
4278
|
+
editIcon,
|
|
4279
|
+
onDeletePress,
|
|
4280
|
+
onEditPress,
|
|
4281
|
+
onDirectionPress,
|
|
4282
|
+
data,
|
|
4283
|
+
viewText,
|
|
4284
|
+
info,
|
|
4285
|
+
directionText
|
|
4236
4286
|
}) => {
|
|
4237
4287
|
const { theme } = useTheme();
|
|
4238
4288
|
return /* @__PURE__ */ React.createElement(
|
|
@@ -4248,93 +4298,125 @@ const AppointmentCard = ({
|
|
|
4248
4298
|
borderBottomColor: theme.BORDER_SEPERATOR_HEADER
|
|
4249
4299
|
},
|
|
4250
4300
|
headerStyle: styles$1.accordionHeader,
|
|
4251
|
-
headerComponent: () => /* @__PURE__ */ React.createElement(
|
|
4252
|
-
Pressable,
|
|
4253
|
-
{
|
|
4254
|
-
style: styles$1.accordionHeaderContent,
|
|
4255
|
-
onPress: onHeaderPress
|
|
4256
|
-
},
|
|
4257
|
-
headerIcon,
|
|
4258
|
-
/* @__PURE__ */ React.createElement(View, { style: styles$1.accordionText }, /* @__PURE__ */ React.createElement(
|
|
4259
|
-
CustomTypography,
|
|
4260
|
-
{
|
|
4261
|
-
text: headerTitle,
|
|
4262
|
-
variant: FontStyle.L2_REGULAR,
|
|
4263
|
-
style: { color: theme.CONTENT_SECONDRY }
|
|
4264
|
-
}
|
|
4265
|
-
), /* @__PURE__ */ React.createElement(
|
|
4266
|
-
CustomTypography,
|
|
4267
|
-
{
|
|
4268
|
-
text: headerSubtitle,
|
|
4269
|
-
variant: FontStyle.B3_REGULAR,
|
|
4270
|
-
style: { color: theme.CONTENT_PRIMARY }
|
|
4271
|
-
}
|
|
4272
|
-
))
|
|
4273
|
-
),
|
|
4274
|
-
icon
|
|
4275
|
-
},
|
|
4276
|
-
/* @__PURE__ */ React.createElement(
|
|
4277
|
-
View,
|
|
4278
|
-
{
|
|
4279
|
-
style: {
|
|
4280
|
-
...styles$1.accordionDetails,
|
|
4281
|
-
borderTopColor: theme.BORDER_SEPERATOR_HEADER
|
|
4282
|
-
}
|
|
4283
|
-
},
|
|
4284
|
-
/* @__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(
|
|
4285
4302
|
CustomTypography,
|
|
4286
4303
|
{
|
|
4287
|
-
text:
|
|
4288
|
-
variant: FontStyle.
|
|
4304
|
+
text: headerTitle,
|
|
4305
|
+
variant: FontStyle.L2_REGULAR,
|
|
4289
4306
|
style: { color: theme.CONTENT_SECONDRY }
|
|
4290
4307
|
}
|
|
4291
4308
|
), /* @__PURE__ */ React.createElement(
|
|
4292
4309
|
CustomTypography,
|
|
4293
4310
|
{
|
|
4294
|
-
text:
|
|
4295
|
-
variant: FontStyle.
|
|
4311
|
+
text: headerSubtitle,
|
|
4312
|
+
variant: FontStyle.B3_REGULAR,
|
|
4296
4313
|
style: { color: theme.CONTENT_PRIMARY }
|
|
4297
4314
|
}
|
|
4298
|
-
)),
|
|
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(
|
|
4299
4327
|
CustomTypography,
|
|
4300
4328
|
{
|
|
4301
|
-
text:
|
|
4329
|
+
text: title2,
|
|
4302
4330
|
variant: FontStyle.L3_REGULAR,
|
|
4303
4331
|
style: { color: theme.CONTENT_SECONDRY }
|
|
4304
4332
|
}
|
|
4305
|
-
), /* @__PURE__ */ React.createElement(
|
|
4333
|
+
), /* @__PURE__ */ React.createElement(View, { style: styles$1.infoRow }, isStatus && statusIcon, /* @__PURE__ */ React.createElement(
|
|
4306
4334
|
CustomTypography,
|
|
4307
4335
|
{
|
|
4308
|
-
text:
|
|
4336
|
+
text: value,
|
|
4309
4337
|
variant: FontStyle.L1_REGULAR,
|
|
4310
|
-
style: {
|
|
4338
|
+
style: {
|
|
4339
|
+
color: isStatus ? theme.WARNING : theme.CONTENT_PRIMARY
|
|
4340
|
+
}
|
|
4311
4341
|
}
|
|
4312
|
-
))
|
|
4313
|
-
/* @__PURE__ */ React.createElement(View, { style: styles$1.locationInfo }, /* @__PURE__ */ React.createElement(
|
|
4342
|
+
)), isLocation && /* @__PURE__ */ React.createElement(
|
|
4314
4343
|
CustomTypography,
|
|
4315
4344
|
{
|
|
4316
|
-
text:
|
|
4317
|
-
variant: FontStyle.
|
|
4318
|
-
style:
|
|
4345
|
+
text: directionText,
|
|
4346
|
+
variant: FontStyle.L2_REGULAR,
|
|
4347
|
+
style: [
|
|
4348
|
+
styles$1.getDirectionsText,
|
|
4349
|
+
{ color: theme.CONTENT_PRIMARY }
|
|
4350
|
+
],
|
|
4351
|
+
onPress: onDirectionPress
|
|
4319
4352
|
}
|
|
4320
|
-
),
|
|
4321
|
-
|
|
4353
|
+
)))),
|
|
4354
|
+
/* @__PURE__ */ React.createElement(
|
|
4355
|
+
View,
|
|
4322
4356
|
{
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
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,
|
|
4329
4376
|
{
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
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
|
|
4335
4396
|
}
|
|
4336
|
-
|
|
4337
|
-
|
|
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
|
+
)
|
|
4338
4420
|
)
|
|
4339
4421
|
);
|
|
4340
4422
|
};
|